PageSourceSearch

https://us.fusionmap.com/_next/static/chunks/pages/_app-55ab3976f60e19f6.js

js fusionmap.com collected 2026-10-01 01:54:57 UTC 2,560,871 bytes, 289 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="035fb3e0-b43b-4446-94d0-be22ecdfbd57",e._sentryDebugIdIdentifier="sentry-dbid-035fb3e0-b43b-4446-94d0-be22ecdfbd57")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{92:(e,r,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return i(92382)}])},553:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}},604:(e,r,i)=>{"use strict";var n=i(54780),o=i(93710).OrderedSet,a=n.substr,s=o();e.exports=function(e,r){var i=Array(e.length).fill(s);return r&&r.forEach(function(r){for(var n=a(e,0,r.offset).length,o=n+a(e,r.offset,r.length).length;n<o;)i[n]=i[n].add(r.style),n++}),i}},636:(e,r,i)=>{"use strict";var n,o=i(48012),a=i(93710),s=i(12968),l=a.OrderedMap;e.exports={getDirectionMap:function(e,r){n?n.reset():n=new o;var i=e.getBlockMap(),u=i.valueSeq().map(function(e){return s(n).getDirection(e.getText())}),c=l(i.keySeq().zip(u));return null!=r&&a.is(r,c)?r:c}}},1011:(e,r,i)=>{"use strict";var n=i(18916);e.exports=function(e){var r=e.getSelection(),i=r.getEndKey(),o=e.getCurrentContent().getBlockForKey(i).getLength();return n.set(e,{selection:r.merge({anchorKey:i,anchorOffset:o,focusKey:i,focusOffset:o,isBackward:!1}),forceSelection:!0}
1)}},1289:e=>{"use strict";e.exports={initODS:function(){},handleExtensionCausedError:function(){}}},1643:e=>{"use strict";var r=Object.prototype.toString,i=Math.max,n=function(e,r){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<r.length;o+=1)i[o+e.length]=r[o];return i},o=function(e,r){for(var i=[],n=r||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},a=function(e,r){for(var i="",n=0;n<e.length;n+=1)i+=e[n],n+1<e.length&&(i+=r);return i};e.exports=function(e){var s,l=this;if("function"!=typeof l||"[object Function]"!==r.apply(l))throw TypeError("Function.prototype.bind called on incompatible "+l);for(var u=o(arguments,1),c=i(0,l.length-u.length),h=[],p=0;p<c;p++)h[p]="$"+p;if(s=Function("binder","return function ("+a(h,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof s){var r=l.apply(this,n(u,arguments));return Object(r)===r?r:this}return l.apply(e,n(u,arguments))}),l.prototype){var d=function(){};d.prototype=l.prototype,s.prototype=new d,d.prototype=null}return s}},1737:(e,r,i)=>{"use strict";var n=i(28419),o=i(71938),a=i(34140);e.exports=function(){return a(n,o,arguments)}},2002:e=>{"use strict";e.exports=Math.abs},2194:e=>{"use strict";e.exports=function(){function e(e){var r,i;i=void 0,(r="_uri")in this?Object.defineProperty(this,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):this[r]=i,this._uri=e}return e.prototype.toString=function(){return this._uri},e}()}
1,2234:(e,r,i)=>{"use strict";var n=i(60620),o=i(93710).List;e.exports=function(e,r){return o(e.map(function(e,i){var o=r[i];return n.create({style:e,entity:o})}))}},2398:(e,r,i)=>{"use strict";var n=i(37525),o=i(64485);e.exports=function(e){for(var r=e;r&&r!==n(e).documentElement;){var i=o(r);if(null!=i)return i;r=r.parentNode}return null}},2496:e=>{"use strict";e.exports=Math.floor},3566:(e,r,i)=>{"use strict";var n=i(9426);e.exports=function(e){return!!e&&!!e.ownerDocument&&n(e)&&"A"===e.nodeName}},3713:(e,r,i)=>{"use strict";var n=i(9912),o=i(85256),a=i(93710);a.List;var s=a.Map,l=function(e,r,i){if(e){var n=r.get(e);n&&r.set(e,i(n))}},u=function(e,r){var i=[];if(!e)return i;for(var n=r.get(e);n&&n.getParentKey();){var o=n.getParentKey();o&&i.push(o),n=o?r.get(o):null}return i},c=function(e,r){var i=[];if(!e)return i;for(var n=o(e,r);n&&r.get(n);){var a=r.get(n);i.push(n),n=a.getParentKey()?o(a,r):null}return i},h=function(e,r,i){if(!e)return null;for(var n=i.get(e.getKey()).getNextSiblingKey();n&&!r.get(n);)n=i.get(n).getNextSiblingKey()||null;return n},p=function(e,r,i){if(!e)return null;for(var n=i.get(e.getKey()).getPrevSiblingKey();n&&!r.get(n);)n=i.get(n).getPrevSiblingKey()||null;return n},d=function(e,r,i){if(0===r)for(;r<i;)e=e.shift(),r++;else if(i===e.count())for(;i>r;)e=e.pop(),i--;else{var n=e.slice(0,r),o=e.slice(i);e=n.concat(o).toList()}return e};e.exports=function(e,r){if(r.isCollapsed())return e;var i,a,f=e.getBlockMap(),m=r.getStartKey(),g=r.getStartOffset(),_=r.getEndKey(),y=r.getEndOffset(),v=f.get(m),x=f.get(_),b=v instanceof n,w=[];if(b){var E=x.getChildKeys(),S=u(_,f);x.getNextSiblingKey()&&(w=w.concat(S)),E.isEmpty()||(w=w.concat(S.concat([_]))),w=w.concat(u(o(x,f),f))}a=v===x?d(v.getCharacterList(),g,y):v.getCharacterList().slice(0,g).concat(x.getCharacterList().slice(y));var T=v.merge({text:v.getText().slice(0,g)+x.getText().slice(y),characterList:a}),I=b&&0===g&&0===y&&x.getParentKey()===m&&null==x.getPrevSiblingKey()?s([[m,null]]):f.toSeq().skipUntil(function(e,r){return r===m}).takeUntil(function(e,r){return r===_}).filter(function(e,r){return -1===w.indexOf(r)}).concat(s([[_,null]])).map(function(e,r){return r===m?T:null}),M=f.merge(I).filter(function(e){return!!e});return b&&v!==x&&(M=(i=M).withMutations(function(e){if(l(v.getKey(),e,function(r){return r.merge({nextSibling:h(r,e,f),prevSibling:p(r,e,f)})}),l(x.getKey(),e,function(r){return r.merge({nextSibling:h(r,e,f),prevSibling:p(r,e,f)})}),u(v.getKey(),f).forEach(function(r){return l(r,e,function(r){return r.merge({children:r.getChildKeys().filter(function(r){return e.get(r)}),nextSibling:h(r,e,f),prevSibling:p(r,e,f)})})}),l(v.getNextSiblingKey(),e,function(e){return e.merge({prevSibling:v.getPrevSiblingKey()})}),l(v.getPrevSiblingKey(),e,function(r){return r.merge({nextSibling:h(r,e,f)})}),l(x.getNextSiblingKey(),e,function(r){return r.merge({prevSibling:p(r,e,f)})}),l(x.getPrevSiblingKey(),e,function(e){return e.merge({nextSibling:x.getNextSiblingKey()})}),u(x.getKey(),f).forEach(function(r){l(r,e,function(r){return r.merge({children:r.getChildKeys().filter(function(r){return e.get(r)}),nextSibling:h(r,e,f),prevSibling:p(r,e,f)})})}),c(x,f).forEach(function(r){return l(r,e,function(r){return r.merge({nextSibling:h(r,e,f),prevSibling:p(r,e,f)})})}),null==i.get(v.getKey())&&null!=i.get(x.getKey())&&x.getParentKey()===v.getKey()&&null==x.getPrevSiblingKey()){var r=v.getPrevSiblingKey();l(x.getKey(),e,function(e){return e.merge({prevSibling:r})}),l(r,e,function(e){return e.merge({nextSibling:x.getKey()})});var n=r?i.get(r):null,o=n?n.getParentKey():null;if(v.getChildKeys().forEach(function(r){l(r,e,function(e){return e.merge({parent:o})})}),null!=o){var a=i.get(o);l(o,e,function(e){return e.merge({children:a.getChildKeys().concat(v.getChildKeys())})})}l(v.getChildKeys().find(function(e){return null===i.get(e).getNextSiblingKey()}),e,function(e){return e.merge({nextSibling:v.getNextSiblingKey()})})}})),e.merge({blockMap:M,selectionBefore:r,selectionAfter:r.merge({anchorKey:m,anchorOffset:g,focusKey:m,focusOffset:g,isBackward:!1})})}},3774:(e,r,i)=>{"use strict";var n=i(10875);e.exports=function(e,r){var i=r.ownerDocument.defaultView.getSelection(),o=i.anchorNode,a=i.anchorOffset,s=i.focusNode,l=i.focusOffset;return 0===i.rangeCount||null==o||null==s?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:n(e,r,o,a,s,l)}}
1,3792:(e,r,i)=>{"use strict";function n(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}var o=i(18428),a=i(9912),s=i(45288),l=i(44510),u=i(94584);i(18756);var c=i(75269),h=i(2234),p=i(98369),d=i(604),f=i(58217),m=i(58240),g=i(93710),_=i(15796),y=m("draft_tree_data_support"),v=g.List,x=g.Map,b=g.OrderedMap,w=function(e,r){var i=e.key,n=e.type,o=e.data;return{text:e.text,depth:e.depth||0,type:n||"unstyled",key:i||f(),data:x(o),characterList:E(e,r)}},E=function(e,r){var i=e.text,o=e.entityRanges;return h(d(i,e.inlineStyleRanges||[]),p(i,(o||[]).filter(function(e){return r.hasOwnProperty(e.key)}).map(function(e){return n({},e,{key:r[e.key]})})))},S=function(e){return n({},e,{key:e.key||f()})},T=function(e,r,i){var o=r.map(function(e){return n({},e,{parentRef:i})});return e.concat(o.reverse())},I=function(e,r){var i,s=e.blocks.find(function(e){return Array.isArray(e.children)&&e.children.length>0}),l=y&&!s?u.fromRawStateToRawTreeState(e).blocks:e.blocks;return y?l.map(S).reduce(function(e,i,o){Array.isArray(i.children)||_(!1);var s=i.children.map(S),u=new a(n({},w(i,r),{prevSibling:0===o?null:l[o-1].key,nextSibling:o===l.length-1?null:l[o+1].key,children:v(s.map(function(e){return e.key}))}));e=e.set(u.getKey(),u);for(var c=T([],s,u);c.length>0;){var h=c.pop(),p=h.parentRef,d=p.getChildKeys(),f=d.indexOf(h.key),m=Array.isArray(h.children);if(!m){m||_(!1);break}var g=h.children.map(S),y=new a(n({},w(h,r),{parent:p.getKey(),children:v(g.map(function(e){return e.key})),prevSibling:0===f?null:d.get(f-1),nextSibling:f===d.size-1?null:d.get(f+1)}));e=e.set(y.getKey(),y),c=T(c,g,y)}return e},b()):(i=s?u.fromRawTreeStateToRawState(e).blocks:l,b(i.map(function(e){var i=new o(w(e,r));return[i.getKey(),i]})))},M=function(e){var r=e.entityMap,i={};return Object.keys(r).forEach(function(e){var n=r[e],o=n.type,a=n.mutability,s=n.data;i[e]=l.__create(o,a,s||{})}),i};e.exports=function(e){Array.isArray(e.blocks)||_(!1);var r=M(e),i=I(e,r),n=i.isEmpty()?new c:c.createEmpty(i.first().getKey());return new s({blockMap:i,entityMap:r,selectionBefore:n,selectionAfter:n})}},4708:e=>{"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},4821:e=>{"use strict";e.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=16*Math.random()|0;return("x"==e?r:3&r|8).toString(16)})}},4833:e=>{"use strict";e.exports=function(e){return!!e&&!!e.ownerDocument&&(e.ownerDocument.defaultView?e instanceof e.ownerDocument.defaultView.HTMLElement:e instanceof HTMLElement)}},5168:(e,r,i)=>{"use strict";i.d(r,{y:()=>ec});var n=i(99742);let o=Object.create(null),a=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),s=new Proxy(o,{get:(e,r)=>a()[r]??o[r],has:(e,r)=>r in a()||r in o,set:(e,r,i)=>(a(!0)[r]=i,!0),deleteProperty(e,r){if(!r)return!1;let i=a(!0);return delete i[r],!0},ownKeys:()=>Object.keys(a(!0))});function l(e,r){return void 0!==n&&n.env?n.env[e]??r:"u">typeof Deno?Deno.env.get(e)??r:"u">typeof Bun?Bun.env[e]??r:r}void 0!==n&&n.env,Object.freeze({get BETTER_AUTH_SECRET(){return l("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return l("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return l("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return l("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return l("NODE_ENV","development")},get PACKAGE_VERSION(){return l("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return l("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});let u={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PE
1RMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var c=class extends Error{constructor(e="INTERNAL_SERVER_ERROR",r,i={},n="number"==typeof e?e:u[e]){super(r?.message,r?.cause?{cause:r.cause}:void 0),this.status=e,this.body=r,this.headers=i,this.statusCode=n,this.name="APIError",this.status=e,this.headers=i,this.statusCode=n,this.body=r}};Symbol.for("better-call:api-error-headers"),function(e,r){class i extends e{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){const r=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=r}else super(...e);const r=Error().stack;r&&(this.#e=function(e){let r=e.split("\n    at ");return r.length<=1?e:(r.splice(1,1),r.join("\n    at "))}(r.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}Object.defineProperty(i.prototype,"constructor",{get:()=>r,enumerable:!1,configurable:!0})}(c,Error);var h=class extends Error{constructor(e,r){super(e,r),this.name="BetterAuthError",this.message=e,this.stack=""}};function p(e,r="/api/auth"){try{let r=new URL(e);if("http:"!==r.protocol&&"https:"!==r.protocol)throw new h(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(r){if(r instanceof h)throw r;throw new h(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:r})}if(function(e){try{return"/"!==(new URL(e).pathname.replace(/\/+$/,"")||"/")}catch{throw new h(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let i=e.replace(/\/+$/,"");return r&&"/"!==r?(r=r.startsWith("/")?r:`/${r}`,`${i}${r}`):i}let d={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},f=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,m={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},g=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,_={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},y=[],v=0,x=0,b=e=>{let r=[],i={get:()=>(i.lc||i.listen(()=>{})(),i.value),init:e,lc:0,listen:e=>(i.lc=r.push(e),()=>{for(let r=v+4;r<y.length;)y[r]===e?y.splice(r,4):r+=4;let n=r.indexOf(e);~n&&(r.splice(n,1),--i.lc||i.off())}),notify(e,n){x++;let o=!y.length;for(let o of r)y.push(o,i.value,e,n);if(o){for(v=0;v<y.length;v+=4)y[v](y[v+1],y[v+2],y[v+3]);y.length=0}},off(){},set(e){let r=i.value;r!==e&&(i.value=e,i.notify(r))},subscribe(e){let r=i.listen(e);return e(i.value),r},value:e};return i},w=(e,r)=>{var i,n;return i=i=>{let n=r(i);n&&e.events[6].push(n)},n=r=>{let i=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,r()),i(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>
1{if(e.active&&!e.lc){for(let r of(e.active=!1,e.events[6]))r();e.events[6]=[]}},1e3)},()=>{e.listen=i,e.off=n}},e.events=e.events||{},e.events[15]||(e.events[15]=n(r=>{e.events[5].reduceRight((e,r)=>(r(e),e),{shared:{},...r})})),e.events[5]=e.events[5]||[],e.events[5].push(i),()=>{let r=e.events[5],n=r.indexOf(i);r.splice(n,1),r.length||(delete e.events[5],e.events[15](),delete e.events[15])}},E=()=>"u"<typeof window,S=Symbol.for("better-auth:broadcast-channel");var T=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("u">typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let r=JSON.parse(e.newValue??"{}");r?.event==="session"&&r?.data&&this.listeners.forEach(e=>e(r))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function I(e="better-auth.message"){return globalThis[S]||(globalThis[S]=new T(e)),globalThis[S]}let M=Symbol.for("better-auth:focus-manager");var C=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(r=>r(e))}setup(){if("u"<typeof window||"u"<typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function A(){return globalThis[M]||(globalThis[M]=new C),globalThis[M]}let P=Symbol.for("better-auth:online-manager");var L=class{listeners=new Set;isOnline="u"<typeof navigator||navigator.onLine;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(r=>r(e))}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),r=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",r,!1)}}};function O(){return globalThis[P]||(globalThis[P]=new L),globalThis[P]}let D=()=>Math.floor(Date.now()/1e3);function R(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function k(e){if(null===e||"object"!=typeof e)return!1;let r=Object.getPrototypeOf(e);return(null===r||r===Object.prototype||null===Object.getPrototypeOf(r))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function N(e){return(...r)=>r.reduce((r,i)=>(function e(r,i,n=".",o){if(!k(i))return e(r,{},n,o);let a={...i};for(let i of Object.keys(r)){if("__proto__"===i||"constructor"===i)continue;let s=r[i];null!=s&&(o&&o(a,i,s,n)||(Array.isArray(s)&&Array.isArray(a[i])?a[i]=[...s,...a[i]]:k(s)&&k(a[i])?a[i]=e(s,a[i],(n?`${n}.`:"")+i.toString(),o):a[i]=s))}return a})(r,i,"",e),{})}let F=N();N((e,r,i)=>{if(void 0!==e[r]&&"function"==typeof i)return e[r]=i(e[r]),!0}),N((e,r,i)=>{if(Array.isArray(e[r])&&"function"==typeof i)return e[r]=i(e[r]),!0});var z=Object.defineProperty,B=Object.defineProperties,U=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,q=(e,r,i)=>r in e?z(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,H=(e,r)=>{for(var i in r||(r={}))V.call(r,i)&&q(e,i,r[i]);if(j)for(var i of j(r))G.call(r,i)&&q(e,i,r[i]);return e},$=(e,r)=>B(e,U(r)),W=class extends Error{constructor(e,r,i){super(r||e.toString(),{cause:i}),this.status=e,this.statusText=r,this.error=i,Error.captureStackTrace(this,this.constructor)}},Y=async(e,r)=>{var i,n,o,a,s,l;let u=r||{},c={onRequest:[null==r?void 0:r.onRequest],onResponse:[null==r?void 0:r.onResponse],onSuccess:[null==r?void 0:r.onSuccess],onError:[null==r?void 0:r.onError],onRetry:[null==r?void 0:r.onRetry]};if(!r||!(null==r?void 0:r.plugins))return{url:e,options:u,hooks:c};for(let h of(null==r?void 0:r.plugins)||[]){if(h.init){let n=await (null==(i=h.init)?void 0:i.call(h,e.toString(),r));u=n.options||u,e=n.url}c.onRequest.push(null==(n=h.hooks)?void 0:n.onRequest),c.onResponse.push(null==(o=h.hooks)?void 0:o.onResponse),c.onSuccess.push(null==(a=h.hooks)?void 0:a.onSuccess),c.onError.push(null==(s=h.hooks)?void 0:s.onError),c.onRetry.push(null==(l=h.hooks)?void 0:l.onRetry)}return{url:e,options:u,hooks:c}},Z=class{constructor(e){this.options=e}shouldAttemptRetry(e,r){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(r)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},X=class{constructor(e){this.options=e}shouldAttemptRetry(e,r){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(r)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},K=async e=>{let r={},i=async e=>"function"==typeof e?await e():e;
1if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await i(e.auth.token);if(!n)return r;r.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([i(e.auth.username),i(e.auth.password)]);if(!n||!o)return r;r.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([i(e.auth.prefix),i(e.auth.value)]);if(!o)return r;r.authorization=`${null!=n?n:""} ${o}`}}return r},Q=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function J(e){if(void 0===e)return!1;let r=typeof e;return"string"===r||"number"===r||"boolean"===r||null===r||"object"===r&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function ee(e){try{return JSON.parse(e)}catch(r){return e}}function et(e){return"function"==typeof e}async function er(e){let r=new Headers(null==e?void 0:e.headers);for(let[i,n]of Object.entries(await K(e)||{}))r.set(i,n);if(!r.has("content-type")){let i=J(null==e?void 0:e.body)?"application/json":null;i&&r.set("content-type",i)}return r}var ei=class e extends Error{constructor(r,i){super(i||JSON.stringify(r,null,2)),this.issues=r,Object.setPrototypeOf(this,e.prototype)}};async function en(e,r){let i=await e["~standard"].validate(r);if(i.issues)throw new ei(i.issues);return i.value}var eo=["get","post","put","patch","delete"],ea=async(e,r)=>{var i,n,o,a,s,l,u,c;let h,{hooks:p,url:d,options:f}=await Y(e,r),m=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&et(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&et(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(f),g=new AbortController,_=null!=(i=f.signal)?i:g.signal,y=function(e,r){let{baseURL:i,params:n,query:o}=r||{query:{},params:{},baseURL:""},a=e.startsWith("http")?e.split("/").slice(0,3).join("/"):i||"";if(e.startsWith("@")){let r=e.toString().split("@")[1].split("/")[0];eo.includes(r)&&(e=e.replace(`@${r}/`,"/"))}a.endsWith("/")||(a+="/");let[s,l]=e.replace(a,"").split("?"),u=new URLSearchParams(l);for(let[e,r]of Object.entries(o||{})){let i;if(null!=r){if("string"==typeof r)i=r;else if(Array.isArray(r)){for(let i of r)u.append(e,i);continue}else i=JSON.stringify(r);u.set(e,i)}}if(n)if(Array.isArray(n))for(let[e,r]of s.split("/").filter(e=>e.startsWith(":")).entries()){let i=n[e];s=s.replace(r,i)}else for(let[e,r]of Object.entries(n))s=s.replace(`:${e}`,String(r));(s=s.split("/").map(encodeURIComponent).join("/")).startsWith("/")&&(s=s.slice(1));let c=u.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",a.startsWith("http"))?new URL(`${s}${c}`,a):`${a}${s}${c}`}(d,f),v=function(e){if(!(null==e?void 0:e.body))return null;let r=new Headers(null==e?void 0:e.headers);if(J(e.body)&&!r.has("content-type")){for(let[r,i]of Object.entries(null==e?void 0:e.body))i instanceof Date&&(e.body[r]=i.toISOString());return JSON.stringify(e.body)}return r.has("content-type")&&"application/x-www-form-urlencoded"===r.get("content-type")&&J(e.body)?new URLSearchParams(e.body).toString():e.body}(f),x=await er(f),b=function(e,r){var i;if(null==r?void 0:r.method)return r.method.toUpperCase();if(e.startsWith("@")){let n=null==(i=e.split("@")[1])?void 0:i.split("/")[0];return eo.includes(n)?n.toUpperCase():(null==r?void 0:r.body)?"POST":"GET"}return(null==r?void 0:r.body)?"POST":"GET"}(d,f),w=$(H({},f),{url:y,headers:x,body:v,method:b,signal:_});for(let e of p.onRequest)if(e){let r=await e(w);"object"==typeof r&&null!==r&&(w=r)}("pipeTo"in w&&"function"==typeof w.pipeTo||"function"==typeof(null==(n=null==r?void 0:r.body)?void 0:n.pipe))&&!("duplex"in w)&&(w.duplex="half");let{clearTimeout:E}=(!(null==f?void 0:f.signal)&&(null==f?void 0:f.timeout)&&(h=setTimeout(()=>null==g?void 0:g.abort(),null==f?void 0:f.timeout)),{abortTimeout:h,clearTimeout:()=>{h&&clearTimeout(h)}}),S=await m(w.url,w);E();let T={response:S,request:w};for(let e of p.onResponse)if(e){let i=await e($(H({},T),{response:(null==(o=null==r?void 0:r.hookOptions)?void 0:o.cloneResponse)?S.clone():S}));i instanceof Response?S=i:"object"==typeof i&&null!==i&&(S=i.response)}if(S.ok){if("HEAD"===w.method)return{data:"",error:null};let e=function(e){let r=e.headers.get("content-type"),i=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!r)return"json";let n=r.split(";").shift()||"";return Q.test(n)?"json":i.has(n)||n.startsWith("text/")?"text":"blob"}(S),i={data:null,response:S,request:w};if("json"===e||"text"===e){let e=await S.text(),r=null!=(a=w.jsonParser)?a:ee;i.data=await r(e)}else i.data=await S[e]();for(let e of((null==w?void 0:w.output)&&w.output&&!w.disableValidation&&(i.data=await en(w.output,i.data)),p.onSuccess))e&&await e($(H({},i),{response:(null==(s=null==r?void 0:r.hookOptions)?void 0:s.cloneResponse)?S.clone():S}));return(null==r?void 0:r.throw)?i.data:{data:i.data,error:null}}let I=null!=(l=null==r?void 0:r.jsonParser)?l:ee,M=await S.text(),C=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(M),A=C?await I(M):null,P={response:S,responseText:M,request:w,error:$(H({},A),{status:S.status,statusText:S.statusText})};for(let e of p.onError)e&&await e($(H({},P),{response:(null==(u=null==r?void 0:r.hookOptions)?void 0:u.cloneResponse)?S.clone():S}));if(null==r?void 0:r.retry){let i=function(e){if("number"==typeof e)return new Z({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new Z(e);case"exponential":return new X(e);default:throw Error("Invalid retry strategy")}}(r.retry),n=null!=(c=r.retryAttempt)?c:0;if(await i.shouldAttemptRetry(n,S)){for(let e of p.onRetry)e&&await e(T);let o=i.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await ea(e,$(H({},r),{retryAttempt:n+1}))}}if(null==r?void 0:r.throw)throw new W(S.status,S.statusText,C?A:M);return{data:null,error:$(H({},A),{status:S.status,statusText:S.statusText})}},es=i(99742),el=i(14232),eu=i(84412);let ec=function(e){var r;let{pluginPathMethods:i,pluginsActions:n,pluginsAtoms:o,$fetch:a,$store:l,atomListeners:u}=(e=>{var r;let i,n,o,a="credentials"in Request.prototype,l=function(e,r,i,n){if(e)return p(e,r);if(!1!==n){let e=s.BETTER_AUTH_URL||s.NEXT_PUBLIC_BETTER_AUTH_URL||s.PUBLIC_BETTER_AUTH_URL||s.NUXT_PUBLIC_BETTER_AUTH_URL||s.NUXT_PUBLIC_AUTH_URL||("/"!==s.BASE_URL?s.BASE_URL:void 0);if(e)return p(e,r)}i?.headers.get("x-forwarded-host"),i?.headers.get("x-forwarded-proto");if(i){let e=function(e){try{let r=new URL(e);return"null"===r.origin?null:r.origin}catch{return null}}(i.url);if(!e)throw new h("Could not get origin from request. Please provide a valid base URL.");return p(e,r)}if("u">typeof window&&window.location)return p(window.location.origin,r)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==es){if(es.env.NEXT_PUBLIC_AUTH_URL)return es.env.NEXT_PUBLIC_AUTH_URL;if("u"<typeof window){if(es.env.NEXTAUTH_URL)try{return es.env.NEXTAUTH_URL}catch{}if(es.env.VERCEL_URL)try{let r=es.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${r}${es.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",u=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],c={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:y,onError:v,onRequest:x,onResponse:S,...T}=e?.fetchOptions||{},M=(r={baseURL:l,...a?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,r={strict:!0}){return function(e,r={}){let{strict:i=!1,warnings:n=!1,reviver:o,parseDates:a=!0}=r;if("string"!=typeof e)return e;let s=e.trim();if(s.length>0&&'"'===s[0]&&s.endsWith('"')&&!s.slice(1,-1).includes('"'))return s.slice(1,-1);let l=s.toLowerCase();if(l.length<=9&&l in m)return m[l];
1if(!f.test(s)){if(i)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(d).some(([e,r])=>{let i=r.test(s);return i&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),i})&&i)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(s,(e,r)=>{if("__proto__"===e||"constructor"===e&&r&&"object"==typeof r&&"prototype"in r){n&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&"string"==typeof r){let e=function(e){let r=g.exec(e);if(!r)return null;let[,i,n,o,a,s,l,u,c,h,p]=r,d=new Date(Date.UTC(parseInt(i,10),parseInt(n,10)-1,parseInt(o,10),parseInt(a,10),parseInt(s,10),parseInt(l,10),u?parseInt(u.padEnd(3,"0"),10):0));if(c){let e=(60*parseInt(h,10)+parseInt(p,10))*("+"===c?-1:1);d.setUTCMinutes(d.getUTCMinutes()+e)}return d instanceof Date&&!isNaN(d.getTime())?d:null}(r);if(e)return e}return o?o(e,r):r})}catch(r){if(i)throw r;return e}}(e,r)}(e,{strict:!1}):null,customFetchImpl:fetch,...T,plugins:[c,...T.plugins||[],...e?.disableDefaultFetchPlugins?[]:[_],...u]},async function(e,i){let n,o=$(H(H({},r),i),{plugins:[...(null==r?void 0:r.plugins)||[],(n=r||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,r){var i,o,a,s;let l=(null==(o=null==(i=n.plugins)?void 0:i.find(r=>{var i;return null!=(i=r.schema)&&!!i.config&&(e.startsWith(r.schema.config.baseURL||"")||e.startsWith(r.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(l){let i=e;(null==(a=l.config)?void 0:a.prefix)&&i.startsWith(l.config.prefix)&&(i=i.replace(l.config.prefix,""),l.config.baseURL&&(e=e.replace(l.config.prefix,l.config.baseURL))),(null==(s=l.config)?void 0:s.baseURL)&&i.startsWith(l.config.baseURL)&&(i=i.replace(l.config.baseURL,""));let n=l.schema[i];if(n){let i=$(H({},r),{method:n.method,output:n.output});return(null==r?void 0:r.disableValidation)||(i=$(H({},i),{body:n.input?await en(n.input,null==r?void 0:r.body):null==r?void 0:r.body,params:n.params?await en(n.params,null==r?void 0:r.params):null==r?void 0:r.params,query:n.query?await en(n.query,null==r?void 0:r.query):null==r?void 0:r.query})),{url:e,options:i}}}return{url:e,options:r}}}),...(null==i?void 0:i.plugins)||[]]});if(null==r?void 0:r.catchAllError)try{return await ea(e,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await ea(e,o)}),{$sessionSignal:C,session:P,broadcastSessionUpdate:L}=(n=((e,r,i,n)=>{let o=b({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)}),a=async e=>new Promise(a=>{let s="function"==typeof n?n({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):n;i(r,{...s,query:{...s?.query,...e?.query},async onSuccess(e){o.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await s?.onSuccess?.(e)},async onError(e){let{request:r}=e,i="number"==typeof r.retry?r.retry:r.retry?.attempts,n=r.retryAttempt||0;if(i&&n<i)return;let a=401===e.error.status;o.set({error:e.error,data:a?null:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await s?.onError?.(e)},async onRequest(e){let r=o.get();o.set({isPending:null===r.data,data:r.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await s?.onRequest?.(e)}}).catch(e=>{o.set({error:e,data:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let s=!1;for(let r of e)r.subscribe(async()=>{E()||(s?await a():w(o,()=>{let e=setTimeout(async()=>{s||(await a(),s=!0)},0);return()=>{o.off(),r.off(),clearTimeout(e)}}))});return o})(i=b(!1),"/get-session",M,{method:"GET"}),o=()=>{},w(n,()=>{let r=function(e){let{sessionAtom:r,sessionSignal:i,$fetch:n,options:o={}}=e,a=o.sessionOptions?.refetchInterval??0,s=o.sessionOptions?.refetchOnWindowFocus??!0,l=o.sessionOptions?.refetchWhenOffline??!1,u={lastSync:0,lastSessionRequest:0,cachedSession:void 0},c=e=>{if(!(l||O().isOnline))return;if(e?.event==="storage"){u.lastSync=D(),i.set(!i.get());return}let o=r.get(),a=()=>{u.lastSessionRequest=D(),n("/get-session").then(async e=>{let{data:a,error:s}=R(e);if(a?.needsRefresh)try{let e=await n("/get-session",{method:"POST"});({data:a,error:s}=R(e))}catch{}let l=a?.session&&a?.user?a:null;r.set({...o,data:l,error:s}),u.lastSync=D(),i.set(!i.get())}).catch(()=>{})};if(e?.event==="poll")return void a();if(e?.event==="visibilitychange"){if(D()-u.lastSessionRequest<5)return;u.lastSessionRequest=D()}e?.event==="visibilitychange"?a():(o?.data===null||o?.data===void 0)&&(u.lastSync=D(),i.set(!i.get()))};return{init:()=>{a&&a>0&&(u.pollInterval=setInterval(()=>{r.get()?.data&&c({event:"poll"})},1e3*a)),u.unsubscribeBroadcast=I().subscribe(()=>{c({event:"storage"})}),s&&(u.unsubscribeFocus=A().subscribe(()=>{c({event:"visibilitychange"})})),u.unsubscribeOnline=O().subscribe(e=>{e&&c({event:"visibilitychange"})}),I().setup(),A().setup(),O().setup()},cleanup:()=>{u.pollInterval&&(clearInterval(u.pollInterval),u.pollInterval=void 0),u.unsubscribeBroadcast&&(u.unsubscribeBroadcast(),u.unsubscribeBroadcast=void 0),u.unsubscribeFocus&&(u.unsubscribeFocus(),u.unsubscribeFocus=void 0),u.unsubscribeOnline&&(u.unsubscribeOnline(),u.unsubscribeOnline=void 0),u.lastSync=0,u.lastSessionRequest=0,u.cachedSession=void 0},triggerRefetch:c,broadcastSessionUpdate:e=>{I().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({sessionAtom:n,sessionSignal:i,$fetch:M,options:e});return r.init(),o=r.broadcastSessionUpdate,()=>{r.cleanup()}}),{session:n,$sessionSignal:i,broadcastSessionUpdate:e=>o(e)}),k=e?.plugins||[],N={},z={$sessionSignal:C,session:P}
1,B={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},U=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||"/update-session"===e||"/sign-up/email"===e||"/sign-in/email"===e||"/delete-user"===e||"/verify-email"===e||"/revoke-sessions"===e||"/revoke-session"===e||"/change-email"===e,callback(e){"/sign-out"===e?L("signout"):("/update-user"===e||"/update-session"===e)&&L("updateUser")}}];for(let e of k)e.getAtoms&&Object.assign(z,e.getAtoms?.(M)),e.pathMethods&&Object.assign(B,e.pathMethods),e.atomListeners&&U.push(...e.atomListeners);let j={notify:e=>{z[e].set(!z[e].get())},listen:(e,r)=>{z[e].subscribe(r)},atoms:z};for(let r of k)r.getActions&&(N=F(r.getActions?.(M,j,e)??{},N));return{get baseURL(){return l},pluginsActions:N,pluginsAtoms:z,pluginPathMethods:B,atomListeners:U,$fetch:M,$store:j}})(e),c={};for(let[e,r]of Object.entries(o))c[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,r={}){let i=(0,el.useRef)(e.get()),{keys:n,deps:o=[e,n]}=r,a=(0,el.useCallback)(r=>{let o=e=>{i.current!==e&&(i.current=e,r())};if(o(e.value),n?.length){let r;return r=new Set(n).add(void 0),e.listen((e,i,n)=>{r.has(n)&&o(e)})}return e.listen(o)},o),s=()=>i.current;return(0,el.useSyncExternalStore)(a,s,s)})(r);return r={...n,...c,$fetch:a,$store:l},function e(n=[]){return new Proxy(function(){},{get(i,o){var a;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let s=[...n,o],l=r;for(let e of s)if(l&&"object"==typeof l&&e in l)l=l[e];else{l=void 0;break}return"function"==typeof l?l:"object"==typeof(a=l)&&null!==a&&"get"in a&&"function"==typeof a.get&&"lc"in a&&"number"==typeof a.lc?l:e(s)},apply:async(e,r,s)=>{let l="/"+n.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join("/"),c=s[0]||{},h=s[1]||{},{query:p,fetchOptions:d,...f}=c,m={...h,...d},g=function(e,r,i){let n=r[e],{fetchOptions:o,query:a,...s}=i||{};return n||(o?.method?o.method:s&&Object.keys(s).length>0?"POST":"GET")}(l,i,c);return await a(l,{...m,body:"GET"===g?void 0:{...f,...m?.body||{}},query:p||m?.query,method:g,async onSuccess(e){if(await m?.onSuccess?.(e),!u||m.disableSignal)return;let r=u.filter(e=>e.matcher(l));if(!r.length)return;let i=new Set;for(let e of r){let r=o[e.signal];if(!r)return;if(i.has(e.signal))continue;i.add(e.signal);let n=r.get();setTimeout(()=>{r.set(!n)},10),e.callback?.(l)}}})}})}()}({baseURL:`${eu.fn}/auth-v2`,fetchOptions:{credentials:"include"},plugins:[{id:"additional-fields-client",version:"1.6.2",$InferServerPlugin:{}}]})},5373:(e,r,i)=>{"use strict";var n=i(18916),o=i(39052);e.exports=function(e,r){var i=e._latestEditorState,a=i.getSelection();if(!a.getHasFocus()){var s=a.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(r),o.isBrowser("Chrome < 60.0.3081.0")?e.update(n.forceSelection(i,s)):e.update(n.acceptSelection(i,s))}}},5391:e=>{"use strict";e.exports=EvalError},5686:(e,r,i)=>{"use strict";var n=i(39052),o=i(15796),a=n.isBrowser("IE <= 9");e.exports=function(e){var r,i=null;return!a&&document.implementation&&document.implementation.createHTMLDocument&&((r=document.implementation.createHTMLDocument("foo")).documentElement||o(!1),r.documentElement.innerHTML=e,i=r.getElementsByTagName("body")[0]),i}},5733:e=>{"use strict";e.exports=function(e,r,i){var n=e;if(i===n.count())r.forEach(function(e){n=n.push(e)});else if(0===i)r.reverse().forEach(function(e){n=n.unshift(e)});else{var o=n.slice(0,i),a=n.slice(i);n=o.concat(r,a).toList()}return n}},5819:(e,r,i)=>{"use strict";e.exports=o,e.exports.default=o;var n=i(97487);function o(e,r){if(!(this instanceof o))return new o(e,r);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),r&&this._initFormat(r),this.clear()}function a(e,r){s(e,0,e.children.length,r,e)}function s(e,r,i,n,o){o||(o=m(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var a,s=r;s<i;s++)a=e.children[s],l(o,e.leaf?n(a):a);return o}function l(e,r){return e.minX=Math.min(e.minX,r.minX),e.minY=Math.min(e.minY,r.minY),e.maxX=Math.max(e.maxX,r.maxX),e.maxY=Math.max(e.maxY,r.maxY),e}function u(e,r){return e.minX-r.minX}function c(e,r){return e.minY-r.minY}function h(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function d(e,r){return e.minX<=r.minX&&e.minY<=r.minY&&r.maxX<=e.maxX&&r.maxY<=e.maxY}function f(e,r){return r.minX<=e.maxX&&r.minY<=e.maxY&&r.maxX>=e.minX&&r.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,r,i,o,a){for(var s,l=[r,i];l.length;)(i=l.pop())-(r=l.pop())<=o||(n(e,s=r+Math.ceil((i-r)/o/2)*o,r,i,a),l.push(r,s,s,i))}o.prototype={all:function(){return this._all(this.data,[])},search:function(e){var r=this.data,i=[],n=this.toBBox;if(!f(e,r))return i;for(var o,a,s,l,u=[];r;){for(o=0,a=r.children.length;o<a;o++)s=r.children[o],f(e,l=r.leaf?n(s):s)&&(r.leaf?i.push(s):d(e,l)?this._all(s,i):u.push(s));r=u.pop()}return i},collides:function(e){var r=this.data,i=this.toBBox;if(!f(e,r))return!1;for(var n,o,a,s,l=[];r;){for(n=0,o=r.children.length;n<o;
1n++)if(a=r.children[n],f(e,s=r.leaf?i(a):a)){if(r.leaf||d(e,s))return!0;l.push(a)}r=l.pop()}return!1},load:function(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(var r=0,i=e.length;r<i;r++)this.insert(e[r]);return this}var n=this._build(e.slice(),0,e.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 o=this.data;this.data=n,n=o}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(e,r){if(!e)return this;for(var i,n,o,a,s=this.data,l=this.toBBox(e),u=[],c=[];s||u.length;){if(s||(s=u.pop(),n=u[u.length-1],i=c.pop(),a=!0),s.leaf&&-1!==(o=function(e,r,i){if(!i)return r.indexOf(e);for(var n=0;n<r.length;n++)if(i(e,r[n]))return n;return -1}(e,s.children,r))){s.children.splice(o,1),u.push(s),this._condense(u);break}!a&&!s.leaf&&d(s,l)?(u.push(s),c.push(i),i=0,n=s,s=s.children[0]):n?(i++,s=n.children[i],a=!1):s=null}return this},toBBox:function(e){return e},compareMinX:u,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,r){for(var i=[];e;)e.leaf?r.push.apply(r,e.children):i.push.apply(i,e.children),e=i.pop();return r},_build:function(e,r,i,n){var o,s=i-r+1,l=this._maxEntries;if(s<=l)return a(o=m(e.slice(r,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(s)/Math.log(l)),l=Math.ceil(s/Math.pow(l,n-1))),(o=m([])).leaf=!1,o.height=n;var u,c,h,p,d=Math.ceil(s/l),f=d*Math.ceil(Math.sqrt(l));for(g(e,r,i,f,this.compareMinX),u=r;u<=i;u+=f)for(h=Math.min(u+f-1,i),g(e,u,h,d,this.compareMinY),c=u;c<=h;c+=d)p=Math.min(c+d-1,h),o.children.push(this._build(e,c,p,n-1));return a(o,this.toBBox),o},_chooseSubtree:function(e,r,i,n){for(var o,a,s,l,u,c,p,d,f,m;n.push(r),!r.leaf&&n.length-1!==i;){for(p=d=1/0,o=0,a=r.children.length;o<a;o++){u=h(s=r.children[o]),(c=(f=e,(Math.max((m=s).maxX,f.maxX)-Math.min(m.minX,f.minX))*(Math.max(m.maxY,f.maxY)-Math.min(m.minY,f.minY))-u))<d?(d=c,p=u<p?u:p,l=s):c===d&&u<p&&(p=u,l=s)}r=l||r.children[0]}return r},_insert:function(e,r,i){var n=this.toBBox,o=i?e:n(e),a=[],s=this._chooseSubtree(o,this.data,r,a);for(s.children.push(e),l(s,o);r>=0;)if(a[r].children.length>this._maxEntries)this._split(a,r),r--;else break;this._adjustParentBBoxes(o,a,r)},_split:function(e,r){var i=e[r],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),l=m(i.children.splice(s,i.children.length-s));l.height=i.height,l.leaf=i.leaf,a(i,this.toBBox),a(l,this.toBBox),r?e[r-1].children.push(l):this._splitRoot(i,l)},_splitRoot:function(e,r){this.data=m([e,r]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,r,i){var n,o,a,l,u,c,p,d;for(c=p=1/0,n=r;n<=i-r;n++)l=function(e,r){var i=Math.max(e.minX,r.minX),n=Math.max(e.minY,r.minY);return Math.max(0,Math.min(e.maxX,r.maxX)-i)*Math.max(0,Math.min(e.maxY,r.maxY)-n)}(o=s(e,0,n,this.toBBox),a=s(e,n,i,this.toBBox)),u=h(o)+h(a),l<c?(c=l,d=n,p=u<p?u:p):l===c&&u<p&&(p=u,d=n);return d},_chooseSplitAxis:function(e,r,i){var n=e.leaf?this.compareMinX:u,o=e.leaf?this.compareMinY:c;this._allDistMargin(e,r,i,n)<this._allDistMargin(e,r,i,o)&&e.children.sort(n)},_allDistMargin:function(e,r,i,n){e.children.sort(n);var o,a,u=this.toBBox,c=s(e,0,r,u),h=s(e,i-r,i,u),d=p(c)+p(h);for(o=r;o<i-r;o++)a=e.children[o],l(c,e.leaf?u(a):a),d+=p(c);for(o=i-r-1;o>=r;o--)a=e.children[o],l(h,e.leaf?u(a):a),d+=p(h);return d},_adjustParentBBoxes:function(e,r,i){for(var n=i;n>=0;n--)l(r[n],e)},_condense:function(e){for(var r,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(r=e[i-1].children).splice(r.indexOf(e[i]),1):this.clear():a(e[i],this.toBBox)},_initFormat:function(e){var r=["return a"," - b",";"];this.compareMinX=Function("a","b",r.join(e[0])),this.compareMinY=Function("a","b",r.join(e[1])),this.toBBox=Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},5870:(e,r,i)=>{"use strict";var n=i(76184),o=n.eudist,a=n.dist;e.exports={kmrand:function(e,r){for(var i={},n=[],o=r<<2,a=e.length,s=e[0].length>0;n.length<r&&o-- >0;){var l=e[Math.floor(Math.random()*a)],u=s?l.join("_"):""+l;i[u]||(i[u]=!0,n.push(l))}if(!(n.length<r))return n;
1throw Error("Error initializating clusters")},kmpp:function(e,r){var i=e[0].length?o:a,n=[],s=e.length,l=e[0].length>0,u=e[Math.floor(Math.random()*s)];for(l&&u.join("_"),n.push(u);n.length<r;){for(var c=[],h=n.length,p=0,d=[],f=0;f<s;f++){for(var m=1/0,g=0;g<h;g++){var _=i(e[f],n[g]);_<=m&&(m=_)}c[f]=m}for(var y=0;y<s;y++)p+=c[y];for(var v=0;v<s;v++)d[v]={i:v,v:e[v],pr:c[v]/p,cs:0};d.sort(function(e,r){return e.pr-r.pr}),d[0].cs=d[0].pr;for(var x=1;x<s;x++)d[x].cs=d[x-1].cs+d[x].pr;for(var b=Math.random(),w=0;w<s-1&&d[w++].cs<b;);n.push(d[w-1].v)}return n}}},5913:(e,r,i)=>{"use strict";i.d(r,{T:()=>h});var n=i(80856),o=i(14104),a=i(9380);let s=[],l=[],u=!1,c=async(e,r,i=!1)=>{if(u||0===l.length)return[];let{resolve:h}=l.shift();u=!0;let p=[];try{s=p=await (0,a.i2)(n.nW.complete,r,i),(0,o.$c)(r,p,e),(0,o.G4)(r,p,e)}finally{u=!1,h(p),c(e,r,i)}},h=async(e,r,i=!1)=>{for(;l.length>0;){let{resolve:e}=l.shift();e(s)}return l=[],new Promise(n=>{l.push({resolve:n}),c(e,r,i)})}},6507:(e,r,i)=>{"use strict";i.d(r,{CP:()=>u,Uh:()=>s,nt:()=>l});var n=i(37876),o=i(97984),a=i(39149);let s="50vh",l="360px";function u({sidePanelOpen:e,contentStack:r,closePanel:i,beta:c,closingSubPage:h,sidePanelActionButtons:p,goBack:d,lastAction:f}){let m=(0,o.W)(),g=r[r.length-1],_=r.length>1;return(0,n.jsx)("div",{className:`
2                fixed z-50 bg-white shadow-lg text-black transition-transform duration-150 ease-in-out right-0
3                ${e?"translate-y-0 translate-x-0":m?"translate-y-full":"translate-x-full"}
4                ${m?"bottom-0 left-0":"top-0"}
5            `,style:{transformOrigin:m?"bottom":"right",height:m?s:"100%",width:m?"100%":l},children:(0,n.jsxs)("div",{className:"flex flex-col h-full overflow-hidden relative",children:[(0,n.jsxs)("div",{className:"flex items-center border-b h-12 border-black/10 bg-white z-30",children:[(0,n.jsx)("button",{onClick:()=>{i(),g.onClose?.()},className:"cursor-pointer h-full w-12 shrink-0 flex items-center justify-center border-r border-black/10 hover:bg-gray-200 transition",children:m?(0,n.jsx)(a.tEr,{className:"w-5 h-5"}):(0,n.jsx)(a.xyO,{className:"w-5 h-5"})}),(0,n.jsxs)("div",{className:"flex w-full justify-between items-center gap-2 text-lg font-semibold ml-3",children:[(0,n.jsxs)("span",{className:"flex gap-2 items-center",children:[r[0]?.title??"Panel",c&&(0,n.jsx)("div",{className:"beta-tag",children:"BETA"})]}),(0,n.jsx)("div",{className:"flex items-center gap-2 mr-3",children:g?.actionButtons==null?_?null:p:g.actionButtons})]})]}),(0,n.jsx)("div",{className:"h-[calc(100%-48px)] relative overflow-hidden",children:r.map(({content:e,onClose:i},o)=>{let a=o===r.length-1,s=o>0,l="";return a&&(h?l=m?"animate-slide-out-y":"animate-slide-out-x":s&&"push"===f&&(l=m?"animate-slide-in-y":"animate-slide-in-x")),(0,n.jsx)("div",{className:`
6                                    absolute inset-0 bg-white transition-all overflow-hidden
7                                    ${a?"z-20":"z-10"}
8                                    ${l}
9                                `,children:(0,n.jsxs)("div",{className:r[o]?.fullWidth?"h-full w-full flex flex-col min-h-0":"p-4 h-full w-full flex flex-col min-h-0",style:{overflowY:r[o]?.scrollable===!1?"hidden":"auto"},children:[s&&(0,n.jsxs)("div",{className:"flex flex-row  justify-between items-center pb-2 mb-4 border-b border-b-black/10",children:[(0,n.jsx)("span",{className:"font-bold text-lg flex flex-row items-center gap-3",children:g?.title||"Panel"}),(0,n.jsx)("button",{className:"btn btn-sm btn-circle btn-ghost",id:"close-add-layer",onClick:()=>{i?.(),d()},children:"✕"})]}),"function"==typeof e?e():e]})},o)})})]})})}},6656:(e,r,i)=>{"use strict";i.d(r,{A:()=>h});var n,o={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function a(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.width?String(r.width):e.defaultWidth;return e.formats[i]||e.formats[e.defaultWidth]}}var s={date:a({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:a({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:a({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},l={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function u(e){return function(r,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=i&&i.width?String(i.width):o;n=e.formattingValues[a]||e.formattingValues[o]}else{var s=e.defaultWidth,l=null!=i&&i.width?String(i.width):e.defaultWidth;n=e.values[l]||e.values[s]}return n[e.argumentCallback?e.argumentCallback(r):r]}}function c(e){return function(r){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=r.match(a);if(!s)return null;var l=s[0],u=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(u)?function(e,r){for(var i=0;i<e.length;i++)if(r(e[i]))return i}(u,function(e){return e.test(l)}):function(e,r){for(var i in e)if(e.hasOwnProperty(i)&&r(e[i]))return i}(u,function(e){return e.test(l)});return i=e.valueCallback?e.valueCallback(c):c,{value:i=n.valueCallback?n.valueCallback(i):i,rest:r.slice(l.length)}}}let h={code:"en-US",formatDistance:function(e,r,i){var n,a=o[e];if(n="string"==typeof a?a:1===r?a.one:a.other.replace("{{count}}",r.toString()),null!=i&&i.addSuffix)if(i.comparison&&i.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:s,formatRelative:function(e,r,i,n){return l[e]},localize:{ordinalNumber:function(e,r){var i=Number(e),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:u({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:u({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:u({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:u({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
9ay","Saturday"]},defaultWidth:"wide"}),dayPeriod:u({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(n={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.match(n.matchPattern);if(!i)return null;var o=i[0],a=e.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:e.slice(o.length)}}),era:c({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:c({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:c({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:c({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}}},7075:(e,r,i)=>{"use strict";function n(e){if(null===e||!0===e||!1===e)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}i.d(r,{A:()=>n})},7121:(e,r,i)=>{"use strict";i.d(r,{gb:()=>f,Is:()=>m,US:()=>g});var n=i(85428),o=i(80856),a=i(22629),s=i(83964);let l={[o.ly.NORMAL]:{[o.S3.POINT]:[o.jw.ICON,o.jw.RED_DOT],[o.S3.CLUSTER]:[o.jw.CLUSTER_TEXT,o.jw.CLUSTER_CIRCLE],[o.S3.POLYGON]:[o.jw.POLYGON,o.jw.POLYGON_ICON,o.jw.POLYGON_OUTLINE]}},u=Object.entries(l).reduce((e,[r,i])=>(Object.values(i).forEach(i=>{i.forEach(i=>{e[i]=r})}),e),{}),c=e=>{let r=(0,a.YN)(`${u[e]}-layer`,(0,n.Ky)().project_uuid);return null===r||r?"visible":"none"},h=Object.values(o.S3),p=Object.values(o.ly),d=(e,r)=>{e.current.getLayer(r)&&e.current.removeLayer(r),e.current.addLayer(r===o.jw.ICON||r===o.jw.POLYGON_ICON?{id:r,type:"symbol",source:u[r],layout:{"icon-image":["match",["get","verified"],"true","alert-verified-marker","alert-marker"],"icon-size":.9,"icon-allow-overlap":!0,visibility:c(r)}
9,filter:["all",["==",["geometry-type"],"Point"],r===o.jw.POLYGON_ICON?["==",["get","is_polygon_icon"],!0]:["!=",["get","is_polygon_icon"],!0],["!=",["get","cluster"],!0]]}:r===o.jw.RED_DOT?{id:r,type:"symbol",source:u[r],layout:{"icon-image":"red-dot","icon-size":.2,"icon-offset":[30,-30],"icon-allow-overlap":!0,visibility:c(r)},filter:["all",["==",["geometry-type"],"Point"],["!=",["get","is_polygon_icon"],!0],["!=",["get","cluster"],!0],[">",["length",["get","notification_ids"]],0]]}:r===o.jw.POLYGON?{id:r,type:"fill",source:u[r],layout:{visibility:c(r)},paint:{"fill-color":["match",["get","verified"],"true","rgba(255, 0, 0, 0.2)","rgba(239, 218, 58, 0.2)"],"fill-outline-color":["match",["get","verified"],"true","rgba(255, 0, 0, 1)","rgba(180, 160, 5, 1)"]},filter:["==","$type","Polygon"]}:r===o.jw.POLYGON_OUTLINE?{id:r,type:"line",source:u[r],layout:{visibility:c(r)},paint:{"line-color":["match",["get","verified"],"true","rgba(255, 0, 0, 1)","rgba(180, 160, 5, 1)"],"line-width":3},filter:["==","$type","Polygon"]}:r===o.jw.CLUSTER_TEXT?{id:r,type:"symbol",source:u[r],filter:["all",["<",["zoom"],s.a7],["any",["has","point_count"],["has","count"]]],layout:{"icon-image":"alert-marker","text-field":["coalesce",["get","point_count_abbreviated"],["to-string",["get","point_count"]],["to-string",["get","count"]]],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12,"icon-size":.9,"icon-allow-overlap":!0,"text-allow-overlap":!0,visibility:c(r)}}:r===o.jw.CLUSTER_CIRCLE?{id:r,type:"circle",source:u[r],filter:["all",["<",["zoom"],s.a7],["any",["has","point_count"],["has","count"]]],paint:{"circle-color":"#f5ff66","circle-radius":30,"circle-stroke-width":0,"cir
9cle-stroke-color":"#000000","circle-opacity":.15},layout:{visibility:c(r)}}:void 0)},f=(e,r)=>{for(let i of p)for(let n of l[i][r])d(e,n)},m=(e,r,i)=>{for(let i of h)for(let n of l[r][i])e.current.getLayer(n)&&e.current.removeLayer(n);e.current.getSource(r)&&e.current.removeSource(r),e.current.addSource(r,((e,r)=>{if(e===o.ly.NORMAL)return{type:"geojson",data:r};throw Error(`Invalid alert source ID: ${e}`)})(r,i))},g=(e,r,i)=>{e.current.getSource(r)?.setData(i)}},7234:e=>{e.exports=function(e){if(!e||!e.type)return null;var i=r[e.type];return i?"geometry"===i?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]}:"feature"===i?{type:"FeatureCollection",features:[e]}:"featurecollection"===i?e:void 0:null};var r={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},8135:(e,r,i)=>{"use strict";i.d(r,{$qj:()=>m,FT1:()=>o,IkI:()=>b,P7h:()=>c,VZ_:()=>d,Wyp:()=>w,XfR:()=>g,Xpf:()=>u,cJR:()=>l,cXu:()=>v,d1R:()=>p,id1:()=>S,iyI:()=>x,mOA:()=>f,mlL:()=>s,nwe:()=>a,p8Z:()=>h,qzG:()=>_,wDG:()=>T,yzF:()=>E,z$h:()=>y});var n=i(51729);function o(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 3H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM9 9H5V5h4v4zm11 4h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1zm-1 6h-4v-4h4v4zM17 3c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4zm0 6c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2zM7 13c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4zm0 6c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2z"}}]})(e)}function a(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"}}]})(e)}function s(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m6.293 13.293 1.414 1.414L12 10.414l4.293 4.293 1.414-1.414L12 7.586z"}}]})(e)}function l(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"}},{tag:"path",attr:{d:"m8 16 5.991-2L16 8l-6 2z"}}]})(e)}function u(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 2H10c-1.103 0-2 .897-2 2v4H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h10c1.103 0 2-.897 2-2v-4h4c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zM4 20V10h10l.002 10H4zm16-6h-4v-4c0-1.103-.897-2-2-2h-4V4h10v10z"}}]})(e)}function c(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.406 6.086-9-4a1.001 1.001 0 0 0-.813 0l-9 4c-.02.009-.034.024-.054.035-.028.014-.058.023-.084.04-.022.015-.039.034-.06.05a.87.87 0 0 0-.19.194c-.02.028-.041.053-.059.081a1.119 1.119 0 0 0-.076.165c-.009.027-.023.052-.031.079A1.013 1.013 0 0 0 2 7v10c0 .396.232.753.594.914l9 4c.13.058.268.086.406.086a.997.997 0 0 0 .402-.096l.004.01 9-4A.999.999 0 0 0 22 17V7a.999.999 0 0 0-.594-.914zM12 4.095 18.538 7 12 9.905l-1.308-.581L5.463 7 12 4.095zM4 16.351V8.539l7 3.111v7.811l-7-3.11zm9 3.11V11.65l7-3.111v7.812l-7 3.11z"}}]})(e)}function h(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 15.414V20h2v-4.586c0-.526-.214-1.042-.586-1.414l-2-2L13 9.414l2 2c.372.372.888.586 1.414.586H20v-2h-3.586l-3.707-3.707a.999.999 0 0 0-1.414 0L8 9.586c-.378.378-.586.88-.586 1.414s.208 1.036.586 1.414l3 3z"}},{tag:"circle",attr:{cx:"16",cy:"5",r:"2"}},{tag:"path",attr:{d:"M18 14c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4zm0 6c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2zM6 22c2.206 0 4-1.794 4-4s-1.794-4-4-4-4 1.794-4 4 1.794 4 4 4zm0-6c1.103 0 2 .897 2 2s-.897 2-2 2-2-.897-2-2 .897-2 2-2z"}}]})(e)}function p(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 3H6.693A2.01 2.01 0 0 0 4.82 4.298l-2.757 7.351A1 1 0 0 0 2 12v2c0 1.103.897 2 2 2h5.612L8.49 19.367a2.004 2.004 0 0 0 .274 1.802c.376.52.982.831 1.624.831H12c.297 0 .578-.132.769-.36l4.7-5.64H20c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zm-8.469 17h-1.145l1.562-4.684A1 1 0 0 0 11 14H4v-1.819L6.693 5H16v9.638L11.531 20zM18 14V5h2l.001 9H18z"}}]})(e)}function d(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"}}]})(e)}function f(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M15 3H4.984c-1.103 0-2 .897-2 2v14.016c0 1.103.897 2 2 2H19c1.
9103 0 2-.897 2-2V5c0-1.103-.897-2-2-2h-4zm4 5h-3V5h3v3zM4.984 10h3v4.016h-3V10zm5 0H14v4.016H9.984V10zM16 10h3v4.016h-3V10zm-2-5v3H9.984V5H14zM7.984 5v3h-3V5h3zm-3 11.016h3v3h-3v-3zm5 3v-3H14v3H9.984zm6.016 0v-3h3.001v3H16z"}}]})(e)}function m(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 8h-5.612l1.123-3.367c.202-.608.1-1.282-.275-1.802S14.253 2 13.612 2H12c-.297 0-.578.132-.769.36L6.531 8H4c-1.103 0-2 .897-2 2v9c0 1.103.897 2 2 2h13.307a2.01 2.01 0 0 0 1.873-1.298l2.757-7.351A1 1 0 0 0 22 12v-2c0-1.103-.897-2-2-2zM4 10h2v9H4v-9zm16 1.819L17.307 19H8V9.362L12.468 4h1.146l-1.562 4.683A.998.998 0 0 0 13 10h7v1.819z"}}]})(e)}function g(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 6h2v2H4zm0 5h2v2H4zm0 5h2v2H4zm16-8V6H8.023v2H18.8zM8 11h12v2H8zm0 5h12v2H8z"}}]})(e)}function _(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z"}}]})(e)}function y(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 21a1 1 0 0 0 .24 0l4-1a1 1 0 0 0 .47-.26L21 7.41a2 2 0 0 0 0-2.82L19.42 3a2 2 0 0 0-2.83 0L4.3 15.29a1.06 1.06 0 0 0-.27.47l-1 4A1 1 0 0 0 3.76 21 1 1 0 0 0 4 21zM18 4.41 19.59 6 18 7.59 16.42 6zM5.91 16.51 15 7.41 16.59 9l-9.1 9.1-2.11.52z"}}]})(e)}function v(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.875 7H3.125C1.953 7 1 7.897 1 9v6c0 1.103.953 2 2.125 2h17.75C22.047 17 23 16.103 23 15V9c0-1.103-.953-2-2.125-2zm0 8H3.125c-.057 0-.096-.016-.113-.016-.007 0-.011.002-.012.008l-.012-5.946c.007-.01.052-.046.137-.046H5v3h2V9h2v4h2V9h2v3h2V9h2v4h2V9h1.875c.079.001.122.028.125.008l.012 5.946c-.007.01-.052.046-.137.046z"}}]})(e)}function x(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}function b(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.426 11.095-17-8A.999.999 0 0 0 3.03 4.242L4.969 12 3.03 19.758a.998.998 0 0 0 1.396 1.147l17-8a1 1 0 0 0 0-1.81zM5.481 18.197l.839-3.357L12 12 6.32 9.16l-.839-3.357L18.651 12l-13.17 6.197z"}}]})(e)}function w(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.5 14.5c-1.58 0-2.903 1.06-3.337 2.5H2v2h2.163c.434 1.44 1.757 2.5 3.337 2.5s2.903-1.06 3.337-2.5H22v-2H10.837c-.434-1.44-1.757-2.5-3.337-2.5zm0 5c-.827 0-1.5-.673-1.5-1.5s.673-1.5 1.5-1.5S9 17.173 9 18s-.673 1.5-1.5 1.5zm9-11c-1.58 0-2.903 1.06-3.337 2.5H2v2h11.163c.434 1.44 1.757 2.5 3.337 2.5s2.903-1.06 3.337-2.5H22v-2h-2.163c-.434-1.44-1.757-2.5-3.337-2.5zm0 5c-.827 0-1.5-.673-1.5-1.5s.673-1.5 1.5-1.5 1.5.673 1.5 1.5-.673 1.5-1.5 1.5z"}},{tag:"path",attr:{d:"M12.837 5C12.403 3.56 11.08 2.5 9.5 2.5S6.597 3.56 6.163 5H2v2h4.163C6.597 8.44 7.92 9.5 9.5 9.5s2.903-1.06 3.337-2.5h9.288V5h-9.288zM9.5 7.5C8.673 7.5 8 6.827 8 6s.673-1.5 1.5-1.5S11 5.173 11 6s-.673 1.5-1.5 1.5z"}}]})(e)}function E(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M13 4.069V2h-2v2.069A8.008 8.008 0 0 0 4.069 11H2v2h2.069A8.007 8.007 0 0 0 11 19.931V22h2v-2.069A8.007 8.007 0 0 0 19.931 13H22v-2h-2.069A8.008 8.008 0 0 0 13 4.069zM12 18c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function S(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z"}},{tag:"path",attr:{d:"M9 10h2v8H9zm4 0h2v8h-2z"}}]})(e)}function T(e){return(0,n.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.283 10.356h-8.327v3.451h4.792c-.446 2.193-2.313 3.453-4.792 3.453a5.27 5.27 0 0 1-5.279-5.28 5.27 5.27 0 0 1 5.279-5.279c1.259 0 2.397.447 3.29 1.178l2.6-2.599c-1.584-1.381-3.615-2.233-5.89-2.233a8.908 8.908 0 0 0-8.934 8.934 8.907 8.907 0 0 0 8.934 8.934c4.467 0 8.529-3.249 8.529-8.934 0-.528-.081-1.097-.202-1.625z"}}]})(e)}}
9,8734:(e,r,i)=>{"use strict";var n=i(9912),o=i(58217),a=i(93710),s=i(15796),l=i(71306),u=a.List,c=a.Map,h=function(e,r,i){if(e){var n=r.get(e);n&&r.set(e,i(n))}};e.exports=function(e,r){r.isCollapsed()||s(!1);var i=r.getAnchorKey(),a=e.getBlockMap(),p=a.get(i),d=p.getText();if(!d){var f=p.getType();if("unordered-list-item"===f||"ordered-list-item"===f)return l(e,r,function(e){return e.merge({type:"unstyled",depth:0})})}var m=r.getAnchorOffset(),g=p.getCharacterList(),_=o(),y=p instanceof n,v=p.merge({text:d.slice(0,m),characterList:g.slice(0,m)}),x=v.merge({key:_,text:d.slice(m),characterList:g.slice(m),data:c()}),b=a.toSeq().takeUntil(function(e){return e===p}),w=a.toSeq().skipUntil(function(e){return e===p}).rest(),E=b.concat([[i,v],[_,x]],w).toOrderedMap();return y&&(p.getChildKeys().isEmpty()||s(!1),E=E.withMutations(function(e){var r=v.getKey(),i=x.getKey();h(v.getParentKey(),e,function(e){var n=e.getChildKeys(),o=n.indexOf(r)+1,a=n.toArray();return a.splice(o,0,i),e.merge({children:u(a)})}),h(v.getNextSiblingKey(),e,function(e){return e.merge({prevSibling:i})}),h(r,e,function(e){return e.merge({nextSibling:i})}),h(i,e,function(e){return e.merge({prevSibling:r})})})),e.merge({blockMap:E,selectionBefore:r,selectionAfter:r.merge({anchorKey:_,anchorOffset:0,focusKey:_,focusOffset:0,isBackward:!1})})}},8908:e=>{"use strict";e.exports={getRemovalRange:function(e,r,i,n,o){var a,s=i.split(" ");s=s.map(function(e,r){if("forward"===o){if(r>0)return" "+e}else if(r<s.length-1)return e+" ";return e});for(var l=n,u=null,c=null,h=0;h<s.length;h++){if(e<(a=l+s[h].length)&&l<r)null!==u||(u=l),c=a;else if(null!==u)break;l=a}var p=n+i.length,d=u===n,f=c===p;return(!d&&f||d&&!f)&&("forward"===o?c!==p&&c++:u!==n&&u--),{start:u,end:c}}}},9380:(e,r,i)=>{"use strict";i.d(r,{MU:()=>h,cN:()=>u,ev:()=>l,i2:()=>c,ux:()=>s});var n=i(80856),o=i(85428),a=i(23323);let s=async(e,r,i,n)=>await (0,a.x)("/map/update-lidar",{method:"PATCH",json:{uuid:e,...i&&{name:i},...n&&{date:n.toISOString()},user_metrics:r}}),l=async e=>{try{return await (0,a.x)("/map/populate-lidar",{method:"PUT",json:{uuid:e,properties:{status:n.nW.cancelled}}}),!0}catch{return!1}},u=async e=>{try{return await (0,a.x)("/map/delete-lidar",{method:"DELETE",params:{uuid:e}}),!0}catch{return!1}},c=async(e,r,i=!1)=>{let n=(0,o.i6)(r);return await (0,a.x)("/map/user-lidar",{method:"POST",json:{status:e??void 0,screen:i?void 0:n}})},h=async e=>{try{let r=await (0,a.x)("/map/fetch-lidar",{method:"GET",params:{uuid:e}});if(r&&r.properties&&r.properties.status)return r.properties.status;return n.nW.processing}catch(e){return console.error("Error fetching the status:",e),n.nW.error}}},9426:e=>{"use strict";e.exports=function(e){return!!e&&!!e.ownerDocument&&e.nodeType===Node.ELEMENT_NODE}},9610:(e,r,i)=>{"use strict";var n=i(15796),o=null;function a(e){return"LTR"===e||"RTL"===e}function s(e){return a(e)||n(!1),"LTR"===e?"ltr":"rtl"}e.exports={NEUTRAL:"NEUTRAL",LTR:"LTR",RTL:"RTL",isStrong:a,getHTMLDir:s,getHTMLDirIfDifferent:function(e,r){return a(e)||n(!1),a(r)||n(!1),e===r?null:s(e)},setGlobalDir:function(e){o=e},initGlobalDir:function(){o="LTR"},getGlobalDir:function(){return o||this.initGlobalDir(),o||n(!1),o}}},9912:(e,r,i)=>{"use strict";var n=i(60620),o=i(62989),a=i(93710),s=a.List,l=a.Map,u=a.OrderedSet,c=a.Record,h=a.Repeat,p=u(),d={parent:null,characterList:s(),data:l(),depth:0,key:"",text:"",type:"unstyled",children:s(),prevSibling:null,nextSibling:null},f=function(e,r){return e.getStyle()===r.getStyle()},m=function(e,r){return e.getEntity()===r.getEntity()},g=function(e){if(!e)return e;var r=e.characterList,i=e.text;return i&&!r&&(e.characterList=s(h(n.EMPTY,i.length))),e};e.exports=function(e){function r(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return e.call(this,g(r))||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.getKey=function(){return this.get("key")},i.getType=function(){return this.get("type")},i.getText=function(){return this.get("text")},i.getCharacterList=function(){return this.get("characterList")},i.getLength=function(){return this.getText().length},i.getDepth=function(){return this.get("depth")},i.getData=function(){return this.get("data")},i.getInlineStyleAt=function(e){var r=this.getCharacterList().get(e);return r?r.getStyle():p},i.getEntityAt=function(e){var r=this.getCharacterList().get(e);return r?r.getEntity():null},i.getChildKeys=function(){return this.get("children")},i.getParentKey=function(){return this.get("parent")},i.getPrevSiblingKey=function(){return this.get("prevSibling")},i.getNextSiblingKey=function(){return this.get("nextSibling")},i.findStyleRanges=function(e,r){o(this.getCharacterList(),f,e,r)},i.findEntityRanges=function(e,r){o(this.getCharacterList(),m,e,r)},r}(c(d))},10221:(e,r,i)=>{"use strict";var n=i(65225);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},10841:function(e,r,i){e=i.nmd(e),e.exports=function(){"use strict";function r(){return j.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function a(e){var r;if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(r in e)if(o(e,r))return!1;return!0}function s(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,r){var i,n=[],o=e.length;for(i=0;i<o;++i)n.push(r(e[i],i));return n}
9function h(e,r){for(var i in r)o(r,i)&&(e[i]=r[i]);return o(r,"toString")&&(e.toString=r.toString),o(r,"valueOf")&&(e.valueOf=r.valueOf),e}function p(e,r,i,n){return to(e,r,i,n,!0).utc()}function d(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function f(e){var r=null,i=!1,n=e._d&&!isNaN(e._d.getTime());return(n&&(r=d(e),i=V.call(r.parsedDateParts,function(e){return null!=e}),n=r.overflow<0&&!r.empty&&!r.invalidEra&&!r.invalidMonth&&!r.invalidWeekday&&!r.weekdayMismatch&&!r.nullInput&&!r.invalidFormat&&!r.userInvalidated&&(!r.meridiem||r.meridiem&&i),e._strict&&(n=n&&0===r.charsLeftOver&&0===r.unusedTokens.length&&void 0===r.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e))?n:(e._isValid=n,e._isValid)}function m(e){var r=p(NaN);return null!=e?h(d(r),e):d(r).userInvalidated=!0,r}V=Array.prototype.some?Array.prototype.some:function(e){var r,i=Object(this),n=i.length>>>0;for(r=0;r<n;r++)if(r in i&&e.call(this,i[r],r,i))return!0;return!1};var g,_,y=r.momentProperties=[],v=!1;function x(e,r){var i,n,o,a=y.length;if(s(r._isAMomentObject)||(e._isAMomentObject=r._isAMomentObject),s(r._i)||(e._i=r._i),s(r._f)||(e._f=r._f),s(r._l)||(e._l=r._l),s(r._strict)||(e._strict=r._strict),s(r._tzm)||(e._tzm=r._tzm),s(r._isUTC)||(e._isUTC=r._isUTC),s(r._offset)||(e._offset=r._offset),s(r._pf)||(e._pf=d(r)),s(r._locale)||(e._locale=r._locale),a>0)for(i=0;i<a;i++)s(o=r[n=y[i]])||(e[n]=o);return e}function b(e){x(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,r.updateOffset(this),v=!1)}function w(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function E(e){!1===r.suppressDeprecationWarnings&&"u">typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function S(e,i){var n=!0;return h(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var a,s,l,u=[],c=arguments.length;for(s=0;s<c;s++){if(a="","object"==typeof arguments[s]){for(l in a+="\n["+s+"] ",arguments[0])o(arguments[0],l)&&(a+=l+": "+arguments[0][l]+", ");a=a.slice(0,-2)}else a=arguments[s];u.push(a)}E(e+"\nArguments: "+Array.prototype.slice.call(u).join("")+"\n"+Error().stack),n=!1}return i.apply(this,arguments)},i)}var T={};function I(e,i){null!=r.deprecationHandler&&r.deprecationHandler(e,i),T[e]||(E(i),T[e]=!0)}function M(e){return"u">typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,r){var i,a=h({},e);for(i in r)o(r,i)&&(n(e[i])&&n(r[i])?(a[i]={},h(a[i],e[i]),h(a[i],r[i])):null!=r[i]?a[i]=r[i]:delete a[i]);for(i in e)o(e,i)&&!o(r,i)&&n(e[i])&&(a[i]=h({},a[i]));return a}function A(e){null!=e&&this.set(e)}function P(e,r,i){var n=""+Math.abs(e);return(e>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,r-n.length)).toString().substr(1)+n}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null;var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,O=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,D={},R={};function k(e,r,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),e&&(R[e]=o),r&&(R[r[0]]=function(){return P(o.apply(this,arguments),r[1],r[2])}),i&&(R[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function N(e,r){return e.isValid()?(D[r=F(r,e.localeData())]=D[r]||function(e){var r,i,n,o=e.match(L);for(i=0,n=o.length;i<n;i++)R[o[i]]?o[i]=R[o[i]]:o[i]=(r=o[i]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(r){var i,a="";for(i=0;i<n;i++)a+=M(o[i])?o[i].call(r,e):o[i];return a}}(r),D[r](e)):e.localeData().invalidDate()}function F(e,r){var i=5;function n(e){return r.longDateFormat(e)||e}for(O.lastIndex=0;i>=0&&O.test(e);)e=e.replace(O,n),O.lastIndex=0,i-=1;return e}var z={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function B(e){return"string"==typeof e?z[e]||z[e.toLowerCase()]:void 0}function U(e){var r,i,n={};for(i in e)o(e,i)&&(r=B(i))&&(n[r]=e[i]);return n}var j,V,G,q={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},H=Object.keys?Object.keys:function(e){var r,i=[];for(r in e)o(e,r)&&i.push(r);return i},$=/\d/,W=/\d\d/,Y=/\d{3}/,Z=/\d{4}/,X=/[+-]?\d{6}/,K=/\d\d?/,Q=/\d\d\d\d?/,J=/\d\d\d\d\d\d?/,ee=/\d{1,3}/,et=/\d{1,4}/,er=/[+-]?\d{1,6}/,ei=/\d+/,en=/[+-]?\d+/,eo=/Z|[+-]\d\d:?\d\d/gi,ea=/Z|[+-]\d\d(?::?\d\d)?/gi,es=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,el=/^[1-9]\d?/,eu=/^([1-9]\d|\d)/;
9function ec(e,r,i){G[e]=M(r)?r:function(e,n){return e&&i?i:r}}function eh(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ep(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ed(e){var r=+e,i=0;return 0!==r&&isFinite(r)&&(i=ep(r)),i}G={};var ef={};function em(e,r){var i,n,o=r;for("string"==typeof e&&(e=[e]),l(r)&&(o=function(e,i){i[r]=ed(e)}),n=e.length,i=0;i<n;i++)ef[e[i]]=o}function eg(e,r){em(e,function(e,i,n,o){n._w=n._w||{},r(e,n._w,n,o)})}function e_(e){return e%4==0&&e%100!=0||e%400==0}function ey(e){return e_(e)?366:365}k("Y",0,0,function(){var e=this.year();return e<=9999?P(e,4):"+"+e}),k(0,["YY",2],0,function(){return this.year()%100}),k(0,["YYYY",4],0,"year"),k(0,["YYYYY",5],0,"year"),k(0,["YYYYYY",6,!0],0,"year"),ec("Y",en),ec("YY",K,W),ec("YYYY",et,Z),ec("YYYYY",er,X),ec("YYYYYY",er,X),em(["YYYYY","YYYYYY"],0),em("YYYY",function(e,i){i[0]=2===e.length?r.parseTwoDigitYear(e):ed(e)}),em("YY",function(e,i){i[0]=r.parseTwoDigitYear(e)}),em("Y",function(e,r){r[0]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return ed(e)+(ed(e)>68?1900:2e3)};var ev=ex("FullYear",!0);function ex(e,i){return function(n){return null!=n?(ew(this,e,n),r.updateOffset(this,i),this):eb(this,e)}}function eb(e,r){if(!e.isValid())return NaN;var i=e._d,n=e._isUTC;switch(r){case"Milliseconds":return n?i.getUTCMilliseconds():i.getMilliseconds();case"Seconds":return n?i.getUTCSeconds():i.getSeconds();case"Minutes":return n?i.getUTCMinutes():i.getMinutes();case"Hours":return n?i.getUTCHours():i.getHours();case"Date":return n?i.getUTCDate():i.getDate();case"Day":return n?i.getUTCDay():i.getDay();case"Month":return n?i.getUTCMonth():i.getMonth();case"FullYear":return n?i.getUTCFullYear():i.getFullYear();default:return NaN}}function ew(e,r,i){var n,o,a,s;if(!(!e.isValid()||isNaN(i))){switch(n=e._d,o=e._isUTC,r){case"Milliseconds":return void(o?n.setUTCMilliseconds(i):n.setMilliseconds(i));case"Seconds":return void(o?n.setUTCSeconds(i):n.setSeconds(i));case"Minutes":return void(o?n.setUTCMinutes(i):n.setMinutes(i));case"Hours":return void(o?n.setUTCHours(i):n.setHours(i));case"Date":return void(o?n.setUTCDate(i):n.setDate(i));case"FullYear":break;default:return}a=e.month(),s=29!==(s=e.date())||1!==a||e_(i)?s:28,o?n.setUTCFullYear(i,a,s):n.setFullYear(i,a,s)}}function eE(e,r){if(isNaN(e)||isNaN(r))return NaN;var i=(r%12+12)%12;return e+=(r-i)/12,1===i?e_(e)?29:28:31-i%7%2}eG=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var r;for(r=0;r<this.length;++r)if(this[r]===e)return r;return -1},k("M",["MM",2],"Mo",function(){return this.month()+1}),k("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),k("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ec("M",K,el),ec("MM",K,W),ec("MMM",function(e,r){return r.monthsShortRegex(e)}),ec("MMMM",function(e,r){return r.monthsRegex(e)}),em(["M","MM"],function(e,r){r[1]=ed(e)-1}),em(["MMM","MMMM"],function(e,r,i,n){var o=i._locale.monthsParse(e,n,i._strict);null!=o?r[1]=o:d(i).invalidMonth=e});var eS="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),eT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;function eI(e,r,i){var n,o,a,s=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)a=p([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(a,"").toLocaleLowerCase();if(i)if("MMM"===r)return -1!==(o=eG.call(this._shortMonthsParse,s))?o:null;else return -1!==(o=eG.call(this._longMonthsParse,s))?o:null;return"MMM"===r?-1!==(o=eG.call(this._shortMonthsParse,s))||-1!==(o=eG.call(this._longMonthsParse,s))?o:null:-1!==(o=eG.call(this._longMonthsParse,s))||-1!==(o=eG.call(this._shortMonthsParse,s))?o:null}function eM(e,r){if(!e.isValid())return e;if("string"==typeof r){if(/^\d+$/.test(r))r=ed(r);else if(!l(r=e.localeData().monthsParse(r)))return e}var i=r,n=e.date();return n=n<29?n:Math.min(n,eE(e.year(),i)),e._isUTC?e._d.setUTCMonth(i,n):e._d.setMonth(i,n),e}function eC(e){return null!=e?(eM(this,e),r.updateOffset(this,!0),this):eb(this,"Month")}function eA(){function e(e,r){return r.length-e.length}var r,i,n,o,a=[],s=[],l=[];for(r=0;r<12;r++)i=p([2e3,r]),n=eh(this.monthsShort(i,"")),o=eh(this.months(i,"")),a.push(n),s.push(o),l.push(o),l.push(n);a.sort(e),s.sort(e),l.sort(e),this._monthsRegex=RegExp("^("+l.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=RegExp("^("+a.join("|")+")","i")}function eP(e,r,i,n,o,a,s){var l;return e<100&&e>=0?isFinite((l=new Date(e+400,r,i,n,o,a,s)).getFullYear())&&l.setFullYear(e):l
9=new Date(e,r,i,n,o,a,s),l}function eL(e){var r,i;return e<100&&e>=0?(i=Array.prototype.slice.call(arguments),i[0]=e+400,isFinite((r=new Date(Date.UTC.apply(null,i))).getUTCFullYear())&&r.setUTCFullYear(e)):r=new Date(Date.UTC.apply(null,arguments)),r}function eO(e,r,i){var n=7+r-i;return-((7+eL(e,0,n).getUTCDay()-r)%7)+n-1}function eD(e,r,i,n,o){var a,s,l=1+7*(r-1)+(7+i-n)%7+eO(e,n,o);return l<=0?s=ey(a=e-1)+l:l>ey(e)?(a=e+1,s=l-ey(e)):(a=e,s=l),{year:a,dayOfYear:s}}function eR(e,r,i){var n,o,a=eO(e.year(),r,i),s=Math.floor((e.dayOfYear()-a-1)/7)+1;return s<1?n=s+ek(o=e.year()-1,r,i):s>ek(e.year(),r,i)?(n=s-ek(e.year(),r,i),o=e.year()+1):(o=e.year(),n=s),{week:n,year:o}}function ek(e,r,i){var n=eO(e,r,i),o=eO(e+1,r,i);return(ey(e)-n+o)/7}function eN(e,r){return e.slice(r,7).concat(e.slice(0,r))}k("w",["ww",2],"wo","week"),k("W",["WW",2],"Wo","isoWeek"),ec("w",K,el),ec("ww",K,W),ec("W",K,el),ec("WW",K,W),eg(["w","ww","W","WW"],function(e,r,i,n){r[n.substr(0,1)]=ed(e)}),k("d",0,"do","day"),k("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),k("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),k("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),k("e",0,0,"weekday"),k("E",0,0,"isoWeekday"),ec("d",K),ec("e",K),ec("E",K),ec("dd",function(e,r){return r.weekdaysMinRegex(e)}),ec("ddd",function(e,r){return r.weekdaysShortRegex(e)}),ec("dddd",function(e,r){return r.weekdaysRegex(e)}),eg(["dd","ddd","dddd"],function(e,r,i,n){var o=i._locale.weekdaysParse(e,n,i._strict);null!=o?r.d=o:d(i).invalidWeekday=e}),eg(["d","e","E"],function(e,r,i,n){r[n]=ed(e)});var eF="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function ez(e,r,i){var n,o,a,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)a=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(a,"").toLocaleLowerCase();if(i)if("dddd"===r)return -1!==(o=eG.call(this._weekdaysParse,s))?o:null;else if("ddd"===r)return -1!==(o=eG.call(this._shortWeekdaysParse,s))?o:null;else return -1!==(o=eG.call(this._minWeekdaysParse,s))?o:null;return"dddd"===r?-1!==(o=eG.call(this._weekdaysParse,s))||-1!==(o=eG.call(this._shortWeekdaysParse,s))||-1!==(o=eG.call(this._minWeekdaysParse,s))?o:null:"ddd"===r?-1!==(o=eG.call(this._shortWeekdaysParse,s))||-1!==(o=eG.call(this._weekdaysParse,s))||-1!==(o=eG.call(this._minWeekdaysParse,s))?o:null:-1!==(o=eG.call(this._minWeekdaysParse,s))||-1!==(o=eG.call(this._weekdaysParse,s))||-1!==(o=eG.call(this._shortWeekdaysParse,s))?o:null}function eB(){function e(e,r){return r.length-e.length}var r,i,n,o,a,s=[],l=[],u=[],c=[];for(r=0;r<7;r++)i=p([2e3,1]).day(r),n=eh(this.weekdaysMin(i,"")),o=eh(this.weekdaysShort(i,"")),a=eh(this.weekdays(i,"")),s.push(n),l.push(o),u.push(a),c.push(n),c.push(o),c.push(a);s.sort(e),l.sort(e),u.sort(e),c.sort(e),this._weekdaysRegex=RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=RegExp("^("+l.join("|")+")","i"),this._weekdaysMinStrictRegex=RegExp("^("+s.join("|")+")","i")}function eU(){return this.hours()%12||12}function ej(e,r){k(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),r)})}function eV(e,r){return r._meridiemParse}k("H",["HH",2],0,"hour"),k("h",["hh",2],0,eU),k("k",["kk",2],0,function(){return this.hours()||24}),k("hmm",0,0,function(){return""+eU.apply(this)+P(this.minutes(),2)}),k("hmmss",0,0,function(){return""+eU.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),k("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),k("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),ej("a",!0),ej("A",!1),ec("a",eV),ec("A",eV),ec("H",K,eu),ec("h",K,el),ec("k",K,el),ec("HH",K,W),ec("hh",K,W),ec("kk",K,W),ec("hmm",Q),ec("hmmss",J),ec("Hmm",Q),ec("Hmmss",J),em(["H","HH"],3),em(["k","kk"],function(e,r,i){var n=ed(e);r[3]=24===n?0:n}),em(["a","A"],function(e,r,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),em(["h","hh"],function(e,r,i){r[3]=ed(e),d(i).bigHour=!0}),em("hmm",function(e,r,i){var n=e.length-2;r[3]=ed(e.substr(0,n)),r[4]=ed(e.substr(n)),d(i).bigHour=!0}),em("hmmss",function(e,r,i){var n=e.length-4,o=e.length-2;r[3]=ed(e.substr(0,n)),r[4]=ed(e.substr(n,2)),r[5]=ed(e.substr(o)),d(i).bigHour=!0}),em("Hmm",function(e,r,i){var n=e.length-2;r[3]=ed(e.substr(0,n)),r[4]=ed(e.substr(n))}),em("Hmmss",function(e,r,i){var n=e.length-4,o=e.length-2;r[3]=ed(e.substr(0,n)),r[4]=ed(e.substr(n,2)),r[5]=ed(e.substr(o))});var eG,eq,eH=ex("Hours",!0),e$={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:eS,week:{dow:0,doy:6},weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysShort:eF,meridiemParse:/[ap]\.?m?\.?/i},eW={},eY={};function eZ(e){return e?e.toLowerCase().replace("_","-"):e}function eX(r){if(void 0===eW[r]&&e&&e.exports&&r&&r.match("^[^/\\\\]*$"))try{eq._abbr;var i=Error("Cannot find module 'undefined'");throw i.code="MODULE_NOT_FOUND",i}catch(e){eW[r]=null}return eW[r]}function eK(e,r){var i;return e&&((i=s(r)?eJ(e):eQ(e,r))?eq=i:"u">typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),eq._abbr}function eQ(e,r){if(null===r)return delete eW[e],null;var i,n=e$;if(r.abbr=e,null!=eW[e])I("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=eW[e]._config;else if(null!=r.parentLocale)if(null!=eW[r.parentLocale])n=eW[r.parentLocale]._config;else{if(null==(i=eX(r.parentLocale)))return eY[r.parentLocale]||(eY[r.parentLocale]=[]),eY[r.parentLocale].push({name:e,config:r}),null;n=i._config}return eW[e]=new A(C(n,r)),eY[e]&&eY[e].forEach(function(e){eQ(e.name,e.config)}),eK(e),eW[e]}function eJ(e){var r;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return eq;if(!i(e)){if(r=eX(e))return r;e=[e]}return function(e){for(var r,i,n,o,a=0;a<e.length;){for(r=(o=eZ(e[a]).split("-")).length,i=(i=eZ(e[a+1]))?i.split("-"):null;r>0;){if(n=eX(o.slice(0,r).join("-")))return n;if(i&&i.length>=r&&function(e,r){var i,n=Math.min(e.length,r.length);for(i=0;i<n;i+=1)if(e[i]!==r[i])return i;return n}(o,i)>=r-1)break;r--}a++}return eq}(e)}function e0(e){var r,i=e._a;return i&&-2===d(e).overflow&&(r=i[1]<0||i[1]>11?1:i[2]<1||i[2]>eE(i[0],i[1])?2:i[3]<0||i[3]>
924||24===i[3]&&(0!==i[4]||0!==i[5]||0!==i[6])?3:i[4]<0||i[4]>59?4:i[5]<0||i[5]>59?5:i[6]<0||i[6]>999?6:-1,d(e)._overflowDayOfYear&&(r<0||r>2)&&(r=2),d(e)._overflowWeeks&&-1===r&&(r=7),d(e)._overflowWeekday&&-1===r&&(r=8),d(e).overflow=r),e}var e1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e2=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,e3=/Z|[+-]\d\d(?::?\d\d)?/,e5=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],e4=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],e6=/^\/?Date\((-?\d+)/i,e8=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,e9={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function e7(e){var r,i,n,o,a,s,l=e._i,u=e1.exec(l)||e2.exec(l),c=e5.length,h=e4.length;if(u){for(d(e).iso=!0,r=0,i=c;r<i;r++)if(e5[r][1].exec(u[1])){o=e5[r][0],n=!1!==e5[r][2];break}if(null==o){e._isValid=!1;return}if(u[3]){for(r=0,i=h;r<i;r++)if(e4[r][1].exec(u[3])){a=(u[2]||" ")+e4[r][0];break}if(null==a){e._isValid=!1;return}}if(!n&&null!=a){e._isValid=!1;return}if(u[4])if(e3.exec(u[4]))s="Z";else{e._isValid=!1;return}e._f=o+(a||"")+(s||""),ti(e)}else e._isValid=!1}function te(e){var r,i,n,o,a,s,l,u,c,h,p,f=e8.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(f){if(a=f[4],s=f[3],l=f[2],u=f[5],c=f[6],h=f[7],p=[(r=parseInt(a,10))<=49?2e3+r:r<=999?1900+r:r,eS.indexOf(s),parseInt(l,10),parseInt(u,10),parseInt(c,10)],h&&p.push(parseInt(h,10)),i=f[1],n=p,o=e,i&&eF.indexOf(i)!==new Date(n[0],n[1],n[2]).getDay()&&(d(o).weekdayMismatch=!0,o._isValid=!1,1))return;e._a=p,e._tzm=function(e,r,i){if(e)return e9[e];if(r)return 0;var n=parseInt(i,10),o=n%100;return(n-o)/100*60+o}(f[8],f[9],f[10]),e._d=eL.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),d(e).rfc2822=!0}else e._isValid=!1}function tt(e,r,i){return null!=e?e:null!=r?r:i}function tr(e){var i,n,o,a,s,l,u,c,h,p,f,m,g,_,y,v,x=[];if(!e._d){for(f=new Date(r.now()),_=e._useUTC?[f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()]:[f.getFullYear(),f.getMonth(),f.getDate()],e._w&&null==e._a[2]&&null==e._a[1]&&(null!=(n=(i=e)._w).GG||null!=n.W||null!=n.E?(l=1,u=4,o=tt(n.GG,i._a[0],eR(ta(),1,4).year),a=tt(n.W,1),((s=tt(n.E,1))<1||s>7)&&(h=!0)):(l=i._locale._week.dow,u=i._locale._week.doy,p=eR(ta(),l,u),o=tt(n.gg,i._a[0],p.year),a=tt(n.w,p.week),null!=n.d?((s=n.d)<0||s>6)&&(h=!0):null!=n.e?(s=n.e+l,(n.e<0||n.e>6)&&(h=!0)):s=l),a<1||a>ek(o,l,u)?d(i)._overflowWeeks=!0:null!=h?d(i)._overflowWeekday=!0:(c=eD(o,a,s,l,u),i._a[0]=c.year,i._dayOfYear=c.dayOfYear)),null!=e._dayOfYear&&(v=tt(e._a[0],_[0]),(e._dayOfYear>ey(v)||0===e._dayOfYear)&&(d(e)._overflowDayOfYear=!0),g=eL(v,0,e._dayOfYear),e._a[1]=g.getUTCMonth(),e._a[2]=g.getUTCDate()),m=0;m<3&&null==e._a[m];++m)e._a[m]=x[m]=_[m];for(;m<7;m++)e._a[m]=x[m]=null==e._a[m]?+(2===m):e._a[m];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?eL:eP).apply(null,x),y=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==y&&(d(e).weekdayMismatch=!0)}}function ti(e){if(e._f===r.ISO_8601)return void e7(e);if(e._f===r.RFC_2822)return void te(e);e._a=[],d(e).empty=!0;var i,n,a,s,l,u,c,h,p,f,m,g=""+e._i,_=g.length,y=0;for(m=(c=F(e._f,e._locale).match(L)||[]).length,l=0;l<m;l++)if(h=c[l],(u=(g.match(!o(G,h)?new RegExp(eh(h.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,i,n,o){return r||i||n||o}))):G[h](e._strict,e._locale))||[])[0])&&((p=g.substr(0,g.indexOf(u))).length>0&&d(e).unusedInput.push(p),g=g.slice(g.indexOf(u)+u.length),y+=u.length),R[h])u?d(e).empty=!1:d(e).unusedTokens.push(h),null!=u&&o(ef,h)&&ef[h](u,e._a,e,h);else e._strict&&!u&&d(e).unusedTokens.push(h);d(e).charsLeftOver=_-y,g.length>0&&d(e).unusedInput.push(g),e._a[3]<=12&&!0===d(e).bigHour&&e._a[3]>0&&(d(e).bigHour=void 0),d(e).parsedDateParts=e._a.slice(0),d(e).meridiem=e._meridiem,e._a[3]=(i=e._locale,n=e._a[3],null==(a=e._meridiem)?n:null!=i.meridiemHour?i.meridiemHour(n,a):(null!=i.isPM&&((s=i.isPM(a))&&n<12&&(n+=12),s||12!==n||(n=0)),n)),null!==(f=d(e).era)&&(e._a[0]=e._locale.erasConvertYear(f,e._a[0])),tr(e),e0(e)}function tn(e){var o=e._i,a=e._f;return(e._locale=e._locale||eJ(e._l),null===o||void 0===a&&""===o)?m({nullInput:!0}):("string"==typeof o&&(e._i=o=e._locale.preparse(o)),w(o))?new b(e0(o)):(u(o)?e._d=o:i(a)?!function(e){var r,i,n,o,a,s,l=!1,u=e._f.length;if(0===u){d(e).invalidFormat=!0,e._d=new Date(NaN);return}for(o=0;o<u;o++)a=0,s=!1,r=x({},e),null!=e._useUTC&&(r._useUTC=e._useUTC),r._f=e._f[o],ti(r),f(r)&&(s=!0),a+=d(r).charsLeftOver,a+=10*d(r).unusedTokens.length,d(r).score=a,l?a<n&&(n=a,i=r):(null==n||a<n||s)&&(n=a,i=r,s&&(l=!0));h(e,i||r)}(e):a?ti(e):function(e){var o=e._i;if(s(o))e._d=new Date(r.now());else if(u(o))e._d=new Date(o.valueOf());else if("string"==typeof o)!function(e){var i=e6.exec(e._i);if(null!==i){e._d=new Date(+i[1]);return}e7(e),!1!==e._isValid||(delete e._isValid,te(e),!1===e._isValid&&
9(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))}(e);else if(i(o))e._a=c(o.slice(0),function(e){return parseInt(e,10)}),tr(e);else if(n(o)){if(!e._d){var a=U(e._i),h=void 0===a.day?a.date:a.day;e._a=c([a.year,a.month,h,a.hour,a.minute,a.second,a.millisecond],function(e){return e&&parseInt(e,10)}),tr(e)}}else l(o)?e._d=new Date(o):r.createFromInputFallback(e)}(e),f(e)||(e._d=null),e)}function to(e,r,o,s,l){var u,c={};return(!0===r||!1===r)&&(s=r,r=void 0),(!0===o||!1===o)&&(s=o,o=void 0),(n(e)&&a(e)||i(e)&&0===e.length)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=l,c._l=o,c._i=e,c._f=r,c._strict=s,(u=new b(e0(tn(c))))._nextDay&&(u.add(1,"d"),u._nextDay=void 0),u}function ta(e,r,i,n){return to(e,r,i,n,!1)}r.createFromInputFallback=S("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var ts=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ta.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),tl=S("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ta.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()});function tu(e,r){var n,o;if(1===r.length&&i(r[0])&&(r=r[0]),!r.length)return ta();for(n=r[0],o=1;o<r.length;++o)(!r[o].isValid()||r[o][e](n))&&(n=r[o]);return n}var tc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function th(e){var r=U(e),i=r.year||0,n=r.quarter||0,a=r.month||0,s=r.week||r.isoWeek||0,l=r.day||0,u=r.hour||0,c=r.minute||0,h=r.second||0,p=r.millisecond||0;this._isValid=function(e){var r,i,n=!1,a=tc.length;for(r in e)if(o(e,r)&&!(-1!==eG.call(tc,r)&&(null==e[r]||!isNaN(e[r]))))return!1;for(i=0;i<a;++i)if(e[tc[i]]){if(n)return!1;parseFloat(e[tc[i]])!==ed(e[tc[i]])&&(n=!0)}return!0}(r),this._milliseconds=+p+1e3*h+6e4*c+1e3*u*3600,this._days=+l+7*s,this._months=+a+3*n+12*i,this._data={},this._locale=eJ(),this._bubble()}function tp(e){return e instanceof th}function td(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function tf(e,r){k(e,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+P(~~(e/60),2)+r+P(~~e%60,2)})}tf("Z",":"),tf("ZZ",""),ec("Z",ea),ec("ZZ",ea),em(["Z","ZZ"],function(e,r,i){i._useUTC=!0,i._tzm=tg(ea,e)});var tm=/([\+\-]|\d\d)/gi;function tg(e,r){var i,n,o=(r||"").match(e);return null===o?null:0===(n=+(60*(i=((o[o.length-1]||[])+"").match(tm)||["-",0,0])[1])+ed(i[2]))?0:"+"===i[0]?n:-n}function t_(e,i){var n,o;return i._isUTC?(n=i.clone(),o=(w(e)||u(e)?e.valueOf():ta(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),r.updateOffset(n,!1),n):ta(e).local()}function ty(e){return-Math.round(e._d.getTimezoneOffset())}function tv(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var tx=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tb=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function tw(e,r){var i,n,a,s,u,c,h=e,p=null;return tp(e)?h={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(h={},r?h[r]=+e:h.milliseconds=+e):(p=tx.exec(e))?(s="-"===p[1]?-1:1,h={y:0,d:ed(p[2])*s,h:ed(p[3])*s,m:ed(p[4])*s,s:ed(p[5])*s,ms:ed(td(1e3*p[6]))*s}):(p=tb.exec(e))?(s="-"===p[1]?-1:1,h={y:tE(p[2],s),M:tE(p[3],s),w:tE(p[4],s),d:tE(p[5],s),h:tE(p[6],s),m:tE(p[7],s),s:tE(p[8],s)}):null==h?h={}:"object"==typeof h&&("from"in h||"to"in h)&&(i=ta(h.from),n=ta(h.to),c=i.isValid()&&n.isValid()?(n=t_(n,i),i.isBefore(n)?a=tS(i,n):((a=tS(n,i)).milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0},(h={}).ms=c.milliseconds,h.M=c.months),u=new th(h),tp(e)&&o(e,"_locale")&&(u._locale=e._locale),tp(e)&&o(e,"_isValid")&&(u._isValid=e._isValid),u}function tE(e,r){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*r}function tS(e,r){var i={};return i.months=r.month()-e.month()+(r.year()-e.year())*12,e.clone().add(i.months,"M").isAfter(r)&&--i.months,i.milliseconds=r-e.clone().add(i.months,"M"),i}function tT(e,r){return function(i,n){var o;
9return null===n||isNaN(+n)||(I(r,"moment()."+r+"(period, number) is deprecated. Please use moment()."+r+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),tI(this,tw(i,n),e),this}}function tI(e,i,n,o){var a=i._milliseconds,s=td(i._days),l=td(i._months);e.isValid()&&(o=null==o||o,l&&eM(e,eb(e,"Month")+l*n),s&&ew(e,"Date",eb(e,"Date")+s*n),a&&e._d.setTime(e._d.valueOf()+a*n),o&&r.updateOffset(e,s||l))}tw.fn=th.prototype,tw.invalid=function(){return tw(NaN)};var tM=tT(1,"add"),tC=tT(-1,"subtract");function tA(e){return"string"==typeof e||e instanceof String}function tP(e,r){if(e.date()<r.date())return-tP(r,e);var i,n=(r.year()-e.year())*12+(r.month()-e.month()),o=e.clone().add(n,"months");return i=r-o<0?(r-o)/(o-e.clone().add(n-1,"months")):(r-o)/(e.clone().add(n+1,"months")-o),-(n+i)||0}function tL(e){var r;return void 0===e?this._locale._abbr:(null!=(r=eJ(e))&&(this._locale=r),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var tO=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function tD(){return this._locale}function tR(e,r,i){return e<100&&e>=0?new Date(e+400,r,i)-126227808e5:new Date(e,r,i).valueOf()}function tk(e,r,i){return e<100&&e>=0?Date.UTC(e+400,r,i)-126227808e5:Date.UTC(e,r,i)}function tN(e,r){return r.erasAbbrRegex(e)}function tF(){var e,r,i,n,o,a=[],s=[],l=[],u=[],c=this.eras();for(e=0,r=c.length;e<r;++e)i=eh(c[e].name),n=eh(c[e].abbr),o=eh(c[e].narrow),s.push(i),a.push(n),l.push(o),u.push(i),u.push(n),u.push(o);this._erasRegex=RegExp("^("+u.join("|")+")","i"),this._erasNameRegex=RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=RegExp("^("+a.join("|")+")","i"),this._erasNarrowRegex=RegExp("^("+l.join("|")+")","i")}function tz(e,r){k(0,[e,e.length],0,r)}function tB(e,r,i,n,o){var a;return null==e?eR(this,n,o).year:(r>(a=ek(e,n,o))&&(r=a),tU.call(this,e,r,i,n,o))}function tU(e,r,i,n,o){var a=eD(e,r,i,n,o),s=eL(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}k("N",0,0,"eraAbbr"),k("NN",0,0,"eraAbbr"),k("NNN",0,0,"eraAbbr"),k("NNNN",0,0,"eraName"),k("NNNNN",0,0,"eraNarrow"),k("y",["y",1],"yo","eraYear"),k("y",["yy",2],0,"eraYear"),k("y",["yyy",3],0,"eraYear"),k("y",["yyyy",4],0,"eraYear"),ec("N",tN),ec("NN",tN),ec("NNN",tN),ec("NNNN",function(e,r){return r.erasNameRegex(e)}),ec("NNNNN",function(e,r){return r.erasNarrowRegex(e)}),em(["N","NN","NNN","NNNN","NNNNN"],function(e,r,i,n){var o=i._locale.erasParse(e,n,i._strict);o?d(i).era=o:d(i).invalidEra=e}),ec("y",ei),ec("yy",ei),ec("yyy",ei),ec("yyyy",ei),ec("yo",function(e,r){return r._eraYearOrdinalRegex||ei}),em(["y","yy","yyy","yyyy"],0),em(["yo"],function(e,r,i,n){var o;i._locale._eraYearOrdinalRegex&&(o=e.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?r[0]=i._locale.eraYearOrdinalParse(e,o):r[0]=parseInt(e,10)}),k(0,["gg",2],0,function(){return this.weekYear()%100}),k(0,["GG",2],0,function(){return this.isoWeekYear()%100}),tz("gggg","weekYear"),tz("ggggg","weekYear"),tz("GGGG","isoWeekYear"),tz("GGGGG","isoWeekYear"),ec("G",en),ec("g",en),ec("GG",K,W),ec("gg",K,W),ec("GGGG",et,Z),ec("gggg",et,Z),ec("GGGGG",er,X),ec("ggggg",er,X),eg(["gggg","ggggg","GGGG","GGGGG"],function(e,r,i,n){r[n.substr(0,2)]=ed(e)}),eg(["gg","GG"],function(e,i,n,o){i[o]=r.parseTwoDigitYear(e)}),k("Q",0,"Qo","quarter"),ec("Q",$),em("Q",function(e,r){r[1]=(ed(e)-1)*3}),k("D",["DD",2],"Do","date"),ec("D",K,el),ec("DD",K,W),ec("Do",function(e,r){return e?r._dayOfMonthOrdinalParse||r._ordinalParse:r._dayOfMonthOrdinalParseLenient}),em(["D","DD"],2),em("Do",function(e,r){r[2]=ed(e.match(K)[0])});var tj=ex("Date",!0);k("DDD",["DDDD",3],"DDDo","dayOfYear"),ec("DDD",ee),ec("DDDD",Y),em(["DDD","DDDD"],function(e,r,i){i._dayOfYear=ed(e)}),k("m",["mm",2],0,"minute"),ec("m",K,eu),ec("mm",K,W),em(["m","mm"],4);var tV=ex("Minutes",!1);k("s",["ss",2],0,"second"),ec("s",K,eu),ec("ss",K,W),em(["s","ss"],5);var tG=ex("Seconds",!1);for(k("S",0,0,function(){return~~(this.millisecond()/100)}),k(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),k(0,["SSS",3],0,"millisecond"),k(0,["SSSS",4],0,function(){return 10*this.millisecond()}),k(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),k(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),k(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),k(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),k(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ec("S",ee,$),ec("SS",ee,W),ec("SSS",ee,Y),g="SSSS";g.length<=9;g+="S")ec(g,ei);function tq(e,r){r[6]=ed(("0."+e)*1e3)}for(g="S";g.length<=9;g+="S")em(g,tq);_=ex("Milliseconds",!1),k("z",0,0,"zoneAbbr"),k("zz",0,0,"zoneName");var tH=b.prototype;function t$(e){return e}tH.add=tM,tH.calendar=function(e,s){if(1==arguments.length)if(arguments[0]){var c,h,p,d;if(c=arguments[0],w(c)||u(c)||tA(c)||l(c)||(p=i(h=c),d=!1,p&&(d=0===h.filter(function(e){return!l(e)&&tA(h)}).length),p&&d)||function(e){var r,i,s=n(e)&&!a(e),l=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],c=u.length;for(r=0;r<c;r+=1)i=u[r],l=l||o(e,i);return s&&l}(c)||null==c)e=arguments[0],s=void 0;else(function(e){var r,i,s=n(e)&&!a(e),l=!1,u=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(r=0;r<u.length;r+=1)i=u[r],l=l||o(e,i);return s&&l})(arguments[0])&&(s=arguments[0],e=void 0)}else e=void 0,s=void 0;var f=e||ta(),m=t_(f,this).startOf("day"),g=r.calendarFormat(this,m)||"s
9ameElse",_=s&&(M(s[g])?s[g].call(this,f):s[g]);return this.format(_||this.localeData().calendar(g,this,ta(f)))},tH.clone=function(){return new b(this)},tH.diff=function(e,r,i){var n,o,a;if(!this.isValid()||!(n=t_(e,this)).isValid())return NaN;switch(o=(n.utcOffset()-this.utcOffset())*6e4,r=B(r)){case"year":a=tP(this,n)/12;break;case"month":a=tP(this,n);break;case"quarter":a=tP(this,n)/3;break;case"second":a=(this-n)/1e3;break;case"minute":a=(this-n)/6e4;break;case"hour":a=(this-n)/36e5;break;case"day":a=(this-n-o)/864e5;break;case"week":a=(this-n-o)/6048e5;break;default:a=this-n}return i?a:ep(a)},tH.endOf=function(e){var i,n;if(void 0===(e=B(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?tk:tR,e){case"year":i=n(this.year()+1,0,1)-1;break;case"quarter":i=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":i=n(this.year(),this.month()+1,1)-1;break;case"week":i=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":i=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":i=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":i=this._d.valueOf(),i+=36e5-((i+(this._isUTC?0:6e4*this.utcOffset()))%36e5+36e5)%36e5-1;break;case"minute":i=this._d.valueOf(),i+=6e4-(i%6e4+6e4)%6e4-1;break;case"second":i=this._d.valueOf(),i+=1e3-(i%1e3+1e3)%1e3-1}return this._d.setTime(i),r.updateOffset(this,!0),this},tH.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var i=N(this,e);return this.localeData().postformat(i)},tH.from=function(e,r){return this.isValid()&&(w(e)&&e.isValid()||ta(e).isValid())?tw({to:this,from:e}).locale(this.locale()).humanize(!r):this.localeData().invalidDate()},tH.fromNow=function(e){return this.from(ta(),e)},tH.to=function(e,r){return this.isValid()&&(w(e)&&e.isValid()||ta(e).isValid())?tw({from:this,to:e}).locale(this.locale()).humanize(!r):this.localeData().invalidDate()},tH.toNow=function(e){return this.to(ta(),e)},tH.get=function(e){return M(this[e=B(e)])?this[e]():this},tH.invalidAt=function(){return d(this).overflow},tH.isAfter=function(e,r){var i=w(e)?e:ta(e);return!!(this.isValid()&&i.isValid())&&("millisecond"===(r=B(r)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(r).valueOf())},tH.isBefore=function(e,r){var i=w(e)?e:ta(e);return!!(this.isValid()&&i.isValid())&&("millisecond"===(r=B(r)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(r).valueOf()<i.valueOf())},tH.isBetween=function(e,r,i,n){var o=w(e)?e:ta(e),a=w(r)?r:ta(r);return!!(this.isValid()&&o.isValid()&&a.isValid())&&("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(a,i):!this.isAfter(a,i))},tH.isSame=function(e,r){var i,n=w(e)?e:ta(e);return!!(this.isValid()&&n.isValid())&&("millisecond"===(r=B(r)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(r).valueOf()<=i&&i<=this.clone().endOf(r).valueOf()))},tH.isSameOrAfter=function(e,r){return this.isSame(e,r)||this.isAfter(e,r)},tH.isSameOrBefore=function(e,r){return this.isSame(e,r)||this.isBefore(e,r)},tH.isValid=function(){return f(this)},tH.lang=tO,tH.locale=tL,tH.localeData=tD,tH.max=tl,tH.min=ts,tH.parsingFlags=function(){return h({},d(this))},tH.set=function(e,r){if("object"==typeof e){var i,n=function(e){var r,i=[];for(r in e)o(e,r)&&i.push({unit:r,priority:q[r]});return i.sort(function(e,r){return e.priority-r.priority}),i}(e=U(e)),a=n.length;for(i=0;i<a;i++)this[n[i].unit](e[n[i].unit])}else if(M(this[e=B(e)]))return this[e](r);return this},tH.startOf=function(e){var i,n;if(void 0===(e=B(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?tk:tR,e){case"year":i=n(this.year(),0,1);break;case"quarter":i=n(this.year(),this.month()-this.month()%3,1);break;case"month":i=n(this.year(),this.month(),1);break;case"week":i=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":i=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":i=n(this.year(),this.month(),this.date());break;case"hour":i=this._d.valueOf(),i-=((i+(this._isUTC?0:6e4*this.utcOffset()))%36e5+36e5)%36e5;break;case"minute":i=this._d.valueOf(),i-=(i%6e4+6e4)%6e4;break;case"second":i=this._d.valueOf(),i-=(i%1e3+1e3)%1e3}return this._d.setTime(i),r.updateOffset(this,!0),this},tH.subtract=tC,tH.toArray=function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]},tH.toObject=function(){return{years:this.year(),months:this.month(),date:this.date(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()}},tH.toDate=function(){return new Date(this.valueOf())},tH.toISOString=function(e){if(!this.isValid())return null;var r=!0!==e,i=r?this.clone().utc():this;if(0>i.year()||i.year()>9999)return N(i,r?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ");if(M(Date.prototype.toISOString))if(r)return this.toDate().toISOString();else return new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(i,"Z"));return N(i,r?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}
9,tH.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,r,i,n="moment",o="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+n+'("]',r=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",i=o+'[")]',this.format(e+r+"-MM-DD[T]HH:mm:ss.SSS"+i)},"u">typeof Symbol&&null!=Symbol.for&&(tH[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),tH.toJSON=function(){return this.isValid()?this.toISOString():null},tH.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},tH.unix=function(){return Math.floor(this.valueOf()/1e3)},tH.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},tH.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},tH.eraName=function(){var e,r,i,n=this.localeData().eras();for(e=0,r=n.length;e<r;++e)if(i=this.clone().startOf("day").valueOf(),n[e].since<=i&&i<=n[e].until||n[e].until<=i&&i<=n[e].since)return n[e].name;return""},tH.eraNarrow=function(){var e,r,i,n=this.localeData().eras();for(e=0,r=n.length;e<r;++e)if(i=this.clone().startOf("day").valueOf(),n[e].since<=i&&i<=n[e].until||n[e].until<=i&&i<=n[e].since)return n[e].narrow;return""},tH.eraAbbr=function(){var e,r,i,n=this.localeData().eras();for(e=0,r=n.length;e<r;++e)if(i=this.clone().startOf("day").valueOf(),n[e].since<=i&&i<=n[e].until||n[e].until<=i&&i<=n[e].since)return n[e].abbr;return""},tH.eraYear=function(){var e,i,n,o,a=this.localeData().eras();for(e=0,i=a.length;e<i;++e)if(n=a[e].since<=a[e].until?1:-1,o=this.clone().startOf("day").valueOf(),a[e].since<=o&&o<=a[e].until||a[e].until<=o&&o<=a[e].since)return(this.year()-r(a[e].since).year())*n+a[e].offset;return this.year()},tH.year=ev,tH.isLeapYear=function(){return e_(this.year())},tH.weekYear=function(e){return tB.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},tH.isoWeekYear=function(e){return tB.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},tH.quarter=tH.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)},tH.month=eC,tH.daysInMonth=function(){return eE(this.year(),this.month())},tH.week=tH.weeks=function(e){var r=this.localeData().week(this);return null==e?r:this.add((e-r)*7,"d")},tH.isoWeek=tH.isoWeeks=function(e){var r=eR(this,1,4).week;return null==e?r:this.add((e-r)*7,"d")},tH.weeksInYear=function(){var e=this.localeData()._week;return ek(this.year(),e.dow,e.doy)},tH.weeksInWeekYear=function(){var e=this.localeData()._week;return ek(this.weekYear(),e.dow,e.doy)},tH.isoWeeksInYear=function(){return ek(this.year(),1,4)},tH.isoWeeksInISOWeekYear=function(){return ek(this.isoWeekYear(),1,4)},tH.date=tj,tH.day=tH.days=function(e){if(!this.isValid())return null!=e?this:NaN;var r,i,n=eb(this,"Day");return null==e?n:(r=e,i=this.localeData(),e="string"!=typeof r?r:isNaN(r)?"number"==typeof(r=i.weekdaysParse(r))?r:null:parseInt(r,10),this.add(e-n,"d"))},tH.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var r=(this.day()+7-this.localeData()._week.dow)%7;return null==e?r:this.add(e-r,"d")},tH.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var r,i=(r=this.localeData(),"string"==typeof e?r.weekdaysParse(e)%7||7:isNaN(e)?null:e);return this.day(this.day()%7?i:i-7)},tH.dayOfYear=function(e){var r=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?r:this.add(e-r,"d")},tH.hour=tH.hours=eH,tH.minute=tH.minutes=tV,tH.second=tH.seconds=tG,tH.millisecond=tH.milliseconds=_,tH.utcOffset=function(e,i,n){var o,a=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?a:ty(this);if("string"==typeof e){if(null===(e=tg(ea,e)))return this}else 16>Math.abs(e)&&!n&&(e*=60);return!this._isUTC&&i&&(o=ty(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),a!==e&&(!i||this._changeInProgress?tI(this,tw(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this},tH.utc=function(e){return this.utcOffset(0,e)},tH.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(ty(this),"m")),this},tH.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=tg(eo,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},tH.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?ta(e).utcOffset():0,(this.utcOffset()-e)%60==0)},tH.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},tH.isLocal=function(){return!!this.isValid()&&!this._isUTC},tH.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},tH.isUtc=tv,tH.isUTC=tv,tH.zoneAbbr=function(){return this._isUTC?"UTC":""},tH.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},tH.dates=S("dates accessor is deprecated. Use date instead.",tj),tH.months=S("months accessor is deprecated. Use month instead",eC),tH.years=S("years accessor is deprecated. Use year instead",ev),tH.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,r){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,r),this):-this.utcOffset()}),tH.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e,r={};return x(r,this),(r=tn(r))._a?(e=r._isUTC?p(r._a):ta(r._a),this._isDSTShifted=this.isValid()&&function(e,r){var i,n=Math.min(e.length,r.length),o=Math.abs(e.length-r.length),a=0;for(i=0;i<n;i++)ed(e[i])!==ed(r[i])&&a++;return a+o}(r._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var tW=A.prototype;function tY(e,r,i,n){var o=eJ(),a=p().set(n,r);return o[i](a,e)}function tZ(e,r,i){if(l(e)&&(r=e,e=void 0),e=e||"",null!=r)return tY(e,r,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=tY(e,n,i,"month");return o}function tX(e,r,i,n){"boolean"==typeof e||(i=r=e,e=!1),l(r)&&(i=r,r=void 0),r=r||"";var o,a=eJ(),s=e?a._week.dow:0,u=[];
vendor: 8,697 bytes, line 9
9if(null!=i)return tY(r,(i+s)%7,n,"day");for(o=0;o<7;o++)u[o]=tY(r,(o+s)%7,n,"day");return u}tW.calendar=function(e,r,i){var n=this._calendar[e]||this._calendar.sameElse;return M(n)?n.call(r,i):n},tW.longDateFormat=function(e){var r=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return r||!i?r:(this._longDateFormat[e]=i.match(L).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},tW.invalidDate=function(){return this._invalidDate},tW.ordinal=function(e){return this._ordinal.replace("%d",e)},tW.preparse=t$,tW.postformat=t$,tW.relativeTime=function(e,r,i,n){var o=this._relativeTime[i];return M(o)?o(e,r,i,n):o.replace(/%d/i,e)},tW.pastFuture=function(e,r){var i=this._relativeTime[e>0?"future":"past"];return M(i)?i(r):i.replace(/%s/i,r)},tW.set=function(e){var r,i;for(i in e)o(e,i)&&(M(r=e[i])?this[i]=r:this["_"+i]=r);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},tW.eras=function(e,i){var n,o,a,s=this._eras||eJ("en")._eras;for(n=0,o=s.length;n<o;++n)switch("string"==typeof s[n].since&&(a=r(s[n].since).startOf("day"),s[n].since=a.valueOf()),typeof s[n].until){case"undefined":s[n].until=Infinity;break;case"string":a=r(s[n].until).startOf("day").valueOf(),s[n].until=a.valueOf()}return s},tW.erasParse=function(e,r,i){var n,o,a,s,l,u=this.eras();for(e=e.toUpperCase(),n=0,o=u.length;n<o;++n)if(a=u[n].name.toUpperCase(),s=u[n].abbr.toUpperCase(),l=u[n].narrow.toUpperCase(),i)switch(r){case"N":case"NN":case"NNN":if(s===e)return u[n];break;case"NNNN":if(a===e)return u[n];break;case"NNNNN":if(l===e)return u[n]}else if([a,s,l].indexOf(e)>=0)return u[n]},tW.erasConvertYear=function(e,i){var n=e.since<=e.until?1:-1;return void 0===i?r(e.since).year():r(e.since).year()+(i-e.offset)*n},tW.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||tF.call(this),e?this._erasAbbrRegex:this._erasRegex},tW.erasNameRegex=function(e){return o(this,"_erasNameRegex")||tF.call(this),e?this._erasNameRegex:this._erasRegex},tW.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||tF.call(this),e?this._erasNarrowRegex:this._erasRegex},tW.months=function(e,r){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||eT).test(r)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},tW.monthsShort=function(e,r){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[eT.test(r)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},tW.monthsParse=function(e,r,i){var n,o,a;if(this._monthsParseExact)return eI.call(this,e,r,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=p([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(a="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=RegExp(a.replace(".",""),"i")),i&&"MMMM"===r&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===r&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}},tW.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||eA.call(this),e)?this._monthsStrictRegex:this._monthsRegex:(o(this,"_monthsRegex")||(this._monthsRegex=es),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},tW.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||eA.call(this),e)?this._monthsShortStrictRegex:this._monthsShortRegex:(o(this,"_monthsShortRegex")||(this._monthsShortRegex=es),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},tW.week=function(e){return eR(e,this._week.dow,this._week.doy).week},tW.firstDayOfYear=function(){return this._week.doy},tW.firstDayOfWeek=function(){return this._week.dow},tW.weekdays=function(e,r){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(r)?"format":"standalone"];return!0===e?eN(n,this._week.dow):e?n[e.day()]:n},tW.weekdaysMin=function(e){return!0===e?eN(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},tW.weekdaysShort=function(e){return!0===e?eN(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},tW.weekdaysParse=function(e,r,i){var n,o,a;if(this._weekdaysParseExact)return ez.call(this,e,r,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(a="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=RegExp(a.replace(".",""),"i")),i&&"dddd"===r&&this._fullWeekdaysParse[n].test(e))return n;if(i&&"ddd"===r&&this._shortWeekdaysParse[n].test(e))return n;if(i&&"dd"===r&&this._minWeekdaysParse[n].test(e))return n;else if(!i&&this._weekdaysParse[n].test(e))return n}},tW.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||eB.call(this),e)?this._weekdaysStrictRegex:this._weekdaysRegex:(o(this,"_weekdaysRegex")||(this._weekdaysRegex=es),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},tW.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||eB.call(this),e)?this._weekdaysShortStrictRegex:this._weekdaysShortRegex:(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=es),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},tW.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||eB.call(this),e)?this._weekdaysMinStrictRegex:this._weekdaysMinRegex:(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=es),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},tW.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},tW.meridiem=function(e,r,i){return e>11?i?"pm":"PM":i?"am":"AM"},eK("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var r=e%10,i=1===ed(e%100/10)?"th":1===r?"st":2===r?"nd":3===r?"rd":"th";return e+i}}),r.lang=S("moment.lang is deprecated. Use moment.locale instead.",eK),r.langData=S("moment.langData is deprecated. Use moment.localeData instead.",eJ);var tK=Math.abs;function tQ(e,r,i,n){var o=tw(r,i);return e._milliseconds+=n*o._milliseconds,e._days+=n*o._days,e._months+=n*o._months,e._bubble()}function tJ(e){return e<0?Math.floor(e):Math.ceil(e)}function t0(e){return 4800*e/146097}function t1(e){return 146097*e/4800}function t2(e){return function(){return this.as(e)}}var t3=t2("ms"),t5=t2("s"),t4=t2("m"),t6=t2("h"),t8=t2("d"),t9=t2("w"),t7=t2("M"),re=t2("Q"),rt=t2("y");function rr(e){return function(){return this.isValid()?this._data[e]:NaN}}var ri=rr("milliseconds"),rn=rr("seconds"),ro=rr("minutes"),ra=rr("hours"),rs=rr("days"),rl=rr("months"),ru=rr("years"),rc=Math.round,rh={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rp(e,r,i,n,o){return o.relativeTime(r||1,!!i,e,n)}var rd=Math.abs;function rf(e){return(e>0)-(e<0)||+e}function rm(){if(!this.isValid())return this.localeData().invalidDate();var e,r,i,n,o,a,s,l,u=rd(this._milliseconds)/1e3,c=rd(this._days),h=rd(this._months),p=this.asSeconds();return p?(e=ep(u/60),r=ep(e/60),u%=60,e%=60,i=ep(h/12),h%=12,n=u?u.toFixed(3).replace(/\.?0+$/,""):"",o=p<0?"-":"",a=rf(this._months)!==rf(p)?"-":"",s=rf(this._days)!==rf(p)?"-":"",l=rf(this._milliseconds)!==rf(p)?"-":"",o+"P"+(i?a+i+"Y":"")+(h?a+h+"M":"")+(c?s+c+"D":"")+(r||e||u?"T":"")+(r?l+r+"H":"")+(e?l+e+"M":"")+(u?l+n+"S":"")):"P0D"}var rg=th.prototype;return rg.isValid=function(){return this._isValid},rg.abs=function(){var e=this._data;return this._milliseconds=tK(this._milliseconds),this._days=tK(this._days),this._months=tK(this._months),e.milliseconds=tK(e.milliseconds),e.seconds=tK(e.seconds),e.minutes=tK(e.minutes),e.hours=tK(e.hours),e.months=tK(e.months),e.years=tK(e.
9years),this},rg.add=function(e,r){return tQ(this,e,r,1)},rg.subtract=function(e,r){return tQ(this,e,r,-1)},rg.as=function(e){if(!this.isValid())return NaN;var r,i,n=this._milliseconds;if("month"===(e=B(e))||"quarter"===e||"year"===e)switch(r=this._days+n/864e5,i=this._months+t0(r),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(r=this._days+Math.round(t1(this._months)),e){case"week":return r/7+n/6048e5;case"day":return r+n/864e5;case"hour":return 24*r+n/36e5;case"minute":return 1440*r+n/6e4;case"second":return 86400*r+n/1e3;case"millisecond":return Math.floor(864e5*r)+n;default:throw Error("Unknown unit "+e)}},rg.asMilliseconds=t3,rg.asSeconds=t5,rg.asMinutes=t4,rg.asHours=t6,rg.asDays=t8,rg.asWeeks=t9,rg.asMonths=t7,rg.asQuarters=re,rg.asYears=rt,rg.valueOf=t3,rg._bubble=function(){var e,r,i,n,o,a=this._milliseconds,s=this._days,l=this._months,u=this._data;return a>=0&&s>=0&&l>=0||a<=0&&s<=0&&l<=0||(a+=864e5*tJ(t1(l)+s),s=0,l=0),u.milliseconds=a%1e3,u.seconds=(e=ep(a/1e3))%60,u.minutes=(r=ep(e/60))%60,u.hours=(i=ep(r/60))%24,s+=ep(i/24),l+=o=ep(t0(s)),s-=tJ(t1(o)),n=ep(l/12),l%=12,u.days=s,u.months=l,u.years=n,this},rg.clone=function(){return tw(this)},rg.get=function(e){return e=B(e),this.isValid()?this[e+"s"]():NaN},rg.milliseconds=ri,rg.seconds=rn,rg.minutes=ro,rg.hours=ra,rg.days=rs,rg.weeks=function(){return ep(this.days()/7)},rg.months=rl,rg.years=ru,rg.humanize=function(e,r){if(!this.isValid())return this.localeData().invalidDate();var i,n,o,a,s,l,u,c,h,p,d,f,m,g=!1,_=rh;return"object"==typeof e&&(r=e,e=!1),"boolean"==typeof e&&(g=e),"object"==typeof r&&(_=Object.assign({},rh,r),null!=r.s&&null==r.ss&&(_.ss=r.s-1)),f=this.localeData(),i=!g,n=_,o=tw(this).abs(),a=rc(o.as("s")),s=rc(o.as("m")),l=rc(o.as("h")),u=rc(o.as("d")),c=rc(o.as("M")),h=rc(o.as("w")),p=rc(o.as("y")),d=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||s<=1&&["m"]||s<n.m&&["mm",s]||l<=1&&["h"]||l<n.h&&["hh",l]||u<=1&&["d"]||u<n.d&&["dd",u],null!=n.w&&(d=d||h<=1&&["w"]||h<n.w&&["ww",h]),(d=d||c<=1&&["M"]||c<n.M&&["MM",c]||p<=1&&["y"]||["yy",p])[2]=i,d[3]=+this>0,d[4]=f,m=rp.apply(null,d),g&&(m=f.pastFuture(+this,m)),f.postformat(m)},rg.toISOString=rm,rg.toString=rm,rg.toJSON=rm,rg.locale=tL,rg.localeData=tD,rg.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rm),rg.lang=tO,k("X",0,0,"unix"),k("x",0,0,"valueOf"),ec("x",en),ec("X",/[+-]?\d+(\.\d{1,3})?/),em("X",function(e,r,i){i._d=new Date(1e3*parseFloat(e))}),em("x",function(e,r,i){i._d=new Date(ed(e))}),r.version="2.30.1",j=ta,r.fn=tH,r.min=function(){var e=[].slice.call(arguments,0);return tu("isBefore",e)},r.max=function(){var e=[].slice.call(arguments,0);return tu("isAfter",e)},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return ta(1e3*e)},r.months=function(e,r){return tZ(e,r,"months")},r.isDate=u,r.locale=eK,r.invalid=m,r.duration=tw,r.isMoment=w,r.weekdays=function(e,r,i){return tX(e,r,i,"weekdays")},r.parseZone=function(){return ta.apply(null,arguments).parseZone()},r.localeData=eJ,r.isDuration=tp,r.monthsShort=function(e,r){return tZ(e,r,"monthsShort")},r.weekdaysMin=function(e,r,i){return tX(e,r,i,"weekdaysMin")},r.defineLocale=eQ,r.updateLocale=function(e,r){if(null!=r){var i,n,o=e$;null!=eW[e]&&null!=eW[e].parentLocale?eW[e].set(C(eW[e]._config,r)):(null!=(n=eX(e))&&(o=n._config),r=C(o,r),null==n&&(r.abbr=e),(i=new A(r)).parentLocale=eW[e],eW[e]=i),eK(e)}else null!=eW[e]&&(null!=eW[e].parentLocale?(eW[e]=eW[e].parentLocale,e===eK()&&eK(e)):null!=eW[e]&&delete eW[e]);return eW[e]},r.locales=function(){return H(eW)},r.weekdaysShort=function(e,r,i){return tX(e,r,i,"weekdaysShort")},r.normalizeUnits=B,r.relativeTimeRounding=function(e){return void 0===e?rc:"function"==typeof e&&(rc=e,!0)},r.relativeTimeThreshold=function(e,r){return void 0!==rh[e]&&(void 0===r?rh[e]:(rh[e]=r,"s"===e&&(rh.ss=r-1),!0))},r.calendarFormat=function(e,r){var i=e.diff(r,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},r.prototype=tH,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()},10875:(e,r,i)=>{"use strict";var n=i(2398),o=i(64485),a=i(38650),s=i(15796),l=i(9426),u=i(12968);function c(e,r,i){var a=r,c=n(a);if(null!=c||e&&(e===a||e.firstChild===a)||s(!1),e===a&&(l(a=a.firstChild)||s(!1),"true"!==a.getAttribute("data-contents")&&s(!1),i>0&&(i=a.childNodes.length)),0===i){var p=null;if(null!=c)p=c;else{var d=function(e){for(;e.firstChild&&(l(e.firstChild)&&"true"===e.firstChild.getAttribute("data-blocks")||o(e.firstChild));)e=e.firstChild;return e}(a);p=u(o(d))}return{key:p,offset:0}}var f=a.childNodes[i-1],m=null,g=null;if(o(f)){var _=function(e){for(;
9e.lastChild&&(l(e.lastChild)&&"true"===e.lastChild.getAttribute("data-blocks")||o(e.lastChild));)e=e.lastChild;return e}(f);m=u(o(_)),g=h(_)}else m=u(c),g=h(f);return{key:m,offset:g}}function h(e){var r=e.textContent;return"\n"===r?0:r.length}e.exports=function(e,r,i,o,s,l){var h=i.nodeType===Node.TEXT_NODE,p=s.nodeType===Node.TEXT_NODE;if(h&&p)return{selectionState:a(e,u(n(i)),o,u(n(s)),l),needsRecovery:!1};var d=null,f=null,m=!0;return h?(d={key:u(n(i)),offset:o},f=c(r,s,l)):p?(f={key:u(n(s)),offset:l},d=c(r,i,o)):(d=c(r,i,o),f=c(r,s,l),i===s&&o===l&&(m=!!i.firstChild&&"BR"!==i.firstChild.nodeName)),{selectionState:a(e,d.key,d.offset,f.key,f.offset),needsRecovery:m}}},11151:(e,r,i)=>{"use strict";var n=i(57793),o=i(75864),a=i(74637),s=RegExp("\r\n","g"),l={"text/rtf":1,"text/html":1};function u(e){if("file"==e.kind)return e.getAsFile()}e.exports=function(){function e(e){this.data=e,this.types=e.types?o(e.types):[]}var r=e.prototype;return r.isRichText=function(){return!!(this.getHTML()&&this.getText())||!this.isImage()&&this.types.some(function(e){return l[e]})},r.getText=function(){var e;return this.data.getData&&(this.types.length?-1!=this.types.indexOf("text/plain")&&(e=this.data.getData("text/plain")):e=this.data.getData("Text")),e?e.replace(s,"\n"):null},r.getHTML=function(){if(this.data.getData){if(!this.types.length)return this.data.getData("Text");else if(-1!=this.types.indexOf("text/html"))return this.data.getData("text/html")}},r.isLink=function(){return this.types.some(function(e){return -1!=e.indexOf("Url")||-1!=e.indexOf("text/uri-list")||e.indexOf("text/x-moz-url")})},r.getLink=function(){return this.data.getData?-1!=this.types.indexOf("text/x-moz-url")?this.data.getData("text/x-moz-url").split("\n")[0]:-1!=this.types.indexOf("text/uri-list")?this.data.getData("text/uri-list"):this.data.getData("url"):null},r.isImage=function(){if(this.types.some(function(e){return -1!=e.indexOf("application/x-moz-file")}))return!0;for(var e=this.getFiles(),r=0;r<e.length;r++){var i=e[r].type;if(!n.isImage(i))return!1}return!0},r.getCount=function(){return this.data.hasOwnProperty("items")?this.data.items.length:this.data.hasOwnProperty("mozItemCount")?this.data.mozItemCount:this.data.files?this.data.files.length:null},r.getFiles=function(){return this.data.items?Array.prototype.slice.call(this.data.items).map(u).filter(a.thatReturnsArgument):this.data.files?Array.prototype.slice.call(this.data.files):[]},r.hasFiles=function(){return this.getFiles().length>0},e}()},11228:(e,r,i)=>{"use strict";function n(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){o(e,r,i[r])})}return e}function o(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var a,s=i(60620),l=i(18428),u=i(9912),c=i(74011),h=i(44510),p=i(2194),d=i(73239),f=i(58217),m=i(5686),g=i(58240),_=i(93710),y=_.List,v=_.Map,x=_.OrderedSet,b=i(3566),w=i(34769),E=i(4833),S=i(43708),T=g("draft_tree_data_support"),I=RegExp("\r","g"),M=RegExp("\n","g"),C=RegExp("^\n","g"),A=RegExp("&nbsp;","g"),P=RegExp("&#13;?","g"),L=RegExp("&#8203;?","g"),O=["bold","bolder","500","600","700","800","900"],D=["light","lighter","normal","100","200","300","400"],R=["className","href","rel","target","title"],k=["alt","className","height","src","width"],N=(o(a={},d("public/DraftStyleDefault/depth0"),0),o(a,d("public/DraftStyleDefault/depth1"),1),o(a,d("public/DraftStyleDefault/depth2"),2),o(a,d("public/DraftStyleDefault/depth3"),3),o(a,d("public/DraftStyleDefault/depth4"),4),a),F=v({b:"BOLD",code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",i:"ITALIC",s:"STRIKETHROUGH",strike:"STRIKETHROUGH",strong:"BOLD",u:"UNDERLINE",mark:"HIGHLIGHT"}),z=function(e){var r={};return e.mapKeys(function(e,i){var n=[i.element];void 0!==i.aliasedElements&&n.push.apply(n,i.aliasedElements),n.forEach(function(i){void 0===r[i]?r[i]=e:"string"==typeof r[i]?r[i]=[r[i],e]:r[i].push(e)})}),v(r)},B=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(N).some(function(i){e.classList.contains(i)&&(r=N[i])}),r},U=function(e){if(!b(e)||!e.href||"http:"!==e.protocol&&"https:"!==e.protocol&&"mailto:"!==e.protocol&&"tel:"!==e.protocol)return!1;try{return new p(e.href),!0}catch(e){return!1}},j=function(e,r){if(!E(e))return r;
9var i=e.style.fontWeight,n=e.style.fontStyle,o=e.style.textDecoration;return r.withMutations(function(e){O.indexOf(i)>=0?e.add("BOLD"):D.indexOf(i)>=0&&e.remove("BOLD"),"italic"===n?e.add("ITALIC"):"normal"===n&&e.remove("ITALIC"),"underline"===o&&e.add("UNDERLINE"),"line-through"===o&&e.add("STRIKETHROUGH"),"none"===o&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))})},V=function(e){return"ul"===e||"ol"===e},G=function(){function e(e,r){o(this,"characterList",y()),o(this,"currentBlockType","unstyled"),o(this,"currentDepth",0),o(this,"currentEntity",null),o(this,"currentText",""),o(this,"wrapper",null),o(this,"blockConfigs",[]),o(this,"contentBlocks",[]),o(this,"entityMap",h),o(this,"blockTypeMap",void 0),o(this,"disambiguate",void 0),this.clear(),this.blockTypeMap=e,this.disambiguate=r}var r=e.prototype;return r.clear=function(){this.characterList=y(),this.blockConfigs=[],this.currentBlockType="unstyled",this.currentDepth=0,this.currentEntity=null,this.currentText="",this.entityMap=h,this.wrapper=null,this.contentBlocks=[]},r.addDOMNode=function(e){var r;return this.contentBlocks=[],this.currentDepth=0,(r=this.blockConfigs).push.apply(r,this._toBlockConfigs([e],x())),this._trimCurrentText(),""!==this.currentText&&this.blockConfigs.push(this._makeBlockConfig()),this},r.getContentBlocks=function(){return 0===this.contentBlocks.length&&(T?this._toContentBlocks(this.blockConfigs):this._toFlatContentBlocks(this.blockConfigs)),{contentBlocks:this.contentBlocks,entityMap:this.entityMap}},r._makeBlockConfig=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n({key:e.key||f(),type:this.currentBlockType,text:this.currentText,characterList:this.characterList,depth:this.currentDepth,parent:null,children:y(),prevSibling:null,nextSibling:null,childConfigs:[]},e);return this.characterList=y(),this.currentBlockType="unstyled",this.currentText="",r},r._toBlockConfigs=function(e,r){for(var i=[],n=0;n<e.length;n++){var o,a=e[n],s=a.nodeName.toLowerCase();if("body"===s||V(s)){this._trimCurrentText(),""!==this.currentText&&i.push(this._makeBlockConfig());var l=this.currentDepth,u=this.wrapper;V(s)&&(this.wrapper=s,V(u)&&this.currentDepth++),i.push.apply(i,this._toBlockConfigs(Array.from(a.childNodes),r)),this.currentDepth=l,this.wrapper=u;continue}var c=this.blockTypeMap.get(s);if(void 0!==c){this._trimCurrentText(),""!==this.currentText&&i.push(this._makeBlockConfig());var h=this.currentDepth,p=this.wrapper;this.wrapper="pre"===s?"pre":this.wrapper,"string"!=typeof c&&(c=this.disambiguate(s,this.wrapper)||c[0]||"unstyled"),!T&&E(a)&&("unordered-list-item"===c||"ordered-list-item"===c)&&(this.currentDepth=B(a,this.currentDepth));var d=f(),m=this._toBlockConfigs(Array.from(a.childNodes),r);this._trimCurrentText(),i.push(this._makeBlockConfig({key:d,childConfigs:m,type:c})),this.currentDepth=h,this.wrapper=p;continue}if("#text"===s){this._addTextNode(a,r);continue}if("br"===s){this._addBreakNode(a,r);continue}if(S(a)&&a.attributes.getNamedItem("src")&&a.attributes.getNamedItem("src").value){this._addImgNode(a,r);continue}if(U(a)){this._addAnchorNode(a,i,r);continue}var g=r;F.has(s)&&(g=g.add(F.get(s))),g=j(a,g);var _=E(o=a)&&o.style.fontFamily.includes("monospace")?"CODE":null;null!=_&&(g=g.add(_)),i.push.apply(i,this._toBlockConfigs(Array.from(a.childNodes),g))}return i},r._appendText=function(e,r){this.currentText+=e;var i,n=s.create({style:r,entity:this.currentEntity});this.characterList=(i=this.characterList).push.apply(i,Array(e.length).fill(n))},r._trimCurrentText=function(){var e=this.currentText.length,r=e-this.currentText.trimLeft().length,i=this.currentText.trimRight().length,n=this.characterList.findEntry(function(e){return null!==e.getEntity()});(r=void 0!==n?Math.min(r,n[0]):r)>(i=void 0!==(n=this.characterList.reverse().findEntry(function(e){return null!==e.getEntity()}))?Math.max(i,e-n[0]):i)?(this.currentText="",this.characterList=y()):(this.currentText=this.currentText.slice(r,i),this.characterList=this.characterList.slice(r,i))},r._addTextNode=function(e,r){var i=e.textContent;""===i.trim()&&"pre"!==this.wrapper&&(i=" "),"pre"!==this.wrapper&&(i=(i=i.replace(C,"")).replace(M," ")),this._appendText(i,r)},r._addBreakNode=function(e,r){w(e)&&this._appendText("\n",r)},r._addImgNode=function(e,r){if(S(e)){var i={};
9k.forEach(function(r){var n=e.getAttribute(r);n&&(i[r]=n)}),this.currentEntity=this.entityMap.__create("IMAGE","IMMUTABLE",i),g("draftjs_fix_paste_for_img")?"presentation"!==e.getAttribute("role")&&this._appendText("\uD83D\uDCF7",r):this._appendText("\uD83D\uDCF7",r),this.currentEntity=null}},r._addAnchorNode=function(e,r,i){if(b(e)){var n={};R.forEach(function(r){var i=e.getAttribute(r);i&&(n[r]=i)}),n.url=new p(e.href).toString(),this.currentEntity=this.entityMap.__create("LINK","MUTABLE",n||{}),r.push.apply(r,this._toBlockConfigs(Array.from(e.childNodes),i)),this.currentEntity=null}},r._toContentBlocks=function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=e.length-1,o=0;o<=i;o++){var a=e[o];a.parent=r,a.prevSibling=o>0?e[o-1].key:null,a.nextSibling=o<i?e[o+1].key:null,a.children=y(a.childConfigs.map(function(e){return e.key})),this.contentBlocks.push(new u(n({},a))),this._toContentBlocks(a.childConfigs,a.key)}},r._hoistContainersInBlockConfigs=function(e){var r=this;return y(e).flatMap(function(e){return"unstyled"!==e.type||""!==e.text?[e]:r._hoistContainersInBlockConfigs(e.childConfigs)})},r._toFlatContentBlocks=function(e){var r=this;this._hoistContainersInBlockConfigs(e).forEach(function(e){var i=r._extractTextFromBlockConfigs(e.childConfigs),o=i.text,a=i.characterList;r.contentBlocks.push(new l(n({},e,{text:e.text+o,characterList:e.characterList.concat(a)})))})},r._extractTextFromBlockConfigs=function(e){for(var r=e.length-1,i="",n=y(),o=0;o<=r;o++){var a=e[o];i+=a.text,n=n.concat(a.characterList),""!==i&&"unstyled"!==a.type&&(i+="\n",n=n.push(n.last()));var s=this._extractTextFromBlockConfigs(a.childConfigs);i+=s.text,n=n.concat(s.characterList)}return{text:i,characterList:n}},e}();e.exports=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,n=r(e=e.trim().replace(I,"").replace(A," ").replace(P,"").replace(L,""));return n?new G(z(i),function(e,r){return"li"===e?"ol"===r?"ordered-list-item":"unordered-list-item":null}).addDOMNode(n).getContentBlocks():null}},11257:(e,r,i)=>{"use strict";i.d(r,{A1:()=>L,Bg:()=>w,E3:()=>O,EJ:()=>F,H7:()=>j,Jg:()=>S,Lr:()=>N,WO:()=>U,Xp:()=>x,aF:()=>b,cI:()=>B,en:()=>D,gV:()=>P,hC:()=>T,iY:()=>k,l6:()=>V,lk:()=>A,mE:()=>z,oD:()=>E,yD:()=>v});var n=i(85428),o=i(51877),a=i(84091),s=i(45602),l=i(97685),u=i(78594),c=i(23323),h=i(82909).hp;let p=new Map,d=null,f=[],m=!1,g=new Map;function _(){for(;f.length>0;){let{resolve:e}=f.shift();e(Array.from(p.values()))}}async function y(e){try{return await (0,c.x)("/layer/user/filter",{method:"POST",json:e})}catch(e){throw Error(`Failed to fetch vector layers: ${e instanceof Error?e.message:"Unknown error"}`)}}function v(e,r,i){let n=p.get(i)||{features:[]},o=(0,s.e_)(r.geojson).features,a=Array.from(new Map([...n.features,...o].map(e=>[e.id,e])).values());p.set(i,{...n,features:a}),e.current.getSource(`${i}-source`).setData({type:"FeatureCollection",features:a})}function x(e,r,i){let n=(p.get(i)||{features:[]}).features.filter(e=>!r.includes(e.id));p.set(i,{features:n});let o=e.current?.getSource(`${i}-source`);o&&"geojson"===o.type&&o.setData({type:"FeatureCollection",features:n})}function b(e,r,i,n){let o=p.get(r);if(!o)return;let a=String(i),s=o.features.find(e=>String(e.id)===a),l={};for(let[e,r]of Object.entries(n)){if("string"==typeof r&&"number"==typeof s?.properties?.[e]){let i=Number(r);l[e]=Number.isFinite(i)?i:r;continue}l[e]=r}let u=o.features.map(e=>String(e.id)===a?{...e,properties:{...e.properties,...l}}:e);p.set(r,{...o,features:u});let c=e.current?.getSource(`${r}-source`);c?.type==="geojson"&&c.setData({type:"FeatureCollection",features:u})}function w(e){let r=Date.now();return e.map(e=>({...e,cacheTime:r}))}function E(e){let r=p.get(e);return r?.features??[]}function S(e,r){let i=p.get(e);i&&p.set(e,{...i,gradientProperty:r})}let T=(e,r)=>i=>{let n=Array.from(p.keys()).flatMap(r=>(0,s.tP)(r).filter(r=>e.current.getLayer(r))),o=e.current.queryRenderedFeatures(i.point,{layers:n}),a=e.current.queryRenderedFeatures(i.point,{layers:["line-layer","point-layer","polygon-layer"]}),l=r=>{let i=r.layer?.source,n=r.id;if(!i||null==n)return!1;try{let r=e.current.getFeatureState({source:i,id:n});return!!r?.hidden}catch{return!1}},u=o.filter(e=>!l(e)),c=[...a.filter(e=>!l(e)),...u],h=[...new Set(c.map(e=>e.id))].map(e=>c.find(r=>r.id===e));if(!h||0===h.length)return;let d=[],f=[],m=[];o.forEach(r=>
9{r.layer?.id&&r.id&&r.layer.source&&(d.push(r.layer.id),f.push(r.id),m.push(r.layer.source),e.current.removeFeatureState({source:r.layer.source}))});let g={};a.forEach(e=>{let{id:r,layer:i}=e;d.push(i.id),f.push(r),m.push("measurements"),g[r]=e});let _=i.lngLat.lat,y=i.lngLat.lng,v=e.current.project([y,_]);r({count:h.length,layerIds:d,featureUuids:f,sources:m,lat:_,lon:y,position:v,measurementData:g})};async function I(e,r,i,l){let u;d&&(d.abort("New fetch made"),_()),d=new AbortController;let f=null;!i&&p.size>0&&(f=Object.fromEntries(Array.from(p.entries()).filter(([e,r])=>void 0!==r.gradientProperty).map(([e,r])=>[e.split("-")[0],r.gradientProperty])));let m=(0,n.Rf)(r),g={project_id:e,zoom:r.current.getZoom(),screen:m,initialLoad:i,...null!==f&&{gradientProperties:f}};(await (0,c.x)("/layer/user/filter",{method:"POST",json:g})).forEach(e=>{let i=`${e.layer_id}-layer`,n=(0,s.e_)(e.geojson);if(n.features=w(n.features),e.geojson=n,r.current.getSource(`${i}-source`))v(r,e,i);else{r=(0,o.KI)(r,e.geojson,i,e.layer_properties.color,e.layer_properties.opacity,l,e.layer_properties.gradientData.property,e.layer_properties.gradientData.gradient1,e.layer_properties.gradientData.gradient2,e.layer_properties.gradientData.categorical,e.layer_properties.gradientData.categoricalOpacities,e.layer_properties.gradientData.gradientType,e.layer_properties.icon,"ProjectGIS"===e.scope,e.layer_properties.lineStyle,e.layer_properties.labelProperty,e.layer_properties.geojson_type);let n=e.layer_properties.gradientData.property,a=n?{features:e.geojson.features,gradientProperty:n}:{features:e.geojson.features};p.set(i,a)}});let y=R(await D(e),"desc");return y.forEach(e=>{e.id=e.id+"-layer"}),G(r,y),(0,a.y)(r.current),u=0,p.forEach(e=>{let r=e.features;if(0!==r.length){let e=Math.min(r.length,10),i=0;for(let n=0;n<e;n++){let e=Math.floor(r.length*Math.random());i+=h.byteLength(JSON.stringify(r[e]),"utf8")}u+=r.length/e*i}}),u/1024/1024>=110&&function(){let e=0,r=[];if(p.forEach((i,n)=>{i.features.forEach(i=>{let o=h.byteLength(JSON.stringify(i),"utf8");e+=o,r.push({id:n,feature:i,size:o})})}),!(e<=0x6400000))for(let{id:i,feature:n,size:o}of(r.sort((e,r)=>e.feature.cacheTime-r.feature.cacheTime),r)){if(e<=0x5000000)break;let r=p.get(i)??{features:[]},a={...r,features:r.features.filter(e=>e.uuid!==n.uuid)};p.set(i,a),e-=o}}(),r}async function M(e,r,i){return(0,c.x)("/layer/user/filter",{method:"POST",json:{project_id:e,layerIds:r,initialLoad:i}})}async function C(e,r,i,n){if(m||0===f.length)return[];let{resolve:o}=f.shift();m=!0;let a=[];try{a=await I(e,r,i,n)}finally{m=!1,o(a),C(e,r,!1,n)}}async function A(e,r,i,n){return _(),f=[],new Promise(o=>{f.push({resolve:o}),C(e,r,i,n)})}async function P(e,r,i){if(!r.current?.getSource(`${i}-source`))return;let o=Number.parseInt(i.split("-")[0],10);if(Number.isNaN(o))return;let a={project_id:e,layerIds:[o],zoom:r.current.getZoom(),screen:(0,n.Rf)(r),initialLoad:!1};(await y(a)).forEach(e=>{let i=`${e.layer_id}-layer`;if(!r.current?.getSource(`${i}-source`))return;let n=(0,s.e_)(e.geojson);n.features=w(n.features),e.geojson=n,v(r,e,i)})}async function L(e,r,i,n=!1){let o=i.filter(e=>!p.has(e)),a=o.map(e=>Number(e.split("-")[0]));if(0===a.length)return[];let s=`${e}-${n}-${o.sort((e,r)=>e.localeCompare(r)).join(",")}`;if(g.has(s))return g.get(s);let l=(async()=>{try{let r=await M(e,a,n);return r.forEach(e=>{let r=`${e.layer_id}-layer`,i=p.get(r);p.set(r,{...i,features:e.geojson.features})}),r}finally{g.delete(s)}})();return g.set(s,l),l}async function O(e){p.delete(e)}let D=async e=>{let[r,i]=await Promise.all([(0,c.x)("/layer/project",{params:{project_uuid:e}}),(0,c.x)("/layer/user",{params:{project_uuid:e}})]);return R(r.concat(i),"asc")},R=(e,r)=>{let i=[...e];return i.sort((e,i)=>{if(e.properties.order!==i.properties.order){let n=Number(e.properties.order),o=Number(i.properties.order);return"asc"===r?n-o:o-n}if(void 0!==e.properties.group_index&&void 0!==i.properties.group_index){let n=Number(e.properties.group_index),o=Number(i.properties.group_index);return"asc"===r?n-o:o-n}return -1}),i},k=async(e,r,i)=>{try{let n=new FormData;n.append("order",JSON.stringify(r)),n.append("project_id",i),await (0,c.x)("/layer/update-order",{method:"PATCH",form:n});let o=R(await D(i),"desc");
9o.forEach(e=>{e.id=e.id+"-layer"}),G(e,o),(0,a.y)(e.current)}catch(e){console.error(e)}},N=async(e,r,i)=>{let n={ids:[],properties:{group:r}};e.forEach(e=>n.ids.push(parseInt(e.id)));try{await (0,c.x)("/layer/update",{method:"PATCH",json:n}),e.forEach(e=>e.properties.group=r),i.setCustomLayers([...i.customLayers.filter(r=>!e.has(r)),...e])}catch(e){console.error(e),l.Ay.error("Error updating group")}},F=e=>e.reduce((e,r)=>{let i=r?.properties?.group;if(i){let n=e.find(e=>"object"==typeof e&&e[i]);n?n[i].push(r):e.push({[i]:[r]})}else e.push(r);return e},[]),z=e=>{let r=[];for(let i of e)if("id"in i)r.push(i);else{let e=Object.keys(i)[0];r.push(...i[e])}return r},B=async e=>{try{let r=e.split("?")[0],i=`${r}?service=WMS&request=GetCapabilities`,n=await (0,u.kD)(i),o=n.querySelector("WMS_Capabilities")?.getAttribute("version")||"1.3.0",a=parseInt(n.querySelector("MaxWidth")?.textContent||"256",10),s=parseInt(n.querySelector("MaxHeight")?.textContent||"256",10),l=new Set,c={};return Array.from(n.querySelectorAll("Layer")).forEach(e=>{let r=e.querySelector("Name");if(!r)return;let i=r.textContent?.trim()||"";if(l.has(i))return;l.add(i);let n=e.querySelector('BoundingBox[CRS="EPSG:4326"]');if(!n)return;let o=parseFloat(n.getAttribute("minx")),a=parseFloat(n.getAttribute("miny")),s=parseFloat(n.getAttribute("maxx")),u=parseFloat(n.getAttribute("maxy"));c[i]={lat:(a+u)/2,lon:(o+s)/2}}),{typeNames:Array.from(l),maxWidth:a,maxHeight:s,version:o,url:r,coordsMap:c}}catch(e){throw console.error("Error fetching WMS Capabilities:",e),e}},U=async e=>{let r=await (0,c.x)("/layer/create/wmts/capabilities",{method:"GET",params:{url:e}});if(0===r.typeNames.length)throw Error("No layers available to add");return r},j=async(e,r,i)=>{let n=e.split("?")[0],o=await (0,c.x)("/layer/create/wfs/capabilities",{method:"POST",params:{url:n},json:{...r&&{username:r},...i&&{password:i}}});if(0===o.typeNames.length)throw Error("No layers available to add");return r&&i&&(o.username=r,o.password=i),o};async function V(e){let r=await (0,c.x)("/tour/tours",{params:{project_id:e}});return r&&Array.isArray(r)?new Map(r):new Map}let G=(e,r)=>{let i=e.current.getStyle().layers,n=i.map(e=>e.id),o=i[i.length-1]?.id;r.forEach(r=>{var i;let a;(i=r.id,[...a=(0,s.tP)(i),...a.map(e=>`${e}-stroke`),...a.map(e=>`${e}-halo`),...a.map(e=>`${e}-vector-label`),`${i}-cluster`,`${i}-cluster-count`]).filter(e=>n.includes(e)).forEach(r=>{try{e.current.moveLayer(r,o)}catch(e){console.warn(`Failed to move layer ${r}:`,e)}})})}},11324:function(e,r,i){var n=i(99742);e.exports=function(){"use strict";var e,r,i;function o(n,o){if(e)if(r){var a="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+r+")(sharedChunk); self.onerror = null;",s={};e(s),i=o(s),"u">typeof window&&window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else r=o;else e=o}return o(["exports"],function(e){let r,i,o,a,s,l;var u,c,h,p,d,f,m,g,_,y="3.4.0";let v={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){let e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=n.env.API_URL_REGEX?new RegExp(n.env.API_URL_REGEX):e}catch(i){r=e}}return r},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!v.API_URL)return null;try{let e=new URL(v.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MES
9HOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"};function x(e){return v.API_URL_REGEX.test(e)}function b(e){return 0===e.indexOf("mapbox:")}function w(e){return v.API_CDN_URL_REGEX.test(e)}function E(e){return v.API_SPRITE_REGEX.test(e)}function S(e){return v.API_STYLE_REGEX.test(e)&&!E(e)}let T={create:"create",load:"load",fullLoad:"fullLoad"};function I(e){let r=e.name.split("?")[0];return w(r)&&r.includes("mapbox-gl.js")?"javascript":w(r)&&r.includes("mapbox-gl.css")?"css":v.API_FONTS_REGEX.test(r)?"fontRange":E(r)?"sprite":S(r)?"style":v.API_TILEJSON_REGEX.test(r)?"tilejson":"other"}function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={},A={};Object.defineProperty(A,"__esModule",{value:!0}),A.setMatrixArrayType=function(e){A.ARRAY_TYPE=L=e},A.toRadian=function(e){return e*O},A.equals=function(e,r){return Math.abs(e-r)<=P*Math.max(1,Math.abs(e),Math.abs(r))},A.RANDOM=A.ARRAY_TYPE=A.EPSILON=void 0;var P=1e-6;A.EPSILON=1e-6;var L="u">typeof Float32Array?Float32Array:Array;A.ARRAY_TYPE=L,A.RANDOM=Math.random;var O=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)});var D={};function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(D,"__esModule",{value:!0}),D.create=function(){var e=new k.ARRAY_TYPE(4);return k.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},D.clone=function(e){var r=new k.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r},D.copy=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e},D.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},D.fromValues=function(e,r,i,n){var o=new k.ARRAY_TYPE(4);return o[0]=e,o[1]=r,o[2]=i,o[3]=n,o},D.set=function(e,r,i,n,o){return e[0]=r,e[1]=i,e[2]=n,e[3]=o,e},D.transpose=function(e,r){if(e===r){var i=r[1];e[1]=r[2],e[2]=i}else e[0]=r[0],e[1]=r[2],e[2]=r[1],e[3]=r[3];return e},D.invert=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=i*a-o*n;return s?(e[0]=a*(s=1/s),e[1]=-n*s,e[2]=-o*s,e[3]=i*s,e):null},D.adjoint=function(e,r){var i=r[0];return e[0]=r[3],e[1]=-r[1],e[2]=-r[2],e[3]=i,e},D.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},D.multiply=F,D.rotate=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=Math.sin(i),u=Math.cos(i);return e[0]=n*u+a*l,e[1]=o*u+s*l,e[2]=-(n*l)+a*u,e[3]=-(o*l)+s*u,e},D.scale=function(e,r,i){var n=r[1],o=r[2],a=r[3],s=i[0],l=i[1];return e[0]=r[0]*s,e[1]=n*s,e[2]=o*l,e[3]=a*l,e},D.fromRotation=function(e,r){var i=Math.sin(r),n=Math.cos(r);return e[0]=n,e[1]=i,e[2]=-i,e[3]=n,e},D.fromScaling=function(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=r[1],e},D.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},D.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},D.LDU=function(e,r,i,n){return e[2]=n[2]/n[0],i[0]=n[0],i[1]=n[1],i[3]=n[3]-e[2]*i[1],[e,r,i]},D.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e[3]=r[3]+i[3],e},D.subtract=z,D.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]},D.equals=function(e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return Math.abs(i-s)<=k.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-l)<=k.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-u)<=k.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(a-c)<=k.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))},D.multiplyScalar=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e},D.multiplyScalarAndAdd=function(e,r,i,n){return e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n,e[3]=r[3]+i[3]*n,e},D.sub=D.mul=void 0;var k=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==R(e)&&"function"!=typeof e)return{default:e};var r=N(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(A);function N(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(N=function(e){return e?i:r})(e)}function F(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=i[0],u=i[1],c=i[2],h=i[3];return e[0]=n*l+a*u,e[1]=o*l+s*u,e[2]=n*c+a*h,e[3]=o*c+s*h,e}function z(e,r,i){return e[0]=r[0]-i[0],e[1]=r[1]-i[1],e[2]=r[2]-i[2],e[3]=r[3]-i[3],e}D.mul=F,D.sub=z;var B={};function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(B,"__esModule",{value:!0}),B.create=function(){var e=new j.ARRAY_TYPE(6);return j.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},B.clone=function(e){var r=new j.ARRAY_TYPE(6);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r},B.copy=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e},B.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},B.fromValues=function(e,r,i,n,o,a){var s=new j.ARRAY_TYPE(6);return s[0]=e,s[1]=r,s[2]=i,s[3]=n,s[4]=o,s[5]=a,s},B.set=function(e,r,i,n,o,a,s){return e[0]=r,e[1]=i,e[2]=n,e[3]=o,e[4]=a,e[5]=s,e},B.invert=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5],u=i*a-n*o;return u?(e[0]=a*(u=1/u),e[1]=-n*u,e[2]=-o*u,e[3]=i*u,e[4]=(o*l-a*s)*u,e[5]=(n*s-i*l)*u,e):null},B.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},B.multiply=G,B.rotate=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=Math.sin(i),h=Math.cos(i);return e[0]=n*h+a*c,e[1]=o*h+s*c,e[2]=-(n*c)+a*h,e[3]=-(o*c)+s*h,e[4]=l,e[5]=u,e},B.scale=function(e,r,i){var n=r[1],o=r[2],a=r[3],s=r[4],l=r[5],u=i[0],c=i[1];return e[0]=r[0]*u,e[1]=n*u,e[2]=o*c,e[3]=a*c,e[4]=s,e[5]=l,e},B.translate=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=i[0],h=i[1];return e[0]=n,e[1]=o,e[2]=a,e[3]=s,e[4]=n*c+a*h+l,e[5]=o*c+s*h+u,e},B.fromRotation=function(e,r){var i=Math.sin(r),n=Math.cos(r);return e[0]=n,e[1]=i,e[2]=-i,e[3]=n,e[4]=0,e[5]=0,e},B.fromScaling=function(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=r[1],e[4]=0,e[5]=0,e},B.fromTranslation=function(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=r[0],e[5]=r[1],e},B.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},B.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)},B.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e[3]=r[3]+i[3],e[4]=r[4]+i[4],e[5]=r[5]+i[5],e},B.subtract=q,B.multiplyScalar=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*i,e[5]=r[5]*i,e},B.multiplyScalarAndAdd=function(e,r,i,n){return e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n,e[3]=r[3]+i[3]*n,e[4]=r[4]+i[4]*n,e[5]=r[5]+i[5]*n,e},B.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]},B.equals=function(e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=r[0],c=r[1],h=r[2],p=r[3],d=r[4],f=r[5];return Math.abs(i-u)<=j.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(n-c)<=j.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(o-h)<=j.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-p)<=j.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-d)<=j.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(l-f)<=j.EPSILON*Math.max(1,Math.abs(l),Math.abs(f))},B.sub=B.mul=void 0;
9var j=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==U(e)&&"function"!=typeof e)return{default:e};var r=V(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(A);function V(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(V=function(e){return e?i:r})(e)}function G(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=i[0],h=i[1],p=i[2],d=i[3],f=i[4],m=i[5];return e[0]=n*c+a*h,e[1]=o*c+s*h,e[2]=n*p+a*d,e[3]=o*p+s*d,e[4]=n*f+a*m+l,e[5]=o*f+s*m+u,e}function q(e,r,i){return e[0]=r[0]-i[0],e[1]=r[1]-i[1],e[2]=r[2]-i[2],e[3]=r[3]-i[3],e[4]=r[4]-i[4],e[5]=r[5]-i[5],e}B.mul=G,B.sub=q;var H={};function $(e){return($="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(H,"__esModule",{value:!0}),H.create=function(){var e=new W.ARRAY_TYPE(9);return W.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},H.fromMat4=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e},H.clone=function(e){var r=new W.ARRAY_TYPE(9);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r},H.copy=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e},H.fromValues=function(e,r,i,n,o,a,s,l,u){var c=new W.ARRAY_TYPE(9);return c[0]=e,c[1]=r,c[2]=i,c[3]=n,c[4]=o,c[5]=a,c[6]=s,c[7]=l,c[8]=u,c},H.set=function(e,r,i,n,o,a,s,l,u,c){return e[0]=r,e[1]=i,e[2]=n,e[3]=o,e[4]=a,e[5]=s,e[6]=l,e[7]=u,e[8]=c,e},H.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},H.transpose=function(e,r){if(e===r){var i=r[1],n=r[2],o=r[5];e[1]=r[3],e[2]=r[6],e[3]=i,e[5]=r[7],e[6]=n,e[7]=o}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e},H.invert=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5],u=r[6],c=r[7],h=r[8],p=h*s-l*c,d=-h*a+l*u,f=c*a-s*u,m=i*p+n*d+o*f;return m?(e[0]=p*(m=1/m),e[1]=(-h*n+o*c)*m,e[2]=(l*n-o*s)*m,e[3]=d*m,e[4]=(h*i-o*u)*m,e[5]=(-l*i+o*a)*m,e[6]=f*m,e[7]=(-c*i+n*u)*m,e[8]=(s*i-n*a)*m,e):null},H.adjoint=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5],u=r[6],c=r[7],h=r[8];return e[0]=s*h-l*c,e[1]=o*c-n*h,e[2]=n*l-o*s,e[3]=l*u-a*h,e[4]=i*h-o*u,e[5]=o*a-i*l,e[6]=a*c-s*u,e[7]=n*u-i*c,e[8]=i*s-n*a,e},H.determinant=function(e){var r=e[3],i=e[4],n=e[5],o=e[6],a=e[7],s=e[8];return e[0]*(s*i-n*a)+e[1]*(-s*r+n*o)+e[2]*(a*r-i*o)},H.multiply=Z,H.translate=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=r[8],d=i[0],f=i[1];return e[0]=n,e[1]=o,e[2]=a,e[3]=s,e[4]=l,e[5]=u,e[6]=d*n+f*s+c,e[7]=d*o+f*l+h,e[8]=d*a+f*u+p,e},H.rotate=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=r[8],d=Math.sin(i),f=Math.cos(i);return e[0]=f*n+d*s,e[1]=f*o+d*l,e[2]=f*a+d*u,e[3]=f*s-d*n,e[4]=f*l-d*o,e[5]=f*u-d*a,e[6]=c,e[7]=h,e[8]=p,e},H.scale=function(e,r,i){var n=i[0],o=i[1];return e[0]=n*r[0],e[1]=n*r[1],e[2]=n*r[2],e[3]=o*r[3],e[4]=o*r[4],e[5]=o*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e},H.fromTranslation=function(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=r[0],e[7]=r[1],e[8]=1,e},H.fromRotation=function(e,r){var i=Math.sin(r),n=Math.cos(r);return e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},H.fromScaling=function(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=r[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},H.fromMat2d=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=0,e[3]=r[2],e[4]=r[3],e[5]=0,e[6]=r[4],e[7]=r[5],e[8]=1,e},H.fromQuat=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=i+i,l=n+n,u=o+o,c=i*s,h=n*s,p=n*l,d=o*s,f=o*l,m=o*u,g=a*s,_=a*l,y=a*u;return e[0]=1-p-m,e[3]=h-y,e[6]=d+_,e[1]=h+y,e[4]=1-c-m,e[7]=f-g,e[2]=d-_,e[5]=f+g,e[8]=1-c-p,e},H.normalFromMat4=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5],u=r[6],c=r[7],h=r[8],p=r[9],d=r[10],f=r[11],m=r[12],g=r[13],_=r[14],y=r[15],v=i*l-n*s,x=i*u-o*s,b=i*c-a*s,w=n*u-o*l,E=n*c-a*l,S=o*c-a*u,T=h*g-p*m,I=h*_-d*m,M=h*y-f*m,C=p*_-d*g,A=p*y-f*g,P=d*y-f*_,L=v*P-x*A+b*C+w*M-E*I+S*T;return L?(e[0]=(l*P-u*A+c*C)*(L=1/L),e[1]=(u*M-s*P-c*I)*L,e[2]=(s*A-l*M+c*T)*L,e[3]=(o*A-n*P-a*C)*L,e[4]=(i*P-o*M+a*I)*L,e[5]=(n*M-i*A-a*T)*L,e[6]=(g*S-_*E+y*w)*L,e[7]=(_*b-m*S-y*x)*L,e[8]=(m*E-g*b+y*v)*L,e):null},H.projection=function(e,r,i){return e[0]=2/r,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/i,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},H.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},H.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},H.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e[3]=r[3]+i[3],e[4]=r[4]+i[4],e[5]=r[5]+i[5],e[6]=r[6]+i[6],e[7]=r[7]+i[7],e[8]=r[8]+i[8],e},H.subtract=X,H.multiplyScalar=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=r[7]*i,e[8]=r[8]*i,e},H.multiplyScalarAndAdd=function(e,r,i,n){return e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n,e[3]=r[3]+i[3]*n,e[4]=r[4]+i[4]*n,e[5]=r[5]+i[5]*n,e[6]=r[6]+i[6]*n,e[7]=r[7]+i[7]*n,e[8]=r[8]+i[8]*n,e},H.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]},H.equals=function(e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=r[0],d=r[1],f=r[2],m=r[3],g=r[4],_=r[5],y=r[6],v=r[7],x=r[8];return Math.abs(i-p)<=W.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(n-d)<=W.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-f)<=W.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-m)<=W.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-g)<=W.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-_)<=W.EPSILON*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-y)<=W.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-v)<=W.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-x)<=W.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},H.sub=H.mul=void 0;
9var W=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==$(e)&&"function"!=typeof e)return{default:e};var r=Y(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(A);function Y(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(Y=function(e){return e?i:r})(e)}function Z(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=r[8],d=i[0],f=i[1],m=i[2],g=i[3],_=i[4],y=i[5],v=i[6],x=i[7],b=i[8];return e[0]=d*n+f*s+m*c,e[1]=d*o+f*l+m*h,e[2]=d*a+f*u+m*p,e[3]=g*n+_*s+y*c,e[4]=g*o+_*l+y*h,e[5]=g*a+_*u+y*p,e[6]=v*n+x*s+b*c,e[7]=v*o+x*l+b*h,e[8]=v*a+x*u+b*p,e}function X(e,r,i){return e[0]=r[0]-i[0],e[1]=r[1]-i[1],e[2]=r[2]-i[2],e[3]=r[3]-i[3],e[4]=r[4]-i[4],e[5]=r[5]-i[5],e[6]=r[6]-i[6],e[7]=r[7]-i[7],e[8]=r[8]-i[8],e}H.mul=Z,H.sub=X;var K={};function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(K,"__esModule",{value:!0}),K.create=function(){var e=new J.ARRAY_TYPE(16);return J.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},K.clone=function(e){var r=new J.ARRAY_TYPE(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},K.copy=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e},K.fromValues=function(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g){var _=new J.ARRAY_TYPE(16);return _[0]=e,_[1]=r,_[2]=i,_[3]=n,_[4]=o,_[5]=a,_[6]=s,_[7]=l,_[8]=u,_[9]=c,_[10]=h,_[11]=p,_[12]=d,_[13]=f,_[14]=m,_[15]=g,_},K.set=function(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_){return e[0]=r,e[1]=i,e[2]=n,e[3]=o,e[4]=a,e[5]=s,e[6]=l,e[7]=u,e[8]=c,e[9]=h,e[10]=p,e[11]=d,e[12]=f,e[13]=m,e[14]=g,e[15]=_,e},K.identity=et,K.transpose=function(e,r){if(e===r){var i=r[1],n=r[2],o=r[3],a=r[6],s=r[7],l=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=i,e[6]=r[9],e[7]=r[13],e[8]=n,e[9]=a,e[11]=r[14],e[12]=o,e[13]=s,e[14]=l}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e},K.invert=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5],u=r[6],c=r[7],h=r[8],p=r[9],d=r[10],f=r[11],m=r[12],g=r[13],_=r[14],y=r[15],v=i*l-n*s,x=i*u-o*s,b=i*c-a*s,w=n*u-o*l,E=n*c-a*l,S=o*c-a*u,T=h*g-p*m,I=h*_-d*m,M=h*y-f*m,C=p*_-d*g,A=p*y-f*g,P=d*y-f*_,L=v*P-x*A+b*C+w*M-E*I+S*T;return L?(e[0]=(l*P-u*A+c*C)*(L=1/L),e[1]=(o*A-n*P-a*C)*L,e[2]=(g*S-_*E+y*w)*L,e[3]=(d*E-p*S-f*w)*L,e[4]=(u*M-s*P-c*I)*L,e[5]=(i*P-o*M+a*I)*L,e[6]=(_*b-m*S-y*x)*L,e[7]=(h*S-d*b+f*x)*L,e[8]=(s*A-l*M+c*T)*L,e[9]=(n*M-i*A-a*T)*L,e[10]=(m*E-g*b+y*v)*L,e[11]=(p*b-h*E-f*v)*L,e[12]=(l*I-s*C-u*T)*L,e[13]=(i*C-n*I+o*T)*L,e[14]=(g*x-m*w-_*v)*L,e[15]=(h*w-p*x+d*v)*L,e):null},K.adjoint=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5],u=r[6],c=r[7],h=r[8],p=r[9],d=r[10],f=r[11],m=r[12],g=r[13],_=r[14],y=r[15];return e[0]=l*(d*y-f*_)-p*(u*y-c*_)+g*(u*f-c*d),e[1]=-(n*(d*y-f*_)-p*(o*y-a*_)+g*(o*f-a*d)),e[2]=n*(u*y-c*_)-l*(o*y-a*_)+g*(o*c-a*u),e[3]=-(n*(u*f-c*d)-l*(o*f-a*d)+p*(o*c-a*u)),e[4]=-(s*(d*y-f*_)-h*(u*y-c*_)+m*(u*f-c*d)),e[5]=i*(d*y-f*_)-h*(o*y-a*_)+m*(o*f-a*d),e[6]=-(i*(u*y-c*_)-s*(o*y-a*_)+m*(o*c-a*u)),e[7]=i*(u*f-c*d)-s*(o*f-a*d)+h*(o*c-a*u),e[8]=s*(p*y-f*g)-h*(l*y-c*g)+m*(l*f-c*p),e[9]=-(i*(p*y-f*g)-h*(n*y-a*g)+m*(n*f-a*p)),e[10]=i*(l*y-c*g)-s*(n*y-a*g)+m*(n*c-a*l),e[11]=-(i*(l*f-c*p)-s*(n*f-a*p)+h*(n*c-a*l)),e[12]=-(s*(p*_-d*g)-h*(l*_-u*g)+m*(l*d-u*p)),e[13]=i*(p*_-d*g)-h*(n*_-o*g)+m*(n*d-o*p),e[14]=-(i*(l*_-u*g)-s*(n*_-o*g)+m*(n*u-o*l)),e[15]=i*(l*d-u*p)-s*(n*d-o*p)+h*(n*u-o*l),e},K.determinant=function(e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],_=e[15];return(r*s-i*a)*(p*_-d*g)-(r*l-n*a)*(h*_-d*m)+(r*u-o*a)*(h*g-p*m)+(i*l-n*s)*(c*_-d*f)-(i*u-o*s)*(c*g-p*f)+(n*u-o*l)*(c*m-h*f)},K.multiply=er,K.translate=function(e,r,i){var n,o,a,s,l,u,c,h,p,d,f,m,g=i[0],_=i[1],y=i[2];return r===e?(e[12]=r[0]*g+r[4]*_+r[8]*y+r[12],e[13]=r[1]*g+r[5]*_+r[9]*y+r[13],e[14]=r[2]*g+r[6]*_+r[10]*y+r[14],e[15]=r[3]*g+r[7]*_+r[11]*y+r[15]):(o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],e[0]=n=r[0],e[1]=o,e[2]=a,e[3]=s,e[4]=l,e[5]=u,e[6]=c,e[7]=h,e[8]=p,e[9]=d,e[10]=f,e[11
9]=m,e[12]=n*g+l*_+p*y+r[12],e[13]=o*g+u*_+d*y+r[13],e[14]=a*g+c*_+f*y+r[14],e[15]=s*g+h*_+m*y+r[15]),e},K.scale=function(e,r,i){var n=i[0],o=i[1],a=i[2];return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=r[3]*n,e[4]=r[4]*o,e[5]=r[5]*o,e[6]=r[6]*o,e[7]=r[7]*o,e[8]=r[8]*a,e[9]=r[9]*a,e[10]=r[10]*a,e[11]=r[11]*a,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e},K.rotate=function(e,r,i,n){var o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E,S,T,I,M,C,A=n[0],P=n[1],L=n[2],O=Math.hypot(A,P,L);return O<J.EPSILON?null:(A*=O=1/O,P*=O,L*=O,o=Math.sin(i),a=Math.cos(i),u=r[1],c=r[2],h=r[3],d=r[5],f=r[6],m=r[7],_=r[9],y=r[10],v=r[11],x=A*A*(s=1-a)+a,E=A*P*s-L*o,S=P*P*s+a,T=L*P*s+A*o,I=A*L*s+P*o,M=P*L*s-A*o,C=L*L*s+a,e[0]=(l=r[0])*x+(p=r[4])*(b=P*A*s+L*o)+(g=r[8])*(w=L*A*s-P*o),e[1]=u*x+d*b+_*w,e[2]=c*x+f*b+y*w,e[3]=h*x+m*b+v*w,e[4]=l*E+p*S+g*T,e[5]=u*E+d*S+_*T,e[6]=c*E+f*S+y*T,e[7]=h*E+m*S+v*T,e[8]=l*I+p*M+g*C,e[9]=u*I+d*M+_*C,e[10]=c*I+f*M+y*C,e[11]=h*I+m*M+v*C,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)},K.rotateX=function(e,r,i){var n=Math.sin(i),o=Math.cos(i),a=r[4],s=r[5],l=r[6],u=r[7],c=r[8],h=r[9],p=r[10],d=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=a*o+c*n,e[5]=s*o+h*n,e[6]=l*o+p*n,e[7]=u*o+d*n,e[8]=c*o-a*n,e[9]=h*o-s*n,e[10]=p*o-l*n,e[11]=d*o-u*n,e},K.rotateY=function(e,r,i){var n=Math.sin(i),o=Math.cos(i),a=r[0],s=r[1],l=r[2],u=r[3],c=r[8],h=r[9],p=r[10],d=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=a*o-c*n,e[1]=s*o-h*n,e[2]=l*o-p*n,e[3]=u*o-d*n,e[8]=a*n+c*o,e[9]=s*n+h*o,e[10]=l*n+p*o,e[11]=u*n+d*o,e},K.rotateZ=function(e,r,i){var n=Math.sin(i),o=Math.cos(i),a=r[0],s=r[1],l=r[2],u=r[3],c=r[4],h=r[5],p=r[6],d=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=a*o+c*n,e[1]=s*o+h*n,e[2]=l*o+p*n,e[3]=u*o+d*n,e[4]=c*o-a*n,e[5]=h*o-s*n,e[6]=p*o-l*n,e[7]=d*o-u*n,e},K.fromTranslation=function(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},K.fromScaling=function(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},K.fromRotation=function(e,r,i){var n,o,a,s=i[0],l=i[1],u=i[2],c=Math.hypot(s,l,u);return c<J.EPSILON?null:(s*=c=1/c,l*=c,u*=c,n=Math.sin(r),o=Math.cos(r),e[0]=s*s*(a=1-o)+o,e[1]=l*s*a+u*n,e[2]=u*s*a-l*n,e[3]=0,e[4]=s*l*a-u*n,e[5]=l*l*a+o,e[6]=u*l*a+s*n,e[7]=0,e[8]=s*u*a+l*n,e[9]=l*u*a-s*n,e[10]=u*u*a+o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)},K.fromXRotation=function(e,r){var i=Math.sin(r),n=Math.cos(r);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=i,e[7]=0,e[8]=0,e[9]=-i,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},K.fromYRotation=function(e,r){var i=Math.sin(r),n=Math.cos(r);return e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=i,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},K.fromZRotation=function(e,r){var i=Math.sin(r),n=Math.cos(r);return e[0]=n,e[1]=i,e[2]=0,e[3]=0,e[4]=-i,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},K.fromRotationTranslation=ei,K.fromQuat2=function(e,r){var i=new J.ARRAY_TYPE(3),n=-r[0],o=-r[1],a=-r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=n*n+o*o+a*a+s*s;return p>0?(i[0]=2*(l*s+h*n+u*a-c*o)/p,i[1]=2*(u*s+h*o+c*n-l*a)/p,i[2]=2*(c*s+h*a+l*o-u*n)/p):(i[0]=2*(l*s+h*n+u*a-c*o),i[1]=2*(u*s+h*o+c*n-l*a),i[2]=2*(c*s+h*a+l*o-u*n)),ei(e,r,i),e},K.getTranslation=function(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e},K.getScaling=en,K.getRotation=function(e,r){var i=new J.ARRAY_TYPE(3);en(i,r);var n=1/i[0],o=1/i[1],a=1/i[2],s=r[0]*n,l=r[1]*o,u=r[2]*a,c=r[4]*n,h=r[5]*o,p=r[6]*a,d=r[8]*n,f=r[9]*o,m=r[10]*a,g=s+h+m,_=0;return g>0?(_=2*Math.sqrt(g+1),e[3]=.25*_,e[0]=(p-f)/_,e[1]=(d-u)/_,e[2]=(l-c)/_):s>h&&s>m?(_=2*Math.sqrt(1+s-h-m),e[3]=(p-f)/_,e[0]=.25*_,e[1]=(l+c)/_,e[2]=(d+u)/_):h>m?(_=2*Math.sqrt(1+h-s-m),e[3]=(d-u)/_,e[0]=(l+c)/_,e[1]=.25*_,e[2]=(p+f)/_):(_=2*Math.sqrt(1+m-s-h),e[3]=(l-c)/_,e[0]=(d+u)/_,e[1]=(p+f)/_,e[2]=.25*_),e},K.fromRotationTranslationScale=function(e,r,i,n){var o=r[0],a=r[1],s=r[2],l=r[3],u=o+o,c=a+a,h=s+s,p=o*u,d=o*c,f=o*h,m=a*c,g=a*h,_=s*h,y=l*u,v=l*c,x=l*h,b=n[0],w=n[1],E=n[2];return e[0]=(1-(m+_))*b,e[1]=(d+x)*b,e[2]=(f-v)*b,e[3]=0,e[4]=(d-x)*w,e[5]=(1-(p+_))*w,e[6]=(g+y)*w,e[7]=0,e[8]=(f+v)*E,e[9]=(g-y)*E,e[10]=(1-(p+m))*E,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e},K.fromRotationTranslationScaleOrigin=function(e,r,i,n,o){var a=r[0],s=r[1],l=r[2],u=r[3],c=a+a,h=s+s,p=l+l,d=a*c,f=a*h,m=a*p,g=s*h,_=s*p,y=l*p,v=u*c,x=u*h,b=u*p,w=n[0],E=n[1],S=n[2],T=o[0],I=o[1],M=o[2],C=(1-(g+y))*w,A=(f+b)*w,P=(m-x)*w,L=(f-b)*E,O=(1-(d+y))*E,D=(_+v)*E,R=(m+x)*S,k=(_-v)*S,N=(1-(d+g))*S;return e[0]=C,e[1]=A,e[2]=P,e[3]=0,e[4]=L,e[5]=O,e[6]=D,e[7]=0,e[8]=R,e[9]=k,e[10]=N,e[11]=0,e[12]=i[0]+T-(C*T+L*I+R*M),e[13]=i[1]+I-(A*T+O*I+k*M),e[14]=i[2]+M-(P*T+D*I+N*M),e[15]=1,e},K.fromQuat=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=i+i,l=n+n,u=o+o,c=i*s,h=n*s,p=n*l,d=o*s,f=o*l,m=o*u,g=a*s,_=a*l,y=a*u;return e[0]=1-p-m,e[1]=h+y,e[2]=d-_,e[3]=0,e[4]=h-y,e[5]=1-c-m,e[6]=f+g,e[7]=0,e[8]=d+_,e[9]=f-g,e[10]=1-c-p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},K.frustum=function(e,r,i,n,o,a,s){var l=1/(i-r),u=1/(o-n),c=1/(a-s);return e[0]=2*a*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*u,e[6]=0,e[7]=0,e[8]=(i+r)*l,e[9]=(o+n)*u,e[10]=(s+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*a*2*c,e[15]=0,e},K.perspectiveNO=eo,K.perspectiveZO=function(e,r,i,n,o){var a,s=1/Math.tan(r/2);return e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=o&&o!==1/0?(e[10]=o*(a=1/(n-o)),e[14]=o*n*a):(e[10]=-1,e[14]=-n),e},K.perspectiveFromFieldOfView=function(e,r,i,n){var o=Math.tan(r.upDegrees*Math.PI/180),a=Math.tan(r.downDegrees*Math.PI/180),s=Math.tan(r.leftDegrees*Math.PI/180),l=Math.tan(r.rightDegrees*Math.PI/180),u=2/(s+l),c=2/(o+a);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(s-l)*u*.5,e[9]=(o-a)*c*.5,e[10]=n/(i-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*i/(i-n),e[15]=0,e},K.orthoNO=ea,K.orthoZO=function(e,r,i,n,o,a,s){var l=1/(r-i),u=1/(n-o),c=1/(a-s);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10
9]=c,e[11]=0,e[12]=(r+i)*l,e[13]=(o+n)*u,e[14]=a*c,e[15]=1,e},K.lookAt=function(e,r,i,n){var o,a,s,l,u,c,h,p,d,f,m=r[0],g=r[1],_=r[2],y=n[0],v=n[1],x=n[2],b=i[0],w=i[1],E=i[2];return Math.abs(m-b)<J.EPSILON&&Math.abs(g-w)<J.EPSILON&&Math.abs(_-E)<J.EPSILON?et(e):(h=m-b,p=g-w,d=_-E,o=v*(d*=f=1/Math.hypot(h,p,d))-x*(p*=f),(f=Math.hypot(o,a=x*(h*=f)-y*d,s=y*p-v*h))?(o*=f=1/f,a*=f,s*=f):(o=0,a=0,s=0),(f=Math.hypot(l=p*s-d*a,u=d*o-h*s,c=h*a-p*o))?(l*=f=1/f,u*=f,c*=f):(l=0,u=0,c=0),e[0]=o,e[1]=l,e[2]=h,e[3]=0,e[4]=a,e[5]=u,e[6]=p,e[7]=0,e[8]=s,e[9]=c,e[10]=d,e[11]=0,e[12]=-(o*m+a*g+s*_),e[13]=-(l*m+u*g+c*_),e[14]=-(h*m+p*g+d*_),e[15]=1,e)},K.targetTo=function(e,r,i,n){var o=r[0],a=r[1],s=r[2],l=n[0],u=n[1],c=n[2],h=o-i[0],p=a-i[1],d=s-i[2],f=h*h+p*p+d*d;f>0&&(h*=f=1/Math.sqrt(f),p*=f,d*=f);var m=u*d-c*p,g=c*h-l*d,_=l*p-u*h;return(f=m*m+g*g+_*_)>0&&(m*=f=1/Math.sqrt(f),g*=f,_*=f),e[0]=m,e[1]=g,e[2]=_,e[3]=0,e[4]=p*_-d*g,e[5]=d*m-h*_,e[6]=h*g-p*m,e[7]=0,e[8]=h,e[9]=p,e[10]=d,e[11]=0,e[12]=o,e[13]=a,e[14]=s,e[15]=1,e},K.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},K.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},K.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e[3]=r[3]+i[3],e[4]=r[4]+i[4],e[5]=r[5]+i[5],e[6]=r[6]+i[6],e[7]=r[7]+i[7],e[8]=r[8]+i[8],e[9]=r[9]+i[9],e[10]=r[10]+i[10],e[11]=r[11]+i[11],e[12]=r[12]+i[12],e[13]=r[13]+i[13],e[14]=r[14]+i[14],e[15]=r[15]+i[15],e},K.subtract=es,K.multiplyScalar=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=r[7]*i,e[8]=r[8]*i,e[9]=r[9]*i,e[10
9]=r[10]*i,e[11]=r[11]*i,e[12]=r[12]*i,e[13]=r[13]*i,e[14]=r[14]*i,e[15]=r[15]*i,e},K.multiplyScalarAndAdd=function(e,r,i,n){return e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n,e[3]=r[3]+i[3]*n,e[4]=r[4]+i[4]*n,e[5]=r[5]+i[5]*n,e[6]=r[6]+i[6]*n,e[7]=r[7]+i[7]*n,e[8]=r[8]+i[8]*n,e[9]=r[9]+i[9]*n,e[10]=r[10]+i[10]*n,e[11]=r[11]+i[11]*n,e[12]=r[12]+i[12]*n,e[13]=r[13]+i[13]*n,e[14]=r[14]+i[14]*n,e[15]=r[15]+i[15]*n,e},K.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]},K.equals=function(e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],m=e[12],g=e[13],_=e[14],y=e[15],v=r[0],x=r[1],b=r[2],w=r[3],E=r[4],S=r[5],T=r[6],I=r[7],M=r[8],C=r[9],A=r[10],P=r[11],L=r[12],O=r[13],D=r[14],R=r[15];return Math.abs(i-v)<=J.EPSILON*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-x)<=J.EPSILON*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(o-b)<=J.EPSILON*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-w)<=J.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-E)<=J.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(l-S)<=J.EPSILON*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-T)<=J.EPSILON*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(c-I)<=J.EPSILON*Math.max(1,Math.abs(c),Math.abs(I))&&Math.abs(h-M)<=J.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(p-C)<=J.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(d-A)<=J.EPSILON*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(f-P)<=J.EPSILON*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-L)<=J.EPSILON*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(g-O)<=J.EPSILON*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(_-D)<=J.EPSILON*Math.max(1,Math.abs(_),Math.abs(D))&&Math.abs(y-R)<=J.EPSILON*Math.max(1,Math.abs(y),Math.abs(R))},K.sub=K.mul=K.ortho=K.perspective=void 0;var J=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==Q(e)&&"function"!=typeof e)return{default:e};var r=ee(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(A);function ee(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(ee=function(e){return e?i:r})(e)}function et(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function er(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],g=r[12],_=r[13],y=r[14],v=r[15],x=i[0],b=i[1],w=i[2],E=i[3];return e[0]=x*n+b*l+w*p+E*g,e[1]=x*o+b*u+w*d+E*_,e[2]=x*a+b*c+w*f+E*y,e[3]=x*s+b*h+w*m+E*v,e[4]=(x=i[4])*n+(b=i[5])*l+(w=i[6])*p+(E=i[7])*g,e[5]=x*o+b*u+w*d+E*_,e[6]=x*a+b*c+w*f+E*y,e[7]=x*s+b*h+w*m+E*v,e[8]=(x=i[8])*n+(b=i[9])*l+(w=i[10])*p+(E=i[11])*g,e[9]=x*o+b*u+w*d+E*_,e[10]=x*a+b*c+w*f+E*y,e[11]=x*s+b*h+w*m+E*v,e[12]=(x=i[12])*n+(b=i[13])*l+(w=i[14])*p+(E=i[15])*g,e[13]=x*o+b*u+w*d+E*_,e[14]=x*a+b*c+w*f+E*y,e[15]=x*s+b*h+w*m+E*v,e}function ei(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=n+n,u=o+o,c=a+a,h=n*l,p=n*u,d=n*c,f=o*u,m=o*c,g=a*c,_=s*l,y=s*u,v=s*c;return e[0]=1-(f+g),e[1]=p+v,e[2]=d-y,e[3]=0,e[4]=p-v,e[5]=1-(h+g),e[6]=m+_,e[7]=0,e[8]=d+y,e[9]=m-_,e[10]=1-(h+f),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function en(e,r){var i=r[4],n=r[5],o=r[6],a=r[8],s=r[9],l=r[10];return e[0]=Math.hypot(r[0],r[1],r[2]),e[1]=Math.hypot(i,n,o),e[2]=Math.hypot(a,s,l),e}function eo(e,r,i,n,o){var a,s=1/Math.tan(r/2);return e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=o&&o!==1/0?(e[10]=(o+n)*(a=1/(n-o)),e[14]=2*o*n*a):(e[10]=-1,e[14]=-2*n),e}function ea(e,r,i,n,o,a,s){var l=1/(r-i),u=1/(n-o),c=1/(a-s);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10
9]=2*c,e[11]=0,e[12]=(r+i)*l,e[13]=(o+n)*u,e[14]=(s+a)*c,e[15]=1,e}function es(e,r,i){return e[0]=r[0]-i[0],e[1]=r[1]-i[1],e[2]=r[2]-i[2],e[3]=r[3]-i[3],e[4]=r[4]-i[4],e[5]=r[5]-i[5],e[6]=r[6]-i[6],e[7]=r[7]-i[7],e[8]=r[8]-i[8],e[9]=r[9]-i[9],e[10]=r[10]-i[10],e[11]=r[11]-i[11],e[12]=r[12]-i[12],e[13]=r[13]-i[13],e[14]=r[14]-i[14],e[15]=r[15]-i[15],e}K.perspective=eo,K.ortho=ea,K.mul=er,K.sub=es;var el={},eu={};function ec(e){return(ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(eu,"__esModule",{value:!0}),eu.create=ed,eu.clone=function(e){var r=new eh.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r},eu.length=ef,eu.fromValues=function(e,r,i){var n=new eh.ARRAY_TYPE(3);return n[0]=e,n[1]=r,n[2]=i,n},eu.copy=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e},eu.set=function(e,r,i,n){return e[0]=r,e[1]=i,e[2]=n,e},eu.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e},eu.subtract=em,eu.multiply=eg,eu.divide=e_,eu.ceil=function(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e},eu.floor=function(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e},eu.min=function(e,r,i){return e[0]=Math.min(r[0],i[0]),e[1]=Math.min(r[1],i[1]),e[2]=Math.min(r[2],i[2]),e},eu.max=function(e,r,i){return e[0]=Math.max(r[0],i[0]),e[1]=Math.max(r[1],i[1]),e[2]=Math.max(r[2],i[2]),e},eu.round=function(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e},eu.scale=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e},eu.scaleAndAdd=function(e,r,i,n){return e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n,e},eu.distance=ey,eu.squaredDistance=ev,eu.squaredLength=ex,eu.negate=function(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e},eu.inverse=function(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e},eu.normalize=function(e,r){var i=r[0],n=r[1],o=r[2],a=i*i+n*n+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e},eu.dot=eb,eu.cross=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=i[0],l=i[1],u=i[2];return e[0]=o*u-a*l,e[1]=a*s-n*u,e[2]=n*l-o*s,e},eu.lerp=function(e,r,i,n){var o=r[0],a=r[1],s=r[2];return e[0]=o+n*(i[0]-o),e[1]=a+n*(i[1]-a),e[2]=s+n*(i[2]-s),e},eu.hermite=function(e,r,i,n,o,a){var s=a*a,l=s*(2*a-3)+1,u=s*(a-2)+a,c=s*(a-1),h=s*(3-2*a);return e[0]=r[0]*l+i[0]*u+n[0]*c+o[0]*h,e[1]=r[1]*l+i[1]*u+n[1]*c+o[1]*h,e[2]=r[2]*l+i[2]*u+n[2]*c+o[2]*h,e},eu.bezier=function(e,r,i,n,o,a){var s=1-a,l=s*s,u=a*a,c=l*s,h=3*a*l,p=3*u*s,d=u*a;return e[0]=r[0]*c+i[0]*h+n[0]*p+o[0]*d,e[1]=r[1]*c+i[1]*h+n[1]*p+o[1]*d,e[2]=r[2]*c+i[2]*h+n[2]*p+o[2]*d,e},eu.random=function(e,r){r=r||1;var i=2*eh.RANDOM()*Math.PI,n=2*eh.RANDOM()-1,o=Math.sqrt(1-n*n)*r;return e[0]=Math.cos(i)*o,e[1]=Math.sin(i)*o,e[2]=n*r,e},eu.transformMat4=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=i[3]*n+i[7]*o+i[11]*a+i[15];return e[0]=(i[0]*n+i[4]*o+i[8]*a+i[12])/(s=s||1),e[1]=(i[1]*n+i[5]*o+i[9]*a+i[13])/s,e[2]=(i[2]*n+i[6]*o+i[10]*a+i[14])/s,e},eu.transformMat3=function(e,r,i){var n=r[0],o=r[1],a=r[2];return e[0]=n*i[0]+o*i[3]+a*i[6],e[1]=n*i[1]+o*i[4]+a*i[7],e[2]=n*i[2]+o*i[5]+a*i[8],e},eu.transformQuat=function(e,r,i){var n=i[0],o=i[1],a=i[2],s=r[0],l=r[1],u=r[2],c=o*u-a*l,h=a*s-n*u,p=n*l-o*s,d=o*p-a*h,f=a*c-n*p,m=n*h-o*c,g=2*i[3];return h*=g,p*=g,f*=2,m*=2,e[0]=s+(c*=g)+(d*=2),e[1]=l+h+f,e[2]=u+p+m,e},eu.rotateX=function(e,r,i,n){var o=[],a=[];return o[0]=r[0]-i[0],o[1]=r[1]-i[1],o[2]=r[2]-i[2],a[0]=o[0],a[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),a[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},eu.rotateY=function(e,r,i,n){var o=[],a=[];return o[0]=r[0]-i[0],o[1]=r[1]-i[1],o[2]=r[2]-i[2],a[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),a[1]=o[1],a[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},eu.rotateZ=function(e,r,i,n){var o=[],a=[];return o[0]=r[0]-i[0],o[1]=r[1]-i[1],o[2]=r[2]-i[2],a[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),a[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),a[2]=o[2],e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},eu.angle=function(e,r){var i=e[0],n=e[1],o=e[2],a=r[0],s=r[1],l=r[2],u=Math.sqrt(i*i+n*n+o*o)*Math.sqrt(a*a+s*s+l*l);return Math.acos(Math.min(Math.max(u&&eb(e,r)/u,-1),1))},eu.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e},eu.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},eu.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]},eu.equals=function(e,r){var i=e[0],n=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return Math.abs(i-a)<=eh.EPSILON*Math.max(1,Math.abs(i),Math.abs(a)
9)&&Math.abs(n-s)<=eh.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-l)<=eh.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))},eu.forEach=eu.sqrLen=eu.len=eu.sqrDist=eu.dist=eu.div=eu.mul=eu.sub=void 0;var eh=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==ec(e)&&"function"!=typeof e)return{default:e};var r=ep(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(A);function ep(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(ep=function(e){return e?i:r})(e)}function ed(){var e=new eh.ARRAY_TYPE(3);return eh.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ef(e){return Math.hypot(e[0],e[1],e[2])}function em(e,r,i){return e[0]=r[0]-i[0],e[1]=r[1]-i[1],e[2]=r[2]-i[2],e}function eg(e,r,i){return e[0]=r[0]*i[0],e[1]=r[1]*i[1],e[2]=r[2]*i[2],e}function e_(e,r,i){return e[0]=r[0]/i[0],e[1]=r[1]/i[1],e[2]=r[2]/i[2],e}function ey(e,r){return Math.hypot(r[0]-e[0],r[1]-e[1],r[2]-e[2])}function ev(e,r){var i=r[0]-e[0],n=r[1]-e[1],o=r[2]-e[2];return i*i+n*n+o*o}function ex(e){var r=e[0],i=e[1],n=e[2];return r*r+i*i+n*n}function eb(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}eu.sub=em,eu.mul=eg,eu.div=e_,eu.dist=ey,eu.sqrDist=ev,eu.len=ef,eu.sqrLen=ex,u=ed(),eu.forEach=function(e,r,i,n,o,a){var s,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,s=i;s<l;s+=r)u[0]=e[s],u[1]=e[s+1],u[2]=e[s+2],o(u,u,a),e[s]=u[0],e[s+1]=u[1],e[s+2]=u[2];return e};var ew={};function eE(e){return(eE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(ew,"__esModule",{value:!0}),ew.create=eI,ew.clone=function(e){var r=new eS.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r},ew.fromValues=function(e,r,i,n){var o=new eS.ARRAY_TYPE(4);return o[0]=e,o[1]=r,o[2]=i,o[3]=n,o},ew.copy=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e},ew.set=function(e,r,i,n,o){return e[0]=r,e[1]=i,e[2]=n,e[3]=o,e},ew.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e[3]=r[3]+i[3],e},ew.subtract=eM,ew.multiply=eC,ew.divide=eA,ew.ceil=function(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e[3]=Math.ceil(r[3]),e},ew.floor=function(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e[3]=Math.floor(r[3]),e},ew.min=function(e,r,i){return e[0]=Math.min(r[0],i[0]),e[1]=Math.min(r[1],i[1]),e[2]=Math.min(r[2],i[2]),e[3]=Math.min(r[3],i[3]),e},ew.max=function(e,r,i){return e[0]=Math.max(r[0],i[0]),e[1]=Math.max(r[1],i[1]),e[2]=Math.max(r[2],i[2]),e[3]=Math.max(r[3],i[3]),e},ew.round=function(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e[3]=Math.round(r[3]),e},ew.scale=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e},ew.scaleAndAdd=function(e,r,i,n){return e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n,e[3]=r[3]+i[3]*n,e},ew.distance=eP,ew.squaredDistance=eL,ew.length=eO,ew.squaredLength=eD,ew.negate=function(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=-r[3],e},ew.inverse=function(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e[3]=1/r[3],e},ew.normalize=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=i*i+n*n+o*o+a*a;return s>0&&(s=1/Math.sqrt(s)),e[0]=i*s,e[1]=n*s,e[2]=o*s,e[3]=a*s,e},ew.dot=function(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},ew.cross=function(e,r,i,n){var o=i[0]*n[1]-i[1]*n[0],a=i[0]*n[2]-i[2]*n[0],s=i[0]*n[3]-i[3]*n[0],l=i[1]*n[2]-i[2]*n[1],u=i[1]*n[3]-i[3]*n[1],c=i[2]*n[3]-i[3]*n[2],h=r[0],p=r[1],d=r[2],f=r[3];return e[0]=p*c-d*u+f*l,e[1]=-h*c+d*s-f*a,e[2]=h*u-p*s+f*o,e[3]=-h*l+p*a-d*o,e},ew.lerp=function(e,r,i,n){var o=r[0],a=r[1],s=r[2],l=r[3];return e[0]=o+n*(i[0]-o),e[1]=a+n*(i[1]-a),e[2]=s+n*(i[2]-s),e[3]=l+n*(i[3]-l),e},ew.random=function(e,r){r=r||1;do s=(i=2*eS.RANDOM()-1)*i+(n=2*eS.RANDOM()-1)*n;while(s>=1);do l=(o=2*eS.RANDOM()-1)*o+(a=2*eS.RANDOM()-1)*a;while(l>=1);var i,n,o,a,s,l,u=Math.sqrt((1-s)/l);return e[0]=r*i,e[1]=r*n,e[2]=r*o*u,e[3]=r*a*u,e},ew.transformMat4=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3];return e[0]=i[0]*n+i[4]*o+i[8]*a+i[12]*s,e[1]=i[1]*n+i[5]*o+i[9]*a+i[13]*s,e[2]=i[2]*n+i[6]*o+i[10]*a+i[14]*s,e[3]=i[3]*n+i[7]*o+i[11]*a+i[15]*s,e},ew.transformQuat=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=i[0],l=i[1],u=i[2],c=i[3],h=c*n+l*a-u*o,p=c*o+u*n-s*a,d=c*a+s*o-l*n,f=-s*n-l*o-u*a;return e[0]=h*c+-(f*s)+-(p*u)- -(d*l),e[1]=p*c+-(f*l)+-(d*s)- -(h*u),e[2]=d*c+-(f*u)+-(h*l)- -(p*s),e[3]=r[3],e},ew.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},ew.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},ew.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]},ew.equals=function(e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return Math.abs(i-s)<=eS.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-l)<=eS.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-u)<=eS.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(a-c)<=eS.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))}
9,ew.forEach=ew.sqrLen=ew.len=ew.sqrDist=ew.dist=ew.div=ew.mul=ew.sub=void 0;var eS=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==eE(e)&&"function"!=typeof e)return{default:e};var r=eT(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(A);function eT(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(eT=function(e){return e?i:r})(e)}function eI(){var e=new eS.ARRAY_TYPE(4);return eS.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function eM(e,r,i){return e[0]=r[0]-i[0],e[1]=r[1]-i[1],e[2]=r[2]-i[2],e[3]=r[3]-i[3],e}function eC(e,r,i){return e[0]=r[0]*i[0],e[1]=r[1]*i[1],e[2]=r[2]*i[2],e[3]=r[3]*i[3],e}function eA(e,r,i){return e[0]=r[0]/i[0],e[1]=r[1]/i[1],e[2]=r[2]/i[2],e[3]=r[3]/i[3],e}function eP(e,r){return Math.hypot(r[0]-e[0],r[1]-e[1],r[2]-e[2],r[3]-e[3])}function eL(e,r){var i=r[0]-e[0],n=r[1]-e[1],o=r[2]-e[2],a=r[3]-e[3];return i*i+n*n+o*o+a*a}function eO(e){return Math.hypot(e[0],e[1],e[2],e[3])}function eD(e){var r=e[0],i=e[1],n=e[2],o=e[3];return r*r+i*i+n*n+o*o}function eR(e){return(eR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}ew.sub=eM,ew.mul=eC,ew.div=eA,ew.dist=eP,ew.sqrDist=eL,ew.len=eO,ew.sqrLen=eD,c=eI(),ew.forEach=function(e,r,i,n,o,a){var s,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,s=i;s<l;s+=r)c[0]=e[s],c[1]=e[s+1],c[2]=e[s+2],c[3]=e[s+3],o(c,c,a),e[s]=c[0],e[s+1]=c[1],e[s+2]=c[2],e[s+3]=c[3];return e}
9,Object.defineProperty(el,"__esModule",{value:!0}),el.create=ej,el.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},el.setAxisAngle=eV,el.getAxisAngle=function(e,r){var i=2*Math.acos(r[3]),n=Math.sin(i/2);return n>ek.EPSILON?(e[0]=r[0]/n,e[1]=r[1]/n,e[2]=r[2]/n):(e[0]=1,e[1]=0,e[2]=0),i},el.getAngle=function(e,r){var i=eZ(e,r);return Math.acos(2*i*i-1)},el.multiply=eG,el.rotateX=function(e,r,i){i*=.5;var n=r[0],o=r[1],a=r[2],s=r[3],l=Math.sin(i),u=Math.cos(i);return e[0]=n*u+s*l,e[1]=o*u+a*l,e[2]=a*u-o*l,e[3]=s*u-n*l,e},el.rotateY=function(e,r,i){i*=.5;var n=r[0],o=r[1],a=r[2],s=r[3],l=Math.sin(i),u=Math.cos(i);return e[0]=n*u-a*l,e[1]=o*u+s*l,e[2]=a*u+n*l,e[3]=s*u-o*l,e},el.rotateZ=function(e,r,i){i*=.5;var n=r[0],o=r[1],a=r[2],s=r[3],l=Math.sin(i),u=Math.cos(i);return e[0]=n*u+o*l,e[1]=o*u-n*l,e[2]=a*u+s*l,e[3]=s*u-a*l,e},el.calculateW=function(e,r){var i=r[0],n=r[1],o=r[2];return e[0]=i,e[1]=n,e[2]=o,e[3]=Math.sqrt(Math.abs(1-i*i-n*n-o*o)),e},el.exp=eq,el.ln=eH,el.pow=function(e,r,i){return eH(e,r),eY(e,e,i),eq(e,e),e},el.slerp=e$,el.random=function(e){var r=ek.RANDOM(),i=ek.RANDOM(),n=ek.RANDOM(),o=Math.sqrt(1-r),a=Math.sqrt(r);return e[0]=o*Math.sin(2*Math.PI*i),e[1]=o*Math.cos(2*Math.PI*i),e[2]=a*Math.sin(2*Math.PI*n),e[3]=a*Math.cos(2*Math.PI*n),e},el.invert=function(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=i*i+n*n+o*o+a*a,l=s?1/s:0;return e[0]=-i*l,e[1]=-n*l,e[2]=-o*l,e[3]=a*l,e},el.conjugate=function(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e},el.fromMat3=eW,el.fromEuler=function(e,r,i,n){var o=.5*Math.PI/180;r*=o,i*=o,n*=o;var a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(n),h=Math.cos(n);return e[0]=a*u*h-s*l*c,e[1]=s*l*h+a*u*c,e[2]=s*u*c-a*l*h,e[3]=s*u*h+a*l*c,e},el.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},el.setAxes=el.sqlerp=el.rotationTo=el.equals=el.exactEquals=el.normalize=el.sqrLen=el.squaredLength=el.len=el.length=el.lerp=el.dot=el.scale=el.mul=el.add=el.set=el.copy=el.fromValues=el.clone=void 0;var ek=eU(A),eN=eU(H),eF=eU(eu),ez=eU(ew);function eB(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(eB=function(e){return e?i:r})(e)}function eU(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!==eR(e)&&"function"!=typeof e)return{default:e};var i=eB(r);if(i&&i.has(e))return i.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,i&&i.set(e,n),n}function ej(){var e=new ek.ARRAY_TYPE(4);return ek.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}
9function eV(e,r,i){var n=Math.sin(i*=.5);return e[0]=n*r[0],e[1]=n*r[1],e[2]=n*r[2],e[3]=Math.cos(i),e}function eG(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=i[0],u=i[1],c=i[2],h=i[3];return e[0]=n*h+s*l+o*c-a*u,e[1]=o*h+s*u+a*l-n*c,e[2]=a*h+s*c+n*u-o*l,e[3]=s*h-n*l-o*u-a*c,e}function eq(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=Math.sqrt(i*i+n*n+o*o),l=Math.exp(a),u=s>0?l*Math.sin(s)/s:0;return e[0]=i*u,e[1]=n*u,e[2]=o*u,e[3]=l*Math.cos(s),e}function eH(e,r){var i=r[0],n=r[1],o=r[2],a=r[3],s=Math.sqrt(i*i+n*n+o*o),l=s>0?Math.atan2(s,a)/s:0;return e[0]=i*l,e[1]=n*l,e[2]=o*l,e[3]=.5*Math.log(i*i+n*n+o*o+a*a),e}function e$(e,r,i,n){var o,a,s,l,u,c=r[0],h=r[1],p=r[2],d=r[3],f=i[0],m=i[1],g=i[2],_=i[3];return(a=c*f+h*m+p*g+d*_)<0&&(a=-a,f=-f,m=-m,g=-g,_=-_),1-a>ek.EPSILON?(s=Math.sin(o=Math.acos(a)),l=Math.sin((1-n)*o)/s,u=Math.sin(n*o)/s):(l=1-n,u=n),e[0]=l*c+u*f,e[1]=l*h+u*m,e[2]=l*p+u*g,e[3]=l*d+u*_,e}function eW(e,r){var i,n=r[0]+r[4]+r[8];if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,e[0]=(r[5]-r[7])*(i=.5/i),e[1]=(r[6]-r[2])*i,e[2]=(r[1]-r[3])*i;else{var o=0;r[4]>r[0]&&(o=1),r[8]>r[3*o+o]&&(o=2);var a=(o+1)%3,s=(o+2)%3;i=Math.sqrt(r[3*o+o]-r[3*a+a]-r[3*s+s]+1),e[o]=.5*i,e[3]=(r[3*a+s]-r[3*s+a])*(i=.5/i),e[a]=(r[3*a+o]+r[3*o+a])*i,e[s]=(r[3*s+o]+r[3*o+s])*i}return e}el.clone=ez.clone,el.fromValues=ez.fromValues,el.copy=ez.copy,el.set=ez.set,el.add=ez.add,el.mul=eG;var eY=ez.scale;el.scale=eY;var eZ=ez.dot;el.dot=eZ,el.lerp=ez.lerp;var eX=ez.length;el.length=eX,el.len=eX;var eK=ez.squaredLength;el.squaredLength=eK,el.sqrLen=eK;var eQ=ez.normalize;el.normalize=eQ,el.exactEquals=ez.exactEquals,el.equals=ez.equals,h=eF.create(),p=eF.fromValues(1,0,0),d=eF.fromValues(0,1,0),el.rotationTo=function(e,r,i){var n=eF.dot(r,i);return n<-.999999?(eF.cross(h,p,r),1e-6>eF.len(h)&&eF.cross(h,d,r),eF.normalize(h,h),eV(e,h,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(eF.cross(h,r,i),e[0]=h[0],e[1]=h[1],e[2]=h[2],e[3]=1+n,eQ(e,e))},f=ej(),m=ej(),el.sqlerp=function(e,r,i,n,o,a){return e$(f,r,o,a),e$(m,i,n,a),e$(e,f,m,2*a*(1-a)),e},g=eN.create(),el.setAxes=function(e,r,i,n){return g[0]=i[0],g[3]=i[1],g[6]=i[2],g[1]=n[0],g[4]=n[1],g[7]=n[2],g[2]=-r[0],g[5]=-r[1],g[8]=-r[2],eQ(e,eW(e,g))};var eJ={};function e0(e){return(e0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(eJ,"__esModule",{value:!0}),eJ.create=function(){var e=new e1.ARRAY_TYPE(8);return e1.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e},eJ.clone=function(e){var r=new e1.ARRAY_TYPE(8);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r},eJ.fromValues=function(e,r,i,n,o,a,s,l){var u=new e1.ARRAY_TYPE(8);return u[0]=e,u[1]=r,u[2]=i,u[3]=n,u[4]=o,u[5]=a,u[6]=s,u[7]=l,u},eJ.fromRotationTranslationValues=function(e,r,i,n,o,a,s){var l=new e1.ARRAY_TYPE(8);l[0]=e,l[1]=r,l[2]=i,l[3]=n;var u=.5*o,c=.5*a,h=.5*s;return l[4]=u*n+c*i-h*r,l[5]=c*n+h*e-u*i,l[6]=h*n+u*r-c*e,l[7]=-u*e-c*r-h*i,l},eJ.fromRotationTranslation=e6,eJ.fromTranslation=function(e,r){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*r[0],e[5]=.5*r[1],e[6]=.5*r[2],e[7]=0,e},eJ.fromRotation=function(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},eJ.fromMat4=function(e,r){var i=e2.create();e3.getRotation(i,r);var n=new e1.ARRAY_TYPE(3);return e3.getTranslation(n,r),e6(e,i,n),e},eJ.copy=e8,eJ.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},eJ.set=function(e,r,i,n,o,a,s,l,u){return e[0]=r,e[1]=i,e[2]=n,e[3]=o,e[4]=a,e[5]=s,e[6]=l,e[7]=u,e},eJ.getDual=function(e,r){return e[0]=r[4],e[1]=r[5],e[2]=r[6],e[3]=r[7],e},eJ.setDual=function(e,r){return e[4]=r[0],e[5]=r[1],e[6]=r[2],e[7]=r[3],e},eJ.getTranslation=function(e,r){var i=r[4],n=r[5],o=r[6],a=r[7],s=-r[0],l=-r[1],u=-r[2],c=r[3];return e[0]=2*(i*c+a*s+n*u-o*l),e[1]=2*(n*c+a*l+o*s-i*u),e[2]=2*(o*c+a*u+i*l-n*s),e},eJ.translate=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=.5*i[0],u=.5*i[1],c=.5*i[2],h=r[4],p=r[5],d=r[6],f=r[7];return e[0]=n,e[1]=o,e[2]=a,e[3]=s,e[4]=s*l+o*c-a*u+h,e[5]=s*u+a*l-n*c+p,e[6]=s*c+n*u-o*l+d,e[7]=-n*l-o*u-a*c+f,e},eJ.rotateX=function(e,r,i){var n=-r[0],o=-r[1],a=-r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=l*s+h*n+u*a-c*o,d=u*s+h*o+c*n-l*a,f=c*s+h*a+l*o-u*n,m=h*s-l*n-u*o-c*a;
9return e2.rotateX(e,r,i),e[4]=p*(s=e[3])+m*(n=e[0])+d*(a=e[2])-f*(o=e[1]),e[5]=d*s+m*o+f*n-p*a,e[6]=f*s+m*a+p*o-d*n,e[7]=m*s-p*n-d*o-f*a,e},eJ.rotateY=function(e,r,i){var n=-r[0],o=-r[1],a=-r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=l*s+h*n+u*a-c*o,d=u*s+h*o+c*n-l*a,f=c*s+h*a+l*o-u*n,m=h*s-l*n-u*o-c*a;return e2.rotateY(e,r,i),e[4]=p*(s=e[3])+m*(n=e[0])+d*(a=e[2])-f*(o=e[1]),e[5]=d*s+m*o+f*n-p*a,e[6]=f*s+m*a+p*o-d*n,e[7]=m*s-p*n-d*o-f*a,e},eJ.rotateZ=function(e,r,i){var n=-r[0],o=-r[1],a=-r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],p=l*s+h*n+u*a-c*o,d=u*s+h*o+c*n-l*a,f=c*s+h*a+l*o-u*n,m=h*s-l*n-u*o-c*a;return e2.rotateZ(e,r,i),e[4]=p*(s=e[3])+m*(n=e[0])+d*(a=e[2])-f*(o=e[1]),e[5]=d*s+m*o+f*n-p*a,e[6]=f*s+m*a+p*o-d*n,e[7]=m*s-p*n-d*o-f*a,e},eJ.rotateByQuatAppend=function(e,r,i){var n=i[0],o=i[1],a=i[2],s=i[3],l=r[0],u=r[1],c=r[2],h=r[3];return e[0]=l*s+h*n+u*a-c*o,e[1]=u*s+h*o+c*n-l*a,e[2]=c*s+h*a+l*o-u*n,e[3]=h*s-l*n-u*o-c*a,e[4]=(l=r[4])*s+(h=r[7])*n+(u=r[5])*a-(c=r[6])*o,e[5]=u*s+h*o+c*n-l*a,e[6]=c*s+h*a+l*o-u*n,e[7]=h*s-l*n-u*o-c*a,e},eJ.rotateByQuatPrepend=function(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=i[0],u=i[1],c=i[2],h=i[3];return e[0]=n*h+s*l+o*c-a*u,e[1]=o*h+s*u+a*l-n*c,e[2]=a*h+s*c+n*u-o*l,e[3]=s*h-n*l-o*u-a*c,e[4]=n*(h=i[7])+s*(l=i[4])+o*(c=i[6])-a*(u=i[5]),e[5]=o*h+s*u+a*l-n*c,e[6]=a*h+s*c+n*u-o*l,e[7]=s*h-n*l-o*u-a*c,e},eJ.rotateAroundAxis=function(e,r,i,n){if(Math.abs(n)<e1.EPSILON)return e8(e,r);var o=Math.hypot(i[0],i[1],i[2]),a=Math.sin(n*=.5),s=a*i[0]/o,l=a*i[1]/o,u=a*i[2]/o,c=Math.cos(n),h=r[0],p=r[1],d=r[2],f=r[3];e[0]=h*c+f*s+p*u-d*l,e[1]=p*c+f*l+d*s-h*u,e[2]=d*c+f*u+h*l-p*s,e[3]=f*c-h*s-p*l-d*u;var m=r[4],g=r[5],_=r[6],y=r[7];return e[4]=m*c+y*s+g*u-_*l,e[5]=g*c+y*l+_*s-m*u,e[6]=_*c+y*u+m*l-g*s,e[7]=y*c-m*s-g*l-_*u,e},eJ.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e[3]=r[3]+i[3],e[4]=r[4]+i[4],e[5]=r[5]+i[5],e[6]=r[6]+i[6],e[7]=r[7]+i[7],e},eJ.multiply=e9,eJ.scale=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=r[7]*i,e},eJ.lerp=function(e,r,i,n){var o=1-n;return 0>e7(r,i)&&(n=-n),e[0]=r[0]*o+i[0]*n,e[1]=r[1]*o+i[1]*n,e[2]=r[2]*o+i[2]*n,e[3]=r[3]*o+i[3]*n,e[4]=r[4]*o+i[4]*n,e[5]=r[5]*o+i[5]*n,e[6]=r[6]*o+i[6]*n,e[7]=r[7]*o+i[7]*n,e},eJ.invert=function(e,r){var i=tt(r);return e[0]=-r[0]/i,e[1]=-r[1]/i,e[2]=-r[2]/i,e[3]=r[3]/i,e[4]=-r[4]/i,e[5]=-r[5]/i,e[6]=-r[6]/i,e[7]=r[7]/i,e},eJ.conjugate=function(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e[4]=-r[4],e[5]=-r[5],e[6]=-r[6],e[7]=r[7],e},eJ.normalize=function(e,r){var i=tt(r);if(i>0){i=Math.sqrt(i);var n=r[0]/i,o=r[1]/i,a=r[2]/i,s=r[3]/i,l=r[4],u=r[5],c=r[6],h=r[7],p=n*l+o*u+a*c+s*h;e[0]=n,e[1]=o,e[2]=a,e[3]=s,e[4]=(l-n*p)/i,e[5]=(u-o*p)/i,e[6]=(c-a*p)/i,e[7]=(h-s*p)/i}return e},eJ.str=function(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"},eJ.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]},eJ.equals=function(e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=r[0],p=r[1],d=r[2],f=r[3],m=r[4],g=r[5],_=r[6],y=r[7];return Math.abs(i-h)<=e1.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(n-p)<=e1.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(o-d)<=e1.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-f)<=e1.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(s-m)<=e1.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(l-g)<=e1.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-_)<=e1.EPSILON*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(c-y)<=e1.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))},eJ.sqrLen=eJ.squaredLength=eJ.len=eJ.length=eJ.dot=eJ.mul=eJ.setReal=eJ.getReal=void 0;var e1=e4(A),e2=e4(el),e3=e4(K);function e5(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(e5=function(e){return e?i:r})(e)}function e4(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!==e0(e)&&"function"!=typeof e)return{default:e};var i=e5(r);if(i&&i.has(e))return i.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,i&&i.set(e,n),n}
9function e6(e,r,i){var n=.5*i[0],o=.5*i[1],a=.5*i[2],s=r[0],l=r[1],u=r[2],c=r[3];return e[0]=s,e[1]=l,e[2]=u,e[3]=c,e[4]=n*c+o*u-a*l,e[5]=o*c+a*s-n*u,e[6]=a*c+n*l-o*s,e[7]=-n*s-o*l-a*u,e}function e8(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e}function e9(e,r,i){var n=r[0],o=r[1],a=r[2],s=r[3],l=i[4],u=i[5],c=i[6],h=i[7],p=r[4],d=r[5],f=r[6],m=r[7],g=i[0],_=i[1],y=i[2],v=i[3];return e[0]=n*v+s*g+o*y-a*_,e[1]=o*v+s*_+a*g-n*y,e[2]=a*v+s*y+n*_-o*g,e[3]=s*v-n*g-o*_-a*y,e[4]=n*h+s*l+o*c-a*u+p*v+m*g+d*y-f*_,e[5]=o*h+s*u+a*l-n*c+d*v+m*_+f*g-p*y,e[6]=a*h+s*c+n*u-o*l+f*v+m*y+p*_-d*g,e[7]=s*h-n*l-o*u-a*c+m*v-p*g-d*_-f*y,e}eJ.getReal=e2.copy,eJ.setReal=e2.copy,eJ.mul=e9;var e7=e2.dot;eJ.dot=e7;var te=e2.length;eJ.length=te,eJ.len=te;var tt=e2.squaredLength;eJ.squaredLength=tt,eJ.sqrLen=tt;var tr={};function ti(e){return(ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(tr,"__esModule",{value:!0}),tr.create=ta,tr.clone=function(e){var r=new tn.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r},tr.fromValues=function(e,r){var i=new tn.ARRAY_TYPE(2);return i[0]=e,i[1]=r,i},tr.copy=function(e,r){return e[0]=r[0],e[1]=r[1],e},tr.set=function(e,r,i){return e[0]=r,e[1]=i,e},tr.add=function(e,r,i){return e[0]=r[0]+i[0],e[1]=r[1]+i[1],e},tr.subtract=ts,tr.multiply=tl,tr.divide=tu,tr.ceil=function(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e},tr.floor=function(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e},tr.min=function(e,r,i){return e[0]=Math.min(r[0],i[0]),e[1]=Math.min(r[1],i[1]),e},tr.max=function(e,r,i){return e[0]=Math.max(r[0],i[0]),e[1]=Math.max(r[1],i[1]),e},tr.round=function(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e},tr.scale=function(e,r,i){return e[0]=r[0]*i,e[1]=r[1]*i,e},tr.scaleAndAdd=function(e,r,i,n){return e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e},tr.distance=tc,tr.squaredDistance=th,tr.length=tp,tr.squaredLength=td,tr.negate=function(e,r){return e[0]=-r[0],e[1]=-r[1],e},tr.inverse=function(e,r){return e[0]=1/r[0],e[1]=1/r[1],e},tr.normalize=function(e,r){var i=r[0],n=r[1],o=i*i+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=r[0]*o,e[1]=r[1]*o,e},tr.dot=function(e,r){return e[0]*r[0]+e[1]*r[1]},tr.cross=function(e,r,i){var n=r[0]*i[1]-r[1]*i[0];return e[0]=e[1]=0,e[2]=n,e},tr.lerp=function(e,r,i,n){var o=r[0],a=r[1];return e[0]=o+n*(i[0]-o),e[1]=a+n*(i[1]-a),e},tr.random=function(e,r){r=r||1;var i=2*tn.RANDOM()*Math.PI;return e[0]=Math.cos(i)*r,e[1]=Math.sin(i)*r,e},tr.transformMat2=function(e,r,i){var n=r[0],o=r[1];return e[0]=i[0]*n+i[2]*o,e[1]=i[1]*n+i[3]*o,e},tr.transformMat2d=function(e,r,i){var n=r[0],o=r[1];return e[0]=i[0]*n+i[2]*o+i[4],e[1]=i[1]*n+i[3]*o+i[5],e},tr.transformMat3=function(e,r,i){var n=r[0],o=r[1];return e[0]=i[0]*n+i[3]*o+i[6],e[1]=i[1]*n+i[4]*o+i[7],e},tr.transformMat4=function(e,r,i){var n=r[0],o=r[1];return e[0]=i[0]*n+i[4]*o+i[12],e[1]=i[1]*n+i[5]*o+i[13],e},tr.rotate=function(e,r,i,n){var o=r[0]-i[0],a=r[1]-i[1],s=Math.sin(n),l=Math.cos(n);return e[0]=o*l-a*s+i[0],e[1]=o*s+a*l+i[1],e},tr.angle=function(e,r){var i=e[0],n=e[1],o=r[0],a=r[1],s=Math.sqrt(i*i+n*n)*Math.sqrt(o*o+a*a);return Math.acos(Math.min(Math.max(s&&(i*o+n*a)/s,-1),1))},tr.zero=function(e){return e[0]=0,e[1]=0,e},tr.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},tr.exactEquals=function(e,r){return e[0]===r[0]&&e[1]===r[1]},tr.equals=function(e,r){var i=e[0],n=e[1],o=r[0],a=r[1];return Math.abs(i-o)<=tn.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-a)<=tn.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))},tr.forEach=tr.sqrLen=tr.sqrDist=tr.dist=tr.div=tr.mul=tr.sub=tr.len=void 0;var tn=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==ti(e)&&"function"!=typeof e)return{default:e};var r=to(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(A);function to(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(to=function(e){return e?i:r})(e)}function ta(){var e=new tn.ARRAY_TYPE(2);return tn.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}
9function ts(e,r,i){return e[0]=r[0]-i[0],e[1]=r[1]-i[1],e}function tl(e,r,i){return e[0]=r[0]*i[0],e[1]=r[1]*i[1],e}function tu(e,r,i){return e[0]=r[0]/i[0],e[1]=r[1]/i[1],e}function tc(e,r){return Math.hypot(r[0]-e[0],r[1]-e[1])}function th(e,r){var i=r[0]-e[0],n=r[1]-e[1];return i*i+n*n}function tp(e){return Math.hypot(e[0],e[1])}function td(e){var r=e[0],i=e[1];return r*r+i*i}function tf(e){return(tf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tm(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,i=new WeakMap;return(tm=function(e){return e?i:r})(e)}function tg(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!==tf(e)&&"function"!=typeof e)return{default:e};var i=tm(r);if(i&&i.has(e))return i.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,i&&i.set(e,n),n}function t_(e,r,i,n){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(n-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=i,this.p2y=n}tr.len=tp,tr.sub=ts,tr.mul=tl,tr.div=tu,tr.dist=tc,tr.sqrDist=th,tr.sqrLen=td,_=ta(),tr.forEach=function(e,r,i,n,o,a){var s,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,s=i;s<l;s+=r)_[0]=e[s],_[1]=e[s+1],o(_,_,a),e[s]=_[0],e[s+1]=_[1];return e},Object.defineProperty(C,"__esModule",{value:!0}),e.aa=C.vec4=e.Q=C.vec3=C.vec2=C.quat2=e.bl=C.quat=e.a9=C.mat4=e.ct=C.mat3=C.mat2d=e.b7=C.mat2=C.glMatrix=void 0,C.glMatrix=tg(A),e.b7=C.mat2=tg(D),C.mat2d=tg(B),e.ct=C.mat3=tg(H),e.a9=C.mat4=tg(K),e.bl=C.quat=tg(el),C.quat2=tg(eJ),C.vec2=tg(tr),e.Q=C.vec3=tg(eu),e.aa=C.vec4=tg(ew),t_.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(void 0===r&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,n=0;n<8;n++){var o=this.sampleCurveX(i)-e;if(Math.abs(o)<r)return i;var a=this.sampleCurveDerivativeX(i);if(1e-6>Math.abs(a))break;i-=o/a}var s=0,l=1;for(i=e,n=0;n<20&&!(Math.abs((o=this.sampleCurveX(i))-e)<r);n++)e>o?s=i:l=i,i=.5*(l-s)+s;return i},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}};var ty=M(t_);function tv(e,r){this.x=e,this.y=r}tv.prototype={clone:function(){return new tv(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,r){return this.clone()._rotateAround(e,r)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var r=e.x-this.x,i=e.y-this.y;return r*r+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)},_matMult:function(e){var r=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var r=Math.cos(e),i=Math.sin(e),n=i*this.x+r*this.y;return this.x=r*this.x-i*this.y,this.y=n,this}
9,_rotateAround:function(e,r){var i=Math.cos(e),n=Math.sin(e),o=r.y+n*(this.x-r.x)+i*(this.y-r.y);return this.x=r.x+i*(this.x-r.x)-n*(this.y-r.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},tv.convert=function(e){return e instanceof tv?e:Array.isArray(e)?new tv(e[0],e[1]):e};var tx=M(tv);let tb=Math.PI/180,tw=180/Math.PI,tE=[[0,0],[1,0],[1,1],[0,1]];function tS(e){if(e<=0)return 0;if(e>=1)return 1;let r=e*e,i=r*e;return 4*(e<.5?i:3*(e-r)+i-.75)}function tT(e,r,i,n){let o=new ty(e,r,i,n);return function(e){return o.solve(e)}}let tI=tT(.25,.1,.25,1);function tM(e,r,i){return Math.min(i,Math.max(r,e))}function tC(e,r,i){return(i=tM((i-e)/(r-e),0,1))*i*(3-2*i)}function tA(e,r,i){let n=i-r,o=((e-r)%n+n)%n+r;return o===r?i:o}function tP(e,r,i){if(!e.length)return i(null,[]);let n=e.length,o=Array(e.length),a=null;e.forEach((e,s)=>{r(e,(e,r)=>{e&&(a=e),o[s]=r,0==--n&&i(a,o)})})}function tL(e,...r){for(let i of r)for(let r in i)e[r]=i[r];return e}let tO=1;function tD(){return tO++}function tR(){return function e(r){return r?(r^Math.random()*(16>>r/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function tk(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function tN(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function tF(e,r){e.forEach(e=>{r[e]&&(r[e]=r[e].bind(r))})}function tz(e,r){return -1!==e.indexOf(r,e.length-r.length)}function tB(e,r,i){let n={};for(let i in e)n[i]=r.call(this,e[i],i,e);return n}function tU(e,r,i){let n={};for(let i in e)r.call(this,e[i],i,e)&&(n[i]=e[i]);return n}function tj(e){return Array.isArray(e)?e.map(tj):"object"==typeof e&&e?tB(e,tj):e}let tV={};function tG(e){tV[e]||("u">typeof console&&console.warn(e),tV[e]=!0)}function tq(e,r,i){return(i.y-e.y)*(r.x-e.x)>(r.y-e.y)*(i.x-e.x)}function tH([e,r,i]){let n=(r+90)*tb,o=i*tb;return{x:e*Math.cos(n)*Math.sin(o),y:e*Math.sin(n)*Math.sin(o),z:e*Math.cos(o),azimuthal:r,polar:i}}function t$(){return"u">typeof WorkerGlobalScope&&"u">typeof self&&self instanceof WorkerGlobalScope}function tW(e){let r={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,i,n,o)=>{let a=n||o;return r[i]=!a||a.toLowerCase(),""}),r["max-age"]){let e=parseInt(r["max-age"],10);isNaN(e)?delete r["max-age"]:r["max-age"]=e}return r}let tY,tZ,tX,tK,tQ,tJ,t0=null;function t1(e){try{let r=self[e];return r.setItem("_mapbox_test_",1),r.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function t2(e,r){return[e[4*r],e[4*r+1],e[4*r+2],e[4*r+3]]}function t3(e,r,i,n){for(;r<i;){let o=r+i>>1;e[o]<n?r=o+1:i=o}return r}function t5(e,r,i,n){for(;r<i;){let o=r+i>>1;e[o]<=n?r=o+1:i=o}return r}function t4(e){return e>0?1/(1.001-e):1+e}function t6(e){return e>0?1-1/(1.001-e):-e}function t8(){return null==tY&&(tY=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),tY}let t9={now:()=>void 0!==tK?tK:performance.now(),setNow(e){tK=e},restoreNow(){tK=void 0},frame(e){let r=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(r)}},getImageData(e,r=0){let{width:i,height:n}=e;tQ||(tQ=document.createElement("canvas"));let o=tQ.getContext("2d",{willReadFrequently:!0});if(!o)throw Error("failed to create canvas 2d context");return(i>tQ.width||n>tQ.height)&&(tQ.width=i,tQ.height=n),o.clearRect(-r,-r,i+2*r,n+2*r),o.drawImage(e,0,0,i,n),o.getImageData(-r,-r,i+2*r,n+2*r)},resolveURL:e=>(tZ||(tZ=document.createElement("a")),tZ.href=e,tZ.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==tX&&(tX=window.matchMedia("(prefers-reduced-motion: reduce)")),tX.matches)},hasCanvasFingerprintNoise(){if(void 0!==tJ)return tJ;if(!t8())return tJ=!1,!1;let e=new OffscreenCanvas(85,1),r=e.getContext("2d",{willReadFrequently:!0}),i=0;for(let n=0;n<e.width;++n)r.fillStyle=`rgba(${i++},${i++},${i++}, 255)`,r.fillRect(n,0,1,1);let n=r.getImageData(0,0,e.width,e.height);i=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&i++!==n.data[e])return tJ=!0,!0;return tJ=!1,!1}};function t7(e,r){let i=e.indexOf("?");if(i<0)return`${e}?${new URLSearchParams(r).toString()}`;let n=new URLSearchParams(e.slice(i));for(let e in r)n.set(e,r[e]);return`${e.slice(0,i)}?${n.toString()}`}
9function re(e,r={persistentParams:[]}){let i=e.indexOf("?");if(i<0)return e;let n=new URLSearchParams,o=new URLSearchParams(e.slice(i));for(let e of r.persistentParams){let r=o.get(e);r&&n.set(e,r)}let a=n.toString();return`${e.slice(0,i)}${a.length>0?`?${a}`:""}`}let rt="mapbox-tiles",rr=500,ri=50;function rn(){try{return caches}catch(e){}}function ro(){let e=rn();e&&!i&&(i=e.open(rt))}let ra=1/0,rs={supported:!1,testSupport:function(e){!rc&&ru&&(rh?rd(e):rl=e)}},rl,ru,rc=!1,rh=!1,rp="u">typeof self?self:{};function rd(e){let r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,ru),e.isContextLost())return;rs.supported=!0}catch(e){}e.deleteTexture(r),rc=!0}rp.document&&((ru=rp.document.createElement("img")).onload=function(){rl&&rd(rl),rl=null,rh=!0},ru.onerror=function(){rc=!0,rl=null},ru.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");let rf={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(rf);class rm extends Error{constructor(e,r,i){401===r&&x(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=r,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}let rg=t$()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,r_=function(e,r){var n,a;if(!(/^file:/.test(n=e.url)||/^file:/.test(rg())&&!/^\w+:/.test(n))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal")){let n,s,l,u,c,h,p;return n=new AbortController,s=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:rg(),referrerPolicy:e.referrerPolicy,signal:n.signal}),l=!1,u=!1,c=(a=s.url).indexOf("sku=")>0&&x(a),"json"===e.type&&s.headers.set("Accept","application/json"),h=(i,n,o)=>{if(u)return;if(i&&"SecurityError"!==i.message&&tG(i.toString()),n&&o)return p(n);let a=Date.now();fetch(s).then(i=>{if(i.ok){let e=c?i.clone():null;return p(i,e,a)}return r(new rm(i.statusText,i.status,e.url))}).catch(i=>{"AbortError"!==i.name&&r(Error(`${i.message} ${e.url}`))})},p=(n,a,c)=>{("arrayBuffer"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text()).then(e=>{u||(a&&c&&function(e,r,n){if(ro(),!i)return;let a=tW(r.headers.get("Cache-Control")||"");if(a["no-store"])return;let s={status:r.status,statusText:r.statusText,headers:new Headers};r.headers.forEach((e,r)=>s.headers.set(r,e)),a["max-age"]&&s.headers.set("Expires",new Date(n+1e3*a["max-age"]).toUTCString());let l=s.headers.get("Expires");if(!l||new Date(l).getTime()-n<42e4)return;
9let u=re(e.url,{persistentParams:["language","worldview"]});if(206===r.status){let r=e.headers.get("Range");if(!r)return;s.status=200,u=t7(u,{range:r})}var c=e=>{let r=new Response(e,s);ro(),i&&i.then(e=>e.put(u,r)).catch(e=>tG(e.message))};if(void 0===o)try{new Response(new ReadableStream),o=!0}catch(e){o=!1}o?c(r.body):r.blob().then(c)}(s,a,c),l=!0,r(null,e,n.headers.get("Cache-Control"),n.headers.get("Expires")))}).catch(e=>{u||r(Error(e.message))})},c?function(e,r){if(ro(),!i)return r(null);i.then(i=>{let n=re(e.url,{persistentParams:["language","worldview"]}),o=e.headers.get("Range");o&&(n=t7(n,{range:o})),i.match(n).then(e=>{let o=function(e){if(!e)return!1;let r=new Date(e.headers.get("Expires")||0),i=tW(e.headers.get("Cache-Control")||"");return r>Date.now()&&!i["no-cache"]}(e);i.delete(n),o&&i.put(n,e.clone()),r(null,e,o)}).catch(r)}).catch(r)}(s,h):h(null,null),{cancel:()=>{u=!0,l||n.abort()}}}if(t$()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,r,void 0,!0)}let s=new XMLHttpRequest;for(let r in s.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(s.responseType="arraybuffer"),e.headers)s.setRequestHeader(r,e.headers[r]);return"json"===e.type&&(s.responseType="text",s.setRequestHeader("Accept","application/json")),s.withCredentials="include"===e.credentials,s.onerror=()=>{r(Error(s.statusText))},s.onload=()=>{if((s.status>=200&&s.status<300||0===s.status)&&null!==s.response){let i=s.response;if("json"===e.type)try{i=JSON.parse(s.response)}catch(e){return r(e)}r(null,i,s.getResponseHeader("Cache-Control"),s.getResponseHeader("Expires"))}else r(new rm(s.statusText,s.status,e.url))},s.send(e.body),{cancel:()=>s.abort()}},ry=function(e,r){return r_(tL(e,{type:"arrayBuffer"}),r)},rv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";a=[],s=0;let rx=function(e,r){if(rs.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),s>=v.MAX_PARALLEL_IMAGE_REQUESTS){let i={requestParameters:e,callback:r,cancelled:!1,cancel(){this.cancelled=!0}};return a.push(i),i}s++;let i=!1,n=()=>{if(!i)for(i=!0,s--;a.length&&s<v.MAX_PARALLEL_IMAGE_REQUESTS;){let e=a.shift(),{requestParameters:r,callback:i,cancelled:n}=e;n||(e.cancel=rx(r,i).cancel)}},o=ry(e,(e,i,o,a)=>{let s,l;n(),e?r(e):i&&(self.createImageBitmap?createImageBitmap(new Blob([new Uint8Array(i)],{type:"image/png"})).then(e=>{((e,i)=>r(e,i,o,a))(null,e)}).catch(e=>{((e,i)=>r(e,i,o,a))(Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}):((s=new Image).onload=()=>{((e,i)=>r(e,i,o,a))(null,s),URL.revokeObjectURL(s.src),s.onload=null,requestAnimationFrame(()=>{s.src=rv})},s.onerror=()=>((e,i)=>r(e,i,o,a))(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),l=new Blob([new Uint8Array(i)],{type:"image/png"}),s.src=i.byteLength?URL.createObjectURL(l):rv))});return{cancel:()=>{o.cancel(),n()}}},rb="NO_ACCESS_TOKEN",rw=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rE(e){let r=e.match(rw);if(!r)throw Error("Unable to parse URL object");return{protocol:r[1],authority:r[2],path:r[3]||"/",params:r[4]?r[4].split("&"):[]}}function rS(e){let r=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${r}`}let rT="mapbox.eventData";function rI(e){if(!e)return null;let r=e.split(".");if(!r||3!==r.length)return null;try{return JSON.parse(decodeURIComponent(atob(r[1]).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(e){return null}}class rM{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){let r=rI(v.ACCESS_TOKEN),i="";return i=r&&r.u?btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(Number("0x"+r)))):v.ACCESS_TOKEN||"",e?`${rT}.${e}:${i}`:`${rT}:${i}`}fetchEventData(){let e=t1("localStorage"),r=this.getStorageKey(),i=this.getStorageKey("uuid");if(e)try{let e=localStorage.getItem(r);e&&(this.eventData=JSON.parse(e));let n=localStorage.getItem(i);n&&(this.anonId=n)}catch(e){tG("Unable to read from LocalStorage")}}saveEventData(){let e=t1("localStorage"),r=this.getStorageKey(),i=this.getStorageKey("uuid"),n=this.anonId;if(e&&n)try{localStorage.setItem(i,n),Object.keys(this.eventData).length>=1&&localStorage.setItem(r,JSON.stringify(this.eventData))}catch(e){tG("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,r,i,n){var o;if(!v.EVENTS_URL)return;let a=rE(v.EVENTS_URL);a.params.push(`access_token=${n||v.ACCESS_TOKEN||""}`);let s={event:this.type,created:new Date(e).toISOString()},l=r?tL(s,r):s,u={url:rS(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=(o=e=>{this.pendingRequest=null,i(e),this.saveEventData(),this.processRequests(n)},r_(tL(u,{method:"POST"}),o))}queueRequest(e,r){this.queue.push(e),this.processRequests(r)}}let rC=new class extends rM{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,r){v.EVENTS_URL&&v.ACCESS_TOKEN&&Array.isArray(e)&&e.some(e=>b(e)||x(e))&&this.queueRequest(Date.now(),r)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();let r=rI(v.ACCESS_TOKEN),i=r?r.u:v.ACCESS_TOKEN,n=i!==this.eventData.tokenU;tN(this.anonId)||(this.anonId=tR(),n=!0);let o=this.queue.shift();if(this.eventData.lastSuccess){let e=new Date(this.eventData.lastSuccess),r=new Date(o),i=(o-this.eventData.lastSuccess)/864e5;n=n||i>=1||i<-1||e.getDate()!==r.getDate()}else n=!0;n?this.postEvent(o,{sdkIdentifier:"mapbox-gl-js",sdkVersion:y,skuId:"01","enabled.telemetry":!1,userId:this.anonId},e=>{e||(this.eventData.lastSuccess=o,this.eventData.tokenU=i)},e):this.processRequests()}},rA=rC.postTurnstileEvent.bind(rC),rP=new class extends rM{constructor(){super("map.load"),this.success={},this.skuToken=""}
9postMapLoadEvent(e,r,i,n){this.skuToken=r,this.errorCb=n,v.EVENTS_URL&&(i||v.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(Error(rb)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;let{id:r,timestamp:i}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),tN(this.anonId)||(this.anonId=tR()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:y,skuId:"01",skuToken:this.skuToken,userId:this.anonId},e=>{e?this.errorCb(e):r&&(this.success[r]=!0)},e))}remove(){this.errorCb=null}},rL=rP.postMapLoadEvent.bind(rP),rO=new class extends rM{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let r=this.mapInstanceIdMap.get(e);return r||(r=tR(),this.mapInstanceIdMap.set(e,r)),r}getEventId(e){let r=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,r+1),r}postStyleLoadEvent(e,r){let{map:i,style:n,importedStyles:o}=r;if(!v.EVENTS_URL||!e&&!v.ACCESS_TOKEN)return;let a=this.getMapInstanceId(i),s={mapInstanceId:a,eventId:this.getEventId(a),style:n};o.length&&(s.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:s},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;let{timestamp:r,payload:i}=this.queue.shift();this.postEvent(r,i,()=>{},e)}},rD=rO.postStyleLoadEvent.bind(rO),rR=new class extends rM{constructor(){super("gljs.performance")}postPerformanceEvent(e,r){v.EVENTS_URL&&(e||v.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:r},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;let{timestamp:r,performanceData:i}=this.queue.shift(),n=function(e){let r=performance.getEntriesByType("resource"),i=performance.getEntriesByType("mark"),n=function(e){let r={};if(e){for(let i in e)if("other"!==i)for(let n of e[i]){let e=`${i}ResolveRangeMin`,o=`${i}ResolveRangeMax`,a=`${i}RequestCount`,s=`${i}RequestCachedCount`;r[e]=Math.min(r[e]||1/0,n.startTime),r[o]=Math.max(r[o]||-1/0,n.responseEnd);let l=e=>{void 0===r[e]&&(r[e]=0),++r[e]};void 0!==n.transferSize&&0===n.transferSize&&l(s),l(a)}}return r}(function(e,r){let i={};if(e)for(let n of e){let e=r(n);void 0===i[e]&&(i[e]=[]),i[e].push(n)}return i}(r,I)),o=window.devicePixelRatio,a=navigator.connection||navigator.mozConnection||navigator.webkitConnection,s=a?a.effectiveType:void 0,l={counters:[],metadata:[],attributes:[]},u=(e,r,i)=>{null!=i&&e.push({name:r,value:i.toString()})};for(let e in n)u(l.counters,e,n[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(u(l.counters,"interactionRangeMin",e.interactionRange[0]),u(l.counters,"interactionRangeMax",e.interactionRange[1])),i)for(let e of Object.keys(T)){let r=T[e],n=i.find(e=>e.name===r);n&&u(l.counters,r,n.startTime)}return u(l.counters,"visibilityHidden",e.visibilityHidden),u(l.attributes,"style",function(e){if(e)for(let r of e){let e=r.name.split("?")[0];if(S(e)){let r=e.split("/").slice(-2);if(2===r.length)return`mapbox://styles/${r[0]}/${r[1]}`}}}(r)),u(l.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),u(l.attributes,"fogEnabled",e.fogEnabled?"true":"false"),u(l.attributes,"projection",e.projection),u(l.attributes,"zoom",e.zoom),u(l.metadata,"devicePixelRatio",o),u(l.metadata,"connectionEffectiveType",s),u(l.metadata,"navigatorUserAgent",navigator.userAgent),u(l.metadata,"screenWidth",window.screen.width),u(l.metadata,"screenHeight",window.screen.height),u(l.metadata,"windowWidth",window.innerWidth),u(l.metadata,"windowHeight",window.innerHeight),u(l.metadata,"mapWidth",e.width/o),u(l.metadata,"mapHeight",e.height/o),u(l.metadata,"webglRenderer",e.renderer),u(l.metadata,"webglVendor",e.vendor),u(l.metadata,"sdkVersion",y),u(l.metadata,"sdkIdentifier","mapbox-gl-js"),l}(i);for(let e of n.metadata);for(let e of n.counters);for(let e of n.attributes);this.postEvent(r,n,()=>{},e)}},rk=rR.postPerformanceEvent.bind(rR),rN=new class extends rM{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,r,i,n){var o;if(!v.API_URL||!v.SESSION_PATH)return;let a=rE(v.API_URL+v.SESSION_PATH);a.params.push(`sku=${r||""}`),a.params.push(`access_token=${n||v.ACCESS_TOKEN||""}`);let s={url:rS(a),headers:{"Content-Type":"text/plain"}};this.pendingRequest=(o=e=>{this.pendingRequest=null,i(e),this.saveEventData(),this.processRequests(n)},r_(tL(s,{method:"GET"}),o))}getSessionAPI(e,r,i,n){this.skuToken=r,this.errorCb=n,v.SESSION_PATH&&v.API_URL&&(i||v.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(Error(rb)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;let{id:r,timestamp:i}=this.queue.shift();
9r&&this.success[r]||this.getSession(i,this.skuToken,e=>{e?this.errorCb(e):r&&(this.success[r]=!0)},e)}remove(){this.errorCb=null}},rF=rN.getSessionAPI.bind(rN),rz=new Set;var rB={exports:{}},rU={exports:{}};rU.exports=function(e,r){var i,n,o,a,s,l;for(n=e.length-(i=3&e.length),o=r,l=0;l<n;)s=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,o=27492+(65535&(a=5*(65535&(o=(o^=s=(65535&(s=(s=(65535&s)*0xcc9e2d51+(((s>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|s>>>17))*0x1b873593+(((s>>>16)*0x1b873593&65535)<<16)|0)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)|0))+((58964+(a>>>16)&65535)<<16);switch(s=0,i){case 3:s^=(255&e.charCodeAt(l+2))<<16;case 2:s^=(255&e.charCodeAt(l+1))<<8;case 1:o^=s=(65535&(s=(s=(65535&(s^=255&e.charCodeAt(l)))*0xcc9e2d51+(((s>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|s>>>17))*0x1b873593+(((s>>>16)*0x1b873593&65535)<<16)|0}return o^=e.length,o=0x85ebca6b*(65535&(o^=o>>>16))+((0x85ebca6b*(o>>>16)&65535)<<16)|0,o=0xc2b2ae35*(65535&(o^=o>>>13))+((0xc2b2ae35*(o>>>16)&65535)<<16)|0,(o^=o>>>16)>>>0};var rj=rU.exports,rV={exports:{}};rV.exports=function(e,r){for(var i,n=e.length,o=r^n,a=0;n>=4;)i=0x5bd1e995*(65535&(i=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((0x5bd1e995*(i>>>16)&65535)<<16),o=0x5bd1e995*(65535&o)+((0x5bd1e995*(o>>>16)&65535)<<16)^(i=0x5bd1e995*(65535&(i^=i>>>24))+((0x5bd1e995*(i>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:o^=(255&e.charCodeAt(a+2))<<16;case 2:o^=(255&e.charCodeAt(a+1))<<8;case 1:o=0x5bd1e995*(65535&(o^=255&e.charCodeAt(a)))+((0x5bd1e995*(o>>>16)&65535)<<16)}return o=0x5bd1e995*(65535&(o^=o>>>13))+((0x5bd1e995*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var rG=rV.exports;rB.exports=rj,rB.exports.murmur3=rj,rB.exports.murmur2=rG;
9var rq=M(rB.exports);function rH(e,r,i){i[e]&&-1!==i[e].indexOf(r)||(i[e]=i[e]||[],i[e].push(r))}function r$(e,r,i){if(i&&i[e]){let n=i[e].indexOf(r);-1!==n&&i[e].splice(n,1)}}class rW{constructor(e,r={}){tL(this,r),this.type=e}}class rY extends rW{constructor(e,r={}){super("error",tL({error:e},r))}}class rZ{on(e,r){return this._listeners=this._listeners||{},rH(e,r,this._listeners),this}off(e,r){return r$(e,r,this._listeners),r$(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},rH(e,r,this._oneTimeListeners),this):new Promise(r=>this.once(e,r))}fire(e,r){"string"==typeof e&&(e=new rW(e,r||{}));let i=e.type;if(this.listens(i)){for(let r of(e.target=this,this._listeners&&this._listeners[i]?this._listeners[i].slice():[]))r.call(this,e);for(let r of this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[])r$(i,r,this._oneTimeListeners),r.call(this,e);let r=this._eventedParent;r&&(tL(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),r.fire(e))}else e instanceof rY&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}e.z=void 0;var rX={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function rK(e){return(e=Math.round(e))<0?0:e>255?255:e}function rQ(e){return rK("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function rJ(e){var r;return(r="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:r>1?1:r}function r0(e,r,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(r-e)*i*6:2*i<1?r:3*i<2?e+(r-e)*(2/3-i)*6:e}try{e.z=({}).parseCSSColor=function(e){var r,i=e.replace(/ /g,"").toLowerCase();if(i in rX)return rX[i].slice();if("#"===i[0])return 4===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null:7===i.length&&(r=parseInt(i.substr(1),16))>=0&&r<=0xffffff?[(0xff0000&r)>>16,(65280&r)>>8,255&r,1]:null;var n=i.indexOf("("),o=i.indexOf(")");if(-1!==n&&o+1===i.length){var a=i.substr(0,n),s=i.substr(n+1,o-(n+1)).split(","),l=1;switch(a){case"rgba":if(4!==s.length)break;l=rJ(s.pop());case"rgb":return 3!==s.length?null:[rQ(s[0]),rQ(s[1]),rQ(s[2]),l];case"hsla":if(4!==s.length)break;l=rJ(s.pop());case"hsl":if(3!==s.length)break;var u=(parseFloat(s[0])%360+360)%360/360,c=rJ(s[1]),h=rJ(s[2]),p=h<=.5?h*(c+1):h+c-h*c,d=2*h-p;return[rK(255*r0(d,p,u+1/3)),rK(255*r0(d,p,u)),rK(255*r0(d,p,u-1/3)),l]}}return null}}catch(e){}class r1{constructor(e,r,i,n=1){this.r=e,this.g=r,this.b=i,this.a=n}static parse(r){if(!r)return;if(r instanceof r1)return r;if("string"!=typeof r)return;let i=e.z(r);return i?new r1(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){let[e,r,i,n]=this.toArray();return`rgba(${Math.round(e)},${Math.round(r)},${Math.round(i)},${n})`}toArray(){let{r:e,g:r,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*e/n,255*r/n,255*i/n,n]}toArray01(){let{r:e,g:r,b:i,a:n}=this;return 0===n?[0,0,0,0]:[e/n,r/n,i/n,n]}toArray01Scaled(e){let{r:r,g:i,b:n,a:o}=this;return 0===o?[0,0,0]:[r/o*e,i/o*e,n/o*e]}toArray01PremultipliedAlpha(){let{r:e,g:r,b:i,a:n}=this;return[e,r,i,n]}toArray01Linear(){let{r:e,g:r,b:i,a:n}=this;return 0===n?[0,0,0,0]:[Math.pow(e/n,2.2),Math.pow(r/n,2.2),Math.pow(i/n,2.2),n]}}function r2(e,r,i){return e*(1-i)+r*i}function r3(e,r,i){return e.map((e,n)=>r2(e,r[n],i))}r1.black=new r1(0,0,0,1),r1.white=new r1(1,1,1,1),r1.transparent=new r1(0,0,0,0),r1.red=new r1(1,0,0,1),r1.blue=new r1(0,0,1,1);var r5=Object.freeze({__proto__:null,array:r3,color:function(e,r,i){return new r1(r2(e.r,r.r,i
9),r2(e.g,r.g,i),r2(e.b,r.b,i),r2(e.a,r.a,i))},number:r2});function r4(e,...r){for(let i of r)for(let r in i)e[r]=i[r];return e}class r6 extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class r8{constructor(e,r=[]){for(const[i,n]of(this.parent=e,this.bindings={},r))this.bindings[i]=n}concat(e){return new r8(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}let r9={kind:"null"},r7={kind:"number"},ie={kind:"string"},it={kind:"boolean"},ir={kind:"color"},ii={kind:"object"},io={kind:"value"},ia={kind:"collator"},is={kind:"formatted"},il={kind:"resolvedImage"};function iu(e,r){return{kind:"array",itemType:e,N:r}}function ic(e){if("array"===e.kind){let r=ic(e.itemType);return"number"==typeof e.N?`array<${r}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${r}>`}return e.kind}let ih=[r9,r7,ie,it,ir,is,ii,iu(io),il];function ip(e,r){if("error"===r.kind)return null;if("array"===e.kind){if("array"===r.kind&&(0===r.N&&"value"===r.itemType.kind||!ip(e.itemType,r.itemType))&&("number"!=typeof e.N||e.N===r.N))return null}else{if(e.kind===r.kind)return null;if("value"===e.kind){for(let e of ih)if(!ip(e,r))return null}}return`Expected ${ic(e)} but found ${ic(r)} instead.`}function id(e,r){return r.some(r=>r.kind===e.kind)}function im(e,r){return r.some(r=>"null"===r?null===e:"array"===r?Array.isArray(e):"object"===r?e&&!Array.isArray(e)&&"object"==typeof e:r===typeof e)}class ig{constructor(e,r,i){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class i_{constructor(e,r,i,n,o){this.text=e.normalize?e.normalize():e,this.image=r,this.scale=i,this.fontStack=n,this.textColor=o}}class iy{constructor(e){this.sections=e}static fromString(e){return new iy([new i_(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.namePrimary.length)}static factory(e){return e instanceof iy?e:iy.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){let e=["format"];for(let r of this.sections){if(r.image){e.push(["image",r.image.namePrimary]);continue}e.push(r.text);let i={};r.fontStack&&(i["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(i["font-scale"]=r.scale),r.textColor&&(i["text-color"]=["rgba"].concat(r.textColor.toArray())),e.push(i)}return e}}class iv{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(e,r){return e?new iv({namePrimary:e,nameSecondary:r,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function ix(e,r,i,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,r,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,r,i,n]:[e,r,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ib(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof r1||e instanceof ig||e instanceof iy||e instanceof iv)return!0;if(Array.isArray(e)){for(let r of e)if(!ib(r))return!1;return!0}if("object"==typeof e){for(let r in e)if(!ib(e[r]))return!1;return!0}return!1}function iw(e){if(null===e)return r9;if("string"==typeof e)return ie;if("boolean"==typeof e)return it;if("number"==typeof e)return r7;if(e instanceof r1)return ir;if(e instanceof ig)return ia;if(e instanceof iy)return is;if(e instanceof iv)return il;if(Array.isArray(e)){let r,i=e.length;for(let i of e){let e=iw(i);if(r){if(r===e)continue;r=io;break}r=e}return iu(r||io,i)}return ii}function iE(e){let r=typeof e;return null===e?"":"string"===r||"number"===r||"boolean"===r?String(e):e instanceof r1||e instanceof iy||e instanceof iv?e.toString():JSON.stringify(e)}class iS{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(2!==e.length)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ib(e[1]))return r.error("invalid value");let i=e[1],n=iw(i),o=r.expectedType;return"array"===n.kind&&0===n.N&&o&&"array"===o.kind&&("number"!=typeof o.N||0===o.N)&&(n=o),new iS(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof r1?["rgba"].concat(this.value.toArray()):this.value instanceof iy?this.value.serialize():this.value}}class iT{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}let iI={string:ie,number:r7,boolean:it,object:ii};class iM{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i,n=1,o=e[0];if("array"===o){let o,a;if(e.length>2){let i=e[1];if("string"!=typeof i||!(i in iI)||"object"===i)return r.error('The item type argument of "array" must be one of string, number, boolean',1);o=iI[i],n++}else o=io;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}i=iu(o,a)}else i=iI[o];let a=[];for(;n<e.length;n++){let i=r.parse(e[n],n,io);if(!i)return null;a.push(i)}return new iM(i,a)}evaluate(e){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(e);if(!ip(this.type,iw(i)))return i;if(r===this.args.length-1)throw new iT(`Expected value to be of type ${ic(this.type)}, but found ${ic(iw(i))} instead.`)}return null}
9eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){let e=this.type,r=[e.kind];if("array"===e.kind){let i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){r.push(i.kind);let n=e.N;("number"==typeof n||this.args.length>1)&&r.push(n)}}return r.concat(this.args.map(e=>e.serialize()))}}class iC{constructor(e){this.type=is,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return r.error("First argument must be an image or text section.");let n=[],o=!1;for(let i=1;i<=e.length-1;++i){let a=e[i];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&!(e=r.parse(a["font-scale"],1,r7)))return null;let i=null;if(a["text-font"]&&!(i=r.parse(a["text-font"],1,iu(ie))))return null;let s=null;if(a["text-color"]&&!(s=r.parse(a["text-color"],1,ir)))return null;let l=n[n.length-1];l.scale=e,l.font=i,l.textColor=s}else{let a=r.parse(e[i],1,io);if(!a)return null;let s=a.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null})}}return new iC(n)}evaluate(e){return new iy(this.sections.map(r=>{let i=r.content.evaluate(e);return iw(i)===il?new i_("",i,null,null,null):new i_(iE(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}serialize(){let e=["format"];for(let r of this.sections){e.push(r.content.serialize());let i={};r.scale&&(i["font-scale"]=r.scale.serialize()),r.font&&(i["text-font"]=r.font.serialize()),r.textColor&&(i["text-color"]=r.textColor.serialize()),e.push(i)}return e}}class iA{constructor(e,r){this.type=il,this.inputPrimary=e,this.inputSecondary=r}static parse(e,r){if(e.length<2)return r.error("Expected two or more arguments.");let i=r.parse(e[1],1,ie);if(!i)return r.error("No image name provided.");if(2===e.length)return new iA(i);let n=r.parse(e[2],1,ie);return n?new iA(i,n):r.error("Secondary image variant is not a string.")}evaluate(e){let r=iv.fromString(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(r.namePrimary)>-1,r.nameSecondary&&r.available&&e.availableImages&&(r.available=e.availableImages.indexOf(r.nameSecondary)>-1)),r}eachChild(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function iP(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}let iL={"to-boolean":it,"to-color":ir,"to-number":r7,"to-string":ie};class iO{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[0],n=[],o=r9;if("to-array"===i){if(!Array.isArray(e[1]))return null;let i=e[1].length;if(r.expectedType){if("array"!==r.expectedType.kind)return r.error(`Expected ${r.expectedType.kind} but found array.`);o=iu(r.expectedType.itemType,i)}else{if(!(i>0&&ib(e[1][0])))return null;o=iu(iw(e[1][0]),i)}for(let a=0;a<i;a++){let i,s=e[1][a];if("array"===iP(s))i=r.parse(s,void 0,o.itemType);else{let e=iP(s);if(e!==o.itemType.kind)return r.error(`Expected ${o.itemType.kind} but found ${e}.`);i=r.registry.literal.parse(["literal",void 0===s?null:s],r)}if(!i)return null;n.push(i)}}else{if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return r.error("Expected one argument.");o=iL[i];for(let i=1;i<e.length;i++){let o=r.parse(e[i],i,io);if(!o)return null;n.push(o)}}return new iO(o,n)}evaluate(e){if("boolean"===this.type.kind)return!!this.args[0].evaluate(e);if("color"===this.type.kind){let r,i;for(let n of this.args){if(r=n.evaluate(e),i=null,r instanceof r1)return r;if("string"==typeof r){let i=e.parseColor(r);if(i)return i}else if(Array.isArray(r)&&!(i=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ix(r[0],r[1],r[2],r[3])))return new r1(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new iT(i||`Could not parse color from value '${"string"==typeof r?r:String(JSON.stringify(r))}'`)}if("number"===this.type.kind){let r=null;for(let i of this.args){if(null===(r=i.evaluate(e)))return 0;let n=Number(r);
9if(!isNaN(n))return n}throw new iT(`Could not convert ${JSON.stringify(r)} to number.`)}return"formatted"===this.type.kind?iy.fromString(iE(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?iv.fromString(iE(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map(r=>r.evaluate(e)):iE(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if("formatted"===this.type.kind)return new iC([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new iA(this.args[0]).serialize();let e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild(r=>{e.push(r.serialize())}),e}}let iD=["Unknown","Point","LineString","Polygon"];class iR{constructor(e,r){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=r}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?iD[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){let e=this.featureDistanceData.center,r=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*r-e[0])+this.featureDistanceData.bearing[1]*(n*r-e[1])}return 0}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=r1.parse(e)),r}getConfig(e){return this.options?this.options.get(e):null}}class ik{constructor(e,r,i,n,o){this.name=e,this.type=r,this._evaluate=i,this.args=n,this._overloadIndex=o}evaluate(e){if(!this._evaluate){let e=ik.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,r){let i=e[0],n=ik.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=[],l=null,u=-1;for(let[n,c]of a){if(Array.isArray(n)&&n.length!==e.length-1)continue;s.push(n),u++,l=new nv(r.registry,r.path,null,r.scope,void 0,r._scope,r.options);let a=[],h=!1;for(let r=1;r<e.length;r++){let i=e[r],o=Array.isArray(n)?n[r-1]:n.type,s=l.parse(i,1+a.length,o);if(!s){h=!0;break}a.push(s)}if(!h)if(Array.isArray(n)&&n.length!==a.length)l.error(`Expected ${n.length} arguments, but found ${a.length} instead.`);else{for(let e=0;e<a.length;e++){let r=Array.isArray(n)?n[e]:n.type,i=a[e];l.concat(e+1).checkSubtype(r,i.type)}if(0===l.errors.length)return new ik(i,o,c,a,u)}}if(1===s.length)r.errors.push(...l.errors);else{let i=(s.length?s:a.map(([e])=>e)).map(iN).join(" | "),n=[];for(let i=1;i<e.length;i++){let o=r.parse(e[i],1+n.length);if(!o)return null;n.push(ic(o.type))}r.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(e,r){for(let i in ik.definitions=r,r)e[i]=ik}}function iN(e){return Array.isArray(e)?`(${e.map(ic).join(", ")})`:`(${ic(e.type)}...)`}class iF{constructor(e,r,i){this.type=ia,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(2!==e.length)return r.error("Expected one argument.");let i=e[1];if("object"!=typeof i||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,it);if(!n)return null;let o=r.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,it);if(!o)return null;let a=null;return!i.locale||(a=r.parse(i.locale,1,ie))?new iF(n,o,a):null}evaluate(e){return new ig(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){let e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}var iz={exports:{}};iz.exports=function(){function e(e,r,i){var n=e[r];e[r]=e[i],e[i]=n}function r(e,r){return e<r?-1:+(e>r)}return function(i,n,o,a,s){!function r(i,n,o,a,s){for(;a>o;){if(a-o>600){var l=a-o+1,u=n-o+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);r(i,n,Math.max(o,Math.floor(n-u*h/l+p)),Math.min(a,Math.floor(n+(l-u)*h/l+p)),s)}var d=i[n],f=o,m=a;for(e(i,o,n),s(i[a],d)>0&&e(i,o,a);f<m;){for(e(i,f,m),f++,m--;0>s(i[f],d);)f++;for(;s(i[m],d)>0;)m--}0===s(i[o],d)?e(i,o,m):e(i,++m,a),m<=n&&(o=m+1),n<=m&&(a=m-1)}}(i,n,o||0,a||i.length-1,s||r)}}();var iB=M(iz.exports);function iU(e,r){e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[0]),e[3]=Math.max(e[3],r[1])}function ij(e,r){return!(e[0]<=r[0]||e[2]>=r[2]||e[1]<=r[1]||e[3]>=r[3])}function iV(e,r,i=!1){let n=!1;for(let o=0,a=r.length;o<a;o++){let a=r[o];for(let r=0,o=a.length,s=o-1;r<o;s=r++){let o=a[s],l=a[r];if(function(e,r,i){let n=e[0]-r[0],o=e[1]-r[1],a=e[0]-i[0],s=e[1]-i[1];return n*s-a*o==0&&n*a<=0&&o*s<=0}(e,o,l))return i;o[1]>e[1]!=l[1]>e[1]&&e[0]<(l[0]-o[0])*(e[1]-o[1])/(l[1]-o[1])+o[0]&&(n=!n)}}return n}function iG(e,r,i,n){let o=n[0]-i[0],a=n[1]-i[1],s=(e[0]-i[0])*a-o*(e[1]-i[1]),l=(r[0]-i[0])*a-o*(r[1]-i[1]);return s>0&&l<0||s<0&&l>0}function iq(e,r,i,n){var o,a;return 0!=(o=[n[0]-i[0],n[1]-i[1]])[0]*(a=[r[0]-e[0],r[1]-e[1]])[1]-o[1]
9*a[0]&&!(!iG(e,r,i,n)||!iG(i,n,e,r))}function iH(e,r){for(let i=0;i<e.length;++i)if(!iV(e[i],r))return!1;for(let i=0;i<e.length-1;++i)if(function(e,r,i){for(let n of i)for(let i=0,o=n.length,a=o-1;i<o;a=i++)if(iq(e,r,n[a],n[i]))return!0;return!1}(e[i],e[i+1],r))return!1;return!0}function i$(e,r,i){let n=[];for(let o=0;o<e.length;o++){let a=[];for(let n=0;n<e[o].length;n++){let s=function(e,r){let i=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,o=Math.pow(2,r.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}(e[o][n],i);iU(r,s),a.push(s)}n.push(a)}return n}function iW(e,r,i){let n=[];for(let o=0;o<e.length;o++){let a=i$(e[o],r,i);n.push(a)}return n}function iY(e,r,i,n){if(e[0]<i[0]||e[0]>i[2]){let r=.5*n,o=e[0]-i[0]>r?-n:i[0]-e[0]>r?n:0;0===o&&(o=e[0]-i[2]>r?-n:i[2]-e[0]>r?n:0),e[0]+=o}iU(r,e)}function iZ(e,r,i,n){let o=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],s=[];if(!e)return s;for(let n of e)for(let e of n){let n=[e.x+a[0],e.y+a[1]];iY(n,r,i,o),s.push(n)}return s}function iX(e,r,i,n){let o=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],s=[];if(!e)return s;for(let i of e){let e=[];for(let n of i){let i=[n.x+a[0],n.y+a[1]];iU(r,i),e.push(i)}s.push(e)}if(r[2]-r[0]<=o/2)for(let e of(r[0]=r[1]=1/0,r[2]=r[3]=-1/0,s))for(let n of e)iY(n,r,i,o);return s}class iK{constructor(e,r){this.type=it,this.geojson=e,this.geometries=r}static parse(e,r){if(2!==e.length)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ib(e[1])){let r=e[1];if("FeatureCollection"===r.type)for(let e=0;e<r.features.length;++e){let i=r.features[e].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new iK(r,r.features[e].geometry)}else if("Feature"===r.type){let e=r.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new iK(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new iK(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,r){let i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if(!o)return!1;if("Polygon"===r.type){let a=i$(r.coordinates,n,o),s=iZ(e.geometry(),i,n,o);if(!ij(i,n))return!1;for(let e of s)if(!iV(e,a))return!1}if("MultiPolygon"===r.type){let a=iW(r.coordinates,n,o),s=iZ(e.geometry(),i,n,o);if(!ij(i,n))return!1;for(let e of s)if(!function(e,r){for(let i=0;i<r.length;i++)if(iV(e,r[i]))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,r){let i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if(!o)return!1;if("Polygon"===r.type){let a=i$(r.coordinates,n,o),s=iX(e.geometry(),i,n,o);if(!ij(i,n))return!1;for(let e of s)if(!iH(e,a))return!1}if("MultiPolygon"===r.type){let a=iW(r.coordinates,n,o),s=iX(e.geometry(),i,n,o);if(!ij(i,n))return!1;for(let e of s)if(!function(e,r){for(let i=0;i<r.length;i++)if(iH(e,r[i]))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var iQ={exports:{}};iQ.exports=function(){var e={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},r=1/298.257223563*(2-1/298.257223563),i=Math.PI/180,n=function(n,o){if(void 0===n)throw Error("No latitude given.");if(o&&!e[o])throw Error("Unknown unit "+o+". Use one of: "+Object.keys(e).join(", "));var a=6378.137*i*(o?e[o]:1),s=Math.cos(n*i),l=1/(1-r*(1-s*s)),u=Math.sqrt(l);this.kx=a*u*s,this.ky=a*u*l*(1-r)},o={units:{configurable:!0}};function a(e,r){return e[0]===r[0]&&e[1]===r[1]}function s(e,r,i){var n=l(r[0]-e[0]);return[e[0]+n*i,e[1]+(r[1]-e[1])*i]}function l(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}return n.fromTile=function(e,r,o){var a=Math.PI*(1-2*(e+.5)/Math.pow(2,r));return new n(Math.atan(.5*(Math.exp(a)-Math.exp(-a)))/i,o)},o.units.get=function(){return e},n.prototype.distance=function(e,r){var i=l(e[0]-r[0])*this.kx,n=(e[1]-r[1])*this.ky;return Math.sqrt(i*i+n*n)},n.prototype.bearing=function(e,r){return Math.atan2(l(r[0]-e[0])*this.kx,(r[1]-e[1])*this.ky)/i},n.prototype.destination=function(e,r,n){var o=n*i;return this.offset(e,Math.sin(o)*r,Math.cos(o)*r)},n.prototype.offset=function(e,r,i){return[e[0]+r/this.kx,e[1]+i/this.ky]},n.prototype.lineDistance=function(e){for(var r=0,i=0;i<e.length-1;i++)r+=this.distance(e[i],e[i+1]);return r},n.prototype.area=function(e){for(var r=0,i=0;i<e.length;i++)for(var n=e[i],o=0,a=n.length,s=a-1;o<a;s=o++)r+=l(n[o][0]-n[s][0])*(n[o][1]+n[s][1])*(i?-1:1);return Math.abs(r)/2*this.kx*this.ky},n.prototype.along=function(e,r){var i=0;if(r<=0)return e[0];for(var n=0;n<e.length-1;n++){var o=e[n],a=e[n+1],l=this.distance(o,a);if((i+=l)>r)return s(o,a,(r-(i-l))/l)}return e[e.length-1]},n.prototype.pointToSegmentDistance=function(e,r,i){var n=r[0],o=r[1],a=l(i[0]-n)*this.kx,s=(i[1]-o)*this.ky,u=0;return 0===a&&0===s||((u=(l(e[0]-n)*this.kx*a+(e[1]-o)*this.ky*s)/(a*a+s*s))>1?(n=i[0],o=i[1]):u>0&&(n+=a/this.kx*u,o+=s/this.ky*u)),Math.sqrt((a=l(e[0]-n)*this.kx)*a+(s=(e[1]-o)*this.ky)*s)},n.prototype.pointOnLine=function(e,r){for(var i,n,o,a,s=1/0,u=0;u<e.length-1;u++){var c=e[u][0],h=e[u][1],p=l(e[u+1][0]-c)*this.kx,d=(e[u+1][1]-h)*this.ky,f=0;0===p&&0===d||((f=(l(r[0]-c)*this.kx*p+(r[1]-h)*this.ky*d)/(p*p+d*d))>1?(c=e[u+1][0],h=e[u+1][1]):f>0&&(c+=p/this.kx*f,h+=d/this.ky*f));var m=(p=l(r[0]-c)*this.kx)*p+(d=(r[1]-h)*this.ky)*d;m<s&&(s=m,i=c,n=h,o=u,a=f)}return{point:[i,n],index:o,t:Math.max(0,Math.min(1,a))}},n.prototype.lineSlice=function(e,r,i){var n=this.pointOnLine(i,e),o=this.pointOnLine(i,r);if(n.index>o.index||n.index===o.index&&n.t>o.t){var s=n;n=o,o=s}var l=[n.point],u=n.index+1,c=o.index;!a(i[u],l[0])&&u<=c&&l.push(i[u]);for(var h=u+1;h<=c;h++)l.push(i[h]);return a(i[c],o.point)||l.push(o.point),l},n.prototype.lineSliceAlong=function(e,r,i){for(var n=0,o=[],a=0;a<i.length-1;a++){var l=i[a],u=i[a+1],c=this.distance(l,u);if((n+=c)>e&&0===o.length&&o.push(s(l,u,(e-(n-c))/c)),n>=r)return o.push(s(l,u,(r-(n-c))/c)),o;n>e&&o.push(u)}return o},n.prototype.bufferPoint=function(e,r){var i=r/this.ky,n=r/this.kx;return[e[0]-n,e[1]-i,e[0]+n,e[1]+i]},n.prototype.bufferBBox=function(e,r){var i=r/this.ky,n=r/this.kx;
9return[e[0]-n,e[1]-i,e[2]+n,e[3]+i]},n.prototype.insideBBox=function(e,r){return l(e[0]-r[0])>=0&&0>=l(e[0]-r[2])&&e[1]>=r[1]&&e[1]<=r[3]},Object.defineProperties(n,o),n}();var iJ=M(iQ.exports),i0={exports:{}};i0.exports=function(){var e=function(e,i){if(void 0===e&&(e=[]),void 0===i&&(i=r),this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function r(e,r){return e<r?-1:+(e>r)}return e.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(0!==this.length){var e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(e){for(var r=this.data,i=this.compare,n=r[e];e>0;){var o=e-1>>1,a=r[o];if(i(n,a)>=0)break;r[e]=a,e=o}r[e]=n},e.prototype._down=function(e){for(var r=this.data,i=this.compare,n=this.length>>1,o=r[e];e<n;){var a=1+(e<<1),s=r[a],l=a+1;if(l<this.length&&0>i(r[l],s)&&(a=l,s=r[l]),i(s,o)>=0)break;r[e]=s,e=a}r[e]=o},e}();
9var i1=M(i0.exports);function i2(e,r){return r.dist-e.dist}function i3(e){let r=[1/0,1/0,-1/0,-1/0];if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(r[i]!==e[i])return!1;return!0}function i5(e){return e[1]-e[0]+1}function i4(e,r){let i=e[1]>=e[0]&&e[1]<r;return i||console.warn("Distance Expression: Index is out of range"),i}function i6(e,r){if(e[0]>e[1])return[null,null];let i=i5(e);if(r){if(2===i)return[e,null];let r=Math.floor(i/2);return[[e[0],e[0]+r],[e[0]+r,e[1]]]}{if(1===i)return[e,null];let r=Math.floor(i/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}}function i8(e,r){let i=[1/0,1/0,-1/0,-1/0];if(!i4(r,e.length))return i;for(let n=r[0];n<=r[1];++n)iU(i,e[n]);return i}function i9(e){let r=[1/0,1/0,-1/0,-1/0];for(let i=0;i<e.length;++i)for(let n=0;n<e[i].length;++n)iU(r,e[i][n]);return r}function i7(e,r,i){if(i3(e)||i3(r))return NaN;let n=0,o=0;return e[2]<r[0]&&(n=r[0]-e[2]),e[0]>r[2]&&(n=e[0]-r[2]),e[1]>r[3]&&(o=e[1]-r[3]),e[3]<r[1]&&(o=r[1]-e[3]),i.distance([0,0],[n,o])}function ne(e,r){let i=Math.pow(2,r.z),n=(e.y/8192+r.y)/i;return[360*((e.x/8192+r.x)/i)-180,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90]}function nt(e,r,i){let n=i.pointOnLine(r,e).point;return i.distance(e,n)}function nr(e,r,i,n,o){let a=i.slice(n[0],n[1]+1),s=1/0;for(let i=r[0];i<=r[1];++i)if(0===(s=Math.min(s,nt(e[i],a,o))))return 0;return s}function ni(e,r,i,n,o){return Math.min(Math.min(o.pointToSegmentDistance(e,i,n),o.pointToSegmentDistance(r,i,n)),Math.min(o.pointToSegmentDistance(i,e,r),o.pointToSegmentDistance(n,e,r)))}function nn(e,r){for(let i of e)for(let e=0;e<=i.length-1;++e)if(iV(i[e],r,!0))return!0;return!1}function no(e,r,i,n,o,a,s){if(null===a||null===s)return;let l=i7(i8(n,a),i8(o,s),i);l<r&&e.push({dist:l,range1:a,range2:s})}function na(e,r,i,n,o,a=1/0){let s=Math.min(a,o.distance(e[0],i[0]));if(0===s)return s;let l=new i1([{dist:0,range1:[0,e.length-1],range2:[0,i.length-1]}],i2),u=r?50:100,c=n?50:100;for(;l.length;){let a=l.pop();if(a.dist>=s)continue;let h=a.range1,p=a.range2;if(i5(h)<=u&&i5(p)<=c){if(!i4(h,e.length)||!i4(p,i.length))return NaN;if(r&&n?s=Math.min(s,function(e,r,i,n,o){if(!i4(r,e.length)||!i4(n,i.length))return NaN;let a=1/0;for(let s=r[0];s<r[1];++s)for(let r=n[0];r<n[1];++r){if(iq(e[s],e[s+1],i[r],i[r+1]))return 0;a=Math.min(a,ni(e[s],e[s+1],i[r],i[r+1],o))}return a}(e,h,i,p,o)):r||n?r&&!n?s=Math.min(s,nr(i,p,e,h,o)):!r&&n&&(s=Math.min(s,nr(e,h,i,p,o))):s=Math.min(s,function(e,r,i,n,o){if(!i4(r,e.length)||!i4(n,i.length))return NaN;let a=1/0;for(let s=r[0];s<=r[1];++s)for(let r=n[0];r<=n[1];++r)if(0===(a=Math.min(a,o.distance(e[s],i[r]))))return a;return a}(e,h,i,p,o)),0===s)break}else{let a=i6(h,r),u=i6(p,n);no(l,s,o,e,i,a[0],u[0]),no(l,s,o,e,i,a[0],u[1]),no(l,s,o,e,i,a[1],u[0]),no(l,s,o,e,i,a[1],u[1])}}return s}function ns(e,r,i,n,o=1/0){let a=o,s=i8(e,[0,e.length-1]);for(let o of i)if(!(a!==1/0&&i7(s,i8(o,[0,o.length-1]),n)>=a)&&0===(a=Math.min(a,na(e,r,o,!0,n,a))))break;return a}function nl(e,r,i,n,o=1/0){let a=o,s=i8(e,[0,e.length-1]);for(let o of i){if(a!==1/0&&i7(s,i9(o),n)>=a)continue;let i=function(e,r,i,n,o=1/0){let a=Math.min(n.distance(e[0],i[0][0]),o);if(0===a)return a;let s=new i1([{dist:0,range1:[0,e.length-1],range2:[0,0]}],i2),l=r?50:100,u=i9(i);for(;s.length;){let o=s.pop();if(o.dist>=a)continue;let c=o.range1;if(i5(c)<=l){if(!i4(c,e.length))return NaN;if(r){if(0===(a=Math.min(a,function(e,r,i,n){if(!i4(r,e.length))return NaN;for(let n=r[0];n<=r[1];++n)if(iV(e[n],i,!0))return 0;let o=1/0;for(let a=r[0];a<r[1];++a)for(let r of i)for(let i=0,s=r.length,l=s-1;i<s;l=i++){if(iq(e[a],e[a+1],r[l],r[i]))return 0;o=Math.min(o,ni(e[a],e[a+1],r[l],r[i],n))}return o}(e,c,i,n))))break}else for(let r=c[0];r<=c[1];++r)if(0===(a=Math.min(a,function(e,r,i){if(iV(e,r,!0))return 0;let n=1/0;for(let o of r){let r=o.length;if(r<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(o[0]!==o[r-1]&&0===(n=Math.min(n,i.pointToSegmentDistance(e,o[r-1],o[0])))||0===(n=Math.min(n,nt(e,o,i))))break}return n}(e[r],i,n))))return a}else{let i=i6(c,r);if(null!==i[0]){let r=i7(i8(e,i[0]),u,n);r<a&&s.push({dist:r,range1:i[0],range2:[0,0]})}
9if(null!==i[1]){let r=i7(i8(e,i[1]),u,n);r<a&&s.push({dist:r,range1:i[1],range2:[0,0]})}}}return a}(e,r,o,n,a);if(isNaN(i))return i;if(0===(a=Math.min(a,i)))break}return a}function nu(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class nc{constructor(e,r){this.type=r7,this.geojson=e,this.geometries=r}static parse(e,r){if(2!==e.length)return r.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(ib(e[1])){let r=e[1];if("FeatureCollection"===r.type){for(let e=0;e<r.features.length;++e)if(nu(r.features[e].geometry.type))return new nc(r,r.features[e].geometry)}else if("Feature"===r.type){if(nu(r.geometry.type))return new nc(r,r.geometry)}else if(nu(r.type))return new nc(r,r)}return r.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){let r=e.geometry(),i=e.canonicalID();if(null!=r&&null!=i){if("Point"===e.geometryType()){var n=this.geometries;let e=[];for(let n of r)for(let r of n)e.push(ne(r,i));let o=new iJ(e[0][1],"meters");return"Point"===n.type||"MultiPoint"===n.type||"LineString"===n.type?na(e,!1,"Point"===n.type?[n.coordinates]:n.coordinates,"LineString"===n.type,o):"MultiLineString"===n.type?ns(e,!1,n.coordinates,o):"Polygon"===n.type||"MultiPolygon"===n.type?nl(e,!1,"Polygon"===n.type?[n.coordinates]:n.coordinates,o):null}if("LineString"===e.geometryType())return function(e,r,i){let n=[];for(let i of e){let e=[];for(let n of i)e.push(ne(n,r));n.push(e)}let o=new iJ(n[0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return ns("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,o);if("MultiLineString"===i.type){let e=1/0;for(let r=0;r<i.coordinates.length;r++){let a=ns(i.coordinates[r],!0,n,o,e);if(isNaN(a))return a;if(0===(e=Math.min(e,a)))break}return e}if("Polygon"===i.type||"MultiPolygon"===i.type){let e=1/0;for(let r=0;r<n.length;r++){let a=nl(n[r],!0,"Polygon"===i.type?[i.coordinates]:i.coordinates,o,e);if(isNaN(a))return a;if(0===(e=Math.min(e,a)))break}return e}return null}(r,i,this.geometries);if("Polygon"===e.geometryType())return function(e,r,i){let n=[];for(let i of function(e){let r,i,n=e.length;if(n<=1)return[e];let o=[];for(let a=0;a<n;a++){let n=function(e){let r=0;for(let i,n,o=0,a=e.length,s=a-1;o<a;s=o++)i=e[o],r+=((n=e[s]).x-i.x)*(i.y+n.y);return r}(e[a]);0!==n&&(e[a].area=Math.abs(n),void 0===i&&(i=n<0),i===n<0?(r&&o.push(r),r=[e[a]]):r.push(e[a]))}return r&&o.push(r),o}(e)){let e=[];for(let n=0;n<i.length;++n)e.push(function(e,r){let i=[];for(let n=0;n<e.length;++n)i.push(ne(e[n],r));return i}(i[n],r));n.push(e)}let o=new iJ(n[0][0][0][1],"meters");if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return nl("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,o);if("MultiLineString"===i.type){let e=1/0;for(let r=0;r<i.coordinates.length;r++){let a=nl(i.coordinates[r],!0,n,o,e);if(isNaN(a))return a;if(0===(e=Math.min(e,a)))break}return e}return"Polygon"===i.type||"MultiPolygon"===i.type?function(e,r,i){let n=1/0;for(let o of e)for(let e of r){let r=function(e,r,i,n=1/0){let o=i9(e),a=i9(r);if(n!==1/0&&i7(o,a,i)>=n)return n;if(ij(o,a)){if(nn(e,r))return 0}else if(nn(r,e))return 0;let s=n;for(let n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++)for(let o of r)for(let r=0,l=o.length,u=l-1;r<l;u=r++){if(iq(n[a],n[e],o[u],o[r]))return 0;s=Math.min(s,ni(n[a],n[e],o[u],o[r],i))}return s}(o,e,i,n);if(isNaN(r))return r;if(0===(n=Math.min(n,r)))return n}return n}("Polygon"===i.type?[i.coordinates]:i.coordinates,n,o):null}(r,i,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function nh(e,r){switch(e){case"string":return iE(r);case"number":return+r;case"boolean":return!!r;case"color":return r1.parse(r);case"formatted":return iy.fromString(iE(r));case"resolvedImage":return iv.fromString(iE(r))}return r}function np(e,r,i,n){return void 0!==n&&(e=n*Math.round(e/n)),void 0!==r&&e<r&&(e=r),void 0!==i&&e>i&&(e=i),e}class nd{constructor(e,r,i){this.type=e,this.key=r,this.scope=i}static parse(e,r){let i=r.expectedType;if(null==i&&(i=io),e.length<2||e.length>3)return r.error("Invalid number of arguments for 'config' expression.");let n=r.parse(e[1],1);if(!(n instanceof iS))return r.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){let o=r.parse(e[2],2);return o instanceof iS?new nd(i,iE(n.value),iE(o.value)):r.error("Scope of 'config' expression must be a string literal.")}return new nd(i,iE(n.value))}
9evaluate(e){let r=[this.key,this.scope,e.scope].filter(Boolean).join("\x1f"),i=e.getConfig(r);if(!i)return null;let{type:n,value:o,values:a,minValue:s,maxValue:l,stepValue:u}=i,c=i.default.evaluate(e),h=c;if(o){let r=e.scope;e.scope=(r||"").split("\x1f").slice(1).join("\x1f"),h=o.evaluate(e),e.scope=r}return n&&(h=nh(n,h)),void 0===h||void 0===s&&void 0===l&&void 0===u||("number"==typeof h?h=np(h,s,l,u):Array.isArray(h)&&(h=h.map(e=>"number"==typeof e?np(e,s,l,u):e))),void 0!==o&&void 0!==h&&a&&!a.includes(h)&&(h=c,n&&(h=nh(n,h))),(n&&n!==this.type||void 0!==h&&iw(h)!==this.type)&&(h=nh(this.type.kind,h)),h}eachChild(){}outputDefined(){return!1}serialize(){let e=["config",this.key];return this.scope&&e.concat(this.key),e}}function nf(e){if(e instanceof ik&&("get"===e.name&&1===e.args.length||"feature-state"===e.name||"has"===e.name&&1===e.args.length||"properties"===e.name||"geometry-type"===e.name||"id"===e.name||/^filter-/.test(e.name))||e instanceof iK||e instanceof nc)return!1;let r=!0;return e.eachChild(e=>{r&&!nf(e)&&(r=!1)}),r}function nm(e){if(e instanceof ik&&"feature-state"===e.name)return!1;let r=!0;return e.eachChild(e=>{r&&!nm(e)&&(r=!1)}),r}function ng(e){if(e instanceof nd)return!1;let r=!0;return e.eachChild(e=>{r&&!ng(e)&&(r=!1)}),r}function n_(e,r){if(e instanceof ik&&r.indexOf(e.name)>=0)return!1;let i=!0;return e.eachChild(e=>{i&&!n_(e,r)&&(i=!1)}),i}class ny{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(2!==e.length||"string"!=typeof e[1])return r.error("'var' expression requires exactly one string literal argument.");let i=e[1];return r.scope.has(i)?new ny(i,r.scope.get(i)):r.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class nv{constructor(e,r=[],i,n=new r8,o=[],a,s){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=n,this.errors=o,this.expectedType=i,this._scope=a,this.options=s}parse(e,r,i,n,o={}){return r||i?this.concat(r,i,n)._parse(e,o):this._parse(e,o)}_parse(e,r){function i(e,r,i){return"assert"===i?new iM(r,[e]):"coerce"===i?new iO(r,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let n="string"==typeof e[0]?this.registry[e[0]]:void 0;if(n){let o=n.parse(e,this);if(!o)return null;if(this.expectedType){let e=this.expectedType,n=o.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(e,n))return null}else o=i(o,e,r.typeAnnotation||"coerce");else o=i(o,e,r.typeAnnotation||"assert")}if(!(o instanceof iS)&&"resolvedImage"!==o.type.kind&&function e(r){if(r instanceof ny)return e(r.boundExpression);if(r instanceof ik&&"error"===r.name||r instanceof iF||r instanceof iK||r instanceof nc||r instanceof nd)return!1;let i=r instanceof iO||r instanceof iM,n=!0;return r.eachChild(r=>{n=i?n&&e(r):n&&r instanceof iS}),!!n&&nf(r)&&n_(r,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}(o)){let e=new iR(this._scope,this.options);try{o=new iS(o.type,o.evaluate(e))}catch(e){return this.error(e.message),null}}return o}return iO.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n="number"==typeof e?this.path.concat(e):this.path,o=i?this.scope.concat(i):this.scope;return new nv(this.registry,n,r||null,o,this.errors,this._scope,this.options)}error(e,...r){let i=`${this.key}${r.map(e=>`[${e}]`).join("")}`;this.errors.push(new r6(i,e))}checkSubtype(e,r){let i=ip(e,r);return i&&this.error(i),i}}function nx(e,r){let i=e.length-1,n,o,a=0,s=i,l=0;for(;a<=s;)if(n=e[l=Math.floor((a+s)/2)],o=e[l+1],n<=r){if(l===i||r<o)return l;a=l+1}else{if(!(n>r))throw new iT("Input is not a number.");s=l-1}return 0}
9class nb{constructor(e,r,i){for(const[n,o]of(this.type=e,this.input=r,this.labels=[],this.outputs=[],i))this.labels.push(n),this.outputs.push(o)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(e[1],1,r7);if(!i)return null;let n=[],o=null;r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);for(let i=1;i<e.length;i+=2){let a=1===i?-1/0:e[i],s=e[i+1],l=i,u=i+1;if("number"!=typeof a)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=a)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);let c=r.parse(s,u,o);if(!c)return null;o=o||c.type,n.push([a,c])}return new nb(o,i,n)}evaluate(e){let r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let o=r.length;return n>=r[o-1]?i[o-1].evaluate(e):i[nx(r,n)].evaluate(e)}eachChild(e){for(let r of(e(this.input),this.outputs))e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e=["step",this.input.serialize()];for(let r=0;r<this.labels.length;r++)r>0&&e.push(this.labels[r]),e.push(this.outputs[r].serialize());return e}}let nw=4/29,nE=6/29,nS=6/29*3*(6/29),nT=6/29*(6/29)*(6/29),nI=Math.PI/180,nM=180/Math.PI;function nC(e){return e>nT?Math.pow(e,1/3):e/nS+nw}function nA(e){return e>nE?e*e*e:nS*(e-nw)}function nP(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function nL(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function nO(e){let r=nL(e.r),i=nL(e.g),n=nL(e.b),o=nC((.4124564*r+.3575761*i+.1804375*n)/.95047),a=nC((.2126729*r+.7151522*i+.072175*n)/1);return{l:116*a-16,a:500*(o-a),b:200*(a-nC((.0193339*r+.119192*i+.9503041*n)/1.08883)),alpha:e.a}}function nD(e){let r=(e.l+16)/116,i=isNaN(e.a)?r:r+e.a/500,n=isNaN(e.b)?r:r-e.b/200;return r=+nA(r),new r1(nP(3.2404542*(i=.95047*nA(i))-1.5371385*r-.4985314*(n=1.08883*nA(n))),nP(-.969266*i+1.8760108*r+.041556*n),nP(.0556434*i-.2040259*r+1.0572252*n),e.alpha)}let nR={forward:nO,reverse:nD,interpolate:function(e,r,i){return{l:r2(e.l,r.l,i),a:r2(e.a,r.a,i),b:r2(e.b,r.b,i),alpha:r2(e.alpha,r.alpha,i)}}},nk={forward:function(e){let{l:r,a:i,b:n}=nO(e),o=Math.atan2(n,i)*nM;return{h:o<0?o+360:o,c:Math.sqrt(i*i+n*n),l:r,alpha:e.a}},reverse:function(e){let r=e.h*nI,i=e.c;return nD({l:e.l,a:Math.cos(r)*i,b:Math.sin(r)*i,alpha:e.alpha})},interpolate:function(e,r,i){var n,o;let a;return{h:(n=e.h,o=r.h,a=o-n,n+i*(a>180||a<-180?a-360*Math.round(a/360):a)),c:r2(e.c,r.c,i),l:r2(e.l,r.l,i),alpha:r2(e.alpha,r.alpha,i)}}};var nN=Object.freeze({__proto__:null,hcl:nk,lab:nR});class nF{constructor(e,r,i,n,o){for(const[a,s]of(this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[],o))this.labels.push(a),this.outputs.push(s)}static interpolationFactor(e,r,i,n){let o=0;if("exponential"===e.name)o=nz(r,e.base,i,n);else if("linear"===e.name)o=nz(r,1,i,n);else if("cubic-bezier"===e.name){let a=e.controlPoints;o=new ty(a[0],a[1],a[2],a[3]).solve(nz(r,1,i,n))}return o}static parse(e,r){let[i,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return r.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){let e=n[1];if("number"!=typeof e)return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);{let e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(o=r.parse(o,2,r7)))return null;let s=[],l=null;"interpolate-hcl"===i||"interpolate-lab"===i?l=ir:r.expectedType&&"value"!==r.expectedType.kind&&(l=r.expectedType);for(let e=0;e<a.length;e+=2){let i=a[e],n=a[e+1],o=e+3,u=e+4;if("number"!=typeof i)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not c
9omputed expressions) for the input values.',o);if(s.length&&s[s.length-1][0]>=i)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);let c=r.parse(n,u,l);if(!c)return null;l=l||c.type,s.push([i,c])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new nF(l,i,n,o,s):r.error(`Type ${ic(l)} is not interpolatable.`)}evaluate(e){let r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let o=r.length;if(n>=r[o-1])return i[o-1].evaluate(e);let a=nx(r,n),s=nF.interpolationFactor(this.interpolation,n,r[a],r[a+1]),l=i[a].evaluate(e),u=i[a+1].evaluate(e);return"interpolate"===this.operator?r5[this.type.kind.toLowerCase()](l,u,s):"interpolate-hcl"===this.operator?nk.reverse(nk.interpolate(nk.forward(l),nk.forward(u),s)):nR.reverse(nR.interpolate(nR.forward(l),nR.forward(u),s))}eachChild(e){for(let r of(e(this.input),this.outputs))e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);let r=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)r.push(this.labels[e],this.outputs[e].serialize());return r}}function nz(e,r,i,n){let o=n-i,a=e-i;return 0===o?0:1===r?a/o:(Math.pow(r,a)-1)/(Math.pow(r,o)-1)}class nB{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let i=null,n=r.expectedType;n&&"value"!==n.kind&&(i=n);let o=[];for(let n of e.slice(1)){let e=r.parse(n,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!e)return null;i=i||e.type,o.push(e)}return new nB(n&&o.some(e=>ip(n,e.type))?io:i,o)}evaluate(e){let r,i=null,n=0;for(let o of this.args){if(n++,(i=o.evaluate(e))&&i instanceof iv&&!i.available&&(r||(r=i),i=null,n===this.args.length))return r;if(null!==i)break}return i}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){let e=["coalesce"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class nU{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let n=1;n<e.length-1;n+=2){let o=e[n];if("string"!=typeof o)return r.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return r.error("Variable names must contain only alphanumeric characters or '_'.",n);let a=r.parse(e[n+1],n+1);if(!a)return null;i.push([o,a])}let n=r.parse(e[e.length-1],e.length-1,r.expectedType,i);return n?new nU(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){let e=["let"];for(let[r,i]of this.bindings)e.push(r,i.serialize());return e.push(this.result.serialize()),e}}class nj{constructor(e,r,i){this.type=e,this.index=r,this.input=i}static parse(e,r){if(3!==e.length)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,r7),n=r.parse(e[2],2,iu(r.expectedType||io));return i&&n?new nj(n.type.itemType,i,n):null}evaluate(e){let r=this.index.evaluate(e),i=this.input.evaluate(e);if(r<0)throw new iT(`Array index out of bounds: ${r} < 0.`);if(r>=i.length)throw new iT(`Array index out of bounds: ${r} > ${i.length-1}.`);if(r!==Math.floor(r))throw new iT(`Array index must be an integer, but found ${r} instead.`);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class nV{constructor(e,r){this.type=it,this.needle=e,this.haystack=r}static parse(e,r){if(3!==e.length)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,io),n=r.parse(e[2],2,io);return i&&n?id(i.type,[it,ie,r7,r9,io])?new nV(i,n):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ic(i.type)} instead`):null}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(null==i)return!1;if(!im(r,["boolean","string","number","null"]))throw new iT(`Expected first argument to be of type boolean, string, number or null, but found ${ic(iw(r))} instead.`);if(!im(i,["string","array"]))throw new iT(`Expected second argument to be of type array or string, but found ${ic(iw(i))} instead.`);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class nG{constructor(e,r,i){this.type=r7,this.needle=e,this.haystack=r,this.fromIndex=i}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,io),n=r.parse(e[2],2,io);if(!i||!n)return null;
9if(!id(i.type,[it,ie,r7,r9,io]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ic(i.type)} instead`);if(4===e.length){let o=r.parse(e[3],3,r7);return o?new nG(i,n,o):null}return new nG(i,n)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!im(r,["boolean","string","number","null"]))throw new iT(`Expected first argument to be of type boolean, string, number or null, but found ${ic(iw(r))} instead.`);if(!im(i,["string","array"]))throw new iT(`Expected second argument to be of type array or string, but found ${ic(iw(i))} instead.`);if(this.fromIndex){let n=this.fromIndex.evaluate(e);return i.indexOf(r,n)}return i.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){let e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class nq{constructor(e,r,i,n,o,a){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,r){let i,n;if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);let o={},a=[];for(let s=2;s<e.length-1;s+=2){let l=e[s],u=e[s+1];Array.isArray(l)||(l=[l]);let c=r.concat(s);if(0===l.length)return c.error("Expected at least one branch label.");for(let e of l){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,iw(e)))return null}else i=iw(e);if(void 0!==o[String(e)])return c.error("Branch labels must be unique.");o[String(e)]=a.length}let h=r.parse(u,s,n);if(!h)return null;n=n||h.type,a.push(h)}let s=r.parse(e[1],1,io);if(!s)return null;let l=r.parse(e[e.length-1],e.length-1,n);return l?"value"!==s.type.kind&&r.concat(1).checkSubtype(i,s.type)?null:new nq(i,n,s,o,a,l):null}evaluate(e){let r=this.input.evaluate(e);return(iw(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){let e=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),i=[],n={};for(let e of r){let r=n[this.cases[e]];void 0===r?(n[this.cases[e]]=i.length,i.push([this.cases[e],[e]])):i[r][1].push(e)}let o=e=>"number"===this.inputType.kind?Number(e):e;for(let[r,n]of i)e.push(1===n.length?o(n[0]):n.map(o)),e.push(this.outputs[r].serialize());return e.push(this.otherwise.serialize()),e}}class nH{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){let i;if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);let n=[];for(let o=1;o<e.length-1;o+=2){let a=r.parse(e[o],o,it);if(!a)return null;let s=r.parse(e[o+1],o+1,i);if(!s)return null;n.push([a,s]),i=i||s.type}let o=r.parse(e[e.length-1],e.length-1,i);return o?new nH(i,n,o):null}evaluate(e){for(let[r,i]of this.branches)if(r.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,i]of this.branches)e(r),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}serialize(){let e=["case"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class n${constructor(e,r,i,n){this.type=e,this.input=r,this.beginIndex=i,this.endIndex=n}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,io),n=r.parse(e[2],2,r7);if(!i||!n)return null;
9if(!id(i.type,[iu(io),ie,io]))return r.error(`Expected first argument to be of type array or string, but found ${ic(i.type)} instead`);if(4===e.length){let o=r.parse(e[3],3,r7);return o?new n$(i.type,i,n,o):null}return new n$(i.type,i,n)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!im(r,["string","array"]))throw new iT(`Expected first argument to be of type array or string, but found ${ic(iw(r))} instead.`);if(this.endIndex){let n=this.endIndex.evaluate(e);return r.slice(i,n)}return r.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){let e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function nW(e,r){return"=="===e||"!="===e?"boolean"===r.kind||"string"===r.kind||"number"===r.kind||"null"===r.kind||"value"===r.kind:"string"===r.kind||"number"===r.kind||"value"===r.kind}function nY(e,r,i,n){return 0===n.compare(r,i)}function nZ(e,r,i){let n="=="!==e&&"!="!==e;return class o{constructor(e,r,i){this.type=it,this.lhs=e,this.rhs=r,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===r.type.kind}static parse(e,r){if(3!==e.length&&4!==e.length)return r.error("Expected two or three arguments.");let i=e[0],a=r.parse(e[1],1,io);if(!a)return null;if(!nW(i,a.type))return r.concat(1).error(`"${i}" comparisons are not supported for type '${ic(a.type)}'.`);let s=r.parse(e[2],2,io);if(!s)return null;if(!nW(i,s.type))return r.concat(2).error(`"${i}" comparisons are not supported for type '${ic(s.type)}'.`);if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return r.error(`Cannot compare types '${ic(a.type)}' and '${ic(s.type)}'.`);n&&("value"===a.type.kind&&"value"!==s.type.kind?a=new iM(s.type,[a]):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new iM(a.type,[s])));let l=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return r.error("Cannot use collator to compare non-string types.");if(!(l=r.parse(e[3],3,ia)))return null}return new o(a,s,l)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let r=iw(a),i=iw(s);if(r.kind!==i.kind||"string"!==r.kind&&"number"!==r.kind)throw new iT(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${r.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let e=iw(a),i=iw(s);if("string"!==e.kind||"string"!==i.kind)return r(o,a,s)}return this.collator?i(o,a,s,this.collator.evaluate(o)):r(o,a,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){let r=[e];return this.eachChild(e=>{r.push(e.serialize())}),r}}}let nX=nZ("==",function(e,r,i){return r===i},nY),nK=nZ("!=",function(e,r,i){return r!==i},function(e,r,i,n){return!nY(0,r,i,n)}),nQ=nZ("<",function(e,r,i){return r<i},function(e,r,i,n){return 0>n.compare(r,i)}),nJ=nZ(">",function(e,r,i){return r>i},function(e,r,i,n){return n.compare(r,i)>0}),n0=nZ("<=",function(e,r,i){return r<=i},function(e,r,i,n){return 0>=n.compare(r,i)}),n1=nZ(">=",function(e,r,i){return r>=i},function(e,r,i,n){return n.compare(r,i)>=0});class n2{constructor(e,r,i,n,o,a){this.type=ie,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,r){if(3!==e.length)return r.error("Expected two arguments.");let i=r.parse(e[1],1,r7);if(!i)return null;let n=e[2];if("object"!=typeof n||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&!(o=r.parse(n.locale,1,ie)))return null;let a=null;if(n.currency&&!(a=r.parse(n.currency,1,ie)))return null;let s=null;if(n.unit&&!(s=r.parse(n.unit,1,ie)))return null;let l=null;if(n["min-fraction-digits"]&&!(l=r.parse(n["min-fraction-digits"],1,r7)))return null;let u=null;return!n["max-fraction-digits"]||(u=r.parse(n["max-fraction-digits"],1,r7))?new n2(i,o,a,s,l,u):null}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){let e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class n3{constructor(e){this.type=r7,this.input=e}static parse(e,r){if(2!==e.length)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?r.error(`Expected argument of type string or array, but found ${ic(i.type)} instead.`):new n3(i):null}evaluate(e){let r=this.input.evaluate(e);if("string"==typeof r||Array.isArray(r))return r.length;throw new iT(`Expected value to be of type string or array, but found ${ic(iw(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){let e=["length"];return this.eachChild(r=>{e.push(r.serialize())}),e}}function n5(e){return function(){let r=Math.imul((e=0x6d2b79f5+(e|=0)|0)^e>>>15,1|e);return(((r=r+Math.imul(r^r>>>7,61|r)^r)^r>>>14)>>>0)/0x100000000}}let n4={"==":nX,"!=":nK,">":nJ,"<":nQ,">=":n1,"<=":n0,array:iM,at:nj,boolean:iM,case:nH,coalesce:nB,collator:iF,format:iC,image:iA,in:nV,"index-of":nG,interpolate:nF,"interpolate-hcl":nF,"interpolate-lab":nF,length:n3,let:nU,literal:iS,match:nq,number:iM,"number-format":n2,object:iM,slice:n$,step:nb,string:iM,"to-boolean":iO,"to-color":iO,"to-number":iO,"to-string":iO,var:ny,within:iK,distance:nc,config:nd};
9function n6(e,[r,i,n,o]){r=r.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);let a=o?o.evaluate(e):1,s=ix(r,i,n,a);if(s)throw new iT(s);return new r1(r/255*a,i/255*a,n/255*a,a)}function n8(e,[r,i,n,o]){var a,s,l;r=r.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);let u=o?o.evaluate(e):1,c=(a=r,s=i,l=n,"number"==typeof a&&a>=0&&a<=360?"number"==typeof s&&s>=0&&s<=100&&"number"==typeof l&&l>=0&&l<=100?void 0===u||"number"==typeof u&&u>=0&&u<=1?null:`Invalid hsla value [${[a,s,l,u].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof u?[a,s,l,u]:[a,s,l]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof u?[a,s,l,u]:[a,s,l]).join(", ")}]: 'h' must be between 0 and 360.`);if(c)throw new iT(c);let h=`hsla(${r}, ${i}%, ${n}%, ${u})`,p=r1.parse(h);if(!p)throw new iT(`Failed to parse HSLA color: ${h}`);return p}function n9(e,r){let i=r[e];return void 0===i?null:i}function n7(e){return{type:e}}function oe(e){return{result:"success",value:e}}function ot(e){return{result:"error",value:e}}function or(e,r){return!!e&&!!e.parameters&&e.parameters.indexOf(r)>-1}function oi(e){return"data-driven"===e["property-type"]}function on(e){return or(e.expression,"measure-light")}function oo(e){return or(e.expression,"zoom")}function oa(e){return!!e.expression&&e.expression.interpolated}function os(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ol(e){return e}function ou(e,r,i){return void 0!==e?e:void 0!==r?r:void 0!==i?i:void 0}function oc(e,r,i,n,o){return ou(typeof i===o?n[i]:void 0,e.default,r.default)}function oh(e,r,i){if("number"!==iP(i))return ou(e.default,r.default);let n=e.stops.length;if(1===n||i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];let o=nx(e.stops.map(e=>e[0]),i);return e.stops[o][1]}function op(e,r,i){var n;let o,a,s=void 0!==e.base?e.base:1;if("number"!==iP(i))return ou(e.default,r.default);let l=e.stops.length;if(1===l||i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[l-1][0])return e.stops[l-1][1];let u=nx(e.stops.map(e=>e[0]),i),c=(n=e.stops[u][0],o=e.stops[u+1][0]-n,a=i-n,0===o?0:1===s?a/o:(Math.pow(s,a)-1)/(Math.pow(s,o)-1)),h=e.stops[u][1],p=e.stops[u+1][1],d=r5[r.type]||ol;if(e.colorSpace&&"rgb"!==e.colorSpace){let r=nN[e.colorSpace];d=(e,i)=>r.reverse(r.interpolate(r.forward(e),r.forward(i),c))}return"function"==typeof h.evaluate?{evaluate(...e){let r=h.evaluate.apply(void 0,e),i=p.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==i)return d(r,i,c)}}:d(h,p,c)}function od(e,r,i){return"color"===r.type?i=r1.parse(i):"formatted"===r.type?i=iy.fromString(i.toString()):"resolvedImage"===r.type?i=iv.fromString(i.toString()):iP(i)===r.type||"enum"===r.type&&r.values[i]||(i=void 0),ou(i,e.default,r.default)}ik.register(n4,{error:[{kind:"error"},[ie],(e,[r])=>{throw new iT(r.evaluate(e))}],typeof:[ie,[io],(e,[r])=>ic(iw(r.evaluate(e)))],"to-rgba":[iu(r7,4),[ir],(e,[r])=>r.evaluate(e).toArray()],rgb:[ir,[r7,r7,r7],n6],rgba:[ir,[r7,r7,r7,r7],n6],hsl:[ir,[r7,r7,r7],n8],hsla:[ir,[r7,r7,r7,r7],n8],has:{type:it,overloads:[[[ie],(e,[r])=>r.evaluate(e)in e.properties()],[[ie,ii],(e,[r,i])=>r.evaluate(e)in i.evaluate(e)]]},get:{type:io,overloads:[[[ie],(e,[r])=>n9(r.evaluate(e),e.properties())],[[ie,ii],(e,[r,i])=>n9(r.evaluate(e),i.evaluate(e))]]},"feature-state":[io,[ie],(e,[r])=>n9(r.evaluate(e),e.featureState||{})],properties:[ii,[],e=>e.properties()],"geometry-type":[ie,[],e=>e.geometryType()],id:[io,[],e=>e.id()],zoom:[r7,[],e=>e.globals.zoom],pitch:[r7,[],e=>e.globals.pitch||0],"distance-from-center":[r7,[],e=>e.distanceFromCenter()],"measure-light":[r7,[ie],(e,[r])=>e.measureLight(r.evaluate(e))],"heatmap-density":[r7,[],e=>e.globals.heatmapDensity||0],"line-progress":[r7,[],e=>e.globals.lineProgress||0],"raster-value":[r7,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[r7,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[r7,[],e=>e.globals.skyRadialProgress||0],accumulated:[io,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[r7,n7(r7),(e,r)=>{let i=0;for(let n of r)i+=n.evaluate(e);return i}],"*":[r7,n7(r7),(e,r)=>{let i=1;for(let n of r)i*=n.evaluate(e);return i}],"-":{type:r7,overloads:[[[r7,r7],(e,[r,i])=>r.evaluate(e)-i.evaluate(e)],[[r7],(e,[r])=>-r.evaluate(e)]]},"/":[r7,[r7,r7],(e,[r,i])=>r.evaluate(e)/i.evaluate(e)],"%":[r7,[r7,r7],(e,[r,i])=>r.evaluate(e)%i.evaluate(e)],ln2:[r7,[],()=>Math.LN2],pi:[r7,[],()=>Math.PI],e:[r7,[],()=>Math.E],"^":[r7,[r7,r7],(e,[r,i])=>Math.pow(r.evaluate(e),i.evaluate(e))],sqrt:[r7,[r7],(e,[r])=>Math.sqrt(r.evaluate(e))],log10:[r7,[r7],(e,[r])=>Math.log(r.evaluate(e))/Math.LN10],ln:[r7,[r7],(e,[r])=>Math.log(r.evaluate(e))],log2:[r7,[r7],(e,[r])=>Math.log(r.evaluate(e))/Math.LN2],sin:[r7,[r7],(e,[r])=>Math.sin(r.evaluate(e))],cos:[r7,[r7],(e,[r])=>Math.cos(r.evaluate(e))],tan:[r7,[r7],(e,[r])=>Math.tan(r.evaluate(e))],asin:[r7,[r7],(e,[r])=>Math.asin(r.evaluate(e))],acos:[r7,[r7],(e,[r])=>Math.acos(r.evaluate(e))],atan:[r7,[r7],(e,[r])=>Math.atan(r.evaluate(e))],min:[r7,n7(r7),(e,r)=>Math.min(...r.map(r=>r.evaluate(e)))],max:[r7,n7(r7),(e,r)=>Math.max(...r.map(r=>r.evaluate(e)))],abs:[r7,[r7],(e,[r])=>Math.abs(r.evaluate(e))],round:[r7,[r7],(e,[r])=>{let i=r.evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[r7,[r7],(e,[r])=>Math.floor(r.evaluate(e))],ceil:[r7,[r7],(e,[r])=>Math.ceil(r.evaluate(e))],"filter-==":[it,[ie,io],(e,[r,i])=>e.properties()[r.value]===i.value],"filter-id-==":[it,[io],(e,[r])=>e.id()===r.value],"filter-type-==":[it,[ie],(e,[r])=>e.geometryType()===r.value],"filter-<":[it,[ie,io],(e,[r,i])=>{let n=e.properties()[r.value],o=i.value;return typeof n==typeof o&&n<o}],"filter-id-<":[it,[io],(e,[r])=>{let i=e.id(),n=r.value;return typeof i==typeof n&&i<n}],"filter->":[it,[ie,io],(e,[r,i])=>{let n=e.properties()[r.value],o=i.value;return typeof n==typeof o&&n>o}],"filter-id->":[it,[io],(e,[r])=>{let i=e.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[it,[ie,io],(e,[r,i])=>{let n=e.properties()[r.value],o=i.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[it,[io],(e,[r])=>{let i=e.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[it,[ie,io],(e,[r,i])=>{let n=e.properties()[r.value],o=i.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[it,[io],(e,[r])=>{let i=e.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[it,[io],(e,[r])=>r.value in e.properties()],"filter-has-id":[it,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[it,[iu(ie)],(e,[r])=>r.value.indexOf(e.geometryType())>=0],"filter-id-in":[it,[iu(io)],(e,[r])=>r.value.indexOf(e.id())>=0],"filter-in-small":[it,[ie,iu(io)],(e,[r,i])=>i.value.indexOf(e.properties()[r.value])>=0],"filter-in-large":[it,[ie,iu(io)],(e,[r,i])=>(function(e,r,i,n){for(;i<=n;){let o=i+n>>1;
9if(r[o]===e)return!0;r[o]>e?n=o-1:i=o+1}return!1})(e.properties()[r.value],i.value,0,i.value.length-1)],all:{type:it,overloads:[[[it,it],(e,[r,i])=>r.evaluate(e)&&i.evaluate(e)],[n7(it),(e,r)=>{for(let i of r)if(!i.evaluate(e))return!1;return!0}]]},any:{type:it,overloads:[[[it,it],(e,[r,i])=>r.evaluate(e)||i.evaluate(e)],[n7(it),(e,r)=>{for(let i of r)if(i.evaluate(e))return!0;return!1}]]},"!":[it,[it],(e,[r])=>!r.evaluate(e)],"is-supported-script":[it,[ie],(e,[r])=>{let i=e.globals&&e.globals.isSupportedScript;return!i||i(r.evaluate(e))}],upcase:[ie,[ie],(e,[r])=>r.evaluate(e).toUpperCase()],downcase:[ie,[ie],(e,[r])=>r.evaluate(e).toLowerCase()],concat:[ie,n7(io),(e,r)=>r.map(r=>iE(r.evaluate(e))).join("")],"resolved-locale":[ie,[ia],(e,[r])=>r.evaluate(e).resolvedLocale()],random:[r7,[r7,r7,io],(e,r)=>{let i,[n,o,a]=r.map(r=>r.evaluate(e));if(n>o||n===o)return n;if("string"==typeof a)i=function(e){let r=0;if(0===e.length)return r;for(let i=0;i<e.length;i++)r=(r<<5)-r+e.charCodeAt(i)|0;return r}(a);else{if("number"!=typeof a)throw new iT(`Invalid seed input: ${a}`);i=a}return n+n5(i)()*(o-n)}]});class of{constructor(e,r,i,n){this.expression=e,this._warningHistory={},this._evaluator=new iR(i,n),this._defaultValue=r?function(e){return"color"===e.type&&(os(e.default)||Array.isArray(e.default))?new r1(0,0,0,0):"color"===e.type?r1.parse(e.default)||null:void 0===e.default?null:e.default}(r):null,this._enumValues=r&&"enum"===r.type?r.values:null}evaluateWithoutErrorHandling(e,r,i,n,o,a,s,l){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=i,this._evaluator.canonical=n||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=l||null,this.expression.evaluate(this._evaluator)}evaluate(e,r,i,n,o,a,s,l){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=l||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new iT(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"u">typeof console&&console.warn(e.message)),this._defaultValue}}}function om(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in n4}function og(e,r,i,n){let o,a=new nv(n4,[],r?(o={color:ir,string:ie,number:r7,enum:ie,boolean:it,formatted:is,resolvedImage:il},"array"===r.type?iu(o[r.value]||io,r.length):o[r.type]):void 0,void 0,void 0,i,n),s=a.parse(e,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0);return s?oe(new of(s,r,i,n)):ot(a.errors)}class o_{constructor(e,r,i){this.kind=e,this._styleExpression=r,this.isLightConstant=i,this.isStateDependent="constant"!==e&&!nm(r.expression),this.isConfigDependent=!ng(r.expression)}evaluateWithoutErrorHandling(e,r,i,n,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,i,n,o,a)}evaluate(e,r,i,n,o,a){return this._styleExpression.evaluate(e,r,i,n,o,a)}}class oy{constructor(e,r,i,n,o){this.kind=e,this.zoomStops=i,this._styleExpression=r,this.isStateDependent="camera"!==e&&!nm(r.expression),this.isLightConstant=o,this.isConfigDependent=!ng(r.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,r,i,n,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,i,n,o,a)}evaluate(e,r,i,n,o,a){return this._styleExpression.evaluate(e,r,i,n,o,a)}interpolationFactor(e,r,i){return this.interpolationType?nF.interpolationFactor(this.interpolationType,e,r,i):0}}function ov(e,r,i,n){if("error"===(e=og(e,r,i,n)).result)return e;let o=e.value.expression,a=nf(o);if(!a&&!oi(r))return ot([new r6("","data expressions not supported")]);let s=n_(o,["zoom","pitch","distance-from-center"]);if(!s&&!oo(r))return ot([new r6("","zoom expressions not supported")]);let l=n_(o,["measure-light"]);if(!l&&!on(r))return ot([new r6("","measure-light expression not supported")]);let u=r.expression&&r.expression.relaxZoomRestriction,c=function e(r){let i=null;if(r instanceof nU)i=e(r.result);else if(r instanceof nB){for(let n of r.args)if(i=e(n))break}else(r instanceof nb||r instanceof nF)&&r.input instanceof ik&&"zoom"===r.input.name&&(i=r);return i instanceof r6||r.eachChild(r=>{let n=e(r);n instanceof r6?i=n:i&&n&&i!==n&&(i=new r6("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}(o);return c||s||u?c instanceof r6?ot([c]):c instanceof nF&&!oa(r)?ot([new r6("",'"interpolate" expressions cannot be used with this property')]):oe(c?new oy(a?"camera":"composite",e.value,c.labels,c instanceof nF?c.interpolation:void 0,l):new o_(a?"constant":"source",e.value,l)):ot([new r6("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class ox{constructor(e,r){this._parameters=e,this._specification=r,r4(this,function e(r,i){let n,o,a,s="color"===i.type,l=r.stops&&"object"==typeof r.stops[0][0],u=l||!(l||void 0!==r.property),c=r.type||(oa(i)?"exponential":"interval");if(s&&((r=r4({},r)).stops&&(r.stops=r.stops.map(e=>[e[0],r1.parse(e[1])])),r.default=r1.parse(r.default?r.default:i.default)),r.colorSpace&&"rgb"!==r.colorSpace&&!nN[r.colorSpace])throw Error(`Unknown color space: ${r.colorSpace}`);if("exponential"===c)n=op;else if("interval"===c)n=oh;else if("categorical"===c){for(let e of(n=oc,o=Object.create(null),r.stops))o[e[0]]=e[1];a=typeof r.stops[0][0]}else{if("identity"!==c)throw Error(`Unknown function type "${c}"`);n=od}if(l){let n={},o=[];for(let e=0;e<r.stops.length;e++){let i=r.stops[e],a=i[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:r.type,property:r.property,default:r.default,stops:[]},o.push(a)),n[a].stops.push([i[0].value,i[1]])}let a=[];for(let r of o)a.push([n[r].zoom,e(n[r],i)]);let s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:nF.interpolationFactor.bind(void 0,s),zoomStops:a.map(e=>e[0]),evaluate:({zoom:e},n)=>op({stops:a,base:r.base},i,e).evaluate(e,n)}}if(u){let e="exponential"===c?{name:"exponential",base:void 0!==r.base?r.base:1}:null;return{kind:"camera",interpolationType:e,interpolationFactor:nF.interpolationFactor.bind(void 0,e),zoomStops:r.stops.map(e=>e[0]),evaluate:({zoom:e})=>n(r,i,e,o,a)}}return{kind:"source",evaluate(e,s){let l=s&&s.properties?s.properties[r.property]:void 0;return void 0===l?ou(r.default,i.default):n(r,i,l,o,a)}}}(this._parameters,this._specification))}static deserialize(e){return new ox(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ob(e,r,i){var n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var o=new Int32Array(this.arrayBuffer);e=o[0],this.d=(r=o[1])+2*(i=o[2]);for(var a=0;a<this.d*this.d;a++){var s=o[3+a],l=o[3+a+1];n.push(s===l?null:o.subarray(s,l))}var u=o[3+n.length+1];this.keys=o.subarray(o[3+n.length],u),this.bboxes=o.subarray(u),this.insert=this._insertReadonly}else{this.d=r+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=i,this.scale=r/e,this.uid=0;var h=i/r*e;this.min=-h,this.max=e+h}
9ob.prototype.insert=function(e,r,i,n,o){this._forEachCell(r,i,n,o,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(o)},ob.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ob.prototype._insertCell=function(e,r,i,n,o,a){this.cells[o].push(a)},ob.prototype.query=function(e,r,i,n,o){var a=this.min,s=this.max;if(e<=a&&r<=a&&s<=i&&s<=n&&!o)return Array.prototype.slice.call(this.keys);var l=[];return this._forEachCell(e,r,i,n,this._queryCell,l,{},o),l},ob.prototype._queryCell=function(e,r,i,n,o,a,s,l){var u=this.cells[o];if(null!==u)for(var c=this.keys,h=this.bboxes,p=0;p<u.length;p++){var d=u[p];if(void 0===s[d]){var f=4*d;(l?l(h[f+0],h[f+1],h[f+2],h[f+3]):e<=h[f+2]&&r<=h[f+3]&&i>=h[f+0]&&n>=h[f+1])?(s[d]=!0,a.push(c[d])):s[d]=!1}}},ob.prototype._forEachCell=function(e,r,i,n,o,a,s,l){for(var u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),p=this._convertToCellCoord(n),d=u;d<=h;d++)for(var f=c;f<=p;f++){var m=this.d*f+d;if((!l||l(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&o.call(this,e,r,i,n,m,a,s,l))return}},ob.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ob.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ob.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,r=3+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var o=new Int32Array(r+i+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;for(var a=r,s=0;s<e.length;s++){var l=e[s];o[3+s]=a,o.set(l,a),a+=l.length}return o[3+e.length]=a,o.set(this.keys,a),o[3+e.length+1]=a+=this.keys.length,o.set(this.bboxes,a),a+=this.bboxes.length,o.buffer};var ow=M(ob);let oE={};function oS(e,r,i={}){Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),oE[r]={klass:e,omit:i.omit||[]}}for(let e in oS(Object,"Object"),ow.serialize=function(e,r){let i=e.toArrayBuffer();return r&&r.add(i),{buffer:i}},ow.deserialize=function(e){return new ow(e.buffer)},Object.defineProperty(ow,"name",{value:"Grid"}),oS(ow,"Grid"),oS(r1,"Color"),oS(Error,"Error"),oS(iy,"Formatted"),oS(i_,"FormattedSection"),oS(rm,"AJAXError"),oS(iv,"ResolvedImage"),oS(ox,"StylePropertyFunction"),oS(of,"StyleExpression",{omit:["_evaluator"]}),oS(oy,"ZoomDependentExpression"),oS(o_,"ZoomConstantExpression"),oS(ik,"CompoundExpression",{omit:["_evaluate"]}),n4)oE[n4[e]._classRegistryKey]||oS(n4[e],`Expression${e}`);function oT(e){return e&&"u">typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function oI(e){return self.ImageBitmap&&e instanceof ImageBitmap}function oM(e,r){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(oT(e)||oI(e))return r&&r.add(e),e;if(ArrayBuffer.isView(e))return r&&r.add(e.buffer),e;if(e instanceof ImageData)return r&&r.add(e.data.buffer),e;if(Array.isArray(e)){let i=[];for(let n of e)i.push(oM(n,r));return i}if(e instanceof Map){let r={$name:"Map"};for(let[i,n]of e.entries())r[i]=oM(n);return r}if("object"==typeof e){let i=e.constructor,n=i._classRegistryKey;if(!n)throw Error(`can't serialize object of unregistered class ${n}`);let o=i.serialize?i.serialize(e,r):{};if(!i.serialize){for(let i in e)e.hasOwnProperty(i)&&(oE[n].omit.indexOf(i)>=0||(o[i]=oM(e[i],r)));e instanceof Error&&(o.message=e.message)}if(o.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(o.$name=n),o}throw Error("can't serialize object of type "+typeof e)}function oC(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||oT(e)||oI(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(oC);if("object"==typeof e){let r=e.$name||"Object";if("Map"===r){let r=new Map;for(let i of Object.keys(e))"$name"!==i&&r.set(i,oC(e[i]));return r}let{klass:i}=oE[r];if(!i)throw Error(`can't deserialize unregistered class ${r}`);if(i.deserialize)return i.deserialize(e);let n=Object.create(i.prototype);for(let r of Object.keys(e))"$name"!==r&&(n[r]=oC(e[r]));return n}throw Error("can't deserialize object of type "+typeof e)}let oA=e=>e>=1536&&e<=1791,oP=e=>e>=1872&&e<=1919,oL=e=>e>=2208&&e<=2303,oO=e=>e>=6016&&e<=6143,oD=e=>e>=11904&&e<=12031,oR=e=>e>=12032&&e<=12255,ok=e=>e>=12272&&e<=12287,oN=e=>e>=12288&&e<=12351,oF=e=>e>=12352&&e<=12447,oz=e=>e>=12448&&e<=12543,oB=e=>e>=12544&&e<=12591,oU=e=>e>=12704&&e<=12735,oj=e=>e>=12736&&e<=12783,oV=e=>e>=12784&&e<=12799,oG=e=>e>=12800&&e<=13055,oq=e=>e>=13056&&e<=13311,oH=e=>e>=13312&&e<=19903,o$=e=>e>=19968&&e<=40959,oW=e=>e>=40960&&e<=42127,oY=e=>e>=42128&&e<=42191,oZ=e=>e>=44032&&e<=55215,oX=e=>e>=63744&&e<=64255,oK=e=>e>=64336&&e<=65023,oQ=e=>e>=65040&&e<=65055,oJ=e=>e>=65072&&e<=65103,o0=e=>e>=65104&&e<=65135,o1=e=>e>=65136&&e<=65279,o2=e=>e>=65280&&e<=65519;function o3(e){for(let r of e)if(o5(r.charCodeAt(0)))return!0;return!1}function o5(e){let r,i,n,o,a,s,l,u;return!(746!==e&&747!==e&&(e<4352||!(oU(e)||oB(e)||oJ(e)&&!(e>=65097&&e<=65103)||oX(e)||oq(e)||oD(e)||oj(e)||!(!oN(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||oH(e)||o$(e)||oG(e)||(r=e)>=12592&&r<=12687||(i=e)>=43360&&i<=43391||(n=e)>=55216&&n<=55295||(o=e)>=4352&&o<=4607||oZ(e)||oF(e)||ok(e)||(a=e)>=12688&&a<=12703||oR(e)||oV(e)||oz(e)&&12540!==e||!(!o2(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!o0(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||(s=e)>=5120&&s<=5759||(l=e)>=6320&&l<=6399||oQ(e)||(u=e)>=19904&&u<=19967||oW(e)||oY(e))))}function o4(e){let r,i,n,o,a,s,l,u,c,h,p,d;return!(o5(e)||(r=e)>=128&&r<=255&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(i=e)>=8192&&i<=8303&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||(n=e)>=8448&&n<=8527||(o=e)>=8528&&o<=8591||(a=e)>=8960&&a<=9215&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||(s=e)>=9216&&s<=9279&&9251!==e||(l=e)>
9=9280&&l<=9311||(u=e)>=9312&&u<=9471||(c=e)>=9632&&c<=9727||(h=e)>=9728&&h<=9983&&!(e>=9754&&e<=9759)||(p=e)>=11008&&p<=11263&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||oN(e)||oz(e)||(d=e)>=57344&&d<=63743||oJ(e)||o0(e)||o2(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}function o6(e){return e>=1424&&e<=2303||oK(e)||o1(e)}let o8="deferred",o9="loading",o7="loaded",ae=null,at="unavailable",ar=null,ai=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(at="error"),ae&&ae(e)};function an(){ao.fire(new rW("pluginStateChange",{pluginStatus:at,pluginURL:ar}))}let ao=new rZ,aa=function(){return at},as=function(){if(at!==o8||!ar)throw Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");at=o9,an(),ar&&ry({url:ar},e=>{e?ai(e):(at=o7,an())})},al={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>at===o7||null!=al.applyArabicShaping,isLoading:()=>at===o9,setState(e){at=e.pluginStatus,ar=e.pluginURL},isParsed:()=>null!=al.applyArabicShaping&&null!=al.processBidirectionalText&&null!=al.processStyledBidirectionalText,getPluginURL:()=>ar};class au{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.transition=r.transition,this.pitch=r.pitch,this.brightness=r.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){var r,i=al.isLoaded();for(let n of e)if(r=n.charCodeAt(0),!i&&o6(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||oO(r))return!1;return!0}}class ac{constructor(e,r,i,n){this.property=e,this.value=r,this.expression=function(e,r,i,n){if(os(e))return new ox(e,r);if(om(e)||Array.isArray(e)&&e.length>0){let o=ov(e,r,i,n);if("error"===o.result)throw Error(o.value.map(e=>`${e.key}: ${e.message}`).join(", "));return o.value}{let i=e;return"string"==typeof e&&"color"===r.type&&(i=r1.parse(e)),{kind:"constant",isConfigDependent:!1,evaluate:()=>i}}}(void 0===r?e.specification.default:r,e.specification,i,n)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,r,i){return this.property.possiblyEvaluate(this,e,r,i)}}class ah{constructor(e,r,i){this.property=e,this.value=new ac(e,void 0,r,i)}transitioned(e,r){return new ad(this.property,this.value,r,tL({},e.transition,this.transition),e.now)}untransitioned(){return new ad(this.property,this.value,null,{},0)}}class ap{constructor(e,r,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=r,this._options=i,this.isConfigDependent=!1}getValue(e){return tj(this._values[e].value.value)}setValue(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new ah(this._values[e].property,this._scope,this._options)),this._values[e].value=new ac(this._values[e].property,null===r?void 0:tj(r),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].value.expression.isConfigDependent}setTransitionOrValue(e,r){r&&(this._options=r);let i=this._properties.properties;if(e)for(let r in e){let n=e[r];if(tz(r,"-transition")){let e=r.slice(0,-11);i[e]&&this.setTransition(e,n)}else i[r]&&this.setValue(r,n)}}getTransition(e){return tj(this._values[e].transition)}setTransition(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new ah(this._values[e].property)),this._values[e].transition=tj(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let i=this.getValue(r);void 0!==i&&(e[r]=i);let n=this.getTransition(r);void 0!==n&&(e[`${r}-transition`]=n)}return e}transitioned(e,r){let i=new af(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(e,r._values[n]);return i}untransitioned(){let e=new af(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class ad{constructor(e,r,i,n,o){const a=n.delay||0,s=n.duration||0;o=o||0,this.property=e,this.value=r,this.begin=o+a,this.end=this.begin+s,e.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(e,r,i){let n=e.now||0,o=this.value.possiblyEvaluate(e,r,i),a=this.prior;if(a){if(n>this.end||this.value.isDataDriven())return this.prior=null,o;if(n<this.begin)return a.possiblyEvaluate(e,r,i);{let s=(n-this.begin)/(this.end-this.begin);
9return this.property.interpolate(a.possiblyEvaluate(e,r,i),o,tS(s))}}return o}}class af{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,i){let n=new a_(this._properties);for(let o of Object.keys(this._values))n._values[o]=this._values[o].possiblyEvaluate(e,r,i);return n}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class am{constructor(e,r,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=r,this._options=i,this.isConfigDependent=!1}getValue(e){return tj(this._values[e].value)}setValue(e,r){this._values[e]=new ac(this._values[e].property,null===r?void 0:tj(r),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].expression.isConfigDependent}serialize(){let e={};for(let r of Object.keys(this._values)){let i=this.getValue(r);void 0!==i&&(e[r]=i)}return e}possiblyEvaluate(e,r,i){let n=new a_(this._properties);for(let o of Object.keys(this._values))n._values[o]=this._values[o].possiblyEvaluate(e,r,i);return n}}class ag{constructor(e,r,i){this.property=e,this.value=r,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,r,i,n){return this.property.evaluate(this.value,this.parameters,e,r,i,n)}}class a_{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class ay{constructor(e){this.specification=e}possiblyEvaluate(e,r){return e.expression.evaluate(r)}interpolate(e,r,i){let n=r5[this.specification.type];return n?n(e,r,i):e}}class av{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,i,n){return new ag(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(r,null,{},i,n)}:e.expression,r)}interpolate(e,r,i){if("constant"!==e.value.kind||"constant"!==r.value.kind)return e;if(void 0===e.value.value||void 0===r.value.value)return new ag(this,{kind:"constant",value:void 0},e.parameters);let n=r5[this.specification.type];return n?new ag(this,{kind:"constant",value:n(e.value.value,r.value.value,i)},e.parameters):e}evaluate(e,r,i,n,o,a){return"constant"===e.kind?e.value:e.evaluate(r,i,n,o,a)}}class ax{constructor(e){this.specification=e}possiblyEvaluate(e,r,i,n){return!!e.expression.evaluate(r,null,{},i,n)}interpolate(){return!1}}class ab{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const r=new au(0,{});for(const i in e){const n=e[i];n.specification.overridable&&this.overridableProperties.push(i);const o=this.defaultPropertyValues[i]=new ac(n,void 0),a=this.defaultTransitionablePropertyValues[i]=new ah(n);this.defaultTransitioningPropertyValues[i]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=o.possiblyEvaluate(r)}}}function aw(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function aE(e){if(Array.isArray(e))return e.map(aE);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let r={};for(let i in e)r[i]=aE(e[i]);return r}return aw(e)}oS(av,"DataDrivenProperty"),oS(ay,"DataConstantProperty"),oS(ax,"ColorRampProperty");var aS=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"camera":{"type":"camera"},"imports":{"type":"array","value":"import"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}}
9,"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"expression":{},"property-type":"data-constant"},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
9,"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":1}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}
9,"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"
9interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true
9,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function aT(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(let r of e.slice(1))if(!aT(r)&&"boolean"!=typeof r)return!1;return!0;default:return!0}}function aI(e,r="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};aT(e)||(e=function e(r){if(!r)return!0;let i=r[0];return r.length<=1?"any"!==i:"=="===i?aP(r[1],r[2],"=="):"!="===i?aD(aP(r[1],r[2],"==")):"<"===i||">"===i||"<="===i||">="===i?aP(r[1],r[2],i):"any"===i?["any"].concat(r.slice(1).map(e)):"all"===i?["all"].concat(r.slice(1).map(e)):"none"===i?["all"].concat(r.slice(1).map(e).map(aD)):"in"===i?aL(r[1],r.slice(2)):"!in"===i?aD(aL(r[1],r.slice(2))):"has"===i?aO(r[1]):"!has"!==i||aD(aO(r[1]))}(e));let i=e,n=!0;try{n=function(e){if(!aM(e))return e;let r=aE(e);return function e(r){let i=!1,n=[];if("case"===r[0]){for(let e=1;e<r.length-1;e+=2)i=i||aM(r[e]),n.push(r[e+1]);n.push(r[r.length-1])}else if("match"===r[0]){i=i||aM(r[1]);for(let e=2;e<r.length-1;e+=2)n.push(r[e+1]);n.push(r[r.length-1])}else if("step"===r[0]){i=i||aM(r[1]);for(let e=1;e<r.length-1;e+=2)n.push(r[e+1])}i&&(r.length=0,r.push("any",...n));for(let i=1;i<r.length;i++)e(r[i])}(r),r=function e(r){if(!Array.isArray(r))return r;let i=function(e){if(aC.has(e[0])){for(let r=1;r<e.length;r++)if(aM(e[r]))return!0}return e}(r);return!0===i?i:i.map(r=>e(r))}(r)}(i)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
10This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
11and paste the contents of this message in the report.
12Thank you!
13Filter Expression:
14${JSON.stringify(i,null,2)}
15        `)}let o=aS[`filter_${r}`],a=og(n,o),s=null;if("error"===a.result)throw Error(a.value.map(e=>`${e.key}: ${e.message}`).join(", "));s=(e,r,i)=>a.value.evaluate(e,r,{},i);let l=null,u=null;if(n!==i){let e=og(i,o);if("error"===e.result)throw Error(e.value.map(e=>`${e.key}: ${e.message}`).join(", "));l=(r,i,n,o,a)=>e.value.evaluate(r,i,{},n,void 0,void 0,o,a),u=!nf(e.value.expression)}return{filter:s,dynamicFilter:l||void 0,needGeometry:function e(r){if(!Array.isArray(r))return!1;if("within"===r[0]||"distance"===r[0])return!0;for(let i=1;i<r.length;i++)if(e(r[i]))return!0;return!1}(n),needFeature:!!u}}function aM(e){var r;if(!Array.isArray(e))return!1;if("pitch"===(r=e[0])||"distance-from-center"===r)return!0;for(let r=1;r<e.length;r++)if(aM(e[r]))return!0;return!1}let aC=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function aA(e,r){return e<r?-1:+(e>r)}function aP(e,r,i){switch(e){case"$type":return[`filter-type-${i}`,r];case"$id":return[`filter-id-${i}`,r];default:return[`filter-${i}`,e,r]}}function aL(e,r){if(0===r.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(e=>typeof e!=typeof r[0])?["filter-in-large",e,["literal",r.sort(aA)]]:["filter-in-small",e,["literal",r]]}}function aO(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function aD(e){return["!",e]}function aR(e,r){return r?`${e}�${r}`:e}let ak="-transition",aN=new Set(["fill","line","background","hillshade","raster"]);class aF extends rZ{constructor(e,r,i,n){if(super(),this.id=e.id,this.fqid=aR(this.id,i),this.type=e.type,this.scope=i,this.options=n,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.isConfigDependent=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),r.layout&&(this._unevaluatedLayout=new am(r.layout,this.scope,n),this.isConfigDependent=this.isConfigDependent||this._unevaluatedLayout.isConfigDependent),r.paint)){for(const i in this._transitionablePaint=new ap(r.paint,this.scope,n),e.paint)this.setPaintProperty(i,e.paint[i]);for(const r in e.layout)this.setLayoutProperty(r,e.layout[r]);this.isConfigDependent=this.isConfigDependent||this._transitionablePaint.isConfigDependent,this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new a_(r.paint)}}onAdd(e){}onRemove(e){}isDraped(e){return aN.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r){if("custom"===this.type&&"visibility"===e)return void(this.visibility=r);let i=this._unevaluatedLayout;i._properties.properties[e]&&(i.setValue(e,r),this.isConfigDependent=this.isConfigDependent||i.isConfigDependent,"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(e){return tz(e,ak)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r){let i=this._transitionablePaint,n=i._properties.properties;if(tz(e,ak)){let o=e.slice(0,-11);return n[o]&&i.setTransition(o,r||void 0),!1}if(!n[e])return!1;let o=i._values[e],a=o.value.isDataDriven(),s=o.value;i.setValue(e,r),this.isConfigDependent=this.isConfigDependent||i.isConfigDependent,this._handleSpecialPaintPropertyUpdate(e);let l=i._values[e].value,u=l.isDataDriven(),c=tz(e,"pattern")||"line-dasharray"===e;return u||a||c||this._handleOverridablePaintPropertyUpdate(e,s,l)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,r){return null}_handleOverridablePaintPropertyUpdate(e,r,i){return!1}
15isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){return tU({id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()},(e,r)=>!(void 0===e||"layout"===r&&!Object.keys(e).length||"paint"===r&&!Object.keys(e).length))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(r instanceof ag&&oi(r.property.specification)&&("source"===r.value.kind||"composite"===r.value.kind)&&r.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=aI(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,r,i,n,o,a,s,l,u){}queryIntersectsMatchingFeature(e,r,i,n){}}let az={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class aB{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class aU{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(){throw Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(){throw Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function aj(e,r=1){let i=0,n=0;return{members:e.map(e=>{let o=az[e.type].BYTES_PER_ELEMENT,a=i=aV(i,Math.max(r,o)),s=e.components||1;return n=Math.max(n,o),i+=o*s,{name:e.name,type:e.type,components:s,offset:a}}),size:aV(i,Math.max(n,r)),alignment:r}}function aV(e,r){return Math.ceil(e/r)*r}class aG extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,r)}emplace(e,r,i){let n=2*e;return this.int16[n+0]=r,this.int16[n+1]=i,e}}aG.prototype.bytesPerElement=4,oS(aG,"StructArrayLayout2i4");class aq extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=3*e;return this.int16[o+0]=r,this.int16[o+1]=i,this.int16[o+2]=n,e}}aq.prototype.bytesPerElement=6,oS(aq,"StructArrayLayout3i6");class aH extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,i,n)}emplace(e,r,i,n,o){let a=4*e;return this.int16[a+0]=r,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=o,e}}aH.prototype.bytesPerElement=8,oS(aH,"StructArrayLayout4i8");class a$ extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,i,n,o)}emplace(e,r,i,n,o,a){let s=5*e;return this.int16[s+0]=r,this.int16[s+1]=i,this.int16[s+2]=n,this.int16[s+3]=o,this.int16[s+4]=a,e}}a$.prototype.bytesPerElement=10,oS(a$,"StructArrayLayout5i10");class aW extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a,s)}emplace(e,r,i,n,o,a,s,l){let u=6*e,c=12*e;return this.int16[u+0]=r,this.int16[u+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=o,this.uint8[c+6]=a,this.uint8[c+7]=s,this.float32[3*e+2]=l,e}}aW.prototype.bytesPerElement=12,oS(aW,"StructArrayLayout2i4ub1f12");class aY extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,i,n)}emplace(e,r,i,n,o){let a=4*e;return this.float32[a+0]=r,this.float32[a+1]=i,this.float32[a+2]=n,this.float32[a+3]=o,e}}aY.prototype.bytesPerElement=16,oS(aY,"StructArrayLayout4f16");class aZ extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,r)}emplace(e,r,i){let n=2*e;return this.float32[n+0]=r,this.float32[n+1]=i,e}}aZ.prototype.bytesPerElement=8,oS(aZ,"StructArrayLayout2f8");class aX extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,i,n,o)}emplace(e,r,i,n,o,a){let s=6*e;return this.uint16[s+0]=r,this.uint16[s+1]=i,this.uint16[s+2]=n,this.uint16[s+3]=o,this.float32[3*e+2]=a,e}}aX.prototype.bytesPerElement=12,oS(aX,"StructArrayLayout4ui1f12");class aK extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,i,n)}emplace(e,r,i,n,o){let a=4*e;return this.uint16[a+0]=r,this.uint16[a+1]=i,this.uint16[a+2]=n,this.uint16[a+3]=o,e}}aK.prototype.bytesPerElement=8,oS(aK,"StructArrayLayout4ui8");class aQ extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,i,n,o,a)}emplace(e,r,i,n,o,a,s){let l=6*e;return this.int16[l+0]=r,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,e}}aQ.prototype.bytesPerElement=12,oS(aQ,"StructArrayLayout6i12");class aJ extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s,l,u,c,h,p){let d=this.length;return this.resize(d+1),this.emplace(d,e,r,i,n,o,a,s,l,u,c,h,p)}emplace(e,r,i,n,o,a,s,l,u,c,h,p,d){let f=12*e;return this.int16[f+0]=r,this.int16[f+1]=i,this.int16[f+2]=n,this.int16[f+3]=o,this.uint16[f+4]=a,this.uint16[f+5]=s,this.uint16[f+6]=l,this.uint16[f+7]=u,this.int16[f+8]=c,this.int16[f+9]=h,this.int16[f+10]=p,this.int16[f+11]=d,e}}
15aJ.prototype.bytesPerElement=24,oS(aJ,"StructArrayLayout4i4ui4i24");class a0 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,i,n,o,a)}emplace(e,r,i,n,o,a,s){let l=10*e,u=5*e;return this.int16[l+0]=r,this.int16[l+1]=i,this.int16[l+2]=n,this.float32[u+2]=o,this.float32[u+3]=a,this.float32[u+4]=s,e}}a0.prototype.bytesPerElement=20,oS(a0,"StructArrayLayout3i3f20");class a1 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[+e+0]=r,e}}a1.prototype.bytesPerElement=4,oS(a1,"StructArrayLayout1ul4");class a2 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,r)}emplace(e,r,i){let n=2*e;return this.uint16[n+0]=r,this.uint16[n+1]=i,e}}a2.prototype.bytesPerElement=4,oS(a2,"StructArrayLayout2ui4");class a3 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s,l,u,c,h,p,d){let f=this.length;return this.resize(f+1),this.emplace(f,e,r,i,n,o,a,s,l,u,c,h,p,d)}emplace(e,r,i,n,o,a,s,l,u,c,h,p,d,f){let m=20*e,g=10*e;return this.int16[m+0]=r,this.int16[m+1]=i,this.int16[m+2]=n,this.int16[m+3]=o,this.int16[m+4]=a,this.float32[g+3]=s,this.float32[g+4]=l,this.float32[g+5]=u,this.float32[g+6]=c,this.int16[m+14]=h,this.uint32[g+8]=p,this.uint16[m+18]=d,this.uint16[m+19]=f,e}}a3.prototype.bytesPerElement=40,oS(a3,"StructArrayLayout5i4f1i1ul2ui40");class a5 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a,s)}emplace(e,r,i,n,o,a,s,l){let u=8*e;return this.int16[u+0]=r,this.int16[u+1]=i,this.int16[u+2]=n,this.int16[u+4]=o,this.int16[u+5]=a,this.int16[u+6]=s,this.int16[u+7]=l,e}}a5.prototype.bytesPerElement=16,oS(a5,"StructArrayLayout3i2i2i16");class a4 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,i,n,o)}emplace(e,r,i,n,o,a){let s=4*e,l=8*e;return this.float32[s+0]=r,this.float32[s+1]=i,this.float32[s+2]=n,this.int16[l+6]=o,this.int16[l+7]=a,e}}a4.prototype.bytesPerElement=16,oS(a4,"StructArrayLayout2f1f2i16");class a6 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,i,n)}emplace(e,r,i,n,o){let a=12*e,s=3*e;return this.uint8[a+0]=r,this.uint8[a+1]=i,this.float32[s+1]=n,this.float32[s+2]=o,e}}a6.prototype.bytesPerElement=12,oS(a6,"StructArrayLayout2ub2f12");class a8 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=3*e;return this.uint16[o+0]=r,this.uint16[o+1]=i,this.uint16[o+2]=n,e}}a8.prototype.bytesPerElement=6,oS(a8,"StructArrayLayout3ui6");class a9 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b){let w=this.length;return this.resize(w+1),this.emplace(w,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b)}emplace(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w){let E=30*e,S=15*e,T=60*e;return this.int16[E+0]=r,this.int16[E+1]=i,this.int16[E+2]=n,this.float32[S+2]=o,this.float32[S+3]=a,this.uint16[E+8]=s,this.uint16[E+9]=l,this.uint32[S+5]=u,this.uint32[S+6]=c,this.uint32[S+7]=h,this.uint16[E+16]=p,this.uint16[E+17]=d,this.uint16[E+18]=f,this.float32[S+10]=m,this.float32[S+11]=g,this.uint8[T+48]=_,this.uint8[T+49]=y,this.uint8[T+50]=v,this.uint32[S+13]=x,this.int16[E+28]=b,this.uint8[T+58]=w,e}}a9.prototype.bytesPerElement=60,oS(a9,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class a7 extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E,S,T,I,M,C,A,P,L,O){let D=this.length;return this.resize(D+1),this.emplace(D,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E,S,T,I,M,C,A,P,L,O)}emplace(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E,S,T,I,M,C,A,P,L,O,D){let R=20*e,k=40*e;return this.float32[R+0]=r,this.float32[R+1]=i,this.int16[k+4]=n,this.int16[k+5]=o,this.int16[k+6]=a,this.int16[k+7]=s,this.int16[k+8]=l,this.int16[k+9]=u,this.int16[k+10]=c,this.int16[k+11]=h,this.int16[k+12]=p,this.uint16[k+13]=d,this.uint16[k+14]=f,this.uint16[k+15]=m,this.uint16[k+16]=g,this.uint16[k+17]=_,this.uint16[k+18]=y,this.uint16[k+19]=v,this.uint16[k+20]=x,this.uint16[k+21]=b,this.uint16[k+22]=w,this.uint16[k+23]=E,this.uint16[k+24]=S,this.uint16[k+25]=T,this.uint16[k+26]=I,this.uint16[k+27]=M,this.uint32[R+14]=C,this.float32[R+15]=A,this.float32[R+16]=P,this.float32[R+17]=L,this.float32[R+18]=O,this.uint8[80*e+76]=D,e}}a7.prototype.bytesPerElement=80,oS(a7,"StructArrayLayout2f9i15ui1ul4f1ub80");class se extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[+e+0]=r,e}}se.prototype.bytesPerElement=4,oS(se,"StructArrayLayout1f4");class st extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,i,n,o)}emplace(e,r,i,n,o,a){let s=5*e;return this.float32[s+0]=r,this.float32[s+1]=i,this.float32[s+2]=n,this.float32[s+3]=o,this.float32[s+4]=a,e}}st.prototype.bytesPerElement=20,oS(st,"StructArrayLayout5f20");class sr extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a,s)}emplace(e,r,i,n,o,a,s,l){let u=7*e;return this.float32[u+0]=r,this.float32[u+1]=i,this.float32[u+2]=n,this.float32[u+3]=o,this.float32[u+4]=a,this.float32[u+5]=s,this.float32[u+6]=l,e}}sr.prototype.bytesPerElement=28,oS(sr,"StructArrayLayout7f28");class si extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,i,n)}emplace(e,r,i,n,o){let a=6*e;
15return this.uint32[3*e+0]=r,this.uint16[a+2]=i,this.uint16[a+3]=n,this.uint16[a+4]=o,e}}si.prototype.bytesPerElement=12,oS(si,"StructArrayLayout1ul3ui12");class sn extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[+e+0]=r,e}}sn.prototype.bytesPerElement=2,oS(sn,"StructArrayLayout1ui2");class so extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=3*e;return this.float32[o+0]=r,this.float32[o+1]=i,this.float32[o+2]=n,e}}so.prototype.bytesPerElement=12,oS(so,"StructArrayLayout3f12");class sa extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g){let _=this.length;return this.resize(_+1),this.emplace(_,e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g)}emplace(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_){let y=16*e;return this.float32[y+0]=r,this.float32[y+1]=i,this.float32[y+2]=n,this.float32[y+3]=o,this.float32[y+4]=a,this.float32[y+5]=s,this.float32[y+6]=l,this.float32[y+7]=u,this.float32[y+8]=c,this.float32[y+9]=h,this.float32[y+10]=p,this.float32[y+11]=d,this.float32[y+12]=f,this.float32[y+13]=m,this.float32[y+14]=g,this.float32[y+15]=_,e}}sa.prototype.bytesPerElement=64,oS(sa,"StructArrayLayout16f64");class ss extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a,s)}emplace(e,r,i,n,o,a,s,l){let u=10*e,c=5*e;return this.uint16[u+0]=r,this.uint16[u+1]=i,this.uint16[u+2]=n,this.uint16[u+3]=o,this.float32[c+2]=a,this.float32[c+3]=s,this.float32[c+4]=l,e}}ss.prototype.bytesPerElement=20,oS(ss,"StructArrayLayout4ui3f20");class sl extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.int16[+e+0]=r,e}}sl.prototype.bytesPerElement=2,oS(sl,"StructArrayLayout1i2");class su extends aU{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint8[+e+0]=r,e}}su.prototype.bytesPerElement=1,oS(su,"StructArrayLayout1ub1");class sc extends aB{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}sc.prototype.size=40;class sh extends a3{get(e){return new sc(this,e)}}oS(sh,"CollisionBoxArray");class sp extends aB{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}sp.prototype.size=60;class sd extends a9{get(e){return new sp(this,e)}}oS(sd,"PlacedSymbolArray");class sf extends aB{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}
15get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}sf.prototype.size=80;
15class sm extends a7{get(e){return new sf(this,e)}}oS(sm,"SymbolInstanceArray");class sg extends se{getoffsetX(e){return this.float32[+e+0]}}oS(sg,"GlyphOffsetArray");class s_ extends aG{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}oS(s_,"SymbolLineVertexArray");class sy extends aB{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}sy.prototype.size=12;class sv extends si{get(e){return new sy(this,e)}}oS(sv,"FeatureIndexArray");class sx extends a2{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}oS(sx,"FillExtrusionCentroidArray");let sb=aj([{name:"a_pos",components:2,type:"Int16"}],4),sw=aj([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class sE{constructor(e=[]){this.segments=e}_prepareSegment(e,r,i,n){let o=this.segments[this.segments.length-1];return e>sE.MAX_VERTEX_ARRAY_LENGTH&&tG(`Max vertices per segment is ${sE.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!o||o.vertexLength+e>sE.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==n)&&(o={vertexOffset:r,primitiveOffset:i,vertexLength:0,primitiveLength:0},void 0!==n&&(o.sortKey=n),this.segments.push(o)),o}prepareSegment(e,r,i,n){return this._prepareSegment(e,r.length,i.length,n)}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new sE([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}function sS(e,r){return 256*(e=tM(Math.floor(e),0,255))+tM(Math.floor(r),0,255)}sE.MAX_VERTEX_ARRAY_LENGTH=65535,oS(sE,"SegmentVector");let sT=aj([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),sI=aj([{name:"a_dash",components:4,type:"Uint16"}]);class sM{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(sC(e)),this.positions.push(r,i,n)}eachPosition(e,r){let i=sC(e),n=0,o=this.ids.length-1;for(;n<o;){let e=n+o>>1;this.ids[e]>=i?o=e:n=e+1}for(;this.ids[n]===i;)r(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return function e(r,i,n,o){for(;n<o;){let a=r[n+o>>1],s=n-1,l=o+1;for(;;){do s++;while(r[s]<a);do l--;while(r[l]>a);if(s>=l)break;sA(r,s,l),sA(i,3*s,3*l),sA(i,3*s+1,3*l+1),sA(i,3*s+2,3*l+2)}l-n<o-l?(e(r,i,n,l),n=l+1):(e(r,i,l+1,o),o=l)}}(i,n,0,i.length-1),r&&(r.add(i.buffer),r.add(n.buffer)),{ids:i,positions:n}}static deserialize(e){let r,i=new sM;for(let n of(i.ids=e.ids,i.positions=e.positions,i.ids))n!==r&&i.uniqueIds.push(n),r=n;return i.indexed=!0,i}}function sC(e){let r=+e;return!isNaN(r)&&Number.MIN_SAFE_INTEGER<=r&&r<=Number.MAX_SAFE_INTEGER?r:rq(String(e))}function sA(e,r,i){let n=e[r];e[r]=e[i],e[i]=n}oS(sM,"FeaturePositionMap");class sP{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,r){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,r),this.initialized=!0),!!this.location}set(e,r,i){throw Error("Uniform#set() must be implemented by each concrete Uniform")}}class sL extends sP{constructor(e){super(e),this.current=0}set(e,r,i){this.fetchUniformLocation(e,r)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}}class sO extends sP{constructor(e){super(e),this.current=0}set(e,r,i){this.fetchUniformLocation(e,r)&&this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class sD extends sP{constructor(e){super(e),this.current=[0,0]}set(e,r,i){this.fetchUniformLocation(e,r)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}}class sR extends sP{constructor(e){super(e),this.current=[0,0,0]}set(e,r,i){this.fetchUniformLocation(e,r)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}}class sk extends sP{constructor(e){super(e),this.current=[0,0,0,0]}set(e,r,i){this.fetchUniformLocation(e,r)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4f(this.location,i[0],i[1],i[2],i[3])))}}class sN extends sP{constructor(e){super(e),this.current=r1.transparent}set(e,r,i){this.fetchUniformLocation(e,r)&&(i.r===this.current.r&&i.g===this.current.g&&i.b===this.current.b&&i.a===this.current.a||(this.current=i,this.gl.uniform4f(this.location,i.r,i.g,i.b,i.a)))}}let sF=new Float32Array(16);class sz extends sP{constructor(e){super(e),this.current=sF}set(e,r,i){if(this.fetchUniformLocation(e,r)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}}let sB=new Float32Array(9),sU=new Float32Array(4);class sj extends sP{constructor(e){super(e),this.current=sU}set(e,r,i){if(this.fetchUniformLocation(e,r)){for(let e=0;e<4;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}}}function sV(e){return[sS(255*e.r,255*e.g),sS(255*e.b,255*e.a)]}class sG{constructor(e,r,i){this.value=e,this.uniformNames=r.map(e=>`u_${e}`),this.type=i}setUniform(e,r,i,n,o){r.set(e,o,n.constantOr(this.value))}getBinding(e,r){return"color"===this.type?new sN(e):new sO(e)}}class sq{constructor(e,r){this.uniformNames=r.map(e=>`u_${e}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,r,i,n,o){let a="u_pattern"===o||"u_dash"===o?this.pattern:"u_pixel_ratio"===o?this.pixelRatio:null;a&&r.set(e,o,a)}getBinding(e,r){return"u_pattern"===r||"u_dash"===r?new sk(e):new sO(e)}}class sH{constructor(e,r,i,n){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=r.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(e,r,i,n,o,a,s){let l=this.paintVertexArray.length,u=this.expression.evaluate(new au(0,{brightness:a}),r,{},o,n,s);this.paintVertexArray.resize(e),this._setPaintValue(l,e,u)}updatePaintArray(e,r,i,n,o,a,s){let l=this.expression.evaluate({zoom:0,brightness:s},i,n,void 0,o);this._setPaintValue(e,r,l)}_setPaintValue(e,r,i){if("color"===this.type){let n=sV(i);for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,n[0],n[1])}else{for(let n=e;n<r;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class s${constructor(e,r,i,n,o,a){this.expression=e,this.uniformNames=r.map(e=>`u_${e}_t`),this.type=i,this.useIntegerZoom=n,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,i,n,o,a,s){let l=this.expression.evaluate(new au(this.zoom,{brightness:a}),r,{},o,n,s),u=this.expression.evaluate(new au(this.zoom+1,{brightness:a}),r,{},o,n,s),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,l,u)}updatePaintArray(e,r,i,n,o,a,s){let l=this.expression.evaluate({zoom:this.zoom,brightness:s},i,n,void 0,o),u=this.expression.evaluate({zoom:this.zoom+1,brightness:s},i,n,void 0,o);this._setPaintValue(e,r,l,u)}_setPaintValue(e,r,i,n){if("color"===this.type){let o=sV(i),a=sV(n);for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,o[0],o[1],a[0],a[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r,i,n,o){let a=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,s=tM(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);r.set(e,o,s)}getBinding(e,r){return new sO(e)}}class sW{constructor(e,r,i,n,o){this.expression=e,this.layerId=o,this.paintVertexAttributes=("array"===i?sI:sT).members;for(let e=0;e<r.length;++e);this.paintVertexArray=new n}populatePaintArray(e,r,i){let n=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(n,e,r.patterns&&r.patterns[this.layerId],i)}updatePaintArray(e,r,i,n,o,a,s){this._setPaintValues(e,r,i.patterns&&i.patterns[this.layerId],a)}_setPaintValues(e,r,i,n){if(!n||!i)return;let o=n[i];if(!o)return;let{tl:a,br:s,pixelRatio:l}=o;for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,a[0],a[1],s[0],s[1],l)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class sY{constructor(e,r,i=()=>!0){this.binders={},this._buffers=[];const n=[];for(const o in e.paint._values){const a=e.paint.get(o);if(!i(o)||!(a instanceof ag&&oi(a.property.specification)))continue;const s=function(e,r){return sX[e]||[e.replace(`${r}
15-`,"").replace(/-/g,"_")]}(o,e.type),l=a.value,u=a.property.specification.type,c=!!a.property.useIntegerZoom,h="line-dasharray"===o||o.endsWith("pattern"),p="line-dasharray"===o&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==l.kind||p)if("source"===l.kind||p||h){const r=sJ(o,u,"source");this.binders[o]=h?new sW(l,s,u,r,e.id):new sH(l,s,u,r),n.push(`/a_${o}`)}else{const e=sJ(o,u,"composite");this.binders[o]=new s$(l,s,u,c,r,e),n.push(`/z_${o}`)}else this.binders[o]=h?new sq(l.value,s):new sG(l.value,s,u),n.push(`/u_${o}`)}this.cacheKey=n.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof sH||r instanceof s$?r.maxValue:0}populatePaintArrays(e,r,i,n,o,a,s){for(let l in this.binders){let u=this.binders[l];(u instanceof sH||u instanceof s$||u instanceof sW)&&u.populatePaintArray(e,r,i,n,o,a,s)}}setConstantPatternPositions(e){for(let r in this.binders){let i=this.binders[r];i instanceof sq&&i.setConstantPatternPositions(e)}}updatePaintArrays(e,r,i,n,o,a,s,l){let u=!1,c=Object.keys(e),h=0!==c.length,p=h?c:r.uniqueIds;for(let c in this.binders){let d=this.binders[c];if((d instanceof sH||d instanceof s$||d instanceof sW)&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){for(let i of(d.expression=o.paint.get(c).value,p)){let o=e[i.toString()];r.eachPosition(i,(e,r,i)=>{let u=n.feature(e);d.updatePaintArray(r,i,u,o,a,s,l)})}if(!h)for(let r of i.uniqueIds){let o=e[r.toString()];i.eachPosition(r,(e,r,i)=>{let u=n.feature(e);d.updatePaintArray(r,i,u,o,a,s,l)})}u=!0}}return u}defines(){let e=[];for(let r in this.binders){let i=this.binders[r];(i instanceof sG||i instanceof sq)&&e.push(...i.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof sH||i instanceof s$||i instanceof sW)for(let r=0;r<i.paintVertexAttributes.length;r++)e.push(i.paintVertexAttributes[r].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof sG||i instanceof sq||i instanceof s$)for(let r of i.uniformNames)e.push(r)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof sG||n instanceof sq||n instanceof s$)for(let o of n.uniformNames)r.push({name:o,property:i,binding:n.getBinding(e,o)})}return r}setUniforms(e,r,i,n,o){for(let{name:r,property:a,binding:s}of i)this.binders[a].setUniform(e,s,o,n.get(a),r)}updatePaintBuffers(){for(let e in this._buffers=[],this.binders){let r=this.binders[e];(r instanceof sH||r instanceof s$||r instanceof sW)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let r in this.binders){let i=this.binders[r];(i instanceof sH||i instanceof s$||i instanceof sW)&&i.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof sH||r instanceof s$||r instanceof sW)&&r.destroy()}}}class sZ{constructor(e,r,i=()=>!0){for(const n of(this.programConfigurations={},e))this.programConfigurations[n.id]=new sY(n,r,i);this.needsUpload=!1,this._featureMap=new sM,this._featureMapWithoutIds=new sM,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,r,i,n,o,a,s,l){for(let i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(e,r,n,o,a,s,l);void 0!==r.id?this._featureMap.add(r.id,i,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,i,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,i,n,o,a){for(let s of i)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,r,s,n,o,a||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}let sX={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["ga
15pwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]},sK={"line-pattern":{source:aX,composite:aX},"fill-pattern":{source:aX,composite:aX},"fill-extrusion-pattern":{source:aX,composite:aX},"line-dasharray":{source:aK,composite:aK}},sQ={color:{source:aZ,composite:aY},number:{source:se,composite:aZ}};function sJ(e,r,i){let n=sK[e];return n&&n[i]||sQ[r][i]}oS(sG,"ConstantBinder"),oS(sq,"PatternConstantBinder"),oS(sH,"SourceExpressionBinder"),oS(sW,"PatternCompositeBinder"),oS(s$,"CompositeExpressionBinder"),oS(sY,"ProgramConfiguration",{omit:["_buffers"]}),oS(sZ,"ProgramConfigurationSet");let s0=8192/Math.PI/2,s1=[64,32,16],s2=-s0;function s3(e,r,i,n=s0){return[e*Math.sin(i*=tb)*n,-r*n,e*Math.cos(i)*n]}function s5(e,r,i){return s3(Math.cos(e*tb),Math.sin(e*tb),r,i)}let s4=2*Math.PI*6371008.8;class s6{constructor(e,r){if(isNaN(e)||isNaN(r))throw Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new s6(tA(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r;return 6371008.8*Math.acos(Math.min(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r),1))}toBounds(e=0){let r=360*e/0x2637f09,i=r/Math.cos(Math.PI/180*this.lat);return new s8({lng:this.lng-i,lat:this.lat-r},{lng:this.lng+i,lat:this.lat+r})}toEcef(e){return s5(this.lat,this.lng,s0+e*s0/6371008.8)}static convert(e){if(e instanceof s6)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new s6(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new s6(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class s8{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof s6?new s6(e.lng,e.lat):s6.convert(e),this}setSouthWest(e){return this._sw=e instanceof s6?new s6(e.lng,e.lat):s6.convert(e),this}extend(e){let r,i,n=this._sw,o=this._ne;if(e instanceof s6)r=e,i=e;else{if(!(e instanceof s8))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(s8.convert(e)):this.extend(s6.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(s6.convert(e)):this;if(r=e._sw,i=e._ne,!r||!i)return this}return n||o?(n.lng=Math.min(r.lng,n.lng),n.lat=Math.min(r.lat,n.lat),o.lng=Math.max(i.lng,o.lng),o.lat=Math.max(i.lat,o.lat)):(this._sw=new s6(r.lng,r.lat),this._ne=new s6(i.lng,i.lat)),this}getCenter(){return new s6((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new s6(this.getWest(),this.getNorth())}getSouthEast(){return new s6(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:r,lat:i}=s6.convert(e),n=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(e){return!e||e instanceof s8?e:new s8(e)}}var s9={};function s7(e,r,i){var n=le(256*e,256*(r=Math.pow(2,i)-r-1),i),o=le(256*(e+1),256*(r+1),i);return n[0]+","+n[1]+","+o[0]+","+o[1]}function le(e,r,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[e*n-2*Math.PI*6378137/2,r*n-2*Math.PI*6378137/2]}s9.getURL=function(e,r,i,n,o,a){return a=a||{},e+"?"+["bbox="+s7(i,n,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+r].join("&")},s9.getTileBBox=s7,s9.getMercCoords=le,Object.defineProperty(s9,"__esMo
15dule",{value:!0});class lt{constructor(e,r,i){this.z=e,this.x=r,this.y=i,this.key=ln(0,e,e,r,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r){let i=s9.getTileBBox(this.x,this.y,this.z),n=function(e,r,i){let n,o="";for(let a=e;a>0;a--)o+=(r&(n=1<<a-1)?1:0)+(i&n?2:0);return o}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",i)}toString(){return`${this.z}/${this.x}/${this.y}`}}class lr{constructor(e,r){this.wrap=e,this.canonical=r,this.key=ln(e,r.z,r.z,r.x,r.y)}}class li{constructor(e,r,i,n,o){this.overscaledZ=e,this.wrap=r,this.canonical=new lt(i,+n,+o),this.key=0===r&&e===i?this.canonical.key:ln(r,e,i,n,o)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){let r=this.canonical.z-e;return e>this.canonical.z?new li(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new li(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r=!0){if(this.overscaledZ===e&&r)return this.key;if(e>this.canonical.z)return ln(this.wrap*r,e,this.canonical.z,this.canonical.x,this.canonical.y);{let i=this.canonical.z-e;return ln(this.wrap*r,e,e,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new li(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new li(r,this.wrap,r,i,n),new li(r,this.wrap,r,i+1,n),new li(r,this.wrap,r,i,n+1),new li(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new li(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new li(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new lr(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function ln(e,r,i,n,o){let a=1<<Math.min(i,22),s=o%a*a+n%a;return e&&i<22&&(s+=a*a*((e<0?-2*e-1:2*e)%(1<<2*(22-i)))),16*(32*s+i)+(r-i)}let lo=[e=>{let r=e.canonical.x-1,i=e.wrap;return r<0&&(r=(1<<e.canonical.z)-1,i--),new li(e.overscaledZ,i,e.canonical.z,r,e.canonical.y)},e=>{let r=e.canonical.x+1,i=e.wrap;return r===1<<e.canonical.z&&(r=0,i++),new li(e.overscaledZ,i,e.canonical.z,r,e.canonical.y)},e=>new li(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new li(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];function la(e){return s4*Math.cos(e*Math.PI/180)}function ls(e){return(180+e)/360}function ll(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}oS(lt,"CanonicalTileID"),oS(li,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});function lu(e){return 360*e-180}function lc(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function lh(e){return Math.cos(tM(e,-85.051129,85.051129)*tb)}function lp(e,r){let i=Math.pow(2,tM(r,0,25.5));return lh(e)*s4/(512*i)}function ld(e){return 1/Math.cos(e*Math.PI/180)}function lf(e,r=0){let i=Math.exp(Math.PI*(1-(e.y+r/8192)/(1<<e.z)*2));return 0x4c6fe12*i/(i*i+1)/8192/(1<<e.z)}class lm{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=s6.convert(e);return new lm(ls(i.lng),ll(i.lat),r/la(i.lat))}toLngLat(){return new s6(lu(this.x),lc(this.y))}toAltitude(){return this.z*la(lc(this.y))}meterInMercatorCoordinateUnits(){return 1/s4*ld(lc(this.y))}}function lg(e,r,i){let n=e[0],o=n.x,a=n.y;r(n);let s=[n];for(let l=1;l<e.length;l++){let u=e[l],{x:c,y:h}=u;r(u),function e(r,i,n,o,a,s,l,u,c){var h,p,d,f,m,g;let _,y,v=(i+o)/2,x=(n+a)/2,b=new tx(v,x);u(b),(h=b.x,p=b.y,d=s.x,f=s.y,m=l.x,g=l.y,_=d-m,y=f-g,Math.abs((f-p)*_
15-(d-h)*y)/Math.hypot(_,y)>=c)?(e(r,i,n,v,x,s,b,u,c),e(r,v,x,o,a,b,l,u,c)):r.push(l)}(s,o,a,c,h,n,u,r,i),o=c,a=h,n=u}return s}let l_=-16383-1;function ly(e,r,i){let n=e.loadGeometry(),o=e.extent,a=8192/o;if(r&&i&&i.projection.isReprojectedInTileSpace){let a=1<<r.z,{scale:s,x:l,y:u,projection:c}=i,h=e=>{let i=lu((r.x+e.x/o)/a),n=lc((r.y+e.y/o)/a),h=c.project(i,n);e.x=(h.x*s-l)*o,e.y=(h.y*s-u)*o};for(let r=0;r<n.length;r++)if(1!==e.type)n[r]=lg(n[r],h,1);else{let e=[];for(let i of n[r])i.x<0||i.x>=o||i.y<0||i.y>=o||(h(i),e.push(i));n[r]=e}}for(let e of n)for(let r of e)!function(e,r){let i=Math.round(e.x*r),n=Math.round(e.y*r);e.x=tM(i,l_,16383),e.y=tM(n,l_,16383),(i<e.x||i>e.x+1||n<e.y||n>e.y+1)&&tG("Geometry exceeds allowed extent, reduce your vector tile buffer size")}(r,a);return n}function lv(e,r){return{type:e.type,id:e.id,properties:e.properties,geometry:r?ly(e):[]}}function lx(e,r,i,n,o){e.emplaceBack(2*r+(n+1)/2,2*i+(o+1)/2)}function lb(e,r,i){e.emplaceBack(r.x,r.y,r.z,16384*i[0],16384*i[1],16384*i[2])}class lw{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new aG,this.indexArray=new a8,this.segments=new sE,this.programConfigurations=new sZ(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,r,i,n){let o=this.layers[0],a=[],s=null;for(let{feature:r,id:l,index:u,sourceLayerIndex:c}of("circle"===o.type&&(s=o.layout.get("circle-sort-key")),e)){let e=this.layers[0]._featureFilter.needGeometry,o=lv(r,e);if(!this.layers[0]._featureFilter.filter(new au(this.zoom),o,i))continue;let h=s?s.evaluate(o,{},i):void 0,p={id:l,properties:r.properties,type:r.type,sourceLayerIndex:c,index:u,geometry:e?o.geometry:ly(r,i,n),patterns:{},sortKey:h};a.push(p)}s&&a.sort((e,r)=>e.sortKey-r.sortKey);let l=null;for(let o of("globe"===n.projection.name&&(this.globeExtVertexArray=new aQ,l=n.projection),a)){let{geometry:n,index:a,sourceLayerIndex:s}=o,u=e[a].feature;this.addFeature(o,n,a,r.availableImages,i,l,r.brightness),r.featureIndex.insert(u,n,a,s,this.index)}}update(e,r,i,n,o){let a=0!==Object.keys(e).length;a&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,r,a?this.stateDependentLayers:this.layers,i,n,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,sw.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,r,i,n,o,a,s){for(let i of r)for(let r of i){let i=r.x,n=r.y;if(i<0||i>=8192||n<0||n>=8192)continue;if(a){let e=a.projectTilePoint(i,n,o),r=a.upVector(o,i,n),s=this.globeExtVertexArray;lb(s,e,r),lb(s,e,r),lb(s,e,r),lb(s,e,r)}let s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),l=s.vertexLength;lx(this.layoutVertexArray,i,n,-1,-1),lx(this.layoutVertexArray,i,n,1,-1),lx(this.layoutVertexArray,i,n,1,1),lx(this.layoutVertexArray,i,n,-1,1),this.indexArray.emplaceBack(l,l+1,l+2),this.indexArray.emplaceBack(l,l+2,l+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{},n,o,s)}}function lE(e,r){for(let i=0;i<e.length;i++)if(lA(r,e[i]))return!0;for(let i=0;i<r.length;i++)if(lA(e,r[i]))return!0;return!!lT(e,r)}function lS(e,r){if(1===e.length)return lC(r,e[0]);for(let i=0;i<r.length;i++){let n=r[i];for(let r=0;r<n.length;r++)if(lA(e,n[r]))return!0}for(let i=0;i<e.length;i++)if(lC(r,e[i]))return!0;for(let i=0;i<r.length;i++)if(lT(e,r[i]))return!0;return!1}function lT(e,r){if(0===e.length||0===r.length)return!1;for(let s=0;s<e.length-1;s++){let l=e[s],u=e[s+1];for(let e=0;e<r.length-1;e++){var i,n,o,a;if(i=l,n=u,o=r[e],tq(i,o,a=r[e+1])!==tq(n,o,a)&&tq(i,n,o)!==tq(i,n,a))return!0}}return!1}function lI(e,r,i){let n=i*i;if(1===r.length)return e.distSqr(r[0])<n;for(let i=1;i<r.length;
15i++)if(lM(e,r[i-1],r[i])<n)return!0;return!1}function lM(e,r,i){let n=r.distSqr(i);if(0===n)return e.distSqr(r);let o=((e.x-r.x)*(i.x-r.x)+(e.y-r.y)*(i.y-r.y))/n;return e.distSqr(o<0?r:o>1?i:i.sub(r)._mult(o)._add(r))}function lC(e,r){let i,n,o,a=!1;for(let s=0;s<e.length;s++){i=e[s];for(let e=0,s=i.length-1;e<i.length;s=e++)n=i[e],o=i[s],n.y>r.y!=o.y>r.y&&r.x<(o.x-n.x)*(r.y-n.y)/(o.y-n.y)+n.x&&(a=!a)}return a}function lA(e,r){let i=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){let a=e[n],s=e[o];a.y>r.y!=s.y>r.y&&r.x<(s.x-a.x)*(r.y-a.y)/(s.y-a.y)+a.x&&(i=!i)}return i}function lP(e,r,i,n,o){for(let a of e)if(r<=a.x&&i<=a.y&&n>=a.x&&o>=a.y)return!0;let a=[new tx(r,i),new tx(r,o),new tx(n,o),new tx(n,i)];if(e.length>2){for(let r of a)if(lA(e,r))return!0}for(let r=0;r<e.length-1;r++)if(function(e,r,i){let n=i[0],o=i[2];if(e.x<n.x&&r.x<n.x||e.x>o.x&&r.x>o.x||e.y<n.y&&r.y<n.y||e.y>o.y&&r.y>o.y)return!1;let a=tq(e,r,i[0]);return a!==tq(e,r,i[1])||a!==tq(e,r,i[2])||a!==tq(e,r,i[3])}(e[r],e[r+1],a))return!0;return!1}function lL(e,r,i,n,o,a){let s=r.y-e.y,l=e.x-r.x;if(a=a||0){let e=s*s+l*l;if(0===e)return!0;let r=Math.sqrt(e);s/=r,l/=r}return!((i.x-e.x)*s+(i.y-e.y)*l-a<0||(n.x-e.x)*s+(n.y-e.y)*l-a<0||(o.x-e.x)*s+(o.y-e.y)*l-a<0)}function lO(e,r,i,n,o,a,s){return!(lL(e,r,n,o,a,s)||lL(r,i,n,o,a,s)||lL(i,e,n,o,a,s)||lL(n,o,e,r,i,s)||lL(o,a,e,r,i,s)||lL(a,n,e,r,i,s))}function lD(e,r,i){let n=r.paint.get(e).value;return"constant"===n.kind?n.value:i.programConfigurations.get(r.id).getMaxValue(e)}function lR(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function lk(e,r,i,n,o){if(!r[0]&&!r[1])return e;let a=tx.convert(r)._mult(o);"viewport"===i&&a._rotate(-n);let s=[];for(let r=0;r<e.length;r++)s.push(e[r].sub(a));return s}function lN(e,r,i,n){let o=tx.convert(e)._mult(n);return"viewport"===r&&o._rotate(-i),o}oS(lw,"CircleBucket",{omit:["layers"]});let lF=new ab({"circle-sort-key":new av(aS.layout_circle["circle-sort-key"]),visibility:new ay(aS.layout_circle.visibility)});var lz={paint:new ab({"circle-radius":new av(aS.paint_circle["circle-radius"]),"circle-color":new av(aS.paint_circle["circle-color"]),"circle-blur":new av(aS.paint_circle["circle-blur"]),"circle-opacity":new av(aS.paint_circle["circle-opacity"]),"circle-translate":new ay(aS.paint_circle["circle-translate"]),"circle-translate-anchor":new ay(aS.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ay(aS.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ay(aS.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new av(aS.paint_circle["circle-stroke-width"]),"circle-stroke-color":new av(aS.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new av(aS.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new ay(aS.paint_circle["circle-emissive-strength"])}),layout:lF};class lB{constructor(e,r){this.pos=e,this.dir=r}intersectsPlane(r,i,n){let o=e.Q.dot(i,this.dir);if(1e-6>Math.abs(o))return!1;let a=((r[0]-this.pos[0])*i[0]+(r[1]-this.pos[1])*i[1]+(r[2]-this.pos[2])*i[2])/o;return n[0]=this.pos[0]+this.dir[0]*a,n[1]=this.pos[1]+this.dir[1]*a,n[2]=this.pos[2]+this.dir[2]*a,!0}closestPointOnSphere(r,i,n){if(e.Q.equals(this.pos,r)||0===i)return n[0]=n[1]=n[2]=0,!1;let[o,a,s]=this.dir,l=this.pos[0]-r[0],u=this.pos[1]-r[1],c=this.pos[2]-r[2],h=o*o+a*a+s*s,p=2*(l*o+u*a+c*s),d=p*p-4*h*(l*l+u*u+c*c-i*i);if(d<0){let e=Math.max(-p/2,0),r=l+o*e,h=u+a*e,d=c+s*e,f=Math.hypot(r,h,d);return n[0]=r*i/f,n[1]=h*i/f,n[2]=d*i/f,!1}{let e=(-p-Math.sqrt(d))/(2*h);if(e<0){let e=Math.hypot(l,u,c);return n[0]=l*i/e,n[1]=u*i/e,n[2]=c*i/e,!1}return n[0]=l+o*e,n[1]=u+a*e,n[2]=c+s*e,!0}}}class lU{constructor(e,r,i,n,o){this.TL=e,this.TR=r,this.BR=i,this.BL=n,this.horizon=o}static fromInvProjectionMatrix(r,i,n){let o=[-1,1,1],a=[1,1,1],s=[1,-1,1],l=[-1,-1,1];return new lU(e.Q.transformMat4(o,o,r),e.Q.transformMat4(a,a,r),e.Q.transformMat4(s,s,r),e.Q.transformMat4(l,l,r),i/n)}}function lj(r,i,n){let o=1/0,a=-1/0,s=[];for(let l of r){e.Q.sub(s,l,i);let r=e.Q.dot(s,n);o=Math.min(o,r),a=Math.max(a,r)}return[o,a]}function lV(r,i){let n=!0;for(let o=0;o<r.planes.length;o++){let a=r.planes[o],s=0;for(let r=0;r<i.length;r++)s+=e.Q.dot(a,i[r])+a[3]>=0;if(0===s)return 0;s!==i.length&&(n=!1)}return n?2:1}function lG(e,r){for(let i of e.projections){let n=lj(r,e.points[0],i.axis);if(i.projection[1]<n[0]||i.projection[0]>n[1])return 0}return 1}function lq(r,i){let n=0,o=[0,0,0,0];for(let a=0;a<r.length;a++)o[0]=r[a][0],o[1]=r[a][1],o[2]=r[a][2],o[3]=1,e.aa.dot(o,i)>=0&&n++;return n}class lH{constructor(r,i){for(const n of(this.points=r||Array(8).fill([0,0,0]),this.planes=i||Array(6).fill([
150,0,0,0]),this.bounds=l$.fromPoints(this.points),this.projections=[],this.frustumEdges=[e.Q.sub([],this.points[2],this.points[3]),e.Q.sub([],this.points[0],this.points[3]),e.Q.sub([],this.points[4],this.points[0]),e.Q.sub([],this.points[5],this.points[1]),e.Q.sub([],this.points[6],this.points[2]),e.Q.sub([],this.points[7],this.points[3])],this.frustumEdges)){const e=[0,-n[2],n[1]],r=[n[2],0,-n[0]];this.projections.push({axis:e,projection:lj(this.points,this.points[0],e)}),this.projections.push({axis:r,projection:lj(this.points,this.points[0],r)})}}static fromInvProjectionMatrix(r,i,n,o){let a=Math.pow(2,n),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(n=>{let s=e.aa.transformMat4([],n,r),l=1/s[3]/i*a;return e.aa.mul(s,s,[l,l,o?1/s[3]:l,l])}),l=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(r=>{let i=e.Q.sub([],s[r[0]],s[r[1]]),n=e.Q.sub([],s[r[2]],s[r[1]]),o=e.Q.normalize([],e.Q.cross([],i,n)),a=-e.Q.dot(o,s[r[1]]);return o.concat(a)}),u=[];for(let e=0;e<s.length;e++)u.push([s[e][0],s[e][1],s[e][2]]);return new lH(u,l)}intersectsPrecise(r,i,n){for(let e=0;e<i.length;e++)if(!lq(r,i[e]))return 0;for(let e=0;e<this.planes.length;e++)if(!lq(r,this.planes[e]))return 0;for(let i of n)for(let n of this.frustumEdges){let o=e.Q.cross([],i,n),a=e.Q.length(o);if(0===a)continue;e.Q.scale(o,o,1/a);let s=lj(this.points,this.points[0],o),l=lj(r,this.points[0],o);if(s[0]>l[1]||l[0]>s[1])return 0}return 1}}class l${static fromPoints(r){let i=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(let o of r)e.Q.min(i,i,o),e.Q.max(n,n,o);return new l$(i,n)}static fromTileIdAndHeight(e,r,i){let n=1<<e.canonical.z,o=e.canonical.x,a=e.canonical.y;return new l$([o/n,a/n,r],[(o+1)/n,(a+1)/n,i])}static applyTransform(r,i){let n=r.getCorners();for(let r=0;r<n.length;++r)e.Q.transformMat4(n[r],n[r],i);return l$.fromPoints(n)}static projectAabbCorners(r,i){let n=r.getCorners();for(let r=0;r<n.length;++r)e.Q.transformMat4(n[r],n[r],i);return n}constructor(r,i){this.min=r,this.max=i,this.center=e.Q.scale([],e.Q.add([],this.min,this.max),.5)}quadrant(r){let i=[r%2==0,r<2],n=e.Q.clone(this.min),o=e.Q.clone(this.max);for(let e=0;e<i.length;e++)n[e]=i[e]?this.min[e]:this.center[e],o[e]=i[e]?this.center[e]:this.max[e];return o[2]=this.max[2],new l$(n,o)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){let e=this.min,r=this.max;return[[e[0],e[1],e[2]],[r[0],e[1],e[2]],[r[0],r[1],e[2]],[e[0],r[1],e[2]],[e[0],e[1],r[2]],[r[0],e[1],r[2]],[r[0],r[1],r[2]],[e[0],r[1],r[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?lV(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?lV(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,r){return r||this.intersects(e)?lG(e,this.getCorners()):0}intersectsPreciseFlat(e,r){return r||this.intersectsFlat(e)?lG(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let r=0;r<3;++r)if(this.min[r]>e.max[r]||e.min[r]>this.max[r])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let r=0;r<3;r++)this.min[r]=Math.min(this.min[r],e.min[r]),this.max[r]=Math.max(this.max[r],e.max[r])}encapsulatePoint(e){for(let r=0;r<3;r++)this.min[r]=Math.min(this.min[r],e[r]),this.max[r]=Math.max(this.max[r],e[r])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}oS(l$,"Aabb");let{members:lW}=aj([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),lY=aj([{name:"a_pos_3",components:3,type:"Int16"}]);var lZ=aj([{name:"a_pos",type:"Int16",components:2}]);function lX(e){return e*s0/6371008.8}let lK=[new l$([s2,s2,s2],[s0,s0,s0]),new l$([s2,s2,s2],[0,0,s0]),new l$([0,s2,s2],[s0,0,s0]),new l$([s2,0,s2],[0,s0,s0]),new l$([0,0,s2],[s0,s0,s0])];function lQ(r,i,n,o=!0){let a,s=e.Q.scale([],r._camera.position,r.worldSize),l=[i,n,1,1];e.aa.transformMat4(l,l,r.pixelMatrixInverse),e.aa.scale(l,l,1/l[3]);let u=e.Q.sub([],l,s),c=e.Q.normalize([],u),h=r.globeMatrix,p=[h[12],h[13],h[14]],d=e.Q.sub([],p,s),f=e.Q.length(d),m=e.Q.normalize([],d),g=r.worldSize/(2*Math.PI),_=e.Q.dot(m,c),y=Math.asin(g/f);
15if(y<Math.acos(_)){if(!o)return null;let r=[],i=[];e.Q.scale(r,c,f/_),e.Q.normalize(i,e.Q.sub(i,r,d)),e.Q.normalize(c,e.Q.add(c,d,e.Q.scale(c,i,Math.tan(y)*f)))}let v=[];new lB(s,c).closestPointOnSphere(p,g,v);let x=e.Q.normalize([],t2(h,0)),b=e.Q.normalize([],t2(h,1)),w=e.Q.normalize([],t2(h,2)),E=e.Q.dot(x,v),S=e.Q.dot(b,v),T=e.Q.dot(w,v),I=Math.asin(-S/g)*tw,M=Math.atan2(E,T)*tw;return new lm(ls(M=r.center.lng+((a=(M-r.center.lng+180)%360-180)<-180?a+360:a)),tM(ll(I),0,1))}class lJ{constructor(r,i,n){this.a=e.Q.sub([],r,n),this.b=e.Q.sub([],i,n),this.center=n;const o=e.Q.normalize([],this.a),a=e.Q.normalize([],this.b);this.angle=Math.acos(e.Q.dot(o,a))}}function l0(e,r){var i,n,o,a;let s,l;return 0===e.angle?null:(s=0===e.a[r]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[r]/e.a[r]/Math.sin(e.angle)-1/Math.tan(e.angle)))<0||s>1?null:(i=e.a[r],n=e.b[r],o=e.angle,a=tM(s,0,1),l=Math.sin(o),Math.sin((1-a)*o)/l*i+Math.sin(a*o)/l*n+e.center[r])}function l1(e){if(e.z<=1)return lK[e.z+2*e.y+e.x];let r=l6(l4(e));return l$.fromPoints(r)}function l2(r,i,n){return e.Q.scale(r,r,1-n),e.Q.scaleAndAdd(r,r,i,n)}function l3(r,i,n){for(let o of r)e.Q.transformMat4(o,o,i),e.Q.scale(o,o,n)}function l5(r,i,n,o){let a=i/r.worldSize,s=r.globeMatrix;if(n.z<=1){let e=l1(n).getCorners();return l3(e,s,a),l$.fromPoints(e)}let l=l4(n,o),u=l6(l,s0+lX(r._tileCoverLift));l3(u,s,a);let c=Number.MAX_VALUE,h=[-c,-c,-c],p=[c,c,c];if(l.contains(r.center)){for(let r of u)e.Q.min(p,p,r),e.Q.max(h,h,r);h[2]=0;let i=r.point,n=[i.x*a,i.y*a,0];return e.Q.min(p,p,n),e.Q.max(h,h,n),new l$(p,h)}if(r._tileCoverLift>0){for(let r of u)e.Q.min(p,p,r),e.Q.max(h,h,r);return new l$(p,h)}let d=[s[12]*a,s[13]*a,s[14]*a],f=l.getCenter(),m=tM(r.center.lat,-85.051129,85.051129),g=tM(f.lat,-85.051129,85.051129),_=ls(r.center.lng),y=ll(m),v=_-ls(f.lng),x=y-ll(g);v>.5?v-=1:v<-.5&&(v+=1);let b=0;if(Math.abs(v)>Math.abs(x))b=v>=0?1:3;else{b=x>=0?0:2;let r=[s[4]*a,s[5]*a,s[6]*a],i=-Math.sin((x>=0?l.getSouth():l.getNorth())*tb)*s0;e.Q.scaleAndAdd(d,d,r,i)}let w=u[b],E=u[(b+1)%4],S=new lJ(w,E,d),T=[l0(S,0)||w[0],l0(S,1)||w[1],l0(S,2)||w[2]],I=uo(r.zoom);if(I>0){let o=function({x:e,y:r,z:i},n,o,a,s){let l=1/(1<<i),u=e*l,c=u+l,h=r*l,p=h+l,d=0,f=(u+c)/2-a;return f>.5?d=-1:f<-.5&&(d=1),u=((u+d)*n-(a*=n))*o+a,c=((c+d)*n-a)*o+a,h=(h*n-(s*=n))*o+s,[[u,p=(p*n-s)*o+s,0],[c,p,0],[c,h,0],[u,h,0]]}(n,i,r._pixelsPerMercatorPixel,_,y);for(let e=0;e<u.length;e++)l2(u[e],o[e],I);let a=e.Q.add([],o[b],o[(b+1)%4]);e.Q.scale(a,a,.5),l2(T,a,I)}for(let r of u)e.Q.min(p,p,r),e.Q.max(h,h,r);return p[2]=Math.min(w[2],E[2]),e.Q.min(p,p,T),e.Q.max(h,h,T),new l$(p,h)}function l4({x:e,y:r,z:i},n=!1){let o=1/(1<<i);return new s8(new s6(lu(e*o),r===(1<<i)-1&&n?-90:lc((r+1)*o)),new s6(lu((e+1)*o),0===r&&n?90:lc(r*o)))}function l6(e,r=s0){let i=e.getNorth()*tb,n=e.getSouth()*tb,o=Math.cos(i),a=Math.cos(n),s=Math.sin(i),l=Math.sin(n),u=e.getWest(),c=e.getEast();return[s3(a,l,u,r),s3(a,l,c,r),s3(o,s,c,r),s3(o,s,u,r)]}function l8(e,r,i,n){let o=1<<i.z,a=(e/8192+i.x)/o;return s5(lc((r/8192+i.y)/o),lu(a),n)}function l9({min:e,max:r}){return 16383/Math.max(r[0]-e[0],r[1]-e[1],r[2]-e[2])}let l7=new Float64Array(16);function ue(r){let i=l9(r),n=e.a9.fromScaling(l7,[i,i,i]);return e.a9.translate(n,n,e.Q.negate([],r.min))}function ut(r){let i=e.a9.fromTranslation(l7,r.min),n=1/l9(r);return e.a9.scale(i,i,[n,n,n])}function ur(e){return e/(2*Math.PI)/(8192/(2*Math.PI))}function ui(e,r){return 8192/(512*Math.pow(2,e))*l9(l1(r))}function un(r,i,n,o,a){let s=ur(n),l=[r,i,-n/(2*Math.PI)],u=e.a9.identity(new Float64Array(16));return e.a9.translate(u,u,l),e.a9.scale(u,u,[s,s,s]),e.a9.rotateX(u,u,-a*tb),e.a9.rotateY(u,u,-o*tb),u}function uo(e){return tC(5,6,e)}function ua(r,i){let n,o,a,s,l,u=s5(i.lat,i.lng),c=(n=s5(r._center.lat,r._center.lng),o=e.Q.fromValues(0,1,0),a=e.Q.cross([],o,n),s=e.a9.fromRotation([],-r.angle,n),a=e.Q.transformMat4(a,a,s),e.a9.fromRotation(s,-r._pitch,a),l=e.Q.normalize([],n),e.Q.scale(l,l,lX(r.cameraToCenterDistance/r.pixelsPerMeter)),e.Q.transformMat4(l,l,s),e.Q.add([],n,l)),h=e.Q.subtract([],c,u);return e.Q.angle(h,u)}function us(e,r){return ua(e,r)>Math.PI/2*1.01}let ul=85*tb,uu=Math.cos(ul),uc=Math.sin(ul),uh=e.a9.create(),up=e=>{let r=[];return"map"===e.paint.get("circle-pitch-alignment")&&r.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&r.push("SCALE_WITH_MAP"),r};function ud(r,i,n,o,a,s,l,u,c){if(s&&r.queryGeometry.isAboveHorizon)return!1;s&&(c*=r.pixelToTileUnitsFactor);let h=r.tileID.canonical,p=n.projection.upVectorScale(h,n.center.lat,n.worldSize).metersToTile;for(let f of i)for(let i of f){var d;let f=i.add(u),m=a&&n.elevation?n.elevation.exaggeration()*a.getElevationAt(f.x,f.y,!0):0,g=n.projection.projectTilePoint(f.x,f.y,h);if(m>0){let e=n.projection.upVector(h,f.x,f.y);g.x+=e[0]*p*m,g.y+=e[1]*p*m,g.z+=e[2]*p*m}let _=s?f:function(r,i,n,o){let a=e.aa.transformMat4([],[r,i,n,1],o);return new tx(a[0]/a[3],a[1]/a[3])}(g.x,g.y,g.z,o),y=s?r.tilespaceRays.map(r=>(function(r,i){let n=e.Q.create();return uf[2]=i,r.intersectsPlane(uf,um,n),new tx(n[0],n[1])})(r,m)):r.queryGeometry.screenGeometry,v=e.aa.transformMat4([],[g.x,g.y,g.z,1],o);if(!l&&s?c*=v[3]/n.cameraToCenterDistance:l&&!s&&(c*=n.cameraToCenterDistance/v[3]),s){let e=lc((i.y/8192+h.y)/(1<<h.z));c/=n.projection.pixelsPerMeter(e,1)/(1/la(e))}if(d=c,lA(y,_)||lI(_,y,d))return!0}return!1}let uf=e.Q.fromValues(0,0,0),um=e.Q.fromValues(0,0,1);class ug extends lw{}function u_(e,{width:r,height:i},n,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==r*i*n)throw RangeError("mismatched image size")}else o=new Uint8Array(r*i*n);return e.width=r,e.height=i,e.data=o,e}function uy(e,r,i){let{width:n,height:o}=r;n===e.width&&o===e.height||(uv(e,r,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,o)},i),e.width=n,e.height=o,e.data=r.data)}
15function uv(e,r,i,n,o,a,s){if(0===o.width||0===o.height)return r;if(o.width>e.width||o.height>e.height||i.x>e.width-o.width||i.y>e.height-o.height)throw RangeError("out of range source coordinates for image copy");if(o.width>r.width||o.height>r.height||n.x>r.width-o.width||n.y>r.height-o.height)throw RangeError("out of range destination coordinates for image copy");let l=e.data,u=r.data,c=4===a&&s;for(let s=0;s<o.height;s++){let h=((i.y+s)*e.width+i.x)*a,p=((n.y+s)*r.width+n.x)*a;if(c)for(let e=0;e<o.width;e++){let r=h+e*a+3,i=p+e*a;u[i+0]=255,u[i+1]=255,u[i+2]=255,u[i+3]=l[r]}else for(let e=0;e<o.width*a;e++)u[p+e]=l[h+e]}return r}oS(ug,"HeatmapBucket",{omit:["layers"]});class ux{constructor(e,r){u_(this,e,1,r)}resize(e){uy(this,new ux(e),1)}clone(){return new ux({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,o){uv(e,r,i,n,o,1)}}class ub{constructor(e,r){u_(this,e,4,r)}resize(e){uy(this,new ub(e),4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new ub({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,o,a){uv(e,r,i,n,o,4,a)}}class uw{constructor(e,r){this.width=e.width,this.height=e.height,this.data=r instanceof Uint8Array?new Float32Array(r.buffer):r}}oS(ux,"AlphaImage"),oS(ub,"RGBAImage");let uE=new ab({visibility:new ay(aS.layout_heatmap.visibility)});var uS={paint:new ab({"heatmap-radius":new av(aS.paint_heatmap["heatmap-radius"]),"heatmap-weight":new av(aS.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ay(aS.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ax(aS.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ay(aS.paint_heatmap["heatmap-opacity"])}),layout:uE};function uT(e){let r={},i=e.resolution||256,n=e.clips?e.clips.length:1,o=e.image||new ub({width:i,height:n}),a=(i,n,a)=>{r[e.evaluationKey]=a;let s=e.expression.evaluate(r);s&&(o.data[i+n+0]=Math.floor(255*s.r/s.a),o.data[i+n+1]=Math.floor(255*s.g/s.a),o.data[i+n+2]=Math.floor(255*s.b/s.a),o.data[i+n+3]=Math.floor(255*s.a))};if(e.clips)for(let r=0,o=0;r<n;++r,o+=4*i)for(let n=0,s=0;n<i;n++,s+=4){let l=n/(i-1),{start:u,end:c}=e.clips[r];a(o,s,u*(1-l)+c*l)}else for(let e=0,r=0;e<i;e++,r+=4)a(0,r,e/(i-1));return o}let uI=new ab({visibility:new ay(aS.layout_hillshade.visibility)});var uM={paint:new ab({"hillshade-illumination-direction":new ay(aS.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ay(aS.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ay(aS.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ay(aS.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ay(aS.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ay(aS.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new ay(aS.paint_hillshade["hillshade-emissive-strength"])}),layout:uI};let{members:uC}=aj([{name:"a_pos",components:2,type:"Int16"}],4);var uA={exports:{}};function uP(e,r,i){i=i||2;var n,o,a,s,l,u,c,h=r&&r.length,p=h?r[0]*i:e.length,d=uL(e,0,p,i,!0),f=[];if(!d||d.next===d.prev)return f;if(h&&(d=function(e,r,i,n){var o,a,s,l=[];for(o=0,a=r.length;o<a;o++)(s=uL(e,r[o]*n,o<a-1?r[o+1]*n:e.length,n,!1))===s.next&&(s.steiner=!0),l.push(function(e){var r=e,i=e;do(r.x<i.x||r.x===i.x&&r.y<i.y)&&(i=r),r=r.next;while(r!==e);return i}(s));for(l.sort(uD),o=0;o<l.length;o++)i=function(e,r){var i=function(e,r){var i,n,o,a=r,s=e.x,l=e.y,u=-1/0;do{if(l<=a.y&&l>=a.next.y&&a.next.y!==a.y){var c=a.x+(l-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(c<=s&&c>u&&(u=c,o=a.x<a.next.x?a:a.next,c===s))return o}a=a.next}while(a!==r);if(!o)return null;var h,p=o,d=o.x,f=o.y,m=1/0;a=o;do{s>=a.x&&a.x>=d&&s!==a.x&&uk(l<f?s:u,l,d,f,l<f?u:s,l,a.x,a.y)&&(h=Math.abs(l-a.y)/(s-a.x),uj(a,e)&&(h<m||h===m&&(a.x>o.x||a.x===o.x&&(i=o,n=a,0>uN(i.prev,i,n.prev)&&0>uN(n.next,i,i.next))))&&(o=a,m=h)),a=a.next}while(a!==p);return o}(e,r);if(!i)return r;var n=uV(i,e);return uO(n,n.next),uO(i,i.next)}(l[o],i);return i}(e,r,d,i)),e.length>80*i){n=a=e[0],o=s=e[1];for(var m=i;m<p;m+=i)(l=e[m])<n&&(n=l),(u=e[m+1])<o&&(o=u),l>a&&(a=l),u>s&&(s=u);c=0!==(c=Math.max(a-n,s-o))?32767/c:0}return function e(r,i,n,o,a,s,l){if(r){!l&&s&&function(e,r,i,n){var o=e;do 0===o.z&&(o.z=uR(o.x,o.y,r,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var r,i,n,o,a,s,l,u,c=1;do{for(i=e,e=null,a=null,s=0;i;){for(s++,n=i,l=0,r=0;r<c&&(l++,n=n.nextZ);r++);for(u=c;l>0||u>0&&n;)0!==l&&(0===u||!n||i.z<=n.z)?(o=i,i=i.nextZ,l--):(o=n,n=n.nextZ,u--),a?a.nextZ=o:e=o,o.prevZ=a,a=o;i=n}a.nextZ=null,c*=2}while(s>1)}(o)}(r,o,a,s);for(var u,c,h=r;r.prev!==r.next;)if(u=r.prev,c=r.next,s?function(e,r,i,n){var o=e.prev,a=e.next;if(uN(o,e,a)>=0)return!1;for(var s=o.x,l=e.x,u=a.x,c=o.y,h=e.y,p=a.y,d=s<l?s<u?s:u:l<u?l:u,f=c<h?c<p?c:p:h<p?h:p,m=s>l?s>u?s:u:l>u?l:u,g=c>h?c>p?c:p:h>p?h:p,_=uR(d,f,r,i,n),y=uR(m,g,r,i,n),v=e.prevZ,x=e.nextZ;v&&v.z>=_&&x&&x.z<=y;){if(v.x>=d&&v.x<=m&&v.y>=f&&v.y<=g&&v!==o&&v!==a&&uk(s,c,l,h,u,p,v.x,v.y)&&uN(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==o&&x!==a&&uk(s,c,l,h,u,p,x.x,x.y)&&uN(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=_;){if(v.x>=d&&v.x<=m&&v.y>=f&&v.y<=g&&v!==o&&v!==a&&uk(s,c,l,h,u,p,v.x,v.y)&&uN(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==o&&x!==a&&uk(s,c,l,h,u,p,x.x,x.y)&&uN(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}(r,o,a,s):function(e){var r=e.prev,i=e.next;if(uN(r,e,i)>=0)return!1;for(var n=r.x,o=e.x,a=i.x,s=r.y,l=e.y,u=i.y,c=n<o?n<a?n:a:o<a?o:a,h=s<l?s<u?s:u:l<u?l:u,p=n>o?n>a?n:a:o>a?o:a,d=s>l?s>u?s:u:l>u?l:u,f=i.next;f!==r;){if(f.x>=c&&f.x<=p&&f.y>=h&&f.y<=d&&uk(n,s,o,l,a,u,f.x,f.y)&&uN(f.prev,f,f.next)>=0)return!1;
15f=f.next}return!0}(r))i.push(u.i/n|0),i.push(r.i/n|0),i.push(c.i/n|0),uq(r),r=c.next,h=c.next;else if((r=c)===h){l?1===l?e(r=function(e,r,i){var n=e;do{var o=n.prev,a=n.next.next;!uF(o,a)&&uz(o,n,n.next,a)&&uj(o,a)&&uj(a,o)&&(r.push(o.i/i|0),r.push(n.i/i|0),r.push(a.i/i|0),uq(n),uq(n.next),n=e=a),n=n.next}while(n!==e);return uO(n)}(uO(r),i,n),i,n,o,a,s,2):2===l&&function(r,i,n,o,a,s){var l=r;do{for(var u,c,h=l.next.next;h!==l.prev;){if(l.i!==h.i&&(u=l,c=h,u.next.i!==c.i&&u.prev.i!==c.i&&!function(e,r){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==r.i&&i.next.i!==r.i&&uz(i,i.next,e,r))return!0;i=i.next}while(i!==e);return!1}(u,c)&&(uj(u,c)&&uj(c,u)&&function(e,r){var i=e,n=!1,o=(e.x+r.x)/2,a=(e.y+r.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&o<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next;while(i!==e);return n}(u,c)&&(uN(u.prev,u,c.prev)||uN(u,c.prev,c))||uF(u,c)&&uN(u.prev,u,u.next)>0&&uN(c.prev,c,c.next)>0))){var p=uV(l,h);return l=uO(l,l.next),p=uO(p,p.next),e(l,i,n,o,a,s,0),void e(p,i,n,o,a,s,0)}h=h.next}l=l.next}while(l!==r)}(r,i,n,o,a,s):e(uO(r),i,n,o,a,s,1);break}}}(d,f,i,n,o,c,0),f}function uL(e,r,i,n,o){var a,s;if(o===u$(e,r,i,n)>0)for(a=r;a<i;a+=n)s=uG(a,e[a],e[a+1],s);else for(a=i-n;a>=r;a-=n)s=uG(a,e[a],e[a+1],s);return s&&uF(s,s.next)&&(uq(s),s=s.next),s}function uO(e,r){if(!e)return e;r||(r=e);var i,n=e;do if(i=!1,n.steiner||!uF(n,n.next)&&0!==uN(n.prev,n,n.next))n=n.next;else{if(uq(n),(n=r=n.prev)===n.next)break;i=!0}while(i||n!==r);return r}function uD(e,r){return e.x-r.x}function uR(e,r,i,n,o){return(e=0x55555555&((e=0x33333333&((e=0xf0f0f0f&((e=0xff00ff&((e=(e-i)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(r=0x55555555&((r=0x33333333&((r=0xf0f0f0f&((r=0xff00ff&((r=(r-n)*o|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function uk(e,r,i,n,o,a,s,l){return(o-s)*(r-l)>=(e-s)*(a-l)&&(e-s)*(n-l)>=(i-s)*(r-l)&&(i-s)*(a-l)>=(o-s)*(n-l)}function uN(e,r,i){return(r.y-e.y)*(i.x-r.x)-(r.x-e.x)*(i.y-r.y)}function uF(e,r){return e.x===r.x&&e.y===r.y}function uz(e,r,i,n){var o=uU(uN(e,r,i)),a=uU(uN(e,r,n)),s=uU(uN(i,n,e)),l=uU(uN(i,n,r));return o!==a&&s!==l||!(0!==o||!uB(e,i,r))||!(0!==a||!uB(e,n,r))||!(0!==s||!uB(i,e,n))||!(0!==l||!uB(i,r,n))}function uB(e,r,i){return r.x<=Math.max(e.x,i.x)&&r.x>=Math.min(e.x,i.x)&&r.y<=Math.max(e.y,i.y)&&r.y>=Math.min(e.y,i.y)}function uU(e){return e>0?1:e<0?-1:0}function uj(e,r){return 0>uN(e.prev,e,e.next)?uN(e,r,e.next)>=0&&uN(e,e.prev,r)>=0:0>uN(e,r,e.prev)||0>uN(e,e.next,r)}function uV(e,r){var i=new uH(e.i,e.x,e.y),n=new uH(r.i,r.x,r.y),o=e.next,a=r.prev;return e.next=r,r.prev=e,i.next=o,o.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function uG(e,r,i,n){var o=new uH(e,r,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function uq(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function uH(e,r,i){this.i=e,this.x=r,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function u$(e,r,i,n){for(var o=0,a=r,s=i-n;a<i;a+=n)o+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return o}uA.exports=uP,uA.exports.default=uP,uP.deviation=function(e,r,i,n){var o=r&&r.length,a=Math.abs(u$(e,0,o?r[0]*i:e.length,i));if(o)for(var s=0,l=r.length;s<l;s++)a-=Math.abs(u$(e,r[s]*i,s<l-1?r[s+1]*i:e.length,i));var u=0;for(s=0;s<n.length;s+=3){var c=n[s]*i,h=n[s+1]*i,p=n[s+2]*i;u+=Math.abs((e[c]-e[p])*(e[h+1]-e[c+1])-(e[c]-e[h])*(e[p+1]-e[c+1]))}return 0===a&&0===u?0:Math.abs((u-a)/a)},uP.flatten=function(e){for(var r=e[0][0].length,i={vertices:[],holes:[],dimensions:r},n=0,o=0;o<e.length;o++){for(var a=0;a<e[o].length;a++)for(var s=0;s<r;s++)i.vertices.push(e[o][a][s]);o>0&&i.holes.push(n+=e[o-1].length)}return i};var uW=M(uA.exports);function uY(e,r){let i,n,o=e.length;if(o<=1)return[e];let a=[];for(let r=0;r<o;r++){let o=function(e){let r=0;for(let i,n,o=0,a=e.length,s=a-1;o<a;s=o++)i=e[o],r+=((n=e[s]).x-i.x)*(i.y+n.y);return r}(e[r]);0!==o&&(e[r].area=Math.abs(o),void 0===n&&(n=o<0),n===o<0?(i&&a.push(i),i=[e[r]]):i.push(e[r]))}if(i&&a.push(i),r>1)for(let e=0;e<a.length;e++)a[e].length<=r||(iB(a[e],r,1,a[e].length-1,uZ),a[e]=a[e].slice(0,r));return a}function uZ(e,r){return r.area-e.area}
15function uX(e,r,i){let n=i.patternDependencies,o=!1;for(let i of r){let r=i.paint.get(`${e}-pattern`);r.isConstant()||(o=!0);let a=r.constantOr(null);a&&(o=!0,n[a]=!0)}return o}function uK(e,r,i,n,o){let a=o.patternDependencies;for(let s of r){let r=s.paint.get(`${e}-pattern`).value;if("constant"!==r.kind){let e=r.evaluate({zoom:n},i,{},o.availableImages);a[e=e&&e.name?e.name:e]=!0,i.patterns[s.id]=e}}return i}class uQ{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new aG,this.indexArray=new a8,this.indexArray2=new a2,this.programConfigurations=new sZ(e.layers,e.zoom),this.segments=new sE,this.segments2=new sE,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.projection=e.projection}populate(e,r,i,n){this.hasPattern=uX("fill",this.layers,r);let o=this.layers[0].layout.get("fill-sort-key"),a=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of e){let e=this.layers[0]._featureFilter.needGeometry,h=lv(s,e);if(!this.layers[0]._featureFilter.filter(new au(this.zoom),h,i))continue;let p=o?o.evaluate(h,{},i,r.availableImages):void 0,d={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:e?h.geometry:ly(s,i,n),patterns:{},sortKey:p};a.push(d)}for(let n of(o&&a.sort((e,r)=>e.sortKey-r.sortKey),a)){let{geometry:o,index:a,sourceLayerIndex:s}=n;if(this.hasPattern){let e=uK("fill",this.layers,n,this.zoom,r);this.patternFeatures.push(e)}else this.addFeature(n,o,a,i,{},r.availableImages,r.brightness);r.featureIndex.insert(e[a].feature,o,a,s,this.index)}}update(e,r,i,n,o){let a=0!==Object.keys(e).length;a&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,r,a?this.stateDependentLayers:this.layers,i,n,o)}addFeatures(e,r,i,n,o,a){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,r,i,n,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,uC),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,i,n,o,a=[],s){for(let e of uY(r,500)){let r=0;for(let i of e)r+=i.length;let i=this.segments.prepareSegment(r,this.layoutVertexArray,this.indexArray),n=i.vertexLength,o=[],a=[];for(let r of e){if(0===r.length)continue;r!==e[0]&&a.push(o.length/2);let i=this.segments2.prepareSegment(r.length,this.layoutVertexArray,this.indexArray2),n=i.vertexLength;this.layoutVertexArray.emplaceBack(r[0].x,r[0].y),this.indexArray2.emplaceBack(n+r.length-1,n),o.push(r[0].x),o.push(r[0].y);for(let e=1;e<r.length;e++)this.layoutVertexArray.emplaceBack(r[e].x,r[e].y),this.indexArray2.emplaceBack(n+e-1,n+e),o.push(r[e].x),o.push(r[e].y);i.vertexLength+=r.length,i.primitiveLength+=r.length}let s=uW(o,a);for(let e=0;e<s.length;e+=3)this.indexArray.emplaceBack(n+s[e],n+s[e+1],n+s[e+2]);i.vertexLength+=r,i.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,o,a,n,s)}}oS(uQ,"FillBucket",{omit:["layers","patternFeatures"]});let uJ=new ab({"fill-sort-key":new av(aS.layout_fill["fill-sort-key"]),visibility:new ay(aS.layout_fill.visibility)});var u0={paint:new ab({"fill-antialias":new ay(aS.paint_fill["fill-antialias"]),"fill-opacity":new av(aS.paint_fill["fill-opacity"]),"fill-color":new av(aS.paint_fill["fill-color"]),"fill-outline-color":new av(aS.paint_fill["fill-outline-color"]),"fill-translate":new ay(aS.paint_fill["fill-translate"]),"fill-translate-anchor":new ay(aS.paint_fill["fill-translate-anchor"]),"fill-pattern":new av(aS.paint_fill["fill-pattern"]),"fill-emissive-strength":new ay(aS.paint_fill["fill-emissive-strength"])}),layout:uJ};let u1=aj([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),u2=aj([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),u3=aj([{name:"a_centroid_pos",components:2,type:"Uint16"}]),u5=aj([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),u4=aj([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:u6}=u1;var u8={};function u9(e,r,i,n,o){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(u7,this,r)}function u7(e,r,i){1==e?r.id=i.readVarint():2==e?function(e,r){for(var i=e.readVarint()+e.pos;e.pos<i;){var n=r._keys[e.readVarint()],o=r._values[e.readVarint()];r.properties[n]=o}}(i,r):3==e?r.type=i.readVarint():4==e&&(r._geometry=i.pos)}function ce(e,r){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ct,this,r),this.length=this._features.length}function ct(e,r,i){15===e?r.version=i.readVarint():1===e?r.name=i.readString():5===e?r.extent=i.readVarint():2===e?r._features.push(i.pos):3===e?r._keys.push(i.readString()):4===e&&r._values.push(function(e){for(var r=null,i=e.readVarint()+e.pos;e.pos<i;){var n=e.readVarint()>>3;r=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return r}(i))}function cr(e,r,i){if(3===e){var n=new ce(i,i.readVarint()+i.pos);n.length&&(r[n.name]=n)}}u9.types=["Unknown","Point","LineString","Polygon"],u9.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var r,i=e.readVarint()+e.pos,n=1,o=0,a=0,s=0,l=[];e.pos<i;){if(o<=0){var u=e.readVarint();n=7&u,o=u>>3}if(o--,1===n||2===n)a+=e.readSVarint(),s+=e.readSVarint(),1===n&&(r&&l.push(r),r=[]),r.push(new tv(a,s));else{if(7!==n)throw Error("unknown command "+n);r&&r.push(r[0].clone())}}return r&&l.push(r),l},u9.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var r=e.readVarint()+e.pos,i=1,n=0,o=0,a=0,s=1/0,l=-1/0,u=1/0,c=-1/0;e.pos<r;){if(n<=0){var h=e.readVarint();i=7&h,n=h>>3}if(n--,1===i||2===i)(o+=e.readSVarint())<s&&(s=o),o>
15l&&(l=o),(a+=e.readSVarint())<u&&(u=a),a>c&&(c=a);else if(7!==i)throw Error("unknown command "+i)}return[s,u,l,c]},u9.prototype.toGeoJSON=function(e,r,i){var n,o,a=this.extent*Math.pow(2,i),s=this.extent*e,l=this.extent*r,u=this.loadGeometry(),c=u9.types[this.type];function h(e){for(var r=0;r<e.length;r++){var i=e[r];e[r]=[360*(i.x+s)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+l)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(n=0;n<u.length;n++)p[n]=u[n][0];h(u=p);break;case 2:for(n=0;n<u.length;n++)h(u[n]);break;case 3:for(u=function(e){var r=e.length;if(r<=1)return[e];for(var i,n,o=[],a=0;a<r;a++){var s=function(e){for(var r,i,n=0,o=0,a=e.length,s=a-1;o<a;s=o++)n+=((i=e[s]).x-(r=e[o]).x)*(r.y+i.y);return n}(e[a]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(i&&o.push(i),i=[e[a]]):i.push(e[a]))}return i&&o.push(i),o}(u),n=0;n<u.length;n++)for(o=0;o<u[n].length;o++)h(u[n][o])}1===u.length?u=u[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:u},properties:this.properties};return"id"in this&&(d.id=this.id),d},ce.prototype.feature=function(e){if(e<0||e>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];var r=this._pbf.readVarint()+this._pbf.pos;return new u9(this._pbf,r,this.extent,this._keys,this._values)};var ci=u8.VectorTile=function(e,r){this.layers=e.readFields(cr,{},r)},cn=u8.VectorTileFeature=u9;function co(e,r,i,n){let o=[],a=0===n?(e,r,i,n,o,a)=>{e.push(new tx(a,i+(a-r)/(n-r)*(o-i)))}:(e,r,i,n,o,a)=>{e.push(new tx(r+(a-i)/(o-i)*(n-r),a))};for(let s of e){let e=[];for(let o of s){if(o.length<=2)continue;let s=[];for(let e=0;e<o.length-1;e++){let l=o[e].x,u=o[e].y,c=o[e+1].x,h=o[e+1].y,p=0===n?l:u,d=0===n?c:h;p<r?d>r&&a(s,l,u,c,h,r):p>i?d<i&&a(s,l,u,c,h,i):s.push(o[e]),d<r&&p>=r&&a(s,l,u,c,h,r),d>i&&p<=i&&a(s,l,u,c,h,i)}let l=o[o.length-1],u=0===n?l.x:l.y;u>=r&&u<=i&&s.push(l),s.length&&(l=s[s.length-1],s[0].x===l.x&&s[0].y===l.y||s.push(s[0]),e.push(s))}e.length&&o.push(e)}return o}function ca(e,r){return e.x-r.x||e.y-r.y}function cs(e,r){return 0===ca(e.min,r.min)&&0===ca(e.max,r.max)}function cl(e,r){return!(e.min.x>r.max.x||e.max.x<r.min.x||e.min.y>r.max.y||e.max.y<r.min.y)}function cu(e,r,i){let n=1/(1<<i.canonical.z),o=(1220703125e-13*r.x+i.canonical.x)*n+i.wrap,a=(1220703125e-13*r.y+i.canonical.y)*n;return{min:new tx((1220703125e-13*e.x+i.canonical.x)*n+i.wrap,(1220703125e-13*e.y+i.canonical.y)*n),max:new tx(o,a)}}function cc(e,r,i,n,o,a,s){let l=e.indices,u=e.vertices,c=[];for(let h=n;h<n+o;h+=3){let n=r[i[h+0]+a],o=r[i[h+1]+a],p=r[i[h+2]+a],d=Math.min(n.x,o.x,p.x),f=Math.max(n.x,o.x,p.x),m=Math.min(n.y,o.y,p.y),g=Math.max(n.y,o.y,p.y);c.length=0,e.grid.query(new tx(d,m),new tx(f,g),c);for(let e=0;e<c.length;e++){let r=c[e];if(lO(u[l[3*r+0]],u[l[3*r+1]],u[l[3*r+2]],n,o,p,s))return!0}}return!1}u8.VectorTileLayer=ce;class ch{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,r){let i=this.toIdx(e,r);return{min:this.minimums[i],max:this.maximums[i]}}isLeaf(e,r){return this.leaves[this.toIdx(e,r)]}toIdx(e,r){return r*this.size+e}}function cp(e,r,i,n){let o=0,a=Number.MAX_VALUE;for(let s=0;s<3;s++)if(1e-15>Math.abs(n[s])){if(i[s]<e[s]||i[s]>r[s])return null}else{let l=1/n[s],u=(e[s]-i[s])*l,c=(r[s]-i[s])*l;if(u>c){let e=u;u=c,c=e}if(u>o&&(o=u),c<a&&(a=c),o>a)return null}return o}function cd(e,r,i,n,o,a,s,l,u,c,h){let p=n-e,d=o-r,f=a-i,m=s-e,g=l-r,_=u-i,y=h[1]*_-h[2]*g,v=h[2]*m-h[0]*_,x=h[0]*g-h[1]*m,b=p*y+d*v+f*x;if(1e-15>Math.abs(b))return null;let w=1/b,E=c[0]-e,S=c[1]-r,T=c[2]-i,I=(E*y+S*v+T*x)*w;if(I<0||I>1)return null;let M=S*f-T*d,C=T*p-E*f,A=E*d-S*p,P=(h[0]*M+h[1]*C+h[2]*A)*w;return P<0||I+P>1?null:(m*M+g*C+_*A)*w}function cf(e,r,i,n,o,a,s,l,u){let c=1<<i,h=a-n,p=s-o;l[0]=(e+0)/c*h+n,l[1]=(r+0)/c*p+o,u[0]=(e+1)/c*h+n,u[1]=(r+1)/c*p+o}class cm{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const r=function(e){let r=Math.ceil(Math.log2(e.dim/8)),i=[],n=Math.ceil(Math.pow(2,r)),o=1/n,a=(e,r,i,n,o)=>{let a=+!!n;o[0]=e*i,o[1]=r*i,o[2]=(e+1)*i-a,o[3]=(r+1)*i-a},s=new ch(n),l=[];for(let r=0;r<n*n;r++){a(r%n,Math.floor(r/n),o,!1,l);let i=c_(l[0],l[1],e),u=c_(l[2],l[1],e),c=c_(l[2],l[3],e),h=c_(l[0],l[3],e);s.minimums.push(Math.min(i,u,c,h)),s.maximums.push(Math.max(i,u,c,h)),s.leaves.push(1)}for(i.push(s),n/=2;n>=1;n/=2){let e=i[i.length-1];s=new ch(n);for(let r=0;r<n*n;r++){a(r%n,Math.floor(r/n),2,!0,l);let i=e.getElevation(l[0],l[1]),o=e.getElevation(l[2],l[1]),u=e.getElevation(l[2],l[3]),c=e.getElevation(l[0],l[3]),h=e.isLeaf(l[0],l[1]),p=e.isLeaf(l[2],l[1]),d=e.isLeaf(l[2],l[3]),f=e.isLeaf(l[0],l[3]),m=Math.min(i.min,o.min,u.min,c.min),g=Math.max(i.max,o.max,u.max,c.max),_=h&&p&&d&&f;s.maximums.push(g),s.minimums.push(m),s.leaves.push(g-m<=5&&_?1:0)}i.push(s)}return i}(this.dem),i=r.length-1,n=r[i];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(r,0,0,i,0)}raycastRoot(e,r,i,n,o,a,s=1){return cp([e,r,-100],[i,n,this.maximums[0]*s],o,a)}raycast(r,i,n,o,a,s,l=1){if(!this.nodeCount)return null;let u=this.raycastRoot(r,i,n,o,a,s,l);if(null==u)return null;
15let c=[],h=[],p=[],d=[],f=[{idx:0,t:u,nodex:0,nodey:0,depth:0}];for(;f.length>0;){let{idx:u,t:v,nodex:x,nodey:b,depth:w}=f.pop();if(this.leaves[u]){cf(x,b,w,r,i,n,o,p,d);let u=1<<w,c=(x+0)/u,h=(x+1)/u,f=(b+0)/u,E=(b+1)/u,S=c_(c,f,this.dem)*l,T=c_(h,f,this.dem)*l,I=c_(h,E,this.dem)*l,M=c_(c,E,this.dem)*l,C=cd(p[0],p[1],S,d[0],p[1],T,d[0],d[1],I,a,s),A=cd(d[0],d[1],I,p[0],d[1],M,p[0],p[1],S,a,s),P=Math.min(null!==C?C:Number.MAX_VALUE,null!==A?A:Number.MAX_VALUE);if(P!==Number.MAX_VALUE)return P;{var m,g,_,y;let r=e.Q.scaleAndAdd([],a,s,v);if(cg(S,T,M,I,(m=r[0],(m-(g=p[0]))/(d[0]-g)),(_=r[1],(_-(y=p[1]))/(d[1]-y)))>=r[2])return v}continue}let E=0;for(let e=0;e<this._siblingOffset.length;e++){cf((x<<1)+this._siblingOffset[e][0],(b<<1)+this._siblingOffset[e][1],w+1,r,i,n,o,p,d),p[2]=-100,d[2]=this.maximums[this.childOffsets[u]+e]*l;let f=cp(p,d,a,s);if(null!=f){c[e]=f;let r=!1;for(let i=0;i<E&&!r;i++)f>=c[h[i]]&&(h.splice(i,0,e),r=!0);r||(h[E]=e),E++}}for(let e=0;e<E;e++){let r=h[e];f.push({idx:this.childOffsets[u]+r,t:c[r],nodex:(x<<1)+this._siblingOffset[r][0],nodey:(b<<1)+this._siblingOffset[r][1],depth:w+1})}}return null}_addNode(e,r,i){return this.minimums.push(e),this.maximums.push(r),this.leaves.push(i),this.childOffsets.push(0),this.nodeCount++}_construct(e,r,i,n,o){if(1===e[n].isLeaf(r,i))return;this.childOffsets[o]||(this.childOffsets[o]=this.nodeCount);let a=n-1,s=e[a],l=0,u=0;for(let e=0;e<this._siblingOffset.length;e++){let n=2*r+this._siblingOffset[e][0],o=2*i+this._siblingOffset[e][1],a=s.getElevation(n,o),c=s.isLeaf(n,o),h=this._addNode(a.min,a.max,c);c&&(l|=1<<e),u||(u=h)}for(let n=0;n<this._siblingOffset.length;n++)l&1<<n||this._construct(e,2*r+this._siblingOffset[n][0],2*i+this._siblingOffset[n][1],a,u+n)}}function cg(e,r,i,n,o,a){return r2(r2(e,i,a),r2(r,n,a),o)}function c_(e,r,i){let n=i.dim,o=tM(e*n-.5,0,n-1),a=tM(r*n-.5,0,n-1),s=Math.floor(o),l=Math.floor(a),u=Math.min(s+1,n-1),c=Math.min(l+1,n-1);return cg(i.get(s,l),i.get(u,l),i.get(s,c),i.get(u,c),o-s,a-l)}let cy={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function cv(e,r,i){return(256*e*256+256*r+i)/10-1e4}function cx(e,r,i){return 256*e+r+i/256-32768}class cb{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,r,i,n=!1){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return tG(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=r.height;const o=this.dim=r.height-2,a=new Uint32Array(r.data.buffer);if(this.pixels=new Uint8Array(r.data.buffer),this.floatView=new Float32Array(r.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let e=0;e<o;e++)a[this._idx(-1,e)]=a[this._idx(0,e)],a[this._idx(o,e)]=a[this._idx(o-1,e)],a[this._idx(e,-1)]=a[this._idx(e,0)],a[this._idx(e,o)]=a[this._idx(e,o-1)];a[this._idx(-1,-1)]=a[this._idx(0,0)],a[this._idx(o,-1)]=a[this._idx(o-1,0)],a[this._idx(-1,o)]=a[this._idx(0,o-1)],a[this._idx(o,o)]=a[this._idx(o-1,o-1)]}const s="terrarium"===i?cx:cv;for(let e=0;e<a.length;++e){const r=4*e;this.floatView[e]=s(this.pixels[r],this.pixels[r+1],this.pixels[r+2])}this._timestamp=t9.now()}_buildQuadTree(){this._tree=new cm(this)}get(e,r,i=!1){i&&(e=tM(e,-1,this.dim),r=tM(r,-1,this.dim));let n=this._idx(e,r);return this.floatView[n]}set(e,r,i){let n=this._idx(e,r),o=this.floatView[n];return this.floatView[n]=i,i-o}static getUnpackVector(e){return cy[e]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}static pack(e,r){let i=[0,0,0,0],n=cb.getUnpackVector(r),o=Math.floor((e+n[3])/n[2]);return i[2]=o%256,o=Math.floor(o/256),i[1]=o%256,o=Math.floor(o/256),i[0]=o,i}getPixels(){return new uw({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let n=r*this.dim,o=r*this.dim+this.dim,a=i*this.dim,s=i*this.dim+this.dim;switch(r){case -1:n=o-1;break;case 1:o=n+1}switch(i){case -1:a=s-1;break;case 1:s=a+1}let l=-r*this.dim,u=-i*this.dim;for(let r=a;r<s;r++)for(let i=n;i<o;i++){let n=4*this._idx(i,r),o=4*this._idx(i+l,r+u);this.pixels[n+0]=e.pixels[o+0],this.pixels[n+1]=e.pixels[o+1],this.pixels[n+2]=e.pixels[o+2],this.pixels[n+3]=e.pixels[o+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}oS(cb,"DEMData"),oS(cm,"DemMinMaxQuadTree",{omit:["dem"]});class cw{constructor(e,r,i){this._demTile=e,this._dem=this._demTile.dem,this._scale=r,this._offset=i}static create(e,r,i){let n=i||e.findDEMTileFor(r);if(!n||!n.dem)return;let o=n.dem,a=n.tileID,s=1<<r.canonical.z-a.canonical.z;return new cw(n,o.dim/8192/s,[(r.canonical.x/s-a.canonical.x)*o.dim,(r.canonical.y/s-a.canonical.y)*o.dim])}tileCoordToPixel(e,r){let i=r*this._scale+this._offset[1];return new tx(Math.floor(e*this._scale+this._offset[0]),Math.floor(i))}getElevationAt(e,r,i,n){let o=e*this._scale+this._offset[0],a=r*this._scale+this._offset[1],s=Math.floor(o),l=Math.floor(a),u=this._dem;
15return n=!!n,i?r2(r2(u.get(s,l,n),u.get(s,l+1,n),a-l),r2(u.get(s+1,l,n),u.get(s+1,l+1,n),a-l),o-s):u.get(s,l,n)}getElevationAtPixel(e,r,i){return this._dem.get(e,r,!!i)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*(1/la(e))*this._dem.stride}}let cE=cn.types,cS=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius"],cT=["fill-extrusion-flood-light-ground-radius"],cI=new tx(0,1);function cM(e,r,i,n,o,a,s,l){e.emplaceBack((r<<1)+s,(i<<1)+a,(Math.floor(8192*n)<<1)+o,Math.round(l))}function cC(e,r,i,n,o,a){e.emplaceBack(r.x,r.y,(i.x<<1)+n,(i.y<<1)+o,a)}function cA(e,r,i){e.emplaceBack(r.x,r.y,r.z,16384*i[0],16384*i[1],16384*i[2])}class cP{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class cL{constructor(){this.centroidXY=new tx(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new tx(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new tx(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new tx(this.max.x-this.min.x,this.max.y-this.min.y)}}class cO{constructor(){this.acc=new tx(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,r){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=r.x,e.min.y=e.max.y=r.y)}appendEdge(e,r,i){this.accCount++,this.acc._add(r);let n=!!this.borders;r.x<e.min.x?(e.min.x=r.x,n=!0):r.x>e.max.x&&(e.max.x=r.x,n=!0),r.y<e.min.y?(e.min.y=r.y,n=!0):r.y>e.max.y&&(e.max.y=r.y,n=!0),((0===r.x||8192===r.x)&&r.x===i.x)!=((0===r.y||8192===r.y)&&r.y===i.y)&&this.processBorderOverlap(r,i),n&&this.checkBorderIntersection(r,i)}checkBorderIntersection(e,r){r.x<0!=e.x<0&&this.addBorderIntersection(0,r2(r.y,e.y,(0-r.x)/(e.x-r.x))),r.x>8192!=e.x>8192&&this.addBorderIntersection(1,r2(r.y,e.y,(8192-r.x)/(e.x-r.x))),r.y<0!=e.y<0&&this.addBorderIntersection(2,r2(r.x,e.x,(0-r.y)/(e.y-r.y))),r.y>8192!=e.y>8192&&this.addBorderIntersection(3,r2(r.x,e.x,(8192-r.y)/(e.y-r.y)))}addBorderIntersection(e,r){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);let i=this.borders[e];r<i[0]&&(i[0]=r),r>i[1]&&(i[1]=r)}processBorderOverlap(e,r){if(e.x===r.x){if(e.y===r.y)return;let i=+(0!==e.x);this.addBorderIntersection(i,r.y),this.addBorderIntersection(i,e.y)}else{let i=0===e.y?2:3;this.addBorderIntersection(i,r.x),this.addBorderIntersection(i,e.x)}}centroid(){return 0===this.accCount?new tx(0,0):new tx(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((e,r)=>e+ +(r[0]!==Number.MAX_VALUE),0):0}}function cD(e,r){let i=e.add(r)._unit();return Math.min(4,Math.max(-4,Math.tan(Math.acos(tM(e.x*i.x+e.y*i.y,-1,1)))))/4*32767*(e.x*r.y-e.y*r.x<0?-1:1)}let cR=[e=>e.x<0,e=>e.x>8192,e=>e.y<0,e=>e.y>8192];class ck{constructor(e){this.vertexArray=new a$,this.indexArray=new a8,this.programConfigurations=new sZ(e.layers,e.zoom,e=>cT.includes(e)),this._segments=new sE,this.hiddenByLandmarkVertexArray=new su,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new sE}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,r,i,n=!1){let o=e.length;if(o>2){let a,s=Math.max(0,this._segments.get().length-1),l=this._segments._prepareSegment(4*o,this.vertexArray.length,2*this._segmentToGroundQuads[s].length);s!==this._segments.get().length-1&&(s++,this._segmentToGroundQuads[s]=[],this._segmentToRegionTriCounts[s]=[0,0,0,0,0]);{let r=e[0],i=e[1];a=cD(r.sub(e[o-1])._perp()._unit(),i.sub(r)._perp()._unit())}for(let u=0;u<o;u++){let c=u===o-1?0:u+1,h=e[u],p=e[c],d=e[c===o-1?0:c+1],f=p.sub(h)._perp()._unit(),m=cD(f,d.sub(p)._perp()._unit()),g=a;if(cB(h,p,r)||n&&cU(h,r)&&cU(p,r)){a=m;continue}let _=l.vertexLength;for(let e of(cC(this.vertexArray,h,p,1,1,g),cC(this.vertexArray,h,p,1,0,g),cC(this.vertexArray,h,p,0,1,m),cC(this.vertexArray,h,p,0,0,m),l.vertexLength+=4,function(e,r,i,n){let o=[4];if(0===n)return o;i._mult(n);let a=e.sub(i),s=r.sub(i),l=[e,r,a,s];for(let e=0;e<4;e++)for(let r of l)if(cR[e](r)){o.push(e);break}return o}(h,p,f,i)))this._segmentToGroundQuads[s].push({id:_,region:e}),this._segmentToRegionTriCounts[s][e]+=2,l.primitiveLength+=2;a=m}}}prepareBorderSegments(){if(!this.hasData())return;let e=this._segments.get(),r=e.length;for(let e=0;e<r;e++)this._segmentToGroundQuads[e].sort((e,r)=>e.region-r.region);for(let i=0;i<r;i++){let r=this._segmentToGroundQuads[i],n=e[i],o=this._segmentToRegionTriCounts[i];o.reduce((e,r)=>e+r,0);let a=0;for(let e=0;e<=4;e++){let r=o[e];if(0!==r){let i=this.regionSegments[e];i||(i=this.regionSegments[e]=new sE);let o={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+a,vertexLength:n.vertexLength,primitiveLength:r};i.get().push(o)}a+=r}for(let e=0;e<r.length;e++){let i=r[e].id;this.indexArray.emplaceBack(i,i+1,i+3),this.indexArray.emplaceBack(i,i+3,i+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,r,i,n,o,a){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,r,i,n,o,a)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,u2.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,r,i,n,o,a){this.hasData()&&this.programConfigurations.updatePaintArrays(e,r,i,n,o,a)}updateHiddenByLandmark(e){if(!this.hasData())return;let r=e.groundVertexCount+e.groundVertexArrayOffset;if(0===e.groundVertexCount)return;let i=0x80000000&e.flags?1:0;for(let n=e.groundVertexArrayOffset;n<r;++n)this.hiddenByLandmarkVertexArray.emplace(n,i);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,u5.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){let r=this.regionSegments[e];r&&r.destroy()}}}}class cN{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new a8,this.footprintVertices=new aG,this.footprintSegments=[],this.layoutVertexArray=new aH,this.centroidVertexArray=new sx,this.indexArray=new a8,this.programConfigurations=new sZ(e.layers,e.zoom,e=>cS.includes(e)),this.segments=new sE,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.groundEffect=new ck(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}populate(e,r,i,n){for(let{feature:o,id:a,index:s,sourceLayerIndex:l}of(this.features=[],this.hasPattern=uX("fill-extrusion",this.layers,r),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=lf(i),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,e)){let e=this.layers[0]._featureFilter.needGeometry,u=lv(o,e);if(!this.layers[0]._featureFilter.filter(new au(this.zoom),u,i))continue;let c={id:a,sourceLayerIndex:l,index:s,geometry:e?u.geometry:ly(o,i,n),properties:o.properties,type:o.type,patterns:{}},h=this.layoutVertexArray.length;this.hasPattern?this.features.push(uK("fill-extrusion",this.layers,c,this.zoom,r)):this.addFeature(c,c.geometry,s,i,{},r.availableImages,n,r.brightness),r.featureIndex.insert(o,c.geometry,s,l,this.index,h)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,r,i,n,o,a){for(let e of this.features){let{geometry:s}=e;this.addFeature(e,s,e.index,r,i,n,o,a)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,r,i,n,o){let a=0!==Object.keys(e).length;if(a&&!this.stateDependentLayers.length)return;let s=a?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(e,r,s,i,n,o),this.groundEffect.update(e,r,s,i,n,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,u6),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,u4.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,u3.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,i,n,o,a,s,l){var u;
15let c,h=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,p=[new tx(0,0),new tx(8192,8192)],d=s.projection,f="globe"===d.name,m="Polygon"===cE[e.type],g=new cO;g.centroidDataIndex=this.centroidData.length;let _=new cL,y=0>=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},n),v=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},n);_.height=v,_.vertexArrayOffset=this.layoutVertexArray.length,_.groundVertexArrayOffset=this.groundEffect.vertexArray.length,f&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new aQ);let x=uY(r,500);for(let e=x.length-1;e>=0;e--){let r=x[e];(0===r.length||(u=r[0]).every(e=>e.x<=0)||u.every(e=>e.x>=8192)||u.every(e=>e.y<=0)||u.every(e=>e.y>=8192))&&x.splice(e,1)}if(f)c=cq(x,p,n);else for(let e of(c=[],x))c.push({polygon:e,bounds:p});let b=m?this.edgeRadius:0,w=b>0&&this.zoom<17,E=(e,r)=>{if(0===e.length)return!1;let i=e[e.length-1];return r.x===i.x&&r.y===i.y};for(let{polygon:e,bounds:r}of c){let i=0,o=0;for(let r of e)m&&!r[0].equals(r[r.length-1])&&r.push(r[0]),o+=m?r.length-1:r.length;let a=this.segments.prepareSegment((m?5:4)*o,this.layoutVertexArray,this.indexArray);_.footprintSegIdx<0&&(_.footprintSegIdx=this.footprintSegments.length),_.polygonSegIdx<0&&(_.polygonSegIdx=this.polygonSegments.length);let s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},l=new cP;if(l.vertexOffset=this.footprintVertices.length,l.indexOffset=3*this.footprintIndices.length,l.ringIndices=[],m){let o=[],s=[];i=a.vertexLength;for(let i=0;i<e.length;i++){let u,c,p=e[i];p.length&&0!==i&&s.push(o.length/2);let m=[];u=p[1].sub(p[0])._perp()._unit(),l.ringIndices.push(p.length-1);for(let e=1;e<p.length;e++){let r=p[e],i=p[e===p.length-1?1:e+1],s=r.clone();if(b){c=i.sub(r)._perp()._unit();let e=u.add(c)._unit(),n=b*Math.min(4,1/(u.x*e.x+u.y*e.y));s.x+=n*e.x,s.y+=n*e.y,s.x=Math.round(s.x),s.y=Math.round(s.y),u=c}!y||0!==b&&!w||E(m,s)||m.push(s),cM(this.layoutVertexArray,s.x,s.y,0,0,1,1,0),a.vertexLength++,this.footprintVertices.emplaceBack(r.x,r.y),o.push(r.x,r.y),f&&cA(this.layoutVertexExtArray,d.projectTilePoint(s.x,s.y,n),d.upVector(n,s.x,s.y))}y&&(0===b||w)&&(0!==m.length&&E(m,m[0])&&m.pop(),this.groundEffect.addData(m,r,h))}let u=uW(o,s);for(let e=0;e<u.length;e+=3)this.footprintIndices.emplaceBack(l.vertexOffset+u[e+0],l.vertexOffset+u[e+1],l.vertexOffset+u[e+2]),this.indexArray.emplaceBack(i+u[e],i+u[e+2],i+u[e+1]),a.primitiveLength++;l.indexCount+=u.length,l.vertexCount+=this.footprintVertices.length-l.vertexOffset}for(let o=0;o<e.length;o++){let s,l,u,c=e[o];g.startRing(_,c[0]);let p=c.length>4&&cj(c[c.length-2],c[0],c[1]),v=b?function(e,r,i,n){let o=r.sub(e)._perp()._unit(),a=i.sub(r)._perp()._unit();return cz(e,r,i,cF(o,a),n)}(c[c.length-2],c[0],c[1],b):0,x=[];l=c[1].sub(c[0])._perp()._unit();let w=!0;for(let e=1,o=0;e<c.length;e++){let h=c[e-1],m=c[e],S=c[e===c.length-1?1:e+1];if(g.appendEdge(_,m,h),cB(m,h,r)){b&&(l=S.sub(m)._perp()._unit(),w=!w);continue}let T=m.sub(h)._perp(),I=T.x/(Math.abs(T.x)+Math.abs(T.y)),M=+(T.y>0),C=h.dist(m);if(o+C>32768&&(o=0),b){u=S.sub(m)._perp()._unit();let e=cz(h,m,S,cF(l,u),b);isNaN(e)&&(e=0);let r=m.sub(h)._unit();h=h.add(r.mult(v))._round(),m=m.add(r.mult(-e))._round(),v=e,l=u,y&&this.zoom>=17&&(E(x,h)||x.push(h),E(x,m)||x.push(m))}let A=a.vertexLength,P=c.length>4&&cj(h,m,S),L=cV(o,p,w);if(cM(this.layoutVertexArray,h.x,h.y,I,M,0,0,L),cM(this.layoutVertexArray,h.x,h.y,I,M,0,1,L),o+=C,L=cV(o,P,!w),p=P,cM(this.layoutVertexArray,m.x,m.y,I,M,0,0,L),cM(this.layoutVertexArray,m.x,m.y,I,M,0,1,L),a.vertexLength+=4,this.indexArray.emplaceBack(A+0,A+1,A+2),this.indexArray.emplaceBack(A+1,A+3,A+2),a.primitiveLength+=2,b){let n=i+(1===e?c.length-2:e-2),o=1===e?i:n+1;if(this.indexArray.emplaceBack(A+1,n,A+3),this.indexArray.emplaceBack(n,o,A+3),a.primitiveLength+=2,void 0===s&&(s=A),!cB(S,c[e],r)){let r=e===c.length-1?s:a.vertexLength;this.indexArray.emplaceBack(A+2,A+3,r),this.indexArray.emplaceBack(A+3,r+1,r),this.indexArray.emplaceBack(A+3,o,r+1),a.primitiveLength+=3}w=!w}if(f){let e=this.layoutVertexExtArray,r=d.projectTilePoint(h.x,h.y,n),i=d.projectTilePoint(m.x,m.y,n),o=d.upVector(n,h.x,h.y),a=d.upVector(n,m.x,m.y);cA(e,r,o),cA(e,r,o),cA(e,i,a),cA(e,i,a)}}m&&(i+=c.length-1),y&&b&&this.zoom>=17&&(0!==x.length&&E(x,x[0])&&x.pop(),this.groundEffect.addData(x,r,h,b>0))}this.footprintSegments.push(l),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++_.footprintSegLen,++_.polygonSegLen}if(_.vertexCount=this.layoutVertexArray.length-_.vertexArrayOffset,_.groundVertexCount=this.groundEffect.vertexArray.length-_.groundVertexArrayOffset,0!==_.vertexCount){if(_.centroidXY=g.borders?cI:this.encodeCentroid(g,_),this.centroidData.push(_),g.borders){this.featuresOnBorder.push(g);let e=this.featuresOnBorder.length-1;for(let r=0;r<g.borders.length;r++)g.borders[r][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[r].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,o,a,n,l),this.groundEffect.addPaintPropertiesData(e,i,o,a,n,l),this.maxHeight=Math.max(this.maxHeight,v)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort((r,i)=>this.featuresOnBorder[r].borders[e][0]-this.featuresOnBorder[i].borders[e][0])}splitToSubtiles(){let e=[];for(let r=0;r<this.centroidData.length;r++){let i=this.centroidData[r],n=+(i.min.y+i.max.y>8192),o=2*n+(i.min.x+i.max.x>8192^n);for(let n=0;n<i.polygonSegLen;n++){let a=i.polygonSegIdx+n;e.push({centroidIdx:r,subtile:o,polygonSegmentIdx:a,triangleSegmentIdx:this.polygonSegments[a].triangleSegIdx})}}let r=new a8;e.sort((e,r)=>e.triangleSegmentIdx===r.triangleSegmentIdx?e.subtile-r.subtile:e.triangleSegmentIdx-r.triangleSegmentIdx);let i=0,n=0,o=0;for(let r of e){if(r.triangleSegmentIdx!==i)break;o++}let a=e.length;for(;n!==e.length;){i=e[n].triangleSegmentIdx;let s=0,l=n,u=n;for(let r=l;r<o&&e[r].subtile===s;r++)u++;for(;l!==o;){let n=e[l];s=n.subtile;let a=this.centroidData[n.centroidIdx].min.clone(),c=this.centroidData[n.centroidIdx].max.clone(),h={vertexOffset:this.segments.segments[i].vertexOffset,primitiveOffset:r.length,vertexLength:this.segments.segments[i].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let i=l;i<u;i++){let n=e[i],o=this.polygonSegments[n.polygonSegmentIdx],s=this.centroidData[n.centroidIdx].min,l=this.centroidData[n.centroidIdx].max,u=this.indexArray.uint16;for(let e=o.triangleArrayOffset;e<o.triangleArrayOffset+o.triangleCount;e++)r.emplaceBack(u[3*e],u[3*e+1],u[3*e+2]);h.primitiveLength+=o.triangleCount,a.x=Math.min(a.x,s.x),a.y=Math.min(a.y,s.y),c.x=Math.max(c.x,l.x),c.y=Math.max(c.y,l.y)}h.primitiveLength>0&&this.triangleSubSegments.push({segment:h,min:a,max:c}
15),l=u;for(let r=l;r<o&&e[r].subtile===e[l].subtile;r++)u++}n=o;for(let r=n;r<a&&e[r].triangleSegmentIdx===e[n].triangleSegmentIdx;r++)o++}r._trim(),this.indexArray=r}getVisibleSegments(e,r,i){let n,o=0,a=0,s=1<<e.canonical.z;if(r){let i=r.getMinMaxForTile(e);i&&(o=i.min,a=i.max)}a+=this.maxHeight;let l=e.toUnwrapped(),u=[l.canonical.x/s+l.wrap,l.canonical.y/s],c=[(l.canonical.x+1)/s+l.wrap,(l.canonical.y+1)/s],h=new sE,p=(e,r,i)=>[e[0]*(1-i[0])+r[0]*i[0],e[1]*(1-i[1])+r[1]*i[1]],d=[],f=[];for(let e of this.triangleSubSegments){d[0]=e.min.x/8192,d[1]=e.min.y/8192,f[0]=e.max.x/8192,f[1]=e.max.y/8192;let r=p(u,c,d),s=p(u,c,f);if(0===new l$([r[0],r[1],o],[s[0],s[1],a]).intersectsPrecise(i)){n&&(h.segments.push(n),n=void 0);continue}let l=e.segment;n&&n.vertexOffset!==l.vertexOffset&&(h.segments.push(n),n=void 0),n?(n.vertexLength+=l.vertexLength,n.primitiveLength+=l.primitiveLength):n={vertexOffset:l.vertexOffset,primitiveLength:l.primitiveLength,vertexLength:l.vertexLength,primitiveOffset:l.primitiveOffset,sortKey:void 0,vaos:{}}}return n&&h.segments.push(n),h}encodeCentroid(e,r){let i=e.centroid(),n=r.span(),o=Math.min(7,Math.round(n.x*this.tileToMeter/10)),a=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new tx(tM(i.x,1,8191)<<3|o,tM(i.y,1,8191)<<3|a)}encodeBorderCentroid(e){if(!e.borders)return new tx(0,0);let r=e.borders,i=Number.MAX_VALUE;if(r[0][0]!==i||r[1][0]!==i){let e=+(r[0][0]===i);return new tx(6|65528*(r[0][0]===i),(r[e][0]+r[e][1])/2<<3|6)}{let e=r[2][0]!==i?2:3;return new tx((r[e][0]+r[e][1])/2<<3|6,6|65528*(r[2][0]===i))}}showCentroid(e){let r=this.centroidData[e.centroidDataIndex];r.flags&=0x80000000,r.centroidXY.x=0,r.centroidXY.y=0,this.writeCentroidToBuffer(r)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);let r=e.vertexArrayOffset,i=e.vertexCount+e.vertexArrayOffset,n=0x80000000&e.flags?cI:e.centroidXY,o=this.centroidVertexArray.geta_centroid_pos0(r);if(this.centroidVertexArray.geta_centroid_pos1(r)!==n.y||o!==n.x){for(let e=r;e<i;++e)this.centroidVertexArray.emplace(e,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){for(let e of(this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length),this.centroidData))this.writeCentroidToBuffer(e)}updateReplacement(e,r){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;let i=r.getReplacementRegionsForTile(e.toUnwrapped());if(function(e,r){if(e.length!==r.length)return!1;for(let i=0;i<e.length;i++)if(e[i].sourceId!==r[i].sourceId||!cs(e[i],r[i]))return!1;return!0}(this.activeReplacements,i))return;if(this.activeReplacements=i,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(let e of this.centroidData)e.flags&=0x7fffffff;let n=[];for(let r of this.activeReplacements){let i=Math.pow(2,r.footprintTileId.canonical.z-e.canonical.z);for(let o of this.centroidData)if(!(0x80000000&o.flags||r.min.x>o.max.x||o.min.x>r.max.x||r.min.y>o.max.y||o.min.y>r.max.y))for(let a=0;a<o.footprintSegLen;a++){let s=this.footprintSegments[o.footprintSegIdx+a];if(n.length=0,function(e,r,i,n,o,a){let s=Math.pow(2,n.z-o.z);for(let l=0;l<i;l++){let i=e.int16[2*(l+r)+0],u=e.int16[2*(l+r)+1];i=(i+8192*o.x)*s-8192*n.x,u=(u+8192*o.y)*s-8192*n.y,a.push(new tx(i,u))}}(this.footprintVertices,s.vertexOffset,s.vertexCount,r.footprintTileId.canonical,e.canonical,n),cc(r.footprint,n,this.footprintIndices.uint16,s.indexOffset,s.indexCount,-s.vertexOffset,-i)){o.flags|=0x80000000;break}}}for(let e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,r,i){let n=!1;for(let o=0;o<i.footprintSegLen;o++){let a=this.footprintSegments[i.footprintSegIdx+o],s=0;for(let i of a.ringIndices){for(let o=s,l=i+s-1;o<i+s;l=o++){let i=this.footprintVertices.int16[2*(o+a.vertexOffset)+0],s=this.footprintVertices.int16[2*(o+a.vertexOffset)+1],u=this.footprintVertices.int16[2*(l+a.vertexOffset)+1];s>r!=u>r&&e<(this.footprintVertices.int16[2*(l+a.vertexOffset)+0]-i)*(r-s)/(u-s)+i&&(n=!n)}s=i}}return n}getHeightAtTileCoord(e,r){let i=-1/0,n=!0,o=4*(e+8192)*8192+(r+8192);if(this.partLookup.hasOwnProperty(o)){let e=this.partLookup[o];return e?{height:e.height,hidden:!!(0x80000000&e.flags)}:void 0}for(let a of this.centroidData)e>a.max.x||a.min.x>e||r>a.max.y||a.min.y>r||this.footprintContainsPoint(e,r,a)&&a&&a.height>i&&(i=a.height,this.partLookup[o]=a,n=!!(0x80000000&a.flags));if(i!==-1/0)return{height:i,hidden:n};this.partLookup[o]=void 0}}function cF(e,r){let i=e.add(r)._unit();return e.x*i.x+e.y*i.y}function cz(e,r,i,n,o){let a=Math.sqrt(1-n*n);return Math.min(e.dist(r)/3,r.dist(i)/3,o*a/n)}
15function cB(e,r,i){return e.x<i[0].x&&r.x<i[0].x||e.x>i[1].x&&r.x>i[1].x||e.y<i[0].y&&r.y<i[0].y||e.y>i[1].y&&r.y>i[1].y}function cU(e,r){return e.x<r[0].x||e.x>r[1].x||e.y<r[0].y||e.y>r[1].y}function cj(e,r,i){if(e.x<0||e.x>=8192||r.x<0||r.x>=8192||i.x<0||i.x>=8192)return!1;let n=i.sub(r),o=n.perp(),a=e.sub(r);return(n.x*a.x+n.y*a.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(a.x*a.x+a.y*a.y))>-.866&&o.x*a.x+o.y*a.y<0}function cV(e,r,i){let n=r?2|e:-3&e;return i?1|n:-2&n}function cG(){let e=Math.tan(Math.PI/32);return 6371008.8*Math.sqrt(1+2*e*e)-6371008.8}function cq(e,r,i){let n=1<<i.z,o=lu(i.x/n);return function(e,r,i,n,o=0,a){let s=[];if(!e.length||!i||!n)return s;let l=(e,r)=>{for(let i of e)s.push({polygon:i,bounds:r})},u=Math.ceil(Math.log2(i)),c=Math.ceil(Math.log2(n)),h=u-c,p=[];for(let e=0;e<Math.abs(h);e++)p.push(h>0?0:1);for(let e=0;e<Math.min(u,c);e++)p.push(0),p.push(1);let d=e;if(d=co(d,r[0].y-o,r[1].y+o,1),!(d=co(d,r[0].x-o,r[1].x+o,0)).length)return s;let f=[];for(p.length?f.push({polygons:d,bounds:r,depth:0}):l(d,r);f.length;){let e=f.pop(),r=e.depth,i=p[r],n=e.bounds[0],s=e.bounds[1],u=0===i?n.x:n.y,c=0===i?s.x:s.y,h=a?a(i,u,c):.5*(u+c),d=co(e.polygons,u-o,h+o,i),m=co(e.polygons,h-o,c+o,i);if(d.length){let e=[n,new tx(0===i?h:s.x,1===i?h:s.y)];p.length>r+1?f.push({polygons:d,bounds:e,depth:r+1}):l(d,e)}if(m.length){let e=[new tx(0===i?h:n.x,1===i?h:n.y),s];p.length>r+1?f.push({polygons:m,bounds:e,depth:r+1}):l(m,e)}}return s}
15(e,r,Math.ceil((lu((i.x+1)/n)-o)/11.25),Math.ceil((lc(i.y/n)-lc((i.y+1)/n))/11.25),1,(e,r,o)=>{if(0===e)return .5*(r+o);{let e=lc((i.y+r/8192)/n);return(ll(.5*(lc((i.y+o/8192)/n)+e))*n-i.y)*8192}})}oS(cN,"FillExtrusionBucket",{omit:["layers","features"]}),oS(cL,"PartData"),oS(cP,"FootprintSegment"),oS(cO,"BorderCentroidData"),oS(ck,"GroundEffect");let cH=new ab({visibility:new ay(aS["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new ay(aS["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var c$={paint:new ab({"fill-extrusion-opacity":new ay(aS["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new av(aS["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ay(aS["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ay(aS["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new av(aS["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new av(aS["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new av(aS["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ay(aS["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new ay(aS["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new ay(aS["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new ay(aS["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new ay(aS["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new ay(aS["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new ay(aS["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new ay(aS["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new av(aS["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new av(aS["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new ay(aS["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new ay(aS["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new ay(aS["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new ay(aS["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new ay(aS["paint_fill-extrusion"]["fill-extrusion-emissive-strength"])}),layout:cH};class cW extends tx{constructor(e,r,i){super(e,r),this.z=i}}function cY(e,r){return e.x*r.x+e.y*r.y}function cZ(e,r){if(1===e.length){let i,n=0,o=r[n++];for(;!i||o.equals(i);)if(!(i=r[n++]))return 1/0;for(;n<r.length;n++){let a=r[n],s=e[0],l=i.sub(o),u=a.sub(o),c=s.sub(o),h=cY(l,l),p=cY(l,u),d=cY(u,u),f=cY(c,l),m=cY(c,u),g=h*d-p*p,_=(d*f-p*m)/g,y=(h*m-p*f)/g,v=o.z*(1-_-y)+i.z*_+a.z*y;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let i of r)e=Math.min(e,i.z);return e}}function cX(e,r,i,n,o,a,s,l){var u,c;let h,p,d,f,m,g,_,y,v,x,b,w,E,S,T=s*o.getElevationAt(e,r,!0,!0),I=0!==a[0],M=I?0===a[1]?s*(a[0]/7-450):s*(h=Math.floor(a[0]/8),p=Math.floor(a[1]/8),d=10*(a[0]-8*h),f=10*(a[1]-8*p),m=o.getElevationAt(h,p,!0,!0),_=Math.floor(.5*(d*(g=o.getMeterToDEM(l))-1)),y=Math.floor(.5*(f*g-1)),v=o.tileCoordToPixel(h,p),x=2*_+1,b=2*y+1,u=v.x-_,c=v.y-y,E=Math.abs((w=[o.getElevationAtPixel(u,c,!0),o.getElevationAtPixel(u+b,c,!0),o.getElevationAtPixel(u,c+b,!0),o.getElevationAtPixel(u+x,c+b,!0)])[0]-w[1]),S=Math.abs(w[2]-w[3]),m+Math.max(Math.min(.25,.5*g*(E+S)/x)*d,Math.min(.25,.5*g*(Math.abs(w[0]-w[2])+Math.abs(w[1]-w[3]))/b)*f)):T;return{base:T+(0===i)?-1:i,top:I?Math.max(M+n,T+i+2):T+n}}let{members:cK}=aj([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:cQ}=aj([{name:"a_packed",components:4,type:"Float32"}]),{members:cJ}=aj([{name:"a_pattern_data",components:2,type:"Float32"}]);class c0{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.image=new ux({width:e,height:r}),this.positions={},this.uploaded=!1}getDash(e,r){let i=this.getKey(e,r);return this.positions[i]}trim(){let e=this.width,r=this.height=tk(this.nextRow);this.image.resize({width:e,height:r})}getKey(e,r){return e.join(",")+r}getDashRanges(e,r,i){let n=[],o=e.length%2==1?-e[e.length-1]*i:0,a=e[0]*i,s=!0;n.push({left:o,right:a,isDash:s,zeroLength:0===e[0]});let l=e[0];for(let r=1;r<e.length;r++){s=!s;let u=e[r];o=l*i,l+=u,a=l*i,n.push({left:o,right:a,isDash:s,zeroLength:0===u})}return n}
15addRoundDash(e,r,i){let n=r/2;for(let r=-i;r<=i;r++){let o=this.width*(this.nextRow+i+r),a=0,s=e[0];for(let l=0;l<this.width;l++){let u;l/s.right>1&&(s=e[++a]);let c=Math.min(Math.abs(l-s.left),Math.abs(l-s.right)),h=r/i*(n+1);if(s.isDash){let e=n-Math.abs(h);u=Math.sqrt(c*c+e*e)}else u=n-Math.sqrt(c*c+h*h);this.image.data[o+l]=Math.max(0,Math.min(255,u+128))}}}addRegularDash(e,r){for(let r=e.length-1;r>=0;--r){let i=e[r],n=e[r+1];i.zeroLength?e.splice(r,1):n&&n.isDash===i.isDash&&(n.left=i.left,e.splice(r,1))}let i=e[0],n=e[e.length-1];i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);let o=this.width*this.nextRow,a=0,s=e[0];for(let i=0;i<this.width;i++){i/s.right>1&&(s=e[++a]);let n=Math.min(Math.abs(i-s.left),Math.abs(i-s.right));this.image.data[o+i]=Math.max(0,Math.min(255,(s.isDash?n:-n)+r+128))}}addDash(e,r){let i=this.getKey(e,r);if(this.positions[i])return this.positions[i];let n="round"===r,o=7*!!n,a=2*o+1;if(this.nextRow+a>this.height)return tG("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let r=0;r<e.length;r++)e[r]<0&&(tG("Negative value is found in line dasharray, replacing values with 0"),e[r]=0),s+=e[r];if(0!==s){let i=this.width/s,a=this.getDashRanges(e,this.width,i);n?this.addRoundDash(a,i,o):this.addRegularDash(a,"square"===r?.5*i:0)}let l=this.nextRow+o;this.nextRow+=a;let u={tl:[l,o],br:[s,0]};return this.positions[i]=u,u}}oS(c0,"LineAtlas");let c1=cn.types,c2=Math.cos(Math.PI/180*37.5),c3=Math.cos(Math.PI/180*5);class c5{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(e=>{this.gradients[e.id]={}}),this.layoutVertexArray=new aW,this.layoutVertexArray2=new aY,this.patternVertexArray=new aZ,this.indexArray=new a8,this.programConfigurations=new sZ(e.layers,e.zoom),this.segments=new sE,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,r,i,n){this.hasPattern=uX("line",this.layers,r);let o=this.layers[0].layout.get("line-sort-key"),a=[];for(let{feature:r,id:s,index:l,sourceLayerIndex:u}of e){let e=this.layers[0]._featureFilter.needGeometry,c=lv(r,e);if(!this.layers[0]._featureFilter.filter(new au(this.zoom),c,i))continue;let h=o?o.evaluate(c,{},i):void 0,p={id:s,properties:r.properties,type:r.type,sourceLayerIndex:u,index:l,geometry:e?c.geometry:ly(r,i,n),patterns:{},sortKey:h};a.push(p)}o&&a.sort((e,r)=>e.sortKey-r.sortKey);let{lineAtlas:s,featureIndex:l}=r,u=this.addConstantDashes(s);for(let n of a){let{geometry:o,index:a,sourceLayerIndex:c}=n;if(u&&this.addFeatureDashes(n,s),this.hasPattern){let e=uK("line",this.layers,n,this.zoom,r);this.patternFeatures.push(e)}else this.addFeature(n,o,a,i,s.positions,r.availableImages,r.brightness);l.insert(e[a].feature,o,a,c,this.index)}}addConstantDashes(e){let r=!1;for(let i of this.layers){let n=i.paint.get("line-dasharray").value,o=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==o.kind)r=!0;else{let r=o.value,i=n.value;if(!i)continue;e.addDash(i,r)}}return r}addFeatureDashes(e,r){let i=this.zoom;for(let n of this.layers){let o,a,s=n.paint.get("line-dasharray").value,l=n.layout.get("line-cap").value;if("constant"!==s.kind||"constant"!==l.kind){if("constant"===s.kind){if(!(o=s.value))continue}else o=s.evaluate({zoom:i},e);a="constant"===l.kind?l.value:l.evaluate({zoom:i},e),r.addDash(o,a),e.patterns[n.id]=r.getKey(o,a)}}}update(e,r,i,n,o){let a=0!==Object.keys(e).length;a&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,r,a?this.stateDependentLayers:this.layers,i,n,o)}addFeatures(e,r,i,n,o,a){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,r,i,n,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,cQ)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,cJ)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cK),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,i,n,o,a,s){let l=this.layers[0].layout,u=l.get("line-join").evaluate(e,{}),c=l.get("line-cap").evaluate(e,{}),h=l.get("line-miter-limit"),p=l.get("line-round-limit");for(let i of(this.lineClips=this.lineFeatureClips(e),r))this.addLine(i,e,u,c,h,p);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,o,a,n,s)}addLine(e,r,i,n,o,a){let s,l,u,c,h;this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineS
15oFar=0;let p="none"===i;if(this.patternJoinNone=this.hasPattern&&p,this.segmentStart=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let r=0;r<e.length-1;r++)this.totalDistance+=e[r].dist(e[r+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let d="Polygon"===c1[r.type],f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let m=0;for(;m<f-1&&e[m].equals(e[m+1]);)m++;if(f<(d?3:2))return;"bevel"===i&&(o=1.05);let g=this.overscaling<=16?122880/(512*this.overscaling):0,_=this.segments.prepareSegment(10*f,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,d&&(s=e[f-2],h=e[m].sub(s)._unit()._perp());for(let r=m;r<f;r++){if((u=r===f-1?d?e[m+1]:void 0:e[r+1])&&e[r].equals(u))continue;h&&(c=h),s&&(l=s),s=e[r],h=u?u.sub(s)._unit()._perp():c,c=c||h;let y=l&&u,v=y?i:d||p?"butt":n,x=c.x*h.x+c.y*h.y;if(p){let e=function(e){if(e.patternJoinNone){let r=e.segmentPoints.length/2,i=e.lineSoFar-e.segmentStart;for(let n=0;n<r;++n){let r=e.segmentPoints[2*n+1],o=Math.round(e.segmentPoints[2*n])+.5+.25*r;e.patternVertexArray.emplaceBack(o,i),e.patternVertexArray.emplaceBack(o,i)}e.segmentPoints=[],e.segmentStart=e.lineSoFar}e.e1=e.e2=-1};if(y&&x<c3){this.updateDistance(l,s),this.addCurrentVertex(s,c,1,1,_),e(this),this.addCurrentVertex(s,h,-1,-1,_);continue}if(l){if(!u){this.updateDistance(l,s),this.addCurrentVertex(s,c,1,1,_),e(this);continue}v="miter"}}let b=c.add(h);0===b.x&&0===b.y||b._unit();let w=b.x*h.x+b.y*h.y,E=0!==w?1/w:1/0,S=2*Math.sqrt(2-2*w),T=w<c2&&l&&u,I=c.x*h.y-c.y*h.x>0;if(T&&r>m){let e=s.dist(l);if(e>2*g){let r=s.sub(s.sub(l)._mult(g/e)._round());this.updateDistance(l,r),this.addCurrentVertex(r,c,0,0,_),l=r}}if(y&&"round"===v&&(E<a?v="miter":E<=2&&(v="fakeround")),"miter"===v&&E>o&&(v="bevel"),"bevel"===v&&(E>2&&(v="flipbevel"),E<o&&(v="miter")),l&&this.updateDistance(l,s),"miter"
15===v)b._mult(E),this.addCurrentVertex(s,b,0,0,_);else if("flipbevel"===v){if(E>100)b=h.mult(-1);else{let e=E*c.add(h).mag()/c.sub(h).mag();b._perp()._mult(e*(I?-1:1))}this.addCurrentVertex(s,b,0,0,_),this.addCurrentVertex(s,b.mult(-1),0,0,_)}else if("bevel"===v||"fakeround"===v){let e=-Math.sqrt(E*E-1),r=I?e:0,i=I?0:e;if(l&&this.addCurrentVertex(s,c,r,i,_),"fakeround"===v){let e=Math.round(180*S/Math.PI/20);for(let r=1;r<e;r++){let i=r/e;if(.5!==i){let e=i-.5;i+=i*e*(i-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*e*e+(.848013+x*(.215638*x-1.06021)))}let n=h.sub(c)._mult(i)._add(c)._unit()._mult(I?-1:1);this.addHalfVertex(s,n.x,n.y,!1,I,0,_)}}u&&this.addCurrentVertex(s,h,-r,-i,_)}else"butt"===v?this.addCurrentVertex(s,b,0,0,_):"square"===v?(l||this.addCurrentVertex(s,b,-1,-1,_),this.addCurrentVertex(s,b,0,0,_),l&&this.addCurrentVertex(s,b,1,1,_)):"round"===v&&(l&&(this.addCurrentVertex(s,c,0,0,_),this.addCurrentVertex(s,c,1,1,_,!0)),u&&(this.addCurrentVertex(s,h,-1,-1,_,!0),this.addCurrentVertex(s,h,0,0,_)));if(T&&r<f-1){let e=s.dist(u);if(e>2*g){let r=s.add(u.sub(s)._mult(g/e)._round());this.updateDistance(s,r),this.addCurrentVertex(r,h,0,0,_),s=r}}}}addCurrentVertex(e,r,i,n,o,a=!1){let s=r.y*n-r.x,l=-r.y-r.x*n;this.addHalfVertex(e,r.x+r.y*i,r.y-r.x*i,a,!1,i,o),this.addHalfVertex(e,s,l,a,!0,-n,o),this.patternJoinNone&&this.segmentPoints.push(this.lineSoFar-this.segmentStart,i)}addHalfVertex({x:e,y:r},i,n,o,a,s,l){this.layoutVertexArray.emplaceBack((e<<1)+ +!!o,(r<<1)+ +!!a,Math.round(63*i)+128,Math.round(63*n)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);let u=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),l.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){if(this.lineClips){let e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}oS(c5,"LineBucket",{omit:["layers","patternFeatures"]});let c4=new ab({"line-cap":new av(aS.layout_line["line-cap"]),"line-join":new av(aS.layout_line["line-join"]),"line-miter-limit":new ay(aS.layout_line["line-miter-limit"]),"line-round-limit":new ay(aS.layout_line["line-round-limit"]),"line-sort-key":new av(aS.layout_line["line-sort-key"]),visibility:new ay(aS.layout_line.visibility)});var c6={paint:new ab({"line-opacity":new av(aS.paint_line["line-opacity"]),"line-color":new av(aS.paint_line["line-color"]),"line-translate":new ay(aS.paint_line["line-translate"]),"line-translate-anchor":new ay(aS.paint_line["line-translate-anchor"]),"line-width":new av(aS.paint_line["line-width"]),"line-gap-width":new av(aS.paint_line["line-gap-width"]),"line-offset":new av(aS.paint_line["line-offset"]),"line-blur":new av(aS.paint_line["line-blur"]),"line-dasharray":new av(aS.paint_line["line-dasharray"]),"line-pattern":new av(aS.paint_line["line-pattern"]),"line-gradient":new ax(aS.paint_line["line-gradient"]),"line-trim-offset":new ay(aS.paint_line["line-trim-offset"]),"line-emissive-strength":new ay(aS.paint_line["line-emissive-strength"]),"line-border-width":new av(aS.paint_line["line-border-width"]),"line-border-color":new av(aS.paint_line["line-border-color"])}),layout:c4};function c8(e,r,i){return r*(8192/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}function c9(e,r){return 1/c8(e,1,r.tileZoom)}function c7(e,r,i,n){return e.translatePosMatrix(n||r.tileID.projMatrix,r,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}let he=e=>{let r=[];ht(e)&&r.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&r.push("RENDER_LINE_GRADIENT");let i=e.paint.get("line-trim-offset");0===i[0]&&0===i[1]||r.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&r.push("RENDER_LINE_BORDER");let n="none"===e.layout.get("line-join").constantOr("miter"),o=!!e.paint.get("line-pattern").constantOr(1);return n&&o&&r.push("LINE_JOIN_NONE"),r};function ht(e){let r=e.paint.get("line-dasharray").value;return r.value||"constant"!==r.kind}let hr=new class extends av{possiblyEvaluate(e,r){return r=new au(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,i,n){return r=tL({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,i,n)}}(c6.paint.properties["line-width"].specification);hr.useIntegerZoom=!0;let hi=aj([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),hn=aj([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),ho=aj([{name:"a_projected_pos",components:4,type:"Float32"}],4);aj([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let ha=aj([{name:"a_z_offset",components:1,type:"Float32"}],4),hs=aj([{name:"a_texb",components:2,type:"Uint16"}]),hl=aj([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),hu=aj([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_z_offset",components:1,type:"Float32"}]);aj([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let hc=aj([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),hh=aj([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function hp(e,r){let{expression:i}=r;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new au(e+1))};if("source"===i.kind)return{kind:"source"};{let{zoomStops:r,interpolationType:n}=i,o=0;for(;o<r.length&&r[o]<=e;)o++;let a=o=Math.max(0,o-1);for(;a<r.length&&r[a]<e+1;)a++;a=Math.min(r.length-1,a);let s=r[o],l=r[a];return"composite"===i.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:l,minSize:i.evaluate(new au(s)),maxSize:i.evaluate(new au(l)),interpolationType:n}}}function hd(e,{uSize:r,uSizeT:i},{lowerSize:n,upperSize:o}){return"source"===e.kind?n/128:"composite"===e.kind?r2(n/128,o/128,i):r}function hf(e,r){let i=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){let{interpolationType:o,minZoom:a,maxZoom:s}=e,l=o?tM(nF.interpolationFactor(o,r,a,s),0,1):0;"camera"===e.kind?n=r2(e.minSize,e.maxSize,l):i=l}return{uSizeT:i,uSize:n}}aj([{name:"triangle",components:3,type:"Uint16"}]),aj([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),aj([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),aj([{type:"Float32",name:"offsetX"}]),aj([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var hm=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:128,evaluateSizeForFeature:hd,evaluateSizeForZoom:hf,getSizeData:hp});let hg={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","\xa2":"¢","\xa3":"£","\xa5":"¥","\xa6":"¦","\xac":"¬","\xaf":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};
15var h_=function(e,r,i,n,o){var a,s,l=8*o-n-1,u=(1<<l)-1,c=u>>1,h=-7,p=i?o-1:0,d=i?-1:1,f=e[r+p];for(p+=d,a=f&(1<<-h)-1,f>>=-h,h+=l;h>0;a=256*a+e[r+p],p+=d,h-=8);for(s=a&(1<<-h)-1,a>>=-h,h+=n;h>0;s=256*s+e[r+p],p+=d,h-=8);if(0===a)a=1-c;else{if(a===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),a-=c}return(f?-1:1)*s*Math.pow(2,a-n)},hy=function(e,r,i,n,o,a){var s,l,u,c=8*a-o-1,h=(1<<c)-1,p=h>>1,d=5960464477539062e-23*(23===o),f=n?0:a-1,m=n?1:-1,g=+(r<0||0===r&&1/r<0);for(isNaN(r=Math.abs(r))||r===1/0?(l=+!!isNaN(r),s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),(r+=s+p>=1?d/u:d*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=h?(l=0,s=h):s+p>=1?(l=(r*u-1)*Math.pow(2,o),s+=p):(l=r*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;e[i+f]=255&l,f+=m,l/=256,o-=8);for(s=s<<o|l,c+=o;c>0;e[i+f]=255&s,f+=m,s/=256,c-=8);e[i+f-m]|=128*g};function hv(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}hv.Varint=0,hv.Fixed64=1,hv.Bytes=2,hv.Fixed32=5;var hx="u"<typeof TextDecoder?null:new TextDecoder("utf8");function hb(e){return e.type===hv.Bytes?e.readVarint()+e.pos:e.pos+1}function hw(e,r,i){var n=r<=16383?1:r<=2097151?2:r<=0xfffffff?3:Math.floor(Math.log(r)/(7*Math.LN2));i.realloc(n);for(var o=i.pos-1;o>=e;o--)i.buf[o+n]=i.buf[o]}function hE(e,r){for(var i=0;i<e.length;i++)r.writeVarint(e[i])}function hS(e,r){for(var i=0;i<e.length;i++)r.writeSVarint(e[i])}function hT(e,r){for(var i=0;i<e.length;i++)r.writeFloat(e[i])}function hI(e,r){for(var i=0;i<e.length;i++)r.writeDouble(e[i])}function hM(e,r){for(var i=0;i<e.length;i++)r.writeBoolean(e[i])}function hC(e,r){for(var i=0;i<e.length;i++)r.writeFixed32(e[i])}function hA(e,r){for(var i=0;i<e.length;i++)r.writeSFixed32(e[i])}function hP(e,r){for(var i=0;i<e.length;i++)r.writeFixed64(e[i])}function hL(e,r){for(var i=0;i<e.length;i++)r.writeSFixed64(e[i])}function hO(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+0x1000000*e[r+3]}function hD(e,r,i){e[i]=r,e[i+1]=r>>>8,e[i+2]=r>>>16,e[i+3]=r>>>24}function hR(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16)+(e[r+3]<<24)}hv.prototype={destroy:function(){this.buf=null},readFields:function(e,r,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),o=n>>3,a=this.pos;this.type=7&n,e(o,r,this),this.pos===a&&this.skip(n)}return r},readMessage:function(e,r){return this.readFields(e,r,this.readVarint()+this.pos)},readFixed32:function(){var e=hO(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=hR(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=hO(this.buf,this.pos)+0x100000000*hO(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=hO(this.buf,this.pos)+0x100000000*hR(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=h_(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=h_(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var r,i,n=this.buf;return r=127&(i=n[this.pos++]),i<128?r:(r|=(127&(i=n[this.pos++]))<<7,i<128?r:(r|=(127&(i=n[this.pos++]))<<14,i<128?r:(r|=(127&(i=n[this.pos++]))<<21,i<128?r:function(e,r,i){var n,o,a,s,l=i.buf;if(a=(112&(s=l[i.pos++]))>>4,s<128||(a|=(127&(s=l[i.pos++]))<<3,s<128)||(a|=(127&(s=l[i.pos++]))<<10,s<128)||(a|=(127&(s=l[i.pos++]))<<17,s<128)||(a|=(127&(s=l[i.pos++]))<<24,s<128)||(a|=(1&(s=l[i.pos++]))<<31,s<128)){return n=e,o=a,r?0x100000000*o+(n>>>0):0x100000000*(o>>>0)+(n>>>0)}throw Error("Expected varint not more than 10 bytes")}(r|=(15&(i=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?-((e+1)/2):e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e,r=this.readVarint()+this.pos,i=this.pos;return this.pos=r,r-i>=12&&hx?(e=this.buf,hx.decode(e.subarray(i,r))):function(e,r,i){for(var n="",o=r;o<i;){var a,s,l,u=e[o],c=null,h=u>239?4:u>223?3:u>191?2:1;if(o+h>i)break;1===h?u<128&&(c=u):2===h?128==(192&(a=e[o+1]))&&(c=(31&u)<<6|63&a)<=127&&(c=null):3===h?(s=e[o+2],128==(192&(a=e[o+1]))&&128==(192&s)&&((c=(15&u)<<12|(63&a)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(s=e[o+2],l=e[o+3],128==(192&(a=e[o+1]))&&128==(192&s)&&128==(192&l)&&((c=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&l)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),o+=h}return n}(this.buf,i,r)},readBytes:function(){var e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r}
15,readPackedVarint:function(e,r){if(this.type!==hv.Bytes)return e.push(this.readVarint(r));var i=hb(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(r));return e},readPackedSVarint:function(e){if(this.type!==hv.Bytes)return e.push(this.readSVarint());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==hv.Bytes)return e.push(this.readBoolean());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==hv.Bytes)return e.push(this.readFloat());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==hv.Bytes)return e.push(this.readDouble());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==hv.Bytes)return e.push(this.readFixed32());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==hv.Bytes)return e.push(this.readSFixed32());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==hv.Bytes)return e.push(this.readFixed64());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==hv.Bytes)return e.push(this.readSFixed64());var r=hb(this);for(e=e||[];this.pos<r;)e.push(this.readSFixed64());return e},skip:function(e){var r=7&e;if(r===hv.Varint)for(;this.buf[this.pos++]>127;);else if(r===hv.Bytes)this.pos=this.readVarint()+this.pos;else if(r===hv.Fixed32)this.pos+=4;else{if(r!==hv.Fixed64)throw Error("Unimplemented type: "+r);this.pos+=8}},writeTag:function(e,r){this.writeVarint(e<<3|r)},realloc:function(e){for(var r=this.length||16;r<this.pos+e;)r*=2;if(r!==this.length){var i=new Uint8Array(r);i.set(this.buf),this.buf=i,this.length=r}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),hD(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),hD(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),hD(this.buf,-1&e,this.pos),hD(this.buf,Math.floor(23283064365386963e-26*e),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),hD(this.buf,-1&e,this.pos),hD(this.buf,Math.floor(23283064365386963e-26*e),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>0xfffffff||e<0?function(e,r){var i,n,o,a,s;if(e>=0?(i=e%0x100000000|0,n=e/0x100000000|0):(n=~(-e/0x100000000),0xffffffff^(i=~(-e%0x100000000))?i=i+1|0:(i=0,n=n+1|0)),e>=0xffffffffffffffff||e<-0xffffffffffffffff)throw Error("Given varint doesn't fit into 10 bytes");r.realloc(10),o=i,r.buf[r.pos++]=127&o|128,o>>>=7,r.buf[r.pos++]=127&o|128,o>>>=7,r.buf[r.pos++]=127&o|128,o>>>=7,r.buf[r.pos++]=127&o|128,r.buf[r.pos]=127&(o>>>=7),s=(7&(a=n))<<4,r.buf[r.pos++]|=s|128*!!(a>>>=3),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a|128*!!(a>>>=7),a&&(r.buf[r.pos++]=127&a)))))}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|128*(e>127),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|128*(e>127),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|128*(e>127),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?-(2*e)-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var r=this.pos;this.pos=function(e,r,i){for(var n,o,a=0;a<r.length;a++){if((n=r.charCodeAt(a))>55295&&n<57344){if(!o){n>56319||a+1===r.length?(e[i++]=239,e[i++]=191,e[i++]=189):o=n;continue}if(n<56320){e[i++]=239,e[i++]=191,e[i++]=189,o=n;continue}n=o-55296<<10|n-56320|65536,o=null}else o&&(e[i++]=239,e[i++]=191,e[i++]=189,o=null);n<128?e[i++]=n:(n<2048?e[i++]=n>>6|192:(n<65536?e[i++]=n>>12|224:(e[i++]=n>>18|240,e[i++]=n>>12&63|128),e[i++]=n>>6&63|128),e[i++]=63&n|128)}return i}(this.buf,e,this.pos);var i=this.pos-r;i>=128&&hw(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),hy(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),hy(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var r=e.length;this.writeVarint(r),this.realloc(r);for(var i=0;i<r;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,r){this.pos++;var i=this.pos;e(r,this);var n=this.pos-i;n>=128&&hw(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,r,i){this.writeTag(e,hv.Bytes),this.writeRawMessage(r,i)},writePackedVarint:function(e,r){r.length&&this.writeMessage(e,hE,r)},writePackedSVarint:function(e,r){r.length&&this.writeMessage(e,hS,r)},writePackedBoolean:function(e,r){r.length&&this.writeMessage(e,hM,r)},writePackedFloat:function(e,r){r.length&&this.writeMessage(e,hT,r)},writePackedDouble:function(e,r){r.length&&this.writeMessage(e,hI,r)},writePackedFixed32:function(e,r){r.length&&this.writeMessage(e,hC,r)},writePackedSFixed32:function(e,r){r.length&&this.writeMessage(e,hA,r)},writePackedFixed64:function(e,r){r.length&&this.writeMessage(e,hP,r)},writePackedSFixed64:function(e,r){r.length&&this.writeMessage(e,hL,r)},writeBytesField:function(e,r){this.writeTag(e,hv.Bytes),this.writeBytes(r)},writeFixed32Field:function(e,r){this.writeTag(e,hv.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(e,r){this.writeTag(e,hv.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(e,r){this.writeTag(e,hv.Fixed64),this.writeFixed64
15(r)},writeSFixed64Field:function(e,r){this.writeTag(e,hv.Fixed64),this.writeSFixed64(r)},writeVarintField:function(e,r){this.writeTag(e,hv.Varint),this.writeVarint(r)},writeSVarintField:function(e,r){this.writeTag(e,hv.Varint),this.writeSVarint(r)},writeStringField:function(e,r){this.writeTag(e,hv.Bytes),this.writeString(r)},writeFloatField:function(e,r){this.writeTag(e,hv.Fixed32),this.writeFloat(r)},writeDoubleField:function(e,r){this.writeTag(e,hv.Fixed64),this.writeDouble(r)},writeBooleanField:function(e,r){this.writeVarintField(e,!!r)}};var hk=M(hv);function hN(e,r,i){r.glyphs=[],1===e&&i.readMessage(hF,r)}function hF(e,r,i){if(3===e){let{id:e,bitmap:n,width:o,height:a,left:s,top:l,advance:u}=i.readMessage(hz,{});r.glyphs.push({id:e,bitmap:new ux({width:o+6,height:a+6},n),metrics:{width:o,height:a,left:s,top:l,advance:u}})}else 4===e?r.ascender=i.readSVarint():5===e&&(r.descender=i.readSVarint())}function hz(e,r,i){1===e?r.id=i.readVarint():2===e?r.bitmap=i.readBytes():3===e?r.width=i.readVarint():4===e?r.height=i.readVarint():5===e?r.left=i.readSVarint():6===e?r.top=i.readSVarint():7===e&&(r.advance=i.readVarint())}let hB={horizontal:1,vertical:2,horizontalOnly:3};class hU{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){let i=new hU;return i.scale=e||1,i.fontStack=r,i}static forImage(e){let r=new hU;return r.imageName=e,r}}class hj{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){let i=new hj;for(let n=0;n<e.sections.length;n++){let o=e.sections[n];o.image?i.addImageSection(o):i.addTextSection(o,r)}return i}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=function(e,r){let i="";for(let n=0;n<e.length;n++){let o=e.charCodeAt(n+1)||null,a=e.charCodeAt(n-1)||null;i+=!r&&(o&&o4(o)&&!hg[e[n+1]]||a&&o4(a)&&!hg[e[n-1]])||!hg[e[n]]?e[n]:hg[e[n]]}return i}(this.text,e)}trim(){let e=0;for(let r=0;r<this.text.length&&hG[this.text.charCodeAt(r)];r++)e++;let r=this.text.length;for(let i=this.text.length-1;i>=0&&i>=e&&hG[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){let i=new hj;return i.text=this.text.substring(e,r),i.sectionIndex=this.sectionIndex.slice(e,r),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(hU.forText(e.scale,e.fontStack||r));let i=this.sections.length-1;for(let r=0;r<e.text.length;++r)this.sectionIndex.push(i)}addImageSection(e){let r=e.image?e.image.namePrimary:"";if(0===r.length)return void tG("Can't add FormattedSection with an empty image.");let i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCodePoint(i),this.sections.push(hU.forImage(r)),this.sectionIndex.push(this.sections.length-1)):tG("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function hV(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m){let g=hj.fromFeature(e,o);p===hB.vertical&&g.verticalizePunctuation(d);let _=[],y=function(e,r,i,n,o,a){if(!e)return[];let s=[],l=function(e,r,i,n,o,a){let s=0;for(let i=0;i<e.length();i++){let l=e.getSection(i);s+=hH(e.getCodePoint(i),l,n,o,r,a)}return s/Math.max(1,Math.ceil(s/i))}(e,r,i,n,o,a),u=e.text.indexOf("​")>=0,c=0;for(let i=0;i<e.length();i++){let h=e.getSection(i),p=e.getCodePoint(i);if(hG[p]||(c+=hH(p,h,n,o,r,a)),i<e.length()-1){let r=!(p<11904||!(oU(p)||oB(p)||oJ(p)||oX(p)||oq(p)||oD(p)||oj(p)||oN(p)||oH(p)||o$(p)||oG(p)||o2(p)||oF(p)||ok(p)||oR(p)||oV(p)||oz(p)||oQ(p)||oY(p)||oW(p)));(hq[p]||r||h.imageName)&&s.push(hW(i+1,c,l,s,function(e,r,i){let n=0;return 10===e&&(n-=1e4),i&&(n+=150),40!==e&&65288!==e||(n+=50),41!==r&&65289!==r||(n+=50),n}(p,e.getCodePoint(i+1),r&&u),!1))}}return function e(r){return r?e(r.priorBreak).concat(r.index):[]}(hW(e.length(),c,l,s,0,!0))}(g,c,a,r,n,f),{processBidirectionalText:v,processStyledBidirectionalText:x}=al;if(v&&1===g.sections.length)for(let e of v(g.toString(),y)){let r=new hj;r.text=e,r.sections=g.sections;for(let i=0;i<e.length;i++)r.sectionIndex.push(0);_.push(r)}else if(x)for(let e of x(g.text,g.sectionIndex,y)){let r=new hj;r.text=e[0],r.sectionIndex=e[1],r.sections=g.sections,_.push(r)}else _=function(e,r){let i=[],n=e.text,o=0;for(let n of r)i.push(e.substring(o,n)),o=n;return o<n.length&&i.push(e.substring(o,n.length)),i}(g,y);let b=[],w={positionedLines:b,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:p,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(e,r,i,n,o,a,s,l,u,c,h,p){let d=0,f=0,m=0,g="right"===l?1:.5*("left"!==l),_=!1;for(let e of o){for(let i of e.getSections()){if(i.imageName)continue;let e=r[i.fontStack];
15if(e&&!(_=void 0!==e.ascender&&void 0!==e.descender))break}if(!_)break}let y=0;for(let s of o){s.trim();let o=s.getMaxScale(),l=(o-1)*24,v={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=v;let x=v.positionedGlyphs,b=0;if(!s.length()){f+=a,++y;continue}let w=0,E=0;for(let a=0;a<s.length();a++){let l=s.getSection(a),m=s.getSectionIndex(a),g=s.getCodePoint(a),y=l.scale,v=null,S=null,T=null,I=24,M=0,C=!(u===hB.horizontal||!h&&!o5(g)||h&&(hG[g]||oA(g)||oP(g)||oL(g)||oK(g)||o1(g)));if(l.imageName){let r=n[l.imageName];if(!r)continue;T=l.imageName,e.iconsInText=e.iconsInText||!0,S=r.paddedRect;let i=r.displaySize;y=24*y/p,v={width:i[0],height:i[1],left:0,top:-3,advance:C?i[1]:i[0],localGlyph:!1},M=_?-v.height*y:24*o-17-i[1]*y,I=v.advance;let a=(C?i[0]:i[1])*y-24*o;a>0&&a>b&&(b=a)}else{let e=i[l.fontStack];if(!e)continue;e[g]&&(S=e[g]);let n=r[l.fontStack];if(!n)continue;let a=n.glyphs[g];if(!a)continue;if(v=a.metrics,I=24*(8203!==g),_){let e=void 0!==n.ascender?Math.abs(n.ascender):0,r=void 0!==n.descender?Math.abs(n.descender):0,i=(e+r)*y;w<i&&(w=i,E=(e-r)/2*y),M=-e*y}else M=(o-y)*24-17}C?(e.verticalizable=!0,x.push({glyph:g,imageName:T,x:d,y:f+M,vertical:C,scale:y,localGlyph:v.localGlyph,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:S}),d+=I*y+c):(x.push({glyph:g,imageName:T,x:d,y:f+M,vertical:C,scale:y,localGlyph:v.localGlyph,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:S}),d+=v.advance*y+c)}0!==x.length&&(m=Math.max(d-c,m),_?hZ(x,g,b,E,a*o/2):hZ(x,g,b,0,a/2)),d=0;let S=a*o+b;v.lineOffset=Math.max(b,l),f+=S,++y}let v=f,{horizontalAlign:x,verticalAlign:b}=hY(s);(function(e,r,i,n,o,a){let s=(r-i)*o,l=-a*n;for(let r of e)for(let e of r.positionedGlyphs)e.x+=s,e.y+=l})(e.positionedLines,g,x,b,m,v),e.top+=-b*v,e.bottom=e.top+v,e.left+=-x*m,e.right=e.left+m,e.hasBaseline=_}(w,r,i,n,_,s,l,u,p,c,d,m),!function(e){for(let r of e)if(0!==r.positionedGlyphs.length)return!1;return!0}(b)&&w}let hG={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},hq={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function hH(e,r,i,n,o,a){if(r.imageName){let e=n[r.imageName];return e?e.displaySize[0]*r.scale*24/a+o:0}{let n=i[r.fontStack],a=n&&n.glyphs[e];return a?a.metrics.advance*r.scale+o:0}}function h$(e,r,i,n){let o=Math.pow(e-r,2);return n?e<r?o/2:2*o:o+Math.abs(i)*i}function hW(e,r,i,n,o,a){let s=null,l=h$(r,i,o,a);for(let e of n){let n=h$(r-e.x,i,o,a)+e.badness;n<=l&&(s=e,l=n)}return{index:e,x:r,priorBreak:s,badness:l}}function hY(e){let r=.5,i=.5;switch(e){case"right":case"top-right":case"bottom-right":r=1;break;case"left":case"top-left":case"bottom-left":r=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:r,verticalAlign:i}}function hZ(e,r,i,n,o){if(!(r||i||n||o))return;let a=e.length-1,s=e[a],l=(s.x+s.metrics.advance*s.scale)*r;for(let r=0;r<=a;r++)e[r].x-=l,e[r].y+=i+n+o}function hX(e,r,i,n,o,a){let s,l,u,c,h,p=e.imagePrimary;if(p.content){let e=p.content,r=p.pixelRatio||1;s=[e[0]/r,e[1]/r,p.displaySize[0]-e[2]/r,p.displaySize[1]-e[3]/r]}let d=r.left*a,f=r.right*a;"width"===i||"both"===i?(h=o[0]+d-n[3],u=o[0]+f+n[1]):u=(h=o[0]+(d+f-p.displaySize[0])/2)+p.displaySize[0];let m=r.top*a,g=r.bottom*a;return"height"===i||"both"===i?(l=o[1]+m-n[0],c=o[1]+g+n[2]):c=(l=o[1]+(m+g-p.displaySize[1])/2)+p.displaySize[1],{imagePrimary:p,imageSecondary:void 0,top:l,right:u,bottom:c,left:h,collisionPadding:s}}class hK extends tx{constructor(e,r,i,n,o){super(e,r),this.angle=n,this.z=i,void 0!==o&&(this.segment=o)}clone(){return new hK(this.x,this.y,this.z,this.angle,this.segment)}}function hQ(e,r,i,n,o){if(void 0===r.segment)return!0;let a=r,s=r.segment+1,l=0;for(;l>-i/2;){if(--s<0)return!1;l-=e[s].dist(a),a=e[s]}l+=e[s].dist(e[s+1]),s++;let u=[],c=0;for(;l<i/2;){let r=e[s],i=e[s+1];if(!i)return!1;let a=e[s-1].angleTo(r)-r.angleTo(i);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:l,angleDelta:a}),c+=a;l-u[0].distance>n;)c-=u.shift().angleDelta;if(c>o)return!1;s++,l+=r.dist(i)}return!0}function hJ(e){let r=0;for(let i=0;i<e.length-1;i++)r+=e[i].dist(e[i+1]);return r}function h0(e,r){return Math.max(e?e.right-e.left:0,r?r.right-r.left:0)}function h1(e,r,i,n,o){let a=[];for(let s=0;s<e.length;s++){let l,u=e[s];for(let e=0;e<u.length-1;e++){let s=u[e],c=u[e+1];s.x<r&&c.x<r||(s.x<r?s=new tx(r,s.y+(r-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x<r&&(c=new tx(r,s.y+(r-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y<i&&c.y<i||(s.y<i?s=new tx(s.x+(i-s.y)/(c.y-s.y)*(c.x-s.x),i)._round():c.y<i&&(c=new tx(s.x+(i-s.y)/(c.y-s.y)*(c.x-s.x),i)._round()),s.x>=n&&c.x>=n||(s.x>=n?s=new tx(n,s.y+(n-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x>=n&&(c=new tx(n,s.y+(n-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y>=o&&c.y>=o||(s.y>=o?s=new tx(s.x+(o-s.y)/(c.y-s.y)*(c.x-s.x),o)._round():c.y>=o&&(c=new tx(s.x+(o-s.y)/(c.y-s.y)*(c.x-s.x),o)._round()),l&&s.equals(l[l.length-1])||(l=[s],a.push(l)),l.push(c)))))}}return a}function h2(e){let r=0,i=0;for(let n of e)r+=n.w*n.h,i=Math.max(i,n.w);e.sort((e,r)=>r.h-e.h);let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),i),h:1/0}],o=0,a=0;for(let r of e)for(let e=n.length-1;e>=0;e--){let i=n[e];if(!(r.w>i.w||r.h>i.h)){if(r.x=i.x,r.y=i.y,a=Math.max(a,r.y+r.h),o=Math.max(o,r.x+r.w),r.w===i.w&&r.h===i.h){let r=n.pop();e<n.length&&(n[e]=r)}else r.h===i.h?(i.x+=r.w,i.w-=r.w):(r.w===i.w||n.push({x:i.x+r.w,y:i.y,w:i.w-r.w,h:r.h}),i.y+=r.h,i.h-=r.h);break}}return{w:o,h:a,fill:r/(o*a)||0}}oS(hK,"Anchor");class h3{constructor(e,{pixelRatio:r,version:i,stretchX:n,stretchY:o,content:a}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=n,this.stretchY=o,this.content=a,this.version=i}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class h5{constructor(e,r){const i={},n={};this.haveRenderCallbacks=[];const o=[];this.addImages(e,i,o),this.addImages(r,n,o);const{w:a,h:s}=h2(o),l=new ub({width:a||1,height:s||1});for(const r in e){const n=e[r],o=i[r].paddedRect;ub.copy(n.data,l,{x:0,y:0},{x:o.x+1,y:o.y+1},n.data,n.sdf)}for(const e in r){const i=r[e],o=n[e].paddedRect,a=o.x+1,s=o.y+1,u=i.data.width,c=i.data.height;ub.copy(i.data,l,{x:0,y:0},{x:a,y:s},i.data),ub.copy(i.data,l,{x:0,y:c-1},{x:a,y:s-1},{width:u,height:1}),ub.copy(i.data,l,{x:0,y:0},{x:a,y:s+c},{width:u,height:1}),ub.copy(i.data,l,{x:u-1,y:0},{x:a-1,y:s},{width:1,height:c}),ub.copy(i.data,l,{x:0,y:0},{x:a+u,y:s},{width:1,height:c})}this.image=l,this.iconPositions=i,this.patternPositions=n}addImages(e,r,i){for(let n in e){let o=e[n],a={x:0,y:0,w:o.data.width+2,h:o.data.height+2};i.push(a),r[n]=new h3(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,r,i){for(let n in this.haveRenderCallbacks=this.haveRenderCallbacks.filter(r=>e.hasImage(r,i)),e.dispatchRenderCallbacks(this.haveRenderCallbacks,i),e.getUpdatedImages(i))this.patchUpdatedImage(this.iconPositions[n],e.getImage(n,i),r),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n,i),r)}patchUpdatedImage(e,r,i){if(!e||!r||e.version===r.version)return;e.version=r.version;let[n,o]=e.tl,a=!!Object.keys(this.patternPositions).length;i.update(r.data,{useMipmap:a},{x:n,y:o})}}function h4(e,r,i,n,o,a,s,l,u){for(let c=r;c<r+n;c++)h6(e,i*a+c,a,o,s,l,u);for(let c=i;c<i+o;c++)h6(e,c*a+r,1,n,s,l,u)}function h6(e,r,i,n,o,a,s){a[0]=0,s[0]=-1e20,s[1]=1e20,o[0]=e[r];for(let l=1,u=0,c=0;l<n;l++){o[l]=e[r+l*i];let n=l*l;do{let e=a[u];c=(o[l]-o[e]+n-e*e)/(l-e)/2}while(c<=s[u]&&--u>-1);a[++u]=l,s[u]=c,s[u+1]=1e20}for(let l=0,u=0;l<n;l++){for(;s[u+1]<l;)u++;let n=a[u],c=l-n;e[r+l*i]=o[n]+c*c}}oS(h3,"ImagePosition"),oS(h5,"ImageAtlas");let h8={none:0,ideographs:1,all:2};class h9{constructor(e,r,i){this.requestManager=e,this.localGlyphMode=r,this.localFontFamily=i,this.urls={},this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e,r){this.urls[r]=e}getGlyphs(e,r,i){let n=[],o=this.urls[r]||v.GLYPHS_URL;for(let r in e)for(let i of e[r])n.push({stack:r,id:i});tP(n,({stack:e,id:r},i)=>{let n=this.entries[e];n||(n=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let a=n.glyphs[r];if(void 0!==a)return void i(null,{stack:e,id:r,glyph:a});if(a=this._tinySDF(n,e,r))return n.glyphs[r]=a,void i(null,{stack:e,id:r,glyph:a});let s=Math.floor(r/256);if(256*s>65535)return void i(Error("glyphs > 65535 not supported"));if(n.ranges[s])return void i(null,{stack:e,id:r,glyph:a});let l=n.requests[s];l||(l=n.requests[s]=[],h9.loadGlyphRange(e,s,o,this.requestManager,(e,r)=>{if(r){for(let e in n.ascender=r.ascender,n.descender=r.descender,r.glyphs)this._doesCharSupportLocalGlyph(+e)||(n.glyphs[+e]=r.glyphs[+e]);n.ranges[s]=!0}for(let i of l)i(e,r);delete n.requests[s]})),l.push((n,o)=>{n?i(n):o&&i(null,{stack:e,id:r,glyph:o.glyphs[r]||null})})},(e,r)=>{if(e)i(e);else if(r){let e={};for(let{stack:i,id:n,glyph:o}of r)void 0===e[i]&&(e[i]={}),void 0===e[i].glyphs&&(e[i].glyphs={}),e[i].glyphs[n]=o&&{id:o.id,bitmap:o.bitmap.clone(),metrics:o.metrics},e[i].ascender=this.entries[i].ascender,e[i].descender=this.entries[i].descender;i(null,e)}})}_doesCharSupportLocalGlyph(e){let r;return this.localGlyphMode!==h8.none&&(this.localGlyphMode===h8.all?!!this.localFontFamily:!!this.localFontFamily&&
15(o$(e)||oZ(e)||oF(e)||oz(e)||oN(e)||oH(e)||(r=e)>=131072&&r<=173791))}_tinySDF(e,r,i){let n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let o=e.tinySDF;if(!o){let i="400";/bold/i.test(r)?i="900":/medium/i.test(r)?i="500":/light/i.test(r)&&(i="200"),(o=e.tinySDF=new h9.TinySDF({fontFamily:n,fontWeight:i,fontSize:48,buffer:6,radius:16})).fontWeight=i}if(this.localGlyphs[o.fontWeight][i])return this.localGlyphs[o.fontWeight][i];let a=String.fromCodePoint(i),{data:s,width:l,height:u,glyphWidth:c,glyphHeight:h,glyphLeft:p,glyphTop:d,glyphAdvance:f}=o.draw(a);return this.localGlyphs[o.fontWeight][i]={id:i,bitmap:new ux({width:l,height:u},s),metrics:{width:c/2,height:h/2,left:p/2,top:d/2-27,advance:f/2,localGlyph:!0}}}}function h7(e,r,i,n){let o=[],a=e.imagePrimary,s=a.pixelRatio,l=a.paddedRect.w-2,u=a.paddedRect.h-2,c=e.right-e.left,h=e.bottom-e.top,p=a.stretchX||[[0,l]],d=a.stretchY||[[0,u]],f=(e,r)=>e+r[1]-r[0],m=p.reduce(f,0),g=d.reduce(f,0),_=l-m,y=u-g,v=0,x=m,b=0,w=g,E=0,S=_,T=0,I=y;if(a.content&&n){let e=a.content;v=pe(p,0,e[0]),b=pe(d,0,e[1]),x=pe(p,e[0],e[2]),w=pe(d,e[1],e[3]),E=e[0]-v,T=e[1]-b,S=e[2]-e[0]-x,I=e[3]-e[1]-w}let M=(n,o,l,u)=>{var p,d,f,_,y,M,C,A,P,L,O,D,R,k,N,F;let z=(p=n.stretch-v,p/x*c+e.left),B=(d=n.fixed-E,f=S,_=n.stretch,d-f*_/m),U=(y=o.stretch-b,y/w*h+e.top),j=(M=o.fixed-T,C=I,A=o.stretch,M-C*A/g),V=(P=l.stretch-v,P/x*c+e.left),G=(L=l.fixed-E,O=S,D=l.stretch,L-O*D/m),q=(R=u.stretch-b,R/w*h+e.top),H=(k=u.fixed-T,N=I,F=u.stretch,k-N*F/g),$=new tx(z,U),W=new tx(V,U),Y=new tx(V,q),Z=new tx(z,q),X=new tx(B/s,j/s),K=new tx(G/s,H/s),Q=r*Math.PI/180;if(Q){let e=Math.sin(Q),r=Math.cos(Q),i=[r,-e,e,r];$._matMult(i),W._matMult(i),Z._matMult(i),Y._matMult(i)}let J=n.stretch+n.fixed,ee=l.stretch+l.fixed,et=o.stretch+o.fixed,er=u.stretch+u.fixed,ei=e.imageSecondary;return{tl:$,tr:W,bl:Z,br:Y,texPrimary:{x:a.paddedRect.x+1+J,y:a.paddedRect.y+1+et,w:ee-J,h:er-et},texSecondary:ei?{x:ei.paddedRect.x+1+J,y:ei.paddedRect.y+1+et,w:ee-J,h:er-et}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:X,pixelOffsetBR:K,minFontScaleX:S/s/c,minFontScaleY:I/s/h,isSDF:i}};if(n&&(a.stretchX||a.stretchY)){let e=pt(p,_,m),r=pt(d,y,g);for(let i=0;i<e.length-1;i++){let n=e[i],a=e[i+1];for(let e=0;e<r.length-1;e++)o.push(M(n,r[e],a,r[e+1]))}}else o.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));return o}function pe(e,r,i){let n=0;for(let o of e)n+=Math.max(r,Math.min(i,o[1]))-Math.max(r,Math.min(i,o[0]));return n}function pt(e,r,i){let n=[{fixed:-1,stretch:0}];for(let[r,i]of e){let e=n[n.length-1];n.push({fixed:r-e.stretch,stretch:e.stretch}),n.push({fixed:r-e.stretch,stretch:e.stretch+(i-r)})}return n.push({fixed:r+1,stretch:i}),n}h9.loadGlyphRange=function(e,r,i,n,o){let a=256*r;ry(n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",`${a}-${a+255}`),rf.Glyphs),(e,r)=>{if(e)o(e);else if(r){let e={},i=new hk(r).readFields(hN,{});for(let r of i.glyphs)e[r.id]=r;o(null,{glyphs:e,ascender:i.ascender,descender:i.descender})}})},h9.TinySDF=class{constructor({fontSize:e=24,buffer:r=3,radius:i=8,cutoff:n=.25,fontFamily:o="sans-serif",fontWeight:a="normal",fontStyle:s="normal"}={}){this.buffer=r,this.cutoff=n,this.radius=i;const l=this.size=e+4*r,u=this._createCanvas(l),c=this.ctx=u.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${a} ${e}px ${o}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){let r=document.createElement("canvas");return r.width=r.height=e,r}draw(e){let{width:r,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:o,actualBoundingBoxRight:a}=this.ctx.measureText(e),s=Math.ceil(i),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-o))),u=Math.min(this.size-this.buffer,s+Math.ceil(n)),c=l+2*this.buffer,h=u+2*this.buffer,p=Math.max(c*h,0),d=new Uint8ClampedArray(p),f={data:d,width:c,height:h,glyphWidth:l,glyphHeight:u,glyphTop:s,glyphLeft:0,glyphAdvance:r};if(0===l||0===u)return f;let{ctx:m,buffer:g,gridInner:_,gridOuter:y}=this;m.clearRect(g,g,l,u),m.fillText(e,g,g+s);let v=m.getImageData(g,g,l,u);y.fill(1e20,0,p),_.fill(0,0,p);for(let e=0;e<u;e++)for(let r=0;r<l;r++){let i=v.data[4*(e*l+r)+3]/255;if(0===i)continue;let n=(e+g)*c+r+g;if(1===i)y[n]=0,_[n]=1e20;else{let e=.5-i;y[n]=e>0?e*e:0,_[n]=e<0?e*e:0}}h4(y,0,0,c,h,c,this.f,this.v,this.z),h4(_,g,g,l,u,c,this.f,this.v,this.z);for(let e=0;e<p;e++){let r=Math.sqrt(y[e])-Math.sqrt(_[e]);d[e]=Math.round(255-255*(r/this.radius+this.cutoff))}return f}};function pr(e,r){return r.max-e.max}class pi{constructor(e,r,i,n){this.p=new tx(e,r),this.h=i,this.d=function(e,r){let i=!1,n=1/0;for(let o=0;o<r.length;o++){let a=r[o];for(let r=0,o=a.length,s=o-1;r<o;s=r++){let o=a[r],l=a[s];o.y>e.y!=l.y>e.y&&e.x<(l.x-o.x)*(e.y-o.y)/(l.y-o.y)+o.x&&(i=!i),n=Math.min(n,lM(e,o,l))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}let pn=1/0,po=Math.sqrt(2);function pa(e,[r,i]){let n=0,o=0;if(i===pn){r<0&&(r=0);let i=r/po;switch(e){case"top-right":case"top-left":o=i-7;break;case"bottom-right":case"bottom-left":o=7-i;break;case"bottom":o=7-r;break;case"top":o=r-7}switch(e){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=r;break;case"right":n=-r}}else{switch(r=Math.abs(r),i=Math.abs(i),e){case"top-right":case"top-left":case"top":o=i-7;break;case"bottom-right":case"bottom-left":case"bottom":o=7-i}switch(e){case"top-right":case"bottom-right":case"right":n=-r;break;case"top-left":case"bottom-left":case"left":n=r}}return[n,o]}function ps(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function pl(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y){let v=function(e,r,i,n,o,a,s){let l,u,c,h=[];if(0===e.positionedLines.length)return h;let p=i.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,d=(l=r[0],(c=l*(u=r[1]))>0?[l,-u]:c<0?[-l,u]:0===l?[u,l]:[u,-l]),f=Math.abs(e.top-e.bottom);for(let r of e.positionedLines)f-=r.lineOffset;let m=e.positionedLines.length,g=f/m,_=e.top-r[1];for(let i=0;i<m;++i){let o=e.positionedLines[i];for(let l of(_=function(e,r,i,n){let o=r+e.positionedLines[n].lineOffset;return 0===n?i+o/2:i+(o+(r+e.positionedLines[n-1].lineOffset))/2}(e,g,_,i),o.positionedGlyphs)){let i,o,u,c;if(!l.rect)continue;let f=l.rect||{},m=4,g=!0,y=1,v=0;if(l.imageName){let e=a[l.imageName];if(!e)continue;if(e.sdf){tG("SDF images are not supported in formatted text and will be ignored.");continue}g=!1,m=1/(y=e.pixelRatio)}let x=(n||s)&&l.vertical,b=l.metrics.advance*l.scale/2,w=l.metrics,E=l.rect;if(null===E)continue;s&&e.verticalizable&&(v=l.imageName?b-l.metrics.width*l.scale/2:0);let S=n?[l.x+b,l.y]:[0,0],T=[0,0],I=[0,0],M=!1;n||(x?(I=[l.x+b+d[0],l.y+d[1]-v],M=!0):T=[l.x+b+r[0],l.y+r[1]-v]);let C=E.w*l.scale/(y*(l.localGlyph?2:1)),A=E.h*l.scale/(y*(l.localGlyph?2:1));if(x){let e=l.y-_,r=new tx(-b,b-e),n=-Math.PI/2,a=new tx(...I);
15(i=new tx(-b+T[0],T[1]))._rotateAround(n,r)._add(a),i.x+=-e+b,i.y-=(w.left-m)*l.scale;let s=l.imageName?w.advance*l.scale:24*l.scale,h=String.fromCodePoint(l.glyph);"︶"===h||"﹈"===h||"︸"===h||"﹄"===h||"﹂"===h||"︾"===h||"︼"===h||"︺"===h||"︘"===h||"﹀"===h||"︐"===h||"︓"===h||"︔"===h||"`"===h||" ̄"===h||"︑"===h||"︒"===h?i.x+=(1-m)*l.scale:"︵"===h||"﹇"===h||"︷"===h||"﹃"===h||"﹁"===h||"︽"===h||"︻"===h||"︹"===h||"︗"===h||"︿"===h?i.x+=s-w.height*l.scale+(-m-1)*l.scale:i.x+=l.imageName||w.width+2*m===E.w&&w.height+2*m===E.h?(s-A)/2:(s-(w.height+2*m)*l.scale)/2,o=new tx(i.x,i.y-C),u=new tx(i.x+A,i.y),c=new tx(i.x+A,i.y-C)}else{let e=(w.left-m)*l.scale-b+T[0],r=(-w.top-m)*l.scale+T[1],n=e+C,a=r+A;i=new tx(e,r),o=new tx(n,r),u=new tx(e,a),c=new tx(n,a)}if(p){let e;e=n?new tx(0,0):M?new tx(d[0],d[1]):new tx(r[0],r[1]),i._rotateAround(p,e),o._rotateAround(p,e),u._rotateAround(p,e),c._rotateAround(p,e)}let P=new tx(0,0),L=new tx(0,0);h.push({tl:i,tr:o,bl:u,br:c,texPrimary:f,texSecondary:void 0,writingMode:e.writingMode,glyphOffset:S,sectionIndex:l.sectionIndex,isSDF:g,pixelOffsetTL:P,pixelOffsetBR:L,minFontScaleX:0,minFontScaleY:0})}}return h}(n,u,a,s,l,o,e.allowVerticalPlacement),x=e.textSizeData,b=null;for(let n of("source"===x.kind?(b=[128*a.layout.get("text-size").evaluate(l,{},_)])[0]>32640&&tG(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`):"composite"===x.kind&&((b=[128*m.compositeTextSizes[0].evaluate(l,{},_),128*m.compositeTextSizes[1].evaluate(l,{},_)])[0]>32640||b[1]>32640)&&tG(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`),e.addSymbols(e.text,v,b,u,s,l,h,r,i,c.lineStartIndex,c.lineLength,f,g,_,y,!1),p))d[n]=e.text.placedSymbolArray.length-1;return 4*v.length}function pu(e){for(let r in e)return e[r];return null}function pc(e,r,i,n,o,a,s,l,u,c){let h=s.top,p=s.bottom,d=s.left,f=s.right,m=s.collisionPadding;if(m&&(d-=m[0],h-=m[1],f+=m[2],p+=m[3]),u){let e=new tx(d,h),r=new tx(f,h),i=new tx(d,p),n=new tx(f,p),o=u*tb,a=new tx(0,0);c&&(a=new tx(c[0],c[1])),e._rotateAround(o,a),r._rotateAround(o,a),i._rotateAround(o,a),n._rotateAround(o,a),d=Math.min(e.x,r.x,i.x,n.x),f=Math.max(e.x,r.x,i.x,n.x),h=Math.min(e.y,r.y,i.y,n.y),p=Math.max(e.y,r.y,i.y,n.y)}return e.emplaceBack(r.x,r.y,r.z,i.x,i.y,d,h,f,p,l,n,o,a),e.length-1}function ph(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);let r=e.bottom-e.top;return r>0?Math.max(10,r):null}function pp(e,r){let i=e.fovAboveCenter,n=e.elevation?e.elevation.getMinElevationBelowMSL()*r:0,o=(e._camera.position[2]*e.worldSize-n)/Math.cos(e._pitch),a=Math.sin(i)*o/Math.sin(Math.max(Math.PI/2-e._pitch-i,.01));return Math.min(1.01*(Math.sin(e._pitch)*a+o),o*(1/e._horizonShift))}function pd(e,r){if(!r.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:r};let i=Math.pow(2,-e.z),n=e.x*i,o=(e.x+1)*i,a=e.y*i,s=(e.y+1)*i,l=lu(n),u=lu(o),c=lc(a),h=lc(s),p=r.project(l,c),d=r.project(u,c),f=r.project(u,h),m=r.project(l,h),g=Math.min(p.x,d.x,f.x,m.x),_=Math.min(p.y,d.y,f.y,m.y),y=Math.max(p.x,d.x,f.x,m.x),v=Math.max(p.y,d.y,f.y,m.y),x=i/16;function b(e,i,n,o,a,s){let l=(n+a)/2,u=(o+s)/2,c=r.project(lu(l),lc(u)),h=Math.max(0,g-c.x,_-c.y,c.x-y,c.y-v);g=Math.min(g,c.x),y=Math.max(y,c.x),_=Math.min(_,c.y),v=Math.max(v,c.y),h>x&&(b(e,c,n,o,l,u),b(c,i,l,u,a,s))}b(p,d,n,a,o,a),b(d,f,o,a,o,s),b(f,m,o,s,n,s),b(m,p,n,s,n,a),g-=x,_-=x,y+=x,v+=x;let w=1/Math.max(y-g,v-_);return{scale:w,x:g*w,y:_*w,x2:y*w,y2:v*w,projection:r}}function pf(e,{x:r,y:i},n=0){return new tx(((r-n)*e.scale-e.x)*8192,(i*e.scale-e.y)*8192)}let pm=e.a9.identity(new Float32Array(16));class pg{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,r){return{x:0,y:0,z:0}}unproject(e,r){return new s6(0,0)}projectTilePoint(e,r,i){return{x:e,y:r,z:0}}locationPoint(e,r,i=!0){return e._coordinatePoint(e.locationCoordinate(r),i)}pixelsPerMeter(e,r){return 1/la(e)*r}pixelSpaceConversion(e,r,i){return 1}farthestPixelDistance(e){return pp(e,e.pixelsPerMeter)}pointCoordinate(e,r,i,n){let o=new tx(r,Math.max(e.horizonLineFromTop(!1),i));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,n))}pointCoordinate3D(e,r,i){let n=new tx(r,i);if(e.elevation)return e.elevation.pointCoordinate(n);{let r=this.pointCoordinate(e,n.x,n.y,0);return[r.x,r.y,r.z]}}isPointAboveHorizon(e,r){if(e.elevation)return!this.pointCoordinate3D(e,r.x,r.y);let i=e.horizonLineFromTop();return r.y<i}createInversionMatrix(e,r){return pm}createTileMatrix(r,i,n){let o,a,s,l=n.canonical,u=e.a9.identity(new Float64Array(16));if(this.isReprojectedInTileSpace){let c=pd(l,this);o=1,a=c.x+n.wrap*c.scale,s=c.y,e.a9.scale(u,u,[o/c.scale,o/c.scale,r.pixelsPerMeter/i])}else o=i/r.zoomScale(l.z),a=(l.x+Math.pow(2,l.z)*n.wrap)*o,s=l.y*o;return e.a9.translate(u,u,[a,s,0]),e.a9.scale(u,u,[o/8192,o/8192,1]),u}upVector(e,r,i){return[0,0,1]}upVectorScale(e,r,i){return{metersToTile:1}}}class p_ extends pg{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[r,i]=this.parallels=e.parallels||[29.5,45.5],n=Math.sin(r*tb);this.n=(n+Math.sin(i*tb))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(e,r){let{n:i,c:n,r0:o}=this,a=(e-this.center[0])*tb,s=Math.sqrt(n-2*i*Math.sin(r*tb))/i;return{x:s*Math.sin(a*i),y:s*Math.cos(a*i)-o,z:0}}unproject(e,r){let{n:i,c:n,r0:o}
15=this,a=o+r,s=Math.atan2(e,Math.abs(a))*Math.sign(a);a*i<0&&(s-=Math.PI*Math.sign(e)*Math.sign(a));let l=this.center[0]*tb*i,u=tM((s=tA(s,-Math.PI-l,Math.PI-l))/i*tw+this.center[0],-180,180),c=Math.asin(tM((n-(e*e+a*a)*i*i)/(2*i),-1,1));return new s6(u,tM(c*tw,-85.051129,85.051129))}}let py=Math.sqrt(3)/2;class pv extends pg{project(e,r){r=r/180*Math.PI,e=e/180*Math.PI;let i=Math.asin(py*Math.sin(r)),n=i*i,o=n*n*n;return{x:.5*(e*Math.cos(i)/(py*(1.340264+-.24331799999999998*n+o*(.0062510000000000005+.034164*n)))/Math.PI+.5),y:1-.5*(i*(1.340264+-.081106*n+o*(893e-6+.003796*n))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let i=r=(2*(1-r)-1)*Math.PI,n=i*i,o=n*n*n;for(let e,a,s=0;s<12&&(a=i*(1.340264+-.081106*n+o*(893e-6+.003796*n))-r,o=(n=(i=tM(i-(e=a/(1.340264+-.24331799999999998*n+o*(.0062510000000000005+.034164*n))),-Math.PI/3,Math.PI/3))*i)*n*n,!(1e-12>Math.abs(e)));++s);let a=py*e*(1.340264+-.24331799999999998*n+o*(.0062510000000000005+.034164*n))/Math.cos(i),s=Math.asin(Math.sin(i)/py);return new s6(tM(180*a/Math.PI,-180,180),tM(180*s/Math.PI,-85.051129,85.051129))}}class px extends pg{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){return{x:.5+e/360,y:.5-r/360,z:0}}unproject(e,r){return new s6(360*(e-.5),tM(360*(.5-r),-85.051129,85.051129))}}let pb=Math.PI/2;function pw(e){return Math.tan((pb+e)/2)}class pE extends pg{constructor(e){super(e),this.center=e.center||[0,30];const[r,i]=this.parallels=e.parallels||[30,30];let n=r*tb,o=i*tb;this.southernCenter=n+o<0,this.southernCenter&&(n=-n,o=-o);const a=Math.cos(n),s=pw(n);this.n=n===o?Math.sin(n):Math.log(a/Math.cos(o))/Math.log(pw(o)/s),this.f=a*Math.pow(pw(n),this.n)/this.n}project(e,r){r*=tb,this.southernCenter&&(r=-r),e=(e-this.center[0])*tb;let{n:i,f:n}=this;n>0?r<-pb+1e-6&&(r=-pb+1e-6):r>pb-1e-6&&(r=pb-1e-6);let o=n/Math.pow(pw(r),i),a=o*Math.sin(i*e),s=n-o*Math.cos(i*e);return a=.5*(a/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:a,y:this.southernCenter?s:1-s,z:0}}unproject(e,r){e=(2*e-.5)*Math.PI,this.southernCenter&&(r=1-r);let{n:i,f:n}=this,o=n-(r=(2*(1-r)-.5)*Math.PI),a=Math.sign(o),s=Math.sign(i)*Math.sqrt(e*e+o*o),l=Math.atan2(e,Math.abs(o))*a;o*i<0&&(l-=Math.PI*Math.sign(e)*a);let u=tM(l/i*tw+this.center[0],-180,180),c=tM((2*Math.atan(Math.pow(n/s,1/i))-pb)*tw,-85.051129,85.051129);return new s6(u,this.southernCenter?-c:c)}}class pS extends pg{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,r){return{x:ls(e),y:ll(r),z:0}}unproject(e,r){return new s6(lu(e),lc(r))}}let pT=85.051129*tb;class pI extends pg{project(e,r){let i=(r*=tb)*r,n=i*i;return{x:.5*((e*=tb)*(.8707-.131979*i+n*(n*(.003971*i-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(r*(1.007226+i*(.015085+n*(.028874*i-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let i=r=(2*(1-r)-1)*Math.PI,n=25,o=0,a=i*i;do{let e=(a=i*i)*a;o=(i*(1.007226+a*(.015085+e*(.028874*a-.044475-.005916*e)))-r)/(1.007226+a*(.045255+e*(.259866*a-.311325-.005916*11*e))),i=tM(i-o,-pT,pT)}while(Math.abs(o)>1e-6&&--n>0);return new s6(tM(e/(.8707+(a=i*i)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979))*tw,-180,180),i*tw)}}let pM=85.051129*tb;class pC extends pg{project(e,r){r*=tb,e*=tb;let i=Math.cos(r),n=Math.acos(i*Math.cos(e/2)),o=Math.sin(n)/n;return{x:.5*((.5*(2/Math.PI*e+2*i*Math.sin(e/2)/o)||0)/Math.PI+.5),y:1-.5*((.5*(r+Math.sin(r)/o)||0)/Math.PI+1),z:0}}unproject(e,r){let i=e=(2*e-.5)*Math.PI,n=r=(2*(1-r)-1)*Math.PI,o=25,a=0,s=0;do{let o=Math.cos(n),l=Math.sin(n),u=2*l*o,c=l*l,h=o*o,p=Math.cos(i/2),d=Math.sin(i/2),f=2*p*d,m=d*d,g=1-h*p*p,_=g?1/g:0,y=g?Math.acos(o*p)*Math.sqrt(1/g):0,v=.5*(2*y*o*d+2*i/Math.PI)-e,x=.5*(y*l+n)-r,b=.5*_*(h*m+y*o*p*c)+1/Math.PI,w=_*(f*u/4-y*l*d),E=.125*_*(u*d-y*l*h*f),S=.5*_*(c*p+y*m*o)+.5,T=w*E-S*b;a=(x*w-v*S)/T,s=(v*E-x*b)/T,i=tM(i-a,-Math.PI,Math.PI),n=tM(n-s,-pM,pM)}while((Math.abs(a)>1e-6||Math.abs(s)>1e-6)&&--o>0);return new s6(i*tw,n*tw)}}class pA extends pg{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(this.parallels[0]*tb)),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){let{scale:i,cosPhi:n}=this;return{x:e*tb*n*i+.5,y:-Math.sin(r*tb)/n*i+.5,z:0}}unproject(e,r){let{scale:i,cosPhi:n}=this,o=tM((e-.5)/i*tw/n,-180,180),a=Math.asin(tM(-(r-.5)/i*n,-1,1));return new s6(o,tM(a*tw,-85.051129,85.051129))}}class pP extends pS{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(r,i,n){let o=l8(r,i,n),a=ue(l1(n));return e.Q.transformMat4(o,o,a),{x:o[0],y:o[1],z:o[2]}}locationPoint(r,i){let n=s5(i.lat,i.lng),o=e.Q.normalize([],n),a=r.elevation?r.elevation.getAtPointOrZero(r.locationCoordinate(i),r._centerAltitude):r._centerAltitude,s=1/la(0)*8192*a;e.Q.scaleAndAdd(n,n,o,s);let l=e.a9.identity(new Float64Array(16));return e.a9.multiply(l,r.pixelMatrix,r.globeMatrix),e.Q.transformMat4(n,n,l),new tx(n[0],n[1])}pixelsPerMeter(e,r){return 1/la(0)*r}pixelSpaceConversion(e,r,i){let n=1/la(e)*r,o=r2(1/la(45)*r,n,i);return this.pixelsPerMeter(e,r)/o}createTileMatrix(r,i,n){let o=ut(l1(n.canonical));return e.a9.multiply(new Float64Array(16),r.globeMatrix,o)}createInversionMatrix(r,i){let{center:n}=r,o=ue(l1(i));return e.a9.rotateY(o,o,n.lng*tb),e.a9.rotateX(o,o,n.lat*tb),e.a9.scale(o,o,[r._pixelsPerMercatorPixel,r._pixelsPerMercatorPixel,1]),Float32Array.from(o)}pointCoordinate(e,r,i,n){return lQ(e,r,i,!0)||new lm(0,0)}pointCoordinate3D(e,r,i){let n=this.pointCoordinate(e,r,i,0);return[n.x,n.y,n.z]}isPointAboveHorizon(e,r){return!lQ(e,r.x,r.y,!1)}farthestPixelDistance(r){let i=function(r,i){let n,o=r.cameraToCenterDistance,a=r._centerAltitude*i,s=r._camera,l=r._camera.forward(),u=e.Q.add([],e.Q.scale([],l,-o),[0,0,a]),c=r.worldSize/(2*Math.PI),h=[0,0,-c],p=r.width/r.height,d=Math.tan(r.fovAboveCenter),f=e.Q.scale([],s.up(),d),m=e.Q.scale([],s.right(),d*p),g=e.Q.normalize([],e.Q.add([],e.Q.add([],l,f),m)),_=[];
15if(new lB(u,g).closestPointOnSphere(h,c,_)){let i=e.Q.add([],_,h),o=e.Q.sub([],i,u);n=Math.cos(r.fovAboveCenter)*e.Q.length(o)}else{let r=e.Q.sub([],u,h),i=e.Q.sub([],h,u);e.Q.normalize(i,i);let o=e.Q.length(r)-c,a=Math.acos((n=Math.sqrt(o*(o+2*c)))/(c+o))-Math.acos(e.Q.dot(l,i));n*=Math.cos(a)}return 1.01*n}(r,this.pixelsPerMeter(r.center.lat,r.worldSize)),n=uo(r.zoom);return n>0?r2(i,pp(r,1/la(r.center.lat)*r.worldSize)+r.worldSize/(2*Math.PI)*(1-Math.cos(Math.max(r.width,r.height)/r.worldSize*Math.PI)),Math.pow(n,10)):i}upVector(e,r,i){return l8(r,i,e,1)}upVectorScale(e){return{metersToTile:lX(l9(l1(e)))}}}function pL(e){let r=e.parallels,i=!!r&&.01>Math.abs(r[0]+r[1]);switch(e.name){case"mercator":return new pS(e);case"equirectangular":return new px(e);case"naturalEarth":return new pI(e);case"equalEarth":return new pv(e);case"winkelTripel":return new pC(e);case"albers":return i?new pA(e):new p_(e);case"lambertConformalConic":return i?new pA(e):new pE(e);case"globe":return new pP(e)}throw Error(`Invalid projection name: ${e.name}`)}let pO=cn.types,pD=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function pR(e,r,i,n,o,a,s,l,u,c,h,p,d){let f=l?Math.min(32640,Math.round(l[0])):0,m=l?Math.min(32640,Math.round(l[1])):0;e.emplaceBack(r,i,Math.round(32*n),Math.round(32*o),a,s,(f<<1)+ +!!u,m,16*c,16*h,256*p,256*d)}function pk(e,r,i){e.emplaceBack(r,i)}function pN(e,r,i,n,o,a,s){e.emplaceBack(r,i,n,o,a,s)}function pF(e,r,i,n,o){e.emplaceBack(r,i,n,o),e.emplaceBack(r,i,n,o),e.emplaceBack(r,i,n,o),e.emplaceBack(r,i,n,o)}class pz{constructor(e){this.layoutVertexArray=new aJ,this.indexArray=new a8,this.programConfigurations=e,this.segments=new sE,this.dynamicLayoutVertexArray=new aY,this.opacityVertexArray=new a1,this.placedSymbolArray=new sd,this.iconTransitioningVertexArray=new a2,this.globeExtVertexArray=new a0,this.zOffsetVertexArray=new se}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(e,r,i,n,o){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hi.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,ho.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,pD,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,hs.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,hn.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||o)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,ha.members,!0)),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}oS(pz,"SymbolBuffers");class pB{constructor(e,r,i){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new i,this.segments=new sE,this.collisionVertexArray=new a6,this.collisionVertexArrayExt=new aY}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,hl.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,hu.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
15stroy())}}oS(pB,"CollisionBuffers");class pU{constructor(r){this.collisionBoxArray=r.collisionBoxArray,this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=r.index,this.pixelRatio=r.pixelRatio,this.sourceLayerIndex=r.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=e.a9.identity([]),this.placementViewportMatrix=e.a9.identity([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=hp(this.zoom,i["text-size"]),this.iconSizeData=hp(this.zoom,i["icon-size"]);const n=this.layers[0].layout,o=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&void 0!==o.constantOr(1),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map(e=>hB[e]),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=r.sourceID,this.projection=r.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=n.get("symbol-z-elevate")}createArrays(){this.text=new pz(new sZ(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new pz(new sZ(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new sg,this.lineVertexArray=new s_,this.symbolInstances=new sm}calculateGlyphDependencies(e,r,i,n,o){for(let i=0;i<e.length;i++){let a=e.codePointAt(i);if(void 0===a)break;if(r[a]=!0,n&&o&&a<=65535){let n=hg[e.charAt(i)];n&&(r[n.charCodeAt(0)]=!0)}}}populate(r,i,n,o){let a=this.layers[0],s=a.layout,l="globe"===this.projection.name,u=s.get("text-font"),c=s.get("text-field"),h=s.get("icon-image"),p=("constant"!==c.value.kind||c.value.value instanceof iy&&!c.value.value.isEmpty()||c.value.value.toString().length>0)&&("constant"!==u.value.kind||u.value.value.length>0),d="constant"!==h.value.kind||!!h.value.value||Object.keys(h.parameters).length>0,f=s.get("symbol-sort-key");if(this.features=[],!p&&!d)return;let m=i.iconDependencies,g=i.glyphDependencies,_=i.availableImages,y=new au(this.zoom);for(let{feature:i,id:c,index:h,sourceLayerIndex:v}of r){let r,x,b=a._featureFilter.needGeometry,w=lv(i,b);if(!a._featureFilter.filter(y,w,n))continue;if(b||(w.geometry=ly(i,n,o)),l&&1!==i.type&&n.z<=5){let r=w.geometry,i=(r,i)=>{let o=l8(r.x,r.y,n,1),a=l8(i.x,i.y,n,1);return .98078528056>e.Q.dot(o,a)};for(let e=0;e<r.length;e++)r[e]=function(e,r){let i=e[0],n=[i];for(let o=1;o<e.length;o++){let a=e[o];(function e(r,i,n,o){if(o(i,n)){let a=i.add(n)._mult(.5);e(r,i,a,o),e(r,a,n,o)}else r.push(n)})(n,i,a,r),i=a}return n}(r[e],i)}if(p){let e=a.getValueAndResolveTokens("text-field",w,n,_),i=iy.factory(e);(function(e){for(let r of e.sections)if(function(e){for(let r of e)if(o6(r.charCodeAt(0)))return!0;return!1}(r.text))return!0;return!1})(i)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===aa()||this.hasRTLText&&al.isParsed())&&(r=function(e,r,i){return e.sections.forEach(e=>{var n;let o;n=e.text,"uppercase"===(o=r.layout.get("text-transform").evaluate(i,{}))?n=n.toLocaleUpperCase():"lowercase"===o&&(n=n.toLocaleLowerCase()),al.applyArabicShaping&&(n=al.applyArabicShaping(n)),e.text=n}),e}(i,a,w))}if(d){let e=a.getValueAndResolveTokens("icon-image",w,n,_);x=e instanceof iv?e:iv.fromString(e)}if(!r&&!x)continue;let E=this.sortFeaturesByKey?f.evaluate(w,{},n):void 0;if(this.features.push({id:c,text:r,icon:x,index:h,sourceLayerIndex:v,geometry:w.geometry,properties:i.properties,type:pO[i.type],sortKey:E}),x&&(m[x.namePrimary]=!0,x.nameSecondary&&(m[x.nameSecondary]=!0)),r){let e=u.evaluate(w,{},n).join(","),i="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");for(let n of(this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(hB.vertical)>=0,r.sections))if(n.image)m[n.image.namePrimary]=!0;else{let o=o3(r.toString()),a=n.fontStack||e,s=g[a]=g[a]||{};this.calculateGlyphDependencies(n.text,s,i,this.allowVerticalPlacement,o)}}}"line"===s.get("symbol-placement")&&(this.features=function(e){let r={},i={},n=[],o=0;function a(r){n.push(e[r]),o++}function s(e,r,o){let a=i[e];return delete i[e],i[r]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(o[0]),a}function l(e,i,o){let a=r[i];return delete r[i],r[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=o[0].concat(n[a].geometry[0]),a}function u(e,r,i){let n=i?r[0][r[0].length-1]:r[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){let h=e[c],p=h.geometry,d=h.text?h.text.toString():null;if(!d){a(c);continue}let f=u(d,p),m=u(d,p,!0);if(f in i&&m in r&&i[f]!==r[m]){let e=l(f,m,p),o=s(f,m,n[e].geometry);delete r[f],delete i[m],i[u(d,n[o].geometry,!0)]=o,n[e].geometry=null}
15else f in i?s(f,m,p):m in r?l(f,m,p):(a(c),r[f]=o-1,i[m]=o-1)}return n.filter(e=>e.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((e,r)=>e.sortKey-r.sortKey)}update(e,r,i,n,o){let a=0!==Object.keys(e).length;if(a&&!this.stateDependentLayers.length)return;let s=a?this.stateDependentLayers:this.layers;this.text.programConfigurations.updatePaintArrays(e,r,s,i,n,o),this.icon.programConfigurations.updatePaintArrays(e,r,s,i,n,o)}updateZOffset(){let e=(e,r,n)=>{(i+=r)>e.length&&e.resize(i);for(let o=-r;o<0;o++)e.emplace(o+i,n)},r=(e,r,i)=>{(n+=r)>e.length&&e.resize(n);for(let o=-r;o<0;o++)e.emplace(o+n,i)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let i=0,n=0;for(let i=0;i<this.symbolInstances.length;i++){let n=this.symbolInstances.get(i),{numHorizontalGlyphVertices:o,numVerticalGlyphVertices:a,numIconVertices:s}=n,l=n.zOffset,u=s>0;if((o>0||a>0)&&(e(this.text.zOffsetVertexArray,o,l),e(this.text.zOffsetVertexArray,a,l)),u){let{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:i}=n;e>=0&&r(this.icon.zOffsetVertexArray,s,l),i>=0&&r(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,l)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=pL(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){let i=this.lineVertexArray.length;if(void 0!==e.segment)for(let{x:e,y:i}of r)this.lineVertexArray.emplaceBack(e,i);return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g){let _=e.indexArray,y=e.layoutVertexArray,v=e.globeExtVertexArray,x=e.segments.prepareSegment(4*r.length,y,_,this.canOverlap?a.sortKey:void 0),b=this.glyphOffsetArray.length,w=x.vertexLength,E=this.allowVerticalPlacement&&s===hB.vertical?Math.PI/2:0,S=a.text&&a.text.sections;for(let n=0;n<r.length;n++){let{tl:o,tr:s,bl:c,br:h,texPrimary:p,texSecondary:b,pixelOffsetTL:w,pixelOffsetBR:T,minFontScaleX:I,minFontScaleY:M,glyphOffset:C,isSDF:A,sectionIndex:P}=r[n],L=x.vertexLength,O=C[1];if(pR(y,u.x,u.y,o.x,O+o.y,p.x,p.y,i,A,w.x,w.y,I,M),pR(y,u.x,u.y,s.x,O+s.y,p.x+p.w,p.y,i,A,T.x,w.y,I,M),pR(y,u.x,u.y,c.x,O+c.y,p.x,p.y+p.h,i,A,w.x,T.y,I,M),pR(y,u.x,u.y,h.x,O+h.y,p.x+p.w,p.y+p.h,i,A,T.x,T.y,I,M),l){let{x:r,y:i,z:n}=l.anchor,[o,a,s]=l.up;pN(v,r,i,n,o,a,s),pN(v,r,i,n,o,a,s),pN(v,r,i,n,o,a,s),pN(v,r,i,n,o,a,s),pF(e.dynamicLayoutVertexArray,r,i,n,E)}else pF(e.dynamicLayoutVertexArray,u.x,u.y,u.z,E);if(g){let r=b||p;pk(e.iconTransitioningVertexArray,r.x,r.y),pk(e.iconTransitioningVertexArray,r.x+r.w,r.y),pk(e.iconTransitioningVertexArray,r.x,r.y+r.h),pk(e.iconTransitioningVertexArray,r.x+r.w,r.y+r.h)}_.emplaceBack(L,L+1,L+2),_.emplaceBack(L+1,L+2,L+3),x.vertexLength+=4,x.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),n!==r.length-1&&P===r[n+1].sectionIndex||e.programConfigurations.populatePaintArrays(y.length,a,a.index,{},d,f,m,S&&S[P])}let T=l?l.anchor:u;e.placedSymbolArray.emplaceBack(T.x,T.y,T.z,u.x,u.y,b,this.glyphOffsetArray.length-b,w,c,h,u.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,!1,0,p,0)}_commitLayoutVertex(e,r,i,n,o,a,s){e.emplaceBack(r,i,n,o,a,Math.round(s.x),Math.round(s.y))}_addCollisionDebugVertices(e,r,i,n,o,a,s){let l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),u=l.vertexLength,c=s.tileAnchorX,h=s.tileAnchorY;for(let e=0;e<4;e++)i.collisionVertexArray.emplaceBack(0,0,0,0);this._commitDebugCollisionVertexUpdate(i.collisionVertexArrayExt,r,e.padding,s.zOffset),this._commitLayoutVertex(i.layoutVertexArray,n,o,a,c,h,new tx(e.x1,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,o,a,c,h,new tx(e.x2,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,o,a,c,h,new tx(e.x2,e.y2)),this._commitLayoutVertex(i.layoutVertexArray,n,o,a,c,h,new tx(e.x1,e.y2)),l.vertexLength+=4;let p=i.indexArray;p.emplaceBack(u,u+1),p.emplaceBack(u+1,u+2),p.emplaceBack(u+2,u+3),p.emplaceBack(u+3,u),l.primitiveLength+=4}_addTextDebugCollisionBoxes(e,r,i,n,o,a){for(let s=n;s<o;s++){let n=i.get(s),o=this.getSymbolInstanceTextSize(e,a,r,s);this._addCollisionDebugVertices(n,o,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,a)}}_addIconDebugCollisionBoxes(e,r,i,n,o,a){for(let s=n;s<o;s++){let n=i.get(s),o=this.getSymbolInstanceIconSize(e,r,a.placedIconSymbolIndex);this._addCollisionDebugVertices(n,o,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,a)}}generateCollisionDebugBuffers(e,r){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new pB(a5,hc.members,a2),this.iconCollisionBox=new pB(a5,hc.members,a2);let i=hf(this.iconSizeData,e),n=hf(this.textSizeData,e);for(let o=0;o<this.symbolInstances.length;o++){let a=this.symbolInstances.get(o);this._addTextDebugCollisionBoxes(n,e,r,a.textBoxStartIndex,a.textBoxEndIndex,a),this._addTextDebugCollisionBoxes(n,e,r,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a),this._addIconDebugCollisionBoxes(i,e,r,a.iconBoxStartIndex,a.iconBoxEndIndex,a),this._addIconDebugCollisionBoxes(i,e,r,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex,a)}}getSymbolInstanceTextSize(e,r,i,n){let o=this.text.placedSymbolArray.get(r.rightJustifiedTextSymbolIndex>=0?r.rightJustifiedTextSymbolIndex:r.centerJustifiedTextSymbolIndex>=0?r.centerJustifiedTextSymbolIndex:r.leftJustifiedTextSymbolIndex>=0?r.leftJustifiedTextSymbolIndex:r.verticalPlacedTextSymbolIndex>=0?r.verticalPlacedTextSymbolIndex:n),a=hd(this.textSizeData,e,o)/24;return this.tilePixelRatio*a}getSymbolInstanceIconSize(e,r,i){let n=this.icon.placedSymbolArray.get(i),o=hd(this.iconSizeData,e,n);return this.tilePixelRatio*o}_commitDebugCollisionVertexUpdate(e,r,i,n){e.emplaceBack(r,-i,-i,n),e.emplaceBack(r,i,-i,n),e.emplaceBack(r,i,i,n),e.emplaceBack(r,-i,i,n)}_updateTextDebugCollisionBoxes(e,r,i,n,o,a){for(let s=n;s<o;s++){let n=i.get(s),o=this.getSymbolInstanceTextSize(e,a,r,s);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,o,n.padding,a.zOffset)}}_updateIconDebugCollisionBoxes(e,r,i,n,o,a){for(let s=n;s<o;s++){let n=i.get(s),o=this.getSymbolInstanceIconSize(e,r,a.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,o,n.padding,a.zOffset)}}updateCollisionDebugBuffers(e,r){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();let i=hf(this.iconSizeData,e),n=hf(this.textSizeData,e);for(let o=0;o<this.symbolInstances.length;o++){let a=this.symbolInstances.get(o);this._updateTextDebugCollisionBoxes(n,e,r,a.textBoxStartIndex,a.textBoxEndIndex,a),this._updateTextDebugCollisionBoxes(n,e,r,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a),this._updateIconDebugCollisionBoxes(i,e,r,a.iconBoxStartIndex,a.iconBoxEndIndex,a),this._updateIconDebugCollisionBoxes(i,e,r,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex,a)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,r,i,n,o,a,s,l,u){let c={};if(r<i){let{x1:i,y1:n,x2:o,y2:a,padding:s,projectedAnchorX:l,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d,featureIndex:f}=e.get(r);c.textBox={x1:i,y1:n,x2:o,y2:a,padding:s,projectedAnchorX:l,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d},c.textFeatureIndex=f}if(n<o){let{x1:r,y1:i,x2:o,y2:a,padding:s,projectedAnchorX:l,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d,featureIndex:f}=e.get(n);c.verticalTextBox={x1:r,y1:i,x2:o,y2:a,padding:s,projectedAnchorX:l,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d},c.verticalTextFeatureIndex=f}if(a<s){let{x1:r,y1:i,x2:n,y2:o,padding:s,projectedAnchorX:l,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d,featureIndex:f}=e.get(a);c.iconBox={x1:r,y1:i,x2:n,y2:o,padding:s,projectedAnchorX:l,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d},c.iconFeatureIndex=f}if(l<u){let{x1:r,y1:i,x2:n,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d,featureIndex:f}=e.get(l);c.verticalIconBox={x1:r,y1:i,x2:n,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:u,projectedAnchorZ:h,tileAnchorX:p,tileAnchorY:d},c.verticalIconFeatureIndex=f}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let i=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,r){let i=e.placedSymbolArray.get(r),n=i.vertexStartIndex+4*i.numGlyphs;for(let r=i.vertexStartIndex;r<n;r+=4)e.indexArray.emplaceBack(r,r+1,r+2),e.indexArray.emplaceBack(r+1,r+2,r+3)}
15getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let r=Math.sin(e),i=Math.cos(e),n=[],o=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let s=this.symbolInstances.get(e);n.push(0|Math.round(r*s.tileAnchorX+i*s.tileAnchorY)),o.push(s.featureIndex)}return a.sort((e,r)=>n[e]-n[r]||o[r]-o[e]),a}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort((e,r)=>this.symbolInstances.get(r).zOffset-this.symbolInstances.get(e).zOffset)}addToSortKeyRanges(e,r){let i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===r?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){for(let r of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let e=this.symbolInstances.get(r);this.featureSortOrder.push(e.featureIndex);let{rightJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:o,verticalPlacedTextSymbolIndex:a,placedIconSymbolIndex:s,verticalPlacedIconSymbolIndex:l}=e;i>=0&&this.addIndicesForPlacedSymbol(this.text,i),n>=0&&n!==i&&this.addIndicesForPlacedSymbol(this.text,n),o>=0&&o!==n&&o!==i&&this.addIndicesForPlacedSymbol(this.text,o),a>=0&&this.addIndicesForPlacedSymbol(this.text,a),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s),l>=0&&this.addIndicesForPlacedSymbol(this.icon,l)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}oS(pU,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),pU.addDynamicAttributes=pF;let pj=new ab({"symbol-placement":new ay(aS.layout_symbol["symbol-placement"]),"symbol-spacing":new ay(aS.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ay(aS.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new av(aS.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ay(aS.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new ay(aS.layout_symbol["symbol-z-elevate"]),"icon-allow-overlap":new ay(aS.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ay(aS.layout_symbol["icon-ignore-placement"]),"icon-optional":new ay(aS.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ay(aS.layout_symbol["icon-rotation-alignment"]),"icon-size":new av(aS.layout_symbol["icon-size"]),"icon-text-fit":new av(aS.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new av(aS.layout_symbol["icon-text-fit-padding"]),"icon-image":new av(aS.layout_symbol["icon-image"]),"icon-rotate":new av(aS.layout_symbol["icon-rotate"]),"icon-padding":new ay(aS.layout_symbol["icon-padding"]),"icon-keep-upright":new ay(aS.layout_symbol["icon-keep-upright"]),"icon-offset":new av(aS.layout_symbol["icon-offset"]),"icon-anchor":new av(aS.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ay(aS.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ay(aS.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ay(aS.layout_symbol["text-rotation-alignment"]),"text-field":new av(aS.layout_symbol["text-field"]),"text-font":new av(aS.layout_symbol["text-font"]),"text-size":new av(aS.layout_symbol["text-size"]),"text-max-width":new av(aS.layout_symbol["text-max-width"]),"text-line-height":new av(aS.layout_symbol["text-line-height"]),"text-letter-spacing":new av(aS.layout_symbol["text-letter-spacing"]),"text-justify":new av(aS.layout_symbol["text-justify"]),"text-radial-offset":new av(aS.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ay(aS.layout_symbol["text-variable-anchor"]),"text-anchor":new av(aS.layout_symbol["text-anchor"]),"text-max-angle":new ay(aS.layout_symbol["text-max-angle"]),"text-writing-mode":new ay(aS.layout_symbol["text-writing-mode"]),"text-rotate":new av(aS.layout_symbol["text-rotate"]),"text-padding":new ay(aS.layout_symbol["text-padding"]),"text-keep-upright":new ay(aS.layout_symbol["text-keep-upright"]),"text-transform":new av(aS.layout_symbol["text-transform"]),"text-offset":new av(aS.layout_symbol["text-offset"]),"text-allow-overlap":new ay(aS.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ay(aS.layout_symbol["text-ignore-placement"]),"text-optional":new ay(aS.layout_symbol["text-optional"]),visibility:new ay(aS.layout_symbol.visibility)});var pV={paint:new ab({"icon-opacity":new av(aS.paint_symbol["icon-opacity"]),"icon-emissive-strength":new av(aS.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new av(aS.paint_symbol["text-emissive-strength"]),"icon-color":new av(aS.paint_symbol["icon-color"]),"icon-halo-color":new av(aS.paint_symbol["icon-halo-color"]),"icon-halo-width":new av(aS.paint_symbol["icon-halo-width"]),"icon-halo-blur":new av(aS.paint_symbol["icon-halo-blur"]),"icon-translate":new ay(aS.paint_symbol["icon-translate"]),"icon-translate-anchor":new ay(aS.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new av(aS.paint_symbol["icon-image-cross-fade"]),"text-opacity":new av(aS.paint_symbol["text-opacity"]),"text-color":new av(aS.paint_symbol["text-color"],{runtimeType:ir,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new av(aS.paint_symbol["text-halo-color"]),"text-halo-width":new av(aS.paint_symbol["text-halo-width"]),"text-halo-blur":new av(aS.paint_symbol["text-halo-blur"]),"text-translate":new ay(aS.paint_symbol["text-translate"]),"text-translate-anchor":new ay(aS.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new ay(aS.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new ay(aS.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new ay(aS.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new ay(aS.paint_symbol["icon-color-brightness-max"])}),layout:pj};class pG{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:r9,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}oS(pG,"FormatSectionOverride",{omit:["defaultValue"]});class pq extends aF{constructor(r,i,n){super(r,pV,i,n),this._colorAdjustmentMatrix=e.a9.identity([])}
15recalculate(e,r){super.recalculate(e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));let i=this.layout.get("text-writing-mode");if(i){let e=[];for(let r of i)0>e.indexOf(r)&&e.push(r);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(r,i,n,o){var a,s;let l,u,c,h,p;return this._saturation===r&&this._contrast===i&&this._brightnessMin===n&&this._brightnessMax===o||(this._colorAdjustmentMatrix=(a=r,s=i,a=t6(a),s=t4(s),l=e.a9.create(),c=1-2*(u=a/3),h=.5-.5*s,p=o-n,e.a9.multiply(l,[p,0,0,0,0,p,0,0,0,0,p,0,n,n,n,1],[s,0,0,0,0,s,0,0,0,0,s,0,h,h,h,1]),e.a9.multiply(l,l,[c,u,u,0,u,c,u,0,u,u,c,0,0,0,0,1]),l),this._saturation=r,this._contrast=i,this._brightnessMin=n,this._brightnessMax=o),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,r,i,n){var o;let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return s.isDataDriven()||om(s.value)||!a?a:(o=r.properties,a.replace(/{([^{}]+)}/g,(e,r)=>r in o?String(o[r]):""))}createBucket(e){return new pU(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(let e of pV.paint.overridableProperties){if(!pq.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new of(new pG(r),r.property.specification,this.scope,this.options),n=null;n="constant"===r.value.kind||"source"===r.value.kind?new o_("source",i):new oy("composite",i,r.value.zoomStops,r.value._interpolationType),this.paint._values[e]=new ag(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&pq.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get("text-field"),n=pV.paint.properties[r],o=!1,a=e=>{for(let r of e)if(n.overrides&&n.overrides.hasOverride(r))return void(o=!0)};if("constant"===i.value.kind&&i.value.value instanceof iy)a(i.value.value.sections);else if("source"===i.value.kind){let e=r=>{o||(r instanceof iS&&iw(r.value)===is?a(r.value.sections):r instanceof iC?a(r.sections):r.eachChild(e))},r=i.value;r._styleExpression&&e(r._styleExpression.expression)}return o}getProgramIds(){let e=0!==this.paint.get("icon-opacity").constantOr(1),r=0!==this.paint.get("text-opacity").constantOr(1),i=[];return e&&i.push("symbolIcon"),r&&i.push("symbolSDF"),i}getDefaultProgramParams(e,r){return{config:new sY(this,r),overrideFog:!1}}}let pH=new ab({visibility:new ay(aS.layout_background.visibility)});var p$={paint:new ab({"background-color":new ay(aS.paint_background["background-color"]),"background-pattern":new ay(aS.paint_background["background-pattern"]),"background-opacity":new ay(aS.paint_background["background-opacity"]),"background-emissive-strength":new ay(aS.paint_background["background-emissive-strength"])}),layout:pH};let pW=new ab({visibility:new ay(aS.layout_raster.visibility)});var pY={paint:new ab({"raster-opacity":new ay(aS.paint_raster["raster-opacity"]),"raster-color":new ax(aS.paint_raster["raster-color"]),"raster-color-mix":new ay(aS.paint_raster["raster-color-mix"]),"raster-color-range":new ay(aS.paint_raster["raster-color-range"]),"raster-hue-rotate":new ay(aS.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ay(aS.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ay(aS.paint_raster["raster-brightness-max"]),"raster-saturation":new ay(aS.paint_raster["raster-saturation"]),"raster-contrast":new ay(aS.paint_raster["raster-contrast"]),"raster-resampling":new ay(aS.paint_raster["raster-resampling"]),"raster-fade-duration":new ay(aS.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new ay(aS.paint_raster["raster-emissive-strength"]),"raster-array-band":new ay(aS.paint_raster["raster-array-band"]),"raster-elevation":new ay(aS.paint_raster["raster-elevation"])}),layout:pW},pZ=aj([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class pX{constructor(e,r,i,n){this.context=e,this.format=i,this.texture=e.gl.createTexture(),this.update(r,n)}update(e,r,i){let{width:n,height:o}=e,{context:a}=this,{gl:s}=a;if(s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!r||!1!==r.premultiply)),i||this.size&&this.size[0]===n&&this.size[1]===o){let{x:r,y:a}=i||{x:0,y:0};if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap)s.texSubImage2D(s.TEXTURE_2D,0,r,a,s.RGBA,s.UNSIGNED_BYTE,e);else{let i=this.format,l=s.UNSIGNED_BYTE;this.format===s.R32F&&(i=s.RED,l=s.FLOAT),s.texSubImage2D(s.TEXTURE_2D,0,r,a,n,o,i,l,e.data)}}else if(this.size=[n,o],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap){let r=this.format;this.format===s.R8&&(r=s.RED),s.texImage2D(s.TEXTURE_2D,0,this.format,r,s.UNSIGNED_BYTE,e)}else{let r=this.format,i=this.format,a=s.UNSIGNED_BYTE;this.format===s.DEPTH_COMPONENT&&(r=s.DEPTH_COMPONENT16,a=s.UNSIGNED_SHORT),this.format===s.R8&&(i=s.RED),this.format===s.R32F&&(a=s.FLOAT,i=s.RED),s.texImage2D(s.TEXTURE_2D,0,r,n,o,0,i,a,e.data)}this.useMipmap=!!(r&&r.useMipmap),this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,r,i=!1){let{context:n}=this,{gl:o}=n;
15o.bindTexture(o.TEXTURE_2D,this.texture),e!==this.minFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.useMipmap&&!i?e===o.NEAREST?o.NEAREST_MIPMAP_NEAREST:o.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),r!==this.wrapS&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrapS=r)}bindExtraParam(e,r,i,n){let{context:o}=this,{gl:a}=o;a.bindTexture(a.TEXTURE_2D,this.texture),r!==this.magFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,r),this.magFilter=r),e!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.useMipmap?e===a.NEAREST?a.NEAREST_MIPMAP_NEAREST:a.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),i!==this.wrapS&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,i),this.wrapS=i),n!==this.wrapT&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,n),this.wrapT=n)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class pK{constructor(e,r){this.context=e,this.texture=r}bind(e,r){let{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),r!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,r),this.wrapS=r)}}function pQ(r,i,n,o,a,s,l,u){let c=[r,i,1,n,o,1,a,s,1],h=[l,u,1],p=e.ct.adjoint([],c),[d,f,m]=e.Q.transformMat3(h,h,p);return e.ct.multiply(c,c,[d,0,0,0,f,0,0,0,m])}function pJ(r,i,n,o,a,s,l,u){let c,h,p,d=(c=pQ(0,0,1,0,1,1,0,1),h=pQ(r,i,n,o,a,s,l,u),p=e.ct.adjoint([],c),e.ct.multiply(h,h,p));return[d[2]/d[8]/8192,d[5]/d[8]/8192]}function p0(e){return[e[0],Math.min(Math.max(e[1],-85.051129),85.051129)]}class p1 extends rZ{constructor(e,r,i,n){super(),this.id=e,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=r,this._dirty=!1}load(e,r){(this._loaded=r||!1,this.fire(new rW("dataloading",{dataType:"source"})),this.url=this.options.url,this.url)?this._imageRequest=rx(this.map._requestManager.transformRequest(this.url,rf.Image),(r,i)=>{this._imageRequest=null,this._loaded=!0,r?this.fire(new rY(r)):i&&(this.image=i instanceof HTMLImageElement?t9.getImageData(i):i,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())}):(e&&(this.coordinates=e),this._loaded=!0,this._finishLoading())}loaded(){return this._loaded}updateImage(e){return e.url&&(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded)),this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw Error("The provided handle is not a WebGLTexture instance");return this.texture=new pK(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new rW("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof pK||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let r=e[0][1],i=e[0][1];for(let n of e)n[1]>i&&(i=n[1]),n[1]<r&&(r=n[1]);let n=(i+r)/2;if(n>85.051129?this.onNorthPole=!0:n<-85.051129&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){let r=e.map(lm.fromLngLat);this.tileID=function(e){let r=1/0,i=1/0,n=-1/0,o=-1/0;for(let a of e)r=Math.min(r,a.x),i=Math.min(i,a.y),n=Math.max(n,a.x),o=Math.max(o,a.y);let a=Math.max(0,Math.floor(-Math.log(Math.max(n-r,o-i))/Math.LN2)),s=Math.pow(2,a),l=Math.floor((r+n)/2*s);return l>1&&(l-=1),new lt(a,l,Math.floor((i+o)/2*s))}(r),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new rW("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(r){var i,n,o,a,s,l,u,c,h;let p,d,f,m,g,_,y,v,x,b,w,E;for(let e in this.tiles){let r=this.tiles[e];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;let S=pd(new lt(0,0,0),this.map.transform.projection),T=[S.projection.project(this.coordinates[0][0],this.coordinates[0][1]),S.projection.project(this.coordinates[1][0],this.coordinates[1][1]),S.projection.project(this.coordinates[2][0],this.coordinates[2][1]),S.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(p=T[1].x-T[0].x,d=T[1].y-T[0].y,f=T[2].x-T[1].x,m=T[2].y-T[1].y,g=T[3].x-T[2].x,_=T[3].y-T[2].y,y=T[0].x-T[3].x,v=T[0].y-T[3].y,x=p*m-f*d,b=f*_-g*m,w=g*v-y*_,E=y*d-p*v,(!(x>0)||!(b>0)||!(w>0)||!(E>0))&&(!(x<0)||!(b<0)||!(w<0)||!(E<0)))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);let I=pd(this.tileID,this.map.transform.projection),[M,C,A,P]=this.coordinates.map(e=>{let r=I.projection.project(e[0],e[1]);return pf(I,r)._round()});this.perspectiveTransform=pJ(M.x,M.y,C.x,C.y,A.x,A.y,P.x,P.y);let L=this._boundsArray=new aH;L.emplaceBack(M.x,M.y,0,0),L.emplaceBack(C.x,C.y,8192,0),L.emplaceBack(P.x,P.y,0,8192),L.emplaceBack(A.x,A.y,8192,8192),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=r.createVertexBuffer(L,pZ.members),this.boundsSegments=sE.simpleSegment(0,0,4,2);let O=[],[D,R,k,N]=function(e){let r=e[0][0],i=r,n=e[0][1],o=n;for(let a=1;a<e.length;
15a++)e[a][0]<r?r=e[a][0]:e[a][0]>i&&(i=e[a][0]),e[a][1]<n?n=e[a][1]:e[a][1]>o&&(o=e[a][1]);return[r,n,i-r,o-n]}([p0((i=this.coordinates)[0]),p0(i[1]),p0(i[2]),p0(i[3])]);{let i,p,d,f=new aH,[m,g,_,y]=function(e){let r=e[0].x,i=r,n=e[0].y,o=n;for(let a=1;a<e.length;a++)e[a].x<r?r=e[a].x:e[a].x>i&&(i=e[a].x),e[a].y<n?n=e[a].y:e[a].y>o&&(o=e[a].y);return[r,n,i-r,o-n]}(T),v=e=>[(e.x-m)/_,(e.y-g)/y],[x,b,w,E]=T.map(v),I=(n=x[0],o=x[1],a=b[0],s=b[1],l=w[0],u=w[1],c=E[0],h=E[1],i=pQ(0,0,1,0,1,1,0,1),p=pQ(n,o,a,s,l,u,c,h),d=e.ct.adjoint([],p),e.ct.multiply(i,i,d));this.elevatedGlobePerspectiveTransform=pJ(x[0],x[1],b[0],b[1],w[0],w[1],E[0],E[1]);let M=(r,i)=>{O.push(r.lng);let n=Math.round((r.lng-D)/k*8192),o=Math.round((r.lat-R)/N*8192),a=v(i),s=e.Q.transformMat3([],[a[0],a[1],1],I),l=Math.round(s[0]/s[2]*8192),u=Math.round(s[1]/s[2]*8192);f.emplaceBack(n,o,l,u)},C=T[3].x-T[0].x,A=T[3].y-T[0].y,P=T[2].x-T[1].x,L=T[2].y-T[1].y;for(let e=0;e<65;e++){let r=e/64,i=[T[0].x+r*C,T[0].y+r*A],n=[T[1].x+r*P,T[1].y+r*L],o=n[0]-i[0],a=n[1]-i[1];for(let e=0;e<65;e++){let r=e/64,n={x:i[0]+o*r,y:i[1]+a*r,z:0};M(S.projection.unproject(n.x,n.y),n)}}this.elevatedGlobeVertexBuffer=r.createVertexBuffer(f,pZ.members)}{this.maxLongitudeTriangleSize=0;let e=[],i=new a8,n=(r,n,o)=>{i.emplaceBack(r,n,o);let a=O[r],s=O[n],l=O[o],u=Math.min(Math.min(a,s),l),c=Math.max(Math.max(a,s),l)-u;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),e.push(u+c/2)};for(let e=0;e<64;e++)for(let r=0;r<64;r++){let i=65*e+r,o=i+1,a=i+65,s=a+1;n(i,a,o),n(o,a,s)}[e,i]=function(e,r){let i=Array.from({length:e.length},(e,r)=>r);i.sort((r,i)=>e[r]-e[i]);let n=[],o=new a8;for(let a=0;a<i.length;a++){let s=i[a];n.push(e[s]);let l=3*s,u=l+1;o.emplaceBack(r.uint16[l],r.uint16[u],r.uint16[u+1])}return[n,o]}(e,i),this.elevatedGlobeTrianglesCenterLongitudes=e,this.elevatedGlobeIndexBuffer=r.createIndexBuffer(i)}this.elevatedGlobeSegments=sE.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,k/8192,0,N/8192,0,0,R,D,0])}prepare(){let e=0!==Object.keys(this.tiles).length;if(this.tileID&&!e)return;let r=this.map.painter.context,i=r.gl;!this._dirty||this.texture instanceof pK||(this.texture?this.texture.update(this.image):(this.texture=new pX(r,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(r)}loadTile(e,r){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored",r(null)}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){let r,i=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!i)return null;let n=this.elevatedGlobeTrianglesCenterLongitudes,o=(r=e+180)+360*Math.round((n[0]-r)/360),a=new sE,s=(e,r)=>{a.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:i.segments[0].vertexLength,primitiveLength:r,sortKey:void 0,vaos:{}})},l=.51*this.maxLongitudeTriangleSize;if(Math.abs(n[0]-o)<=l){let e=t5(n,0,n.length,o+l);return e===n.length||s(e,t3(n,e+1,n.length,o+360-l)-e),a}o<n[0]&&(o+=360);let u=t3(n,0,n.length,o-l);if(u===n.length)return s(0,n.length),a;s(0,u-0);let c=t5(n,u+1,n.length,o+l);return c!==n.length&&s(c,n.length-c),a}}class p2 extends aF{constructor(e,r,i){super(e,pY,r,i),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){return!(e&&e._source instanceof p1&&(e._source.onNorthPole||e._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(e){"raster-color"!==e&&"raster-color-range"!==e||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}updateColorRamp(e){if(!this.hasColorMap()||!this._curRampRange)return;let r=this._transitionablePaint._values["raster-color"].value.expression,[i,n]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(i)&&isNaN(n)||i===this._curRampRange[0]&&n===this._curRampRange[1]||(this.colorRamp=uT({expression:r,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:i,end:n}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[i,n])}}let p3=new ab({visibility:new ay(aS["layout_raster-particle"].visibility)});var p5={paint:new ab({"raster-particle-array-band":new ay(aS["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new ay(aS["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new ax(aS["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new ay(aS["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new ay(aS["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new ay(aS["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new ay(aS["paint_raster-particle"]["raster-particle-reset-rate-factor"])}),layout:p3};class p4 extends aF{constructor(e,r,i){super(e,p5,r,i),this._updateColorRamp(),this.lastInvalidatedAt=t9.now()}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){"raster-particle-color"!==e&&"raster-particle-max-speed"!==e||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===e&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;let e=this._transitionablePaint._values["raster-particle-color"].value.expression,r=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=uT({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:r}],resolution:256}),this.colorRampTexture=null}
15_invalidateAnimationState(){this.lastInvalidatedAt=t9.now()}}class p6 extends aF{constructor(e,r){super(e,{},r),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(e){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}let p8=new ab({visibility:new ay(aS.layout_sky.visibility)});var p9={paint:new ab({"sky-type":new ay(aS.paint_sky["sky-type"]),"sky-atmosphere-sun":new ay(aS.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new ay(aS.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new ay(aS.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new ay(aS.paint_sky["sky-gradient-radius"]),"sky-gradient":new ax(aS.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new ay(aS.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new ay(aS.paint_sky["sky-atmosphere-color"]),"sky-opacity":new ay(aS.paint_sky["sky-opacity"])}),layout:p8};function p7(r,i,n){let o=[0,0,1],a=e.bl.identity([]);return e.bl.rotateY(a,a,n?-(r*tb)+Math.PI:r*tb),e.bl.rotateX(a,a,-(i*tb)),e.Q.transformQuat(o,o,a),e.Q.normalize(o,o)}var de={paint:new ab({})};function dt(r,i){var n,o;let a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E,S,T=di(r.projection,r.zoom,r.width,r.height),I=(n=r.projection,o=r.center,a=new s6(o.lng-180*dn,o.lat),s=new s6(o.lng+180*dn,o.lat),l=n.project(a.lng,a.lat),c=-Math.atan2((u=n.project(s.lng,s.lat)).y-l.y,u.x-l.x),(h=lm.fromLngLat(o)).y=tM(h.y,-1+dn,1-dn),p=h.toLngLat(),d=n.project(p.lng,p.lat),f=lm.fromLngLat(p),f.x+=dn,m=f.toLngLat(),_=ds((g=n.project(m.lng,m.lat)).x-d.x,g.y-d.y,c),y=lm.fromLngLat(p),y.y+=dn,v=y.toLngLat(),b=ds((x=n.project(v.lng,v.lat)).x-d.x,x.y-d.y,c),w=Math.abs(_.x)/Math.abs(b.y),E=e.a9.identity([]),e.a9.rotateZ(E,E,-c*(1-(i?0:T))),S=e.a9.identity([]),e.a9.scale(S,S,[1,1-(1-w)*T,1]),S[4]=-b.x/b.y*T,e.a9.rotateZ(S,S,c),e.a9.multiply(S,E,S),S),M=dr(r);return e.a9.scale(I,I,[M,M,1]),I}function dr(e){let r=e.projection,i=di(e.projection,e.zoom,e.width,e.height);return Math.pow(2,da(r,e.center)*i+(1-i)*da(r,s6.convert(r.center)))}function di(e,r,i,n,o=1/0){let a=e.range;if(!a)return 0;let s=Math.log(Math.min(o,Math.max(i,n))/1024)/Math.LN2;return tC(a[0]+s,a[1]+s,r)}let dn=1/4e4;function da(e,r){let i=tM(r.lat,-85.051129,85.051129),n=new s6(r.lng-180*dn,i),o=new s6(r.lng+180*dn,i),a=e.project(n.lng,i),s=e.project(o.lng,i),l=lm.fromLngLat(n),u=lm.fromLngLat(o),c=s.x-a.x,h=s.y-a.y,p=u.x-l.x,d=u.y-l.y;return Math.log(Math.sqrt((p*p+d*d)/(c*c+h*h)))/Math.LN2}function ds(e,r,i){let n=Math.cos(i),o=Math.sin(i);return{x:e*n-r*o,y:e*o+r*n}}function dl(r,i,n){e.a9.identity(r),e.a9.rotateZ(r,r,i[2]*tb),e.a9.rotateX(r,r,i[0]*tb),e.a9.rotateY(r,r,i[1]*tb),e.a9.scale(r,r,n),e.a9.multiply(r,r,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function du(r,i,n,o,a,s,l,u){let c=[n[0]-i[0],n[1]-i[1],0],h=[o[0]-i[0],o[1]-i[1],0];if(1e-12>e.Q.length(c)||1e-12>e.Q.length(h))return e.bl.identity(r);let p=e.Q.cross([],c,h);return e.Q.normalize(p,p),e.Q.subtract(h,o,i),c[2]=(s-a)*u,h[2]=(l-a)*u,e.Q.cross(c,c,h),e.Q.normalize(c,c),e.bl.rotationTo(r,p,c)}function dc(r,i,n=!1){let o=uo(i.zoom),a=function(r,i,n){let o,a,s,l=i.worldSize,u=[r[12],r[13],r[14]],c=lc(u[1]/l),h=lu(u[0]/l),p=e.a9.identity([]),d=1/la(c)*l,f=1/la(0)*l*lp(c,i.zoom),m=1/ur(l),g=f*m;if(n){let e=di(i.projection,i.zoom,i.width,i.height,1024);g=m*i.projection.pixelSpaceConversion(i.center.lat,l,e)}let _=s5(c,h);e.Q.add(_,_,e.Q.scale([],e.Q.normalize([],_),d*g*u[2]));let y=(o=[_[0],_[1],_[2]],a=[0,1,0],s=e.Q.cross([],a,o),e.Q.cross(a,o,s),0===e.Q.squaredLength(a)&&(a=[0,1,0],e.Q.cross(s,o,a)),e.Q.normalize(s,s),e.Q.normalize(a,a),e.Q.normalize(o,o),[s[0],s[1],s[2],0,a[0],a[1],a[2],0,o[0],o[1],o[2],0,_[0],_[1],_[2],1]);e.a9.scale(p,p,[g,g,g*d]),e.a9.translate(p,p,[-u[0],-u[1],-u[2]]);let v=e.a9.multiply([],i.globeMatrix,y);return e.a9.multiply(v,v,p),e.a9.multiply(v,v,r),v}(r,i,n);if(o>0){let n,s,l,u,c,h,p,d,f,m=(n=i.worldSize,s=1/la(0)*n*lp(i.center.lat,i.zoom)/ur(n),l=1/la(i.center.lat)*n,u=e.a9.identity([]),e.a9.rotateY(u,u,i.center.lng*tb),e.a9.rotateX(u,u,i.center.lat*tb),e.a9.translate(u,u,[0,0,s0]),e.a9.scale(u,u,[s,s,s*l]),e.a9.translate(u,u,[i.point.x-.5*n,i.point.y-.5*n,0]),e.a9.multiply(u,u,r),e.a9.multiply(u,i.globeMatrix,u));return h=(c=(r,i,n)=>{let o=e.Q.length(r),a=e.Q.length(i),s=l2(r,i,n);return e.Q.scale(s,s,1/e.Q.length(s)*r2(o,a,n))})([a[0],a[1],a[2]],[m[0],m[1],m[2]],o),p=c([a[4],a[5],a[6]],[m[4],m[5],m[6]],o),d=c([a[8],a[9],a[10]],[m[8],m[9],m[10]],o),f=l2([a[12],a[13],a[14]],[m[12],m[13],m[14]],o),[h[0],h[1],h[2],0,p[0],p[1],p[2],0,d[0],d[1],d[2],0,f[0],f[1],f[2],1]}return a}function dh(e,r,i,n){let o,a=l$.projectAabbCorners(n,i),s=Number.MAX_VALUE,l=-1;for(let e=0;e<a.length;++e){let i=a[e];i[0]=(.5*i[0]+.5)*r.width,i[1]=(.5-.5*i[1])*r.height,i[2]<s&&(l=e,s=i[2])}let u=e=>new tx(a[e][0],a[e][1]);switch(l){case 0:case 6:o=[u(1),u(5),u(4),u(7),u(3),u(2),u(1)];break;case 1:case 7:o=[u(0),u(4),u(5),u(6),u(2),u(3),u(0)];break;case 3:case 5:o=[u(1),u(0),u(4),u(7),u(6),u(2),u(1)];break;default:o=[u(1),u(5),u(6),u(7),u(3),u(0),u(1)]}if(lE(e,o))return s}let dp=aj([{name:"a_pos_3f",components:3,type:"Float32"}]),dd=aj([{name:"a_color_3f",components:3,type:"Float32"}]),df=aj([{name:"a_color_4f",components:4,type:"Float32"}]),dm=aj([{name:"a_uv_2f",components:2,type:"Float32"}]),dg=aj([{name:"a_normal_3f",components:3,type:"Float32"}]),d_=aj([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),dy=aj([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);class dv{constructor(e,r,i,n){this.message=(e?`${e}: `:"")+i,n&&(this.identifier=n),null!=r&&r.__line__&&(this.line=r.__line__)}}function dx(e,r){let i=-1===e.indexOf("://");try{return new URL(e,i&&r?"http://example.com":void 0),!0}catch(e){return!1}}class db{constructor(e,r){this.feature=e,this.instancedDataOffset=r,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class dw{constructor(){this.instancedDataArray=new sa,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class dE{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1}populate(e,r,i,n){this.tileToMeter=lf(i);let o=this.layers[0]._featureFilter.needGeometry;for(let{feature:a,id:s,index:l,sourceLayerIndex:u}of(this.lookup=new Uint8Array(this.lookupDim*this.lookupDim),e)){let e=null!=s?s:a.properties&&a.properties.hasOwnProperty("id")?a.properties.id:void 0,c=lv(a,o);if(!this.layers[0]._featureFilter.filter(new au(this.zoom),c,i))continue;let h={id:e,sourceLayerIndex:u,index:l,geometry:o?c.geometry:ly(a,i,n),properties:a.properties,type:a.type,patterns:{}},p=this.addFeature(h,h.geometry,c);p&&r.featureIndex.insert(a,h.geometry,l,u,this.index,this.instancesPerModel[p].instancedDataArray.length,256)}this.lookup=null}update(e,r,i,n){for(let r in this.instancesPerModel){let i=this.instancesPerModel[r];for(let r in e)i.idToFeaturesIndex.hasOwnProperty(r)&&(this.evaluate(i.features[i.idToFeaturesIndex[r]],e[r],i,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let r=!1;for(let i in this.instancesPerModel){let n=this.instancesPerModel[i];for(let i of n.features){let o=this.layers[0],a=i.feature,s=this.canonical,l=o.paint.get("model-rotation").evaluate(a,{},s),u=o.paint.get("model-scale").evaluate(a,{},s),c=o.paint.get("model-translation").evaluate(a,{},s);e.Q.exactEquals(i.rotation,l)&&e.Q.exactEquals(i.scale,u)&&e.Q.exactEquals(i.translation,c)||(this.evaluate(i,i.featureStates,n,!0),r=!0)}}return r}isEmpty(){for(let e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(let r in this.instancesPerModel){let i=this.instancesPerModel[r];i.instancedDataArray.length<0||0===i.instancedDataArray.length||(i.instancedDataBuffer?i.instancedDataBuffer.updateData(i.instancedDataArray):i.instancedDataBuffer=e.createVertexBuffer(i.instancedDataArray,d_.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(let e in this.instancesPerModel){let r=this.instancesPerModel[e];0!==r.instancedDataArray.length&&r.instancedDataBuffer&&r.instancedDataBuffer.destroy()}let e=this.layers[0].modelManager;if(e&&this.modelUris)for(let r of this.modelUris)e.removeModel(r,"")}addFeature(e,r,i){let n=this.layers[0],o=n.layout.get("model-id").evaluate(i,{},this.canonical);if(!o)return tG(`modelId is not evaluated for layer ${n.id} and it is not going to get rendered.`),o;dx(o,!1)&&(this.modelUris.includes(o)||this.modelUris.push(o)),this.instancesPerModel[o]||(this.instancesPerModel[o]=new dw);let a=this.instancesPerModel[o],s=a.instancedDataArray,l=new db(i,s.length);for(let e of r)for(let r of e){if(r.x<0||r.x>=8192||r.y<0||r.y>=8192)continue;let e=(this.lookupDim-1)/8192,i=this.lookupDim*(r.y*e|0)+r.x*e|0;if(this.lookup){if(0!==this.lookup[i])continue;this.lookup[i]=1}this.instanceCount++;let n=s.length;s.resize(n+1),a.instancesEvaluatedElevation.push(0),s.float32[16*n]=r.x,s.float32[16*n+1]=r.y}return l.instancedDataCount=a.instancedDataArray.length-l.instancedDataOffset,l.instancedDataCount>0&&(e.id&&(a.idToFeaturesIndex[e.id]=a.features.length),a.features.push(l),this.evaluate(l,{},a,!1)),o}getModelUris(){return this.modelUris}evaluate(e,r,i,n){let o=this.layers[0],a=e.feature,s=this.canonical,l=e.rotation=o.paint.get("model-rotation").evaluate(a,r,s),u=e.scale=o.paint.get("model-scale").evaluate(a,r,s),c=e.translation=o.paint.get("model-translation").evaluate(a,r,s),h=o.paint.get("model-color").evaluate(a,r,s);h.a=o.paint.get("model-color-mix-intensity").evaluate(a,r,s);let p=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]),this.maxScale=Math.max(Math.max(this.maxScale,u[0]),Math.max(u[1],u[2])),dl(p,l,u);let d=Math.round(100*h.a)+h.b/1.05;for(let r=0;r<e.instancedDataCount;++r){let o=e.instancedDataOffset+r,a=16*o,l=i.instancedDataArray.float32,u=0;n&&(u=l[a+6]-i.instancesEvaluatedElevation[o]);let f=0|l[a+1];l[a]=(0|l[a])+h.r/1.05,l[a+1]=f+h.g/1.05,l[a+2]=d,l[a+3]=1/(s.z>10?this.tileToMeter:lf(s,f)),l[a+4]=c[0],l[a+5]=c[1],l[a+6]=c[2]+u,l[a+7]=p[0],l[a+8]=p[1],l[a+9]=p[2],l[a+10]=p[4],l[a+11]=p[5],l[a+12]=p[6],l[a+13]=p[8],l[a+14]=p[9],l[a+15]=p[10],i.instancesEvaluatedElevation[o]=c[2]}}}oS(dE,"ModelBucket",{omit:["layers"]}),oS(dw,"PerModelAttributes"),oS(db,"ModelFeature");let dS=new ab({visibility:new ay(aS.layout_model.visibility),"model-id":new av(aS.layout_model["model-id"])});var dT={paint:new ab({"model-opacity":new ay(aS.paint_model["model-opacity"]),"model-rotation":new av(aS.paint_model["model-rotation"]),"model-scale":new av(aS.paint_model["model-scale"]),"model-translation":new av(aS.paint_model["model-translation"]),"model-color":new av(aS.paint_model["model-color"]),"model-color-mix-intensity":new av(aS.paint_model["model-color-mix-intensity"]),"model-type":new ay(aS.paint_model["model-type"]),"model-cast-shadows":new ay(aS.paint_model["model-cast-shadows"]),"model-receive-shadows":new ay(aS.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new ay(aS.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new av(aS.paint_model["model-emissive-strength"]),"model-roughness":new av(aS.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new av(aS.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new ay(aS.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new ay(aS.paint_model["model-front-cutoff"])}),layout:dS};
15let dI={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function dM(r,i,n,o,a,s,l,u,c,h=!1){let p=n.zoom,d=n.project(o),f=lp(o.lat,p),m=1/f;e.a9.identity(r),e.a9.translate(r,r,[d.x+l[0]*m,d.y+l[1]*m,l[2]]);let g=1,_=1,y=n.worldSize;if(h){if("mercator"===n.projection.name){let r=0;n.elevation&&(r=n.elevation.getAtPointOrZero(new lm(d.x/y,d.y/y),0));let i=e.aa.transformMat4([],[d.x,d.y,r,1],n.projMatrix)[3]/n.cameraToCenterDistance;g=i,_=i*lp(n.center.lat,p)}else if("globe"===n.projection.name){let i=dc(r,n),a=e.a9.multiply([],n.projMatrix,i),s=[0,0,0,1];e.aa.transformMat4(s,s,a);let l=s[3]/n.cameraToCenterDistance,u=uo(p),c=n.projection.pixelsPerMeter(o.lat,y)*lp(o.lat,p),h=n.projection.pixelsPerMeter(n.center.lat,y)*lp(n.center.lat,p);g=l/r2(c,lh(n.center.lat),u),_=l*f/c,g*=h,_*=h}}else g=m;e.a9.scale(r,r,[g,g,_]);let v=[...r],x=i.orientation,b=[];if(dl(b,[x[0]+a[0],x[1]+a[1],x[2]+a[2]],s),e.a9.multiply(r,v,b),u&&n.elevation){let a=0,s=[];if(c&&n.elevation){a=function(r,i,n,o,a){let s=i.elevation;if(!s)return 0;let l=l$.projectAabbCorners(n,o),u=1/la(a.lat)*i.worldSize,c=function(r,i){let n=[0,0,1],o=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(let a of o){let o=r[a.corners[0]],s=r[a.corners[1]],l=r[a.corners[2]],u=[s[0]-o[0],s[1]-o[1],i*(s[2]-o[2])],c=e.Q.cross(u,u,[l[0]-o[0],l[1]-o[1],i*(l[2]-o[2])]);e.Q.normalize(c,c),a.dotProductWithUp=e.Q.dot(c,n)}return o.sort((e,r)=>e.dotProductWithUp-r.dotProductWithUp),o[0].corners}(l,u),h=l[c[0]],p=l[c[1]],d=l[c[2]],f=l[c[3]],m=s.getAtPointOrZero(new lm(h[0]/i.worldSize,h[1]/i.worldSize),0),g=s.getAtPointOrZero(new lm(p[0]/i.worldSize,p[1]/i.worldSize),0),_=s.getAtPointOrZero(new lm(d[0]/i.worldSize,d[1]/i.worldSize),0),y=s.getAtPointOrZero(new lm(f[0]/i.worldSize,f[1]/i.worldSize),0),v=(m+y)/2,x=(g+_)/2;return v>x?g<_?du(r,p,f,h,g,y,m,u):du(r,d,h,f,_,m,y,u):m<y?du(r,h,p,d,m,g,_,u):du(r,f,d,p,y,_,g,u),Math.max(v,x)}(s,n,i.aabb,r,o);let l=e.a9.fromQuat([],s),u=e.a9.multiply([],l,b);e.a9.multiply(r,v,u)}else a=n.elevation.getAtPointOrZero(new lm(d.x/y,d.y/y),0);0!==a&&(r[14]+=a)}}function dC(e,r,i=!1){e.uploaded||(e.gfxTexture=new pX(r,e.image,i?r.gl.R8:r.gl.RGBA,{useMipmap:e.sampler.minFilter>=r.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function dA(e,r,i){if(e.meshes)for(let n of e.meshes)!function(e,r,i){e.indexBuffer=r.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=r.createVertexBuffer(e.vertexArray,dp.members,!1,!0),e.normalArray&&(e.normalBuffer=r.createVertexBuffer(e.normalArray,dg.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=r.createVertexBuffer(e.texcoordArray,dm.members,!1,!0)),e.colorArray&&(e.colorBuffer=r.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?dd:df).members,!1,!0)),e.featureArray&&(e.pbrBuffer=r.createVertexBuffer(e.featureArray,dy.members,!0)),e.segments=sE.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);let n=e.material;n.pbrMetallicRoughness.baseColorTexture&&dC(n.pbrMetallicRoughness.baseColorTexture,r),n.pbrMetallicRoughness.metallicRoughnessTexture&&dC(n.pbrMetallicRoughness.metallicRoughnessTexture,r),n.normalTexture&&dC(n.normalTexture,r),n.occlusionTexture&&dC(n.occlusionTexture,r,i),n.emissionTexture&&dC(n.emissionTexture,r)}(n,r,i);if(e.children)for(let n of e.children)dA(n,r,i)}function dP(e){if(e.meshes)for(let r of e.meshes)r.indexArray.destroy(),r.vertexArray.destroy(),r.colorArray&&r.colorArray.destroy(),r.normalArray&&r.normalArray.destroy(),r.texcoordArray&&r.texcoordArray.destroy(),r.featureArray&&r.featureArray.destroy();if(e.children)for(let r of e.children)dP(r)}function dL(e){var r;if(e.meshes)for(let i of e.meshes)i.vertexBuffer&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.normalBuffer&&i.normalBuffer.destroy(),i.texcoordBuffer&&i.texcoordBuffer.destroy(),i.colorBuffer&&i.colorBuffer.destroy(),i.pbrBuffer&&i.pbrBuffer.destroy(),i.segments.destroy(),i.material&&((r=i.material).pbrMetallicRoughness.baseColorTexture&&r.pbrMetallicRoughness.baseColorTexture.gfxTexture&&r.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),r.pbrMetallicRoughness.metallicRoughnessTexture&&r.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&r.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),r.normalTexture&&r.normalTexture.gfxTexture&&r.normalTexture.gfxTexture.destroy(),r.emissionTexture&&r.emissionTexture.gfxTexture&&r.emissionTexture.gfxTexture.destroy(),r.occlusionTexture&&r.occlusionTexture.gfxTexture&&r.occlusionTexture.gfxTexture.destroy()));if(e.children)for(let r of e.children)dL(r)}
15class dO{constructor(e){this._callback=e,this._triggered=!1,"u">typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class dD{constructor(){this.tasks={},this.taskQueue=[],tF(["process"],this),this.invoker=new dO(this.process),this.nextId=0}add(e,r){let i=this.nextId++,n=function({type:e,isSymbolTile:r,zoom:i}){return i=i||0,"message"===e?0:"maybePrepare"!==e||r?"parseTile"!==e||r?"parseTile"===e&&r?300-i:"maybePrepare"===e&&r?400-i:500:200-i:100-i}(r);return 0===n?(t$(),e(),null):(this.tasks[i]={fn:e,metadata:r,priority:n,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}})}process(){t$();{if(this.taskQueue=this.taskQueue.filter(e=>!!this.tasks[e]),!this.taskQueue.length)return;let e=this.pick();if(null===e)return;let r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!r)return;r.fn()}}pick(){let e=null,r=1/0;for(let i=0;i<this.taskQueue.length;i++){let n=this.tasks[this.taskQueue[i]];n.priority<r&&(r=n.priority,e=i)}if(null===e)return null;let i=this.taskQueue[e];return this.taskQueue.splice(e,1),i}remove(){this.invoker.remove()}}class dR{constructor(e,r,i){this.target=e,this.parent=r,this.mapId=i,this.callbacks={},this.cancelCallbacks={},tF(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new dD}send(e,r,i,n,o=!1,a){let s=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=a,this.callbacks[s]=i);let l=new Set;return this.target.postMessage({id:s,type:e,hasCallback:!!i,targetMapId:n,mustQueue:o,sourceMapId:this.mapId,data:oM(r,l)},l),{cancel:()=>{i&&delete this.callbacks[s],this.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(e){let r=e.data,i=r.id;if(i&&(!r.targetMapId||this.mapId===r.targetMapId))if("<cancel>"===r.type){let e=this.cancelCallbacks[i];delete this.cancelCallbacks[i],e&&e.cancel()}else if(r.mustQueue||t$()){let e=this.callbacks[i],n=this.scheduler.add(()=>this.processTask(i,r),e&&e.metadata||{type:"message"});n&&(this.cancelCallbacks[i]=n)}else this.processTask(i,r)}processTask(e,r){if(delete this.cancelCallbacks[e],"<response>"===r.type){let i=this.callbacks[e];delete this.callbacks[e],i&&(r.error?i(oC(r.error)):i(null,oC(r.data)))}else{let i=new Set,n=r.hasCallback?(r,n)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:r?oM(r):null,data:oM(n,i)},i)}:e=>{},o=oC(r.data);if(this.parent[r.type])this.parent[r.type](r.sourceMapId,o,n);else if(this.parent.getWorkerSource){let e=r.type.split(".");this.parent.getWorkerSource(r.sourceMapId,e[0],o.source,o.scope)[e[1]](o,n)}else n(Error(`Could not find function ${r.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}class dk{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=tD();const i=this.workerPool.acquire(this.id);for(let e=0;e<i.length;e++){const n=new dk.Actor(i[e],r,this.id);n.name=`Worker ${e}`,this.actors.push(n)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(e,r,i){tP(this.actors,(i,n)=>{i.send(e,r,n)},i=i||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(e=>{e.remove()}),this.actors=[],this.workerPool.release(this.id)}}dk.Actor=dR;var dN={workerUrl:"",workerClass:null,workerParams:void 0};function dF(){return null!=dN.workerClass?new dN.workerClass:new self.Worker(dN.workerUrl,dN.workerParams)}let dz="mapboxgl_preloaded_worker_pool";class dB{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<dB.workerCount;)this.workers.push(new dF);return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&0===this.numActive()&&(this.workers.forEac
15h(e=>{e.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[dz]}numActive(){return Object.keys(this.active).length}}function dU(){return l||(l=new dB),l}dB.workerCount=2;let dj,dV,dG,dq,dH,d$=null;function dW(){return t$()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:dV||v.DRACO_URL}function dY(){if(t$()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(dq)return dq;let e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw Error("WebAssembly not supported, cannot instantiate meshoptimizer");return dq=WebAssembly.validate(e)?v.MESHOPT_SIMD_URL:v.MESHOPT_URL}let dZ={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},dX={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},dK={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function dQ(e,r,i){let n=i.json.bufferViews.length,o=i.buffers.length;r.bufferView=n,i.json.bufferViews[n]={buffer:o,byteLength:e.byteLength},i.buffers[o]=e}let dJ="KHR_draco_mesh_compression",d0="EXT_meshopt_compression",d1=new TextDecoder("utf8");function d2(e,r){return new URL(e,r).href}function d3(e,r){let i=e.json.bufferViews[r];return new Uint8Array(e.buffers[i.buffer],i.byteOffset||0,i.byteLength)}function d5(e,r=0,i){let n={json:null,images:[],buffers:[]};if(0x46546c67===new Uint32Array(e,r,1)[0]){let i=new Uint32Array(e,r),o=2,a=(i[o++]>>2)-3,s=i[o++]>>2;if(o++,n.json=JSON.parse(d1.decode(i.subarray(o,o+s))),(o+=s)<a){let a=i[o++],s=r+(++o<<2);n.buffers[0]=e.slice(s,s+a)}}else n.json=JSON.parse(d1.decode(new Uint8Array(e,r)));let{buffers:o,images:a,meshes:s,extensionsUsed:l,bufferViews:u}=n.json,c=Promise.resolve();if(o){let e=[];for(let r=0;r<o.length;r++){let a=o[r];a.uri?e.push(function(e,r,i,n){return fetch(d2(e.uri,n)).then(e=>e.arrayBuffer()).then(e=>{r.buffers[i]=e})}(a,n,r,i)):n.buffers[r]||(n.buffers[r]=null)}c=Promise.all(e)}return c.then(()=>{let e=[],r=l&&l.includes(dJ),o=l&&l.includes(d0);if(r&&e.push(function(){if(!dG)return dj||(dj=function(e){let r,i=null;function n(){r=new Uint8Array(i.buffer)}function o(){throw Error("Unexpected Draco error.")}let a={a:{a:o,d:function(e,i,n){return r.copyWithin(e,i,i+n)},c:function(e){let o=r.length,a=Math.ceil((Math.max(e>>>0,Math.ceil(1.2*o))-o)/65536);try{return i.grow(a),n(),!0}catch(e){return!1}},b:o}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,a):e.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,a))).then(e=>{let o,a,s,l,{Rb:u,Qb:c,P:h,T:p,X:d,Ja:f,La:m,Qa:g,Va:_,Wa:y,eb:v,jb:x,f:b,e:w,yb:E,zb:S,Ab:T,Bb:I,Db:M,Gb:C}=e.instance.exports;i=w;let A=(o=0,a=0,s=0,l=0,e=>{s&&(u(l),u(o),a+=s,s=o=0),o||(a+=128,o=c(a));let i=e.length+7&-8,n=o;i>=a&&(s=i,n=l=c(i));for(let i=0;i<e.length;i++)r[n+i]=e[i];return n});return n(),b(),{memory:w,_free:u,_malloc:c,Mesh:class{constructor(){this.ptr=h()}destroy(){p(this.ptr)}},Decoder:class{constructor(){this.ptr=f()}destroy(){x(this.ptr)}DecodeArrayToMesh(e,r,i){let n=A(e);return!!d(m(this.ptr,n,r,i.ptr))}GetAttributeByUniqueId(e,r){return{ptr:g(this.ptr,e.ptr,r)}}GetTrianglesUInt16Array(e,r,i){_(this.ptr,e.ptr,r,i)}GetTrianglesUInt32Array(e,r,i){y(this.ptr,e.ptr,r,i)}GetAttributeDataArrayForAllPoints(e,r,i,n,o){v(this.ptr,e.ptr,r.ptr,i,n,o)}},DT_INT8:E(),DT_UINT8:S(),DT_INT16:T(),DT_UINT16:I(),DT_UINT32:M(),DT_FLOAT32:C()}})}(fetch(dW()))).then(e=>{dG=e,dj=void 0})}()),o&&e.push(function(){var e;let r,i,n,o;if(dH)return;let a=(e=fetch(dY()),i=WebAssembly.instantiateStreaming(e,{}).then(e=>{(r=e.instance).exports.__wasm_call_ctors()}),n={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},o={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},{ready:i,supported:!0,decodeGltfBuffer(e,i,a,s,l,u){!function(e,r,i,n,o,a,s){let l=e.exports.sbrk,u=n+3&-4,c=l(u*o),h=l(a.length),p=new Uint8Array(e.exports.memory.buffer);p.set(a,h);let d=r(c,n,o,h,a.length);if(0===d&&s&&s(c,u,o),i.set(p.subarray(c,c+n*o)),l(c-l(0)),0!==d)throw Error(`Malformed buffer data: ${d}`)}(r,r.exports[o[l]],e,i,a,s,r.exports[n[u]])}});return a.ready.then(()=>{dH=a})}()),a)for(let r=0;r<a.length;r++)e.push(function(e,r,i,n){return e.uri?fetch(d2(e.uri,n)).then(e=>e.blob()).then(e=>createImageBitmap(e)).then(e=>{r.images[i]=e}):void 0!==e.bufferView?createImageBitmap(new Blob([d3(r,e.bufferView)],{type:e.mimeType})).then(e=>{r.images[i]=e}):void 0}(a[r],n,r,i));return(e.length?Promise.all(e):Promise.resolve()).then(()=>
15{if(r&&s)for(let{primitives:e}of s)for(let r of e)!function(e,r){let i=e.extensions&&e.extensions[dJ];if(!i)return;let n=new dG.Decoder,o=d3(r,i.bufferView),a=new dG.Mesh;if(!n.DecodeArrayToMesh(o,o.byteLength,a))throw Error("Failed to decode Draco mesh");let s=r.json.accessors[e.indices],l=dZ[s.componentType],u=s.count*l.BYTES_PER_ELEMENT,c=dG._malloc(u);for(let o of(l===Uint16Array?n.GetTrianglesUInt16Array(a,u,c):n.GetTrianglesUInt32Array(a,u,c),dQ(dG.memory.buffer.slice(c,c+u),s,r),dG._free(c),Object.keys(i.attributes))){let s=n.GetAttributeByUniqueId(a,i.attributes[o]),l=r.json.accessors[e.attributes[o]],u=dX[l.componentType],c=l.count*dK[l.type]*dZ[l.componentType].BYTES_PER_ELEMENT,h=dG._malloc(c);n.GetAttributeDataArrayForAllPoints(a,s,dG[u],c,h),dQ(dG.memory.buffer.slice(h,h+c),l,r),dG._free(h)}n.destroy(),a.destroy(),delete e.extensions[dJ]}(r,n);if(o&&s&&u)for(let e of u)!function(e,r){if(!e.extensions||!e.extensions[d0])return;let i=e.extensions[d0],n=new Uint8Array(r.buffers[i.buffer],i.byteOffset||0,i.byteLength||0),o=new Uint8Array(i.count*i.byteStride);dH.decodeGltfBuffer(o,i.count,i.byteStride,n,i.mode,i.filter),e.buffer=r.buffers.length,e.byteOffset=0,r.buffers[e.buffer]=o.buffer,delete e.extensions[d0]}(e,n);return n})})}class d4{constructor(e,r,i,n){if(this.triangleCount=r.length/3,this.min=new tx(0,0),this.max=new tx(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===e.length)return;const[o,a]=[e[0].clone(),e[0].clone()];for(let r=1;r<e.length;++r){const i=e[r];o.x=Math.min(o.x,i.x),o.y=Math.min(o.y,i.y),a.x=Math.max(a.x,i.x),a.y=Math.max(a.y,i.y)}if(n&&(i=Math.max(i,Math.ceil(Math.max(a.x-o.x,a.y-o.y)/n))),0===i)return;this.min=o,this.max=a;const s=this.max.sub(this.min);s.x=Math.max(s.x,1),s.y=Math.max(s.y,1);const l=Math.max(s.x,s.y)/i;this.cellsX=Math.max(1,Math.ceil(s.x/l)),this.cellsY=Math.max(1,Math.ceil(s.y/l)),this.xScale=1/l,this.yScale=1/l;const u=[];for(let i=0;i<this.triangleCount;i++){const n=e[r[3*i+0]].sub(this.min),o=e[r[3*i+1]].sub(this.min),a=e[r[3*i+2]].sub(this.min),s=d6(Math.floor(Math.min(n.x,o.x,a.x)),this.xScale,this.cellsX),c=d6(Math.floor(Math.max(n.x,o.x,a.x)),this.xScale,this.cellsX),h=d6(Math.floor(Math.min(n.y,o.y,a.y)),this.yScale,this.cellsY),p=d6(Math.floor(Math.max(n.y,o.y,a.y)),this.yScale,this.cellsY),d=new tx(0,0),f=new tx(0,0),m=new tx(0,0),g=new tx(0,0);for(let e=h;e<=p;++e){d.y=f.y=e*l,m.y=g.y=(e+1)*l;for(let r=s;r<=c;++r)d.x=m.x=r*l,f.x=g.x=(r+1)*l,(lO(n,o,a,d,f,g)||lO(n,o,a,d,g,m))&&u.push({cellIdx:e*this.cellsX+r,triIdx:i})}}if(0===u.length)return;u.sort((e,r)=>e.cellIdx-r.cellIdx||e.triIdx-r.triIdx);let c=0;for(;c<u.length;){const e=u[c].cellIdx,r={start:this.payload.length,len:0};for(;c<u.length&&u[c].cellIdx===e;)++r.len,this.payload.push(u[c++].triIdx);this.cells[e]=r}}query(e,r,i){if(0===this.triangleCount||0===this.cells.length||e.x>this.max.x||this.min.x>r.x||e.y>this.max.y||this.min.y>r.y)return;this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8)));for(let e=0;e<this.lookup.length;e++)this.lookup[e]=0;let n=d6(e.x-this.min.x,this.xScale,this.cellsX),o=d6(r.x-this.min.x,this.xScale,this.cellsX),a=d6(e.y-this.min.y,this.yScale,this.cellsY),s=d6(r.y-this.min.y,this.yScale,this.cellsY);for(let e=a;e<=s;e++)for(let r=n;r<=o;r++){let n=this.cells[e*this.cellsX+r];if(n)for(let e=0;e<n.len;e++){let r=this.payload[n.start+e],o=Math.floor(r/8),a=1<<r%8;if(!(this.lookup[o]&a)&&(this.lookup[o]|=a,i.push(r),i.length===this.triangleCount))return}}}}function d6(e,r,i){return Math.max(0,Math.min(i-1,Math.floor(e*r)))}function d8(e,r){let i=e.json.bufferViews[r.bufferView],n=dZ[r.componentType];return new n(e.buffers[i.buffer],(r.byteOffset||0)+(i.byteOffset||0),r.count*(i.byteStride&&i.byteStride!==dK[r.type]*n.BYTES_PER_ELEMENT?i.byteStride/n.BYTES_PER_ELEMENT:dK[r.type]))}function d9(e,r,i,n){let o=dZ[r.componentType],a=function(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(o),s=e.json.bufferViews[r.bufferView],l=s.byteStride?s.byteStride/o.BYTES_PER_ELEMENT:dK[r.type],u=i.float32,c=u.length/i.capacity;for(let e=0,i=0;e<r.count*l;e+=l,i+=c)for(let r=0;r<c;r++)u[i+r]=n[e+r]*a;i._trim()}
15function d7(r){let i=function(e,r){let i=[],n=WebGL2RenderingContext;if(e.json.textures)for(let o of e.json.textures){let a={magFilter:n.LINEAR,minFilter:n.NEAREST,wrapS:n.REPEAT,wrapT:n.REPEAT};void 0!==o.sampler&&Object.assign(a,e.json.samplers[o.sampler]),i.push({image:r[o.source],sampler:a,uploaded:!1})}return i}(r,r.images),n=function(e,r){let i=[];for(let n of e.json.meshes){let o=[];for(let i of n.primitives)o.push(function(e,r,i){let n=e.indices,o=e.attributes,a={};a.indexArray=new a8;let s=r.json.accessors[n],l=s.count/3;a.indexArray.reserve(l);let u=d8(r,s);for(let e=0;e<l;e++)a.indexArray.emplaceBack(u[3*e],u[3*e+1],u[3*e+2]);a.indexArray._trim(),a.vertexArray=new so;let c=r.json.accessors[o.POSITION];a.vertexArray.reserve(c.count);let h=d8(r,c);for(let e=0;e<c.count;e++)a.vertexArray.emplaceBack(h[3*e],h[3*e+1],h[3*e+2]);if(a.vertexArray._trim(),a.aabb=new l$(c.min,c.max),a.centroid=function(e,r){let i=[0,0,0],n=e.length;if(n>0){for(let o=0;o<n;o++){let n=3*e[o];i[0]+=r[n],i[1]+=r[n+1],i[2]+=r[n+2]}i[0]/=n,i[1]/=n,i[2]/=n}return i}(u,h),void 0!==o.COLOR_0){let e=r.json.accessors[o.COLOR_0],i=dK[e.type],n=d8(r,e);a.colorArray=3===i?new so:new aY,a.colorArray.resize(e.count),d9(r,e,a.colorArray,n)}if(void 0!==o.NORMAL){a.normalArray=new so;let e=r.json.accessors[o.NORMAL];a.normalArray.resize(e.count);let i=d8(r,e);d9(r,e,a.normalArray,i)}if(void 0!==o.TEXCOORD_0&&i.length>0){a.texcoordArray=new aZ;let e=r.json.accessors[o.TEXCOORD_0];a.texcoordArray.resize(e.count);let i=d8(r,e);d9(r,e,a.texcoordArray,i)}if(void 0!==o._FEATURE_ID_RGBA4444){let e=r.json.accessors[o._FEATURE_ID_RGBA4444];r.json.extensionsUsed&&r.json.extensionsUsed.includes("EXT_meshopt_compression")&&(a.featureData=d8(r,e))}void 0!==o._FEATURE_RGBA4444&&(a.featureData=new Uint32Array(d8(r,r.json.accessors[o._FEATURE_RGBA4444]).buffer));let p=e.material;return a.material=function(e,r){let{emissiveFactor:i=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:o=.5,normalTexture:a,occlusionTexture:s,emissiveTexture:l,doubleSided:u}=e,{baseColorFactor:c=[1,1,1,1],metallicFactor:h=1,roughnessFactor:p=1,baseColorTexture:d,metallicRoughnessTexture:f}=e.pbrMetallicRoughness||{},m=s?r[s.index]:void 0;if(s&&s.extensions&&s.extensions.KHR_texture_transform&&m){let e=s.extensions.KHR_texture_transform;m.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new r1(...c),metallicFactor:h,roughnessFactor:p,baseColorTexture:d?r[d.index]:void 0,metallicRoughnessTexture:f?r[f.index]:void 0},doubleSided:u,emissiveFactor:i,alphaMode:n,alphaCutoff:o,normalTexture:a?r[a.index]:void 0,occlusionTexture:m,emissionTexture:l?r[l.index]:void 0,defined:void 0===e.defined}}(void 0!==p?r.json.materials[p]:{defined:!1},i),a}(i,e,r));i.push(o)}return i}(r,i),{scenes:o,scene:a,nodes:s}=r.json,l=o?o[a||0].nodes:s,u=[];for(let i of l)u.push(function r(i,n,o){let{matrix:a,rotation:s,translation:l,scale:u,mesh:c,extras:h,children:p}=i,d={};if(d.matrix=a||e.a9.fromRotationTranslationScale([],s||[0,0,0,1],l||[0,0,0],u||[1,1,1]),void 0!==c){d.meshes=o[c];let e=d.anchor=[0,0];for(let r of d.meshes){let{min:i,max:n}=r.aabb;e[0]+=i[0]+n[0],e[1]+=i[1]+n[1]}e[0]=Math.floor(e[0]/d.meshes.length/2),e[1]=Math.floor(e[1]/d.meshes.length/2)}if(h&&(h.id&&(d.id=h.id),h.lights&&(d.lights=function(e){if(!e.length)return[];let r=function(e){let r=atob(e),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.codePointAt(e);return i}(e),i=[],n=r.length/24,o=new Uint16Array(r.buffer),a=new Float32Array(r.buffer);for(let e=0;e<n;e++){let r=o[2*e*6]/30,n=o[2*e*6+1]/30,s=o[2*e*6+10]/100,l=a[6*e+1],u=a[6*e+2],c=a[6*e+3],h=a[6*e+4],p=c-l,d=h-u,f=Math.hypot(p,d);i.push({pos:[l+.5*p,u+.5*d,n],normal:[d/f,-p/f,0],width:f,height:r,depth:s,points:[l,u,c,h]})}return i}(h.lights))),p){let e=[];for(let i of p)e.push(r(n.json.nodes[i],n,o));d.children=e}return d}(s[i],r,n));return function(r,i,n){let o={},a=new Set;for(let e=0;e<r.length;e++){let r=n[i[e]];if(!r.extras)continue;let s=r.extras["mapbox:footprint:version"],l=r.extras["mapbox:footprint:id"];(s||l)&&a.add(e),"1.0.0"===s&&l&&(o[l]=e)}for(let s=0;s<r.length;s++){if(a.has(s))continue;let l=r[s],u=n[i[s]];if(!u.extras)continue;let c=null;l.id in o&&(c=function(r,i){let n=[],o=[],a=0,s=[];for(let l of r){a=n.length;let r=l.vertexArray.float32,u=l.indexArray.uint16;for(let o=0;o<l.vertexArray.length;o++)s[0]=r[3*o+0],s[1]=r[3*o+1],s[2]=r[3*o+2],e.Q.transformMat4(s,s,i),n.push(new tx(s[0],s[1]));for(let e=0;e<3*l.indexArray.length;e++)o.push(u[e]+a)}if(o.length%3!=0)return null;for(let e=0;e<o.length;e+=3){let r=n[o[e+0]],i=n[o[e+1]],a=n[o[e+2]];(r.x-i.x)*(a.y-i.y)-(a.x-i.x)*(r.y-i.y)>0&&([o[e+1],o[e+2]]=[o[e+2],o[e+1]])}return{vertices:n,indices:o}}(r[o[l.id]].meshes,l.matrix)),c||(c=function(e){if(!e.extras||!e.extras.ground)return null;let r=e.extras.ground;if(!r||!Array.isArray(r)||0===r.length)return null;let i=r[0];if(!i||!Array.isArray(i)||0===i.length)return null;let n=[];for(let e of i){if(!Array.isArray(e)||2!==e.length)continue;let r=e[0],i=e[1];"number"==typeof r&&"number"==typeof i&&n.push(new tx(r,i))}if(n.length<3)return null;n.length>1&&n[n.length-1].equals(n[0])&&n.pop();let o=0;for(let e=0;e<n.length;e++){let r=n[e],i=n[(e+1)%n.length],a=n[(e+2)%n.length];o+=(r.x-i.x)*(a.y-i.y)-(a.x-i.x)*(r.y-i.y)}o>0&&n.reverse();let a=uW(n.flatMap(e=>[e.x,e.y]),[]);return 0===a.length?null:{vertices:n,indices:a}}(u)),c&&(l.footprint=function(e){if(0===e.vertices.length||0===e.indices.length)return null;let r=new d4(e.vertices,e.indices,8,256),[i,n]=[r.min.clone(),r.max.clone()];return{vertices:e.vertices,indices:e.indices,grid:r,min:i,max:n}}(c))}if(a.size>0){let e=Array.from(a.values()).sort((e,r)=>e-r);for(let i=e.length-1;i>=0;i--)r.splice(e[i],1)}}(u,l,r.json.nodes),u}oS(d4,"TriangleGridIndex");class fe{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const i=e[r];this._stringToNumber[i]=r,this._numberToString[r]=i}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}let ft=["tile","layer","source","sourceLayer","state"];
15class fr{constructor(e,r,i,n,o){this.type="Feature",this._vectorTileFeature=e,this._z=r,this._x=i,this._y=n,this.properties=e.properties,this.id=o}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(let r of(void 0!==this.id&&(e.id=this.id),ft))void 0!==this[r]&&(e[r]=this[r]);return e}}class fi{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new ow(8192,16,0),this.featureIndexArray=new sv,this.promoteId=r,this.is3DTile=!1}insert(e,r,i,n,o,a=0,s=0){let l=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,o,a);let u=this.grid;for(let e=0;e<r.length;e++){let i=r[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<i.length;e++){let r=i[e];n[0]=Math.min(n[0],r.x),n[1]=Math.min(n[1],r.y),n[2]=Math.max(n[2],r.x),n[3]=Math.max(n[3],r.y)}0!==s&&(n[0]-=s,n[1]-=s,n[2]+=s,n[3]+=s),n[0]<8192&&n[1]<8192&&n[2]>=0&&n[3]>
15=0&&u.insert(l,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers)for(let e in this.vtLayers=new ci(new hk(this.rawTileData)).layers,this.sourceLayerCoder=new fe(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={},this.vtLayers)this.vtFeatures[e]=[];return this.vtLayers}query(e,r,i,n){let o;this.loadVTLayers();let a=e.params||{},s=aI(a.filter),l=e.tileResult,u=e.transform,c=l.bufferedTilespaceBounds,h=this.grid.query(c.min.x,c.min.y,c.max.x,c.max.y,(e,r,i,n)=>lP(l.bufferedTilespaceGeometry,e,r,i,n));h.sort(fo);let p=null;u.elevation&&h.length>0&&(p=cw.create(u.elevation,this.tileID));let d={};for(let c=0;c<h.length;c++){let f=h[c];if(f===o)continue;o=f;let m=this.featureIndexArray.get(f),g=null;if(this.is3DTile){let e=this.bucketLayerIDs[0][0],i=r[e];if("model"!==i.type)continue;let{queryFeature:n,intersectionZ:o}=i.queryIntersectsMatchingFeature(l,m.featureIndex,s,u);n&&this.appendToResult(d,e,m.featureIndex,n,o)}else this.loadMatchingFeature(d,m,s,a.layers,a.availableImages,r,i,n,(r,i,n,o=0)=>(g||(g=ly(r,this.tileID.canonical,e.tileTransform)),i.queryIntersectsFeature(l,r,n,g,this.z,e.transform,e.pixelPosMatrix,p,o)))}return d}loadMatchingFeature(e,r,i,n,o,a,s,l,u){let{featureIndex:c,bucketIndex:h,sourceLayerIndex:p,layoutVertexArrayOffset:d}=r,f=this.bucketLayerIDs[h];if(n&&!function(e,r){for(let i=0;i<e.length;i++)if(r.indexOf(e[i])>=0)return!0;return!1}(n,f))return;let m=this.sourceLayerCoder.decode(p),g=this.vtLayers[m].feature(c);if(i.needGeometry){let e=lv(g,!0);if(!i.filter(new au(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new au(this.tileID.overscaledZ),g))return;let _=this.getId(g,m);for(let r=0;r<f.length;r++){let i=f[r];if(n&&0>n.indexOf(i))continue;let h=a[i];if(!h)continue;let p={};void 0!==_&&l&&(p=l.getState(h.sourceLayer||"_geojsonTileLayer",_));let m=!u||u(g,h,p,d);if(!m)continue;let y=new fr(g,this.z,this.x,this.y,_),v=tL({},s[i]);v.paint=fn(v.paint,h.paint,g,p,o),v.layout=fn(v.layout,h.layout,g,p,o),y.layer=v,this.appendToResult(e,i,c,y,m)}}appendToResult(e,r,i,n,o){let a=e[r];void 0===a&&(a=e[r]=[]),a.push({featureIndex:i,feature:n,intersectionZ:o})}lookupSymbolFeatures(e,r,i,n,o,a,s,l){let u={};this.loadVTLayers();let c=aI(o);for(let o of e)this.loadMatchingFeature(u,{bucketIndex:i,sourceLayerIndex:n,featureIndex:o,layoutVertexArrayOffset:0},c,a,s,l,r);return u}loadFeature(e){let{featureIndex:r,sourceLayerIndex:i}=e;this.loadVTLayers();let n=this.sourceLayerCoder.decode(i),o=this.vtFeatures[n];if(o[r])return o[r];let a=this.vtLayers[n].feature(r);return o[r]=a,a}hasLayer(e){for(let r of this.bucketLayerIDs)for(let i of r)if(e===i)return!0;return!1}getId(e,r){let i=e.id;if(this.promoteId){let n="string"==typeof this.promoteId?this.promoteId:this.promoteId[r];null!=n&&(i=e.properties[n]),"boolean"==typeof i&&(i=Number(i))}return i}}function fn(e,r,i,n,o){return tB(e,(e,a)=>{let s=r instanceof a_?r.get(a):null;return s&&s.evaluate?s.evaluate(i,n,o):s})}function fo(e,r){return r-e}oS(fi,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});let fa=new Float32Array(262144),fs=new Uint8Array(262144),fl=["","wall","door","roof","window","lamp","logo"];class fu{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.feature={type:"Point",id:e.id,geometry:[],properties:{height:function e(r){let i=0;if(r.meshes)for(let e of r.meshes)i=Math.max(i,e.aabb.max[2]);if(r.children)for(let n of r.children)i=Math.max(i,e(n));return i}(e)}}}getLocalBounds(){if(!this.node.meshes)return new l$([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0,r=new l$([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(let i of this.node.meshes)this.node.lightMeshIndex!==e&&r.encapsulate(i.aabb),e++;this.aabb=l$.applyTransform(r,this.node.matrix)}return this.aabb}}class fc{constructor(e,r,i,n,o,a){for(const s of(this.id=r,this.modelTraits|=dI.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,i&&(this.modelTraits|=dI.HasMapbox
15MeshFeatures),n&&(this.modelTraits|=dI.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=o,this.dirty=!0,this.needsUpload=!1,this.nodesInfo=[],e))this.nodesInfo.push(new fu(s)),function e(r,i,n){if(r.meshes)for(let e of r.meshes)e.aabb.min[0]!==1/0&&n.insert(i,e.aabb.min[0],e.aabb.min[1],e.aabb.max[0],e.aabb.max[1]);if(r.children)for(let o of r.children)e(o,i,n)}(s,a.featureIndexArray.length,a.grid),a.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,a.bucketLayerIDs.length-1,0)}update(){console.log("Update 3D model bucket")}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;let r=this.getNodesInfo();for(let i of r){let r=i.node;this.uploaded?this.updatePbrBuffer(r):dA(r,e,!0)}for(let e of r)dP(e.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let r=!1;if(!e.meshes)return r;for(let i of e.meshes)i.pbrBuffer&&(i.pbrBuffer.updateData(i.featureArray),r=!0);return r}needsReEvaluation(e,r,i){let n=e.transform.projectionOptions,o=e.style.getBrightness(),a=this.brightness!==o;return!!(!this.uploaded||this.dirty||n.name!==this.projection.name||fh(i.paint.get("model-color").value,a)||fh(i.paint.get("model-color-mix-intensity").value,a)||fh(i.paint.get("model-roughness").value,a)||fh(i.paint.get("model-emissive-strength").value,a)||fh(i.paint.get("model-height-based-emissive-strength-multiplier").value,a))&&(this.projection=n,this.brightness=o,!0)}evaluateScale(e,r){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;let i=this.getNodesInfo(),n=this.id.canonical;for(let e of i){let i=e.feature;e.evaluatedScale=r.paint.get("model-scale").evaluate(i,{},n)}}evaluate(e){for(let r of this.getNodesInfo()){if(!r.node.meshes)continue;let i=r.feature,n=r.node.meshes&&r.node.meshes[0].featureData,o=r.evaluatedColor[2],a=r.evaluatedRMEA[2],s=this.id.canonical;if(r.hasTranslucentParts=!1,n){for(let n=0;n<fl.length;n++){let o=fl[n];o.length&&(i.properties.part=o);let a=e.paint.get("model-color").evaluate(i,{},s),l=e.paint.get("model-color-mix-intensity").evaluate(i,{},s);r.evaluatedColor[n]=[a.r,a.g,a.b,l],r.evaluatedRMEA[n][0]=e.paint.get("model-roughness").evaluate(i,{},s),r.evaluatedRMEA[n][2]=e.paint.get("model-emissive-strength").evaluate(i,{},s),r.evaluatedRMEA[n][3]=a.a,r.emissionHeightBasedParams[n]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(i,{},s),!r.hasTranslucentParts&&a.a<1&&(r.hasTranslucentParts=!0)}delete i.properties.part,function(e,r,i){let n=e.node,o=0,a=i&dI.HasMeshoptCompression;for(let i of n.meshes){if(n.lights&&n.lightMeshIndex===o||!i.featureData)continue;i.featureArray=new ss,i.featureArray.reserve(i.featureData.length);let s=r;for(let r of i.featureData){let o,l=a?65535&r:r>>16&65535,u=a?r>>16&65535:65535&r,c=(15&u)<8?15&u:0,h=e.evaluatedRMEA[c],p=e.evaluatedColor[c],d=e.emissionHeightBasedParams[c];if(s&&2===c&&n.lights&&(o=new ss).resize(10*n.lights.length),function(e,r,i,n,o,a,s,l){let u,c,h,p,d=(61440&r|(61440&r)>>4)>>8,f=(3840&r|(3840&r)>>4)>>4,m=240&r|(240&r)>>4;i[3]>0&&(d=r2(d,255*i[0],i[3]),f=r2(f,255*i[1],i[3]),m=r2(m,255*i[2],i[3]));let g=d<<8|f,_=m<<8|Math.floor(255*n[3]),y=Math.min(Math.round(.5*tM(n[2],0,2)*255),255)<<8|15*n[0]<<4|15*n[1],v=tM(o[0],0,1),x=tM(o[1],0,1),b=tM(o[2],0,1),w=tM(o[3],0,1);if(v!==x&&s!==a&&x!==v){let e=s-a;c=1/(e*(x-v)),h=-(a+e*v)/(e*(x-v)),p=Math.pow(10,tM(o[4],-1,1)),u=255*b<<8|255*w}else u=65535,c=0,h=1,p=1;if(e.emplaceBack(g,_,y,u,c,h,p),l){let e=l.length;l.clear();for(let r=0;r<e;r++)l.emplaceBack(g,_,y,u,c,h,p)}}(i.featureArray,l,p,h,d,i.aabb.min[2],i.aabb.max[2],o),o&&s){s=!1;let e=n.meshes[n.lightMeshIndex];e.featureArray=o,e.featureArray._trim()}}i.featureArray._trim(),o++}}(r,o!==r.evaluatedColor[2]||a!==r.evaluatedRMEA[2],this.modelTraits)}else r.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(i,{},s);r.evaluatedScale=e.paint.get("model-scale").evaluate(i,{},s),this.updatePbrBuffer(r.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,r,i,n){let o=e.findDEMTileFor(i);if(o&&(o.tileID.canonical!==this.terrainTile||r!==this.terrainExaggeration)){if
15(o.dem&&o.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=o.tileID.overscaledZ;let r=cw.create(e,i,o);if(!r)return;for(let o of(this.modelTraits&dI.HasMapboxMeshFeatures&&this.updateDEM(e,r,i,n),this.getNodesInfo())){let e=o.node;if(!e.footprint||!e.footprint.vertices||!e.footprint.vertices.length)continue;let i=e.footprint.vertices,n=r.getElevationAt(i[0].x,i[0].y,!0,!0);for(let e=1;e<i.length;e++)n=Math.min(n,r.getElevationAt(i[e].x,i[e].y,!0,!0));e.elevation=n}}this.terrainTile=o.tileID.canonical,this.terrainExaggeration=r}}updateDEM(e,r,i,n){let o=r._dem._modifiedForSources[n];if(void 0===o&&(r._dem._modifiedForSources[n]=[],o=r._dem._modifiedForSources[n]),o.includes(i.canonical))return;let a=r._dem.dim;o.push(i.canonical);let s=!1;for(let e of this.getNodesInfo()){let i=e.node;if(!i.footprint||!i.footprint.grid)continue;let n=i.footprint.grid,o=r.tileCoordToPixel(n.min.x,n.min.y),l=r.tileCoordToPixel(n.max.x,n.max.y),u=Math.min(Math.min(a-l.y,o.x),Math.min(o.y,a-l.x));if(u<0)continue;let c=tM(u,2,5),h=Math.max(0,o.x-c),p=Math.max(0,o.y-c),d=Math.min(l.x+c,a-1),f=Math.min(l.y+c,a-1);for(let e=p;e<=f;++e)for(let r=h;r<=d;++r)fs[e*a+r]=255;let m=0,g=0;for(let e=0;e<n.cellsY;++e)for(let i=0;i<n.cellsX;++i){if(!n.cells[e*n.cellsX+i])continue;let o=r.tileCoordToPixel(n.min.x+i/n.xScale,n.min.y+e/n.yScale),s=r.tileCoordToPixel(n.min.x+(i+1)/n.xScale,n.min.y+(e+1)/n.yScale);for(let e=o.y;e<=Math.min(s.y+1,a-1);++e)for(let i=o.x;i<=Math.min(s.x+1,a-1);++i)255===fs[e*a+i]&&(fs[e*a+i]=0,m+=r.getElevationAtPixel(i,e),g++)}let _=m/g;h=Math.max(1,o.x-c),p=Math.max(1,o.y-c),d=Math.min(l.x+c,a-2),f=Math.min(l.y+c,a-2),s=!0;for(let e=p;e<=f;++e)for(let i=h;i<=d;++i)0===fs[e*a+i]&&(fa[e*a+i]=r._dem.set(i,e,_));for(let e=1;e<c;++e){h=Math.max(1,o.x-e),p=Math.max(1,o.y-e),d=Math.min(l.x+e,a-2),f=Math.min(l.y+e,a-2);for(let i=p;i<=f;++i)for(let n=h;n<=d;++n){let o=i*a+n;if(255===fs[o]){let s=0,l=0,u=-1,h=-1;for(let r=-1;r<=1;++r)for(let o=-1;o<=1;++o){let c=(i+r)*a+n+o;if(fs[c]>=e)continue;let p=fa[c],d=Math.abs(p);d>l&&(s=p,l=d,u=o,h=r)}if(l>.1){let a=1-(e+.5*Math.abs(u*h))/c,l=r._dem.get(n,i)+s*a,p=r._dem.get(n+u,i+h),d=r._dem.get(n-u,i-h,!0);(l-p)*(l-d)>0&&(l=(p+d)/2),fa[o]=r._dem.set(n,i,l),fs[o]=e}}}}}s&&(r._demTile.needsDEMTextureUpload=!0,r._dem._timestamp=t9.now())}getNodesInfo(){return this.nodesInfo}destroy(){for(let e of this.getNodesInfo())dP(e.node),dL(e.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,r){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;let i=r.getReplacementRegionsForTile(e.toUnwrapped()),n=this.getNodesInfo();for(let e=0;e<this.nodesInfo.length;e++){let r=n[e].node;n[e].hiddenByReplacement=!!r.footprint&&!i.find(e=>e.footprint===r.footprint)}}getHeightAtTileCoord(r,i){let n=this.getNodesInfo(),o=[],a=[0,0,0];for(let s=0;s<this.nodesInfo.length;s++){let l=n[s],u=l.node.meshes[0],c=l$.applyTransform(u.aabb,l.node.matrix);if(r<c.min[0]||i<c.min[1]||r>c.max[0]||i>c.max[1])continue;let h=(r-u.aabb.min[0])/(u.aabb.max[0]-u.aabb.min[0])*64|0,p=64*Math.min(63,(i-u.aabb.min[1])/(u.aabb.max[1]-u.aabb.min[1])*64|0)+Math.min(63,h);if(a[2]=u.heightmap[p],e.Q.transformMat4(a,a,l.node.matrix),!(u.heightmap[p]<0&&l.node.footprint)){if(l.hiddenByReplacement)return;return{height:a[2],maxHeight:l.feature.properties.height,hidden:!1,verticalScale:l.evaluatedScale[2]}}if(l.node.footprint.grid.query(new tx(r,i),new tx(r,i),o),o.length>0)return{height:void 0,maxHeight:l.feature.properties.height,hidden:l.hiddenByReplacement,verticalScale:l.evaluatedScale[2]}}}}function fh(e,r){return!e.isLightConstant&&r}function fp(e,r,i,n){let o=1<<e.z;r.lat=lc((n/8192+e.y)/o),r.lng=lu((i/8192+e.x)/o)}oS(fc,"Tiled3dModelBucket",{omit:["layers"]}),oS(fu,"Tiled3dModelFeature");let fd={circle:class extends aF{constructor(e,r,i){super(e,lz,r,i)}createBucket(e){return new lw(e)}queryRadius(e){return lD("circle-radius",this,e)+lD("circle-stroke-width",this,e)+lR(this.paint.get("circle-translate"))}queryIntersectsFeature(e,r,i,n,o,a,s,l){let u=lN(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(r,i)+this.paint.get("circle-stroke-width").evaluate(r,i);return ud(e,n,a,s,l,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),u,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(e,r){let i=up(this);return{config:new sY(this,r),defines:i,overrideFog:!1}}},heatmap:class extends aF{createBucket(e){return new ug(e)}constructor(e,r,i){super(e,uS,r,i),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=uT({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(e){return lD("heatmap-radius",this,e)}queryIntersectsFeature(e,r,i,n,o,a,s,l){let u=this.paint.get("heatmap-radius").evaluate(r,i);return ud(e,n,a,s,l,!0,!0,new tx(0,0),u)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(e,r){return"heatmap"===e?{config:new sY(this,r),overrideFog:!1}:{}}},hillshade:class extends aF{constructor(e,r,i){super(e,uM,r,i)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(e,r){return{overrideFog:!1}}},fill:class extends aF{constructor(e,r,i){super(e,u0,r,i)}getProgramIds(){let e=this.paint.get("fill-pattern"),r=e&&e.constantOr(1),i=[r?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(r&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getDefaultProgramParams(e,r){return{config:new sY(this,r),overrideFog:!1}}recalculate(e,r){super.recalculate(e,r);let i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new uQ(e)}queryRadius(){return lR(this.paint.get("fill-translate"))}queryIntersectsFeature(e,r,i,n,o,a){return!e.queryGeometry.isAboveHorizon&&lS(lk(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,e.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends aF{constructor(e,r,i){super(e,c$,r,i),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new cN(e)}queryRadius(){return lR(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}hasShadowPass(){return!0}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(r,i,n,o,a,s,l,u,c){var h,p,d,f;let m=lN(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,r.pixelToTileUnitsFactor),g=this.paint.get("fill-extrusion-height").evaluate(i,n),_=this.paint.get("fill-extrusion-base").evaluate(i,n),y=[0,0],v=u&&s.elevation,x=s.elevation?s.elevation.exaggeration():1,b=r.tile.getBucket(this);if(v&&b instanceof cN){let e=b.centroidVertexArray,r=c+1;r<e.length&&(y[0]=e.geta_centroid_pos0(r),y[1]=e.geta_centroid_pos1(r))}if(0===y[0]&&1===y[1])return!1;"globe"===s.projection.name&&(o=cq([o],[new tx(0,0),new tx(8192,8192)],r.tileID.canonical).map(e=>e.polygon).flat());let[w,E]=(h=o,p=v?u:null,d=s.center.lat,f=r.tileID.canonical,"globe"===s.projection.name?function(r,i,n,o,a,s,l,u,c,h,p){let d=[],f=[],m=r.projection.upVectorScale(p,r.center.lat,r.worldSize).metersToTile,g=[0,0,0,1],_=[0,0,0,1],y=(e,r,i,n)=>{e[0]=r,e[1]=i,e[2]=n,e[3]=1},v=cG();for(let x of(n>0&&(n+=v),o+=v,i)){let i=[],v=[];for(let d of x){let f=d.x+a.x,x=d.y+a.y,b=r.projection.projectTilePoint(f,x,p),w=r.projection.upVector(p,d.x,d.y),E=n,S=o;if(l){let e=cX(f,x,n,o,l,u,c,h);E+=e.base,S+=e.top}0!==n?y(g,b.x+w[0]*m*E,b.y+w[1]*m*E,b.z+w[2]*m*E):y(g,b.x,b.y,b.z),y(_,b.x+w[0]*m*S,b.y+w[1]*m*S,b.z+w[2]*m*S),e.Q.transformMat4(g,g,s),e.Q.transformMat4(_,_,s),i.push(new cW(g[0],g[1],g[2])),v.push(new cW(_[0],_[1],_[2]))}d.push(i),f.push(v)}return[d,f]}(s,h,_,g,m,l,p,y,x,d,f):p?function(r,i,n,o,a,s,l,u,c){let h=[],p=[],d=[0,0,0,1];for(let f of r){let r=[],m=[];for(let h of f){let p=h.x+o.x,f=h.y+o.y,g=cX(p,f,i,n,s,l,u,c);d[0]=p,d[1]=f,d[2]=g.base,d[3]=1,e.aa.transformMat4(d,d,a),d[3]=Math.max(d[3],1e-5);let _=new cW(d[0]/d[3],d[1]/d[3],d[2]/d[3]);d[0]=p,d[1]=f,d[2]=g.top,d[3]=1,e.aa.transformMat4(d,d,a),d[3]=Math.max(d[3],1e-5);let y=new cW(d[0]/d[3],d[1]/d[3],d[2]/d[3]);r.push(_),m.push(y)}h.push(r),p.push(m)}return[h,p]}(h,_,g,m,l,p,y,x,d):function(e,r,i,n,o){let a=[],s=[],l=o[8]*r,u=o[9]*r,c=o[10]*r,h=o[11]*r,p=o[8]*i,d=o[9]*i,f=o[10]*i,m=o[11]*i;for(let r of e){let e=[],i=[];
15for(let a of r){let r=a.x+n.x,s=a.y+n.y,g=o[0]*r+o[4]*s+o[12],_=o[1]*r+o[5]*s+o[13],y=o[2]*r+o[6]*s+o[14],v=o[3]*r+o[7]*s+o[15],x=g+l,b=_+u,w=y+c,E=Math.max(v+h,1e-5),S=g+p,T=_+d,I=y+f,M=Math.max(v+m,1e-5);e.push(new cW(x/E,b/E,w/E)),i.push(new cW(S/M,T/M,I/M))}a.push(e),s.push(i)}return[a,s]}(h,_,g,m,l)),S=r.queryGeometry;return function(e,r,i){let n=1/0;lS(i,r)&&(n=cZ(i,r[0]));for(let o=0;o<r.length;o++){let a=r[o],s=e[o];for(let e=0;e<a.length-1;e++){let r=a[e],o=[r,a[e+1],s[e+1],s[e],r];lE(i,o)&&(n=Math.min(n,cZ(i,o)))}}return n!==1/0&&n}(w,E,S.isPointQuery()?S.screenBounds:S.screenGeometry)}},line:class extends aF{constructor(e,r,i){super(e,c6,r,i),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof nb,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=hr.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new c5(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,r){let i=he(this);return{config:new sY(this,r),defines:i,overrideFog:!1}}queryRadius(e){var r,i;return r=lD("line-width",this,e),((i=lD("line-gap-width",this,e))>0?i+2*r:r)/2+Math.abs(lD("line-offset",this,e))+lR(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,i,n,o,a){var s,l;if(e.queryGeometry.isAboveHorizon)return!1;let u=lk(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,e.pixelToTileUnitsFactor),c=e.pixelToTileUnitsFactor/2*(s=this.paint.get("line-width").evaluate(r,i),(l=this.paint.get("line-gap-width").evaluate(r,i))>0?l+2*s:s),h=this.paint.get("line-offset").evaluate(r,i);return h&&(n=function(e,r){let i=[],n=new tx(0,0);for(let o=0;o<e.length;o++){let a=e[o],s=[];for(let e=0;e<a.length;e++){let i=a[e],o=a[e+1],l=0===e?n:i.sub(a[e-1])._unit()._perp(),u=e===a.length-1?n:o.sub(i)._unit()._perp(),c=l._add(u)._unit();c._mult(1/(c.x*u.x+c.y*u.y)),s.push(c._mult(r)._add(i))}i.push(s)}return i}(n,h*e.pixelToTileUnitsFactor)),function(e,r,i){for(let n=0;n<r.length;n++){let o=r[n];if(e.length>=3){for(let r=0;r<o.length;r++)if(lA(e,o[r]))return!0}if(function(e,r,i){if(e.length>1){if(lT(e,r))return!0;for(let n=0;n<r.length;n++)if(lI(r[n],e,i))return!0}for(let n=0;n<e.length;n++)if(lI(e[n],r,i))return!0;return!1}(e,o,i))return!0}return!1}(u,n,c)}isTileClipped(){return!0}},symbol:pq,background:class extends aF{constructor(e,r,i){super(e,p$,r,i)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(e,r){return{overrideFog:!1}}},raster:p2,"raster-particle":p4,sky:class extends aF{constructor(e,r,i){super(e,p9,r,i),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=uT({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){let r=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==r.azimuthal||this._lightPosition.polar!==r.polar}return!1}getCenter(e,r){if("atmosphere"===this.paint.get("sky-type")){let i=this.paint.get("sky-atmosphere-sun"),n=!i,o=e.style.light,a=o.properties.get("position");return n&&"viewport"===o.properties.get("anchor")&&tG("The sun direction is attached to a light with viewport anchor, lighting may behave unex
15pectedly."),n?p7(a.azimuthal,90-a.polar,r):p7(i[0],90-i[1],r)}let i=this.paint.get("sky-gradient-center");return p7(i[0],90-i[1],r)}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){let e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}},slot:class extends aF{constructor(e,r,i){super(e,de,r)}},model:class extends aF{constructor(e,r,i){super(e,dT,r,i),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new dE(e)}getProgramIds(){return["model"]}is3D(){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(e){return 8191*(e instanceof fc)}queryIntersectsFeature(r,i,n,o,a,s){if(!this.modelManager)return!1;let l=this.modelManager,u=r.tile.getBucket(this);if(!(u&&u instanceof dE))return!1;for(let n in u.instancesPerModel){let o=u.instancesPerModel[n],a=void 0!==i.id?i.id:i.properties&&i.properties.hasOwnProperty("id")?i.properties.id:void 0;if(o.idToFeaturesIndex.hasOwnProperty(a)){let i=o.features[o.idToFeaturesIndex[a]],c=l.getModel(n,this.scope);if(!c)return!1;let h=e.a9.create(),p=new s6(0,0),d=u.canonical,f=Number.MAX_VALUE;for(let n=0;n<i.instancedDataCount;++n){let a=16*(i.instancedDataOffset+n),l=o.instancedDataArray.float32,u=[l[a+4],l[a+5],l[a+6]];fp(d,p,l[a],0|l[a+1]),dM(h,c,s,p,i.rotation,i.scale,u,!1,!1,!1),"globe"===s.projection.name&&(h=dc(h,s));let m=e.a9.multiply([],s.projMatrix,h),g=r.queryGeometry,_=dh(g.isPointQuery()?g.screenBounds:g.screenGeometry,s,m,c.aabb);null!=_&&(f=Math.min(_,f))}return f!==Number.MAX_VALUE&&f}}return!1}_handleOverridablePaintPropertyUpdate(e,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven()||"model-color"!==e&&"model-color-mix-intensity"!==e&&"model-rotation"!==e&&"model-scale"!==e&&"model-translation"!==e&&"model-emissive-strength"!==e)}_isPropertyZoomDependent(e){let r=this._transitionablePaint._values[e];return null!=r&&null!=r.value&&null!=r.value.expression&&r.value.expression instanceof oy}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}queryIntersectsMatchingFeature(r,i,n,o){let a=r.tile,s=a.getBucket(this),l=null,u=Number.MAX_VALUE;if(!(s&&s instanceof fc))return{queryFeature:l,intersectionZ:u};let c=s.getNodesInfo()[i];if(c.hiddenByReplacement||!c.node.meshes||!n.filter(new au(a.tileID.overscaledZ),c.feature,a.tileID.canonical))return{queryFeature:l,intersectionZ:u};let h=c.node,p=o.calculatePosMatrix(a.tileID.toUnwrapped(),o.worldSize),d=c.evaluatedScale,f=0;o.elevation&&h.elevation&&(f=h.elevation*o.elevation.exaggeration()),e.a9.translate(p,p,[(h.anchor?h.anchor[0]:0)*(d[0]-1),(h.anchor?h.anchor[1]:0)*(d[1]-1),f]),e.a9.scale(p,p,d),e.a9.multiply(p,p,h.matrix);let m=r.queryGeometry,g=m.isPointQuery()?m.screenBounds:m.screenGeometry,_=function(r){let i=e.a9.multiply([],p,r.matrix),n=e.a9.multiply(i,o.expandedFarZProjMatrix,i);for(let e=0;e<r.meshes.length;++e){let i=r.meshes[e];if(e===r.lightMeshIndex)continue;let a=dh(g,o,n,i.aabb);null!=a&&(u=Math.min(a,u))}if(r.children)for(let e of r.children)_(e)};if(_(h),u===Number.MAX_VALUE)return{queryFeature:l,intersectionZ:u};let y=new s6(0,0);return fp(a.tileID.canonical,y,c.node.anchor[0],c.node.anchor[1]),{queryFeature:l={type:"Feature",geometry:{type:"Point",coordinates:[y.lng,y.lat]},properties:c.feature.properties,id:c.feature.id,state:{},layer:this.serialize()},intersectionZ:u}}}},ff={read:function(e,r){return e.readFields(ff._readField,{header_length:0,x:0,y:0,z:0,layers:[]},r)},_readField:function(e,r,i){1===e?r.header_length=i.readFixed32():2===e?r.x=i.readVarint():3===e?r.y=i.readVarint():4===e?r.z=i.readVarint():5===e&&r.layers.push(ff.Layer.read(i,i.readVarint()+i.pos))},PixelFormat:{PIXEL_FORMAT_UNKNOWN:{value:0,options:{}},PIXEL_FORMAT_UINT32:{value:1,options:{}},PIXEL_FORMAT_UINT16:{value:2,options:{}},PIXEL_FORMAT_UINT8:{value:3,options:{}}},Filter:{}};ff.Filter.read=function(e,r){return e.readFields(ff.Filter._readField,{delta_filter:null,filter:null,zigzag_filter:null,bitshuffle_filter:null,byteshuffle_filter:null},r)},ff.Filter._readField=function(e,r,i){1===e?(r.delta_filter=ff.Filter.Delta.read(i,i.readVarint()+i.pos),r.filter="delta_filter"):2===e?(r.zigzag_filter=ff.Filter.Zigzag.read(i,i.readVarint()+i.pos),r.filter="zigzag_filter"):3===e?(r.bitshuffle_filter=ff.Filter.BitShuffle.read(i,i.readVarint()+i.pos),r.filter="bitshuffle_filter"):4===e&&(r.byteshuffle_filter=ff.Filter.ByteShuffle.read(i,i.readVarint()+i.pos),r.filter="byteshuffle_filter")},ff.Filter.Delta={},ff.Filter.Delta.read=function(e,r){return e.readFields(ff.Filter.Delta._readField,{block_size:0},r)},ff.Filter.Delta._readField=function(e,r,i){1===e&&(r.block_size=i.readVarint())},ff.Filter.Zigzag={},ff.Filter.Zigzag.read=function(e,r){return e.readFields(ff.Filter.Zigzag._readField,{},r)},ff.Filter.Zigzag._readField=function(e,r,i){},ff.Filter.BitShuffle={},ff.Filter.BitShuffle.read=function(e,r){return e.readFields(ff.Filter.BitShuffle._readField,{},r)},ff.Filter.BitShuffle._readField=function(e,r,i){},ff.Filter.ByteShuffle={},ff.Filter.ByteShuffle.read=function(e,r){return e.readFields(ff.Filter.ByteShuffle._readField,{},r)},ff.Filter.ByteShuffle._readField=function(e,r,i){},ff.Codec={},ff.Codec.read=function(e,r){return e.readFields(ff.Codec._readField,{gzip_data:null,codec:null,jpeg_image:null,webp_image:null,png_image:null},r)},ff.Codec._readField=function(e,r,i){1===e?(r.gzip_data=ff.Codec.GzipData.read(i,i.readVarint()+i.pos),r.codec="gzip_data"):2===e?(r.jpeg_image=ff.Codec.JpegImage.read(i,i.readVarint()+i.pos),r.codec="jpeg_image"):3===e?(r.webp_image=ff.Codec.WebpImage.read(i,i.readVarint()+i.pos),r.codec="webp_image"):4===e&&(r.png_image=ff.Codec.PngImage.read(i,i.readVarint()+i.pos),r.codec="png_image")},ff.Codec.GzipData={},ff.Codec.GzipData.read=function(e,r){return e.readFields(ff.Codec.GzipData._readField,{},r)},ff.Codec.GzipData._readField=function(e,r,i){},ff.Codec.JpegImage={},ff.Codec.JpegImage.read=function(e,r){return e.readFields(ff.Codec.JpegImage._readField,{},r)},ff.Codec.JpegImage._readField=function(e,r,i){},ff.Codec.WebpImage={},ff.Codec.WebpImage.read=function(e,r){return e.readFields(ff.Codec.WebpImage._readField,{},r)},ff.Codec.WebpImage._readField=function(e,r,i){},ff.Codec.PngImage={},ff.Codec.PngImage.read=function(e,r){return e.readFields(ff.Codec.PngImage._readField,{},r)},ff.Codec.PngImage._readField=function(e,r,i){},ff.DataIndexEntry={},ff.DataIndexEntry.read=function(e,r){return e.readFields(ff.DataIndexEntry._readField,{first_byte:0,last_byte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},r)},ff.DataIndexEntry._readField=function(e,r,i){1===e?r.first_byte=i.readFixed64():2===e?r.last_byte=i.readFixed64():3===e?r.filters.push(ff.Filter.read(i,i.readVarint()+i.pos)):4===e?r.codec=ff.Codec.read(i,i.readVarint()+i.pos):5===e?r.offset=i.readFloat():6===e?r.scale=i.readFloat():7===e&&r.bands.push(i.readString())},ff.Layer={},ff.Layer.read=function(e,r){return e.readFields(ff.Layer._readField,{version:0,name:"",units:"",tilesize:0,buffer:0,pixel_format:0,data_index:[]},r)},ff.Layer._readField=function(e,r,i){1===e?r.version=i.readVarint():2===e?r.name=i.readString():3===e?r.units=i.readString():4===e?r.tilesize=i.readVarint():5===e?r.buffer=i.readVarint():6===e?r.pixel_format=i.readVarint():7===e&&r.data_index.push(ff.DataIndexEntry.read(i,i.readVarint()+i.pos))};let fm={read:function(e,r){return e.readFields(fm._readField,{uint32_values:null,values:null,fixed32_values:null},r)},_readField:function(e,r,i){2===e?(r.uint32_values=fm.Uint32Values.read(i,i.readVarint()+i.pos),r.values="uint32_values"):3===e&&(r.fixed32_values=fm.Fixed32Values.read(i,i.readVarint()+i.pos),r.values="fixed32_values")},Uint32Values:{}};fm.Uint32Values.read=function(e,r){return e.readFields(fm.Uint32Values._readField,{values:[]},r)},fm.Uint32Values._readField=function(e,r,i){1===e&&(r.readValuesInto=function(e){if(2!==e.type)throw Error(`Unsupported pbf type "${e.type}"`);let r=2===e.type?e.readVarint()+e.pos:e.pos+1,i=e.pos;return e.pos=r,function(n){e.pos=i;let o=0;for(;e.pos<r;){let r=e.readVarint();n[o++]=r}return n}}(i))},fm.Fixed32Values={},fm.Fixed32Values.read=function(e,r){return e.readFields(fm.Fixed32Values._readField,{values:[]},r)},fm.Fixed32Values._readField=function(e,r,i){throw Error("Not implemented")};class fg{constructor(e=0,r=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=i,this.size=0,this.ttl=r}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){let r=this.items[e];delete this.items[e],this.size--,null!==r.prev&&(r.prev.next=r.next),null!==r.next&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}return this}entries(e=this.keys()){return e.map(e=>[e,this.get(e)])}evict(e=!1){if(e||this.size>0){let e=this.first;delete this.items[e.key],0==--this.size?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}return this}expiresAt(e){let r;return this.has(e)&&(r=this.items[e].expiry),r}get(e){let r;if(this.has(e)){let i=this.items[e];this.ttl>0&&i.expiry<=Date.now()?this.delete(e):(r=i.value,this.set(e,r,!0))}return r}has(e){return e in this.items}keys(){let e=[],r=this.first;for(;null!==r;)e.push(r.key),r=r.next;return e}set(e,r,i=!1,n=this.resetTtl){let o;
15if(i||this.has(e)){if((o=this.items[e]).value=r,!1===i&&n&&(o.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.last!==o){let e=this.last,r=o.next,i=o.prev;this.first===o&&(this.first=o.next),o.next=null,o.prev=this.last,e.next=o,null!==i&&(i.next=r),null!==r&&(r.prev=i)}}else this.max>0&&this.size===this.max&&this.evict(!0),o=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r},1==++this.size?this.first=o:this.last.next=o;return this.last=o,this}values(e=this.keys()){return e.map(e=>this.get(e))}}class f_ extends Error{constructor(e){super(e),this.name="MRTError"}}var fy=Uint8Array,fv=Uint16Array,fx=Int32Array,fb=new fy([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]),fw=new fy([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]),fE=new fy([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fS=function(e,r){for(var i=new fv(31),n=0;n<31;++n)i[n]=r+=1<<e[n-1];var o=new fx(i[30]);for(n=1;n<30;++n)for(var a=i[n];a<i[n+1];++a)o[a]=a-i[n]<<5|n;return{b:i,r:o}},fT=fS(fb,2),fI=fT.b,fM=fT.r;fI[28]=258,fM[258]=28;for(var fC=fS(fw,0).b,fA=new fv(32768),fP=0;fP<32768;++fP){var fL=(43690&fP)>>1|(21845&fP)<<1;fA[fP]=((65280&(fL=(61680&(fL=(52428&fL)>>2|(13107&fL)<<2))>>4|(3855&fL)<<4))>>8|(255&fL)<<8)>>1}var fO=function(e,r,i){for(var n=e.length,o=0,a=new fv(r);o<n;++o)e[o]&&++a[e[o]-1];var s,l=new fv(r);for(o=1;o<r;++o)l[o]=l[o-1]+a[o-1]<<1;if(i){s=new fv(1<<r);var u=15-r;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],h=r-e[o],p=l[e[o]-1]++<<h,d=p|(1<<h)-1;p<=d;++p)s[fA[p]>>u]=c}else for(s=new fv(n),o=0;o<n;++o)e[o]&&(s[o]=fA[l[e[o]-1]++]>>15-e[o]);return s},fD=new fy(288);for(fP=0;fP<144;++fP)fD[fP]=8;for(fP=144;fP<256;++fP)fD[fP]=9;for(fP=256;fP<280;++fP)fD[fP]=7;for(fP=280;fP<288;++fP)fD[fP]=8;var fR=new fy(32);for(fP=0;fP<32;++fP)fR[fP]=5;var fk=fO(fD,9,1),fN=fO(fR,5,1),fF=function(e){for(var r=e[0],i=1;i<e.length;++i)e[i]>r&&(r=e[i]);return r},fz=function(e,r,i){var n=r/8|0;return(e[n]|e[n+1]<<8)>>(7&r)&i},fB=function(e,r){var i=r/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&r)}
15,fU=["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"],fj=function(e,r,i){var n=Error(r||fU[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,fj),!i)throw n;return n},fV=new fy(0),fG="u">typeof TextDecoder&&new TextDecoder;try{fG.decode(fV,{stream:!0})}catch(e){}let fq={gzip_data:"gzip"},fH={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},f$={uint32:1,uint16:2,uint8:4},fW={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};class fY{constructor(e=1){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){return this.layers[e]}getHeaderLength(e){let r=new Uint8Array(e),i=new DataView(e);if(13!==r[0])throw new f_("File is not a valid MRT.");return i.getUint32(1,!0)}parseHeader(e){let r=new Uint8Array(e),i=this.getHeaderLength(e);if(r.length<i)throw new f_(`Expected header with length >= ${i} but got buffer of length ${r.length}`);let n=new hk(r.subarray(0,i)),o=ff.read(n);if(!isNaN(this.x)&&(this.x!==o.x||this.y!==o.y||this.z!==o.z))throw new f_(`Invalid attempt to parse header ${o.z}/${o.x}/${o.y} for tile ${this.z}/${this.x}/${this.y}`);for(let e of(this.x=o.x,this.y=o.y,this.z=o.z,o.layers))this.layers[e.name]=new fZ(e,{cacheSize:this._cacheSize});return this}createDecodingTask(e){let r=[],i=this.getLayer(e.layerName);for(let n=0;n<i.dataIndex.length;n++){let o=i.dataIndex[n],a=o.first_byte-e.firstByte,s=o.last_byte+1-e.firstByte;if(n<e.firstBlock||n>e.lastBlock||i._blocksInProgress.has(n))continue;let l={layerName:i.name,firstByte:a,lastByte:s,pixelFormat:i.pixelFormat,blockIndex:n,blockShape:[o.bands.length].concat(i.bandShape),buffer:i.buffer,codec:o.codec.codec,filters:o.filters.map(e=>e.filter)};i._blocksInProgress.add(n),r.push(l)}return new fX(r,()=>{r.forEach(e=>i._blocksInProgress.delete(e.blockIndex))},(e,n)=>{if(r.forEach(e=>i._blocksInProgress.delete(e.blockIndex)),e)throw e;n.forEach(e=>{this.getLayer(e.layerName).processDecodedData(e)})})}}class fZ{constructor({version:e,name:r,units:i,tilesize:n,pixel_format:o,buffer:a,data_index:s},l){if(this.version=e,1!==this.version)throw new f_(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=r,this.units=i,this.tileSize=n,this.buffer=a,this.pixelFormat=fH[o],this.dataIndex=s,this.bandShape=[n+2*a,n+2*a,f$[this.pixelFormat]],this._decodedBlocks=function(e=1e3,r=0,i=!1){if(isNaN(e)||e<0)throw TypeError("Invalid max value");if(isNaN(r)||r<0)throw TypeError("Invalid ttl value");if("boolean"!=typeof i)throw TypeError("Invalid resetTtl value");return new fg(e,r,i)}(l?l.cacheSize:5),this._blocksInProgress=new Set}processDecodedData(e){let r=e.blockIndex.toString();this._decodedBlocks.get(r)||this._decodedBlocks.set(r,e.data)}getBlockForBand(e){let r=0;switch(typeof e){case"string":for(let[i,n]of this.dataIndex.entries()){for(let[o,a]of n.bands.entries())if(a===e)return{bandIndex:r+o,blockIndex:i,blockBandIndex:o};r+=n.bands.length}break;case"number":for(let[i,n]of this.dataIndex.entries()){if(e>=r&&e<r+n.bands.length)return{bandIndex:e,blockIndex:i,blockBandIndex:e-r};r+=n.bands.length}break;default:throw new f_(`Invalid band \`${JSON.stringify(e)}\`. Expected string or integer.`)}throw new f_(`Band not found: ${JSON.stringify(e)}`)}getDataRange(e){let r=1/0,i=-1/0,n=1/0,o=-1/0;for(let a of e){let{blockIndex:e}=this.getBlockForBand(a);if(e<0)throw new f_(`Invalid band: ${JSON.stringify(a)}`);let s=this.dataIndex[e];n=Math.min(n,e),o=Math.max(o,e),r=Math.min(r,s.first_byte),i=Math.max(i,s.last_byte)}return{layerName:this.name,firstByte:r,lastByte:i,firstBlock:n,lastBlock:o}}hasBand(e){let{blockIndex:r}=this.getBlockForBand(e);return r>=0}hasDataForBand(e){let{blockIndex:r}=this.getBlockForBand(e);return r>=0&&!!this._decodedBlocks.get(r.toString())}getBandView(e){let{blockIndex:r,blockBandIndex:i}=this.getBlockForBand(e),n=this._decodedBlocks.get(r.toString());if(!n)throw new f_(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);let o=this.dataIndex[r],a=this.bandShape.reduce((e,r)=>e*r,1),s=i*a,l=n.subarray(s,s+a);return{data:l,bytes:new Uint8Array(l.buffer).subarray(l.byteOffset,l.byteOffset+l.byteLength),tileSize:this.tileSize,buffer:this.buffer,offset:o.offset,scale:o.scale}}}class fX{constructor(e,r,i){this.tasks=e,this._onCancel=r,this._onComplete=i,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,r){this._finalized||(this._onComplete(e,r),this._finalized=!0)}}fY.performDecoding=function(e,r){return Promise.all(r.tasks.map(r=>
15{let{layerName:i,firstByte:n,lastByte:o,pixelFormat:a,blockShape:s,blockIndex:l,filters:u,codec:c}=r,h=new Uint8Array(e).subarray(n,o+1),p=new Uint32Array(s[0]*s[1]*s[2]);if("gzip_data"!==c)throw Error(`Unhandled codec: ${c}`);return(function(e,r){var i,n;if(!globalThis.DecompressionStream&&"gzip_data"===r)return Promise.resolve(((n=function(e){31==e[0]&&139==e[1]&&8==e[2]||fj(6,"invalid gzip data");var r=e[3],i=10;4&r&&(i+=2+(e[10]|e[11]<<8));for(var n=(r>>3&1)+(r>>4&1);n>0;n-=!e[i++]);return i+(2&r)}(e))+8>e.length&&fj(6,"invalid gzip data"),function(e,r,i){var n=e.length;if(!n||r.f&&!r.l)return i||new fy(0);var o=!i,a=o||2!=r.i,s=r.i;o&&(i=new fy(3*n));var l,u,c=function(e){var r=i.length;if(e>r){var n=new fy(Math.max(2*r,e));n.set(i),i=n}},h=r.f||0,p=r.p||0,d=r.b||0,f=r.l,m=r.d,g=r.m,_=r.n,y=8*n;do{if(!f){h=fz(e,p,1);var v=fz(e,p+1,3);if(p+=3,!v){var x=e[(L=4+((p+7)/8|0))-4]|e[L-3]<<8,b=L+x;if(b>n){s&&fj(0);break}a&&c(d+x),i.set(e.subarray(L,b),d),r.b=d+=x,r.p=p=8*b,r.f=h;continue}if(1==v)f=fk,m=fN,g=9,_=5;else if(2==v){var w=fz(e,p,31)+257,E=fz(e,p+10,15)+4,S=w+fz(e,p+5,31)+1;p+=14;for(var T=new fy(S),I=new fy(19),M=0;M<E;++M)I[fE[M]]=fz(e,p+3*M,7);p+=3*E;var C=fF(I),A=(1<<C)-1,P=fO(I,C,1);for(M=0;M<S;){var L,O=P[fz(e,p,A)];if(p+=15&O,(L=O>>4)<16)T[M++]=L;else{var D=0,R=0;for(16==L?(R=3+fz(e,p,3),p+=2,D=T[M-1]):17==L?(R=3+fz(e,p,7),p+=3):18==L&&(R=11+fz(e,p,127),p+=7);R--;)T[M++]=D}}var k=T.subarray(0,w),N=T.subarray(w);g=fF(k),_=fF(N),f=fO(k,g,1),m=fO(N,_,1)}else fj(1);if(p>y){s&&fj(0);break}}a&&c(d+131072);for(var F=(1<<g)-1,z=(1<<_)-1,B=p;;B=p){var U=(D=f[fB(e,p)&F])>>4;if((p+=15&D)>y){s&&fj(0);break}if(D||fj(2),U<256)i[d++]=U;else{if(256==U){B=p,f=null;break}var j=U-254;U>264&&(j=fz(e,p,(1<<(q=fb[M=U-257]))-1)+fI[M],p+=q);var V=m[fB(e,p)&z],G=V>>4;if(V||fj(3),p+=15&V,N=fC[G],G>3){var q=fw[G];N+=fB(e,p)&(1<<q)-1,p+=q}if(p>y){s&&fj(0);break}a&&c(d+131072);var H=d+j;if(d<N){var $=0-N,W=Math.min(N,H);for($+d<0&&fj(3);d<W;++d)i[d]=(void 0)[$+d]}for(;d<H;++d)i[d]=i[d-N]}}r.l=f,r.p=B,r.b=d,r.f=h,f&&(h=1,r.m=g,r.d=m,r.n=_)}while(!h);return d!=i.length&&o?(l=i,(null==(u=d)||u>l.length)&&(u=l.length),new fy(l.subarray(0,u))):i.subarray(0,d)}(e.subarray(n,-8),{i:2},new fy((e[(i=e.length)-4]|e[i-3]<<8|e[i-2]<<16|e[i-1]<<24)>>>0))));let o=fq[r];if(!o)throw Error(`Unhandled codec: ${r}`);let a=new globalThis.DecompressionStream(o);return new Response(new Blob([e]).stream().pipeThrough(a)).arrayBuffer().then(e=>new Uint8Array(e))})(h,c).then(e=>{let r=fm.read(new hk(e));if("uint32_values"===r.values)return r.uint32_values.readValuesInto(p),new(0,fW[a])(p.buffer);throw Error(`Unhandled numeric data "${r.values}"`)}).then(e=>{for(let i=u.length-1;i>=0;i--)switch(u[i]){case"delta_filter":!function(e,r){if(4!==r.length)throw Error(`Expected data of dimension 4 but got ${r.length}.`);let i=r[3];for(let n=2;n>=1;n--){let o=+(1===n),a=+(2===n);for(let n=0;n<r[0];n++){let s=r[1]*n;for(let n=o;n<r[1];n++){let o=r[2]*(n+s);for(let n=a;n<r[2];n++){let a=r[3]*(n+o);for(let n=0;n<r[3];n++){let r=a+n;e[r]+=e[r-i]}}}}i*=r[n]}}(e,s);break;case"zigzag_filter":var r=e;for(let e=0,i=r.length;e<i;e++)r[e]=r[e]>>>1^-(1&r[e]);break;case"bitshuffle_filter":!function(e,r){switch(r){case"uint32":return;case"uint16":for(let r=0;r<e.length;r+=2){let i=e[r],n=e[r+1];e[r]=(240&i)>>4|(61440&i)>>8|(240&n)<<4|61440&n,e[r+1]=15&i|(3840&i)>>4|(15&n)<<8|(3840&n)<<4}return;case"uint8":for(let r=0;r<e.length;r+=4){let i=e[r],n=e[r+1],o=e[r+2],a=e[r+3];e[r+0]=(192&i)>>6|(192&n)>>4|(192&o)>>2|192&a,e[r+1]=(48&i)>>4|(48&n)>>2|48&o|(48&a)<<2,e[r+2]=(12&i)>>2|12&n|(12&o)<<2|(12&a)<<4,e[r+3]=3&i|(3&n)<<2|(3&o)<<4|(3&a)<<6}return;default:throw Error(`Invalid pixel format, "${r}"`)}}(e,a);break;default:throw Error(`Unhandled filter "${u[i]}"`)}return{layerName:i,blockIndex:l,data:e}}).catch(e=>{throw e})}))},oS(fX,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]});let fK=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class fQ{static from(e){if(!(e instanceof ArrayBuffer))throw Error("Data must be an instance of ArrayBuffer.");let[r,i]=new Uint8Array(e,0,2);if(219!==r)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(1!==n)throw Error(`Got v${n} data when expected v1.`);let o=fK[15&i];if(!o)throw Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new fQ(s,a,o,e)}constructor(e,r=64,i=Float64Array,n){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=fK.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(o<0)throw Error(`Unexpected typed array class: ${i}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+l,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+s+l),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);
15return function e(r,i,n,o,a,s){if(a-o<=n)return;let l=o+a>>1;(function e(r,i,n,o,a,s){for(;a>o;){if(a-o>600){let l=a-o+1,u=n-o+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);e(r,i,n,Math.max(o,Math.floor(n-u*h/l+p)),Math.min(a,Math.floor(n+(l-u)*h/l+p)),s)}let l=i[2*n+s],u=o,c=a;for(fJ(r,i,o,n),i[2*a+s]>l&&fJ(r,i,o,a);u<c;){for(fJ(r,i,u,c),u++,c--;i[2*u+s]<l;)u++;for(;i[2*c+s]>l;)c--}i[2*o+s]===l?fJ(r,i,o,c):fJ(r,i,++c,a),c<=n&&(o=c+1),n<=c&&(a=c-1)}})(r,i,l,o,a,s),e(r,i,n,o,l-1,1-s),e(r,i,n,l+1,a,1-s)}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,l=[0,o.length-1,0],u=[];for(;l.length;){let c=l.pop()||0,h=l.pop()||0,p=l.pop()||0;if(h-p<=s){for(let s=p;s<=h;s++){let l=a[2*s],c=a[2*s+1];l>=e&&l<=i&&c>=r&&c<=n&&u.push(o[s])}continue}let d=p+h>>1,f=a[2*d],m=a[2*d+1];f>=e&&f<=i&&m>=r&&m<=n&&u.push(o[d]),(0===c?e<=f:r<=m)&&(l.push(p),l.push(d-1),l.push(1-c)),(0===c?i>=f:n>=m)&&(l.push(d+1),l.push(h),l.push(1-c))}return u}within(e,r,i){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:o,nodeSize:a}=this,s=[0,n.length-1,0],l=[],u=i*i;for(;s.length;){let c=s.pop()||0,h=s.pop()||0,p=s.pop()||0;if(h-p<=a){for(let i=p;i<=h;i++)f1(o[2*i],o[2*i+1],e,r)<=u&&l.push(n[i]);continue}let d=p+h>>1,f=o[2*d],m=o[2*d+1];f1(f,m,e,r)<=u&&l.push(n[d]),(0===c?e-i<=f:r-i<=m)&&(s.push(p),s.push(d-1),s.push(1-c)),(0===c?e+i>=f:r+i>=m)&&(s.push(d+1),s.push(h),s.push(1-c))}return l}}function fJ(e,r,i,n){f0(e,i,n),f0(r,2*i,2*n),f0(r,2*i+1,2*n+1)}function f0(e,r,i){let n=e[r];e[r]=e[i],e[i]=n}function f1(e,r,i,n){let o=e-i,a=r-n;return o*o+a*a}e.$=class{constructor(e){this.specification=e}possiblyEvaluate(e,r){return function([e,r]){let i=tH([1,e,r]);return{x:i.x,y:i.y,z:i.z}}(e.expression.evaluate(r))}interpolate(e,r,i){return{x:r2(e.x,r.x,i),y:r2(e.y,r.y,i),z:r2(e.z,r.z,i)}}},e.A=aT,e.B=os,e.C=ik,e.D=on,e.E=rZ,e.F=function(e){let r=e.value,i=[];if(!r)return i;let n=iP(r);return"string"!==n?i=i.concat([new dv(e.key,r,`string expected, "${n}" found`)]):(dx(r,!0)||(i=i.concat([new dv(e.key,r,`invalid url "${r}"`)])),i)},e.G=aS,e.H=ab,e.I=h3,e.J=ay,e.K=class{constructor(e){this.specification=e}possiblyEvaluate(e,r){return tH(e.expression.evaluate(r))}interpolate(e,r,i){return{x:r2(e.x,r.x,i),y:r2(e.y,r.y,i),z:r2(e.z,r.z,i),azimuthal:r2(e.azimuthal,r.azimuthal,i),polar:r2(e.polar,r.polar,i)}}},e.L=ap,e.M=class{constructor(e,r,i,n){this.id=e,this.position=null!=r?new s6(r[0],r[1]):new s6(0,0),this.orientation=null!=i?i:[0,0,0],this.nodes=n,this.uploaded=!1,this.aabb=new l$([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(r,i){if(e.a9.multiply(r.matrix,i,r.matrix),r.meshes)for(let e of r.meshes){let i=l$.applyTransform(e.aabb,r.matrix);this.aabb.encapsulate(i)}if(r.children)for(let e of r.children)this._applyTransformations(e,r.matrix)}computeBoundsAndApplyParent(){let r=e.a9.identity([]);for(let e of this.nodes)this._applyTransformations(e,r)}computeModelMatrix(e,r,i,n,o,a,s=!1){dM(this.matrix,this,e.transform,this.position,r,i,n,o,a,s)}upload(e){if(!this.uploaded){for(let r of this.nodes)dA(r,e);for(let e of this.nodes)dP(e);this.uploaded=!0}}destroy(){for(let e of this.nodes)dL(e)}},e.N=au,e.O=lm,e.P=tx,e.R=rf,e.S=tC,e.T=pX,e.U=a_,e.V=dv,e.W=uo,e.X=r2,e.Y=8192,e.Z=oy,e._=r3,e.a=rY,e.a$=tF,e.a0=function(e,r,i=0,n=!0){let o=new tx(i,i),a=e.sub(o),s=r.add(o),l=[a,new tx(s.x,a.y),s,new tx(a.x,s.y)];return n&&l.push(a.clone()),l},e.a1=function(e,r){let i=[];for(let n=0;n<e.length;n++){let o=tA(n-1,-1,e.length-1),a=tA(n+1,-1,e.length-1),s=e[n],l=e[a],u=e[o].sub(s).unit(),c=l.sub(s).unit(),h=c.angleWithSep(u.x,u.y),p=u.add(c).unit().mult(-1*r/Math.sin(h/2));i.push(s.add(p))}return i},e.a2=pf,e.a3=lP,e.a4=function(r,i,n=0){return e.Q.fromValues(((i.x-n)*r.scale-r.x)*8192,(i.y*r.scale-r.y)*8192,i.z*la(lc(i.y)))},e.a5=lB,e.a6=c8,e.a7=function(e){let r=1/0,i=1/0,n=-1/0,o=-1/0;for(let a of e)r=Math.min(r,a.x),i=Math.min(i,a.y),n=Math.max(n,a.x),o=Math.max(o,a.y);return{min:new tx(r,i),max:new tx(n,o)}},e.a8=ls,e.aA=r1,e.aB=aj,e.aC=n5,e.aD=sl,e.aE=sE,e.aF=tD,e.aG=sh,e.aH=pU,e.aI=function(){al.isLoading()||al.isLoaded()||"deferred"!==aa()||as()},e.aJ=aI,e.aK=lv,e.aL=fr,e.aM=tW,e.aN=c5,e.aO=uQ,e.aP=ly,e.aQ=aG,e.aR=sn,e.aS=lZ,e.aT=uW,e.aU=pZ,e.aV=function(r,i){let n=uo(i.zoom);if(0===n)return l1(r);let o=l4(r),a=l6(o),s=ls(o.getWest())*i.worldSize,l=ls(o.getEast())*i.worldSize,u=ll(o.getNorth())*i.worldSize,c=ll(o.getSouth())*i.worldSize,h=[s,u,0],p=[l,u,0],d=[s,c,0],f=[l,c,0],m=e.a9.invert([],i.globeMatrix);return e.Q.transformMat4(h,h,m),e.Q.transformMat4(p,p,m),e.Q.transformMat4(d,d,m),e.Q.transformMat4(f,f,m),a[0]=l2(a[0],d,n),a[1]=l2(a[1],f,n),a[2]=l2(a[2],p,n),a[3]=l2(a[3],h,n),l$.fromPoints(a)},e.aW=ue,e.aX=l8,e.aY=l2,e.aZ=aq,e.a_=lY,e.ab=lA,e.ac=lg,e.ad=tM,e.ae=s0,e.af=function(e,r){let i={};for(let n=0;n<r.length;n++){let o=r[n];o in e&&(i[o]=e[o])}return i},e.ag=s8,e.ah=ll,e.ai=class{constructor(e){this.entries={}
15,this.scheduler=e}request(e,r,i,n){let o=this.entries[e]=this.entries[e]||{callbacks:[]};if(o.result){let[e,i]=o.result;return this.scheduler?this.scheduler.add(()=>{n(e,i)},r):n(e,i),()=>{}}return o.callbacks.push(n),o.cancel||(o.cancel=i((i,n)=>{for(let e of(o.result=[i,n],o.callbacks))this.scheduler?this.scheduler.add(()=>{e(i,n)},r):e(i,n);setTimeout(()=>delete this.entries[e],3e3)})),()=>{o.result||(o.callbacks=o.callbacks.filter(e=>e!==n),o.callbacks.length||(o.cancel(),delete this.entries[e]))}}},e.aj=aR,e.ak=function(e,r,i){let n=JSON.stringify(e.request);return e.data&&(this.deduped.entries[n]={result:[null,e.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},r=>{let n=ry(e.request,(e,n,o,a)=>{e?r(e):n&&r(null,{vectorTile:i?void 0:new ci(new hk(n)),rawData:n,cacheControl:o,expires:a})});return()=>{n.cancel(),r()}},r)},e.al=function(e){++ra>ri&&(e.getActor().send("enforceCacheSizeLimit",rr),ra=0)},e.am=rA,e.an=t8,e.ao=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},e.ap=li,e.aq=p2,e.ar=p4,e.as=p1,e.at=function(e,r){let i=document.createElement("video");i.muted=!0,i.onloadstart=function(){r(null,i)};for(let r=0;r<e.length;r++){let n=document.createElement("source");(function(e){let r=document.createElement("a");return r.href=e,r.protocol===location.protocol&&r.host===location.host})(e[r])||(i.crossOrigin="Anonymous"),n.src=e[r],i.appendChild(n)}return{cancel:()=>{}}},e.au=pK,e.av=pd,e.aw=lu,e.ax=lc,e.ay=aH,e.az=a8,e.b=rW,e.b$=h9,e.b0=fY,e.b1=ry,e.b2=function(e){let r=[];for(let i in e)r.push(e[i]);return r},e.b3=function(e,r){let i=[];for(let n in e)n in r||i.push(n);return i},e.b4=tP,e.b5=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.b6=function(r,i){let{x:n,y:o}=r.point,a=un(n,o,r.worldSize/r._pixelsPerMercatorPixel,0,0);return e.a9.multiply(a,a,ut(l1(i)))},e.b8=hf,e.b9=hB,e.bA=6,e.bB=function(r){let i=e.a9.identity(new Float64Array(16));e.a9.multiply(i,r.pixelMatrix,r.globeMatrix);let n=[0,s2,0],o=[0,s0,0];return e.Q.transformMat4(n,n,i),e.Q.transformMat4(o,o,i),[n[0]>0&&n[0]<=r.width&&n[1]>0&&n[1]<=r.height&&!us(r,new s6(r.center.lat,90)),o[0]>0&&o[0]<=r.width&&o[1]>0&&o[1]<=r.height&&!us(r,new s6(r.center.lat,-90))]},e.bC=function(r,i){let{scale:n}=r.tileTransform,o=8192*n/(r.tileSize*Math.pow(2,i.zoom-r.tileID.overscaledZ+r.tileID.canonical.z));return e.b7.scale(new Float32Array(4),i.inverseAdjustmentMatrix,[o,o])},e.bD=di,e.bE=dt,e.bF=function(r){let i=dt(r,!0);return e.b7.invert([],[i[0],i[1],i[4],i[5]])},e.bG=lU,e.bH=function(e){let{x:r,y:i}=e.point,{lng:n,lat:o}=e._center;return un(r,i,e.worldSize,n,o)},e.bI=function(e){return e*tw},e.bJ=5,e.bK=function(e){return tE[Math.round((e+45+360)%360/90)%4]},e.bL=45,e.bM=la,e.bN=sz,e.bO=sD,e.bP=sR,e.bQ=sO,e.bR=sL,e.bS=sk,e.bT=function(e,r,i){let n=Math.sqrt(e*e+r*r+i*i),o=n>0?Math.acos(i/n)*tw:0,a=0!==e||0!==r?Math.atan2(-r,-e)*tw+90:0;return a<0&&(a+=360),[n,a,o]},e.bU=lf,e.bV=l$,e.bW=tH,e.bX=function(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]},e.bY=function(e){return e({pluginStatus:at,pluginURL:ar}),ao.on("pluginStateChange",e),e},e.bZ=dk,e.b_=dU,e.ba=hd,e.bb=function(e,r,i,n,o){let a=5*r+2;e.float32[a+0]=i,e.float32[a+1]=n,e.float32[a+2]=o}
15,e.bc=pF,e.bd=h1,e.be=lE,e.bf=24,e.bg=ps,e.bh=pa,e.bi=hY,e.bj=fQ,e.bk=tA,e.bm=function(e){return e*tb},e.bn=t2,e.bo=function(e,r){return e/la(r)},e.bp=function(e,r,i){e[4*r+0]=i[0],e[4*r+1]=i[1],e[4*r+2]=i[2],e[4*r+3]=i[3]},e.bq=s6,e.br=pL,e.bs=lr,e.bt=lH,e.bu=dr,e.bv=lt,e.bw=l5,e.bx=function(e,r,i,n,o,a,s,l,u){if("globe"===u.name)return l5(e,r,new lt(i,n,o),!1);let c=pd({z:i,x:n,y:o},u);return new l$([(a+c.x/c.scale)*r,r*(c.y/c.scale),s],[(a+c.x2/c.scale)*r,r*(c.y2/c.scale),l])},e.by=function(e,r,i){let n=0;for(let i=0;i<2;++i)e[i]>0&&(n+=(e[i]-0)*(e[i]-0)),r[i]<0&&(n+=(0-r[i])*(0-r[i]));return n},e.bz=85.051129,e.c=d7,e.c$=[1,1,1],e.c0=h8,e.c1=rg,e.c2=ai,e.c3=b,e.c4=re,e.c5=rq,e.c6=tj,e.c7=function(e,r,i){return"custom"===e.type?new p6(e,r):new fd[e.type](e,r,i)},e.c8=function(e){let r=e.indexOf("\x1f");return r>=0?e.slice(0,r):e},e.c9=function(e){return e.indexOf("\x1f")>=0},e.cA=e=>({u_matrix:new sz(e),u_pixels_to_tile_units:new sj(e),u_device_pixel_ratio:new sO(e),u_units_to_pixels:new sD(e),u_dash_image:new sL(e),u_gradient_image:new sL(e),u_image_height:new sO(e),u_texsize:new sD(e),u_tile_units_to_pixels:new sO(e),u_alpha_discard_threshold:new sO(e),u_trim_offset:new sD(e),u_emissive_strength:new sO(e)}),e.cB=e=>({u_matrix:new sz(e),u_texsize:new sD(e),u_pixels_to_tile_units:new sj(e),u_device_pixel_ratio:new sO(e),u_image:new sL(e),u_units_to_pixels:new sD(e),u_tile_units_to_pixels:new sO(e),u_alpha_discard_threshold:new sO(e),u_trim_offset:new sD(e)}),e.cC=a4,e.cD=hh,e.cE=hm,e.cF=up,e.cG=(e,r,i,n,o,a)=>{let s,l=e.transform,u="globe"===l.projection.name;if("map"===a.paint.get("circle-pitch-alignment"))if(u){let e=ui(l.zoom,r.canonical)*l._pixelsPerMercatorPixel;s=Float32Array.from([e,0,0,e])}else s=l.calculatePixelsToTileUnitsMatrix(i);else s=new Float32Array([l.pixelsToGLUnits[0],0,0,l.pixelsToGLUnits[1]]);let c={u_camera_to_center_distance:e.transform.getCameraToCenterDistance(l.projection),u_matrix:e.translatePosMatrix(r.projMatrix,i,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_device_pixel_ratio:t9.devicePixelRatio,u_extrude_scale:s,u_inv_rot_matrix:uh,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:a.paint.get("circle-emissive-strength")};if(u){c.u_inv_rot_matrix=n,c.u_merc_center=o,c.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],c.u_zoom_transition=uo(l.zoom);let e=8192*o[0],i=8192*o[1];c.u_up_dir=l.projection.upVector(new lt(0,0,0),e,i)}return c},e.cH=he,e.cI=(e,r,i,n,o,a)=>{let s=e.transform;return{u_matrix:c7(e,r,i,n),u_texsize:r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:s.calculatePixelsToTileUnitsMatrix(r),u_device_pixel_ratio:o,u_image:0,u_tile_units_to_pixels:c9(r,s),u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:a}},e.cJ=(e,r,i,n,o,a,s)=>{let l=e.transform,u=l.calculatePixelsToTileUnitsMatrix(r);return{u_matrix:c7(e,r,i,n),u_pixels_to_tile_units:u,u_device_pixel_ratio:a,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:o,u_texsize:ht(i)&&r.lineAtlasTexture?r.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:c9(r,e.transform),u_alpha_discard_threshold:0,u_trim_offset:s,u_emissive_strength:i.paint.get("line-emissive-strength")}},e.cK=tk,e.cL=uT,e.cM=cG,e.cN=lo,e.cO=cN,e.cP=0x80000000,e.cQ=450,e.cR=7,e.cS=.0038760859073359074,e.cT=256,e.cU=ut,e.cV=so,e.cW=st,e.cX=sr,e.cY=function(e,r,i,n,o){return tM((e-r)/(i-r)*(o-n)+n,n,o)},e.cZ=lp,e.c_=dc,e.ca=function(e){let r=e.indexOf("\x1f");return r>=0?e.slice(r+1):""},e.cb=function(e){let r=[],i=e.id;return void 0===i&&r.push({message:`layers.${i}: missing required property "id"`}),void 0===e.render&&r.push({message:`layers.${i}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&r.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),r},e.cc=tU,e.cd=ao,e.ce=r_,e.cf=sN,e.cg=class extends sP{constructor(e){super(e),this.current=sB}set(e,r,i){if(this.fetchUniformLocation(e,r)){for(let e=0;e<9;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}}},e.ch=tS,e.ci=function(e,r,i){let n=uo(i.zoom),o=e.style.map._antialias,a=r.options.extStandardDerivativesForceOff||e.terrain&&e.terrain.exaggeration()>0;return 0===n&&!o&&!a},e.cj=function(r){let i=r.pixelsPerMeter,n=i/(1/la(r.center.lat)),o=e.a9.identity(new Float64Array(16));return e.a9.translate(o,o,[r.point.x,r.point.y,0]),e.a9.scale(o,o,[n,n,i]),Float32Array.from(o)},e.ck=l4,e.cl=function(e){return Math.round(Math.pow(Math.abs(Math.sin((e=tM(e,-80.051129,80.051129)/80.051129*90)*tb)),3)*(s1.length-1))},e.cm=function(r,i,n,o){let a=i.getNorth(),s=i.getSouth(),l=i.getWest(),u=i.getEast(),c=1<<r.z,h=u-l,p=a-s,d=h/64,f=-p/s1[n],m=[0,d,0,f,0,0,a,l,0];if(r.z>0){let r=180/o;e.ct.multiply(m,m,[r/h+1,0,0,0,r/p+1,0,-.5*r/d,.5*r/f,1])}return m[2]=c,m[5]=r.x,m[8]=r.y,m},e.cn=l1,e.co=function(r,i,n){let o=e.a9.identity(new Float64Array(16)),a=(i/(1<<r)-.5)*Math.PI*2;return e.a9.rotateY(o,n.globeMatrix,a),Float32Array.from(o)},e.cp=class{isDataAvailableAtPoint(e){let r=this._source();if(this.isUsingMockSource()||!r||e.y<0||e.y>1)return!1;let i=r.getSource().maxzoom,n=1<<i,o=Math.floor(e.x),a=Math.floor((e.x-o)*n),s=Math.floor(e.y*n),l=this.findDEMTileFor(new li(i,o,i,a,s));return!(!l||!l.dem)}
15getAtPointOrZero(e,r=0){return this.getAtPoint(e,r)||0}getAtPoint(e,r,i=!0){if(this.isUsingMockSource())return null;null==r&&(r=null);let n=this._source();if(!n||e.y<0||e.y>1)return r;let o=n.getSource().maxzoom,a=1<<o,s=Math.floor(e.x),l=e.x-s,u=new li(o,s,o,Math.floor(l*a),Math.floor(e.y*a)),c=this.findDEMTileFor(u);if(!c||!c.dem)return r;let h=c.dem,p=1<<c.tileID.canonical.z,d=(l*p-c.tileID.canonical.x)*h.dim,f=(e.y*p-c.tileID.canonical.y)*h.dim,m=Math.floor(d),g=Math.floor(f);return(i?this.exaggeration():1)*r2(r2(h.get(m,g),h.get(m,g+1),f-g),r2(h.get(m+1,g),h.get(m+1,g+1),f-g),d-m)}getAtTileOffset(e,r,i){let n=1<<e.canonical.z;return this.getAtPointOrZero(new lm(e.wrap+(e.canonical.x+r/8192)/n,(e.canonical.y+i/8192)/n))}getAtTileOffsetFunc(r,i,n,o){return a=>{let s=this.getAtTileOffset(r,a.x,a.y),l=o.upVector(r.canonical,a.x,a.y),u=o.upVectorScale(r.canonical,i,n).metersToTile;return e.Q.scale(l,l,s*u),l}}getForTilePoints(e,r,i,n){if(this.isUsingMockSource())return!1;let o=cw.create(this,e,n);return!!o&&(r.forEach(e=>{e[2]=this.exaggeration()*o.getElevationAt(e[0],e[1],i)}),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;let r=this.findDEMTileFor(e);if(!r||!r.dem)return null;let i=r.dem.tree,n=r.tileID,o=1<<e.canonical.z-n.canonical.z,a=e.canonical.x/o-n.canonical.x,s=e.canonical.y/o-n.canonical.y,l=0;for(let r=0;r<e.canonical.z-n.canonical.z&&!i.leaves[l];r++){let e=2*Math.floor(s*=2)+Math.floor(a*=2);l=i.childOffsets[l]+e,a%=1,s%=1}return{min:this.exaggeration()*i.minimums[l],max:this.exaggeration()*i.maximums[l]}}getMinElevationBelowMSL(){throw Error("Pure virtual method called.")}raycast(e,r,i){throw Error("Pure virtual method called.")}pointCoordinate(e){throw Error("Pure virtual method called.")}_source(){throw Error("Pure virtual method called.")}isUsingMockSource(){throw Error("Pure virtual method called.")}exaggeration(){throw Error("Pure virtual method called.")}findDEMTileFor(e){throw Error("Pure virtual method called.")}get visibleDemTiles(){throw Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){let e=this.visibleDemTiles;if(0===e.length)return null;let r=!1,i=Number.MAX_VALUE,n=5e-324;for(let o of e){let e=this.getMinMaxForTile(o.tileID);e&&(i=Math.min(i,e.min),n=Math.max(n,e.max),r=!0)}return r?{min:i,max:n}:null}},e.cq=lX,e.cr=uw,e.cs=function(e,r){return[Math.pow(e[0],2.2)*r,Math.pow(e[1],2.2)*r,Math.pow(e[2],2.2)*r]},e.cu=ui,e.cv=t6,e.cw=t4,e.cx=256,e.cy=function(r,i){let n=[0,0,0],o=ue(l1(i.canonical));return e.Q.transformMat4(n,n,o),e.Q.transformMat4(n,n,r),n},e.cz=e=>({u_camera_to_center_distance:new sO(e),u_extrude_scale:new sj(e),u_device_pixel_ratio:new sO(e),u_matrix:new sz(e),u_inv_rot_matrix:new sz(e),u_merc_center:new sD(e),u_tile_id:new sR(e),u_zoom_transition:new sO(e),u_up_dir:new sR(e),u_emissive_strength:new sO(e)}),e.d=rx,e.d$=dR,e.d0=cw,e.d1=dI,e.d2=a2,e.d3=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[]}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(e){let r=cu(new tx(0,0),new tx(8192,8192),e),i=[];for(let n of this._activeRegions){if(n.hiddenByOverlap||!cl(r,n))continue;let o=function(e,r,i){let n=1<<i.canonical.z,o=((r.x-i.wrap)*n-i.canonical.x)*8192,a=(r.y*n-i.canonical.y)*8192;return{min:new tx(((e.x-i.wrap)*n-i.canonical.x)*8192,(e.y*n-i.canonical.y)*8192),max:new tx(o,a)}}(n.min,n.max,e);i.push({min:o.min,max:o.max,sourceId:this._sourceIds[n.priority],footprint:n.footprint,footprintTileId:n.tileId})}return i}setSources(e){this._setSources(e.map(e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{let r=[];for(let i of e.cache.getVisibleCoordinates()){let n=e.cache.getTile(i).buckets[e.layer];if(n)for(let e of n.getNodesInfo()){let n=e.node;n.footprint&&r.push({footprint:n.footprint,id:i.toUnwrapped()})}}return r}})))}_addSource(e){let r=e.getFootprints();if(0!==r.length){for(let e of r){if(!e.footprint)continue;let r=cu(e.footprint.min,e.footprint.max,e.id);this._activeRegions.push({min:r.min,max:r.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:e.id,footprint:e.footprint})}this._sourceIds.push(e.getSourceId())}}_computeReplacement(){this._activeRegions.sort((e,r)=>e.priority-r.priority||ca(e.min,r.min)||ca(e.max,r.max));let e=this._activeRegions.length!==this._prevRegions.length;if(!e){let r=0,i=0;for(;!e&&r!==this._activeRegions.length;){let n=this._activeRegions[r],o=this._prevRegions[i];e=n.priority!==o.priority||!cs(n,o),++r,++i}}if(e){++this._updateTime;let e=e=>{let r=this._activeRegions;if(e>=r.length)return e;let i=r[e].priority;for(;e<r.length&&r[e].priority===i;)++e;return e};if(this._sourceIds.length>1){let r=0,i=e(0);for(;r!==i;){let n=r,o=r;for(;n!==i;){let e=this._activeRegions[n];e.hiddenByOverlap=!1;for(let r=0;r<o;r++){let i=this._activeRegions[r];if(!i.hiddenByOverlap&&cl(e,i)&&(e.hiddenByOverlap=function e(r,i,n,o){if(!r||!n)return!1;let a=r.vertices;if(!i.canonical.equals(o.canonical)||i.wrap!==o.wrap){if(n.vertices.length<r.vertices.length)return e(n,o,r,i);let s=i.canonical,l=o.canonical,u=Math.pow(2,l.z-s.z);a=r.vertices.map(e=>new tx((e.x+8192*s.x)*u-8192*l.x,(e.y+8192*s.y)*u-8192*l.y))}return cc(n,a,r.indices,0,r.indices.length,0,0)}(e.footprint,e.tileId,i.footprint,i.tileId),e.hiddenByOverlap))break}++n}i=e(r=i)}}}}_setSources(e){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let r=e.length-1;r>=0;r--)this._addSource(e[r]);this._computeReplacement()}},e.d4=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){for(let e of(this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy(),this._poleSegments))e.destroy();for(let e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy()}_fillGridMeshWithLods(e,r){let i=new aG,n=new a8,o=[],a=e+1+2,s=r[0]+1,l=r[0]+1+(1+r.length),u=(e,r,i)=>{let n=e===a-1?e-2:0===e?e:e-1;return[n+=24575*!!i,r]};for(let e=0;e<a;++e)i.emplaceBack(...u(e,0,!0));for(let e=0;e<s;++e)for(let r=0;r<a;
15++r)i.emplaceBack(...u(r,e,0===r||r===a-1));for(let e=0;e<r.length;++e){let n=r[e];for(let e=0;e<a;++e)i.emplaceBack(...u(e,n,!0))}for(let e=0;e<r.length;++e){let s=n.length,u=r[e]+1+2,c=new a8;for(let i=0;i<u-1;i++){let o=i===u-2,s=o?a*(l-r.length+e-i):a;for(let e=0;e<a-1;e++){let r=i*a+e;0===i||o||0===e||e===a-2?(c.emplaceBack(r+1,r,r+s),c.emplaceBack(r+s,r+s+1,r+1)):(n.emplaceBack(r+1,r,r+s),n.emplaceBack(r+s,r+s+1,r+1))}}let h=sE.simpleSegment(0,s,i.length,n.length-s);for(let e=0;e<c.uint16.length;e+=3)n.emplaceBack(c.uint16[e],c.uint16[e+1],c.uint16[e+2]);let p=sE.simpleSegment(0,s,i.length,n.length-s);o.push({withoutSkirts:h,withSkirts:p})}return{vertices:i,indices:n,segments:o}}_createGrid(e){let r=this._fillGridMeshWithLods(64,s1);this._gridSegments=r.segments,this._gridBuffer=e.createVertexBuffer(r.vertices,lZ.members),this._gridIndexBuffer=e.createIndexBuffer(r.indices,!0)}_createPoles(e){let r=new a8;for(let e=0;e<=64;e++)r.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(r,!0);let i=new st,n=new st,o=new st,a=new st;this._poleSegments=[];for(let e=0,r=0;e<5;e++){let s=360/(1<<e);i.emplaceBack(0,-s0,0,.5,0),n.emplaceBack(0,-s0,0,.5,1),o.emplaceBack(0,-s0,0,.5,.5),a.emplaceBack(0,-s0,0,.5,.5);for(let e=0;e<=64;e++){let r=e/64,l=0,u=r2(0,s,r),[c,h,p]=s3(uu,uc,u,s0);i.emplaceBack(c,h,p,r,l),n.emplaceBack(c,h,p,r,1-l);let d=u*tb;r=.5+.5*Math.sin(d),l=.5+.5*Math.cos(d),o.emplaceBack(c,h,p,r,l),a.emplaceBack(c,h,p,r,1-l)}this._poleSegments.push(sE.simpleSegment(r,0,66,64)),r+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(i,lW,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(n,lW,!1),this._texturedPoleNorthVertexBuffer=e.createVertexBuffer(o,lW,!1),this._texturedPoleSouthVertexBuffer=e.createVertexBuffer(a,lW,!1)}getGridBuffers(e,r){return[this._gridBuffer,this._gridIndexBuffer,r?this._gridSegments[e].withSkirts:this._gridSegments[e].withoutSkirts]}getPoleBuffers(e,r){return[r?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,r?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}},e.d5=function(e){return rz.has(e)},e.d6=tT,e.d7=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},e.d8=tI,e.d9=ld,e.dA=dB,e.dB=function(e){let r=rn();if(!r)return;let i=r.delete(rt);e&&i.catch(e).then(()=>e())},e.dC=dN,e.dD=dW,e.dE=function(e){dV=t9.resolveURL(e),d$||(d$=new dk(dU(),new rZ)),d$.broadcast("setDracoUrl",dV)},e.dF=dY,e.dG=function(e){dq=t9.resolveURL(e),d$||(d$=new dk(dU(),new rZ)),d$.broadcast("setMeshoptUrl",dq)},e.dH=oS,e.dI=ux,e.dJ=2,e.dK=fe,e.dL=fi,e.dM=c0,e.dN=tB,e.dO=h5,e.dP=function(e,r,i,n,o,a,s,l,u,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;let p=e.layers[0].layout,d=e.layers[0]._unevaluatedLayout._values,f={};if("composite"===e.textSizeData.kind){let{minZoom:r,maxZoom:i}=e.textSizeData;f.compositeTextSizes=[d["text-size"].possiblyEvaluate(new au(r),l),d["text-size"].possiblyEvaluate(new au(i),l)]}if("composite"===e.iconSizeData.kind){let{minZoom:r,maxZoom:i}=e.iconSizeData;f.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new au(r),l),d["icon-size"].possiblyEvaluate(new au(i),l)]}f.layoutTextSize=d["text-size"].possiblyEvaluate(new au(u+1),l),f.layoutIconSize=d["icon-size"].possiblyEvaluate(new au(u+1),l),f.textMaxSize=d["text-size"].possiblyEvaluate(new au(18),l);let m="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),g=p.get("text-size"),_=!1;for(let r of e.features)if(r.icon&&r.icon.nameSecondary){_=!0;break}for(let a of e.features){let u=p.get("text-font").evaluate(a,{},l).join(","),d=g.evaluate(a,{},l),y=f.layoutTextSize.evaluate(a,{},l),v=(f.layoutIconSize.evaluate(a,{},l),{horizontal:{},vertical:void 0}),x=a.text,b,w=[0,0];if(x){let n=x.toString(),s=24*p.get("text-letter-spacing").evaluate(a,{},l),c=24*p.get("text-line-height").evaluate(a,{},l),h=!function(e){for(let i of e){var r;if(oA(r=i.charCodeAt(0))||oP(r)||oL(r)||oK(r)||o1(r))return!1}return!0}(n)?0:s,f=p.get("text-anchor").evaluate(a,{},l),g=p.get("text-variable-anchor");if(!g){let e=p.get("text-radial-offset").evaluate(a,{},l);w=e?pa(f,[24*e,pn]):p.get("text-offset").evaluate(a,{},l).map(e=>24*e)}
15let _=m?"center":p.get("text-justify").evaluate(a,{},l),b="point"===p.get("symbol-placement"),E=b?24*p.get("text-max-width").evaluate(a,{},l):1/0,S=a=>{e.allowVerticalPlacement&&o3(n)&&(v.vertical=hV(x,r,i,o,u,E,c,f,a,h,w,hB.vertical,!0,y,d))};if(!m&&g){let e="auto"===_?g.map(e=>ps(e)):[_],n=!1;for(let a=0;a<e.length;a++){let s=e[a];if(!v.horizontal[s])if(n)v.horizontal[s]=v.horizontal[0];else{let e=hV(x,r,i,o,u,E,c,"center",s,h,w,hB.horizontal,!1,y,d);e&&(v.horizontal[s]=e,n=1===e.positionedLines.length)}}S("left")}else{if("auto"===_&&(_=ps(f)),b||p.get("text-writing-mode").indexOf("horizontal")>=0||!o3(n)){let e=hV(x,r,i,o,u,E,c,f,_,h,w,hB.horizontal,!1,y,d);e&&(v.horizontal[_]=e)}S(b?"left":_)}}let E=!1;if(a.icon&&a.icon.namePrimary){let r=n[a.icon.namePrimary];r&&(b=function(e,r,i,n){let{horizontalAlign:o,verticalAlign:a}=hY(n),s=i[0]-e.displaySize[0]*o,l=i[1]-e.displaySize[1]*a;return{imagePrimary:e,imageSecondary:r,top:l,bottom:l+e.displaySize[1],left:s,right:s+e.displaySize[0]}}(o[a.icon.namePrimary],a.icon.nameSecondary?o[a.icon.nameSecondary]:void 0,p.get("icon-offset").evaluate(a,{},l),p.get("icon-anchor").evaluate(a,{},l)),E=r.sdf,void 0===e.sdfIcons?e.sdfIcons=r.sdf:e.sdfIcons!==r.sdf&&tG("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(r.pixelRatio!==e.pixelRatio||0!==p.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}let S=pu(v.horizontal)||v.vertical;e.iconsInText||(e.iconsInText=!!S&&S.iconsInText),(S||b)&&function(e,r,i,n,o,a,s,l,u,c,h,p,d,f){var m;let g,_=a.textMaxSize.evaluate(r,{},h);void 0===_&&(_=s);let y=e.layers[0].layout,v=y.get("icon-offset").evaluate(r,{},h),x=pu(i.horizontal)||i.vertical,b="globe"===p.name,w=s/24,E=e.tilePixelRatio*_/24,S=(m=e.overscaling,e.zoom>18&&m>2&&(m>>=1),Math.max(8192/(512*m),1)*y.get("symbol-spacing")),T=y.get("text-padding")*e.tilePixelRatio,I=y.get("icon-padding")*e.tilePixelRatio,M=y.get("text-max-angle")*tb,C="map"===y.get("text-rotation-alignment")&&"point"!==y.get("symbol-placement"),A="map"===y.get("icon-rotation-alignment")&&"point"!==y.get("symbol-placement"),P=y.get("symbol-placement"),L=S/2,O=y.get("icon-text-fit").evaluate(r,{},h),D=y.get("icon-text-fit-padding").evaluate(r,{},h),R="none"!==O;!1===e.hasAnyIconTextFit&&R&&(e.hasAnyIconTextFit=!0),n&&R&&(e.allowVerticalPlacement&&i.vertical&&(g=hX(n,i.vertical,O,D,v,w)),x&&(n=hX(n,x,O,D,v,w)));let k=(s,m,_)=>{if(m.x<0||m.x>=8192||m.y<0||m.y>=8192)return;let y=null;if(b){let{x:e,y:r,z:i}=p.projectTilePoint(m.x,m.y,_);y={anchor:new hK(e,r,i,0,void 0),up:p.upVector(_,m.x,m.y)}}!function(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E,S,T,I){let M=e.addToLineVertexArray(r,n),C,A,P,L,O,D,R,k=0,N=0,F=0,z=0,B=-1,U=-1,j={},V=rq(""),G=i?i.anchor:r,q="none"!==u.layout.get("icon-text-fit").evaluate(x,{},S),H=0,$=0;if(void 0===u._unevaluatedLayout.getValue("text-radial-offset")?[H,$]=u.layout.get("text-offset").evaluate(x,{},S).map(e=>24*e):(H=24*u.layout.get("text-radial-offset").evaluate(x,{},S),$=pn),e.allowVerticalPlacement&&o.vertical){let e=o.vertical;if(m)D=ph(e),l&&(R=ph(l));else{let i=u.layout.get("text-rotate").evaluate(x,{},S)+90;P=pc(c,G,r,h,p,d,e,f,i,g),l&&(L=pc(c,G,r,h,p,d,l,_,i))}}if(a){let n=u.layout.get("icon-rotate").evaluate(x,{},S),o=h7(a,n,w,q),s=l?h7(l,n,w,q):void 0;A=pc(c,G,r,h,p,d,a,_,n),k=4*o.length;let f=e.iconSizeData,m=null;"source"===f.kind?(m=[128*u.layout.get("icon-size").evaluate(x,{},S)])[0]>32640&&tG(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`):"composite"===f.kind&&((m=[128*b.compositeIconSizes[0].evaluate(x,{},S),128*b.compositeIconSizes[1].evaluate(x,{},S)])[0]>32640||m[1]>32640)&&tG(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`),e.addSymbols(e.icon,o,m,v,y,x,!1,i,r,M.lineStartIndex,M.lineLength,-1,E,S,T,I),B=e.icon.placedSymbolArray.length-1,s&&(N=4*s.length,e.addSymbols(e.icon,s,m,v,y,x,hB.vertical,i,r,M.lineStartIndex,M.lineLength,-1,E,S,T,I),U=e.icon.placedSymbolArray.length-1)}for(let n in o.horizontal){let a=o.horizontal[n];C||(V=rq(a.text),m?O=ph(a):C=pc(c,G,r,h,p,d,a,f,u.layout.get("text-rotate").evaluate(x,{},S),g));let l=1===a.positionedLines.length;if(F+=pl(e,i,r,a,s,u,m,x,g,M,o.vertical?hB.horizontal:hB.horizontalOnly,l?Object.keys(o.horizontal):[n],j,B,b,E,S,T),l)break}o.vertical&&(z+=pl(e,i,r,o.vertical,s,u,m,x,g,M,hB.vertical,["vertical"],j,U,b,E,S,T));let W=-1,Y=(e,r)=>e?Math.max(e,r):r;W=Y(O,-1),W=Y(D,W);let Z=+((W=Y(R,W))>-1);e.glyphOffsetArray.length>=65535&&tG("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKey
15Ranges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(r.x,r.y,G.x,G.y,G.z,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical>=0?j.vertical:-1,B,U,V,void 0!==C?C:e.collisionBoxArray.length,void 0!==C?C+1:e.collisionBoxArray.length,void 0!==P?P:e.collisionBoxArray.length,void 0!==P?P+1:e.collisionBoxArray.length,void 0!==A?A:e.collisionBoxArray.length,void 0!==A?A+1:e.collisionBoxArray.length,L||e.collisionBoxArray.length,L?L+1:e.collisionBoxArray.length,h,F,z,k,N,Z,0,H,$,W,0,+!!q)}(e,m,y,s,i,n,o,g,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,T,C,l,I,A,v,r,a,u,c,h,d,f)};if("line"===P)for(let o of h1(r.geometry,0,0,8192,8192))for(let r of function(e,r,i,n,o,a,s){let l=n?14.399999999999999*a:0,u=h0(n,o),c=u*a,h=0===e[0].x||8192===e[0].x||0===e[0].y||8192===e[0].y;return r-c<r/4&&(r=c+r/4),function e(r,i,n,o,a,s,l,u,c){let h=s/2,p=hJ(r),d=0,f=i-n,m=[];for(let e=0;e<r.length-1;e++){let i=r[e],l=r[e+1],u=i.dist(l),g=l.angleTo(i);for(;f+n<d+u;){let _=((f+=n)-d)/u,y=r2(i.x,l.x,_),v=r2(i.y,l.y,_);if(y>=0&&y<c&&v>=0&&v<c&&f-h>=0&&f+h<=p){let i=new hK(y,v,0,g,e);o&&!hQ(r,i,s,o,a)||m.push(i)}}d+=u}return u||m.length||l||(m=e(r,d/2,n,o,a,s,l,!0,c)),m}(e,h?r/2*s%r:(u/2+48)*a*s%r,r,l,i,c,h,!1,8192)}(o,S,M,i.vertical||x,n,E,e.overscaling))x&&function(e,r,i,n){let o=e.compareText;if(r in o){let e=o[r];for(let r=e.length-1;r>=0;r--)if(n.dist(e[r])<i)return!0}else o[r]=[];return o[r].push(n),!1}(e,x.text,L,r)||k(o,r,h);else if("line-center"===P){for(let e of r.geometry)if(e.length>1){let r=function(e,r,i,n,o){let a=i?14.399999999999999*o:0,s=h0(i,n)*o,l=0,u=hJ(e)/2;for(let i=0;i<e.length-1;i++){let n=e[i],o=e[i+1],c=n.dist(o);if(l+c>u){let h=(u-l)/c,p=new hK(r2(n.x,o.x,h),r2(n.y,o.y,h),0,o.angleTo(n),i);return!a||hQ(e,p,s,a,r)?p:void 0}l+=c}}(e,M,i.vertical||x,n,E);r&&k(e,r,h)}}else if("Polygon"===r.type)for(let e of uY(r.geometry,0)){let r=function(e,r=1,i=!1){let n=1/0,o=1/0,a=-1/0,s=-1/0,l=e[0];for(let e=0;e<l.length;e++){let r=l[e];(!e||r.x<n)&&(n=r.x),(!e||r.y<o)&&(o=r.y),(!e||r.x>a)&&(a=r.x),(!e||r.y>s)&&(s=r.y)}let u=Math.min(a-n,s-o),c=u/2,h=new i1([],pr);if(0===u)return new tx(n,o);for(let r=n;r<a;r+=u)for(let i=o;i<s;i+=u)h.push(new pi(r+c,i+c,c,e));let p=function(e){let r=0,i=0,n=0,o=e[0];for(let e=0,a=o.length,s=a-1;e<a;s=e++){let a=o[e],l=o[s],u=a.x*l.y-l.x*a.y;i+=(a.x+l.x)*u,n+=(a.y+l.y)*u,r+=3*u}return new pi(i/r,n/r,0,e)}(e),d=h.length;for(;h.length;){let n=h.pop();(n.d>p.d||!p.d)&&(p=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-p.d<=r||(c=n.h/2,h.push(new pi(n.p.x-c,n.p.y-c,c,e)),h.push(new pi(n.p.x+c,n.p.y-c,c,e)),h.push(new pi(n.p.x-c,n.p.y+c,c,e)),h.push(new pi(n.p.x+c,n.p.y+c,c,e)),d+=4)}return i&&(console.log(`num probes: ${d}`),console.log(`best distance: ${p.d}`)),p.p}(e,16);k(e[0],new hK(r.x,r.y,0,0,void 0),h)}else if("LineString"===r.type)for(let e of r.geometry)k(e,new hK(e[0].x,e[0].y,0,0,void 0),h);else if("Point"===r.type)for(let e of r.geometry)for(let r of e)k([r],new hK(r.x,r.y,0,0,void 0),h)}(e,a,v,b,n,f,y,w,E,s,l,c,h,_)}a&&e.generateCollisionDebugBuffers(u,e.collisionBoxArray)},e.dQ=ci,e.dR=hk,e.dS=cb,e.dT=cn,e.dU=u8,e.dV=tv,e.dW=hv,e.dX=M,e.dY=function(e){let r=0;if(0x46546c67!==new Uint32Array(e,0,1)[0]){let i=new Uint32Array(e,0,7),[,,n,o,a,s]=i;r=i.byteLength+o+a+s+a,(n!==e.byteLength||r>=e.byteLength)&&tG("Invalid b3dm header information.")}return d5(e,r)},e.dZ=function(r,i){let n=d7(r);for(let r of n){for(let e of r.meshes)!function(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);let r=e.vertexArray.float32,i=e.aabb.min[0]-1,n=e.aabb.min[1]-1,o=64/(e.aabb.max[0]-i+2),a=64/(e.aabb.max[1]-n+2);for(let s=0;s<r.length;s+=3){let l=r[s+2],u=(r[s+0]-i)*o|0,c=(r[s+1]-n)*a|0;l>e.heightmap[64*c+u]&&(e.heightmap[64*c+u]=l)}}(e);r.lights&&(r.lightMeshIndex=r.meshes.length,r.meshes.push(function(r,i){let n={};n.indexArray=new a8,n.indexArray.reserve(4*r.length),n.vertexArray=new so,n.vertexArray.reserve(10*r.length),n.colorArray=new aY,n.vertexArray.reserve(10*r.length);let o=0;for(let a of r){let r=Math.min(10,Math.max(4,1.3*a.height))*i,s=[-a.normal[1],a.normal[0],0],l=Math.min(.29,.1*a.width/a.depth),u=a.width-2*a.depth*i*(l+.01),c=e.Q.scaleAndAdd([],a.pos,s,u/2),h=e.Q.scaleAndAdd([],a.pos,s,-u/2),p=[c[0],c[
151],c[2]+a.height],d=[h[0],h[1],h[2]+a.height],f=e.Q.scaleAndAdd([],a.normal,s,l);e.Q.scale(f,f,r);let m=e.Q.scaleAndAdd([],a.normal,s,-l);e.Q.scale(m,m,r),e.Q.add(f,c,f),e.Q.add(m,h,m),c[2]+=.1,h[2]+=.1,n.vertexArray.emplaceBack(f[0],f[1],f[2]),n.vertexArray.emplaceBack(m[0],m[1],m[2]),n.vertexArray.emplaceBack(c[0],c[1],c[2]),n.vertexArray.emplaceBack(h[0],h[1],h[2]),n.vertexArray.emplaceBack(p[0],p[1],p[2]),n.vertexArray.emplaceBack(d[0],d[1],d[2]),n.vertexArray.emplaceBack(c[0],c[1],c[2]),n.vertexArray.emplaceBack(h[0],h[1],h[2]),n.vertexArray.emplaceBack(f[0],f[1],f[2]),n.vertexArray.emplaceBack(m[0],m[1],m[2]);let g=u/r/2;n.colorArray.emplaceBack(-g-l,-1,g,.8),n.colorArray.emplaceBack(g+l,-1,g,.8),n.colorArray.emplaceBack(-g,0,g,1.3),n.colorArray.emplaceBack(g,0,g,1.3),n.colorArray.emplaceBack(g+l,-.8,g,.7),n.colorArray.emplaceBack(g+l,-.8,g,.7),n.colorArray.emplaceBack(0,0,g,1.3),n.colorArray.emplaceBack(0,0,g,1.3),n.colorArray.emplaceBack(g+l,-1.2,g,.8),n.colorArray.emplaceBack(g+l,-1.2,g,.8),n.indexArray.emplaceBack(6+o,4+o,8+o),n.indexArray.emplaceBack(7+o,9+o,5+o),n.indexArray.emplaceBack(0+o,1+o,2+o),n.indexArray.emplaceBack(1+o,3+o,2+o),o+=10}let a={defined:!0,emissiveFactor:[0,0,0]},s={};return s.baseColorFactor=r1.white,a.pbrMetallicRoughness=s,n.material=a,n.aabb=new l$([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),n}(r.lights,i)))}return n},e.d_=fc,e.da=s5,e.db=function([e,r,i]){let n=Math.hypot(e,r,i);return new s6(Math.atan2(e,i)*tw,(.5*Math.PI-Math.acos(-r/n))*tw)},e.dc=6371008.8,e.dd=v,e.de=us,e.df=ua,e.dg=function(r){let i=[0,0,0],n=e.a9.identity(new Float64Array(16));return e.a9.multiply(n,r.pixelMatrix,r.globeMatrix),e.Q.transformMat4(i,i,n),new tx(i[0],i[1])},e.dh=function(e){let r=e.navigator?e.navigator.userAgent:null;return!!function(e){if(null==t0){let r=e.navigator?e.navigator.userAgent:null;t0=!!e.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return t0}(e)&&r&&(r.match("Version/15.4")||r.match("Version/15.5")||r.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},e.di=class{constructor(e,r,i){this._transformRequestFn=e,this._customAccessToken=r,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){let e=function(){let e="";for(let r=0;r<10;r++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1","01",e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,r){return this._transformRequestFn&&this._transformRequestFn(e,r)||{url:e}}normalizeStyleURL(e,r){if(!b(e))return e;let i=rE(e);return i.params.push(`sdk=js-${y}`),i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||r)}normalizeGlyphsURL(e,r){if(!b(e))return e;let i=rE(e);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||r)}normalizeModelURL(e,r){if(!b(e))return e;let i=rE(e);return i.path=`/models/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||r)}normalizeSourceURL(e,r,i,n){if(!b(e))return e;let o=rE(e);return o.path=`/v4/${o.authority}.json`,o.params.push("secure"),i&&o.params.push(`language=${i}`),n&&o.params.push(`worldview=${n}`),this._makeAPIURL(o,this._customAccessToken||r)}normalizeSpriteURL(e,r,i,n){let o=rE(e);return b(e)?(o.path=`/styles/v1${o.path}/sprite${r}${i}`,this._makeAPIURL(o,this._customAccessToken||n)):(o.path+=`${r}${i}`,rS(o))}normalizeTileURL(e,r,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!b(e))return e;let n=rE(e);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${r||i&&"raster"!==n.authority&&512===i?"@2x":""}${rs.supported?".webp":"$1"}`),"raster"===n.authority?n.path=`/${v.RASTER_URL_PREFIX}${n.path}`:"rasterarrays"===n.authority?n.path=`/${v.RASTERARRAYS_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${v.TILE_URL_VERSION}${n.path}`);let o=this._customAccessToken||function(e){for(let r of e){let e=r.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(n.params)||v.ACCESS_TOKEN;return v.REQUIRE_ACCESS_TOKEN&&o&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,o)}canonicalizeTileURL(e,r){let i=rE(e);if(!i.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!i.path.match(/\.[\w]+$/))return e;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${v.RASTER_URL_PREFIX}/`,"")}`:i.path.match(/^\/rasterarrays\/v1\//)?n+=`rasterarrays/${i.path.replace(`/${v.RASTERARRAYS_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${v.TILE_URL_VERSION}/`,"")}`;let o=i.params;return r&&(o=o.filter(e=>!e.match(/^access_token=/))),o.length&&(n+=`?${o.join("&")}`),n}canonicalizeTileset(e,r){let i=!!r&&b(r),n=[];for(let r of e.tiles||[])x(r)?n.push(this.canonicalizeTileURL(r,i)):n.push(r);return n}_makeAPIURL(e,r){let i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=rE(v.API_URL);if(e.protocol=n.protocol,e.authority=n.authority,"http"===e.protocol){let r=e.params.indexOf("secure");r>=0&&e.params.splice(r,1)}if("/"!==n.path&&(e.path=`${n.path}${e.path}`),!v.REQUIRE_ACCESS_TOKEN)return rS(e);if(r=r||v.ACCESS_TOKEN,!this._silenceAuthErrors){if(!r)throw Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===r[0])throw Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return e.params=e.params.filter(e=>-1===e.indexOf("access_token")),e.params.push(`access_token=${r||""}`),rS(e)}},e.dj=function(e,r){r?rz.add(e):rz.delete(e)},e.dk=rs,e.dl=rk,e.dm=rF,e.dn=rb,e.dp=rL,e.dq=rD,e.dr=function(e){rz.delete(e)},e.ds=rN,e.dt=rP,e.du=y,e.dv=function(e,r){rr=e,ri=r},e.dw=function(e,r,i=!1){if(at===o8||at===o9||at===o7)throw Error("setRTLTextPlugin cannot be called multiple times.");ar=t9.resolveURL(e),at=o8,ae=r,an(),i||as()},e.dx=aa,e.dy=function(){dU().acquire(dz)},e.dz=function(){let e=l;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(dz),l=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.e=tL,e.e0=al,e.e1=function(e){ro(),i&&i.then(r=>{r.keys().then(i=>{for(let n=0;n<i.length-e;n++)r.delete(i[n])})})},e.f=t9,e.g=function(e,r){return r_(tL(e,{type:"json"}),r)},e.h=ub,e.i=class extends dv{},e.j=iP,e.k=r4,e.l=function(e){return fetch(e).then(e=>e.arrayBuffer()).then(r=>d5(r,0,e))},e.m=oi,e.n=oo,e.o=om,e.p=h2,e.q=aE,e.r=ov,e.s=oa,e.t=og,e.u=aw,e.v=nm,e.w=tG,e.x=n_,e.y=nf}),o(["./shared"],function(e){function r(e){let r=e?e.url.toString():void 0;return r?performance.getEntriesByName(r):[]}class i{constructor(e){this.keyCache={},this._layers={},this._layerConfigs={},e&&this.replace(e)}replace(e,r){this._layerConfigs={},this._layers={},this.update(e,[],r)}update(r,i,n){for(let i of(this._options=n,r))this._layerConfigs[i.id]=i,(this._layers[i.id]=e.c7(i,this.scope,this._options)).compileFilter(),this.keyCache[i.id]&&delete this.keyCache[i.id];for(let e of i)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];for(let r of(this.familiesBySource={},function(r,i){let n={};for(let o=0;o<r.length;o++){let a=i&&i[r[o].id]||function(r){let i="";for(let n of e.b5)i+=`/${function e(r){if("number"==typeof r||"boolean"==typeof r||"string"==typeof r||null==r)return JSON.stringify(r);if(Array.isArray(r)){let i="[";for(let n of r)i+=`${e(n)},`;return`${i}]`}let i="{";for(let n of Object.keys(r).sort())i+=`${n}:${e(r[n])},`;return`${i}}`}(r[n])}`;return i}(r[o]);i&&(i[r[o].id]=a);let s=n[a];s||(s=n[a]=[]),s.push(r[o])}let o=[];for(let e in n)o.push(n[e]);return o}(e.b2(this._layerConfigs),this.keyCache))){let e=r.map(e=>this._layers[e.id]),i=e[0];if("none"===i.visibility)continue;let n=i.source||"",o=this.familiesBySource[n];o||(o=this.familiesBySource[n]={});let a=i.sourceLayer||"_geojsonTileLayer",s=o[a];s||(s=o[a]=[]),s.push(e)}}}let n=+e.dJ;class o{constructor(r){const i={},o=[];for(const e in r){const a=r[e],s=i[e]={};for(const e in a.glyphs){const r=a.glyphs[+e];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const i=r.metrics.localGlyph?n:1,l={x:0,y:0,w:r.bitmap.width+2*i,h:r.bitmap.height+2*i};o.push(l),s[e]=l}}const{w:a,h:s}=e.p(o),l=new e.dI({width:a||1,height:s||1});for(const o in r){const a=r[o];for(const r in a.glyphs){const s=a.glyphs[+r];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const u=i[o][r],c=s.metrics.localGlyph?n:1;e.dI.copy(s.bitmap,l,{x:0,y:0},{x:u.x+c,y:u.y+c},s.bitmap)}}this.image=l,this.positions=i}}e.dH(o,"GlyphAtlas");class a{constructor(r){this.tileID=new e.ap(r.tileID.overscaledZ,r.tileID.wrap,r.tileID.canonical.z,r.tileID.canonical.x,r.tileID.canonical.y),this.tileZoom=r.tileZoom,this.uid=r.uid,this.zoom=r.zoom,this.canonical=r.tileID.canonical,this.pixelRatio=r.pixelRatio,this.tileSize=r.tileSize,this.source=r.source,this.scope=r.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=r.showCollisionBoxes,this.collectResourceTiming=!!r.collectResourceTiming,this.promoteId=r.promoteId,this.isSymbolTile=r.isSymbolTile,this.tileTransform=e.av(r.tileID.canonical,r.projection),this.projection=r.projection,this.brightness=r.brightness,this.extraShadowCaster=!!r.extraShadowCaster}parse(r,i,n,a,l){let u,c,h,p;this.status="parsing",this.data=r,this.collisionBoxArray=new e.aG;let d=new e.dK(Object.keys(r.layers).sort()),f=new e.dL(this.tileID,this.promoteId);f.bucketLayerIDs=[];let m={},g=new e.dM(256,256),_={featureIndex:f,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:g,availableImages:n,brightness:this.brightness},y=i.familiesBySource[this.source];for(let i in y){let o=r.layers[i];if(!o)continue;let a=!1,l=!1,u=!1;for(let e of y[i])"symbol"===e[0].type?a=!0:l=!0,e[0].is3D()&&"model"!==e[0].type&&(u=!0);if(this.extraShadowCaster&&!u||!0===this.isSymbolTile&&!a||!1===this.isSymbolTile&&!l)continue;1===o.version&&e.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let c=d.encode(i),h=[];for(let e=0;e<o.length;
15e++){let r=o.feature(e),n=f.getId(r,i);h.push({feature:r,id:n,index:e,sourceLayerIndex:c})}for(let e of y[i]){let r=e[0];(!this.extraShadowCaster||r.is3D()&&"model"!==r.type)&&(void 0!==this.isSymbolTile&&"symbol"===r.type!==this.isSymbolTile||r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(s(e,this.zoom,_.brightness,n),(m[r.id]=r.createBucket({index:f.bucketLayerIDs.length,layers:e,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:c,sourceID:this.source,projection:this.projection.spec})).populate(h,_,this.tileID.canonical,this.tileTransform),f.bucketLayerIDs.push(e.map(e=>e.id))))}}g.trim();let v={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},x=()=>{if(u)return this.status="done",l(u);if(this.extraShadowCaster)this.status="done",l(null,{buckets:e.b2(m).filter(e=>!e.isEmpty()),featureIndex:f,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:_.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(c&&h&&p){let r=new o(c),i=new e.dO(h,p);for(let o in m){let a=m[o];a instanceof e.aH?(s(a.layers,this.zoom,_.brightness,n),e.dP(a,c,r.positions,h,i.iconPositions,this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection,this.brightness)):a.hasPattern&&(a instanceof e.aN||a instanceof e.aO||a instanceof e.cO)&&(s(a.layers,this.zoom,_.brightness,n),a.addFeatures(_,this.tileID.canonical,i.patternPositions,n,this.tileTransform,this.brightness))}this.status="done",l(null,{buckets:e.b2(m).filter(e=>!e.isEmpty()),featureIndex:f,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:r.image,lineAtlas:g,imageAtlas:i,brightness:_.brightness})}};if(!this.extraShadowCaster){let r=e.dN(_.glyphDependencies,e=>Object.keys(e).map(Number));Object.keys(r).length?a.send("getGlyphs",{uid:this.uid,stacks:r,scope:this.scope},(e,r)=>{u||(u=e,c=r,x())},void 0,!1,v):c={};let i=Object.keys(_.iconDependencies);i.length?a.send("getImages",{icons:i,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},(e,r)=>{u||(u=e,h=r,x())},void 0,!1,v):h={};let n=Object.keys(_.patternDependencies);n.length?a.send("getImages",{icons:n,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},(e,r)=>{u||(u=e,p=r,x())},void 0,!1,v):p={}}x()}}function s(r,i,n,o){let a=new e.N(i,{brightness:n});for(let e of r)e.recalculate(a,o)}class l extends e.E{constructor(r,i,n,o,a,s){super(),this.actor=r,this.layerIndex=i,this.availableImages=n,this.loadVectorData=a||e.ak,this.loading={},this.loaded={},this.deduped=new e.ai(r.scheduler),this.isSpriteLoaded=o,this.scheduler=r.scheduler,this.brightness=s}loadTile(i,n){let o=i.uid,s=i&&i.request,l=s&&s.collectResourceTiming,u=this.loading[o]=new a(i);u.abort=this.loadVectorData(i,(a,c)=>{let h=!this.loading[o];if(delete this.loading[o],h||a||!c)return u.status="done",h||(this.loaded[o]=u),n(a);let p=c.rawData,d={};c.expires&&(d.expires=c.expires),c.cacheControl&&(d.cacheControl=c.cacheControl),u.vectorTile=c.vectorTile||new e.dQ(new e.dR(p));let f=()=>{u.parse(u.vectorTile,this.layerIndex,this.availableImages,this.actor,(i,o)=>{if(i||!o)return n(i);let a={};if(l){let e=r(s);e.length>0&&(a.resourceTiming=JSON.parse(JSON.stringify(e)))}n(null,e.e({rawTileData:p.slice(0)},o,d,a))})};this.isSpriteLoaded?f():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(f,{type:"parseTile",isSymbolTile:i.isSymbolTile,zoom:i.tileZoom}
15):f()}),this.loaded=this.loaded||{},this.loaded[o]=u})}reloadTile(r,i){let n=this.loaded,o=r.uid,a=this;if(n&&n[o]){let s=n[o];s.showCollisionBoxes=r.showCollisionBoxes,s.projection=r.projection,s.brightness=r.brightness,s.tileTransform=e.av(r.tileID.canonical,r.projection),s.extraShadowCaster=r.extraShadowCaster;let l=(e,r)=>{let n=s.reloadCallback;n&&(delete s.reloadCallback,s.parse(s.vectorTile,a.layerIndex,this.availableImages,a.actor,n)),i(e,r)};"parsing"===s.status?s.reloadCallback=l:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,l):l())}else i(null,void 0)}abortTile(e,r){let i=e.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),r()}removeTile(e,r){let i=this.loaded,n=e.uid;i&&i[n]&&delete i[n],r()}}class u{loadTile(r,i){let{uid:n,encoding:o,rawImageData:a,padding:s}=r,l=ImageBitmap&&a instanceof ImageBitmap?this.getImageData(a,s):a;i(null,new e.dS(n,l,o,s<1))}getImageData(e,r){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);let i=this.offscreenCanvasContext.getImageData(-r,-r,e.width+2*r,e.height+2*r);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),i}}class c{decodeRasterArray({task:r,buffer:i},n){e.b0.performDecoding(i,r).then(e=>{n(null,e)},e=>{n(e)})}}let h=e.dT.prototype.toGeoJSON,p=class{constructor(r){this._feature=r,this.extent=e.Y,this.type=r.type,this.properties=r.tags,"id"in r&&!isNaN(r.id)&&(this.id=parseInt(r.id,10))}loadGeometry(){if(1===this._feature.type){let r=[];for(let i of this._feature.geometry)r.push([new e.P(i[0],i[1])]);return r}{let r=[];for(let i of this._feature.geometry){let n=[];for(let r of i)n.push(new e.P(r[0],r[1]));r.push(n)}return r}}toGeoJSON(e,r,i){return h.call(this,e,r,i)}},d=class{constructor(r){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.Y,this.length=r.length,this._features=r}feature(e){return new p(this._features[e])}};var f,m={exports:{}},g=e.dV,_=e.dU.VectorTileFeature;function y(e,r){this.options=r||{},this.features=e,this.length=e.length}function v(e,r){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=r||4096}y.prototype.feature=function(e){return new v(this.features[e],this.options.extent)},v.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var i=e[r],n=[],o=0;o<i.length;o++)n.push(new g(i[o][0],i[o][1]));this.geometry.push(n)}return this.geometry},v.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,r=1/0,i=-1/0,n=1/0,o=-1/0,a=0;a<e.length;a++)for(var s=e[a],l=0;l<s.length;l++){var u=s[l];r=Math.min(r,u.x),i=Math.max(i,u.x),n=Math.min(n,u.y),o=Math.max(o,u.y)}return[r,n,i,o]},v.prototype.toGeoJSON=_.prototype.toGeoJSON;var x=e.dW;function b(e){var r=new x;return function(e,r){for(var i in e.layers)r.writeMessage(3,w,e.layers[i])}(e,r),r.finish()}function w(e,r){r.writeVarintField(15,e.version||1),r.writeStringField(1,e.name||""),r.writeVarintField(5,e.extent||4096);var i,n={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<e.length;i++)n.feature=e.feature(i),r.writeMessage(2,E,n);var o=n.keys;for(i=0;i<o.length;i++)r.writeStringField(3,o[i]);var a=n.values;for(i=0;i<a.length;i++)r.writeMessage(4,I,a[i])}function E(e,r){var i=e.feature;void 0!==i.id&&r.writeVarintField(1,i.id),r.writeMessage(2,S,e),r.writeVarintField(3,i.type),r.writeMessage(4,T,i)}function S(e,r){var i=e.feature,n=e.keys,o=e.values,a=e.keycache,s=e.valuecache;for(var l in i.properties){var u=i.properties[l],c=a[l];if(null!==u){void 0===c&&(n.push(l),a[l]=c=n.length-1),r.writeVarint(c);var h=typeof u;"string"!==h&&"boolean"!==h&&"number"!==h&&(u=JSON.stringify(u));var p=h+":"+u,d=s[p];void 0===d&&(o.push(u),s[p]=d=o.length-1),r.writeVarint(d)}}}function T(e,r){for(var i=e.loadGeometry(),n=e.type,o=0,a=0,s=i.length,l=0;l<s;l++){var u=i[l],c=1;1===n&&(c=u.length),r.writeVarint((c<<3)+1);for(var h=3===n?u.length-1:u.length,p=0;p<h;p++){1===p&&1!==n&&r.writeVarint((h-1<<3)+2);var d=u[p].x-o,f=u[p].y-a;r.writeVarint(d<<1^d>>31),r.writeVarint(f<<1^f>>31),o+=d,a+=f}3===n&&r.writeVarint(15)}}function I(e,r){var i=typeof e;"string"===i?r.writeStringField(1,e):"boolean"===i?r.writeBooleanField(7,e):"number"===i&&(e%1!=0?r.writeDoubleField(3,e):e<0?r.writeSVarintField(6,e):r.writeVarintField(5,e))}m.exports=b,m.exports.fromVectorTileJs=b,m.exports.fromGeojsonVt=function(e,r){r=r||{};var i={};for(var n in e)i[n]=new y(e[n].features,r),i[n].name=n,i[n].version=r.version,i[n].extent=r.extent;return b({layers:i})},m.exports.GeoJSONWrapper=y;var M=e.dX(m.exports);let C={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},A=Math.fround||(f=new Float32Array(1),e=>(f[0]=+e,f[0]));class P{constructor(e){this.options=Object.assign(Object.create(C),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:r,minZoom:i,maxZoom:n}=this.options;r&&console.time("total time");let o=`prepare ${e.length} points`;r&&console.time(o),this.points=e;let a=[];for(let r=0;r<e.length;r++){let i=e[r];if(!i.geometry)continue;let[n,o]=i.geometry.coordinates,s=A(D(n)),l=A(R(o));a.push(s,l,1/0,r,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[n+1]=this._createTree(a);r&&console.timeEnd(o);for(let e=n;e>=i;e--){let i=+Date.now();s=this.trees[e]=this._createTree(this._cluster(s,e)),r&&console.log("z%d: %d clusters in %dms",e,s.numItems,Date.now()-i)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let i=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),o=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,o=180;else if(i>o){let e=this.getClusters([i,n,180,a],r),s=this.getClusters([-180,n,o,a],r);return e.concat(s)}let s=this.trees[this._limitZoom(r)],l=s.range(D(i),R(a),D(o),R(n)),u=s.data,c=[];for(let e of l){let r=this.stride*e;c.push(u[r+5]>1?L(u,r,this.clusterProps):this.points[u[r+3]])}return c}getChildren(e){let r=this._getOriginId(e),i=this._getOriginZoom(e),n="No cluster with the specified id.",o=this.trees[i];if(!o)throw Error(n);let a=o.data;if(r*this.stride>=a.length)throw Error(n);let s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),l=o.within(a[r*this.stride],a[r*this.stride+1],s),u=[];for(let r of l){let i=r*this.stride;a[i+4]===e&&u.push(a[i+5]>1?L(a,i,this.clusterProps):this.points[a[i+3]])}if(0===u.length)throw Error(n);return u}getLeaves(e,r,i){let n=[];return this._appendLeaves(n,e,r=r||10,i=i||0,0),n}getTile(e,r,i){let n=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:s}=this.options,l=s/a,u=(i-l)/o,c=(i+1+l)/o,h={features:[]};return this._addTileFeatures(n.range((r-l)/o,u,(r+1+l)/o,c),n.data,r,i,o,h),0===r&&this._addTileFeatures(n.range(1-l/o,u,1,c),n.data,o,i,o,h),r===o-1&&this._addTileFeatures(n.range(0,u,l/o,c
15),n.data,-1,i,o,h),h.features.length?h:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){let i=this.getChildren(e);if(r++,1!==i.length)break;e=i[0].properties.cluster_id}return r}_appendLeaves(e,r,i,n,o){for(let a of this.getChildren(r)){let r=a.properties;if(r&&r.cluster?o+r.point_count<=n?o+=r.point_count:o=this._appendLeaves(e,r.cluster_id,i,n,o):o<n?o++:e.push(a),e.length===i)break}return o}_createTree(r){let i=new e.bj(r.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<r.length;e+=this.stride)i.add(r[e],r[e+1]);return i.finish(),i.data=r,i}_addTileFeatures(e,r,i,n,o,a){for(let s of e){let e,l,u,c,h=s*this.stride,p=r[h+5]>1;if(p)e=O(r,h,this.clusterProps),l=r[h],u=r[h+1];else{let i=this.points[r[h+3]];e=i.properties;let[n,o]=i.geometry.coordinates;l=D(n),u=R(o)}let d={type:1,geometry:[[Math.round(this.options.extent*(l*o-i)),Math.round(this.options.extent*(u*o-n))]],tags:e};void 0!==(c=p||this.options.generateId?r[h+3]:this.points[r[h+3]].id)&&(d.id=c),a.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){let{radius:i,extent:n,reduce:o,minPoints:a}=this.options,s=i/(n*Math.pow(2,r)),l=e.data,u=[],c=this.stride;for(let i=0;i<l.length;i+=c){if(l[i+2]<=r)continue;l[i+2]=r;let n=l[i],h=l[i+1],p=e.within(l[i],l[i+1],s),d=l[i+5],f=d;for(let e of p){let i=e*c;l[i+2]>r&&(f+=l[i+5])}if(f>d&&f>=a){let e,a=n*d,s=h*d,m=-1,g=(i/c<<5)+(r+1)+this.points.length;for(let n of p){let u=n*c;if(l[u+2]<=r)continue;l[u+2]=r;let h=l[u+5];a+=l[u]*h,s+=l[u+1]*h,l[u+4]=g,o&&(e||(e=this._map(l,i,!0),m=this.clusterProps.length,this.clusterProps.push(e)),o(e,this._map(l,u)))}l[i+4]=g,u.push(a/f,s/f,1/0,g,-1,f),o&&u.push(m)}else{for(let e=0;e<c;e++)u.push(l[i+e]);if(f>1)for(let e of p){let i=e*c;if(!(l[i+2]<=r)){l[i+2]=r;for(let e=0;e<c;e++)u.push(l[i+e])}}}}return u}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,i){if(e[r+5]>1){let n=this.clusterProps[e[r+6]];return i?Object.assign({},n):n}let n=this.points[e[r+3]].properties,o=this.options.map(n);return i&&o===n?Object.assign({},o):o}}function L(e,r,i){return{type:"Feature",id:e[r+3],properties:O(e,r,i),geometry:{type:"Point",coordinates:[360*(e[r]-.5),360*Math.atan(Math.exp((180-360*e[r+1])*Math.PI/180))/Math.PI-90]}}}function O(e,r,i){let n=e[r+5],o=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=e[r+6];return Object.assign(-1===a?{}:Object.assign({},i[a]),{cluster:!0,cluster_id:e[r+3],point_count:n,point_count_abbreviated:o})}function D(e){return e/360+.5}function R(e){let r=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return i<0?0:i>1?1:i}var k={exports:{}};k.exports=function(){function e(e,i,n,o){var a={id:void 0===e?null:e,type:i,geometry:n,tags:o,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var i=e.geometry,n=e.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)r(e,i);else if("Polygon"===n||"MultiLineString"===n)for(var o=0;o<i.length;o++)r(e,i[o]);else if("MultiPolygon"===n)for(o=0;o<i.length;o++)for(var a=0;a<i[o].length;a++)r(e,i[o][a])}(a),a}function r(e,r){for(var i=0;i<r.length;i+=3)e.minX=Math.min(e.minX,r[i]),e.minY=Math.min(e.minY,r[i+1]),e.maxX=Math.max(e.maxX,r[i]),e.maxY=Math.max(e.maxY,r[i+1])}function i(r,s,l,u){if(s.geometry){var c=s.geometry.coordinates,h=s.geometry.type,p=Math.pow(l.tolerance/((1<<l.maxZoom)*l.extent),2),d=[],f=s.id;if(l.promoteId?f=s.properties[l.promoteId]:l.generateId&&(f=u||0),"Point"===h)n(c,d);else if("MultiPoint"===h)for(var m=0;m<c.length;m++)n(c[m],d);else if("LineString"===h)o(c,d,p,!1);else if("MultiLineString"===h){if(l.lineMetrics){for(m=0;m<c.length;m++)o(c[m],d=[],p,!1),r.push(e(f,"LineString",d,s.properties));return}a(c,d,p,!1)}else if("Polygon"===h)a(c,d,p,!0);else{if("MultiPolygon"!==h){if("GeometryCollection"===h){for(m=0;m<s.geometry.geometries.length;m++)i(r,{id:f,geometry:s.geometry.geometries[m],properties:s.properties},l,u);return}throw Error("Input data is not a valid GeoJSON object.")}for(m=0;m<c.length;m++){var g=[];a(c[m],g,p,!0),d.push(g)}}r.push(e(f,h,d,s.properties))}}
vendor: 3,288 bytes, line 15
15function n(e,r){r.push(e[0]/360+.5),r.push(s(e[1])),r.push(0)}function o(e,r,i,n){for(var o,a,l=0,u=0;u<e.length;u++){var c=e[u][0]/360+.5,h=s(e[u][1]);r.push(c),r.push(h),r.push(0),u>0&&(l+=n?(o*h-c*a)/2:Math.sqrt(Math.pow(c-o,2)+Math.pow(h-a,2))),o=c,a=h}var p=r.length-3;r[2]=1,function e(r,i,n,o){for(var a,s=o,l=n-i>>1,u=n-i,c=r[i],h=r[i+1],p=r[n],d=r[n+1],f=i+3;f<n;f+=3){var m=function(e,r,i,n,o,a){var s=o-i,l=a-n;if(0!==s||0!==l){var u=((e-i)*s+(r-n)*l)/(s*s+l*l);u>1?(i=o,n=a):u>0&&(i+=s*u,n+=l*u)}return(s=e-i)*s+(l=r-n)*l}(r[f],r[f+1],c,h,p,d);if(m>s)a=f,s=m;else if(m===s){var g=Math.abs(f-l);g<u&&(a=f,u=g)}}s>o&&(a-i>3&&e(r,i,a,o),r[a+2]=s,n-a>3&&e(r,a,n,o))}(r,0,p,i),r[p+2]=1,r.size=Math.abs(l),r.start=0,r.end=r.size}function a(e,r,i,n){for(var a=0;a<e.length;a++){var s=[];o(e[a],s,i,n),r.push(s)}}function s(e){var r=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return i<0?0:i>1?1:i}function l(r,i,n,o,a,s,l,c){if(o/=i,s>=(n/=i)&&l<o)return r;if(l<n||s>=o)return null;for(var p=[],d=0;d<r.length;d++){var f=r[d],m=f.geometry,g=f.type,_=0===a?f.minX:f.minY,y=0===a?f.maxX:f.maxY;if(_>=n&&y<o)p.push(f);else if(!(y<n||_>=o)){var v=[];if("Point"===g||"MultiPoint"===g){for(var x=m,b=v,w=n,E=o,S=a,T=0;T<x.length;T+=3){var I=x[T+S];I>=w&&I<=E&&(b.push(x[T]),b.push(x[T+1]),b.push(x[T+2]))}}else if("LineString"===g)u(m,v,n,o,a,!1,c.lineMetrics);else if("MultiLineString"===g)h(m,v,n,o,a,!1);else if("Polygon"===g)h(m,v,n,o,a,!0);else if("MultiPolygon"===g)for(var M=0;M<m.length;M++){var C=[];h(m[M],C,n,o,a,!0),C.length&&v.push(C)}if(v.length){if(c.lineMetrics&&"LineString"===g){for(M=0;M<v.length;M++)p.push(e(f.id,g,v[M],f.tags));continue}"LineString"!==g&&"MultiLineString"!==g||(1===v.length?(g="LineString",v=v[0]):g="MultiLineString"),"Point"!==g&&"MultiPoint"!==g||(g=3===v.length?"Point":"MultiPoint"),p.push(e(f.id,g,v,f.tags))}}}return p.length?p:null}function u(e,r,i,n,o,a,s){for(var l,u,h=c(e),m=0===o?d:f,g=e.start,_=0;_<e.length-3;_+=3){var y=e[_],v=e[_+1],x=e[_+2],b=e[_+3],w=e[_+4],E=0===o?y:v,S=0===o?b:w,T=!1;s&&(l=Math.sqrt(Math.pow(y-b,2)+Math.pow(v-w,2))),E<i?S>i&&(u=m(h,y,v,b,w,i),s&&(h.start=g+l*u)):E>n?S<n&&(u=m(h,y,v,b,w,n),s&&(h.start=g+l*u)):p(h,y,v,x),S<i&&E>=i&&(u=m(h,y,v,b,w,i),T=!0),S>n&&E<=n&&(u=m(h,y,v,b,w,n),T=!0),!a&&T&&(s&&(h.end=g+l*u),r.push(h),h=c(e)),s&&(g+=l)}var I=e.length-3;y=e[I],v=e[I+1],x=e[I+2],(E=0===o?y:v)>=i&&E<=n&&p(h,y,v,x),I=h.length-3,a&&I>=3&&(h[I]!==h[0]||h[I+1]!==h[1])&&p(h,h[0],h[1],h[2]),h.length&&r.push(h)}function c(e){var r=[];return r.size=e.size,r.start=e.start,r.end=e.end,r}function h(e,r,i,n,o,a){for(var s=0;s<e.length;s++)u(e[s],r,i,n,o,a,!1)}function p(e,r,i,n){e.push(r),e.push(i),e.push(n)}function d(e,r,i,n,o,a){var s=(a-r)/(n-r);return e.push(a),e.push(i+(o-i)*s),e.push(1),s}function f(e,r,i,n,o,a){var s=(a-i)/(o-i);return e.push(r+(n-r)*s),e.push(a),e.push(1),s}function m(r,i){for(var n=[],o=0;o<r.length;o++){var a,s=r[o],l=s.type;if("Point"===l||"MultiPoint"===l||"LineString"===l)a=g(s.geometry,i);else if("MultiLineString"===l||"Polygon"===l){a=[];for(var u=0;u<s.geometry.length;u++)a.push(g(s.geometry[u],i))}else if("MultiPolygon"===l)for(a=[],u=0;u<s.geometry.length;u++){for(var c=[],h=0;h<s.geometry[u].length;h++)c.push(g(s.geometry[u][h],i));a.push(c)}
vendor: 5,381 bytes, line 15
15n.push(e(s.id,l,a,s.tags))}return n}function g(e,r){var i=[];i.size=e.size,void 0!==e.start&&(i.start=e.start,i.end=e.end);for(var n=0;n<e.length;n+=3)i.push(e[n]+r,e[n+1],e[n+2]);return i}function _(e,r){if(e.transformed)return e;var i,n,o,a=1<<e.z,s=e.x,l=e.y;for(i=0;i<e.features.length;i++){var u=e.features[i],c=u.geometry,h=u.type;if(u.geometry=[],1===h)for(n=0;n<c.length;n+=2)u.geometry.push(y(c[n],c[n+1],r,a,s,l));else for(n=0;n<c.length;n++){var p=[];for(o=0;o<c[n].length;o+=2)p.push(y(c[n][o],c[n][o+1],r,a,s,l));u.geometry.push(p)}}return e.transformed=!0,e}function y(e,r,i,n,o,a){return[Math.round(i*(e*n-o)),Math.round(i*(r*n-a))]}function v(e,r,i,n,o,a){var s=n*n;if(n>0&&r.size<(o?s:n))i.numPoints+=r.length/3;else{for(var l=[],u=0;u<r.length;u+=3)(0===n||r[u+2]>s)&&(i.numSimplified++,l.push(r[u]),l.push(r[u+1])),i.numPoints++;o&&function(e,r){for(var i=0,n=0,o=e.length,a=o-2;n<o;a=n,n+=2)i+=(e[n]-e[a])*(e[n+1]+e[a+1]);if(i>0===r)for(n=0,o=e.length;n<o/2;n+=2){var s=e[n],l=e[n+1];e[n]=e[o-2-n],e[n+1]=e[o-1-n],e[o-2-n]=s,e[o-1-n]=l}}(l,a),e.push(l)}}function x(e,r){var n,o,a,s,u,c,h=(r=this.options=function(e,r){for(var i in r)e[i]=r[i];return e}(Object.create(this.options),r)).debug;if(h&&console.time("preprocess data"),r.maxZoom<0||r.maxZoom>24)throw Error("maxZoom should be in the 0-24 range");if(r.promoteId&&r.generateId)throw Error("promoteId and generateId cannot be used together.");var p=function(e,r){var n=[];if("FeatureCollection"===e.type)for(var o=0;o<e.features.length;o++)i(n,e.features[o],r,o);else i(n,"Feature"===e.type?e:{geometry:e},r);return n}(e,r);this.tiles={},this.tileCoords=[],h&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",r.indexMaxZoom,r.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=p,a=(o=r).buffer/o.extent,s=n,u=l(n,1,-1-a,a,0,-1,2,o),c=l(n,1,1-a,2+a,0,-1,2,o),(u||c)&&(s=l(n,1,-a,1+a,0,-1,2,o)||[],u&&(s=m(u,1).concat(s)),c&&(s=s.concat(m(c,-1)))),p=s).length&&this.splitTile(p,0,0,0),h&&(p.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function b(e,r,i){return 32*((1<<e)*i+r)+e}return x.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},x.prototype.splitTile=function(e,r,i,n,o,a,s){for(var u=[e,r,i,n],c=this.options,h=c.debug;u.length;){n=u.pop(),i=u.pop(),r=u.pop(),e=u.pop();var p=1<<r,d=b(r,i,n),f=this.tiles[d];if(!f&&(h>1&&console.time("creation"),f=this.tiles[d]=function(e,r,i,n,o){for(var a=r===o.maxZoom?0:o.tolerance/((1<<r)*o.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z:r,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},l=0;l<e.length;l++){s.numFeatures++,function(e,r,i,n){var o=r.geometry,a=r.type,s=[];if("Point"===a||"MultiPoint"===a)for(var l=0;l<o.length;l+=3)s.push(o[l]),s.push(o[l+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)v(s,o,e,i,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(l=0;l<o.length;l++)v(s,o[l],e,i,"Polygon"===a,0===l);else if("MultiPolygon"===a)for(var u=0;u<o.length;u++){var c=o[u];for(l=0;l<c.length;l++)v(s,c[l],e,i,!0,0===l)}if(s.length){var h=r.tags||null;if("LineString"===a&&n.lineMetrics){for(var p in h={},r.tags)h[p]=r.tags[p];h.mapbox_clip_start=o.start/o.size,h.mapbox_clip_end=o.end/o.size}var d={geometry:s,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:h};null!==r.id&&(d.id=r.id),e.features.push(d)}}(s,e[l],a,o);var u=e[l].minX,c=e[l].minY,h=e[l].maxX,p=e[l].maxY;u<s.minX&&(s.minX=u),c<s.minY&&(s.minY=c),h>s.maxX&&(s.maxX=h),p>s.maxY&&(s.maxY=p)}return s}(e,r,i,n,c),this.tileCoords.push({z:r,x:i,y:n}),h)){h>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",r,i,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var m="z"+r;this.stats[m]=(this.stats[m]||0)+1,this.total++}if(f.source=e,o){if(r===c.maxZoom||r===o)continue;var g=1<<o-r;if(i!==Math.floor(a/g)||n!==Math.floor(s/g))continue}else if(r===c.indexMaxZoom||f.numPoints<=c.indexMaxPoints)continue;if(f.source=null,0!==e.length){h>1&&console.time("clipping");var _,y,x,w,E,S,T=.5*c.buffer/c.extent,I=.5-T,M=.5+T,C=1+T;_=y=x=w=null,E=l(e,p,i-T,i+M,0,f.minX,f.maxX,c),S=l(e,p,i+I,i+C,0,f.minX,f.maxX,c),e=null,E&&(_=l(E,p,n-T,n+M,1,f.minY,f.maxY,c),y=l(E,p,n+I,n+C,1,f.minY,f.maxY,c),E=null),S&&(x=l(S,p,n-T,n+M,1,f.minY,f.maxY,c),w=l(S,p,n+I,n+C,1,f.minY,f.maxY,c),S=null),h>1&&console.timeEnd("clipping"),u.push(_||[],r+1,2*i,2*n),u.push(y||[],r+1,2*i,2*n+1),u.push(x||[],r+1,2*i+1,2*n),u.push(w||[],r+1,2*i+1,2*n+1)}}},x.prototype.getTile=function(e,r,i){var n=this.options,o=n.extent,a=n.debug;if(e<0||e>24)return null;var s=1<<e,l=b(e,r=(r%s+s)%s,i);if(this.tiles[l])return _(this.tiles[l],o);a>1&&console.log("drilling down to z%d-%d-%d",e,r,i);for(var u,c=e,h=r,p=i;!u&&c>0;)c--,h=Math.floor(h/2),p=Math.floor(p/2),u=this.tiles[b(c,h,p)];return u&&u.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,h,p),a>1&&console.time("drilling down"),this.splitTile(u.source,c,h,p,e,r,i),a>1&&console.timeEnd("drilling down"),this.tiles[l]?_(this.tiles[l],o):null):null},function(e,r){return new x(e,r)}}();
15var N=e.dX(k.exports);function F(e,r){let i=e.tileID.canonical;if(!this._geoJSONIndex)return r(null,null);let n=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!n)return r(null,null);let o=new d(n.features),a=M(o);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),r(null,{vectorTile:o,rawData:a.buffer})}class z extends l{constructor(e,r,i,n,o,a){super(e,r,i,n,F,a),o&&(this.loadGeoJSON=o),this._featureMap=new Map}loadData(i,n){let o=i&&i.request,a=o&&o.collectResourceTiming;this.loadGeoJSON(i,(s,l)=>{if(s||!l)return n(s);if("object"!=typeof l)return n(Error(`Input data given to '${i.source}' is not a valid GeoJSON object.`));{try{if(i.filter){let r=e.t(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));l.features=l.features.filter(e=>r.value.evaluate({zoom:0},e))}if(i.dynamic){for(let e of("Feature"===l.type&&(l={type:"FeatureCollection",features:[l]}),i.append||this._featureMap.clear(),l.features||[])){let r=e.id;void 0!==r&&(e.geometry?this._featureMap.set(r,e):this._featureMap.delete(r))}l.features=[...this._featureMap.values()]}this._geoJSONIndex=i.cluster?new P(function({superclusterOptions:r,clusterProperties:i}){if(!i||!r)return r;let n={},o={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(i);for(let r of l){let[a,s]=i[r],l=e.t(s),u=e.t("string"==typeof a?[a,["accumulated"],["get",r]]:a);n[r]=l.value,o[r]=u.value}return r.map=e=>{s.properties=e;let r={};for(let e of l)r[e]=n[e].evaluate(a,s);return r},r.reduce=(e,r)=>{for(let i of(s.properties=r,l))a.accumulated=e[i],e[i]=o[i].evaluate(a,s)},r}(i)).load(l.features):N(l,i.geojsonVtOptions)}catch(e){return n(e)}this.loaded={};let s={};if(a){let e=r(o);e&&(s.resourceTiming={},s.resourceTiming[i.source]=JSON.parse(JSON.stringify(e)))}n(null,s)}})}reloadTile(e,r){let i=this.loaded;return i&&i[e.uid]?super.reloadTile(e,r):this.loadTile(e,r)}loadGeoJSON(r,i){if(r.request)e.g(r.request,i);else{if("string"!=typeof r.data)return i(Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`));try{return i(null,JSON.parse(r.data))}catch(e){return i(Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(e,r){try{r(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){r(e)}}getClusterChildren(e,r){try{r(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){r(e)}}getClusterLeaves(e,r){try{r(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){r(e)}}}class B{constructor(r,i){this.tileID=new e.ap(r.tileID.overscaledZ,r.tileID.wrap,r.tileID.canonical.z,r.tileID.canonical.x,r.tileID.canonical.y),this.tileZoom=r.tileZoom,this.uid=r.uid,this.zoom=r.zoom,this.canonical=r.tileID.canonical,this.pixelRatio=r.pixelRatio,this.tileSize=r.tileSize,this.source=r.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=r.projection,this.brightness=i}parse(r,i,n,o){this.status="parsing";let a=new e.ap(n.tileID.overscaledZ,n.tileID.wrap,n.tileID.canonical.z,n.tileID.canonical.x,n.tileID.canonical.y),s={},l=i.familiesBySource[n.source],u=new e.dL(a,n.promoteId);return u.bucketLayerIDs=[],u.is3DTile=!0,e.dY(r).then(r=>{if(!r)return o(Error("Could not parse tile"));let i=e.dZ(r,1/e.bU(n.tileID.canonical)),c=r.json.extensionsUsed&&r.json.extensionsUsed.includes("MAPBOX_mesh_features")||r.json.asset.extras&&r.json.asset.extras.MAPBOX_mesh_features,h=r.json.extensionsUsed&&r.json.extensionsUsed.includes("EXT_meshopt_compression"),p=new e.N(this.zoom,{brightness:this.brightness});for(let r in l)for(let n of l[r]){let r=n[0];u.bucketLayerIDs.push(n.map(e=>e.id)),r.recalculate(p,[]);let o=new e.d_(i,a,c,h,this.brightness,u);c||(o.needsUpload=!0),s[r.fqid]=o,o.evaluate(r)}this.status="done",o(null,{buckets:s,featureIndex:u})}).catch(e=>o(Error(e.message)))}}class U{constructor(e,r,i,n,o,a){this.actor=e,this.layerIndex=r,this.brightness=a,this.loading={},this.loaded={}}loadTile(r,i){let n=r.uid,o=this.loading[n]=new B(r,this.brightness);e.b1(r.request,(e,a)=>{let s=!this.loading[n];return delete this.loading[n],s||e?(o.status="done",s||(this.loaded[n]=o),i(e)):a&&0!==a.byteLength?void o.parse(a,this.layerIndex,r,(e,r)=>{o.status="done",this.loaded=this.loaded||{},this.loaded[n]=o,e||!r?i(e):i(null,r)}
15):(o.status="done",this.loaded[n]=o,i())})}reloadTile(e,r){let i=this.loaded,n=e.uid;if(i&&i[n]){let o=i[n];o.projection=e.projection,o.brightness=e.brightness;let a=(i,n)=>{o.reloadCallback&&(delete o.reloadCallback,this.loadTile(e,r)),r(i,n)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&this.loadTile(e,r)}}abortTile(e,r){let i=e.uid;this.loading[i]&&delete this.loading[i],r()}removeTile(e,r){let i=this.loaded,n=e.uid;i&&i[n]&&delete i[n],r()}}class j{constructor(r){this.self=r,this.actor=new e.d$(r,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=e.br({name:"mercator"}),this.workerSourceTypes={vector:l,geojson:z,"batched-model":U},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,r)=>{if(this.workerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=r},this.self.registerRTLTextPlugin=r=>{if(e.e0.isParsed())throw Error("RTL text plugin already registered.");e.e0.applyArabicShaping=r.applyArabicShaping,e.e0.processBidirectionalText=r.processBidirectionalText,e.e0.processStyledBidirectionalText=r.processStyledBidirectionalText}}clearCaches(e,r,i){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],delete this.rasterArrayWorkerSource,i()}checkIfReady(e,r,i){i()}setReferrer(e,r){this.referrer=r}spriteLoaded(r,{scope:i,isLoaded:n}){if(this.isSpriteLoaded[r]||(this.isSpriteLoaded[r]={}),this.isSpriteLoaded[r][i]=n,this.workerSources[r]&&this.workerSources[r][i])for(let o in this.workerSources[r][i]){let a=this.workerSources[r][i][o];for(let r in a)a[r]instanceof l&&(a[r].isSpriteLoaded=n,a[r].fire(new e.b("isSpriteLoaded")))}}setImages(e,{scope:r,images:i},n){if(this.availableImages[e]||(this.availableImages[e]={}),this.availableImages[e][r]=i,this.workerSources[e]&&this.workerSources[e][r]){for(let n in this.workerSources[e][r]){let o=this.workerSources[e][r][n];for(let e in o)o[e].availableImages=i}n()}else n()}setProjection(r,i){this.projections[r]=e.br(i)}setBrightness(e,r,i){this.brightness=r,i()}setLayers(e,r,i){this.getLayerIndex(e,r.scope).replace(r.layers,r.options),i()}updateLayers(e,r,i){this.getLayerIndex(e,r.scope).update(r.layers,r.removedIds,r.options),i()}loadTile(e,r,i){r.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,r.type,r.source,r.scope).loadTile(r,i)}loadDEMTile(e,r,i){this.getDEMWorkerSource(e,r.source,r.scope).loadTile(r,i)}decodeRasterArray(e,r,i){this.getRasterArrayWorkerSource().decodeRasterArray(r,i)}reloadTile(e,r,i){r.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,r.type,r.source,r.scope).reloadTile(r,i)}abortTile(e,r,i){this.getWorkerSource(e,r.type,r.source,r.scope).abortTile(r,i)}removeTile(e,r,i){this.getWorkerSource(e,r.type,r.source,r.scope).removeTile(r,i)}removeSource(e,r,i){if(!(this.workerSources[e]&&this.workerSources[e][r.scope]&&this.workerSources[e][r.scope][r.type]&&this.workerSources[e][r.scope][r.type][r.source]))return;let n=this.workerSources[e][r.scope][r.type][r.source];delete this.workerSources[e][r.scope][r.type][r.source],void 0!==n.removeSource?n.removeSource(r,i):i()}loadWorkerSource(e,r,i){try{this.self.importScripts(r.url),i()}catch(e){i(e.toString())}}syncRTLPluginState(r,i,n){try{e.e0.setState(i);let r=e.e0.getPluginURL();if(e.e0.isLoaded()&&!e.e0.isParsed()&&null!=r){this.self.importScripts(r);let i=e.e0.isParsed();n(i?void 0:Error(`RTL Text Plugin failed to import scripts from ${r}`),i)}}catch(e){n(e.toString())}}setDracoUrl(e,r){this.dracoUrl=r}getAvailableImages(e,r){this.availableImages[e]||(this.availableImages[e]={});let i=this.availableImages[e][r];return i||(i=[]),i}getLayerIndex(e,r){this.layerIndexes[e]||(this.layerIndexes[e]={});let n=this.layerIndexes[e][r];return n||((n=this.layerIndexes[e][r]=new i).scope=r),n}getWorkerSource(e,r,i,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][n]||(this.workerSources[e][n]={}),this.workerSources[e][n][r]||(this.workerSources[e][n][r]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),!this.workerSources[e][n][r][i]){let o={send:(r,i,n,o,a,s)=>{this.actor.send(r,i,n,e,a,s)},scheduler:this.actor.scheduler};this.workerSources[e][n][r][i]=new this.workerSourceTypes[r](o,this.getLayerIndex(e,n),this.getAvailableImages(e,n),this.isSpriteLoaded[e][n],void 0,this.brightness)}return this.workerSources[e][n][r][i]}getDEMWorkerSource(e,r,i){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][i]||(this.demWorkerSources[e][i]={}),this.demWorkerSources[e][i][r]||(this.demWorkerSources[e][i][r]=new u),this.demWorkerSources[e][i][r]}getRasterArrayWorkerSource(){return this.rasterArrayWorkerSource||(this.rasterArrayWorkerSource=new c),this.rasterArrayWorkerSource}enforceCacheSizeLimit(r,i){e.e1(i)}getWorkerPerformanceMetrics(e,r,i){i(void 0,void 0)}}return"u">typeof WorkerGlobalScope&&"u">typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new j(self)),j}),o(["./shared"],function(e){let r,i;function n(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],r[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r||Object.keys(e).length!==Object.keys(r).length)return!1;for(let i in e)if(!n(e[i],r[i]))return!1;return!0}return e===r}function o(e){var r;
15return!("u"<typeof window)&&!("u"<typeof document)&&!!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,r,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{r=new Worker(n),e=!0}catch(r){e=!1}return r&&r.terminate(),URL.revokeObjectURL(n),e}()&&!!function(){var e=document.createElement("canvas");e.width=e.height=1;var r=e.getContext("2d");if(!r)return!1;var i=r.getImageData(0,0,1,1);return i&&i.width===e.width}()&&(void 0===a[r=e&&e.failIfMajorPerformanceCaveat]&&(a[r]=function(e){var r,i,n,a=(r=document.createElement("canvas"),(i=Object.create(o.webGLContextAttributes)).failIfMajorPerformanceCaveat=e,r.getContext("webgl2",i));if(!a)return!1;try{n=a.createShader(a.VERTEX_SHADER)}catch(e){return!1}return!(!n||a.isContextLost())&&(a.shaderSource(n,"void main() {}"),a.compileShader(n),!0===a.getShaderParameter(n,a.COMPILE_STATUS))}(r)),!!a[r]&&!document.documentMode&&true)}var a={};function s(e,r,i){let n=document.createElement(e);return null!=r&&(n.className=r),i&&i.appendChild(n),n}function l(e,r,i){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let e of Object.keys(r))n.setAttributeNS(null,e,String(r[e]));return i&&i.appendChild(n),n}o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};let u="u">typeof document?document.documentElement&&document.documentElement.style:null,c=u&&void 0!==u.userSelect?"userSelect":"WebkitUserSelect";function h(){u&&c&&(r=u[c],u[c]="none")}function p(){u&&c&&(u[c]=r)}function d(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",d,!0)}function f(){window.addEventListener("click",d,!0),window.setTimeout(()=>{window.removeEventListener("click",d,!0)},0)}function m(e,r){let i=e.getBoundingClientRect();return y(e,i,r)}function g(e,r){let i=e.getBoundingClientRect(),n=[];for(let o=0;o<r.length;o++)n.push(y(e,i,r[o]));return n}function _(e){return void 0!==window.InstallTrigger&&2===e.button&&e.ctrlKey&&window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button}function y(r,i,n){let o=r.offsetWidth===i.width?1:r.offsetWidth/i.width;return new e.P((n.clientX-i.left)*o,(n.clientY-i.top)*o)}class v{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages=new Set}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,r){this._updatedSourceCaches[e]=r,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){let r=e.scope;this._updatedLayers[r]=this._updatedLayers[r]||new Set,this._updatedLayers[r].add(e.id),this.setDirty()}removeLayer(e){let r=e.scope;this._removedLayers[r]=this._removedLayers[r]||{},this._updatedLayers[r]=this._updatedLayers[r]||new Set,this._removedLayers[r][e.id]=e,this._updatedLayers[r].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){let e={};for(let r in this._updatedLayers)e[r]=e[r]||{},e[r].updatedIds=Array.from(this._updatedLayers[r].values());for(let r in this._removedLayers)e[r]=e[r]||{},e[r].removedIds=Object.keys(this._removedLayers[r]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(){return Array.from(this._updatedImages.values())}updateImage(e){this._updatedImages.add(e),this.setDirty()}resetUpdatedImages(){this._updatedImages.clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages.clear()}}class x extends e.E{constructor(e){super(),this.requestManager=e,this.models={"":{}},this.numModelsLoading={}}loadModel(r,i){return e.l(this.requestManager.transformRequest(i,e.R.Model).url).then(i=>{if(!i)return;let n=e.c(i),o=new e.M(r,void 0,void 0,n);return o.computeBoundsAndApplyParent(),o}
15).catch(n=>{if(n&&404===n.status)return null;this.fire(new e.a(Error(`Could not load model ${r} from ${i}: ${n.message}`)))})}load(r,i){this.models[i]||(this.models[i]={});let n=Object.keys(r);this.numModelsLoading[i]=(this.numModelsLoading[i]||0)+n.length;let o=[];for(let e of n)o.push(this.loadModel(e,r[e]));Promise.allSettled(o).then(r=>{for(let e=0;e<r.length;e++){let{status:o,value:a}=r[e];"fulfilled"===o&&a&&(this.models[i][n[e]]={model:a,numReferences:1})}this.numModelsLoading[i]-=n.length,this.fire(new e.b("data",{dataType:"style"}))}).catch(r=>{this.fire(new e.a(Error(`Could not load models: ${r.message}`)))})}isLoaded(){for(let e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return!1;return!0}hasModel(e,r){return!!this.getModel(e,r)}getModel(e,r){return this.models[r]||(this.models[r]={}),this.models[r][e]?this.models[r][e].model:void 0}addModel(e,r,i){this.models[i]||(this.models[i]={}),this.hasModel(e,i)&&this.models[i][e].numReferences++,this.load({[e]:this.requestManager.normalizeModelURL(r)},i)}addModels(e,r){this.models[r]||(this.models[r]={});let i={};for(let n in e)this.models[r][n]={},i[n]=this.requestManager.normalizeModelURL(e[n]);this.load(i,r)}addModelsFromBucket(e,r){this.models[r]||(this.models[r]={});let i={};for(let n of e)this.hasModel(n,r)?this.models[r][n].numReferences++:i[n]=this.requestManager.normalizeModelURL(n);this.load(i,r)}removeModel(e,r){if(this.models[r]&&this.models[r][e]&&(this.models[r][e].numReferences--,0===this.models[r][e].numReferences)){let i=this.models[r][e].model;delete this.models[r][e],i.destroy()}}listModels(e){return this.models[e]||(this.models[e]={}),Object.keys(this.models[e])}upload(e,r){for(let i in this.models[r]||(this.models[r]={}),this.models[r])this.models[r][i].model&&this.models[r][i].model.upload(e.context)}}class b{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(r,i,n){let o=String(i);if(this.stateChanges[r]=this.stateChanges[r]||{},this.stateChanges[r][o]=this.stateChanges[r][o]||{},e.e(this.stateChanges[r][o],n),null===this.deletedStates[r])for(let e in this.deletedStates[r]={},this.state[r])e!==o&&(this.deletedStates[r][e]=null);else if(this.deletedStates[r]&&null===this.deletedStates[r][o])for(let e in this.deletedStates[r][o]={},this.state[r][o])n[e]||(this.deletedStates[r][o][e]=null);else for(let e in n)this.deletedStates[r]&&this.deletedStates[r][o]&&null===this.deletedStates[r][o][e]&&delete this.deletedStates[r][o][e]}removeFeatureState(e,r,i){if(null===this.deletedStates[e])return;let n=String(r);if(this.deletedStates[e]=this.deletedStates[e]||{},i&&void 0!==r)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][i]=null);else if(void 0!==r)if(this.stateChanges[e]&&this.stateChanges[e][n])for(i in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][i]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(r,i){let n=String(i),o=e.e({},(this.state[r]||{})[n],(this.stateChanges[r]||{})[n]);if(null===this.deletedStates[r])return{};if(this.deletedStates[r]){let e=this.deletedStates[r][i];if(null===e)return{};for(let r in e)delete o[r]}return o}initializeTileState(e,r){e.setFeatureState(this.state,r)}coalesceChanges(r,i){let n={};for(let r in this.stateChanges){this.state[r]=this.state[r]||{};let i={};for(let n in this.stateChanges[r])this.state[r][n]||(this.state[r][n]={}),e.e(this.state[r][n],this.stateChanges[r][n]),i[n]=this.state[r][n];n[r]=i}for(let r in this.deletedStates){this.state[r]=this.state[r]||{};let i={};if(null===this.deletedStates[r])for(let e in this.state[r])i[e]={},this.state[r][e]={};else for(let e in this.deletedStates[r]){if(null===this.deletedStates[r][e])this.state[r][e]={};else if(this.state[r][e])for(let i of Object.keys(this.deletedStates[r][e]))delete this.state[r][e][i];i[e]=this.state[r][e]}n[r]=n[r]||{},e.e(n[r],i)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(let e in r)r[e].setFeatureState(n,i)}}class w extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded={},this.requestors=[],this.patterns={},this.atlasImage={},this.atlasTexture={},this.dirty=!0}createScope(r){this.images[r]={},this.loaded[r]=!1,this.updatedImages[r]={},this.patterns[r]={},this.callbackDispatchedThisFrame[r]={},this.atlasImage[r]=new e.h({width:1,height:1})}isLoaded(){for(let e in this.loaded)if(!this.loaded[e])return!1;return!0}setLoaded(e,r){if(this.loaded[r]!==e&&(this.loaded[r]=e,e)){for(let{ids:e,callback:i}of this.requestors)this._notify(e,r,i);this.requestors=[]}}hasImage(e,r){return!!this.getImage(e,r)}getImage(e,r){return this.images[r][e]}
15addImage(e,r,i){this._validate(e,i)&&(this.images[r][e]=i)}_validate(r,i){let n=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new e.a(Error(`Image "${r}" has invalid "stretchX" value`))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new e.a(Error(`Image "${r}" has invalid "stretchY" value`))),n=!1),this._validateContent(i.content,i)||(this.fire(new e.a(Error(`Image "${r}" has invalid "content" value`))),n=!1),n}_validateStretch(e,r){if(!e)return!0;let i=0;for(let n of e){if(n[0]<i||n[1]<n[0]||r<n[1])return!1;i=n[1]}return!0}_validateContent(e,r){return!(e&&(4!==e.length||e[0]<0||r.data.width<e[0]||e[1]<0||r.data.height<e[1]||e[2]<0||r.data.width<e[2]||e[3]<0||r.data.height<e[3]||e[2]<e[0]||e[3]<e[1]))}updateImage(e,r,i){i.version=this.images[r][e].version+1,this.images[r][e]=i,this.updatedImages[r][e]=!0}removeImage(e,r){let i=this.images[r][e];delete this.images[r][e],delete this.patterns[r][e],i.userImage&&i.userImage.onRemove&&i.userImage.onRemove()}listImages(e){return Object.keys(this.images[e])}getImages(e,r,i){let n=!0,o=!!this.loaded[r];if(!o)for(let i of e)this.images[r][i]||(n=!1);o||n?this._notify(e,r,i):this.requestors.push({ids:e,scope:r,callback:i})}getUpdatedImages(e){return this.updatedImages[e]}_notify(r,i,n){let o={};for(let n of r){this.images[i][n]||this.fire(new e.b("styleimagemissing",{id:n}));let r=this.images[i][n];r?o[n]={data:r.data.clone(),pixelRatio:r.pixelRatio,sdf:r.sdf,version:r.version,stretchX:r.stretchX,stretchY:r.stretchY,content:r.content,hasRenderCallback:!!(r.userImage&&r.userImage.render)}:e.w(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}n(null,o)}getPixelSize(e){let{width:r,height:i}=this.atlasImage[e];return{width:r,height:i}}getPattern(r,i){let n=this.patterns[i][r],o=this.getImage(r,i);if(!o)return null;if(n&&n.position.version===o.version)return n.position;if(n)n.position.version=o.version;else{let n={w:o.data.width+2,h:o.data.height+2,x:0,y:0},a=new e.I(n,o);this.patterns[i][r]={bin:n,position:a}}return this._updatePatternAtlas(i),this.patterns[i][r].position}bind(r,i){let n=r.gl,o=this.atlasTexture[i];o?this.dirty&&(o.update(this.atlasImage[i]),this.dirty=!1):(o=new e.T(r,this.atlasImage[i],n.RGBA),this.atlasTexture[i]=o),o.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(r){let i=[];for(let e in this.patterns[r])i.push(this.patterns[r][e].bin);let{w:n,h:o}=e.p(i),a=this.atlasImage[r];for(let i in a.resize({width:n||1,height:o||1}),this.patterns[r]){let{bin:n}=this.patterns[r][i],o=n.x+1,s=n.y+1,l=this.images[r][i].data,u=l.width,c=l.height;e.h.copy(l,a,{x:0,y:0},{x:o,y:s},{width:u,height:c}),e.h.copy(l,a,{x:0,y:c-1},{x:o,y:s-1},{width:u,height:1}),e.h.copy(l,a,{x:0,y:0},{x:o,y:s+c},{width:u,height:1}),e.h.copy(l,a,{x:u-1,y:0},{x:o-1,y:s},{width:1,height:c}),e.h.copy(l,a,{x:0,y:0},{x:o+u,y:s},{width:1,height:c})}this.dirty=!0}beginFrame(){for(let e in this.images)this.callbackDispatchedThisFrame[e]={}}dispatchRenderCallbacks(e,r){for(let i of e){if(this.callbackDispatchedThisFrame[r][i])continue;this.callbackDispatchedThisFrame[r][i]=!0;let e=this.images[r][i];(function(e){let{userImage:r}=e;return!!(r&&r.render&&r.render())&&(e.data.replace(new Uint8Array(r.data.buffer)),!0)})(e)&&this.updateImage(i,r,e)}}}function E(r){let i=r.key,n=r.value,o=r.valueSpec||{},a=r.objectElementValidators||{},s=r.style,l=r.styleSpec,u=[],c=e.j(n);if("object"!==c)return[new e.V(i,n,`object expected, ${c} found`)];for(let r in n){let c,h=r.split(".")[0];a[h]?c=a[h]:o[h]?c=V:a["*"]?c=a["*"]:o["*"]&&(c=V),c?u=u.concat(c({key:(i?`${i}.`:i)+r,value:n[r],valueSpec:o[h]||o["*"],style:s,styleSpec:l,object:n,objectKey:r},n)):u.push(new e.i(i,n[r],`unknown property "${r}"`))}for(let r in o)a[r]||o[r].required&&void 0===o[r].default&&void 0===n[r]&&u.push(new e.V(i,n,`missing required property "${r}"`));return u}function S(r){let i=r.value,n=r.valueSpec,o=r.style,a=r.styleSpec,s=r.key,l=r.arrayElementValidator||V;if("array"!==e.j(i))return[new e.V(s,i,`array expected, ${e.j(i)} found`)];if(n.length&&i.length!==n.length)return[new e.V(s,i,`array length ${n.length} expected, length ${i.length} found`)];if(n["min-length"]&&i.length<n["min-length"])return[new e.V(s,i,`array length at least ${n["min-length"]} expected, length ${i.length} found`)];let u={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum,function:void 0};a.$version<7&&(u.function=n.function),"object"===e.j(n.value)&&(u=n.value);let c=[];for(let e=0;e<i.length;e++)c=c.concat(l({array:i,arrayIndex:e,value:i[e],valueSpec:u,style:o,styleSpec:a,key:`${s}[${e}]`},!0));return c}function T(r){let i=r.key,n=r.value,o=r.valueSpec,a=e.j(n);if("number"===a&&n!=n&&(a="NaN"),"number"!==a)return[new e.V(i,n,`number expected, ${a} found`)];if("minimum"in o){let a=o.minimum;if("array"===e.j(o.minimum)&&(a=o.minimum[r.arrayIndex]),n<a)return[new e.V(i,n,`${n} is less than the minimum value ${a}`)]}if("maximum"in o){let a=o.maximum;if("array"===e.j(o.maximum)&&(a=o.maximum[r.arrayIndex]),n>a)return[new e.V(i,n,`${n} is greater than the maximum value ${a}`)]}return[]}
15function I(r){let i=r.valueSpec,n=e.u(r.value.type),o,a,s,l={},u="categorical"!==n&&void 0===r.value.property,c="array"===e.j(r.value.stops)&&"array"===e.j(r.value.stops[0])&&"object"===e.j(r.value.stops[0][0]),h=E({key:r.key,value:r.value,valueSpec:r.styleSpec.function,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(r){if("identity"===n)return[new e.V(r.key,r.value,'identity function may not have a "stops" property')];let i=[],o=r.value;return i=i.concat(S({key:r.key,value:o,valueSpec:r.valueSpec,style:r.style,styleSpec:r.styleSpec,arrayElementValidator:p})),"array"===e.j(o)&&0===o.length&&i.push(new e.V(r.key,o,"array must have at least one stop")),i},default:function(e){return V({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===n&&u&&h.push(new e.V(r.key,r.value,'missing required property "property"')),"identity"===n||r.value.stops||h.push(new e.V(r.key,r.value,'missing required property "stops"')),"exponential"===n&&r.valueSpec.expression&&!e.s(r.valueSpec)&&h.push(new e.V(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(u||e.m(r.valueSpec)?u&&!e.n(r.valueSpec)&&h.push(new e.V(r.key,r.value,"zoom functions not supported")):h.push(new e.V(r.key,r.value,"property functions not supported"))),("categorical"===n||c)&&void 0===r.value.property&&h.push(new e.V(r.key,r.value,'"property" property is required')),h;function p(r){let n=[],o=r.value,u=r.key;if("array"!==e.j(o))return[new e.V(u,o,`array expected, ${e.j(o)} found`)];if(2!==o.length)return[new e.V(u,o,`array length 2 expected, length ${o.length} found`)];if(c){if("object"!==e.j(o[0]))return[new e.V(u,o,`object expected, ${e.j(o[0])} found`)];if(void 0===o[0].zoom)return[new e.V(u,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new e.V(u,o,"object stop key must have value")];let i=e.u(o[0].zoom);if("number"!=typeof i)return[new e.V(u,o[0].zoom,"stop zoom values must be numbers")];if(s&&s>i)return[new e.V(u,o[0].zoom,"stop zoom values must appear in ascending order")];i!==s&&(s=i,a=void 0,l={}),n=n.concat(E({key:`${u}[0]`,value:o[0],valueSpec:{zoom:{}},style:r.style,styleSpec:r.styleSpec,objectElementValidators:{zoom:T,value:d}}))}else n=n.concat(d({key:`${u}[0]`,value:o[0],valueSpec:{},style:r.style,styleSpec:r.styleSpec},o));return e.o(e.q(o[1]))?n.concat([new e.V(`${u}[1]`,o[1],"expressions are not allowed in function stops.")]):n.concat(V({key:`${u}[1]`,value:o[1],valueSpec:i,style:r.style,styleSpec:r.styleSpec}))}function d(r,s){let u=e.j(r.value),c=e.u(r.value),h=null!==r.value?r.value:s;if(o){if(u!==o)return[new e.V(r.key,h,`${u} stop domain type must match previous stop domain type ${o}`)]}else o=u;if("number"!==u&&"string"!==u&&"boolean"!==u&&"number"!=typeof c&&"string"!=typeof c&&"boolean"!=typeof c)return[new e.V(r.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==u&&"categorical"!==n){let o=`number expected, ${u} found`;return e.m(i)&&void 0===n&&(o+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e.V(r.key,h,o)]}return"categorical"!==n||"number"!==u||"number"==typeof c&&isFinite(c)&&Math.floor(c)===c?"categorical"!==n&&"number"===u&&"number"==typeof c&&"number"==typeof a&&void 0!==a&&c<a?[new e.V(r.key,h,"stop domain values must appear in ascending order")]:(a=c,"categorical"===n&&c in l?[new e.V(r.key,h,"stop domain values must be unique")]:(l[c]=!0,[])):[new e.V(r.key,h,`integer expected, found ${String(c)}`)]}}function M(r){let i=("property"===r.expressionContext?e.r:e.t)(e.q(r.value),r.valueSpec);if("error"===i.result)return i.value.map(i=>new e.V(`${r.key}${i.key}`,r.value,i.message));let n=i.value.expression||i.value._styleExpression.expression;if("property"===r.expressionContext&&"text-font"===r.propertyKey&&!n.outputDefined())return[new e.V(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===r.expressionContext&&"layout"===r.propertyType&&!e.v(n))return[new e.V(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===r.expressionContext)return function r(i,n){let o=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(n.valueSpec&&n.valueSpec.expression)for(let e of n.valueSpec.expression.parameters)o.delete(e);
15if(0===o.size)return[];let a=[];return i instanceof e.C&&o.has(i.name)?[new e.V(n.key,n.value,`["${i.name}"] expression is not supported in a filter for a ${n.object.type} layer with id: ${n.object.id}`)]:(i.eachChild(e=>{a.push(...r(e,n))}),a)}(n,r);if(r.expressionContext&&0===r.expressionContext.indexOf("cluster")){if(!e.x(n,["zoom","feature-state"]))return[new e.V(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===r.expressionContext&&!e.y(n))return[new e.V(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function C(r){let i=r.key,n=r.value,o=r.valueSpec,a=[];return Array.isArray(o.values)?-1===o.values.indexOf(e.u(n))&&a.push(new e.V(i,n,`expected one of [${o.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(o.values).indexOf(e.u(n))&&a.push(new e.V(i,n,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(n)} found`)),a}function A(r){return e.A(e.q(r.value))?M(e.k({},r,{expressionContext:"filter",valueSpec:r.styleSpec[`filter_${r.layerType||"fill"}`]})):function r(i){let n=i.value,o=i.key;if("array"!==e.j(n))return[new e.V(o,n,`array expected, ${e.j(n)} found`)];let a=i.styleSpec,s,l=[];if(n.length<1)return[new e.V(o,n,"filter array must have at least 1 element")];switch(l=l.concat(C({key:`${o}[0]`,value:n[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),e.u(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===e.u(n[1])&&l.push(new e.V(o,n,`"$type" cannot be use with operator "${n[0]}"`));case"==":case"!=":3!==n.length&&l.push(new e.V(o,n,`filter array for operator "${n[0]}" must have 3 elements`));case"in":case"!in":n.length>=2&&"string"!==(s=e.j(n[1]))&&l.push(new e.V(`${o}[1]`,n[1],`string expected, ${s} found`));for(let r=2;r<n.length;r++)s=e.j(n[r]),"$type"===e.u(n[1])?l=l.concat(C({key:`${o}[${r}]`,value:n[r],valueSpec:a.geometry_type,style:i.style,styleSpec:i.styleSpec})):"string"!==s&&"number"!==s&&"boolean"!==s&&l.push(new e.V(`${o}[${r}]`,n[r],`string, number, or boolean expected, ${s} found`));break;case"any":case"all":case"none":for(let e=1;e<n.length;e++)l=l.concat(r({key:`${o}[${e}]`,value:n[e],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":s=e.j(n[1]),2!==n.length?l.push(new e.V(o,n,`filter array for "${n[0]}" operator must have 2 elements`)):"string"!==s&&l.push(new e.V(`${o}[1]`,n[1],`string expected, ${s} found`))}return l}(r)}function P(r,i){let n,o=r.key,a=r.style,s=r.layer,l=r.styleSpec,u=r.value,c=r.objectKey,h=l[`${i}_${r.layerType}`];if(!h)return[];let p=c.match(/^(.*)-transition$/);if("paint"===i&&p&&h[p[1]]&&h[p[1]].transition)return V({key:o,value:u,valueSpec:l.transition,style:a,styleSpec:l});let d=r.valueSpec||h[c];if(!d)return[new e.i(o,u,`unknown property "${c}"`)];if("string"===e.j(u)&&e.m(d)&&!d.tokens&&(n=/^{([^}]+)}$/.exec(u))){let r=`\`{ "type": "identity", "property": ${n?JSON.stringify(n[1]):'"_"'} }\``;return[new e.V(o,u,`"${c}" does not support interpolation syntax
16Use an identity property function instead: ${r}.`)]}let f=[];if("symbol"===r.layerType)"text-field"!==c||!a||a.glyphs||a.imports||f.push(new e.V(o,u,'use of "text-field" requires a style "glyphs" property')),"text-font"===c&&e.B(e.q(u))&&"identity"===e.u(u.type)&&f.push(new e.V(o,u,'"text-font" does not support identity functions'));else if("model"===r.layerType&&"paint"===i&&s&&s.layout&&s.layout.hasOwnProperty("model-id")&&e.m(d)&&(e.D(d)||e.n(d))){let r=e.r(e.q(u),d),i=r.value.expression||r.value._styleExpression.expression;i&&!e.x(i,["measure-light"])&&("model-emissive-strength"===c&&e.y(i)&&e.v(i)||f.push(new e.V(o,u,`${c} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return f.concat(V({key:r.key,value:u,valueSpec:d,style:a,styleSpec:l,expressionContext:"property",propertyType:i,propertyKey:c}))}function L(e){return P(e,"paint")}function O(e){return P(e,"layout")}function D(r){let i=[],n=r.value,o=r.key,a=r.style,s=r.styleSpec;n.type||n.ref||i.push(new e.V(o,n,'either "type" or "ref" is required'));let l=e.u(n.type),u=e.u(n.ref);
16if(n.id){let s=e.u(n.id);for(let l=0;l<r.arrayIndex;l++){let r=a.layers[l];e.u(r.id)===s&&i.push(new e.V(o,n.id,`duplicate layer id "${n.id}", previously used at line ${r.id.__line__}`))}}if("ref"in n){let r;["type","source","source-layer","filter","layout"].forEach(r=>{r in n&&i.push(new e.V(o,n[r],`"${r}" is prohibited for ref layers`))}),a.layers.forEach(i=>{e.u(i.id)===u&&(r=i)}),r?r.ref?i.push(new e.V(o,n.ref,"ref cannot reference another ref layer")):l=e.u(r.type):"string"==typeof u&&i.push(new e.V(o,n.ref,`ref layer "${u}" not found`))}else if("background"!==l&&"sky"!==l&&"slot"!==l)if(n.source){let r=a.sources&&a.sources[n.source],s=r&&e.u(r.type);r?"vector"===s&&"raster"===l?i.push(new e.V(o,n.source,`layer "${n.id}" requires a raster source`)):"raster"===s&&"raster"!==l?i.push(new e.V(o,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==s||n["source-layer"]?"raster-dem"===s&&"hillshade"!==l?i.push(new e.V(o,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==s||["raster","raster-particle"].includes(l)?"line"===l&&n.paint&&(n.paint["line-gradient"]||n.paint["line-trim-offset"])&&("geojson"!==s||!r.lineMetrics)?i.push(new e.V(o,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):"raster-particle"===l&&"raster-array"!==s&&i.push(new e.V(o,n.source,`layer "${n.id}" requires a 'raster-array' source.`)):i.push(new e.V(o,n.source,"raster-array source can only be used with layer type 'raster'.")):i.push(new e.V(o,n,`layer "${n.id}" must specify a "source-layer"`)):i.push(new e.V(o,n.source,`source "${n.source}" not found`))}else i.push(new e.V(o,n,'missing required property "source"'));return i=i.concat(E({key:o,value:n,valueSpec:s.layer,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":()=>[],type:()=>V({key:`${o}.type`,value:n.type,valueSpec:s.layer.type,style:r.style,styleSpec:r.styleSpec,object:n,objectKey:"type"}),filter:r=>A(e.k({layerType:l},r)),layout:r=>E({layer:n,key:r.key,value:r.value,valueSpec:{},style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":r=>O(e.k({layerType:l},r))}}),paint:r=>E({layer:n,key:r.key,value:r.value,valueSpec:{},style:r.style,styleSpec:r.styleSpec,objectElementValidators:{"*":r=>L(e.k({layerType:l,layer:n},r))}})}}))}function R(r){let i=r.value,n=r.key,o=e.j(i);return"string"!==o?[new e.V(n,i,`string expected, ${o} found`)]:[]}let k={promoteId:function({key:r,value:i}){if("string"===e.j(i))return R({key:r,value:i});{let e=[];for(let n in i)e.push(...R({key:`${r}.${n}`,value:i[n]}));return e}}};function N(r){let i=r.value,n=r.key,o=r.styleSpec,a=r.style;if(!i.type)return[new e.V(n,i,'"type" is required')];let s=e.u(i.type),l=[];switch(["vector","raster","raster-dem","raster-array"].includes(s)&&(i.url||i.tiles||l.push(new e.i(n,i,'Either "url" or "tiles" is required.'))),s){case"vector":case"raster":case"raster-dem":case"raster-array":return l.concat(E({key:n,value:i,valueSpec:o[`source_${s.replace("-","_")}`],style:r.style,styleSpec:o,objectElementValidators:k}));case"geojson":if(l=E({key:n,value:i,valueSpec:o.source_geojson,style:a,styleSpec:o,objectElementValidators:k}),i.cluster)for(let e in i.clusterProperties){let[r,o]=i.clusterProperties[e],a="string"==typeof r?[r,["accumulated"],["get",e]]:r;l.push(...M({key:`${n}.${e}.map`,value:o,expressionContext:"cluster-map"})),l.push(...M({key:`${n}.${e}.reduce`,value:a,expressionContext:"cluster-reduce"}))}return l;case"video":return E({key:n,value:i,valueSpec:o.source_video,style:a,styleSpec:o});case"image":return E({key:n,value:i,valueSpec:o.source_image,style:a,styleSpec:o});case"canvas":return[new e.V(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:var u;return C({key:`${n}.type`,value:i.type,valueSpec:{values:(u=o).source.reduce((e,r)=>{let i=u[r];return"enum"===i.type.type&&(e=e.concat(Object.keys(i.type.values))),e},[])},style:a,styleSpec:o})}}function F(r){let i=r.value,n=r.styleSpec,o=n.light,a=r.style,s=[],l=e.j(i);if(void 0===i)return s;if("object"!==l)return s.concat([new e.V("light",i,`object expected, ${l}
16 found`)]);for(let r in i){let l=r.match(/^(.*)-transition$/);s=s.concat(l&&o[l[1]]&&o[l[1]].transition?V({key:r,value:i[r],valueSpec:n.transition,style:a,styleSpec:n}):o[r]?V({key:r,value:i[r],valueSpec:o[r],style:a,styleSpec:n}):[new e.V(r,i[r],`unknown property "${r}"`)])}return s}function z(r){let i=r.value,n=[];if(!i)return n;let o=e.j(i);if("object"!==o)return n.concat([new e.V("light-3d",i,`object expected, ${o} found`)]);let a=r.styleSpec,s=a["light-3d"],l=r.key,u=r.style,c=r.style.lights;for(let r of["type","id"])if(!(r in i))return n.concat([new e.V("light-3d",i,`missing property ${r} on light`)]);if(i.type&&c)for(let o=0;o<r.arrayIndex;o++){let r=e.u(i.type),a=c[o];e.u(a.type)===r&&n.push(new e.V(l,i.id,`duplicate light type "${i.type}", previously defined at line ${a.id.__line__}`))}let h=`properties_light_${i.type}`;if(!(h in a))return n.concat([new e.V("light-3d",i,`Invalid light type ${i.type}`)]);let p=a[h];for(let o in i)if("properties"===o){let s=i[o],l=e.j(s);if("object"!==l)return n.concat([new e.V("properties",s,`object expected, ${l} found`)]);for(let i in s)n=n.concat(p[i]?V({key:i,value:s[i],valueSpec:p[i],style:u,styleSpec:a}):[new e.i(r.key,s[i],`unknown property "${i}"`)])}else{let r=o.match(/^(.*)-transition$/);n=n.concat(r&&s[r[1]]&&s[r[1]].transition?V({key:o,value:i[o],valueSpec:a.transition,style:u,styleSpec:a}):s[o]?V({key:o,value:i[o],valueSpec:s[o],style:u,styleSpec:a}):[new e.i(o,i[o],`unknown property "${o}"`)])}return n}function B(r){let i=r.value,n=r.key,o=r.style,a=r.styleSpec,s=a.terrain,l=[],u=e.j(i);if(void 0===i||"null"===u)return l;if("object"!==u)return l.concat([new e.V("terrain",i,`object expected, ${u} found`)]);for(let r in i){let n=r.match(/^(.*)-transition$/);l=l.concat(n&&s[n[1]]&&s[n[1]].transition?V({key:r,value:i[r],valueSpec:a.transition,style:o,styleSpec:a}):s[r]?V({key:r,value:i[r],valueSpec:s[r],style:o,styleSpec:a}):[new e.i(r,i[r],`unknown property "${r}"`)])}if(i.source){let r=o.sources&&o.sources[i.source],a=r&&e.u(r.type);r?"raster-dem"!==a&&l.push(new e.V(n,i.source,`terrain cannot be used with a source of type ${String(a)}, it only be used with a "raster-dem" source type`)):l.push(new e.V(n,i.source,`source "${i.source}" not found`))}else l.push(new e.V(n,i,'terrain is missing required property "source"'));return l}function U(r){let i=r.value,n=r.style,o=r.styleSpec,a=o.fog,s=[],l=e.j(i);if(void 0===i)return s;if("object"!==l)return s.concat([new e.V("fog",i,`object expected, ${l} found`)]);for(let r in i){let l=r.match(/^(.*)-transition$/);s=s.concat(l&&a[l[1]]&&a[l[1]].transition?V({key:r,value:i[r],valueSpec:o.transition,style:n,styleSpec:o}):a[r]?V({key:r,value:i[r],valueSpec:a[r],style:n,styleSpec:o}):[new e.i(r,i[r],`unknown property "${r}"`)])}return s}let j={"*":()=>[],array:S,boolean:function(r){let i=r.value,n=r.key,o=e.j(i);return"boolean"!==o?[new e.V(n,i,`boolean expected, ${o} found`)]:[]},number:T,color:function(r){let i=r.key,n=r.value,o=e.j(n);return"string"!==o?[new e.V(i,n,`color expected, ${o} found`)]:null===e.z(n)?[new e.V(i,n,`color expected, "${n}" found`)]:[]},enum:C,filter:A,function:I,layer:D,object:E,source:N,model:e.F,light:F,"light-3d":z,terrain:B,fog:U,string:R,formatted:function(e){return 0===R(e).length?[]:M(e)},resolvedImage:function(e){return 0===R(e).length?[]:M(e)},projection:function(r){let i=r.value,n=r.styleSpec,o=n.projection,a=r.style,s=[],l=e.j(i);if("object"===l)for(let e in i)s=s.concat(V({key:e,value:i[e],valueSpec:o[e],style:a,styleSpec:n}));else"string"!==l&&(s=s.concat([new e.V("projection",i,`object or string expected, ${l} found`)]));return s},import:function(r){let{value:i,styleSpec:n}=r,{data:o,...a}=i;Object.defineProperty(a,"__line__",{value:i.__line__,enumerable:!1});let s=E(e.k({},r,{value:a,valueSpec:n.import}));return""===e.u(a.id)&&s.push(new e.V(`${r.key}.id`,a,"import id can't be an empty string")),o&&(s=s.concat(q(o,n,{key:`${r.key}.data`}))),s}};function V(r,i=!1){let n=r.value,o=r.valueSpec,a=r.styleSpec;if(o.expression&&e.B(e.u(n)))return I(r);if(o.expression&&e.o(e.q(n)))return M(r);if(o.type&&j[o.type]){let n=j[o.type](r);return!0===i&&n.length>0&&"array"===e.j(r.value)?M(r):n}return E(e.k({},r,{valueSpec:o.type?a[o.type]:o}))}function G(r){let i=r.value,n=r.key,o=R(r);return o.length||(-1===i.indexOf("{fontstack}")&&o.push(new e.V(n,i,'"glyphs" url must include a "{fontstack}" token')),-1===i.indexOf("{range}")&&o.push(new e.V(n,i,'"glyphs" url must include a "{range}" token'))),o}function q(r,i=e.G,n={}){return V({key:n.key||"",value:r,valueSpec:i.$root,styleSpec:i,style:r,objectElementValidators:{glyphs:G,"*":()=>[]}})}function H(r,i=e.G){return er(q(r,i))}let $=e=>er(N(e)),W=e=>er(F(e)),Y=e=>er(z(e)),Z=e=>er(B(e)),X=e=>er(U(e)),K=e=>er(D(e)),Q=e=>er(A(e)),J=e=>er(L(e)),ee=e=>er(O(e)),et=r=>er(e.F(r));function er(e){return e.slice().sort((e,r)=>e.line&&r.line?e.line-r.line:0)}function ei(r,i){let n=!1;if(i&&i.length)for(let o of i)o instanceof e.i?e.w(o.message):(r.fire(new e.a(Error(o.message))),n=!0);return n}let en=new e.H({anchor:new e.J(e.G.light.anchor),position:new e.K(e.G.light.position),color:new e.J(e.G.light.color),intensity:new e.J(e.G.light.intensity)});class eo extends e.E{constructor(r,i="flat"){super(),this._transitionable=new e.L(en),this.setLight(r,i),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,r,i={}
16){this._validate(W,e,i)||(this._transitionable.setTransitionOrValue(e),this.id=r)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(r,i,n){return(!n||!1!==n.validate)&&ei(this,r.call(H,e.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.G})))}}let ea=new e.H({source:new e.J(e.G.terrain.source),exaggeration:new e.J(e.G.terrain.exaggeration)}),es=class extends e.E{constructor(r,i,n,o){super(),this.scope=n,this._transitionable=new e.L(ea,n,o),this._transitionable.setTransitionOrValue(r,o),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i}get(){return this._transitionable.serialize()}set(e,r){this._transitionable.setTransitionOrValue(e,r)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}getExaggeration(r){return this._transitioning.possiblyEvaluate(new e.N(r)).get("exaggeration")}isZoomDependent(){let r=this._transitionable._values.exaggeration;return null!=r&&null!=r.value&&null!=r.value.expression&&r.value.expression instanceof e.Z}};function el(r,i,n,o){let a=e.S(45,65,n),[s,l]=eu(r,o),u=1-Math.min(1,Math.exp(-((i-s)/(l-s)*6)));return u*=u*u,(u=Math.min(1,1.00747*u))*a*r.alpha}function eu(e,r){let i=.5/Math.tan(.5*r);return[e.range[0]+i,e.range[1]+i]}function ec(r,i,n,o,a){let s=e.Q.transformMat4([],[i,n,o],a.mercatorFogMatrix);return el(r,e.Q.length(s),a.pitch,a._fov)}function eh(r,i,n,o,a,s,l){let u=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let r of[[n,o,0],[a,o,0],[a,s,0],[n,s,0]]){let n=e.Q.transformMat4([],r,i),o=e.Q.length(n);u=Math.min(u,o),c=Math.max(c,o)}return[el(r,u,l.pitch,l._fov),el(r,c,l.pitch,l._fov)]}let ep=new e.H({range:new e.J(e.G.fog.range),color:new e.J(e.G.fog.color),"high-color":new e.J(e.G.fog["high-color"]),"space-color":new e.J(e.G.fog["space-color"]),"horizon-blend":new e.J(e.G.fog["horizon-blend"]),"star-intensity":new e.J(e.G.fog["star-intensity"]),"vertical-range":new e.J(e.G.fog["vertical-range"])});class ed extends e.E{constructor(r,i,n,o){super(),this._transitionable=new e.L(ep,n,new Map(o)),this.set(r,o),this._transitioning=this._transitionable.untransitioned(),this._transform=i,this.properties=new e.U(ep)}get state(){let r=this._transform,i="globe"===r.projection.name,n=e.W(r.zoom),o=this.properties.get("range");return{range:i?[e.X(.5,o[0],n),e.X(3,o[1],n)]:o,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(r,i,n={}){if(this._validate(X,r,n))return;let o=e.e({},r);for(let r of Object.keys(e.G.fog))void 0===o[r]&&(o[r]=e.G.fog[r].default);this._options=o,this._transitionable.setTransitionOrValue(this._options,i)}getOpacity(r){if(!this._transform.projection.supportsFog)return 0;let i=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.S(45,65,r))*i.a}getOpacityAtLatLng(r,i){var n;let o,a;return this._transform.projection.supportsFog?(n=this.state,o=e.O.fromLngLat(r),a=i.elevation?i.elevation.getAtPointOrZero(o):0,ec(n,o.x,o.y,a,i)):0}getOpacityForTile(r){if(!this._transform.projection.supportsFog)return[1,1];let i=this._transform.calculateFogTileMatrix(r.toUnwrapped());return eh(this.state,i,0,0,e.Y,e.Y,this._transform)}getOpacityForBounds(e,r,i,n,o){return this._transform.projection.supportsFog?eh(this.state,e,r,i,n,o,this._transform):[1,1]}getFovAdjustedRange(e){return this._transform.projection.supportsFog?eu(this.state,e):[0,1]}isVisibleOnFrustum(r){if(!this._transform.projection.supportsFog)return!1;for(let i of[4,5,6,7]){let n,o=r.points[i];if(o[2]>=0)n=o;else{let a=r.points[i-4];n=e._(a,o,a[2]/(a[2]-o[2]))}if(ec(this.state,n[0],n[1],0,this._transform)>=.05)return!0}return!1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(r,i,n){return(!n||!1!==n.validate)&&ei(this,r.call(H,e.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.G})))}}class ef extends e.E{constructor(r,i,n,o){super(),this.scope=n,this._options=r,this.properties=new e.U(i),this._transitionable=new e.L(i,n,new Map(o)),this._transitionable.setTransitionOrValue(r.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,r){this._options=e,this._transitionable.setTransitionOrValue(e.properties,r)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}let em=new e.H({color:new e.J(e.G.properties_light_ambient.color),intensity:new e.J(e.G.properties_light_ambient.intensity)}),eg=new e.H({direction:new e.$(e.G.properties_light_directional.direction),color:new e.J(e.G.properties_light_directional.color),intensity:new e.J(e.G.properties_light_directional.intensity),"cast-shadows":new e.J(e.G.properties_light_directional["cast-shadows"]),"shadow-intensity":new e.J(e.G.properties_light_directional["shadow-intensity"])});class e_{constructor(e,r,i,n){this.screenBounds=e,this.cameraPoint=r,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=i,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,n)}static createFromScreenPoints(r,i){let n,o;
16if(r instanceof e.P||"number"==typeof r[0]){let a=e.P.convert(r);n=[a],o=i.isPointAboveHorizon(a)}else{let a=e.P.convert(r[0]),s=e.P.convert(r[1]);n=[a,s],o=e.a0(a,s).every(e=>i.isPointAboveHorizon(e))}return new e_(n,i.getCameraPoint(),o,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(r){return e.a0(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],r)}bufferedCameraGeometry(r){let i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],o=e.a0(i,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x<n.x?o.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?o[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(o[3]=this.cameraPoint)),e.a1(o,r)}bufferedCameraGeometryGlobe(r){let i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],o=e.a0(i,n,r),a=this.cameraPoint.clone();switch(3*((a.y>i.y)+(a.y>n.y))+((a.x>i.x)+(a.x>n.x))){case 0:o[0]=a,o[4]=a.clone();break;case 1:o.splice(1,0,a);break;case 2:o[1]=a;break;case 3:o.splice(4,0,a);break;case 5:o.splice(2,0,a);break;case 6:o[3]=a;break;case 7:o.splice(3,0,a);break;case 8:o[2]=a}return o}containsTile(r,i,n,o=0){var a;let s=r.queryPadding/i._pixelsPerMercatorPixel+1,l=n?this._bufferedCameraMercator(s,i):this._bufferedScreenMercator(s,i),u=r.tileID.wrap+(l.unwrapped?o:0),c=l.polygon.map(i=>e.a2(r.tileTransform,i,u));if(!e.a3(c,0,0,e.Y,e.Y))return;u=r.tileID.wrap+(this.screenGeometryMercator.unwrapped?o:0);let h=this.screenGeometryMercator.polygon.map(i=>e.a4(r.tileTransform,i,u)),p=h.map(r=>new e.P(r[0],r[1])),d=i.getFreeCameraOptions().position||new e.O(0,0,0),f=e.a4(r.tileTransform,d,u),m=h.map(r=>{let i=e.Q.sub(r,r,f);return e.Q.normalize(i,i),new e.a5(f,i)}),g=e.a6(r,1,i.zoom)*i._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:p,tilespaceRays:m,bufferedTilespaceGeometry:c,bufferedTilespaceBounds:((a=e.a7(c)).min.x=e.ad(a.min.x,0,e.Y),a.min.y=e.ad(a.min.y,0,e.Y),a.max.x=e.ad(a.max.x,0,e.Y),a.max.y=e.ad(a.max.y,0,e.Y),a),tile:r,tileID:r.tileID,pixelToTileUnitsFactor:g}}_bufferedScreenMercator(e,r){let i=100*e|0;if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let n;return n="globe"===r.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),r):{polygon:this.bufferedScreenGeometry(e).map(e=>r.pointCoordinate3D(e)),unwrapped:!0},this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(e,r){let i=100*e|0;if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let n;return n="globe"===r.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),r):{polygon:this.bufferedCameraGeometry(e).map(e=>r.pointCoordinate3D(e)),unwrapped:!0},this._cameraRaycastCache[i]=n,n}}_projectAndResample(r,i){let n=function(r,i){let n=e.a9.multiply([],i.pixelMatrix,i.globeMatrix),o=[0,-e.ae,0,1],a=[0,e.ae,0,1],s=[0,0,0,1];e.aa.transformMat4(o,o,n),e.aa.transformMat4(a,a,n),e.aa.transformMat4(s,s,n);let l=new e.P(o[0]/o[3],o[1]/o[3]),u=new e.P(a[0]/a[3],a[1]/a[3]),c=e.ab(r,l)&&o[3]<s[3],h=e.ab(r,u)&&a[3]<s[3];if(!c&&!h)return null;let p=function(e,r,i){for(let n=1;n<e.length;n++){let o=ev(r.pointCoordinate3D(e[n-1]).x),a=ev(r.pointCoordinate3D(e[n]).x);if(i<0){if(o<a)return{idx:n,t:-o/(a-1-o)}}else if(a<o)return{idx:n,t:(1-o)/(a+1-o)}}return null}(r,i,c?-1:1);if(!p)return null;let{idx:d,t:f}=p,m=d>1?ey(r.slice(0,d),i):[],g=d<r.length?ey(r.slice(d),i):[];m=m.map(r=>new e.P(ev(r.x),r.y)),g=g.map(r=>new e.P(ev(r.x),r.y));let _=[...m];0===_.length&&_.push(g[g.length-1]);let y=e.X(_[_.length-1].y,(0===g.length?m[0]:g[0]).y,f);return _.push(...c?[new e.P(0,y),new e.P(0,0),new e.P(1,0),new e.P(1,y)]:[new e.P(1,y),new e.P(1,1),new e.P(0,1),new e.P(0,y)]),0===g.length?_.push(m[0]):_.push(...g),{polygon:_.map(r=>new e.O(r.x,r.y)),unwrapped:!1}}(r,i);if(n)return n;let o=function(r,i){let n=!1,o=-1/0,a=0;for(let e=0;e<r.length-1;e++)r[e].x>o&&(o=r[e].x,a=e);for(let e=0;e<r.length-1;e++){let i=(a+e)%(r.length-1),o=r[i],s=r[i+1];Math.abs(o.x-s.x)>.5&&(o.x<s.x?(o.x+=1,0===i&&(r[r.length-1].x+=1)):(s.x+=1,i+1===r.length-1&&(r[0].x+=1)),n=!0)}let s=e.a8(i.center.lng);
16return n&&s<Math.abs(s-1)&&r.forEach(e=>{e.x-=1}),{polygon:r,unwrapped:n}}(ey(r,i).map(r=>new e.P(ev(r.x),r.y)),i);return{polygon:o.polygon.map(r=>new e.O(r.x,r.y)),unwrapped:o.unwrapped}}}function ey(r,i){return e.ac(r,e=>{let r=i.pointCoordinate3D(e);e.x=r.x,e.y=r.y},1/256)}function ev(e){return e<0?1+e%1:e%1}function ex(r,i,n,o,a){let s=function(n,o){if(n)return a(n);if(o){r.url&&o.tiles&&r.tiles&&delete r.tiles;let n=e.af(e.e(o,r),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(n.vectorLayers=o.vector_layers,n.vectorLayerIds=n.vectorLayers.map(e=>e.id)),o.raster_layers&&(n.rasterLayers=o.raster_layers,n.rasterLayerIds=n.rasterLayers.map(e=>e.id)),n.tiles=i.canonicalizeTileset(n,r.url),a(null,n)}};return r.url?e.g(i.transformRequest(i.normalizeSourceURL(r.url,null,n,o),e.R.Source),s):e.f.frame(()=>s(null,r))}class eb{constructor(r,i,n){this.bounds=e.ag.convert(this.validateBounds(r)),this.minzoom=i||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(r){let i=Math.pow(2,r.z),n=Math.floor(e.a8(this.bounds.getWest())*i),o=Math.floor(e.ah(this.bounds.getNorth())*i),a=Math.ceil(e.a8(this.bounds.getEast())*i),s=Math.ceil(e.ah(this.bounds.getSouth())*i);return r.x>=n&&r.x<a&&r.y>=o&&r.y<s}}class ew extends e.E{constructor(r,i,n,o){if(super(),this.id=r,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.af(i,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},i),this._collectResourceTiming=!!i.collectResourceTiming,512!==this.tileSize)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o),this._tileWorkers={},this._deduped=new e.ai}load(r){this._loaded=!1,this.fire(new e.b("dataloading",{dataType:"source"}));let i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map._worldview;this._tileJSONRequest=ex(this._options,this.map._requestManager,i,n,(o,a)=>{this._tileJSONRequest=null,this._loaded=!0,o?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&2!==n.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.a(o))):a&&(e.e(this,a),a.bounds&&(this.tileBounds=new eb(a.bounds,this.minzoom,this.maxzoom)),e.am(a.tiles,this.map._requestManager._customAccessToken),this.fire(new e.b("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.b("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();let r=e.aj(this.id,this.scope);this.load(()=>this.map.style.clearSource(r))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return e.e({},this._options)}loadTile(r,i){let n=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),o={request:this.map._requestManager.transformRequest(n,e.R.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.t
16ype,source:this.id,scope:this.scope,pixelRatio:e.f.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:r.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:r.isExtraShadowCaster};if(o.request.collectResourceTiming=this._collectResourceTiming,r.actor&&"expired"!==r.state)"loading"===r.state?r.reloadCallback=i:r.request=r.actor.send("reloadTile",o,a.bind(this));else if(r.actor=this._tileWorkers[n]=this._tileWorkers[n]||this.dispatcher.getActor(),this.dispatcher.ready)r.request=r.actor.send("loadTile",o,a.bind(this),void 0,!0);else{let i=e.ak.call({deduped:this._deduped},o,(e,i)=>{e||!i?a.call(this,e):(o.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},r.actor&&r.actor.send("loadTile",o,a.bind(this),void 0,!0))},!0);r.request={cancel:i}}function a(n,o){return delete r.request,r.aborted?i(null):n&&404!==n.status?i(n):(o&&o.resourceTiming&&(r.resourceTiming=o.resourceTiming),this.map._refreshExpiredTiles&&o&&r.setExpiryData(o),r.loadVectorData(o,this.map.painter),e.al(this.dispatcher),i(null),void(r.reloadCallback&&(this.loadTile(r,r.reloadCallback),r.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.t
16ype,source:this.id,scope:this.scope})}unloadTile(e){e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class eE extends e.E{constructor(r,i,n,o){super(),this.id=r,this.dispatcher=n,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},i),e.e(this,e.af(i,["url","scheme","tileSize"]))}load(r){this._loaded=!1,this.fire(new e.b("dataloading",{dataType:"source"})),this._tileJSONRequest=ex(this._options,this.map._requestManager,null,null,(i,n)=>{this._tileJSONRequest=null,this._loaded=!0,i?this.fire(new e.a(i)):n&&(e.e(this,n),n.bounds&&(this.tileBounds=new eb(n.bounds,this.minzoom,this.maxzoom)),e.am(n.tiles),this.fire(new e.b("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.b("data",{dataType:"source",sourceDataType:"content"}))),r&&r(i)})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();let r=e.aj(this.id,this.scope);this.load(()=>this.map.style.clearSource(r))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return e.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(r,i){let n=e.f.devicePixelRatio>=2,o=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize);r.request=e.d(this.map._requestManager.transformRequest(o,e.R.Tile),(n,o,a,s)=>(delete r.request,r.aborted?(r.state="unloaded",i(null)):n?(r.state="errored",i(n)):o?(this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:a,expires:s}),r.setTexture(o,this.map.painter),r.state="loaded",e.al(this.dispatcher),void i(null)):i(null)))}abortTile(e,r){e.request&&(e.request.cancel(),delete e.request),r()}unloadTile(r,i){r.texture&&r.texture instanceof e.T?(r.destroy(!0),r.texture&&r.texture instanceof e.T&&this.map.painter.saveTileTexture(r.texture)):r.destroy(),i()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class eS extends eE{constructor(r,i,n,o){super(r,i,n,o),this.type="raster-array",this.maxzoom=22,this._options=e.e({type:"raster-array"},i)}triggerRepaint(e){let r=this.map.painter._terrain,i=this.map.style.getSourceCache(this.id);r&&r.enabled&&i&&r._clearRenderCacheForTile(i.id,e.tileID),this.map.triggerRepaint()}loadTile(r,i){let n=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);r.requestParams=this.map._requestManager.transformRequest(n,e.R.Tile),r.actor||(r.actor=this.dispatcher.getActor()),r.request=r.fetchHeader(void 0,(e,n,o,a)=>{if(delete r.request,r.aborted)return r.state="unloaded",i(null);if(e){if(20===e.code)return;return r.state="errored",i(e)}this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:o,expires:a}),r.state="empty",i(null)})}unloadTile(r){let i=r.texture;i&&i instanceof e.T?(r.destroy(!0),this.map.painter.saveTileTexture(i)):(r.destroy(),r.flushQueues(),r._isHeaderLoaded=!1,delete r._mrt,delete r.textureDescriptor),r.fbo&&(r.fbo.destroy(),delete r.fbo),delete r.request,delete r.requestParams,delete r.neighboringTiles,r.state="unloaded"}prepareTile(r,i,n){r._isHeaderLoaded&&("empty"!==r.state&&(r.state="reloading"),r.fetchBand(i,n,(i,n)=>{i?(r.state="errored",this.fire(new e.a(i)),this.triggerRepaint(r)):n&&(r.setTexture(n,this.map.painter),r.state="loaded",this.triggerRepaint(r))}))}getInitialBand(e){if(!this.rasterLayers)return 0;let r=this.rasterLayers.find(({id:r})=>r===e),i=r&&r.fields,n=i&&i.bands&&i.bands;return n?n[0]:0}getTextureDescriptor(r,i,n){if(!r)return;let o=i.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!o)return;let a=null;i instanceof e.aq?a=i.paint.get("raster-array-band"):i instanceof e.ar&&(a=i.paint.get("raster-particle-array-band"));let s=a||this.getInitialBand(o);if(null!=s)if(r.textureDescriptor){if(!r.updateNeeded(o,s)||n)return Object.assign({},r.textureDescriptor,{texture:r.texture})}else this.prepareTile(r,o,s)}}let eT=new Uint16Array(8184);for(let e=0;e<2046;e++){let r=e+2,i=0,n=0,o=0,a=0,s=0,l=0;for(1&r?o=a=s=32:i=n=l=32;(r>>=1)>1;){let e=i+o>>1,u=n+a>>1;1&r?(o=i,a=n,i=s,n=l):(i=o,n=a,o=s,a=l),s=e,l=u}let u=4*e;eT[u+0]=i,eT[u+1]=n,eT[u+2]=o,eT[u+3]=a}let eI=new Uint16Array(2178),eM=new Uint8Array(1089),eC=new Uint16Array(1089);function eA(e){return 0===e?-.03125:.03125*(32===e)}class eP{constructor(e,r,i,n){this.id=eP.uniqueIdxCounter,eP.uniqueIdxCounter++,this.context=e;const o=e.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||n||r.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){this.id=eP.uniqueIdxCounter,eP.uniqueIdxCounter++;let r=this.context.gl;this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}eP.uniqueIdxCounter=0;let eL={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class eO{constructor(e,r,i,n,o,a){this.length=r.length,this.attributes=i,this.itemSize=r.bytesPerElement,this.dynamicDraw=n,this.instanceCount=a,this.context=e;const s=e.gl;this.buffer=s.createBuffer(),e.bindVertexBuffer.set(this.buffer),s.bufferData(s.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||o||r.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){let r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,e.arrayBuffer)}
16enableAttributes(e,r){for(let i=0;i<this.attributes.length;i++){let n=r.attributes[this.attributes[i].name];void 0!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,r,i){for(let n=0;n<this.attributes.length;n++){let o=this.attributes[n],a=r.attributes[o.name];void 0!==a&&e.vertexAttribPointer(a,o.components,e[eL[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||0))}}setVertexAttribDivisor(e,r,i){for(let n=0;n<this.attributes.length;n++){let o=r.attributes[this.attributes[n].name];void 0!==o&&this.instanceCount&&this.instanceCount>0&&e.vertexAttribDivisor(o,i)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class eD{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class eR extends eD{getDefault(){return e.aA.transparent}set(e){let r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class ek extends eD{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class eN extends eD{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class eF extends eD{getDefault(){return[!0,!0,!0,!0]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class ez extends eD{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class eB extends eD{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class eU extends eD{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let r=this.current;(e.func!==r.func||e.ref!==r.ref||e.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class ej extends eD{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class eV extends eD{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=e,this.dirty=!1}}class eG extends eD{getDefault(){return[0,1]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class eq extends eD{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=e,this.dirty=!1}}class eH extends eD{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class e$ extends eD{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.BLEND):r.disable(r.BLEND),this.current=e,this.dirty=!1}}class eW extends eD{getDefault(){let e=this.gl;return[e.ONE,e.ZERO,e.ONE,e.ZERO]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class eY extends eD{getDefault(){return e.aA.transparent}set(e){let r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class eZ extends eD{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1)}}class eX extends eD{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=e,this.dirty=!1}}class eK extends eD{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class eQ extends eD{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let eJ=class extends eD{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class e0 extends eD{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class e1 extends eD{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class e2 extends eD{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class e3 extends eD{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class e5 extends eD{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindTexture(r.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class e4 extends eD{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class e6 extends eD{getDefault(){return null}set(e){let r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class e8 extends eD{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}}class e9 extends eD{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class e7 extends eD{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class te extends eD{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class tt extends eD{constructor(e,r){super(e),this.context=e,this.parent=r}getDefault(){return null}}class tr extends tt{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class ti extends tt{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,this.attachment(),r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class tn extends tt{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,this.attachment(),r.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class to extends ti{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class ta{constructor(e,r,i,n,o){this.context=e,this.width=r,this.height=i;const a=this.framebuffer=e.gl.createFramebuffer();
16n&&(this.colorAttachment=new tr(e,a)),o&&(this.depthAttachmentType=o,this.depthAttachment="renderbuffer"===o?new ti(e,a):new tn(e,a))}destroy(){let e=this.context.gl;if(this.colorAttachment){let r=this.colorAttachment.get();r&&e.deleteTexture(r)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){let r=this.depthAttachment.get();r&&e.deleteRenderbuffer(r)}else{let r=this.depthAttachment.get();r&&e.deleteTexture(r)}e.deleteFramebuffer(this.framebuffer)}}class ts{constructor(e,r,i){this.func=e,this.mask=r,this.range=i}}ts.ReadOnly=!1,ts.ReadWrite=!0,ts.disabled=new ts(519,ts.ReadOnly,[0,1]);class tl{constructor(e,r,i,n,o,a){this.test=e,this.ref=r,this.mask=i,this.fail=n,this.depthFail=o,this.pass=a}}tl.disabled=new tl({func:519,mask:0},0,0,7680,7680,7680);class tu{constructor(e,r,i,n){this.blendFunction=e,this.blendColor=r,this.mask=i,this.blendEquation=n}}tu.Replace=[1,0,1,0],tu.disabled=new tu(tu.Replace,e.aA.transparent,[!1,!1,!1,!1]),tu.unblended=new tu(tu.Replace,e.aA.transparent,[!0,!0,!0,!0]),tu.alphaBlended=new tu([1,771,1,771],e.aA.transparent,[!0,!0,!0,!0]),tu.multiply=new tu([774,0,774,0],e.aA.transparent,[!0,!0,!0,!0]);class tc{constructor(e,r,i){this.enable=e,this.mode=r,this.frontFace=i}}tc.disabled=new tc(!1,1029,2305),tc.backCCW=new tc(!0,1029,2305),tc.backCW=new tc(!0,1029,2304),tc.frontCW=new tc(!0,1028,2304),tc.frontCCW=new tc(!0,1028,2305);class th{constructor(e,r){this.gl=e,this.clearColor=new eR(this),this.clearDepth=new ek(this),this.clearStencil=new eN(this),this.colorMask=new eF(this),this.depthMask=new ez(this),this.stencilMask=new eB(this),this.stencilFunc=new eU(this),this.stencilOp=new ej(this),this.stencilTest=new eV(this),this.depthRange=new eG(this),this.depthTest=new eq(this),this.depthFunc=new eH(this),this.blend=new e$(this),this.blendFunc=new eW(this),this.blendColor=new eY(this),this.blendEquation=new eZ(this),this.cullFace=new eX(this),this.cullFaceSide=new eK(this),this.frontFace=new eQ(this),this.program=new eJ(this),this.activeTexture=new e0(this),this.viewport=new e1(this),this.bindFramebuffer=new e2(this),this.bindRenderbuffer=new e3(this),this.bindTexture=new e5(this),this.bindVertexBuffer=new e4(this),this.bindElementBuffer=new e6(this),this.bindVertexArrayOES=new e8(this),this.pixelStoreUnpack=new e9(this),this.pixelStoreUnpackPremultiplyAlpha=new e7(this),this.pixelStoreUnpackFlipY=new te(this),this.options=r?{...r}:{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxPointSize=e.getParameter(e.ALIASED_POINT_SIZE_RANGE)[1]}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,r,i){return new eP(this,e,r,i)}createVertexBuffer(e,r,i,n,o){return new eO(this,e,r,i,n,o)}createRenderbuffer(e,r,i){let n=this.gl,o=n.createRenderbuffer();return this.bindRenderbuffer.set(o),n.renderbufferStorage(n.RENDERBUFFER,e,r,i),this.bindRenderbuffer.set(null),o}createFramebuffer(e,r,i,n){return new ta(this,e,r,i,n)}clear({color:e,depth:r,stencil:i,colorMask:n}){let o=this.gl,a=0;e&&(a|=o.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set(n||[!0,!0,!0,!0])),void 0!==r&&(a|=o.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),void 0!==i&&(a|=o.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),o.clear(a)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){n(e.blendFunction,tu.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor),e.blendEquation?this.blendEquation.set(e.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(e.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}var tp=e.aB([{name:"a_index",type:"Int16",components:1}]);class td{constructor(r,i,n,o){const a={width:n[0],height:n[1],data:null},s=r.gl;this.targetColorTexture=new e.T(r,a,s.RGBA,{useMipmap:!1}),this.backgroundColorTexture=new e.T(r,a,s.RGBA,{useMipmap:!1}),this.context=r,this.setParticleTextureDimension(i,o),this.lastInvalidatedAt=0}setParticleTextureDimension(r,i){if(this.particleTextureDimension===i)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());let n=this.context.gl,o=i*i,a=new Uint8Array(4*o),s=e.aC(r.key);for(let e=0;e<a.length;e+=4){let r=.7692307692307692*(s()+.15000000000000002),i=.7692307692307692*(s()+.15000000000000002),n=255*r%1,o=255*i%1,l=i-o/255;a[e+0]=Math.floor(255*(r-n/255)),a[e+1]=Math.floor(255*n),a[e+2]=Math.floor(255*l),a[e+3]=Math.floor(255*o)}let l=new e.h({width:i,height:i},a);this.particleTexture0=new e.T(this.context,l,n.RGBA,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,l,n.RGBA,{premultiply:!1,useMipmap:!1});let u=new e.aD;u.reserve(o);for(let e=0;e<o;e++)u.emplaceBack(e);this.particleIndexBuffer=this.context.createVertexBuffer(u,tp.members,!0),this.particleSegment=e.aE.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=i}update(r){return!(this.lastInvalidatedAt<r&&(this.lastInvalidatedAt=e.f.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}let tf={type:2,extent:e.Y,loadGeometry:()=>[[new e.P(0,0),new e.P(e.Y+1,0),new e.P(e.Y+1,e.Y+1),new e.P(0,e.Y+1),new e.P(0,0)]]};class tm{constructor(r,i,n,o,a){this.tileID=r,this.uid=e.aF(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=a,o&&o.style&&(this._lastUpdatedBrightness=o.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",o&&o.transform&&(this.projection=o.transform.projection)}registerFadeDuration(r){let i=r+this.timeAdded;i<e.f.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=e.av(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(r,i,n){if(this.unloadVectorData(),this.state="loaded",r){for(let o in r.featureIndex&&(this.latestFeatureIndex=r.featureIndex,r.rawTileData?(this.latestRawTileData=r.rawTileData,this.latestFeatureIndex.rawTileData=r.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=r.collisionBoxArray,this.buckets=function(e,r){let i={};if(!r)return i;for(let n of e){let e=n.layerIds.map(e=>
16r.getLayer(e)).filter(Boolean);if(0!==e.length)for(let r of(n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map(r=>e.filter(e=>e.id===r)[0])),e))i[r.fqid]=n}return i}(r.buckets,i.style),this.hasSymbolBuckets=!1,this.buckets){let r=this.buckets[o];if(r instanceof e.aH){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let r in this.buckets){let i=this.buckets[r];if(i instanceof e.aH&&i.hasRTLText){this.hasRTLText=!0,e.aI();break}}for(let e in this.queryPadding=0,this.buckets){let r=this.buckets[e],n=i.style.getOwnLayer(e);if(!n)continue;let o=n.queryRadius(r);this.queryPadding=Math.max(this.queryPadding,o)}r.imageAtlas&&(this.imageAtlas=r.imageAtlas),r.glyphAtlasImage&&(this.glyphAtlasImage=r.glyphAtlasImage),r.lineAtlas&&(this.lineAtlas=r.lineAtlas),this._lastUpdatedBrightness=r.brightness}else this.collisionBoxArray=new e.aG}unloadVectorData(){if(this.hasData()){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.fqid]}upload(r){for(let e in this.buckets){let i=this.buckets[e];i.uploadPending()&&i.upload(r)}let i=r.gl,n=this.imageAtlas;if(n&&!n.uploaded){let o=!!Object.keys(n.patternPositions).length;this.imageAtlasTexture=new e.T(r,n.image,i.RGBA,{useMipmap:o}),this.imageAtlas.uploaded=!0}this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(r,this.glyphAtlasImage,i.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new e.T(r,this.lineAtlas.image,i.R8),this.lineAtlas.uploaded=!0)}prepare(e,r,i){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,i),!r||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;let n=r.style.getBrightness();(this._lastUpdatedBrightness||n)&&(this._lastUpdatedBrightness&&n&&.001>Math.abs(this._lastUpdatedBrightness-n)||(this._lastUpdatedBrightness=n,this.updateBuckets(void 0,r)))}queryRenderedFeatures(e,r,i,n,o,a,s,l){return this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)?this.latestFeatureIndex.query({tileResult:n,pixelPosMatrix:s,transform:a,params:o,tileTransform:this.tileTransform},e,r,i):{}}querySourceFeatures(r,i){let n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;let o=n.loadVTLayers(),a=i?i.sourceLayer:"",s=o._geojsonTileLayer||o[a];if(!s)return;let l=e.aJ(i&&i.filter),{z:u,x:c,y:h}=this.tileID.canonical,p={z:u,x:c,y:h};for(let i=0;i<s.length;i++){let o=s.feature(i);if(l.needGeometry){let r=e.aK(o,!0);if(!l.filter(new e.N(this.tileID.overscaledZ),r,this.tileID.canonical))continue}else if(!l.filter(new e.N(this.tileID.overscaledZ),o))continue;let d=n.getId(o,a),f=new e.aL(o,u,c,h,d);f.tile=p,r.push(f)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}bucketsLoaded(){for(let e in this.buckets)if(this.buckets[e].uploadPending())return!1;return!0}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(r){let i=this.expirationTime;if(r.cacheControl){let i=e.aM(r.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else r.expires&&(this.expirationTime=new Date(r.expires).getTime());if(this.expirationTime){let e=Date.now(),r=!1;if(this.expirationTime>e)r=!1;else if(i)if(this.expirationTime<i)r=!0;else{let n=this.expirationTime-i;n?this.expirationTime=e+Math.max(n,3e4):r=!0}else r=!0;r?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),0x7fffffff)}setFeatureState(e,r){this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(e).length&&r&&this.updateBuckets(e,r)}updateBuckets(r,i){if(!this.latestFeatureIndex)return;let n=this.latestFeatureIndex.loadVTLayers(),o=i.style.listImages(),a=i.style.getBrightness();for(let s in this.buckets){if(!i.style.hasLayer(s))continue;let l=this.buckets[s],u=l.layers[0].sourceLayer||"_geojsonTileLayer",c=n[u],h={};if(r&&(h=r[u],!c||!h||0===Object.keys(h).length))continue;if(l.update(h,c,o,this.imageAtlas&&this.imageAtlas.patternPositions||{},a),l instanceof e.aN||l instanceof e.aO){let e=i.style.getOwnSourceCache(l.layers[0].source);i._terrain&&i._terrain.enabled&&e&&l.programConfigurations.needsUpload&&i._terrain._clearRenderCacheForTile(e.id,this.tileID)}let p=i&&i.style&&i.style.getOwnLayer(s);p&&(this.queryPadding=Math.max(this.queryPadding,p.queryRadius(l)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.f.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(r){this.symbolFadeHoldUntil=e.f.now()+r}setTexture(r,i){let n=i.context,o=n.gl;this.texture=this.texture||i.getTileTexture(r.width),this.texture&&this.texture instanceof e.T?this.texture.update(r,{useMipmap:!0}):(this.texture=new e.T(n,r,o.RGBA,{useMipmap:!0}),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE))}
16setDependencies(e,r){let i={};for(let e of r)i[e]=!0;this.dependencies[e]=i}hasDependency(e,r){for(let i of e){let e=this.dependencies[i];if(e){for(let i of r)if(e[i])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(r,i){if(!i||"mercator"===i.name||this._tileDebugBuffer)return;let n=e.aP(tf,this.tileID.canonical,this.tileTransform)[0],o=new e.aQ,a=new e.aR;for(let e=0;e<n.length;e++){let{x:r,y:i}=n[e];o.emplaceBack(r,i),a.emplaceBack(e)}a.emplaceBack(0),this._tileDebugIndexBuffer=r.createIndexBuffer(a),this._tileDebugBuffer=r.createVertexBuffer(o,e.aS.members),this._tileDebugSegments=e.aE.simpleSegment(0,0,o.length,a.length)}_makeTileBoundsBuffers(r,i){let n,o;if(this._tileBoundsBuffer||!i||"mercator"===i.name)return;let a=e.aP(tf,this.tileID.canonical,this.tileTransform)[0];if(this.isRaster){let r=function(r,i){let n=e.av(r,i),o=Math.pow(2,r.z);for(let a=0;a<33;a++)for(let s=0;s<33;s++){let l=e.aw((r.x+(s+eA(s))/32)/o),u=e.ax((r.y+(a+eA(a))/32)/o),c=i.project(l,u),h=33*a+s;eI[2*h+0]=Math.round((c.x*n.scale-n.x)*e.Y),eI[2*h+1]=Math.round((c.y*n.scale-n.y)*e.Y)}eM.fill(0),eC.fill(0);for(let e=2045;e>=0;e--){let r=4*e,i=eT[r+0],n=eT[r+1],o=eT[r+2],a=eT[r+3],s=i+o>>1,l=n+a>>1,u=s+l-n,c=l+i-s,h=33*n+i,p=33*a+o,d=33*l+s,f=Math.hypot((eI[2*h+0]+eI[2*p+0])/2-eI[2*d+0],(eI[2*h+1]+eI[2*p+1])/2-eI[2*d+1])>=16;eM[d]=eM[d]||+!!f,e<1022&&(eM[d]=eM[d]||eM[(n+c>>1)*33+(i+u>>1)]||eM[(a+c>>1)*33+(o+u>>1)])}let a=new e.ay,s=new e.az,l=0;function u(r,i){let n=33*i+r;return 0===eC[n]&&(a.emplaceBack(eI[2*n+0],eI[2*n+1],r*e.Y/32,i*e.Y/32),eC[n]=++l),eC[n]-1}function c(e,r,i,n,o,a){let l=e+i>>1,h=r+n>>1;if(Math.abs(e-o)+Math.abs(r-a)>1&&eM[33*h+l])c(o,a,e,r,l,h),c(i,n,o,a,l,h);else{let l=u(e,r),c=u(i,n),h=u(o,a);s.emplaceBack(l,c,h)}}return c(0,0,32,32,32,0),c(32,32,0,0,0,32),{vertices:a,indices:s}}(this.tileID.canonical,i);n=r.vertices,o=r.indices}else{for(let{x:r,y:i}of(n=new e.ay,o=new e.az,a))n.emplaceBack(r,i,0,0);let r=e.aT(n.int16,void 0,4);for(let e=0;e<r.length;e+=3)o.emplaceBack(r[e],r[e+1],r[e+2])}this._tileBoundsBuffer=r.createVertexBuffer(n,e.aU.members),this._tileBoundsIndexBuffer=r.createIndexBuffer(o),this._tileBoundsSegments=e.aE.simpleSegment(0,0,n.length,o.length)}_makeGlobeTileDebugBuffers(r,i){let n,o=i.projection;if(!o||"globe"!==o.name||i.freezeTileCoverage)return;let a=this.tileID.canonical,s=e.aV(a,i),l=e.aW(s),u=e.W(i.zoom);u>0&&(n=e.a9.invert(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(r,a,i,l,n,u),this._makeGlobeTileDebugTextBuffer(r,a,i,l,n,u)}_globePoint(r,i,n,o,a,s,l){let u=e.aX(r,i,n);if(s){let a=1<<n.z,c=e.a8(o.center.lng),h=e.ah(o.center.lat),p=(n.x+.5)/a-c,d=0;p>.5?d=-1:p<-.5&&(d=1);let f=(r/e.Y+n.x)/a+d,m=(i/e.Y+n.y)/a;f=(f-c)*o._pixelsPerMercatorPixel+c,m=(m-h)*o._pixelsPerMercatorPixel+h;let g=[f*o.worldSize,m*o.worldSize,0];e.Q.transformMat4(g,g,s),u=e.aY(u,g,l)}return e.Q.transformMat4(u,u,a)}_makeGlobeTileDebugBorderBuffer(r,i,n,o,a,s){let l=new e.aQ,u=new e.aR,c=new e.aZ,h=(e,r,h,p,d)=>{let f=(h-e)/(d-1),m=(p-r)/(d-1),g=l.length;for(let h=0;h<d;h++){let p=e+h*f,d=r+h*m;l.emplaceBack(p,d);let _=this._globePoint(p,d,i,n,o,a,s);c.emplaceBack(_[0],_[1],_[2]),u.emplaceBack(g+h)}},p=e.Y;h(0,0,p,0,16),h(p,0,p,p,16),h(p,p,0,p,16),h(0,p,0,0,16),this._tileDebugIndexBuffer=r.createIndexBuffer(u),this._tileDebugBuffer=r.createVertexBuffer(l,e.aS.members),this._globeTileDebugBorderBuffer=r.createVertexBuffer(c,e.a_.members),this._tileDebugSegments=e.aE.simpleSegment(0,0,l.length,u.length)}_makeGlobeTileDebugTextBuffer(r,i,n,o,a,s){let l=e.Y/4,u=new e.aQ,c=new e.az,h=new e.aZ;c.reserve(32),u.reserve(25),h.reserve(25);let p=(e,r)=>25*e+r;for(let e=0;e<25;e++){let r=e*l;for(let e=0;e<25;e++){let c=e*l;u.emplaceBack(c,r);let p=this._globePoint(c,r,i,n,o,a,s);h.emplaceBack(p[0],p[1],p[2])}}for(let e=0;e<4;e++)for(let r=0;r<4;r++){let i=p(e,r),n=p(e,r+1),o=p(e+1,r),a=p(e+1,r+1);c.emplaceBack(i,n,o),c.emplaceBack(o,n,a)}this._tileDebugTextIndexBuffer=r.createIndexBuffer(c),this._tileDebugTextBuffer=r.createVertexBuffer(u,e.aS.members),this._globeTileDebugTextBuffer=r.createVertexBuffer(h,e.a_.members),this._tileDebugTextSegments=e.aE.simpleSegment(0,0,25,32)}destroy(r=!1){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),!r&&this.texture&&this.texture instanceof e.T&&(this.texture.destroy(),delete this.texture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}}let tg={vector:ew,raster:eE,"raster-dem":class extends eE{constructor(r,i,n,o){super(r,i,n,o),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(r,i){let n=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function o(e,n){e&&(r.state="errored",i(e)),n&&(r.dem=n,r.dem.onDeserialize(),r.needsHillshadePrepare=!0,r.needsDEMTextureUpload=!0,r.state="loaded",i(null))}r.request=e.d(this.map._requestManager.transformRequest(n,e.R.Tile),(function(n,a,s,l){if(delete r.request,r.aborted)r.state="unloaded",i(null);else if(n)r.state="errored",i(n);
16else if(a){this.map._refreshExpiredTiles&&r.setExpiryData({cacheControl:s,expires:l});let i=ImageBitmap&&a instanceof ImageBitmap&&e.an(),n=1-(a.width-e.ao(a.width))/2;n<1||r.neighboringTiles||(r.neighboringTiles=this._getNeighboringTiles(r.tileID));let u=i?a:e.f.getImageData(a,n),c={uid:r.uid,coord:r.tileID,source:this.id,scope:this.scope,rawImageData:u,encoding:this.encoding,padding:n};r.actor&&"expired"!==r.state||(r.actor=this.dispatcher.getActor(),r.actor.send("loadDEMTile",c,o.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(r){let i=r.canonical,n=Math.pow(2,i.z),o=(i.x-1+n)%n,a=0===i.x?r.wrap-1:r.wrap,s=(i.x+1+n)%n,l=i.x+1===n?r.wrap+1:r.wrap,u={};return u[new e.ap(r.overscaledZ,a,i.z,o,i.y).key]={backfilled:!1},u[new e.ap(r.overscaledZ,l,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(u[new e.ap(r.overscaledZ,a,i.z,o,i.y-1).key]={backfilled:!1},u[new e.ap(r.overscaledZ,r.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},u[new e.ap(r.overscaledZ,l,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<n&&(u[new e.ap(r.overscaledZ,a,i.z,o,i.y+1).key]={backfilled:!1},u[new e.ap(r.overscaledZ,r.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},u[new e.ap(r.overscaledZ,l,i.z,s,i.y+1).key]={backfilled:!1}),u}},"raster-array":eS,geojson:class extends e.E{constructor(r,i,n,o){super(),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(o),this._data=i.data,this._options=e.e({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),void 0!==i.minzoom&&(this.minzoom=i.minzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const a=e.Y/this.tileSize;this.workerOptions=e.e({source:this.id,scope:this.scope,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*a,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*a,extent:e.Y,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.Y,radius:(void 0!==i.clusterRadius?i.clusterRadius:50)*a,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter,dynamic:i.dynamic},i.workerOptions)}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(r){return this._options.dynamic?(this._data=r,this._updateWorkerData(!0),this):this.fire(new e.a(Error("Can't call updateData on a GeoJSON source with dynamic set to false.")))}getClusterExpansionZoom(e,r){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id,scope:this.scope},r),this}getClusterChildren(e,r){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id,scope:this.scope},r),this}getClusterLeaves(e,r,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:e,limit:r,offset:i},n),this}_updateWorkerData(r=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.b("dataloading",{dataType:"source"})),this._loaded=!1;let i=e.e({append:r},this.workerOptions);i.scope=this.scope;let n=this._data;"string"==typeof n?(i.request=this.map._requestManager.transformRequest(e.f.resolveURL(n),e.R.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,i,(i,n)=>{if(this._loaded=!0,this._pendingLoad=null,i)this.fire(new e.a(i));else{let r={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&n&&n.resourceTiming&&n.resourceTiming[this.id]&&(r.resourceTiming=n.resourceTiming[this.id]),this.fire(new e.b("data",r)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(r),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(r,i){let n=r.actor?"reloadTile":"loadTile";r.actor=this.actor;let o={type:this.type,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,scope:this.scope,pixelRatio:e.f.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0};r.request=this.actor.send(n,o,(e,o)=>(delete r.request,r.destroy(),r.aborted?i(null):e?i(e):(r.loadVectorData(o,this.map.painter,"reloadTile"===n),i(null))),void 0,"loadTile"===n)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e){this.actor.send("removeTile",{uid:e.uid,type:this.t
16ype,source:this.id,scope:this.scope}),e.destroy()}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends e.as{constructor(e,r,i,n){super(e,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}load(){this._loaded=!1;let r=this.options;for(let i of(this.urls=[],r.urls))this.urls.push(this.map._requestManager.transformRequest(i,e.R.Source).url);e.at(this.urls,(r,i)=>{this._loaded=!0,r?this.fire(new e.a(r)):i&&(this.video=i,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(r){if(this.video){let i=this.video.seekable;r<i.start(0)||r>i.end(0)?this.fire(new e.a(new e.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=r}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let r=this.map.painter.context,i=r.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(r,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(r)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:e.as,model:class extends e.E{constructor(e,r,i,n){super(),this.id=e,this.type="model",this.models=[],this._loaded=!1,this._options=r}load(){let r=[];for(let i in this._options.models){let n=this._options.models[i],o=e.l(this.map._requestManager.transformRequest(n.uri,e.R.Model).url).then(r=>{if(!r)return;let o=e.c(r),a=new e.M(i,n.position,n.orientation,o);a.computeBoundsAndApplyParent(),this.models.push(a)}).catch(r=>{this.fire(new e.a(Error(`Could not load model ${i} from ${n.uri}: ${r.message}`)))});r.push(o)}return Promise.allSettled(r).then(()=>{this._loaded=!0,this.fire(new e.b("data",{dataType:"source",sourceDataType:"metadata"}))}).catch(r=>{this.fire(new e.a(Error(`Could not load models: ${r.message}`)))})}onAdd(e){this.map=e,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(e,r){}serialize(){return{type:"model"}}},"batched-model":class extends e.E{constructor(e,r,i,n){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=r,this.tiles=this._options.tiles,this.maxzoom=r.maxzoom||19,this.minzoom=r.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=i,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(n)}onAdd(e){this.map=e,this.load()}load(r){this._loaded=!1,this.fire(new e.b("dataloading",{dataType:"source"}));let i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map._worldview;this._tileJSONRequest=ex(this._options,this.map._requestManager,i,n,(o,a)=>{this._tileJSONRequest=null,this._loaded=!0,o?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&2!==n.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.a(o))):a&&(e.e(this,a),a.bounds&&(this.tileBounds=new eb(a.bounds,this.minzoom,this.maxzoom)),e.am(a.tiles,this.map._requestManager._customAccessToken),this.fire(new e.b("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.b("data",{dataType:"source",sourceDataType:"content"}))),r&&r(o)})}hasTransition(){return!1}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}loadTile(r,i){let n=this.map._requestManager.normalizeTileURL(r.tileID.canonical.url(this.tiles,this.scheme)),o={request:this.map._requestManager.transformRequest(n,e.R.Tile),data:void 0,uid:r.uid,tileID:r.tileID,tileZoom:r.tileZoom,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.t
16ype,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:r.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0};if(r.actor&&"expired"!==r.state)if("loading"===r.state)r.reloadCallback=i;else{if(r.buckets){for(let e of Object.values(r.buckets))e.dirty=!0;return void(r.state="loaded")}r.request=r.actor.send("reloadTile",o,a.bind(this))}else r.actor=this.dispatcher.getActor(),r.request=r.actor.send("loadTile",o,a.bind(this),void 0,!0);function a(e,n){return r.aborted?i(null):e&&404!==e.status?i(e):(n&&(n.resourceTiming&&(r.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&r.setExpiryData(n),r.buckets={...r.buckets,...n.buckets},n.featureIndex&&(r.latestFeatureIndex=n.featureIndex)),r.state="loaded",void i(null))}}serialize(){return e.e({},this._options)}},canvas:class extends e.as{constructor(r,i,n,o){super(r,i,n,o),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(e=>!Array.isArray(e)||2!==e.length||e.some(e=>"number"!=typeof e))||this.fire(new e.a(new e.V(`sources.${r}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.a(new e.V(`sources.${r}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.a(new e.V(`sources.${r}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.a(new e.V(`sources.${r}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.a(new e.V(`sources.${r}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.a(Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let r=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,r=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,r=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let i=this.map.painter.context;this.texture?!r&&!this._playing||this.texture instanceof e.au||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(i,this.canvas,i.gl.RGBA,{premultiply:!0}),this._prepareData(i)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.E{constructor(r,i,n,o){super(),this.id=r,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=i,this.setEventedParent(o),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.a(Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.a(Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new eb(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),e.e(this,e.af(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.af(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.b("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.b("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(r){this._map=r,this._loaded=!1,this.fire(new e.b("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(r),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){let{x:r,y:i,z:n}=e.canonical;return this._implementation.hasTile({x:r,y:i,z:n})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,r){let{x:i,y:n,z:o}=e.tileID.canonical,a=new AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:i,y:n,z:o},{signal:a.signal})).then((function(i){return delete e.request,e.aborted?(e.state="unloaded",r(null)):void 0===i?(e.state="errored",r(null)):null===i?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",r(null)):i instanceof ImageData||i instanceof HTMLCanvasElement||i instanceof ImageBitmap||i instanceof HTMLImageElement?(this.loadTileData(e,i),e.state="loaded",void r(null)):(e.state="errored",r(Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(i=>{20!==i.code&&(e.state="errored",r(i))}),e.request.cancel=()=>a.abort()}loadTileData(e,r){e.setTexture(r,this._map.painter)}unloadTile(r,i){if(r.texture&&r.texture instanceof e.T?(r.destroy(!0),r.texture&&r.texture instanceof e.T&&this._map.painter.saveTileTexture(r.texture)):r.destroy(),this._implementation.unloadTile){let{x:e,y:i,z:n}=r.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:n})}i()}abortTile(e,r){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),r()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z}))}_clearTiles(){let r=e.aj(this.id,this.scope);this._map.style.clearSource(r)}
16_update(){this.fire(new e.b("data",{dataType:"source",sourceDataType:"content"}))}}},t_=function(r,i,n,o){let a=new tg[i.type](r,i,n,o);if(a.id!==r)throw Error(`Expected Source id to be ${r} instead of ${a.id}`);return e.a$(["load","abort","unload","serialize","prepare"],a),a};function ty(e,r){let i=e.tileID,n=r.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}class tv extends tm{constructor(e,r,i,n,o){super(e,r,i,n,o),this._workQueue=[],this._fetchQueue=[],this._isHeaderLoaded=!1}setTexture(r,i){let n=i.context,o=n.gl;this.texture=this.texture||i.getTileTexture(r.width),this.texture&&this.texture instanceof e.T?this.texture.update(r,{useMipmap:!1,premultiply:!1}):this.texture=new e.T(n,r,o.RGBA,{useMipmap:!1,premultiply:!1})}flushQueues(){for(;this._workQueue.length;)this._workQueue.pop()();for(;this._fetchQueue.length;)this._fetchQueue.pop()()}fetchHeader(r=16384,i){let n=this._mrt=new e.b0(30),o=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(r-1)}});return this.entireBuffer=null,this.request=e.b1(o,(e,o,a,s)=>{if(e)i(e);else try{let e=n.getHeaderLength(o);if(e>r)return void(this.request=this.fetchHeader(e,i));n.parseHeader(o),this._isHeaderLoaded=!0;let l=0;for(let e of Object.values(n.layers))l=Math.max(l,e.dataIndex[e.dataIndex.length-1].last_byte);o.byteLength>=l&&(this.entireBuffer=o),i(null,this.entireBuffer||o,a,s)}catch(e){i(e)}}),this.request}fetchBand(r,i,n){let o,a=this._mrt;if(!this._isHeaderLoaded||!a)return void n(Error("Tile header is not ready"));let s=this.actor;if(!s)return void n(Error("Can't fetch tile band without an actor"));let l=(e,a)=>{o.complete(e,a),e?n(e):(this.updateTextureDescriptor(r,i),n(null,this.textureDescriptor&&this.textureDescriptor.img))},u=(e,r)=>{if(e)return n(e);let i=s.send("decodeRasterArray",{buffer:r,task:o},l,void 0,!0);this._workQueue.push(()=>{i&&i.cancel(),o.cancel()})},c=a.getLayer(r);if(!c)return void n(Error(`Unknown sourceLayer "${r}"`));if(c.hasDataForBand(i))return this.updateTextureDescriptor(r,i),void n(null,this.textureDescriptor?this.textureDescriptor.img:null);let h=c.getDataRange([i]);if((o=a.createDecodingTask(h))&&!o.tasks.length)n(null);else if(this.flushQueues(),this.entireBuffer)u(null,this.entireBuffer.slice(h.firstByte,h.lastByte+1));else{let r=Object.assign({},this.requestParams,{headers:{Range:`bytes=${h.firstByte}-${h.lastByte}`}}),i=e.b1(r,u);this._fetchQueue.push(()=>{i.cancel(),o.cancel()})}}updateNeeded(e,r){return(!this.textureDescriptor||this.textureDescriptor.band!==r||this.textureDescriptor.layer!==e)&&"errored"!==this.state}updateTextureDescriptor(r,i){if(!this._mrt)return;let n=this._mrt.getLayer(r);if(!n||!n.hasBand(i)||!n.hasDataForBand(i))return;let{bytes:o,tileSize:a,buffer:s,offset:l,scale:u}=n.getBandView(i),c=a+2*s,h={data:o,width:c,height:c},p=this.texture;p&&p instanceof e.T&&p.update(h,{useMipmap:!1,premultiply:!1}),this.textureDescriptor={layer:r,band:i,img:h,buffer:s,offset:l,tileSize:a,format:n.pixelFormat,mix:[u,256*u,65536*u,0x1000000*u]}}}class tx{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(let e in this.data)for(let r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,i){let n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);let o={value:r,timeout:void 0};if(void 0!==i&&(o.timeout=setTimeout(()=>{this.remove(e,o)},i)),this.data[n].push(o),this.order.push(n),this.order.length>this.max){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){let r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;let i=e.wrapped().key,n=void 0===r?0:this.data[i].indexOf(r),o=this.data[i][n];return this.data[i].splice(n,1),o.timeout&&clearTimeout(o.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){let r=[];for(let i in this.data)for(let n of this.data[i])e(n.value)||r.push(n);for(let e of r)this.remove(e.value.tileID,e)}}class tb extends e.E{constructor(e,r,i){super(),this.id=e,this._onlySymbols=i,r.on("data",e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),r.on("error",()=>{this._sourceErrored=!0}),this._source=r,this._tiles={},this._cache=new tx(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={}
16,this._minTileCacheSize=r.minTileCacheSize,this._maxTileCacheSize=r.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new b,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(let e in this._tiles){let r=this._tiles[e];if("errored"!==r.state&&("loaded"!==r.state||!r.bucketsLoaded()))return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,r){return e.isSymbolTile=this._onlySymbols,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],this._source.loadTile(e,r)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,()=>{})}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,()=>{})}serialize(){return this._source.serialize()}prepare(e){for(let r in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){let i=this._tiles[r];i.upload(e),i.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return e.b2(this._tiles).map(e=>e.tileID).sort(tw).map(e=>e.key)}getRenderableIds(r,i){let n=[];for(let e in this._tiles)this._isIdRenderable(+e,r,i)&&n.push(this._tiles[e]);return r?n.sort((r,i)=>{let n=r.tileID,o=i.tileID,a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),s=new e.P(o.canonical.x,o.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x}).map(e=>e.tileID.key):n.map(e=>e.tileID).sort(tw).map(e=>e.key)}hasRenderableParent(e){let r=this.findLoadedParent(e,0);return!!r&&this._isIdRenderable(r.tileID.key)}_isIdRenderable(e,r,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(r||!this._tiles[e].holdingForFade())&&(i||!this._shadowCasterTiles[e])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else for(let e in this._cache.reset(),this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}_reloadTile(e,r){let i=this._tiles[e];i&&("loading"!==i.state&&(i.state=r),this._loadTile(i,this._tileLoaded.bind(this,i,e,r)))}_tileLoaded(r,i,n,o){if(o)if(r.state="errored",404!==o.status)this._source.fire(new e.a(o,{tile:r}));else{if(!(r.tileID.key in this._loadedParentTiles))return void this._source.fire(new e.b("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id}));if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){let e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform)}else r.timeAdded=e.f.now(),"expired"===n&&(r.refreshedUponExpiration=!0),this._setTileReloadTimer(i,r),"raster-dem"===this._source.type&&r.dem&&this._backfillDEM(r),this._state.initializeTileState(r,this.map?this.map.painter:null),this._source.fire(new e.b("data",{dataType:"source",tile:r,coord:r.tileID,sourceCacheId:this.id}))}_backfillDEM(e){let r=this.getRenderableIds();for(let n=0;n<r.length;n++){let o=r[n];if(e.neighboringTiles&&e.neighboringTiles[o]){let r=this.getTileByID(o);i(e,r),i(r,e)}}function i(e,r){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let i=r.tileID.canonical.x-e.tileID.canonical.x,n=r.tileID.canonical.y-e.tileID.canonical.y,o=Math.pow(2,e.tileID.canonical.z),a=r.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+o)?i+=o:1===Math.abs(i-o)&&(i-=o)),r.dem&&e.dem&&(e.dem.backfillBorder(r.dem,i,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}
16getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,r,i,n){for(let o in this._tiles){let a=this._tiles[o];if(n[o]||!a.hasData()||a.tileID.overscaledZ<=r||a.tileID.overscaledZ>i)continue;let s=a.tileID;for(;a&&a.tileID.overscaledZ>r+1;){let e=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[e.key])&&a.hasData()&&(s=e)}let l=s;for(;l.overscaledZ>r;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[s.key]=s;break}}}findLoadedParent(e,r){if(e.key in this._loadedParentTiles){let i=this._loadedParentTiles[e.key];return i&&i.tileID.overscaledZ>=r?i:null}for(let i=e.overscaledZ-1;i>=r;i--){let r=e.scaledTo(i),n=this._getLoadedTile(r);if(n)return n}}_getLoadedTile(e){let r=this._tiles[e.key];return r&&r.hasData()?r:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,r){r=r||this._source.tileSize;let i=Math.floor((Math.ceil(e.width/r)+1)*(Math.ceil(e.height/r)+1)*5),n="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,i):i,o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(o)}handleWrapJump(e){let r=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,r){let e={};for(let i in this._tiles){let n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+r),e[n.tileID.key]=n}for(let r in this._tiles=e,this._timers)clearTimeout(this._timers[r]),delete this._timers[r];for(let e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(r,i,n,o){let a;if(this.transform=r,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!n)return;if(this.updateCacheSize(r,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={},this.used||this.usedForTerrain)if(this._source.tileID)a=r.getVisibleUnwrappedCoordinates(this._source.tileID).map(r=>new e.ap(r.canonical.z,r.wrap,r.canonical.z,r.canonical.x,r.canonical.y));else if(0!==this.tileCoverLift){let o=r.clone();o.tileCoverLift=this.tileCoverLift,a=o.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.minzoom<=1&&"globe"===r.projection.name&&(a.push(new e.ap(1,0,1,0,0)),a.push(new e.ap(1,0,1,1,0)),a.push(new e.ap(1,0,1,0,1)),a.push(new e.ap(1,0,1,1,1)))}else a=r.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(a=a.filter(e=>this._source.hasTile(e)));else a=[];if(a.length>0&&this.castsShadows&&o&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!tE(this._source.type)){let e=Math.min(r.coveringZoomLevel({tileSize:i||this._source.tileSize,roundZoom:this._source.roundZoom&&!n}),this._source.maxzoom);for(let i of r.extendTileCoverForShadows(a,o,e))this._shadowCasterTiles[i.key]=!0,a.push(i)}let s=this._updateRetainedTiles(a);if(tE(this._source.type)&&0!==a.length){let r={},i={};for(let n of Object.keys(s)){let o=s[n],a=this._tiles[n];if(!a||a.fadeEndTime&&a.fadeEndTime<=e.f.now())continue;let l=this.findLoadedParent(o,Math.max(o.overscaledZ-tb.maxOverzooming,this._source.minzoom));l&&(this._addTile(l.tileID),r[l.tileID.key]=l.tileID),i[n]=o}let n=a[a.length-1].overscaledZ;for(let e in this._tiles){let r=this._tiles[e];if(s[e]||!r.hasData())continue;let o=r.tileID;for(;o.overscaledZ>n;){o=o.scaledTo(o.overscaledZ-1);let n=this._tiles[o.key];if(n&&n.hasData()&&i[o.key]){s[e]=r.tileID;break}}}for(let e in r)s[e]||(this._coveredTiles[e]=!0,s[e]=r[e])}for(let e in s)this._tiles[e].clearFadeHold();for(let r of e.b3(this._tiles,s)){let e=this._tiles[r];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(+r)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(let e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){let r={};if(0===e.length)return r;let i={},n=e.reduce((e,r)=>
16Math.min(e,r.overscaledZ),1/0),o=e[0].overscaledZ,a=Math.max(o-tb.maxOverzooming,this._source.minzoom),s=Math.max(o+tb.maxUnderzooming,this._source.minzoom),l={};for(let i of e){let e=this._addTile(i);r[i.key]=i,e.hasData()||n<this._source.maxzoom&&(l[i.key]=i)}for(let o of(this._retainLoadedChildren(l,n,s,r),e)){let e=this._tiles[o.key];if(e.hasData())continue;if(o.canonical.z>=this._source.maxzoom){let e=o.children(this._source.maxzoom)[0],i=this.getTile(e);if(i&&i.hasData()){r[e.key]=e;continue}}else{let e=o.children(this._source.maxzoom);if(r[e[0].key]&&r[e[1].key]&&r[e[2].key]&&r[e[3].key])continue}let n=e.wasRequested();for(let s=o.overscaledZ-1;s>=a;--s){let a=o.scaledTo(s);if(i[a.key]||(i[a.key]=!0,(e=this.getTile(a))||!n||(e=this._addTile(a)),e&&(r[a.key]=a,n=e.wasRequested(),e.hasData())))break}}return r}_updateLoadedParentTileCache(){for(let e in this._loadedParentTiles={},this._tiles){let r=[],i,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}r.push(n.key);let e=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(e))break;n=e}for(let e of r)this._loadedParentTiles[e]=i}}_addTile(r){let i=this._tiles[r.key];if(i)return!0!==i.isExtraShadowCaster||this._shadowCasterTiles[r.key]||this._reloadTile(r.key,"reloading"),i;(i=this._cache.getAndRemove(r))&&(this._setTileReloadTimer(r.key,i),i.tileID=r,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[r.key]&&(clearTimeout(this._cacheTimers[r.key]),delete this._cacheTimers[r.key],this._setTileReloadTimer(r.key,i)));let n=!!i;if(!n){let e=this.map?this.map.painter:null,n=this._source.tileSize*r.overscaleFactor();i="raster-array"===this._source.type?new tv(r,n,this.transform.tileZoom,e,this._isRaster):new tm(r,n,this.transform.tileZoom,e,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,r.key,i.state))}return i?(i.uses++,this._tiles[r.key]=i,n||this._source.fire(new e.b("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,r){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);let i=r.getExpiryTimeout();i&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},i))}_removeTile(e){let r=this._tiles[e];r&&(r.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),r.uses>0||(r.hasData()&&"reloading"!==r.state||"empty"===r.state?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}clearTiles(){for(let e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(r,i,n){let o=[],a=this.transform;if(!a)return o;let s="globe"===a.projection.name,l=e.a8(a.center.lng);for(let u in this._tiles){let c,h=this._tiles[u];if(n&&h.clearQueryDebugViz(),!h.holdingForFade()){if(s){let r=h.tileID.canonical;if(0===r.z){let i=[Math.abs(e.ad(l,...tS(r,-1))-l),Math.abs(e.ad(l,...tS(r,1))-l)];c=[0,2*i.indexOf(Math.min(...i))-1]}else{let i=[Math.abs(e.ad(l,...tS(r,-1))-l),Math.abs(e.ad(l,...tS(r,0))-l),Math.abs(e.ad(l,...tS(r,1))-l)];c=[i.indexOf(Math.min(...i))-1]}}else c=[0];for(let e of c){let n=r.containsTile(h,a,i,e);n&&o.push(n)}}}return o}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,r){let i=this.getRenderableIds(e,r).map(e=>this._tiles[e].tileID),n="globe"===this.transform.projection.name;for(let e of i)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped()),e.expandedProjMatrix=n?this.transform.calculateProjMatrix(e.toUnwrapped(),!1,!0):e.projMatrix;return i}sortCoordinatesByDistance(e){let r=e.slice(),i=this.transform._camera.position,n=this.transform._camera.forward(),o={};for(let e of r){let r=1/(1<<e.canonical.z);o[e.key]=((e.canonical.x+.5)*r+e.wrap-i[0])*n[0]+((e.canonical.y+.5)*r-i[1])*n[1]-i[2]*n[2]}return r.sort((e,r)=>o[e.key]-o[r.key]),r}hasTransition(){if(this._source.hasTransition())return!0;
16if(tE(this._source.type))for(let r in this._tiles){let i=this._tiles[r];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=e.f.now())return!0}return!1}setFeatureState(e,r,i){this._state.updateState(e=e||"_geojsonTileLayer",r,i)}removeFeatureState(e,r,i){this._state.removeFeatureState(e=e||"_geojsonTileLayer",r,i)}getFeatureState(e,r){return this._state.getState(e=e||"_geojsonTileLayer",r)}setDependencies(e,r,i){let n=this._tiles[e];n&&n.setDependencies(r,i)}reloadTilesForDependencies(e,r){for(let i in this._tiles)this._tiles[i].hasDependency(e,r)&&this._reloadTile(+i,"reloading");this._cache.filter(i=>!i.hasDependency(e,r))}_preloadTiles(r,i){if(!this._sourceLoaded){let e=()=>{this._sourceLoaded&&(this._source.off("data",e),this._preloadTiles(r,i))};return void this._source.on("data",e)}let n=new Map,o=Array.isArray(r)?r:[r],a=this.map.painter.terrain,s=this.usedForTerrain&&a?a.getScaledDemTileSize():this._source.tileSize;for(let e of o){for(let r of e.coveringTiles({tileSize:s,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}))n.set(r.key,r);this.usedForTerrain&&e.updateElevation(!1)}let l=Array.from(n.values());e.b4(l,(e,r)=>{let i=new tm(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(i,e=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),r(e,i)})},i)}}function tw(e,r){let i=Math.abs(2*e.wrap)-(e.wrap<0),n=Math.abs(2*r.wrap)-(r.wrap<0);return e.overscaledZ-r.overscaledZ||n-i||r.canonical.y-e.canonical.y||r.canonical.x-e.canonical.x}function tE(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function tS(e,r){let i=1<<e.z;return[e.x/i+r,(e.x+1)/i+r]}tb.maxOverzooming=10,tb.maxUnderzooming=3;class tT{constructor(e){this.style=e,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){for(let e in this.layers=[],this.style._mergedLayers){let r=this.style._mergedLayers[e];if("fill-extrusion"===r.type)this.layers.push({layer:r,visible:!1,visibilityChanged:!1});else if("model"===r.type){let e=this.style.getLayerSource(r);e&&"batched-model"===e.type&&this.layers.push({layer:r,visible:!1,visibilityChanged:!1})}}}onNewFrame(e){for(let r of(this.layersGotHidden=!1,this.layers)){let i=r.layer,n=!1;"fill-extrusion"===i.type?n=!i.isHidden(e)&&i.paint.get("fill-extrusion-opacity")>0:"model"===i.type&&(n=!i.isHidden(e)&&i.paint.get("model-opacity")>0),this.layersGotHidden=this.layersGotHidden||!n&&r.visible,r.visible=n}}updateZOffset(e,r){for(let e of(this.currentBuildingBuckets=[],this.layers)){let i=e.layer,n=this.style.getLayerSourceCache(i),o=1;"fill-extrusion"===i.type&&(o=e.visible?i.paint.get("fill-extrusion-vertical-scale"):0);let a=n?n.getTile(r):null;if(!a&&n&&r.canonical.z>n.getSource().minzoom){let e=r.scaledTo(Math.min(n.getSource().maxzoom,r.overscaledZ-1));for(;e.overscaledZ>=n.getSource().minzoom&&!(a=n.getTile(e))&&0!==e.overscaledZ;)e=e.scaledTo(e.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:a?a.getBucket(i):null,tileID:a?a.tileID:r,verticalScale:o})}e.hasAnyZOffset=!1;let i=!1;for(let n=0;n<e.symbolInstances.length;n++){let o=e.symbolInstances.get(n),a=o.zOffset,s=this._getHeightAtTileOffset(r,o.tileAnchorX,o.tileAnchorY);o.zOffset=s!==-1/0?s:a,i||a===o.zOffset||(i=!0),e.hasAnyZOffset||0===o.zOffset||(e.hasAnyZOffset=!0)}i&&(e.zOffsetBuffersNeedUpload=!0,e.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(r,i,n,o){let a=i,s=n;if(r.canonical.z!==o.canonical.z){let l=o.canonical,u=1/(1<<r.canonical.z-l.z);a=(i+r.canonical.x*e.Y)*u-l.x*e.Y|0,s=(n+r.canonical.y*e.Y)*u-l.y*e.Y|0}return{tileX:a,tileY:s}}_getHeightAtTileOffset(e,r,i){let n,o;for(let a=0;a<this.layers.length;++a){if("fill-extrusion"!==this.layers[a].layer.type)continue;let{bucket:s,tileID:l,verticalScale:u}=this.currentBuildingBuckets[a];if(!s)continue;let{tileX:c,tileY:h}=this._mapCoordToOverlappingTile(e,r,i,l),p=s.getHeightAtTileCoord(c,h);p&&void 0!==p.height&&(p.hidden?n=p.height:o=Math.max(p.height*u,o||0))}if(void 0!==o)return o;for(let o=0;o<this.layers.length;++o){let a=this.layers[o];if("model"!==a.layer.type||!a.visible)continue;let{bucket:s,tileID:l}=this.currentBuildingBuckets[o];if(!s)continue;let{tileX:u,tileY:c}=this._mapCoordToOverlappingTile(e,r,i,l),h=s.getHeightAtTileCoord(u,c);if(h&&!h.hidden)return void 0===h.height&&void 0!==n?Math.min(h.maxHeight,n)*h.verticalScale:h.height?h.height*h.verticalScale:-1/0}return this.layersGotHidden?0:-1/0}}function tI(r){r=r.slice();let i=Object.create(null);for(let e=0;e<r.length;e++)i[r[e].id]=r[e];for(let n=0;n<r.length;n++)"ref"in r[n]&&(r[n]=function(r,i){let n={};for(let e in r)"ref"!==e&&(n[e]=r[e]);
16return e.b5.forEach(e=>{e in i&&(n[e]=i[e])}),n}(r[n],i[r[n].ref]));return r}let tM={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport"};function tC(e,r,i){i.push({command:tM.addSource,args:[e,r[e]]})}function tA(e,r,i){r.push({command:tM.removeSource,args:[e]}),i[e]=!0}function tP(e,r,i,o,a,s){let l;for(l in r=r||{},e=e||{})e.hasOwnProperty(l)&&(n(e[l],r[l])||i.push({command:s,args:[o,l,r[l],a]}));for(l in r)r.hasOwnProperty(l)&&!e.hasOwnProperty(l)&&(n(e[l],r[l])||i.push({command:s,args:[o,l,r[l],a]}))}function tL(e){return e.id}function tO(e,r){return e[r.id]=r,e}class tD{constructor(e,r){this.reset(e,r)}reset(e,r){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(r||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(r){if(1===this.points.length)return this.points[0];r=e.ad(r,0,1);let i=1,n=this._distances[i],o=r*this.paddedLength+this.padding;for(;n<o&&i<this._distances.length;)n=this._distances[++i];let a=i-1,s=this._distances[a],l=n-s,u=l>0?(o-s)/l:0;return this.points[a].mult(1-u).add(this.points[i].mult(u))}}class tR{constructor(e,r,i){const n=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(r/i);for(let e=0;e<this.xCellCount*this.yCellCount;e++)n.push([]),o.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=r,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/r,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,r,i,n,o){this._forEachCell(r,i,n,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(o)}insertCircle(e,r,i,n){this._forEachCell(r-n,i-n,r+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(r),this.circles.push(i),this.circles.push(n)}_insertBoxCell(e,r,i,n,o,a){this.boxCells[o].push(a)}_insertCircleCell(e,r,i,n,o,a){this.circleCells[o].push(a)}_query(e,r,i,n,o,a){if(i<0||e>this.width||n<0||r>this.height)return!o&&[];let s=[];if(e<=0&&r<=0&&this.width<=i&&this.height<=n){if(o)return!0;for(let e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){let r=this.circles[3*e],i=this.circles[3*e+1],n=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:r-n,y1:i-n,x2:r+n,y2:i+n})}return a?s.filter(a):s}return this._forEachCell(e,r,i,n,this._queryCell,s,{hitTest:o,seenUids:{box:{},circle:{}}},a),o?s.length>0:s}_queryCircle(e,r,i,n,o){let a=e-i,s=e+i,l=r-i,u=r+i;if(s<0||a>this.width||u<0||l>this.height)return!n&&[];let c=[];return this._forEachCell(a,l,s,u,this._queryCellCircle,c,{hitTest:n,circle:{x:e,y:r,radius:i},seenUids:{box:{},circle:{}}},o),n?c.length>0:c}query(e,r,i,n,o){return this._query(e,r,i,n,!1,o)}hitTest(e,r,i,n,o){return this._query(e,r,i,n,!0,o)}hitTestCircle(e,r,i,n){return this._queryCircle(e,r,i,!0,n)}_queryCell(e,r,i,n,o,a,s,l){let u=s.seenUids,c=this.boxCells[o];if(null!==c){let o=this.bboxes;for(let h of c)if(!u.box[h]){u.box[h]=!0;let c=4*h;if(e<=o[c+2]&&r<=o[c+3]&&i>=o[c+0]&&n>=o[c+1]&&(!l||l(this.boxKeys[h]))){if(s.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[h],x1:o[c],y1:o[c+1],x2:o[c+2],y2:o[c+3]})}}}let h=this.circleCells[o];if(null!==h){let o=this.circles;for(let c of h)if(!u.circle[c]){u.circle[c]=!0;let h=3*c;if(this._circleAndRectCollide(o[h],o[h+1],o[h+2],e,r,i,n)&&(!l||l(this.circleKeys[c]))){if(s.hitTest)return a.push(!0),!0;{let e=o[h],r=o[h+1],i=o[h+2];a.push({key:this.circleKeys[c],x1:e-i,y1:r-i,x2:e+i,y2:r+i})}}}}}_queryCellCircle(e,r,i,n,o,a,s,l){let u=s.circle,c=s.seenUids,h=this.boxCells[o];if(null!==h){let e=this.bboxes;for(let r of h)if(!c.box[r]){c.box[r]=!0;let i=4*r;if(this._circleAndRectCollide(u.x,u.y,u.radius,e[i+0],e[i+1],e[i+2],e[i+3])&&(!l||l(this.boxKeys[r])))return a.push(!0),!0}}let p=this.circleCells[o];if(null!==p){let e=this.circles;for(let r of p)if(!c.circle[r]){c.circle[r]=!0;let i=3*r;
16if(this._circlesCollide(e[i],e[i+1],e[i+2],u.x,u.y,u.radius)&&(!l||l(this.circleKeys[r])))return a.push(!0),!0}}}_forEachCell(e,r,i,n,o,a,s,l){let u=this._convertToXCellCoord(e),c=this._convertToYCellCoord(r),h=this._convertToXCellCoord(i),p=this._convertToYCellCoord(n);for(let d=u;d<=h;d++)for(let u=c;u<=p;u++)if(o.call(this,e,r,i,n,this.xCellCount*u+d,a,s,l))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,r,i,n,o,a){let s=n-e,l=o-r,u=i+a;return u*u>s*s+l*l}_circleAndRectCollide(e,r,i,n,o,a,s){let l=(a-n)/2,u=Math.abs(e-(n+l));if(u>l+i)return!1;let c=(s-o)/2,h=Math.abs(r-(o+c));if(h>c+i)return!1;if(u<=l||h<=c)return!0;let p=u-l,d=h-c;return p*p+d*d<=i*i}}let tk=Math.tan(85*Math.PI/180);function tN(r,i,n,o,a,s,l){let u=e.a9.create();if(n)if("globe"===s.name){let r=e.b6(a,i);e.a9.multiply(u,u,r)}else{let r=e.b7.invert([],l);u[0]=r[0],u[1]=r[1],u[4]=r[2],u[5]=r[3],o||e.a9.rotateZ(u,u,a.angle)}else e.a9.multiply(u,a.labelPlaneMatrix,r);return u}function tF(e,r,i,n,o,a,s){let l=tN(e,r,i,n,o,a,s);return"globe"===a.name&&i||(l[2]=l[6]=l[10]=l[14]=0),l}function tz(r,i,n,o,a,s,l){if(n){if("globe"===s.name){let u=tN(r,i,n,o,a,s,l);return e.a9.invert(u,u),e.a9.multiply(u,r,u),u}{let i=e.a9.clone(r),n=e.a9.identity([]);return n[0]=l[0],n[1]=l[1],n[4]=l[2],n[5]=l[3],e.a9.multiply(i,i,n),o||e.a9.rotateZ(i,i,-a.angle),i}}return a.glCoordMatrix}function tB(r,i,n,o){let a=[r,i,n,1];n?e.aa.transformMat4(a,a,o):tZ(a,a,o);let s=a[3];return a[0]/=s,a[1]/=s,a[2]/=s,a}function tU(e,r){return Math.min(.5+e/r*.5,1.5)}function tj(r,i,n,o,a,s,l,u,c,h){let p=n.transform,d=o?r.textSizeData:r.iconSizeData,f=e.b8(d,n.transform.zoom),m="globe"===p.projection.name,g=[256/n.width*2+1,256/n.height*2+1],_=o?r.text.dynamicLayoutVertexArray:r.icon.dynamicLayoutVertexArray;_.clear();let y=null;m&&(y=o?r.text.globeExtVertexArray:r.icon.globeExtVertexArray);let v=r.lineVertexArray,x=o?r.text.placedSymbolArray:r.icon.placedSymbolArray,b=n.transform.width/n.transform.height,w,E=!1;for(let o=0;o<x.length;o++){let m=x.get(o),{numGlyphs:S,writingMode:T}=m;if(T!==e.b9.vertical||E||w===e.b9.horizontal||(E=!0),w=T,(m.hidden||T===e.b9.vertical)&&!E){tY(S,_);continue}E=!1;let I=new e.P(m.tileAnchorX,m.tileAnchorY),{x:M,y:C,z:A}=p.projection.projectTilePoint(I.x,I.y,h.canonical);if(c){let[e,r,i]=c(I);M+=e,C+=r,A+=i}let P=[M,C,A,1];if(e.aa.transformMat4(P,P,i),!function(e,r){let i=e[0]/e[3],n=e[1]/e[3];return i>=-r[0]&&i<=r[0]&&n>=-r[1]&&n<=r[1]}(P,g)){tY(S,_);continue}let L=P[3],O=tU(n.transform.getCameraToCenterDistance(p.projection),L),D=e.ba(d,f,m),R=l?D/O:D*O,k=tB(M,C,A,a);if(k[3]<=0){tY(S,_);continue}let N={},F=l?null:c,z=tq(m,R,!1,u,i,a,s,r.glyphOffsetArray,v,_,y,k,I,N,b,F,p.projection,h,l);E=z.useVertical,F&&z.needsFlipping&&(N={}),(z.notEnoughRoom||E||z.needsFlipping&&tq(m,R,!0,u,i,a,s,r.glyphOffsetArray,v,_,y,k,I,N,b,F,p.projection,h,l).notEnoughRoom)&&tY(S,_)}o?(r.text.dynamicLayoutVertexBuffer.updateData(_),y&&r.text.globeExtVertexBuffer&&r.text.globeExtVertexBuffer.updateData(y)):(r.icon.dynamicLayoutVertexBuffer.updateData(_),y&&r.icon.globeExtVertexBuffer&&r.icon.globeExtVertexBuffer.updateData(y))}function tV(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g){let{lineStartIndex:_,glyphStartIndex:y,segment:v}=l,x=y+l.numGlyphs,b=_+l.lineLength,w=r.getoffsetX(y),E=r.getoffsetX(x-1),S=tW(e*w,i,n,o,a,s,v,_,b,u,c,h,p,d,!0,f,m,g);if(!S)return null;let T=tW(e*E,i,n,o,a,s,v,_,b,u,c,h,p,d,!0,f,m,g);return T?{first:S,last:T}:null}function tG(r,i,n,o){return r===e.b9.horizontal&&Math.abs(o)>Math.abs(n)?{useVertical:!0}:r===e.b9.vertical?o>0?{needsFlipping:!0}:null:0!==i&&(0===n||Math.abs(o/n)>tk)?1===i?{needsFlipping:!0}:null:n<0?{needsFlipping:!0}:null}function tq(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x){let b=i/24,w=r.lineOffsetX*b,E=r.lineOffsetY*b,{lineStartIndex:S,glyphStartIndex:T,numGlyphs:I,segment:M,writingMode:C,flipState:A}=r,P=S+r.lineLength,L=r=>{if(p){let[i,n,o]=r.up,a=h.length;e.bb(p,a+0,i,n,o),e.bb(p,a+1,i,n,o),e.bb(p,a+2,i,n,o),e.bb(p,a+3,i,n,o)}let[i,n,o]=r.point;e.bc(h,i,n,o,r.angle)};if(I>1){let e=tV(b,u,w,E,n,d,f,r,c,s,m,_,!1,y,v,x);if(!e)return{notEnoughRoom:!0};
16if(o&&!n){let[i,n,o]=e.first.point,[a,s,u]=e.last.point;[i,n]=tB(i,n,o,l),[a,s]=tB(a,s,u,l);let c=tG(C,A,(a-i)*g,s-n);if(r.flipState=c&&c.needsFlipping?1:2,c)return c}L(e.first);for(let e=T+1;e<T+I-1;e++){let r=tW(b*u.getoffsetX(e),w,E,n,d,f,M,S,P,c,s,m,_,!1,!1,y,v,x);if(!r)return h.length-=4*(e-T),{notEnoughRoom:!0};L(r)}L(e.last)}else{if(o&&!n){let i=tB(f.x,f.y,0,a),n=S+M+1,o=new e.P(c.getx(n),c.gety(n)),s=tB(o.x,o.y,0,a),l=s[3]>0?s:t$(f,o,i,1,a,void 0,y,v.canonical),u=tG(C,A,(l[0]-i[0])*g,l[1]-i[1]);if(r.flipState=u&&u.needsFlipping?1:2,u)return u}let i=tW(b*u.getoffsetX(T),w,E,n,d,f,M,S,P,c,s,m,_,!1,!1,y,v,x);if(!i)return{notEnoughRoom:!0};L(i)}return{}}function tH(e,r,i,n,o){let{x:a,y:s,z:l}=n.projectTilePoint(e.x,e.y,r);if(!o)return tB(a,s,l,i);let[u,c,h]=o(e);return tB(a+u,s+c,l+h,i)}function t$(r,i,n,o,a,s,l,u){let c=tH(r.sub(i)._unit()._add(r),u,a,l,s);return e.Q.sub(c,n,c),e.Q.normalize(c,c),e.Q.scaleAndAdd(c,n,c,o)}function tW(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v){let x=o?r-i:r+i,b=x>0?1:-1,w=0;o&&(b*=-1,w=Math.PI),b<0&&(w+=Math.PI);let E=u+l+(b>0?0:1)|0,S=a,T=a,I=0,M=0,C=Math.abs(x),A=[],P=[],L=s,O=L,D=()=>t$(O,L,T,C-I+1,p,f,_,y.canonical);for(;I+M<=C;){if((E+=b)<u||E>=c)return null;if(T=S,O=L,A.push(T),m&&P.push(O),L=new e.P(h.getx(E),h.gety(E)),!(S=d[E])){let e=tH(L,y.canonical,p,_,f);S=e[3]>0?d[E]=e:D()}I+=M,M=e.Q.distance(T,S)}g&&f&&(d[E]&&(S=D(),M=e.Q.distance(T,S)),d[E]=S);let R=(C-I)/M,k=L.sub(O)._mult(R)._add(O),N=e.Q.sub([],S,T),F=e.Q.scaleAndAdd([],T,N,R),z=[0,0,1],B=N[0],U=N[1];if(v&&(0!==(z=_.upVector(y.canonical,k.x,k.y))[0]||0!==z[1]||1!==z[2])){let r=[z[2],0,-z[0]],i=e.Q.cross([],z,r);e.Q.normalize(r,r),e.Q.normalize(i,i),B=e.Q.dot(N,r),U=e.Q.dot(N,i)}if(n){let r=e.Q.cross([],z,N);e.Q.normalize(r,r),e.Q.scaleAndAdd(F,F,r,n*b)}let j=w+Math.atan2(U,B);return A.push(F),m&&P.push(k),{point:F,angle:j,path:A,tilePath:P,up:z}}function tY(e,r){let i=r.length,n=i+4*e;r.resize(n),r.float32.fill(-1/0,4*i,4*n)}function tZ(e,r,i){let n=r[0],o=r[1];return e[0]=i[0]*n+i[4]*o+i[12],e[1]=i[1]*n+i[5]*o+i[13],e[3]=i[3]*n+i[7]*o+i[15],e}class tX{constructor(e,r,i=new tR(e.width+200,e.height+200,25),n=new tR(e.width+200,e.height+200,25)){this.transform=e,this.grid=i,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=r}placeCollisionBox(e,r,i,n,o,a,s,l){let u=i.projectedAnchorX,c=i.projectedAnchorY,h=i.projectedAnchorZ,p=i.elevation,d=i.tileID,f=e.getProjection();if(p&&d){let[e,r,n]=f.upVector(d.canonical,i.tileAnchorX,i.tileAnchorY),o=f.upVectorScale(d.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;u+=e*p*o,c+=r*p*o,h+=n*p*o}let m=this.projectAndGetPerspectiveRatio(s,u,c,h,i.tileID,"globe"===f.name||!!p||this.transform.pitch>0,f),g=a*m.perspectiveRatio,_=(i.x1*r+n.x-i.padding)*g+m.point.x,y=(i.y1*r+n.y-i.padding)*g+m.point.y,v=(i.x2*r+n.x+i.padding)*g+m.point.x,x=(i.y2*r+n.y+i.padding)*g+m.point.y,b=m.perspectiveRatio<=.55||m.occluded;return!this.isInsideGrid(_,y,v,x)||!o&&this.grid.hitTest(_,y,v,x,l)||b?{box:[],offscreen:!1,occluded:m.occluded}:{box:[_,y,v,x],offscreen:this.isOffscreen(_,y,v,x),occluded:!1}}placeCollisionCircles(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g){let _=[],y=this.transform.elevation,v=r.getProjection(),x=y?y.getAtTileOffsetFunc(g,this.transform.center.lat,this.transform.worldSize,v):null,b=new e.P(n.tileAnchorX,n.tileAnchorY),{x:w,y:E,z:S}=v.projectTilePoint(b.x,b.y,g.canonical);if(x){let[e,r,i]=x(b);w+=e,E+=r,S+=i}let T="globe"===v.name,I=this.projectAndGetPerspectiveRatio(l,w,E,S,g,T||!!y||this.transform.pitch>0,v),{perspectiveRatio:M}=I,C=(p?s/M:s*M)/e.bf,A=tB(w,E,S,u),P=I.signedDistanceFromCamera>0?tV(C,a,n.lineOffsetX*C,n.lineOffsetY*C,!1,A,b,n,o,u,{},y&&!p?x:null,p&&!!y,v,g,p):null,L=!1,O=!1,D=!0;if(P&&!I.occluded){let r=.5*f*M+m,n=new e.P(-100,-100),o=new e.P(this.screenRightBoundary,this.screenBottomBoundary),a=new tD,{first:s,last:l}=P,u=s.path.length,p=[];for(let e=u-1;e>=1;e--)p.push(s.path[e]);for(let e=1;e<l.path.length;e++)p.push(l.path[e]);let g=2.5*r;c&&(p=p.map(([e,r,i],n)=>(x&&!T&&(i=x(n<u-1?s.tilePath[u-1-n]:l.tilePath[n-u+2])[2]),tB(e,r,i,c)))).some(e=>e[3]<=0)&&(p=[]);let y=[];if(p.length>0){let r=1/0,i=-1/0,a=1/0,s=-1/0;for(let e of p)r=Math.min(r,e[0]),a=Math.min(a,e[1]),i=Math.max(i,e[0]),s=Math.max(s,e[1]);i>=n.x&&r<=o.x&&s>=n.y&&a<=o.y&&(y=[p.map(r=>new e.P(r[0],r[1]))],(r<n.x||i>o.x||a<n.y||s>o.y)&&(y=e.bd(y,n.x,n.y,o.x,o.y)))}for(let e of y){a.reset(e,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/g)+1;for(let e=0;e<n;e++){let o=e/Math.max(n-1,1),s=a.lerp(o),l=s.x+100,u=s.y+100;_.push(l,u,r,0);let c=l-r,p=u-r,f=l+r,m=u+r;if(D=D&&this.isOffscreen(c,p,f,m),O=O||this.isInsideGrid(c,p,f,m),!i&&this.grid.hitTestCircle(l,u,r,d)&&(L=!0,!h))return{circles:[],offscreen:!1,collisionDetected:L,occluded:!1}}}}return{circles:(h||!L)&&O?_:[],offscreen:D,collisionDetected:L,occluded:I.occluded}}queryRenderedSymbols(r){if(0===r.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let i=[],n=1/0,o=1/0,a=-1/0,s=-1/0;for(let l of r){let r=new e.P(l.x+100,l.y+100);n=Math.min(n,r.x),o=Math.min(o,r.y),a=Math.max(a,r.x),s=Math.max(s,r.y),i.push(r)}let l=this.grid.query(n,o,a,s).concat(this.ignoredGrid.query(n,o,a,s)),u={},c={};for(let r of l){let n=r.key;if(void 0===u[n.bucketInstanceId]&&(u[n.bucketInstanceId]={}),u[n.bucketInstanceId][n.featureIndex])continue;let o=[new e.P(r.x1,r.y1),new e.P(r.x2,r.y1),new e.P(r.x2,r.y2),new e.P(r.x1,r.y2)];e.be(i,o)&&(u[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(e,r,i,n,o){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:o},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,r,i,n,o){let a=r?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:o};for(let r=0;r<e.length;
16r+=4)a.insertCircle(s,e[r],e[r+1],e[r+2])}projectAndGetPerspectiveRatio(r,i,n,o,a,s,l){let u=[i,n,o,1],c=!1;if(o||this.transform.pitch>0){if(e.aa.transformMat4(u,u,r),this.fogState&&a&&"globe"!==l.name){var h,p,d;let r,s;h=this.fogState,p=a.toUnwrapped(),r=(d=this.transform).calculateFogTileMatrix(p),s=[i,n,o],e.Q.transformMat4(s,s,r),c=el(h,e.Q.length(s),d.pitch,d._fov)>.9}}else tZ(u,u,r);let f=u[3];return{point:new e.P((u[0]/f+1)/2*this.transform.width+100,(-u[1]/f+1)/2*this.transform.height+100),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(l)/f*.5,1.5),signedDistanceFromCamera:f,occluded:s&&u[2]>f||c}}isOffscreen(e,r,i,n){return i<100||e>=this.screenRightBoundary||n<100||r>this.screenBottomBoundary}isInsideGrid(e,r,i,n){return i>=0&&e<this.gridRightBoundary&&n>=0&&r<this.gridBottomBoundary}getViewportMatrix(){let r=e.a9.identity([]);return e.a9.translate(r,r,[-100,-100,0]),r}}function tK(r,i,n){let o=i.createTileMatrix(r,r.worldSize,n.toUnwrapped());return e.a9.multiply(new Float32Array(16),r.projMatrix,o)}function tQ(e,r,i){return r.name===i.projection.name?e.projMatrix:tK(i,r,e)}class tJ{constructor(e,r,i,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?r:-r))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class t0{constructor(e,r,i,n,o,a=!1){this.text=new tJ(e?e.text:null,r,i,o),this.icon=new tJ(e?e.icon:null,r,n,o),this.clipped=a}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class t1{constructor(e,r,i,n=!1){this.text=e,this.icon=r,this.skipFade=i,this.clipped=n}}class t2{constructor(){this.invProjMatrix=e.a9.create(),this.viewportMatrix=e.a9.create(),this.circles=[]}}class t3{constructor(e,r,i,n,o){this.bucketInstanceId=e,this.featureIndex=r,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=o}}class t5{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let r=++this.maxGroupID;this.collisionGroups[e]={ID:r,predicate:e=>e.collisionGroupID===r}}return this.collisionGroups[e]}}function t4(r,i,n,o,a){let{horizontalAlign:s,verticalAlign:l}=e.bi(r),u=e.bh(r,o);return new e.P(-(s-.5)*i+u[0]*a,-(l-.5)*n+u[1]*a)}function t6(r,i,n,o,a){let s=new e.P(r,i);return n&&s._rotate(o?a:-a),s}class t8{constructor(e,r,i,n,o,a){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new tX(this.transform,o),this.buildingIndex=a,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new t5(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(r,i,n,o){var a,s,l;let u=n.getBucket(i),c=n.latestFeatureIndex;if(!u||!c||i.fqid!==u.layerIds[0])return;let h=u.layers[0].layout,p=n.collisionBoxArray,d=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),f=n.tileSize/e.Y,m=n.tileID.toUnwrapped();this.transform.setProjection(u.projection);let g=(a=n.tileID,s=u.getProjection(),l=this.transform,s.name===this.projection?l.calculateProjMatrix(a.toUnwrapped()):tK(l,s,a)),_="map"===h.get("text-pitch-alignment"),y="map"===h.get("text-rotation-alignment");i.compileFilter();let v=i.dynamicFilter(),x=i.dynamicFilterNeedsFeature(),b=this.transform.calculatePixelsToTileUnitsMatrix(n),w=tF(g,n.tileID.canonical,_,y,this.transform,u.getProjection(),b),E=null;if(_){let r=tz(g,n.tileID.canonical,_,y,this.transform,u.getProjection(),b);E=e.a9.multiply([],this.transform.labelPlaneMatrix,r)}let S=null;v&&n.latestFeatureIndex&&(S={unwrappedTileID:m,dynamicFilter:v,dynamicFilterNeedsFeature:x,featureIndex:n.latestFeatureIndex}),this.retainedQueryData[u.bucketInstanceId]=new t3(u.bucketInstanceId,c,u.sourceLayerIndex,u.index,n.tileID);let T={bucket:u,layout:h,posMatrix:g,textLabelPlaneMatrix:w,labelToScreenMatrix:E,clippingData:S,scale:d,textPixelRatio:f,holdingForFade:n.holdingForFade(),collisionBoxArray:p,partiallyEvaluatedTextSize:e.b8(u.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:e.b8(u.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(u.sourceID)};if(o)for(let e of u.sortKeyRanges){let{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:o}=e;r.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:o,parameters:T})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:u.symbolInstances.length,parameters:T})}attemptAnchorPlacement(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y){let{textOffset0:v,textOffset1:x,crossTileID:b}=p,w=[v,x],E=t4(e,i,n,w,o),S=this.collisionIndex.placeCollisionBox(f,o,r,t6(E.x,E.y,a,s,this.transform.angle),h,l,u,c.predicate);if(g){let e=f.getSymbolInstanceIconSize(y,this.transform.zoom,p.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(f,e,g,t6(E.x,E.y,a,s,this.transform.angle),h,l,u,c.predicate).box.length)return}if(S.box.length>0){let r;return this.prevPlacement&&this.prevPlacement.variableOffsets[b]&&this.prevPlacement.placements[b]&&this.prevPlacement.placements[b].text&&(r=this.prevPlacement.variableOffsets[b].anch
16or),this.variableOffsets[b]={textOffset:w,width:i,height:n,anchor:e,textScale:o,prevAnchor:r},this.markUsedJustification(f,e,p,m),f.allowVerticalPlacement&&(this.markUsedOrientation(f,m,p),this.placedOrientations[b]=m),{shift:E,placedGlyphBoxes:S}}}placeLayerBucketPart(r,i,n,o){let{bucket:a,layout:s,posMatrix:l,textLabelPlaneMatrix:u,labelToScreenMatrix:c,clippingData:h,textPixelRatio:p,holdingForFade:d,collisionBoxArray:f,partiallyEvaluatedTextSize:m,partiallyEvaluatedIconSize:g,collisionGroup:_}=r.parameters,y=s.get("text-optional"),v=s.get("icon-optional"),x=s.get("text-allow-overlap"),b=s.get("icon-allow-overlap"),w="map"===s.get("text-rotation-alignment"),E="map"===s.get("text-pitch-alignment"),S="viewport-y"===s.get("symbol-z-order"),T=s.get("symbol-z-elevate");this.transform.setProjection(a.projection);let I=x&&(b||!a.hasIconData()||v),M=b&&(x||!a.hasTextData()||y);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f),n&&o&&a.updateCollisionDebugBuffers(this.transform.zoom,f);let C=(r,o,f)=>{let{crossTileID:S,numVerticalGlyphVertices:T}=r;if(h){let n={zoom:this.transform.zoom,pitch:this.transform.pitch},o=null;if(h.dynamicFilterNeedsFeature){let e=this.retainedQueryData[a.bucketInstanceId];o=h.featureIndex.loadFeature({featureIndex:r.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.s
16ourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,h.dynamicFilter)(n,o,this.retainedQueryData[a.bucketInstanceId].tileID.canonical,new e.P(r.tileAnchorX,r.tileAnchorY),this.transform.calculateDistanceTileData(h.unwrappedTileID)))return this.placements[S]=new t1(!1,!1,!1,!0),void i.add(S)}if(i.has(S))return;if(d)return void(this.placements[S]=new t1(!1,!1,!1));let C=!1,A=!1,P=!0,L=!1,O=!1,D=null,R={box:null,offscreen:null,occluded:null},k={box:null,offscreen:null,occluded:null},N=null,F=null,z=null,B=0,U=0,j=0;f.textFeatureIndex?B=f.textFeatureIndex:r.useRuntimeCollisionCircles&&(B=r.featureIndex),f.verticalTextFeatureIndex&&(U=f.verticalTextFeatureIndex);let V=e=>{e.tileID=this.retainedQueryData[a.bucketInstanceId].tileID;let i=this.transform.elevation;e.elevation=r.zOffset+(i?i.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0)},G=f.textBox;if(G){V(G);let i=i=>{let n=e.b9.horizontal;if(a.allowVerticalPlacement&&!i&&this.prevPlacement){let e=this.prevPlacement.placedOrientations[S];e&&(this.placedOrientations[S]=e,n=e,this.markUsedOrientation(a,n,r))}return n},n=(r,i)=>{if(a.allowVerticalPlacement&&T>0&&f.verticalTextBox){for(let n of a.writingModes)if(n===e.b9.vertical?k=R=i():R=r(),R&&R.box&&R.box.length)break}else R=r()};if(s.get("text-variable-anchor")){let u=s.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[S]){let e=this.prevPlacement.variableOffsets[S];u.indexOf(e.anchor)>0&&(u=u.filter(r=>r!==e.anchor)).unshift(e.anchor)}let c=(e,i,n)=>{let s=a.getSymbolInstanceTextSize(m,r,this.transform.zoom,o),c=(e.x2-e.x1)*s+2*e.padding,h=(e.y2-e.y1)*s+2*e.padding,d=r.hasIconTextFit&&!b?i:null;d&&V(d);let f={box:[],offscreen:!1,occluded:!1},y=x?2*u.length:u.length;for(let i=0;i<y;++i){let y=this.attemptAnchorPlacement(u[i%u.length],e,c,h,s,w,E,p,l,_,i>=u.length,r,o,a,n,d,m,g);if(y&&(f=y.placedGlyphBoxes)&&f.box&&f.box.length){C=!0,D=y.shift;break}}return f};n(()=>c(G,f.iconBox,e.b9.horizontal),()=>{let r=f.verticalTextBox;return r&&V(r),a.allowVerticalPlacement&&!(R&&R.box&&R.box.length)&&T>0&&r?c(r,f.verticalIconBox,e.b9.vertical):{box:null,offscreen:null,occluded:null}}),R&&(C=R.box,P=R.offscreen,L=R.occluded);let h=i(!(!R||!R.box));if(!C&&this.prevPlacement){let e=this.prevPlacement.variableOffsets[S];e&&(this.variableOffsets[S]=e,this.markUsedJustification(a,e.anchor,r,h))}}else{let s=(i,n)=>{let s=a.getSymbolInstanceTextSize(m,r,this.transform.zoom,o),u=this.collisionIndex.placeCollisionBox(a,s,i,new e.P(0,0),x,p,l,_.predicate);return u&&u.box&&u.box.length&&(this.markUsedOrientation(a,n,r),this.placedOrientations[S]=n),u};n(()=>s(G,e.b9.horizontal),()=>{let r=f.verticalTextBox;return a.allowVerticalPlacement&&T>0&&r?(V(r),s(r,e.b9.vertical)):{box:null,offscreen:null,occluded:null}}),i(!!(R&&R.box&&R.box.length))}}if(C=(N=R)&&N.box&&N.box.length>0,P=N&&N.offscreen,L=N&&N.occluded,r.useRuntimeCollisionCircles){let i=a.text.placedSymbolArray.get(r.centerJustifiedTextSymbolIndex>=0?r.centerJustifiedTextSymbolIndex:r.verticalPlacedTextSymbolIndex),o=e.ba(a.textSizeData,m,i),h=s.get("text-padding");F=this.collisionIndex.placeCollisionCircles(a,x,i,a.lineVertexArray,a.glyphOffsetArray,o,l,u,c,n,E,_.predicate,r.collisionCircleDiameter*o/e.bf,h,this.retainedQueryData[a.bucketInstanceId].tileID),C=x||F.circles.length>0&&!F.collisionDetected,P=P&&F.offscreen,L=F.occluded}if(f.iconFeatureIndex&&(j=f.iconFeatureIndex),f.iconBox){let i=i=>{V(i);let n=r.hasIconTextFit&&D?t6(D.x,D.y,w,E,this.transform.angle):new e.P(0,0),o=a.getSymbolInstanceIconSize(g,this.transform.zoom,r.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(a,o,i,n,b,p,l,_.predicate)};A=k&&k.box&&k.box.length&&f.verticalIconBox?(z=i(f.verticalIconBox)).box.length>0:(z=i(f.iconBox)).box.length>0,P=P&&z.offscreen,O=z.occluded}let q=y||0===r.numHorizontalGlyphVertices&&0===T,H=v||0===r.numIconVertices;
16if(q||H?H?q||(A=A&&C):C=A&&C:A=C=A&&C,C&&N&&N.box&&this.collisionIndex.insertCollisionBox(N.box,s.get("text-ignore-placement"),a.bucketInstanceId,k&&k.box&&U?U:B,_.ID),A&&z&&this.collisionIndex.insertCollisionBox(z.box,s.get("icon-ignore-placement"),a.bucketInstanceId,j,_.ID),F&&(C&&this.collisionIndex.insertCollisionCircles(F.circles,s.get("text-ignore-placement"),a.bucketInstanceId,B,_.ID),n)){let e=a.bucketInstanceId,r=this.collisionCircleArrays[e];void 0===r&&(r=this.collisionCircleArrays[e]=new t2);for(let e=0;e<F.circles.length;e+=4)r.circles.push(F.circles[e+0]),r.circles.push(F.circles[e+1]),r.circles.push(F.circles[e+2]),r.circles.push(+!!F.collisionDetected)}let $="globe"!==a.projection.name;I=I&&($||!L),M=M&&($||!O),this.placements[S]=new t1(C||I,A||M,P||a.justReloaded),i.add(S)};if(T&&this.buildingIndex&&(this.buildingIndex.updateZOffset(a,this.retainedQueryData[a.bucketInstanceId].tileID),a.updateZOffset()),S){let r=a.getSortedSymbolIndexes(this.transform.angle);for(let e=r.length-1;e>=0;--e){let i=r[e];C(a.symbolInstances.get(i),i,a.collisionArrays[i])}a.hasAnyZOffset&&e.w(`${a.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(a.hasAnyZOffset){let e=a.getSortedIndexesByZOffset();for(let r=0;r<e.length;++r){let i=e[r];C(a.symbolInstances.get(i),i,a.collisionArrays[i])}}else for(let e=r.symbolInstanceStart;e<r.symbolInstanceEnd;e++)C(a.symbolInstances.get(e),e,a.collisionArrays[e]);if(n&&a.bucketInstanceId in this.collisionCircleArrays){let r=this.collisionCircleArrays[a.bucketInstanceId];e.a9.invert(r.invProjMatrix,l),r.viewportMatrix=this.collisionIndex.getViewportMatrix()}a.justReloaded=!1}markUsedJustification(r,i,n,o){let{leftJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:u,crossTileID:c}
16=n,h=e.bg(i),p=o===e.b9.vertical?u:"left"===h?a:"center"===h?s:"right"===h?l:-1;a>=0&&(r.text.placedSymbolArray.get(a).crossTileID=p>=0&&a!==p?0:c),s>=0&&(r.text.placedSymbolArray.get(s).crossTileID=p>=0&&s!==p?0:c),l>=0&&(r.text.placedSymbolArray.get(l).crossTileID=p>=0&&l!==p?0:c),u>=0&&(r.text.placedSymbolArray.get(u).crossTileID=p>=0&&u!==p?0:c)}markUsedOrientation(r,i,n){let o=i===e.b9.horizontal||i===e.b9.horizontalOnly?i:0,a=i===e.b9.vertical?i:0,{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:l,rightJustifiedTextSymbolIndex:u,verticalPlacedTextSymbolIndex:c}=n,h=r.text.placedSymbolArray;s>=0&&(h.get(s).placedOrientation=o),l>=0&&(h.get(l).placedOrientation=o),u>=0&&(h.get(u).placedOrientation=o),c>=0&&(h.get(c).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let r=this.prevPlacement,i=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;let n=r?r.symbolFadeChange(e):1,o=r?r.opacities:{},a=r?r.variableOffsets:{},s=r?r.placedOrientations:{};for(let e in this.placements){let r=this.placements[e],a=o[e];a?(this.opacities[e]=new t0(a,n,r.text,r.icon,null,r.clipped),i=i||r.text!==a.text.placed||r.icon!==a.icon.placed):(this.opacities[e]=new t0(null,n,r.text,r.icon,r.skipFade,r.clipped),i=i||r.text||r.icon)}for(let e in o){let r=o[e];if(!this.opacities[e]){let o=new t0(r,n,!1,!1);o.isHidden()||(this.opacities[e]=o,i=i||r.text.placed||r.icon.placed)}}for(let e in a)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=a[e]);for(let e in s)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=s[e]);i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:e)}updateLayerOpacities(e,r){let i=new Set;for(let n of r){let r=n.getBucket(e);r&&n.latestFeatureIndex&&e.fqid===r.layerIds[0]&&(this.updateBucketOpacities(r,i,n.collisionBoxArray),r.layers[0].layout.get("symbol-z-elevate")&&this.buildingIndex&&(this.buildingIndex.updateZOffset(r,n.tileID),r.updateZOffset()))}}updateBucketOpacities(r,i,n){r.hasTextData()&&r.text.opacityVertexArray.clear(),r.hasIconData()&&r.icon.opacityVertexArray.clear(),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();let o=r.layers[0].layout,a=!!r.layers[0].dynamicFilter(),s=new t0(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),c=o.get("text-variable-anchor"),h="map"===o.get("text-rotation-alignment"),p="map"===o.get("text-pitch-alignment"),d=new t0(null,0,l&&(u||!r.hasIconData()||o.get("icon-optional")),u&&(l||!r.hasTextData()||o.get("text-optional")),!0);!r.collisionArrays&&n&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(n);let f=(e,r,i)=>{for(let n=0;n<r/4;n++)e.opacityVertexArray.emplaceBack(i)},m=0;for(let n=0;n<r.symbolInstances.length;n++){let o=r.symbolInstances.get(n),{numHorizontalGlyphVertices:l,numVerticalGlyphVertices:u,crossTileID:g,numIconVertices:_}=o,y=i.has(g),v=this.opacities[g];y?v=s:v||(v=d,this.opacities[g]=v),i.add(g);let x=l>0||u>0,b=_>0,w=this.placedOrientations[g],E=w===e.b9.vertical,S=w===e.b9.horizontal||w===e.b9.horizontalOnly;if(!x&&!b||v.isHidden()||m++,x){let e=t7(v.text);f(r.text,l,E?re:e),f(r.text,u,S?re:e);let i=v.text.isHidden(),{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:c}=o,h=r.text.placedSymbolArray,p=i||E?1:0;n>=0&&(h.get(n).hidden=p),a>=0&&(h.get(a).hidden=p),s>=0&&(h.get(s).hidden=p),c>=0&&(h.get(c).hidden=i||S?1:0);let d=this.variableOffsets[g];d&&this.markUsedJustification(r,d.anchor,o,w);let m=this.placedOrientations[g];m&&(this.markUsedJustification(r,"left",o,m),this.markUsedOrientation(r,m,o))}if(b){let e=t7(v.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:n}=o,a=r.icon.placedSymbolArray,s=+!!v.icon.isHidden();i>=0&&(f(r.icon,_,E?re:e),a.get(i).hidden=s),n>=0&&(f(r.icon,o.numVerticalIconVertices,S?re:e),a.get(n).hidden=s)}if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){let i=r.collisionArrays[n];if(i){let n=new e.P(0,0),s=!0;if(i.textBox||i.verticalTextBox){if(c){let e=this.variableOffsets[g];e?(n=t4(e.anchor,e.width,e.height,e.textOffset,e.textScale),h&&n._rotate(p?this.transform.angle:-this.transform.angle)):s=!1}
16a&&(s=!v.clipped),i.textBox&&t9(r.textCollisionBox.collisionVertexArray,v.text.placed,!s||E,n.x,n.y),i.verticalTextBox&&t9(r.textCollisionBox.collisionVertexArray,v.text.placed,!s||S,n.x,n.y)}let l=s&&!!(!S&&i.verticalIconBox);i.iconBox&&t9(r.iconCollisionBox.collisionVertexArray,v.icon.placed,l,o.hasIconTextFit?n.x:0,o.hasIconTextFit?n.y:0),i.verticalIconBox&&t9(r.iconCollisionBox.collisionVertexArray,v.icon.placed,!l,o.hasIconTextFit?n.x:0,o.hasIconTextFit?n.y:0)}}}if(r.fullyClipped=0===m,r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.bucketInstanceId in this.collisionCircleArrays){let e=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=e.invProjMatrix,r.placementViewportMatrix=e.viewportMatrix,r.collisionCircleArray=e.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,r){let i=this.zoomAtLastRecencyCheck===r?1-this.zoomAdjustment(r):1;return this.zoomAtLastRecencyCheck=r,this.commitTime+this.fadeDuration*i>e}setStale(){this.stale=!0}}function t9(e,r,i,n,o){e.emplaceBack(+!!r,+!!i,n||0,o||0),e.emplaceBack(+!!r,+!!i,n||0,o||0),e.emplaceBack(+!!r,+!!i,n||0,o||0),e.emplaceBack(+!!r,+!!i,n||0,o||0)}function t7(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 0xffffffff;let r=+!!e.placed,i=Math.floor(127*e.opacity);return 0x2000000*i+0x1000000*r+131072*i+65536*r+512*i+256*r+2*i+r}let re=0;class rt{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,r,i,n,o){let a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(r.getBucketParts(a,n,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,o())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((e,r)=>e.sortKey-r.sortKey));this._currentPartIndex<a.length;){let e=a[this._currentPartIndex];if(r.placeLayerBucketPart(e,this._seenCrossTileIDs,i,0===e.symbolInstanceStart),this._currentPartIndex++,o())return!0}return!1}}class rr{constructor(e,r,i,n,o,a,s,l,u){this.placement=new t8(e,o,a,s,l,u),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(r,i,n,o){let a=e.f.now(),s=()=>{let r=e.f.now()-a;return!this._forceFullPlacement&&r>2};for(;this._currentPlacementIndex>=0;){let a=i[r[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&(!a.minzoom||a.minzoom<=l)&&(!a.maxzoom||a.maxzoom>l)){let r=a.layout.get("symbol-z-elevate"),i=this._inProgressLayer=this._inProgressLayer||new rt(a),l=e.aj(a.source,a.scope);if(i.continuePlacement(r?o[l]:n[l],this.placement,this._showCollisionBoxes,a,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}let ri=512/e.Y/2;class rn{constructor(r,i,n){this.tileID=r,this.bucketInstanceId=n,this.index=new e.bj(i.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const o=r.canonical.x*e.Y,a=r.canonical.y*e.Y;for(let e=0;e<i.length;e++){const{key:r,crossTileID:n,tileAnchorX:s,tileAnchorY:l}=i.get(e),u=Math.floor((o+s)*ri),c=Math.floor((a+l)*ri);this.index.add(u,c),this.keys.push(r),this.crossTileIDs.push(n)}this.index.finish()}
16findMatches(r,i,n){let o=this.tileID.canonical.z<i.canonical.z?1:Math.pow(2,this.tileID.canonical.z-i.canonical.z),a=ri/Math.pow(2,i.canonical.z-this.tileID.canonical.z),s=i.canonical.x*e.Y,l=i.canonical.y*e.Y;for(let e=0;e<r.length;e++){let i=r.get(e);if(i.crossTileID)continue;let{key:u,tileAnchorX:c,tileAnchorY:h}=i,p=Math.floor((s+c)*a),d=Math.floor((l+h)*a);for(let e of this.index.range(p-o,d-o,p+o,d+o)){let r=this.crossTileIDs[e];if(this.keys[e]===u&&!n.has(r)){n.add(r),i.crossTileID=r;break}}}}}class ro{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ra{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let r=Math.round((e-this.lng)/360);if(0!==r)for(let e in this.indexes){let i=this.indexes[e],n={};for(let e in i){let o=i[e];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+r),n[o.tileID.key]=o}this.indexes[e]=n}this.lng=e}addBucket(e,r,i){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===r.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<r.symbolInstances.length;e++)r.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]=new Set);let n=this.usedCrossTileIDs[e.overscaledZ];for(let i in this.indexes){let o=this.indexes[i];if(Number(i)>e.overscaledZ)for(let i in o){let a=o[i];a.tileID.isChildOf(e)&&a.findMatches(r.symbolInstances,e,n)}else{let a=o[e.scaledTo(Number(i)).key];a&&a.findMatches(r.symbolInstances,e,n)}}for(let e=0;e<r.symbolInstances.length;e++){let o=r.symbolInstances.get(e);o.crossTileID||(o.crossTileID=i.generate(),n.add(o.crossTileID))}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new rn(e,r.symbolInstances,r.bucketInstanceId),!0}removeBucketCrossTileIDs(e,r){for(let i of r.crossTileIDs)this.usedCrossTileIDs[e].delete(i)}removeStaleBuckets(e){let r=!1;for(let i in this.indexes){let n=this.indexes[i];for(let o in n)e[n[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[o]),delete n[o],r=!0)}return r}}class rs{constructor(){this.layerIndexes={},this.crossTileIDs=new ro,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,r,i,n){let o=this.layerIndexes[e.fqid];void 0===o&&(o=this.layerIndexes[e.fqid]=new ra);let a=!1,s={};for(let l of("globe"!==n.name&&o.handleWrapJump(i),r)){let r=l.getBucket(e);r&&e.fqid===r.layerIds[0]&&(r.bucketInstanceId||(r.bucketInstanceId=++this.maxBucketInstanceId),o.addBucket(l.tileID,r,this.crossTileIDs)&&(a=!0),s[r.bucketInstanceId]=!0)}return o.removeStaleBuckets(s)&&(a=!0),a}pruneUnusedLayers(e){let r={};for(let i in e.forEach(e=>{r[e]=!0}),this.layerIndexes)r[i]||delete this.layerIndexes[i]}}class rl{constructor(e=0,r=0,i=0,n=0){if(isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<0||isNaN(n)||n<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=r,this.left=i,this.right=n}interpolate(r,i,n){return null!=i.top&&null!=r.top&&(this.top=e.X(r.top,i.top,n)),null!=i.bottom&&null!=r.bottom&&(this.bottom=e.X(r.bottom,i.bottom,n)),null!=i.left&&null!=r.left&&(this.left=e.X(r.left,i.left,n)),null!=i.right&&null!=r.right&&(this.right=e.X(r.right,i.right,n)),this}getCenter(r,i){let n=e.ad((this.left+r-this.right)/2,0,r),o=e.ad((this.top+i-this.bottom)/2,0,i);return new e.P(n,o)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new rl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function ru(r,i){let n=e.bn(r,3);e.a9.fromQuat(r,i),e.bp(r,3,n)}function rc(r,i){let n=e.bl.identity([]);return e.bl.rotateZ(n,n,-i),e.bl.rotateX(n,n,-r),n}function rh(r,i){let n=[r[0],r[1],0],o=[i[0],i[1],0];if(e.Q.length(n)>=1e-15){let r=e.Q.normalize([],n);e.Q.scale(o,r,e.Q.dot(o,r)),i[0]=o[0],i[1]=o[1]}let a=e.Q.cross([],i,r);if(1e-15>e.Q.len(a))return null;let s=Math.atan2(-a[1],a[0]);return rc(Math.atan2(Math.sqrt(r[0]*r[0]+r[1]*r[1]),-r[2]),s)}class rp{constructor(e,r){this.position=e,this.orientation=r}get position(){return this._position}set position(r){if(r){let i=r instanceof e.O?r:new e.O(r[0],r[1],r[2]);
16this._renderWorldCopies&&(i.x=e.bk(i.x,0,1)),this._position=i}else this._position=null}lookAtPoint(r,i){if(this.orientation=null,!this.position)return;let n=this.position,o=this._elevation?this._elevation.getAtPointOrZero(e.O.fromLngLat(r)):0,a=e.O.fromLngLat(r,o),s=[a.x-n.x,a.y-n.y,a.z-n.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=rh(s,i)}setPitchBearing(r,i){this.orientation=rc(e.bm(r),e.bm(-i))}}class rd{constructor(r,i){this._transform=e.a9.identity([]),this.orientation=i,this.position=r}get mercatorPosition(){let r=this.position;return new e.O(r[0],r[1],r[2])}get position(){let r=e.bn(this._transform,3);return[r[0],r[1],r[2]]}set position(r){r&&e.bp(this._transform,3,[r[0],r[1],r[2],1])}get orientation(){return this._orientation}set orientation(r){this._orientation=r||e.bl.identity([]),r&&ru(this._transform,this._orientation)}getPitchBearing(){let e=this.forward(),r=this.right();return{bearing:Math.atan2(-r[1],r[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,r){this._orientation=rc(e,r),ru(this._transform,this._orientation)}forward(){let r=e.bn(this._transform,2);return[-r[0],-r[1],-r[2]]}up(){let r=e.bn(this._transform,1);return[-r[0],-r[1],-r[2]]}right(){let r=e.bn(this._transform,0);return[r[0],r[1],r[2]]}getCameraToWorld(r,i){let n=new Float64Array(16);return e.a9.invert(n,this.getWorldToCamera(r,i)),n}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(r,i,n){let o=this.position;e.Q.scale(o,o,-r);let a=new Float64Array(16);return e.a9.fromScaling(a,[n,n,n]),e.a9.translate(a,a,o),a[10]*=i,a}getWorldToCamera(r,i){let n=new Float64Array(16),o=new Float64Array(4),a=this.position;return e.bl.conjugate(o,this._orientation),e.Q.scale(a,a,-r),e.a9.fromQuat(n,o),e.a9.translate(n,n,a),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=i,n[9]*=i,n[10]*=i,n[11]*=i,n}getCameraToClipPerspective(r,i,n,o){let a=new Float64Array(16);return e.a9.perspective(a,r,i,n,o),a}getCameraToClipOrthographic(r,i,n,o,a,s){let l=new Float64Array(16);return e.a9.ortho(l,r,i,n,o,a,s),l}getDistanceToElevation(r,i=!1){let n=0===r?0:e.bo(r,i?e.ax(this.position[1]):this.position[1]),o=this.forward();return(n-this.position[2])/o[2]}clone(){return new rd([...this.position],[...this.orientation])}}
16let rf=(e,r,i)=>(1-i)*e+i*r,rm=e=>e*e*e*e*e;class rg{constructor(r,i,n,o,a,s,l){this.tileSize=512,this._renderWorldCopies=void 0===a||a,this._minZoom=r||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==o?60:o,this.setProjection(s),this.setMaxBounds(l),this.width=0,this.height=0,this._center=new e.bq(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new rl,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new rd,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1}clone(){let e=new rg(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForE
16xaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<15}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e,r=!1){let i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForE
16xaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(e||i)&&this._constrainCamera(r),this._calcMatrices()}getProjection(){return e.af(this.projection,["name","center","parallels"])}setProjection(r){this.projectionOptions=r||{name:"mercator"};let i=this.projection?this.getProjection():void 0;this.projection=e.br(this.projectionOptions);let o=!n(i,this.getProjection());return o&&this._calcMatrices(),this.mercatorFromTransition=!1,o}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){let r=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.br({name:"mercator"});let i=r!==this.projection.name;return i&&this._calcMatrices(),i}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){let e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){let e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.bo(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return e.bk(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(r){let i=-r*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=e.b7.create(),e.b7.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(r){let i=e.ad(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){let e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=e.bm(r),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){let r=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==r&&(this._unmodified=!1,this._setZoom(r),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e)}_updateCameraOnTerrain(){let e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),-1/0):-1/0,r=this.elevation&&e===-1/0&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>
160&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===-1/0&&(!r||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);let i=this._elevation;r||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&i.exaggeration()&&this._centerAltitudeValidForExaggeration!==i.exaggeration()?this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*i.exaggeration():this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=i.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;let r=this._elevation,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop(),o=0,a=0;for(let s=0;s<i.length;s++){let l=new e.P(i[s][0]*this.width,n+i[s][1]*(this.height-n)),u=r.pointCoordinate(l);if(!u)continue;let c=1/Math.hypot(u[0]-this._camera.position[0],u[1]-this._camera.position[1]);o+=u[3]*c,a+=c}return 0===a?NaN:o/a}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;let e=this._seaLevelZoom,r=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),i=this.pixelsPerMeter/this.worldSize*r,n=Math.max(this._mercatorZfromZoom(e)-i,this._mercatorZfromZoom(this._maxZoom));this._setZoom(this._zoomFromMercatorZ(n))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}computeZoomRelativeTo(r){let i,n=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,r.toAltitude()));i=r.z<this._camera.position[2]?[n.x,n.y,n.z]:[r.x,r.y,r.z];let o=e.Q.length(e.Q.sub([],this._camera.position,i));return e.ad(this._zoomFromMercatorZ(o),this._minZoom,this._maxZoom)}setFreeCameraOptions(r){if(!this.height||!r.position&&!r.orientation)return;this._updateCameraState();let i=!1;if(r.orientation&&!e.bl.exactEquals(r.orientation,this._camera.orientation)&&(i=this._setCameraOrientation(r.orientation)),r.position){let n=[r.position.x,r.position.y,r.position.z];e.Q.exactEquals(n,this._camera.position)||(this._setCameraPosition(n),i=!0)}i&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();let r=this._camera.position,i=new rp;return i.position=new e.O(r[0],r[1],r[2]),i.orientation=this._camera.orientation,i._elevation=this.elevation,i._renderWorldCopies=this.renderWorldCopies,i}_setCameraOrientation(r){if(!e.bl.length(r))return!1;e.bl.normalize(r,r);let i=e.Q.transformQuat([],[0,0,-1],r),n=e.Q.transformQuat([],[0,-1,0],r);if(n[2]<0)return!1;let o=rh(i,n);return!!o&&(this._camera.orientation=o,!0)}_setCameraPosition(r){let i=this.zoomScale(this.minZoom)*this.tileSize,n=this.zoomScale(this.maxZoom)*this.tileSize,o=this.cameraToCenterDistance;r[2]=e.ad(r[2],o/n,o/i),this._camera.position=r}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,r,i){this._unmodified=!1,this._edgeInsets.interpolate(e,r,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){return Math.max(0,(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize)))}getVisibleUnwrappedCoordinates(r){let i=[new e.bs(0,r)];if(this.renderWorldCopies){let n=this.pointCoordinate(new e.P(0,0)),o=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),s=this.pointCoordinate(new e.P(0,this.height)),l=Math.floor(Math.min(n.x,o.x,a.x,s.x)),u=Math.floor(Math.max(n.x,o.x,a.x,s.x));for(let n=l-1;n<=u+1;n++)0!==n&&i.push(new e.bs(n,r))}return i}isLODDisabled(e){return(!e||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCoverForShadows(r,i,n){let o=[];if(0===i[0]&&0===i[1])return o;for(let n of r){let r=n.canonical,a=n.overscaledZ,s=n.wrap,l=1<<r.z,u=r.x+1<l,c=r.x>0,h=r.y+1<l,p=r.y>0,d=n.wrap-!c,f=n.wrap+ +!u,m=c?r.x-1:l-1,g=u?r.x+1:0;i[0]<0?(o.push(new e.ap(a,f,r.z,g,r.y)),i[1]<0&&h&&(o.push(new e.ap(a,s,r.z,r.x,r.y+1)),o.push(new e.ap(a,f,r.z,g,r.y+1))),i[1]>0&&p&&(o.push(new e.ap(a,s,r.z,r.x,r.y-1)),o.push(new e.ap(a,f,r.z,g,r.y-1)))):i[0]>0?(o.push(new e.ap(a,d,r.z,m,r.y)),i[1]<0&&h&&(o.push(new e.ap(a,s,r.z,r.x,r.y+1)),o.push(new e.ap(a,d,r.z,m,r.y+1))),i[1]>0&&p&&(o.push(new e.ap(a,s,r.z,r.x,r.y-1)),o.push(new e.ap(a,d,r.z,m,r.y-1)))):i[1]<0&&h?o.push(new e.ap(a,s,r.z,r.x,r.y+1)):p&&o.push(new e.ap(a,s,r.z,r.x,r.y-1))}if(o.length>1){o.sort((e,r)=>e.overscaledZ-r.overscaledZ||e.wrap-r.wrap||e.canonical.z-r.canonical.z||e.canonical.x-r.canonical.x||e.canonical.y-r.canonical.y);let e=0,r=0;for(;r<o.length;)o[r].equals(o[e])?++r:o[++e]=o[r++];o.length=e+1}let a=[];for(let e of o)o.some(r=>e.isChildOf(r))||a.push(e);return a.filter(e=>!r.some(r=>!!(e.overscaledZ<n&&r.isChildOf(e))||e.equals(r)||e.isChildOf(r)))}coveringTiles(r){let i,n,o=this.coveringZoomLevel(r),a=o,s=this.elevation&&this.elevation.exaggeration(),l=s&&!r.isTerrainDEM,u="mercator"===this.projection.name;if(void 0!==r.minzoom&&o<r.minzoom)return[];void 0!==r.maxzoom&&o>r.maxzoom&&(o=r.maxzoom);let c=this.locationCoordinate(this.center),h=this.center.lat,p=1<<o,d=[p*c.x,p*c.y,0],f="globe"===this.projection.name,m=!f,g=e.bt.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o,m),_=f?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),y=p*e.bo(1,this.center.lat),v=this._camera.position[2]/e.bo(1,this.center.lat),x=[p*_.x,p*_.y,v*(m?1:y)],b=f||s,w=this.cameraToCenterDistance/r.tileSize*(r.roundZoom?1:.502),E=this.isLODDisabled(!0)?o:0;if(this._elevation&&r.isTerrainDEM)n=1e4*this._elevation.exaggeration();else if(this._elevation){let e=this._elevation.getMinMaxForVisibleTiles();n=e?e.max:this._centerAltitude}else n=this._centerAltitude;let S=r.isTerrainDEM?-n:this._elevation?this._elevation.getMinElevationBelowMSL():0,T=this.projection.isReprojectedInTileSpace?e.bu(this):1,I=r=>{let i=1/4e4,n=new e.O(r.x+i,r.y,r.z),o=new e.O(r.x,r.y+i,r.z),a=r.toLngLat(),s=n.toLngLat(),l=o.toLngLat(),u=this.locationCoordinate(a),c=this.locationCoordinate(s),h=this.locationCoordinate(l);return Math.sqrt(Math.hypot(c.x-u.x,c.y-u.y)*Math.hypot(h.x-u.x,h.y-u.
16y))*T/i},M=r=>{let i=n;return{aabb:e.bx(this,p,0,0,0,r,S,i,this.projection),zoom:0,x:0,y:0,minZ:S,maxZ:i,wrap:r,fullyVisible:!1}},C=[],A=[],P=o,L=r.reparseOverscaled?a:o,O=(i=(v-this._centerAltitude)*y)*i,D=e=>{if(!this._elevation||!e.tileID||!u)return;let r=this._elevation.getMinMaxForTile(e.tileID),i=e.aabb;r?(i.min[2]=r.min,i.max[2]=r.max,i.center[2]=(i.min[2]+i.max[2])/2):(e.shouldSplit=R(e),e.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},R=r=>{let i;if(r.zoom<E)return!0;if(r.zoom===P)return!1;if(null!=r.shouldSplit)return r.shouldSplit;let n=r.aabb.distanceX(x),o=r.aabb.distanceY(x),s=O,u=1;if(f){let i;s=(i=r.aabb.distanceZ(x))*i;let n=Math.pow(2,r.zoom),o=Math.min(Math.max(h,e.ax((r.y+1)/n)),e.ax(r.y/n)),a=e.bM(o)/e.bM(h);if(u=o===h?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,a/this._mercatorScaleRatio),this.zoom<=e.bJ&&r.zoom===P-1&&a>=.9)return!0}else{let i;if(l&&(s=(i=r.aabb.distanceZ(x)*y)*i),this.projection.isReprojectedInTileSpace&&a<=5){let i=Math.pow(2,r.zoom),n=I(new e.O((r.x+.5)/i,(r.y+.5)/i));u=n>.85?1:n}}let c=n*n+o*o+s,p=(i=(1<<P-r.zoom)*w*u*((e,r)=>{if(.707*.707*r<e)return 1;let i=Math.sqrt(r/e);return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(s,O),c))*i;return c<p};if(this.renderWorldCopies)for(let e=1;e<=3;e++)C.push(M(-e)),C.push(M(e));for(C.push(M(0));C.length>0;){let i=C.pop(),n=i.x,a=i.y,s=i.fullyVisible,c=()=>"globe"===this.projection.name&&(0===i.y||i.y===(1<<i.zoom)-1);if(!s){let r=b?i.aabb.intersects(g):i.aabb.intersectsFlat(g);if(0===r&&c()){let o=new e.bv(i.zoom,n,a);r=e.bw(this,p,o,!0).intersects(g)}if(0===r)continue;s=2===r}if(i.zoom!==P&&R(i))for(let r=0;r<4;r++){let o=(n<<1)+r%2,c=(a<<1)+(r>>1),h={aabb:u?i.aabb.quadrant(r):e.bx(this,p,i.zoom+1,o,c,i.wrap,i.minZ,i.maxZ,this.projection),zoom:i.zoom+1,x:o,y:c,wrap:i.wrap,fullyVisible:s,tileID:void 0,shouldSplit:void 0,minZ:i.minZ,maxZ:i.maxZ};l&&!f&&(h.tileID=new e.ap(i.zoom+1===P?L:i.zoom+1,i.wrap,i.zoom+1,o,c),D(h)),C.push(h)}else{let l=i.zoom===P?L:i.zoom;if(r.minzoom&&r.minzoom>l)continue;if(!s){let r=b?i.aabb.intersectsPrecise(g):i.aabb.intersectsPreciseFlat(g);if(0===r&&c()){let o=new e.bv(i.zoom,n,a);r=e.bw(this,p,o,!0).intersectsPrecise(g)}if(0===r)continue}let u=d[0]-(.5+n+(i.wrap<<i.zoom))*(1<<o-i.zoom),h=d[1]-.5-a,f=i.tileID?i.tileID:new e.ap(l,i.wrap,i.zoom,n,a);A.push({tileID:f,distanceSq:u*u+h*h})}}if(this.fogCullDistSq){let i=this.fogCullDistSq,o=this.horizonLineFromTop();A=A.filter(a=>{let s=[0,0,0,1],l=[e.Y,e.Y,0,1],u=this.calculateFogTileMatrix(a.tileID.toUnwrapped());e.aa.transformMat4(s,s,u),e.aa.transformMat4(l,l,u);let c=e.aa.min([],s,l),h=e.aa.max([],s,l),p=e.by(c,h);if(0===p)return!0;let d=!1,f=this._elevation;if(f&&p>i&&0!==o){let i,s=this.calculateProjMatrix(a.tileID.toUnwrapped());r.isTerrainDEM||(i=f.getMinMaxForTile(a.tileID)),i||(i={min:S,max:n});let l=e.bK(this.rotation),u=[l[0]*e.Y,l[1]*e.Y,i.max];e.Q.transformMat4(u,u,s),d=(1-u[1])*this.height*.5<o}return p<i||d})}return A.sort((e,r)=>e.distanceSq-r.distanceSq).map(e=>e.tileID)}resize(e,r){this.width=e,this.height=r,this.pixelsToGLUnits=[2/e,-2/r],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(r){let i=e.ad(r.lat,-e.bz,e.bz),n=this.projection.project(r.lng,i);return new e.P(n.x*this.worldSize,n.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.bo(1,this.center.lat)/this.worldSize}setLocationAtPoint(r,i){let n,o,a=this.centerPoint;if("globe"===this.projection.name){let e=this.worldSize;n=(i.x-a.x)/e,o=(i.y-a.y)/e}else{let e=this.pointCoordinate(i),r=this.pointCoordinate(a);n=e.x-r.x,o=e.y-r.y}let s=this.locationCoordinate(r);this.setLocation(new e.O(s.x-n,s.y-o))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e){return this.projection.locationPoint(this,e)}locationPoint3D(e){return this.projection.locationPoint(this,e,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e){return this.coordinateLocation(this.pointCoordinate3D(e))}locationCoordinate(r,i){let n=i?e.bo(i,r.lat):void 0,o=this.projection.project(r.lng,r.lat);return new e.O(o.x,o.y,n)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(r,i){let n=null!=i?i:this._centerAltitude,o=[r.x,r.y,0,1],a=[r.x,r.y,1,1];e.aa.transformMat4(o,o,this.pixelMatrixInverse),e.aa.transformMat4(a,a,this.pixelMatrixInverse);let s=a[3];
16e.aa.scale(o,o,1/o[3]),e.aa.scale(a,a,1/s);let l=o[2],u=a[2];return{p0:o,p1:a,t:l===u?0:(n-l)/(u-l)}}screenPointToMercatorRay(r){let i=[r.x,r.y,0,1],n=[r.x,r.y,1,1];return e.aa.transformMat4(i,i,this.pixelMatrixInverse),e.aa.transformMat4(n,n,this.pixelMatrixInverse),e.aa.scale(i,i,1/i[3]),e.aa.scale(n,n,1/n[3]),i[2]=e.bo(i[2],this._center.lat)*this.worldSize,n[2]=e.bo(n[2],this._center.lat)*this.worldSize,e.aa.scale(i,i,1/this.worldSize),e.aa.scale(n,n,1/this.worldSize),new e.a5([i[0],i[1],i[2]],e.Q.normalize([],e.Q.sub([],n,i)))}rayIntersectionCoordinate(r){let{p0:i,p1:n,t:o}=r,a=e.bo(i[2],this._center.lat),s=e.bo(n[2],this._center.lat);return new e.O(e.X(i[0],n[0],o)/this.worldSize,e.X(i[1],n[1],o)/this.worldSize,e.X(a,s,o))}pointCoordinate(e,r=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,r)}pointCoordinate3D(r){if(!this.elevation)return this.pointCoordinate(r);let i=this.projection.pointCoordinate3D(this,r.x,r.y);if(i)return new e.O(i[0],i[1],i[2]);let n=0,o=this.horizonLineFromTop();if(r.y>o)return this.pointCoordinate(r);let a=.02*o,s=r.clone();for(let r=0;r<10&&o-n>a;r++){s.y=e.X(n,o,.66);let r=this.projection.pointCoordinate3D(this,s.x,s.y);r?(o=s.y,i=r):n=s.y}return i?new e.O(i[0],i[1],i[2]):this.pointCoordinate(r)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(r){if(r.y<0||r.y>this.height||r.x<0||r.x>this.width)return!1;if(this.elevation||this.zoom>=e.bA)return!this.isPointAboveHorizon(r);let i=this.pointCoordinate(r);return i.y>=0&&i.y<=1}_coordinatePoint(r,i){let n=i&&this.elevation?this.elevation.getAtPointOrZero(r,this._centerAltitude):this._centerAltitude,o=[r.x*this.worldSize,r.y*this.worldSize,n+r.toAltitude(),1];return e.aa.transformMat4(o,o,this.pixelMatrix),o[3]>0?new e.P(o[0]/o[3],o[1]/o[3]):new e.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){let{top:r,left:i}=this._edgeInsets,n=this.height-this._edgeInsets.bottom,o=this.width-this._edgeInsets.right,a=this.pointLocation3D(new e.P(i,r)),s=this.pointLocation3D(new e.P(o,r)),l=this.pointLocation3D(new e.P(o,n)),u=this.pointLocation3D(new e.P(i,n)),c=Math.min(a.lng,s.lng,l.lng,u.lng),h=Math.max(a.lng,s.lng,l.lng,u.lng),p=Math.min(a.lat,s.lat,l.lat,u.lat),d=Math.max(a.lat,s.lat,l.lat,u.lat),f=Math.pow(2,-this.zoom)/16*270,m="globe"===this.projection.name?1:4,g=(r,i,n,o,a)=>{let s=(r+n)/2,l=(i+o)/2,u=new e.P(s,l),{lng:_,lat:y}=this.pointLocation3D(u),v=Math.max(0,c-_,p-y,_-h,y-d);c=Math.min(c,_),h=Math.max(h,_),p=Math.min(p,y),d=Math.max(d,y),(a<m||v>f)&&(g(r,i,s,l,a+1),g(s,l,n,o,a+1))};if(g(i,r,o,r,1),g(o,r,o,n,1),g(o,n,i,n,1),g(i,n,i,r,1),"globe"===this.projection.name){let[r,i]=e.bB(this);r?(d=90,h=180,c=-180):i&&(p=-90,h=180,c=-180)}return new e.ag(new e.bq(c,p),new e.bq(h,d))}_getBoundsRectangular(r,i){let{top:n,left:o}=this._edgeInsets,a=this.height-this._edgeInsets.bottom,s=this.width-this._edgeInsets.right,l=new e.P(o,n),u=new e.P(s,n),c=new e.P(s,a),h=new e.P(o,a),p=this.pointCoordinate(l,r),d=this.pointCoordinate(u,r),f=this.pointCoordinate(c,i),m=this.pointCoordinate(h,i),g=(e,r)=>(r.y-e.y)/(r.x-e.x);return p.y>1&&d.y>=0?p=new e.O((1-m.y)/g(m,p)+m.x,1):p.y<0&&d.y<=1&&(p=new e.O(-m.y/g(m,p)+m.x,0)),d.y>1&&p.y>=0?d=new e.O((1-f.y)/g(f,d)+f.x,1):d.y<0&&p.y<=1&&(d=new e.O(-f.y/g(f,d)+f.x,0)),(new e.ag).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(m)).extend(this.coordinateLocation(f))}_getBoundsRectangularTerrain(){let e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);let r=e.visibleDemTiles.reduce((e,r)=>{if(r.dem){let i=r.dem.tree;e.min=Math.min(e.min,i.minimums[0]),e.max=Math.max(e.max,i.maximums[0])}return e},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(r.min*e.exaggeration(),r.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){let r=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,i=this.height/2-r*(1-this._horizonShift);return e?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(r){this.maxBounds=r,this.minLat=-e.bz,this.maxLat=e.bz,this.minLng=-180,this.maxLng=180,r&&(this.minLat=r.getSouth(),this.maxLat=r.getNorth(),this.minLng=r.getWest(),this.maxLng=r.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=e.a8(this.minLng)*this.tileSize,this.worldMaxX=e.a8(this.maxLng)*this.tileSize,this.worldMinY=e.ah(this.maxLat)*this.tileSize,this.worldMaxY=e.ah(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,r){return this.projection.createTileMatrix(this,r,e)}calculateDistanceTileData(r){let i=r.key,n=this._distanceTileDataCache;if(n[i])return n[i];let o=r.canonical,a=1/this.height,s=this.cameraWorldSize,l=s/this.zoomScale(o.z),u=(o.x+Math.pow(2,o.z)*r.wrap)*l,c=o.y*l,h=this.point;h.x*=s/this.worldSize,h.y*=s/this.worldSize;let p=this.angle,d=Math.sin(-p),f=-Math.cos(-p);return n[i]={bearing:[d,f],center:[(h.x-u)*a,(h.y-c)*a],scale:l/e.Y*a},n[i]}calculateFogTileMatrix(r){let i=r.key,n=this._fogTileMatrixCache;if(n[i])return n[i];let o=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,r);return e.a9.multiply(o,this.worldToFogMatrix,o),n[i]=new Float32Array(o),n[i]}calculateProjMatrix(r,i=!1,n=!1){let o,a,s=r.key;if((o=n?this._expandedProjMatrixCache:i?this._alignedProjMatrixCache:this._projMatrixCache)[s])return o[s];let l=this.calculatePosMatrix(r,this.worldSize);return a=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.expandedFarZProjMatrix:i?this.alignedProjMatrix:this.projMatrix,e.a9.multiply(l,a,l),o[s]=new Float32Array(l),o[s]}calculatePixelsToTileUnitsMatrix(r){let i=r.tileID.key,n=this._pixelsToTileUnitsCache;if(n[i])return n[i];let o=e.bC(r,this);return n[i]=o,n[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){let r=1/this.worldSize,i=e.a9.fromScaling([],[r,r,r]);return e.a9.multiply(i,i,this.globeMatrix),i}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;let r=this._elevation;this._updateCameraState();let i=e.bo(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(i),o=this._camera.forward(),a=e.bo(1,this._center.lat);n[2]/=a,o[2]/=a,e.Q.normalize(o,o);let s=r.raycast(n,o,r.exaggeration());if(s){let r=e.Q.scaleAndAdd([],n,o,s),i=new e.O(r[0],r[1],e.bo(r[2],e.ax(r[1]))),l=(i.z+e.Q.length([i.x-n[0],i.y-n[1],i.z-n[2]*a]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(l),this._centerAltitude=i.toAltitude(),this._center=this.coordinateLocation(i),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(r=!1){if(!this._elevation)return;let i=this._elevation,n=e.bo(1,this._center.lat)*this.worldSize,o=this._computeCameraPosition(n),a=i.getAtPointOrZero(new e.O(...o)),s=this.pixelsPerMeter/this.worldSize*a,l=this._minimumHeightOverTerrain(),u=o[2]-s;if(u<=l)if(u<0||r){let r=this.locationCoordinate(this._center,this._centerAltitude),i=[o[0],o[1],r.z-o[2]],n=e.Q.length(i);i[2]-=(l-u)/this._pixelsPerMercatorPixel;let a=e.Q.length(i);if(0===a)return;e.Q.scale(i,i,n/a*this._pixelsPerMercatorPixel),this._camera.position=[o[0],o[1],r.z*this._pixelsPerMercatorPixel-i[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let r="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||r){let i=this.center;return i.lat=e.ad(i.lat,this.minLat,this.maxLat),!this.maxBounds&&(this.renderWorldCopies||r)||(i.lng=e.ad(i.lng,this.minLng,this.maxLng)),this.center=i,void(this._constraining=!1)}let i=this._unmodified,{x:n,y:o}=this.point,a=0,s=n,l=o,u=this.width/2,c=this.height/2,h=this.worldMinY*this.scale,p=this.worldMaxY*this.scale;if(o-c<h&&(l=h+c),o+c>p&&(l=p-c),p-h<this.height&&(a=Math.max(a,this.height/(p-h)),l=(p+h)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){let e=this.worldMinX*this.scale,r=this.worldMaxX*this.scale,i=this.worldSize/2-(e+r)/2;(s=(n+i+this.worldSize)%this.worldSize-i)-u<e&&(s=e+u),s+u>r&&(s=r-u),r-e<this.width&&(a=Math.max(a,this.width/(r-e)),s=(r+e)/2)}s===n&&l===o||(this.center=this.unproject(new e.P(s,l))),a&&(this.zoom+=this.scaleZoom(a)),this._constrainCamera(),this._unmodified=i,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){let r;if(!this.height)return;let i=this.centerOffset,n="globe"===this.projection.name,o=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.bo(1,this.center.lat)/e.bo(1,e.bL));let a=e.bD(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,a),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;let s="meters"===this.projection.zAxisUnit?o:1,l=this._camera.getWorldToCamera(this.worldSize,s),u=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(u[8]=-(2*i.x)/this.width,u[9]=2*i.y/this.height,this.isOrthographic){let e=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),n=e*this.aspect,o=-n,a=-e;n-=i.x,o-=i.x,e+=i.y,a+=i.y,((e,r,i,n)=>{for(let o=0;o<16;o++)e[o]=rf(r[o],i[o],n)})(r=this._camera.getCameraToClipOrthographic(o,n,a,e,this._nearZ,this._farZ),r,u,rm(this.pitch>=15?1:this.pitch/15))}else r=u;let c=e.a9.mul([],u,l),h=e.a9.mul([],r,l);if(this.projection.isReprojectedInTileSpace){let r=this.locationCoordinate(this.center),i=e.a9.identity([]);e.a9.translate(i,i,[r.x*this.worldSize,r.y*this.worldSize,0]),e.a9.multiply(i,i,e.bE(this)),e.a9.translate(i,i,[-r.x*this.worldSize,-r.y*this.worldSize,0]),e.a9.multiply(h,h,i),e.a9.multiply(c,c,i),this.inverseAdjustmentMatrix=e.bF(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=e.a9.scale([],h,[this.worldSize,this.worldSize,this.worldSize/s,1]),this.projMatrix=h,this.invProjMatrix=e.a9.invert(new Float64Array(16),this.projMatrix),n){let r=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);r[8]=-(2*i.x)/this.width,r[9]=2*i.y/this.height,this.expandedFarZProjMatrix=e.a9.mul([],r,l)}else this.expandedFarZProjMatrix=this.projMatrix;let p=e.a9.invert([],r);this.frustumCorners=e.bG.fromInvProjectionMatrix(p,this.horizonLineFromTop(),this.height),this.cameraFrustum=e.bt.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!n);let d=new Float32Array(16);e.a9.identity(d),e.a9.scale(d,d,[1,-1,1]),e.a9.rotateX(d,d,this._pitch),e.a9.rotateZ(d,d,this.angle);let f=e.a9.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=e.a9.clone(f);let m=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;f[8]=-(2*i.x)/this.width,f[9]=2*(i.y+m)/this.height,this.skyboxMatrix=e.a9.multiply(d,f,d);let g=this.point,_=g.x,y=g.y,v=this.width%2/2,x=this.height%2/2,b=Math.cos(this.angle),w=Math.sin(this.angle),E=_-Math.round(_)+b*v+w*x,S=y-Math.round(y)+b*x+w*v,T=new Float64Array(h);if(e.a9.translate(T,T,[E>.5?E-1:E,S>.5?S-1:S,0]),this.alignedProjMatrix=T,h=e.a9.create(),e.a9.scale(h,h,[this.width/2,-this.height/2,1]),e.a9.translate(h,h,[1,-1,0]),this.labelPlaneMatr
16ix=h,h=e.a9.create(),e.a9.scale(h,h,[1,-1,1]),e.a9.translate(h,h,[-1,-1,0]),e.a9.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=e.a9.multiply(new Float64Array(16),this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},!(h=e.a9.invert(new Float64Array(16),this.pixelMatrix)))throw Error("failed to invert matrix");if(this.pixelMatrixInverse=h,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.bH(this);let r=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.Q.transformMat4(r,r,l),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=h;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};let r=this.cameraWorldSizeForFog,i=this.cameraPixelsPerMeter,n=this._camera.position,o=1/this.height/this._pixelsPerMercatorPixel,a=[r,r,i];e.Q.scale(a,a,o),e.Q.scale(n,n,-1),e.Q.multiply(n,n,a);let s=e.a9.create();e.a9.translate(s,s,n),e.a9.scale(s,s,a),this.mercatorFogMatrix=s,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(r,i,o)}_computeCameraPosition(e){let r=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),n=this.point,o=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*r-e/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-i[0]*o,n.y/this.worldSize-i[1]*o,e/this.worldSize*this._centerAltitude-i[2]*o]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(r){let i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=this._camera.position[2],o=r[2],a=1;this.projection.wrap&&(this.center=this.center.wrap()),o>0&&(a=Math.min((i-n)/o,1)),this._camera.position=e.Q.scaleAndAdd([],this._camera.position,r,a),this._updateStateFromCamera()}_updateStateFromCamera(){let r=this._camera.position,i=this._camera.forward(),{pitch:n,bearing:o}=this._camera.getPitchBearing(),a=e.bo(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,s=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.bm(this._maxPitch)),l=Math.max((r[2]-a)/Math.cos(n),s),u=this._zoomFromMercatorZ(l);e.Q.scaleAndAdd(r,r,i,l),this._pitch=e.ad(n,e.bm(this.minPitch),e.bm(this.maxPitch)),this.angle=e.bk(o,-Math.PI,Math.PI),this._setZoom(e.ad(u,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.O(r[0],r[1],r[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){let e=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}zoomFromMercatorZAdjusted(r){let i=0,n=e.bA,o=0,a=1/0;for(;n-i>1e-6&&n>i;){let e=i+.5*(n-i),s=this.tileSize*Math.pow(2,e),l=this.getCameraToCenterDistance(this.projection,e,s),u=this.scaleZoom(l/(r*this.tileSize)),c=Math.abs(e-u);c<a&&(a=c,o=e),e<u?i=e:n=e}return o}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(e.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(r,i){let n=Math.min(r.x,i.x),o=Math.max(r.x,i.x),a=Math.min(r.y,i.y),s=Math.max(r.y,i.y);if(a<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;let l=[new e.P(n,a),new e.P(o,s),new e.P(n,s),new e.P(o,a)],u=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(let e of l){let r=this.pointRayIntersection(e);if(r.t<0)return!0;let i=this.rayIntersectionCoordinate(r);if(i.x<u||i.y<0||i.x>c||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.bI(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.P(0,0),new e.P(this.width,this.height))}zoomDeltaToMovement(r,i){let n=e.Q.length(e.Q.sub([],this._camera.position,r)),o=this._zoomFromMercatorZ(n)+i;return n-this._mercatorZfromZoom(o)}getCameraPoint(){if("globe"===this.projection.name){let r=function([r,i,n],o){let a=[r,i,n,1];e.aa.transformMat4(a,a,o);let s=a[3]=Math.max(a[3],1e-6);return a[0]/=s,a[1]/=s,a[2]/=s,a}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.P(r[0],r[1])}{let r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,r))}}getCameraToCenterDistance(r,i=this.zoom,n=this.worldSize){let o=e.bD(r,i,this.width,this.height,1024),a=r.pixelSpaceConversion(this.center.lat,n,o),s=.5/Math.tan(.5*this._fov)*this.height*a;return this.isOrthographic&&(s=rf(1,s,rm(this.pitch>=15?1:this.pitch/15))),s}getWorldToCameraMatrix(){let r=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.a9.multiply(r,r,this.globeMatrix),r}getFrustum(r){return e.bt.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r,"meters"===this.projection.zAxisUnit)}}let r_=(r,i)=>{if(i>0&&r.terrain&&e.w("Cutoff is currently disabled on terrain"),i<=0||r.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};let n=r.transform,o=Math.max(Math.abs(n._zoom-(r.minCutoffZoom-1)),1),a=n.isLODDisabled(!1)?e.S(60,45,n.pitch):e.S(30,15,n.pitch),s=n._farZ-n._nearZ,l=i*n.height,u=((1-a)*n.cameraToCenterDistance+a*(n._farZ+l))*o;return{shouldRenderCutoff:a<1,uniformValues:{u_cutoff_params:[n._nearZ,n._farZ,(u-n._nearZ)/s,(u-l-n._nearZ)/s]}}},ry={cascadeCount:2,shadowMapResolution:2048};class rv{constructor(e,r){this.aabb=e,this.lastCascade=r}}class rx{add(e,r){let i=this.receivers[e.key];void 0!==i?(i.aabb.min[0]=Math.min(i.aabb.min[0],r.min[0]),i.aabb.min[1]=Math.min(i.aabb.min[1],r.min[1]),i.aabb.min[2]=Math.min(i.aabb.min[2],r.min[2]),i.aabb.max[0]=Math.max(i.aabb.max[0],r.max[0]),i.aabb.max[1]=Math.max(i.aabb.max[1],r.max[1]),i.aabb.max[2]=Math.max(i.aabb.max[2],r.max[2])):this.receivers[e.key]=new rv(r,null)}clear(){this.receivers={}}get(e){return this.receivers[e.key]}computeRequiredCascades(r,i,n){let o=e.bV.fromPoints(r.points),a=0;for(let r in this.receivers){let s=this.receivers[r];if(!s||!o.intersectsAabb(s.aabb))continue;s.aabb.min=o.closestPoint(s.aabb.min),s.aabb.max=o.closestPoint(s.aabb.max);let l=s.aabb.getCorners();for(let r=0;r<n.length;r++){let o=!0;for(let a of l){let s=[a[0]*i,a[1]*i,a[2]];
16if(e.Q.transformMat4(s,s,n[r].matrix),s[0]<-1||s[0]>1||s[1]<-1||s[1]>1){o=!1;break}}if(s.lastCascade=r,a=Math.max(a,r),o)break}}return a+1}}class rb{constructor(e){this.painter=e,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new rx,this._depthMode=new ts(e.context.gl.LEQUAL,ts.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,e.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},()=>{this.painter.style.map.triggerRepaint()}),e.tp.registerParameter(ry,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),e.tp.registerParameter(ry,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),e.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(let e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[]}updateShadowParameters(r,i){let n=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!i||!i.properties)return;let o=i.properties.get("shadow-intensity");if(!i.shadowsEnabled()||o<=0||(this._shadowLayerCount=n.style.order.reduce((e,i)=>{let o=n.style._mergedLayers[i];return e+(o.hasShadowPass()&&!o.isHidden(r.zoom)?1:0)},0),this._enabled=this._shadowLayerCount>0,!this.enabled))return;let a=n.context,s=ry.shadowMapResolution,l=ry.shadowMapResolution;if(0===this._cascades.length||ry.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let r=0;r<ry.cascadeCount;++r){let r=n._shadowMapDebug,i=a.gl,o=a.createFramebuffer(s,l,r,"texture"),u=new e.T(a,{width:s,height:l,data:null},i.DEPTH_COMPONENT);if(o.depthAttachment.set(u.texture),r){let r=new e.T(a,{width:s,height:l,data:null},i.RGBA);o.colorAttachment.set(r.texture)}this._cascades.push({framebuffer:o,texture:u,matrix:[],far:0,boundingSphereRadius:0,frustum:new e.bt,scale:0})}}this.shadowDirection=rE(i);let u=0;if(r.elevation){let e=r.elevation,i=[1e4,-1e4];e.visibleDemTiles.filter(e=>e.dem).forEach(e=>{let r=e.dem.tree;i[0]=Math.min(i[0],r.minimums[0]),i[1]=Math.max(i[1],r.maximums[0])}),1e4!==i[0]&&(u=(i[1]-i[0])*e.exaggeration())}let c=1.5*r.cameraToCenterDistance,h=3*c,p=new Float64Array(16);for(let i=0;i<this._cascades.length;++i){let n=this._cascades[i],o=r.height/50,a=1;1===ry.cascadeCount?a=h:0===i?a=c:(o=c,a=h);let[s,l]=function(r,i,n,o,a,s){let l,u,c=r.zoom,h=r.scale,p=r.worldSize,d=1/p,f=r.aspect,m=Math.sqrt(1+f*f)*Math.tan(.5*r.fovX),g=m*m,_=o-n,y=o+n;g>_/y?(l=o,u=o*m):(l=.5*y*(1+g),u=.5*Math.sqrt(_*_+2*(o*o+n*n)*g+y*y*g*g));let v=r.projection.pixelsPerMeter(r.center.lat,p),x=r._camera.getCameraToWorldMercator(),b=[0,0,-l*d];e.Q.transformMat4(b,b,x);let w=u*d,E=r._edgeInsets;if((0!==E.left||0!==E.top||0!==E.right||0!==E.bottom)&&(E.left!==E.right||E.top!==E.bottom)){let i=r._camera.getWorldToCamera(r.worldSize,"meters"===r.projection.zAxisUnit?v:1),a=r._camera.getCameraToClipPerspective(r._fov,r.width/r.height,n,o);a[8]=-(2*r.centerOffset.x)/r.width,a[9]=2*r.centerOffset.y/r.height;let s=new Float64Array(16);e.a9.mul(s,a,i);let l=new Float64Array(16);for(let i of(e.a9.invert(l,s),e.bt.fromInvProjectionMatrix(l,p,c,!0).points)){let n=(i[0]/=h,i[1]/=h,i[2]=e.bo(i[2],r._center.lat),i);w=Math.max(w,e.Q.len(e.Q.subtract([],b,n)))}}w*=a/(a-1);let S=Math.acos(i[2]),T=Math.atan2(-i[0],-i[1]),I=new rd;I.position=b,I.setPitchBearing(S,T);let M=I.getWorldToCamera(p,v),C=w*p,A=Math.min(-(r._mercatorZfromZoom(17)*p*2),-2*C),P=I.getCameraToClipOrthographic(-C,C,-C,C,A,(C+s*v)/i[2]),L=new Float64Array(16);e.a9.multiply(L,P,M);let O=e.Q.fromValues(Math.floor(1e6*b[0])/1e6*p,Math.floor(1e6*b[1])/1e6*p,0),D=.5*a,R=[0,0,0];e.Q.transformMat4(R,O,L),e.Q.scale(R,R,D);let k=[Math.floor(R[0]),Math.floor(R[1]),Math.floor(R[2])],N=[0,0,0];e.Q.sub(N,R,k),e.Q.scale(N,N,-1/D);let F=new Float64Array(16);return e.a9.identity(F),e.a9.translate(F,F,N),e.a9.multiply(L,F,L),[L,C]}(r,this.shadowDirection,o,a,ry.shadowMapResolution,u);n.scale=r.scale,n.matrix=s,n.boundingSphereRadius=l,e.a9.invert(p,n.matrix),n.frustum=e.bt.fromInvProjectionMatrix(p,1,0,!0),n.far=a}let d=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[d].far,this._cascades[d].far],this._uniformValues.u_shadow_intensity=o,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/ry.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=ry.shadowMapResolution,this._uniformValues.u_shadowmap_0=10,this._uniformValues.u_shadowmap_1=11,this._groundShadowTiles=n.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});let f=n.transform.elevation;for(let e of this._groundShadowTiles){let r={min:0,max:0};if(f){let i=f.getMinMaxForTile(e);
16i&&(r=i)}this.addShadowReceiver(e.toUnwrapped(),r.min,r.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(e){this._enabled=e}drawShadowPass(r,i){if(!this.enabled)return;let n=this.painter,o=n.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(n.transform.getFrustum(0),n.transform.worldSize,this._cascades),o.viewport.set([0,0,ry.shadowMapResolution,ry.shadowMapResolution]);for(let a=0;a<this._numCascadesToRender;++a)for(let s of(n.currentShadowCascade=a,o.bindFramebuffer.set(this._cascades[a].framebuffer.framebuffer),o.clear({color:e.aA.white,depth:1}),r.order)){let e=r._mergedLayers[s];if(!e.hasShadowPass()||e.isHidden(n.transform.zoom))continue;let o=r.getLayerSourceCache(e),a=o?i[o.id]:void 0;("model"===e.type||a&&a.length)&&n.renderLayer(n,o,e,a)}n.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;let e=this.painter,r=e.style,i=e.context,n=r.directionalLight,o=r.ambientLight;if(!n||!o)return;let a=[],s=r_(e,e.longestCutoffRange);s.shouldRenderCutoff&&a.push("RENDER_CUTOFF");let l=rS(n,o),u=new ts(i.gl.LEQUAL,ts.ReadOnly,e.depthRangeFor3D);for(let r of this._groundShadowTiles){let n=r.toUnwrapped(),o=e.isTileAffectedByFog(r),c=e.getOrCreateProgram("groundShadow",{defines:a,overrideFog:o});this.setupShadows(n,c),e.uploadCommonUniforms(i,c,n,null,s);let h={u_matrix:e.transform.calculateProjMatrix(n),u_ground_shadow_factor:l};c.draw(e,i.gl.TRIANGLES,u,tl.disabled,tu.multiply,tc.disabled,h,"ground_shadow",e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments,{},e.transform.zoom,null,null)}}getShadowPassColorMode(){return this.painter._shadowMapDebug?tu.unblended:tu.disabled}getShadowPassDepthMode(){return this._depthMode}getShadowCastingLayerCount(){return this._shadowLayerCount}calculateShadowPassMatrixFromTile(r){let i=this.painter.transform,n=i.calculatePosMatrix(r,i.worldSize);return e.a9.multiply(n,this._cascades[this.painter.currentShadowCascade].matrix,n),Float32Array.from(n)}calculateShadowPassMatrixFromMatrix(r){return e.a9.multiply(r,this._cascades[this.painter.currentShadowCascade].matrix,r),Float32Array.from(r)}setupShadows(r,i,n,o=0){if(!this.enabled)return;let a=this.painter.transform,s=this.painter.context,l=s.gl,u=this._uniformValues,c=new Float64Array(16),h=a.calculatePosMatrix(r,a.worldSize);for(let r=0;r<this._cascades.length;r++)e.a9.multiply(c,this._cascades[r].matrix,h),u[0===r?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(c),s.activeTexture.set(l.TEXTURE0+10+r),this._cascades[r].texture.bind(l.NEAREST,l.CLAMP_TO_EDGE);if(this.useNormalOffset=!!n,this.useNormalOffset){let i=e.bU(r.canonical),s=2/a.tileSize*e.Y/ry.shadowMapResolution,l=s*this._cascades[0].boundingSphereRadius,c=s*this._cascades[this._cascades.length-1].boundingSphereRadius,h=("vector-tile"===n?1:3)/Math.pow(2,o-r.canonical.z-(1-a.zoom+Math.floor(a.zoom)));u.u_shadow_normal_offset=[i,l*h,c*h],u.u_shadow_bias=[6e-5,.0012,.012]}else u.u_shadow_bias=[36e-5,.0012,.012];i.setShadowUniformValues(s,u)}setupShadowsFromMatrix(r,i,n=!1){if(!this.enabled)return;let o=this.painter.context,a=o.gl,s=this._uniformValues,l=new Float64Array(16);for(let i=0;i<ry.cascadeCount;i++)e.a9.multiply(l,this._cascades[i].matrix,r),s[0===i?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(l),o.activeTexture.set(a.TEXTURE0+10+i),this._cascades[i].texture.bind(a.NEAREST,a.CLAMP_TO_EDGE);(this.useNormalOffset=n,n)?(s.u_shadow_normal_offset=[1,5,5],s.u_shadow_bias=[6e-5,.0012,.012]):s.u_shadow_bias=[36e-5,.0012,.012],i.setShadowUniformValues(o,s)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(r,i,n,o){let a;if(o[2]>=0)return{};let s=(a=n/(1<<r.canonical.z),new e.bV([r.canonical.x*a+r.wrap*n,r.canonical.y*a+r.wrap*n,0],[(r.canonical.x+1)*a+r.wrap*n,(r.canonical.y+1)*a+r.wrap*n,i])).getCorners(),l=-(i/o[2]);o[0]<0?(e.Q.add(s[0],s[0],[o[0]*l,0,0]),e.Q.add(s[3],s[3],[o[0]*l,0,0])):o[0]>0&&(e.Q.add(s[1],s[1],[o[0]*l,0,0]),e.Q.add(s[2],s[2],[o[0]*l,0,0])),o[1]<0?(e.Q.add(s[0],s[0],[0,o[1]*l,0]),e.Q.add(s[1],s[1],[0,o[1]*l,0])):o[1]>0&&(e.Q.add(s[2],s[2],[0,o[1]*l,0]),e.Q.add(s[3],s[3],[0,o[1]*l,0]));let u={};return u.vertices=s,u.planes=[rw(s[1],s[0],s[4]),rw(s[2],s[1],s[5]),rw(s[3],s[2],s[6]),rw(s[0],s[3],s[7])],u}addShadowReceiver(r,i,n){this._receivers.add(r,e.bV.fromTileIdAndHeight(r,i,n))}getMaxCascadeForTile(e){let r=this._receivers.get(e);
16return r&&r.lastCascade?r.lastCascade:0}}function rw(r,i,n){let o=e.Q.sub([],n,i),a=e.Q.sub([],r,i),s=e.Q.cross([],o,a),l=e.Q.length(s);return 0===l?[0,0,1,0]:(e.Q.scale(s,s,1/l),[s[0],s[1],s[2],-e.Q.dot(s,i)])}function rE(r){let i=r.properties.get("direction"),n=e.bT(i.x,i.y,i.z);n[2]=e.ad(n[2],0,75);let o=e.bW([n[0],n[1],n[2]]);return e.Q.fromValues(o.x,o.y,o.z)}function rS(r,i){let n=r.properties.get("color"),o=r.properties.get("intensity"),a=r.properties.get("direction"),s=[a.x,a.y,a.z],l=i.properties.get("color"),u=i.properties.get("intensity"),c=Math.max(e.Q.dot([0,0,1],s),0),h=[0,0,0];e.Q.scale(h,l.toArray01Linear().slice(0,3),u);let p=[0,0,0];return e.Q.scale(p,n.toArray01Linear().slice(0,3),c*o),e.bX([h[0]>0?h[0]/(h[0]+p[0]):0,h[1]>0?h[1]/(h[1]+p[1]):0,h[2]>0?h[2]/(h[2]+p[2]):0])}let rT=(e,r)=>ei(e,r&&r.filter(e=>"source.canvas"!==e.identifier)),rI=e.af(tM,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection","setCamera","addImport","removeImport","updateImport"]),rM=e.af(tM,["setCenter","setZoom","setBearing","setPitch"]),rC={version:8,layers:[],sources:{}},rA={duration:300,delay:0};class rP extends e.E{constructor(r,i={}){super(),this.map=r,this.scope=i.scope||"",this.globalId=null,this.fragments=[],this.importDepth=i.importDepth||0,this.importsCache=i.importsCache||new Map,this.resolvedImports=i.resolvedImports||new Set,this.transition=e.e({},rA),this._buildingIndex=new tT(this),this.crossTileSymbolIndex=new rs,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=i.styleChanges||new v,this.dispatcher=i.dispatcher?i.dispatcher:new e.bZ(e.b_(),this),i.imageManager?this.imageManager=i.imageManager:(this.imageManager=new w,this.imageManager.setEventedParent(this)),this.imageManager.createScope(this.scope),this.glyphManager=i.glyphManager?i.glyphManager:new e.b$(r._requestManager,i.localFontFamily?e.c0.all:i.localIdeographFontFamily?e.c0.ideographs:e.c0.none,i.localFontFamily||i.localIdeographFontFamily),i.modelManager?this.modelManager=i.modelManager:(this.modelManager=new x(r._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this.options=i.configOptions?i.configOptions:new Map,this._configDependentLayers=i.configDependentLayers?i.configDependentLayers:new Set,this._config=i.config,this._initialConfig=i.initialConfig,this.dispatcher.broadcast("setReferrer",e.c1());const n=this;this._rtlTextPluginCallback=rP.registerForPluginStateChange(r=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:r.pluginStatus,pluginURL:r.pluginURL},(r,i)=>{if(e.c2(r),i&&i.every(e=>e))for(let e in n._sourceCaches){let r=n._sourceCaches[e],i=r.getSource().type;"vector"!==i&&"geojson"!==i||r.reload()}})}),this.on("data",e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;let r=this.getOwnSource(e.sourceId);if(r&&r.vectorLayerIds)for(let e in this._layers){let i=this._layers[e];i.source===r.id&&this._validateLayer(i)}})}load(e){return e&&("string"==typeof e?this.loadURL(e):this.loadJSON(e)),this}_getGlobalId(r){if(!r)return null;if("string"==typeof r){if(e.c3(r))return r;let i=e.c4(r);if(!i.startsWith("http"))try{return new URL(i,location.href).toString()}catch(e){}return i}return`json://${e.c5(JSON.stringify(r))}`}_diffStyle(r,i,n){this.globalId=this._getGlobalId(r);let o=(e,r)=>{try{r(null,this.setState(e,n))}catch(e){r(e,!1)}};if("string"==typeof r){let n=this.map._requestManager.normalizeStyleURL(r),a=this.map._requestManager.transformRequest(n,e.R.Style);e.g(a,(r,n)=>{r?this.fire(new e.a(r)):n&&o(n,i)})}else"object"==typeof r&&o(r,i)}loadURL(r,i={}){this.fire(new e.b("dataloading",{dataType:"style"}));
16let n="boolean"==typeof i.validate?i.validate:!e.c3(r);this.globalId=this._getGlobalId(r),r=this.map._requestManager.normalizeStyleURL(r,i.accessToken),this.resolvedImports.add(r);let o=this.importsCache.get(r);if(o)return this._load(o,n);let a=this.map._requestManager.transformRequest(r,e.R.Style);this._request=e.g(a,(i,o)=>{if(this._request=null,i)this.fire(new e.a(i));else if(o)return this.importsCache.set(r,o),this._load(o,n)})}loadJSON(r,i={}){this.fire(new e.b("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(r),this._request=e.f.frame(()=>{this._request=null,this._load(r,!1!==i.validate)})}loadEmpty(){this.fire(new e.b("dataloading",{dataType:"style"})),this._load(rC,!1)}_loadImports(r,i,n){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();let o=[];for(let e of r){let r=this._createFragmentStyle(e),a=new Promise(e=>{r.once("style.import.load",e),r.once("error",e)}).then(()=>this.mergeAll());if(o.push(a),this.resolvedImports.has(e.url)){r.loadEmpty();continue}let s=e.data||this.importsCache.get(e.url);s?(r.loadJSON(s,{validate:i}),this._isInternalStyle(s)&&(r.globalId=null)):e.url?r.loadURL(e.url,{validate:i}):r.loadEmpty();let l={style:r,id:e.id,config:e.config};if(n){let e=this.fragments.findIndex(({id:e})=>e===n);this.fragments=this.fragments.slice(0,e).concat(l).concat(this.fragments.slice(e))}else this.fragments.push(l)}return Promise.allSettled(o)}getImportGlobalIds(e=this,r=new Set){for(let i of e.fragments)i.style.globalId&&r.add(i.style.globalId),this.getImportGlobalIds(i.style,r);return[...r.values()]}_createFragmentStyle(r){let i,n=this.scope?e.aj(r.id,this.scope):r.id,o=this._initialConfig&&this._initialConfig[n];(r.config||o)&&(i=e.e({},r.config,o));let a=new rP(this.map,{scope:n,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:i,configOptions:this.options,configDependentLayers:this._configDependentLayers});return a.setEventedParent(this.map,{style:a}),a}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.isRootStyle()}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}_load(r,i){let n=r.schema;if(this._isInternalStyle(r)){let n=e.e({},rC,{imports:[{id:"basemap",data:r,url:""}]});return void this._load(n,i)}if(this.updateConfig(this._config,n),i&&rT(this,H(r)))return;for(let i in this._loaded=!0,this.stylesheet=e.c6(r),r.sources)this.addSource(i,r.sources[i],{validate:!1,isInitialLoad:!0});r.sprite?this._loadSprite(r.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.glyphManager.setURL(r.glyphs,this.scope);let o=tI(this.stylesheet.layers);if(this._order=o.map(e=>e.id),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){let e=this.stylesheet.lights[0];this.light=new eo(e.properties,e.id)}else this.setLights(this.stylesheet.lights);for(let r of(this.light||(this.light=new eo(this.stylesheet.light)),this._layers={},this._serializedLayers={},o)){let i=e.c7(r,this.scope,this.options);i.isConfigDependent&&this._configDependentLayers.add(i.fqid),i.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=i,this._serializedLayers[i.id]=i.serialize();let n=this.getOwnLayerSourceCache(i),o=!!this.directionalLight&&this.directionalLight.shadowsEnabled();n&&i.canCastShadows()&&o&&(n.castsShadows=!0)}this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);let a=this.stylesheet.terrain;a&&(void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.f.hasCanvasFingerprintNoise()),this.disableElevatedTerrain?e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."):this.terrainSetForDrapingOnly()||this._createTerrain(a,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.b("data",{dataType:"style"}));let s=this.isRootStyle();r.imports?this._loadImports(r.imports,i).then(()=>{this._reloadImports(),this.fire(new e.b(s?"style.load":"style.import.load"))}):(this._reloadImports(),this.fire(new e.b(s?"style.load":"style.import.load")))}isRootStyle(){return 0===this.importDepth}mergeAll(){let r,i,n,o,a,s,l,u;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(e=>{if(e.stylesheet){if(null!=e.light&&(r=e.light),e.stylesheet.lights)for(let r of e.stylesheet.lights)"ambient"===r.type&&null!=e.ambientLight&&(i=e.ambientLight),"directional"===r.type&&null!=e.directionalLight&&(n=e.directionalLight);o=this._prioritizeTerrain(o,e.terrain,e.stylesheet.terrain),e.stylesheet.fog&&null!=e.fog&&(a=e.fog),null!=e.stylesheet.camera&&(u=e.stylesheet.camera),null!=e.stylesheet.projection&&(s=e.stylesheet.projection),null!=e.stylesheet.transition&&(l=e.stylesheet.transition)}}),this.light=r,this.ambientLight=i,this.directionalLight=n,this.fog=a,null===o?delete this.terrain:this.terrain=o,this.camera=u||{"camera-projection":"perspective"},this.projection=s||{name:"mercator"},this.transition=e.e({},rA,l),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(e){let r=i=>{for(let e of i.fragments)r(e.style);e(i)};r(this)}_prioritizeTerrain(e,r,i){let n=e&&0===e.drapeRenderMode;return null===i?r&&0===r.drapeRenderMode?r:n?e:null:null!=r&&(!e||n||r&&1===r.drapeRenderMode)?r:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(r=>{e=this._prioritizeTerrain(e,r.terrain,r.stylesheet.terrain)}),null===e?delete this.terrain:this.terrain=e}mergeProjection(){let e;this.forEachFragmentStyle(r=>{null!=r.stylesheet.projection&&(e=r.stylesheet.projection)}),this.projection=e||{name:"mercator"}}mergeSources(){let r={},i={},n={};this.forEachFragmentStyle(o=>{for(let i in o._sourceCaches)r[e.aj(i,o.scope)]=o._sourceCaches[i];for(let r in o._otherSourceCaches)i[e.aj(r,o.scope)]=o._otherSourceCaches[r];for(let r in o._symbolSourceCaches)n[e.aj(r,o.scope)]=o._symbolSourceCaches[r]}),this._mergedSourceCaches=r,this._mergedOtherSourceCaches=i,this._mergedSymbolSourceCaches=n}mergeLayers(){let r={},i=[],n={};this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(n=>{for(let o of n._order){let a=n._layers[o];if("slot"===a.type){let i=e.c8(o);if(r[i])continue;
16r[i]=[]}a.slot&&r[a.slot]?r[a.slot].push(a):i.push(a)}}),this._mergedOrder=[];let o=(i=[])=>{for(let a of i)if("slot"===a.type){let i=e.c8(a.id);r[i]&&o(r[i])}else{let r=e.aj(a.id,a.scope);this._mergedOrder.push(r),n[r]=a,a.is3D()&&(this._has3DLayers=!0),"circle"===a.type&&(this._hasCircleLayers=!0),"symbol"===a.type&&(this._hasSymbolLayers=!0)}};o(i),this._mergedLayers=n,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(r){return this.stylesheet.camera=e.e({},this.stylesheet.camera,r),this.camera=this.stylesheet.camera,this}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(r){this._spriteRequest=function(r,i,n){let o,a,s,l=e.f.devicePixelRatio>1?"@2x":"",u=e.g(i.transformRequest(i.normalizeSpriteURL(r,l,".json"),e.R.SpriteJSON),(e,r)=>{u=null,s||(s=e,o=r,h())}),c=e.d(i.transformRequest(i.normalizeSpriteURL(r,l,".png"),e.R.SpriteImage),(e,r)=>{c=null,s||(s=e,a=r,h())});function h(){if(s)n(s);else if(o&&a){let r=e.f.getImageData(a),i={};for(let n in o){let{width:a,height:s,x:l,y:u,sdf:c,pixelRatio:h,stretchX:p,stretchY:d,content:f}=o[n],m=new e.h({width:a,height:s});e.h.copy(r,m,{x:l,y:u},{x:0,y:0},{width:a,height:s}),i[n]={data:m,pixelRatio:h,sdf:c,stretchX:p,stretchY:d,content:f}}n(null,i)}}return{cancel(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(r,this.map._requestManager,(r,i)=>{if(this._spriteRequest=null,r)this.fire(new e.a(r));else if(i)for(let e in i)this.imageManager.addImage(e,this.scope,i[e]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.b("data",{dataType:"style"}))})}_validateLayer(r){let i=this.getOwnSource(r.source);if(!i)return;let n=r.sourceLayer;
16n&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.a(Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${r.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(let e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;if(!this.imageManager.isLoaded()||!this.modelManager.isLoaded())return!1;for(let{style:e}of this.fragments)if(!e.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((e,r)=>{let i=this.fragments[r];return i&&i.style&&(e.data=i.style.serialize()),e})}_serializeSources(){let e={};for(let r in this._sourceCaches){let i=this._sourceCaches[r].getSource();e[i.id]||(e[i.id]=i.serialize())}return e}_serializeLayers(e){let r=[];for(let i of e){let e=this._layers[i];e&&"custom"!==e.type&&r.push(e.serialize())}return r}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasTransitions(){if(this.hasLightTransitions()||this.hasFogTransition())return!0;for(let e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}isLayerDraped(e){return!!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading")}_checkLayer(r){let i=this.getOwnLayer(r);if(i)return i;this.fire(new e.a(Error(`The layer '${r}' does not exist in the map's style.`)))}_checkSource(r){let i=this.getOwnSource(r);if(i)return i;this.fire(new e.a(Error(`The source '${r}' does not exist in the map's style.`)))}update(r){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(r),this.directionalLight&&this.directionalLight.recalculate(r);let i=this.calculateLightsBrightness();r.brightness=i||0,i!==this._brightness&&(this._brightness=i,this.dispatcher.broadcast("setBrightness",i));let n=this._changes.isDirty();if(this._changes.isDirty()){let e=this._changes.getLayerUpdatesByScope();for(let r in e){let{updatedIds:i,removedIds:n}=e[r];(i||n)&&this._updateWorkerLayers(r,i,n)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(r),this.light&&this.light.updateTransitions(r),this.ambientLight&&this.ambientLight.updateTransitions(r),this.directionalLight&&this.directionalLight.updateTransitions(r),this.fog&&this.fog.updateTransitions(r),this._changes.reset()}let o={};for(let e in this._mergedSourceCaches){let r=this._mergedSourceCaches[e];o[e]=r.used,r.used=!1,r.tileCoverLift=0}for(let e of this._mergedOrder){let i=this._mergedLayers[e];if(i.recalculate(r,this._availableImages),!i.isHidden(r.zoom)){let e=this.getLayerSourceCache(i);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,i.tileCoverLift()))}if(!this._precompileDone&&this._shouldPrecompile)for(let e=i.minzoom||0;e<(i.maxzoom||25.5);e++){let e=this.map.painter;if(e){let n=i.getProgramIds();if(!n)continue;for(let o of n){let n=i.getDefaultProgramParams(o,r.zoom);n&&(e.style=this,this.fog&&(e._fogVisible=!0,n.overrideFog=!0,e.getOrCreateProgram(o,n)),e._fogVisible=!1,n.overrideFog=!1,e.getOrCreateProgram(o,n),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(n.overrideRtt=!0,e.getOrCreateProgram(o,n)))}}}}for(let r in this._shouldPrecompile&&(this._precompileDone=!0),o){let i=this._mergedSourceCaches[r];o[r]!==i.used&&i.getSource().fire(new e.b("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light&&this.light.recalculate(r),this.terrain&&this.terrain.recalculate(r),this.fog&&this.fog.recalculate(r),this.z=r.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),n&&this.fire(new e.b("data",{dataType:"style"}))}
16_updateTilesForChangedImages(){let e=this._changes.getUpdatedImages();if(e.length){for(let r in this._sourceCaches)this._sourceCaches[r].reloadTilesForDependencies(["icons","patterns"],e);this._changes.resetUpdatedImages()}}_updateWorkerLayers(e,r,i){let n=this.getFragmentStyle(e);n&&this.dispatcher.broadcast("updateLayers",{layers:r?n._serializeLayers(r):[],scope:e,removedIds:i||[],options:n.options})}setState(r,i){if(this._checkLoaded(),rT(this,H(r)))return!1;(r=e.c6(r)).layers=tI(r.layers);let o=(function(e,r){if(!e)return[{command:tM.setStyle,args:[r]}];let i=[];try{if(!n(e.version,r.version))return[{command:tM.setStyle,args:[r]}];n(e.center,r.center)||i.push({command:tM.setCenter,args:[r.center]}),n(e.zoom,r.zoom)||i.push({command:tM.setZoom,args:[r.zoom]}),n(e.bearing,r.bearing)||i.push({command:tM.setBearing,args:[r.bearing]}),n(e.pitch,r.pitch)||i.push({command:tM.setPitch,args:[r.pitch]}),n(e.sprite,r.sprite)||i.push({command:tM.setSprite,args:[r.sprite]}),n(e.glyphs,r.glyphs)||i.push({command:tM.setGlyphs,args:[r.glyphs]}),n(e.imports,r.imports)||function(e=[],r=[],i){let o,a,s,l;r=r||[];let u=(e=e||[]).map(tL),c=r.map(tL),h=e.reduce(tO,{}),p=r.reduce(tO,{}),d=u.slice();for(o=0,a=0;o<u.length;o++)s=u[o],p.hasOwnProperty(s)?a++:(i.push({command:tM.removeImport,args:[s]}),d.splice(d.indexOf(s,a),1));for(o=0,a=0;o<c.length;o++)s=c[c.length-1-o],d[d.length-1-o]!==s&&(h.hasOwnProperty(s)?(i.push({command:tM.removeImport,args:[s]}),d.splice(d.lastIndexOf(s,d.length-a),1)):a++,l=d[d.length-o],i.push({command:tM.addImport,args:[p[s],l]}),d.splice(d.length-o,0,s));for(let e of r){let r=h[e.id];r&&!n(r,e)&&i.push({command:tM.updateImport,args:[e.id,e]})}}(e.imports,r.imports,i),n(e.transition,r.transition)||i.push({command:tM.setTransition,args:[r.transition]}),n(e.light,r.light)||i.push({command:tM.setLight,args:[r.light]}),n(e.fog,r.fog)||i.push({command:tM.setFog,args:[r.fog]}),n(e.projection,r.projection)||i.push({command:tM.setProjection,args:[r.projection]}),n(e.lights,r.lights)||i.push({command:tM.setLights,args:[r.lights]}),n(e.camera,r.camera)||i.push({command:tM.setCamera,args:[r.camera]});let o={},a=[];!function(e,r,i,o){let a;for(a in r=r||{},e=e||{})e.hasOwnProperty(a)&&(r.hasOwnProperty(a)||tA(a,i,o));for(a in r){var s;if(!r.hasOwnProperty(a))continue;let l=r[a];e.hasOwnProperty(a)?n(e[a],l)||("geojson"===e[a].type&&"geojson"===l.type&&function(e,r,i){let o;for(o in e[i])if(e[i].hasOwnProperty(o)&&"data"!==o&&!n(e[i][o],r[i][o]))return!1;for(o in r[i])if(r[i].hasOwnProperty(o)&&"data"!==o&&!n(e[i][o],r[i][o]))return!1;return!0}(e,r,a)?i.push({command:tM.setGeoJSONSourceData,args:[a,l.data]}):(s=r,tA(a,i,o),tC(a,s,i))):tC(a,r,i)}}(e.sources,r.sources,a,o);let s=[];e.layers&&e.layers.forEach(e=>{e.source&&o[e.source]?i.push({command:tM.removeLayer,args:[e.id]}):s.push(e)});let l=e.terrain;l&&o[l.source]&&(i.push({command:tM.setTerrain,args:[void 0]}),l=void 0),i=i.concat(a),n(l,r.terrain)||i.push({command:tM.setTerrain,args:[r.terrain]}),function(e,r,i){let o,a,s,l,u,c,h;r=r||[];let p=(e=e||[]).map(tL),d=r.map(tL),f=e.reduce(tO,{}),m=r.reduce(tO,{}),g=p.slice(),_=Object.create(null);for(o=0,a=0;o<p.length;o++)s=p[o],m.hasOwnProperty(s)?a++:(i.push({command:tM.removeLayer,args:[s]}),g.splice(g.indexOf(s,a),1));for(o=0,a=0;o<d.length;o++)s=d[d.length-1-o],g[g.length-1-o]!==s&&(f.hasOwnProperty(s)?(i.push({command:tM.removeLayer,args:[s]}),g.splice(g.lastIndexOf(s,g.length-a),1)):a++,c=g[g.length-o],i.push({command:tM.addLayer,args:[m[s],c]}),g.splice(g.length-o,0,s),_[s]=!0);for(o=0;o<d.length;o++)if(l=f[s=d[o]],u=m[s],!_[s]&&!n(l,u))if(n(l.source,u.source)&&n(l["source-layer"],u["source-layer"])&&n(l.type,u.type)){for(h in tP(l.layout,u.layout,i,s,null,tM.setLayoutProperty),tP(l.paint,u.paint,i,s,null,tM.setPaintProperty),n(l.slot,u.slot)||i.push({command:tM.setSlot,args:[s,u.slot]}),n(l.filter,u.filter)||i.push({command:tM.setFilter,args:[s,u.filter]}),n(l.minzoom,u.minzoom)&&n(l.maxzoom,u.maxzoom)||i.push({command:tM.setLayerZoomRange,args:[s,u.minzoom,u.maxzoom]}),l)l.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&"slot"!==h&&(0===h.indexOf("paint.")?tP(l[h],u[h],i,s,h.slice(6),tM.setPaintProperty):n(l[h],u[h])||i.push({command:tM.setLayerProperty,args:[s,h,u[h]]}));for(h in u)u.hasOwnProperty(h)&&!l.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&"slot"!==h&&(0===h.indexOf("paint.")?tP(l[h],u[h],i,s,h.slice(6),tM.setPaintProperty):n(l[h],u[h])||i.push({command:tM.setLayerProperty,args:[s,h,u[h]]}))}else i.push({command:tM.removeLayer,args:[s]}),c=g[g.lastIndexOf(s)+1],i.push({command:tM.addLayer,args:[u,c]})}(s,r.layers,i)}catch(e){console.warn("Unable to compute style diff:",e),i=[{command:tM.setStyle,args:[r]}]}return i})(this.serialize(),r).filter(e=>!(e.command in rM));if(0===o.length)return!1;let a=o.filter(e=>!(e.command in rI));if(a.length>0)throw Error(`Unimplemented: ${a.map(e=>e.command).join(", ")}.`);let s=[];
16return o.forEach(e=>{s.push(this[e.command].apply(this,e.args))}),i&&Promise.all(s).then(i),this.stylesheet=r,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}addImage(r,i){return this.getImage(r)?this.fire(new e.a(Error("An image with this name already exists."))):(this.imageManager.addImage(r,this.scope,i),this._afterImageUpdated(r),this)}updateImage(e,r){this.imageManager.updateImage(e,this.scope,r)}getImage(e){return this.imageManager.getImage(e,this.scope)}removeImage(r){return this.getImage(r)?(this.imageManager.removeImage(r,this.scope),this._afterImageUpdated(r),this):this.fire(new e.a(Error("No image with this name exists.")))}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(this.scope),this._changes.updateImage(r),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.fire(new e.b("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(e,r,i={}){return this._checkLoaded(),this._validate(et,`models.${e}`,r,null,i)||(this.modelManager.addModel(e,r,this.scope),this._changes.setDirty()),this}hasModel(e){return this.modelManager.hasModel(e,this.scope)}removeModel(r){return this.hasModel(r)?(this.modelManager.removeModel(r,this.scope),this):this.fire(new e.a(Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(r,i,n={}){if(this._checkLoaded(),void 0!==this.getOwnSource(r))throw Error(`There is already a source with ID "${r}".`);if(!i.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate($,`sources.${r}`,i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);let o=t_(r,i,this.dispatcher,this);o.scope=this.scope,o.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(o.id),source:o.serialize(),sourceId:o.id}));let a=r=>{let i=(r?"symbol:":"other:")+o.id,n=e.aj(i,this.scope),a=this._sourceCaches[i]=new tb(n,o,r);(r?this._symbolSourceCaches:this._otherSourceCaches)[o.id]=a,a.onAdd(this.map)};a(!1),"vector"!==i.type&&"geojson"!==i.type||a(!0),o.onAdd&&o.onAdd(this.map),n.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(r){this._checkLoaded();let i=this.getOwnSource(r);if(!i)throw Error("There is no source with this ID");for(let i in this._layers)if(this._layers[i].source===r)return this.fire(new e.a(Error(`Source "${r}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===r)return this.fire(new e.a(Error(`Source "${r}" cannot be removed while terrain is using it.`)));for(let i of this.getOwnSourceCaches(r)){let r=e.c8(i.id);delete this._sourceCaches[r],this._changes.discardSourceCacheUpdate(i.id),i.fire(new e.b("data",{sourceDataType:"metadata",dataType:"source",sourceId:i.getSource().id})),i.setEventedParent(null),i.clearTiles()}return delete this._otherSourceCaches[r],delete this._symbolSourceCaches[r],this.mergeSources(),i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(e,r){this._checkLoaded(),this.getOwnSource(e).setData(r),this._changes.setDirty()}getOwnSource(e){let r=this.getOwnSourceCache(e);return r&&r.getSource()}getOwnSources(){let e=[];for(let r in this._otherSourceCaches){let i=this.getOwnSourceCache(r);i&&e.push(i.getSource())}return e}areTilesLoaded(){let e=this._mergedSourceCaches;for(let r in e){let i=e[r]._tiles;for(let e in i){let r=i[e];if("loaded"!==r.state&&"errored"!==r.state)return!1}}return!0}setLights(r){if(this._checkLoaded(),!r)return delete this.ambientLight,void delete this.directionalLight;let i=this._getTransitionParameters();for(let e of r){if(this._validate(Y,"lights",e))return;switch(e.type){case"ambient":if(this.ambientLight){let r=this.ambientLight;r.set(e),r.updateTransitions(i)}else this.ambientLight=new ef(e,em,this.scope,this.options);break;case"directional":if(this.directionalLight){let r=this.directionalLight;r.set(e),r.updateTransitions(i)}else this.directionalLight=new ef(e,eg,this.scope,this.options)}}let n=new e.N(this.z||0,i);this.ambientLight&&this.ambientLight.recalculate(n),this.directionalLight&&this.directionalLight.recalculate(n),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){let r=this.directionalLight,i=this.ambientLight;if(!r||!i)return;let n=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),o=r.properties.get("color").toArray01(),a=r.properties.get("intensity"),s=r.properties.get("direction"),l=1-e.bT(s.x,s.y,s.z)[2]/90,u=n(o)*a*l,c=i.properties.get("color").toArray01(),h=i.properties.get("intensity");return(u+n(c)*h)/2}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;let e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(r){if(!r)return this;if(e.c9(r)){let i=e.ca(r),n=this.fragments.find(({id:e})=>e===i);if(!n)throw Error(`Style import not found: ${r}`);let o=e.c8(r);return n.style.getFragmentStyle(o)}{let e=this.fragments.find(({id:e})=>e===r);if(!e)throw Error(`Style import not found: ${r}`);return e.style}}getConfigProperty(r,i){let n=this.getFragmentStyle(r);if(!n)return null;let o=e.aj(i,n.scope),a=n.options.get(o),s=a?a.value||a.default:null;return s?s.serialize():null}setConfigProperty(r,i,n){let o,a=this.getFragmentStyle(r);if(!a)return;let s=a.stylesheet.schema;if(!s||!s[i])return;let l=e.t(n);if("success"!==l.result)return void rT(this,l.value);let u=l.value.expression,c=e.aj(i,a.scope),h=a.options.get(c);if(!h)return;let{minValue:p,maxValue:d,stepValue:f,type:m,values:g}=s[i],_=e.t(s[i].default);"success"===_.result&&(o=_.value.expression),o?(this.options.set(c,{...h,value:u,default:o,minValue:p,maxValue:d,stepValue:f,type:m,values:g}),this.updateConfigDependencies()):this.fire(new e.a(Error(`No schema defined for the config option "${i}" in the "${r}" fragment.`)))}getConfig(r){let i=this.getFragmentStyle(r);if(!i)return null;let n=i.stylesheet.schema;if(!n)return null;let o={};for(let r in n){let n=e.aj(r,i.scope),a=i.options.get(n),s=a?a.value||a.default:null;o[r]=s?s.serialize():null}return o}setConfig(e,r){let i=this.getFragmentStyle(e);
16i&&(i.updateConfig(r,i.stylesheet.schema),this.updateConfigDependencies())}getSchema(e){let r=this.getFragmentStyle(e);return r?r.stylesheet.schema:null}setSchema(e,r){let i=this.getFragmentStyle(e);i&&(i.stylesheet.schema=r,i.updateConfig(i._config,r),this.updateConfigDependencies())}updateConfig(r,i){if(this._config=r,r||i)if(i)for(let n in i){let o,a,s=e.t(i[n].default);if("success"===s.result&&(o=s.value.expression),r&&void 0!==r[n]){let i=e.t(r[n]);"success"===i.result&&(a=i.value.expression)}let{minValue:l,maxValue:u,stepValue:c,type:h,values:p}=i[n];if(o){let r=e.aj(n,this.scope);this.options.set(r,{default:o,value:a,minValue:l,maxValue:u,stepValue:c,type:h,values:p})}else this.fire(new e.a(Error(`No schema defined for config option "${n}".`)))}else this.fire(new e.a(Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(){for(let e of this._configDependentLayers){let r=this.getLayer(e);r&&(r.possiblyEvaluateVisibility(),this._updateLayer(r))}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this._changes.setDirty()}addLayer(r,i,n={}){let o;this._checkLoaded();let a=r.id;if(this._layers[a])return void this.fire(new e.a(Error(`Layer with i
16d "${a}" already exists on this map`)));if("custom"===r.type){if(rT(this,e.cb(r)))return;o=e.c7(r,this.scope,this.options)}else{if("object"==typeof r.source&&(this.addSource(a,r.source),r=e.c6(r),r=e.e(r,{source:a})),this._validate(K,`layers.${a}`,r,{arrayIndex:-1},n))return;o=e.c7(r,this.scope,this.options),this._validateLayer(o),o.setEventedParent(this,{layer:{id:a}}),this._serializedLayers[o.id]=o.serialize()}o.isConfigDependent&&this._configDependentLayers.add(o.fqid);let s=this._order.length;if(i){let r=this._order.indexOf(i);if(-1===r)return void this.fire(new e.a(Error(`Layer with id "${i}" does not exist on this map.`)));o.slot===this._layers[i].slot?s=r:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(s,0,a),this._layerOrderChanged=!0,this._layers[a]=o;let l=this.getOwnLayerSourceCache(o),u=!!this.directionalLight&&this.directionalLight.shadowsEnabled();l&&o.canCastShadows()&&u&&(l.castsShadows=!0);let c=this._changes.getRemovedLayer(o);if(c&&o.source&&l&&"custom"!==o.type){this._changes.discardLayerRemoval(o);let r=e.aj(o.source,o.scope);c.type!==o.type?this._changes.updateSourceCache(r,"clear"):(this._changes.updateSourceCache(r,"reload"),l.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),o.scope=this.scope,this.mergeLayers()}moveLayer(r,i){this._checkLoaded();let n=this._checkLayer(r);if(!n||r===i)return;let o=this._order.indexOf(r);this._order.splice(o,1);let a=this._order.length;if(i){let r=this._order.indexOf(i);
16if(-1===r)return void this.fire(new e.a(Error(`Layer with id "${i}" does not exist on this map.`)));n.slot===this._layers[i].slot?a=r:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(a,0,r),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(e){this._checkLoaded();let r=this._checkLayer(e);if(!r)return;r.setEventedParent(null);let i=this._order.indexOf(e);this._order.splice(i,1),delete this._layers[e],delete this._serializedLayers[e],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(r.fqid),this._changes.removeLayer(r);let n=this.getOwnLayerSourceCache(r);if(n&&n.castsShadows){let e=!1;for(let i in this._layers)if(this._layers[i].source===r.source&&this._layers[i].canCastShadows()){e=!0;break}n.castsShadows=e}r.onRemove&&r.onRemove(this.map),this.mergeLayers()}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(let r in this._layers)if(this._layers[r].type===e)return!0;return!1}setLayerZoomRange(e,r,i){this._checkLoaded();let n=this._checkLayer(e);n&&(n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)))}setSlot(e,r){this._checkLoaded();let i=this._checkLayer(e);i&&i.slot!==r&&(i.slot=r,this._updateLayer(i))}setFilter(r,i,o={}){this._checkLoaded();let a=this._checkLayer(r);if(a&&!n(a.filter,i))return null==i?(a.filter=void 0,void this._updateLayer(a)):void(this._validate(Q,`layers.${a.id}.filter`,i,{layerType:a.type},o)||(a.filter=e.c6(i),this._updateLayer(a)))}getFilter(r){let i=this._checkLayer(r);if(i)return e.c6(i.filter)}setLayoutProperty(r,i,o,a={}){this._checkLoaded();let s=this._checkLayer(r);if(s&&!n(s.getLayoutProperty(i),o)){if(null!=o&&(!a||!1!==a.validate)&&rT(s,ee.call(H,{key:`layers.${r}.layout.${i}`,layerType:s.type,objectKey:i,value:o,styleSpec:e.G,style:{glyphs:!0,sprite:!0}})))return;s.setLayoutProperty(i,o),s.isConfigDependent&&this._configDependentLayers.add(s.fqid),this._updateLayer(s)}}getLayoutProperty(e,r){let i=this._checkLayer(e);if(i)return i.getLayoutProperty(r)}setPaintProperty(r,i,o,a={}){this._checkLoaded();let s=this._checkLayer(r);if(!s||n(s.getPaintProperty(i),o)||null!=o&&(!a||!1!==a.validate)&&rT(s,J.call(H,{key:`layers.${r}.paint.${i}`,layerType:s.type,objectKey:i,value:o,styleSpec:e.G})))return;let l=s.setPaintProperty(i,o);s.isConfigDependent&&this._configDependentLayers.add(s.fqid),l&&this._updateLayer(s),this._changes.updatePaintProperties(s)}getPaintProperty(e,r){let i=this._checkLayer(e);if(i)return i.getPaintProperty(r)}setFeatureState(r,i){this._checkLoaded();let n=r.source,o=r.sourceLayer,a=this._checkSource(n);if(!a)return;let s=a.type;if("geojson"===s&&o)return void this.fire(new e.a(Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===s&&!o)return void this.fire(new e.a(Error("The sourceLayer parameter must be provided for vector source types.")));for(let a of(void 0===r.id&&this.fire(new e.a(Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(n)))a.setFeatureState(o,r.id,i)}removeFeatureState(r,i){this._checkLoaded();let n=r.source,o=this._checkSource(n);if(!o)return;let a=o.type,s="vector"===a?r.sourceLayer:void 0;if("vector"===a&&!s)return void this.fire(new e.a(Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof r.id&&"number"!=typeof r.id)return void this.fire(new e.a(Error("A feature id is required to remove its specific state property.")));for(let e of this.getOwnSourceCaches(n))e.removeFeatureState(s,r.id,i)}getFeatureState(r){this._checkLoaded();let i=r.source,n=r.sourceLayer,o=this._checkSource(i);if(o){if("vector"!==o.type||n)return void 0===r.id&&this.fire(new e.a(Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(i)[0].getFeatureState(n,r.id);this.fire(new e.a(Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(r){return this.stylesheet.transition=e.e({},this.stylesheet.transition,r),this.transition=this.stylesheet.transition,this}getTransition(){return e.e({},this.stylesheet.transition)}serialize(){this._checkLoaded();let r=this.getTerrain(),i=r&&this.terrain&&this.terrain.scope===this.scope?r:this.stylesheet.terrain;return e.cc({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:i,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},e=>void 0!==e)}_updateLayer(r){this._changes.updateLayer(r);let i=this.getLayerSourceCache(r),n=e.aj(r.source,r.scope),o=this._changes.getUpd
16atedSourceCaches();r.source&&!o[n]&&i&&"raster"!==i.getSource().type&&(this._changes.updateSourceCache(n,"reload"),i.pause()),r.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){let r=e=>"fill-extrusion"===this._mergedLayers[e].type||"model"===this._mergedLayers[e].type,i=this.order,n={},o=[];for(let a=i.length-1;a>=0;a--){let s=i[a];if(r(s))for(let r of(n[s]=a,e)){let e=r[s];if(e)for(let r of e)o.push(r)}}o.sort((e,r)=>r.intersectionZ-e.intersectionZ);let a=[];for(let s=i.length-1;s>=0;s--){let l=i[s];if(r(l))for(let e=o.length-1;e>=0;e--){let r=o[e].feature;if(n[r.layer.id]<s)break;a.push(r),o.pop()}else for(let r of e){let e=r[l];if(e)for(let r of e)a.push(r.feature)}}return a}queryRenderedFeatures(r,i,n){i&&i.filter&&this._validate(Q,"queryRenderedFeatures.filter",i.filter,null,i),i.scope=this.scope,i.availableImages=this._availableImages,i.serializedLayers=this._serializedLayers;let o={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new e.a(Error("parameters.layers must be an Array."))),[];for(let r of i.layers){let i=this._mergedLayers[r];if(!i)return this.fire(new e.a(Error(`The layer '${r}' does not exist in the map's style and cannot be queried for features.`))),[];o[i.source]=!0}}let a=[],s=i.serializedLayers||{},l=i&&i.layers?i.layers.some(e=>{let r=this.getLayer(e);return r&&r.is3D()}):this.has3DLayers(),u=e_.createFromScreenPoints(r,n);for(let r in this._mergedSourceCaches){let c=this._mergedSourceCaches[r].getSource();if(!c||c.scope!==i.scope)continue;let h=this._mergedSourceCaches[r].getSource().id;i.layers&&!o[h]||a.push(function(r,i,n,o,a,s,l,u=!1){let c=r.tilesIn(o,l,u);c.sort(ty);let h=[];for(let o of c)h.push({wrappedTileID:o.tile.tileID.wrapped().key,queryResults:o.tile.queryRenderedFeatures(i,n,r._state,o,a,s,function(r,i){let n=e.a9.identity([]);return e.a9.scale(n,n,[.5*r.width,-(.5*r.height),1]),e.a9.translate(n,n,[1,-1,0]),e.a9.multiply(n,n,r.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(n)}(r.transform,o.tile.tileID),u)});let p=function(e){let r={},i={};for(let n of e){let e=n.queryResults,o=n.wrappedTileID,a=i[o]=i[o]||{};for(let i in e){let n=e[i],o=a[i]=a[i]||{},s=r[i]=r[i]||[];for(let e of n)o[e.featureIndex]||(o[e.featureIndex]=!0,s.push(e))}}return r}(h);for(let e in p)p[e].forEach(e=>{let i=e.feature,n=i.layer;n&&"background"!==n.type&&"sky"!==n.type&&"slot"!==n.type&&(i.source=n.source,n["source-layer"]&&(i.sourceLayer=n["source-layer"]),i.state=void 0!==i.id?r.getFeatureState(n["source-layer"],i.id):{})});return p}(this._mergedSourceCaches[r],this._mergedLayers,s,u,i,n,l,!!this.map._showQueryGeometry))}return this.placement&&a.push(function(e,r,i,n,o,a,s){let l={},u=a.queryRenderedSymbols(n),c=[];for(let e of Object.keys(u).map(Number))c.push(s[e]);for(let i of(c.sort(ty),c)){let n=i.featureIndex.lookupSymbolFeatures(u[i.bucketInstanceId],r,i.bucketIndex,i.sourceLayerIndex,o.filter,o.layers,o.availableImages,e);for(let e in n){let r=l[e]=l[e]||[],o=n[e];for(let e of(o.sort((e,r)=>{let n=i.featureSortOrder;if(n){let i=n.indexOf(e.featureIndex);return n.indexOf(r.featureIndex)-i}return r.featureIndex-e.featureIndex}),o))r.push(e)}}for(let r in l)l[r].forEach(n=>{let o=n.feature,a=i(e[r]);if(!a)return;let s=a.getFeatureState(o.layer["source-layer"],o.id);o.source=o.layer.source,o.layer["source-layer"]&&(o.sourceLayer=o.layer["source-layer"]),o.state=s});return l}(this._mergedLayers,s,this.getLayerSourceCache.bind(this),u.screenGeometry,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r&&r.filter&&this._validate(Q,"querySourceFeatures.filter",r.filter,null,r);let i=this.getOwnSourceCaches(e),n=[];for(let e of i)n=n.concat(function(e,r){let i=e.getRenderableIds().map(r=>e.getTileByID(r)),n=[],o={};for(let e=0;e<i.length;e++){let a=i[e],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(n,r))}return n}(e,r));return n}addSourceType(e,r,i){return rP.getSourceType(e)?i(Error(`A source type called "${e}" already exists.`)):(rP.setSourceType(e,r),r.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:r.workerSourceURL},i):i(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(e,r,i={}){this._checkLoaded();let o=this.light.getLight(),a=!1;for(let r in e)if(!n(e[r],o[r])){a=!0;break}if(!a)return;let s=this._getTransitionParameters();this.light.setLight(e,r,i),this.light.updateTransitions(s)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(r,i=1){if(this._checkLoaded(),!r)return this.terrainSetForDrapingOnly()&&0!==i||delete this.terrain,null===r?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedU
16pdate=!0);let o=r,a=null==r.source;if(1===i){if("object"==typeof o.source){let r="terrain-dem-src";this.addSource(r,o.source),o=e.c6(o),o=e.e(o,{source:r})}let r=e.e({},o),i={};if(this.terrain&&a){r.source=this.terrain.get().source;let e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(i.style=e.serialize())}if(this._validate(Z,"terrain",r,i))return}if(this.terrain&&(this.terrain.scope===this.scope||a)&&(!this.terrain||i===this.terrain.drapeRenderMode)){let i=this.terrain,a=i.get();for(let r of Object.keys(e.G.terrain))!o.hasOwnProperty(r)&&e.G.terrain[r].default&&(o[r]=e.G.terrain[r].default);for(let o in r)if(!n(r[o],a[o])){i.set(r,this.options),this.stylesheet.terrain=r;let n=this._getTransitionParameters({duration:0});i.updateTransitions(n),this.fire(new e.b("data",{dataType:"style"}));break}}else{if(!o)return;this._createTerrain(o,i),this.fire(new e.b("data",{dataType:"style"}))}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){let r=this.fog=new ed(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=r.get();let i=this._getTransitionParameters({duration:0});r.updateTransitions(i)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(let e of this.map._markers)e._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(e){if(this._checkLoaded(),!e)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){let r=this.fog;if(!n(r.get(),e)){r.set(e,this.options),this.stylesheet.fog=r.get();let i=this._getTransitionParameters({duration:0});r.updateTransitions(i)}}else this._createFog(e);this._markersNeedUpdate=!0}_getTransitionParameters(r){return{now:e.f.now(),transition:e.e(this.transition,r)}}updateDrapeFirstLayers(){if(!this.terrain)return;let e=[],r=[];for(let i in this._mergedLayers)this.isLayerDraped(this._mergedLayers[i])?e.push(i):r.push(i);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...r)}_createTerrain(e,r){let i=this.terrain=new es(e,r,this.scope,this.options);1===r&&(this.stylesheet.terrain=e),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();let n=this._getTransitionParameters({duration:0});i.updateTransitions(n)}_force3DLayerUpdate(){for(let e in this._layers){let r=this._layers[e];"fill-extrusion"===r.type&&this._updateLayer(r)}}_forceSymbolLayerUpdate(){for(let e in this._layers){let r=this._layers[e];"symbol"===r.type&&this._updateLayer(r)}}_validate(r,i,n,o,a={}){if(a&&!1===a.validate)return!1;let s=e.e({},this.serialize());return rT(this,r.call(H,e.e({key:i,style:s,value:n,styleSpec:e.G},o)))}_remove(){for(let r in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.cd.off("pluginStateChange",this._rtlTextPluginCallback),this._mergedLayers)this._mergedLayers[r].setEventedParent(null);for(let e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles(),this._mergedSourceCaches[e].setEventedParent(null);this.setEventedParent(null),delete this.fog,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove())}clearSource(e){for(let r of this.getSourceCaches(e))r.clearTiles()}clearSources(){for(let e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles()}reloadSource(e){for(let r of this.getSourceCaches(e))r.resume(),r.reload()}reloadSources(){for(let e of this.getSources())e.reload&&e.reload()}updateSources(e){let r;for(let i in this.directionalLight&&(r=rE(this.directionalLight)),this._mergedSourceCaches)this._mergedSourceCaches[i].update(e,void 0,void 0,r)}_generateCollisionBoxes(){for(let e in this._sourceCaches){let r=this._sourceCaches[e];r.resume(),r.reload()}}_updatePlacement(r,i,n,o,a=!1){let s=!1,l=!1,u={},c={};for(let i of this._mergedOrder){let n=this._mergedLayers[i];if("symbol"!==n.type)continue;let o=e.aj(n.source,n.scope),a=u[o];if(!a){let e=this.getLayerSourceCache(n);if(!e)continue;let r=e.getRenderableIds(!0).map(r=>e.getTileByID(r));c[o]=r.slice(),a=u[o]=r.sort((e,r)=>r.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(r.tileID)?-1:1))}let l=this.crossTileSymbolIndex.addLayer(n,a,r.center.lng,r.projection);s=s||l}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),a=a||this._layerOrderChanged||0===n,this._layerOrderChanged&&this.fire(new e.b("neworder")),(a||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.f.now(),r.zoom))&&(this.pauseablePlacement=new rr(r,this._mergedOrder,a,i,n,o,this.placement,this.fog&&r.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,u,c),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.f.now()),l=!0),s&&this.pauseablePlacement.placement.setStale()),l||s)for(let i of(this._buildingIndex.onNewFrame(r.zoom),this._mergedOrder)){let r=this._mergedLayers[i];"symbol"===r.type&&this.placement.updateLayerOpacities(r,u[e.aj(r.source,r.scope)])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.f.now())}_releaseSymbolFadeTiles(){for(let e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}addImport(r,i){this._checkLoaded();let n=this.stylesheet.imports=this.stylesheet.imports||[];if(-1!==n.findIndex(({id:e})=>
16e===r.id))return void this.fire(new e.a(Error(`Import with id '${r.id}' already exists in the map's style.`)));if(!i)return n.push(r),this._loadImports([r],!0);let o=n.findIndex(({id:e})=>e===i);return -1===o&&this.fire(new e.a(Error(`Import with id "${i}" does not exist on this map.`))),this.stylesheet.imports=n.slice(0,o).concat(r).concat(n.slice(o)),this._loadImports([r],!0,i)}updateImport(e,r){this._checkLoaded();let i=this.stylesheet.imports||[],o=this.getImportIndex(e);return -1===o||("string"==typeof r?this.setImportUrl(e,r):(r.url&&r.url!==i[o].url&&this.setImportUrl(e,r.url),n(r.config,i[o].config)||this.setImportConfig(e,r.config),n(r.data,i[o].data)||this.setImportData(e,r.data))),this}moveImport(e,r){this._checkLoaded();let i=this.stylesheet.imports||[],n=this.getImportIndex(e);if(-1===n)return this;let o=this.getImportIndex(r);if(-1===o)return this;let a=i[n],s=this.fragments[n];return i=i.filter(({id:r})=>r!==e),this.fragments=this.fragments.filter(({id:r})=>r!==e),this.stylesheet.imports=i.slice(0,o).concat(a).concat(i.slice(o)),this.fragments=this.fragments.slice(0,o).concat(s).concat(this.fragments.slice(o)),this.mergeLayers(),this}setImportUrl(e,r){this._checkLoaded();let i=this.stylesheet.imports||[],n=this.getImportIndex(e);if(-1===n)return this;i[n].url=r;let o=this.fragments[n];return o.style=this._createFragmentStyle(i[n]),o.style.on("style.import.load",()=>this.mergeAll()),o.style.loadURL(r),this}setImportData(e,r){this._checkLoaded();let i=this.getImportIndex(e),n=this.stylesheet.imports||[];return -1===i?this:r?(this.fragments[i].style.setState(r),this._reloadImports(),this):(delete n[i].data,this.setImportUrl(e,n[i].url))}setImportConfig(e,r){this._checkLoaded();let i=this.getImportIndex(e),n=this.stylesheet.imports||[];if(-1===i)return this;r?n[i].config=r:delete n[i].config;let o=this.fragments[i],a=o.style.stylesheet&&o.style.stylesheet.schema;return o.config=r,o.style.updateConfig(r,a),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();let r=this.stylesheet.imports||[],i=this.getImportIndex(e);-1!==i&&(r.splice(i,1),this.fragments[i].style._remove(),this.fragments.splice(i,1),this._reloadImports())}getImportIndex(r){let i=(this.stylesheet.imports||[]).findIndex(e=>e.id===r);return -1===i&&this.fire(new e.a(Error(`Import '${r}' does not exist in the map's style and cannot be updated.`))),i}getLayer(e){return this._mergedLayers[e]}getSources(){let e=[];for(let r in this._mergedOtherSourceCaches){let i=this._mergedOtherSourceCaches[r];i&&e.push(i.getSource())}return e}getSource(e,r){let i=this.getSourceCache(e,r);return i&&i.getSource()}getLayerSource(e){let r=this.getLayerSourceCache(e);return r&&r.getSource()}getSourceCache(r,i){let n=e.aj(r,i);return this._mergedOtherSourceCaches[n]}getLayerSourceCache(r){let i=e.aj(r.source,r.scope);return"symbol"===r.type?this._mergedSymbolSourceCaches[i]:this._mergedOtherSourceCaches[i]}getSourceCaches(e){if(null==e)return Object.values(this._mergedSourceCaches);let r=[];return this._mergedOtherSourceCaches[e]&&r.push(this._mergedOtherSourceCaches[e]),this._mergedSymbolSourceCaches[e]&&r.push(this._mergedSymbolSourceCaches[e]),r}updateSourceCaches(){let e=this._changes.getUpdatedSourceCaches();for(let r in e){let i=e[r];"reload"===i?this.reloadSource(r):"clear"===i&&this.clearSource(r)}}updateLayers(e){for(let r of this._changes.getUpdatedPaintProperties()){let i=this.getLayer(r);i&&i.updateTransitions(e)}}getImages(e,r,i){this.imageManager.getImages(r.icons,r.scope,i),this._updateTilesForChangedImages();let n=e=>{e&&e.setDependencies(r.tileID.key,r.type,r.icons)};n(this._otherSourceCaches[r.source]),n(this._symbolSourceCaches[r.source])}getGlyphs(e,r,i){this.glyphManager.getGlyphs(r.stacks,r.scope,i)}getResource(r,i,n){return e.ce(i,n)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}getOwnSourceCaches(e){let r=[];return this._otherSourceCaches[e]&&r.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&r.push(this._symbolSourceCaches[e]),r}_isSourceCacheLoaded(r){let i=this.getOwnSourceCaches(r);return 0===i.length?(this.fire(new e.a(Error(`There is no source with ID '${r}'`))),!1):i.every(e=>e.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}
16destroy(){this._clearWorkerCaches(),this.fragments.forEach(e=>{e.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}rP.getSourceType=function(e){return tg[e]},rP.setSourceType=function(e,r){tg[e]=r},rP.registerForPluginStateChange=e.bY;var rL="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",rO="\nout vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec2 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color) {\n#ifdef INDICATOR_CUTOUT\nfloat holeMinOpacity=u_indicator_cutout_params.x;float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,vec2 pos,vec2 lod_coord) {vec2 size=vec2(textureSize(image,0));vec2 dx=dFdx(lod_coord.xy*size);vec2 dy=dFdy(lod_coord.xy*size);float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}",rD="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
16return (tile_units_to_pixels*pos+offset)/pattern_size;}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}",rR="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",rk="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;
16vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture(u_depth,uv-df.xz)),unpack_depth(texture(u_depth,uv+df.xz)),unpack_depth(texture(u_depth,uv-df.zy)),unpack_depth(texture(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",rN="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",rF="highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}
16vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {\n#ifdef FOG_DITHERING\nvec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);\n#else\nreturn color;\n#endif\n}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",rz="#ifdef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",rB="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec4 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=vec2(u_data_offset+dot(t.rg,u_data_scale.yx),-(u_data_offset+dot(t.ba,u_data_scale.yx)));velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",rU="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif//RENDER_SHADOWS",rj="#ifdef RENDER_SHADOWS\n#ifdef DEPTH_TEXTURE\nuniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1;\n#else\nuniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1;\n#endif\nuniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_1,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_0,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}
16float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias;\n#ifdef NATIVE\nhighp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0));\n#else\nhighp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4(\nshadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0)\n);\n#endif\nvec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return mix(lerpx.x,lerpx.y,f.y);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {\n#ifdef SHADOWS_SINGLE_CASCADE\nlight_view_pos0.xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);\n#else\nlight_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth));\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";let rV=[];rW(rL,rV),rW(rD,rV),rW(rO,rV);let rG={"_prelude_fog.vertex.glsl":rN,"_prelude_terrain.vertex.glsl":rk,"_prelude_shadow.vertex.glsl":rU,"_prelude_fog.fragment.glsl":rF,"_prelude_shadow.fragment.glsl":rj,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif//LIGHTING_3D_MODE","_prelude_raster_array.glsl":rz,"_prelude_raster_particle.glsl":rB},rq={};rY("",rk),rY(rF,rN),rY(rj,rU),rY(rz,""),rY(rB,"");let rH=rY(rO,rD);var r$={background:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),circle:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*v
16iew_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:rY("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:rY('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:rY("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:rY("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in float a_size_scale;in vec2 a_padding;in float a_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(a_z_offset+elevation(a_anchor_pos)),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:rY("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:rY("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1
16);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),fill:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutline:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength;in highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;in vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nuniform float u_emissive_strength;in float v_height;void main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,u_emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=max(0.01,cutoff_opacity(u_cutoff_params,ground.z));if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff < 0.01 && centroid_pos.x !=0.0));gl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}
16\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);v_flat=vec4(linearProduct(color.rgb,vec3(calculate_NdotL(normal))),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:rY("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_vertical_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\nout highp float v_depth;void main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base);pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\nin vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
16),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nout vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
16ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:rY('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0)).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:rY("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;
16fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(1.0,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:rY("precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform lowp float u_device_pixel_ratio;
16uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nfloat linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;
16float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {    \nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color.rgb=mix(border_color.rgb*border_color.a*trimmed,out_color.rgb,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),linePattern:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform mediump float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec4 v_uv;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float pattern_x=v_linesofar/pattern_size.x*aspect;float x=mod(pattern_x,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {color=vec4(0,0,0,0);}}\n#endif\n#ifdef LINE_JOIN_NONE\nfloat pattern_len=pattern_size.x/aspect;float segment_phase=pattern_len-mod((v_linesofar-v_pattern_data.x),pattern_len);float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_ground(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec4 a_packed;\n#endif\nin float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin vec2 a_pattern_data;out vec2 v_pattern_data;\n#endif\nuniform mat4 u_matrix;uniform mediump float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec4 v_uv;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nfloat a_uv_x=a_packed[0];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef LINE_JOIN_NONE\nv_width+=ANTIALIASING;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5/u_tile_units_to_pixels;v_linesofar+=line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),raster:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos   ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);    \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];
16if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:rY("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-vec2(1.0),0.0,1.0);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:rY("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:rY('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));
16highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp float speed=velocity==INVALID_VELOCITY ? 0.0 : length(velocity);highp float reset_rate_bump=speed*u_reset_rate;highp vec2 particle_pos_min=-u_particle_pos_offset;highp vec2 particle_pos_max=vec2(1.0)+u_particle_pos_offset;highp vec2 pos_drop_rate=vec2(1.0)-step(particle_pos_min,pos)+step(particle_pos_max,pos);highp float drop_rate=max(u_reset_rate+reset_rate_bump,length(pos_drop_rate));highp float drop=step(1.0-drop_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbolIcon:rY('#include "_prelude_lighting.glsl"\nuniform sampler2D u_texture;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\nin float v_fade_opacity;in vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nlowp float alpha=opacity*v_fade_opacity;vec4 out_color;\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\nout_color*=alpha;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nv_tex_a=a_tex/u_texsize;\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\nv_fade_opacity=out_fade_opacity;}'),symbolSDF:rY('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\nuniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;in float v_draw_halo;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);vec4 out_color=color*(alpha*opacity*fade_opacity);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout float v_draw_halo;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float out_fade_opacity=interpolated_fade_opacity*projection_transition_fade;float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,out_fade_opacity);}'),symbolTextAndIcon:rY('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_halo;in float v_draw_halo;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
16glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);vec4 out_color=color*(alpha*opacity*fade_opacity);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout float v_draw_halo;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nfloat out_fade_opacity=interpolated_fade_opacity*projection_transition_fade;float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,out_fade_opacity,is_sdf);}'),terrainRaster:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
16\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:rY("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:rY('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
16nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',rR),skyboxGradient:rY('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',rR),skyboxCapture:rY
vendor: 3,689 bytes, line 16
16("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;
16v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nraster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(raster.rgb*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:rY('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;
16vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;\n#ifndef NATIVE\nc=dither(c,gl_FragCoord.xy+u_temporal_offset);\n#endif\nglFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:rY('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform sampler2D u_depthTexture;uniform vec2 u_inv_depth_size;bool isOccluded() {vec2 coord=gl_FragCoord.xy*u_inv_depth_size;highp float depth=unpack_depth(texture(u_depthTexture,coord));return v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-light
16Color),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nreturn vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*light
16Color;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);color=mix(color,v_color_mix.rgb,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.
16y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=u_matrix*pos;pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);
16\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normalize(normal_3f));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:rY("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;
16rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=u_matrix*pos;\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:rY("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}")};function rW(e,r){for(let i of e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n"))if("#"===(i=i.trim())[0]&&i.includes("if")&&!i.includes("endif"))for(let e of(i=i.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim()).split(" "))r.includes(e)||r.push(e)}function rY(e,r){let i=/#include\s+"([^"]+)"/g,n=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g,o=r.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);o&&(o=[...new Set(o=o.map(e=>{let r=e.split(" ");return r[r.length-1]}))]);let a={},s=[],l=[];if(e=e.replace(i,(e,r)=>(l.push(r),"")),(r=r.replace(i,(e,r)=>(s.push(r),""))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let u=[...rV];for(let i of(rW(e,u),rW(r,u),[...s,...l]))rG[i]||console.error(`Undefined include: ${i}`),rq[i]||(rq[i]=[],rW(rG[i],rq[i])),u=[...u,...rq[i]];return{fragmentSource:e=e.replace(n,(e,r,i,n,o)=>(a[o]=!0,"define"===r?`
17#ifndef HAS_UNIFORM_u_${o}
18in ${i} ${n} ${o};
19#else
20uniform ${i} ${n} u_${o};
21#endif
22`:"initialize"===r?`
23#ifdef HAS_UNIFORM_u_${o}
24    ${i} ${n} ${o} = u_${o};
25#endif
26`:"define-attribute"===r?`
27#ifdef HAS_ATTRIBUTE_a_${o}
28    in ${i} ${n} ${o};
29#endif
30`:"initialize-attribute"===r?"":void 0)),vertexSource:r=r.replace(n,(e,r,i,n,o)=>{let s="float"===n?"vec2":n,l=o.match(/color/)?"color":s;return"define-attribute-vertex-shader-only"===r?`
31#ifdef HAS_ATTRIBUTE_a_${o}
32in ${i} ${n} a_${o};
33#endif
34`:a[o]?"define"===r?`
35#ifndef HAS_UNIFORM_u_${o}
36uniform lowp float u_${o}_t;
37in ${i} ${s} a_${o};
38out ${i} ${n} ${o};
39#else
40uniform ${i} ${n} u_${o};
41#endif
42`:"initialize"===r?"vec4"===l?`
43#ifndef HAS_UNIFORM_u_${o}
44    ${o} = a_${o};
45#else
46    ${i} ${n} ${o} = u_${o};
47#endif
48`:`
49#ifndef HAS_UNIFORM_u_${o}
50    ${o} = unpack_mix_${l}(a_${o}, u_${o}_t);
51#else
52    ${i} ${n} ${o} = u_${o};
53#endif
54`:"define-attribute"===r?`
55#ifdef HAS_ATTRIBUTE_a_${o}
56    in ${i} ${n} a_${o};
57    out ${i} ${n} ${o};
58#endif
59`:"initialize-attribute"===r?`
60#ifdef HAS_ATTRIBUTE_a_${o}
61    ${o} = a_${o};
62#endif
63`:void 0:"define"===r?`
64#ifndef HAS_UNIFORM_u_${o}
65uniform lowp float u_${o}_t;
66in ${i} ${s} a_${o};
67#else
68uniform ${i} ${n} u_${o};
69#endif
70`:"define-instanced"===r?"mat4"===l?`
71#ifdef INSTANCED_ARRAYS
72in vec4 a_${o}0;
73in vec4 a_${o}1;
74in vec4 a_${o}2;
75in vec4 a_${o}3;
76#else
77uniform ${i} ${n} u_${o};
78#endif
79`:`
80#ifdef INSTANCED_ARRAYS
81in ${i} ${s} a_${o};
82#else
83uniform ${i} ${n} u_${o};
84#endif
85`:"initialize-attribute-custom"===r?`
86#ifdef HAS_ATTRIBUTE_a_${o}
87    ${i} ${n} ${o} = a_${o};
88#endif
89`:"vec4"===l?`
90#ifndef HAS_UNIFORM_u_${o}
91    ${i} ${n} ${o} = a_${o};
92#else
93    ${i} ${n} ${o} = u_${o};
94#endif
95`:`
96#ifndef HAS_UNIFORM_u_${o}
97    ${i} ${n} ${o} = unpack_mix_${l}(a_${o}, u_${o}_t);
98#else
99    ${i} ${n} ${o} = u_${o};
100#endif
101`}),staticAttributes:o,usedDefines:u,vertexIncludes:s,fragmentIncludes:l}}class rZ{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,r,i,n,o,a,s,l){this.context=e;let u=this.boundPaintVertexBuffers.length!==n.length;for(let e=0;!u&&e<n.length;e++)this.boundPaintVertexBuffers[e]!==n[e]&&(u=!0);let c=this.boundDynamicVertexBuffers.length!==s.length;for(let e=0;!c&&e<s.length;e++)this.boundDynamicVertexBuffers[e]!==s[e]&&(c=!0);if(!this.vao||this.boundProgram!==r||this.boundLayoutVertexBuffer!==i||u||c||this.boundIndexBuffer!==o||this.boundVertexOffset!==a)this.freshBind(r,i,n,o,a,s,l);else{for(let i of(e.bindVertexArrayOES.set(this.vao),s))i&&(i.bind(),l&&i.instanceCount&&i.setVertexAttribDivisor(e.gl,r,l));o&&o.dynamicDraw&&o.bind()}}freshBind(e,r,i,n,o,a,s){let l=e.numAttributes,u=this.context,c=u.gl;for(let s of(this.vao&&this.destroy(),this.vao=u.gl.createVertexArray(),u.bindVertexArrayOES.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=r,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=o,this.boundDynamicVertexBuffers=a,r.enableAttributes(c,e),r.bind(),r.setVertexAttribPointers(c,e,o),i))s.enableAttributes(c,e),s.bind(),s.setVertexAttribPointers(c,e,o);for(let r of a)r&&(r.enableAttributes(c,e),r.bind(),r.setVertexAttribPointers(c,e,o),s&&r.instanceCount&&r.setVertexAttribDivisor(c,e,s));n&&n.bind(),u.currentNumAttributes=l}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function rX(r,i,n){if(!i.needsDEMTextureUpload)return;let o=r.context,a=o.gl;o.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||r.getTileTexture(n.stride);let s=n.getPixels();i.demTexture?i.demTexture.update(s,{premultiply:!1}):i.demTexture=new e.T(o,s,a.R32F,{premultiply:!1}),i.needsDEMTextureUpload=!1}let rK=r=>({u_matrix:new e.bN(r),u_image0:new e.bR(r),u_skirt_height:new e.bQ(r),u_ground_shadow_factor:new e.bP(r)}),rQ=(e,r,i)=>({u_matrix:e,u_image0:0,u_skirt_height:r,u_ground_shadow_factor:i}),rJ=(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:r,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:i,u_zoom_transition:o,u_merc_center:a,u_image0:0,u_frustum_tl:s,u_frustum_tr:l,u_frustum_br:u,u_frustum_bl:c,u_globe_pos:h,u_globe_radius:p,u_viewport:d,u_grid_matrix:g?Float32Array.from(g):new Float32Array(9),u_skirt_height:f,u_far_z_cutoff:m});function r0(e,r){return null!=e&&null!=r&&!(!e.hasData()||!r.hasData())&&null!=e.demTexture&&null!=r.demTexture&&e.tileID.key!==r.tileID.key}let r1=new class{constructor(){this.operations={}}newMorphing(e,r,i,n,o){if(e in this.operations){let r=this.operations[e];r.to.tileID.key!==i.tileID.key&&(r.queued=i)}else this.operations[e]={startTime:n,phase:0,duration:o,from:r,to:i,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;let r=this.operations[e];return{from:r.from,to:r.to,phase:r.phase}}update(e){for(let r in this.operations){let i=this.operations[r];for(i.phase=(e-i.startTime)/i.duration;i.phase>
101=1||!this._validOp(i);)if(!this._nextOp(i,e)){delete this.operations[r];break}}}_nextOp(e,r){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=r,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},r2={0:null,1:"TERRAIN_VERTEX_MORPHING"};function r3(e,r,i){return 0===r?0:6*Math.pow(1.5,22-e)*Math.max(r,1)*(r<1&&514===i?.25/r:1)}let r5=e=>({u_matrix:e});function r4(r,i,n,o,a){if(a>0){let s=e.f.now(),l=(s-r.timeAdded)/a,u=i?(s-i.timeAdded)/a:-1,c=n.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(r.tileID.overscaledZ-h),d=p&&r.refreshedUponExpiration?1:e.ad(p?l:1-u,0,1);return r.refreshedUponExpiration&&l>=1&&(r.refreshedUponExpiration=!1),i?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}class r6 extends tb{constructor(r){const i=t_("mock-dem",{type:"raster-dem",maxzoom:r.transform.maxZoom},new e.bZ(e.b_(),null),r.style);super("mock-dem",i,!1),i.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,r){e.state="loaded",r(null)}}class r8 extends tb{constructor(r){const i=t_("proxy",{type:"geojson",maxzoom:r.transform.maxZoom},new e.bZ(e.b_(),null),r.style);super("proxy",i,!1),i.setEventedParent(this),this.map=this.getSource().map=r,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,r,i){if(e.freezeTileCoverage)return;this.transform=e;let n=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((r,i)=>{if(r[i.key]="",!this._tiles[i.key]){let r=new tm(i,this._source.tileSize*i.overscaleFactor(),e.tileZoom);r.state="loaded",this._tiles[i.key]=r}return r},{});for(let e in this._tiles)e in n||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){let r=this.proxyCachedFBO[e];if(void 0!==r){let i=Object.values(r);this.renderCachePool.push(...i),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach(e=>e.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class r9 extends e.ap{constructor(e,r,i){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=r,this.projMatrix=i}}class r7 extends e.cp{constructor(r,i){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},r.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},()=>{this._style.map.triggerRepaint()}),r.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},()=>{this._style.map.triggerRepaint()}),r.tp.registerButton(["Terrain"],"Invalidate Render Cache",()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()}),this.painter=r,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,o,a]=function(){let r=new e.aQ,i=new e.az;r.reserve(17161),i.reserve(33800);let n=e.Y/128,o=e.Y+n/2,a=o+n;for(let i=-n;i<a;i+=n)for(let s=-n;s<a;s+=n){let n=24575*(s<0||s>o||i<0||i>o),a=e.ad(Math.round(s),0,e.Y),l=e.ad(Math.round(i),0,e.Y);r.emplaceBack(a+n,l)}let s=(e,r)=>{let n=131*r+e;i.emplaceBack(n+1,n,n+131),i.emplaceBack(n+131,n+131+1,n+1)};for(let e=1;e<129;e++)for(let r=1;r<129;r++)s(r,e);return[0,129].forEach(e=>{for(let r=0;r<130;r++)s(r,e),s(e,r)}),[r,i,32768]}(),s=r.context;this.gridBuffer=s.createVertexBuffer(n,e.aS.members),this.gridIndexBuffer=s.createIndexBuffer(o),this.gridSegments=e.aE.simpleSegment(0,0,n.length,o.length),this.gridNoSkirtSegments=e.aE.simpleSegment(0,0,n.length,a),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new r8(i.map),this.orthoMatrix=e.a9.create(),e.a9.ortho(this.orthoMatrix,.015*("globe"===this.painter.transform.projection.name),e.Y,0,e.Y,0,1);const l=s.gl;this._overlapStencilMode=new tl({func:l.GEQUAL,mask:255},0,255,l.KEEP,l.KEEP,l.REPLACE),this._previousZoom=r.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new r6(i.map),this._pendingGroundEffectLayers=[]}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(r,i,n){if(r&&r.terrain){this._style!==r&&(this.style=r,this._evaluationZoom=void 0);let o=r.terrain.properties,a=0===r.terrain.drapeRenderMode,s=r.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.f.now();let l=r.terrain&&r.terrain.scope,u=o.get("source"),c=a?this._mockSourceCache:r.getSourceCache(u,l);if(!c)return void e.w(`Couldn't find terrain source "${u}".`);if(this.sourceCache=c,this._exaggeration=s?this.calculateExaggeration(i):o.get("exaggeration"),!i.projection.requiresDraping&&s&&0===this._exaggeration)return void this._disable();this.enabled=!0;let h=()=>{this.sourceCache.used&&e.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.
102This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);let r=this.getScaledDemTileSize();this.sourceCache.update(i,r,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,h(),this._initializing=!0),h(),i.updateElevation(!0,n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0,this._previousZoom=i.zoom}else this._disable()}calculateExaggeration(r){let i=this._previousCameraAltitude,n=r.getFreeCameraOptions().position.z/r.pixelsPerMeter*r.worldSize;this._previousCameraAltitude=n;let o=null!=i?n-i:Number.MAX_VALUE;if(2>Math.abs(o))return this._exaggeration;let a=r.zoom,s=this._style.terrain;if(!this._previousUpdateTimestamp)return s.getExaggeration(a);let l=a-this._previousZoom,u=this._previousUpdateTimestamp,c=a;null!=this._evaluationZoom&&(Math.abs(a-(c=this._evaluationZoom))>.5&&(l=.5*(a-c+l)),l*o<0&&(c+=l)),this._evaluationZoom=c;let h=s.getExaggeration(c),p=h===s.getExaggeration(Math.max(0,c-.1));if(p&&.01>Math.abs(h-this._exaggeration))return h;let d=Math.min(.1,.00375*(this._updateTimestamp-u));return(p||h<.1||1e-4>Math.abs(l))&&(d=Math.min(.2,4*d)),e.X(this._exaggeration,h,d)}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(let e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(e
102=>e.fb.destroy()),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){let e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(r){var i;let n,o;if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;let a=this.proxySourceCache,s=this.painter.transform;this._initializing&&(this._initializing=0===s._centerAltitude&&-1===this.getAtPointOrZero(e.O.fromLngLat(s.center),-1),this._emptyDEMTextureDirty=!this._initializing);let l=this.proxyCoords=a.getIds().map(e=>{let r=a.getTileByID(e).tileID;return r.projMatrix=s.calculateProjMatrix(r.toUnwrapped()),r});n=(i=this.painter).transform.pointCoordinate(i.transform.getCameraPoint()),o=new e.P(n.x,n.y),l.sort((r,i)=>{if(i.overscaledZ-r.overscaledZ)return i.overscaledZ-r.overscaledZ;let n=new e.P(r.canonical.x+(1<<r.canonical.z)*r.wrap,r.canonical.y),a=new e.P(i.canonical.x+(1<<i.canonical.z)*i.wrap,i.canonical.y),s=o.mult(1<<r.canonical.z);return s.x-=.5,s.y-=.5,s.distSqr(n)-s.distSqr(a)});let u=this.proxyToSource||{};this.proxyToSource={},l.forEach(e=>{this.proxyToSource[e.key]={}}),this.terrainTileForTile={};let c=this._style._mergedSourceCaches;for(let e in c){let i=c[e];if(!i.used||(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,r[e],u),i.usedForTerrain))continue;let n=r[e];i.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[a.id]=l.map(e=>new r9(e,e.key,this.orthoMatrix)),this._assignTerrainTiles(l),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(u),this.renderingToTexture=!1;let h={};for(let e of(this._visibleDemTiles=[],this.proxyCoords)){let r=this.terrainTileForTile[e.key];if(!r)continue;let i=r.tileID.key;i in h||(this._visibleDemTiles.push(r),h[i]=i)}}_assignTerrainTiles(e){this._initializing||e.forEach(e=>{if(this.terrainTileForTile[e.key])return;let r=this._findTileCoveringTileID(e,this.sourceCache);r&&(this.terrainTileForTile[e.key]=r)})}_prepareDEMTextures(){let e=this.painter.context,r=e.gl;for(let i in this.terrainTileForTile){let n=this.terrainTileForTile[i],o=n.dem;o&&(!n.demTexture||n.needsDEMTextureUpload)&&(e.activeTexture.set(r.TEXTURE1),rX(this.painter,n,o))}}_prepareDemTileUniforms(e,r,i,n){if(!r||null==r.demTexture)return!1;let o=e.tileID.canonical,a=Math.pow(2,r.tileID.canonical.z-o.z),s=n||"";return i[`u_dem_tl${s}`]=[o.x*a%1,o.y*a%1],i[`u_dem_scale${s}`]=a,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){let r=this.painter.context,i=r.gl;if(!this._emptyDepthBufferTexture){let n=new e.h({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new e.T(r,n,i.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let e=0,r=this._visibleDemTiles.reduce((r,i)=>{if(!i.dem)return r;let n=i.dem.tree.minimums[0];return n>0&&e++,r+n},0);return e?r/e:0}_updateEmptyDEMTexture(){let r,i=this.painter.context,n=i.gl;i.activeTexture.set(n.TEXTURE2);let o=this._getLoadedAreaMinimum(),[a,s]=(r=new e.cr({width:1,height:1},new Float32Array([o])),[n.R32F,r]);this._emptyDEMTextureDirty=!1;let l=this._emptyDEMTexture;return l?l.update(s,{premultiply:!1}):l=this._emptyDEMTexture=new e.T(i,s,a,{premultiply:!1}),l}setupElevationDraw(r,i,n){let o=this.painter.context,a=o.gl,s={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0};s.u_exaggeration=this.exaggeration();let l=null,u=null,c=1;if(n&&n.morphing&&this._useVertexMorphing){let e=n.morphing.srcDemTile,i=n.morphing.dstDemTile;
102c=n.morphing.phase,e&&i&&(this._prepareDemTileUniforms(r,e,s,"_prev")&&(u=e),this._prepareDemTileUniforms(r,i,s)&&(l=i))}let h=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?a.LINEAR:a.NEAREST,p=e=>{s.u_dem_size=1===e.size[0]?1:e.size[0]-2};if(u&&l)o.activeTexture.set(a.TEXTURE2),l.demTexture.bind(h(l),a.CLAMP_TO_EDGE),o.activeTexture.set(a.TEXTURE4),u.demTexture.bind(h(u),a.CLAMP_TO_EDGE),l.demTexture&&p(l.demTexture),s.u_dem_lerp=c;else{l=this.terrainTileForTile[r.tileID.key],o.activeTexture.set(a.TEXTURE2);let e=this._prepareDemTileUniforms(r,l,s)?l.demTexture:this.emptyDEMTexture;e.bind(h(l),a.CLAMP_TO_EDGE),p(e)}if(o.activeTexture.set(a.TEXTURE3),n&&n.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(a.NEAREST,a.CLAMP_TO_EDGE),this._depthFBO&&(s.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(a.NEAREST,a.CLAMP_TO_EDGE),s.u_depth_size_inv=[1,1]),n&&n.useMeterToDem&&l&&(s.u_meter_to_dem=(1<<l.tileID.canonical.z)*e.bo(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize),n&&n.labelPlaneMatrixInv&&(s.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),i.setTerrainUniformValues(o,s),"globe"===this.painter.transform.projection.name){let e=this.globeUniformValues(this.painter.transform,r.tileID.canonical,n&&n.useDenormalizedUpVectorScale);i.setGlobeUniformValues(o,e)}}globeUniformValues(r,i,n){let o=r.projection;return{u_tile_tl_up:o.upVector(i,0,0),u_tile_tr_up:o.upVector(i,e.Y,0),u_tile_br_up:o.upVector(i,e.Y,e.Y),u_tile_bl_up:o.upVector(i,0,e.Y),u_tile_up_scale:n?e.cq(1):o.upVectorScale(i,r.center.lat,r.worldSize).metersToTile}}renderToBackBuffer(r){let i=this.painter,n=this.painter.context;0!==r.length&&(n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),i.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(r,i,n,o,a){if("globe"===r.transform.projection.name)!function(r,i,n,o,a){let s,l,u=r.context,c=u.gl,h=r.transform,p=e.ci(r,u,h),d=(e,i)=>{if(l===i)return;let n=[r2[i],"PROJECTION_GLOBE_VIEW"];p&&n.push("CUSTOM_ANTIALIASING");let o=r.isTileAffectedByFog(e);s=r.getOrCreateProgram("globeRaster",{defines:n,overrideFog:o}),l=i},f=r.colorModeForRenderPass(),m=new ts(c.LEQUAL,ts.ReadWrite,r.depthRangeFor3D);r1.update(a);
102let g=e.cj(h),_=[e.a8(h.center.lng),e.ah(h.center.lat)],y=r.globeSharedBuffers,v=[h.width*e.f.devicePixelRatio,h.height*e.f.devicePixelRatio],x=Float32Array.from(h.globeMatrix),b={useDenormalizedUpVectorScale:!0};{let h=r.transform,p=r3(h.zoom,i.exaggeration(),i.sourceCache._source.tileSize);l=-1;let w=c.TRIANGLES;for(let l of o){let o=n.getTile(l),E=tl.disabled,S=i.prevTerrainTileForTile[l.key],T=i.terrainTileForTile[l.key];r0(S,T)&&r1.newMorphing(l.key,S,T,a,250),u.activeTexture.set(c.TEXTURE0),o.texture&&o.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE);let I=r1.getMorphValuesForProxy(l.key),M=+!!I;I&&e.k(b,{morphing:{srcDemTile:I.from,dstDemTile:I.to,phase:e.ch(I.phase)}});let C=e.ck(l.canonical),A=e.cl(C.getCenter().lat),P=e.cm(l.canonical,C,A,h.worldSize/h._pixelsPerMercatorPixel),L=e.aW(e.cn(l.canonical)),O=rJ(h.expandedFarZProjMatrix,x,g,L,e.W(h.zoom),_,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,v,p,h._farZ,P);if(d(l,M),s&&(i.setupElevationDraw(o,s,b),r.uploadCommonUniforms(u,s,l.toUnwrapped()),y)){let[e,i,n]=y.getGridBuffers(A,0!==p);s.draw(r,w,m,E,f,tc.backCCW,O,"globe_raster",e,i,n)}}}if(y&&(r.renderDefaultNorthPole||r.renderDefaultSouthPole)){let a=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];for(let l of(p&&a.push("CUSTOM_ANTIALIASING"),s=r.getOrCreateProgram("globeRaster",{defines:a}),o)){let{x:o,y:a,z:p}=l.canonical,d=0===a,g=a===(1<<p)-1,[x,w,E,S]=y.getPoleBuffers(p,!1);if(S&&(d||g)){let a=n.getTile(l);u.activeTexture.set(c.TEXTURE0),a.texture&&a.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE);let y=e.co(p,o,h),T=e.aW(e.cn(l.canonical)),I=(e,i)=>e.draw(r,c.TRIANGLES,m,tl.disabled,f,tc.disabled,rJ(h.expandedFarZProjMatrix,y,y,T,0,_,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,v,0,h._farZ),"globe_pole_raster",i,E,S);i.setupElevationDraw(a,s,b),r.uploadCommonUniforms(u,s,l.toUnwrapped()),d&&r.renderDefaultNorthPole&&I(s,x),g&&r.renderDefaultSouthPole&&(y=e.a9.scale(e.a9.create(),y,[1,-1,1]),I(s,w))}}}}(r,i,n,o,a);else{let s,l,u=r.context,c=u.gl,h=r.shadowRenderer,p=r_(r,r.longestCutoffRange),d=e=>{if(l===e)return;let i=[];i.push(r2[e]),p.shouldRenderCutoff&&i.push("RENDER_CUTOFF"),s=r.getOrCreateProgram("terrainRaster",{defines:i}),l=e},f=r.colorModeForRenderPass(),m=new ts(c.LEQUAL,ts.ReadWrite,r.depthRangeFor3D);r1.update(a);let g=r.transform,_=r3(g.zoom,i.exaggeration(),i.sourceCache._source.tileSize),y=[0,0,0];if(h){let e=r.style.directionalLight,i=r.style.ambientLight;e&&i&&(y=rS(e,i))}{l=-1;let v=c.TRIANGLES,[x,b]=[i.gridIndexBuffer,i.gridSegments];for(let l of o){let o,w=n.getTile(l),E=tl.disabled,S=i.prevTerrainTileForTile[l.key],T=i.terrainTileForTile[l.key];r0(S,T)&&r1.newMorphing(l.key,S,T,a,250),u.activeTexture.set(c.TEXTURE0),w.texture&&w.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE);let I=r1.getMorphValuesForProxy(l.key),M=+!!I;I&&(o={morphing:{srcDemTile:I.from,dstDemTile:I.to,phase:e.ch(I.phase)}});let C=rQ(l.projMatrix,!function(e,r){let i=1<<e.z;return!r&&(0===e.x||e.x===i-1)||0===e.y||e.y===i-1}(l.canonical,g.renderWorldCopies)?_:_/10,y);if(d(M),!s)continue;i.setupElevationDraw(w,s,o);let A=l.toUnwrapped();h&&h.setupShadows(A,s),r.uploadCommonUniforms(u,s,A,null,p),s.draw(r,v,m,E,f,tc.backCCW,C,"terrain_raster",i.gridBuffer,x,b)}}}}(i,this,this.proxySourceCache,r,this._updateTimestamp),this.renderingToTexture=!0,i.gpuTimingDeferredRenderEnd(),r.splice(0,r.length))}renderBatch(r){if(0===this._drapedRenderBatches.length)return r+1;this.renderingToTexture=!0;let i=this.painter,n=this.painter.context,o=this.proxySourceCache,a=this.proxiedCoords[o.id],s=this._drapedRenderBatches.shift(),l=i.style.order,u=[],c=0;for(let h of a){let a,p=o.getTileByID(h.proxyTileKey),d=o.proxyCachedFBO[h.key]?o.proxyCachedFBO[h.key][r]:void 0,f=void 0!==d?o.renderCache[d]:this.pool[c++],m=void 0!==d;if(p.texture=f.tex,m&&!f.dirty){u.push(p.tileID);continue}n.bindFramebuffer.set(f.fb.framebuffer),this.renderedToTile=!1,f.dirty&&(n.clear({color:e.aA.transparent,stencil:0}),f.dirty=!1);for(let e=s.start;e<=s.end;++e){let r=i.style._mergedLayers[l[e]];if(r.isHidden(i.transform.zoom))continue;let o=i.style.getLayerSourceCache(r),s=o?this.proxyToSource[h.key][o.id]:[h];s&&(n.viewport.set([0,0,f.fb.width,f.fb.height]),a!==(o?o.id:null)&&(this._setupStencil(f,s,r,o),a=o?o.id:null),i.renderLayer(i,o,r,s))}if(0===this._drapedRenderBatches.length)for(let e of this._pendingGroundEffectLayers){let r=i.style._mergedLayers[l[e]];if(r.isHidden(i.transform.zoom))continue;let o=i.style.getLayerSourceCache(r),s=o?this.proxyToSource[h.key][o.id]:[h];s&&(n.viewport.set([0,0,f.fb.width,f.fb.height]),a!==(o?o.id:null)&&(this._setupStencil(f,s,r,o),a=o?o.id:null),i.renderLayer(i,o,r,s))}this.renderedToTile?(f.dirty=!0,u.push(p.tileID)):m||--c,5===c&&(c=0,this.renderToBackBuffer(u))}return this.renderToBackBuffer(u),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),s.end+1}postRender(){}isLayerOrderingCorrect(e){let r=e.order.length,i=-1,n=r;for(let o=0;o<r;++o)this._style.isLayerDraped(e._mergedLayers[e.order[o]])?i=Math.max(i,o):n=Math.min(n,o);return n>i}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter(e=>e.dem).forEach(r=>{e=Math.min(e,r.dem.tree.minimums[0])}),0===e?e:(e-30)*this._exaggeration}raycast(e,r,i){if(!this._visibleDemTiles)return null;let n=this._visibleDemTiles.filter(e=>e.dem).map(n=>{let o=n.tileID,a=1<<o.overscaledZ,{x:s,y:l}=o.canonical,u=s/a,c=(s+1)/a,h=l/a,p=(l+1)/a;
102return{minx:u,miny:h,maxx:c,maxy:p,t:n.dem.tree.raycastRoot(u,h,c,p,e,r,i),tile:n}});for(let o of(n.sort((e,r)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==r.t?r.t:Number.MAX_VALUE)),n)){if(null==o.t)break;let n=o.tile.dem.tree.raycast(o.minx,o.miny,o.maxx,o.maxy,e,r,i);if(null!=n)return n}return null}_createFBO(){let r=this.painter.context,i=r.gl,n=this.drapeBufferSize;r.activeTexture.set(i.TEXTURE0);let o=new e.T(r,{width:n[0],height:n[1],data:null},i.RGBA);o.bind(i.LINEAR,i.CLAMP_TO_EDGE);let a=r.createFramebuffer(n[0],n[1],!0,null);return a.colorAttachment.set(o.texture),a.depthAttachment=new to(r,a.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=r.createRenderbuffer(r.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,a.depthAttachment.set(this._sharedDepthStencil),r.clear({stencil:0})):a.depthAttachment.set(this._sharedDepthStencil),r.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,r.extTextureFilterAnisotropicMax),{fb:a,tex:o,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._debugParams.disableRenderCache||this._style.hasLightTransitions())return!0;for(let e in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[e].hasTransition())return!0;return this._style.order.some(e=>{let r=this._style._mergedLayers[e],i=r.isHidden(this.painter.transform.zoom);return"custom"===r.type?!i&&r.shouldRedrape():!i&&r.hasTransition()})}_clearLineLayersFromRenderCache(){let r=!1;for(let e of this._style.getSources())if(e instanceof ew){r=!0;break}if(!r)return;let i={};for(let r=0;r<this._style.order.length;++r){let n=this._style._mergedLayers[this._style.order[r]],o=this._style.getLayerSourceCache(n);if(o&&!i[o.id]&&!n.isHidden(this.painter.transform.zoom)&&"line"===n.type&&n.widthExpression()instanceof e.Z)for(let e of(i[o.id]=!0,this.proxyCoords)){let r=this.proxyToSource[e.key][o.id];if(r)for(let e of r)this._clearRenderCacheForTile(o.id,e)}}}_clearRasterLayersFromRenderCache(){let e=!1;for(let r in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[r]._source instanceof eE){e=!0;break}if(!e)return;let r={};for(let e=0;e<this._style.order.length;++e){let i=this._style._mergedLayers[this._style.order[e]],n=this._style.getLayerSourceCache(i);if(!n||r[n.id]||i.isHidden(this.painter.transform.zoom)||"raster"!==i.type)continue;let o=i.paint.get("raster-fade-duration");for(let e of this.proxyCoords){let r=this.proxyToSource[e.key][n.id];if(r)for(let e of r){let r=r4(n.getTile(e),n.findLoadedParent(e,0),n,this.painter.transform,o);(1!==r.opacity||0!==r.mix)&&this._clearRenderCacheForTile(n.id,e)}}}}_setupDrapedRenderBatches(){let r=this._style.order,i=r.length;if(0===i)return;let n=[];this._pendingGroundEffectLayers=[];let o,a=0,s=this._style._mergedLayers[r[a]];for(;!this._style.isLayerDraped(s)&&s.isHidden(this.painter.transform.zoom)&&++a<i;)s=this._style._mergedLayers[r[a]];for(;a<i;++a){let e=this._style._mergedLayers[r[a]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===o&&(o=a):("fill-extrusion"===e.type&&this._pendingGroundEffectLayers.push(a),void 0!==o&&(n.push({start:o,end:a-1}),o=void 0)))}if(void 0!==o&&n.push({start:o,end:a-1}),0!==n.length){let r=n[n.length-1];this._pendingGroundEffectLayers.every(e=>e>r.end)||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=n}_setupRenderCache(e){let r=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,r.renderCache.length>r.renderCachePool.length){let e=Object.values(r.proxyCachedFBO);r.proxyCachedFBO={};for(let i=0;i<e.length;++i){let n=Object.values(e[i]);r.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();let i=this.proxyCoords,n=this._tilesDirty;for(let o=i.length-1;o>=0;o--){let a=i[o];if(r.getTileByID(a.key),void 0!==r.proxyCachedFBO[a.key]){let i=e[a.key],o=this.proxyToSource[a.key],s=0;for(let e in o){let r=o[e],a=i[e];if(!a||a.length!==r.length||r.some((r,i)=>
102r!==a[i]||n[e]&&n[e].hasOwnProperty(r.key))){s=-1;break}++s}for(let e in r.proxyCachedFBO[a.key])r.renderCache[r.proxyCachedFBO[a.key][e]].dirty=s<0||s!==Object.values(i).length}}let o=[...this._drapedRenderBatches];for(let e of(o.sort((e,r)=>r.end-r.start-(e.end-e.start)),o))for(let n of i){if(r.proxyCachedFBO[n.key])continue;let i=r.renderCachePool.pop();void 0===i&&r.renderCache.length<50&&(i=r.renderCache.length,r.renderCache.push(this._createFBO())),void 0!==i&&(r.proxyCachedFBO[n.key]={},r.proxyCachedFBO[n.key][e.start]=i,r.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(e,r,i,n){let o;if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));let a=this.painter.context,s=a.gl;if(r.length<=1)return void(this._overlapStencilType=!1);if(i.isTileClipped())o=r.length,this._overlapStencilMode.test={func:s.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(r[0].overscaledZ>r[r.length-1].overscaledZ))return void(this._overlapStencilType=!1);o=1,this._overlapStencilMode.test={func:s.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+o>255&&(a.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=o,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(r,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):tl.disabled}_renderTileClippingMasks(e,r){let i=this.painter,n=this.painter.context,o=n.gl;i._tileClippingMaskIDs={},n.setColorMode(tu.disabled),n.setDepthMode(ts.disabled);let a=i.getOrCreateProgram("clippingMask");for(let n of e){let e=i._tileClippingMaskIDs[n.key]=--r;a.draw(i,o.TRIANGLES,ts.disabled,new tl({func:o.ALWAYS,mask:0},e,255,o.KEEP,o.KEEP,o.REPLACE),tu.disabled,tc.disabled,r5(n.projMatrix),"$clipping",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}pointCoordinate(r){let i=this.painter.transform;if(r.x<0||r.x>i.width||r.y<0||r.y>i.height)return null;let n=[r.x,r.y,1,1];e.aa.transformMat4(n,n,i.pixelMatrixInverse),e.aa.scale(n,n,1/n[3]),n[0]/=i.worldSize,n[1]/=i.worldSize;let o=i._camera.position,a=e.bo(1,i.center.lat),s=[o[0],o[1],o[2]/a,0],l=e.Q.subtract([],n.slice(0,3),s);e.Q.normalize(l,l);let u=this.raycast(s,l,this._exaggeration);return null!==u&&u?(e.Q.scaleAndAdd(s,s,l,u),s[3]=s[2],s[2]*=a,s):null}drawDepth(){let r=this.painter,i=r.context,n=this.proxySourceCache,o=Math.ceil(r.width),a=Math.ceil(r.height);if(this._depthFBO&&(this._depthFBO.width!==o||this._depthFBO.height!==a)&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){let r=i.gl,n=i.createFramebuffer(o,a,!0,"renderbuffer");i.activeTexture.set(r.TEXTURE0);let s=new e.T(i,{width:o,height:a,data:null},r.RGBA);s.bind(r.NEAREST,r.CLAMP_TO_EDGE),n.colorAttachment.set(s.texture);let l=i.createRenderbuffer(i.gl.DEPTH_COMPONENT16,o,a);n.depthAttachment.set(l),this._depthFBO=n,this._depthTexture=s}i.bindFramebuffer.set(this._depthFBO.framebuffer),i.viewport.set([0,0,o,a]),function(e,r,i,n){if("globe"===e.transform.projection.name)return;let o=e.context,a=o.gl;o.clear({depth:1});let s=e.getOrCreateProgram("terrainDepth"),l=new ts(a.LESS,ts.ReadWrite,e.depthRangeFor3D);for(let o of n){let n=i.getTile(o),u=rQ(o.projMatrix,0,[0,0,0]);r.setupElevationDraw(n,s),s.draw(e,a.TRIANGLES,l,tl.disabled,tu.unblended,tc.backCCW,u,"terrain_depth",r.gridBuffer,r.gridIndexBuffer,r.gridNoSkirtSegments)}}(r,this,n,this.proxyCoords)}_setupProxiedCoordsForOrtho(r,i,n){if(r.getSource()instanceof e.as)return this._setupProxiedCoordsForImageSource(r,i,n);this._findCoveringTileCache[r.id]=this._findCoveringTileCache[r.id]||{};let o=this.proxiedCoords[r.id]=[],a=this.proxyCoords;for(let e=0;e<a.length;e++){let i=a[e],s=this._findTileCoveringTileID(i,r);if(s){let e=this._createProxiedId(i,s,n[i.key]&&n[i.key][r.id]);o.push(e),this.proxyToSource[i.key][r.id]=[e]}}let s=!1,l=new Set;for(let e=0;e<i.length;e++){let a=r.getTile(i[e]);if(!a||!a.hasData())continue;let u=this._findTileCoveringTileID(a.tileID,this.proxySourceCache);
102if(u&&u.tileID.canonical.z!==a.tileID.canonical.z){let e=this.proxyToSource[u.tileID.key][r.id],i=this._createProxiedId(u.tileID,a,n[u.tileID.key]&&n[u.tileID.key][r.id]);e?e.splice(e.length-1,0,i):this.proxyToSource[u.tileID.key][r.id]=[i];let c=this.proxyToSource[u.tileID.key][r.id];l.has(c)||l.add(c),o.push(i),s=!0}}if(this._sourceTilesOverlap[r.id]=s,s&&this._debugParams.sortTilesHiZFirst)for(let e of l)e.sort((e,r)=>r.overscaledZ-e.overscaledZ)}_setupProxiedCoordsForImageSource(r,i,n){if(!r.getSource().loaded())return;let o=this.proxiedCoords[r.id]=[],a=this.proxyCoords,s=r.getSource(),l=s.tileID;if(!l)return;let u=new e.P(l.x,l.y)._div(1<<l.z),c=s.coordinates.map(e.O.fromLngLat).reduce((e,r)=>(e.min.x=Math.min(e.min.x,r.x-u.x),e.min.y=Math.min(e.min.y,r.y-u.y),e.max.x=Math.max(e.max.x,r.x-u.x),e.max.y=Math.max(e.max.y,r.y-u.y),e),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),h=(r,i)=>{let n=r.wrap+r.canonical.x/(1<<r.canonical.z),o=r.canonical.y/(1<<r.canonical.z),a=e.Y/(1<<r.canonical.z),s=i.wrap+i.canonical.x/(1<<i.canonical.z),l=i.canonical.y/(1<<i.canonical.z);return n+a<s+c.min.x||n>s+c.max.x||o+a<l+c.min.y||o>l+c.max.y};for(let e=0;e<a.length;e++){let s=a[e];for(let e=0;e<i.length;e++){let a=r.getTile(i[e]);if(!a||!a.hasData()||h(s,a.tileID))continue;let l=this._createProxiedId(s,a,n[s.key]&&n[s.key][r.id]),u=this.proxyToSource[s.key][r.id];u?u.push(l):this.proxyToSource[s.key][r.id]=[l],o.push(l)}}}_createProxiedId(r,i,n){let o=this.orthoMatrix;if(n){let e=n.find(e=>e.key===i.tileID.key);if(e)return e}if(i.tileID.key!==r.key){let n,a,s,l=r.canonical.z-i.tileID.canonical.z;o=e.a9.create();let u=i.tileID.wrap-r.wrap<<r.overscaledZ;l>0?(a=(n=e.Y>>l)*((i.tileID.canonical.x<<l)-r.canonical.x+u),s=n*((i.tileID.canonical.y<<l)-r.canonical.y)):(n=e.Y<<-l,a=e.Y*(i.tileID.canonical.x-(r.canonical.x+u<<-l)),s=e.Y*(i.tileID.canonical.y-(r.canonical.y<<-l))),e.a9.ortho(o,0,n,0,n,0,1),e.a9.translate(o,o,[a,s,0])}return new r9(i.tileID,r.key,o)}_findTileCoveringTileID(r,i){let n=i.getTile(r);if(n&&n.hasData())return n;let o=this._findCoveringTileCache[i.id],a=o[r.key];if((n=a?i.getTileByID(a):null)&&n.hasData()||null===a)return n;let s=n?n.tileID:r,l=s.overscaledZ,u=i.getSource().minzoom,c=[];if(!a){let o=i.getSource().maxzoom;if(r.canonical.z>=o){let n=r.canonical.z-o;i.getSource().reparseOverscaled?(l=Math.max(r.canonical.z+2,i.transform.tileZoom),s=new e.ap(l,r.wrap,o,r.canonical.x>>n,r.canonical.y>>n)):0!==n&&(l=o,s=new e.ap(l,r.wrap,o,r.canonical.x>>n,r.canonical.y>>n))}s.key!==r.key&&(c.push(s.key),n=i.getTile(s))}let h=e=>{c.forEach(r=>{o[r]=e}),c.length=0};for(l-=1;l>=u&&(!n||!n.hasData());l--){n&&h(n.tileID.key);let e=s.calculateScaledKey(l);if((n=i.getTileByID(e))&&n.hasData())break;let r=o[e];if(null===r)break;void 0===r?c.push(e):n=i.getTileByID(r)}return h(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,r){let i=this._tilesDirty[e];i||(i=this._tilesDirty[e]={}),i[r.key]=!0}}let ie=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],it=["stars","fillExtrusion","fillExtrusionGroundEffect","model","symbolSDF","symbolIcon","symbolTextAndIcon"];class ir{static cacheKey(e,r,i,n){let o=`${r}${n?n.cacheKey:""}`;for(let r of i)e.usedDefines.includes(r)&&(o+=`/${r}`);return o}constructor(r,i,n,o,a,s){const l=r.gl;this.program=l.createProgram(),this.configuration=o,this.name=i,this.fixedDefines=[...s];const u=o?o.getBinderAttributes():[],c=(n.staticAttributes||[]).concat(u);let h=o?o.defines():[];h=h.concat(s.map(e=>`#define ${e}`));const p="#version 300 es\n";let d=p+h.concat("precision mediump float;",rL,rH.fragmentSource).join("\n");for(const e of n.fragmentIncludes)d+=`
103${rG[e]}`;d+=`
104${n.fragmentSource}`;let f=p+h.concat("precision highp float;",rL,rH.vertexSource).join("\n");for(const e of n.vertexIncludes)f+=`
105${rG[e]}`;f+=`
106${n.vertexSource}`;const m=l.createShader(l.FRAGMENT_SHADER);if(l.isContextLost())return void(this.failedToCreate=!0);l.shaderSource(m,d),l.compileShader(m),l.attachShader(this.program,m);const g=l.createShader(l.VERTEX_SHADER);if(l.isContextLost())this.failedToCreate=!0;else{l.shaderSource(g,f),l.compileShader(g),l.attachShader(this.program,g),this.attributes={},this.numAttributes=c.length;for(let e=0;e<this.numAttributes;e++)if(c[e]){const r=c[e].startsWith("a_")?c[e]:`a_${c[e]}`;l.bindAttribLocation(this.program,e,r),this.attributes[r]=e}l.linkProgram(this.program),l.deleteShader(g),l.deleteShader(m),this.fixedUniforms=a(r),this.binderUniforms=o?o.getUniforms(r):[],s.includes("TERRAIN")&&(this.terrainUniforms=(r=>({u_dem:new e.bR(r),u_dem_prev:new e.bR(r),u_dem_tl:new e.bO(r),u_dem_scale:new e.bQ(r),u_dem_tl_prev:new e.bO(r),u_dem_scale_prev:new e.bQ(r),u_dem_size:new e.bQ(r),u_dem_lerp:new e.bQ(r),u_exaggeration:new e.bQ(r),u_depth:new e.bR(r),u_depth_size_inv:new e.bO(r),u_meter_to_dem:new e.bQ(r),u_label_plane_matrix_inv:new e.bN(r)}))(r)),s.includes("GLOBE")&&(this.globeUniforms=(r=>({u_tile_tl_up:new e.bP(r),u_tile_tr_up:new e.bP(r),u_tile_br_up:new e.bP(r),u_tile_bl_up:new e.bP(r),u_tile_up_scale:new e.bQ(r)}))(r)),s.includes("FOG")&&(this.fogUniforms=(r=>({u_fog_matrix:new e.bN(r),u_fog_range:new e.bO(r),u_fog_color:new e.bS(r),u_fog_horizon_blend:new e.bQ(r),u_fog_vertical_limit:new e.bO(r),u_fog_temporal_offset:new e.bQ(r),u_frustum_tl:new e.bP(r),u_frustum_tr:new e.bP(r),u_frustum_br:new e.bP(r),u_frustum_bl:new e.bP(r),u_globe_pos:new e.bP(r),u_globe_radius:new e.bQ(r),u_globe_transition:new e.bQ(r),u_is_globe:new e.bR(r),u_viewport:new e.bO(r)}))(r)),s.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(r=>({u_cutoff_params:new e.bS(r)}))(r)),s.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(r=>({u_lighting_ambient_color:new e.bP(r),u_lighting_directional_dir:new e.bP(r),u_lighting_directional_color:new e.bP(r),u_ground_radiance:new e.bP(r)}))(r)),s.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(r=>({u_light_matrix_0:new e.bN(r),u_light_matrix_1:new e.bN(r),u_fade_range:new e.bO(r),u_shadow_normal_offset:new e.bP(r),u_shadow_intensity:new e.bQ(r),u_shadow_texel_size:new e.bQ(r),u_shadow_map_resolution:new e.bQ(r),u_shadow_direction:new e.bP(r),u_shadow_bias:new e.bP(r),u_shadowmap_0:new e.bR(r),u_shadowmap_1:new e.bR(r)}))(r))}}setTerrainUniformValues(e,r){if(!this.terrainUniforms)return;let i=this.terrainUniforms;if(!this.failedToCreate)for(let n in e.program.set(this.program),r)i[n]&&i[n].set(this.program,n,r[n])}setGlobeUniformValues(e,r){if(!this.globeUniforms)return;let i=this.globeUniforms;if(!this.failedToCreate)for(let n in e.program.set(this.program),r)i[n]&&i[n].set(this.program,n,r[n])}setFogUniformValues(e,r){if(!this.fogUniforms)return;let i=this.fogUniforms;if(!this.failedToCreate)for(let n in e.program.set(this.program),r)i[n].set(this.program,n,r[n])}setCutoffUniformValues(e,r){if(!this.cutoffUniforms)return;let i=this.cutoffUniforms;if(!this.failedToCreate)for(let n in e.program.set(this.program),r)i[n].set(this.program,n,r[n])}setLightsUniformValues(e,r){if(!this.lightsUniforms)return;let i=this.lightsUniforms;if(!this.failedToCreate)for(let n in e.program.set(this.program),r)i[n].set(this.program,n,r[n])}setShadowUniformValues(e,r){if(this.failedToCreate||!this.shadowUniforms)return;let i=this.shadowUniforms;for(let n in e.program.set(this.program),r)i[n].set(this.program,n,r[n])}_drawDebugWireframe(r,i,n,o,a,s,l,u,c,h){let p=r.options.wireframe;if(!1===p.terrain&&!1===p.layers2D&&!1===p.layers3D)return;let d=r.context;if(!(!(!p.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!p.layers2D||r._terrain&&r._terrain.renderingToTexture||!ie.includes(this.name))||!(!p.layers3D||!it.includes(this.name))))return;let f=d.gl,m=r.wireframeDebugCache.getLinesFromTrianglesBuffer(r.frameCounter,a,d);if(!m)return;let g=[...this.fixedDefines];
106g.push("DEBUG_WIREFRAME");let _=r.getOrCreateProgram(this.name,{config:this.configuration,defines:g});d.program.set(_.program);let y=(e,r,i)=>{if(r[e]&&i[e])for(let n in r[e])i[e][n]&&i[e][n].set(i.program,n,r[e][n].current)};c&&c.setUniforms(_.program,d,_.binderUniforms,l,{zoom:u}),y("fixedUniforms",this,_),y("terrainUniforms",this,_),y("globeUniforms",this,_),y("fogUniforms",this,_),y("lightsUniforms",this,_),y("shadowUniforms",this,_),m.bind(),d.setColorMode(new tu([f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ZERO,f.ONE],e.aA.transparent,[!0,!0,!0,!1])),d.setDepthMode(new ts(i.func===f.LESS?f.LEQUAL:i.func,ts.ReadOnly,i.range)),d.setStencilMode(tl.disabled);let v=3*s.primitiveLength*2,x=3*s.primitiveOffset*4;h&&h>1?f.drawElementsInstanced(f.LINES,v,f.UNSIGNED_SHORT,x,h):f.drawElements(f.LINES,v,f.UNSIGNED_SHORT,x),a.bind(),d.program.set(this.program),d.setDepthMode(i),d.setStencilMode(n),d.setColorMode(o)}draw(e,r,i,n,o,a,s,l,u,c,h,p,d,f,m,g){let _=e.context,y=_.gl;if(this.failedToCreate)return;for(let e of(_.program.set(this.program),_.setDepthMode(i),_.setStencilMode(n),_.setColorMode(o),_.setCullFace(a),Object.keys(this.fixedUniforms)))this.fixedUniforms[e].set(this.program,e,s[e]);f&&f.setUniforms(this.program,_,this.binderUniforms,p,{zoom:d});let v={[y.POINTS]:1,[y.LINES]:2,[y.TRIANGLES]:3,[y.LINE_STRIP]:1}[r],x=g&&g>0?1:void 0;for(let a of h.get()){let s=a.vaos||(a.vaos={});(s[l]||(s[l]=new rZ)).bind(_,this,u,f?f.getPaintVertexBuffers():[],c,a.vertexOffset,m||[],x),g&&g>1?y.drawElementsInstanced(r,a.primitiveLength*v,y.UNSIGNED_SHORT,a.primitiveOffset*v*2,g):c?y.drawElements(r,a.primitiveLength*v,y.UNSIGNED_SHORT,a.primitiveOffset*v*2):y.drawArrays(r,a.vertexOffset,a.vertexLength),r===y.TRIANGLES&&c&&this._drawDebugWireframe(e,i,n,o,c,a,p,d,f,g)}}}function ii(r,i){let n=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,r.transform.tileZoom)/n,a=o*(i.tileID.canonical.x+i.tileID.wrap*n),s=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/e.a6(i,1,r.transform.tileZoom),u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}let io=e.a9.create(),ia=(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_)=>{let y=i.style.light,v=y.properties.get("position"),x=[v.x,v.y,v.z],b=e.ct.create();"viewport"===y.properties.get("anchor")&&(e.ct.fromRotation(b,-i.transform.angle),e.Q.transformMat3(x,x,b));let w=y.properties.get("color"),E=i.transform,S={u_matrix:r,u_lightpos:x,u_lightintensity:y.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:o,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:io,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:a,u_edge_radius:s,u_flood_light_color:d,u_vertical_scale:f,u_flood_light_intensity:m,u_ground_shadow_factor:g,u_emissive_strength:_};return"globe"===E.projection.name&&(S.u_tile_id=[l.canonical.x,l.canonical.y,1<<l.canonical.z],S.u_zoom_transition=c,S.u_inv_rot_matrix=p,S.u_merc_center=h,S.u_up_dir=E.projection.upVector(new e.bv(0,0,0),h[0]*e.Y,h[1]*e.Y),S.u_height_lift=u),S},is=(e,r,i)=>({u_matrix:e,u_edge_radius:r,u_vertical_scale:i}),il=(r,i,n,o,a,s,l,u,c,h,p,d,f,m)=>{let g=ia(r,i,n,o,a,s,l,c,h,p,d,f,m,1,[0,0,0],0),_={u_height_factor:-Math.pow(2,l.overscaledZ)/u.tileSize/8};return e.e(g,ii(i,u),_)},iu=(e,r)=>({u_matrix:e,u_emissive_strength:r}),ic=(r,i,n,o)=>e.e(iu(r,i),ii(n,o)),ih=(e,r,i)=>({u_matrix:e,u_world:i,u_emissive_strength:r}),ip=(r,i,n,o,a)=>e.e(ic(r,i,n,o),{u_world:a}),id=(r,i,n,o)=>{let a=e.Y/n.tileSize;return{u_matrix:r,u_camera_to_center_distance:i.getCameraToCenterDistance(o),u_extrude_scale:[i.pixelsToGLUnits[0]/a,i.pixelsToGLUnits[1]/a]}},im=(e,r,i=1)=>({u_matrix:e,u_color:r,u_overlay:0,u_overlay_scale:i}),ig=e.a9.create(),i_=(r,i,n,o,a,s,l)=>{let u=r.transform,c="globe"===u.projection.name,h=c?e.cu(u.zoom,i.canonical)*u._pixelsPerMercatorPixel:e.a6(n,1,s),p={u_matrix:i.projMatrix,u_extrude_scale:h,u_intensity:l,u_inv_rot_matrix:ig,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){p.u_inv_rot_matrix=o,p.u_merc_center=a,p.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],p.u_zoom_transition=e.W(u.zoom);let r=a[0]*e.Y,n=a[1]*e.Y;p.u_up_dir=u.projection.upVector(new e.bv(0,0,0),r,n)}return p};function iy(e,[r,i,n,o],[a,s]){if(a===s)return[0,0,0,0];let l=255*(e-1)/(e*(s-a));return[r*l,i*l,n*l,o*l]}function iv(e,r,[i,n]){return i===n?0:.5/e+(r-i)*(e-1)/(e*(n-i))}let ix=(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w)=>{var E;let S,T;return{u_matrix:r,u_normalize_matrix:i,u_globe_matrix:n,u_merc_matrix:o,u_grid_matrix:a,u_tl_parent:s,u_scale_parent:h,u_fade_t:p.mix,u_opacity:p.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:e.cv(d.paint.get("raster-saturation")),u_contrast_factor:e.cw(d.paint.get("raster-contrast")),u_spin_weights:(S=Math.sin(E=d.paint.get("raster-hue-rotate")*(Math.PI/180)
106),[(2*(T=Math.cos(E))+1)/3,(-Math.sqrt(3)*S-T+1)/3,(Math.sqrt(3)*S-T+1)/3]),u_perspective_transform:f,u_raster_elevation:m,u_zoom_transition:l,u_merc_center:u,u_cutoff_params:c,u_colorization_mix:iy(e.cx,_,v),u_colorization_offset:iv(e.cx,y,v),u_color_ramp:g,u_texture_offset:[b/(x+2*b),x/(x+2*b)],u_texture_res:[x+2*b,x+2*b],u_emissive_strength:w}},ib=(e,r,i,n,o,a,s,l,u,c,h,p)=>({u_matrix:e,u_normalize_matrix:r,u_globe_matrix:i,u_merc_matrix:n,u_grid_matrix:o,u_tl_parent:a,u_scale_parent:c,u_fade_t:h.mix,u_opacity:h.opacity,u_image0:0,u_image1:1,u_raster_elevation:p,u_zoom_transition:s,u_merc_center:l,u_cutoff_params:u}),iw=(e,r,i,n,o,a,s,l,u,c)=>({u_particle_texture:e,u_particle_texture_side_len:r,u_tile_offset:i,u_velocity:n,u_color_ramp:a,u_velocity_res:o,u_max_speed:s,u_uv_offset:l,u_data_scale:u,u_data_offset:c,u_particle_pos_scale:1.3,u_particle_pos_offset:[.15000000000000002,.15000000000000002]}),iE=(e,r,i,n,o,a,s,l,u,c)=>({u_particle_texture:e,u_particle_texture_side_len:r,u_velocity:i,u_velocity_res:n,u_max_speed:o,u_speed_factor:a,u_reset_rate:s,u_rand_seed:Math.random(),u_uv_offset:l,u_data_scale:u,u_data_offset:c,u_particle_pos_scale:1.3,u_particle_pos_offset:[.15000000000000002,.15000000000000002]}),iS=e.a9.create(),iT=(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v)=>{let x=a.transform,b={u_is_size_zoom_constant:+("constant"===r||"source"===r),u_is_size_feature_constant:+("constant"===r||"camera"===r),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:x.getCameraToCenterDistance(_),u_rotate_symbol:+n,u_aspect_ratio:x.width/x.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:u,u_is_text:+c,u_pitch_with_map:+o,u_texsize:h,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:iS,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:iS,u_up_vector:[0,-1,0],u_color_adj_mat:y,u_icon_transition:v||0};return"globe"===_.name&&(b.u_tile_id=[p.canonical.x,p.canonical.y,1<<p.canonical.z],b.u_zoom_transition=d,b.u_inv_rot_matrix=m,b.u_merc_center=f,b.u_camera_forward=x._camera.forward(),b.u_ecef_origin=e.cy(x.globeMatrix,p.toUnwrapped()),b.u_tile_matrix=Float32Array.from(x.globeMatrix),b.u_up_vector=g),b},iI=(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y)=>e.e(iT(r,i,n,o,a,s,l,u,c,h,d,f,m,g,_,y),{u_gamma_scale:o?a.transform.getCameraToCenterDistance(y)*Math.cos(a.terrain?0:a.transform._pitch):1,u_device_pixel_ratio:e.f.devicePixelRatio,u_is_halo:+p,undefined:void 0}),iM=(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_)=>e.e(iI(r,i,n,o,a,s,l,u,!0,c,!0,p,d,f,m,g,_),{u_texsize_icon:h,u_texture_icon:1}),iC=(e,r,i,n)=>({u_matrix:e,u_emissive_strength:r,u_opacity:i,u_color:n}),iA=(r,i,n,o,a,s,l)=>e.e(function(r,i,n,o){let a=n.imageManager.getPattern(r.toString(),i),{width:s,height:l}=n.imageManager.getPixelSize(i),u=Math.pow(2,o.tileID.overscaledZ),c=o.tileSize*Math.pow(2,n.transform.tileZoom)/u,h=c*(o.tileID.canonical.x+o.tileID.wrap*u),p=c*o.tileID.canonical.y;return{u_image:0,u_pattern_tl:a.tl,u_pattern_br:a.br,u_texsize:[s,l],u_pattern_size:a.displaySize,u_tile_units_to_pixels:1/e.a6(o,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(a,s,o,l),{u_matrix:r,u_emissive_strength:i,u_opacity:n}),iP=new Float32Array(e.a9.identity([])),iL=(r,i,n,o,a,s,l,u,c,h,p,d,f,m=[0,0,0],g)=>{let _=a.style.light,y=_.properties.get("position"),v=[-y.x,-y.y,y.z],x=e.ct.create();"viewport"===_.properties.get("anchor")&&(e.ct.fromRotation(x,-a.transform.angle),e.Q.transformMat3(v,v,x));let b="MASK"===p.alphaMode,w=_.properties.get("color"),E=f.paint.get("model-ambient-occlusion-intensity"),S=f.paint.get("model-color").constantOr(e.aA.white),T=f.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:r,u_lighting_matrix:i,u_normal_matrix:n,u_node_matrix:o||iP,u_lightpos:v,u_lightintensity:_.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_camera_pos:m,u_opacity:s,u_baseTextureIsAlpha:0,u_alphaMask:+b,u_alphaCutoff:p.alphaCutoff,u_baseColorFactor:[l.r,l.g,l.b,l.a],u_emissiveFactor:[u[0],u[1],u[2],1],u_metallicFactor:c,u_roughnessFactor:h,u_baseColorTexture:5,u_metallicRoughnessTexture:6,u_normalTexture:7,u_occlusionTexture:8,u_emissionTexture:9,u_color_mix:[S.r,S.g,S.b,T],u_aoIntensity:E,u_emissive_strength:d,u_occlusionTextureTransform:g||[0,0,0,0]}},iO=(e,r=iP,i=iP)=>({u_matrix:e,u_instance:r,u_node_matrix:i}),iD={fillExtrusion:r=>({u_matrix:new e.bN(r),u_lightpos:new e.bP(r),u_lightintensity:new e.bQ(r),u_lightcolor:new e.bP(r),u_vertical_gradient:new e.bQ(r),u_opacity:new e.bQ(r),u_edge_radius:new e.bQ(r),u_ao:new e.bO(r),u_tile_id:new e.bP(r),u_zoom_transition:new e.bQ(r),u_inv_rot_matrix:new e.bN(r),u_merc_center:new e.bO(r),u_up_dir:new e.bP(r),u_height_lift:new e.bQ(r),u_flood_light_color:new e.bP(r),u_vertical_scale:new e.bQ(r),u_flood_light_intensity:new e.bQ(r),u_ground_shadow_factor:new e.bP(r),u_emissive_strength:new e.bQ(r)}),fillExtrusionDepth:r=>({u_matrix:new e.bN(r),u_edge_radius:new e.bQ(r),u_vertical_scale:new e.bQ(r)}),fillExtrusionPattern:r=>({u_matrix:new e.bN(r),u_lightpos:new e.bP(r),u_lightintensity:new e.bQ(r),u_lightcolor:new e.bP(r),u_vertical_gradient:new e.bQ(r),u_height_factor:new e.bQ(r),u_edge_radius:new e.bQ(r),u_ao:new e.bO(r),u_tile_id:new e.bP(r),u_zoom_transition:new e.bQ(r),u_inv_rot_matrix:new e.bN(r),u_merc_center:new e.bO(r),u_up_dir:new e.bP(r),u_height_lift:new e.bQ(r),u_image:new e.bR(r),u_texsize:new e.bO(r),u_pixel_coord_upper:new e.bO(r),u_pixel_coord_lower:new e.bO(r),u_tile_units_to_pixels:new e.bQ(r),u_opacity:new e.bQ(r)}),fillExtrusionGroundEffect:r=>({u_matrix:new e.bN(r),u_opacity:new e.bQ(r),u_ao_pass:new e.bQ(r),u_meter_to_tile:new e.bQ(r),u_ao:new e.bO(r),u_flood_light_intensity:new e.bQ(r),u_flood_light_color:new e.bP(r),u_attenuation:new e.bQ(r),u_edge_radius:new e.bQ(r),u_fb:new e.bR(r),u_fb_size:new e.bQ(r)}),fill:r=>({u_matrix:new e.bN(r),u_emissive_strength:new e.bQ(r)}),fillPattern:r=>({u_matrix:new e.bN(r),u_emissive_strength:new e.bQ(r),u_image:new e.bR(r),u_texsize:new e.bO(r),u_pixel_coord_upper:new e.bO(r),u_pixel_coord_lower:new e.bO(r),u_tile_units_to_pixels:new e.bQ(r)}),fillOutline:r=>({u_matrix:new e.bN(r),u_emissive_strength:new e.bQ(r),u_world:new e.bO(r)}),fillOutlinePattern:r=>({u_matrix:new e.bN(r),u_emissive_strength:new e.bQ(r),u_world:new e.bO(r),u_image:new e.bR(r),u_texsize:new e.bO(r),u_pixel_coord_upper:new e.bO(r),u_pixel_coord_lower:new e.bO(r),u_tile_units_to_pixels:new e.bQ(r)}),circle:e.cz,collisionBox:r=>({u_matrix:new e.bN(r),u_camera_to_center_distance:new e.bQ(r),u_extrude_scale:new e.bO(r)}),collisionCircle:r=>({u_matrix:new e.bN(r),u_inv_matrix:new e.bN(r),u_camera_to_center_distance:new e.bQ(r),u_viewport_size:new e.bO(r)}),debug:r=>
106({u_color:new e.cf(r),u_matrix:new e.bN(r),u_overlay:new e.bR(r),u_overlay_scale:new e.bQ(r)}),clippingMask:r=>({u_matrix:new e.bN(r)}),heatmap:r=>({u_extrude_scale:new e.bQ(r),u_intensity:new e.bQ(r),u_matrix:new e.bN(r),u_inv_rot_matrix:new e.bN(r),u_merc_center:new e.bO(r),u_tile_id:new e.bP(r),u_zoom_transition:new e.bQ(r),u_up_dir:new e.bP(r)}),heatmapTexture:r=>({u_image:new e.bR(r),u_color_ramp:new e.bR(r),u_opacity:new e.bQ(r)}),hillshade:r=>({u_matrix:new e.bN(r),u_image:new e.bR(r),u_latrange:new e.bO(r),u_light:new e.bO(r),u_shadow:new e.cf(r),u_highlight:new e.cf(r),u_emissive_strength:new e.bQ(r),u_accent:new e.cf(r)}),hillshadePrepare:r=>({u_matrix:new e.bN(r),u_image:new e.bR(r),u_dimension:new e.bO(r),u_zoom:new e.bQ(r)}),line:e.cA,linePattern:e.cB,raster:r=>({u_matrix:new e.bN(r),u_normalize_matrix:new e.bN(r),u_globe_matrix:new e.bN(r),u_merc_matrix:new e.bN(r),u_grid_matrix:new e.cg(r),u_tl_parent:new e.bO(r),u_scale_parent:new e.bQ(r),u_fade_t:new e.bQ(r),u_opacity:new e.bQ(r),u_image0:new e.bR(r),u_image1:new e.bR(r),u_brightness_low:new e.bQ(r),u_brightness_high:new e.bQ(r),u_saturation_factor:new e.bQ(r),u_contrast_factor:new e.bQ(r),u_spin_weights:new e.bP(r),u_perspective_transform:new e.bO(r),u_raster_elevation:new e.bQ(r),u_zoom_transition:new e.bQ(r),u_merc_center:new e.bO(r),u_cutoff_params:new e.bS(r),u_colorization_mix:new e.bS(r),u_colorization_offset:new e.bQ(r),u_color_ramp:new e.bR(r),u_texture_offset:new e.bO(r),u_texture_res:new e.bO(r),u_emissive_strength:new e.bQ(r)}),rasterParticle:r=>({u_matrix:new e.bN(r),u_normalize_matrix:new e.bN(r),u_globe_matrix:new e.bN(r),u_merc_matrix:new e.bN(r),u_grid_matrix:new e.cg(r),u_tl_parent:new e.bO(r),u_scale_parent:new e.bQ(r),u_fade_t:new e.bQ(r),u_opacity:new e.bQ(r),u_image0:new e.bR(r),u_image1:new e.bR(r),u_raster_elevation:new e.bQ(r),u_zoom_transition:new e.bQ(r),u_merc_center:new e.bO(r),u_cutoff_params:new e.bS(r)}),rasterParticleTexture:r=>({u_texture:new e.bR(r),u_opacity:new e.bQ(r)}),rasterParticleDraw:r=>({u_particle_texture:new e.bR(r),u_particle_texture_side_len:new e.bQ(r),u_tile_offset:new e.bO(r),u_velocity:new e.bR(r),u_color_ramp:new e.bR(r),u_velocity_res:new e.bO(r),u_max_speed:new e.bQ(r),u_uv_offset:new e.bO(r),u_data_scale:new e.bS(r),u_data_offset:new e.bQ(r),u_particle_pos_scale:new e.bQ(r),u_particle_pos_offset:new e.bO(r)}),rasterParticleUpdate:r=>({u_particle_texture:new e.bR(r),u_particle_texture_side_len:new e.bQ(r),u_velocity:new e.bR(r),u_velocity_res:new e.bO(r),u_max_speed:new e.bQ(r),u_speed_factor:new e.bQ(r),u_reset_rate:new e.bQ(r),u_rand_seed:new e.bQ(r),u_uv_offset:new e.bO(r),u_data_scale:new e.bS(r),u_data_offset:new e.bQ(r),u_particle_pos_scale:new e.bQ(r),u_particle_pos_offset:new e.bO(r)}),symbolIcon:r=>({u_is_size_zoom_constant:new e.bR(r),u_is_size_feature_constant:new e.bR(r),u_size_t:new e.bQ(r),u_size:new e.bQ(r),u_camera_to_center_distance:new e.bQ(r),u_rotate_symbol:new e.bR(r),u_aspect_ratio:new e.bQ(r),u_fade_change:new e.bQ(r),u_matrix:new e.bN(r),u_label_plane_matrix:new e.bN(r),u_coord_matrix:new e.bN(r),u_is_text:new e.bR(r),u_pitch_with_map:new e.bR(r),u_texsize:new e.bO(r),u_tile_id:new e.bP(r),u_zoom_transition:new e.bQ(r),u_inv_rot_matrix:new e.bN(r),u_merc_center:new e.bO(r),u_camera_forward:new e.bP(r),u_tile_matrix:new e.bN(r),u_up_vector:new e.bP(r),u_ecef_origin:new e.bP(r),u_texture:new e.bR(r),u_icon_transition:new e.bQ(r),u_color_adj_mat:new e.bN(r)}),symbolSDF:r=>({u_is_size_zoom_constant:new e.bR(r),u_is_size_feature_constant:new e.bR(r),u_size_t:new e.bQ(r),u_size:new e.bQ(r),u_camera_to_center_distance:new e.bQ(r),u_rotate_symbol:new e.bR(r),u_aspect_ratio:new e.bQ(r),u_fade_change:new e.bQ(r),u_matrix:new e.bN(r),u_label_plane_matrix:new e.bN(r),u_coord_matrix:new e.bN(r),u_is_text:new e.bR(r),u_pitch_with_map:new e.bR(r),u_texsize:new e.bO(r),u_texture:new e.bR(r),u_gamma_scale:new e.bQ(r),u_device_pixel_ratio:new e.bQ(r),u_tile_id:new e.bP(r),u_zoom_transition:new e.bQ(r),u_inv_rot_matrix:new e.bN(r),u_merc_center:new e.bO(r),u_camera_forward:new e.bP(r),u_tile_matrix:new e.bN(r),u_up_vector:new e.bP(r),u_ecef_origin:new e.bP(r),u_is_halo:new e.bR(r)}),symbolTextAndIcon:r=>({u_is_size_zoom_constant:new e.bR(r),u_is_size_feature_constant:new e.bR(r),u_size_t:new e.bQ(r),u_size:new e.bQ(r),u_camera_to_center_distance:new e.bQ(r),u_rotate_symbol:new e.bR(r),u_aspect_ratio:new e.bQ(r),u_fade_change:new e.bQ(r),u_matrix:new e.bN(r),u_label_plane_matrix:new e.bN(r),u_coord_matrix:new e.bN(r),u_is_text:new e.bR(r),u_pitch_with_map:new e.bR(r),u_texsize:new e.bO(r),u_texsize_icon:new e.bO(r),u_texture:new e.bR(r),u_texture_icon:new e.bR(r),u_gamma_scale:new e.bQ(r),u_device_pixel_ratio:new e.bQ(r),u_is_halo:new e.bR(r)}),background:r=>({u_matrix:new e.bN(r),u_emissive_strength:new e.bQ(r),u_opacity:new e.bQ(r),u_color:new e.cf(r)}),backgroundPattern:r=>({u_matrix:new e.bN(r),u_emissive_strength:new e.bQ(r),u_opacity:new e.bQ(r),u_image:new e.bR(r),u_pattern_tl:new e.bO(r),u_pattern_br:new e.bO(r),u_texsize:new e.bO(r),u_pattern_size:new e.bO(r),u_pixel_coord_upper:new e.bO(r),u_pixel_coord_lower:new e.bO(r),u_tile_units_to_pixels:new e.bQ(r)}),terrainRaster:rK,terrainDepth:rK,skybox:r=>({u_matrix:new e.bN(r),u_sun_direction:new e.bP(r),u_cubemap:new e.bR(r),u_opacity:new e.bQ(r),u_temporal_offset:new e.bQ(r)}),skyboxGradient:r=>({u_matrix:new e.bN(r),u_color_ramp:new e.bR(r),u_center_direction:new e.bP(r),u_radius:new e.bQ(r),u_opacity:new e.bQ(r),u_temporal_offset:new e.bQ(r)}),skyboxCapture:r=>({u_matrix_3f:new e.cg(r),u_sun_direction:new e.bP(r),u_sun_intensity:new e.bQ(r),u_color_tint_r:new e.bS(r),u_color_tint_m:new e.bS(r),u_luminance:new e.bQ(r)}),globeRaster:r=>({u_proj_matrix:new e.bN(r),u_globe_matrix:new e.bN(r),u_normalize_matrix:new e.bN(r),u_merc_matrix:new e.bN(r),u_zoom_transition:new e.bQ(r),u_merc_center:new e.bO(r),u_image0:new e.bR(r),u_grid_matrix:new e.cg(r),u_skirt_height:new e.bQ(r),u_far_z_cutoff:new e.bQ(r),u_frustum_tl:new e.bP(r),u_frustum_tr:new e.bP(r),u_frustum_br:new e.bP(r),u_frustum_bl:new e.bP(r),u_globe_pos:new e.bP(r),u_globe_radius:new e.bQ(r),u_viewport:new e.bO(r)}),globeAtmosphere:r=>({u_frustum_tl:new e.bP(r),u_frustum_tr:new e.bP(r),u_frustum_br:new e.bP(r),u_frustum_bl:new e.bP(r),u_horizon:new e.bQ(r),u_transition:new e.bQ(r),u_fadeout_range:new e.bQ(r),u_color:new e.bS(r),u_high_color:new e.bS(r),u_space_color:new e.bS(r),u_temporal_offset:new e.bQ(r),u_horizon_angle:new e.bQ(r)}),model:r=>({u_matrix:new e.bN(r),u_lighting_matrix:new e.bN(r),u_normal_matrix:new e.bN(r),u_node_matrix:new e.bN(r),u_lightpos:new e.bP(r),u_lightintensity:new e.bQ(r),u_lightcolor:new e.bP(r),u_camera_pos:new e.bP(r),u_opacity:new e.bQ(r),u_baseColorFactor:new e.bS(r),u_emissiveFactor:new e.bS(r),u_metallicFactor:new e.bQ(r),u_roughnessFactor:new e.bQ(r),u_baseTextureIsAlpha:new e.bR(r),u_alphaMask:new e.bR(r),u_alphaCutoff:new e.bQ(r),u_baseColorTexture:new e.bR(r),u_metallicRoughnessTexture:new e.bR(r),u_normalTexture:new e.bR(r),u_occlusionTexture:new e.bR(r),u_emissionTexture:new e.bR(r),u_color_mix:new e.bS(r),u_aoIntensity:new e.bQ(r),u_emissive_strength:new e.bQ(r),u_occlusionTextureTransform:new e.bS(r)}),modelDepth:r=>({u_matrix:new e.bN(r),u_instance:new e.bN(r),u_node_matrix:new e.bN(r)}),groundShadow:r=>({u_matrix:new e.bN(r),u_ground_shadow_factor:new e.bP(r)}),stars:r=>({u_matrix:new e.bN(r),u_up:new e.bP(r),u_right:new e.bP(r),u_intensity_multiplier:new e.bQ(r)})};function iR(r,n,o,a,s,l,u){let c=r.context,h=c.gl,p=r.transform,d=r.getOrCreateProgram("collisionBox"),f=[],m=0,g=0;for(let i=0;i<a.length;i++){let c=a[i],_=n.getTile(c),y=_.getBucket(o);if(!y)continue;let v=function(e,r,i){if(r.projection.name===i.projection.name)return e.projMatrix;let n=i.clone();return n.setProjection(r.projection),tK(n,r.getProjection(),e)}(c,y,p),x=v;0===s[0]&&0===s[1]||(x=r.translatePosMatrix(v,_,s,l));let b=u?y.textCollisionBox:y.iconCollisionBox,w=y.collisionCircleArray;
106if(w.length>0){let r=e.a9.create(),i=x;e.a9.mul(r,y.placementInvProjMatrix,p.glCoordMatrix),e.a9.mul(r,r,y.placementViewportMatrix),f.push({circleArray:w,circleOffset:g,transform:i,invTransform:r,projection:y.getProjection()}),m+=w.length/4,g=m}b&&(r.terrain&&r.terrain.setupElevationDraw(_,d),d.draw(r,h.LINES,ts.disabled,tl.disabled,r.colorModeForRenderPass(),tc.disabled,id(x,p,_,y.getProjection()),o.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,null,p.zoom,null,[b.collisionVertexBuffer,b.collisionVertexBufferExt]))}if(!u||!f.length)return;let _=r.getOrCreateProgram("collisionCircle"),y=new e.cC;y.resize(4*m),y._trim();let v=0;for(let e of f)for(let r=0;r<e.circleArray.length/4;r++){let i=4*r,n=e.circleArray[i+0],o=e.circleArray[i+1],a=e.circleArray[i+2],s=e.circleArray[i+3];y.emplace(v++,n,o,a,s,0),y.emplace(v++,n,o,a,s,1),y.emplace(v++,n,o,a,s,2),y.emplace(v++,n,o,a,s,3)}(!i||i.length<2*m)&&(i=function(r){let i=2*r,n=new e.az;n.resize(i),n._trim();for(let e=0;e<i;e++){let r=6*e;n.uint16[r+0]=4*e+0,n.uint16[r+1]=4*e+1,n.uint16[r+2]=4*e+2,n.uint16[r+3]=4*e+2,n.uint16[r+4]=4*e+3,n.uint16[r+5]=4*e+0}return n}(m));let x=c.createIndexBuffer(i,!0),b=c.createVertexBuffer(y,e.cD.members,!0);for(let i of f){let n={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:p.getCameraToCenterDistance(i.projection),u_viewport_size:[p.width,p.height]};_.draw(r,h.TRIANGLES,ts.disabled,tl.disabled,r.colorModeForRenderPass(),tc.disabled,n,o.id,b,x,e.aE.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,p.zoom)}b.destroy(),x.destroy()}let ik=e.a9.create();function iN(r){let i=r._camera.getWorldToCamera(r.worldSize,1),n=e.a9.multiply([],i,r.globeMatrix);e.a9.invert(n,n);let o=[0,0,0],a=[0,1,0,0];return e.aa.transformMat4(a,a,n),o[0]=a[0],o[1]=a[1],o[2]=a[2],e.Q.normalize(o,o),o}function iF(r,i,n,o,a,s,l={}){let u=n.paint.get("icon-translate"),c=n.paint.get("text-translate"),h=n.paint.get("icon-translate-anchor"),p=n.paint.get("text-translate-anchor"),d=n.layout.get("icon-rotation-alignment"),f=n.layout.get("text-rotation-alignment"),m=n.layout.get("icon-pitch-alignment"),g=n.layout.get("text-pitch-alignment"),_=n.layout.get("icon-keep-upright"),y=n.layout.get("text-keep-upright"),v=n.paint.get("icon-color-saturation"),x=n.paint.get("icon-color-contrast"),b=n.paint.get("icon-color-brightness-min"),w=n.paint.get("icon-color-brightness-max"),E=r.context,S=E.gl,T=r.transform,I="map"===d,M="map"===f,C="map"===m,A="map"===g,P=void 0!==n.layout.get("symbol-sort-key").constantOr(1),L=!1,O=r.depthModeForSublayer(0,ts.ReadOnly),D=[e.a8(T.center.lng),e.ah(T.center.lat)],R=n.layout.get("text-variable-anchor"),k="globe"===T.projection.name,N=[],F=[0,-1,0];for(let a of o){let o=i.getTile(a),s=o.getBucket(n);if(!s||"mercator"===s.projection.name&&k||s.fullyClipped)continue;let d="globe"===s.projection.name,f=d?e.W(T.zoom):0,m=tQ(a,s.getProjection(),T),g=T.calculatePixelsToTileUnitsMatrix(o),E=R&&s.hasTextData(),O=s.hasIconTextFit()&&E&&s.hasIconData(),z=s.getProjection().createInversionMatrix(T,a.canonical),B=()=>{let i,l=I&&"point"!==n.layout.get("symbol-placement"),c=[],p=l||O,y=n.paint.get("icon-image-cross-fade").constantOr(0);r.terrainRenderModeElevated()&&C&&c.push("PITCH_WITH_MAP_TERRAIN"),d&&(c.push("PROJECTION_GLOBE_VIEW"),p&&c.push("PROJECTED_POS_ON_VIEWPORT")),y>0&&c.push("ICON_TRANSITION"),s.icon.zOffsetVertexBuffer&&c.push("Z_OFFSET"),0===v&&0===x&&0===b&&1===w||c.push("COLOR_ADJUSTMENT");let E=s.icon.programConfigurations.get(n.id),M=r.getOrCreateProgram(s.sdfIcons?"symbolSDF":"symbolIcon",{config:E,defines:c}),A=o.imageAtlasTexture?o.imageAtlasTexture.size:[0,0],P=s.iconSizeData,L=e.b8(P,T.zoom),R=C||0!==T.pitch,N=tN(m,o.tileID.canonical,C,I,T,s.getProjection(),g),B=tz(m,o.tileID.canonical,C,I,T,s.getProjection(),g),U=r.translatePosMatrix(B,o,u,h,!0),j=r.translatePosMatrix(m,o,u,h),V=p?ik:N,G=I&&!C&&!l,q=F;(k||T.mercatorFromTransition)&&!I&&(q=iN(T));let H=d?q:F;if(s.sdfIcons&&!s.iconsInText)i=iI(P.kind,L,G,C,r,j,V,U,!1,A,!0,a,f,D,z,H,s.getProjection());else{let e=n.getColorAdjustmentMatrix(v,x,b,w);i=iT(P.kind,L,G,C,r,j,V,U,!1,A,a,f,D,z,H,s.getProjection(),e,y)}let $=o.imageAtlasTexture?o.imageAtlasTexture:null,W=1!==n.layout.get("icon-size").constantOr(0)||s.iconsNeedLinear,Y=s.sdfIcons||r.options.rotating||r.options.zooming||W||R?S.LINEAR:S.NEAREST,Z=s.sdfIcons&&0!==n.paint.get("icon-halo-width").constantOr(1),X=r.terrain&&C&&l?e.a9.invert(e.a9.create(),N):ik;if(l&&s.icon){let e=T.elevation,i=e?e.getAtTileOffsetFunc(a,T.center.lat,T.worldSize,s.getProjection()):null,n=tF(m,o.tileID.canonical,C,I,T,s.getProjection(),g);tj(s,m,r,!1,n,B,C,_,i,a)}return{program:M,buffers:s.icon,uniformValues:i,atlasTexture:$,atlasTextureIcon:null,atlasInterpolation:Y,atlasInterpolationIcon:null,isSDF:s.sdfIcons,hasH
106alo:Z,tile:o,labelPlaneMatrixInv:X}},U=()=>{let i,l=M&&"point"!==n.layout.get("symbol-placement"),u=[],h=l||R||O;r.terrainRenderModeElevated()&&A&&u.push("PITCH_WITH_MAP_TERRAIN"),d&&(u.push("PROJECTION_GLOBE_VIEW"),h&&u.push("PROJECTED_POS_ON_VIEWPORT")),s.text.zOffsetVertexBuffer&&u.push("Z_OFFSET");let _=s.text.programConfigurations.get(n.id),v=r.getOrCreateProgram(s.iconsInText?"symbolTextAndIcon":"symbolSDF",{config:_,defines:u}),x,b=[0,0],w=null,E=s.textSizeData;s.iconsInText&&(b=o.imageAtlasTexture?o.imageAtlasTexture.size:[0,0],w=o.imageAtlasTexture?o.imageAtlasTexture:null,x=A||0!==T.pitch||r.options.rotating||r.options.zooming||"composite"===E.kind||"camera"===E.kind?S.LINEAR:S.NEAREST);let I=o.glyphAtlasTexture?o.glyphAtlasTexture.size:[0,0],C=e.b8(E,T.zoom),P=tN(m,o.tileID.canonical,A,M,T,s.getProjection(),g),L=tz(m,o.tileID.canonical,A,M,T,s.getProjection(),g),N=r.translatePosMatrix(L,o,c,p,!0),B=r.translatePosMatrix(m,o,c,p),U=h?ik:P,j=M&&!A&&!l,V=F;(k||T.mercatorFromTransition)&&!M&&(V=iN(T));let G=d?V:F;i=s.iconsInText?iM(E.kind,C,j,A,r,B,U,N,I,b,a,f,D,z,G,s.getProjection()):iI(E.kind,C,j,A,r,B,U,N,!0,I,!0,a,f,D,z,G,s.getProjection());let q=o.glyphAtlasTexture?o.glyphAtlasTexture:null,H=S.LINEAR,$=0!==n.paint.get("text-halo-width").constantOr(1),W=r.terrain&&A&&l?e.a9.invert(e.a9.create(),P):ik;if(l&&s.text){let e=T.elevation,i=e?e.getAtTileOffsetFunc(a,T.center.lat,T.worldSize,s.getProjection()):null,n=tF(m,o.tileID.canonical,A,M,T,s.getProjection(),g);tj(s,m,r,!0,n,L,A,y,i,a)}return{program:v,buffers:s.text,uniformValues:i,atlasTexture:q,atlasTextureIcon:w,atlasInterpolation:H,atlasInterpolationIcon:x,isSDF:!0,hasHalo:$,tile:o,labelPlaneMatrixInv:W}},j=s.icon.segments.get().length,V=s.text.segments.get().length,G=j&&!l.onlyText?B():null,q=V&&!l.onlyIcons?U():null,H=n.paint.get("icon-opacity").constantOr(1),$=n.paint.get("text-opacity").constantOr(1);if(P&&s.canOverlap){L=!0;let r=H&&!l.onlyText?s.icon.segments.get():[],i=$&&!l.onlyIcons?s.text.segments.get():[];for(let i of r)N.push({segments:new e.aE([i]),sortKey:i.sortKey,state:G});for(let r of i)N.push({segments:new e.aE([r]),sortKey:r.sortKey,state:q})}else l.onlyText||N.push({segments:H?s.icon.segments:new e.aE([]),sortKey:0,state:G}),l.onlyIcons||N.push({segments:$?s.text.segments:new e.aE([]),sortKey:0,state:q})}for(let e of(L&&N.sort((e,r)=>e.sortKey-r.sortKey),N)){let i=e.state;if(i)if(r.terrain&&r.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:T.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:i.labelPlaneMatrixInv}),E.activeTexture.set(S.TEXTURE0),i.atlasTexture&&i.atlasTexture.bind(i.atlasInterpolation,S.CLAMP_TO_EDGE,!0),i.atlasTextureIcon&&(E.activeTexture.set(S.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,S.CLAMP_TO_EDGE,!0)),r.uploadCommonLightUniforms(r.context,i.program),i.hasHalo){let o=i.uniformValues;o.u_is_halo=1,iz(i.buffers,e.segments,n,r,i.program,O,a,s,o,2),o.u_is_halo=0}else{if(i.isSDF){let o=i.uniformValues;i.hasHalo&&(o.u_is_halo=1,iz(i.buffers,e.segments,n,r,i.program,O,a,s,o,1)),o.u_is_halo=0}iz(i.buffers,e.segments,n,r,i.program,O,a,s,i.uniformValues,1)}}}function iz(e,r,i,n,o,a,s,l,u,c){let h=[e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer,e.iconTransitioningVertexBuffer,e.globeExtVertexBuffer,e.zOffsetVertexBuffer];o.draw(n,n.context.gl.TRIANGLES,a,s,l,tc.disabled,u,i.id,e.layoutVertexBuffer,e.indexBuffer,r,i.paint,n.transform.zoom,e.programConfigurations.get(i.id),h,c)}function iB(e,r,i,n,o,a,s){let l,u,c,h,p,d=e.context.gl,f=i.paint.get("fill-pattern"),m=f&&f.constantOr(1);for(let g of(s?(u=m&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",l=d.LINES):(u=m?"fillPattern":"fill",l=d.TRIANGLES),n)){let n=r.getTile(g);if(m&&!n.patternsLoaded())continue;let _=n.getBucket(i);if(!_)continue;e.prepareDrawTile();let y=_.programConfigurations.get(i.id),v=e.isTileAffectedByFog(g),x=e.getOrCreateProgram(u,{config:y,overrideFog:v});m&&(e.context.activeTexture.set(d.TEXTURE0),n.imageAtlasTexture&&n.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),y.updatePaintBuffers());let b=f.constantOr(null);if(b&&n.imageAtlas){let e=n.imageAtlas.patternPositions[b.toString()];e&&y.setConstantPatternPositions(e)}let w=e.translatePosMatrix(g.projMatrix,n,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor")),E=i.paint.get("fill-emissive-strength");if(s){h=_.indexBuffer2,p=_.segments2;let r=e.terrain&&e.terrain.renderingToTexture?e.terrain.drapeBufferSize:[d.drawingBufferWidth,d.drawingBufferHeight];c="fillOutlinePattern"===u&&m?ip(w,E,e,n,r):ih(w,E,r)}else h=_.indexBuffer,p=_.segments,c=m?ic(w,E,e,n):iu(w,E);e.uploadCommonUniforms(e.context,x,g.toUnwrapped()),x.draw(e,l,o,e.stencilModeForClipping(g),a,tc.disabled,c,i.id,_.layoutVertexBuffer,h,p,i.paint,e.transform.zoom,y,void 0)}}function iU(r,i,n,o,a,s,l,u){let c;n.resetLayerRenderingStats(r);let h=r.context,p=h.gl,d=r.transform,f=n.paint.get("fill-extrusion-pattern"),m=f.constantOr(1),g=n.paint.get("fill-extrusion-opacity"),_=r.style.enable3dLights(),y=n.paint.get(_&&!m?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),v=[n.paint.get("fill-extrusion-ambient-occlusion-intensity"),y],x=n.layout.get("fill-extrusion-edge-radius"),b=x>0&&!n.paint.get("fill-extrusion-rounded-roof"),w=b?0:x,E="globe"===d.projection.name?e.cM():0,S="globe"===d.projection.name,T=S?e.W(d.zoom):0,I=[e.a8(d.center.lng),e.ah(d.center.lat)],M=n.paint.get("fill-extrusion-flood-light-color").toArray01().slice(0,3),C=n.paint.get("fill-extrusion-flood-light-intensity"),A=n.paint.get("fill-extrusion-vertical-scale"),P=r_(r,n.paint.get("fill-extrusion-cutoff-fade-range")),L=n.paint.get("fill-extrusion-emissive-strength"),O=[];S&&O.push("PROJECTION_GLOBE_VIEW"),v[0]>0&&O.push("FAUX_AO"),b&&O.push("ZERO_ROOF_RADIUS"),u&&O.push("HAS_CENTROID"),C>0&&O.push("FLOOD_LIGHT"),P.shouldRenderCutoff&&O.push("RENDER_CUTOFF");let D="shadow"===r.renderPass,R=r.shadowRenderer,k=D&&!!R;r.shadowRenderer&&(r.shadowRenderer.useNormalOffset=!0);let N=[0,0,0];if(R){let e=r.style.directionalLight,i=r.style.ambientLight;e&&i&&(N=rS(e,i)),c=O.concat(["SHADOWS_SINGLE_CASCADE"])}let F=k?"fillExtrusionDepth":m?"fillExtrusionPattern":"fillExtrusion",z=n.getLayerRenderingStats();for(let _ of o){let o,y=i.getTile(_),x=y.getBucket(n);if(!x||x.projection.name!==d.projection.name)continue;let b=!1;R&&(b=0===R.getMaxCascadeForTile(_.toUnwrapped()));let k=r.isTileAffectedByFog(_),B=x.programConfigurations.get(n.id),U=r.getOrCreateProgram(F,{config:B,defines:b?c:O,overrideFog:k});if(r.terrain&&r.terrain.setupElevationDraw(y,U,{useMeterToDem:!0}),!x.centroidVertexBuffer){let e=U.attributes.a_centroid_pos;void 0!==e&&p.vertexAttrib2f(e,0,0)}!D&&R&&R.setupShadows(y.tileID.toUnwrapped(),U,"vector-tile",y.tileID.overscaledZ
106),m&&(r.context.activeTexture.set(p.TEXTURE0),y.imageAtlasTexture&&y.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),B.updatePaintBuffers());let j=f.constantOr(null);if(j&&y.imageAtlas){let e=y.imageAtlas.patternPositions[j.toString()];e&&B.setConstantPatternPositions(e)}let V=n.paint.get("fill-extrusion-vertical-gradient");if(D&&R){if(function(r,i,n){let o=n.transform,a=n.shadowRenderer;if(!a)return!0;let s=r.toUnwrapped(),l=o.tileSize*a._cascades[n.currentShadowCascade].scale,u=i.maxHeight;if(o.elevation){let e=o.elevation.getMinMaxForTile(r);e&&(u+=e.max)}let c=[...a.shadowDirection];c[2]=-c[2];let h=a.computeSimplifiedTileShadowVolume(s,u,l,c);if(!h)return!1;let p=[iV,iG,iq,c,[c[0],0,c[2]],[0,c[1],c[2]]],d="globe"===o.projection.name,f=o.scaleZoom(l),m=e.bt.fromInvProjectionMatrix(o.invProjMatrix,o.worldSize,f,!d),g=a.getCurrentCascadeFrustum();return 0===m.intersectsPrecise(h.vertices,h.planes,p)||0===g.intersectsPrecise(h.vertices,h.planes,p)}(y.tileID,x,r))continue;o=is(R.calculateShadowPassMatrixFromTile(y.tileID.toUnwrapped()),w,A)}else{let e=r.translatePosMatrix(_.expandedProjMatrix,y,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),i=d.projection.createInversionMatrix(d,_.canonical);o=m?il(e,r,V,g,v,w,_,y,E,T,I,i,M,A):ia(e,r,V,g,v,w,_,E,T,I,i,M,A,C,N,L)}r.uploadCommonUniforms(h,U,_.toUnwrapped(),null,P);let G=x.segments;if("mercator"===d.projection.name&&!D&&!(G=x.getVisibleSegments(y.tileID,r.terrain,r.transform.getFrustum(0))).get().length)continue;if(z)if(D)for(let e of G.get())z.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(let e of G.get())z.numRenderedVerticesInTransparentPass+=e.primitiveLength;let q=[];(r.terrain||u)&&q.push(x.centroidVertexBuffer),S&&q.push(x.layoutVertexExtBuffer),U.draw(r,h.gl.TRIANGLES,a,s,l,tc.backCCW,o,n.id,x.layoutVertexBuffer,x.indexBuffer,G,n.paint,r.transform.zoom,B,q)}r.shadowRenderer&&(r.shadowRenderer.useNormalOffset=!1)}function ij(r,i,n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x){let b=r.context,w=b.gl,E=r.transform,S=r.transform.zoom,T=[],I=r_(r,n.paint.get("fill-extrusion-cutoff-fade-range"));"clear"===h?(T.push("CLEAR_SUBPASS"),x&&(T.push("CLEAR_FROM_TEXTURE"),b.activeTexture.set(w.TEXTURE0),x.bind(w.LINEAR,w.CLAMP_TO_EDGE))):"sdf"===h&&T.push("SDF_SUBPASS"),y&&T.push("HAS_CENTROID"),I.shouldRenderCutoff&&T.push("RENDER_CUTOFF");let M=n.layout.get("fill-extrusion-edge-radius"),C=(e,i,o,h,v)=>{let w=i.programConfigurations.get(n.id),E=r.isTileAffectedByFog(e),C=r.getOrCreateProgram("fillExtrusionGroundEffect",{config:w,defines:T,overrideFog:E}),A={u_matrix:h,u_opacity:p,u_ao_pass:+!!c,u_meter_to_tile:v,u_ao:[d,f*v],u_flood_light_intensity:m,u_flood_light_color:g,u_attenuation:_,u_edge_radius:S>=17?0:M*v,u_fb:0,u_fb_size:x?x.size[0]:0},P=[];y&&P.push(i.hiddenByLandmarkVertexBuffer),r.uploadCommonUniforms(b,C,e.toUnwrapped(),null,I),C.draw(r,b.gl.TRIANGLES,a,s,l,u,A,n.id,i.vertexBuffer,i.indexBuffer,o,n.paint,S,w,P)};for(let a of o){let o=i.getTile(a),s=o.getBucket(n);if(!s||s.projection.name!==E.projection.name||!s.groundEffect||s.groundEffect&&!s.groundEffect.hasData())continue;let l=s.groundEffect,u=1/s.tileToMeter;{let e=r.translatePosMatrix(a.projMatrix,o,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),i=l.getDefaultSegment();C(a,l,i,e,u)}if(v)for(let s=0;s<4;s++){let l,c,h=e.cN[s](a),p=i.getTile(h);if(!p)continue;let d=p.getBucket(n);if(!d||d.projection.name!==E.projection.name||!d.groundEffect||d.groundEffect&&!d.groundEffect.hasData())continue;let f=d.groundEffect;0===s?(l=[-e.Y,0,0],c=1):1===s?(l=[e.Y,0,0],c=0):2===s?(l=[0,-e.Y,0],c=3):(l=[0,e.Y,0],c=2);let m=f.regionSegments[c];if(!m)continue;let g=new Float32Array(16);e.a9.translate(g,a.projMatrix,l),C(a,f,m,r.translatePosMatrix(g,o,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),u)}}}let iV=[1,0,0],iG=[0,1,0],iq=[0,0,1];function iH(r){return[r[0]*e.cS,r[1]*e.cS,r[2]*e.cS,0]}function i$(r,i,n,o,a,s,l,u,c){let h,p,d,f,m,g,_,y,v=o.getSource(),x=n.globeSharedBuffers;if(!x||(i&&(h=o.getTile(i)),v instanceof e.as?(p=v.texture,d=e.co(0,0,n.transform)):h&&i&&(p=h.texture,d=e.co(i.canonical.z,i.canonical.x,n.transform)),!p||!d))return;r||(d=e.a9.scale(e.a9.create(),d,[1,-1,1]));let b=n.context,w=b.gl,E="nearest"===a.paint.get("raster-resampling")?w.NEAREST:w.LINEAR,S=n.colorModeForDrapableLayerRenderPass(s),T=l.defines;T.push("GLOBE_POLES");let I=new ts(w.LEQUAL,ts.ReadWrite,n.depthRangeFor3D),M=Float32Array.from(n.transform.expandedFarZProjMatrix),C=Float32Array.from(e.aW(e.cn(new e.bv(0,0,0))));n.terrain&&n.terrain.prepareDrawTile(),b.activeTexture.set(w.TEXTURE0),p.bind(E,w.CLAMP_TO_EDGE),b.activeTexture.set(w.TEXTURE1),p.bind(E,w.CLAMP_TO_EDGE),p.useMipmap&&b.extTextureFilterAnisotropic&&n.transform.pitch>20&&w.texParameterf(w.TEXTURE_2D,b.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b.extTextureFilterAnisotropicMax);let[A,P,L,O]=i?x.getPoleBuffers(i.canonical.z,!1):x.getPoleBuffers(0,!0),D=a.paint.get("raster-elevation");r?(f=A,n.renderDefaultNorthPole=0!==D):(f=P,n.renderDefaultSouthPole=0!==D);let R=iH(l.mix),k=(m=d,g=e.W(n.transform.zoom),_=l.offset,y=l.range,ix(M,C,m,new Float32Array(16),new Float32Array(9),[0,0],g,[0,0],[0,0,0,0],1,{opacity:1,mix:0},a,[0,0],D,2,R,_,y,1,0,s)),N=n.getOrCreateProgram("raster",{defines:T});n.uploadCommonUniforms(b,N,null),N.draw(n,w.TRIANGLES,I,c,S,u,k,a.id,f,L,O)}let iW=new e.aA(1,0,0,1),iY=new e.aA(0,1,0,1),iZ=new e.aA(0,0,1,1),iX=new e.aA(1,0,1,1),iK=new e.aA(0,1,1,1);
106function iQ(r,i,n,o,a,s,l){let u=r.context,c=r.transform,h=u.gl,p="globe"===c.projection.name,d=e.a9.clone(n.projMatrix);if(p&&e.W(c.zoom)>0){let r=e.aV(n.canonical,c),i=e.cU(r);d=e.a9.multiply(new Float32Array(16),c.globeMatrix,i),e.a9.multiply(d,c.projMatrix,d)}let f=e.a9.create();f[12]+=2*a/(e.f.devicePixelRatio*c.width),f[13]+=2*s/(e.f.devicePixelRatio*c.height),e.a9.multiply(d,f,d);let m=r.getOrCreateProgram("debug",{defines:p?["PROJECTION_GLOBE_VIEW"]:[]}),g=i.getTileByID(n.key);r.terrain&&r.terrain.setupElevationDraw(g,m);let _=ts.disabled,y=tl.disabled,v=r.colorModeForRenderPass(),x="$debug";u.activeTexture.set(h.TEXTURE0),r.emptyTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),p?g._makeGlobeTileDebugBuffers(r.context,c):g._makeDebugTileBoundsBuffers(r.context,c.projection);let b=g._tileDebugBuffer||r.debugBuffer,w=g._tileDebugIndexBuffer||r.debugIndexBuffer,E=g._tileDebugSegments||r.debugSegments;if(m.draw(r,h.LINE_STRIP,_,y,v,tc.disabled,im(d,o),x,b,w,E,null,null,null,[g._globeTileDebugBorderBuffer]),l){var S;let e,i,o,a=g.latestRawTileData,s=Math.floor((a&&a.byteLength||0)/1024),l=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(l+=` => ${n.overscaledZ}`),l+=` ${g.state}`,l+=` ${s}kb`,S=l,r.initDebugOverlayCanvas(),e=r.debugOverlayCanvas,i=r.context.gl,(o=r.debugOverlayCanvas.getContext("2d")).clearRect(0,0,e.width,e.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(S,5,5),o.strokeText(S,5,5),r.debugOverlayTexture.update(e),r.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}let T=512/Math.min(i.getTile(n).tileSize,512)*(n.overscaledZ/c.zoom)*.5,I=g._tileDebugTextBuffer||r.debugBuffer,M=g._tileDebugTextIndexBuffer||r.quadTriangleIndexBuffer,C=g._tileDebugTextSegments||r.debugSegments;m.draw(r,h.TRIANGLES,_,y,tu.alphaBlended,tc.disabled,im(d,e.aA.transparent,T),x,I,M,C,null,null,null,[g._globeTileDebugTextBuffer])}function iJ(e,r,i,n){i1(e,0,r+i/2,e.transform.width,i,n)}function i0(e,r,i,n){i1(e,r-i/2,0,i,e.transform.height,n)}function i1(r,i,n,o,a,s){let l=r.context,u=l.gl;u.enable(u.SCISSOR_TEST),u.scissor(i*e.f.devicePixelRatio,n*e.f.devicePixelRatio,o*e.f.devicePixelRatio,a*e.f.devicePixelRatio),l.clear({color:s}),u.disable(u.SCISSOR_TEST)}let{members:i2}=e.aB([{name:"a_pos_3f",components:3,type:"Float32"}]);function i3(e,r,i,n){e.emplaceBack(r,i,n)}class i5{constructor(r){this.vertexArray=new e.cV,this.indices=new e.az,i3(this.vertexArray,-1,-1,1),i3(this.vertexArray,1,-1,1),i3(this.vertexArray,-1,1,1),i3(this.vertexArray,1,1,1),i3(this.vertexArray,-1,-1,-1),i3(this.vertexArray,1,-1,-1),i3(this.vertexArray,-1,1,-1),i3(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=r.createVertexBuffer(this.vertexArray,i2),this.indexBuffer=r.createIndexBuffer(this.indices),this.segment=e.aE.simpleSegment(0,0,36,12)}}function i4(r,i,n,o,a,s){let l,u=r.context.gl,c=i.paint.get("sky-atmosphere-color"),h=i.paint.get("sky-atmosphere-halo-color"),p=i.paint.get("sky-atmosphere-sun-intensity"),d=(l=e.ct.fromMat4(e.ct.create(),o),{u_matrix_3f:l,u_sun_direction:a,u_sun_intensity:p,u_color_tint_r:[c.r,c.g,c.b,c.a],u_color_tint_m:[h.r,h.g,h.b,h.a],u_luminance:5e-5});u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_CUBE_MAP_POSITIVE_X+s,i.skyboxTexture,0),n.draw(r,u.TRIANGLES,ts.disabled,tl.disabled,tu.unblended,tc.frontCW,d,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}let i6=e.aB([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class i8{constructor(r){const i=new e.cW;i.emplaceBack(-1,1,1,0,0),i.emplaceBack(1,1,1,1,0),i.emplaceBack(1,-1,1,1,1),i.emplaceBack(-1,-1,1,0,1);const n=new e.az;n.emplaceBack(0,1,2),n.emplaceBack(2,3,0),this.vertexBuffer=r.createVertexBuffer(i,i6.members),this.indexBuffer=r.createIndexBuffer(n),this.segments=e.aE.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}let i9=e.aB([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class i7{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class ne{constructor(r){this.colorModeAlphaBlendedWriteRGB=new tu([1,771,1,771],e.aA.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new tu([1,0,1,0],e.aA.transparent,[!1,!1,!1,!0]),this.params=new i7,this.updateNeeded=!0,r.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},()=>{this.updateNeeded=!0}),r.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),r.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0}),r.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0})}update(r){let i=r.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new i8(i);let r=this.params.sizeRange,n=this.params.intensityRange,o=function(r){let i=e.aC(30),n=[];for(let o=0;o<r;++o){let r=2*Math.PI*i(),o=Math.acos(1-2*i())-.5*Math.PI;n.push(e.Q.fromValues(Math.cos(o)*Math.cos(r),Math.cos(o)*Math.sin(r),Math.sin(o)))}return n}(this.params.starsCount),a=e.aC(300),s=new e.cX,l=new e.az,u=0;for(let i=0;i<o.length;++i){let c=e.Q.scale([],o[i],200),h=Math.max(0,1+.01*r*(a()-.5)),p=Math.max(0,1+.01*n*(a()-.5));s.emplaceBack(c[0],c[1],c[2],-1,-1,h,p),s.emplaceBack(c[0],c[1],c[2],1,-1,h,p),s.emplaceBack(c[0],c[1],c[2],1,1,h,p),s.emplaceBack(c[0],c[1],c[2],-1,1,h,p),l.emplaceBack(u+0,u+1,u+2),l.emplaceBack(u+0,u+2,u+3),u+=4}this.starsVx=i.createVertexBuffer(s,i9.members),this.starsIdx=i.createIndexBuffer(l),this.starsSegments=e.aE.simpleSegment(0,0,s.length,l.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy()}drawAtmosphereGlow(r,i){let n=r.context,o=n.gl,a=r.transform,s=new ts(o.LEQUAL,ts.ReadOnly,[0,1]),l=e.W(a.zoom),u=i.properties.get("color").toArray01(),c=i.properties.get("high-color").toArray01(),h=i.properties.get("space-color").toArray01PremultipliedAlpha(),p=e.cY(i.properties.get("horizon-blend"),0,1,5e-4,.25),d=e.ci(r,n,a)&&5e-4===p?a.worldSize/(2*Math.PI*1.025)-1:a.globeRadius,f=r.frameCounter/1e3%1,m=e.Q.length(a.globeCenterInViewSpace),g=Math.acos(Math.sqrt(Math.pow(m,2)-Math.pow(d,2))/m),_=e=>{let i,d,m,_,y="globe"===a.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];e&&y.push("ALPHA_PASS");let v=r.getOrCreateProgram("globeAtmosphere",{defines:y}),x=(i=a.frustumCorners.TL,d=a.frustumCorners.TR,m=a.frustumCorners.BR,_=a.frustumCorners.BL,{u_frustum_tl:i,u_frustum_tr:d,u_frustum_br:m,u_frustum_bl:_,u_horizon:a.frustumCorners.horizon,u_transition:l,u_fadeout_range:p,u_color:u,u_high_color:c,u_space_color:h,u_temporal_offset:f,u_horizon_angle:g});r.uploadCommonUniforms(n,v);let b=this.atmosphereBuffer;b&&v.draw(r,o.TRIANGLES,s,tl.disabled,e?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,tc.backCW,x,e?"atmosphere_glow_alpha":"atmosphere_glow",b.vertexBuffer,b.indexBuffer,b.segments)};_(!1),_(!0)}drawStars(r,i){let n=e.ad(i.properties.get("star-intensity"),0,1);if(0===n)return;let o=r.context,a=o.gl,s=r.transform,l=r.getOrCreateProgram("stars"),u=e.bl.identity([]);e.bl.rotateX(u,u,-s._pitch),e.bl.rotateZ(u,u,-s.angle),e.bl.rotateX(u,u,e.bm(s._center.lat)),e.bl.rotateY(u,u,-e.bm(s._center.lng));let c=e.a9.fromQuat(new Float32Array(16),u),h=e.a9.multiply([],s.starsProjMatrix,c),p=e.ct.fromMat4([],c),d=e.ct.invert([],p),f=[0,1,0];e.Q.transformMat3(f,f,d),e.Q.scale(f,f,this.params.sizeMultiplier);let m=[1,0,0];e.Q.transformMat3(m,m,d),e.Q.scale(m,m,this.params.sizeMultiplier);let g={u_matrix:Float32Array.from(h),u_up:f,u_right:m,u_intensity_multiplier:n};r.uploadCommonUniforms(o,l),this.starsVx&&this.starsIdx&&l.draw(r,a.TRIANGLES,ts.disabled,tl.disabled,this.colorModeAlphaBlendedWriteRGB,tc.disabled,g,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function nt(r,i){let n=[...r],o=i.cameraWorldSizeForFog/i.worldSize,a=e.a9.identity([]);return e.a9.scale(a,a,[o,o,1]),e.a9.multiply(n,a,n),e.a9.multiply(n,i.worldToFogMatrix,n),n}function nr(e,r,i,n){let o=i.material,a=n.context,{baseColorTexture:s,metallicRoughnessTexture:l}=o.pbrMetallicRoughness,{normalTexture:u,occlusionTexture:c,emissionTexture:h}=o;function p(r,i,n){if(r&&(e.push(i),a.activeTexture.set(a.gl.TEXTURE0+n),r.gfxTexture)){let{minFilter:e,magFilter:i,wrapS:n,wrapT:o}=r.sampler;r.gfxTexture.bindExtraParam(e,i,n,o)}}p(s,"HAS_TEXTURE_u_baseColorTexture",5),p(l,"HAS_TEXTURE_u_metallicRoughnessTexture",6),p(u,"HAS_TEXTURE_u_normalTexture",7),p(c,"HAS_TEXTURE_u_occlusionTexture",8),p(h,"HAS_TEXTURE_u_emissionTexture",9),i.texcoordBuffer&&(e.push("HAS_ATTRIBUTE_a_uv_2f"),r.push(i.texcoordBuffer)),i.colorBuffer&&(e.push(12===i.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),r.push(i.colorBuffer)),i.normalBuffer&&(e.push("HAS_ATTRIBUTE_a_normal_3f"),r.push(i.normalBuffer)),i.pbrBuffer&&(e.push("HAS_ATTRIBUTE_a_pbr"),e.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),r.push(i.pbrBuffer)),"OPAQUE"!==o.alphaMode&&"MASK"!==o.alphaMode||e.push("UNPREMULT_TEXTURE_IN_SHADER"),o.defined||e.push("DIFFUSE_SHADED"),e.push("USE_STANDARD_DERIVATIVES")}function ni(r,i,n,o,a,s){let l,u=n.paint.get("model-opacity"),c=i.context,h=new ts(i.context.gl.LEQUAL,ts.ReadWrite,i.depthRangeFor3D),p=i.transform,d=r.mesh,f=d.material,m=f.pbrMetallicRoughness,g=i.style.fog;l="pixels"===i.transform.projection.zAxisUnit?[...r.nodeModelMatrix]:e.a9.multiply([],o.zScaleMatrix,r.nodeModelMatrix),e.a9.multiply(l,o.negCameraPosMatrix,l);let _=e.a9.invert([],l);e.a9.transpose(_,_);let y=n.paint.get("model-emissive-strength").constantOr(0),v=iL(new Float32Array(r.worldViewProjection),new Float32Array(l),new Float32Array(_),null,i,u,m.baseColorFactor,f.emissiveFactor,m.metallicFactor,m.roughnessFactor,f,y,n),x={defines:[]},b=[];nr(x.defines,b,d,i);let w=i.shadowRenderer;w&&(w.useNormalOffset=!1);let E=null;if(g){let e=nt(r.nodeModelMatrix,i.transform);if(E=new Float32Array(e),"globe"!==p.projection.name){let r=d.aabb.min,i=d.aabb.max,[n,o]=g.getOpacityForBounds(e,r[0],r[1],i[0],i[1]);x.overrideFog=n>=.05||o>=.05}}let S=r_(i,n.paint.get("model-cutoff-fade-range"));S.shouldRenderCutoff&&x.defines.push("RENDER_CUTOFF");let T=i.getOrCreateProgram("model",x);i.uploadCommonUniforms(c,T,null,E,S),"shadow"!==i.renderPass&&w&&w.setupShadowsFromMatr
106ix(r.nodeModelMatrix,T),T.draw(i,c.gl.TRIANGLES,h,a,s,d.material.doubleSided?tc.disabled:tc.backCCW,v,n.id,d.vertexBuffer,d.indexBuffer,d.segments,n.paint,i.transform.zoom,void 0,b)}function nn(e,r,i,n){let o=i.shadowRenderer;if(!o)return;let a=o.getShadowPassDepthMode(),s=o.getShadowPassColorMode(),l=iO(o.calculateShadowPassMatrixFromMatrix(r));i.getOrCreateProgram("modelDepth",{defines:i._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(i,i.context.gl.TRIANGLES,a,tl.disabled,s,tc.backCCW,l,n.id,e.vertexBuffer,e.indexBuffer,e.segments,n.paint,i.transform.zoom,void 0,void 0)}let no={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new e.bV([0,0,0],[e.Y,e.Y,0])},na=[1,-1,1];class ns{}class nl{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(r,i,n){{let e=this._storage.get(i.id);if(e)return e.lastUsedFrameIdx=r,e.buf}let o=n.gl,a=o.getBufferParameter(o.ELEMENT_ARRAY_BUFFER,o.BUFFER_SIZE),s=new ArrayBuffer(a),l=new Int16Array(s);o.getBufferSubData(o.ELEMENT_ARRAY_BUFFER,0,new Int16Array(s));let u=new e.d2;for(let e=0;e<a/2;e+=3){let r=l[e],i=l[e+1],n=l[e+2];u.emplaceBack(r,i),u.emplaceBack(i,n),u.emplaceBack(n,r)}let c=n.bindVertexArrayOES.current,h=new ns;return h.buf=new eP(n,u),h.lastUsedFrameIdx=r,this._storage.set(i.id,h),n.bindVertexArrayOES.set(c),h.buf}update(e){for(let[r,i]of this._storage)e-i.lastUsedFrameIdx>30&&(i.buf.destroy(),this._storage.delete(r))}destroy(){for(let[e,r]of this._storage)r.buf.destroy(),this._storage.delete(e)}}let nu={symbol:function(r,i,n,o,a){if("translucent"!==r.renderPass)return;let s=tl.disabled,l=r.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(r,i,n,o,a,s,l){let u=i.transform,c="map"===a,h="map"===s;for(let i of r){let r=o.getTile(i),a=r.getBucket(n);if(!a||!a.text||!a.text.segments.get().length)continue;let s=e.b8(a.textSizeData,u.zoom),p=tQ(i,a.getProjection(),u),d=u.calculatePixelsToTileUnitsMatrix(r),f=tN(p,r.tileID.canonical,h,c,u,a.getProjection(),d),m=a.hasIconTextFit()&&a.hasIconData();if(s){let n=Math.pow(2,u.zoom-r.tileID.overscaledZ);!function(r,i,n,o,a,s,l,u,c,h,p){let d=r.text.placedSymbolArray,f=r.text.dynamicLayoutVertexArray,m=r.icon.dynamicLayoutVertexArray,g={},_=r.getProjection(),y=tQ(u,_,s),v=s.elevation,x=_.upVectorScale(u.canonical,s.center.lat,s.worldSize).metersToTile;f.clear();for(let m=0;m<d.length;m++){let b=d.get(m),{tileAnchorX:w,tileAnchorY:E,numGlyphs:S}=b,T=b.hidden||!b.crossTileID||r.allowVerticalPlacement&&!b.placedOrientation?null:o[b.crossTileID];if(T){let o=0,d=0,m=0;if(v){let e=v?v.getAtTileOffset(u,w,E):0,[r,i,n]=_.upVector(u.canonical,w,E);o=e*r*x,d=e*i*x,m=e*n*x}let[I,M,C,A]=tB(b.projectedAnchorX+o,b.projectedAnchorY+d,b.projectedAnchorZ+m,n?y:l),P=tU(s.getCameraToCenterDistance(_),A),L=a.evaluateSizeForFeature(r.textSizeData,h,b)*P/e.bf;n&&(L*=r.tilePixelRatio/c);let O=function({width:r,height:i,anchor:n,textOffset:o,textScale:a},s){let{horizontalAlign:l,verticalAlign:u}=e.bi(n),c=e.bh(n,o);return new e.P((-(l-.5)*r/a+c[0])*s,(-(u-.5)*i/a+c[1])*s)}(T,L);n?({x:I,y:M,z:C}=_.projectTilePoint(w+O.x,E+O.y,u.canonical),[I,M,C]=tB(I+o,M+d,C+m,l)):(i&&O._rotate(-s.angle),I+=O.x,M+=O.y,C=0);let D=r.allowVerticalPlacement&&b.placedOrientation===e.b9.vertical?Math.PI/2:0;for(let r=0;r<S;r++)e.bc(f,I,M,C,D);p&&b.associatedIconIndex>=0&&(g[b.associatedIconIndex]={x:I,y:M,z:C,angle:D})}else tY(S,f)}if(p){m.clear();let i=r.icon.placedSymbolArray;for(let r=0;r<i.length;r++){let n=i.get(r),{numGlyphs:o}=n,a=g[r];if(n.hidden||!a)tY(o,m);else{let{x:r,y:i,z:n,angle:s}=a;for(let a=0;a<o;a++)e.bc(m,r,i,n,s)}}r.icon.dynamicLayoutVertexBuffer.updateData(m)}r.text.dynamicLayoutVertexBuffer.updateData(f)}(a,c,h,l,e.cE,u,f,i,n,s,m)}}}(o,r,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a);let u=0!==n.paint.get("icon-opacity").constantOr(1),c=0!==n.paint.get("text-opacity").constantOr(1);void 0!==n.layout.get("symbol-sort-key").constantOr(1)&&(u||c)?iF(r,i,n,o,s,l):(u&&iF(r,i,n,o,s,l,{onlyIcons:!0}),c&&iF(r,i,n,o,s,l,{onlyText:!0})),i.map.showCollisionBoxes&&(iR(r,i,n,o,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),iR(r,i,n,o,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(r,i,n,o){if("translucent"!==r.renderPass)return;let a=n.paint.get("circle-opacity"),s=n.paint.get("circle-stroke-width"),l=n.paint.get("circle-stroke-opacity"),u=void 0!==n.layout.get("
106circle-sort-key").constantOr(1),c=n.paint.get("circle-emissive-strength");if(0===a.constantOr(1)&&(0===s.constantOr(1)||0===l.constantOr(1)))return;let h=r.context,p=h.gl,d=r.transform,f=r.depthModeForSublayer(0,ts.ReadOnly),m=tl.disabled,g=r.colorModeForDrapableLayerRenderPass(c),_="globe"===d.projection.name,y=[e.a8(d.center.lng),e.ah(d.center.lat)],v=[];for(let a=0;a<o.length;a++){let s=o[a],l=i.getTile(s),c=l.getBucket(n);if(!c||c.projection.name!==d.projection.name)continue;let h=c.programConfigurations.get(n.id),p=e.cF(n),f=r.isTileAffectedByFog(s);_&&p.push("PROJECTION_GLOBE_VIEW");let m=r.getOrCreateProgram("circle",{config:h,defines:p,overrideFog:f}),g=c.layoutVertexBuffer,x=c.globeExtVertexBuffer,b=c.indexBuffer,w=d.projection.createInversionMatrix(d,s.canonical),E={programConfiguration:h,program:m,layoutVertexBuffer:g,globeExtVertexBuffer:x,indexBuffer:b,uniformValues:e.cG(r,s,l,w,y,n),tile:l};if(u)for(let r of c.segments.get())v.push({segments:new e.aE([r]),sortKey:r.sortKey,state:E});else v.push({segments:c.segments,sortKey:0,state:E})}u&&v.sort((e,r)=>e.sortKey-r.sortKey);let x={useDepthForOcclusion:d.depthOcclusionForSymbolsAndCircles};for(let e of v){let{programConfiguration:i,program:o,layoutVertexBuffer:a,globeExtVertexBuffer:s,indexBuffer:l,uniformValues:u,tile:c}=e.state,_=e.segments;r.terrain&&r.terrain.setupElevationDraw(c,o,x),r.uploadCommonUniforms(h,o,c.tileID.toUnwrapped()),o.draw(r,p.TRIANGLES,f,m,g,tc.disabled,u,n.id,a,l,_,n.paint,d.zoom,i,[s])}},heatmap:function(r,i,n,o){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===r.renderPass){let a=r.context,s=a.gl,l=tl.disabled,u=new tu([s.ONE,s.ONE,s.ONE,s.ONE],e.aA.transparent,[!0,!0,!0,!0]);!function(e,r,i,n){let o=e.gl,a=r.width*n,s=r.height*n;e.activeTexture.set(o.TEXTURE1),e.viewport.set([0,0,a,s]);let l=i.heatmapFbo;if(!l||l&&(l.width!==a||l.height!==s)){var u;let r;l&&l.destroy();let n=o.createTexture();o.bindTexture(o.TEXTURE_2D,n),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),l=i.heatmapFbo=e.createFramebuffer(a,s,!0,null),u=l,(r=e.gl).texImage2D(r.TEXTURE_2D,0,e.extRenderToTextureHalfFloat?r.RGBA16F:r.RGBA,a,s,0,r.RGBA,e.extRenderToTextureHalfFloat?r.HALF_FLOAT:r.UNSIGNED_BYTE,null),u.colorAttachment.set(n)}else o.bindTexture(o.TEXTURE_2D,l.colorAttachment.get()),e.bindFramebuffer.set(l.framebuffer)}(a,r,n,"globe"===r.transform.projection.name?.5:.25),a.clear({color:e.aA.transparent});let c=r.transform,h="globe"===c.projection.name,p=h?["PROJECTION_GLOBE_VIEW"]:[],d=h?tc.frontCCW:tc.disabled,f=[e.a8(c.center.lng),e.ah(c.center.lat)];for(let e=0;e<o.length;e++){let m=o[e];if(i.hasRenderableParent(m))continue;let g=i.getTile(m),_=g.getBucket(n);if(!_||_.projection.name!==c.projection.name)continue;let y=r.isTileAffectedByFog(m),v=_.programConfigurations.get(n.id),x=r.getOrCreateProgram("heatmap",{config:v,defines:p,overrideFog:y}),{zoom:b}=r.transform;r.terrain&&r.terrain.setupElevationDraw(g,x),r.uploadCommonUniforms(a,x,m.toUnwrapped());let w=c.projection.createInversionMatrix(c,m.canonical);x.draw(r,s.TRIANGLES,ts.disabled,l,u,d,i_(r,m,g,w,f,b,n.paint.get("heatmap-intensity")),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,n.paint,r.transform.zoom,v,h?[_.globeExtVertexBuffer]:null)}a.viewport.set([0,0,r.width,r.height])}else"translucent"===r.renderPass&&(r.context.setColorMode(r.colorModeForRenderPass()),function(r,i){let n=r.context,o=n.gl,a=i.heatmapFbo;if(!a)return;n.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(o.TEXTURE1);let s=i.colorRampTexture;s||(s=i.colorRampTexture=new e.T(n,i.colorRamp,o.RGBA)),s.bind(o.LINEAR,o.CLAMP_TO_EDGE),r.getOrCreateProgram("heatmapTexture").draw(r,o.TRIANGLES,ts.disabled,tl.disabled,r.colorModeForRenderPass(),tc.disabled,{u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")},i.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments,i.paint,r.transform.zoom)}(r,n))},line:function(r,i,n,o){if("translucent"!==r.renderPass)return;let a=n.paint.get("line-opacity"),s=n.paint.get("line-width");if(0===a.constantOr(1)||0===s.constantOr(1))return;let l=n.paint.get("line-emissive-strength"),u=r.depthModeForSublayer(0,ts.ReadOnly),c=r.colorModeForDrapableLayerRenderPass(l),h=r.terrain&&r.terrain.renderingToTexture?1:e.f.devicePixelRatio,p=n.paint.get("line-dasharray"),d=p.constantOr(1),f=n.layout.get("line-cap"),m=n.paint.get("line-pattern"),g=m.constantOr(1),_=1!==n.paint.get("line-opacity").constantOr(1),y=!g&&_,v=n.paint.get("line-gradient"),x=g?"linePattern":"line",b=r.context,w=b.gl,E=e.cH(n);for(let a of(r.terrain&&r.terrain.clipOrMaskOverlapStencilType()&&(y=!1),o)){let o=i.getTile(a);if(g&&!o.patternsLoaded())continue;let s=o.getBucket(n);if(!s)continue;r.prepareDrawTile();let l=s.programConfigurations.get(n.id),_=r.isTileAffectedByFog(a),S=r.getOrCreateProgram(x,{config:l,defines:E,overrideFog:_}),T=m.constantOr(null);if(T&&o.imageAtlas){let e=o.imageAtlas.patternPositions[T.toString()];e&&l.setConstantPatternPositions(e)}let I=p.constantOr(null),M=f.constantOr(null);if(!g&&I&&M&&o.lineAtlas){let e=o.lineAtlas.getDash(I,M);e&&l.setConstantPatternPositions(e)}let[C,A]=n.paint.get("line-trim-offset");("round"===M||"square"===M)&&C!==A&&(0===C&&(C-=1),1===A&&(A+=1));let P=r.terrain?a.projMatrix:null,L=g?e.cI(r,o,n,P,h,[C,A]):e.cJ(r,o,n,P,s.lineClipsArray.length,h,[C,A]);if(v){let o=s.gradients[n.id],l=o.texture;if(n.gradientVersion!==o.version){let u=256;if(n.stepInterpolant){let n=i.getSource().maxzoom,o=a.canonical.z===n?Math.ceil(1<<r.transform.maxZoom-a.canonical.z):1;u=e.ad(e.cK(s.maxLineLength/e.Y*1024*o),256,b.maxTextureSize)}o.gradient=e.cL({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:u,image:o.gradient||void 0,clips:s.lineClipsArray}),o.texture?o.texture.update(o.gradient):o.texture=new e.T(b,o.gradient,w.RGBA),o.version=n.gradientVersion,l=o.texture}b.activeTexture.set(w.TEXTURE1),l.bind(n.stepInterpolant?w.NEAREST:w.LINEAR,w.CLAMP_TO_EDGE)}d&&(b.activeTexture.set(w.TEXTURE0),o.lineAtlasTexture&&o.lineAtlasTexture.bind(w.LINEAR,w.REPEAT),l.updatePaintBuffers()),g&&(b.activeTexture.set(w.TEXTURE0),o.imageAtlasTexture&&o.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),l.updatePaintBuffers()),r.uploadCommonUniforms(b,S,a.toUnwrapped());let O=e=>{S.draw(r,w.TRIANGLES,u,e,c,tc.disabled,L,n.id,s.layoutVertexBuffer,s.indexBuffer,s.segments,n.paint,r.transform.zoom,l,[s.layoutVertexBuffer2,s.patternVertexBuffer])};if(y){let e=r.stencilModeForClipping(a).ref;0===e&&r.terrain&&b.clear({stencil:0});let i={func:w.EQUAL,mask:255};
106L.u_alpha_discard_threshold=.8,O(new tl(i,e,255,w.KEEP,w.KEEP,w.INVERT)),L.u_alpha_discard_threshold=0,O(new tl(i,e,255,w.KEEP,w.KEEP,w.KEEP))}else O(r.stencilModeForClipping(a))}y&&(r.resetStencilClippingMasks(),r.terrain&&b.clear({stencil:0}))},fill:function(r,i,n,o){let a=n.paint.get("fill-color"),s=n.paint.get("fill-opacity");if(0===s.constantOr(1))return;let l=n.paint.get("fill-emissive-strength"),u=r.colorModeForDrapableLayerRenderPass(l),c=n.paint.get("fill-pattern"),h=r.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===a.constantOr(e.aA.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(r.renderPass===h){let e=r.depthModeForSublayer(1,"opaque"===r.renderPass?ts.ReadWrite:ts.ReadOnly);iB(r,i,n,o,e,u,!1)}if("translucent"===r.renderPass&&n.paint.get("fill-antialias")){let e=r.depthModeForSublayer(2*!!n.getPaintProperty("fill-outline-color"),ts.ReadOnly);iB(r,i,n,o,e,u,!0)}},"fill-extrusion":function(r,i,n,o){let a=n.paint.get("fill-extrusion-opacity"),s=r.context,l=s.gl,u=r.terrain,c=u&&u.renderingToTexture;if(0===a)return;let h=r.conflationActive&&r.layerUsedInConflation(n,i.getSource());if(h&&function(e,r,i,n){for(let o of n){let n=r.getTile(o).getBucket(i);n&&(n.updateReplacement(o,e.replacementSource),n.uploadCentroid(e.context))}}(r,i,n,o),u||h)for(let a of o){let o=i.getTile(a).getBucket(n);o&&function(r,i,n,o,a,s,l){0===o.centroidVertexArray.length&&o.createCentroidsBuffer();let u=s?s.findDEMTileFor(n):null;if(!(u&&u.dem||l))return;let c=r=>new e.P(Math.ceil((r+e.cQ)*e.cR),0),h=e=>{let r=i.getSource().minzoom,n=e=>{let r=i.getTileByID(e);if(r&&r.hasData())return r.getBucket(a)};
106for(let i of[0,-1,1]){if(e.overscaledZ+i<r)continue;let o=n(e.calculateScaledKey(e.overscaledZ+i));if(o)return o}},p=[0,0,0],d=(r,i)=>(p[0]=Math.min(r.min.y,i.min.y),p[1]=Math.max(r.max.y,i.max.y),p[2]=e.Y-i.min.x>r.max.x?i.min.x-e.Y:r.max.x,p),f=(r,i)=>(p[0]=Math.min(r.min.x,i.min.x),p[1]=Math.max(r.max.x,i.max.x),p[2]=e.Y-i.min.y>r.max.y?i.min.y-e.Y:r.max.y,p),m=[(e,r)=>d(e,r),(e,r)=>d(r,e),(e,r)=>f(e,r),(e,r)=>f(r,e)],g=(r,i,o,a,l,c,h)=>{if(!s)return 0;let p=[[c?o:r,c?r:o,0],[c?o:i,c?i:o,0]],d=h<0?e.Y+h:h,f=[c?d:(r+i)/2,c?(r+i)/2:d,0];return 0===o&&h<0||0!==o&&h>0?s.getForTilePoints(l,[f],!0,a):p.push(f),s.getForTilePoints(n,p,!0,u),Math.max(p[0][2],p[1][2],f[2])/s.exaggeration()};for(let r=0;r<4;r++){let i=o.borderFeatureIndices[r];if(0===i.length)continue;let a=e.cN[r](n),u=h(a);if(!(u&&u instanceof e.cO)||o.borderDoneWithNeighborZ[r]===u.canonical.z)continue;0===u.centroidVertexArray.length&&u.createCentroidsBuffer();let p=s?s.findDEMTileFor(a):null;if(!(p&&p.dem||l))continue;let d=(r<2?1:5)-r,f=u.borderDoneWithNeighborZ[d]!==o.canonical.z,_=u.borderFeatureIndices[d],y=0;if(o.canonical.z!==u.canonical.z){for(let e of i)o.showCentroid(o.featuresOnBorder[e]);if(f)for(let e of _)u.showCentroid(u.featuresOnBorder[e]);o.borderDoneWithNeighborZ[r]=u.canonical.z,u.borderDoneWithNeighborZ[d]=o.canonical.z}for(let n of i){let i,s=o.featuresOnBorder[n],h=o.centroidData[s.centroidDataIndex],f=s.borders[r];for(;y<_.length;){let e=(i=u.featuresOnBorder[_[y]]).borders[d];if(e[1]>f[0]+3||e[0]>f[0]-3)break;u.showCentroid(i),y++}if(i&&y<_.length){let n=y,v=0;for(;!(i.borders[d][0]>f[1]-3)&&(v++,++y!==_.length);)i=u.featuresOnBorder[_[y]];if(i=u.featuresOnBorder[_[n]],v>1){let e=i.borders[d];3>Math.abs(f[0]-e[0])&&3>Math.abs(f[1]-e[1])&&(v=1,y=n+1)}else if(0===v){o.showCentroid(s);continue}let x=u.centroidData[i.centroidDataIndex];l&&1===v&&((h.flags|x.flags)&e.cP?(h.flags|=e.cP,x.flags|=e.cP):(h.flags&=~e.cP,x.flags&=~e.cP));let b=s.intersectsCount()>1||i.intersectsCount()>1;if(v>1)y=n,h.centroidXY=x.centroidXY=new e.P(0,0);else if(p&&p.dem&&!b){let i=m[r](h,x),n=r%2?e.Y-1:0;h.centroidXY=x.centroidXY=c(g(i[0],Math.min(e.Y-1,i[1]),n,p,a,r<2,i[2]))}else b?h.centroidXY=x.centroidXY=new e.P(0,0):(h.centroidXY=o.encodeBorderCentroid(s),x.centroidXY=u.encodeBorderCentroid(i));o.writeCentroidToBuffer(h),u.writeCentroidToBuffer(x)}else o.showCentroid(s)}o.borderDoneWithNeighborZ[r]=u.canonical.z,u.borderDoneWithNeighborZ[d]=o.canonical.z}(o.needsCentroidUpdate||!o.centroidVertexBuffer&&0!==o.centroidVertexArray.length)&&o.uploadCentroid(r)}(r.context,i,a,o,n,u,h)}if("shadow"===r.renderPass&&r.shadowRenderer){let s=r.shadowRenderer;if(u&&a<.65&&n._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.Z)return;let l=s.getShadowPassDepthMode(),c=s.getShadowPassColorMode();iU(r,i,n,o,l,tl.disabled,c,h)}else if("translucent"===r.renderPass){let p=!n.paint.get("fill-extrusion-pattern").constantOr(1),d=n.paint.get("fill-extrusion-color").constantOr(e.aA.white);if(!c&&0!==d.a){let e=new ts(r.context.gl.LEQUAL,ts.ReadWrite,r.depthRangeFor3D);1===a&&p?iU(r,i,n,o,e,tl.disabled,tu.unblended,h):(iU(r,i,n,o,e,tl.disabled,tu.disabled,h),iU(r,i,n,o,e,r.stencilModeFor3D(),r.colorModeForRenderPass(),h),r.resetStencilClippingMasks())}if(r.style.enable3dLights()&&p&&(!u&&"globe"!==r.transform.projection.name||c)){let a=n.paint.get("fill-extrusion-opacity"),p=n.paint.get("fill-extrusion-ambient-occlusion-intensity"),d=n.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),f=n.paint.get("fill-extrusion-flood-light-intensity"),m=n.paint.get("fill-extrusion-flood-light-color").toArray01().slice(0,3),g=p>0&&d>0,_=f>0,y=(e,r,i)=>(1-i)*e+i*r,v=s=>{let u=r.depthModeForSublayer(1,ts.ReadOnly,l.LEQUAL,!0),c=y(.1,3,n.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation")),g=r._showOverdrawInspector;g||ij(r,i,n,o,u,new tl({func:l.ALWAYS,mask:255},255,255,l.KEEP,l.KEEP,l.REPLACE),new tu([l.ONE,l.ONE,l.ONE,l.ONE],e.aA.transparent,[!1,!1,!1,!0],l.MIN),tc.disabled,s,"sdf",a,p,d,f,m,c,h,!1);
106{let _=g?tl.disabled:new tl({func:l.EQUAL,mask:255},255,255,l.KEEP,l.DECR,l.DECR),y=g?r.colorModeForRenderPass():new tu([l.ONE_MINUS_DST_ALPHA,l.DST_ALPHA,l.ONE,l.ONE],e.aA.transparent,[!0,!0,!0,!0]);ij(r,i,n,o,u,_,y,tc.disabled,s,"color",a,p,d,f,m,c,h,!1)}};if(c){let c=(s,u,c)=>{let g=r.depthModeForSublayer(1,ts.ReadOnly,l.LEQUAL,!1),_=y(.1,3,n.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"));{let c=new tu([l.ONE,l.ONE,l.ONE,l.ONE],e.aA.transparent,[!1,!1,!1,!0]);ij(r,i,n,o,g,tl.disabled,c,tc.disabled,s,"clear",a,p,d,f,m,_,h,u)}ij(r,i,n,o,g,new tl({func:l.ALWAYS,mask:255},255,255,l.KEEP,l.KEEP,l.REPLACE),new tu([l.ONE,l.ONE,l.ONE,l.ONE],e.aA.transparent,[!1,!1,!1,!0],l.MIN),tc.disabled,s,"sdf",a,p,d,f,m,_,h,u);{let c=s?l.ZERO:l.ONE_MINUS_DST_ALPHA;ij(r,i,n,o,g,new tl({func:l.EQUAL,mask:255},255,255,l.KEEP,l.DECR,l.DECR),new tu([c,l.DST_ALPHA,l.ONE_MINUS_DST_ALPHA,l.ZERO],e.aA.transparent,[!0,!0,!0,!0]),tc.disabled,s,"color",a,p,d,f,m,_,h,u)}{let y=new tu([l.ONE,l.ONE,l.ONE,s?l.ZERO:l.ONE],e.aA.transparent,[!1,!1,!1,!0],s?l.FUNC_ADD:l.MAX);ij(r,i,n,o,g,tl.disabled,y,tc.disabled,s,"clear",a,p,d,f,m,_,h,u,c)}};if(g||_){let i;if(r.prepareDrawTile(),u){let r=u.drapeBufferSize[0],n=u.drapeBufferSize[1];(i=u.framebufferCopyTexture)&&(!i||i.size[0]===r&&i.size[1]===n)||(i&&i.destroy(),i=u.framebufferCopyTexture=new e.T(s,new e.h({width:r,height:n}),l.RGBA)),i.bind(l.LINEAR,l.CLAMP_TO_EDGE),l.copyTexImage2D(l.TEXTURE_2D,0,l.RGBA,0,0,r,n,0)}g&&c(!0,!1,i),_&&c(!1,!0,i)}}else g&&v(!0),_&&v(!1)}}},hillshade:function(r,i,n,o){if("offscreen"!==r.renderPass&&"translucent"!==r.renderPass||r.style.disableElevatedTerrain)return;let a=r.context,s=r.terrain&&r.terrain.renderingToTexture,[l,u]="translucent"!==r.renderPass||s?[{},o]:r.stencilConfigForOverlap(o);for(let o of u){let a=i.getTile(o);if(a.needsHillshadePrepare&&"offscreen"===r.renderPass)!function(r,i,n){var o;let a,s,l=r.context,u=l.gl;if(!i.dem)return;let c=i.dem;if(l.activeTexture.set(u.TEXTURE1),rX(r,i,c),!i.demTexture)return;i.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);let h=c.dim;l.activeTexture.set(u.TEXTURE0);let p=i.hillshadeFBO;if(!p){let r=new e.T(l,{width:h,height:h,data:null},u.RGBA);r.bind(u.LINEAR,u.CLAMP_TO_EDGE),(p=i.hillshadeFBO=l.createFramebuffer(h,h,!0,"renderbuffer")).colorAttachment.set(r.texture)}l.bindFramebuffer.set(p.framebuffer),l.viewport.set([0,0,h,h]);let{tileBoundsBuffer:d,tileBoundsIndexBuffer:f,tileBoundsSegments:m}=r.getMercatorTileBoundsBuffers(),g=[];r.linearFloatFilteringSupported()&&g.push("TERRAIN_DEM_FLOAT_FORMAT"),r.getOrCreateProgram("hillshadePrepare",{defines:g}).draw(r,u.TRIANGLES,ts.disabled,tl.disabled,tu.unblended,tc.disabled,(o=i.tileID,a=c.stride,s=e.a9.create(),e.a9.ortho(s,0,e.Y,-e.Y,0,0,1),e.a9.translate(s,s,[0,-e.Y,0]),{u_matrix:s,u_image:1,u_dimension:[a,a],u_zoom:o.overscaledZ}),n.id,d,f,m),i.needsHillshadePrepare=!1}(r,a,n);else if("translucent"===r.renderPass){let i=r.depthModeForSublayer(0,ts.ReadOnly),u=n.paint.get("hillshade-emissive-strength"),c=r.colorModeForDrapableLayerRenderPass(u),h=s&&r.terrain?r.terrain.stencilModeForRTTOverlap(o):l[o.overscaledZ];!function(r,i,n,o,a,s,l){let u=r.context,c=u.gl,h=n.hillshadeFBO;if(!h)return;r.prepareDrawTile();let p=r.isTileAffectedByFog(i),d=r.getOrCreateProgram("hillshade",{overrideFog:p});u.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,h.colorAttachment.get());let f=((r,i,n,o)=>{var a;let s,l,u=n.paint.get("hillshade-shadow-color"),c=n.paint.get("hillshade-highlight-color"),h=n.paint.get("hillshade-accent-color"),p=n.paint.get("hillshade-emissive-strength"),d=e.bm(n.paint.get("hillshade-illumination-direction"));if("viewport"===n.paint.get("hillshade-illumination-anchor"))d-=r.transform.angle;else if(r.style&&r.style.enable3dLights()&&r.style.directionalLight){let i=r.style.directionalLight.properties.get("direction"),n=e.bT(i.x,i.y,i.z);d=e.bm(n[1])}let f=!r.options.moving;return{u_matrix:o||r.transform.calculateProjMatrix(i.tileID.toUnwrapped(),f),u_image:0,u_latrange:(s=Math.pow(2,(a=i.tileID).canonical.z),l=a.canonical.y,[new e.O(0,l/s).toLngLat().lat,new e.O(0,(l+1)/s).toLngLat().lat]),u_light:[n.paint.get("hillshade-exaggeration"),d],u_shadow:u,u_highlight:c,u_emissive_strength:p,u_accent:h}})(r,n,o,r.terrain?i.projMatrix:null);r.uploadCommonUniforms(u,d,i.toUnwrapped());let{tileBoundsBuffer:m,tileBoundsIndexBuffer:g,tileBoundsSegments:_}=r.getTileBoundsBuffers(n);d.draw(r,c.TRIANGLES,a,s,l,tc.disabled,f,o.id,m,g,_)}(r,o,a,n,i,h,c)}}a.viewport.set([0,0,r.width,r.height]),r.resetStencilClippingMasks()}
106,raster:function(r,i,n,o,a,s){if("translucent"!==r.renderPass||0===n.paint.get("raster-opacity"))return;let l="globe"===r.transform.projection.name,u=0!==n.paint.get("raster-elevation"),c=u&&l;if(r.renderElevatedRasterBackface&&!c)return;let h=r.context,p=h.gl,d=i.getSource(),f=function(r,i,n,o){let a=i.paint.get("raster-color"),s="raster-array"===r.type,l=[],u=i.paint.get("raster-resampling"),c=i.paint.get("raster-color-mix"),h=i.paint.get("raster-color-range"),p=[c[0],c[1],c[2],0],d=c[3],f="nearest"===u?o.NEAREST:o.LINEAR;if(s&&(l.push("RASTER_ARRAY"),a||l.push("RASTER_COLOR"),"linear"===u&&l.push("RASTER_ARRAY_LINEAR"),f=o.NEAREST,!h&&r.rasterLayers)){let e=r.rasterLayers.find(({id:e})=>e===i.sourceLayer);e&&e.fields&&e.fields.range&&(h=e.fields.range)}if(h=h||[0,1],a){l.push("RASTER_COLOR"),n.activeTexture.set(o.TEXTURE2),i.updateColorRamp(h);let r=i.colorRampTexture;r||(r=i.colorRampTexture=new e.T(n,i.colorRamp,o.RGBA)),r.bind(o.LINEAR,o.CLAMP_TO_EDGE)}return{mix:p,range:h,offset:d,defines:l,resampling:f}}(d,n,h,p);if(d instanceof e.as&&!o.length&&!l)return;let m=n.paint.get("raster-emissive-strength"),g=r.colorModeForDrapableLayerRenderPass(m),_=r.terrain&&r.terrain.renderingToTexture,y=!r.options.moving,v="nearest"===n.paint.get("raster-resampling")?p.NEAREST:p.LINEAR;if(d instanceof e.as&&!o.length&&(d.onNorthPole||d.onSouthPole)){let e=u?r.stencilModeFor3D():tl.disabled;return void i$(!!d.onNorthPole,null,r,i,n,m,f,tc.disabled,e)}if(!o.length)return;let[x,b]=d instanceof e.as||_?[{},o]:r.stencilConfigForOverlap(o),w=b[b.length-1].overscaledZ;c&&f.defines.push("PROJECTION_GLOBE_VIEW"),u&&f.defines.push("RENDER_CUTOFF");let E=(o,a,b)=>{for(let E of o){let o,S,T,I,M,C=E.toUnwrapped(),A=i.getTile(E);if(_&&(!A||!A.hasData()))continue;h.activeTexture.set(p.TEXTURE0);let P=function(e,r,i,n){if(e)return r instanceof eS&&e instanceof tv?r.getTextureDescriptor(e,i,!0):{texture:e.texture,mix:iH(n.mix),offset:n.offset,buffer:0,tileSize:1}}(A,d,n,f);if(!P||!P.texture)continue;let{texture:L,mix:O,offset:D,tileSize:R,buffer:k}=P;_?(o=ts.disabled,S=E.projMatrix):u?(o=new ts(p.LEQUAL,ts.ReadWrite,r.depthRangeFor3D),S=l?Float32Array.from(r.transform.expandedFarZProjMatrix):r.transform.calculateProjMatrix(C,y)):(o=r.depthModeForSublayer(E.overscaledZ-w,1===n.paint.get("raster-opacity")?ts.ReadWrite:ts.ReadOnly,p.LESS),S=r.transform.calculateProjMatrix(C,y));let N=r.terrain&&_?r.terrain.stencilModeForRTTOverlap(E):x[E.overscaledZ],F=s?0:n.paint.get("raster-fade-duration");A.registerFadeDuration(F);let z=i.findLoadedParent(E,0),B=r4(A,z,i,r.transform,F);r.terrain&&r.terrain.prepareDrawTile(),h.activeTexture.set(p.TEXTURE0),L.bind(v,p.CLAMP_TO_EDGE),h.activeTexture.set(p.TEXTURE1),z?(z.texture&&z.texture.bind(v,p.CLAMP_TO_EDGE),T=Math.pow(2,z.tileID.overscaledZ-A.tileID.overscaledZ),I=[A.tileID.canonical.x*T%1,A.tileID.canonical.y*T%1]):L.bind(v,p.CLAMP_TO_EDGE),L.useMipmap&&h.extTextureFilterAnisotropic&&r.transform.pitch>20&&p.texParameterf(p.TEXTURE_2D,h.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,h.extTextureFilterAnisotropicMax);let U=r.transform,j=u?function(e){let r=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-r,o=.2*e.height,a=r+o;return[r,i,(a-o-r)/n,(a-r)/n]}(U):[0,0,0,0],V,G,q,H,$,W=0;if(c&&d instanceof e.as&&d.coordinates.length>3)V=Float32Array.from(e.aW(e.cn(new e.bv(0,0,0)))),G=Float32Array.from(U.globeMatrix),q=Float32Array.from(e.cj(U)),H=[e.a8(U.center.lng),e.ah(U.center.lat)],M=d.elevatedGlobePerspectiveTransform,$=d.elevatedGlobeGridMatrix||new Float32Array(9);else if(c){let r=e.ck(E.canonical);W=e.cl(r.getCenter().lat),V=Float32Array.from(e.aW(e.cn(E.canonical))),G=Float32Array.from(U.globeMatrix),q=Float32Array.from(e.cj(U)),H=[e.a8(U.center.lng),e.ah(U.center.lat)],M=[0,0],$=Float32Array.from(e.cm(E.canonical,r,W,U.worldSize/U._pixelsPerMercatorPixel))}else M=d instanceof e.as?d.perspectiveTransform:[0,0],V=new Float32Array(16),G=new Float32Array(9),q=new Float32Array(16),H=[0,0],$=new Float32Array(9);let Y=ix(S,V,G,q,$,I||[0,0],e.W(r.transform.zoom),H,j,T||1,B,n,M,u?n.paint.get("raster-elevation"):0,2,O,D,f.range,R,k,m),Z=r.isTileAffectedByFog(E),X=r.getOrCreateProgram("raster",{defines:f.defines,overrideFog:Z});if(r.uploadCommonUniforms(h,X,C),d instanceof e.as){let i=d.elevatedGlobeVertexBuffer,s=d.elevatedGlobeIndexBuffer;if(_||!l)d.boundsBuffer&&d.boundsSegments&&X.draw(r,p.TRIANGLES,o,tl.disabled,g,tc.disabled,Y,n.id,d.boundsBuffer,r.quadTriangleIndexBuffer,d.boundsSegments);else if(i&&s){let l=U.zoom<=e.bJ?d.elevatedGlobeSegments:d.getSegmentsForLongitude(U.center.lng);l&&X.draw(r,p.TRIANGLES,o,tl.disabled,g,a,Y,n.id,i,s,l)}}else if(c){o=new ts(p.LEQUAL,ts.ReadOnly,r.depthRangeFor3D);let e=r.globeSharedBuffers;if(e){let[i,s,l]=e.getGridBuffers(W,!1);X.draw(r,p.TRIANGLES,o,b||N,r.colorModeForRenderPass(),a,Y,n.id,i,s,l)}}else{let{tileBoundsBuffer:e,tileBoundsIndexBuffer:i,tileBoundsSegments:a}=r.getTileBoundsBuffers(A);X.draw(r,p.TRIANGLES,o,N,g,tc.disabled,Y,n.id,e,i,a)}}if(!(d instanceof e.as)&&c)for(let e of o){let o=e.canonical.y===(1<<e.canonical.z)-1;0===e.canonical.y&&i$(!0,e,r,i,n,m,f,a,b||tl.disabled),o&&i$(!1,e,r,i,n,m,f,a===tc.frontCW?tc.backCW:tc.frontCW,b||tl.disabled)}};c?E(b,r.renderElevatedRasterBackface?tc.backCW:tc.frontCW,r.stencilModeFor3D()):E(b,tc.disabled,void 0),r.resetStencilClippingMasks()},"raster-particle":function(r,i,n,o,a,s){"offscreen"===r.renderPass&&function(r,i,n,o){if(!o.length)return;let a=r.context,s=a.gl,l=i.getSource();if(!(l instanceof eS))return;let u=Math.ceil(Math.sqrt(n.paint.get("raster-particle-count"))),c=n.particleFramebuffer;c?c.width!==u&&(c.destroy(),c=n.particleFramebuffer=a.createFramebuffer(u,u,!0,null)):c=n.particleFramebuffer=a.createFramebuffer(u,u,!0,null);let h=[];for(let r of o){let o=i.getTile(r);if(!(o instanceof tv))continue;let s=function(r,i,n){if(!r)return null;let o=i.getTextureDescriptor(r,n,!0);if(!o)return null;let{texture:a,mix:s,offset:l,tileSize:u,buffer:c,format:h}=o;if(!a||!h)return null;let p=!1;return"uint32"===h&&(p=!0,s[3]=0,s=iy(e.cT,s,[0,n.paint.get("raster-particle-max-speed")]),l=iv(e.cT,l,[0,n.paint.get("raster-particle-max-speed")])),{texture:a,textureOffset:[c/(u+2*c),u/(u+2*c)],tileSize:u,scalarData:p,scale:s,offset:l,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[h]]}}(o,l,n);if(!s)continue;let c=[o.tileSize,o.tileSize],p=n.tileFramebuffer;p||(p=n.tileFramebuffer=a.createFramebuffer(c[0],c[1],!0,null));let d=o.rasterParticleState;d||(d=o.rasterParticleState=new td(a,r,c,u));let f=d.update(n.lastInvalidatedAt);d.particleTextureDimension!==u&&d.setParticleTextureDimension(r,u);let m=d.targetColorTexture;d.targetColorTexture=d.backgroundColorTexture,d.backgroundColorTexture=m;let g=d.particleTexture0;d.particleTexture0=d.particleTexture1,d.particleTexture1=g,h.push([r,s,d,f])}if(0===h.length)return;let p=e.f.now(),d=n.previousDrawTimestamp?.001*(p-n.previousDrawTimestamp):.0167;if(n.previousDrawTimestamp=p,n.hasColorMap()){a.activeTexture.set(s.TEXTURE0+2);let r=n.colorRampTexture;r||(r=n.colorRampTexture=new e.T(a,n.colorRamp,s.RGBA)),r.bind(s.LINEAR,s.CLAMP_TO_EDGE)}a.bindFramebuffer.set(n.tileFramebuffer.framebuffer),function(r,i,n){var o;let a=r.context,s=a.gl,l=i.tileFramebuffer;a.activeTexture.set(s.TEXTURE0);let u={u_texture:0,u_opacity:1.05*(o=i.paint.get("raster-particle-fade-opacity-factor"))/(o+.
10605)},c=r.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});for(let o of n){let[,,n,h]=o;l.colorAttachment.set(n.targetColorTexture.texture),a.viewport.set([0,0,l.width,l.height]),a.clear({color:e.aA.transparent}),h&&(n.backgroundColorTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE),c.draw(r,s.TRIANGLES,ts.disabled,tl.disabled,tu.alphaBlended,tc.disabled,u,i.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments))}}(r,n,h),function(r,i,n,o){let a=r.context,s=a.gl,l=n.tileFramebuffer,u="globe"===r.transform.projection.name,c=n.paint.get("raster-particle-max-speed");for(let h of o){let[o,p,d]=h;a.activeTexture.set(s.TEXTURE0+0),p.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),l.colorAttachment.set(d.targetColorTexture.texture);let f=r.getOrCreateProgram("rasterParticleDraw",{defines:p.defines,overrideFog:!1});a.activeTexture.set(s.TEXTURE0+1);let m=p.scalarData?[]:[0,1,2,3].map(r=>e.cN[r](o));m.push(o);let g=o.canonical.x,_=o.canonical.y;for(let e of m){let a=i.getTile(u?e.wrapped():e);if(!a)continue;let l=a.rasterParticleState;if(!l)continue;let h=e.canonical.x+(1<<e.canonical.z)*(e.wrap-o.wrap),d=e.canonical.y;l.particleTexture0.bind(s.NEAREST,s.CLAMP_TO_EDGE);let m=iw(1,l.particleTexture0.size[0],[h-g,d-_],0,p.texture.size,2,c,p.textureOffset,p.scale,p.offset);f.draw(r,s.POINTS,ts.disabled,tl.disabled,tu.alphaBlended,tc.disabled,m,n.id,l.particleIndexBuffer,void 0,l.particleSegment)}}}(r,i,n,h),a.bindFramebuffer.set(n.particleFramebuffer.framebuffer),function(r,i,n,o){let a=r.context,s=a.gl,l=i.paint.get("raster-particle-max-speed"),u=o*i.paint.get("raster-particle-speed-factor")*.3,c=Math.pow(.01+ +i.paint.get("raster-particle-reset-rate-factor"),6),h=i.particleFramebuffer;for(let o of(a.viewport.set([0,0,h.width,h.height]),n)){let[,n,p]=o;a.activeTexture.set(s.TEXTURE0+0),n.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),a.activeTexture.set(s.TEXTURE0+1);let d=p.particleTexture0;d.bind(s.NEAREST,s.CLAMP_TO_EDGE);let f=iE(1,d.size[0],0,n.texture.size,l,u,c,n.textureOffset,n.scale,n.offset);h.colorAttachment.set(p.particleTexture1.texture),a.clear({color:e.aA.transparent}),r.getOrCreateProgram("rasterParticleUpdate",{defines:n.defines}).draw(r,s.TRIANGLES,ts.disabled,tl.disabled,tu.unblended,tc.disabled,f,i.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments)}}(r,n,h,d)}(r,i,n,o),"translucent"===r.renderPass&&(function(r,i,n,o){let a=r.context,s=a.gl,l=!r.options.moving,u="globe"===r.transform.projection.name;if(!o.length)return;let[c,h]=r.stencilConfigForOverlap(o),p=[];u&&p.push("PROJECTION_GLOBE_VIEW");let d=r.stencilModeFor3D();for(let o of h){let h,f,m,g,_,y,v,x=o.toUnwrapped(),b=i.getTile(o);if(!b.rasterParticleState)continue;let w=b.rasterParticleState;b.registerFadeDuration(100);let E=i.findLoadedParent(o,0),S=r4(b,E,i,r.transform,100);r.terrain&&r.terrain.prepareDrawTile(),a.activeTexture.set(s.TEXTURE0),w.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),a.activeTexture.set(s.TEXTURE1),E&&E.rasterParticleState?(E.rasterParticleState.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),h=Math.pow(2,E.tileID.overscaledZ-b.tileID.overscaledZ),f=[b.tileID.canonical.x*h%1,b.tileID.canonical.y*h%1]):w.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE);let T=u?Float32Array.from(r.transform.expandedFarZProjMatrix):r.transform.calculateProjMatrix(x,l),I=r.transform,M=function(e){let r=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-r,o=.2*e.height,a=r+o;return[r,i,(a-o-r)/n,(a-r)/n]}(I),C=e.ck(o.canonical),A=e.cl(C.getCenter().lat);u?(m=Float32Array.from(e.aW(e.cn(o.canonical))),g=Float32Array.from(I.globeMatrix),_=Float32Array.from(e.cj(I)),y=[e.a8(
106I.center.lng),e.ah(I.center.lat)],v=Float32Array.from(e.cm(o.canonical,C,A,I.worldSize/I._pixelsPerMercatorPixel))):(m=new Float32Array(16),g=new Float32Array(9),_=new Float32Array(16),y=[0,0],v=new Float32Array(9));let P=ib(T,m,g,_,v,f||[0,0],e.W(r.transform.zoom),y,M,h||1,S,250),L=r.isTileAffectedByFog(o),O=r.getOrCreateProgram("rasterParticle",{defines:p,overrideFog:L});if(r.uploadCommonUniforms(a,O,x),u){let e=new ts(s.LEQUAL,ts.ReadWrite,r.depthRangeFor3D),i=r.globeSharedBuffers;if(i){let[o,a,l]=i.getGridBuffers(A,!1);O.draw(r,s.TRIANGLES,e,d,tu.alphaBlended,tc.backCCW,P,n.id,o,a,l)}}else{let e=r.depthModeForSublayer(0,ts.ReadOnly),i=c[o.overscaledZ],{tileBoundsBuffer:a,tileBoundsIndexBuffer:l,tileBoundsSegments:u}=r.getTileBoundsBuffers(b);O.draw(r,s.TRIANGLES,e,i,tu.alphaBlended,tc.disabled,P,n.id,a,l,u)}}r.resetStencilClippingMasks()}(r,i,n,o),r.style.map.triggerRepaint())},background:function(e,r,i,n){let o=i.paint.get("background-color"),a=i.paint.get("background-opacity"),s=i.paint.get("background-emissive-strength");if(0===a)return;let l=e.context,u=l.gl,c=e.transform,h=c.tileSize,p=i.paint.get("background-pattern");if(e.isPatternMissing(p,i.scope))return;let d=!p&&1===o.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==d)return;let f=tl.disabled,m=e.depthModeForSublayer(0,"opaque"===d?ts.ReadWrite:ts.ReadOnly),g=e.colorModeForDrapableLayerRenderPass(s),_=p?"backgroundPattern":"background",y,v=n;for(let d of(v||(v=Object.values(y=e.getBackgroundTiles()).map(e=>e.tileID)),p&&(l.activeTexture.set(u.TEXTURE0),e.imageManager.bind(e.context,i.scope)),v)){let v=e.isTileAffectedByFog(d),x=e.getOrCreateProgram(_,{overrideFog:v}),b=d.toUnwrapped(),w=n?d.projMatrix:e.transform.calculateProjMatrix(b);e.prepareDrawTile();let E=r?r.getTile(d):y?y[d.key]:new tm(d,h,c.zoom,e),S=p?iA(w,s,a,e,p,i.scope,{tileID:d,tileSize:h}):iC(w,s,a,o);e.uploadCommonUniforms(l,x,b);let{tileBoundsBuffer:T,tileBoundsIndexBuffer:I,tileBoundsSegments:M}=e.getTileBoundsBuffers(E);x.draw(e,u.TRIANGLES,m,f,g,tc.disabled,S,i.id,T,I,M)}},sky:function(r,i,n){let o,a,s,l,u,c,h,p,d,f,m,g,_,y,v=r._atmosphere?e.W(r.transform.zoom):1,x=n.paint.get("sky-opacity")*v;if(0===x)return;let b=r.context,w=n.paint.get("sky-type"),E=new ts(b.gl.LEQUAL,ts.ReadOnly,[0,1]),S=r.frameCounter/1e3%1;"atmosphere"===w?"offscreen"===r.renderPass?n.needsSkyboxCapture(r)&&(function(r,i){let n=r.context,o=n.gl,a=i.skyboxFbo;if(!a){a=i.skyboxFbo=n.createFramebuffer(32,32,!0,null),i.skyboxGeometry=new i5(n),i.skyboxTexture=n.gl.createTexture(),o.bindTexture(o.TEXTURE_CUBE_MAP,i.skyboxTexture),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,o.LINEAR);for(let e=0;e<6;++e)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,o.RGBA,32,32,0,o.RGBA,o.UNSIGNED_BYTE,null)}n.bindFramebuffer.set(a.framebuffer),n.viewport.set([0,0,32,32]);let s=i.getCenter(r,!0),l=r.getOrCreateProgram("skyboxCapture"),u=new Float64Array(16);e.a9.identity(u),e.a9.rotateY(u,u,-(.5*Math.PI)),i4(r,i,l,u,s,0),e.a9.identity(u),e.a9.rotateY(u,u,.5*Math.PI),i4(r,i,l,u,s,1),e.a9.identity(u),e.a9.rotateX(u,u,-(.5*Math.PI)),i4(r,i,l,u,s,2),e.a9.identity(u),e.a9.rotateX(u,u,.5*Math.PI),i4(r,i,l,u,s,3),e.a9.identity(u),i4(r,i,l,u,s,4),e.a9.identity(u),e.a9.rotateY(u,u,Math.PI),i4(r,i,l,u,s,5),n.viewport.set([0,0,r.width,r.height])}(r,n),n.markSkyboxValid(r)):"sky"===r.renderPass&&(a=(o=r.context).gl,s=r.transform,l=r.getOrCreateProgram("skybox"),o.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_CUBE_MAP,n.skyboxTexture),u={u_matrix:s.skyboxMatrix,u_sun_direction:n.getCenter(r,!1),u_cubemap:0,u_opacity:x,u_temporal_offset:S},r.uploadCommonUniforms(o,l),l.draw(r,a.TRIANGLES,E,tl.disabled,r.colorModeForRenderPass(),tc.backCW,u,"skybox",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)):"gradient"===w&&"sky"===r.renderPass&&(h=(c=r.context).gl,p=r.transform,d=r.getOrCreateProgram("skyboxGradient"),n.skyboxGeometry||(n.skyboxGeometry=new i5(c)),c.activeTexture.set(h.TEXTURE0),(f=n.colorRampTexture)||(f=n.colorRampTexture=new e.T(c,n.colorRamp,h.RGBA)),f.bind(h.LINEAR,h.CLAMP_TO_EDGE),m=p.skyboxMatrix,g=n.getCenter(r,!1),_=n.paint.get("sky-gradient-radius"),y={u_matrix:m,u_color_ramp:0,u_center_direction:g,u_radius:e.bm(_),u_opacity:x,u_temporal_offset:S},r.uploadCommonUniforms(c,d),d.draw(r,h.TRIANGLES,E,tl.disabled,r.colorModeForRenderPass(),tc.backCW,y,"skyboxGradient",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment))},debug:function(r,i,n,o,a,s){for(let l=0;l<n.length;l++)if(a){let a=new e.aA(.8*o.r,.8*o.g,.8*o.b,1);iQ(r,i,n[l],o,-1,-1,s),iQ(r,i,n[l],o,-1,1,s),iQ(r,i,n[l],o,1,1,s),iQ(r,i,n[l],o,1,-1,s),iQ(r,i,n[l],a,0,0,s)}else iQ(r,i,n[l],o,0,0,s)},custom:function(r,i,n,o){let a=r.context,s=n.implementation;if(!r.transform.projection.unsupportedLayers||!r.transform.projection.unsupportedLayers.includes("custom")||r.terrain&&(r.terrain.renderingToTexture||"offscreen"===r.renderPass)&&n.isDraped(i)){if("offscreen"===r.renderPass){let i=s.prerender;if(i){if(r.setCustomLayerDefaults(),a.setColorMode(r.colorModeForRenderPass()),"globe"===r.transform.projection.name){let n=r.transform.pointMerc;i.call(s,a.gl,r.transform.customLayerMatrix(),r.transform.getProjection(),r.transform.globeToMercatorMatrix(),e.W(r.transform.zoom),[n.x,n.y],r.transform.pixelsPerMeterRatio)}else i.call(s,a.gl,r.transform.customLayerMatrix());a.setDirty(),r.setBaseState()}}else if("translucent"===r.renderPass){if(r.terrain&&r.terrain.renderingToTexture){let i=s.renderToTile;if(i){let n=o[0].canonical,l=new e.O(n.x+o[0].wrap*(1<<n.z),n.y,n.z);a.setDepthMode(ts.disabled),a.setStencilMode(tl.disabled),a.setColorMode(r.colorModeForRenderPass()),r.setCustomLayerDefaults(),i.call(s,a.gl,l),a.setDirty(),r.setBaseState()}return}r.setCustomLayerDefaults(),a.setColorMode(r.colorModeForRenderPass()),a.setStencilMode(tl.disabled);let i="3d"===s.renderingMode?new ts(r.context.gl.LEQUAL,ts.ReadWrite,r.depthRangeFor3D):r.depthModeForSublayer(0,ts.ReadOnly);if(a.setDepthMode(i),"globe"===r.transform.projection.name){let i=r.transform.pointMerc;s.render(a.gl,r.transform.customLayerMatrix(),r.transform.getProjection(),r.transform.globeToMercatorMatrix(),e.W(r.transform.zoom),[i.x,i.y],r.transform.pixelsPerMeterRatio)}else s.render(a.gl,r.transform.customLayerMatrix());a.setDirty(),r.setBaseState(),a.bindFramebuffer.set(null)}}else e.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(r,i,n,o){if("opaque"===r.renderPass)return;let a=n.paint.get("model-opacity");if(0===a)return;let s=n.paint.get("model-cast-shadows");
106if("shadow"===r.renderPass&&(!s||r.terrain&&a<.65&&n._transitionablePaint._values["model-opacity"].value.expression instanceof e.Z))return;let l=r.shadowRenderer,u=n.paint.get("model-receive-shadows");l&&(l.useNormalOffset=!0,u||(l.enabled=!1));let c=()=>{l&&(l.useNormalOffset=!0,u||(l.enabled=!0))},h=i.getSource();if("light-beam"===r.renderPass&&"batched-model"!==h.type)return;if("vector"===h.type||"geojson"===h.type)return function(r,i,n,o,a){let s=r.transform;if("mercator"!==s.projection.name)return e.w(`Drawing 3D models for ${s.projection.name} projection is not yet implemented`);let l=s.getFreeCameraOptions().position;if(!r.modelManager)return;let u=r.modelManager;n.modelManager=u;let c=r.shadowRenderer;if(!n._unevaluatedLayout._values.hasOwnProperty("model-id"))return;let h=n._unevaluatedLayout._values["model-id"],p={...n.layout.get("model-id").parameters};for(let d of o){let o=i.getTile(d).getBucket(n);if(!o||o.projection.name!==s.projection.name)continue;let f=o.getModelUris();f&&!o.modelsRequested&&(u.addModelsFromBucket(f,a),o.modelsRequested=!0),p.zoom=function(r,i){let n=1<<r.canonical.z,o=i.getFreeCameraOptions().position,a=i.elevation,s=r.canonical.x/n,l=(r.canonical.x+1)/n,u=r.canonical.y/n,c=(r.canonical.y+1)/n,h=i._centerAltitude;if(a){let e=a.getMinMaxForTile(r);e&&e.max>h&&(h=e.max)}let p=e.ad(o.x,s,l)-o.x,d=e.ad(o.y,u,c)-o.y,f=e.bo(h,i.center.lat)-o.z;return i._zoomFromMercatorZ(Math.sqrt(p*p+d*d+f*f))}(d,s);let m=h.possiblyEvaluate(p);if(function(r,i,n){let o=i.updateZoomBasedPaintProperties(),a=function(r,i,n){let o,a,s,l=r.terrain?r.terrain.exaggeration():0;if(r.terrain&&l>0){let i=r.terrain,a=i.findDEMTileFor(n);a&&a.dem?o=e.d0.create(i,n,a):l=0}if(0===l&&(i.terrainElevationMin=0,i.terrainElevationMax=0),l===i.validForExaggeration&&(0===l||o&&o._demTile&&o._demTile.tileID===i.validForDEMTile.id&&o._dem._timestamp===i.validForDEMTile.timestamp))return!1;for(let e in i.instancesPerModel){let r=i.instancesPerModel[e];for(let e=0;e<r.instancedDataArray.length;++e){let n=(o?l*o.getElevationAt(0|r.instancedDataArray.float32[16*e],0|r.instancedDataArray.float32[16*e+1],!0,!0):0)+r.instancesEvaluatedElevation[e];r.instancedDataArray.float32[16*e+6]=n,a=a?Math.min(i.terrainElevationMin,n):n,s=s?Math.max(i.terrainElevationMax,n):n}}return i.terrainElevationMin=a||0,i.terrainElevationMax=s||0,i.validForExaggeration=l,i.validForDEMTile=o&&o._demTile?{id:o._demTile.tileID,timestamp:o._dem._timestamp}:{id:void 0,timestamp:0},!0}(r,i,n);(o||a)&&(i.uploaded=!1,i.upload(r.context))}(r,o,d),no.shadowUniformsInitialized=!1,no.useSingleShadowCascade=!!c&&0===c.getMaxCascadeForTile(d.toUnwrapped()),"shadow"===r.renderPass&&c){if(1===r.currentShadowCascade&&o.isInsideFirstShadowMapFrustum)continue;let i=s.calculatePosMatrix(d.toUnwrapped(),s.worldSize);if(no.tileMatrix.set(i),no.shadowTileMatrix=Float32Array.from(c.calculateShadowPassMatrixFromMatrix(i)),no.aabb.min.fill(0),no.aabb.max[0]=no.aabb.max[1]=e.Y,no.aabb.max[2]=0,function(r,i,n,o){if(!n.modelManager)return!0;let a=n.modelManager;if(!n.shadowRenderer)return!0;let s=n.shadowRenderer,l=i.aabb,u=!0,c=r.maxHeight;if(0===c){let e=0;for(let i in r.instancesPerModel){let r=a.getModel(i,o);r?e=Math.max(e,Math.max(Math.max(r.aabb.max[0],r.aabb.max[1]),r.aabb.max[2])):u=!1}c=r.maxScale*e*1.41+r.maxVerticalOffset,u&&(r.maxHeight=c)}l.max[2]=c,l.min[2]+=r.terrainElevationMin,l.max[2]+=r.terrainElevationMax,e.Q.transformMat4(l.min,l.min,i.tileMatrix),e.Q.transformMat4(l.max,l.max,i.tileMatrix);let h=l.intersects(s.getCurrentCascadeFrustum());return 0===n.currentShadowCascade&&(r.isInsideFirstShadowMapFrustum=2===h),0===h}(o,no,r,n.scope))continue}let g=1<<d.canonical.z,_=[((l.x-d.wrap)*g-d.canonical.x)*e.Y,(l.y*g-d.canonical.y)*e.Y,l.z*g*e.Y];for(let e in o.instancesPerModel){let i=o.instancesPerModel[e];i.features.length>0&&(e=m.evaluate(i.features[0].feature,{}));let s=u.getModel(e,a);if(s&&s.uploaded)for(let e of s.nodes)!function e(r,i,n,o,a,s,l){let u=r.context,c="shadow"===r.renderPass,h=r.shadowRenderer,p=c&&h?h.getShadowPassDepthMode():new ts(u.gl.LEQUAL,ts.ReadWrite,r.depthRangeFor3D),d=r.isTileAffectedByFog(s);if(n.meshes)for(let e of n.meshes){let f,m,g,_=["MODEL_POSITION_ON_GPU"],y=[];o.instancedDataArray.length>20&&_.push("INSTANCED_ARRAYS");let v=r_(r,i.paint.get("model-cutoff-fade-range"));if(v.shouldRenderCutoff&&_.push("RENDER_CUTOFF"),c&&h)f=r.getOrCreateProgram("modelDepth",{defines:_}),m=iO(l.shadowTileMatrix,l.shadowTileMatrix,Float32Array.from(n.matrix
106)),g=h.getShadowPassColorMode();else{nr(_,y,e,r),f=r.getOrCreateProgram("model",{defines:_,overrideFog:d});let o=e.material,c=o.pbrMetallicRoughness,p=i.paint.get("model-opacity"),x=i.paint.get("model-emissive-strength").constantOr(0);m=iL(s.expandedProjMatrix,Float32Array.from(n.matrix),new Float32Array(16),null,r,p,c.baseColorFactor,o.emissiveFactor,c.metallicFactor,c.roughnessFactor,o,x,i,a),h&&(l.shadowUniformsInitialized?f.setShadowUniformValues(u,h.getShadowUniformValues()):(h.setupShadows(s.toUnwrapped(),f,"model-tile",s.overscaledZ),l.shadowUniformsInitialized=!0)),g=v.shouldRenderCutoff||p<1||"OPAQUE"!==o.alphaMode?tu.alphaBlended:tu.unblended}r.uploadCommonUniforms(u,f,s.toUnwrapped(),null,v);let x=e.material.doubleSided?tc.disabled:tc.backCCW;if(o.instancedDataArray.length>20)y.push(o.instancedDataBuffer),f.draw(r,u.gl.TRIANGLES,p,tl.disabled,g,x,m,i.id,e.vertexBuffer,e.indexBuffer,e.segments,i.paint,r.transform.zoom,void 0,y,o.instancedDataArray.length);else{let n=c?"u_instance":"u_normal_matrix";for(let a=0;a<o.instancedDataArray.length;++a)m[n]=new Float32Array(o.instancedDataArray.arrayBuffer,64*a,16),f.draw(r,u.gl.TRIANGLES,p,tl.disabled,g,x,m,i.id,e.vertexBuffer,e.indexBuffer,e.segments,i.paint,r.transform.zoom,void 0,y)}}if(n.children)for(let u of n.children)e(r,i,u,o,a,s,l)}(r,n,e,i,_,d,no)}}}(r,i,n,o,"vector"===h.type?n.scope:""),void c();if(!h.loaded())return;if("batched-model"===h.type)return function(r,i,n,o){n.resetLayerRenderingStats(r);let a=r.context,s=r.transform,l=r.style.fog,u=r.shadowRenderer;if("mercator"!==s.projection.name)return e.w(`Drawing 3D landmark models for ${s.projection.name} projection is not yet implemented`);let c=r.transform.getFreeCameraOptions().position,h=e.Q.scale([],[c.x,c.y,c.z],r.transform.worldSize);e.Q.negate(h,h);let p=e.a9.identity([]),d=e.cZ(s.center.lat,s.zoom),f=e.a9.fromScaling([],[1,1,1/d]);e.a9.translate(p,p,h);let m=n.paint.get("model-opacity"),g=new ts(a.gl.LEQUAL,ts.ReadWrite,r.depthRangeFor3D),_=new ts(a.gl.LEQUAL,ts.ReadOnly,r.depthRangeFor3D),y=new e.bV([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),v="shadow"===r.renderPass,x=v&&u?u.getCurrentCascadeFrustum():s.getFrustum(s.scaleZoom(s.worldSize)),b=n.getLayerRenderingStats(),w=function(c,h){for(let d of o){let o=i.getTile(d).getBucket(n);if(!o||!o.uploaded)continue;let w=!1;u&&(w=0===u.getMaxCascadeForTile(d.toUnwrapped()));let E=s.calculatePosMatrix(d.toUnwrapped(),s.worldSize),S=o.modelTraits;for(let i of o.getNodesInfo()){if(i.hiddenByReplacement||!i.node.meshes)continue;let o=i.evaluatedScale,d=i.node,T=0;if(r.terrain&&d.elevation&&(T=d.elevation*r.terrain.exaggeration()),o[0]<=1&&o[1]<=1&&o[2]<=1&&0===(()=>{let r=i.getLocalBounds();return y.min=[...r.min],y.max=[...r.max],y.min[2]+=T,y.max[2]+=T,e.Q.transformMat4(y.min,y.min,E),e.Q.transformMat4(y.max,y.max,E),y})().intersects(x))continue;let I=[...E];e.a9.translate(I,I,[(d.anchor?d.anchor[0]:0)*(o[0]-1),(d.anchor?d.anchor[1]:0)*(o[1]-1),T]),e.Q.exactEquals(o,e.c$)||e.a9.scale(I,I,o);let M=e.a9.multiply([],I,d.matrix),C=e.a9.multiply([],f,I);e.a9.multiply(C,p,C);let A=e.a9.invert([],C);e.a9.transpose(A,A),e.a9.scale(A,A,na),C=e.a9.multiply(C,C,d.matrix);let P="light-beam"===r.renderPass,L=e.a9.multiply([],s.expandedFarZProjMatrix,M),O=e.a9.multiply([],s.expandedFarZProjMatrix,I),D=S&e.d1.HasMapboxMeshFeatures,R=D?0:i.evaluatedRMEA[0][2];for(let e=0;e<d.meshes.length;++e){let o,p=d.meshes[e],f=e===d.lightMeshIndex,y=L;if(f){if(!P&&!r.terrain&&r.shadowRenderer){r.currentLayer<r.firstLightBeamLayer&&(r.firstLightBeamLayer=r.currentLayer);continue}y=O}else if(P)continue;let x={defines:[]},E=[];if(nr(x.defines,E,p,r),D||x.defines.push("DIFFUSE_SHADED"),w&&x.defines.push("SHADOWS_SINGLE_CASCADE"),b&&(v?b.numRenderedVerticesInShadowPass+=p.vertexArray.length:b.numRenderedVerticesInTransparentPass+=p.vertexArray.length),v){nn(p,M,r,n);continue}let S=null;if(l){let e=nt(M,r.transform);if(S=new Float32Array(e),"globe"!==s.projection.name){let r=p.aabb.min,i=p.aabb.max,[n,o]=l.getOpacityForBounds(e,r[0],r[1],i[0],i[1]);x.overrideFog=n>=.05||o>=.05}}let T=p.material;T.occlusionTexture&&T.occlusionTexture.offsetScale&&(o=T.occlusionTexture.offsetScale,x.defines.push("OCCLUSION_TEXTURE_TRANSFORM")),!v&&u&&(u.useNormalOffset=!!p.normalBuffer);let k=r.getOrCreateProgram("model",x);
106!v&&u&&u.setupShadowsFromMatrix(I,k,u.useNormalOffset),r.uploadCommonUniforms(a,k,null,S);let N=T.pbrMetallicRoughness;N.metallicFactor=.9,N.roughnessFactor=.5;let F=iL(new Float32Array(y),new Float32Array(C),new Float32Array(A),new Float32Array(d.matrix),r,m,N.baseColorFactor,T.emissiveFactor,N.metallicFactor,N.roughnessFactor,T,R,n,[0,0,0],o);k.draw(r,a.gl.TRIANGLES,h&&!f?g:_,tl.disabled,c?f||m<1||i.hasTranslucentParts?tu.alphaBlended:tu.unblended:tu.disabled,tc.backCCW,F,n.id,p.vertexBuffer,p.indexBuffer,p.segments,n.paint,r.transform.zoom,void 0,E)}}}};(function(e,r,i,n){let o=e.terrain?e.terrain.exaggeration():0,a=e.transform.zoom;for(let s of n){let n=r.getTile(s).getBucket(i);n&&(e.conflationActive&&n.updateReplacement(s,e.replacementSource),n.evaluateScale(e,i),e.terrain&&o>0&&n.elevationUpdate(e.terrain,o,s,i.source),n.needsReEvaluation(e,a,i)&&n.evaluate(i))}})(r,i,n,o),1===m?w(!0,!0):(w(!1,!0),w(!0,!1))}(r,i,n,o),void c();let p=h.getModels(),d=[],f=r.transform.getFreeCameraOptions().position,m=e.Q.scale([],[f.x,f.y,f.z],r.transform.worldSize);e.Q.negate(m,m);let g=[],_=[],y=0;for(let i of p){let o=n.paint.get("model-rotation").constantOr(null),a=n.paint.get("model-scale").constantOr(null),s=n.paint.get("model-translation").constantOr(null);i.computeModelMatrix(r,o,a,s,!0,!0,!1);let l=e.a9.identity([]),u=e.cZ(i.position.lat,r.transform.zoom),c=e.a9.fromScaling([],[1,1,1/u]);for(let n of(e.a9.translate(l,l,m),d.push({zScaleMatrix:c,negCameraPosMatrix:l}),i.nodes))!function r(i,n,o,a,s,l,u){let c;c="globe"===i.projection.name?e.c_(o,i):[...o],e.a9.multiply(c,c,n.matrix);let h=e.a9.multiply([],a,c);if(n.meshes)for(let r of n.meshes){if("BLEND"!==r.material.alphaMode){u.push({mesh:r,depth:0,modelIndex:s,worldViewProjection:h,nodeModelMatrix:c});continue}let i=e.Q.transformMat4([],r.centroid,h);i[2]>0&&l.push({mesh:r,depth:i[2],modelIndex:s,worldViewProjection:h,nodeModelMatrix:c})}if(n.children)for(let e of n.children)r(i,e,o,a,s,l,u)}(r.transform,n,i.matrix,r.transform.expandedFarZProjMatrix,y,g,_);y++}if(g.sort((e,r)=>r.depth-e.depth),"shadow"!==r.renderPass){if(1===a)for(let e of _)ni(e,r,n,d[e.modelIndex],tl.disabled,r.colorModeForRenderPass());else{for(let e of _)ni(e,r,n,d[e.modelIndex],tl.disabled,tu.disabled);for(let e of _)ni(e,r,n,d[e.modelIndex],r.stencilModeFor3D(),r.colorModeForRenderPass());r.resetStencilClippingMasks()}for(let e of g)ni(e,r,n,d[e.modelIndex],tl.disabled,r.colorModeForRenderPass());c()}else{for(let e of _)nn(e.mesh,e.nodeModelMatrix,r,n);for(let e of g)nn(e.mesh,e.nodeModelMatrix,r,n);c()}}},nc={model:function(e,r,i){let n=r.getSource();if(n.loaded()){if("vector"===n.type||"geojson"===n.type)return void(i.modelManager&&i.modelManager.upload(i,"vector"===n.type?e.scope:""));if("batched-model"!==n.type)for(let e of n.getModels())e.upload(i.context)}},raster:function(e,r,i){let n=r.getSource();if(!(n instanceof eS&&n.loaded()))return;let o=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!o)return;let a=e.paint.get("raster-array-band")||n.getInitialBand(o);if(null!=a)for(let e of r.getIds().map(e=>r.getTileByID(e)))e.updateNeeded(o,a)&&n.prepareTile(e,o,a)},"raster-particle":function(e,r,i){let n=r.getSource();if(!(n instanceof eS&&n.loaded()))return;let o=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!o)return;let a=e.paint.get("raster-particle-array-band")||n.getInitialBand(o);if(null!=a)for(let e of r.getIds().map(e=>r.getTileByID(e)))e.updateNeeded(o,a)&&n.prepareTile(e,o,a)}};class nh{constructor(r,i,n,o){this.context=new th(r,i),this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=o,this._timeStamp=(new Date).getTime(),this._averageFPS=0,this._fpsHistory=[],this._debugParams={showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const a=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const e of a)this._debugParams.enabledLayers[e]=!0;for(const e of(o.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},()=>{this.style.map.triggerRepaint()}),o.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),o.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),o.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),o.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200}),a))o.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],e);this.setup(),this.numSublayers=tb.maxUnderzooming+tb.maxOverzooming+1,this.depthEpsilon=1/65536,this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.d3,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new rb(this),this._wireframeDebugCache=new nl,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0}updateTerrain(e,r){let i=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new r7(this,e));let n=this._terrain;this.transform.elevation=i?n:null,n.update(e,this.transform,r),this.transform.elevation&&!n.enabled&&(this.transform.elevation=null)}_updateFog(e){let r=e.fog;if(!r||"globe"===this.transform.projection.name||1>r.getOpacity(this.transform.pitch)||.03>r.properties.get("horizon-blend"))return void(this.transform.fogCullDistSq=null);let[i,n]=r.getFovAdjustedRange(this.transform._fov);if(i>n)return void(this.transform.fogCullDistSq=null);let o=i+.78*(n-i);this.transform.fogCullDistSq=o*o}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(r,i){if(this.width=r*e.f.devicePixelRatio,this.height=i*e.f.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style.order)this.style._mergedLayers[e].resize()}setup(){let r=this.context,i=new e.aQ;i.emplaceBack(0,0),i.emplaceBack(e.Y,0),i.emplaceBack(0,e.Y),i.emplaceBack(e.Y,e.Y),this.tileExtentBuffer=r.createVertexBuffer(i,e.aS.members),this.tileExtentSegments=e.aE.simpleSegment(0,0,4,2);let n=new e.aQ;n.emplaceBack(0,0),n.emplaceBack(e.Y,0),n.emplaceBack(0,e.Y),n.emplaceBack(e.Y,e.Y),this.debugBuffer=r.createVertexBuffer(n,e.aS.members),this.debugSegments=e.aE.simpleSegment(0,0,4,5);let o=new e.aQ;o.emplaceBack(-1,-1),o.emplaceBack(1,-1),o.emplaceBack(-1,1),o.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(o,e.aS.members),this.viewportSegments=e.aE.simpleSegment(0,0,4,2);let a=new e.ay;a.emplaceBack(0,0,0,0),a.emplaceBack(e.Y,0,e.Y,0),a.emplaceBack(0,e.Y,0,e.Y),a.emplaceBack(e.Y,e.Y,e.Y,e.Y),this.mercatorBoundsBuffer=r.createVertexBuffer(a,e.aU.members),this.mercatorBoundsSegments=e.aE.simpleSegment(0,0,4,2);let s=new e.az;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(s);let l=new e.aR;for(let e of[0,1,3,2,0])l.emplaceBack(e);this.debugIndexBuffer=r.createIndexBuffer(l),this.emptyTexture=new e.T(r,new e.h({width:1,height:1},Uint8Array.of(0,0,0,0)),r.gl.RGBA),this.identityMat=e.a9.create();let u=this.context.gl;this.stencilClearMode=new tl({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){let e=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,e.TRIANGLES,ts.disabled,this.stencilClearMode,tu.disabled,tc.disabled,r5(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(e,r,i){if(!r||this.currentStencilSource===r.id||!e.isTileClipped()||!i||0===i.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(let r of i)if(void 0===this._tileClippingMaskIDs[r.key]){e=!0;break}if(!e)return}this.currentStencilSource=r.id;let n=this.context,o=n.gl;this.nextStencilID+i.length>256&&this.clearStencil(),n.setColorMode(tu.disabled),n.setDepthMode(ts.disabled);let a=this.getOrCreateProgram("clippingMask");for(let e of(this._tileClippingMaskIDs={},i)){let i=r.getTile(e),n=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,{tileBoundsBuffer:s,tileBoundsIndexBuffer:l,tileBoundsSegments:u}=this.getTileBoundsBuffers(i);a.draw(this,o.TRIANGLES,ts.disabled,new tl({func:o.ALWAYS,mask:0},n,255,o.KEEP,o.KEEP,o.REPLACE),tu.disabled,tc.disabled,r5(e.projMatrix),"$clipping",s,l,u)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,r=this.context.gl;return new tl({func:r.NOTEQUAL,mask:255},e,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);let r=this.context.gl;return new tl({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,r.KEEP,r.KEEP,r.REPLACE)}stencilConfigForOverlap(e){let r=this.context.gl,i=e.sort((e,r)=>
106r.overscaledZ-e.overscaledZ),n=i[i.length-1].overscaledZ,o=i[0].overscaledZ-n+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();let e={};for(let i=0;i<o;i++)e[i+n]=new tl({func:r.GEQUAL,mask:255},i+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=o,[e,i]}return[{[n]:tl.disabled},i]}colorModeForRenderPass(){let r=this.context.gl;if(this._showOverdrawInspector){let i=1/8;return new tu([r.CONSTANT_COLOR,r.ONE,r.CONSTANT_COLOR,r.ONE],new e.aA(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?tu.unblended:tu.alphaBlended}colorModeForDrapableLayerRenderPass(r){let i=this.context.gl;return this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture&&"translucent"===this.renderPass?new tu([i.ONE,i.ONE_MINUS_SRC_ALPHA,i.CONSTANT_ALPHA,i.ONE_MINUS_SRC_ALPHA],new e.aA(0,0,0,void 0===r?0:r),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(e,r,i,n=!1){if(!this.opaquePassEnabledForLayer()&&!n)return ts.disabled;let o=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new ts(i||this.context.gl.LEQUAL,r,[o,o])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}updateAverageFPS(){let e=(new Date).getTime(),r=e-this._timeStamp;this._timeStamp=e,this._fpsHistory.push(0===r?0:1e3/r),this._fpsHistory.length>this._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce((e,r)=>e+r/this._fpsHistory.length,0))}render(r,i){var n,o;let a,s;this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=r.map.repaint,this.style=r,this.options=i;let l=this.style._mergedLayers,u=this.style.order.filter(e=>{let r=l[e];return!(r.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[r.type]}),c=u.map(e=>l[e]),h=this.style._mergedSourceCaches;this.imageManager=r.imageManager,this.modelManager=r.modelManager,this.symbolFadeChange=r.placement.symbolFadeChange(e.f.now()),this.imageManager.beginFrame();let p=0,d=!1;for(let e in h){let r=h[e];r.used&&(r.prepare(this.context),r.getSource().usedInConflation&&++p)}for(let e of c)e.isHidden(this.transform.zoom)||this.prepareLayer(e);let f={},m={},g={},_={},y={};for(let e in h){let r=h[e];f[e]=r.getVisibleCoordinates(),m[e]=f[e].slice().reverse(),g[e]=r.getVisibleCoordinates(!0).reverse(),_[e]=r.getShadowCasterCoordinates(),y[e]=r.sortCoordinatesByDistance(f[e])}let v=e=>{let r=this.style.getLayerSourceCache(e);return r&&r.used?r.getSource():null};if(p){let e=[];for(let r of c)this.layerUsedInConflation(r,v(r))&&e.push(r);if(e&&e.length>1){let r=[];for(let i of e){let e=this.style.getLayerSourceCache(i);e&&e.used&&e.getSource().usedInConflation&&r.push({layer:i.fqid,cache:e})}this.replacementSource.setSources(r),d=!0}}for(let e of(d||this.replacementSource.clear(),this.conflationActive=d,this.minCutoffZoom=0,this.longestCutoffRange=0,c)){let r=e.cutoffRange();if(this.longestCutoffRange=Math.max(r,this.longestCutoffRange),r>0){let r=v(e);r&&(this.minCutoffZoom=Math.max(r.minzoom,this.minCutoffZoom)),e.minzoom&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom))}}this.opaquePassCutoff=1/0;for(let e=0;e<c.length;e++)if(c[e].is3D()){this.opaquePassCutoff=e;break}let x=this.style&&this.style.fog;x?(this._fogVisible=0!==x.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=x.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(g),this.opaquePassCutoff=0);let b=this._shadowRenderer;if(b)for(let e in b.updateShadowParameters(this.transform,this.style.directionalLight),h)for(let r of f[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(r)||e),b.addShadowReceiver(r.toUnwrapped(),e.min,e.max)}if("globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.d4(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new ne(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.de
106stroy(),this._atmosphere=void 0),!e.d5(this.context.gl))return;for(let e of(this.renderPass="offscreen",c)){let i=r.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;let n=i?m[i.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||n&&n.length)&&this.renderLayer(this,i,e,n)}this.depthRangeFor3D=[0,1-(c.length+2)*this.numSublayers*this.depthEpsilon];let w=this.terrain;w&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&!this.transform.isOrthographic&&w.drawDepth(),this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,_)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);let E="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),S=(()=>{if(i.showOverdrawInspector)return e.aA.black;if(this.style.fog&&this.transform.projection.supportsFog&&!E){let r=this.style.fog.properties.get("color").toArray01();return new e.aA(...r)}if(this.style.fog&&this.transform.projection.supportsFog&&E){let r=this.style.fog.properties.get("space-color").toArray01();return new e.aA(...r)}return e.aA.transparent})();if(this.context.clear({color:S,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&E&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=u.length-1;this.currentLayer>=0;this.currentLayer--){let e=c[this.currentLayer],i=r.getLayerSourceCache(e);if(e.isSky())continue;let n=i?(e.is3D()?y:m)[i.id]:void 0;this._renderTileClippingMasks(e,i,n),this.renderLayer(this,i,e,n)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&E&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.W(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer<u.length;this.currentLayer++){let e=c[this.currentLayer],i=r.getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,i,e,i?m[i.id]:void 0)}function T(e,r){let i;return r&&(i=("symbol"===e.type?g:e.is3D()?y:m)[r.id]),i}if(this.renderPass="translucent","globe"===this.transform.projection.name){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<u.length;){let e=c[this.currentLayer];if("raster"===e.type){let i=r.getLayerSourceCache(e);this.renderLayer(this,i,e,T(e,i))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let I=0;for(b&&(I=b.getShadowCastingLayerCount());this.currentLayer<u.length;){let e=c[this.currentLayer],i=r.getLayerSourceCache(e);if(e.isSky())++this.currentLayer;else if(w&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=w.renderBatch(this.currentLayer)}else{if(this._renderTileClippingMasks(e,i,i?f[i.id]:void 0),this.renderLayer(this,i,e,T(e,i)),!w&&b&&I>0&&e.hasShadowPass()&&0==--I&&(b.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){let e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){let e=c[this.currentLayer];if(!e.hasLightBeamPass())continue;let i=r.getLayerSourceCache(e);this.renderLayer(this,i,e,i?m[i.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let i=null;c.forEach(e=>{let n=r.getLayerSourceCache(e);n&&!e.isHidden(this.transform.zoom)&&n.getVisibleCoordinates().length&&(!i||i.getSource().maxzoom<n.getSource().maxzoom)&&(i=n)}),i&&this.options.showTileBoundaries&&nu.debug(this,i,i.getVisibleCoordinates(),e.aA.red,!1,this.options.showParseStatus)}this.terrain&&this._debugParams.showTerrainProxyTiles&&nu.debug(this,this.terrain.proxySourceCache,this.terrain.proxyCoords,new e.aA(1,.8,.1,1),!0,this.options.showParseStatus),this.options.showPadding&&(a=this.transform.padding,iJ(this,this.transform.height-(a.top||0),3,iW),iJ(this,a.bottom||0,3,iY),i0(this,a.left||0,3,iZ),i0(this,this.transform.width-(a.right||0),3,iX),s=this.transform.centerPoint,n=s.x,i1(this,n-1,(o=this.transform.height-s.y)-10,2,20,iK),i1(this,n-10,o-1,20,2,iK)),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveC
106anvasCopy()),d||(this.conflationActive=!1)}prepareLayer(e){this.gpuTimingStart(e);let{unsupportedLayers:r}=this.transform.projection,i=!r||!r.includes(e.type);if(nc[e.type]&&(i||this.terrain&&"custom"===e.type)){let r=this.style.getLayerSourceCache(e);nc[e.type](e,r,this)}this.gpuTimingEnd()}renderLayer(e,r,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||"model"===i.type||"raster"===i.type||"raster-particle"===i.type||n&&n.length)&&(this.id=i.id,this.gpuTimingStart(i),e.transform.projection.unsupportedLayers&&e.transform.projection.unsupportedLayers.includes(i.type)&&(!e.terrain||"custom"!==i.type)||nu[i.type](e,r,i,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;let r=this.context.extTimerQuery,i=this.context.gl,n=this.gpuTimers[e.id];n||(n=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:i.createQuery()}),n.calls++,i.beginQuery(r.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){let e=this.context.extTimerQuery,r=this.context.gl,i=r.createQuery();this.deferredRenderGpuTimeQueries.push(i),r.beginQuery(e.TIME_ELAPSED_EXT,i)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){let e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){let e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){let r={};for(let i in e){let n=e[i],o=this.context.extTimerQuery,a=o.getQueryParameter(n.query,this.context.gl.QUERY_RESULT)/1e6;o.deleteQueryEXT(n.query),r[i]=a}return r}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;let r=this.context.extTimerQuery,i=this.context.gl,n=0;for(let o of e)n+=r.getQueryParameter(o,i.QUERY_RESULT)/1e6,r.deleteQueryEXT(o);return n}translatePosMatrix(r,i,n,o,a){if(!n[0]&&!n[1])return r;let s=a?"map"===o?this.transform.angle:0:"viewport"===o?-this.transform.angle:0;if(s){let e=Math.sin(s),r=Math.cos(s);n=[n[0]*r-n[1]*e,n[0]*e+n[1]*r]}let l=[a?n[0]:e.a6(i,n[0],this.transform.zoom),a?n[1]:e.a6(i,n[1],this.transform.zoom),0],u=new Float32Array(16);return e.a9.translate(u,r,l),u}saveTileTexture(e){let r=e.size[0],i=this._tileTextures[r];i?i.push(e):this._tileTextures[r]=[e]}getTileTexture(e){let r=this._tileTextures[e];return r&&r.length>0?r.pop():null}isPatternMissing(e,r){return null===e||void 0!==e&&!this.imageManager.getPattern(e.toString(),r)}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,r,i){let n=void 0===i?this.terrain&&this.terrain.renderingToTexture:i,o=this.terrain&&0===this.terrain.exaggeration(),a=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(a.push("LIGHTING_3D_MODE"),a.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):n||a.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass?this._shadowMapDebug||a.push("DEPTH_TEXTURE"):this.shadowRenderer&&(this.shadowRenderer.useNormalOffset?a.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"):a.push("RENDER_SHADOWS","DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(a.push("TERRAIN"),this.linearFloatFilteringSupported()&&a.push("TERRAIN_DEM_FLOAT_FORMAT"),o&&a.push("ZERO_EXAGGERATION")),"globe"===this.transform.projection.name&&a.push("GLOBE"),this._fogVisible&&!n&&(void 0===r||r)&&a.push("FOG","FOG_DITHERING"),n&&a.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&a.push("OVERDRAW_INSPECTOR"),a}getOrCreateProgram(e,r){this.cache=this.cache||{};let i=r&&r.defines||[],n=r&&r.config,o=this.currentGlobalDefines(e,r&&r.overrideFog,r&&r.overrideRtt).concat(i),a=ir.cacheKey(r$[e],e,o,n);return this.cache[a]||(this.cache[a]=new ir(this.context,e,r$[e],n,iD[e],o)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.de
106stroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(r,i){if(this.style.enable3dLights()){let o=this.style.directionalLight,a=this.style.ambientLight;if(o&&a){var n;let s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E=(s=o.properties.get("direction"),l=o.properties.get("color").toArray01(),u=o.properties.get("intensity"),c=a.properties.get("color").toArray01(),h=a.properties.get("intensity"),p=[s.x,s.y,s.z],d=e.cs(c,h),{u_lighting_ambient_color:d,u_lighting_directional_dir:p,u_lighting_directional_color:f=e.cs(l,u),u_ground_radiance:(n=[0,0,1],m=e.Q.dot(n,p),g=e.Q.dot(f,[.2126,.7152,.0722]),y=(_=(e,r,i)=>(1-i)*e+i*r)(1-.3*Math.min(g,1),1,Math.min(m+1,1)),v=_(.92,1,Math.asin(e.ad(n[2],-1,1))/Math.PI+.5)*y,x=[0,0,0],e.Q.scale(x,d.slice(0,3),v),b=[0,0,0],e.Q.scale(b,f.slice(0,3),p[2]),w=[0,0,0],e.Q.add(w,x,b),e.bX(w))});i.setLightsUniformValues(r,E)}}}uploadCommonUniforms(r,i,n,o,a){if(this.uploadCommonLightUniforms(r,
106i),this.terrain&&this.terrain.renderingToTexture)return;let s=this.style.fog;if(s){let a=s.getOpacity(this.transform.pitch),l=((r,i,n,o,a,s,l,u,c,h,p,d)=>{let f=r.transform,m=i.properties.get("color").toArray01();m[3]=o;let g=r.frameCounter/1e3%1,[_,y]=i.properties.get("vertical-range");return{u_fog_matrix:n?f.calculateFogTileMatrix(n):d||r.identityMat,u_fog_range:i.getFovAdjustedRange(f._fov),u_fog_color:m,u_fog_horizon_blend:i.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(_,y),y],u_fog_temporal_offset:g,u_frustum_tl:a,u_frustum_tr:s,u_frustum_br:l,u_frustum_bl:u,u_globe_pos:c,u_globe_radius:h,u_viewport:p,u_globe_transition:e.W(f.zoom),u_is_globe:+("globe"===f.projection.name)}})(this,s,n,a,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.f.devicePixelRatio,this.transform.height*e.f.devicePixelRatio],o);i.setFogUniformValues(r,l)}a&&i.setCutoffUniformValues(r,a.uniformValues)}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){let e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){let e=this.context.gl,r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),r}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;let e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){let e=this._backgroundTiles,r=this._backgroundTiles={};for(let i of this.transform.coveringTiles({tileSize:512}))r[i.key]=e[i.key]||new tm(i,512,this.transform.tileZoom,this);return r}clearBackgroundTiles(){this._backgroundTiles={}}layerUsedInConflation(e,r){return!(!e.is3D()||e.minzoom&&e.minzoom>this.transform.zoom||"building"!==e.sourceLayer&&(!r||"batched-model"!==r.type))}isTileAffectedByFog(e){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let r=this._cachedTileFogOpacities[e.key];return r||(this._cachedTileFogOpacities[e.key]=r=this.style.fog.getOpacityForTile(e)),r[0]>=.05||r[1]>=.05}}function np(e,r){let i=!1,n=null,o=()=>{n=null,i&&(e(),n=setTimeout(o,r),i=!1)};return()=>(i=!0,n||o(),n)}class nd{constructor(r){this._hashName=r&&encodeURIComponent(r),e.a$(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=np(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map&&(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0),this}getHashString(){let e=this._map;if(!e)return"";let r=nf(e);if(this._hashName){let e=this._hashName,i=!1,n=location.hash.slice(1).split("&").map(n=>{let o=n.split("=")[0];return o===e?(i=!0,`${o}=${r}`):n}).filter(e=>e);return i||n.push(`${e}=${r}`),`#${n.join("&")}`}return`#${r}`}_getCurrentHash(){let e=location.hash.replace("#","");if(this._hashName){let r;return e.split("&").map(e=>e.split("=")).forEach(e=>{e[0]===this._hashName&&(r=e)}),(r&&r[1]||"").split("/")}return e.split("/")}_onHashChange(){let e=this._map;if(!e)return!1;let r=this._getCurrentHash();if(r.length>=3&&!r.some(e=>isNaN(e))){let i=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(r[3]||0):e.getBearing();return e.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:i,pitch:+(r[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function nf(e,r){let i=e.getCenter(),n=Math.round(100*e.getZoom())/100,o=Math.pow(10,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10)),a=Math.round(i.lng*o)/o,s=Math.round(i.lat*o)/o,l=e.getBearing(),u=e.getPitch(),c=r?`/${a}/${s}/${n}`:`${n}/${s}/${a}`;return(l||u)&&(c+="/"+Math.round(10*l)/10),u&&(c+=`/${Math.round(u)}`),c}let nm={linearity:.3,easing:e.d6(0,0,.3,1)},ng=e.e({deceleration:2500,maxSpeed:1400},nm),n_=e.e({deceleration:20,maxSpeed:1400},nm),ny=e.e({deceleration:1e3,maxSpeed:360},nm),nv=e.e({deceleration:1e3,maxSpeed:90},nm);class nx{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.f.now(),settings:r})}_drainInertiaBuffer(){let r=this._inertiaBuffer,i=e.f.now();for(;r.length>0&&i-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;let i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);let n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(i.pan.mag()){let a=nw(i.pan.mag(),n,e.e({},ng,r||{}));o.offset=i.pan.mult(a.amount/i.pan.mag()),o.center=this._map.transform.center,nb(o,a)}if(i.zoom){let e=nw(i.zoom,n,n_);o.zoom=this._map.transform.zoom+e.amount,nb(o,e)}if(i.bearing){let r=nw(i.bearing,n,ny);
106o.bearing=this._map.transform.bearing+e.ad(r.amount,-179,179),nb(o,r)}if(i.pitch){let e=nw(i.pitch,n,nv);o.pitch=this._map.transform.pitch+e.amount,nb(o,e)}if(o.zoom||o.bearing){let e=void 0===i.pinchAround?i.around:i.pinchAround;o.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),o.noMoveStart=!0,o}}function nb(e,r){(!e.duration||e.duration<r.duration)&&(e.duration=r.duration,e.easing=r.easing)}function nw(r,i,n){let{maxSpeed:o,linearity:a,deceleration:s}=n,l=e.ad(r*a/(i/1e3),-o,o),u=Math.abs(l)/(s*a);return{easing:n.easing,duration:1e3*u,amount:u/2*l}}class nE extends e.b{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,i,n,o={}){const a=m(i.getCanvasContainer(),n),s=i.unproject(a);super(r,e.e({point:a,lngLat:s,originalEvent:n},o)),this._defaultPrevented=!1,this.target=i}}class nS extends e.b{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,i,n){const o="touchend"===r?n.changedTouches:n.touches,a=g(i.getCanvasContainer(),o),s=a.map(e=>i.unproject(e)),l=a.reduce((e,r,i,n)=>e.add(r.div(n.length)),new e.P(0,0));super(r,{points:a,point:l,lngLats:s,lngLat:i.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class nT extends e.b{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,i){super(e,{originalEvent:i}),this._defaultPrevented=!1}}class nI{constructor(e,r){this._map=e,this._clickTolerance=r.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new nT(e.type,this._map,e))}mousedown(e,r){return this._mousedownPos=r,this._firePreventable(new nE(e.type,this._map,e))}mouseup(e){this._map.fire(new nE(e.type,this._map,e))}preclick(r){let i=e.e({},r);i.type="preclick",this._map.fire(new nE(i.type,this._map,i))}click(e,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||(this.preclick(e),this._map.fire(new nE(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new nE(e.type,this._map,e))}mouseover(e){this._map.fire(new nE(e.type,this._map,e))}mouseout(e){this._map.fire(new nE(e.type,this._map,e))}touchstart(e){return this._firePreventable(new nS(e.type,this._map,e))}touchmove(e){this._map.fire(new nS(e.type,this._map,e))}touchend(e){this._map.fire(new nS(e.type,this._map,e))}touchcancel(e){this._map.fire(new nS(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nM{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new nE(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new nE("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new nE(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nC{constructor(e,r){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&0===e.button&&(h(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(e,r){if(!this._active)return;let i=this._startPos,n=this._lastPos;if(!i||!n||n.equals(r)||!this._box&&r.dist(i)<this._clickTolerance)return;this._lastPos=r,this._box||(this._box=s("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));let o=Math.min(i.x,r.x),a=Math.max(i.x,r.x),l=Math.min(i.y,r.y),u=Math.max(i.y,r.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${o}px,${l}px)`,this._box.style.width=a-o+"px",this._box.style.height=u-l+"px")})}mouseupWindow(r,i){if(!this._active)return;let n=this._startPos;if(n&&0===r.button){if(this.reset(),f(),n.x!==i.x||n.y!==i.y)return this._map.fire(new e.b("boxzoomend",{originalEvent:r})),{cameraAnimation:e=>e.fitScreenCoordinates(n,i,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",r)}}
106keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),p(),delete this._startPos,delete this._lastPos}_fireEvent(r,i){return this._map.fire(new e.b(r,{originalEvent:i}))}}function nA(e,r){let i={};for(let n=0;n<e.length;n++)i[e[n].identifier]=r[n];return i}class nP{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(r,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=r.timeStamp),n.length===this.numTouches&&(this.centroid=function(r){let i=new e.P(0,0);for(let e of r)i._add(e);return i.div(r.length)}(i),this.touches=nA(n,i)))}touchmove(e,r,i){if(this.aborted||!this.centroid)return;let n=nA(i,r);for(let e in this.touches){let r=n[e];(!r||r.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,r,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class nL{constructor(e){this.singleTap=new nP(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,r,i){this.singleTap.touchstart(e,r,i)}touchmove(e,r,i){this.singleTap.touchmove(e,r,i)}touchend(e,r,i){let n=this.singleTap.touchend(e,r,i);if(n){let r=e.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(n);if(r&&i||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class nO{constructor(){this._zoomIn=new nL({numTouches:1,numTaps:2}),this._zoomOut=new nL({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,r,i){this._zoomIn.touchstart(e,r,i),this._zoomOut.touchstart(e,r,i)}touchmove(e,r,i){this._zoomIn.touchmove(e,r,i),this._zoomOut.touchmove(e,r,i)}touchend(e,r,i){let n=this._zoomIn.touchend(e,r,i),o=this._zoomOut.touchend(e,r,i);return n?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:r=>r.easeTo({duration:300,zoom:r.getZoom()+1,around:r.unproject(n)},{originalEvent:e})}):o?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:r=>r.easeTo({duration:300,zoom:r.getZoom()-1,around:r.unproject(o)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let nD={0:1,2:2};class nR{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,r){return!1}_move(e,r){return{}}mousedown(e,r){if(this._lastPoint)return;let i=_(e);this._correctButton(e,i)&&(this._lastPoint=r,this._eventButton=i)}mousemoveWindow(e,r){let i=this._lastPoint;if(i){let n;if(e.preventDefault(),null!=this._eventButton&&(n=nD[this._eventButton],void 0===e.buttons||(e.buttons&n)!==n))this.reset();else if(this._moved||!(r.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=r,this._move(i,r)}}mouseupWindow(e){this._lastPoint&&_(e)===this._eventButton&&(this._moved&&f(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nk extends nR{mousedown(e,r){super.mousedown(e,r),this._lastPoint&&(this._active=!0)}_correctButton(e,r){return 0===r&&!e.ctrlKey}_move(e,r){return{around:r,panDelta:r.sub(e)}}}class nN extends nR{_correctButton(e,r){return 0===r&&e.ctrlKey||2===r}_move(e,r){let i=.8*(r.x-e.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(e){e.preventDefault()}}class nF extends nR{_correctButton(e,r){return 0===r&&e.ctrlKey||2===r}_move(e,r){let i=-.5*(r.y-e.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(e){e.preventDefault()}}class nz{constructor(r,i){this._map=r,this._el=r.getCanvasContainer(),this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset(),e.a$(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}touchstart(e,r,i){return this._calculateTransform(e,r,i)}touchmove(r,i,n){if(this._active&&!(n.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===n.length&&!e.d7())return void this._showTouchPanBlockerAlert();
106"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return r.cancelable&&r.preventDefault(),this._calculateTransform(r,i,n)}}touchend(e,r,i){this._calculateTransform(e,r,i),this._active&&i.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(r,i,n){n.length>0&&(this._active=!0);let o=nA(n,i),a=new e.P(0,0),s=new e.P(0,0),l=0;for(let e in o){let r=o[e],i=this._touches[e];i&&(a._add(r),s._add(r.sub(i)),l++,o[e]=r)}if(this._touches=o,l<this._minTouches||!s.mag())return;let u=s.div(l);return this._sum._add(u),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(l),panDelta:u}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=s("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class nB{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,r,i){return{}}touchstart(e,r,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([r[0],r[1]]))}touchmove(e,r,i){let n=this._firstTwoTouches;if(!n)return;e.preventDefault();let[o,a]=n,s=nU(i,r,o),l=nU(i,r,a);if(!s||!l)return;let u=this._aroundCenter?null:s.add(l).div(2);return this._move([s,l],u,e)}touchend(e,r,i){if(!this._firstTwoTouches)return;let[n,o]=this._firstTwoTouches,a=nU(i,r,n),s=nU(i,r,o);a&&s||(this._active&&f(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function nU(e,r,i){for(let n=0;n<e.length;n++)if(e[n].identifier===i)return r[n]}function nj(e,r){return Math.log(e/r)/Math.LN2}class nV extends nB{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,r){let i=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(.1>Math.abs(nj(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:nj(this._distance,i),pinchAround:r}}}function nG(e,r){return 180*e.angleWith(r)/Math.PI}class nq extends nB{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,r){let i=this._vector;if(this._vector=e[0].sub(e[1]),i&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:nG(this._vector,i),pinchAround:r}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let r=25/(Math.PI*this._minDiameter)*360,i=this._startVector;return!!i&&Math.abs(nG(e,i))<r}}function nH(e){return Math.abs(e.y)>Math.abs(e.x)}class n$ extends nB{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,nH(e[0].sub(e[1]))&&(this._valid=!1)}_move(r,i,n){let o=this._lastPoints;if(!o)return;let a=r[0].sub(o[0]),s=r[1].sub(o[1]);return this._map._cooperativeGestures&&!e.d7()&&n.touches.length<3||(this._val
106id=this.gestureBeginsVertically(a,s,n.timeStamp),!this._valid)?void 0:(this._lastPoints=r,this._active=!0,{pitchDelta:-((a.y+s.y)/2*.5)})}gestureBeginsVertically(e,r,i){if(void 0!==this._valid)return this._valid;let n=e.mag()>=2,o=r.mag()>=2;if(!n&&!o)return;if(!n||!o)return null==this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let a=e.y>0==r.y>0;return nH(e)&&nH(r)&&a}}let nW=100,nY=15,nZ=10;class nX{constructor(){this._panStep=nW,this._bearingStep=nY,this._pitchStep=nZ,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,i=0,n=0,o=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),o=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),o=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:s=>{let l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:nK,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+i*this._bearingStep,pitch:s.getPitch()+n*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:s.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function nK(e){return e*(2-e)}let nQ=1/450;class nJ{constructor(r,i){this._map=r,this._el=r.getCanvasContainer(),this._handler=i,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=nQ,e.a$(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(r){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(r.ctrlKey||r.metaKey||this.isZooming()||e.d7()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=r.deltaMode===WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY,n=e.f.now(),o=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&4>Math.abs(i)?this._type="trackpad":o>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=200>Math.abs(o*i)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),r.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=r,this._delta-=i,this._active||this._start(r)),r.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=m(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:r,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let r=this._map.transform;"wheel"===this._type&&r.projection.wrap&&(r._center.lng>=180||r._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);let i=()=>r._terrainEnabled()&&this._aroundCoord?r.computeZoomRelativeTo(this._aroundCoord):r.zoom;if(0!==this._delta){let e="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,n=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==n&&(n=1/n);let o=i(),a=Math.pow(2,o),s="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):a;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(s*n))),"wheel"===this._type&&(this._startZoom=o,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}let n="number"==typeof this._targetZoom?this._targetZoom:i(),o=this._startZoom,a=this._easing,s,l=!1;if("wheel"===this._type&&o&&a){let r=Math.min((e.f.now()-this._lastWheelEventTime)/200,1),i=a(r);s=e.X(o,n,i),r<1?this._frameId||(this._frameId=!0):l=!0}else s=n,l=!0;this._active=!0,l&&(this._active=!1,this._finishTimeout=setTimeout(()=>
106{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let u=s-i();return u*this._lastDelta<0&&(u=0),{noInertia:!0,needsRenderFrame:!l,zoomDelta:u,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let i=e.d8;if(this._prevEase){let r=this._prevEase,n=(e.f.now()-r.start)/r.duration,o=r.easing(n+.01)-r.easing(n),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=e.d6(a,s,.25,1)}return this._prevEase={start:e.f.now(),duration:r,easing:i},i}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=s("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class n0{constructor(e,r){this._clickZoom=e,this._tapZoom=r}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class n1{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,r){return e.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(e.shiftKey?-1:1),around:i.unproject(r)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class n2{constructor(){this._tap=new nL({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,r,i){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=r[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(e,r,i))}touchmove(e,r,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let n=r[0],o=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:o/128}}}else this._tap.touchmove(e,r,i)}touchend(e,r,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(e,r,i)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class n3{constructor(e,r,i){this._el=e,this._mousePan=r,this._touchPan=i}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class n5{constructor(e,r,i){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=r,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class n4{constructor(e,r,i,n){this._el=e,this._touchZoom=r,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}let n6=e=>e.zoom||e.drag||e.pitch||e.rotate;class n8 extends e.b{}class n9{constructor(){this.constants=[1,1,.01],this.radius=0}setup(r,i){let n=e.Q.sub([],i,r);this.radius=e.Q.length(n[2]<0?e.Q.div([],n,this.constants):[n[0],n[1],0])}projectRay(r){e.Q.div(r,r,this.constants),e.Q.normalize(r,r),e.Q.mul(r,r,this.constants);let i=e.Q.scale([],r,this.radius);if(i[2]>0){let r=e.Q.scale([],[0,0,1],e.Q.dot(i,[0,0,1])),n=e.Q.scale([],e.Q.normalize([],[i[0],i[1],0]),this.radius),o=e.Q.add([],i,e.Q.scale([],e.Q.sub([],e.Q.add([],n,r),i),2));i[0]=o[0],i[1]=o[1]}return i}}function n7(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class oe{constructor(r,i){this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nx(r),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new n9,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),e.a$(["handleEvent","handleWindowEvent"],this);const n=this._el;for(const[e,r,i]of(this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]],this._listeners)){const n=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(r,n,i)}}destroy(){for(let[e,r,i]of this._listeners){let n=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(r,n,i)}}_addDefaultHandlers(e){let r=this._map,i=r.getCanvasContainer();this._add("mapEvent",new nI(r,e));let n=r.boxZoom=new nC(r,e);this._add("boxZoom",n);let o=new nO,a=new n1;r.doubleClickZoom=new n0(a,o),this._add("tapZoom",o),this._add("clickZoom",a);let s=new n2;this._add("tapDragZoom",s);let l=r.touchPitch=new n$(r);this._add("touchPitch",l);let u=new nN(e),c=new nF(e);r.dragRotate=new n5(e,u,c),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);let h=new nk(e),p=new nz(r,e);r.dragPan=new n3(i,h,p),this._add("mousePan",h),this._add("touchPan",p,["touchZoom","touchRotate"]);let d=new nq,f=new nV;r.touchZoomRotate=new n4(i,f,d,s),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new nM(r));let m=r.scrollZoom=new nJ(r,this);this._add("scrollZoom",m,["mousePan"]);let g=r.keyboard=new nX;for(let i of(this._add("keyboard",g),["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"]))e.interactive&&e[i]&&r[i].enable(e[i])}
106_add(e,r,i){this._handlers.push({handlerName:e,handler:r,allowed:i}),this._handlersById[e]=r}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[],this._originalZoom=void 0}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!n6(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,r,i){for(let n in e)if(n!==i&&(!r||0>r.indexOf(n)))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){let r=[];for(let i of e)this._el.contains(i.target)&&r.push(i);return r}handleEvent(e,r){this._updatingCamera=!0;let i="renderFrame"===e.type,n=i?void 0:e,o={needsRenderFrame:!1},a={},s={},l=e.touches?this._getMapTouches(e.touches):void 0,u=l?g(this._el,l):i?void 0:m(this._el,e);for(let{handlerName:i,handler:c,allowed:h}of this._handlers){let p;c.isEnabled()&&(this._blockedByActive(s,h,i)?c.reset():c[r||e.type]&&(p=c[r||e.type](e,u,l),this.mergeHandlerResult(o,a,p,i,n),p&&p.needsRenderFrame&&this._triggerRenderFrame()),(p||c.isActive())&&(s[i]=c))}let c={};for(let e in this._previousActiveHandlers)s[e]||(c[e]=n);this._previousActiveHandlers=s,(Object.keys(c).length||n7(o))&&(this._changes.push([o,a,c]),this._triggerRenderFrame()),(Object.keys(s).length||n7(o))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=o;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))}mergeHandlerResult(r,i,n,o,a){if(!n)return;e.e(r,n);let s={handlerName:o,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(i.zoom=s),void 0!==n.panDelta&&(i.drag=s),void 0!==n.pitchDelta&&(i.pitch=s),void 0!==n.bearingDelta&&(i.rotate=s)}_applyChanges(){let r={},i={},n={};for(let[o,a,s]of this._changes)o.panDelta&&(r.panDelta=(r.panDelta||new e.P(0,0))._add(o.panDelta)),o.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+o.pitchDelta),void 0!==o.around&&(r.around=o.around),void 0!==o.aroundCoord&&(r.aroundCoord=o.aroundCoord),void 0!==o.pinchAround&&(r.pinchAround=o.pinchAround),o.noInertia&&(r.noInertia=o.noInertia),e.e(i,a),e.e(n,s);this._updateMapTransform(r,i,n),this._changes=[]}_updateMapTransform(r,i,n){let o,a=this._map,s=a.transform,l=e=>[e.x,e.y,e.z];if((o=this._eventsInProgress.drag)&&!this._handlersById[o.handlerName].isActive()&&!n7(r)){let e=s.zoom;s.cameraElevationReference="sea",null!=this._originalZoom&&s._orthographicProjectionAtLowPitch&&"globe"!==s.projection.name&&0===s.pitch?(s.cameraElevationReference="ground",s.zoom=this._originalZoom):(s.recenterOnTerrain(),s.cameraElevationReference="ground"),e!==s.zoom&&this._map._update(!0)}if(s._isCameraConstrained&&a._stop(!0),!n7(r))return void this._fireEvents(i,n,!0);let{panDelta:u,zoomDelta:c,bearingDelta:h,pitchDelta:p,around:d,aroundCoord:f,pinchAround:m}=r;s._isCameraConstrained&&(c>0&&(c=0),s._isCameraConstrained=!1),void 0!==m&&(d=m),(c||i.drag&&!this._eventsInProgress.drag)&&d&&(this._dragOrigin=l(s.pointCoordinate3D(d)),this._originalZoom=s.zoom,this._trackingEllipsoid.setup(s._camera.position,this._dragOrigin)),s.cameraElevationReference="sea",a._stop(!0),d=d||a.transform.centerPoint,h&&(s.bearing+=h),p&&(s.pitch+=p),s._updateCameraState();let g=[0,0,0];if(u)if("mercator"===s.projection.name){let e=this._trackingEllipsoid.projectRay(s.screenPointToMercatorRay(d).dir),r=this._trackingEllipsoid.projectRay(s.screenPointToMercatorRay(d.sub(u)).dir);g[0]=r[0]-e[0],g[1]=r[1]-e[1]}else{let r=s.pointCoordinate(d);if("globe"===s.projection.name){u=u.rotate(-s.angle);let i=s._pixelsPerMercatorPixel/s.worldSize;g[0]=-u.x*e.d9(e.ax(r.y))*i,g[1]=-u.y*e.d9(s.center.lat)*i}else{let e=s.pointCoordinate(d.sub(u));r&&e&&(g[0]=e.x-r.x,g[1]=e.y-r.y)}}let _=s.zoom,y=[0,0,0];if(c){let r=l(f||s.pointCoordinate3D(d)),i={dir:e.Q.normalize([],e.Q.sub([],r,s._camera.position))};if(i.dir[2]<0){let n=s.zoomDeltaToMovement(r,c);e.Q.scale(y,i.dir,n)}}let v=e.Q.add(g,g,y);s._translateCameraConstrained(v),c&&Math.abs(s.zoom-_)>1e-4&&s.recenterOnTerrain(),s.cameraElevationReference="ground",this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(i,n,!0)}
106_fireEvents(r,i,n){let o,a=n6(this._eventsInProgress),s=n6(r),l={};for(let e in r){let{originalEvent:i}=r[e];this._eventsInProgress[e]||(l[`${e}start`]=i),this._eventsInProgress[e]=r[e]}for(let e in!a&&s&&this._fireEvent("movestart",s.originalEvent),l)this._fireEvent(e,l[e]);for(let e in s&&this._fireEvent("move",s.originalEvent),r){let{originalEvent:i}=r[e];this._fireEvent(e,i)}let u={};for(let e in this._eventsInProgress){let{handlerName:r,originalEvent:n}=this._eventsInProgress[e];this._handlersById[r].isActive()||(delete this._eventsInProgress[e],o=i[r]||n,u[`${e}end`]=o)}for(let e in u)this._fireEvent(e,u[e]);let c=n6(this._eventsInProgress);if(n&&(a||s)&&!c){this._updatingCamera=!0;let r=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;r?(i(r.bearing||this._map.getBearing())&&(r.bearing=0),this._map.easeTo(r,{originalEvent:o})):(this._map.fire(new e.b("moveend",{originalEvent:o})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(r,i){this._map.fire(new e.b(r,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{this._frameId=void 0,this.handleEvent(new n8("renderFrame",{timeStamp:e})),this._applyChanges()})}
106_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}let ot="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class or extends e.E{constructor(r,i){super(),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=i.bearingSnap,this._respectPrefersReducedMotion=!1!==i.respectPrefersReducedMotion,e.a$(["_renderFrameCallback"],this)}getCenter(){return new e.bq(this.transform.center.lng,this.transform.center.lat)}setCenter(e,r){return this.jumpTo({center:e},r)}panBy(r,i,n){return r=e.P.convert(r).mult(-1),this.panTo(this.transform.center,e.e({offset:r},i),n)}panTo(r,i,n){return this.easeTo(e.e({center:r},i),n)}getZoom(){return this.transform.zoom}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomTo(r,i,n){return this.easeTo(e.e({zoom:r},i),n)}zoomIn(e,r){return this.zoomTo(this.getZoom()+1,e,r),this}zoomOut(e,r){return this.zoomTo(this.getZoom()-1,e,r),this}getBearing(){return this.transform.bearing}setBearing(e,r){return this.jumpTo({bearing:e},r),this}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(r,i,n){return this.easeTo(e.e({bearing:r},i),n)}resetNorth(r,i){return this.rotateTo(0,e.e({duration:1e3},r),i),this}resetNorthPitch(r,i){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},r),i),this}snapToNorth(e,r){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,r):this}getPitch(){return this.transform.pitch}setPitch(e,r){return this.jumpTo({pitch:e},r),this}cameraForBounds(r,i){r=e.ag.convert(r);let n=i&&i.bearing||0,o=i&&i.pitch||0,a=r.getNorthWest(),s=r.getSouthEast();return this._cameraForBounds(this.transform,a,s,n,o,i)}_extendPadding(r){let i={top:0,right:0,bottom:0,left:0};return null==r?e.e({},i,this.transform.padding):"number"==typeof r?{top:r,bottom:r,right:r,left:r}:e.e({},i,r)}_extendCameraOptions(r){return(r=e.e({offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding=this._extendPadding(r.padding),r}_minimumAABBFrustumDistance(e,r){let i=r.max[0]-r.min[0],n=r.max[1]-r.min[1];return i/n>e.aspect?i/(2*Math.tan(.5*e.fovX)*e.aspect):n/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(r,i,n,o,a,s){let l=r.clone(),u=this._extendCameraOptions(s);l.bearing=o,l.pitch=a;let c=e.bq.convert(i),h=e.bq.convert(n),p=.5*(c.lat+h.lat),d=.5*(c.lng+h.lng),f=e.da(p,d),m=e.Q.normalize([],f),g=e.Q.normalize([],e.Q.cross([],m,[0,1,0])),_=e.Q.cross([],g,m),y=[g[0],g[1],g[2],0,_[0],_[1],_[2],0,m[0],m[1],m[2],0,0,0,0,1],v=[f,e.da(c.lat,c.lng),e.da(h.lat,c.lng),e.da(h.lat,h.lng),e.da(c.lat,h.lng),e.da(p,c.lng),e.da(p,h.lng),e.da(c.lat,d),e.da(h.lat,d)],x=e.bV.fromPoints(v.map(r=>[e.Q.dot(g,r),e.Q.dot(_,r),e.Q.dot(m,r)])),b=e.Q.transformMat4([],x.center,y);0===e.Q.squaredLength(b)&&e.Q.set(b,0,0,1),e.Q.normalize(b,b),e.Q.scale(b,b,e.ae),l.center=e.db(b);let w=l.getWorldToCameraMatrix(),E=e.a9.invert(new Float64Array(16),w);x=e.bV.applyTransform(x,e.a9.multiply([],w,y));let S=this._extendAABB(x,l,u,o);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");x=S,e.Q.transformMat4(b,b,w);let T=.5*(x.max[2]-x.min[2]),I=this._minimumAABBFrustumDistance(l,x),M=e.Q.scale([],[0,0,1],T),C=e.Q.add(M,b,M),A=I+(0===l.pitch?0:e.Q.distance(b,C)),P=l.globeCenterInViewSpace,L=e.Q.sub([],b,[P[0],P[1],P[2]]);e.Q.normalize(L,L),e.Q.scale(L,L,A);let O=e.Q.add([],b,L);e.Q.transformMat4(O,O,E);let D=e.dc/e.ae,R=e.Q.length(O),k=e.bo(Math.max(R*D-e.dc,Number.EPSILON),0),N=Math.min(l.zoomFromMercatorZAdjusted(k),u.maxZoom);return N>.5*(e.bJ+e.bA)?(l.setProjection({name:"mercator"}),l.zoom=N,this._cameraForBounds(l,i,n,o,a,s)):{center:l.center,zoom:N,bearing:o,pitch:a}}_extendAABB(r,i,n,o){let a=.5*((n.padding.left||0)+(n.padding.right||0)),s=.5*((n.padding.top||0)+(n.padding.bottom||0)),l=i.width-(a+a),u=i.height-(s+s),c=e.Q.sub([],r.max,r.min),h=Math.min(l/c[0],u/c[1]),p=Math.min(i.scaleZoom(i.scale*h),n.maxZoom);if(isNaN(p))return null;let d=i.scale/i.zoomScale(p),f=new e.bV([r.min[0]-a*d,r.min[1]-s*d,r.min[2]],[r.max[0]+a*d,r.max[1]+s*d,r.max[2]]),m=("number"==typeof n.offset.x&&"number"==typeof n.offset.y?new e.P(n.offset.x,n.offset.y):e.P.convert(n.offset)).rotate(-e.bm(o));return f.center[0]-=m.x*d,f.center[1]+=m.y*d,f}queryTerrainElevation(r,i){let n=this.transform.elevation;return n?(i=e.e({},{exaggerated:!0},i),n.getAtPoint(e.O.fromLngLat(r),null,i.exaggerated)):null}
106_cameraForBounds(r,i,n,o,a,s){if("globe"===r.projection.name)return this._cameraForBoundsOnGlobe(r,i,n,o,a,s);let l=r.clone(),u=this._extendCameraOptions(s);l.bearing=o,l.pitch=a;let c=e.bq.convert(i),h=e.bq.convert(n),p=new e.bq(c.lng,h.lat),d=new e.bq(h.lng,c.lat),f=l.project(c),m=l.project(h),g=this.queryTerrainElevation(c),_=this.queryTerrainElevation(h),y=this.queryTerrainElevation(p),v=this.queryTerrainElevation(d),x=[[f.x,f.y,Math.min(g||0,_||0,y||0,v||0)],[m.x,m.y,Math.max(g||0,_||0,y||0,v||0)]],b=e.bV.fromPoints(x),w=l.getWorldToCameraMatrix(),E=e.a9.invert(new Float64Array(16),w);b=e.bV.applyTransform(b,w);let S=this._extendAABB(b,l,u,o);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");b=S;let T=.5*e.Q.sub([],b.max,b.min)[2],I=this._minimumAABBFrustumDistance(l,b),M=[0,0,1,0];e.aa.transformMat4(M,M,w),e.aa.normalize(M,M);let C=e.Q.scale([],M,I+T),A=e.Q.add([],b.center,C);e.Q.transformMat4(b.center,b.center,E),e.Q.transformMat4(A,A,E);let P=[b.center[0],b.center[1],A[2]*l.pixelsPerMeter];e.Q.scale(P,P,1/l.worldSize);let L=e.aw(P[0]),O=e.ax(P[1]),D=Math.min(l._zoomFromMercatorZ(P[2]),u.maxZoom),R=new e.bq(L,O);return l.mercatorFromTransition&&D<.5*(e.bJ+e.bA)?(l.setProjection({name:"globe"}),l.zoom=D,this._cameraForBounds(l,i,n,o,a,s)):{center:R,zoom:D,bearing:o,pitch:a}}fitBounds(e,r,i){let n=this.cameraForBounds(e,r);return this._fitInternal(n,r,i)}fitScreenCoordinates(r,i,n,o,a){let s=e.P.convert(r),l=e.P.convert(i),u=new e.P(Math.min(s.x,l.x),Math.min(s.y,l.y)),c=new e.P(Math.max(s.x,l.x),Math.max(s.y,l.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(s,l))return this;let h=this.transform.pointLocation3D(u),p=this.transform.pointLocation3D(c),d=this.transform.pointLocation3D(new e.P(u.x,c.y)),f=this.transform.pointLocation3D(new e.P(c.x,u.y)),m=[Math.min(h.lng,p.lng,d.lng,f.lng),Math.min(h.lat,p.lat,d.lat,f.lat)],g=[Math.max(h.lng,p.lng,d.lng,f.lng),Math.max(h.lat,p.lat,d.lat,f.lat)],_=o&&o.pitch?o.pitch:this.getPitch(),y=this._cameraForBounds(this.transform,m,g,n,_,o);return this._fitInternal(y,o,a)}_fitInternal(r,i,n){return r?(i=e.e(r,i)).linear?this.easeTo(i,n):this.flyTo(i,n):this}jumpTo(r,i){this.stop();let n=r.preloadOnly?this.transform.clone():this.transform,o=!1,a=!1,s=!1;return"zoom"in r&&n.zoom!==+r.zoom&&(o=!0,n.zoom=+r.zoom),void 0!==r.center&&(n.center=e.bq.convert(r.center)),"bearing"in r&&n.bearing!==+r.bearing&&(a=!0,n.bearing=+r.bearing),"pitch"in r&&n.pitch!==+r.pitch&&(s=!0,n.pitch=+r.pitch),null==r.padding||n.isPaddingEqual(r.padding)||(n.padding=r.padding),r.preloadOnly?(this._preloadTiles(n),this):(this.fire(new e.b("movestart",i)).fire(new e.b("move",i)),o&&this.fire(new e.b("zoomstart",i)).fire(new e.b("zoom",i)).fire(new e.b("zoomend",i)),a&&this.fire(new e.b("rotatestart",i)).fire(new e.b("rotate",i)).fire(new e.b("rotateend",i)),s&&this.fire(new e.b("pitchstart",i)).fire(new e.b("pitch",i)).fire(new e.b("pitchend",i)),this.fire(new e.b("moveend",i)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w(ot),this.transform.getFreeCameraOptions()}setFreeCameraOptions(r,i){let n=this.transform;if(!n.projection.supportsFreeCamera)return e.w(ot),this;this.stop();let o=n.zoom,a=n.pitch,s=n.bearing;n.setFreeCameraOptions(r);let l=o!==n.zoom,u=a!==n.pitch,c=s!==n.bearing;return this.fire(new e.b("movestart",i)).fire(new e.b("move",i)),l&&this.fire(new e.b("zoomstart",i)).fire(new e.b("zoom",i)).fire(new e.b("zoomend",i)),c&&this.fire(new e.b("rotatestart",i)).fire(new e.b("rotate",i)).fire(new e.b("rotateend",i)),u&&this.fire(new e.b("pitchstart",i)).fire(new e.b("pitch",i)).fire(new e.b("pitchend",i)),this.fire(new e.b("moveend",i)),this}easeTo(r,i){let n,o,a,s,l;this._stop(!1,r.easeId),(!1===(r=e.e({offset:[0,0],duration:500,easing:e.d8},r)).animate||this._prefersReducedMotion(r))&&(r.duration=0);let u=this.transform,c=this.getZoom(),h=this.getBearing(),p=this.getPitch(),d=this.getPadding(),f="zoom"in r?+r.zoom:c,m="bearing"in r?this._normalizeBearing(r.bearing,h):h,g="pitch"in r?+r.pitch:p,_=this._extendPadding(r.padding),y=e.P.convert(r.offset);if("globe"===u.projection.name){let i=e.O.fromLngLat(u.center),s=y.rotate(-u.angle);i.x+=s.x/u.worldSize,i.y+=s.y/u.worldSize;let l=i.toLngLat(),c=e.bq.convert(r.center||l);this._normalizeCenter(c),n=u.centerPoint.add(s),o=new e.P(i.x,i.y).mult(u.worldSize),a=new e.P(e.a8(c.lng),e.ah(c.lat)).mult(u.worldSize).sub(o)}else{n=u.centerPoint.add(y);let i=u.pointLocation(n),s=e.bq.convert(r.center||i);this._normalizeCenter(s),o=u.project(i),a=u.project(s).sub(o)}let v=u.zoomScale(f-c);r.around&&(s=e.bq.convert(r.around),l=u.locationPoint(s));let x=this._zooming||f!==c,b=this._rotating||h!==m,w=this._pitching||g!==p,E=!u.isPaddingEqual(_),S=u=>S=>
106{if(x&&(u.zoom=e.X(c,f,S)),b&&(u.bearing=e.X(h,m,S)),w&&(u.pitch=e.X(p,g,S)),E&&(u.interpolatePadding(d,_,S),n=u.centerPoint.add(y)),s)u.setLocationAtPoint(s,l);else{let e=u.zoomScale(u.zoom-c),r=Math.pow(f>c?Math.min(2,v):Math.max(.5,v),1-S),i=u.unproject(o.add(a.mult(S*r)).mult(e));u.setLocationAtPoint(u.renderWorldCopies?i.wrap():i,n)}return r.preloadOnly||this._fireMoveEvents(i),u};if(r.preloadOnly){let e=this._emulate(S,r.duration,u);return this._preloadTiles(e),this}let T={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=x,this._rotating=b,this._pitching=w,this._padding=E,this._easeId=r.easeId,this._prepareEase(i,r.noMoveStart,T),this._ease(S(u),e=>{"sea"===u.cameraElevationReference&&u.recenterOnTerrain(),this._afterEase(i,e)},r),this}_prepareEase(r,i,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),i||n.moving||this.fire(new e.b("movestart",r)),this._zooming&&!n.zooming&&this.fire(new e.b("zoomstart",r)),this._rotating&&!n.rotating&&this.fire(new e.b("rotatestart",r)),this._pitching&&!n.pitching&&this.fire(new e.b("pitchstart",r))}_fireMoveEvents(r){this.fire(new e.b("move",r)),this._zooming&&this.fire(new e.b("zoom",r)),this._rotating&&this.fire(new e.b("rotate",r)),this._pitching&&this.fire(new e.b("pitch",r))}_afterEase(r,i){if(this._easeId&&i&&this._easeId===i)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";let n=this._zooming,o=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.b("zoomend",r)),o&&this.fire(new e.b("rotateend",r)),a&&this.fire(new e.b("pitchend",r)),this.fire(new e.b("moveend",r))}flyTo(r,i){if(this._prefersReducedMotion(r)){let n=e.af(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,i)}this.stop(),r=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.d8},r);let n=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),u="zoom"in r?e.ad(+r.zoom,n.minZoom,n.maxZoom):o,c="bearing"in r?this._normalizeBearing(r.bearing,a):a,h="pitch"in r?+r.pitch:s,p=this._extendPadding(r.padding),d=n.zoomScale(u-o),f=e.P.convert(r.offset),m=n.centerPoint.add(f),g=n.pointLocation(m),_=e.bq.convert(r.center||g);this._normalizeCenter(_);let y=n.project(g),v=n.project(_).sub(y),x=r.curve,b=Math.max(n.width,n.height),w=b/d,E=v.mag();if("minZoom"in r){let i=e.ad(Math.min(r.minZoom,o,u),n.minZoom,n.maxZoom);x=Math.sqrt(b/n.zoomScale(i-o)/E*2)}let S=x*x;function T(e){let r=(w*w-b*b+(e?-1:1)*S*S*E*E)/(2*(e?w:b)*S*E);return Math.log(Math.sqrt(r*r+1)-r)}function I(e){return(Math.exp(e)-Math.exp(-e))/2}function M(e){return(Math.exp(e)+Math.exp(-e))/2}let C=T(0),A=function(e){return M(C)/M(C+x*e)},P=function(e){var r;return b*((M(C)*(I(r=C+x*e)/M(r))-I(C))/S)/E},L=(T(1)-C)/x;if(1e-6>Math.abs(E)||!isFinite(L)){if(1e-6>Math.abs(b-w))return this.easeTo(r,i);let e=w<b?-1:1;L=Math.abs(Math.log(w/b))/x,P=function(){return 0},A=function(r){return Math.exp(e*x*r)}}r.duration="duration"in r?+r.duration:1e3*L/("screenSpeed"in r?r.screenSpeed/x:+r.speed),r.maxDuration&&r.duration>r.maxDuration&&(r.duration=0);let O=a!==c,D=h!==s,R=!n.isPaddingEqual(p),k=n=>d=>{let g=d*L,x=1/A(g);n.zoom=1===d?u:o+n.scaleZoom(x),O&&(n.bearing=e.X(a,c,d)),D&&(n.pitch=e.X(s,h,d)),R&&(n.interpolatePadding(l,p,d),m=n.centerPoint.add(f));let b=1===d?_:n.unproject(y.add(v.mult(P(g))).mult(x));return n.setLocationAtPoint(n.renderWorldCopies?b.wrap():b,m),n._updateCameraOnTerrain(),r.preloadOnly||this._fireMoveEvents(i),n};if(r.preloadOnly){let e=this._emulate(k,r.duration,n);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=O,this._pitching=D,this._padding=R,this._prepareEase(i,!1),this._ease(k(n),()=>this._afterEase(i),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_stop(e,r){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){let e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,r)}if(!e){let e=this.handlers;e&&e.stop(!1)}return this}_ease(r,i,n){!1===n.animate||0===n.duration?(r(1),i()):(this._easeStart=e.f.now(),this._easeOptions=n,this._onEaseFrame=r,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let r=Math.min((e.f.now()-this._easeStart)/this._easeOptions.duration,1),i=this._onEaseFrame;i&&i(this._easeOptions.easing(r)),r<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(r,i){let n=Math.abs((r=e.bk(r,-180,180))-i);return Math.abs(r-360-i)<n&&(r-=360),Math.abs(r+360-i)<n&&(r+=360),r}_normalizeCenter(e){let r=this.transform;if(r.maxBounds||"globe"!==r.projection.name&&!r.renderWorldCopies)return;let i=e.lng-r.center.lng;e.lng+=i>180?-360:360*(i<-180)}_prefersReducedMotion(r){return this._respectPrefersReducedMotion&&e.f.prefersReducedMotion&&!(r&&r.essential)}_emulate(e,r,i){let n=Math.ceil(15*r/1e3),o=[],a=e(i.clone());for(let e=0;e<=n;e++){let r=a(e/n);o.push(r.clone())}return o}_preloadTiles(e,r){}}class oi{constructor(r={}){this.options=r,e.a$(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){let r=this.options&&this.options.compact;return this._map=e,this._container=s("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=s("button","mapboxgl-ctrl-attrib-button",this._container),s("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=s("div","mapboxgl-ctrl-attrib-inner",this._container),r&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===r&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(e,r){let i=this._map._getUIString(`AttributionControl.${r}`);e.removeAttribute("title"),e.firstElementChild&&e.firstElementChild.setAttribute("title",i)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
106se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let r=this._editLink;r||(r=this._editLink=this._container.querySelector(".mapbox-improve-map"));let i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.dd.ACCESS_TOKEN}];if(r){let n=i.reduce((e,r,n)=>(r.value&&(e+=`${r.key}=${r.value}${n<i.length-1?"&":""}`),e),"?");r.href=`${e.dd.FEEDBACK_URL}/${n}#${nf(this._map,!0)}`,r.rel="noopener nofollow",this._setElementTitle(r,"MapFeedback")}}_updateData(e){e&&("metadata"===e.sourceDataType||"visibility"===e.sourceDataType||"style"===e.dataType)&&(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let r=this._map.style._mergedSourceCaches;for(let i in r){let n=r[i];if(n.used){let r=n.getSource();r.attribution&&0>e.indexOf(r.attribution)&&e.push(r.attribution)}}e.sort((e,r)=>e.length-r.length),e=e.filter((r,i)=>{for(let n=i+1;n<e.length;n++)if(e[n].indexOf(r)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));let i=e.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class on{constructor(){e.a$(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=s("div","mapboxgl-ctrl");let r=s("a","mapboxgl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://www.mapbox.com/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;let e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(let r in e){let i=e[r].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){let e=this._container.children;if(e.length){let r=e[0];this._map.getCanvasContainer().offsetWidth<250?r.classList.add("mapboxgl-compact"):r.classList.remove("mapboxgl-compact")}}}class oo{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let r=++this._id;return this._queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){let r=this._currentlyRunning;for(let i of r?this._queue.concat(r):this._queue)if(i.id===e)return void(i.cancelled=!0)}run(e=0){let r=this._currentlyRunning=this._queue;for(let i of(this._queue=[],r))if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function oa(r,i,n){if(r=new e.bq(r.lng,r.lat),i){let o=new e.bq(r.lng-360,r.lat),a=new e.bq(r.lng+360,r.lat),s=360*Math.ceil(Math.abs(r.lng-n.center.lng)/360),l=n.locationPoint(r).distSqr(i),u=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint(o).distSqr(i)<l&&(u||Math.abs(o.lng-n.center.lng)<s)?r=o:n.locationPoint(a).distSqr(i)<l&&(u||Math.abs(a.lng-n.center.lng)<s)&&(r=a)}for(;Math.abs(r.lng-n.center.lng)>180;){let e=n.locationPoint(r);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;r.lng>n.center.lng?r.lng-=360:r.lng+=360}return r}
106let os={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class ol extends e.E{constructor(r,i){if(super(),(r instanceof HTMLElement||i)&&(r=e.e({element:r},i)),e.a$(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=r&&r.occludedOpacity||.2,r&&r.element)this._element=r.element,this._offset=e.P.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=s("div");const i=l("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},this._element),n=l("radialGradient",{id:"shadowGradient"},l("defs",{},i));l("stop",{offset:"10%","stop-opacity":.4},n),l("stop",{offset:"100%","stop-opacity":.05},n),l("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},i),l("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},i),l("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},i),l("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},i),this._offset=e.P.convert(r&&r.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()});const n=this._element.classList;for(const e in os)n.remove(`mapboxgl-marker-anchor-${e}`);n.add(`mapboxgl-marker-anchor-${this._anchor}`);const o=r&&r.className?r.className.trim().split(/\s+/):[];n.add(...o),this._popup=null}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){let e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=e.bq.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){let r=Math.sqrt(91.125);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(24.6+r)],"bottom-right":[-r,-1*(24.6+r)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,e._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","fal
106se")}return this}_onKeyPress(e){let r=e.code,i=e.charCode||e.keyCode;"Space"!==r&&"Enter"!==r&&32!==i&&13!==i||this.togglePopup()}_onMapClick(e){let r=e.originalEvent.target,i=this._element;this._popup&&(r===i||i.contains(r))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let e=this._popup;return e&&(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true"))),this}_behindTerrain(){let e=this._map,r=this._pos;if(!e||!r)return!1;let i=e.unproject(r),n=e.getFreeCameraOptions();if(!n.position)return!1;let o=n.position.toLngLat();return o.distanceTo(i)<.9*o.distanceTo(this._lngLat)}_evaluateOpacity(){let r,i=this._map;if(!i)return;let n=this._pos;if(!n||n.x<0||n.x>i.transform.width||n.y<0||n.y>i.transform.height)return void this._clearFadeTimer();let o=i.unproject(n);i._showingGlobe()&&e.de(i.transform,this._lngLat)?r=0:(r=1-i._queryFogOpacity(o),i.transform._terrainEnabled()&&i.getTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity=`${r}`,this._element.style.pointerEvents=r>0?"auto":"none",this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){let e=this._pos;if(!e||!this._map)return;let r=this._offset.mult(this._scale);this._element.style.transform=`
107            translate(${e.x}px,${e.y}px)
108            ${os[this._anchor]}
109            ${this._calculateXYTransform()} ${this._calculateZTransform()}
110            translate(${r.x}px,${r.y}px)
111        `}_calculateXYTransform(){let r=this._pos,i=this._map,n=this.getPitchAlignment();if(!i||!r||"map"!==n)return"";if(!i._showingGlobe()){let e=i.getPitch();return e?`rotateX(${e}deg)`:""}let o=e.bI(e.df(i.transform,this._lngLat)),a=r.sub(e.dg(i.transform)),s=Math.abs(a.x)+Math.abs(a.y);if(0===s)return"";let l=o/s;return`rotateX(${-a.y*l}deg) rotateY(${a.x*l}deg)`}_calculateZTransform(){let r=this._pos,i=this._map;if(!i||!r)return"";let n=0,o=this.getRotationAlignment();if("map"===o)if(i._showingGlobe()){let r=i.project(new e.bq(this._lngLat.lng,this._lngLat.lat+.001)),o=i.project(new e.bq(this._lngLat.lng,this._lngLat.lat-.001)).sub(r);n=e.bI(Math.atan2(o.y,o.x))-90}else n=-i.getBearing();else if("horizon"===o){let o=e.S(4,6,i.getZoom()),a=e.dg(i.transform);a.y+=o*i.transform.height;let s=r.sub(a),l=e.bI(Math.atan2(s.y,s.x));n=(l>90?l-270:l+90)*(1-o)}return(n+=this._rotation)?`rotateZ(${n}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);let r=this._map;
111r&&(r.transform.renderWorldCopies&&(this._lngLat=oa(this._lngLat,this._pos,r.transform)),this._pos=r.project(this._lngLat),!0===e?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),r._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(r._showingGlobe()||r.getTerrain()||r.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(r){return this._offset=e.P.convert(r),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(r){let i=this._map;if(!i)return;let n=this._pointerdownPos,o=this._positionDelta;if(n&&o){if(!this._isDragging){let e=this._clickTolerance||i._clickTolerance;if(r.point.dist(n)<e)return;this._isDragging=!0}this._pos=r.point.sub(o),this._lngLat=i.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.b("dragstart"))),this.fire(new e.b("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;let r=this._map;r&&(r.off("mousemove",this._onMove),r.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.b("dragend")),this._state="inactive"}_addDragHandler(e){let r=this._map,i=this._pos;r&&i&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(i),this._pointerdownPos=e.point,this._state="pending",r.on("mousemove",this._onMove),r.on("touchmove",this._onMove),r.once("mouseup",this._onUp),r.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;let r=this._map;return r&&(e?(r.on("mousedown",this._addDragHandler),r.on("touchstart",this._addDragHandler)):(r.off("mousedown",this._addDragHandler),r.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||"auto",this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}let ou={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"};function oc(r=new e.P(0,0),i="bottom"){if("number"==typeof r){let n=Math.round(Math.sqrt(.5*Math.pow(r,2)));switch(i){case"top":return new e.P(0,r);case"top-left":return new e.P(n,n);case"top-right":return new e.P(-n,n);case"bottom":return new e.P(0,-r);case"bottom-left":return new e.P(n,-n);case"bottom-right":return new e.P(-n,-n);case"left":return new e.P(r,0);case"right":return new e.P(-r,0)}return new e.P(0,0)}return r instanceof e.P||Array.isArray(r)?e.P.convert(r):e.P.convert(r[i]||[0,0])}class oh{constructor(e){this.jumpTo(e)}getValue(r){if(r<=this._startTime)return this._start;if(r>=this._endTime)return this._end;let i=e.ch((r-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,r,i){this._start=this.getValue(r),this._end=e,this._startTime=r,this._endTime=r+i}}class op{registerParameter(e,r,i,n,o){}registerButton(e,r,i){}registerBinding(e,r,i,n){}refreshUI(){}}let od={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},of={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileC
111acheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1},om={showCompass:!0,showZoom:!0,visualizePitch:!1};class og{constructor(r,i,n=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new nN({clickTolerance:r.dragRotate._mouseRotate._clickTolerance}),this.map=r,n&&(this.mousePitch=new nF({clickTolerance:r.dragRotate._mousePitch._clickTolerance})),e.a$(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset)}down(e,r){this.mouseRotate.mousedown(e,r),this.mousePitch&&this.mousePitch.mousedown(e,r),h()}move(e,r){let i=this.map,n=this.mouseRotate.mousemoveWindow(e,r),o=n&&n.bearingDelta;if(o&&i.setBearing(i.getBearing()+o),this.mousePitch){let n=this.mousePitch.mousemoveWindow(e,r),o=n&&n.pitchDelta;o&&i.setPitch(i.getPitch()+o)}}off(){let e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart,{passive:!1}),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){p(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(r){this.down(e.e({},r,{ctrlKey:!0,preventDefault:()=>r.preventDefault()}),m(this.element,r)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,m(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=g(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=g(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}let o_={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},oy={maxWidth:100,unit:"metric"},ov={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"};return{version:e.du,supported:o,setRTLTextPlugin:e.dw,getRTLTextPluginStatus:e.dx,Map:class extends or{constructor(r){const i=r;if(null!=(r=e.e({},of,r)).minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw Error("maxPitch must be less than or equal to 85");if(r.antialias&&e.dh(window)&&(r.antialias=!1,e.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new rg(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),r),this._repaint=!!r.repaint,this._interactive=r.interactive,this._minTileCacheSize=r.minTileCacheSize,this._maxTileCacheSize=r.maxTileCacheSize,this._failIfMajorPerformanceCaveat=r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=r.preserveDrawingBuffer,this._antialias=r.antialias,this._trackResize=r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=r.crossSourceCollisions,this._collectResourceTiming=r.collectResourceTiming,this._language=this._parseLanguage(r.language),this._worldview=r.worldview,this._renderTaskQueue=new oo,this._domRenderTaskQueue=new oo,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.aF(),this._locale=e.e({},od,r.locale),this._clickTolerance=r.clickTolerance,this._cooperativeGestures=r.cooperativeGestures,this._performanceMetricsCollection=r.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new oh(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new e.di(r.transformRequest,r.accessToken,r.testMode),this._silenceAuthErrors=!!r.testMode,this._contextCreateOptions=r.contextCreateOptions?{...r.contextCreateOptions}:{},"string"==typeof r.container){const e=document.getElementById(r.container);if(!e)throw Error(`Container '${r.container.toString()}' not found.`);this._container=e}else{if(!(r.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(this._container.childNodes.length>0&&e.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),r.maxBounds&&this.setMaxBounds(r.maxBounds),e.a$(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp=r.devtools?new op(this):new op,this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},()=>{this._update()}),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._setupPainter(),void 0===this.painter)throw Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new oe(this,r),this._localFontFamily=r.localFontFamily,this._localIdeographFontFamily=r.localIdeographFontFamily,(r.style||!r.testMode)&&this.setStyle(r.style||e.dd.DEFAULT_STYLE,{config:r.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),r.projection&&this.setProjection(r.projection),r.hash&&(this._hash=new nd("string"==typeof r.hash&&r.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==i.center&&null==i.zoom||(this.transform._unmodified=!1),this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch});
111const n=r.bounds;n&&(this.resize(),this.fitBounds(n,e.e({},r.fitBoundsOptions,{duration:0})))}this.resize(),r.attributionControl&&this.addControl(new oi({customAttribution:r.customAttribution})),this._logoControl=new on,this.addControl(this._logoControl,r.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()}),this.on("data",r=>{this._update("style"===r.dataType),this.fire(new e.b(`${r.dataType}data`,r))}),this.on("dataloading",r=>{this.fire(new e.b(`${r.dataType}dataloading`,r))})}_getMapId(){return this._mapId}addControl(r,i){if(void 0===i&&(i=r.getDefaultPosition?r.getDefaultPosition():"top-right"),!r||!r.onAdd)return this.fire(new e.a(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=r.onAdd(this);this._controls.push(r);let o=this._controlPositions[i];return -1!==i.indexOf("bottom")?o.insertBefore(n,o.firstChild):o.appendChild(n),this}removeControl(r){if(!r||!r.onRemove)return this.fire(new e.a(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(r);return i>-1&&this._controls.splice(i,1),r.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(r){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));let i=!this._moving;return i&&this.fire(new e.b("movestart",r)).fire(new e.b("move",r)),this.fire(new e.b("resize",r)),i&&this.fire(new e.b("moveend",r)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(r){return this.transform.setMaxBounds(e.ag.convert(r)),this._update()}setMinZoom(r){if((r=null==r?-2:r)>=-2&&r<=this.transform.maxZoom)return this.transform.minZoom=r,this._update(),this.getZoom()<r?this.setZoom(r):this.fire(new e.b("zoomstart")).fire(new e.b("zoom")).fire(new e.b("zoomend")),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(r){if((r=null==r?22:r)>=this.transform.minZoom)return this.transform.maxZoom=r,this._update(),this.getZoom()>r?this.setZoom(r):this.fire(new e.b("zoomstart")).fire(new e.b("zoom")).fire(new e.b("zoomend")),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(r){if((r=null==r?0:r)<0)throw Error("minPitch must be greater than or equal to 0");if(r>=0&&r<=this.transform.maxPitch)return this.transform.minPitch=r,this._update(),this.getPitch()<r?this.setPitch(r):this.fire(new e.b("pitchstart")).fire(new e.b("pitch")).fire(new e.b("pitchend")),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(r){if((r=null==r?85:r)>85)throw Error("maxPitch must be less than or equal to 85");if(r>=this.transform.minPitch)return this.transform.maxPitch=r,this._update(),this.getPitch()>r?this.setPitch(r):this.fire(new e.b("pitchstart")).fire(new e.b("pitch")).fire(new e.b("pitchend")),this;throw Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map(e=>"auto"===e?navigator.language:e):e}setLanguage(e){let r=this._parseLanguage(e);if(!this.style||r===this._language)return this;for(let e of(this._language=r,this.style.reloadSources(),this._controls))e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview&&(this._worldview=e,this.style.reloadSources()),this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.projection)}_updateProjectionTransition(){let r;if("globe"!==this.getProjection().name)return;let i=this.transform,n=i.projection.name;"globe"===n&&i.zoom>=e.bA?(i.setMercatorFromTransition(),r=!0):"mercator"===n&&i.zoom<e.bA&&(i.setProjection({name:"globe"}),r=!0),r&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
111Update())}_prioritizeAndUpdateProjection(e,r){return this._updateProjection(e||r||{name:"mercator"})}_updateProjection(r){let i;return i="globe"===r.name&&this.transform.zoom>=e.bA?this.transform.setMercatorFromTransition():this.transform.setProjection(r),this.style.applyProjectionUpdate(),i&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(r){return this.transform.locationPoint3D(e.bq.convert(r))}unproject(r){return this.transform.pointLocation3D(e.P.convert(r))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,r,i){if("mouseenter"===e||"mouseover"===e){let n=!1,o=o=>{let a=r.filter(e=>this.getLayer(e)),s=a.length?this.queryRenderedFeatures(o.point,{layers:a}):[];s.length?n||(n=!0,i.call(this,new nE(e,this,o.originalEvent,{features:s}))):n=!1};return{layers:new Set(r),listener:i,delegates:{mousemove:o,mouseout:()=>{n=!1}}}}if("mouseleave"===e||"mouseout"===e){let n=!1,o=o=>{let a=r.filter(e=>this.getLayer(e));(a.length?this.queryRenderedFeatures(o.point,{layers:a}):[]).length?n=!0:n&&(n=!1,i.call(this,new nE(e,this,o.originalEvent)))},a=r=>{n&&(n=!1,i.call(this,new nE(e,this,r.originalEvent)))};return{layers:new Set(r),listener:i,delegates:{mousemove:o,mouseout:a}}}{let n=e=>{let n=r.filter(e=>this.getLayer(e)),o=n.length?this.queryRenderedFeatures(e.point,{layers:n}):[];o.length&&(e.features=o,i.call(this,e),delete e.features)};return{layers:new Set(r),listener:i,delegates:{[e]:n}}}}on(e,r,i){if(void 0===i)return super.on(e,r);if(Array.isArray(r)||(r=[r]),r){for(let e of r)if(!this._isValidId(e))return this}let n=this._createDelegatedListener(e,r,i);for(let r in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n),n.delegates)this.on(r,n.delegates[r]);return this}once(e,r,i){if(void 0===i)return super.once(e,r);if(Array.isArray(r)||(r=[r]),r){for(let e of r)if(!this._isValidId(e))return this}let n=this._createDelegatedListener(e,r,i);for(let e in n.delegates)this.once(e,n.delegates[e]);return this}off(e,r,i){if(void 0===i)return super.off(e,r);for(let e of r=new Set(Array.isArray(r)?r:[r]))if(!this._isValidId(e))return this;let n=(e,r)=>{if(e.size!==r.size)return!1;for(let i of e)if(!r.has(i))return!1;return!0},o=this._delegatedListeners?this._delegatedListeners[e]:void 0;return o&&(e=>{for(let o=0;o<e.length;o++){let a=e[o];if(a.listener===i&&n(a.layers,r)){for(let e in a.delegates)this.off(e,a.delegates[e]);return e.splice(o,1),this}}})(o),this}queryRenderedFeatures(r,i){if(!this.style)return[];if(void 0!==i||void 0===r||r instanceof e.P||Array.isArray(r)||(i=r,r=void 0),r=r||[[0,0],[this.transform.width,this.transform.height]],(i=i||{}).layers&&Array.isArray(i.layers)){for(let e of i.layers)if(!this._isValidId(e))return[]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(e,r){return this._isValidId(e)?this.style.querySourceFeatures(e,r):[]}isPointOnSurface(r){let{name:i}=this.transform.projection;return"globe"!==i&&"mercator"!==i&&e.w(`${i} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(e.P.convert(r))}setStyle(r,i){return i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i),this.style&&r&&!1!==i.diff&&i.localFontFamily===this._localFontFamily&&i.localIdeographFontFamily===this._localIdeographFontFamily&&!i.config?(this.style._diffStyle(r,(n,o)=>{n?(e.w(`Unable to perform style diff: ${String(n.message||n.error||n)}. Rebuilding the style from scratch.`),this._updateStyle(r,i)):o&&this._update(!0)},()=>{this._postStyleLoadEvent()}),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(r,i))}_getUIString(e){let r=this._locale[e];if(null==r)throw Error(`Missing UI string '${e}'`);return r}_updateStyle(r,i){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),r){let n=e.e({},i);
111i&&i.config&&(n.initialConfig=i.config,delete n.config),this.style=new rP(this,n).setEventedParent(this,{style:this.style}).load(r)}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new rP(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(r){return null==r?(this.fire(new e.a(Error("IDs can't be empty."))),!1):!e.c9(r)||(this.fire(new e.a(Error(`IDs can't contain special symbols: "${r}".`))),!1)}addSource(e,r){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,r),this._update(!0)):this}isSourceLoaded(e){return!!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(e,r,i){this._lazyInitEmptyStyle(),this.style.addSourceType(e,r,i)}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(r,i,{pixelRatio:n=1,sdf:o=!1,stretchX:a,stretchY:s,content:l}={}){if(this._lazyInitEmptyStyle(),i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap){let{width:u,height:c,data:h}=e.f.getImageData(i);this.style.addImage(r,{data:new e.h({width:u,height:c},h),pixelRatio:n,stretchX:a,stretchY:s,content:l,sdf:o,version:0})}else if(void 0===i.width||void 0===i.height)this.fire(new e.a(Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{let{width:u,height:c}=i;this.style.addImage(r,{data:new e.h({width:u,height:c},new Uint8Array(i.data)),pixelRatio:n,stretchX:a,stretchY:s,content:l,sdf:o,version:0,userImage:i}),i.onAdd&&i.onAdd(this,r)}}updateImage(r,i){this._lazyInitEmptyStyle();let n=this.style.getImage(r);if(!n)return void this.fire(new e.a(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let o=i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap?e.f.getImageData(i):i,{width:a,height:s}=o,l=o.data;if(void 0===a||void 0===s)return void this.fire(new e.a(Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==n.data.width||s!==n.data.height)return void this.fire(new e.a(Error(`The width and height of the updated image (${a}, ${s})
112                must be that same as the previous version of the image
113                (${n.data.width}, ${n.data.height})`)));let u=!(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap);n.data.replace(l,u),this.style.updateImage(r,n)}hasImage(r){return r?!!this.style&&!!this.style.getImage(r):(this.fire(new e.a(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(r,i){e.d(this._requestManager.transformRequest(r,e.R.Image),(r,n)=>{i(r,n instanceof HTMLImageElement?e.f.getImageData(n):n)})}listImages(){return this.style.listImages()}addModel(e,r){this._lazyInitEmptyStyle(),this.style.addModel(e,r)}hasModel(r){return r?this.style.hasModel(r):(this.fire(new e.a(Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e)}listModels(){return this.style.listModels()}addLayer(e,r){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,r),this._update(!0)):this}getSlot(e){let r=this.getLayer(e);return r&&r.slot||null}setSlot(e,r){return this.style.setSlot(e,r),this.style.mergeLayers(),this._update(!0)}addImport(e,r){return this.style.addImport(e,r),this}updateImport(e,r){return"string"!=typeof r&&r.id!==e?(this.removeImport(e),this.addImport(r)):(this.style.updateImport(e,r),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,r){return this.style.moveImport(e,r),this._update(!0)}moveLayer(e,r){return this._isValidId(e)?(this.style.moveLayer(e,r),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){return this._isValidId(e)?this.style.getOwnLayer(e):null}setLayerZoomRange(e,r,i){return this._isValidId(e)?(this.style.setLayerZoomRange(e,r,i),this._update(!0)):this}setFilter(e,r,i={}){return this._isValidId(e)?(this.style.setFilter(e,r,i),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,r,i,n={}){return this._isValidId(e)?(this.style.setPaintProperty(e,r,i,n),this._update(!0)):this}getPaintProperty(e,r){return this._isValidId(e)?this.style.getPaintProperty(e,r):null}setLayoutProperty(e,r,i,n={}){return this._isValidId(e)?(this.style.setLayoutProperty(e,r,i,n),this._update(!0)):this}getLayoutProperty(e,r){return this._isValidId(e)?this.style.getLayoutProperty(e,r):null}getSchema(e){return this.style.getSchema(e)}setSchema(e,r){return this.style.setSchema(e,r),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,r){return this.style.setConfig(e,r),this._update(!0)}getConfigProperty(e,r){return this.style.getConfigProperty(e,r)}
113setConfigProperty(e,r,i){return this.style.setConfigProperty(e,r,i),this._update(!0)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){let r=e[0];r.properties?this.style.setFlatLight(r.properties,r.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){let e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e,r={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(r){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.bq.convert(r),this.transform):0}setFeatureState(e,r){return this._isValidId(e.source)?(this.style.setFeatureState(e,r),this._update()):this}removeFeatureState(e,r){return this._isValidId(e.source)?(this.style.removeFeatureState(e,r),this._update()):this}getFeatureState(e){return this._isValidId(e.source)?this.style.getFeatureState(e):null}_updateContainerDimensions(){if(!this._container)return;let e=this._container.getBoundingClientRect().width||400,r=this._container.getBoundingClientRect().height||300,i,n,o,a=this._container;for(;a&&(!n||!o);){let e=window.getComputedStyle(a).transform;e&&"none"!==e&&((i=e.match(/matrix.*\((.+)\)/)[1].split(", "))[0]&&"0"!==i[0]&&"1"!==i[0]&&(n=i[0]),i[3]&&"0"!==i[3]&&"1"!==i[3]&&(o=i[3])),a=a.parentElement}this._containerWidth=n?Math.abs(e/n):e,this._containerHeight=o?Math.abs(r/o):r}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){let e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=s("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();let r=this._canvasContainer=s("div","mapboxgl-canvas-container",e);this._canvas=s("canvas","mapboxgl-canvas",r),this._interactive&&(r.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);let i=this._controlContainer=s("div","mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(e=>{n[e]=s("div",`mapboxgl-ctrl-${e}`,i)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(r,i){let n=e.f.devicePixelRatio||1;this._canvas.width=n*Math.ceil(r),this._canvas.height=n*Math.ceil(i),this._canvas.style.width=`${r}px`,this._canvas.style.height=`${i}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){let r=this._markers.indexOf(e);-1!==r&&this._markers.splice(r,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){let r=this._popups.indexOf(e);-1!==r&&this._popups.splice(r,1)}_setupPainter(){let r=e.e({},o.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl2",r);i?(e.dj(i,!0),this.painter=new nh(i,this._contextCreateOptions,this.transform,this._tp),this.on("data",e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)}),e.dk.testSupport(i)):this.fire(new e.a(Error("Failed to initialize WebGL")))}_contextLost(r){r.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.b("webglcontextlost",{originalEvent:r}))}_contextRestored(r){this._setupPainter(),this.resize(),this._update(),this.fire(new e.b("webglcontextrestored",{originalEvent:r}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(r){let i;this.fire(new e.b("renderstart"));let n=this.painter.context.extTimerQuery,o=e.f.now(),a=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(i=a.createQuery(),a.beginQuery(n.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&
113(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(r),this._domRenderTaskQueue.run(r),this._removed)return;this._updateProjectionTransition();let s=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;let r=this.transform.zoom,i=this.transform.pitch,n=e.f.now(),o=new e.N(r,{now:n,fadeDuration:s,pitch:i,transition:this.style.transition});this.style.update(o)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let l=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),l=this._updateAverageElevation(o),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):l=this._updateAverageElevation(o),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,s,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.b("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.b("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){let r=e.f.now()-o;a.endQuery(n.TIME_ELAPSED_EXT),setTimeout(()=>{let n=a.getQueryParameter(i,a.QUERY_RESULT)/1e6;a.deleteQuery(i),this.fire(new e.b("gpu-timing-frame",{cpuTime:r,gpuTime:n}))},50)}if(this.listens("gpu-timing-layer")){let r=this.painter.collectGpuTimers();setTimeout(()=>{let i=this.painter.queryGpuTimers(r);this.fire(new e.b("gpu-timing-layer",{layerTimes:i}))},50)}if(this.listens("gpu-timing-deferred-render")){let r=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{let i=this.painter.queryGpuTimeDeferredRender(r);this.fire(new e.b("gpu-timing-deferred-render",{gpuTime:i}))},50)}let u=this._sourcesDirty||this._styleDirty||this._placementDirty||l;if(u||this._repaint)this.triggerRepaint();else{let r=!this.isMoving()&&this.loaded();if(r&&(l=this._updateAverageElevation(o,!0)),l)this.triggerRepaint();else if(this._triggerFrame(!1),r&&(this.fire(new e.b("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){let r=this._calculateSpeedIndex();this.fire(new e.b("speedindexcompleted",{speedIndex:r})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||u||(this._fullyLoaded=!0,this._performanceMetricsCollection&&e.dl(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(let r of this._markers)e&&!this.getRenderWorldCopies()&&(r._lngLat=r._lngLat.wrap()),r._update();for(let r of this._popups)!e||this.getRenderWorldCopies()||r._trackPointer||(r._lngLat=r._lngLat.wrap()),r._update()}_updateAverageElevation(e,r=!1){let i=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);let n=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(n||(r||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){let r=this.transform.averageElevation,o=this.transform.sampleAverageElevation();this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(o)?o=0:this._averageElevationLastSampledAt=e;let a=Math.abs(r-o);if(a>1){if(this._isInitialLoad||n)return this._averageElevation.jumpTo(o),i(o);this._averageElevation.easeTo(o,e,300)}else if(a>1e-4)return this._averageElevation.jumpTo(o),i(o)}return!!this._averageElevation.isEasing(e)&&i(this._averageElevation.getValue(e))}_authenticate(){e.dm(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,r=>{if(r&&(r.message===e.dn||401===r.status)){let r=this.painter.context.gl;e.dj(r,!1),this._logoControl instanceof on&&this._logoControl._updateLogo(),r&&r.clear(r.DEPTH_BUFFER_BIT|r.COLOR_BUFFER_BIT|r.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.a(Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),e.dp(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&e.dq(this._requestManager._customAccessToken,{map:this,skuToken:this._requestManager._skuToken,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){let e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){let e=this.painter.canvasCopy(),r=this.painter.getCanvasCopiesAndTimestamps();r.timeStamps.push(performance.now());let i=this.painter.context.gl,n=i.createFramebuffer();function o(e){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0);let r=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,r),r}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(o(e),r.canvasCopies.map(o),r.timeStamps)}_canvasPixelComparison(e,r,i){let n=i[1]-i[0],o=e.length/4;for(let a=0;a<r.length;a++){let s=r[a],l=0;for(let r=0;r<s.length;r+=4)s[r]===e[r]&&s[r+1]===e[r+1]&&s[r+2]===e[r+2]&&s[r+3]===e[r+3]&&(l+=1);n+=(i[a+2]-i[a+1])*(1-l/o)}return n}remove(){for(let e of(this._hash&&this._hash.remove(),this._controls))e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);let r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),e.dr(this.painter.context.gl),e.ds.remove(),e.dt.remove(),this._removed=!0,this.fire(new e.b("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(r){this._renderNextFrame=this._renderNextFrame||r,this.style&&!this._frame&&(this._frame=e.f.frame(e=>{let r=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,r&&this._render(e)}))}_preloadTiles(r){let i=this.style?this.style.getSourceCaches():[];return e.b4(i,(e,i)=>e._preloadTiles(r,i),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,this._tp.refreshUI(),e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,this._tp.refreshUI(),e&&this._update())}_setCacheLimits(r,i){e.dv(r,i)}get version(){return e.du}},NavigationControl:class{constructor(r){this.options=e.e({},om,r),this._container=s("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(e.a$(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",e=>{this._map&&this._map.zoomIn({},{originalEvent:e})}),s("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",e=>{this._map&&this._map.zoomOut({},{originalEvent:e})}),s("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.a$(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",e=>{let r=this._map;r&&(this.options.visualizePitch?r.resetNorthPitch({},{originalEvent:e}):r.resetNorth({},{originalEvent:e}))}),this._compassIcon=s("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let e=this._map;if(!e)return;
113let r=e.getZoom(),i=r===e.getMaxZoom(),n=r===e.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){let e=this._map;if(!e)return;let r=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=r)})}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new og(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){let e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,r){let i=s("button",e,this._container);return i.type="button",i.addEventListener("click",r),i}_setButtonTitle(e,r){if(!this._map)return;let i=this._map._getUIString(`NavigationControl.${r}`);e.setAttribute("aria-label",i),e.firstElementChild&&e.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends e.E{constructor(r){super();const i=navigator.geolocation;this.options=e.e({geolocation:i},o_,r),e.a$(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=np(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=s("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(e){let r=(r=!!this.options.geolocation)=>{this._supportsGeolocation=r,e(r)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(e=>r("denied"!==e.state)).catch(()=>r()):r()}_isOutOfMapMaxBounds(e){let r=this._map.getMaxBounds(),i=e.coords;return!!r&&(i.longitude<r.getWest()||i.longitude>r.getEast()||i.latitude<r.getSouth()||i.latitude>r.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(r){if(this._map){if(this._isOutOfMapMaxBounds(r))return this._setErrorState(),this.fire(new e.b("outofmaxbounds",r)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=r,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
113RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(r),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(r),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.b("geolocate",r)),this._finish()}}_updateCamera(r){let i=new e.bq(r.coords.longitude,r.coords.latitude),n=r.coords.accuracy,o=this._map.getBearing(),a=e.e({bearing:o},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),a,{geolocateSource:!0})}_updateMarker(r){if(r){let i=new e.bq(r.coords.longitude,r.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=r.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let r=this._map.transform,i=e.bo(1,r._center.lat)*r.worldSize,n=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(r){if(this._map){if(this.options.trackUserLocation)if(1===r.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===r.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.b("error",r)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(r){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=s("button","mapboxgl-ctrl-geolocate",this._container),s("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===r){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");let r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",r),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",r)}else{let e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
113se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=s("div","mapboxgl-user-location"),this._dotElement.appendChild(s("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(s("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new ol({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=s("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ol({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||"ACTIVE_LOCK"!==this._watchState||r.originalEvent&&"resize"===r.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.b("trackuserlocationend")))})}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.b("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.b("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.b("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){let e=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};"u">typeof DeviceMotionEvent&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(r=>{"granted"===r&&e()}).catch(console.error):e()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
113se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:oi,ScaleControl:class{constructor(r){this.options=e.e({},oy,r),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return!1}}(),e.a$(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){let e=this.options.maxWidth||100,r=this._map,i=r._containerHeight/2,n=r._containerWidth/2-e/2,o=r.unproject([n,i]),a=r.unproject([n+e,i]),s=o.distanceTo(a);if("imperial"===this.options.unit){let r=3.2808*s;r>5280?this._setScale(e,r/5280,"mile"):this._setScale(e,r,"foot")}else"nautical"===this.options.unit?this._setScale(e,s/1852,"nautical-mile"):s>=1e3?this._setScale(e,s/1e3,"kilometer"):this._setScale(e,s,"meter")}_setScale(e,r,i){this._map._requestDomTask(()=>{var n;let o,a,s,l=(o=Math.pow(10,`${Math.floor(r)}`.length-1),a=r/o,o*(a=a>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:(s=Math.pow(10,Math.ceil(-Math.log(n=a)/Math.LN10)),Math.round(n*s)/s))),u=l/r;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(l):`${l}&nbsp;${ov[i]}`,this._container.style.width=e*u+"px"})}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=s("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(r){this._fullscreen=!1,r&&r.container&&(r.container instanceof HTMLElement?this._container=r.container:e.w("Full screen control 'container' must be a DOM element.")),e.a$(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(r){return this._map=r,this._container||(this._container=this._map.getContainer()),this._controlContainer=s("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){let e=this._fullscreenButton=s("button","mapboxgl-ctrl-fullscreen",this._controlContainer);s("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends e.E{constructor(r){super(),this.options=e.e(Object.create(ou),r),e.a$(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(r&&r.className?r.className.trim().split(/\s+/):[])}addTo(r){return this._map&&this.remove(),this._map=r,this.options.closeOnClick&&r.on("preclick",this._onClose),this.options.closeOnMove&&r.on("move",this._onClose),r.on("remove",this.remove),this._update(),r._addPopup(this),this._focusFirstElement(),this._trackPointer?(r.on("mousemove",this._onMouseEvent),r.on("mouseup",this._onMouseEvent),r._canvasContainer.classList.add("mapboxgl-track-pointer")):r.on("move",this._update),this.fire(new e.b("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);let r=this._map;return r&&(r.off("move",this._update),r.off("move",this._onClose),r.off("preclick",this._onClose),r.off("click",this._onClose),r.off("remove",this.remove),r.off("mousemove",this._onMouseEvent),r.off("mouseup",this._onMouseEvent),r.off("drag",this._onMouseEvent),r._canvasContainer&&r._canvasContainer.classList.remove("mapboxgl-track-pointer"),r._removePopup(this),this._map=void 0),this.fire(new e.b("close")),this}getLngLat(){return this._lngLat}setLngLat(r){this._lngLat=e.bq.convert(r),this._pos=null,this._trackPointer=!1,this._update();let i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();let e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let r,i=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=e;r=n.firstChild;)i.appendChild(r);return this.setDOMContent(i)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let r=this._content;if(r)for(;r.hasChildNodes();)r.firstChild&&r.removeChild(r.firstChild);else r=this._content=s("div","mapboxgl-popup-content",this._container||void 0);
113if(r.appendChild(e),this.options.closeButton){let e=this._closeButton=s("button","mapboxgl-popup-close-button",r);e.type="button",e.setAttribute("aria-label","Close popup"),e.setAttribute("aria-hidden","true"),e.innerHTML="&#215;",e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let r;return this._classList.delete(e)?r=!1:(this._classList.add(e),r=!0),this._updateClassList(),r}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;let r=this._map,i=this._container,n=this._pos;if(!r||!i||!n)return"bottom";let o=i.offsetWidth,a=i.offsetHeight,s=n.x<o/2,l=n.x>r.transform.width-o/2;if(n.y+e<a)return s?"top-left":l?"top-right":"top";if(n.y>r.transform.height-a){if(s)return"bottom-left";if(l)return"bottom-right"}return s?"left":l?"right":"bottom"}_updateClassList(){let e=this._container;if(!e)return;let r=[...this._classList];r.push("mapboxgl-popup"),this._anchor&&r.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&r.push("mapboxgl-popup-track-pointer"),e.className=r.join(" ")}_update(r){let i=this._map,n=this._content;if(!i||!this._lngLat&&!this._trackPointer||!n)return;let o=this._container;if(o||(o=this._container=s("div","mapboxgl-popup",i.getContainer()),this._tip=s("div","mapboxgl-popup-tip",o),o.appendChild(n)),this.options.maxWidth&&o.style.maxWidth!==this.options.maxWidth&&(o.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=oa(this._lngLat,this._pos,i.transform)),!this._trackPointer||r){let e=this._pos=this._trackPointer&&r?r:i.project(this._lngLat),n=oc(this.options.offset),o=this._anchor=this._getAnchor(n.y),a=oc(this.options.offset,o),s=e.add(a).round();i._requestDomTask(()=>{this._container&&o&&(this._container.style.transform=`${os[o]} translate(${s.x}px,${s.y}px)`)})}if(!this._marker&&i._showingGlobe()){let r=+!e.de(i.transform,this._lngLat);this._setOpacity(r)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:ol,Style:rP,LngLat:e.bq,LngLatBounds:e.ag,Point:e.P,MercatorCoordinate:e.O,FreeCameraOptions:rp,Evented:e.E,config:e.dd,prewarm:e.dy,clearPrewarmedResources:e.dz,get accessToken(){return e.dd.ACCESS_TOKEN},set accessToken(t){e.dd.ACCESS_TOKEN=t},get baseApiUrl(){return e.dd.API_URL},set baseApiUrl(t){e.dd.API_URL=t},get workerCount(){return e.dA.workerCount},set workerCount(t){e.dA.workerCount=t},get maxParallelImageRequests(){return e.dd.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.dd.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(r){e.dB(r)},get workerUrl(){return e.dC.workerUrl},set workerUrl(t){e.dC.workerUrl=t},get workerClass(){return e.dC.workerClass},set workerClass(t){e.dC.workerClass=t},get workerParams(){return e.dC.workerParams},set workerParams(t){e.dC.workerParams=t},get dracoUrl(){return e.dD()},set dracoUrl(t){e.dE(t)},get meshoptUrl(){return e.dF()},set meshoptUrl(t){e.dG(t)},setNow:e.f.setNow,restoreNow:e.f.restoreNow}}),i}()},11821:(e,r,i)=>{"use strict";var n=i(54780),o=i(37525),a=i(70803),s=i(15796);function l(e,r){for(var i=1/0,n=1/0,o=-1/0,a=-1/0,s=0;s<e.length;s++){var l=e[s];0!==l.width&&1!==l.width&&(i=Math.min(i,l.top),n=Math.min(n,l.bottom),o=Math.max(o,l.top),a=Math.max(a,l.bottom))}return o<=n&&o-i<r&&a-n<r}e.exports=function(e){e.collapsed||s(!1);var r,i,u,c,h,p,d=(e=e.cloneRange()).startContainer;1!==d.nodeType&&(d=d.parentNode);var f=(i=getComputedStyle(r=d),(c=(u=o(r)).createElement("div")).style.fontFamily=i.fontFamily,c.style.fontSize=i.fontSize,c.style.fontStyle=i.fontStyle,c.style.fontWeight=i.fontWeight,c.style.lineHeight=i.lineHeight,c.style.position="absolute",c.textContent="M",(h=u.body)||s(!1),h.appendChild(c),p=c.getBoundingClientRect(),h.removeChild(c),p.height),m=e.endContainer,g=e.endOffset;for(e.setStart(e.startContainer,0);l(a(e),f)&&(m=e.startContainer,g=e.startOffset,m.parentNode||s(!1),e.setStartBefore(m),1!==m.nodeType||"inline"===getComputedStyle(m).display););for(var _=m,y=g-1;;){for(var v=_.nodeValue,x=y;x>=0;x--)if(!(null!=v&&x>0&&n.isSurrogatePair(v,x-1)))if(e.setStart(_,x),l(a(e),f))m=_,g=x;else break;if(-1===x||0===_.childNodes.length)break;y=function(e){switch(e.nodeType){case Node.DOCUMENT_TYPE_NODE:return 0;case Node.TEXT_NODE:case Node.PROCESSING_INSTRUCTION_NODE:case Node.COMMENT_NODE:return e.length;default:return e.childNodes.length}}(_=_.childNodes[x])}return e.setStart(m,g),e}}
113,12192:(e,r,i)=>{"use strict";var n=i(60577);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},12227:(e,r,i)=>{"use strict";let n;function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var i=0,n=Array(r);i<r;i++)n[i]=e[i];return n}i.d(r,{A:()=>ex});let a=Object.entries,s=Object.setPrototypeOf,l=Object.isFrozen,u=Object.getPrototypeOf,c=Object.getOwnPropertyDescriptor,h=Object.freeze,p=Object.seal,d=Object.create,f="u">typeof Reflect&&Reflect,m=f.apply,g=f.construct;h||(h=function(e){return e}),p||(p=function(e){return e}),m||(m=function(e,r){for(var i=arguments.length,n=Array(i>2?i-2:0),o=2;o<i;o++)n[o-2]=arguments[o];return e.apply(r,n)}),g||(g=function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return new e(...i)});let _=F(Array.prototype.forEach),y=F(Array.prototype.lastIndexOf),v=F(Array.prototype.pop),x=F(Array.prototype.push),b=F(Array.prototype.splice),w=Array.isArray,E=F(String.prototype.toLowerCase),S=F(String.prototype.toString),T=F(String.prototype.match),I=F(String.prototype.replace),M=F(String.prototype.indexOf),C=F(String.prototype.trim),A=F(Number.prototype.toString),P=F(Boolean.prototype.toString),L="u"<typeof BigInt?null:F(BigInt.prototype.toString),O="u"<typeof Symbol?null:F(Symbol.prototype.toString),D=F(Object.prototype.hasOwnProperty),R=F(Object.prototype.toString),k=F(RegExp.prototype.test),N=(ev=TypeError,function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return g(ev,r)});function F(e){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return m(e,r,n)}}function z(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(s&&s(e,null),!w(r))return e;let n=r.length;for(;n--;){let o=r[n];if("string"==typeof o){let e=i(o);e!==o&&(l(r)||(r[n]=e),o=e)}e[o]=!0}return e}function B(e){let r=d(null);for(let n of a(e)){var i=function(e){if(Array.isArray(e))return e}(n)||function(e){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o,a,s=[],l=!0,u=!1;try{o=(r=r.call(e)).next,!1;for(;!(l=(i=o.call(r)).done)&&(s.push(i.value),2!==s.length);l=!0);}catch(e){u=!0,n=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw n}}return s}}(n)||function(e){if(e){if("string"==typeof e)return o(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,2):void 0}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();let a=i[0],s=i[1];D(e,a)&&(w(s)?r[a]=function(e){for(let r=0;r<e.length;r++)D(e,r)||(e[r]=null);return e}(s):s&&"object"==typeof s&&s.constructor===Object?r[a]=B(s):r[a]=s)}return r}function U(e,r){for(;null!==e;){let i=c(e,r);if(i){if(i.get)return F(i.get);if("function"==typeof i.value)return F(i.value)}e=u(e)}return function(){return null}}let j=h(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),V=h(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),G=h(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),q=h(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),H=
113h(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$=h(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),W=h(["#text"]),Y=h(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Z=h(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),X=h(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","
113subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),K=h(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Q=p(/{{[\w\W]*|^[\w\W]*}}/g),J=p(/<%[\w\W]*|^[\w\W]*%>/g),ee=p(/\${[\w\W]*/g),et=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),er=p(/^aria-[\-\w]+$/),ei=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),en=p(/^(?:\w+script|data):/i),eo=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ea=p(/^html$/i),es=p(/^[a-z][.\w]*(-[.\w]+)+$/i),el=p(/<[/\w!]/g),eu=p(/<[/\w]/g),ec=p(/<\/no(script|embed|frames)/i),eh=p(/\/>/i),ep=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],ed=h(z({},ep)),ef=(n={},_(ep,e=>{n[e]=p(RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),h(n)),em=function(e,r){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null,n="data-tt-policy-suffix";r&&r.hasAttribute(n)&&(i=r.getAttribute(n));let o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},eg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},e_=function(e,r,i,n){return D(e,r)&&w(e[r])?z(n.base?B(n.base):{},e[r],n.transform):i},ey=function(e,r,i){let n=D(e,r)?e[r]:void 0;return n&&"object"==typeof n?B(n):i()};var ev,ex=function e(){let r,i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof window?null:window,o=r=>e(r);if(o.version="3.4.14",o.removed=[],!n||!n.document||9!==n.document.nodeType||!n.Element)return o.isSupported=!1,o;let s=n.document,l=s,u=l.currentScript;n.DocumentFragment;let c=n.HTMLTemplateElement,f=n.Node,m=n.Element,g=n.NodeFilter;void 0===n.NamedNodeMap&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;let F=n.DOMParser,ep=n.trustedTypes,ev=m.prototype,ex=U(ev,"cloneNode"),eb=U(ev,"remove"),ew=U(ev,"nextSibling"),eE=U(ev,"childNodes"),eS=U(ev,"parentNode"),eT=U(ev,"shadowRoot"),eI=U(ev,"attributes"),eM=f&&f.prototype?U(f.prototype,"nodeType"):null,eC=f&&f.prototype?U(f.prototype,"nodeName"):null,eA=f&&f.prototype?U(f.prototype,"ownerDocument"):null,eP=function(e){return eM?eM(e):e.nodeType},eL=function(e){return eC?eC(e):e.nodeName};if("function"==typeof c){let e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let eO="",eD=!1,eR=0,ek=function(){if(eR>0)throw N('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},eN=function(e){ek(),eR++;try{return r.createHTML(e)}finally{eR--}},eF=function(e){ek(),eR++;try{return r.createScriptURL(e)}finally{eR--}},ez=s,eB=ez.implementation,eU=ez.createNodeIterator,ej=ez.createDocumentFragment,eV=ez.getElementsByTagName,eG=l.importNode,eq=eg();o.isSupported="function"==typeof a&&"function"==typeof eS&&eB&&void 0!==eB.createHTMLDocument;let eH=ei,e$=null,eW=z({},[...j,...V,...G,...H,...W]),eY=null,eZ=z({}
113,[...Y,...Z,...X,...K]),eX=Object.seal(d(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eK=null,eQ=null,eJ=Object.seal(d(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),e0=!0,e1=!0,e2=!1,e3=!0,e5=!1,e4=!0,e6=!1,e8=!1,e9=null,e7=null,te=!1,tt=!1,tr=!1,ti=!1,tn=!0,to=!1,ta="user-content-",ts=!0,tl=!1,tu={},tc=null,th=z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),tp=null,td=z({},["audio","video","img","source","image","track"]),tf=null,tm=z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tg="http://www.w3.org/1998/Math/MathML",t_="http://www.w3.org/2000/svg",ty="http://www.w3.org/1999/xhtml",tv=ty,tx=!1,tb=null,tw=z({},[tg,t_,ty],S),tE=h(["mi","mo","mn","ms","mtext"]),tS=z({},tE),tT=h(["annotation-xml"]),tI=z({},tT),tM=z({},["title","style","font","a","script"]),tC=null,tA=["application/xhtml+xml","text/html"],tP=null,tL=null,tO=s.createElement("form"),tD=function(e){return e instanceof RegExp||e instanceof Function},tR=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(tL&&tL===e)return;e&&"object"==typeof e||(e={}),e=B(e),tP="application/xhtml+xml"===(tC=-1===tA.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?S:E,e$=e_(e,"ALLOWED_TAGS",eW,{transform:tP}),eY=e_(e,"ALLOWED_ATTR",eZ,{transform:tP}),tb=e_(e,"ALLOWED_NAMESPACES",tw,{transform:S}),tf=e_(e,"ADD_URI_SAFE_ATTR",tm,{transform:tP,base:tm}),tp=e_(e,"ADD_DATA_URI_TAGS",td,{transform:tP,base:td}),tc=e_(e,"FORBID_CONTENTS",th,{transform:tP}),eK=e_(e,"FORBID_TAGS",B({}),{transform:tP}),eQ=e_(e,"FORBID_ATTR",B({}),{transform:tP}),tu=!!D(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?B(e.USE_PROFILES):e.USE_PROFILES),e0=!1!==e.ALLOW_ARIA_ATTR,e1=!1!==e.ALLOW_DATA_ATTR,e2=e.ALLOW_UNKNOWN_PROTOCOLS||!1,e3=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,e5=e.SAFE_FOR_TEMPLATES||!1,e4=!1!==e.SAFE_FOR_XML,e6=e.WHOLE_DOCUMENT||!1,tt=e.RETURN_DOM||!1,tr=e.RETURN_DOM_FRAGMENT||!1,ti=e.RETURN_TRUSTED_TYPE||!1,te=e.FORCE_BODY||!1,tn=!1!==e.SANITIZE_DOM,to=e.SANITIZE_NAMED_PROPS||!1,ts=!1!==e.KEEP_CONTENT,tl=e.IN_PLACE||!1,eH=!function(e){try{return k(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?ei:e.ALLOWED_URI_REGEXP,tv="string"==typeof e.NAMESPACE?e.NAMESPACE:ty,tS=ey(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>z({},tE)),tI=ey(e,"HTML_INTEGRATION_POINTS",()=>z({},tT));let n=ey(e,"CUSTOM_ELEMENT_HANDLING",()=>d(null));if(eX=d(null),D(n,"tagNameCheck")&&tD(n.tagNameCheck)&&(eX.tagNameCheck=n.tagNameCheck),D(n,"attributeNameCheck")&&tD(n.attributeNameCheck)&&(eX.attributeNameCheck=n.attributeNameCheck),D(n,"allowCustomizedBuiltInElements")&&"boolean"==typeof n.allowCustomizedBuiltInElements&&(eX.allowCustomizedBuiltInElements=n.allowCustomizedBuiltInElements),p(eX),e5&&(e1=!1),tr&&(tt=!0),tu&&(e$=z({},W),eY=d(null),!0===tu.html&&(z(e$,j),z(eY,Y)),!0===tu.svg&&(z(e$,V),z(eY,Z),z(eY,K)),!0===tu.svgFilters&&(z(e$,G),z(eY,Z),z(eY,K)),!0===tu.mathMl&&(z(e$,H),z(eY,X),z(eY,K))),eJ.tagCheck=null,eJ.attributeCheck=null,D(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?eJ.tagCheck=e.ADD_TAGS:w(e.ADD_TAGS)&&(e$===eW&&(e$=B(e$)),z(e$,e.ADD_TAGS,tP))),D(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?eJ.attributeCheck=e.ADD_ATTR:w(e.ADD_ATTR)&&(eY===eZ&&(eY=B(eY)),z(eY,e.ADD_ATTR,tP))),D(e,"ADD_FORBID_CONTENTS")&&w(e.ADD_FORBID_CONTENTS)&&(tc===th&&(tc=B(tc)),z(tc,e.ADD_FORBID_CONTENTS,tP)),ts&&(e$["#text"]=!0),e6&&z(e$,["html","head","body"]),e$.table&&(z(e$,["tbody"]),delete eK.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw N('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw N('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let i=r;r=e.TRUSTED_TYPES_POLICY;try{eO=eN("")}catch(e){throw r=i,e}}else null===e.TRUSTED_TYPES_POLICY?(r=void 0,eO=""):(void 0===r&&(eD||(i=em(ep,u),eD=!0),r=i),r&&"string"==typeof eO&&(eO=eN("")));h&&h(e),tL=e},tk=z({},[...V,...G,...q]),tN=z({},[...H,...$]),tF=function(e){var r,i,n;let o=eS(e);o&&o.tagName||(o={namespaceURI:tv,tagName:"template"});let a=E(e.tagName),s=E(o.tagName);return!!tb[e.namespaceURI]&&(e.namespaceURI===t_?(r=o).namespaceURI===ty?"svg"===a:r.namespaceURI===tg?"svg"===a&&("annotation-xml"===s||tS[s]):!!t
113k[a]:e.namespaceURI===tg?(i=o).namespaceURI===ty?"math"===a:i.namespaceURI===t_?"math"===a&&tI[s]:!!tN[a]:e.namespaceURI===ty?((n=o).namespaceURI!==t_||!!tI[s])&&(n.namespaceURI!==tg||!!tS[s])&&!tN[a]&&(tM[a]||!tk[a]):"application/xhtml+xml"===tC&&!!tb[e.namespaceURI])},tz=function(e){x(o.removed,{element:e});try{eS(e).removeChild(e)}catch(r){if(eb(e),!eS(e))throw N("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},tB=function(e,r,i){try{e.removeAttributeNode(r)}catch(r){try{e.removeAttribute(i)}catch(e){}}},tU=function(e){tG(e);let r=eE(e);if(r){let e=[];_(r,r=>{x(e,r)}),_(e,e=>{try{eb(e)}catch(e){}})}let i=eI(e);if(i)for(let r=i.length-1;r>=0;--r){let n=i[r],o=n&&n.name;"string"==typeof o&&tB(e,n,o)}},tj=function(e,r,i){if(!i)try{i=r.getAttributeNode(e)}catch(e){i=null}x(o.removed,{attribute:i||null,from:r});try{i?r.removeAttributeNode(i):r.removeAttribute(e)}catch(i){try{r.removeAttribute(e)}catch(e){}}if("is"===e)if(tt||tr)try{tz(r)}catch(e){}else try{r.setAttribute(e,"")}catch(e){}},tV=function(e){let r=eI(e);if(r)for(let i=r.length-1;i>=0;--i){let n=r[i],o=n&&n.name;"string"!=typeof o||eY[tP(o)]||tB(e,n,o)}},tG=function(e){let r=[e];for(;r.length>0;){let e=r.pop();1===eP(e)&&tV(e);let i=eE(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},tq=function(e,r){return!!e4&&("patchsrc"===e||"for"===e&&"label"!==r&&"output"!==r)},tH=function(e){if(!e4)return;let r=[e];for(;r.length>0;){let e=r.pop(),i=eP(e);if(7===i||8===i&&k(eu,e.data)){try{eb(e)}catch(e){}continue}if(1===i){let r=tP(eL(e));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&tq("for",r)&&e.removeAttribute("for")}catch(e){}}let n=eE(e);if(n)for(let e=n.length-1;e>=0;--e)r.push(n[e])}},t$=function(e){let i=null,n=null;if(te)e="<remove></remove>"+e;else{let r=T(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===tC&&tv===ty&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let o=r?eN(e):e;if(tv===ty)try{i=new F().parseFromString(o,tC)}catch(e){}if(!i||!i.documentElement){i=eB.createDocument(tv,"template",null);try{i.documentElement.innerHTML=tx?eO:o}catch(e){}}let a=i.body||i.documentElement;return(e&&n&&a.insertBefore(s.createTextNode(n),a.childNodes[0]||null),tv===ty)?eV.call(i,e6?"html":"body")[0]:e6?i.documentElement:a},tW=function(e){let r=eA?eA(e):e.ownerDocument;return eU.call(r||e,e,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},tY=function(e){return e=I(e,Q," "),e=I(e,J," "),e=I(e,ee," ")},tZ=function(e){var r;e.normalize();let i=eA?eA(e):e.ownerDocument,n=eU.call(i||e,e,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null),o=n.nextNode();for(;o;)o.data=tY(o.data),o=n.nextNode();let a=null==(r=e.querySelectorAll)?void 0:r.call(e,"template");a&&_(a,e=>{tK(e.content)&&tZ(e.content)})},tX=function(e){let r=eC?eC(e):null;return"string"==typeof r&&"form"===tP(r)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==eI(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==eM(e)||e.childNodes!==eE(e))},tK=function(e){if(!eM||"object"!=typeof e||null===e)return!1;try{return 11===eM(e)}catch(e){return!1}},tQ=function(e){if(!eM||"object"!=typeof e||null===e)return!1;try{return"number"==typeof eM(e)}catch(e){return!1}};function tJ(e,r,i){0!==e.length&&_(e,e=>{e.call(o,r,i,tL)})}let t0=function(e,r){if(e instanceof RegExp)return k(e,r);if(e instanceof Function){for(var i=arguments.length,n=Array(i>2?i-2:0),o=2;o<i;o++)n[o-2]=arguments[o];return!!e(r,...n)}return!1},t1=function(e,r,i){if(!eK[r]&&t8(r)&&t0(eX.tagNameCheck,r))return!1;if(ts&&!tc[r]){let r=eS(e),n=eE(e);if(n&&r){let o=n.length;for(let a=o-1;a>=0;--a){let o=e===i?ex(n[a],!0):n[a];r.insertBefore(o,ew(e))}}}return tz(e),!0},t2=function(e,r,i,n){return 0===e.length?r:r===i||r===n?B(r):r},t3=function(e,r){return e!==r&&null===eS(e)&&(tl&&tG(e),!0)},t5=function(e,r){if(tJ(eq.beforeSanitizeElements,e,null),t3(e,r))return!0;
113if(tX(e))return tz(e),!0;let i=tP(eL(e));if(e$=t2(eq.uponSanitizeElement,e$,eW,e9),tJ(eq.uponSanitizeElement,e,{tagName:i,allowedTags:e$}),t3(e,r))return!0;if(e4&&e.hasChildNodes()&&!tQ(e.firstElementChild)&&k(el,e.textContent)&&k(el,e.innerHTML)||e4&&e.namespaceURI===ty&&ed[i]&&(tQ(e.firstElementChild)||"string"==typeof e.textContent&&k(ef[i],e.textContent))||7===e.nodeType||e4&&8===e.nodeType&&k(eu,e.data))return tz(e),!0;if(eK[i]||!(eJ.tagCheck instanceof Function&&eJ.tagCheck(i))&&!e$[i]){let n=t1(e,i,r);return!1===n&&tJ(eq.afterSanitizeElements,e,null),n}if(1===eP(e)&&!tF(e)||("noscript"===i||"noembed"===i||"noframes"===i)&&k(ec,e.innerHTML))return tz(e),!0;if(e5&&3===e.nodeType){let r=tY(e.textContent);e.textContent!==r&&(x(o.removed,{element:e.cloneNode()}),e.textContent=r)}return tJ(eq.afterSanitizeElements,e,null),!1},t4=function(e,r,i){if(eQ[r]||tq(r,e)||tn&&("id"===r||"name"===r)&&(i in s||i in tO))return!1;let n=eY[r]||eJ.attributeCheck instanceof Function&&eJ.attributeCheck(r,e);return!!(e1&&k(et,r)||e0&&k(er,r))||(n?!(!(tf[r]||k(eH,I(i,eo,"")))&&("src"!==r&&"xlink:href"!==r&&"href"!==r||"script"===e||0!==M(i,"data:")||!tp[e])&&(!e2||k(en,I(i,eo,""))))||!i:t8(e)&&t0(eX.tagNameCheck,e)&&t0(eX.attributeNameCheck,r,e)||"is"===r&&eX.allowCustomizedBuiltInElements&&t0(eX.tagNameCheck,i))},t6=z({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),t8=function(e){return!t6[E(e)]&&k(es,e)},t9=function(e,i,n,o){if(r&&"object"==typeof ep&&"function"==typeof ep.getAttributeType&&!n)switch(ep.getAttributeType(e,i)){case"TrustedHTML":return eN(o);case"TrustedScriptURL":return eF(o)}return o},t7=function(e,r,i,n){try{i?e.setAttributeNS(i,r,n):e.setAttribute(r,n),tX(e)?tz(e):v(o.removed)}catch(i){tj(r,e)}},re=function(e){tJ(eq.beforeSanitizeAttributes,e,null);let r=e.attributes;if(!r||tX(e))return;let i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:eY=t2(eq.uponSanitizeAttribute,eY,eZ,e7),forceKeepAttr:void 0},n=r.length,o=tP(e.nodeName);for(;n--;){let a=r[n],s=a.name,l=a.namespaceURI,u=a.value,c=tP(s),h="value"===s?u:C(u);if(i.attrName=c,i.attrValue=h,i.keepAttr=!0,i.forceKeepAttr=void 0,tJ(eq.uponSanitizeAttribute,e,i),h=i.attrValue,to&&("id"===c||"name"===c)&&0!==M(h,ta)&&(tj(s,e,a),h=ta+h),e4&&k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,h)||"attributename"===c&&T(h,"href")){tj(s,e,a);continue}if(!i.forceKeepAttr){if(!i.keepAttr||!e3&&k(eh,h)||(e5&&(h=tY(h)),!t4(o,c,h))){tj(s,e,a);continue}(h=t9(o,c,l,h))!==u&&t7(e,s,l,h)}}tJ(eq.afterSanitizeAttributes,e,null)},rt=function(e){let r=null,i=tW(e);for(tJ(eq.beforeSanitizeShadowDOM,e,null);r=i.nextNode();)if(tJ(eq.uponSanitizeShadowNode,r,null),t5(r,e),re(r),tK(r.content)&&rt(r.content),1===eP(r)){let e=eT(r);tK(e)&&(rr(e),rt(e))}tJ(eq.afterSanitizeShadowDOM,e,null)},rr=function(e){let r=[{node:e,shadow:null}];for(;r.length>0;){let e=r.pop();if(e.shadow){rt(e.shadow);continue}let i=e.node,n=1===eP(i),o=eE(i);if(o)for(let e=o.length-1;e>=0;--e)r.push({node:o[e],shadow:null});if(n){let e=eC?eC(i):null;if("string"==typeof e&&"template"===tP(e)){let e=i.content;tK(e)&&r.push({node:e,shadow:null})}}if(n){let e=eT(i);tK(e)&&r.push({node:null,shadow:e},{node:e,shadow:null})}}};return o.sanitize=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,a=null,s=null,u=null;if((tx=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!tQ(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return A(e);case"boolean":return P(e);case"bigint":return L?L(e):"0";case"symbol":return O?O(e):"Symbol()";case"undefined":default:return R(e);case"function":case"object":{if(null===e)return R(e);let r=U(e,"toString");if("function"==typeof r){let i=r(e);return"string"==typeof i?i:R(i)}return R(e)}}}(e)))throw N("dirty is not a string, aborting");if(!o.isSupported)return e;e8?(e$=e9,eY=e7):tR(i),(eq.uponSanitizeElement.length>0||eq.uponSanitizeAttribute.length>0)&&(e$=B(e$)),eq.uponSanitizeAttribute.length>0&&(eY=B(eY)),o.removed=[];let c=tl&&"string"!=typeof e&&tQ(e);if(c){tH(e);let r=eL(e);if("string"==typeof r){let i=tP(r);if(!e$[i]||eK[i])throw tU(e),N("root node is forbidden and cannot be sanitized in-place")}if(tX(e))throw tU(e),N("root node is clobbered and cannot be sanitized in-place");try{rr(e)}catch(r){throw tU(e),r}}else if(tQ(e))1===(a=(n=t$("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a),rr(a);else{if(!tt&&!e5&&!e6&&-1===e.indexOf("<"))return r&&ti?eN(e):e;if(!(n=t$(e)))return tt?null:ti?eO:""}n&&te&&tz(n.firstChild);let h=c?e:n;try{let e=tW(h);for(;s=e.nextNode();)t5(s,h),re(s),tK(s.content)&&rt(s.content)}catch(r){throw c&&(tU(e),_(o.removed,e=>{e.element&&tG(e.element)})),r}if(c)return _(o.removed,e=>{e.element&&tG(e.element)}),e5&&tZ(e),e;if(tt){if(e5&&tZ(n),tr)for(u=ej.call(n.ownerDocument);n.firstChild;)u.appendChild(n.firstChild);else u=n;return(eY.shadowroot||eY.shadowrootmode)&&(u=eG.call(l,u,!0)),u}let p=e6?n.outerHTML:n.innerHTML;return e6&&e$["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&k(ea,n.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+p),e5&&(p=tY(p)),r&&ti?eN(p):p},o.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tR(e),e8=!0,e9=e$,e7=eY},o.clearConfig=function(){tL=null,e8=!1,e9=null,e7=null,r=i,eO=""},o.isValidAttribute=function(e,r,i){return tL||tR({}),t4(tP(e),tP(r),i)},o.addHook=function(e,r){"function"!=typeof r||D(eq,e)&&x(eq[e],r)},o.removeHook=function(e,r){if(D(eq,e)){if(void 0!==r){let i=y(eq[e],r);return -1===i?void 0:b(eq[e],i,1)[0]}return v(eq[e])}},o.removeHooks=function(e){D(eq,e)&&(eq[e]=[])},o.removeAllHooks=function(){eq=eg()},o}()},12483:(e,r,i)=>{"use strict";var n=i(67432);e.exports=function(e){return n(e)&&3==e.nodeType}},12968:e=>{"use strict";e.exports=function(e){if(null!=e)return e;throw Error("Got unexpected null or undefined")}},13260:(e,r,i)=>{"use strict";i.d(r,{A:()=>R});var n=i(38877),o=i(95392),a=i(99468),s=i(7075);function l(e){(0,a.A)(1,arguments);var r=(0,o.A)(e),i=r.getUTCDay();return r.setUTCDate(r.getUTCDate()-(7*(i<1)+i-1)),r.setUTCHours(0,0,0,0),r}function u(e){(0,a.A)(1,arguments);var r=(0,o.A)(e),i=r.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(i+1,0,4),n.setUTCHours(0,0,0,0);var s=l(n),u=new Date(0);u.setUTCFullYear(i,0,4),u.setUTCHours(0,0,0,0);var c=l(u);return r.getTime()>=s.getTime()?i+1:r.getTime()>=c.getTime()?i:i-1}var c=i(90781);function h(e,r){(0,a.A)(1,arguments);var i,n,l,u,h,p,d,f,m=(0,c.q)(),g=(0,s.A)(null!=(i=null!=(n=null!=(l=null!=(u=null==r?void 0:r.weekStartsOn)?u:null==r||null==(h=r.locale)||null==(p=h.options)?void 0:p.weekStartsOn)?l:m.weekStartsOn)?n:null==(d=m.locale)||null==(f=d.options)?void 0:f.weekStartsOn)?i:0);if(!(g>=0&&g<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=(0,o.A)(e),y=_.getUTCDay();return _.setUTCDate(_.getUTCDate()-(7*(y<g)+y-g)),_.setUTCHours(0,0,0,0),_}function p(e,r){(0,a.A)(1,arguments);var i,n,l,u,p,d,f,m,g=(0,o.A)(e),_=g.getUTCFullYear(),y=(0,c.q)(),v=(0,s.A)(null!=(i=null!=(n=null!=(l=null!=(u=null==r?void 0:r.firstWeekContainsDate)?u:null==r||null==(p=r.locale)||null==(d=p.options)?void 0:d.firstWeekContainsDate)?l:y.firstWeekContainsDate)?n:null==(f=y.locale)||null==(m
113=f.options)?void 0:m.firstWeekContainsDate)?i:1);if(!(v>=1&&v<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(_+1,0,v),x.setUTCHours(0,0,0,0);var b=h(x,r),w=new Date(0);w.setUTCFullYear(_,0,v),w.setUTCHours(0,0,0,0);var E=h(w,r);return g.getTime()>=b.getTime()?_+1:g.getTime()>=E.getTime()?_:_-1}function d(e,r){for(var i=Math.abs(e).toString();i.length<r;)i="0"+i;return(e<0?"-":"")+i}let f=function(e,r){var i=e.getUTCFullYear(),n=i>0?i:1-i;return d("yy"===r?n%100:n,r.length)},m=function(e,r){var i=e.getUTCMonth();return"M"===r?String(i+1):d(i+1,2)},g=function(e,r){var i=r.length;return d(Math.floor(e.getUTCMilliseconds()*Math.pow(10,i-3)),r.length)};function _(e,r){var i=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),a=n%60;return 0===a?i+String(o):i+String(o)+(r||"")+d(a,2)}function y(e,r){return e%60==0?(e>0?"-":"+")+d(Math.abs(e)/60,2):v(e,r)}function v(e,r){var i=Math.abs(e);return(e>0?"-":"+")+d(Math.floor(i/60),2)+(r||"")+d(i%60,2)}let x={G:function(e,r,i){var n=+(e.getUTCFullYear()>0);switch(r){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});default:return i.era(n,{width:"wide"})}},y:function(e,r,i){if("yo"===r){var n=e.getUTCFullYear();return i.ordinalNumber(n>0?n:1-n,{unit:"year"})}return f(e,r)},Y:function(e,r,i,n){var o=p(e,n),a=o>0?o:1-o;return"YY"===r?d(a%100,2):"Yo"===r?i.ordinalNumber(a,{unit:"year"}):d(a,r.length)},R:function(e,r){return d(u(e),r.length)},u:function(e,r){return d(e.getUTCFullYear(),r.length)},Q:function(e,r,i){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(r){case"Q":return String(n);case"QQ":return d(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,r,i){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(r){case"q":return String(n);case"qq":return d(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,r,i){var n=e.getUTCMonth();switch(r){case"M":case"MM":return m(e,r);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(e,r,i){var n=e.getUTCMonth();switch(r){case"L":return String(n+1);case"LL":return d(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(e,r,i,n){var l=function(e,r){(0,a.A)(1,arguments);var i=(0,o.A)(e);return Math.round((h(i,r).getTime()-(function(e,r){(0,a.A)(1,arguments);var i,n,o,l,u,d,f,m,g=(0,c.q)(),_=(0,s.A)(null!=(i=null!=(n=null!=(o=null!=(l=null==r?void 0:r.firstWeekContainsDate)?l:null==r||null==(u=r.locale)||null==(d=u.options)?void 0:d.firstWeekContainsDate)?o:g.firstWeekContainsDate)?n:null==(f=g.locale)||null==(m=f.options)?void 0:m.firstWeekContainsDate)?i:1),y=p(e,r),v=new Date(0);return v.setUTCFullYear(y,0,_),v.setUTCHours(0,0,0,0),h(v,r)})(i,r).getTime())/6048e5)+1}(e,n);return"wo"===r?i.ordinalNumber(l,{unit:"week"}):d(l,r.length)},I:function(e,r,i){var n=function(e){(0,a.A)(1,arguments);var r=(0,o.A)(e);return Math.round((l(r).getTime()-(function(e){(0,a.A)(1,arguments);var r=u(e),i=new Date(0);return i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0),l(i)})(r).getTime())/6048e5)+1}(e);return"Io"===r?i.ordinalNumber(n,{unit:"week"}):d(n,r.length)},d:function(e,r,i){var n,o;return"do"===r?i.ordinalNumber(e.getUTCDate(),{unit:"date"}):(n=e,o=r,d(n.getUTCDate(),o.length))},D:function(e,r,i){var n=function(e){(0,a.A)(1,arguments);var r=(0,o.A)(e),i=r.getTime();return r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0),Math.floor((i-r.getTime())/864e5)+1}(e);return"Do"===r?i.ordinalNumber(n,{unit:"dayOfYear"}):d(n,r.length)},E:function(e,r,i){var n=e.getUTCDay();switch(r){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(e,r,i,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(r){case"e":return String(a);case"ee":return d(a,2);case"eo":return i.ordinalNumber(a,{unit:"day"});case"eee":return i.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},c:function(e,r,i,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(r){case"c":return String(a);case"cc":return d(a,r.length);case"co":return i.ordinalNumber(a,{unit:"day"});case"ccc":return i.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(o,{width:"narrow",context:"standalone"});case"cccccc":return i.day(o,{width:"short",context:"standalone"});default:return i.day(o,{width:"wide",context:"standalone"})}},i:function(e,r,i){var n=e.getUTCDay(),o=0===n?7:n;switch(r){case"i":return String(o);case"ii":return d(o,r.length);case"io":return i.ordinalNumber(o,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(e,r,i){var n=e.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,r,i){var n,o=e.getUTCHours();
113switch(n=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",r){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,r,i){var n,o=e.getUTCHours();switch(n=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",r){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,r,i){if("ho"===r){var n,o,a=e.getUTCHours()%12;return 0===a&&(a=12),i.ordinalNumber(a,{unit:"hour"})}return n=e,o=r,d(n.getUTCHours()%12||12,o.length)},H:function(e,r,i){var n,o;return"Ho"===r?i.ordinalNumber(e.getUTCHours(),{unit:"hour"}):(n=e,o=r,d(n.getUTCHours(),o.length))},K:function(e,r,i){var n=e.getUTCHours()%12;return"Ko"===r?i.ordinalNumber(n,{unit:"hour"}):d(n,r.length)},k:function(e,r,i){var n=e.getUTCHours();return(0===n&&(n=24),"ko"===r)?i.ordinalNumber(n,{unit:"hour"}):d(n,r.length)},m:function(e,r,i){var n,o;return"mo"===r?i.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):(n=e,o=r,d(n.getUTCMinutes(),o.length))},s:function(e,r,i){var n,o;return"so"===r?i.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):(n=e,o=r,d(n.getUTCSeconds(),o.length))},S:function(e,r){return g(e,r)},X:function(e,r,i,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(r){case"X":return y(o);case"XXXX":case"XX":return v(o);default:return v(o,":")}},x:function(e,r,i,n){var o=(n._originalDate||e).getTimezoneOffset();switch(r){case"x":return y(o);case"xxxx":case"xx":return v(o);default:return v(o,":")}},O:function(e,r,i,n){var o=(n._originalDate||e).getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+_(o,":");default:return"GMT"+v(o,":")}},z:function(e,r,i,n){var o=(n._originalDate||e).getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+_(o,":");default:return"GMT"+v(o,":")}},t:function(e,r,i,n){return d(Math.floor((n._originalDate||e).getTime()/1e3),r.length)},T:function(e,r,i,n){return d((n._originalDate||e).getTime(),r.length)}};var b=function(e,r){switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});default:return r.date({width:"full"})}},w=function(e,r){switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});default:return r.time({width:"full"})}};let E={p:w,P:function(e,r){var i,n=e.match(/(P+)(p+)?/)||[],o=n[1],a=n[2];if(!a)return b(e,r);switch(o){case"P":i=r.dateTime({width:"short"});break;case"PP":i=r.dateTime({width:"medium"});break;case"PPP":i=r.dateTime({width:"long"});break;default:i=r.dateTime({width:"full"})}return i.replace("{{date}}",b(o,r)).replace("{{time}}",w(a,r))}};var S=i(52171),T=["D","DD"],I=["YY","YYYY"];function M(e,r,i){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(r,"`) for formatting years to the input `").
113concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(r,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(r,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(r,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}let C=i(6656).A;var A=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,P=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,L=/^'([^]*?)'?$/,O=/''/g,D=/[a-zA-Z]/;function R(e,r,i){(0,a.A)(2,arguments);var l,u,h,p,d,f,m,g,_,y,v,b,w,R,k,N,F,z,B=String(r),U=(0,c.q)(),j=null!=(l=null!=(u=null==i?void 0:i.locale)?u:U.locale)?l:C,V=(0,s.A)(null!=(h=null!=(p=null!=(d=null!=(f=null==i?void 0:i.firstWeekContainsDate)?f:null==i||null==(m=i.locale)||null==(g=m.options)?void 0:g.firstWeekContainsDate)?d:U.firstWeekContainsDate)?p:null==(_=U.locale)||null==(y=_.options)?void 0:y.firstWeekContainsDate)?h:1);if(!(V>=1&&V<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var G=(0,s.A)(null!=(v=null!=(b=null!=(w=null!=(R=null==i?void 0:i.weekStartsOn)?R:null==i||null==(k=i.locale)||null==(N=k.options)?void 0:N.weekStartsOn)?w:U.weekStartsOn)?b:null==(F=U.locale)||null==(z=F.options)?void 0:z.weekStartsOn)?v:0);if(!(G>=0&&G<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!j.localize)throw RangeError("locale must contain localize property");if(!j.formatLong)throw RangeError("locale must contain formatLong property");var q=(0,o.A)(e);if(!function(e){return(0,a.A)(1,arguments),(!!(0,n.A)(e)||"number"==typeof e)&&!isNaN(Number((0,o.A)(e)))}(q))throw RangeError("Invalid time value");var H=(0,S.A)(q),$=function(e,r){return(0,a.A)(2,arguments),function(e,r){return(0,a.A)(2,arguments),new Date((0,o.A)(e).getTime()+(0,s.A)(r))}(e,-(0,s.A)(r))}(q,H),W={firstWeekContainsDate:V,weekStartsOn:G,locale:j,_originalDate:q};return B.match(P).map(function(e){var r=e[0];return"p"===r||"P"===r?(0,E[r])(e,j.formatLong):e}).join("").match(A).map(function(n){if("''"===n)return"'";var o,a,s=n[0];if("'"===s){return(a=(o=n).match(L))?a[1].replace(O,"'"):o}var l=x[s];if(l)return null!=i&&i.useAdditionalWeekYearTokens||-1===I.indexOf(n)||M(n,r,String(e)),null!=i&&i.useAdditionalDayOfYearTokens||-1===T.indexOf(n)||M(n,r,String(e)),l($,n,j.localize,W);if(s.match(D))throw RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return n}).join("")}},13379:e=>{"use strict";e.exports=function(e){e._internalDrag=!0,e.setMode("drag")}},13405:(e,r,i)=>{"use strict";var n=i(15076),o=i(86533),a=i(99297),s=i(93710),l=i(14232),u=i(73239);s.List,e.exports=function(e){function r(){return e.apply(this,arguments)||this}return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e,r.prototype.render=function(){var e=this.props,r=e.block,i=e.contentState,s=e.customStyleFn,c=e.customStyleMap,h=e.decorator,p=e.direction,d=e.forceSelection,f=e.hasSelection,m=e.selection,g=e.tree,_=r.getKey(),y=r.getText(),v=g.size-1,x=this.props.children||g.map(function(e,u){var g=e.get("decoratorKey"),x=e.get("leaves"),b=x.size-1,w=x.map(function(e,i){var n=a.encode(_,u,i),h=e.get("start"),p=e.get("end");return l.createElement(o,{key:n,offsetKey:n,block:r,start:h,selection:f?m:null,forceSelection:d,text:y.slice(h,p),styleSet:r.getInlineStyleAt(h),customStyleMap:c,customStyleFn:s,isLast:g===v&&i===b})}).toArray();return g&&h?l.createElement(n,{block:r,children:w,contentState:i,decorator:h,decoratorKey:g,direction:p,leafSet:e,text:y,key:u}):w}).toArray();return l.createElement("div",{"data-offset-key":a.encode(_,0,0),className:u({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===p,"public/DraftStyleDefault/rtl":"RTL"===p})},x)},r}(l.Component)},13449:(e,r,i)=>{var n=i(69560),o=function(e){this.precision=e&&e.precision?e.precision:17,this.direction=!!e&&!!e.direction&&e.direction,this.pseudoNode=!!e&&!!e.pseudoNode&&e.pseudoNode,this.objectComparator=e&&e.objectComparator?e.objectComparator:l};function a(e){return e.coordinates.map(function(r){return{type:e.type.replace("Multi",""),coordinates:r}})}function s(e,r){return e.hasOwnProperty("coordinates")?e.coordinates.length===r.coordinates.length:e.length===r.length}function l(e,r){return n(e,r,{strict:!0})}o.prototype.compare=function(e,r){if(e.type!==r.type||!s(e,r))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,r.coordinates);
113case"LineString":return this.compareLine(e.coordinates,r.coordinates,0,!1);case"Polygon":return this.comparePolygon(e,r);case"Feature":return this.compareFeature(e,r);default:if(0===e.type.indexOf("Multi")){var i=this,n=a(e),o=a(r);return n.every(function(e){return this.some(function(r){return i.compare(e,r)})},o)}}return!1},o.prototype.compareCoord=function(e,r){if(e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(e[i].toFixed(this.precision)!==r[i].toFixed(this.precision))return!1;return!0},o.prototype.compareLine=function(e,r,i,n){if(!s(e,r))return!1;var o=this.pseudoNode?e:this.removePseudo(e),a=this.pseudoNode?r:this.removePseudo(r);if(!n||this.compareCoord(o[0],a[0])||(a=this.fixStartIndex(a,o))){var l=this.compareCoord(o[i],a[i]);return this.direction||l?this.comparePath(o,a):!!this.compareCoord(o[i],a[a.length-(1+i)])&&this.comparePath(o.slice().reverse(),a)}},o.prototype.fixStartIndex=function(e,r){for(var i,n=-1,o=0;o<e.length;o++)if(this.compareCoord(e[o],r[0])){n=o;break}return n>=0&&(i=[].concat(e.slice(n,e.length),e.slice(1,n+1))),i},o.prototype.comparePath=function(e,r){var i=this;return e.every(function(e,r){return i.compareCoord(e,this[r])},r)},o.prototype.comparePolygon=function(e,r){if(!this.compareLine(e.coordinates[0],r.coordinates[0],1,!0))return!1;var i=e.coordinates.slice(1,e.coordinates.length),n=r.coordinates.slice(1,r.coordinates.length),o=this;return i.every(function(e){return this.some(function(r){return o.compareLine(e,r,1,!0)})},n)},o.prototype.compareFeature=function(e,r){return e.id===r.id&&!!this.objectComparator(e.properties,r.properties)&&!!this.compareBBox(e,r)&&this.compare(e.geometry,r.geometry)},o.prototype.compareBBox=function(e,r){return!!(!e.bbox&&!r.bbox||e.bbox&&r.bbox&&this.compareCoord(e.bbox,r.bbox))},o.prototype.removePseudo=function(e){return e},e.exports=o},14104:(e,r,i)=>{"use strict";i.d(r,{pI:()=>l,$c:()=>y,G4:()=>v,yc:()=>_,jo:()=>x,Pv:()=>b});var n=i(22629),o=i(30169);function a(){return new Worker(i.p+"static/chunks/lidarUnionWorker-3e96ce1db78b55e2.worker.js")}let s="user-uploaded-lidars-source",l="user-uploaded-lidars-layer",u="user-uploaded-lidars-layer-outline",c="user-uploaded-lidars-layer-union",h="user-uploaded-lidars-source-union",p=null,d=null,f=null,m=null,g=0,_=e=>{e.current&&(p=null,d=null,f&&(clearTimeout(f),f=null),e.current.getLayer(u)&&e.current.removeLayer(u),e.current.getLayer(l)&&e.current.removeLayer(l),e.current.getSource(s)&&e.current.removeSource(s))},y=(e,r,i)=>{if(!e.current)return;let a=(0,o.YD)(r);if(e.current.getSource(s)?e.current.getSource(s).setData(a):e.current.addSource(s,{type:"geojson",data:a,promoteId:"uuid"}),!e.current.getLayer(l)){let r=(0,n.YN)(l,i.project_uuid)?"visible":"none";e.current.addLayer({id:l,type:"fill",source:s,layout:{visibility:r},paint:{"fill-color":"rgba(0, 0, 255, 0.2)","fill-opacity":["case",["boolean",["feature-state","focused"],!1],.5,0],"fill-outline-color":"rgba(0, 0, 0, 0.2)"},filter:["==","$type","Polygon"]}),e.current.addLayer({id:u,type:"line",source:s,layout:{visibility:r},paint:{"line-color":"rgba(0, 0, 200, 0.25)","line-width":["case",["boolean",["feature-state","navigated"],!1],2,0],"line-opacity":["case",["boolean",["feature-state","navigated"],!1],1,0]},filter:["==","$type","Polygon"]})}},v=async(e,r,i)=>{if(!e.current)return;if(0===r.length){e.current.getSource(h)&&e.current.getSource(h).setData({type:"FeatureCollection",features:[]});return}e.current.getSource(h)||e.current.addSource(h,{type:"geojson",data:{type:"FeatureCollection",features:[]},promoteId:"uuid"});let o=(0,n.YN)(l,i.project_uuid)?"visible":"none";e.current.getLayer(c)?e.current.setLayoutProperty(c,"visibility",o):e.current.addLayer({id:c,type:"fill",source:h,layout:{visibility:o},paint:{"fill-color":"rgba(0, 0, 255, 0.2)","fill-opacity":.5,"fill-outline-color":"rgba(0, 0, 0, 0.2)"},filter:["==","$type","Polygon"]});let s=r.filter(e=>Array.isArray(e.bbox)&&4===e.bbox.length).map(e=>e.bbox);m&&(m.terminate(),m=null),m=new a;let u=g+=1,p=`union-${i.project_uuid}`;m.onmessage=r=>{if(!e.current||r.data?.jobId!==g||r.data?.error)return;let i=r.data?.unionGeojson;i&&e.current.getSource(h)&&e.current.getSource(h).setData(i)},m.postMessage({jobId:u,bboxes:s,uuid:p})},x=(e,r)=>{e.current&&(p&&(!r||p!==r)&&e.current.setFeatureState({source:s,id:p},{focused:!1}),r&&(!p||p!==r)&&e.current.setFeatureState({source:s,id:r},{focused:!0}),p=r)},b=(e,r,i=1e4)=>{e.current&&(f&&(clearTimeout(f),d&&d!==r&&e.current.setFeatureState({source:s,id:d},{navigated:!1})),d=r,e.current.setFeatureState({source:s,id:r},{navigated:!0}),f=setTimeout(()=>{e.current&&d===r&&(e.current.setFeatureState({source:s,id:r},{navigated:!1}),d=null),f=null},i))}},14147:(e,r,i)=>{"use strict";var n=i(95182),o=i(4708),a=i(39052),s=a.isPlatform("Mac OS X"),l=s&&a.isBrowser("Firefox < 29"),u=n.hasCommandModifier,c=n.isCtrlKeyCommand;function h(e){return s&&e.altKey||c(e)}e.exports=function(e){switch(e.keyCode){case 66:return u(e)?"bold":null;case 68:return c(e)?"delete":null;case 72:return c(e)?"backspace":null;case 73:return u(e)?"italic":null;case 74:return u(e)?"code":null;case 75:return s&&c(e)?"secondary-cut":null;case 77:case 79:return c(e)?"split-block":null;case 84:return s&&c(e)?"transpose-characters":null;case 85:return u(e)?"underline":null;case 87:return s&&c(e)?"backspace-word":null;case 89:if(c(e))return s?"secondary-paste":"redo";return null;case 90:return(u(e)?e.shiftKey?"redo":"undo":null)||null;case o.RETURN:return"split-block";case o.DELETE:return!s&&e.shiftKey?null:h(e)?"delete-word":"delete";case o.BACKSPACE:return u(e)&&s?"backspace-to-start-of-line":h(e)?"backspace-word":"backspace";case o.LEFT:return l&&u(e)?"move-selection-to-start-of-block":null;case o.RIGHT:return l&&u(e)?"move-selection-to-end-of-block":null;default:return null}}},14338:(e,r,i)=>{"use strict";var n=i(27239),o=i(96058)(),a=i(38512).functionsHaveConfigurableNames(),s=i(65865);e.exports=function(e,r){if("function"!=typeof e)throw new s("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||a)&&(o?n(e,"name",r,!0,!0):n(e,"name",r)),e}}
113,14842:(e,r,i)=>{"use strict";var n=i(93710).OrderedMap;e.exports={createFromArray:function(e){return n(e.map(function(e){return[e.getKey(),e]}))}}},14933:(e,r,i)=>{"use strict";var n=i(18916);e.exports=function(e,r){e.setMode("composite"),e.update(n.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(r)}},15065:(e,r,i)=>{"use strict";var n=i(15796);e.exports=function(e,r){var i=[];return e.findEntityRanges(function(e){return e.getEntity()===r},function(e,r){i.push({start:e,end:r})}),i.length||n(!1),i}},15076:(e,r,i)=>{"use strict";var n=i(41822);function o(){return(o=n||function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}var a=i(99297),s=i(14232),l=i(67129),u=i(9610);e.exports=function(e){function r(){return e.apply(this,arguments)||this}return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e,r.prototype.render=function(){var e=this.props,r=e.block,i=e.children,n=e.contentState,c=e.decorator,h=e.decoratorKey,p=e.direction,d=e.leafSet,f=e.text,m=r.getKey(),g=d.get("leaves"),_=c.getComponentForKey(h),y=c.getPropsForKey(h),v=a.encode(m,parseInt(h,10),0),x=f.slice(g.first().get("start"),g.last().get("end")),b=u.getHTMLDirIfDifferent(l.getDirection(x),p);return s.createElement(_,o({},y,{contentState:n,decoratedText:x,dir:b,key:v,entityKey:r.getEntityAt(d.get("start")),offsetKey:v}),i)},r}(s.Component)},15172:(e,r,i)=>{"use strict";var n=i(59356);e.exports=function(e){var r=e.getSelection();return r.isCollapsed()?null:n(e.getCurrentContent(),r)}},15796:e=>{"use strict";var r=function(e){};e.exports=function(e,i){for(var n,o=arguments.length,a=Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];if(r(i),!e){if(void 0===i)n=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;(n=Error(i.replace(/%s/g,function(){return String(a[l++])}))).name="Invariant Violation"}throw n.framesToPop=1,n}}},16006:(e,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return d}});let n=i(64252)._(i(14232)),o=i(72936),a=[],s=[],l=!1;function u(e){let r=e(),i={loading:!0,loaded:null,error:null};return i.promise=r.then(e=>(i.loading=!1,i.loaded=e,e)).catch(e=>{throw i.loading=!1,i.error=e,e}),i}class c{constructor(e,r){this._loadFn=e,this._opts=r,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:r}=this;e.loading&&("number"==typeof r.delay&&(0===r.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},r.delay)),"number"==typeof r.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},r.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}}function h(e){return function(e,r){let i=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},r),a=null;function u(){if(!a){let r=new c(e,i);a={getCurrentValue:r.getCurrentValue.bind(r),subscribe:r.subscribe.bind(r),retry:r.retry.bind(r),promise:r.promise.bind(r)}}return a.promise()}if(!l){let e=i.webpack&&1?i.webpack():i.modules;e&&s.push(r=>{for(let i of e)if(r.includes(i))return u()})}function h(e,r){let s;u(),(s=n.default.useContext(o.LoadableContext))&&Array.isArray(i.modules)&&i.modules.forEach(e=>{s(e)});let l=n.default.useSyncExternalStore(a.subscribe,a.getCurrentValue,a.getCurrentValue);return n.default.useImperativeHandle(r,()=>({retry:a.retry}),[]),n.default.useMemo(()=>{var r;return l.loading||l.error?n.default.createElement(i.loading,{isLoading:l.loading,pastDelay:l.pastDelay,timedOut:l.timedOut,error:l.error,retry:a.retry}):l.loaded?n.default.createElement((r=l.loaded)&&r.default?r.default:r,e):null},[e,l])}return h.preload=()=>u(),h.displayName="LoadableComponent",n.default.forwardRef(h)}(u,e)}function p(e,r){let i=[];for(;e.length;){let n=e.pop();i.push(n(r))}return Promise.all(i).then(()=>
113{if(e.length)return p(e,r)})}h.preloadAll=()=>new Promise((e,r)=>{p(a).then(e,r)}),h.preloadReady=(e=[])=>new Promise(r=>{let i=()=>(l=!0,r());p(s,e).then(i,i)}),window.__NEXT_PRELOADREADY=h.preloadReady;let d=h},16154:e=>{"use strict";function r(e,r,h){h=h||2;var p,m,_,y,v,x,b,w=r&&r.length,E=w?r[0]*h:e.length,S=i(e,0,E,h,!0),T=[];if(!S||S.next===S.prev)return T;if(w&&(S=function(e,r,a,u){var c,h,p,m,g,_=[];for(c=0,h=r.length;c<h;c++)p=r[c]*u,m=c<h-1?r[c+1]*u:e.length,(g=i(e,p,m,u,!1))===g.next&&(g.steiner=!0),_.push(function(e){var r=e,i=e;do(r.x<i.x||r.x===i.x&&r.y<i.y)&&(i=r),r=r.next;while(r!==e);return i}(g));for(_.sort(o),c=0;c<_.length;c++)a=function(e,r){var i=function(e,r){var i,n,o,a=r,u=e.x,c=e.y,h=-1/0;do{if(c<=a.y&&c>=a.next.y&&a.next.y!==a.y){var p=a.x+(c-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(p<=u&&p>h&&(h=p,o=a.x<a.next.x?a:a.next,p===u))return o}a=a.next}while(a!==r);if(!o)return null;var f,m=o,g=o.x,_=o.y,y=1/0;a=o;do{u>=a.x&&a.x>=g&&u!==a.x&&s(c<_?u:h,c,g,_,c<_?h:u,c,a.x,a.y)&&(f=Math.abs(c-a.y)/(u-a.x),d(a,e)&&(f<y||f===y&&(a.x>o.x||a.x===o.x&&(i=o,n=a,0>l(i.prev,i,n.prev)&&0>l(n.next,i,i.next))))&&(o=a,y=f)),a=a.next}while(a!==m);return o}(e,r);if(!i)return r;var o=f(i,e);return n(o,o.next),n(i,i.next)}(_[c],a);return a}(e,r,S,h)),e.length>80*h){p=_=e[0],m=y=e[1];for(var I=h;I<E;I+=h)v=e[I],x=e[I+1],v<p&&(p=v),x<m&&(m=x),v>_&&(_=v),x>y&&(y=x);b=0!==(b=Math.max(_-p,y-m))?32767/b:0}return function e(r,i,o,h,p,m,_){if(r){!_&&m&&function(e,r,i,n){var o=e;do 0===o.z&&(o.z=a(o.x,o.y,r,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var r,i,n,o,a,s,l,u,c=1;do{for(i=e,e=null,a=null,s=0;i;){for(s++,n=i,l=0,r=0;r<c&&(l++,n=n.nextZ);r++);for(u=c;l>0||u>0&&n;)0!==l&&(0===u||!n||i.z<=n.z)?(o=i,i=i.nextZ,l--):(o=n,n=n.nextZ,u--),a?a.nextZ=o:e=o,o.prevZ=a,a=o;i=n}a.nextZ=null,c*=2}while(s>1)}(o)}(r,h,p,m);for(var y,v,x=r;r.prev!==r.next;){if(y=r.prev,v=r.next,m?function(e,r,i,n){var o=e.prev,u=e.next;if(l(o,e,u)>=0)return!1;for(var c=o.x,h=e.x,p=u.x,d=o.y,f=e.y,m=u.y,g=c<h?c<p?c:p:h<p?h:p,_=d<f?d<m?d:m:f<m?f:m,y=c>h?c>p?c:p:h>p?h:p,v=d>f?d>m?d:m:f>m?f:m,x=a(g,_,r,i,n),b=a(y,v,r,i,n),w=e.prevZ,E=e.nextZ;w&&w.z>=x&&E&&E.z<=b;){if(w.x>=g&&w.x<=y&&w.y>=_&&w.y<=v&&w!==o&&w!==u&&s(c,d,h,f,p,m,w.x,w.y)&&l(w.prev,w,w.next)>=0||(w=w.prevZ,E.x>=g&&E.x<=y&&E.y>=_&&E.y<=v&&E!==o&&E!==u&&s(c,d,h,f,p,m,E.x,E.y)&&l(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;w&&w.z>=x;){if(w.x>=g&&w.x<=y&&w.y>=_&&w.y<=v&&w!==o&&w!==u&&s(c,d,h,f,p,m,w.x,w.y)&&l(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;E&&E.z<=b;){if(E.x>=g&&E.x<=y&&E.y>=_&&E.y<=v&&E!==o&&E!==u&&s(c,d,h,f,p,m,E.x,E.y)&&l(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}(r,h,p,m):function(e){var r=e.prev,i=e.next;if(l(r,e,i)>=0)return!1;for(var n=r.x,o=e.x,a=i.x,u=r.y,c=e.y,h=i.y,p=n<o?n<a?n:a:o<a?o:a,d=u<c?u<h?u:h:c<h?c:h,f=n>o?n>a?n:a:o>a?o:a,m=u>c?u>h?u:h:c>h?c:h,g=i.next;g!==r;){if(g.x>=p&&g.x<=f&&g.y>=d&&g.y<=m&&s(n,u,o,c,a,h,g.x,g.y)&&l(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}(r)){i.push(y.i/o|0),i.push(r.i/o|0),i.push(v.i/o|0),g(r),r=v.next,x=v.next;continue}if((r=v)===x){_?1===_?e(r=function(e,r,i){var o=e;do{var a=o.prev,s=o.next.next;!u(a,s)&&c(a,o,o.next,s)&&d(a,s)&&d(s,a)&&(r.push(a.i/i|0),r.push(o.i/i|0),r.push(s.i/i|0),g(o),g(o.next),o=e=s),o=o.next}while(o!==e);return n(o)}(n(r),i,o),i,o,h,p,m,2):2===_&&function(r,i,o,a,s,h){var p=r;do{for(var m,g,_=p.next.next;_!==p.prev;){if(p.i!==_.i&&(m=p,g=_,m.next.i!==g.i&&m.prev.i!==g.i&&!function(e,r){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==r.i&&i.next.i!==r.i&&c(i,i.next,e,r))return!0;i=i.next}while(i!==e);return!1}(m,g)&&(d(m,g)&&d(g,m)&&function(e,r){var i=e,n=!1,o=(e.x+r.x)/2,a=(e.y+r.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&o<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next;while(i!==e);return n}(m,g)&&(l(m.prev,m,g.prev)||l(m,g.prev,g))||u(m,g)&&l(m.prev,m,m.next)>0&&l(g.prev,g,g.next)>0))){var y=f(p,_);p=n(p,p.next),y=n(y,y.next),e(p,i,o,a,s,h,0),e(y,i,o,a,s,h,0);return}_=_.next}p=p.next}while(p!==r)}(r,i,o,h,p,m):e(n(r),i,o,h,p,m,1);break}}}}(S,T,h,p,m,b,0),T}function i(e,r,i,n,o){var a,s;if(o===y(e,r,i,n)>0)for(a=r;a<i;a+=n)s=m(a,e[a],e[a+1],s);else for(a=i-n;a>=r;a-=n)s=m(a,e[a],e[a+1],s);return s&&u(s,s.next)&&(g(s),s=s.next),s}function n(e,r){if(!e)return e;r||(r=e);var i,n=e;do if(i=!1,!n.steiner&&(u(n,n.next)||0===l(n.prev,n,n.next))){if(g(n),(n=r=n.prev)===n.next)break;
113i=!0}else n=n.next;while(i||n!==r);return r}function o(e,r){return e.x-r.x}function a(e,r,i,n,o){return(e=((e=((e=((e=((e=(e-i)*o|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(r=((r=((r=((r=((r=(r-n)*o|0)|r<<8)&0xff00ff)|r<<4)&0xf0f0f0f)|r<<2)&0x33333333)|r<<1)&0x55555555)<<1}function s(e,r,i,n,o,a,s,l){return(o-s)*(r-l)>=(e-s)*(a-l)&&(e-s)*(n-l)>=(i-s)*(r-l)&&(i-s)*(a-l)>=(o-s)*(n-l)}function l(e,r,i){return(r.y-e.y)*(i.x-r.x)-(r.x-e.x)*(i.y-r.y)}function u(e,r){return e.x===r.x&&e.y===r.y}function c(e,r,i,n){var o=p(l(e,r,i)),a=p(l(e,r,n)),s=p(l(i,n,e)),u=p(l(i,n,r));return!!(o!==a&&s!==u||0===o&&h(e,i,r)||0===a&&h(e,n,r)||0===s&&h(i,e,n)||0===u&&h(i,r,n))}function h(e,r,i){return r.x<=Math.max(e.x,i.x)&&r.x>=Math.min(e.x,i.x)&&r.y<=Math.max(e.y,i.y)&&r.y>=Math.min(e.y,i.y)}function p(e){return e>0?1:e<0?-1:0}function d(e,r){return 0>l(e.prev,e,e.next)?l(e,r,e.next)>=0&&l(e,e.prev,r)>=0:0>l(e,r,e.prev)||0>l(e,e.next,r)}function f(e,r){var i=new _(e.i,e.x,e.y),n=new _(r.i,r.x,r.y),o=e.next,a=r.prev;return e.next=r,r.prev=e,i.next=o,o.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function m(e,r,i,n){var o=new _(e,r,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function g(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,r,i){this.i=e,this.x=r,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(e,r,i,n){for(var o=0,a=r,s=i-n;a<i;a+=n)o+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return o}e.exports=r,e.exports.default=r,r.deviation=function(e,r,i,n){var o=r&&r.length,a=o?r[0]*i:e.length,s=Math.abs(y(e,0,a,i));if(o)for(var l=0,u=r.length;l<u;l++){var c=r[l]*i,h=l<u-1?r[l+1]*i:e.length;s-=Math.abs(y(e,c,h,i))}var p=0;for(l=0;l<n.length;l+=3){var d=n[l]*i,f=n[l+1]*i,m=n[l+2]*i;p+=Math.abs((e[d]-e[m])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[m+1]-e[d+1]))}return 0===s&&0===p?0:Math.abs((p-s)/s)},r.flatten=function(e){for(var r=e[0][0].length,i={vertices:[],holes:[],dimensions:r},n=0,o=0;o<e.length;o++){for(var a=0;a<e[o].length;a++)for(var s=0;s<r;s++)i.vertices.push(e[o][a][s]);o>0&&(n+=e[o-1].length,i.holes.push(n))}return i}},16211:(e,r,i)=>{"use strict";var n=i(16576),o=i(23411),a=i(25275),s=i(30286),l=i(49292),u=o(s());n(u,{getPolyfill:s,implementation:a,shim:l}),e.exports=u},16363:e=>{"use strict";function r(){var e;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function i(){var e;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function n(){return{width:window.innerWidth||r(),height:window.innerHeight||i()}}n.withoutScrollbars=function(){return{width:r(),height:i()}},e.exports=n},16576:(e,r,i)=>{"use strict";var n=i(66825),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,s=Array.prototype.concat,l=i(27239),u=i(96058)(),c=function(e,r,i,n){if(r in e){if(!0===n){if(e[r]===i)return}else if("function"!=typeof n||"[object Function]"!==a.call(n)||!n())return}u?l(e,r,i,!0):l(e,r,i)},h=function(e,r){var i=arguments.length>2?arguments[2]:{},a=n(r);o&&(a=s.call(a,Object.getOwnPropertySymbols(r)));for(var l=0;l<a.length;l+=1)c(e,a[l],r[a[l]],i[a[l]])};h.supportsDescriptors=!!u,e.exports=h},16614:(e,r,i)=>{"use strict";i.d(r,{F:()=>a,pj:()=>s,q7:()=>l});var n=i(37876),o=i(61519);let a=async(e,r,i,n,a)=>{if(e.current.getSource(i.id.toString()+"-source")&&(e.current.removeLayer(i.id.toString()),e.current.removeSource(i.id.toString()+"-source"),s(i)),e.current.addSource(i.id.toString()+"-source",{type:"geojson",data:{}}),window.tb.models&&window.tb.models[i.id.toString()])return;let l=await (0,o.bB)(`${r.container_name}/layers/${i.file_path}`);function u(e){let r=e.detail;n(r.selected),a({open:!1,id:0,event:null}),r.selected&&r.boundingBox.material.color.set(0xff0000)}e.current.getLayer(i.id.toString())||e.current.addLayer({id:i.id.toString(),type:"custom",renderingMode:"3d",onAdd:function(){let e={obj:l,type:"gltf",scale:{x:i.properties.ifcScale,y:i.properties.ifcScale,z:i.properties.ifcScale},units:"meters",rotation:{x:90,y:-90,z:0},anchor:"center"};window.tb.loadObj(e,e=>{e.setCoords([i.properties.ifcLon,i.properties.ifcLat,i.properties.ifcElevation]),e.setRotation({x:i.properties.ifcX,y:i.properties.ifcY,z:i.properties.ifcZ}),e.layerId=i.id.toString(),e.layerName=i.name,"false"===i.properties.visible&&(e.visible=!1),e.addEventListener("SelectedChange",u,!1),window.tb.models||(window.tb.models={}),window.tb.models[i.id.toString()]=e,window.tb.add(e)})}
113,render:function(){window.tb.update()}})},s=e=>{if(window.tb&&window.tb.models&&window.tb.models[e.id.toString()]){let r=window.tb.models[e.id.toString()];window.tb.remove(r),delete window.tb.models[e.id.toString()]}},l=(e,r,i,o)=>(0,n.jsxs)("div",{className:"flex w-full",children:[(0,n.jsx)("input",{type:"number",placeholder:"Lat",className:"text-black input  w-1/2 mr-5",value:e,onChange:e=>{""===e.target.value?i(null):Number(e.target.value)>=90?i(89):-90>=Number(e.target.value)?i(-89):i(Number(e.target.value))}}),(0,n.jsx)("input",{type:"number",placeholder:"Lon",className:"text-black input  w-1/2",value:r,onChange:e=>{""===e.target.value?o(null):Number(e.target.value)>=180?o(179):-180>=Number(e.target.value)?o(-179):o(Number(e.target.value))}})]})},18034:(e,r,i)=>{"use strict";var n=i(15796),o=i(4833);e.exports=function(e){var r=e.editorContainer;return r||n(!1),o(r.firstChild)||n(!1),r.firstChild}},18428:(e,r,i)=>{"use strict";var n=i(60620),o=i(62989),a=i(93710),s=a.List,l=a.Map,u=a.OrderedSet,c=a.Record,h=a.Repeat,p=u(),d=c({key:"",type:"unstyled",text:"",characterList:s(),depth:0,data:l()}),f=function(e){if(!e)return e;var r=e.characterList,i=e.text;return i&&!r&&(e.characterList=s(h(n.EMPTY,i.length))),e};function m(e,r){return e.getStyle()===r.getStyle()}function g(e,r){return e.getEntity()===r.getEntity()}e.exports=function(e){function r(r){return e.call(this,f(r))||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.getKey=function(){return this.get("key")},i.getType=function(){return this.get("type")},i.getText=function(){return this.get("text")},i.getCharacterList=function(){return this.get("characterList")},i.getLength=function(){return this.getText().length},i.getDepth=function(){return this.get("depth")},i.getData=function(){return this.get("data")},i.getInlineStyleAt=function(e){var r=this.getCharacterList().get(e);return r?r.getStyle():p},i.getEntityAt=function(e){var r=this.getCharacterList().get(e);return r?r.getEntity():null},i.findStyleRanges=function(e,r){o(this.getCharacterList(),m,e,r)},i.findEntityRanges=function(e,r){o(this.getCharacterList(),g,e,r)},r}(d)},18544:e=>{"use strict";e.exports=function(e,r,i,n){var o=r.getStartKey(),a=r.getEndKey(),s=e.getBlockMap(),l=s.toSeq().skipUntil(function(e,r){return r===o}).takeUntil(function(e,r){return r===a}).concat([[a,s.get(a)]]).map(function(e){var r=e.getDepth()+i;return r=Math.max(0,Math.min(r,n)),e.set("depth",r)});return s=s.merge(l),e.merge({blockMap:s,selectionBefore:r,selectionAfter:r})}},18756:(e,r,i)=>{"use strict";i(23588),e.exports={isValidBlock:function(e,r){var i=e.getKey(),n=e.getParentKey();if(null!=n&&!r.get(n).getChildKeys().includes(i)||!e.getChildKeys().map(function(e){return r.get(e)}).every(function(e){return e.getParentKey()===i}))return!1;var o=e.getPrevSiblingKey();if(null!=o&&r.get(o).getNextSiblingKey()!==i)return!1;var a=e.getNextSiblingKey();return(null==a||r.get(a).getPrevSiblingKey()===i)&&(null===a||null===o||o!==a)&&(""==e.text||!(e.getChildKeys().size>0))},isConnectedTree:function(e){var r=e.toArray().filter(function(e){return null==e.getParentKey()&&null==e.getPrevSiblingKey()});if(1!==r.length)return!1;for(var i=r.shift(),n=0,o=i.getKey(),a=[];null!=o;){var s=e.get(o),l=s.getChildKeys(),u=s.getNextSiblingKey();if(l.size>0){null!=u&&a.unshift(u);var c=l.map(function(r){return e.get(r)}).find(function(e){return null==e.getPrevSiblingKey()});if(null==c)return!1;o=c.getKey()}else o=null!=s.getNextSiblingKey()?s.getNextSiblingKey():a.shift();n++}return n===e.size},isValidTree:function(e){var r=this;return!!e.toArray().every(function(i){return r.isValidBlock(i,e)})&&this.isConnectedTree(e)}}},18847:(e,r,i)=>{e.exports=i(20705)},18916:(e,r,i)=>{"use strict";function n(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){o(e,r,i[r])})}return e}function o(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var a=i(22211),s=i(45288),l=i(636),u=i(75269),c=i(93710),h=c.OrderedSet,p=c.Record,d=c.Stack,f=c.OrderedMap,m=c.List,g=p({allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:d(),selection:null,treeMap:null,undoStack:d()}),_=function(){r.createEmpty=function(e){return this.createWithText("",e)},r.createWithText=function(e,i){return r.createWithContent(s.createFromText(e),i)},r.createWithContent=function(e,i){if(0===e.getBlockMap().count())return r.createEmpty(i);var n=e.getBlockMap().first().getKey();return r.create({currentContent:e,undoStack:d(),redoStack:d(),decorator:i||null,selection:u.createEmpty(n)})},r.create=function(e){var i=e.currentContent,o=e.decorator;return new r(new g(n({},e,{treeMap:v(i,o),directionMap:l.getDirectionMap(i)})))},r.fromJS=function(e){return new r(new g(n({},e,{directionMap:null!=e.directionMap?f(e.directionMap):e.directionMap,inlineStyleOverride:null!=e.inlineStyleOverride?h(e.inlineStyleOverride):e.inlineStyleOverride,nativelyRenderedContent:null!=e.nativelyRenderedContent?s.fromJS(e.nativelyRenderedContent):e.nativelyRenderedContent,redoStack:null!=e.redoStack?d(e.redoStack.map(function(e){return s.fromJS(e)})):e.redoStack,selection:null!=e.selection?new u(e.selection):e.selection,treeMap:null!=e.treeMap?f(e.treeMap).map(function(e){return m(e).map(function(e){return a.fromJS(e)})}):e.treeMap,undoStack:null!=e.undoStack?d(e.undoStack.map(function(e){return s.fromJS(e)})):e.undoStack,currentContent:s.fromJS(e.currentContent)})))},r.set=function(e,i){return new r(e.getImmutable().withMutations(function(r){var n,o,s,l,u,c,h=r.get("decorator"),p=h;null===i.decorator?p=null:i.decorator&&(p=i.decorator);var d=i.currentContent||e.getCurrentContent();if(p!==h){var f,m,g,_,y,x,b=r.get("treeMap");x=p&&h?(f=d,m=d.getBlockMap(),g=b,_=p,y=h,g.merge(m.toSeq().filter(function(e){return _.getDecorations(e,f)!==y.getDecorations(e,f)}).map(function(e){return a.generate(f,e,_)}))):v(d,p),r.merge({decorator:p,treeMap:x,nativelyRenderedContent:null});return}d!==e.getCurrentContent()&&r.set("treeMap",(n=e,o=d.getBlockMap(),s=d.getEntity
113Map(),l=p,c=(u=n.getCurrentContent().set("entityMap",s)).getBlockMap(),n.getImmutable().get("treeMap").merge(o.toSeq().filter(function(e,r){return e!==c.get(r)}).map(function(e){return a.generate(u,e,l)})))),r.merge(i)}))};var e=r.prototype;function r(e){o(this,"_immutable",void 0),this._immutable=e}return e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.getSelection=function(){return this.getImmutable().get("selection")},e.getDecorator=function(){return this.getImmutable().get("decorator")},e.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},r.setInlineStyleOverride=function(e,i){return r.set(e,{inlineStyleOverride:i})},e.getCurrentInlineStyle=function(){var e,r,i,n,o,a,s,l,u,c,h=this.getInlineStyleOverride();if(null!=h)return h;var p=this.getCurrentContent(),d=this.getSelection();return d.isCollapsed()?(e=p,i=(r=d).getStartKey(),n=r.getStartOffset(),o=e.getBlockForKey(i),n>0?o.getInlineStyleAt(n-1):o.getLength()?o.getInlineStyleAt(0):x(e,i)):(a=p,l=(s=d).getStartKey(),u=s.getStartOffset(),u<(c=a.getBlockForKey(l)).getLength()?c.getInlineStyleAt(u):u>0?c.getInlineStyleAt(u-1):x(a,l))},e.getBlockTree=function(e){return this.getImmutable().getIn(["treeMap",e])},e.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),r=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),r,r)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},r.acceptSelection=function(e,r){return y(e,r,!1)},r.forceSelection=function(e,r){return r.getHasFocus()||(r=r.set("hasFocus",!0)),y(e,r,!0)},r.moveSelectionToEnd=function(e){var i=e.getCurrentContent().getLastBlock(),n=i.getKey(),o=i.getLength();return r.acceptSelection(e,new u({anchorKey:n,anchorOffset:o,focusKey:n,focusOffset:o,isBackward:!1}))},r.moveFocusToEnd=function(e){var i=r.moveSelectionToEnd(e);return r.forceSelection(i,i.getSelection())},r.push=function(e,i,n){var o,a,s=!(arguments.length>3)||void 0===arguments[3]||arguments[3];if(e.getCurrentContent()===i)return e;var u=l.getDirectionMap(i,e.getDirectionMap());if(!e.getAllowUndo())return r.set(e,{currentContent:i,directionMap:u,lastChangeType:n,selection:i.getSelectionAfter(),forceSelection:s,inlineStyleOverride:null});var c=e.getSelection(),h=e.getCurrentContent(),p=e.getUndoStack(),f=i;c!==h.getSelectionAfter()||(o=e,(a=n)!==o.getLastChangeType()||"insert-characters"!==a&&"backspace-character"!==a&&"delete-character"!==a)?(p=p.push(h),f=f.set("selectionBefore",c)):("insert-characters"===n||"backspace-character"===n||"delete-character"===n)&&(f=f.set("selectionBefore",h.getSelectionBefore()));var m=e.getInlineStyleOverride();-1===["adjust-depth","change-block-type","split-block"].indexOf(n)&&(m=null);var g={currentContent:f,directionMap:u,undoStack:p,redoStack:d(),lastChangeType:n,selection:i.getSelectionAfter(),forceSelection:s,inlineStyleOverride:m};return r.set(e,g)},r.undo=function(e){if(!e.getAllowUndo())return e;var i=e.getUndoStack(),n=i.peek();if(!n)return e;var o=e.getCurrentContent(),a=l.getDirectionMap(n,e.getDirectionMap());return r.set(e,{currentContent:n,directionMap:a,undoStack:i.shift(),redoStack:e.getRedoStack().push(o),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:o.getSelectionBefore()})},r.redo=function(e){if(!e.getAllowUndo())return e;var i=e.getRedoStack(),n=i.peek();if(!n)return e;var o=e.getCurrentContent(),a=l.getDirectionMap(n,e.getDirectionMap());return r.set(e,{currentContent:n,directionMap:a,undoStack:e.getUndoStack().push(o),redoStack:i.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:n.get
113SelectionAfter()})},e.getImmutable=function(){return this._immutable},r}();function y(e,r,i){return _.set(e,{selection:r,forceSelection:i,nativelyRenderedContent:null,inlineStyleOverride:null})}function v(e,r){return e.getBlockMap().map(function(i){return a.generate(e,i,r)}).toOrderedMap()}function x(e,r){var i=e.getBlockMap().reverse().skipUntil(function(e,i){return i===r}).skip(1).skipUntil(function(e,r){return e.getLength()}).first();return i?i.getInlineStyleAt(i.getLength()-1):h()}e.exports=_},19558:(e,r,i)=>{"use strict";var n=i(11151),o=i(39636),a=i(18916),s=i(2398),l=i(37525),u=i(23061),c=i(38650),h=i(553),p=i(75936),d=i(12968);function f(e){e._internalDrag=!1;var r=e.editorContainer;if(r){var i=new MouseEvent("mouseup",{view:h(r),bubbles:!0,cancelable:!0});r.dispatchEvent(i)}}function m(e,r,i){var n=o.insertText(e.getCurrentContent(),r,i,e.getCurrentInlineStyle());return a.push(e,n,"insert-fragment")}e.exports={onDragEnd:function(e){e.exitCurrentMode(),f(e)},onDrop:function(e,r){var i=new n(r.nativeEvent.dataTransfer),h=e._latestEditorState,g=function(e,r){var i=null,n=null,o=l(e.currentTarget);if("function"==typeof o.caretRangeFromPoint){var a=o.caretRangeFromPoint(e.x,e.y);i=a.startContainer,n=a.startOffset}else{if(!e.rangeParent)return null;i=e.rangeParent,n=e.rangeOffset}i=d(i),n=d(n);var u=d(s(i));return c(r,u,n,u,n)}(r.nativeEvent,h);if(r.preventDefault(),e._dragCount=0,e.exitCurrentMode(),null!=g){var _,y,v,x=i.getFiles();if(x.length>0){if(e.props.handleDroppedFiles&&p(e.props.handleDroppedFiles(g,x)))return;u(x,function(r){r&&e.update(m(h,g,r))});return}var b=e._internalDrag?"internal":"external";e.props.handleDrop&&p(e.props.handleDrop(g,i,b))||(e._internalDrag?e.update((_=h,y=g,v=o.moveText(_.getCurrentContent(),_.getSelection(),y),a.push(_,v,"insert-fragment"))):e.update(m(h,g,i.getText()))),f(e)}}}},19702:e=>{"use strict";function r(e,n){if(!(this instanceof r))return new r(e,n);if(this.data=e||[],this.length=this.data.length,this.compare=n||i,this.length>0)for(var o=(this.length>>1)-1;o>=0;o--)this._down(o)}function i(e,r){return e<r?-1:+(e>r)}e.exports=r,e.exports.default=r,r.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var r=this.data,i=this.compare,n=r[e];e>0;){var o=e-1>>1,a=r[o];if(i(n,a)>=0)break;r[e]=a,e=o}r[e]=n},_down:function(e){for(var r=this.data,i=this.compare,n=this.length>>1,o=r[e];e<n;){var a=(e<<1)+1,s=a+1,l=r[a];if(s<this.length&&0>i(r[s],l)&&(a=s,l=r[s]),i(l,o)>=0)break;r[e]=l,e=a}r[e]=o}}},20109:(e,r,i)=>{"use strict";function n(e,r){var i=o.get(e,r);return"auto"===i||"scroll"===i}var o={get:i(20176),getScrollParent:function(e){if(!e)return null;for(var r=e.ownerDocument;e&&e!==r.body;){if(n(e,"overflow")||n(e,"overflowY")||n(e,"overflowX"))return e;e=e.parentNode}return r.defaultView||r.parentWindow}};e.exports=o},20176:(e,r,i)=>{"use strict";var n=i(83176),o=i(41892);function a(e){return null==e?e:String(e)}e.exports=function(e,r){var i;if(window.getComputedStyle&&(i=window.getComputedStyle(e,null)))return a(i.getPropertyValue(o(r)));if(document.defaultView&&document.defaultView.getComputedStyle){if(i=document.defaultView.getComputedStyle(e,null))return a(i.getPropertyValue(o(r)));if("display"===r)return"none"}return e.currentStyle?"float"===r?a(e.currentStyle.cssFloat||e.currentStyle.styleFloat):a(e.currentStyle[n(r)]):a(e.style&&e.style[n(r)])}},20705:(e,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return c},noSSR:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=i(64252);i(37876),i(14232);let s=a._(i(16006));function l(e){return{default:e?.default||e}}function u(e,r){return delete r.webpack,delete r.modules,e(r)}function c(e,r){let i=s.default,n={loading:({error:e,isLoading:r,pastDelay:i})=>null};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let o=(n={...n,...r}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?i({...n,loader:()=>null!=o?o().then(l):Promise.resolve(l(()=>null))}):(delete n.webpack,delete n.modules,u(i,n))}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
113dule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},20726:(e,r,i)=>{"use strict";var n=i(60620),o=i(62989),a=i(15796);function s(e,r,i){var s=r.getCharacterList(),l=i>0?s.get(i-1):void 0,u=i<s.count()?s.get(i):void 0,c=l?l.getEntity():void 0,h=u?u.getEntity():void 0;if(h&&h===c&&"MUTABLE"!==e.__get(h).getMutability()){for(var p,d,f=(o(s,function(e,r){return e.getEntity()===r.getEntity()},function(e){return e.getEntity()===h},function(e,r){e<=i&&r>=i&&(p={start:e,end:r})}),"object"!=typeof p&&a(!1),p),m=f.start,g=f.end;m<g;)d=s.get(m),s=s.set(m,n.applyEntity(d,null)),m++;return r.set("characterList",s)}return r}e.exports=function(e,r){var i=e.getBlockMap(),n=e.getEntityMap(),o={},a=r.getStartKey(),l=r.getStartOffset(),u=i.get(a),c=s(n,u,l);c!==u&&(o[a]=c);var h=r.getEndKey(),p=r.getEndOffset(),d=i.get(h);a===h&&(d=c);var f=s(n,d,p);return(f!==d&&(o[h]=f),Object.keys(o).length)?e.merge({blockMap:i.merge(o),selectionAfter:r}):e.set("selectionAfter",r)}},20740:(e,r,i)=>{"use strict";var n=i(39636),o=i(58240)("draft_tree_data_support");e.exports=function(e,r,i){var a=e.getSelection(),s=e.getCurrentContent(),l=a,u=a.getAnchorKey(),c=a.getFocusKey(),h=s.getBlockForKey(u);if(o&&"forward"===i&&u!==c)return s;if(a.isCollapsed()){if("forward"===i){if(e.isSelectionAtEndOfContent())return s;if(o&&a.getAnchorOffset()===s.getBlockForKey(u).getLength()){var p=s.getBlockForKey(h.nextSibling);if(!p||0===p.getLength())return s}}else if(e.isSelectionAtStartOfContent())return s;if((l=r(e))===a)return s}return n.removeRange(s,l,i)}},21034:(e,r,i)=>{"use strict";i.d(r,{a:()=>l,u:()=>u});var n=i(37876),o=i(14232),a=i(5168);let s=(0,o.createContext)(null);function l({children:e}){let{data:r,isPending:i,refetch:u}=a.y.useSession(),[c,h]=(0,o.useState)(null),[p,d]=(0,o.useState)(void 0===globalThis.window?"en":localStorage.getItem("lang")||"en");return(0,o.useEffect)(()=>{var e;i||(r?.user?h({id:(e=r.user).id,email:e.email,name:e.name,first_name:e.first_name,surname:e.last_name,profile_image:e.image??"",is_developer:e.is_developer??!1,properties:e.properties,customer_data:e.subscriptions,created_at:e.createdAt,admin_projects:e.adminProjectIds}):h(null))},[r,i]),(0,n.jsx)(s.Provider,{value:{user:c,lang:p,setUser:h,setLang:d,refetch:u},children:e})}function u(){let e=(0,o.useContext)(s);if(!e)throw Error("useUserContext must be used within a UserContextProvider");return e}},21042:(e,r,i)=>{e.exports&&(e.exports={DBSCAN:i(49949),KMEANS:i(21599),OPTICS:i(50844),PriorityQueue:i(89989)})},21599:e=>{function r(e,r,i){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(e,r,i)}r.prototype.init=function(e,r,i){this.assignments=[],this.centroids=[],void 0!==e&&(this.dataset=e),void 0!==r&&(this.k=r),void 0!==i&&(this.distance=i)},r.prototype.run=function(e,r){this.init(e,r);for(var i=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var o=!0;o;){o=this.assign();for(var a=0;a<this.k;a++){for(var s=Array(h),l=0,u=0;u<h;u++)s[u]=0;for(var c=0;c<i;c++){var h=this.dataset[c].length;if(a===this.assignments[c]){for(var u=0;u<h;u++)s[u]+=this.dataset[c][u];l++}}if(l>0){for(var u=0;u<h;u++)s[u]/=l;this.centroids[a]=s}else this.centroids[a]=this.randomCentroid(),o=!0}}return this.getClusters()},r.prototype.randomCentroid=function(){var e,r,i=this.dataset.length-1;do r=Math.round(Math.random()*i),e=this.dataset[r];while(this.centroids.indexOf(e)>=0);return e},r.prototype.assign=function(){for(var e,r=!1,i=this.dataset.length,n=0;n<i;n++)(e=this.argmin(this.dataset[n],this.centroids,this.distance))!=this.assignments[n]&&(this.assignments[n]=e,r=!0);return r},r.prototype.getClusters=function(){for(var e,r=Array(this.k),i=0;i<this.assignments.length;i++)void 0===r[e=this.assignments[i]]&&(r[e]=[]),r[e].push(i);return r},r.prototype.argmin=function(e,r,i){for(var n,o=Number.MAX_VALUE,a=0,s=r.length,l=0;l<s;l++)(n=i(e,r[l]))<o&&(o=n,a=l);return a},r.prototype.distance=function(e,r){for(var i=0,n=Math.min(e.length,r.length);n--;){var o=e[n]-r[n];i+=o*o}return Math.sqrt(i)},e.exports&&(e.exports=r)},22211:(e,r,i)=>{"use strict";var n=i(62989),o=i(39667),a=i(93710),s=a.List,l=a.Repeat,u=a.Record,c=function(){return!0},h=u({start:null,end:null}),p=u({start:null,end:null,decoratorKey:null,leaves:null});function d(e,r){return e===r}e.exports={generate:function(e,r,i){var o=r.getLength();if(!o)return s.of(new p({start:0,end:0,decoratorKey:null,leaves:s.of(new h({start:0,end:0}))}
113));var a=[],u=i?i.getDecorations(r,e):s(l(null,o)),f=r.getCharacterList();return n(u,d,c,function(e,r){var i,o,l;a.push(new p({start:e,end:r,decoratorKey:u.get(e),leaves:(i=f.slice(e,r).toList(),o=e,l=[],n(i.map(function(e){return e.getStyle()}).toList(),d,c,function(e,r){l.push(new h({start:e+o,end:r+o}))}),s(l))}))}),s(a)},fromJS:function(e){var r=e.leaves;return new p(function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},function(e,r){if(null==e)return{};var i,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(i=a[n])>=0||(o[i]=e[i]);return o}(e,["leaves"]),{leaves:null!=r?s(Array.isArray(r)?r:o(r)).map(function(e){return h(e)}):null}))}}},22629:(e,r,i)=>{"use strict";i.d(r,{$9:()=>I,F0:()=>v,Hu:()=>x,I2:()=>O,I8:()=>S,NP:()=>f,TC:()=>k,TI:()=>M,W1:()=>C,WD:()=>T,YN:()=>L,a4:()=>P,cL:()=>A,e3:()=>g,g2:()=>D,md:()=>w,o0:()=>m,uT:()=>R});var n=i(84412),o=i(11257),a=i(47133),s=i(97685),l=i(61519),u=i(23323),c=i(38960),h=i(45602),p=i(84091),d=i(69585);let f=()=>{let e="#";for(let r=0;r<6;r++)e+="0123456789ABCDEF"[Math.floor(16*Math.random())];return e},m=(e,r)=>{e.serverCapabilities=JSON.stringify(r),r.refresh&&r.id&&(e.id=r.id)},g=(e,r,i=!1)=>{let o;if(r&&(0,c.pA)(e))o="/layer/sync";else switch(e){case a.mb.WFS:case"WFS":o="/layer/create/wfs";break;case a.mb.WMTS:case"WMTS":o="/layer/create/wmts";break;case a.mb.WMS:case"WMS":o="/layer/create/wms";break;case a.mb.ArcGIS:case"ArcGIS":o="/layer/create/arcgis";break;default:o="/layer/create"}return i?`${n.fn}${o}`:o},_={200:"Upload Successful",207:"Some WFS layers failed to create",500:"Upload Failed"},y={200:"Layer Refreshed - Processing",400:"Layer does not exist or is not a compatible service",423:"An active refresh is ongoing",502:"Failed to retrieve data from service",500:"An internal error occurred"},v=(e,r)=>"refresh"===e?y[r]||y[500]:_[r]||_[500],x=async(e,r,i,n)=>(b(e,i,r,n,!0,d.Uj),e),b=(e,r,i,n,o=!1,a)=>{if(!e.current.getSource(r+"-source")){let n=a??(o?d.ye:d.E);e.current.addSource(r+"-source",{type:"raster",tiles:[i],tileSize:o?d.Bh:d.yU,minzoom:0,maxzoom:n})}e.current.getLayer(r)&&e.current.removeLayer(r),e.current.addLayer({id:r,type:"raster",source:r+"-source",paint:{"raster-opacity":n/100,"raster-resampling":"nearest","raster-fade-duration":0}}),(0,p.y)(e.current)};async function w(e,r){let i=s.Ay.loading("Retrieving LRS routes...");try{let n=await E(r.project_uuid);e(n.routes),s.Ay.dismiss(i),s.Ay.success("Fetched LRS data",{id:i})}catch{s.Ay.error("Failed to fetch LRS routes",{id:i})}}let E=async e=>(0,u.x)("/map/get-routes",{method:"GET",params:{projectId:e}}),S=async(e,r,i,n)=>(b(e,i,r,n),e),T=async(e,r,i,n)=>(b(e,i,r,n,!0),e),I=(e,r)=>{let i=String(e.id);e.id=i+"-layer",r(r=>r.map(r=>String(r.id).replace("-layer","")===i?e:e.properties.hasLRS?{...r,properties:{...r.properties,hasLRS:!1}}:r))},M=async(e,r,i)=>{try{return await (0,o.H7)(e,r,i)}catch(e){e instanceof Error&&e.message.includes("No layers available to add")?s.Ay.error("No layers available to add"):s.Ay.error("Invalid WFS URL")}},C=async e=>{try{return await (0,o.WO)(e)}catch{s.Ay.error("Invalid WMTS URL")}},A=async e=>{try{return await (0,o.cI)(e)}catch(e){e instanceof Error&&e.message.includes("No layers available to add")?s.Ay.error("No layers available to add"):s.Ay.error("Invalid WMS URL")}};function P(e,r,i){let n;if(r){try{let r=JSON.parse(localStorage.getItem(e)||"{}");n="object"!=typeof r||null===r||Array.isArray(r)?{}:r}catch{n={}}n[r]=i,localStorage.setItem(e,JSON.stringify(n))}}function L(e,r){if(!r)return!0;try{let i=localStorage.getItem(e),n=JSON.parse(i||"{}");if("object"!=typeof n||null===n||Array.isArray(n))return localStorage.removeItem(e),!0;return n[r]??!0}catch{return localStorage.removeItem(e),!0}}
113let O=(e,r,i)=>{if(!e.current)return;let n=(0,h.tP)(r),o=[...n,...n.map(e=>`${e}-stroke`),...n.map(e=>`${e}-halo`),...n.map(e=>`${e}-vector-label`),`${r}-cluster`,`${r}-cluster-count`],a=i?"visible":"none";o.forEach(r=>{e.current.getLayer(r)&&e.current.setLayoutProperty(r,"visibility",a)})},D=e=>e.filter(e=>!0===e.properties.visible||"true"===e.properties.visible).length>0?"visible":"not visible",R=async(e,r)=>{if(!r)return void s.Ay.error("User not found");try{let r=JSON.parse(localStorage.getItem("project")||"{}"),i=await (0,l.bB)(`${r.container_name}/layers/${e.file_path}`),n=await fetch(i),o=await n.blob(),a=URL.createObjectURL(o);if(!n.ok)throw Error();let s=document.createElement("a");s.href=a,s.download=e.file_path||"layer.geojson",s.style.display="none",document.body.appendChild(s),s.click(),URL.revokeObjectURL(a),document.body.removeChild(s)}catch{s.Ay.error("Download failed")}},k=async(e,r)=>{try{await (0,u.x)("/layer/delete",{method:"DELETE",params:{id:e.id}});let i=e.id.toString(),n=r.current.getLayer(i).source;r.current.removeLayer(i),r.current.removeSource(n),r.current.on("style.load",async()=>{r.current.getLayer(e)&&r.current.removeLayer(e)})}catch(e){console.error(e),s.Ay.error("Ran Into Error While Deleting")}}},22732:(e,r,i)=>{"use strict";var n=i(18916);e.exports=function(e){var r=e.getSelection(),i=r.getStartKey();return n.set(e,{selection:r.merge({anchorKey:i,anchorOffset:0,focusKey:i,focusOffset:0,isBackward:!1}),forceSelection:!0}
113)}},22957:(e,r,i)=>{"use strict";var n=i(93710).List;e.exports=function(){function e(e){var r,i;i=void 0,(r="_decorators")in this?Object.defineProperty(this,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):this[r]=i,this._decorators=e.slice()}var r=e.prototype;return r.getDecorations=function(e,r){var i=Array(e.getText().length).fill(null);return this._decorators.forEach(function(n,o){var a=0;(0,n.strategy)(e,function(e,r){(function(e,r,i){for(var n=r;n<i;n++)if(null!=e[n])return!1;return!0})(i,e,r)&&(function(e,r,i,n){for(var o=r;o<i;o++)e[o]=n}(i,e,r,o+"."+a),a++)},r)}),n(i)},r.getComponentForKey=function(e){var r=parseInt(e.split(".")[0],10);return this._decorators[r].component},r.getPropsForKey=function(e){var r=parseInt(e.split(".")[0],10);return this._decorators[r].props},e}()},23061:(e,r,i)=>{"use strict";var n=i(15796),o=/\.textClipping$/,a={"text/plain":!0,"text/html":!0,"text/rtf":!0};e.exports=function(e,r){var s=0,l=[];e.forEach(function(u){!function(e,r){if(!i.g.FileReader||e.type&&!(e.type in a))return r("");if(""===e.type){var s="";o.test(e.name)&&(s=e.name.replace(o,"")),r(s);return}var l=new FileReader;l.onload=function(){var e=l.result;"string"!=typeof e&&n(!1),r(e)},l.onerror=function(){r("")},l.readAsText(e)}(u,function(i){s++,i&&l.push(i.slice(0,5e3)),s==e.length&&r(l.join("\r"))})})}},23117:(e,r,i)=>{"use strict";i.d(r,{IM:()=>a,O0:()=>n,bX:()=>o,s:()=>l,th:()=>s});let n=/^[!-~]([ -~]*[!-~])?$/,o=/^[a-zA-Z0-9](?:[a-zA-Z0-9\s]*[a-zA-Z0-9])?$/,a=/^\d{4,5}$/,s=/^-?\d+(\.\d+)?$/,l=/^(?:[0-9]?[0-9](?:\.[0-9]+)?|(100(\.0+)?))$/},23323:(e,r,i)=>{"use strict";i.d(r,{x:()=>c});var n=i(84412),o=i(77582);class a extends Error{status;constructor(e,r){super(e),this.status=r,this.name="ApiError"}}async function s(e){let r=await e.text().catch(()=>""),i=r||null;try{let e=r?JSON.parse(r):void 0;return void 0!==e?function(e){if(!e||"object"!=typeof e||Array.isArray(e))return;let r=e.message??e.error;return"string"==typeof r&&r.trim()?r:void 0}(e)??i:i}catch{return i}}async function l(){try{(0,o.m)()}catch{throw new a("Unauthorized",401)}throw await new Promise(e=>setTimeout(e,1e4)),new a("Unauthorized",401)}async function u(e){if(401===e.status&&await l(),403===e.status)throw new a("You do not have permission to perform this action.",403);if(!e.ok)throw new a(await s(e)||e.statusText,e.status)}async function c(e,{json:r,form:i,params:o,headers:a,rawResponse:s=!1,...l}={}){let h,p;if(r&&i)throw Error("protectedFetch: cannot specify both `json` and `form`");let d=function(e,r){let i=n.fn.endsWith("/")?n.fn:`${n.fn}/`,o=new URL(e.startsWith("/")?e.slice(1):e,i);if(r)for(let[e,i]of Object.entries(r))void 0!==i&&o.searchParams.set(e,String(i));return o}(e,o),{headers:f,body:m}=(p=new Headers(a),void 0!==r?(p.set("Content-Type","application/json"),h=JSON.stringify(r)):i&&(h=i),{headers:p,body:h}),g=await fetch(d,{credentials:"include",...l,headers:f,body:m});return(await u(g),s)?g:g.json()}},23411:(e,r,i)=>{"use strict";var n=i(80985),o=i(98857),a=i(66530),s=i(1737);e.exports=function(e){var r=a(arguments),i=1+e.length-(arguments.length-1);return n(r,i>0?i:0,!0)},o?o(e.exports,"apply",{value:s}):e.exports.apply=s},23588:(e,r,i)=>{"use strict";e.exports=i(74637)},24350:(e,r,i)=>{"use strict";var n=i(60620),o=i(93710).Map;function a(e,r,i,a){var s=e.getBlockMap(),l=r.getStartKey(),u=r.getStartOffset(),c=r.getEndKey(),h=r.getEndOffset(),p=s.skipUntil(function(e,r){return r===l}).takeUntil(function(e,r){return r===c}).concat(o([[c,s.get(c)]])).map(function(e,r){l===c?(o=u,s=h):(o=r===l?u:0,s=r===c?h:e.getLength());for(var o,s,p,d=e.getCharacterList();o<s;)p=d.get(o),d=d.set(o,a?n.applyStyle(p,i):n.removeStyle(p,i)),o++;return e.set("characterList",d)});return e.merge({blockMap:s.merge(p),selectionBefore:r,selectionAfter:r})}e.exports={add:function(e,r,i){return a(e,r,i,!0)},remove:function(e,r,i){return a(e,r,i,!1)}}},25236:(e,r,i)=>{"use strict";i.d(r,{$W:()=>v,B9:()=>M,DU:()=>x,GW:()=>S,lq:()=>y,m7:()=>_,mE:()=>g,sI:()=>b,wZ:()=>w,xx:()=>I});var n=i(85428),o=i(80856),a=i(84412),s=i(98287),l=i(95674),u=i(23323);let c=new Map,h=null,p=[],d=!1,f=0,m=()=>{for(;p.length>0;){let{resolve:e}=p.shift();
113e(Array.from(c.values()))}},g=(e,r=!0)=>{let i=Array.from(c.values()),n=(0,s.bY)(i),a=(0,s.FQ)(i),u=(0,s.gr)(i);(0,l.ef)(e,o.Zg.NORMAL,n),(0,l.ef)(e,o.Zg.THREE_D,a),(0,l.ef)(e,o.Zg.AI,u),r&&localStorage.setItem("notes",[...Array(10)].map(()=>Math.random().toString(36)[2]).join(""))},_=async(e,r,i=!0)=>{await I(r,e,!0),g(e,i)},y=(e,r,i)=>{c.has(r.id)||(c.set(r.id,r),E(e,r.properties.data),g(e,i))},v=(e,r,i)=>{r.forEach(e=>{c.has(e)&&c.delete(e)}),g(e,i)},x=async(e,r,i,n)=>{let o=c.get(r);if(o){let r=new Set(o.notification_ids||[]);i?.length&&i.forEach(e=>r.delete(e)),n?.length&&n.forEach(e=>r.add(e)),o.notification_ids=Array.from(r),g(e,!1)}},b=async(e,r,i)=>{let n=r?.id?c.get(r.id):void 0;n&&(r?.properties?.data&&E(e,r.properties.data),Object.assign(n,r),g(e,i))},w=async(e,r,i=!0,o=!1)=>{h&&i&&(h.abort("New fetch made"),m()),h=new AbortController,e={...e,screen:(0,n.i6)(r),doubleBB:!0};let a=(await S(e,null,!0,h,void 0)).notes;return o&&(f=0,c.clear()),a.forEach(e=>{let i=c.get(e.id);if(i){let r=e.notification_ids.length-i.notification_ids.length;f+r<=2e3?f+=r:e.notification_ids=i.notification_ids}else f+e.notification_ids.length<2e3?f+=e.notification_ids.length:e.notification_ids=[];c.set(e.id,e),E(r,e.properties.data)}),Array.from(c.values())},E=(e,r)=>{if(r&&"custom"===r.icon_type){let i=r.icon;e.current.loadImage(i,(r,n)=>{if(r)throw r;e.current.hasImage(i)||e.current.addImage(i,n)})}},S=async(e,r,i=!1,o,a)=>{try{let s={project_id:(0,n.Ky)().project_uuid,range:a,filterOptions:e?{...e,screen:i?e.screen:void 0}:void 0,sortConfig:r??void 0},l=JSON.parse(JSON.stringify(s));return await (0,u.x)("/note/filter",{method:"POST",json:l,signal:o?.signal})}catch(e){return console.error("Request failed:",e),{notes:[],count:0}}},T=async(e,r,i=!1)=>
113{if(d||0===p.length)return[];let{resolve:n}=p.shift();d=!0;let o=[];try{o=await w(e,r,void 0,i)}finally{d=!1,n(o),T(e,r,i)}},I=(e,r,i=!1)=>(m(),p=[],new Promise(n=>{p.push({resolve:n}),T(e,r,i)})),M=async e=>{let r=JSON.parse(localStorage.getItem("project")??"{}"),i=r?.container_name;try{let r=new URLSearchParams({notes:JSON.stringify(e),container_name:i??""});return await (0,u.x)(`${a.fn}/note/delete?${r.toString()}`,{method:"DELETE"}),(0,n.By)(),!0}catch(e){return console.error("Request failed:",e),!1}}},25275:(e,r,i)=>{"use strict";var n=i(14338),o=i(65865),a=Object;e.exports=n(function(){if(this==null||this!==a(this))throw new o("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0)},25429:(e,r,i)=>{"use strict";var n=i(39636),o=i(99297),a=i(18916),s=i(39052),l=i(88017).notEmptyKey,u=i(2398),c=i(84785),h=i(12968),p=s.isEngine("Gecko");e.exports=function(e,r){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var i=e.editor.ownerDocument.defaultView.getSelection(),s=i.anchorNode,d=i.isCollapsed,f=(null==s?void 0:s.nodeType)!==Node.TEXT_NODE&&(null==s?void 0:s.nodeType)!==Node.ELEMENT_NODE;if(null!=s&&!f){if(s.nodeType===Node.TEXT_NODE&&(null!==s.previousSibling||null!==s.nextSibling)){var m=s.parentNode;if(null==m)return;s.nodeValue=m.textContent;for(var g=m.firstChild;null!=g;g=g.nextSibling)g!==s&&m.removeChild(g)}var _=s.textContent,y=e._latestEditorState,v=h(u(s)),x=o.decode(v),b=x.blockKey,w=x.decoratorKey,E=x.leafKey,S=y.getBlockTree(b).getIn([w,"leaves",E]),T=S.start,I=S.end,M=y.getCurrentContent(),C=M.getBlockForKey(b),A=C.getText().slice(T,I);if(_.endsWith("\n\n")&&(_=_.slice(0,-1)),_===A){var P=r.nativeEvent.inputType;if(P){var L,O,D,R,k="deleteContentBackward"===P?c(y):y;k!==y&&(e.restoreEditorDOM(),e.update(k))}return}var N=y.getSelection(),F=N.merge({anchorOffset:T,focusOffset:I,isBackward:!1}),z=C.getEntityAt(T),B=l(z)?M.getEntity(z):null,U="MUTABLE"===(null!=B?B.getMutability():null),j=n.replaceText(M,F,_,C.getInlineStyleAt(T),U?C.getEntityAt(T):null);if(p)R=(D=T+Math.min(L=i.anchorOffset,O=i.focusOffset))+Math.abs(L-O),L=D,O=R;else{var V=_.length-A.length;D=N.getStartOffset(),R=N.getEndOffset(),L=d?R+V:D,O=R+V}var G=j.merge({selectionBefore:M.getSelectionAfter(),selectionAfter:N.merge({anchorOffset:L,focusOffset:O})});e.update(a.push(y,G,U?"spellcheck-change":"apply-entity"))}}},25500:(e,r,i)=>{"use strict";var n=i(39052),o=i(85788),a=i(96634),s=i(14933),l=i(34254),u=i(78725),c=i(27731),h=i(13379),p=i(5373),d=i(25429),f=i(63578),m=i(89314),g=i(95431),_=n.isBrowser("Chrome"),y=n.isBrowser("Firefox"),v=_||y?g:function(e){};e.exports={onBeforeInput:o,onBlur:a,onCompositionStart:s,onCopy:l,onCut:u,onDragOver:c,onDragStart:h,onFocus:p,onInput:d,onKeyDown:f,onPaste:m,onSelect:g,onMouseUp:v,onKeyUp:v}},25727:(e,r,i)=>{"use strict";var n=i(41822);function o(){return(o=n||function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}var a=i(45668),s=i(99297),l=i(14232),u=i(73239),c=i(85452),h=i(12968);e.exports=function(e){function r(){return e.apply(this,arguments)||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.shouldComponentUpdate=function(e){var r=this.props.editorState,i=e.editorState;if(r.getDirectionMap()!==i.getDirectionMap()||r.getSelection().getHasFocus()!==i.get
113Selection().getHasFocus())return!0;var n=i.getNativelyRenderedContent(),o=r.isInCompositionMode(),a=i.isInCompositionMode();if(r===i||null!==n&&i.getCurrentContent()===n||o&&a)return!1;var s=r.getCurrentContent(),l=i.getCurrentContent(),u=r.getDecorator(),c=i.getDecorator();return o!==a||s!==l||u!==c||i.mustForceSelection()},i.render=function(){for(var e=this.props,r=e.blockRenderMap,i=e.blockRendererFn,n=e.blockStyleFn,p=e.customStyleMap,d=e.customStyleFn,f=e.editorState,m=e.editorKey,g=e.preventScroll,_=e.textDirectionality,y=f.getCurrentContent(),v=f.getSelection(),x=f.mustForceSelection(),b=f.getDecorator(),w=h(f.getDirectionMap()),E=y.getBlocksAsArray(),S=[],T=null,I=null,M=0;M<E.length;M++){var C=E[M],A=C.getKey(),P=C.getType(),L=i(C),O=void 0,D=void 0,R=void 0;L&&(O=L.component,D=L.props,R=L.editable);var k=_||w.get(A),N=s.encode(A,0,0),F={contentState:y,block:C,blockProps:D,blockStyleFn:n,customStyleMap:p,customStyleFn:d,decorator:b,direction:k,forceSelection:x,offsetKey:N,preventScroll:g,selection:v,tree:f.getBlockTree(A)},z=r.get(P)||r.get("unstyled"),B=z.wrapper,U=z.element||r.get("unstyled").element,j=C.getDepth(),V="";(n&&(V=n(C)),"li"===U)&&(V=c(V,u({"public/DraftStyleDefault/unorderedListItem":"unordered-list-item"===P,"public/DraftStyleDefault/orderedListItem":"ordered-list-item"===P,"public/DraftStyleDefault/reset":I!==B||null===T||j>T,"public/DraftStyleDefault/depth0":0===j,"public/DraftStyleDefault/depth1":1===j,"public/DraftStyleDefault/depth2":2===j,"public/DraftStyleDefault/depth3":3===j,"public/DraftStyleDefault/depth4":j>=4,"public/DraftStyleDefault/listLTR":"LTR"===k,"public/DraftStyleDefault/listRTL":"RTL"===k})));var G=O||a,q={className:V,"data-block":!0,"data-editor":m,"data-offset-key":N,key:A};void 0!==R&&(q=function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},q,{contentEditable:R,suppressContentEditableWarning:!0}));var H=l.createElement(U,q,l.createElement(G,o({},F,{key:A})));S.push({block:H,wrapperTemplate:B,key:A,offsetKey:N}),T=B?C.getDepth():null,I=B}for(var $=[],W=0;W<S.length;){var Y=S[W];if(Y.wrapperTemplate){var Z=[];do Z.push(S[W].block),W++;while(W<S.length&&S[W].wrapperTemplate===Y.wrapperTemplate);var X=l.cloneElement(Y.wrapperTemplate,{key:Y.key+"-wrap","data-offset-key":Y.offsetKey},Z);$.push(X)}else $.push(Y.block),W++}return l.createElement("div",{"data-contents":"true"},$)},r}(l.Component)},27147:(e,r,i)=>{"use strict";var n=i(58240)("draft_tree_data_support");e.exports=i(n?86733:25727)},27239:(e,r,i)=>{"use strict";var n=i(98857),o=i(71742),a=i(65865),s=i(10221);e.exports=function(e,r,i){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof r&&"symbol"!=typeof r)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,h=arguments.length>6&&arguments[6],p=!!s&&s(e,r);if(n)n(e,r,{configurable:null===c&&p?p.configurable:!c,enumerable:null===l&&p?p.enumerable:!l,value:i,writable:null===u&&p?p.writable:!u});else if(!h&&(l||u||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else e[r]=i}},27348:(e,r,i)=>{var n=i(99742);"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),({166:function(){!function(e){"use strict";if(!e.setImmediate){var r,i,o,a,s,l=1,u={},c=!1,h=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"===({}).toString.call(e.process)?s=function(e){n.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var r=!0,i=e.onmessage;return e.onmessage=function(){r=!1},e.postMessage("","*"),e.onmessage=i,r}}()?(r="setImmediate$"+Math.random()+"$",i=function(i){i.source===e&&"string"==typeof i.data&&0===i.data.indexOf(r)&&f(+i.data.slice(r.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),s=function(i){e.postMessage(r+i,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){f(e.data)},s=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(a=h.documentElement,s=function(e){var r=h.createElement("script");r.onreadystatechange=function(){f(e),r.onreadystatechange=null,a.removeChild(r),r=null},a.appendChild(r)}):s=function(e){setTimeout(f,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=Function(""+e));for(var r=Array(arguments.length-1),i=0;i<r.length;i++)r[i]=arguments[i+1];var n={callback:e,args:r};return u[l]=n,s(l),l++},p.clearImmediate=d}function d(e){delete u[e]}function f(e){if(c)setTimeout(f,0,e);else{var r=u[e];if(r){c=!0;try{var i=r.callback,n=r.args;switch(n.length){case 0:i();break;case 1:i(n[0]);break;case 2:i(n[0],n[1]);break;case 3:i(n[0],n[1],n[2]);break;default:i.apply(void 0,n)}}finally{d(e),c=!1}}}}}("u"<typeof self?void 0===i.g?this:i.g:self)}})[166](),e.exports={}},27543:(e,r,i)=>{"use strict";var n=i(41506);e.exports=function(e){var r=n(e);return{x:r.left,y:r.top,width:r.right-r.left,height:r.bottom-r.top}}},27731:e=>{"use strict";e.exports=function(e,r){e.setMode("drag"),r.preventDefault()}}
113,28419:(e,r,i)=>{"use strict";var n=i(1643);e.exports=Function.prototype.bind||n},29333:(e,r,i)=>{"use strict";var n=i(18916),o=i(54780),a=i(54380),s=i(20740);e.exports=function(e){var r=s(e,function(e){var r=e.getSelection(),i=e.getCurrentContent(),n=r.getAnchorKey(),s=r.getAnchorOffset(),l=i.getBlockForKey(n).getText()[s];return a(e,l?o.getUTF16Length(l,0):1)},"forward");if(r===e.getCurrentContent())return e;var i=e.getSelection();return n.push(e,r.set("selectionBefore",i),i.isCollapsed()?"delete-character":"remove-range")}},29351:e=>{"use strict";e.exports=Error},29374:(e,r,i)=>{"use strict";i.d(r,{J:()=>h,p:()=>p});var n=i(37876),o=i(14232),a=i(89099),s=i(55283),l=i(6507),u=i(97984);let c=(0,o.createContext)(void 0),h=({children:e})=>{let[r,i]=(0,o.useState)(null),[h,p]=(0,o.useState)(!1),[d,f]=(0,o.useState)(!1),[m,g]=(0,o.useState)(null),[_,y]=(0,o.useState)(360),[v,x]=(0,o.useState)(null),[b,w]=(0,o.useState)(null),[E,S]=(0,o.useState)([]),T=(0,o.useRef)(E),[I,M]=(0,o.useState)(!1),C=(0,o.useRef)(null),{pathname:A}=(0,a.useRouter)(),P=(0,s.JY)(),L=(0,u.W)();(0,o.useEffect)(()=>{let e=()=>{let e=document.querySelector(".map-container");if(!e||!P.map.current)return;let r=window.innerWidth;e.style.transition="none",L?e.style.width="100%":e.style.width=h?`${Math.max(r-_,400)}px`:"100%",P.map.current.resize(),P.splitViewEnabled&&P.altMap?.current?.resize()};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[h,_,P.map,P.altMap,L]),(0,o.useEffect)(()=>{C.current=m},[m]),(0,o.useEffect)(()=>{T.current=E},[E]),(0,o.useEffect)(()=>{"/map"!==A&&(T.current[T.current.length-1]?.onClose?.(),O())},[A]);let O=e=>{e&&("string"==typeof e||"number"==typeof e)&&e!==m||(p(!1),setTimeout(()=>{S([]),g(null),C.current=null},200))},D=()=>{E.length<=1||(x("pop"),M(!0),setTimeout(()=>{S(e=>e.slice(0,-1)),M(!1)},200))};return(0,o.useEffect)(()=>{let e=document.querySelector(".map-container");if(!e||!P.map.current)return;let r=window.innerWidth;h&&!L?(e.style.transition="width 150ms ease-in-out",e.style.width=`${r-_}px`):(e.style.transition="none",e.style.width="100%"),setTimeout(()=>{(P.splitViewEnabled||!h||h&&m&&m!==C.current)&&(P.map.current?.resize(),P.splitViewEnabled&&P.altMap?.current?.resize())},10)},[h,_,P.map,P.altMap,P.splitViewEnabled,m,L]),(0,n.jsxs)(c.Provider,{value:{sidePanelOpen:h,content:E[E.length-1]?.content||null,currentPanelKey:m,toggleSidePanel:(e,r)=>{let i=r?.key,n=h&&i&&m===i;if(n&&!r?.keepSidePanelOpen){E[E.length-1]?.onClose?.(),O();return}h&&!n&&E[E.length-1]?.onClose?.(),y(350),setTimeout(()=>{S([{content:e,title:r?.title||"Panel",actionButtons:r?.actionButtons||null,onClose:r?.onClose,fullWidth:r?.fullWidth||!1}]),g(i),f(r?.beta||!1),y(360),p(!0)},100)},closePanel:O,setSidePanelActionButtons:w,pushSubPage:(e,{title:r,actionButtons:i,onClose:n,fullWidth:o})=>{x("push"),S(a=>[...a,{content:e,title:r,actionButtons:i,onClose:n,fullWidth:o}])},goBack:D,setConfirmationPopup:i},children:[r,e,(0,n.jsx)(l.CP,{sidePanelOpen:h,contentStack:E,closingSubPage:I,closePanel:O,beta:d,sidePanelActionButtons:b,goBack:D,lastAction:v})]})},p=()=>{let e=(0,o.useContext)(c);if(!e)throw Error("useSidePanel must be used within SidePanelProvider");return e}},29782:(e,r,i)=>{"use strict";i.d(r,{A:()=>s,h:()=>l});var n=i(37876),o=i(14232);let a=(0,o.createContext)(void 0);function s({children:e}){let[r,i]=(0,o.useState)({}),[l,u]=(0,o.useState)({}),[c,h]=(0,o.useState)({}),[p,d]=(0,o.useState)(!1);return(0,n.jsx)(a.Provider,{value:{availableImageDates:r,viewInfo:l,showCameraX:c,isPanoAvailable:p,setAvailableImageDates:i,setViewInfo:u,setShowCameraX:h,setIsPanoAvailable:d},children:e})}function l(){let e=(0,o.useContext)(a);if(void 0===e)throw Error("useCameraContext must be used within a CameraContextProvider");return e}},30169:(e,r,i)=>{"use strict";i.d(r,{FS:()=>h,YD:()=>u,Yf:()=>l});var n=i(85428),o=i(14104),a=i(43299),s=i(23323);let l=async(e,r,i,o,a)=>{i=i||200;let l=(0,n.Ky)().project_uuid,u=(await (0,s.x)("/map/filter-lidar",{method:"POST",json:{project_id:l,screen:{location:{lon:e,lat:r},radius:i}}})).rows;return a&&(u=u.map(e=>({...e,refresh_token:(0,n.kX)()}))),u},u=e=>{if(!Array.isArray(e)||0===e.length)return{type:"FeatureCollection",features:[]};let r=e.filter(e=>Array.isArray(e.bbox)&&4==e.bbox.length).map(e=>{let r=(0,n.ah)(e.bbox),i=a.N4z(r.geometry,{uuid:e.uuid,date:e.date,user:e.user,filename:e.properties.input_file,visibility:e.properties.visibility});return i.id=e.uuid,i});return a.Lrk(r)},c=(e,r)=>{e.current&&((0,o.yc)(e),r.setRefreshLidars(e=>e+1))},h=async(e,r)=>{if(e.current)return c(e,r),e.current.on("style.load",async()=>{c(e,r)}),e}},30286:(e,r,i)=>{"use strict";var n=i(25275),o=i(16576).supportsDescriptors,a=Object.getOwnPropertyDescriptor;e.exports=function(){if(o&&"gim"===/a/mig.flags){var e=a(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(i,"sticky",{get:function(){r+="y"}}),e.get.call(i),"dy"===r)return e.get}}return n}},30328:(e,r,i)=>{"use strict";i.d(r,{C:()=>l,i:()=>s});var n=i(37876),o=i(14232);let a=(0,o.createContext)({}),s=({children:e})=>{let[r,i]=(0,o.useState)(null),[s,l]=(0,o.useState)(null),[u,c]=(0,o.useState)(null),[h,p]=(0,o.useState)(""),d=(0,o.useMemo)(()=>({pulseChat:r,pulseChatFile:s,pdfSource:u,pdfUrl:h,setPulseChat:i,setPulseChatFile:l,setPdfSource:c,setPdfUrl:p}),[r,s,u,h,p,c,i,l]);return(0,n.jsx)(a.Provider,{value:d,children:e})},l=()=>{let e=(0,o.useContext)(a);if(!e)throw Error("usePulseContext must be used within a PulseContextProvider");return e}}
113,30753:(e,r,i)=>{"use strict";var n=i(31114),o=i(18916),a=i(82326),s=i(20740);e.exports=function(e){var r=s(e,function(e){var r=e.getSelection(),i=r.getStartOffset();if(0===i)return a(e,1);var o=r.getStartKey(),s=e.getCurrentContent().getBlockForKey(o).getText().slice(0,i);return a(e,n.getBackward(s).length||1)},"backward");return r===e.getCurrentContent()?e:o.push(e,r,"remove-range")}},31114:(e,r,i)=>{"use strict";var n=i(64545).getPunctuation(),o="['‘’]",a="\\s|(?![_])"+n,s=RegExp("^(?:"+a+")*(?:"+o+"|(?!"+a+").)*(?:(?!"+a+").)"),l=RegExp("(?:(?!"+a+").)(?:"+o+"|(?!"+a+").)*(?:"+a+")*$");function u(e,r){var i=r?l.exec(e):s.exec(e);return i?i[0]:e}e.exports={getBackward:function(e){return u(e,!0)},getForward:function(e){return u(e,!1)}}},31180:(e,r,i)=>{"use strict";e.exports=i(98477).unstable_flushControlled},31717:(e,r,i)=>{"use strict";var n=i(16576),o=i(23411),a=i(60577),s=i(12192),l=i(97794),u=o(s(),Object);n(u,{getPolyfill:s,implementation:a,shim:l}),e.exports=u},31985:(e,r,i)=>{"use strict";i.d(r,{Gn:()=>l,HE:()=>o,KR:()=>n,XM:()=>s,tL:()=>a});let n=()=>{if("u">typeof document){let e=window.navigator,r=e.userAgent.toLowerCase(),i=e.standalone,n=/ip(ad|hone|od)/.test(r)||"MacIntel"===e.platform&&e.maxTouchPoints>1,o=/android/.test(r),a=/safari/.test(r);return o&&/; wv\)/.test(r)||n&&!i&&!a}return!1};function o(){if("u">typeof navigator)return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let a=(e,r="web")=>{if(n()){try{window.ReactNativeWebView.postMessage(JSON.stringify({url:e,type:r}))}catch{}try{window.webkit.messageHandlers.Swift.postMessage(JSON.stringify({url:e,type:r}))}catch{}}else window.location.href=e},s=()=>{n()&&window.webkit.messageHandlers.Swift.postMessage("3DScan")},l=()=>{n()&&window.webkit.messageHandlers.Swift.postMessage("MSLogin")}},32538:(e,r,i)=>{"use strict";var n=i(34560),o=i(39636),a=i(99297),s=i(18916),l=i(4708),u=i(39052),c=i(95431),h=i(18034),p=i(3774),d=i(62191),f=i(12968),m=u.isBrowser("IE"),g=!1,_=!1,y=null,v={onCompositionStart:function(e){_=!0,y||(y=new n(h(e))).start()},onCompositionEnd:function(e){g=!1,_=!1,setTimeout(function(){g||v.resolveComposition(e)},20)},onSelect:c,onKeyDown:function(e,r){if(!_){v.resolveComposition(e),e._onKeyDown(r);return}(r.which===l.RIGHT||r.which===l.LEFT)&&r.preventDefault()},onKeyPress:function(e,r){r.which===l.RETURN&&r.preventDefault()},resolveComposition:function(e){if(!_){var r=f(y).stopAndFlushMutations();y=null,g=!0;var i=s.set(e._latestEditorState,{inCompositionMode:!1});if(e.exitCurrentMode(),!r.size)return void e.update(i);var n=i.getCurrentContent();r.forEach(function(e,r){var l=a.decode(r),u=l.blockKey,c=l.decoratorKey,h=l.leafKey,p=i.getBlockTree(u).getIn([c,"leaves",h]),f=p.start,m=p.end,g=i.getSelection().merge({anchorKey:u,focusKey:u,anchorOffset:f,focusOffset:m,isBackward:!1}),_=d(n,g),y=n.getBlockForKey(u).getInlineStyleAt(f);n=o.replaceText(n,g,e,y,_),i=s.set(i,{currentContent:n})});var l=p(i,h(e)).selectionState;e.restoreEditorDOM();var u=m?s.forceSelection(i,l):s.acceptSelection(i,l);e.update(s.push(u,n,"insert-characters"))}}};e.exports=v},32736:(e,r,i)=>{var n=i(57448);function o(e){var r=0;if(e&&e.length>0){r+=Math.abs(a(e[0]));for(var i=1;i<e.length;i++)r-=Math.abs(a(e[i]))}return r}function a(e){var r,i,o,a,l,u,c=0,h=e.length;if(h>2){for(u=0;u<h;u++)u===h-2?(o=h-2,a=h-1,l=0):u===h-1?(o=h-1,a=0,l=1):(o=u,a=u+1,l=u+2),r=e[o],i=e[a],c+=(s(e[l][0])-s(r[0]))*Math.sin(s(i[1]));c=c*n.RADIUS*n.RADIUS/2}return c}function s(e){return e*Math.PI/180}e.exports.geometry=function e(r){var i,n=0;switch(r.type){case"Polygon":return o(r.coordinates);case"MultiPolygon":for(i=0;i<r.coordinates.length;i++)n+=o(r.coordinates[i]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(i=0;i<r.geometries.length;i++)n+=e(r.geometries[i]);return n}},e.exports.ring=a},34068:(e,r,i)=>{"use strict";var n=i(9912),o=i(58217),a=i(93710).OrderedMap,s=function(e){var r,i={};return a(e.withMutations(function(e){e.forEach(function(n,a){var s=n.getKey(),l=n.getNextSiblingKey(),u=n.getPrevSiblingKey(),c=n.getChildKeys(),h=n.getParentKey(),p=o();if(i[s]=p,l&&(e.get(l)?e.setIn([l,"prevSibling"],p):e.setIn([s,"nextSibling"],null)),u&&(e.get(u)?e.setIn([u,"nextSibling"],p):e.setIn([s,"prevSibling"],null)),h&&e.get(h)){var d=e.get(h).getChildKeys();e.setIn([h,"children"],d.set(d.indexOf(n.getKey()),p))}else e.setIn([s,"parent"],null),r&&(e.setIn([r.getKey(),"nextSibling"],p),e.setIn([s,"prevSibling"],i[r.getKey()])),r=e.get(s);
113c.forEach(function(r){e.get(r)?e.setIn([r,"parent"],p):e.setIn([s,"children"],n.getChildKeys().filter(function(e){return e!==r}))})})}).toArray().map(function(e){return[i[e.getKey()],e.set("key",i[e.getKey()])]}))};e.exports=function(e){return e.first()instanceof n?s(e):a(e.toArray().map(function(e){var r=o();return[r,e.set("key",r)]}))}},34091:e=>{"use strict";e.exports=function(e){var r={};return function(i){return r.hasOwnProperty(i)||(r[i]=e.call(this,i)),r[i]}}},34140:(e,r,i)=>{"use strict";var n=i(28419),o=i(71938),a=i(66958);e.exports=i(78121)||n.call(a,o)},34177:(e,r,i)=>{"use strict";var n=i(15796),o=/\./,a=/\|\|/,s=/\s+\-\s+/,l=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,u=/^(\d*)(.*)/;function c(e,r){if(""===(e=e.trim()))return!0;var i,n,a,s,l,u,c,f=r.split(o),m=p(e),g=m.modifier,y=m.rangeComponents;switch(g){case"<":return -1===_(f,y);case"<=":return -1===(i=_(f,y))||0===i;case">=":return h(f,y);case">":return 1===_(f,y);case"~":case"~>":return n=f,s=(a=y).slice(),(l=a.slice()).length>1&&l.pop(),u=l.length-1,d(c=parseInt(l[u],10))&&(l[u]=c+1+""),h(n,s)&&-1===_(n,l);default:return 0===_(f,y)}}function h(e,r){var i=_(e,r);return 1===i||0===i}function p(e){var r=e.split(o),i=r[0].match(l);return i||n(!1),{modifier:i[1],rangeComponents:[i[2]].concat(r.slice(1))}}function d(e){return!isNaN(e)&&isFinite(e)}function f(e){return!p(e).modifier}function m(e,r){for(var i=e.length;i<r;i++)e[i]="0"}function g(e,r){return(typeof e!=typeof r&&n(!1),e>r)?1:e<r?-1:0}function _(e,r){for(var i=function(e,r){m(e=e.slice(),(r=r.slice()).length);for(var i=0;i<r.length;i++){var n=r[i].match(/^[x*]$/i);if(n&&(r[i]=e[i]="0","*"===n[0]&&i===r.length-1))for(var o=i;o<e.length;o++)e[o]="0"}return m(r,e.length),[e,r]}(e,r),n=i[0],o=i[1],a=0;a<o.length;a++){var s=function(e,r){var i=e.match(u)[1],n=r.match(u)[1],o=parseInt(i,10),a=parseInt(n,10);return d(o)&&d(a)&&o!==a?g(o,a):g(e,r)}(n[a],o[a]);if(s)return s}return 0}var y={contains:function(e,r){var i,o,l;return i=e.trim(),o=r.trim(),(l=i.split(a)).length>1?l.some(function(e){return y.contains(e,o)}):function(e,r){var i=e.split(s);if(i.length>0&&i.length<=2||n(!1),1===i.length)return c(i[0],r);var o=i[0],a=i[1];return f(o)&&f(a)||n(!1),c(">="+o,r)&&c("<="+a,r)}(i=l[0].trim(),o)}};e.exports=y},34254:(e,r,i)=>{"use strict";var n=i(15172);e.exports=function(e,r){e._latestEditorState.getSelection().isCollapsed()?r.preventDefault():e.setClipboard(n(e._latestEditorState))}},34349:e=>{"use strict";e.exports=function e(r,i){if(r===i)return!0;if(r&&i&&"object"==typeof r&&"object"==typeof i){if(r.constructor!==i.constructor)return!1;if(Array.isArray(r)){if((n=r.length)!=i.length)return!1;for(o=n;0!=o--;)if(!e(r[o],i[o]))return!1;return!0}if(r.constructor===RegExp)return r.source===i.source&&r.flags===i.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===i.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===i.toString();if((n=(a=Object.keys(r)).length)!==Object.keys(i).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(i,a[o]))return!1;for(o=n;0!=o--;){var n,o,a,s=a[o];if(!e(r[s],i[s]))return!1}return!0}return r!=r&&i!=i}},34560:(e,r,i)=>{"use strict";function n(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var o=i(39052),a=i(2398),s=i(553),l=i(93710),u=i(15796),c=i(12968),h=l.Map,p={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},d=o.isBrowser("IE <= 11");e.exports=function(){function e(e){var r=this;n(this,"observer",void 0),n(this,"container",void 0),n(this,"mutations",void 0),n(this,"onCharData",void 0),this.container=e,this.mutations=h();var i=s(e);i.MutationObserver&&!d?this.observer=new i.MutationObserver(function(e){return r.registerMutations(e)}):this.onCharData=function(e){e.target instanceof Node||u(!1),r.registerMutation({type:"characterData",target:e.target})}}var r=e.prototype;return r.start=function(){this.observer?this.observer.observe(this.container,p):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},r.stopAndFlushMutations=function(){var e=this.observer;e?(this.registerMutations(e.takeRecords()),e.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var r=this.mutations;return this.mutations=h(),r},r.registerMutations=function(e){for(var r=0;r<e.length;r++)this.registerMutation(e[r])},r.getMutationTextContent=function(e){var r=e.type,i=e.target,n=e.removedNodes;if("characterData"===r){if(""!==i.textContent)return d?i.textContent.replace("\n",""):i.textContent}else if("childList"===r){if(n&&n.length)return"";else if(""!==i.textContent)return i.textContent}return null},r.registerMutation=function(e){var r=this.getMutationTextContent(e);
113if(null!=r){var i=c(a(e.target));this.mutations=this.mutations.set(i,r)}},e}()},34769:(e,r,i)=>{"use strict";var n=i(9426);e.exports=function(e){return!!e&&!!e.ownerDocument&&n(e)&&"BR"===e.nodeName}},34816:(e,r,i)=>{"use strict";var n=i(86558),o=i(61664),a=i(55450);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("getProto: not an object");return o(e)}:a?function(e){return a(e)}:null},34868:(e,r,i)=>{"use strict";var n=i(54780),o=i(62989),a=function(e,r){return e===r},s=function(e){return!!e},l=[];e.exports=function(e){var r=e.getCharacterList().map(function(e){return e.getStyle()}).toList(),i=r.flatten().toSet().map(function(i){var l;return l=[],o(r.map(function(e){return e.has(i)}).toList(),a,s,function(r,o){var a=e.getText();l.push({offset:n.strlen(a.slice(0,r)),length:n.strlen(a.slice(r,o)),style:i})}),l});return Array.prototype.concat.apply(l,i.toJS())}},35302:(e,r,i)=>{"use strict";var n=i(48744)(),o=i(73442)("Object.prototype.toString"),a=function(e){return(!n||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===o(e)},s=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},l=function(){return a(arguments)}();a.isLegacyArguments=s,e.exports=l?a:s},35344:(e,r,i)=>{"use strict";i.d(r,{A:()=>o,O:()=>n});let n="#5781ff",o=[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":["case",["==",["get","active"],"true"],"#fbb03b",["coalesce",["get","user_color"],n]],"fill-opacity":.1}},{id:"gl-draw-lines",type:"line",filter:["any",["==","$type","LineString"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["==",["get","active"],"true"],"#fbb03b",["coalesce",["get","user_color"],n]],"line-dasharray":["case",["==",["get","active"],"true"],[.2,2],[2,0]],"line-width":2}},{id:"gl-draw-point-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":"#fff"}},{id:"gl-draw-point-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":["case",["==",["get","active"],"true"],"#fbb03b",["coalesce",["get","user_color"],n]]}},{id:"gl-draw-vertex-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":"#fff"}},{id:"gl-draw-vertex-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":"#fbb03b"}},{id:"gl-draw-midpoint",type:"circle",filter:["all",["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}}]},35558:(e,r,i)=>{"use strict";var n=i(39636),o=i(18916),a=i(59356),s=i(12968),l=null;e.exports={cut:function(e){var r=e.getCurrentContent(),i=e.getSelection(),u=null;if(i.isCollapsed()){var c=i.getAnchorKey(),h=r.getBlockForKey(c).getLength();if(h===i.getAnchorOffset()){var p=r.getKeyAfter(c);if(null==p)return e;u=i.set("focusKey",p).set("focusOffset",0)}else u=i.set("focusOffset",h)}else u=i;l=a(r,u=s(u));var d=n.removeRange(r,u,"forward");return d===r?e:o.push(e,d,"remove-range")},paste:function(e){if(!l)return e;var r=n.replaceWithFragment(e.getCurrentContent(),e.getSelection(),l);return o.push(e,r,"insert-fragment")}}},36531:(e,r,i)=>{"use strict";function n(){return new Worker(i.p+"static/chunks/uploadWorker-cfa3f3dac0f5ab07.worker.js")}i.d(r,{A:()=>n})},37085:function(e,r){var i,n;void 0===(n="function"==typeof(i=function e(){var r="u">typeof self?self:"u">typeof window?window:void 0!==r?r:{},i=!r.document&&!!r.postMessage,n=r.IS_PAPA_WORKER||!1,o={},a=0,s={};function l(e){return 65279===e.charCodeAt(0)?e.slice(1):e}function u(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var r=x(e);r.chunkSize=parseInt(r.chunkSize),e.step||e.chunk||(r.chunkSize=null),this._handle=new f(r),(this._handle.streamer=this)._config=r}).call(this,e),this.parseChunk=function(e,i){var o=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<o){let r=this._config.newline;r||(a=this._config.quoteChar||'"',r=this._handle.guessLineEndings(e,a)),e=[...e.split(r).slice(o)].join(r)}this.isFirstChunk&&w(this._config.beforeFirstChunk)&&void 0!==(a=this._config.beforeFirstChunk(e))&&(e=a),this.isFirstChunk=!1,this._halted=!1;var o=this._partialLine+e,a=(this._partialLine="",this._handle.parse(o,this._baseIndex,!this._finished));
vendor: 5,700 bytes, line 113
113if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,this._finished||(this._partialLine=o.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),o=this._finished||this._config.preview&&this._rowCount>=this._config.preview,n)r.postMessage({results:a,workerId:s.WORKER_ID,finished:o});else if(w(this._config.chunk)&&!i){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!o||!w(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),o||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):n&&this._config.error&&r.postMessage({workerId:s.WORKER_ID,error:e,finished:!1})}}function c(e){var r;(e=e||{}).chunkSize||(e.chunkSize=s.RemoteChunkSize),u.call(this,e),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),i||(r.onload=b(this._chunkLoaded,this),r.onerror=b(this._chunkError,this)),r.ontimeout=b(this._chunkTimeout,this),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadTimeout&&!i&&(r.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var e,n,o=this._config.downloadRequestHeaders;for(n in o)r.setRequestHeader(n,o[n])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+e));try{r.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}i&&0===r.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===r.readyState&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=r).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(r.responseText)))},this._chunkError=function(e){e=r.statusText||e,this._sendError(Error(e))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function h(e){(e=e||{}).chunkSize||(e.chunkSize=s.LocalChunkSize),u.call(this,e);var r,i,n="u">typeof FileReader;this.stream=function(e){this._input=e,i=e.slice||e.webkitSlice||e.mozSlice,n?((r=new FileReader).onload=b(this._chunkLoaded,this),r.onerror=b(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,o=(this._config.chunkSize&&(o=Math.min(this._start+this._config.chunkSize,this._input.size),e=i.call(e,this._start,o)),r.readAsText(e,this._config.encoding));n||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(r.error)}}function p(e){var r;u.call(this,e=e||{}),this.stream=function(e){return r=e,this._nextChunk()},this._nextChunk=function(){var e,i;if(!this._finished)return r=(e=this._config.chunkSize)?(i=r.substring(0,e),r.substring(e)):(i=r,""),this._finished=!r,this.parseChunk(i)}}function d(e){u.call(this,e=e||{});var r=[],i=!0,n=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===r.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),r.length?this.parseChunk(r.shift()):i=!0},this._streamData=b(function(e){try{r.push("string"==typeof e?e:e.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(r.shift()))}catch(e){this._streamError(e)}},this),this._streamError=b(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=b(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=b(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function f(e){var r,i,n,o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,l=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,u=this,c=0,h=0,p=!1,d=!1,f=[],_={data:[],errors:[],meta:{}};function y(r){return"greedy"===e.skipEmptyLines?""===r.join("").trim():1===r.length&&0===r[0].length}function v(){if(_&&n&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(_.data=_.data.filter(function(e){return!y(e)})),b()){if(_)if(Array.isArray(_.data[0])){for(var r,i=0;b()&&i<_.data.length;
vendor: 5,090 bytes, line 113
113i++)_.data[i].forEach(o);_.data.splice(0,1)}else _.data.forEach(o);function o(e){f.push(e)}}function u(r,i){for(var n=e.header?{}:[],o=0;o<r.length;o++){var s=o,u=r[o],u=((r,i)=>(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===i||"TRUE"===i||"false"!==i&&"FALSE"!==i&&((e=>{if(a.test(e)&&-0x20000000000000<(e=parseFloat(e))&&e<0x20000000000000)return 1})(i)?parseFloat(i):l.test(i)?new Date(i):""===i?null:i):i)(s=e.header?o>=f.length?"__parsed_extra":f[o]:s,u=e.transform?e.transform(u,s):u);"__parsed_extra"===s?(n[s]=n[s]||[],n[s].push(u)):n[s]=u}return e.header&&(o>f.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+f.length+" fields but parsed "+o,h+i):o<f.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+f.length+" fields but parsed "+o,h+i)),n}_&&(e.header||e.dynamicTyping||e.transform)&&(r=1,!_.data.length||Array.isArray(_.data[0])?(_.data=_.data.map(u),r=_.data.length):_.data=u(_.data,0),e.header&&_.meta&&(_.meta.fields=f),h+=r)}function b(){return e.header&&0===f.length}function E(e,r,i,n){e={type:e,code:r,message:i},void 0!==n&&(e.row=n),_.errors.push(e)}w(e.step)&&(o=e.step,e.step=function(r){_=r,b()?v():(v(),0!==_.data.length&&(c+=r.data.length,e.preview&&c>e.preview?i.abort():(_.data=_.data[0],o(_,u))))}),this.parse=function(o,a,l){var u=e.quoteChar||'"',u=(e.newline||(e.newline=this.guessLineEndings(o,u)),n=!1,e.delimiter?w(e.delimiter)&&(e.delimiter=e.delimiter(o),_.meta.delimiter=e.delimiter):((u=((r,i,n,o,a)=>{var l,u,c,h;a=a||[",","	","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var p=0;p<a.length;p++){for(var d,f=a[p],m=0,_=0,v=0,x=(c=void 0,new g({comments:o,delimiter:f,newline:i,preview:10}).parse(r)),b=0;b<x.data.length;b++)n&&y(x.data[b])?v++:(_+=d=x.data[b].length,void 0===c?c=d:0<d&&(m+=Math.abs(d-c),c=d));0<x.data.length&&(_/=x.data.length-v),1.99<_&&(void 0===u||m<u||m===u&&h<_)&&(u=m,l=f,h=_)}return{successful:!!(e.delimiter=l),bestDelimiter:l}})(o,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=u.bestDelimiter:(n=!0,e.delimiter=s.DefaultDelimiter),_.meta.delimiter=e.delimiter),x(e));return u.header=b(),e.preview&&e.header&&u.preview++,r=o,_=(i=new g(u)).parse(r,a,l),v(),p?{meta:{paused:!0}}:_||{meta:{paused:!1}}},this.paused=function(){return p},this.pause=function(){p=!0,i.abort(),r=w(e.chunk)?"":r.substring(i.getCharIndex())},this.resume=function(){u.streamer._halted?(p=!1,u.streamer.parseChunk(r,!0)):setTimeout(u.resume,3)},this.aborted=function(){return d},this.abort=function(){d=!0,i.abort(),_.meta.aborted=!0,w(e.complete)&&e.complete(_),r=""},this.guessLineEndings=function(e,r){e=e.substring(0,1048576);var r=RegExp(m(r)+"([^]*?)"+m(r),"gm"),i=(e=e.replace(r,"")).split("\r"),r=e.split("\n"),e=1<r.length&&r[0].length<i[0].length;if(1===i.length||e)return"\n";for(var n=0,o=0;o<i.length;o++)"\n"===i[o][0]&&n++;return n>=i.length/2?"\r\n":"\r"}}function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){var r=(e=e||{}).delimiter,i=e.newline,n=e.comments,o=e.step,a=e.preview,u=e.fastMode,c=null,h=!1,p=null==e.quoteChar?'"':e.quoteChar,d=p;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof r||-1<s.BAD_DELIMITERS.indexOf(r))&&(r=","),n===r)throw Error("Comment character same as delimiter");!0===n?n="#":("string"!=typeof n||-1<s.BAD_DELIMITERS.indexOf(n))&&(n=!1),"\n"!==i&&"\r"!==i&&"\r\n"!==i&&(i="\n");var f=0,g=!1;this.parse=function(s,_,y){if("string"!=typeof s)throw Error("Input must be a string");var v=s.length,x=r.length,b=i.length,E=n.length,S=w(o),T=[],I=[],M=[],C=f=0;if(!s)return U();if(u||!1!==u&&-1===s.indexOf(p)){for(var A=s.split(i),P=0;P<A.length;P++){if(M=A[P],f+=M.length,P!==A.length-1)f+=i.length;else if(y)break;if(!n||M.substring(0,E)!==n){if(S){if(T=[],N(M.split(r)),j(),g)return U()}else N(M.split(r));if(a&&a<=P)return T=T.slice(0,a),U(!0)}}return U()}for(var L=s.indexOf(r,f),O=s.indexOf(i,f),D=RegExp(m(d)+m(p),"g"),R=s.indexOf(p,f);;)if(s[f]===p)for(R=f,f++;;){if(-1===(R=s.indexOf(p,R+1)))return y||I.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:T.length,index:f}),z();if(R===v-1)return z(s.substring(f,R).replace(D,p));if(p===d&&s[R+1]===d)R++;else if(p===d||0===R||s[R-1]!==d){-1!==L&&L<R+1&&(L=s.indexOf(r,R+1));var k=F(-1===(O=-1!==O&&O<R+1?s.indexOf(i,R+1):O)?L:Math.min(L,O));if(s.substr(R+1+k,x)===r){M.push(s.substring(f,R).replace(D,p)),s[f=R+1+k+x]!==p&&(R=s.indexOf(p,f)),L=s.indexOf(r,f),O=s.indexOf(i,f);break}if(k=F(O),s.substring(R+1+k,R+1+k+b)===i){if(M.push(s.substring(f,R).replace(D,p)),B(R+1+k+b),L=s.indexOf(r,f),R=s.indexOf(p,f),S&&(j(),g))return U();if(a&&T.length>=a)return U(!0);break}I.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:T.length,index:f}),R++}}else if(n&&0===M.length&&s.substring(f,f+E)===n){if(-1===O)return U();f=O+b,O=s.indexOf(i,f),L=s.indexOf(r,f)}else if(-1!==L&&(L<O||-1===O))M.push(s.substring(f,L)),f=L+x,L=s.indexOf(r,f);else{if(-1===O)break;
113if(M.push(s.substring(f,O)),B(O+b),S&&(j(),g))return U();if(a&&T.length>=a)return U(!0)}return z();function N(e){T.push(e),C=f}function F(e){return -1!==e&&(e=s.substring(R+1,e))&&""===e.trim()?e.length:0}function z(e){return y||(void 0===e&&(e=s.substring(f)),M.push(e),f=v,N(M),S&&j()),U()}function B(e){f=e,N(M),M=[],O=s.indexOf(i,f)}function U(n){if(e.header&&!_&&T.length&&!h){var o=T[0],a=Object.create(null),s=new Set(o);let r=!1;for(let i=0;i<o.length;i++){let n=l(o[i]);if(a[n=w(e.transformHeader)?e.transformHeader(n,i):n]){let e,l=a[n];for(;e=n+"_"+l,l++,s.has(e););s.add(e),o[i]=e,a[n]++,r=!0,(c=null===c?{}:c)[e]=n}else a[n]=1,o[i]=n;s.add(n)}r&&console.warn("Duplicate headers found and renamed."),h=!0}return{data:T,errors:I,meta:{delimiter:r,linebreak:i,aborted:g,truncated:!!n,cursor:C+(_||0),renamedHeaders:c}}}function j(){o(U()),T=[],I=[]}},this.abort=function(){g=!0},this.getCharIndex=function(){return f}}function _(e){var r=e.data,i=o[r.workerId],n=!1;if(r.error)i.userError(r.error,r.file);else if(r.results&&r.results.data){var a={abort:function(){n=!0,y(r.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(w(i.userStep)){for(var s=0;s<r.results.data.length&&(i.userStep({data:r.results.data[s],errors:r.results.errors,meta:r.results.meta},a),!n);s++);delete r.results}else w(i.userChunk)&&(i.userChunk(r.results,a,r.file),delete r.results)}r.finished&&!n&&y(r.workerId,r.results)}function y(e,r){var i=o[e];w(i.userComplete)&&i.userComplete(r),i.terminate(),delete o[e]}function v(){throw Error("Not implemented.")}function x(e){if("object"!=typeof e||null===e)return e;var r,i=Array.isArray(e)?[]:{};for(r in e)i[r]=x(e[r]);return i}function b(e,r){return function(){e.apply(r,arguments)}}function w(e){return"function"==typeof e}return s.parse=function(i,n){var u,f,m,g=(n=n||{}).dynamicTyping||!1;if(w(g)&&(n.dynamicTypingFunction=g,g={}),n.dynamicTyping=g,n.transform=!!w(n.transform)&&n.transform,void 0!==n.downloadTimeout){var g=parseInt(n.downloadTimeout);if(isNaN(g))throw Error("Config downloadTimeout value ("+n.downloadTimeout+") not parsable by parseInt(val).");n.downloadTimeout=g}if(!n.worker||!s.WORKERS_SUPPORTED)return g=null,s.NODE_STREAM_INPUT,"string"==typeof i?(i=l(i),g=new(n.download?c:p)(n)):!0===i.readable&&w(i.read)&&w(i.on)?g=new d(n):(r.File&&i instanceof File||i instanceof Object)&&(g=new h(n)),g.stream(i);(g=!!s.WORKERS_SUPPORTED&&(f=r.URL||r.webkitURL||null,m=e.toString(),u=s.BLOB_URL||(s.BLOB_URL=f.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",m,")();"],{type:"text/javascript"}))),(u=new r.Worker(u)).onmessage=_,u.id=a++,o[u.id]=u)).userStep=n.step,g.userChunk=n.chunk,g.userComplete=n.complete,g.userError=n.error,n.step=w(n.step),n.chunk=w(n.chunk),n.complete=w(n.complete),n.error=w(n.error),delete n.worker,g.postMessage({input:i,config:n,workerId:g.id})},s.unparse=function(e,r){var i=!1,n=!0,o=",",a="\r\n",l='"',u=l+l,c=!1,h=null,p=!1,d=((()=>{if("object"==typeof r){if("string"!=typeof r.delimiter||s.BAD_DELIMITERS.filter(function(e){return -1!==r.delimiter.indexOf(e)}).length||(o=r.delimiter),("boolean"==typeof r.quotes||"function"==typeof r.quotes||Array.isArray(r.quotes))&&(i=r.quotes),"boolean"!=typeof r.skipEmptyLines&&"string"!=typeof r.skipEmptyLines||(c=r.skipEmptyLines),"string"==typeof r.newline&&(a=r.newline),"string"==typeof r.quoteChar&&(u=(l=r.quoteChar)+l),"boolean"==typeof r.header&&(n=r.header),Array.isArray(r.columns)){if(0===r.columns.length)throw Error("Option columns is empty");h=r.columns}void 0!==r.escapeChar&&(u=r.escapeChar+l),r.escapeFormulae instanceof RegExp?p=r.escapeFormulae:"boolean"==typeof r.escapeFormulae&&r.escapeFormulae&&(p=/^[=+\-@\t\r].*$/)}})(),RegExp(m(l),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if("object"==typeof e[0])return f(h||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||h),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function f(e,r,i){var s="",l=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof r&&(r=JSON.parse(r)),Array.isArray(e)&&0<e.length),u=!Array.isArray(r[0]);if(l&&n){for(var c=0;c<e.length;c++)0<c&&(s+=o),s+=g(e[c],c);0<r.length&&(s+=a)}for(var h=0;h<r.length;h++){var p=(l?e:r[h]).length,d=!1,f=l?0===Object.keys(r[h]).length:0===r[h].length;
113if(i&&!l&&(d="greedy"===i?""===r[h].join("").trim():1===r[h].length&&0===r[h][0].length),"greedy"===i&&l){for(var m=[],_=0;_<p;_++){var y=u?e[_]:_;m.push(r[h][y])}d=""===m.join("").trim()}if(!d){for(var v=0;v<p;v++){0<v&&!f&&(s+=o);var x=l&&u?e[v]:v;s+=g(r[h][x],v)}h<r.length-1&&(!i||0<p&&!f)&&(s+=a)}}return s}function g(e,r){var n,a,c;return null==e?"":e.constructor===Date?isNaN(e.getTime())?"":e.toISOString():(c=!1,p&&"string"==typeof e&&p.test(e)&&(e="'"+e,c=!0),a=(n=e.toString()).replace(d,u),(c=c||!0===i||"function"==typeof i&&i(e,r)||Array.isArray(i)&&i[r]||((e,r)=>{for(var i=0;i<r.length;i++)if(-1<e.indexOf(r[i]))return!0;return!1})(a,s.BAD_DELIMITERS)||-1<a.indexOf(o)||-1<n.indexOf(l)||" "===a.charAt(0)||" "===a.charAt(a.length-1))?l+a+l:a)}},s.RECORD_SEP="\x1e",s.UNIT_SEP="\x1f",s.BYTE_ORDER_MARK="\uFEFF",s.BAD_DELIMITERS=["\r","\n",'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!i&&!!r.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=0xa00000,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=g,s.ParserHandle=f,s.NetworkStreamer=c,s.FileStreamer=h,s.StringStreamer=p,s.ReadableStreamStreamer=d,n&&(r.onmessage=function(e){e=e.data,void 0===s.WORKER_ID&&e&&(s.WORKER_ID=e.workerId),"string"==typeof e.input?r.postMessage({workerId:s.WORKER_ID,results:s.parse(e.input,e.config),finished:!0}):(r.File&&e.input instanceof File||e.input instanceof Object)&&(e=s.parse(e.input,e.config))&&r.postMessage({workerId:s.WORKER_ID,results:e,finished:!0})}),(c.prototype=Object.create(u.prototype)).constructor=c,(h.prototype=Object.create(u.prototype)).constructor=h,(p.prototype=Object.create(p.prototype)).constructor=p,(d.prototype=Object.create(u.prototype)).constructor=d,s})?i.apply(r,[]):i)||(e.exports=n)},37525:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument?e.ownerDocument:document}},37820:e=>{"use strict";e.exports=function(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){if(!e.ownerDocument.defaultView)return e instanceof Node;if(e instanceof e.ownerDocument.defaultView.Node)return!0}return!1}},38305:e=>{"use strict";function r(e,r){return!!r&&(e===r.documentElement||e===r.body)}e.exports={getTop:function(e){var i=e.ownerDocument;return r(e,i)?i.body.scrollTop||i.documentElement.scrollTop:e.scrollTop},setTop:function(e,i){var n=e.ownerDocument;r(e,n)?n.body.scrollTop=n.documentElement.scrollTop=i:e.scrollTop=i},getLeft:function(e){var i=e.ownerDocument;return r(e,i)?i.body.scrollLeft||i.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,i){var n=e.ownerDocument;r(e,n)?n.body.scrollLeft=n.documentElement.scrollLeft=i:e.scrollLeft=i}}},38512:e=>{"use strict";var r=function(){return"string"==typeof(function(){}).name},i=Object.getOwnPropertyDescriptor;if(i)try{i([],"length")}catch(e){i=null}r.functionsHaveConfigurableNames=function(){if(!r()||!i)return!1;var e=i(function(){},"name");return!!e&&!!e.configurable};var n=Function.prototype.bind;r.boundFunctionsHaveNames=function(){return r()&&"function"==typeof n&&""!==(function(){}).bind().name},e.exports=r},38521:(e,r,i)=>{"use strict";i.d(r,{S:()=>o,i:()=>a});let n=!1;function o(e){n=e}function a(){return n}},38595:(e,r,i)=>{"use strict";var n=i(19702);function o(e,r,i){r=r||1;for(var o,l,u,c,h=0;h<e[0].length;h++){var p=e[0][h];(!h||p[0]<o)&&(o=p[0]),(!h||p[1]<l)&&(l=p[1]),(!h||p[0]>u)&&(u=p[0]),(!h||p[1]>c)&&(c=p[1])}var d=u-o,f=c-l,m=Math.min(d,f),g=m/2,_=new n(null,a);if(0===m)return[o,l];for(var y=o;y<u;y+=m)for(var v=l;v<c;v+=m)_.push(new s(y+g,v+g,g,e));var x=function(e){for(var r=0,i=0,n=0,o=e[0],a=0,l=o.length,u=l-1;a<l;u=a++){var c=o[a],h=o[u],p=c[0]*h[1]-h[0]*c[1];i+=(c[0]+h[0])*p,n+=(c[1]+h[1])*p,r+=3*p}return 0===r?new s(o[0][0],o[0][1],0,e):new s(i/r,n/r,0,e)}(e),b=new s(o+d/2,l+f/2,0,e);b.d>x.d&&(x=b);for(var w=_.length;_.length;){var E=_.pop();E.d>x.d&&(x=E,i&&console.log("found best %d after %d probes",Math.round(1e4*E.d)/1e4,w)),E.max-x.d<=r||(g=E.h/2,_.push(new s(E.x-g,E.y-g,g,e)),_.push(new s(E.x+g,E.y-g,g,e)),_.push(new s(E.x-g,E.y+g,g,e)),_.push(new s(E.x+g,E.y+g,g,e)),w+=4)}return i&&(console.log("num probes: "+w),console.log("best distance: "+x.d)),[x.x,x.y]}function a(e,r){return r.max-e.max}function s(e,r,i,n){this.x=e,this.y=r,this.h=i,this.d=function(e,r,i){for(var n=!1,o=1/0,a=0;a<i.length;a++)for(var s=i[a],l=0,u=s.length,c=u-1;l<u;c=l++){var h=s[l],p=s[c];h[1]>r!=p[1]>r&&e<(p[0]-h[0])*(r-h[1])/(p[1]-h[1])+h[0]&&(n=!n),o=Math.min(o,function(e,r,i,n){var o=i[0],a=i[1],s=n[0]-o,l=n[1]-a;if(0!==s||0!==l){var u=((e-o)*s+(r-a)*l)/(s*s+l*l);u>1?(o=n[0],a=n[1]):u>0&&(o+=s*u,a+=l*u)}return(s=e-o)*s+(l=r-a)*l}(e,r,h,p))}return(n?1:-1)*Math.sqrt(o)}(e,r,n),this.max=this.d+this.h*Math.SQRT2}e.exports=o,e.exports.default=o},38650:(e,r,i)=>{"use strict";var n=i(99297),o=i(12968);e.exports=function(e,r,i,a,s){var l=o(e.getSelection());if(!r||!a)return l;var u=n.decode(r),c=u.blockKey,h=e.getBlockTree(c),p=h&&h.getIn([u.decoratorKey,"leaves",u.leafKey]),d=n.decode(a),f=d.blockKey,m=e.getBlockTree(f),g=m&&m.getIn([d.decoratorKey,"leaves",d.leafKey]);if(!p||!g)return l;var _=p.get("start"),y=g.get("start"),v=p?_+i:null,x=g?y+s:null;if(l.getAnchorKey()===c&&l.getAnchorOffset()===v&&l.getFocusKey()===f&&l.getFocusOffset()===x)return l;var b=!1;if(c===f){var w=p.get("end"),E=g.get("end");b=y===_&&E===w?s<i:y<_}else b=e.getCurrentContent().getBlockMap().keySeq().skipUntil(function(e){return e===c||e===f}).first()===f;return l.merge({anchorKey:c,anchorOffset:v,focusKey:f,focusOffset:x,isBackward:b})}},38877:(e,r,i)=>{"use strict";i.d(r,{A:()=>a});var n=i(54945),o=i(99468);function a(e){return(0,o.A)(1,arguments),e instanceof Date||"object"===(0,n.A)(e)&&"[object Date]"===Object.prototype.toString.call(e)}},38960:(e,r,i)=>{"use strict";i.d(r,{$B:()=>p,J3:()=>g,Lg:()=>f,OT:()=>y,SY:()=>l,Wl:()=>d,aM:()=>s,fR:()=>m,np:()=>u,pA:()=>v,tQ:()=>h,wv:()=>_});var n,o=i(85428),a=i(47133);let s={[a.mb.DXF]:"(Beta) DXF",[a.mb.GeoJSON]:"GeoJSON",[a.mb.GeoTiff]:"GeoTiff",[a.mb.ShapeFile]:"ShapeFile",[a.mb.WFS]:"WFS",[a.mb.WMS]:"WMS",[a.mb.WMTS]:"WMTS",[a.mb.Tours]:"(Beta) Tours",[a.mb.ArcGIS]:"ArcGIS REST Servers",[a.mb.IFC]:"(Beta) IFC",[a.mb.Pointcloud]:"Pointcloud",[a.mb.CustomForm]:"Custom Form",[a.mb.KML]:"(Beta) KML"};var l=((n={}).Draft="Draft",n.Published="Published",n);function u(){return[a.mb.DXF,a.mb.GeoJSON,a.mb.GeoTiff,a.mb.ShapeFile,a.mb.WFS,a.mb.WMS,a.mb.WMTS,a.mb.Tours,a.mb.ArcGIS,a.mb.Pointcloud,a.mb.KML,a.mb.CustomForm,...(0,o.KV)()?[]:[a.mb.IFC]]}let c={geojson:a.mb.GeoJSON,json:a.mb.GeoJSON,shp:a.mb.ShapeFile,shx:a.mb.ShapeFile,dbf:a.mb.ShapeFile,prj:a.mb.ShapeFile,tif:a.mb.GeoTiff,tiff:a.mb.GeoTiff,las:a.mb.Pointcloud,laz:a.mb.Pointcloud,ifc:a.mb.IFC,glb:a.mb.IFC,gltf:a.mb.IFC,zip:a.mb.Tours,csv:a.mb.Tours,dxf:a.mb.DXF,e57:a.mb.Pointcloud,kml:a.mb.KML},h=[1,2,3,4,5,6,7,8,9];function p(e){return c[e.toLowerCase()]||null}function d(e){return"url"===a.d8[e].sourceType}function f(e){return"file"===a.d8[e].sourceType}function m(e){return"custom"===a.d8[e].sourceType}let g=e=>[a.mb.GeoJSON,a.mb.ShapeFile,a.mb.DXF,a.mb.WFS,a.mb.ArcGIS,a.mb.KML].includes(e),_=e=>[a.mb.WMS,a.mb.WMTS].includes(e),y=e=>e===a.mb.WFS||e===a.mb.WMS||e===a.mb.WMTS,v=e=>e===a.mb.WFS||e===a.mb.ArcGIS},39052:(e,r,i)=>{"use strict";var n=i(77580),o=i(34177);function a(e,r,i,n){if(e===i)return!0;
113if(!i.startsWith(e))return!1;var a=i.slice(e.length);return!!r&&(a=n?n(a):a,o.contains(a,r))}function s(e){return"Windows"===n.platformName?e.replace(/^\s*NT/,""):e}e.exports=i(46689)({isBrowser:function(e){return a(n.browserName,n.browserFullVersion,e)},isBrowserArchitecture:function(e){return a(n.browserArchitecture,null,e)},isDevice:function(e){return a(n.deviceName,null,e)},isEngine:function(e){return a(n.engineName,n.engineVersion,e)},isPlatform:function(e){return a(n.platformName,n.platformFullVersion,e,s)},isPlatformArchitecture:function(e){return a(n.platformArchitecture,null,e)}},i(34091))},39149:(e,r,i)=>{"use strict";i.d(r,{$eR:()=>d,$kB:()=>O,B2c:()=>G,D7y:()=>T,D_L:()=>c,Ek:()=>H,Emm:()=>B,HEG:()=>z,HbA:()=>F,IeJ:()=>eo,J1z:()=>h,JPe:()=>L,LW:()=>x,MGr:()=>X,Ob1:()=>p,PAG:()=>A,PxB:()=>v,QCG:()=>Z,R7b:()=>_,S4m:()=>g,Sq0:()=>P,SqY:()=>m,T7J:()=>V,U01:()=>I,WZb:()=>ei,WeY:()=>et,WsZ:()=>D,Y2n:()=>M,YQq:()=>K,Yad:()=>J,Zki:()=>y,_Lw:()=>a,dJk:()=>$,emn:()=>R,fAo:()=>Y,fUT:()=>en,gER:()=>u,gP6:()=>j,kSq:()=>W,maZ:()=>U,mcb:()=>o,mqA:()=>ee,nPs:()=>Q,oSi:()=>k,owP:()=>s,qBV:()=>f,qVV:()=>C,rnS:()=>q,tEr:()=>E,txO:()=>w,uct:()=>N,v4w:()=>er,v6F:()=>l,waL:()=>b,xyO:()=>S});var n=i(51729);function o(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"}}]})(e)}function a(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1H9v1.07a7.001 7.001 0 0 1 3.274 12.474l.601.602a.5.5 0 0 1-.707.708l-.746-.746A6.97 6.97 0 0 1 8 16a6.97 6.97 0 0 1-3.422-.892l-.746.746a.5.5 0 0 1-.707-.708l.602-.602A7.001 7.001 0 0 1 7 2.07V1h-.5A.5.5 0 0 1 6 .5zm2.5 5a.5.5 0 0 0-1 0v3.362l-1.429 2.38a.5.5 0 1 0 .858.515l1.5-2.5A.5.5 0 0 0 8.5 9V5.5zM.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z"}}]})(e)}function s(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43Zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282Z"}},{tag:"path",attr:{d:"M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43Zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282Z"}}]})(e)}function l(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"}},{tag:"path",attr:{d:"M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"}}]})(e)}function u(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.5 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708
113L11 2.707V14.5a.5.5 0 0 0 .5.5zm-7-14a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L4 13.293V1.5a.5.5 0 0 1 .5-.5z"}}]})(e)}function c(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"}}]})(e)}function h(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"}}]})(e)}function p(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"}}]})(e)}function d(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2 2v13.5a.5.5 0 0 0 .74.439L8 13.069l5.26 2.87A.5.5 0 0 0 14 15.5V2a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2z"}}]})(e)}function f(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z"}},{tag:"path",attr:{fillRule:"evenodd",d:"M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"}}]})(e)}function m(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.05 3.05a7 7 0 0 0 0 9.9.5.5 0 0 1-.707.707 8 8 0 0 1 0-11.314.5.5 0 0 1 .707.707zm2.122 2.122a4 4 0 0 0 0 5.656.5.5 0 1 1-.708.708 5 5 0 0 1 0-7.072.5.5 0 0 1 .708.708zm5.656-.708a.5.5 0 0 1 .708 0 5 5 0 0 1 0 7.072.5.5 0 1 1-.708-.708 4 4 0 0 0 0-5.656.5.5 0 0 1 0-.708zm2.122-2.12a.5.5 0 0 1 .707 0 8 8 0 0 1 0 11.313.5.5 0 0 1-.707-.707 7 7 0 0 0 0-9.9.5.5 0 0 1 0-.707zM6 8a2 2 0 1 1 2.5 1.937V15.5a.5.5 0 0 1-1 0V9.937A2 2 0 0 1 6 8z"}}]})(e)}function g(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"}}]})(e)}function _(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h13zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z"}},{tag:"path",attr:{d:"M3 5.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3 8a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 8zm0 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5z"}}]})(e)}function y(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"}}]})(e)}function v(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4.414A2 2 0 0 0 3 11.586l-2 2V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12.793a.5.5 0 0 0 .854.353l2.853-2.853A1 1 0 0 1 4.414 12H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}},{tag:"path",attr:{d:"M5 6a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"}}]})(e)}function x(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z"}}]})(e)}function b(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"}}]})(e)}function w(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"}},{tag:"path",attr:{d:"m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"}}]})(e)}function E(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"}}]})(e)}function S(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"}}]})(e)}function T(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"}}]})(e)}function I(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}},{tag:"path",attr:{d:"M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"}}]})(e)}function M(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L1
1135 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z"}}]})(e)}function C(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"}}]})(e)}function A(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z"}},{tag:"path",attr:{d:"M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995z"}}]})(e)}function P(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"}},{tag:"path",attr:{d:"M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"}},{tag:"path",attr:{d:"M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"}}]})(e)}function L(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"}},{tag:"path",attr:{d:"M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"}}]})(e)}function O(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598.93.62.93-.62-.4-1.598a1 1 0 0 1-.03-.243V7.5z"}},{tag:"path",attr:{d:"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z"}}]})(e)}function D(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z"}}]})(e)}function R(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM3.517 14.841a1.13 1.13 0 0 0 .401.823c.13.108.289.192.478.252.19.061.411.091.665.091.338 0 .624-.053.859-.158.236-.105.416-.252.539-.44.125-.189.187-.408.187-.656 0-.224-.045-.41-.134-.56a1.001 1.001 0 0 0-.375-.357 2.027 2.027 0 0 0-.566-.21l-.621-.144a.97.97 0 0 1-.404-.176.37.37 0 0 1-.144-.299c0-.156.062-.284.185-.384.125-.101.296-.152.512-.152.143 0 .266.023.37.068a.624.624 0 0 1 .246.181.56.56 0 0 1 .12.258h.75a1.092 1.092 0 0 0-.2-.566 1.21 1.21 0 0 0-.5-.41 1.813 
1131.813 0 0 0-.78-.152c-.293 0-.551.05-.776.15-.225.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.122.524.082.149.2.27.352.367.152.095.332.167.539.213l.618.144c.207.049.361.113.463.193a.387.387 0 0 1 .152.326.505.505 0 0 1-.085.29.559.559 0 0 1-.255.193c-.111.047-.249.07-.413.07-.117 0-.223-.013-.32-.04a.838.838 0 0 1-.248-.115.578.578 0 0 1-.255-.384h-.765ZM.806 13.693c0-.248.034-.46.102-.633a.868.868 0 0 1 .302-.399.814.814 0 0 1 .475-.137c.15 0 .283.032.398.097a.7.7 0 0 1 .272.26.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964 1.441 1.441 0 0 0-.489-.272 1.838 1.838 0 0 0-.606-.097c-.356 0-.66.074-.911.223-.25.148-.44.359-.572.632-.13.274-.196.6-.196.979v.498c0 .379.064.704.193.976.131.271.322.48.572.626.25.145.554.217.914.217.293 0 .554-.055.785-.164.23-.11.414-.26.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.799.799 0 0 1-.118.363.7.7 0 0 1-.272.25.874.874 0 0 1-.401.087.845.845 0 0 1-.478-.132.833.833 0 0 1-.299-.392 1.699 1.699 0 0 1-.102-.627v-.495Zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879l-1.327 4Z"}}]})(e)}function k(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM1.6 11.85H0v3.999h.791v-1.342h.803c.287 0 .531-.057.732-.173.203-.117.358-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477c-.2-.12-.443-.179-.732-.179Zm.545 1.333a.795.795 0 0 1-.085.38.574.574 0 0 1-.238.241.794.794 0 0 1-.375.082H.788V12.48h.66c.218 0 .389.06.512.181.123.122.185.296.185.522Zm1.217-1.333v3.999h1.46c.401 0 .734-.08.998-.237a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084 0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.589-.68c-.264-.156-.599-.234-1.005-.234H3.362Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592 1.14 1.14 0 0 1-.196.422.8.8 0 0 1-.334.252 1.298 1.298 0 0 1-.483.082h-.563v-2.707Zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638H7.896Z"}}]})(e)}function N(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"}}]})(e)}function F(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z"}},{tag:"path",attr:{d:"M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z"}}]})(e)}function z(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zm8 0A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm-8 8A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm8 0A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3z"}}]})(e)}function B(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708
113L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.707 1.5ZM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5 5 5Z"}}]})(e)}function U(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.5 11.5a3.5 3.5 0 1 1 3.163-5H14L15.5 8 14 9.5l-1-1-1 1-1-1-1 1-1-1-1 1H6.663a3.5 3.5 0 0 1-3.163 2zM2.5 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"}}]})(e)}function j(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.235 1.559a.5.5 0 0 0-.47 0l-7.5 4a.5.5 0 0 0 0 .882L3.188 8 .264 9.559a.5.5 0 0 0 0 .882l7.5 4a.5.5 0 0 0 .47 0l7.5-4a.5.5 0 0 0 0-.882L12.813 8l2.922-1.559a.5.5 0 0 0 0-.882l-7.5-4zm3.515 7.008L14.438 10 8 13.433 1.562 10 4.25 8.567l3.515 1.874a.5.5 0 0 0 .47 0l3.515-1.874zM8 9.433 1.562 6 8 2.567 14.438 6 8 9.433z"}}]})(e)}function V(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2 6a6 6 0 1 1 10.174 4.31c-.203.196-.359.4-.453.619l-.762 1.769A.5.5 0 0 1 10.5 13a.5.5 0 0 1 0 1 .5.5 0 0 1 0 1l-.224.447a1 1 0 0 1-.894.553H6.618a1 1 0 0 1-.894-.553L5.5 15a.5.5 0 0 1 0-1 .5.5 0 0 1 0-1 .5.5 0 0 1-.46-.302l-.761-1.77a1.964 1.964 0 0 0-.453-.618A5.984 5.984 0 0 1 2 6zm6-5a5 5 0 0 0-3.479 8.592c.263.254.514.564.676.941L5.83 12h4.342l.632-1.467c.162-.377.413-.687.676-.941A5 5 0 0 0 8 1z"}}]})(e)}function G(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16 .5a.5.5 0 0 0-.598-.49L10.5.99 5.598.01a.5.5 0 0 0-.196 0l-5 1A.5.5 0 0 0 0 1.5v14a.5.5 0 0 0 .598.49l4.902-.98 4.902.98a.502.502 0 0 0 .196 0l5-1A.5.5 0 0 0 16 14.5V.5zM5 14.09V1.11l.5-.1.5.1v12.98l-.402-.08a.498.498 0 0 0-.196 0L5 14.09zm5 .8V1.91l.402.08a.5.5 0 0 0 .196 0L11 1.91v12.98l-.5.1-.5-.1z"}}]})(e)}function q(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m13.498.795.149-.149a1.207 1.207 0 1 1 1.707 1.708l-.149.148a1.5 1.5 0 0 1-.059 2.059L4.854 14.854a.5.5 0 0 1-.233.131l-4 1a.5.5 0 0 1-.606-.606l1-4a.5.5 0 0 1 .131-.232l9.642-9.642a.5.5 0 0 0-.642.056L6.854 4.854a.5.5 0 1 1-.708-.708L9.44.854A1.5 1.5 0 0 1 11.5.796a1.5 1.5 0 0 1 1.998-.001zm-.644.766a.5.5 0 0 0-.707 0L1.95 11.756l-.764 3.057 3.057-.764L14.44 3.854a.5.5 0 0 0 0-.708l-1.585-1.585z"}}]})(e)}function H(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"}}]})(e)}function $(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"}}]})(e)}function W(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}}]})(e)}function Y(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2Z"}}]})(e)}function Z(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"}}]})(e)}function X(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}},{tag:"path",attr:{d:"M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286zm1.557 5.763c0 .533.425.927 1.01.927.
113609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94z"}}]})(e)}function K(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"}}]})(e)}function Q(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.964.686a.5.5 0 0 0-.65-.65L.767 5.855H.766l-.452.18a.5.5 0 0 0-.082.887l.41.26.001.002 4.995 3.178 3.178 4.995.002.002.26.41a.5.5 0 0 0 .886-.083l6-15Zm-1.833 1.89L6.637 10.07l-.215-.338a.5.5 0 0 0-.154-.154l-.338-.215 7.494-7.494 1.178-.471-.47 1.178Z"}}]})(e)}function J(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5 8.5A2.5 2.5 0 0 1 7.5 6H9V4.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L9.41 8.658A.25.25 0 0 1 9 8.466V7H7.5A1.5 1.5 0 0 0 6 8.5V11H5V8.5Z"}},{tag:"path",attr:{fillRule:"evenodd",d:"M6.95.435c.58-.58 1.52-.58 2.1 0l6.515 6.516c.58.58.58 1.519 0 2.098L9.05 15.565c-.58.58-1.519.58-2.098 0L.435 9.05a1.482 1.482 0 0 1 0-2.098L6.95.435Zm1.4.7a.495.495 0 0 0-.7 0L1.134 7.65a.495.495 0 0 0 0 .7l6.516 6.516a.495.495 0 0 0 .7 0l6.516-6.516a.495.495 0 0 0 0-.7L8.35 1.134Z"}}]})(e)}function ee(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"}}]})(e)}function et(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z"}},{tag:"path",attr:{d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z"}}]})(e)}function er(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}},{tag:"path",attr:{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"}}]})(e)}function ei(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}},{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}}]})(e)}function en(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"}}]})(e)}function eo(e){return(0,n.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}}]})(e)}},39636:(e,r,i)=>{"use strict";var n=i(60620),o=i(24350),a=i(42638),s=i(93692),l=i(59356),u=i(93710),c=i(61715),h=i(52400),p=i(15796),d=i(71306),f=i(20726),m=i(3713),g=i(8734),_=u.OrderedSet,y={replaceText:function(e,r,i,o,a){var s=m(f(e,r),r),l=n.create({style:o||_(),entity:a||null});return h(s,s.getSelectionAfter(),i,l)},insertText:function(e,r,i,n,o){return r.isCollapsed()||p(!1),y.replaceText(e,r,i,n,o)},moveText:function(e,r,i){var n=l(e,r),o=y.removeRange(e,r,"backward");return y.replaceWithFragment(o,i,n)},replaceWithFragment:function(e,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA",o=m(f(e,r),r);return c(o,o.getSelectionAfter(),i,n)},removeRange:function(e,r,i){r.getIsBackward()&&(r=r.merge({anchorKey:r.getFocusKey(),anchorOffset:r.getFocusOffset(),focusKey:r.getAnchorKey(),focusOffset:r.getAnchorOffset(),isBackward:!1})),n=r.getAnchorKey(),o=r.getFocusKey(),a=e.getBlockForKey(n);var n,o,a,l=e.getBlockForKey(o),u=r.getStartOffset(),c=r.getEndOffset(),h=a.getEntityAt(u),p=l.getEntityAt(c-1);
113if(n===o&&h&&h===p){var d=s(e.getEntityMap(),a,l,r,i);return m(e,d)}return m(f(e,r),r)},splitBlock:function(e,r){var i=m(f(e,r),r);return g(i,i.getSelectionAfter())},applyInlineStyle:function(e,r,i){return o.add(e,r,i)},removeInlineStyle:function(e,r,i){return o.remove(e,r,i)},setBlockType:function(e,r,i){return d(e,r,function(e){return e.merge({type:i,depth:0})})},setBlockData:function(e,r,i){return d(e,r,function(e){return e.merge({data:i})})},mergeBlockData:function(e,r,i){return d(e,r,function(e){return e.merge({data:e.getData().merge(i)})})},applyEntity:function(e,r,i){return a(f(e,r),r,i)}};e.exports=y},39667:e=>{"use strict";e.exports=function(e){return Object.keys(e).map(function(r){return e[r]})}},39746:function(e,r,i){var n;!function(o){"use strict";var a="function",s="undefined",l="object",u="string",c="major",h="model",p="name",d="type",f="vendor",m="version",g="architecture",_="console",y="mobile",v="tablet",x="smarttv",b="wearable",w="embedded",E="Amazon",S="Apple",T="ASUS",I="BlackBerry",M="Browser",C="Chrome",A="Firefox",P="Google",L="Honor",O="Huawei",D="Microsoft",R="Motorola",k="Nvidia",N="OnePlus",F="Opera",z="OPPO",B="Samsung",U="Sharp",j="Sony",V="Xiaomi",G="Zebra",q="Facebook",H="Chromium OS",$="Mac OS",W=" Browser",Y=function(e,r){var i={};for(var n in e)r[n]&&r[n].length%2==0?i[n]=r[n].concat(e[n]):i[n]=e[n];return i},Z=function(e){for(var r={},i=0;i<e.length;i++)r[e[i].toUpperCase()]=e[i];return r},X=function(e,r){return typeof e===u&&-1!==K(r).indexOf(K(e))},K=function(e){return e.toLowerCase()},Q=function(e,r){if(typeof e===u)return e=e.replace(/^\s\s*/,""),typeof r===s?e:e.substring(0,500)},J=function(e,r){for(var i,n,o,s,u,c,h=0;h<r.length&&!u;){var p=r[h],d=r[h+1];for(i=n=0;i<p.length&&!u&&p[i];)if(u=p[i++].exec(e))for(o=0;o<d.length;o++)c=u[++n],typeof(s=d[o])===l&&s.length>0?2===s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:3===s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=c?c.replace(s[1],s[2]):void 0:this[s[0]]=c?s[1].call(this,c,s[2]):void 0:4===s.length&&(this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):void 0):this[s]=c||void 0;h+=2}},ee=function(e,r){for(var i in r)if(typeof r[i]===l&&r[i].length>0){for(var n=0;n<r[i].length;n++)if(X(r[i][n],e))return"?"===i?void 0:i}else if(X(r[i],e))return"?"===i?void 0:i;return r.hasOwnProperty("*")?r["*"]:e},et={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"},er={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,m],[/opios[\/ ]+([\w\.]+)/i],[m,[p,F+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[p,F+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[p,F]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[p,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[m,[p,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,m],[/quark(?:pc)?\/([-\w\.]+)/i],[m,[p,"Quark"]],[/\bddg\/([\w\.]+)/i],[m,[p,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[p,"UC"+M]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[p,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[p,"Smart Lenovo "+M]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+M],m],[/\bfocus\/([\w\.]+)/i],[m,[p,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[p,F+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[p,F+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[p,"MIUI"+W]
vendor: 5,334 bytes, line 113
113],[/fxios\/([\w\.-]+)/i],[m,[p,A]],[/\bqihoobrowser\/?([\w\.]*)/i],[m,[p,"360"]],[/\b(qq)\/([\w\.]+)/i],[[p,/(.+)/,"$1Browser"],m],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1"+W],m],[/samsungbrowser\/([\w\.]+)/i],[m,[p,B+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[m,[p,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,"Sogou Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[p,m],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[p],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[m,p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,q],m],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[p,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[p,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,C+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[p,"Android "+M]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[m,ee,{"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],[p,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],m],[/(wolvic|librewolf)\/([\w\.]+)/i],[p,m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[p,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[p,[m,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[p,[m,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[g,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[g,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[g,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[g,/ower/,"",K]],[/ sun4\w[;\)]/i],[[g,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[g,K]]],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],[h,[f,B],[d,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[h,[f,B],[d,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[h,[f,S],[d,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[f,S],[d,v]],[/(macintosh);/i],[h,[f,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[f,U],[d,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[h,[f,L],[d,v]],[/honor([-\w ]+)[;\)]/i],[h,[f,L],[d,y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[h,[f,O],[d,v]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[f,O],[d,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[h,/_/g," "],[f,V],[d,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[h,/_/g," "],[f,V],[d,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[f,z],[d,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[h,[f,ee,{OnePlus:["304","403","203"],"*":z}],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[f,"Vivo"],[d,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[h,[f,"Realme"],[d,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[h,[f,R],[d,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[f,R],[d,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[f,"LG"],[d,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[f,"LG"],[d,y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}
113(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[h,[f,"Lenovo"],[d,v]],[/(nokia) (t[12][01])/i],[f,h,[d,v]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[h,/_/g," "],[d,y],[f,"Nokia"]],[/(pixel (c|tablet))\b/i],[h,[f,P],[d,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[f,P],[d,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],[h,[f,j],[d,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[f,j],[d,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[f,N],[d,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[f,E],[d,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[f,E],[d,y]],[/(playbook);[-\w\),; ]+(rim)/i],[h,f,[d,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[f,I],[d,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[f,T],[d,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[f,T],[d,y]],[/(nexus 9)/i],[h,[f,"HTC"],[d,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[h,/_/g," "],[d,y]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[h,[f,"TCL"],[d,v]],[/(itel) ((\w+))/i],[[f,K],h,[d,ee,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[f,"Acer"],[d,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[f,"Meizu"],[d,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[h,[f,"Ulefone"],[d,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[h,[f,"Energizer"],[d,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[h,[f,"Cat"],[d,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[h,[f,"Smartfren"],[d,y]],[/droid.+; (a(?:015|06[35]|142p?))/i],[h,[f,"Nothing"],[d,y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[h,[f,"Archos"],[d,v]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[h,[f,"Archos"],[d,y]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[f,h,[d,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[f,h,[d,y]],[/(kobo)\s(ereader|touch)/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],[f,h,[d,v]],[/(surface duo)/i],[h,[f,D],[d,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[f,"Fairphone"],[d,y]],[/(u304aa)/i],[h,[f,"AT&T"],[d,y]],[/\bsie-(\w*)/i],[h,[f,"Siemens"],[d,y]],[/\b(rct\w+) b/i],[h,[f,"RCA"],[d,v]],[/\b(venue[\d ]{2,7}) b/i],[h,[f,"Dell"],[d,v]],[/\b(q(?:mv|ta)\w+) b/i],[h,[f,"Verizon"],[d,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[f,"Barnes & Noble"],[d,v]],[/\b(tm\d{3}\w+) b/i],[h,[f,"NuVision"],[d,v]],[/\b(k88) b/i],[h,[f,"ZTE"],[d,v]],[/\b(nx\d{3}j) b/i],[h,[f,"ZTE"],[d,y]],[/\b(gen\d{3}) b.+49h/i],[h,[f,"Swiss"],[d,y]],[/\b(zur\d{3}) b/i],[h,[f,"Swiss"],[d,v]],[/\b((zeki)?tb.*\b) b/i],[h,[f,"Zeki"],[d,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],h,[d,v]],[/\b(ns-?\w{0,9}) b/i],[h,[f,"Insignia"],[d,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[f,"NextBook"],[d,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],h,[d,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],h,[d,y]],[/\b(ph-1) /i],[h,[f,"Essential"],[d,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[f,"Envizen"],[d,v]],[/\b(trio[-\w\. ]+) b/i],[h,[f,"MachSpeed"],[d,v]],[/\btu_(1491) b/i],[h,[f,"Rotor"],[d,v]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[h,[f,k],[d,v]],[/(sprint) (\w+)/i],[f,h,[d,y]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[f,D],[d,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[f,G],[d,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[f,G],[d,y]],[/smart-tv.+(samsung)/i],[f,[d,x]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[f,B],[d,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,"LG"],[d,x]],[/(apple) ?tv/i],[f,[h,S+" TV"],[d,x]],[/crkey/i],[[h,C+"cast"],[f,P],[d,x]],[/droid.+aft(\w+)( bui|\))/i],[h,[f,E],[d,x]],[/(shield \w+ tv)/i],[h,[f,k],[d,x]],[/\(dtv[\);
vendor: 5,745 bytes, line 113
113].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[f,U],[d,x]],[/(bravia[\w ]+)( bui|\))/i],[h,[f,j],[d,x]],[/(mi(tv|box)-?\w+) bui/i],[h,[f,V],[d,x]],[/Hbbtv.*(technisat) (.*);/i],[f,h,[d,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,Q],[h,Q],[d,x]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[h,[d,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,h,[d,_]],[/droid.+; (shield)( bui|\))/i],[h,[f,k],[d,_]],[/(playstation \w+)/i],[h,[f,j],[d,_]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[f,D],[d,_]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[h,[f,B],[d,b]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[f,h,[d,b]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[h,[f,z],[d,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[h,[f,S],[d,b]],[/(opwwe\d{3})/i],[h,[f,N],[d,b]],[/(moto 360)/i],[h,[f,R],[d,b]],[/(smartwatch 3)/i],[h,[f,j],[d,b]],[/(g watch r)/i],[h,[f,"LG"],[d,b]],[/droid.+; (wt63?0{2,3})\)/i],[h,[f,G],[d,b]],[/droid.+; (glass) \d/i],[h,[f,P],[d,b]],[/(pico) (4|neo3(?: link|pro)?)/i],[f,h,[d,b]],[/; (quest( \d| pro)?)/i],[h,[f,q],[d,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,w]],[/(aeobc)\b/i],[h,[f,E],[d,w]],[/(homepod).+mac os/i],[h,[f,S],[d,w]],[/windows iot/i],[[d,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[h,[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[d,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[h,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[p,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[p,m],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,m],[/ladybird\//i],[[p,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,m],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[p,[m,ee,et]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,ee,et],[p,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,$],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,p],[/(ubuntu) ([\w\.]+) like android/i],[[p,/(.+)/,"$1 Touch"],m],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[p,m],[/\(bb(10);/i],[m,[p,I]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[m,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[p,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[p,C+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,H],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,m],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,m]]},ei=function(e,r){if(typeof e===l&&(r=e,e=void 0),!(this instanceof ei))return new ei(e,r).getResult();var i=typeof o!==s&&o.navigator?o.navigator:void 0,n=e||(i&&i.userAgent?i.userAgent:""),_=i&&i.userAgentData?i.userAgentData:void 0,x=r?Y(er,r):er,b=i&&i.userAgent==n;return this.getBrowser=function(){var e,r={};return r[p]=void 0,r[m]=void 0,J.call(r,n,x.browser),r[c]=typeof(e=r[m])===u?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,b&&i&&i.brave&&typeof i.brave.isBrave==a&&(r[p]="Brave"),r},this.getCPU=function(){var e={};return e[g]=void 0,J.call(e,n,x.cpu),e},this.getDevice=function(){var e={};return e[f]=void 0,e[h]=void 0,e[d]=void 0,J.call(e,n,x.device),b&&!e[d]&&_&&_.mobile&&(e[d]=y),b&&"Macintosh"==e[h]&&i&&typeof i.standalone!==s&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[h]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[p]=void 0,e[m]=void 0,J.call(e,n,x.engine),e},this.getOS=function(){var e={};return e[p]=void 0,e[m]=void 0,J.call(e,n,x.os),b&&!e[p]&&_&&_.platform&&"Unknown"!=_.platform&&(e[p]=_.platform.replace(/chrome os/i,H).replace(/macos/i,$)),e},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 n},this.setUA=function(e){return n=typeof e===u&&e.length>500?Q(e,500):e,this},this.setUA(n),this};ei.VERSION="0.7.41",ei.BROWSER=Z([p,m,c]),ei.CPU=Z([g]),ei.DEVICE=Z([h,f,d,_,y,x,v,b,w]),ei.ENGINE=ei.OS=Z([p,m]),typeof r!==s?(e.exp
113orts&&(r=e.exports=ei),r.UAParser=ei):i.amdO?void 0===(n=(function(){return ei}).call(r,i,r,e))||(e.exports=n):typeof o!==s&&(o.UAParser=ei);var en=typeof o!==s&&(o.jQuery||o.Zepto);if(en&&!en.ua){var eo=new ei;en.ua=eo.getResult(),en.ua.get=function(){return eo.getUA()},en.ua.set=function(e){eo.setUA(e);var r=eo.getResult();for(var i in r)en.ua[i]=r[i]}}}("object"==typeof window?window:this)},40430:(e,r,i)=>{"use strict";i.d(r,{tj:()=>b,B0:()=>w,xe:()=>g,im:()=>y,N6:()=>x,v9:()=>_});var n=i(97685),o=i(57186),a=i(23323);function s(){return new Worker(i.p+"static/chunks/uploadTourWorker-84a17f367083b4a8.worker.js")}var l=i(37085),u=i.n(l),c=i(80856),h=i(85428),p=i(61519),d=i(47133),f=i(22629);let m=e=>`tour-${e}`;function g(e,r){return(0,f.YN)(m(e),r)}function _(e,r,i){(0,f.a4)(m(e),r,i)}let y=async(e,r)=>{if(!e.csvFile||!e.zipFile){n.Ay.error("No file found"),e.setAddingTourState(!1);return}let i=e.csvFile??null,l=e.zipFile??null;if(e.setAddingTourState(!0),!l||!i||!e.project){n.Ay.error("No file found"),e.setAddingTourState(!1);return}if(""===e.tourName){n.Ay.error("Invalid tour name"),e.setAddingTourState(!1);return}try{await v(i,e.tourName)}catch(r){n.Ay.error(String(r)),e.setAddingTourState(!1);return}try{let u=(0,o.A)(),h=await (0,a.x)("/auth/sastoken",{params:{permissions:p.W_.readWriteDelete,duration:d.ox,project_id:e.project.project_uuid}});e.setAddingTourState(!0);let f=new s;r.addUploading({title:e.tourName,type:c.dP.tour,progress:0,id:u,worker:f,layerStatus:c.iO.processing});let m=!1;e.closeAddCustomLayerModal(),m=!0;let g=!1;e.clearTourMetadata(),f.addEventListener("message",async i=>{let{type:o,percentComplete:s,response:l}=i.data;switch(o){case"progress":m||(e.closeAddCustomLayerModal(),m=!0),r.updateUploading(u,{progress:s});break;case"done":if(!m){e.closeAddCustomLayerModal();let r=document.getElementById("modal-layers");r?.checked&&r.click(),m=!0}e.setAddingTourState(!1),r.updateUploading(u,{progress:100,status:c.nW.processing_tour});try{await (0,a.x)("/tour/upload",{method:"POST",json:{tour_id:u,tour_name:e.tourName,zip_file:`${u}.zip`,csv_file:`${u}.csv`,camera_type:e.cameraType,epsg:e.fileEpsg,user_metrics:e.metadata}});let r=e.toursInProgress.set(u,e.tourName);e.setToursInProgress(r)}catch(i){g=!0,e.setAddingTourState(!1),r.updateUploading(u,{progress:100,status:c.nW.error}),n.Ay.error(i instanceof Error?i.message:"Upload failed")}break;case"cancel":e.setAddingTourState(!1),r.updateUploading(u,{progress:100,status:c.nW.cancelled}),f.terminate();break;case"error":g||(console.error("Request failed with status: "+l),e.setAddingTourState(!1),r.updateUploading(u,{progress:100,status:c.nW.error}))}}),f.postMessage({zipFile:l,csvFile:i,project:e.project,createDataProps:{sasToken:h,uuid:u},type:e.cameraType,sasToken:h})}catch(e){console.error(e),n.Ay.error("Failed to upload. Please try again.")}},v=async(e,r)=>{let i=1,n=["date","elevation","y","x","yaw","pitch","roll","filename"],o=["route","direction","chainage"],a=new Map,s=!0,l=null;return new Promise((c,h)=>{u().parse(e,{complete:()=>{l?c(l):h("Invalid/Missing route")},error:e=>{h(e)},header:!1,skipEmptyLines:!0,step:(e,u)=>{let{data:c,errors:p}=e;if(p.length>0&&(h(p[0]),u.abort()),s){let e=c.filter(e=>!n.includes(e.toLowerCase())&&!o.includes(e.toLowerCase()));if(e.length>0){let r=e.slice(0,-1).join(", ")+(e.length>1?`, ${e[e.length-1]}`:e[0]);h(`The following headers are not valid: ${r}`),u.abort()}let r=c.filter(e=>n.includes(e));if(n.length>r.length){let e=n.filter(e=>!c.includes(e)),r=e.slice(0,-1).join(", ")+(e.length>1?`, ${e[e.length-1]}`:e[0]);h(`The following headers are missing: ${r}`),u.abort()}for(let e=0;e<c.length;e++)(n.includes(c[e])||o.includes(c[e]))&&a.set(c[e],e);s=!1}else(c.length<n.length||c.some(e=>""===e))&&(h(`Row ${i} is missing data`),u.abort()),n.forEach(e=>{let r=c[Number(a.get(e))];if("filename"!==e&&"date"!==e)isNaN(r)&&(h(`Row ${i}: ${e} value is not a number`),u.abort());else if("filename"===e){let e=r.split(".")[1].toLowerCase();"jpg"!==e&&"jpeg"!==e&&(h("The files listed in the CSV are not in JPG/JPEG format"),u.abort())}else if("date"===e){let e=new Date(r);e instanceof Date&&!isNaN(e.getTime())||(h(`Row ${i}
113: Date is invalid`),u.abort())}}),o.forEach(e=>{let n=c[Number(a.get(e))];n&&"chainage"===e&&isNaN(n)&&(h(`Row ${i}: ${e} value is not a number`),u.abort()),"route"!==e||l?l||(l=r):l=n});i+=1}})})};async function x(e,r,i,n,o,s,l){try{await (0,a.x)("/tour/create",{method:"POST",json:{tour_id:r,tour_name:i,epsg:n,camera_type:o}});let u=await (0,a.x)(`/tour/${r}/first-image`,{params:{project_id:e?.project_uuid}});l.uploadings.map(e=>e.id).includes(r)?l.updateUploading(r,{progress:100,status:c.nW.complete,coordinates:{lon:u.lon,lat:u.lat}}):l.addUploading({title:i,type:c.dP.tour,id:r,progress:100,status:c.nW.complete,coordinates:{lon:u.lon,lat:u.lat}}),s()}catch{}}async function b(e,r,i,n,o,a,s){r?.data_types.includes(n)||r?.data_types.push(n),i(r),await o(e),a.hasOwnProperty(n)||(a[n]=!1),s(a),(0,h.M5)(a,s)}async function w(e,r){let i=JSON.parse(r).cameraType,o=new FormData;o.append("camera_type",i);try{await (0,a.x)(`/tour/failed/${e}`,{method:"DELETE",form:o})}catch{n.Ay.error("Failed to clean up tour. Please try again.")}}},41506:(e,r,i)=>{"use strict";var n=i(67605);e.exports=function(e){var r=e.ownerDocument.documentElement;if(!("getBoundingClientRect"in e)||!n(r,e))return{left:0,right:0,top:0,bottom:0};var i=e.getBoundingClientRect();return{left:Math.round(i.left)-r.clientLeft,right:Math.round(i.right)-r.clientLeft,top:Math.round(i.top)-r.clientTop,bottom:Math.round(i.bottom)-r.clientTop}}},41760:e=>{"use strict";e.exports=Math.max},41822:e=>{"use strict";e.exports=Object.assign.bind(Object),e.exports.default=e.exports},41892:e=>{"use strict";var r=/([A-Z])/g;e.exports=function(e){return e.replace(r,"-$1").toLowerCase()}},42504:e=>{"use strict";e.exports=Math.pow},42638:(e,r,i)=>{"use strict";var n=i(56334),o=i(93710);e.exports=function(e,r,i){var a=e.getBlockMap(),s=r.getStartKey(),l=r.getStartOffset(),u=r.getEndKey(),c=r.getEndOffset(),h=a.skipUntil(function(e,r){return r===s}).takeUntil(function(e,r){return r===u}).toOrderedMap().merge(o.OrderedMap([[u,a.get(u)]])).map(function(e,r){var o=r===u?c:e.getLength();return n(e,r===s?l:0,o,i)});return e.merge({blockMap:a.merge(h),selectionBefore:r,selectionAfter:r})}},42970:(e,r,i)=>{"use strict";var n=i(73442),o=n("Date.prototype.getDay"),a=function(e){try{return o(e),!0}catch(e){return!1}},s=n("Object.prototype.toString"),l=i(48744)();e.exports=function(e){return"object"==typeof e&&null!==e&&(l?a(e):"[object Date]"===s(e))}},43299:(e,r,i)=>{"use strict";function n(e,r,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=r||{},n.geometry=e,n}function o(e,r,i){if(null!==e)for(var n,a,s,l,u,c,h,p,d=0,f=0,m=e.type,g="FeatureCollection"===m,_="Feature"===m,y=g?e.features.length:1,v=0;v<y;v++){u=(p=!!(h=g?e.features[v].geometry:_?e.geometry:e)&&"GeometryCollection"===h.type)?h.geometries.length:1;for(var x=0;x<u;x++){var b=0,w=0;if(null!==(l=p?h.geometries[x]:h)){c=l.coordinates;var E=l.type;switch(d=i&&("Polygon"===E||"MultiPolygon"===E)?1:0,E){case null:break;case"Point":if(!1===r(c,f,v,b,w))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(!1===r(c[n],f,v,b,w))return!1;f++,"MultiPoint"===E&&b++}"LineString"===E&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(a=0;a<c[n].length-d;a++){if(!1===r(c[n][a],f,v,b,w))return!1;f++}"MultiLineString"===E&&b++,"Polygon"===E&&w++}"Polygon"===E&&b++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(a=0,w=0;a<c[n].length;a++){for(s=0;s<c[n][a].length-d;s++){if(!1===r(c[n][a][s],f,v,b,w))return!1;f++}w++}b++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(!1===o(l.geometries[n],r,i))return!1;break;default:throw Error("Unknown Geometry Type")}}}}}function a(e,r){if("Feature"===e.type)r(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length&&!1!==r(e.features[i],i);i++);}function s(e,r){var i,n,o,a,s,l,u,c,h,p,d=0,f="FeatureCollection"===e.type,m="Feature"===e.type,g=f?e.features.length:1;for(i=0;i<g;i++){for(l=f?e.features[i].geometry:m?e.geometry:e,c=f?e.features[i].properties:m?e.properties:{},h=f?e.features[i].bbox:m?e.bbox:void 0,p=f?e.features[i].id:m?e.id:void 0,s=(u=!!l&&"GeometryCollection"===l.type)?l.geometries.length:1,o=0;o<s;o++){if(null===(a=u?l.geometries[o]:l)){if(!1===r(null,d,c,h,p))return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===r(a,d,c,h,p))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===r(a.geometries[n],d,c,h,p))return!1;break;default:throw Error("Unknown Geometry Type")}}d++}}function l(e,r){s(e,function(e,i,o,a,s){var l,u=null===e?null:e.type;switch(u){case null:case"Point":case"LineString":case"Polygon":if(!1===r(n(e,o,{bbox:a,id:s}),i,0))return!1;return}switch(u){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon"}for(var c=0;c<e.coordinates.length;c++)if(!1===r(n({type:l,coordinates:e.coordinates[c]},o),i,c))return!1})}function u(e){var r=[1/0,1/0,-1/0,-1/0];return o(e,function(e){r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r}i.d(r,{Wcw:()=>H,vh2:()=>v,vnt:()=>P,I3T:()=>A,N4z:()=>T,Lrk:()=>C,Bw9:()=>Z,zx7:()=>I,QwJ:()=>q,n1:()=>M,Fc$:()=>eo,rmV:()=>eu,EUY:()=>z}),u.default=u,i(41822),i(63122),i(79725);var c={centimeters:0x25f96350,centimetres:0x25f96350,degrees:6371008.8/111325,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,nauticalmiles:6371008.8/1852,radians:1,yards:6967335.223679999};function h(e){return e%360*Math.PI/180}
113function p(e){if(!e)throw Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw Error("coord must be GeoJSON Point or an Array of numbers")}let d=function(e,r,i){void 0===i&&(i={});var n=p(e),o=p(r),a=Math.pow(Math.sin(h(o[1]-n[1])/2),2)+Math.pow(Math.sin(h(o[0]-n[0])/2),2)*Math.cos(h(n[1]))*Math.cos(h(o[1]));return function(e,r){void 0===r&&(r="kilometers");var i=c[r];if(!i)throw Error(r+" units is invalid");return e*i}(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)),i.units)};Object.prototype.hasOwnProperty;var f=new ArrayBuffer(16);function m(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var r=0;r<this.length;r++)this.points[r].z=this.points[r].z||0;for(var r=0;r<this.length-1;r++){var i=this.points[r],n=this.points[r+1];this.centers.push({x:(i.x+n.x)/2,y:(i.y+n.y)/2,z:(i.z+n.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var r=0;r<this.centers.length-1;r++){var o=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,a=this.points[r+1].y-(this.centers[r].y+this.centers[r+1].y)/2,s=this.points[r+1].z-(this.centers[r].y+this.centers[r+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r].x+o),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+a),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r].z+s)},{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r+1].x+o),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+a),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}function g(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}new Float64Array(f),new Uint32Array(f),i(5819),m.prototype.cacheSteps=function(e){var r=[],i=this.pos(0);r.push(0);for(var n=0;n<this.duration;n+=10){var o=this.pos(n);Math.sqrt((o.x-i.x)*(o.x-i.x)+(o.y-i.y)*(o.y-i.y)+(o.z-i.z)*(o.z-i.z))>e&&(r.push(n),i=o)}return r},m.prototype.vector=function(e){var r=this.pos(e+10),i=this.pos(e-10);return{angle:180*Math.atan2(r.y-i.y,r.x-i.x)/3.14,speed:Math.sqrt((i.x-r.x)*(i.x-r.x)+(i.y-r.y)*(i.y-r.y)+(i.z-r.z)*(i.z-r.z))}},m.prototype.pos=function(e){var r,i,n,o,a,s,l,u,c=e-this.delay;c<0&&(c=0),c>this.duration&&(c=this.duration-1);var h=c/this.duration;if(h>=1)return this.points[this.length-1];var p=Math.floor((this.points.length-1)*h);return r=(this.length-1)*h-p,i=this.points[p],n=this.controls[p][1],o=this.controls[p+1][0],a=this.points[p+1],u=[(l=(s=r)*s)*s,3*l*(1-s),3*s*(1-s)*(1-s),(1-s)*(1-s)*(1-s)],{x:a.x*u[0]+o.x*u[1]+n.x*u[2]+i.x*u[3],y:a.y*u[0]+o.y*u[1]+n.y*u[2]+i.y*u[3],z:a.z*u[0]+o.z*u[1]+n.z*u[2]+i.z*u[3]}};let _=function(e,r){void 0===r&&(r={});var i=u(e);return function(e,r,i){var n,o,a;if(void 0===i&&(i={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!g(e[0])||!g(e[1]))throw Error("coordinates must contain numbers");return n={type:"Point",coordinates:e},void 0===(o=i)&&(o={}),a={type:"Feature"},(0===o.id||o.id)&&(a.id=o.id),o.bbox&&(a.bbox=o.bbox),a.properties=r||{},a.geometry=n,a}([(i[0]+i[2])/2,(i[1]+i[3])/2],r.properties,r)};function y(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}let v=function(e,r){void 0===r&&(r={});var i=0,n=0,a=0;return o(e,function(e){i+=e[0],n+=e[1],a++},!0),function(e,r,i){var n,o,a;if(void 0===i&&(i={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!y(e[0])||!y(e[1]))throw Error("coordinates must contain numbers");return n={type:"Point",coordinates:e},void 0===(o=i)&&(o={}),a={type:"Feature"},(0===o.id||o.id)&&(a.id=o.id),o.bbox&&(a.bbox=o.bbox),a.properties=r||{},a.geometry=n,a}([i/a,n/a],r.properties)};function x(e,r,i){var n,o,a;if(void 0===i&&(i={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!b(e[0])||!b(e[1]))throw Error("coordinates must contain numbers");return n={type:"Point",coordinates:e},void 0===(o=i)&&(o={}),a={type:"Feature"},(0===o.id||o.id)&&(a.id=o.id),o.bbox&&(a.bbox=o.bbox),a.properties=r||{},a.geometry=n,a}function b(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}let w=function(e){var r,i,n=[];return"FeatureCollection"===e.type?a(e,function(e){o(e,function(r){n.push(x(r,e.properties))})}):o(e,function(r){n.push(x(r,e.properties))}),void 0===r&&(r={}),i={type:"FeatureCollection"}
113,r.id&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.features=n,i};i(16154);var E={centimeters:0x25f96350,centimetres:0x25f96350,degrees:6371008.8/111325,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,nauticalmiles:6371008.8/1852,radians:1,yards:6967335.223679999},S={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};function T(e,r,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=r||{},n.geometry=e,n}function I(e,r,i){if(void 0===i&&(i={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!L(e[0])||!L(e[1]))throw Error("coordinates must contain numbers");return T({type:"Point",coordinates:e},r,i)}function M(e,r,i){void 0===i&&(i={});for(var n=0;n<e.length;n++){var o=e[n];if(o.length<4)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw Error("First and last Position are not equivalent.")}return T({type:"Polygon",coordinates:e},r,i)}function C(e,r){void 0===r&&(r={});var i={type:"FeatureCollection"};return r.id&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.features=e,i}function A(e,r,i){if(void 0===r&&(r="kilometers"),void 0===i&&(i="kilometers"),!(e>=0))throw Error("length must be a positive number");var n=function(e,r){void 0===r&&(r="kilometers");var i=E[r];
113if(!i)throw Error(r+" units is invalid");return e/i}(e,r),o=i;void 0===o&&(o="kilometers");var a=E[o];if(!a)throw Error(o+" units is invalid");return n*a}function P(e,r,i){if(void 0===r&&(r="meters"),void 0===i&&(i="kilometers"),!(e>=0))throw Error("area must be a positive number");var n=S[r];if(!n)throw Error("invalid original units");var o=S[i];if(!o)throw Error("invalid final units");return e/n*o}function L(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function O(e){var r={type:"Feature"};return Object.keys(e).forEach(function(i){switch(i){case"type":case"properties":case"geometry":return;default:r[i]=e[i]}}),r.properties=function e(r){var i={};return r&&Object.keys(r).forEach(function(n){var o=r[n];"object"==typeof o?null===o?i[n]=null:Array.isArray(o)?i[n]=o.map(function(e){return e}):i[n]=e(o):i[n]=o}),i}(e.properties),r.geometry=D(e.geometry),r}function D(e){var r={type:e.type};return(e.bbox&&(r.bbox=e.bbox),"GeometryCollection"===e.type)?r.geometries=e.geometries.map(function(e){return D(e)}):r.coordinates=function e(r){return"object"!=typeof r[0]?r.slice():r.map(function(r){return e(r)})}(e.coordinates),r}let R=function(e){if(!e)throw Error("geojson is required");switch(e.type){case"Feature":return O(e);case"FeatureCollection":var r,i;return i={type:"FeatureCollection"},Object.keys(r=e).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=r[e]}}),i.features=r.features.map(function(e){return O(e)}),i;case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return D(e);default:throw Error("unknown GeoJSON type")}},k=function(e,r){if(!e)throw Error("targetPoint is required");if(!r)throw Error("points is required");var i,n=1/0,o=0;return a(r,function(r,i){var a=d(e,r);a<n&&(o=i,n=a)}),(i=R(r.features[o])).properties.featureIndex=o,i.properties.distanceToPoint=n,i};i(65829);var N={centimeters:0x25f96350,centimetres:0x25f96350,degrees:6371008.8/111325,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,nauticalmiles:6371008.8/1852,radians:1,yards:6967335.223679999};
113function F(e){if(!e)throw Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw Error("coord must be GeoJSON Point or an Array of numbers")}let z=function(e,r,i){void 0===i&&(i={});var n,o,a,s,l,u,c,h,p,d,f=F(e),m=F(r);return m[0]+=m[0]-f[0]>180?-360:360*(f[0]-m[0]>180),function(e,r,i){if(void 0===r&&(r="kilometers"),void 0===i&&(i="kilometers"),!(e>=0))throw Error("length must be a positive number");var n=function(e,r){void 0===r&&(r="kilometers");var i=N[r];if(!i)throw Error(r+" units is invalid");return e/i}(e,r),o=i;void 0===o&&(o="kilometers");var a=N[o];if(!a)throw Error(o+" units is invalid");return n*a}((n=f,o=m,s=a=void 0===a?6371008.8:Number(a),l=n[1]*Math.PI/180,c=(u=o[1]*Math.PI/180)-l,(h=Math.abs(o[0]-n[0])*Math.PI/180)>Math.PI&&(h-=2*Math.PI),d=Math.abs(p=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(l/2+Math.PI/4)))>1e-11?c/p:Math.cos(l),Math.sqrt(c*c+d*d*h*h)*s),"meters",i.units)};function B(e,r,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=r||{},n.geometry=e,n}function U(e,r){void 0===r&&(r={});var i={type:"FeatureCollection"};return r.id&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.features=e,i}function j(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function V(e,r,i){var n=!1;r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]&&(r=r.slice(0,r.length-1));for(var o=0,a=r.length-1;o<r.length;a=o++){var s=r[o][0],l=r[o][1],u=r[a][0],c=r[a][1];if(e[1]*(s-u)+l*(u-e[0])+c*(e[0]-s)==0&&(s-e[0])*(u-e[0])<=0&&(l-e[1])*(c-e[1])<=0)return!i;l>e[1]!=c>e[1]&&e[0]<(u-s)*(e[1]-l)/(c-l)+s&&(n=!n)}return n}function G(e,r,i,n,o,a){return Math.sqrt((o-i)*(o-i)+(a-n)*(a-n))===Math.sqrt((e-i)*(e-i)+(r-n)*(r-n))+Math.sqrt((o-e)*(o-e)+(a-r)*(a-r))}let q=function(e){for(var r="FeatureCollection"!==(a=e).type?"Feature"!==a.type?U([B(a)]):U([a]):a,i=_(r),n=!1,o=0;!n&&o<r.features.length;){var a,s,l,u,c,h,p,d=r.features[o].geometry,f=!1;if("Point"===d.type)i.geometry.coordinates[0]===d.coordinates[0]&&i.geometry.coordinates[1]===d.coordinates[1]&&(n=!0);else if("MultiPoint"===d.type){var m=!1;for(p=0;!m&&p<d.coordinates.length;)i.geometry.coordinates[0]===d.coordinates[p][0]&&i.geometry.coordinates[1]===d.coordinates[p][1]&&(n=!0,m=!0),p++}else if("LineString"===d.type)for(p=0;!f&&p<d.coordinates.length-1;)s=i.geometry.coordinates[0],l=i.geometry.coordinates[1],u=d.coordinates[p][0],c=d.coordinates[p][1],G(s,l,u,c,h=d.coordinates[p+1][0],d.coordinates[p+1][1])&&(f=!0,n=!0),p++;else if("MultiLineString"===d.type)for(var g=0;g<d.coordinates.length;){f=!1,p=0;for(var y=d.coordinates[g];!f&&p<y.length-1;)s=i.geometry.coordinates[0],l=i.geometry.coordinates[1],u=y[p][0],c=y[p][1],G(s,l,u,c,h=y[p+1][0],y[p+1][1])&&(f=!0,n=!0),p++;g++}else("Polygon"===d.type||"MultiPolygon"===d.type)&&function(e,r,i){if(void 0===i&&(i={}),!e)throw Error("point is required");if(!r)throw Error("polygon is required");
113var n,o,a=function(e){if(!e)throw Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw Error("coord must be GeoJSON Point or an Array of numbers")}(e),s="Feature"===r.type?r.geometry:r,l=s.type,u=r.bbox,c=s.coordinates;if(u&&!1==(n=a,(o=u)[0]<=n[0]&&o[1]<=n[1]&&o[2]>=n[0]&&o[3]>=n[1]))return!1;"Polygon"===l&&(c=[c]);for(var h=!1,p=0;p<c.length&&!h;p++)if(V(a,c[p][0],i.ignoreBoundary)){for(var d=!1,f=1;f<c[p].length&&!d;)V(a,c[p][f],!i.ignoreBoundary)&&(d=!0),f++;d||(h=!0)}return h}(i,d)&&(n=!0);o++}if(n)return i;var v=U([]);for(o=0;o<r.features.length;o++)v.features=v.features.concat(w(r.features[o]).features);var x,b=k(i,v).geometry.coordinates;if(void 0===x&&(x={}),!b)throw Error("coordinates is required");if(!Array.isArray(b))throw Error("coordinates must be an Array");if(b.length<2)throw Error("coordinates must be at least 2 numbers long");if(!j(b[0])||!j(b[1]))throw Error("coordinates must contain numbers");return B({type:"Point",coordinates:b},void 0,x)};function H(e){var r,i;return r=function(e,r){return e+function(e){var r,i=0;switch(e.type){case"Polygon":return $(e.coordinates);case"MultiPolygon":for(r=0;r<e.coordinates.length;r++)i+=$(e.coordinates[r]);return i}return 0}(r)},i=0,s(e,function(e,n,o,a,s){i=r(i,e)}),i}function $(e){var r=0;if(e&&e.length>0){r+=Math.abs(W(e[0]));for(var i=1;i<e.length;i++)r-=Math.abs(W(e[i]))}return r}function W(e){var r,i,n,o,a,s,l=0,u=e.length;if(u>2){for(s=0;s<u;s++)s===u-2?(n=u-2,o=u-1,a=0):s===u-1?(n=u-1,o=0,a=1):(n=s,o=s+1,a=s+2),r=e[n],i=e[o],l+=(Y(e[a][0])-Y(r[0]))*Math.sin(Y(i[1]));l=6378137*l*6378137/2}return l}function Y(e){return e*Math.PI/180}function Z(e,r){var i,a,s;return void 0===r&&(r={}),i=function(e,i){var n=i.geometry.coordinates;return e+d(n[0],n[1],r)},a=0,s=function(e,r,n,o,s){a=i(a,e)},l(e,function(e,r,i){var a,l=0;if(e.geometry){var u=e.geometry.type;if("Point"!==u&&"MultiPoint"!==u){var c=0,h=0,p=0;if(!1===o(e,function(o,u,d,f,m){if(void 0===a||r>c||f>h||m>p){a=o,c=r,h=f,p=m,l=0;return}if(!1===s(function(e,r,i){if(void 0===i&&(i={}),e.length<2)throw Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:e},r,i)}([a,o],e.properties),r,i,m,l))return!1;l++,a=o}))return!1}}}),a}var X=Math.PI/180,K=180/Math.PI,Q=function(e,r){this.lon=e,this.lat=r,this.x=X*e,this.y=X*r};Q.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Q.prototype.antipode=function(){var e=-1*this.lat;return new Q(this.lon<0?180+this.lon:-((180-this.lon)*1),e)};var J=function(){this.coords=[],this.length=0};J.prototype.move_to=function(e){this.length++,this.coords.push(e)};var ee=function(e){this.properties=e||{},this.geometries=[]};ee.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 e=[],r=0;r<this.geometries.length;r++)e.push(this.geometries[r].coords);return{geometry:{type:"MultiLineString",coordinates:e},type:"Feature",properties:this.properties}},ee.prototype.wkt=function(){for(var e="",r="LINESTRING(",i=function(e){r+=e[0]+" "+e[1]+","},n=0;n<this.geometries.length;n++)if(0===this.geometries[n].coords.length)return"LINESTRING(empty)";else this.geometries[n].coords.forEach(i),e+=r.substring(0,r.length-1)+")";return e};var et=function(e,r,i){if(!e||void 0===e.x||void 0===e.y||!r||void 0===r.x||void 0===r.y)throw Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Q(e.x,e.y),this.end=new Q(r.x,r.y),this.properties=i||{};var n=this.start.x-this.end.x,o=Math.pow(Math.sin((this.start.y-this.end.y)/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(n/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw Error("it appears "+e.view()+" and "+r.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw Error("could not calculate great circle between "+e+" and "+r)};function er(e){return e%360*Math.PI/180}
113function ei(e){if(!e)throw Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw Error("coord must be GeoJSON Point or an Array of numbers")}function en(e,r){var i=er(e[1]),n=er(r[1]),o=er(r[0]-e[0]);return o>Math.PI&&(o-=2*Math.PI),o<-Math.PI&&(o+=2*Math.PI),(180*(Math.atan2(o,Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)))%(2*Math.PI))/Math.PI+360)%360}et.prototype.interpolate=function(e){var r=Math.sin((1-e)*this.g)/Math.sin(this.g),i=Math.sin(e*this.g)/Math.sin(this.g),n=r*Math.cos(this.start.y)*Math.cos(this.start.x)+i*Math.cos(this.end.y)*Math.cos(this.end.x),o=r*Math.cos(this.start.y)*Math.sin(this.start.x)+i*Math.cos(this.end.y)*Math.sin(this.end.x),a=K*Math.atan2(r*Math.sin(this.start.y)+i*Math.sin(this.end.y),Math.sqrt(Math.pow(n,2)+Math.pow(o,2)));return[K*Math.atan2(o,n),a]},et.prototype.Arc=function(e,r){var i=[];if(!e||e<=2)i.push([this.start.lon,this.start.lat]),i.push([this.end.lon,this.end.lat]);else for(var n=1/(e-1),o=0;o<e;++o){var a=n*o,s=this.interpolate(a);i.push(s)}for(var l=!1,u=0,c=r&&r.offset?r.offset:10,h=180-c,p=-180+c,d=360-c,f=1;f<i.length;++f){var m=i[f-1][0],g=i[f][0],_=Math.abs(g-m);_>d&&(g>h&&m<p||m>h&&g<p)?l=!0:_>u&&(u=_)}var y=[];if(l&&u<c){var v=[];y.push(v);for(var x=0;x<i.length;++x){var b=parseFloat(i[x][0]);if(x>0&&Math.abs(b-i[x-1][0])>d){var w=parseFloat(i[x-1][0]),E=parseFloat(i[x-1][1]),S=parseFloat(i[x][0]),T=parseFloat(i[x][1]);if(w>-180&&w<p&&180===S&&x+1<i.length&&i[x-1][0]>-180&&i[x-1][0]<p){v.push([-180,i[x][1]]),x++,v.push([i[x][0],i[x][1]]);continue}if(w>h&&w<180&&-180===S&&x+1<i.length&&i[x-1][0]>h&&i[x-1][0]<180){v.push([180,i[x][1]]),x++,v.push([i[x][0],i[x][1]]);continue}if(w<p&&S>h){var I=w;w=S,S=I;var M=E;E=T,T=M}if(w>h&&S<p&&(S+=360),w<=180&&S>=180&&w<S){var C=(180-w)/(S-w),A=C*T+(1-C)*E;v.push([i[x-1][0]>h?180:-180,A]),(v=[]).push([i[x-1][0]>h?-180:180,A]),y.push(v)}else v=[],y.push(v);v.push([b,i[x][1]])}else v.push([i[x][0],i[x][1]])}}else{var P=[];y.push(P);for(var L=0;L<i.length;++L)P.push([i[L][0],i[L][1]])}for(var O=new ee(this.properties),D=0;D<y.length;++D){var R=new J;O.geometries.push(R);for(var k=y[D],N=0;N<k.length;++N)R.move_to(k[N])}return O},i(69560);let eo=function(e,r,i){void 0===i&&(i={});var n=i.final?en(ei(r),ei(e)):en(ei(e),ei(r));return n>180?-(360-n):n};var ea={centimeters:0x25f96350,centimetres:0x25f96350,degrees:6371008.8/111325,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,nauticalmiles:6371008.8/1852,radians:1,yards:6967335.223679999};function es(e){return e%360*Math.PI/180}function el(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}let eu=function(e,r,i,n){void 0===n&&(n={});var o,a,s,l,u,c,h,p,d,f,m,g=r<0,_=function(e,r,i){if(void 0===r&&(r="kilometers"),void 0===i&&(i="kilometers"),!(e>=0))throw Error("length must be a positive number");var n=function(e,r){void 0===r&&(r="kilometers");var i=ea[r];
113if(!i)throw Error(r+" units is invalid");return e/i}(e,r),o=i;void 0===o&&(o="kilometers");var a=ea[o];if(!a)throw Error(o+" units is invalid");return n*a}(Math.abs(r),n.units,"meters");g&&(_=-Math.abs(_));var y=function(e){if(!e)throw Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw Error("coord must be GeoJSON Point or an Array of numbers")}(e),v=(o=y,a=_,s=i,u=a/(l=void 0===l?6371008.8:Number(l)),c=o[0]*Math.PI/180,h=es(o[1]),Math.abs(f=h+(d=u*Math.cos(p=es(s))))>Math.PI/2&&(f=f>0?Math.PI-f:-Math.PI-f),[(180*(c+u*Math.sin(p)/(Math.abs(m=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(h/2+Math.PI/4)))>1e-11?d/m:Math.cos(h)))/Math.PI+540)%360-180,180*f/Math.PI]);return v[0]+=v[0]-y[0]>180?-360:360*(y[0]-v[0]>180),function(e,r,i){var n,o,a;if(void 0===i&&(i={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!el(e[0])||!el(e[1]))throw Error("coordinates must contain numbers");return n={type:"Point",coordinates:e},void 0===(o=i)&&(o={}),a={type:"Feature"},(0===o.id||o.id)&&(a.id=o.id),o.bbox&&(a.bbox=o.bbox),a.properties=r||{},a.geometry=n,a}(v,n.properties)};var ec=[],eh=[],ep=[],ed=[],ef=[],em=[],eg=[],e_=[],ey=[],ev=[],ex=[],eb=[],ew=[],eE=[],eS=[],eT=[],eI=[],eM=[],eC=[],eA=[],eP=[],eL=[],eO=[],eD=[];eg[85]=ev[85]=-1,e_[85]=ex[85]=0,ey[85]=eb[85]=1,eC[85]=eL[85]=1,eA[85]=eO[85]=0,eP[85]=eD[85]=1,ec[85]=ed[85]=0,eh[85]=ef[85]=-1,ep[85]=eS[85]=0,eT[85]=ew[85]=0,eI[85]=eE[85]=1,em[85]=eM[85]=1,eL[1]=eL[169]=0,eO[1]=eO[169]=-1,eD[1]=eD[169]=0,ew[1]=ew[169]=-1,eE[1]=eE[169]=0,eS[1]=eS[169]=0,ev[4]=ev[166]=0,ex[4]=ex[166]=-1,eb[4]=eb[166]=1,eT[4]=eT[166]=1,eI[4]=eI[166]=0,eM[4]=eM[166]=0,eg[16]=eg[154]=0,e_[16]=e_[154]=1,ey[16]=ey[154]=1,ed[16]=ed[154]=1,ef[16]=ef[154]=0,em[16]=em[154]=1,eC[64]=eC[106]=0,eA[64]=eA[106]=1,eP[64]=eP[106]=0,ec[64]=ec[106]=-1,eh[64]=eh[106]=0,ep[64]=ep[106]=1,eC[2]=eC[168]=0,eA[2]=eA[168]=-1,eP[2]=eP[168]=1,eL[2]=eL[168]=0,eO[2]=eO[168]=-1,eD[2]=eD[168]=0,ew[2]=ew[168]=-1,eE[2]=eE[168]=0,eS[2]=eS[168]=0,eT[2]=eT[168]=-1,eI[2]=eI[168]=0,eM[2]=eM[168]=1,eg[8]=eg[162]=0,e_[8]=e_[162]=-1,ey[8]=ey[162]=0,ev[8]=ev[162]=0,ex[8]=ex[162]=-1,eb[8]=eb[162]=1,ew[8]=ew[162]=1,eE[8]=eE[162]=0,eS[8]=eS[162]=1,eT[8]=eT[162]=1,eI[8]=eI[162]=0,eM[8]=eM[162]=0,eg[32]=eg[138]=0,e_[32]=e_[138]=1,ey[32]=ey[138]=1,ev[32]=ev[138]=0,ex[32]=ex[138]=1,eb[32]=eb[138]=0,ec[32]=ec[138]=1,eh[32]=eh[138]=0,ep[32]=ep[138]=0,ed[32]=ed[138]=1,ef[32]=ef[138]=0,em[32]=em[138]=1,eL[128]=eL[42]=0,eO[128]=eO[42]=1,eD[128]=eD[42]=1,eC[128]=eC[42]=0,eA[128]=eA[42]=1,eP[128]=eP[42]=0,ec[128]=ec[42]=-1,eh[128]=eh[42]=0,ep[128]=ep[42]=1,ed[128]=ed[42]=-1,ef[128]=ef[42]=0,em[128]=em[42]=0,ev[5]=ev[165]=-1,ex[5]=ex[165]=0,eb[5]=eb[165]=0,eL[5]=eL[165]=1,eO[5]=eO[165]=0,eD[5]=eD[165]=0,eT[20]=eT[150]=0,eI[20]=eI[150]=1,eM[20]=eM[150]=1,ed[20]=ed[150]=0,ef[20]=ef[150]=-1,em[20]=em[150]=1,eg[80]=eg[90]=-1,e_[80]=e_[90]=0,ey[80]=ey[90]=1,eC[80]=eC[90]=1,eA[80]=eA[90]=0,eP[80]=eP[90]=1,ew[65]=ew[105]=0,eE[65]=eE[105]=1,eS[65]=eS[105]=0,ec[65]=ec[105]=0,eh[65]=eh[105]=-1,ep[65]=ep[105]=0,eg[160]=eg[10]=-1,e_[160]=e_[10]=0,ey[160]=ey[10]=1,ev[160]=ev[10]=-1,ex[160]=ex[10]=0,eb[160]=eb[10]=0,eL[160]=eL[10]=1,eO[160]=eO[10]=0,eD[160]=eD[10]=0,eC[160]=eC[10]=1,eA[160]=eA[10]=0,eP[160]=eP[10]=1,eT[130]=eT[40]=0,eI[130]=eI[40]=1,eM[130]=eM[40]=1,ew[130]=ew[40]=0,eE[130]=eE[40]=1,eS[130]=eS[40]=0,ec[130]=ec[40]=0,eh[130]=eh[40]=-1,ep[130]=ep[40]=0,ed[130]=ed[40]=0,ef[130]=ef[40]=-1,em[130]=em[40]=1,ev[37]=ev[133]=0,ex[37]=ex[133]=1,eb[37]=eb[133]=1,eL[37]=eL[133]=0,eO[37]=eO[133]=1,eD[37]=eD[133]=0,ec[37]=ec[133]=-1,eh[37]=eh[133]=0,ep[37]=ep[133]=0,ed[37]=ed[133]=1,ef[37]=ef[133]=0,em[37]=em[133]=0,eT[148]=eT[22]=-1,eI[148]=eI[22]=0,eM[148]=eM[22]=0,eL[148]=eL[22]=0,eO[148]=eO[22]=-1,eD[148]=eD[22]=1,eC[148]=eC[22]=0,eA[148]=eA[22]=1,eP[148]=eP[22]=1,ed[148]=ed[22]=-1,ef[148]=ef[22]=0,em[148]=em[22]=1,eg[82]=eg[88]=0,e_[82]=e_[88]=-1,ey[82]=ey[88]=1,eT[82]=eT[88]=1,eI[82]=eI[88]=0,eM[82]=eM[88]=1,ew[82]=ew[88]=-1,eE[82]=eE[88]=0,eS[82]=eS[88]=1,eC[82]=eC[88]=0,eA[82]=eA[88]=-1,eP[82]=eP[88]=0,eg[73]=eg[97]=0,e_[73]=e_[97]=1,ey[73]=ey[97]=0,ev[73]=ev[97]=0,ex[73]=ex[97]=-1,eb[73]=eb[97]=0,ew[73]=ew[97]=1,eE[73]=eE[97]=0,eS[73]=eS[97]=0,ec[73]=ec[97]=1,eh[73]=eh[97]=0,ep[73]=ep[97]=1,eg[145]=eg[25]=0,e_[145
113]=e_[25]=-1,ey[145]=ey[25]=0,ew[145]=ew[25]=1,eE[145]=eE[25]=0,eS[145]=eS[25]=1,eL[145]=eL[25]=0,eO[145]=eO[25]=1,eD[145]=eD[25]=1,ed[145]=ed[25]=-1,ef[145]=ef[25]=0,em[145]=em[25]=0,ev[70]=ev[100]=0,ex[70]=ex[100]=1,eb[70]=eb[100]=0,eT[70]=eT[100]=-1,eI[70]=eI[100]=0,eM[70]=eM[100]=1,eC[70]=eC[100]=0,eA[70]=eA[100]=-1,eP[70]=eP[100]=1,ec[70]=ec[100]=1,eh[70]=eh[100]=0,ep[70]=ep[100]=0,ev[101]=ev[69]=0,ex[101]=ex[69]=1,eb[101]=eb[69]=0,ec[101]=ec[69]=1,eh[101]=eh[69]=0,ep[101]=ep[69]=0,eL[149]=eL[21]=0,eO[149]=eO[21]=1,eD[149]=eD[21]=1,ed[149]=ed[21]=-1,ef[149]=ef[21]=0,em[149]=em[21]=0,eT[86]=eT[84]=-1,eI[86]=eI[84]=0,eM[86]=eM[84]=1,eC[86]=eC[84]=0,eA[86]=eA[84]=-1,eP[86]=eP[84]=1,eg[89]=eg[81]=0,e_[89]=e_[81]=-1,ey[89]=ey[81]=0,ew[89]=ew[81]=1,eE[89]=eE[81]=0,eS[89]=eS[81]=1,eg[96]=eg[74]=0,e_[96]=e_[74]=1,ey[96]=ey[74]=0,ev[96]=ev[74]=-1,ex[96]=ex[74]=0,eb[96]=eb[74]=1,eC[96]=eC[74]=1,eA[96]=eA[74]=0,eP[96]=eP[74]=0,ec[96]=ec[74]=1,eh[96]=eh[74]=0,ep[96]=ep[74]=1,eg[24]=eg[146]=0,e_[24]=e_[146]=-1,ey[24]=ey[146]=1,eT[24]=eT[146]=1,eI[24]=eI[146]=0,eM[24]=eM[146]=1,ew[24]=ew[146]=0,eE[24]=eE[146]=1,eS[24]=eS[146]=1,ed[24]=ed[146]=0,ef[24]=ef[146]=-1,em[24]=em[146]=0,ev[6]=ev[164]=-1,ex[6]=ex[164]=0,eb[6]=eb[164]=1,eT[6]=eT[164]=-1,eI[6]=eI[164]=0,eM[6]=eM[164]=0,eL[6]=eL[164]=0,eO[6]=eO[164]=-1,eD[6]=eD[164]=1,eC[6]=eC[164]=1,eA[6]=eA[164]=0,eP[6]=eP[164]=0,ew[129]=ew[41]=0,eE[129]=eE[41]=1,eS[129]=eS[41]=1,eL[129]=eL[41]=0,eO[129]=eO[41]=1,eD[129]=eD[41]=0,ec[129]=ec[41]=-1,eh[129]=eh[41]=0,ep[129]=ep[41]=0,ed[129]=ed[41]=0,ef[129]=ef[41]=-1,em[129]=em[41]=0,eT[66]=eT[104]=0,eI[66]=eI[104]=1,eM[66]=eM[104]=0,ew[66]=ew[104]=-1,eE[66]=eE[104]=0,eS[66]=eS[104]=1,eC[66]=eC[104]=0,eA[66]=eA[104]=-1,eP[66]=eP[104]=0,ec[66]=ec[104]=0,eh[66]=eh[104]=-1,ep[66]=ep[104]=1,eg[144]=eg[26]=-1,e_[144]=e_[26]=0,ey[144]=ey[26]=0,eL[144]=eL[26]=1,eO[144]=eO[26]=0,eD[144]=eD[26]=1,eC[144]=eC[26]=0,eA[144]=eA[26]=1,eP[144]=eP[26]=1,ed[144]=ed[26]=-1,ef[144]=ef[26]=0,em[144]=em[26]=1,ev[36]=ev[134]=0,ex[36]=ex[134]=1,eb[36]=eb[134]=1,eT[36]=eT[134]=0,eI[36]=eI[134]=1,eM[36]=eM[134]=0,ec[36]=ec[134]=0,eh[36]=eh[134]=-1,ep[36]=ep[134]=1,ed[36]=ed[134]=1,ef[36]=ef[134]=0,em[36]=em[134]=0,eg[9]=eg[161]=-1,e_[9]=e_[161]=0,ey[9]=ey[161]=0,ev[9]=ev[161]=0,ex[9]=ex[161]=-1,eb[9]=eb[161]=0,ew[9]=ew[161]=1,eE[9]=eE[161]=0,eS[9]=eS[161]=0,eL[9]=eL[161]=1,eO[9]=eO[161]=0,eD[9]=eD[161]=1,eg[136]=0,e_[136]=1,ey[136]=1,ev[136]=0,ex[136]=1,eb[136]=0,eT[136]=-1,eI[136]=0,eM[136]=1,ew[136]=-1,eE[136]=0,eS[136]=0,eL[136]=0,eO[136]=-1,eD[136]=0,eC[136]=0,eA[136]=-1,eP[136]=1,ec[136]=1,eh[136]=0,ep[136]=0,ed[136]=1,ef[136]=0,em[136]=1,eg[34]=0,e_[34]=-1,ey[34]=0,ev[34]=0,ex[34]=-1,eb[34]=1,eT[34]=1,eI[34]=0,eM[34]=0,ew[34]=1,eE[34]=0,eS[34]=1,eL[34]=0,eO[34]=1,eD[34]=1,eC[34]=0,eA[34]=1,eP[34]=0,ec[34]=-1,eh[34]=0,ep[34]=1,ed[34]=-1,ef[34]=0,em[34]=0,eg[35]=0,e_[35]=1,ey[35]=1,ev[35]=0,ex[35]=-1,eb[35]=1,eT[35]=1,eI[35]=0,eM[35]=0,ew[35]=-1,eE[35]=0,eS[35]=0,eL[35]=0,eO[35]=-1,eD[35]=0,eC[35]=0,eA[35]=1,eP[35]=0,ec[35]=-1,eh[35]=0,ep[35]=1,ed[35]=1,ef[35]=0,em[35]=1,eg[153]=0,e_[153]=1,ey[153]=1,ew[153]=-1,eE[153]=0,eS[153]=0,eL[153]=0,eO[153]=-1,eD[153]=0,ed[153]=1,ef[153]=0,em[153]=1,ev[102]=0,ex[102]=-1,eb[102]=1,eT[102]=1,eI[102]=0,eM[102]=0,eC[102]=0,eA[102]=1,eP[102]=0,ec[102]=-1,eh[102]=0,ep[102]=1,eg[155]=0,e_[155]=-1,ey[155]=0,ew[155]=1,eE[155]=0,eS[155]=1,eL[155]=0,eO[155]=1,eD[155]=1,ed[155]=-1,ef[155]=0,em[155]=0,ev[103]=0,ex[103]=1,eb[103]=0,eT[103]=-1,eI[103]=0,eM[103]=1,eC[103]=0,eA[103]=-1,eP[103]=1,ec[103]=1,eh[103]=0,ep[103]=0,eg[152]=0,e_[152]=1,ey[152]=1,eT[152]=-1,eI[152]=0,eM[152]=1,ew[152]=-1,eE[152]=0,eS[152]=0,eL[152]=0,eO[152]=-1,eD[152]=0,eC[152]=0,eA[152]=-1,eP[152]=1,ed[152]=1,ef[152]=0,em[152]=1,eg[156]=0,e_[156]=-1,ey[156]=1,eT[156]=1,eI[156]=0,eM[156]=1,ew[156]=-1,eE[156]=0,eS[156]=0,eL[156]=0,eO[156]=-1,eD[156]=0,eC[156]=0,eA[156]=1,eP[156]=1,ed[156]=-1,ef[156]=0,em[156]=1,eg[137]=0,e_[137]=1,ey[137]=1,ev[137]=0,ex[137]=1,eb[137]=0,ew[137]=-1,eE[137]=0,eS[137]=0,eL[137]=0,eO[137]=-1,eD[137]=0,ec[137]=1,eh[137]=0,ep[137]=0,ed[137]=1,ef[137]=0,em[137]=1,eg[139]=0,e_[139]=1,ey[139]=1,ev[139]=0,ex[139]=-1,eb[139]=0,ew[139]=1,eE[139]=0,eS[139]=0,eL[139]=0,eO[139]=1,eD[139]=0,ec[139]=-1,eh[139]=0,ep[139]=0,ed[139]=1,ef[139]=0,em[139]=1,eg[98]=0,e_[98]=-1,ey[98]=0,ev[98]=0,ex[98]=-1,eb[98]=1,eT[98]=1,eI[98]=0,eM[98]=0,ew[98]=1,eE[98]=0,eS[98]=1,e
113C[98]=0,eA[98]=1,eP[98]=0,ec[98]=-1,eh[98]=0,ep[98]=1,eg[99]=0,e_[99]=1,ey[99]=0,ev[99]=0,ex[99]=-1,eb[99]=1,eT[99]=1,eI[99]=0,eM[99]=0,ew[99]=-1,eE[99]=0,eS[99]=1,eC[99]=0,eA[99]=-1,eP[99]=0,ec[99]=1,eh[99]=0,ep[99]=1,ev[38]=0,ex[38]=-1,eb[38]=1,eT[38]=1,eI[38]=0,eM[38]=0,eL[38]=0,eO[38]=1,eD[38]=1,eC[38]=0,eA[38]=1,eP[38]=0,ec[38]=-1,eh[38]=0,ep[38]=1,ed[38]=-1,ef[38]=0,em[38]=0,ev[39]=0,ex[39]=1,eb[39]=1,eT[39]=-1,eI[39]=0,eM[39]=0,eL[39]=0,eO[39]=-1,eD[39]=1,eC[39]=0,eA[39]=1,eP[39]=0,ec[39]=-1,eh[39]=0,ep[39]=1,ed[39]=1,ef[39]=0,em[39]=0;var eR=function(e){return[[e.bottomleft,0],[0,0],[0,e.leftbottom]]},ek=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0]]},eN=function(e){return[[e.topright,1],[1,1],[1,e.righttop]]},eF=function(e){return[[0,e.lefttop],[0,1],[e.topleft,1]]},ez=function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop]]},eB=function(e){return[[e.bottomright,0],[e.bottomleft,0],[1,e.righttop],[1,e.rightbottom]]},eU=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.topleft,1],[e.topright,1]]},ej=function(e){return[[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},eV=[],eG=[],eq=[],eH=[],e$=[],eW=[],eY=[],eZ=[];eH[1]=e$[1]=18,eH[169]=e$[169]=18,eq[4]=eG[4]=12,eq[166]=eG[166]=12,eV[16]=eZ[16]=4,eV[154]=eZ[154]=4,eW[64]=eY[64]=22,eW[106]=eY[106]=22,eq[2]=eW[2]=17,eH[2]=e$[2]=18,eq[168]=eW[168]=17,eH[168]=e$[168]=18,eV[8]=eH[8]=9,eG[8]=eq[8]=12,eV[162]=eH[162]=9,eG[162]=eq[162]=12,eV[32]=eZ[32]=4,eG[32]=eY[32]=1,eV[138]=eZ[138]=4,eG[138]=eY[138]=1,e$[128]=eZ[128]=21,eW[128]=eY[128]=22,e$[42]=eZ[42]=21,eW[42]=eY[42]=22,eG[5]=e$[5]=14,eG[165]=e$[165]=14,eq[20]=eZ[20]=6,eq[150]=eZ[150]=6,eV[80]=eW[80]=11,eV[90]=eW[90]=11,eH[65]=eY[65]=3,eH[105]=eY[105]=3,eV[160]=eW[160]=11,eG[160]=e$[160]=14,eV[10]=eW[10]=11,eG[10]=e$[10]=14,eq[130]=eZ[130]=6,eH[130]=eY[130]=3,eq[40]=eZ[40]=6,eH[40]=eY[40]=3,eG[101]=eY[101]=1,eG[69]=eY[69]=1,e$[149]=eZ[149]=21,e$[21]=eZ[21]=21,eq[8
1136]=eW[86]=17,eq[84]=eW[84]=17,eV[89]=eH[89]=9,eV[81]=eH[81]=9,eV[96]=eY[96]=0,eG[96]=eW[96]=15,eV[74]=eY[74]=0,eG[74]=eW[74]=15,eV[24]=eq[24]=8,eH[24]=eZ[24]=7,eV[146]=eq[146]=8,eH[146]=eZ[146]=7,eG[6]=eW[6]=15,eq[6]=e$[6]=16,eG[164]=eW[164]=15,eq[164]=e$[164]=16,eH[129]=eZ[129]=7,e$[129]=eY[129]=20,eH[41]=eZ[41]=7,e$[41]=eY[41]=20,eq[66]=eY[66]=2,eH[66]=eW[66]=19,eq[104]=eY[104]=2,eH[104]=eW[104]=19,eV[144]=e$[144]=10,eW[144]=eZ[144]=23,eV[26]=e$[26]=10,eW[26]=eZ[26]=23,eG[36]=eZ[36]=5,eq[36]=eY[36]=2,eG[134]=eZ[134]=5,eq[134]=eY[134]=2,eV[9]=e$[9]=10,eG[9]=eH[9]=13,eV[161]=e$[161]=10,eG[161]=eH[161]=13,eG[37]=eZ[37]=5,e$[37]=eY[37]=20,eG[133]=eZ[133]=5,e$[133]=eY[133]=20,eq[148]=e$[148]=16,eW[148]=eZ[148]=23,eq[22]=e$[22]=16,eW[22]=eZ[22]=23,eV[82]=eq[82]=8,eH[82]=eW[82]=19,eV[88]=eq[88]=8,eH[88]=eW[88]=19,eV[73]=eY[73]=0,eG[73]=eH[73]=13,eV[97]=eY[97]=0,eG[97]=eH[97]=13,eV[145]=eH[145]=9,e$[145]=eZ[145]=21,eV[25]=eH[25]=9,e$[25]=eZ[25]=21,eG[70]=eY[70]=1,eq[70]=eW[70]=17,eG[100]=eY[100]=1,eq[100]=eW[100]=17,eV[34]=eH[34]=9,eG[34]=eq[34]=12,e$[34]=eZ[34]=21,eW[34]=eY[34]=22,eV[136]=eZ[136]=4,eG[136]=eY[136]=1,eq[136]=eW[136]=17,eH[136]=e$[136]=18,eV[35]=eZ[35]=4,eG[35]=eq[35]=12,eH[35]=e$[35]=18,eW[35]=eY[35]=22,eV[153]=eZ[153]=4,eH[153]=e$[153]=18,eG[102]=eq[102]=12,eW[102]=eY[102]=22,eV[155]=eH[155]=9,e$[155]=eZ[155]=23,eG[103]=eY[103]=1,eq[103]=eW[103]=17,eV[152]=eZ[152]=4,eq[152]=eW[152]=17,eH[152]=e$[152]=18,eV[156]=eq[156]=8,eH[156]=e$[156]=18,eW[156]=eZ[156]=23,eV[137]=eZ[137]=4,eG[137]=eY[137]=1,eH[137]=e$[137]=18,eV[139]=eZ[139]=4,eG[139]=eH[139]=13,e$[139]=eY[139]=20,eV[98]=eH[98]=9,eG[98]=eq[98]=12,eW[98]=eY[98]=22,eV[99]=eY[99]=0,eG[99]=eq[99]=12,eH[99]=eW[99]=19,eG[38]=eq[38]=12,e$[38]=eZ[38]=21,eW[38]=eY[38]=22,eG[39]=eZ[39]=5,eq[39]=e$[39]=16,eW[39]=eY[39]=22;var eX=[];function eK(e,r,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=r||{},n.geometry=e,n}function eQ(e,r,i){if(void 0===i&&(i={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!eJ(e[0])||!eJ(e[1]))throw Error("coordinates must contain numbers");return eK({type:"Point",coordinates:e},r,i)}function eJ(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function e0(e,r,i){if(void 0===i&&(i={}),!e)throw Error("point is required");if(!r)throw Error("polygon is required");
113var n,o,a=function(e){if(!e)throw Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw Error("coord must be GeoJSON Point or an Array of numbers")}(e),s="Feature"===r.type?r.geometry:r,l=s.type,u=r.bbox,c=s.coordinates;if(u&&!1==(n=a,(o=u)[0]<=n[0]&&o[1]<=n[1]&&o[2]>=n[0]&&o[3]>=n[1]))return!1;"Polygon"===l&&(c=[c]);for(var h=!1,p=0;p<c.length&&!h;p++)if(e1(a,c[p][0],i.ignoreBoundary)){for(var d=!1,f=1;f<c[p].length&&!d;)e1(a,c[p][f],!i.ignoreBoundary)&&(d=!0),f++;d||(h=!0)}return h}function e1(e,r,i){var n=!1;r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]&&(r=r.slice(0,r.length-1));for(var o=0,a=r.length-1;o<r.length;a=o++){var s=r[o][0],l=r[o][1],u=r[a][0],c=r[a][1];if(e[1]*(s-u)+l*(u-e[0])+c*(e[0]-s)==0&&(s-e[0])*(u-e[0])<=0&&(l-e[1])*(c-e[1])<=0)return!i;l>e[1]!=c>e[1]&&e[0]<(u-s)*(e[1]-l)/(c-l)+s&&(n=!n)}return n}function e2(e,r,i){var n,o=r[0]-e[0],a=r[1]-e[1],s=i[0]-r[0];return((n=o*(i[1]-r[1])-s*a)>0)-(n<0)||+n}function e3(e,r){return r.geometry.coordinates[0].every(function(r){return e0(eQ(r),e)})}eX[1]=eX[169]=eR,eX[4]=eX[166]=ek,eX[16]=eX[154]=eN,eX[64]=eX[106]=eF,eX[168]=eX[2]=ez,eX[162]=eX[8]=eB,eX[138]=eX[32]=eU,eX[42]=eX[128]=ej,eX[5]=eX[165]=function(e){return[[0,0],[0,e.leftbottom],[1,e.rightbottom],[1,0]]},eX[20]=eX[150]=function(e){return[[1,0],[e.bottomright,0],[e.topright,1],[1,1]]},eX[80]=eX[90]=function(e){return[[1,1],[1,e.righttop],[0,e.lefttop],[0,1]]},eX[65]=eX[105]=function(e){return[[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},eX[160]=eX[10]=function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.leftbottom],[0,e.lefttop]]},eX[130]=eX[40]=function(e){return[[e.topleft,1],[e.topright,1],[e.bottomright,0],[e.bottomleft,0]]},eX[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},eX[101]=eX[69]=function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,1],[e.topleft,1]]},eX[149]=eX[21]=function(e){return[[e.topright,1],[1,1],[1,0],[0,0],[0,e.leftbottom]]},eX[86]=eX[84]=function(e){return[[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[1,1]]},eX[89]=eX[81]=function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,1]]},eX[96]=eX[74]=function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.lefttop],[0,1],[e.topleft,1]]},eX[24]=eX[146]=function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[e.topright,1]]},eX[6]=eX[164]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop]]},eX[129]=eX[41]=function(e){return[[e.topright,1],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1]]},eX[66]=eX[104]=function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},eX[144]=eX[26]=function(e){return[[1,1],[1,e.righttop],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},eX[36]=eX[134]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[e.topleft,1],[e.topright,1]]},eX[9]=eX[161]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom]]},eX[37]=eX[133]=function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},eX[148]=eX[22]=function(e){return[[1,1],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},eX[82]=eX[88]=function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1]]},eX[73]=eX[97]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},eX[145]=eX[25]=function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},eX[70]=eX[100]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},eX[34]=function(e){return[ej(e),eB(e)]},eX[35]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},eX[136]=function(e){return[eU(e),ez(e)]},eX[153]=function(e){return[eN(e),eR(e)]},eX[102]=function(e){return[ek(e),eF(e)]},eX[155]=function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},eX[103]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},eX[152]=function(e){return[eN(e),ez(e)]},eX[156]=function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},eX[137]=function(e){return[eU(e),eR(e)]},eX[139]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},eX[98]=function(e){return[eB(e),eF(e)]},eX[99]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},eX[38]=function(e){return[ek(e),ej(e)]},eX[39]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]};var e5=function(){function e(r){this.id=e.buildId(r),this.coordinates=r,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return e.buildId=function(e){return e.join(",")},e.prototype.removeInnerEdge=function(e){this.innerEdges=this.innerEdges.filter(function(r){return r.from.id!==e.from.id})},e.prototype.removeOuterEdge=function(e){this.outerEdges=this.outerEdges.filter(function(r){return r.to.id!==e.to.id})},e.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},e.prototype.sortOuterEdges=function(){var e=this;this.outerEdgesSorted||(this.outerEdges.sort(function(r,i){var n=r.to,o=i.to;if(n.coordinates[0]-e.coordinates[0]>=0&&o.coordinates[0]-e.coordinates[0]<0)return 1;if(n.coordinates[0]-e.coordinates[0]<0&&o.coordinates[0]-e.coordinates[0]>=0)return -1;if(n.coordinates[0]-e.coordinates[0]==0&&o.coordinates[0]-e.coordinates[0]==0)return n.coordinates[1]-e.coordinates[1]>=0||o.coordinates[1]-e.coordinates[1]>=0?n.coordinates[1]-o.coordinates[1]:o.coordinates[1]-n.coordinates[1];var a=e2(e.coordinates,n.coordinates,o.coordinates);return a<0?1:a>0?-1:Math.pow(n.coordinates[0]-e.coordinates[0],2)+Math.pow(n.coordinates[1]-e.coordinates[1],2)-(Math.pow(o.coordinates[0]-e.coordinates[0],2)+Math.pow(o.coordinates[1]-e.coordinates[1],2))}),this.outerEdgesSorted=!0)},e.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},e.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},e.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},e}(),e4=function(){function e(e,r){this.from=e,this.to=r,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 e.prototype.getSymetric=function(){return this.symetric||(this.symetric=new e(this.to,this.from),this.symetric.symetric=this),this.symetric},e.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},e.prototype.isEqual=function(e){return this.from.id===e.from.id&&this.to.id===e.to.id},e.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},e.prototype.toLineString=function(){var e,r=[this.from.coordinates,this.to.coordinates];if(void 0===e&&(e={}),r.length<2)throw Error("coordinates must be an array of two or more positions");return eK({type:"LineString",coordinates:r},void 0,e)},e.prototype.compareTo=function(e){return e2(e.from.coordinates,e.to.coordinates,this.to.coordinates)},e}(),e6=function(){function e(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return e.prototype.push=function(e){this.edges.push(e),this.polygon=this.envelope=void 0},e.prototype.get=function(e){return this.edges[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}
113),e.prototype.forEach=function(e){this.edges.forEach(e)},e.prototype.map=function(e){return this.edges.map(e)},e.prototype.some=function(e){return this.edges.some(e)},e.prototype.isValid=function(){return!0},e.prototype.isHole=function(){var e=this,r=this.edges.reduce(function(r,i,n){return i.from.coordinates[1]>e.edges[r].from.coordinates[1]&&(r=n),r},0),i=(0===r?this.length:r)-1,n=(r+1)%this.length,o=e2(this.edges[i].from.coordinates,this.edges[r].from.coordinates,this.edges[n].from.coordinates);return 0===o?this.edges[i].from.coordinates[0]>this.edges[n].from.coordinates[0]:o>0},e.prototype.toMultiPoint=function(){var e,r;return e=this.edges.map(function(e){return e.from.coordinates}),void 0===r&&(r={}),eK({type:"MultiPoint",coordinates:e},void 0,r)},e.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(e){return e.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=function(e,r){void 0===r&&(r={});for(var i=0;i<e.length;i++){var n=e[i];if(n.length<4)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<n[n.length-1].length;o++)if(n[n.length-1][o]!==n[0][o])throw Error("First and last Position are not equivalent.")}return eK({type:"Polygon",coordinates:e},void 0,r)}([e])},e.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=function(e,r){void 0===r&&(r={});var i=Number(e[0]),n=Number(e[1]),o=Number(e[2]),a=Number(e[3]);if(6===e.length)throw Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[i,n],l=[i,a],u=[o,a];return function(e,r,i){void 0===i&&(i={});for(var n,o,a,s=0;s<e.length;s++){var l=e[s];if(l.length<4)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var u=0;u<l[l.length-1].length;u++)if(l[l.length-1][u]!==l[0][u])throw Error("First and last Position are not equivalent.")}return n={type:"Polygon",coordinates:e},void 0===(o=i)&&(o={}),a={type:"Feature"},(0===o.id||o.id)&&(a.id=o.id),o.bbox&&(a.bbox=o.bbox),a.properties=r||{},a.geometry=n,a}([[s,[o,n],u,l,s]],r.properties,{bbox:e,id:r.id})}(u(this.toPolygon()))},e.findEdgeRingContaining=function(e,r){var i,n,o=e.getEnvelope();return r.forEach(function(r){var a,s,l,u,c=r.getEnvelope();if(n&&(i=n.getEnvelope()),a=c.geometry.coordinates[0].map(function(e){return e[0]}),s=c.geometry.coordinates[0].map(function(e){return e[1]}),l=o.geometry.coordinates[0].map(function(e){return e[0]}),u=o.geometry.coordinates[0].map(function(e){return e[1]}),(Math.max.apply(null,a)!==Math.max.apply(null,l)||Math.max.apply(null,s)!==Math.max.apply(null,u)||Math.min.apply(null,a)!==Math.min.apply(null,l)||Math.min.apply(null,s)!==Math.min.apply(null,u))&&e3(c,o)){for(var h=e.map(function(e){return e.from.coordinates}),p=void 0,d=function(e){r.some(function(r){var i;return i=r.from.coordinates,e[0]===i[0]&&e[1]===i[1]})||(p=e)},f=0;f<h.length;f++)d(h[f]);p&&r.inside(eQ(p))&&(!n||e3(i,c))&&(n=r)}}),n},e.prototype.inside=function(e){return e0(e,this.toPolygon())},e}();function e8(){this.edges=[],this.nodes={}}function e9(e){for(var r=e,i=[];r.parent;)i.unshift(r),r=r.parent;return i}e8.fromGeoJson=function(e){if(!e)throw Error("No geojson passed");if("FeatureCollection"!==e.type&&"GeometryCollection"!==e.type&&"MultiLineString"!==e.type&&"LineString"!==e.type&&"Feature"!==e.type)throw Error("Invalid input type '"+e.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature");var r=new e8;return l(e,function(e){var i,n,a="LineString",s="Graph::fromGeoJson";if(!e)throw Error("No feature passed");if(!s)throw Error(".featureOf() requires a name");if(!e||"Feature"!==e.type||!e.geometry)throw Error("Invalid input to "+s+", Feature with geometry required");if(!e.geometry||e.geometry.type!==a)throw Error("Invalid input to "+s+": must be a "+a+", given "+e.geometry.type);i=function(e,i){if(e){var n=r.getNode(e),o=r.getNode(i);r.addEdge(n,o)}return i},n=void 0,o(e,function(e,r,o,a,s){n=0===r?e:i(n,e)},void 0)}),r},e8.prototype.getNode=function(e){var r=e5.buildId(e),i=this.nodes[r];
113return i||(i=this.nodes[r]=new e5(e)),i},e8.prototype.addEdge=function(e,r){var i=new e4(e,r),n=i.getSymetric();this.edges.push(i),this.edges.push(n)},e8.prototype.deleteDangles=function(){var e=this;Object.keys(this.nodes).map(function(r){return e.nodes[r]}).forEach(function(r){return e._removeIfDangle(r)})},e8.prototype._removeIfDangle=function(e){var r=this;if(e.innerEdges.length<=1){var i=e.getOuterEdges().map(function(e){return e.to});this.removeNode(e),i.forEach(function(e){return r._removeIfDangle(e)})}},e8.prototype.deleteCutEdges=function(){var e=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(r){r.label===r.symetric.label&&(e.removeEdge(r.symetric),e.removeEdge(r))})},e8.prototype._computeNextCWEdges=function(e){var r=this;void 0===e?Object.keys(this.nodes).forEach(function(e){return r._computeNextCWEdges(r.nodes[e])}):e.getOuterEdges().forEach(function(r,i){e.getOuterEdge((0===i?e.getOuterEdges().length:i)-1).symetric.next=r})},e8.prototype._computeNextCCWEdges=function(e,r){for(var i,n,o=e.getOuterEdges(),a=o.length-1;a>=0;--a){var s=o[a],l=s.symetric,u=void 0,c=void 0;s.label===r&&(u=s),l.label===r&&(c=l),u&&c&&(c&&(n=c),u&&(n&&(n.next=u,n=void 0),i||(i=u)))}n&&(n.next=i)},e8.prototype._findLabeledEdgeRings=function(){var e=[],r=0;
113return this.edges.forEach(function(i){if(!(i.label>=0)){e.push(i);var n=i;do n.label=r,n=n.next;while(!i.isEqual(n));r++}}),e},e8.prototype.getEdgeRings=function(){var e=this;this._computeNextCWEdges(),this.edges.forEach(function(e){e.label=void 0}),this._findLabeledEdgeRings().forEach(function(r){e._findIntersectionNodes(r).forEach(function(i){e._computeNextCCWEdges(i,r.label)})});var r=[];return this.edges.forEach(function(i){i.ring||r.push(e._findEdgeRing(i))}),r},e8.prototype._findIntersectionNodes=function(e){var r=[],i=e;do!function(){var n=0;i.from.getOuterEdges().forEach(function(r){r.label===e.label&&++n}),n>1&&r.push(i.from),i=i.next}();while(!e.isEqual(i));return r},e8.prototype._findEdgeRing=function(e){var r=e,i=new e6;do i.push(r),r.ring=i,r=r.next;while(!e.isEqual(r));return i},e8.prototype.removeNode=function(e){var r=this;e.getOuterEdges().forEach(function(e){return r.removeEdge(e)}),e.innerEdges.forEach(function(e){return r.removeEdge(e)}),delete this.nodes[e.id]},e8.prototype.removeEdge=function(e){this.edges=this.edges.filter(function(r){return!r.isEqual(e)}),e.deleteEdge()},i(13449),i(21042),i(73862);var e7={search:function(e,r,i,n){e.cleanDirty();var o=(n=n||{}).heuristic||e7.heuristics.manhattan,a=n.closest||!1,s=new tr(function(e){return e.f}),l=r;for(r.h=o(r,i),s.push(r);s.size()>0;){var u=s.pop();if(u===i)return e9(u);u.closed=!0;for(var c=e.neighbors(u),h=0,p=c.length;h<p;++h){var d=c[h];if(!(d.closed||d.isWall())){var f=u.g+d.getCost(u),m=d.visited;(!m||f<d.g)&&(d.visited=!0,d.parent=u,d.h=d.h||o(d,i),d.g=f,d.f=d.g+d.h,e.markDirty(d),a&&(d.h<l.h||d.h===l.h&&d.g<l.g)&&(l=d),m?s.rescoreElement(d):s.push(d))}}}return a?e9(l):[]},heuristics:{manhattan:function(e,r){return Math.abs(r.x-e.x)+Math.abs(r.y-e.y)},diagonal:function(e,r){var i=Math.sqrt(2),n=Math.abs(r.x-e.x),o=Math.abs(r.y-e.y);return+(n+o)+(i-2)*Math.min(n,o)}},cleanNode:function(e){e.f=0,e.g=0,e.h=0,e.visited=!1,e.closed=!1,e.parent=null}};function te(e,r){r=r||{},this.nodes=[],this.diagonal=!!r.diagonal,this.grid=[];for(var i=0;i<e.length;i++){this.grid[i]=[];for(var n=0,o=e[i];n<o.length;n++){var a=new tt(i,n,o[n]);this.grid[i][n]=a,this.nodes.push(a)}}this.init()}function tt(e,r,i){this.x=e,this.y=r,this.weight=i}function tr(e){this.content=[],this.scoreFunction=e}function ti(){this._=null}function tn(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function to(e,r){var i=r.R,n=r.U;n?n.L===r?n.L=i:n.R=i:e._=i,i.U=n,r.U=i,r.R=i.L,r.R&&(r.R.U=r),i.L=r}function ta(e,r){var i=r.L,n=r.U;n?n.L===r?n.L=i:n.R=i:e._=i,i.U=n,r.U=i,r.L=i.R,r.L&&(r.L.U=r),i.R=r}function ts(e){for(;e.L;)e=e.L;return e}function tl(e,r,i,n){var o=[null,null],a=tX.push(o)-1;return o.left=e,o.right=r,i&&tc(o,e,r,i),n&&tc(o,r,e,n),tY[e.index].halfedges.push(a),tY[r.index].halfedges.push(a),o}function tu(e,r,i){var n=[r,i];return n.left=e,n}function tc(e,r,i,n){e[0]||e[1]?e.left===i?e[1]=n:e[0]=n:(e[0]=n,e.left=r,e.right=i)}function th(e,r){return r[+(r.left!==e.site)]}te.prototype.init=function(){this.dirtyNodes=[];for(var e=0;e<this.nodes.length;e++)e7.cleanNode(this.nodes[e])},te.prototype.cleanDirty=function(){for(var e=0;e<this.dirtyNodes.length;e++)e7.cleanNode(this.dirtyNodes[e]);this.dirtyNodes=[]},te.prototype.markDirty=function(e){this.dirtyNodes.push(e)},te.prototype.neighbors=function(e){var r=[],i=e.x,n=e.y,o=this.grid;return o[i-1]&&o[i-1][n]&&r.push(o[i-1][n]),o[i+1]&&o[i+1][n]&&r.push(o[i+1][n]),o[i]&&o[i][n-1]&&r.push(o[i][n-1]),o[i]&&o[i][n+1]&&r.push(o[i][n+1]),this.diagonal&&(o[i-1]&&o[i-1][n-1]&&r.push(o[i-1][n-1]),o[i+1]&&o[i+1][n-1]&&r.push(o[i+1][n-1]),o[i-1]&&o[i-1][n+1]&&r.push(o[i-1][n+1]),o[i+1]&&o[i+1][n+1]&&r.push(o[i+1][n+1])),r},te.prototype.toString=function(){for(var e,r,i,n,o=[],a=this.grid,s=0,l=a.length;s<l;s++){for(i=0,e=[],n=(r=a[s]).length;i<n;i++)e.push(r[i].weight);o.push(e.join(" "))}return o.join("\n")},tt.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},tt.prototype.getCost=function(e){return e&&e.x!==this.x&&e.y!==this.y?1.41421*this.weight:this.weight},tt.prototype.isWall=function(){return 0===this.weight},tr.prototype={push:function(e){this.content.push(e),this.sinkDown(this.content.length-1)},pop:function(){var e=this.content[0],r=this.content.pop();return this.content.length>0&&(this.content[0]=r,this.bubbleUp(0)),e},remove:function(e){var r=this.content.indexOf(e),i=this.content.pop();r!==this.content.length-1&&(this.content[r]=i,this.scoreFunction(i)<this.scoreFunction(e)?this.sinkDown(r):this.bubbleUp(r))},size:function(){return this.content.length},rescoreElement:function(e){this.sinkDown(this.content.indexOf(e))},sinkDown:function(e){for(var r=this.content[e];e>0;){var i=(e+1>>1)-1,n=this.content[i];if(this.scoreFunction(r)<this.scoreFunction(n))this.content[i]=r,this.content[e]=n,e=i;else break}},bubbleUp:function(e){for(var r=this.content.length,i=this.content[e],n=this.scoreFunction(i);;){var o,a=e+1<<1,s=a-1,l=null;if(s<r){var u=this.content[s];(o=this.scoreFunction(u))<n&&(l=s)}if(a<r){var c=this.content[a];this.scoreFunction(c)<(null===l?n:o)&&(l=a)}if(null!==l)this.content[e]=this.content[l],this.content[l]=i,e=l;else break}}},ti.prototype={constructor:ti,insert:function(e,r){var i,n,o;if(e){if(r.P=e,r.N=e.N,e.N&&(e.N.P=r),e.N=r,e.R){for(e=e.R;e.L;)e=e.L;e.L=r}else e.R=r;i=e}else this._?(e=ts(this._),r.P=null,r.N=e,e.P=e.L=r,i=e):(r.P=r.N=null,this._=r,i=null);for(r.L=r.R=null,r.U=i,r.C=!0,e=r;i&&i.C;)n=i.U,i===n.L?(o=n.R)&&o.C?(i.C=o.C=!1,n.C=!0,e=n):(e===i.R&&(to(this,i),i=(e=i).U),i.C=!1,n.C=!0,ta(this,n)):(o=n.L)&&o.C?(i.C=o.C=!1,n.C=!0,e=n):(e===i.L&&(ta(this,i),i=(e=i).U),i.C=!1,n.C=!0,to(this,n)),i=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var r,i,n,o=e.U,a=e.L,s=e.R;
113if(i=a?s?ts(s):a:s,o?o.L===e?o.L=i:o.R=i:this._=i,a&&s?(n=i.C,i.C=e.C,i.L=a,a.U=i,i!==s?(o=i.U,i.U=e.U,e=i.R,o.L=e,i.R=s,s.U=i):(i.U=o,o=i,e=i.R)):(n=e.C,e=i),e&&(e.U=o),!n){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===o.L){if((r=o.R).C&&(r.C=!1,o.C=!0,to(this,o),r=o.R),r.L&&r.L.C||r.R&&r.R.C){r.R&&r.R.C||(r.L.C=!1,r.C=!0,ta(this,r),r=o.R),r.C=o.C,o.C=r.R.C=!1,to(this,o),e=this._;break}}else if((r=o.L).C&&(r.C=!1,o.C=!0,ta(this,o),r=o.L),r.L&&r.L.C||r.R&&r.R.C){r.L&&r.L.C||(r.R.C=!1,r.C=!0,to(this,r),r=o.L),r.C=o.C,o.C=r.L.C=!1,ta(this,o),e=this._;break}r.C=!0,e=o,o=o.U}while(!e.C);e&&(e.C=!1)}}};var tp=[];function td(){tn(this),this.x=this.y=this.arc=this.site=this.cy=null}function tf(e){var r=e.P,i=e.N;if(r&&i){var n=r.site,o=e.site,a=i.site;if(n!==a){var s=o[0],l=o[1],u=n[0]-s,c=n[1]-l,h=a[0]-s,p=a[1]-l,d=2*(u*p-c*h);if(!(d>=-tb)){var f=u*u+c*c,m=h*h+p*p,g=(p*f-c*m)/d,_=(u*m-h*f)/d,y=tp.pop()||new td;y.arc=e,y.site=o,y.x=g+s,y.y=(y.cy=_+l)+Math.sqrt(g*g+_*_),e.circle=y;for(var v=null,x=tZ._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x)if(x.L)x=x.L;else{v=x.P;break}else if(x.R)x=x.R;else{v=x;break}tZ.insert(v,y),v||(t$=y)}}}}function tm(e){var r=e.circle;r&&(r.P||(t$=r.N),tZ.remove(r),tp.push(r),tn(r),e.circle=null)}var tg=[];function t_(){tn(this),this.edge=this.site=this.circle=null}function ty(e){var r=tg.pop()||new t_;return r.site=e,r}function tv(e){tm(e),tW.remove(e),tg.push(e),tn(e)}function tx(e,r){var i=e.site,n=i[0],o=i[1],a=o-r;if(!a)return n;var s=e.P;if(!s)return-1/0;var l=(i=s.site)[0],u=i[1],c=u-r;if(!c)return l;var h=l-n,p=1/a-1/c,d=h/c;return p?(-d+Math.sqrt(d*d-2*p*(h*h/(-2*c)-u+c/2+o-a/2)))/p+n:(n+l)/2}var tb=1e-12;function tw(e,r){return r[1]-e[1]||r[0]-e[0]}function tE(e,r){var i,n,o,a=e.sort(tw).pop();for(tX=[],tY=Array(e.length),tW=new ti,tZ=new ti;;)if(o=t$,a&&(!o||a[1]<o.y||a[1]===o.y&&a[0]<o.x))(a[0]!==i||a[1]!==n)&&(!function(e){for(var r,i,n,o,a=e[0],s=e[1],l=tW._;l;)if((n=tx(l,s)-a)>1e-6)l=l.L;else if((o=a-function(e,r){var i=e.N;if(i)return tx(i,r);var n=e.site;return n[1]===r?n[0]:1/0}(l,s))>1e-6){if(!l.R){r=l;break}l=l.R}else{n>-1e-6?(r=l.P,i=l):o>-1e-6?(r=l,i=l.N):r=i=l;break}tY[e.index]={site:e,halfedges:[]};var u=ty(e);if(tW.insert(r,u),r||i){if(r===i){tm(r),i=ty(r.site),tW.insert(u,i),u.edge=i.edge=tl(r.site,u.site),tf(r),tf(i);return}if(!i){u.edge=tl(r.site,u.site);return}tm(r),tm(i);var c=r.site,h=c[0],p=c[1],d=e[0]-h,f=e[1]-p,m=i.site,g=m[0]-h,_=m[1]-p,y=2*(d*_-f*g),v=d*d+f*f,x=g*g+_*_,b=[(_*v-f*x)/y+h,(d*x-g*v)/y+p];tc(i.edge,c,m,b),u.edge=tl(c,e,null,b),i.edge=tl(e,m,null,b),tf(r),tf(i)}}(a),i=a[0],n=a[1]),a=e.pop();else if(o)!function(e){var r=e.circle,i=r.x,n=r.cy,o=[i,n],a=e.P,s=e.N,l=[e];tv(e);for(var u=a;u.circle&&1e-6>Math.abs(i-u.circle.x)&&1e-6>Math.abs(n-u.circle.cy);)a=u.P,l.unshift(u),tv(u),u=a;l.unshift(u),tm(u);for(var c=s;c.circle&&1e-6>Math.abs(i-c.circle.x)&&1e-6>Math.abs(n-c.circle.cy);)s=c.N,l.push(c),tv(c),c=s;l.push(c),tm(c);var h,p=l.length;for(h=1;h<p;++h)c=l[h],u=l[h-1],tc(c.edge,u.site,c.site,o);u=l[0],(c=l[p-1]).edge=tl(u.site,c.site,null,o),tf(u),tf(c)}(o.arc);else break;if(!function(){for(var e,r,i,n,o=0,a=tY.length;o<a;++o)if((e=tY[o])&&(n=(r=e.halfedges).length)){var s=Array(n),l=Array(n);for(i=0;i<n;++i)s[i]=i,l[i]=function(e,r){var i=e.site,n=r.left,o=r.right;return(i===o&&(o=n,n=i),o)?Math.atan2(o[1]-n[1],o[0]-n[0]):(i===n?(n=r[1],o=r[0]):(n=r[0],o=r[1]),Math.atan2(n[0]-o[0],o[1]-n[1]))}(e,tX[r[i]]);for(s.sort(function(e,r){return l[r]-l[e]}),i=0;i<n;++i)l[i]=r[s[i]];for(i=0;i<n;++i)r[i]=l[i]}}(),r){for(var s,l=+r[0][0],u=+r[0][1],c=+r[1][0],h=+r[1][1],p=tX.length;p--;)(function(e,r,i,n,o){var a=e[1];if(a)return!0;var s,l,u=e[0],c=e.left,h=e.right,p=c[0],d=c[1],f=h[0],m=h[1],g=(p+f)/2;if(m===d){if(g<r||g>=n)return;if(p>f){if(u){if(u[1]>=o)return}else u=[g,i];a=[g,o]}else{if(u){if(u[1]<i)return}else u=[g,o];a=[g,i]}}else if(s=(p-f)/(m-d),l=(d+m)/2-s*g,s<-1||s>1)if(p>f){if(u){if(u[1]>=o)return}else u=[(i-l)/s,i];a=[(o-l)/s,o]}else{if(u){if(u[1]<i)return}else u=[(o-l)/s,o];a=[(i-l)/s,i]}else if(d<m){if(u){if(u[0]>=n)return}else u=[r,s*r+l];a=[n,s*n+l]}else{if(u){if(u[0]<r)return}else u=[n,s*n+l];a=[r,s*r+l]}return e[0]=u,e[1]=a,!0})(s=tX[p],l,u,c,h)&&function(e,r,i,n,o){var a,s=e[0],l=e[1],u=s[0],c=s[1],h=l[0],p=l[1],d=0,f=1,m=h-u,g=p-c;if(a=r-u,!m&&a>0)return;if(a/=m,m<0){if(a<d)return;a<f&&(f=a)}else if(m>0){if(a>f)return;a>d&&(d=a)}if(a=n-u,m||!(a<0)){if(a/=m,m<0){if(a>f)return;a>d&&(d=a)}else if(m>0){if(a<d)return;a<f&&(f=a)}if(a=i-c,g||!(a>0)){if(a/=g,g<0){if(a<d)return;a<f&&(f=a)}else if(g>0){if(a>f)return;a>d&&(d=a)}if(a=o-c,g||!(a<0)){if(a/=g,g<0){if(a>f)return;a>d&&(d=a)}else if(g>0){if(a<d)return;a<f&&(f=a)}return!(d>0)&&!(f<1)||(d>0&&(e[0]=[u+d*m,c+d*g]),f<1&&(e[1]=[u+f*m,c+f*g]),!0)}}}}(s,l,u,c,h)&&(Math.abs(s[0][0]-s[1][0])>1e-6||Math.abs(s[0][1]-s[1][1])>1e-6)||delete tX[p];!function(e,r,i,n){var o,a,s,l,u,c,h,p,d,f,m,g,_=tY.length,y=!0;for(o=0;o<_;++o)if(a=tY[o]){for(s=a.site,l=(u=a.halfedges).length;l--;)tX[u[l]]||u.splice(l,1);for(l=0,c=u.length;l<c;)v=a,m=(f=(x=tX[u[l]])[+(x.left===v.site)])[0],g=f[1],p=(h=th(a,tX[u[++l%c]]))[0],d=h[1],(Math.abs(m-p)>1e-6||Math.abs(g-d)>1e-6)&&(u.splice(l,0,tX.push(tu(s,f,1e-6>Math.abs(m-e)&&n-g>1e-6?[e,1e-6>Math.abs(p-e)?d:n]:1e-6>Math.abs(g-n)&&i-m>1e-6?[1e-6>Math.abs(d-n)?p:i,n]:1e-6>Math.abs(m-i)&&g-r>1e-6?[i,1e-6>Math.abs(p-i)?d:r]:1e-6>Math.abs(g-r)&&m-e>1e-6?[1e-6>Math.abs(d-r)?p:e,r]:null))-1),++c);c&&(y=!1)}if(y){var v,x,b,w,E,S=1/0;for(o=0,y=null;o<_;++o)(a=tY[o])&&(E=(b=(s=a.site)[0]-e)*b+(w=s[1]-r)*w)<S&&(S=E,y=a);if(y){var T=[e,r],I=[e,n],M=[i,n],C=[i,r];y.halfedges.push(tX.push(tu(s=y.site,T,I))-1,tX.push(tu(s,I,M))-1,tX.push(tu(s,M,C))-1,tX.push(tu(s,C,T))-1)}}for(o=0;o<_;++o)(a=tY[o])&&!a.halfedges.length&&delete tY[o]}(l,u,c,h)}this.edges=tX,this.cells=tY,tW=tZ=tX=tY=null}function tS(){return new tT}function tT(){this.reset()}tE.prototype={constructor:tE,polygons:function(){var e=this.edges;return this.cells.map(function(r){var i=r.halfedges.map(function(i){return th(r,e[i])});return i.data=r.site.data,i})},triangles:function(){var e=[],r=this.edges;
113return this.cells.forEach(function(i,n){if(s=(a=i.halfedges).length)for(var o,a,s,l,u=i.site,c=-1,h=r[a[s-1]],p=h.left===u?h.right:h.left;++c<s;)l=p,p=(h=r[a[c]]).left===u?h.right:h.left,l&&p&&n<l.index&&n<p.index&&0>(o=p,(u[0]-o[0])*(l[1]-u[1])-(u[0]-l[0])*(o[1]-u[1]))&&e.push([u.data,l.data,p.data])}),e},links:function(){return this.edges.filter(function(e){return e.right}).map(function(e){return{source:e.left.data,target:e.right.data}})},find:function(e,r,i){for(var n,o,a=this,s=a._found||0,l=a.cells.length;!(o=a.cells[s]);)if(++s>=l)return null;var u=e-o.site[0],c=r-o.site[1],h=u*u+c*c;do o=a.cells[n=s],s=null,o.halfedges.forEach(function(i){var n=a.edges[i],l=n.left;if(l!==o.site&&l||(l=n.right)){var u=e-l[0],c=r-l[1],p=u*u+c*c;p<h&&(h=p,s=l.index)}});while(null!==s);return a._found=n,null==i||h<=i*i?o.site:null}},i(90326),i(72445),tT.prototype={constructor:tT,reset:function(){this.s=this.t=0},add:function(e){tM(tI,e,this.t),tM(this,tI.s,this.s),this.s?this.t+=tI.t:this.s=tI.t},valueOf:function(){return this.s}};var tI=new tT;function tM(e,r,i){var n=e.s=r+i,o=n-r;e.t=r-(n-o)+(i-o)}var tC=Math.PI,tA=tC/2,tP=tC/4,tL=2*tC,tO=180/tC,tD=tC/180,tR=Math.abs,tk=Math.atan,tN=Math.atan2,tF=Math.cos,tz=Math.sin,tB=Math.sqrt;function tU(e){return e>1?tA:e<-1?-tA:Math.asin(e)}function tj(){}function tV(e,r){e&&tG.hasOwnProperty(e.type)&&tG[e.type](e,r)}var tG={Sphere:function(e,r){r.sphere()},Point:function(e,r){e=e.coordinates,r.point(e[0],e[1],e[2])},MultiPoint:function(e,r){for(var i=e.coordinates,n=-1,o=i.length;++n<o;)e=i[n],r.point(e[0],e[1],e[2])},LineString:function(e,r){tq(e.coordinates,r,0)},MultiLineString:function(e,r){for(var i=e.coordinates,n=-1,o=i.length;++n<o;)tq(i[n],r,0)},Polygon:function(e,r){tH(e.coordinates,r)},MultiPolygon:function(e,r){for(var i=e.coordinates,n=-1,o=i.length;++n<o;)tH(i[n],r)},GeometryCollection:function(e,r){for(var i=e.geometries,n=-1,o=i.length;++n<o;)tV(i[n],r)}};function tq(e,r,i){var n,o=-1,a=e.length-i;for(r.lineStart();++o<a;)n=e[o],r.point(n[0],n[1],n[2]);r.lineEnd()}function tH(e,r){var i=-1,n=e.length;for(r.polygonStart();++i<n;)tq(e[i],r,1);r.polygonEnd()}var t$,tW,tY,tZ,tX,tK,tQ,tJ,t0,t1,t2=tS(),t3=tS(),t5={point:tj,lineStart:tj,lineEnd:tj,polygonStart:function(){t2.reset(),t5.lineStart=t4,t5.lineEnd=t6},polygonEnd:function(){var e=+t2;t3.add(e<0?tL+e:e),this.lineStart=this.lineEnd=this.point=tj},sphere:function(){t3.add(tL)}};function t4(){t5.point=t8}function t6(){t9(tK,tQ)}function t8(e,r){t5.point=t9,tK=e,tQ=r,e*=tD,r*=tD,tJ=e,t0=tF(r=r/2+tP),t1=tz(r)}function t9(e,r){e*=tD,r*=tD;var i=e-tJ,n=i>=0?1:-1,o=n*i,a=tF(r=r/2+tP),s=tz(r),l=t1*s,u=t0*a+l*tF(o),c=l*n*tz(o);t2.add(tN(c,u)),tJ=e,t0=a,t1=s}function t7(e){var r=e[0],i=e[1],n=tF(i);return[n*tF(r),n*tz(r),tz(i)]}function re(e,r){return[e[1]*r[2]-e[2]*r[1],e[2]*r[0]-e[0]*r[2],e[0]*r[1]-e[1]*r[0]]}function rt(e){var r=tB(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=r,e[1]/=r,e[2]/=r}var rr,ri,rn,ro,ra,rs,rl,ru,rc,rh,rp=tS(),rd={point:rf,lineStart:rg,lineEnd:r_,polygonStart:function(){rd.point=ry,rd.lineStart=rv,rd.lineEnd=rx,rp.reset(),t5.polygonStart()},polygonEnd:function(){t5.polygonEnd(),rd.point=rf,rd.lineStart=rg,rd.lineEnd=r_,t2<0?(rr=-(rn=180),ri=-(ro=90)):rp>1e-6?ro=90:rp<-1e-6&&(ri=-90),rh[0]=rr,rh[1]=rn}};function rf(e,r){rc.push(rh=[rr=e,rn=e]),r<ri&&(ri=r),r>ro&&(ro=r)}function rm(e,r){var i=t7([e*tD,r*tD]);if(ru){var n=re(ru,i),o=re([n[1],-n[0],0],n);rt(o),o=[tN((a=o)[1],a[0]),tU(a[2])];var a,s,l=e-ra,u=l>0?1:-1,c=o[0]*tO*u,h=tR(l)>180;h^(u*ra<c&&c<u*e)?(s=o[1]*tO)>ro&&(ro=s):h^(u*ra<(c=(c+360)%360-180)&&c<u*e)?(s=-o[1]*tO)<ri&&(ri=s):(r<ri&&(ri=r),r>ro&&(ro=r)),h?e<ra?rb(rr,e)>rb(rr,rn)&&(rn=e):rb(e,rn)>rb(rr,rn)&&(rr=e):rn>=rr?(e<rr&&(rr=e),e>rn&&(rn=e)):e>ra?rb(rr,e)>rb(rr,rn)&&(rn=e):rb(e,rn)>rb(rr,rn)&&(rr=e)}else rc.push(rh=[rr=e,rn=e]);r<ri&&(ri=r),r>ro&&(ro=r),ru=i,ra=e}function rg(){rd.point=rm}function r_(){rh[0]=rr,rh[1]=rn,rd.point=rf,ru=null}function ry(e,r){if(ru){var i=e-ra;rp.add(tR(i)>180?i+(i>0?360:-360):i)}else rs=e,rl=r;t5.point(e,r),rm(e,r)}function rv(){t5.lineStart()}function rx(){ry(rs,rl),t5.lineEnd(),tR(rp)>1e-6&&(rr=-(rn=180)),rh[0]=rr,rh[1]=rn,ru=null}function rb(e,r){return(r-=e)<0?r+360:r}var rw={sphere:tj,point:rE,lineStart:rT,lineEnd:rC,polygonStart:function(){rw.lineStart=rA,rw.lineEnd=rP},polygonEnd:function(){rw.lineStart=rT,rw.lineEnd=rC}};function rE(e,r){e*=tD;var i=tF(r*=tD);
113rS(i*tF(e),i*tz(e),tz(r))}function rS(e,r,i){++rB,rj+=(e-rj)/rB,rV+=(r-rV)/rB,rG+=(i-rG)/rB}function rT(){rw.point=rI}function rI(e,r){e*=tD;var i=tF(r*=tD);rQ=i*tF(e),rJ=i*tz(e),r0=tz(r),rw.point=rM,rS(rQ,rJ,r0)}function rM(e,r){e*=tD;var i=tF(r*=tD),n=i*tF(e),o=i*tz(e),a=tz(r),s=tN(tB((s=rJ*a-r0*o)*s+(s=r0*n-rQ*a)*s+(s=rQ*o-rJ*n)*s),rQ*n+rJ*o+r0*a);rU+=s,rq+=s*(rQ+(rQ=n)),rH+=s*(rJ+(rJ=o)),r$+=s*(r0+(r0=a)),rS(rQ,rJ,r0)}function rC(){rw.point=rE}function rA(){rw.point=rL}function rP(){rO(rX,rK),rw.point=rE}function rL(e,r){rX=e,rK=r,e*=tD,r*=tD,rw.point=rO;var i=tF(r);rQ=i*tF(e),rJ=i*tz(e),r0=tz(r),rS(rQ,rJ,r0)}function rO(e,r){e*=tD;var i=tF(r*=tD),n=i*tF(e),o=i*tz(e),a=tz(r),s=rJ*a-r0*o,l=r0*n-rQ*a,u=rQ*o-rJ*n,c=tB(s*s+l*l+u*u),h=tU(c),p=c&&-h/c;rW+=p*s,rY+=p*l,rZ+=p*u,rU+=h,rq+=h*(rQ+(rQ=n)),rH+=h*(rJ+(rJ=o)),r$+=h*(r0+(r0=a)),rS(rQ,rJ,r0)}function rD(e,r){return[e>tC?e-tL:e<-tC?e+tL:e,r]}rD.invert=rD;function rR(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}var rk=(1===(rz=rR).length&&(rF=rz,rz=function(e,r){return rR(rF(e),r)}),{left:function(e,r,i,n){for(null==i&&(i=0),null==n&&(n=e.length);i<n;){var o=i+n>>>1;0>rz(e[o],r)?i=o+1:n=o}return i},right:function(e,r,i,n){for(null==i&&(i=0),null==n&&(n=e.length);i<n;){var o=i+n>>>1;rz(e[o],r)>0?n=o:i=o+1}return i}});rk.right,rk.left;var rN=Array.prototype;rN.slice,rN.map;tS();var rF,rz,rB,rU,rj,rV,rG,rq,rH,r$,rW,rY,rZ,rX,rK,rQ,rJ,r0,r1,r2,r3,r5=tS(),r4={sphere:tj,point:tj,lineStart:function(){r4.point=r8,r4.lineEnd=r6},lineEnd:tj,polygonStart:tj,polygonEnd:tj};function r6(){r4.point=r4.lineEnd=tj}function r8(e,r){e*=tD,r*=tD,r1=e,r2=tz(r),r3=tF(r),r4.point=r9}function r9(e,r){e*=tD;var i=tz(r*=tD),n=tF(r),o=tR(e-r1),a=tF(o),s=n*tz(o),l=r3*i-r2*n*a,u=r2*i+r3*n*a;r5.add(tN(tB(s*s+l*l),u)),r1=e,r2=i,r3=n}var r7,ie,it,ir,ii=tS(),io=tS(),ia={point:tj,lineStart:tj,lineEnd:tj,polygonStart:function(){ia.lineStart=is,ia.lineEnd=ic},polygonEnd:function(){ia.lineStart=ia.lineEnd=ia.point=tj,ii.add(tR(io)),io.reset()},result:function(){var e=ii/2;return ii.reset(),e}};function is(){ia.point=il}function il(e,r){ia.point=iu,r7=it=e,ie=ir=r}function iu(e,r){io.add(ir*e-it*r),it=e,ir=r}function ic(){iu(r7,ie)}var ih,ip,id,im,ig=0,i_=0,iy=0,iv=0,ix=0,ib=0,iw=0,iE=0,iS=0,iT={point:iI,lineStart:iM,lineEnd:iP,polygonStart:function(){iT.lineStart=iL,iT.lineEnd=iO},polygonEnd:function(){iT.point=iI,iT.lineStart=iM,iT.lineEnd=iP},result:function(){var e=iS?[iw/iS,iE/iS]:ib?[iv/ib,ix/ib]:iy?[ig/iy,i_/iy]:[NaN,NaN];return ig=i_=iy=iv=ix=ib=iw=iE=iS=0,e}};function iI(e,r){ig+=e,i_+=r,++iy}function iM(){iT.point=iC}function iC(e,r){iT.point=iA,iI(id=e,im=r)}function iA(e,r){var i=e-id,n=r-im,o=tB(i*i+n*n);iv+=o*(id+e)/2,ix+=o*(im+r)/2,ib+=o,iI(id=e,im=r)}function iP(){iT.point=iI}function iL(){iT.point=iD}function iO(){iR(ih,ip)}function iD(e,r){iT.point=iR,iI(ih=id=e,ip=im=r)}function iR(e,r){var i=e-id,n=r-im,o=tB(i*i+n*n);iv+=o*(id+e)/2,ix+=o*(im+r)/2,ib+=o,iw+=(o=im*e-id*r)*(id+e),iE+=o*(im+r),iS+=3*o,iI(id=e,im=r)}var ik,iN,iF,iz,iB,iU=tS(),ij={point:tj,lineStart:function(){ij.point=iV},lineEnd:function(){ik&&iG(iN,iF),ij.point=tj},polygonStart:function(){ik=!0},polygonEnd:function(){ik=null},result:function(){var e=+iU;return iU.reset(),e}};function iV(e,r){ij.point=iG,iN=iz=e,iF=iB=r}function iG(e,r){iz-=e,iB-=r,iU.add(tB(iz*iz+iB*iB)),iz=e,iB=r}function iq(){}function iH(e){return function(r,i){var n=tF(r),o=tF(i),a=e(n*o);return[a*o*tz(r),a*tz(i)]}}function i$(e){return function(r,i){var n=tB(r*r+i*i),o=e(n),a=tz(o);return[tN(r*a,n*tF(o)),tU(n&&i*a/n)]}}function iW(e,r){return[e,r]}iq.prototype={constructor:iq,point:function(e,r){this.stream.point(e,r)},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()}},tF(30*tD),iH(function(e){return tB(2/(1+e))}).invert=i$(function(e){return 2*tU(e/2)}),iH(function(e){var r;return(e=(r=e)>1?0:r<-1?tC:Math.acos(r))&&e/tz(e)}).invert=i$(function(e){return e}),iW.invert=iW,i$(tk),i$(tU),i$(function(e){return 2*tk(e)})}
113,43708:(e,r,i)=>{"use strict";var n=i(9426);e.exports=function(e){return!!e&&!!e.ownerDocument&&n(e)&&"IMG"===e.nodeName}},43791:(e,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=i(48708);function o(e,r,i){if(null!==e)for(var n,a,s,l,u,c,h,p,d=0,f=0,m=e.type,g="FeatureCollection"===m,_="Feature"===m,y=g?e.features.length:1,v=0;v<y;v++){u=(p=!!(h=g?e.features[v].geometry:_?e.geometry:e)&&"GeometryCollection"===h.type)?h.geometries.length:1;for(var x=0;x<u;x++){var b=0,w=0;if(null!==(l=p?h.geometries[x]:h)){c=l.coordinates;var E=l.type;switch(d=i&&("Polygon"===E||"MultiPolygon"===E)?1:0,E){case null:break;case"Point":if(!1===r(c,f,v,b,w))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(!1===r(c[n],f,v,b,w))return!1;f++,"MultiPoint"===E&&b++}"LineString"===E&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(a=0;a<c[n].length-d;a++){if(!1===r(c[n][a],f,v,b,w))return!1;f++}"MultiLineString"===E&&b++,"Polygon"===E&&w++}"Polygon"===E&&b++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(a=0,w=0;a<c[n].length;a++){for(s=0;s<c[n][a].length-d;s++){if(!1===r(c[n][a][s],f,v,b,w))return!1;f++}w++}b++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(!1===o(l.geometries[n],r,i))return!1;break;default:throw Error("Unknown Geometry Type")}}}}}function a(e,r){var i;switch(e.type){case"FeatureCollection":for(i=0;i<e.features.length&&!1!==r(e.features[i].properties,i);i++);break;case"Feature":r(e.properties,0)}}function s(e,r){if("Feature"===e.type)r(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length&&!1!==r(e.features[i],i);i++);}function l(e,r){var i,n,o,a,s,l,u,c,h,p,d=0,f="FeatureCollection"===e.type,m="Feature"===e.type,g=f?e.features.length:1;for(i=0;i<g;i++){for(l=f?e.features[i].geometry:m?e.geometry:e,c=f?e.features[i].properties:m?e.properties:{},h=f?e.features[i].bbox:m?e.bbox:void 0,p=f?e.features[i].id:m?e.id:void 0,s=(u=!!l&&"GeometryCollection"===l.type)?l.geometries.length:1,o=0;o<s;o++){if(null===(a=u?l.geometries[o]:l)){if(!1===r(null,d,c,h,p))return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===r(a,d,c,h,p))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===r(a.geometries[n],d,c,h,p))return!1;break;default:throw Error("Unknown Geometry Type")}}d++}}function u(e,r){l(e,function(e,i,o,a,s){var l,u=null===e?null:e.type;switch(u){case null:case"Point":case"LineString":case"Polygon":if(!1===r(n.feature(e,o,{bbox:a,id:s}),i,0))return!1;return}switch(u){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon"}for(var c=0;c<e.coordinates.length;c++){var h={type:l,coordinates:e.coordinates[c]};if(!1===r(n.feature(h,o),i,c))return!1}})}function c(e,r){u(e,function(e,i,a){var s,l=0;if(e.geometry){var u=e.geometry.type;if("Point"!==u&&"MultiPoint"!==u){var c=0,h=0,p=0;if(!1===o(e,function(o,u,d,f,m){if(void 0===s||i>c||f>h||m>p){s=o,c=i,h=f,p=m,l=0;return}if(!1===r(n.lineString([s,o],e.properties),i,a,m,l))return!1;l++,s=o}))return!1}}})}function h(e,r){if(!e)throw Error("geojson is required");u(e,function(e,i,o){if(null!==e.geometry){var a=e.geometry.type,s=e.geometry.coordinates;switch(a){case"LineString":if(!1===r(e,i,o,0,0))return!1;break;case"Polygon":for(var l=0;l<s.length;l++)if(!1===r(n.lineString(s[l],e.properties),i,o,l))return!1}}})}r.coordAll=function(e){var r=[];return o(e,function(e){r.push(e)}),r},r.coordEach=o,r.coordReduce=function(e,r,i,n){var a=i;return o(e,function(e,n,o,s,l){a=0===n&&void 0===i?e:r(a,e,n,o,s,l)},n),a},r.featureEach=s,r.featureReduce=function(e,r,i){var n=i;return s(e,function(e,o){n=0===o&&void 0===i?e:r(n,e,o)}),n},r.findPoint=function(e,r){if(r=r||{},!n.isObject(r))throw Error("options is invalid");var i,o=r.featureIndex||0,a=r.multiFeatureIndex||0,s=r.geometryIndex||0,l=r.coordIndex||0,u=r.properties;switch(e.type){case"FeatureCollection":o<0&&(o=e.features.length+o),u=u||e.features[o].properties,i=e.features[o].geometry;break;case"Feature":u=u||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;
113default:throw Error("geojson is invalid")}if(null===i)return null;var c=i.coordinates;switch(i.type){case"Point":return n.point(c,u,r);case"MultiPoint":return a<0&&(a=c.length+a),n.point(c[a],u,r);case"LineString":return l<0&&(l=c.length+l),n.point(c[l],u,r);case"Polygon":return s<0&&(s=c.length+s),l<0&&(l=c[s].length+l),n.point(c[s][l],u,r);case"MultiLineString":return a<0&&(a=c.length+a),l<0&&(l=c[a].length+l),n.point(c[a][l],u,r);case"MultiPolygon":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s),l<0&&(l=c[a][s].length-l),n.point(c[a][s][l],u,r)}throw Error("geojson is invalid")},r.findSegment=function(e,r){if(r=r||{},!n.isObject(r))throw Error("options is invalid");var i,o=r.featureIndex||0,a=r.multiFeatureIndex||0,s=r.geometryIndex||0,l=r.segmentIndex||0,u=r.properties;switch(e.type){case"FeatureCollection":o<0&&(o=e.features.length+o),u=u||e.features[o].properties,i=e.features[o].geometry;break;case"Feature":u=u||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;default:throw Error("geojson is invalid")}if(null===i)return null;var c=i.coordinates;switch(i.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=c.length+l-1),n.lineString([c[l],c[l+1]],u,r);case"Polygon":return s<0&&(s=c.length+s),l<0&&(l=c[s].length+l-1),n.lineString([c[s][l],c[s][l+1]],u,r);case"MultiLineString":return a<0&&(a=c.length+a),l<0&&(l=c[a].length+l-1),n.lineString([c[a][l],c[a][l+1]],u,r);case"MultiPolygon":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s),l<0&&(l=c[a][s].length-l-1),n.lineString([c[a][s][l],c[a][s][l+1]],u,r)}throw Error("geojson is invalid")},r.flattenEach=u,r.flattenReduce=function(e,r,i){var n=i;return u(e,function(e,o,a){n=0===o&&0===a&&void 0===i?e:r(n,e,o,a)}),n},r.geomEach=l,r.geomReduce=function(e,r,i){var n=i;return l(e,function(e,o,a,s,l){n=0===o&&void 0===i?e:r(n,e,o,a,s,l)}),n},r.lineEach=h,r.lineReduce=function(e,r,i){var n=i;return h(e,function(e,o,a,s){n=0===o&&void 0===i?e:r(n,e,o,a,s)}),n},r.propEach=a,r.propReduce=function(e,r,i){var n=i;return a(e,function(e,o){n=0===o&&void 0===i?e:r(n,e,o)}),n},r.segmentEach=c,r.segmentReduce=function(e,r,i){var n=i,o=!1;return c(e,function(e,a,s,l,u){n=!1===o&&void 0===i?e:r(n,e,a,s,l,u),o=!0}),n}},44094:e=>{"use strict";e.exports=function(e){if(void 0===(e=e||("u">typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(r){return e.body}}},44335:function(e){e.exports=function(){"use strict";function e(e,r,i){var n=e[r];e[r]=e[i],e[i]=n}function r(e,r){return e<r?-1:+(e>r)}var i=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(e,r){o(e,0,e.children.length,r,e)}function o(e,r,i,n,o){o||(o=d(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var s=r;s<i;s++){var l=e.children[s];a(o,e.leaf?n(l):l)}return o}function a(e,r){return e.minX=Math.min(e.minX,r.minX),e.minY=Math.min(e.minY,r.minY),e.maxX=Math.max(e.maxX,r.maxX),e.maxY=Math.max(e.maxY,r.maxY),e}function s(e,r){return e.minX-r.minX}function l(e,r){return e.minY-r.minY}function u(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function c(e){return e.maxX-e.minX+(e.maxY-e.minY)}function h(e,r){return e.minX<=r.minX&&e.minY<=r.minY&&r.maxX<=e.maxX&&r.maxY<=e.maxY}function p(e,r){return r.minX<=e.maxX&&r.minY<=e.maxY&&r.maxX>=e.minX&&r.maxY>=e.minY}function d(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(i,n,o,a,s){for(var l=[n,o];l.length;)if(!((o=l.pop())-(n=l.pop())<=a)){var u=n+Math.ceil((o-n)/a/2)*a;(function r(i,n,o,a,s){for(;a>o;){if(a-o>600){var l=a-o+1,u=n-o+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),d=Math.max(o,Math.floor(n-u*h/l+p)),f=Math.min(a,Math.floor(n+(l-u)*h/l+p));r(i,n,d,f,s)}var m=i[n],g=o,_=a;for(e(i,o,n),s(i[a],m)>0&&e(i,o,a);g<_;){for(e(i,g,_),g++,_--;0>s(i[g],m);)g++;for(;s(i[_],m)>0;)_--}0===s(i[o],m)?e(i,o,_):e(i,++_,a),_<=n&&(o=_+1),n<=_&&(a=_-1)}})(i,u,n||0,o||i.length-1,s||r),l.push(n,u,u,o)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(e){var r=this.data,i=[];if(!p(e,r))return i;for(var n=this.toBBox,o=[];r;){for(var a=0;a<r.children.length;a++){var s=r.children[a],l=r.leaf?n(s):s;p(e,l)&&(r.leaf?i.push(s):h(e,l)?this._all(s,i):o.push(s))}r=o.pop()}return i},i.prototype.collides=function(e){var r=this.data;if(!p(e,r))return!1;for(var i=[];r;){for(var n=0;n<r.children.length;n++){var o=r.children[n],a=r.leaf?this.toBBox(o):o;if(p(e,a)){if(r.leaf||h(e,a))return!0;
113i.push(o)}}r=i.pop()}return!1},i.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var r=0;r<e.length;r++)this.insert(e[r]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var n=this.data;this.data=i,i=n}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},i.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},i.prototype.clear=function(){return this.data=d([]),this},i.prototype.remove=function(e,r){if(!e)return this;for(var i,n,o,a=this.data,s=this.toBBox(e),l=[],u=[];a||l.length;){if(a||(a=l.pop(),n=l[l.length-1],i=u.pop(),o=!0),a.leaf){var c=function(e,r,i){if(!i)return r.indexOf(e);for(var n=0;n<r.length;n++)if(i(e,r[n]))return n;return -1}(e,a.children,r);if(-1!==c)return a.children.splice(c,1),l.push(a),this._condense(l),this}o||a.leaf||!h(a,s)?n?(i++,a=n.children[i],o=!1):a=null:(l.push(a),u.push(i),i=0,n=a,a=a.children[0])}return this},i.prototype.toBBox=function(e){return e},i.prototype.compareMinX=function(e,r){return e.minX-r.minX},i.prototype.compareMinY=function(e,r){return e.minY-r.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(e){return this.data=e,this},i.prototype._all=function(e,r){for(var i=[];e;)e.leaf?r.push.apply(r,e.children):i.push.apply(i,e.children),e=i.pop();return r},i.prototype._build=function(e,r,i,o){var a,s=i-r+1,l=this._maxEntries;if(s<=l)return n(a=d(e.slice(r,i+1)),this.toBBox),a;o||(o=Math.ceil(Math.log(s)/Math.log(l)),l=Math.ceil(s/Math.pow(l,o-1))),(a=d([])).leaf=!1,a.height=o;var u=Math.ceil(s/l),c=u*Math.ceil(Math.sqrt(l));f(e,r,i,c,this.compareMinX);for(var h=r;h<=i;h+=c){var p=Math.min(h+c-1,i);f(e,h,p,u,this.compareMinY);for(var m=h;m<=p;m+=u){var g=Math.min(m+u-1,p);a.children.push(this._build(e,m,g,o-1))}}return n(a,this.toBBox),a},i.prototype._chooseSubtree=function(e,r,i,n){for(;n.push(r),!r.leaf&&n.length-1!==i;){for(var o=1/0,a=1/0,s=void 0,l=0;l<r.children.length;l++){var c=r.children[l],h=u(c),p=(Math.max(c.maxX,e.maxX)-Math.min(c.minX,e.minX))*(Math.max(c.maxY,e.maxY)-Math.min(c.minY,e.minY))-h;p<a?(a=p,o=h<o?h:o,s=c):p===a&&h<o&&(o=h,s=c)}r=s||r.children[0]}return r},i.prototype._insert=function(e,r,i){var n=i?e:this.toBBox(e),o=[],s=this._chooseSubtree(n,this.data,r,o);for(s.children.push(e),a(s,n);r>=0&&o[r].children.length>this._maxEntries;)this._split(o,r),r--;this._adjustParentBBoxes(n,o,r)},i.prototype._split=function(e,r){var i=e[r],o=i.children.length,a=this._minEntries;this._chooseSplitAxis(i,a,o);var s=this._chooseSplitIndex(i,a,o),l=d(i.children.splice(s,i.children.length-s));l.height=i.height,l.leaf=i.leaf,n(i,this.toBBox),n(l,this.toBBox),r?e[r-1].children.push(l):this._splitRoot(i,l)},i.prototype._splitRoot=function(e,r){this.data=d([e,r]),this.data.height=e.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(e,r,i){for(var n,a,s,l,c,h=1/0,p=1/0,d=r;d<=i-r;d++){var f=o(e,0,d,this.toBBox),m=o(e,d,i,this.toBBox),g=(a=void 0,s=void 0,l=void 0,a=Math.max(f.minX,m.minX),s=Math.max(f.minY,m.minY),Math.max(0,(l=Math.min(f.maxX,m.maxX))-a)*Math.max(0,Math.min(f.maxY,m.maxY)-s)),_=u(f)+u(m);g<h?(h=g,n=d,p=_<p?_:p):g===h&&_<p&&(p=_,n=d)}return n||i-r},i.prototype._chooseSplitAxis=function(e,r,i){var n=e.leaf?this.compareMinX:s,o=e.leaf?this.compareMinY:l;this._allDistMargin(e,r,i,n)<this._allDistMargin(e,r,i,o)&&e.children.sort(n)},i.prototype._allDistMargin=function(e,r,i,n){e.children.sort(n);for(var s=this.toBBox,l=o(e,0,r,s),u=o(e,i-r,i,s),h=c(l)+c(u),p=r;p<i-r;p++){var d=e.children[p];a(l,e.leaf?s(d):d),h+=c(l)}for(var f=i-r-1;f>=r;f--){var m=e.children[f];a(u,e.leaf?s(m):m),h+=c(u)}return h},i.prototype._adjustParentBBoxes=function(e,r,i){for(var n=i;n>=0;n--)a(r[n],e)},i.prototype._condense=function(e){for(var r=e.length-1,i=void 0;r>=0;r--)0===e[r].children.length?r>0?(i=e[r-1].children).splice(i.indexOf(e[r]),1):this.clear():n(e[r],this.toBBox)},i}()},44510:(e,r,i)=>{"use strict";var n=i(87729),o=i(93710),a=i(15796),s=i(4821),l=(0,o.Map)(),u=s();function c(e,r){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+r+'" instead.')}var h={getLastCreatedEntityKey:function(){return c("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),h.__getLastCreatedEntityKey()},create:function(e,r,i){return c("DraftEntity.create","contentState.createEntity"),h.__create(e,r,i)},add:function(e){return c("DraftEntity.add","contentState.addEntity"),h.__add(e)},get:function(e){return c("DraftEntity.get","contentState.getEntity"),h.__get(e)},__getAll:function(){return l},__loadWithEntities:function(e){l=e,u=s()},mergeData:function(e,r){return c("DraftEntity.mergeData","contentState.mergeEntityData"),h.__mergeData(e,r)},replaceData:function(e,r){return c("DraftEntity.replaceData","contentState.replaceEntityData"),h.__replaceData(e,r)},__getLastCreatedEntityKey:function(){return u},__create:function(e,r,i){return h.__add(new n({type:e,mutability:r,data:i||{}}))},__add:function(e){return u=s(),l=l.set(u,e),u},__get:function(e){var r=l.get(e);return r||a(!1),r},__mergeData:function(e,r){var i=h.__get(e),n=function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}
113))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},i.getData(),r),o=i.set("data",n);return l=l.set(e,o),o},__replaceData:function(e,r){var i=h.__get(e).set("data",r);return l=l.set(e,i),i}};e.exports=h},44793:(e,r,i)=>{"use strict";var n=i(41822);function o(){return(o=n||function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function a(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){l(e,r,i[r])})}return e}function s(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}function u(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}var c=i(74011),h=i(98900),p=i(32538),d=i(27147),f=i(19558),m=i(25500),g=i(31180),_=i(45044),y=i(1289),v=i(18916),x=i(14232),b=i(38305),w=i(20109),E=i(39052),S=i(73239),T=i(58217),I=i(14147),M=i(56810),C=i(58240),A=i(15796),P=i(4833),L=i(12968),O=E.isBrowser("IE"),D=!O,R={edit:m,composite:p,drag:f,cut:null,render:null},k=!1,N=function(e){function r(){return e.apply(this,arguments)||this}u(r,e);var i=r.prototype;return i.render=function(){return null},i.componentDidMount=function(){this._update()},i.componentDidUpdate=function(){this._update()},i._update=function(){var e=this.props.editor;e._latestEditorState=this.props.editorState,e._blockSelectEvents=!0},r}(x.Component),F=function(e){function r(r){var i;return l(s(i=e.call(this,r)||this),"_blockSelectEvents",void 0),l(s(i),"_clipboard",void 0),l(s(i),"_handler",void 0),l(s(i),"_dragCount",void 0),l(s(i),"_internalDrag",void 0),l(s(i),"_editorKey",void 0),l(s(i),"_placeholderAccessibilityID",void 0),l(s(i),"_latestEditorState",void 0),l(s(i),"_latestCommittedEditorState",void 0),l(s(i),"_pendingStateFromBeforeInput",void 0),l(s(i),"_onBeforeInput",void 0),l(s(i),"_onBlur",void 0),l(s(i),"_onCharacterData",void 0),l(s(i),"_onCompositionEnd",void 0),l(s(i),"_onCompositionStart",void 0),l(s(i),"_onCopy",void 0),l(s(i),"_onCut",void 0),l(s(i),"_onDragEnd",void 0),l(s(i),"_onDragOver",void 0),l(s(i),"_onDragStart",void 0),l(s(i),"_onDrop",void 0),l(s(i),"_onInput",void 0),l(s(i),"_onFocus",void 0),l(s(i),"_onKeyDown",void 0),l(s(i),"_onKeyPress",void 0),l(s(i),"_onKeyUp",void 0),l(s(i),"_onMouseDown",void 0),l(s(i),"_onMouseUp",void 0),l(s(i),"_onPaste",void 0),l(s(i),"_onSelect",void 0),l(s(i),"editor",void 0),l(s(i),"editorContainer",void 0),l(s(i),"focus",void 0),l(s(i),"blur",void 0),l(s(i),"setMode",void 0),l(s(i),"exitCurrentMode",void 0),l(s(i),"restoreEditorDOM",void 0),l(s(i),"setClipboard",void 0),l(s(i),"getClipboard",void 0),l(s(i),"getEditorKey",void 0),l(s(i),"update",void 0),l(s(i),"onDragEnter",void 0),l(s(i),"onDragLeave",void 0),l(s(i),"_handleEditorContainerRef",function(e){i.editorContainer=e,i.editor=null!==e?e.firstChild:null}),l(s(i),"focus",function(e){var r=i.props.editorState,n=r.getSelection().getHasFocus(),o=i.editor;if(o){var a=w.getScrollParent(o),s=e||M(a),l=s.x,u=s.y;P(o)||A(!1),o.focus(),a===window?window.scrollTo(l,u):b.setTop(a,u),n||i.update(v.forceSelection(r,r.getSelection()))}}),l(s(i),"blur",function(){var e=i.editor;e&&(P(e)||A(!1),e.blur())}),l(s(i),"setMode",function(e){var r=i.props,n=r.onPaste,o=r.onCut,s=r.onCopy,l=a({},R.edit);n&&(l.onPaste=n),o&&(l.onCut=o),s&&(l.onCopy=s),i._handler=a({},R,{edit:l})[e]}),l(s(i),"exitCurrentMode",function(){i.setMode("edit")}),l(s(i),"restoreEditorDOM",function(e){i.setState({contentsKey:i.state.contentsKey+1},function(){i.focus(e)})}),l(s(i),"setClipboard",function(e){i._clipboard=e}),l(s(i),"getClipboard",function(){return i._clipboard}),l(s(i),"update",function(e){i._latestEditorState=e,i.props.onChange(e)}
vendor: 4,406 bytes, line 113
113),l(s(i),"onDragEnter",function(){i._dragCount++}),l(s(i),"onDragLeave",function(){i._dragCount--,0===i._dragCount&&i.exitCurrentMode()}),i._blockSelectEvents=!1,i._clipboard=null,i._handler=null,i._dragCount=0,i._editorKey=r.editorKey||T(),i._placeholderAccessibilityID="placeholder-"+i._editorKey,i._latestEditorState=r.editorState,i._latestCommittedEditorState=r.editorState,i._onBeforeInput=i._buildHandler("onBeforeInput"),i._onBlur=i._buildHandler("onBlur"),i._onCharacterData=i._buildHandler("onCharacterData"),i._onCompositionEnd=i._buildHandler("onCompositionEnd"),i._onCompositionStart=i._buildHandler("onCompositionStart"),i._onCopy=i._buildHandler("onCopy"),i._onCut=i._buildHandler("onCut"),i._onDragEnd=i._buildHandler("onDragEnd"),i._onDragOver=i._buildHandler("onDragOver"),i._onDragStart=i._buildHandler("onDragStart"),i._onDrop=i._buildHandler("onDrop"),i._onInput=i._buildHandler("onInput"),i._onFocus=i._buildHandler("onFocus"),i._onKeyDown=i._buildHandler("onKeyDown"),i._onKeyPress=i._buildHandler("onKeyPress"),i._onKeyUp=i._buildHandler("onKeyUp"),i._onMouseDown=i._buildHandler("onMouseDown"),i._onMouseUp=i._buildHandler("onMouseUp"),i._onPaste=i._buildHandler("onPaste"),i._onSelect=i._buildHandler("onSelect"),i.getEditorKey=function(){return i._editorKey},i.state={contentsKey:0},i}u(r,e);var n=r.prototype;return n._buildHandler=function(e){var r=this;return function(i){if(!r.props.readOnly){var n=r._handler&&r._handler[e];n&&(g?g(function(){return n(r,i)}):n(r,i))}}},n._showPlaceholder=function(){return!!this.props.placeholder&&!this.props.editorState.isInCompositionMode()&&!this.props.editorState.getCurrentContent().hasText()},n._renderPlaceholder=function(){if(this._showPlaceholder()){var e={text:L(this.props.placeholder),editorState:this.props.editorState,textAlignment:this.props.textAlignment,accessibilityID:this._placeholderAccessibilityID};return x.createElement(_,e)}return null},n._renderARIADescribedBy=function(){var e=this.props.ariaDescribedBy||"",r=this._showPlaceholder()?this._placeholderAccessibilityID:"";return e.replace("{{editor_id_placeholder}}",r)||void 0},n.render=function(){var e=this.props,r=e.blockRenderMap,i=e.blockRendererFn,n=e.blockStyleFn,s=e.customStyleFn,l=e.customStyleMap,u=e.editorState,c=e.preventScroll,p=e.readOnly,f=e.textAlignment,m=e.textDirectionality,g=S({"DraftEditor/root":!0,"DraftEditor/alignLeft":"left"===f,"DraftEditor/alignRight":"right"===f,"DraftEditor/alignCenter":"center"===f}),_=this.props.role||"textbox",y="combobox"===_?!!this.props.ariaExpanded:null,v={blockRenderMap:r,blockRendererFn:i,blockStyleFn:n,customStyleMap:a({},h,l),customStyleFn:s,editorKey:this._editorKey,editorState:u,preventScroll:c,textDirectionality:m};return x.createElement("div",{className:g},this._renderPlaceholder(),x.createElement("div",{className:S("DraftEditor/editorContainer"),ref:this._handleEditorContainerRef},x.createElement("div",{"aria-activedescendant":p?null:this.props.ariaActiveDescendantID,"aria-autocomplete":p?null:this.props.ariaAutoComplete,"aria-controls":p?null:this.props.ariaControls,"aria-describedby":this._renderARIADescribedBy(),"aria-expanded":p?null:y,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-multiline":this.props.ariaMultiline,"aria-owns":p?null:this.props.ariaOwneeID,autoCapitalize:this.props.autoCapitalize,autoComplete:this.props.autoComplete,autoCorrect:this.props.autoCorrect,className:S({notranslate:!p,"public/DraftEditor/content":!0}),contentEditable:!p,"data-testid":this.props.webDriverTestID,onBeforeInput:this._onBeforeInput,onBlur:this._onBlur,onCompositionEnd:this._onCompositionEnd,onCompositionStart:this._onCompositionStart,onCopy:this._onCopy,onCut:this._onCut,onDragEnd:this._onDragEnd,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this._onDragOver,onDragStart:this._onDragStart,onDrop:this._onDrop,onFocus:this._onFocus,onInput:this._onInput,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseUp:this._onMouseUp,onPaste:this._onPaste,onSelect:this._onSelect,ref:this.props.editorRef,role:p?null:_,spellCheck:D&&this.props.spellCheck,style:{outline:"none",userSelect:"text",WebkitUserSelect:"text",whiteSpace:"pre-wrap",wordWrap:"break-word"},suppressContentEditableWarning:!0,tabIndex:this.props.tabIndex},x.createElement(N,{editor:this,editorState:u}),x.createElement(d,o({}
113,v,{key:"contents"+this.state.contentsKey})))))},n.componentDidMount=function(){this._blockSelectEvents=!1,!k&&C("draft_ods_enabled")&&(k=!0,y.initODS()),this.setMode("edit"),O&&(this.editor?this.editor.ownerDocument.execCommand("AutoUrlDetect",!1,!1):i.g.execCommand("AutoUrlDetect",!1,!1))},n.componentDidUpdate=function(){this._blockSelectEvents=!1,this._latestEditorState=this.props.editorState,this._latestCommittedEditorState=this.props.editorState},r}(x.Component);l(F,"defaultProps",{ariaDescribedBy:"{{editor_id_placeholder}}",blockRenderMap:c,blockRendererFn:function(){return null},blockStyleFn:function(){return""},keyBindingFn:I,readOnly:!1,spellCheck:!1,stripPastedStyles:!1}),e.exports=F},44845:(e,r,i)=>{"use strict";i.d(r,{X:()=>p});var n=i(80856),o=i(22629),a=i(38960),s=i(97685),l=i(51877),u=i(11257),c=i(52075),h=i(23323);let p=(e,r,i,n,o,a,s)=>{setTimeout(d,1e4,e,r,i,n,o,a,s)},d=async(e,r,i,h,d,m,g)=>{let _;try{_=await f(e.toString(),i.project_uuid)}catch{return}if(h===n.iO.initial&&h!==_.status&&(0,l.Tt)(_.id.toString()+"-layer",r),_.status===n.iO.complete||h===n.iO.processing&&_.status===n.iO.initial){if(_.properties.hasLRS&&await (0,o.md)(g,i),(0,u.E3)(`${_.id}-layer`),(0,a.J3)(_.source)?(await (0,u.A1)(i.project_uuid,r,[_.id.toString()+"-layer"])).forEach(e=>{let i=`${e.layer_id}-layer`;r=(0,l.KI)(r,e.geojson,i,e.layer_properties.color,e.layer_properties.opacity,d,e.layer_properties.gradientData.property,e.layer_properties.gradientData.gradient1,e.layer_properties.gradientData.gradient2,e.layer_properties.gradientData.categorical,e.layer_properties.gradientData.categoricalOpacities,e.layer_properties.gradientData.gradientType,e.layer_properties.icon,"ProjectGIS"===e.scope,e.layer_properties.lineStyle,e.layer_properties.labelProperty,e.layer_properties.geojson_type||_.properties.geojson_type),(!1===_.properties.visible||"false"===_.properties.visible)&&(0,o.I2)(r,i,!1)}):(0,c.w6)(_,r,i),(0,o.$9)(_,m),_.status===n.iO.complete)return void s.Ay.success(`${_.source} layer added successfully`);s.Ay.success(`Initial data is available for ${_.source} layer`)}if(_.status===n.iO.failed){(0,o.$9)(_,m),s.Ay.error(`${_.source} layer failed to process`);return}p(e,r,i,_.status,d,m,g)};async function f(e,r){return await (0,h.x)(`/layer/${e}`,{method:"GET",params:{project_id:r}})}},45044:(e,r,i)=>{"use strict";var n=i(14232),o=i(73239);e.exports=function(e){function r(){return e.apply(this,arguments)||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.shouldComponentUpdate=function(e){return this.props.text!==e.text||this.props.editorState.getSelection().getHasFocus()!==e.editorState.getSelection().getHasFocus()},i.render=function(){var e=o({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/has
113Focus":this.props.editorState.getSelection().getHasFocus()});return n.createElement("div",{className:e},n.createElement("div",{className:o("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:{whiteSpace:"pre-wrap"}},this.props.text))},r}(n.Component)},45288:(e,r,i)=>{"use strict";function n(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}var o=i(14842),a=i(60620),s=i(18428),l=i(9912),u=i(44510),c=i(75269),h=i(58217),p=i(39667),d=i(58240),f=i(93710),m=i(62899),g=f.List,_=f.Record,y=f.Repeat,v=f.Map,x=f.OrderedMap,b=_({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),w=d("draft_tree_data_support")?l:s;e.exports=function(e){function r(){return e.apply(this,arguments)||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.getEntityMap=function(){return u},i.getBlockMap=function(){return this.get("blockMap")},i.getSelectionBefore=function(){return this.get("selectionBefore")},i.getSelectionAfter=function(){return this.get("selectionAfter")},i.getBlockForKey=function(e){return this.getBlockMap().get(e)},i.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil(function(r){return r===e}).skip(1).first()},i.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil(function(r){return r===e}).skip(1).first()},i.getBlockAfter=function(e){return this.getBlockMap().skipUntil(function(r,i){return i===e}).skip(1).first()},i.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil(function(r,i){return i===e}).skip(1).first()},i.getBlocksAsArray=function(){return this.getBlockMap().toArray()},i.getFirstBlock=function(){return this.getBlockMap().first()},i.getLastBlock=function(){return this.getBlockMap().last()},i.getPlainText=function(e){return this.getBlockMap().map(function(e){return e?e.getText():""}).join(e||"\n")},i.getLastCreatedEntityKey=function(){return u.__getLastCreatedEntityKey()},i.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},i.createEntity=function(e,r,i){return u.__create(e,r,i),this},i.mergeEntityData=function(e,r){return u.__mergeData(e,r),this},i.replaceEntityData=function(e,r){return u.__replaceData(e,r),this},i.addEntity=function(e){return u.__add(e),this},i.getEntity=function(e){return u.__get(e)},i.getAllEntities=function(){return u.__getAll()},i.loadWithEntities=function(e){return u.__loadWithEntities(e)},r.createFromBlockArray=function(e,i){var n=Array.isArray(e)?e:e.contentBlocks,a=o.createFromArray(n),s=a.isEmpty()?new c:c.createEmpty(a.first().getKey());return new r({blockMap:a,entityMap:i||u,selectionBefore:s,selectionAfter:s})},r.createFromText=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,n=e.split(i).map(function(e){return e=m(e),new w({key:h(),text:e,type:"unstyled",characterList:g(y(a.EMPTY,e.length))})});return r.createFromBlockArray(n)},r.fromJS=function(e){return new r(n({},e,{blockMap:x(e.blockMap).map(r.createContentBlockFromJS),selectionBefore:new c(e.selectionBefore),selectionAfter:new c(e.selectionAfter)}))},r.createContentBlockFromJS=function(e){var r=e.characterList;return new w(n({},e,{data:v(e.data),characterList:null!=r?g((Array.isArray(r)?r:p(r)).map(function(e){return a.fromJS(e)})):void 0}))},r}(b)},45525:(e,r,i)=>{"use strict";var n,o=i(52468),a=i(29351),s=i(5391),l=i(55502),u=i(72130),c=i(71742),h=i(65865),p=i(73305),d=i(2002),f=i(2496),m=i(41760),g=i(54366),_=i(42504),y=i(87962),v=i(80611),x=Function,b=function(e){try{return x('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=i(10221),E=i(98857),S=function(){throw new h},T=w?function(){try{return arguments.callee,S}catch(e){try{return w(arguments,"callee").get}catch(e){return S}}}():S,I=i(95295)(),M=i(34816),C=i(61664),A=i(86558),P=i(71938),L=i(66958),O={},D="u">typeof Uint8Array&&M?M(Uint8Array):n,R={__proto__:null,"%AggregateError%":"u"<typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"u"<typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":I&&M?M([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":"u"<typeof Atomics?n:Atomics,"%BigInt%":"u"<typeof BigInt?n:BigInt,"%BigInt64Array%":"u"<typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"u"<typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"u"<typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"u"<typeof Float16Array?n:Float16Array,"%Float32Array%":"u"<typeof Float32Array?n:Float32Array,"%Float64Array%":"u"<typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"u"<typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":O,"%Int8Array%":"u"<typeof Int8Array?n:Int8Array,"%Int16Array%":"u"<typeof Int16Array?n:Int16Array,"%Int32Array%":"u"<typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
113IteratorPrototype%":I&&M?M(M([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"u"<typeof Map?n:Map,"%MapIteratorPrototype%":"u">typeof Map&&I&&M?M(new Map()[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"u"<typeof Promise?n:Promise,"%Proxy%":"u"<typeof Proxy?n:Proxy,"%RangeError%":l,"%ReferenceError%":u,"%Reflect%":"u"<typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"u"<typeof Set?n:Set,"%SetIteratorPrototype%":"u">typeof Set&&I&&M?M(new Set()[Symbol.iterator]()):n,"%SharedArrayBuffer%":"u"<typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&M?M(""[Symbol.iterator]()):n,"%Symbol%":I?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":T,"%TypedArray%":D,"%TypeError%":h,"%Uint8Array%":"u"<typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"u"<typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"u"<typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"u"<typeof Uint32Array?n:Uint32Array,"%URIError%":p,"%WeakMap%":"u"<typeof WeakMap?n:WeakMap,"%WeakRef%":"u"<typeof WeakRef?n:WeakRef,"%WeakSet%":"u"<typeof WeakSet?n:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":P,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":C,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":m,"%Math.min%":g,"%Math.pow%":_,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":A};if(M)try{null.error}catch(e){var k=M(M(e));R["%Error.prototype%"]=k}var N=function e(r){var i;if("%AsyncFunction%"===r)i=b("async function () {}");else if("%GeneratorFunction%"===r)i=b("function* () {}");else if("%AsyncGeneratorFunction%"===r)i=b("async function* () {}");else if("%AsyncGenerator%"===r){var n=e("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=e("%AsyncGenerator%");o&&M&&(i=M(o.prototype))}return R[r]=i,i},F={__proto__:null,"%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"]},z=i(28419),B=i(71355),U=z.call(L,Array.prototype.concat),j=z.call(P,Array.prototype.splice),V=z.call(L,Str
113ing.prototype.replace),G=z.call(L,String.prototype.slice),q=z.call(L,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$=/\\(\\)?/g,W=function(e){var r=G(e,0,1),i=G(e,-1);if("%"===r&&"%"!==i)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==r)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return V(e,H,function(e,r,i,o){n[n.length]=i?V(o,$,"$1"):r||e}),n},Y=function(e,r){var i,n=e;if(B(F,n)&&(n="%"+(i=F[n])[0]+"%"),B(R,n)){var o=R[n];if(o===O&&(o=N(n)),void 0===o&&!r)throw new h("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,r){if("string"!=typeof e||0===e.length)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof r)throw new h('"allowMissing" argument must be a boolean');if(null===q(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=W(e),n=i.length>0?i[0]:"",o=Y("%"+n+"%",r),a=o.name,s=o.value,l=!1,u=o.alias;u&&(n=u[0],j(i,U([0,1],u)));for(var p=1,d=!0;p<i.length;p+=1){var f=i[p],m=G(f,0,1),g=G(f,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==f&&d||(l=!0),n+="."+f,B(R,a="%"+n+"%"))s=R[a];else if(null!=s){if(!(f in s)){if(!r)throw new h("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&p+1>=i.length){var _=w(s,f);s=(d=!!_)&&"get"in _&&!("originalValue"in _.get)?_.get:s[f]}else d=B(s,f),s=s[f];d&&!l&&(R[a]=s)}}return s}},45602:(e,r,i)=>{"use strict";i.d(r,{AP:()=>d,NG:()=>s,bj:()=>f,e_:()=>h,gh:()=>u,gl:()=>p,kj:()=>l,oD:()=>a,tP:()=>o,w2:()=>n});let n=["Polygon","LineString","Point"],o=e=>[e,`${e}-polygon`,`${e}-linestring`,`${e}-point`],a=e=>e.replace(/-(polygon|linestring|point)$/,""),s=e=>e?"Polygon"===e||"MultiPolygon"===e?"Polygon":"LineString"===e||"MultiLineString"===e?"LineString":"Point"===e||"MultiPoint"===e?"Point":null:null,l=(e,r)=>{let i=r;return e.endsWith("-polygon")?i="Polygon":e.endsWith("-linestring")?i="LineString":e.endsWith("-point")&&(i="Point"),s(i)??"Point"},u=(e,r)=>{if(!e.current.getLayer(r))return null;let i=e.current.getFilter(r),n=Object.entries(d).find(([,e])=>JSON.stringify(e)===JSON.stringify(i));return n?.[0]??null},c=e=>{let r=e?.geometry;if(r?.type!=="GeometryCollection"||!Array.isArray(r.geometries))return[e];let i=e?.id,n=e?.properties??{};return r.geometries.filter(Boolean).map((r,o)=>{let{properties:a,...s}=r;return{...e,id:null==i?void 0:`${i}-${o}`,geometry:s,properties:{...n,...a&&"object"==typeof a?a:{}}}})},h=e=>{if(!e||"object"!=typeof e)return{type:"FeatureCollection",features:[]};if("FeatureCollection"===e.type){let r=(e.features??[]).flatMap(e=>c(e));return{...e,type:"FeatureCollection",features:r}}return"Feature"===e.type?{type:"FeatureCollection",features:c(e)}:"GeometryCollection"===e.type?{type:"FeatureCollection",features:c({type:"Feature",geometry:e,properties:e.properties??{}})}:{type:"FeatureCollection",features:[{type:"Feature",geometry:e,properties:{}}]}},p=e=>{let r=new Set,i=e=>{if(!e||"object"!=typeof e)return;if("GeometryCollection"===e.type&&Array.isArray(e.geometries))return void e.geometries.forEach(e=>i(e));let n=s(e?.type);n&&r.add(n)};return(e?.features??[]).forEach(e=>{i(e?.geometry)}),r},d={Polygon:["any",["==",["geometry-type"],"Polygon"],["==",["geometry-type"],"MultiPolygon"]],LineString:["any",["==",["geometry-type"],"LineString"],["==",["geometry-type"],"MultiLineString"]],Point:["any",["==",["geometry-type"],"Point"],["==",["geometry-type"],"MultiPoint"]]},f=(e,r,i)=>r===i?e:`${e}-${r.toLowerCase()}`},45668:(e,r,i)=>{"use strict";var n=i(41822);function o(){return(o=n||function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}var a=i(86533),s=i(99297),l=i(14232),u=i(38305),c=i(20109),h=i(67129),p=i(9610),d=i(73239),f=i(27543),m=i(56810),g=i(16363),_=i(15796),y=i(4833),v=i(12968),x=function(e,r){return e.getAnchorKey()===r||e.getFocusKey()===r};e.exports=function(e){function r(){for(var r,i,n,o,a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return i=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r=e.call.apply(e,[this].concat(s))||this),o=void 0,(n="_node")in i?Object.defineProperty(i,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[n]=o,r}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.shouldComponentUpdate=function(e){return this.props.block!==e.block||this.props.tree!==e.tree||this.props.direction!==e.direction||x(e.selection,e.block.getKey())&&e.forceSelection},i.componentDidMount=function(){if(!this.props.preventScroll){var e,r=this.props.selection,i=r.getEndKey();if(r.getHasFocus()&&i===this.props.block.getKey()){var n=this._node;if(null!=n){var o=c.getScrollParent(n),a=m(o);if(o===window){var s=f(n);(e=s.y+s.height-g().height)>0&&window.scrollTo(a.x,a.y+e+10)}else y(n)||_(!1),(e=n.offsetHeight+n.offsetTop-(o.offsetTop+o.offsetHeight+a.y))>0&&u.setTop(o,u.getTop(o)+e+10)}}}},i._renderChildren=function(){var e=this,r=this.props.block,i=r.getKey(),n=r.getText(),u=this.props.tree.size-1,c=x(this.props.selection,i);return this.props.tree.map(function(d,f){var m=d.get("leaves");if(0===m.size)return null;var g=m.size-1,_=m.map(function(o,h){var p=s.encode(i,f,h),d=o.get("start"),m=o.get("end");return l.createElement(a,{key:p,offsetKey:p,block:r,start:d,selection:c?e.props.selection:null,forceSelection:e.props.forceSelection,text:n.slice(d,m),styleSet:r.getInlineStyleAt(d),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:f===u&&h===g})}).toArray(),y=d.get("decoratorKey");if(null==y||!e.props.decorator)return _;var x=v(e.props.decorator),b=x.getComponentForKey(y);if(!b)return _;var w=x.getPropsForKey(y),E=s.encode(i,f,0),S=m.first().get("start"),T=m.last().get("end"),I=n.slice(S,T),M=r.getEntityAt(d.get("start")),C=p.getHTMLDirIfDifferent(h.getDirection(I),e.props.direction),A={contentState:e.props.contentState,decoratedText:I,dir:C,start:S,end:T,blockKey:i,entityKey:M,offsetKey:E};return l.createElement(b,o({},w,A,{key:E}),_)}).toArray()},i.render=function(){var e=this,r=this.props,i=r.direction,n=r.offsetKey,o=d({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===i,"public/DraftStyleDefault/rtl":"RTL"===i});return l.createElement("div",{"data-offset-key":n,className:o,ref:function(r){return e._node=r}},this._renderChildren())},r}(l.Component)},45941:(e,r,i)=>{"use strict";var n=i(39636),o=i(18916),a=i(59356);e.exports=function(e){var r,i,s=e.getSelection();if(!s.isCollapsed())return e;var l=s.getAnchorOffset();if(0===l)return e;var u=s.getAnchorKey(),c=e.getCurrentContent(),h=c.getBlockForKey(u).getLength();if(h<=1)return e;l===h?(r=s.set("anchorOffset",l-1),i=s):i=(r=s.set("focusOffset",l+1)).set("anchorOffset",l+1);var p=a(c,r),d=n.removeRange(c,r,"backward"),f=d.getSelectionAfter(),m=f.getAnchorOffset()-1,g=f.merge({anchorOffset:m,focusOffset:m}),_=n.replaceWithFragment(d,g,p),y=o.push(e,_,"insert-fragment");return o.acceptSelection(y,i)}},46689:e=>{"use strict";var r=Object.prototype.hasOwnProperty;e.exports=function(e,i,n){if(!e)return null;var o={};for(var a in e)r.call(e,a)&&(o[a]=i.call(n,e[a],a,e));return o}},47054:(e,r,i)=>{"use strict";i.d(r,{IS:()=>h,Mv:()=>m,iF:()=>g,wb:()=>l,zU:()=>s});var n=i(85428),o=i(80856),a=i(22629);let s=["fbx","usdz","glb","gltf","obj","ply","note_upload"],l={[o.Zg.NORMAL]:[o.n6.NORMAL_ICON,o.n6.NORMAL_RED_DOT,o.n6.NORMAL_CLUSTER_TEXT,o.n6.NORMAL_CLUSTER_RED_DOT,o.n6.NORMAL_CLUSTER_CIRCLE],[o.Zg.THREE_D]:[o.n6.THREE_D_ICON,o.n6.THREE_D_RED_DOT,o.n6.THREE_D_CLUSTER_TEXT,o.n6.THREE_D_CLUSTER_RED_DOT,o.n6.THREE_D_CLUSTER_CIRCLE],[o.Zg.AI]:[o.n6.AI_ICON]},u=Object.entries(l).reduce((e,[r,i])=>(i.forEach(i=>
113{e[i]=r}),e),{}),c={[o.n6.NORMAL_ICON]:"note-label-layer",[o.n6.THREE_D_ICON]:"3dnote-label-layer",[o.n6.AI_ICON]:"ainote-label-layer",[o.n6.NORMAL_RED_DOT]:"note-label-layer",[o.n6.THREE_D_RED_DOT]:"3dnote-label-layer",[o.n6.NORMAL_CLUSTER_TEXT]:"note-label-layer",[o.n6.THREE_D_CLUSTER_TEXT]:"3dnote-label-layer",[o.n6.NORMAL_CLUSTER_RED_DOT]:"note-label-layer",[o.n6.THREE_D_CLUSTER_RED_DOT]:"3dnote-label-layer",[o.n6.NORMAL_CLUSTER_CIRCLE]:"note-label-layer",[o.n6.THREE_D_CLUSTER_CIRCLE]:"3dnote-label-layer"},h=[{id:"red-dot",imgUrl:"/images/red-dot.png"},{id:"custom-marker-3d",imgUrl:"/images/3d-note-marker.png"},{id:"custom-marker-3d-temp",imgUrl:"/images/3d-note-marker-temp.png"},{id:"custom-marker-3d-failed",imgUrl:"/images/3d-note-marker-failed.png"},{id:"scan-note-marker",imgUrl:"/images/scan-note-marker.png"}],p=e=>e===o.n6.NORMAL_ICON||e===o.n6.THREE_D_ICON||e===o.n6.AI_ICON,d=e=>e===o.n6.NORMAL_RED_DOT||e===o.n6.THREE_D_RED_DOT||e===o.n6.NORMAL_CLUSTER_RED_DOT||e===o.n6.THREE_D_CLUSTER_RED_DOT,f=e=>(0,a.YN)(u[e],(0,n.Ky)().project_uuid)?"visible":"none",m=(e,r)=>{switch(e){case o.Zg.NORMAL:case o.Zg.THREE_D:return{type:"geojson",data:r,cluster:!0,clusterProperties:{unread_count:["+",["length",["get","notification_ids"]]]}};case o.Zg.AI:return{type:"geojson",data:r};default:throw Error(`Invalid note source ID: ${e}`)}},g=e=>p(e)?{id:e,type:"symbol",source:u[e],layout:{...(e=>{if(!p(e))throw Error(`Invalid note icon layer ID: ${e}`);switch(e){case o.n6.NORMAL_ICON:return{"icon-image":["coalesce",["get","icon"],"1"],"icon-size":["case",["any",["==",["to-string",["get","icon"]],"1"],["==",["get","icon"],"1ai"],["has","point_count"]],.33,.35]};case o.n6.THREE_D_ICON:return{"icon-image":["match",["get","icon"],"custom-marker-3d","custom-marker-3d","custom-marker-3d-temp","custom-marker-3d-temp","custom-marker-3d-failed","custom-marker-3d-failed","scan-note-marker","scan-note-marker","custom-marker-3d"],"icon-size":["case",["==",["get","icon"],"scan-note-marker"],.082,.33]};case o.n6.AI_ICON:return{"icon-image":["coalesce",["get","icon"],"1"],"icon-size":.33};default:return{}}})(e),"icon-allow-overlap":!0,"text-field":(e=>{if(!p(e))throw Error(`Invalid note icon layer ID: ${e}`);return(0,a.YN)(c[e],(0,n.Ky)().project_uuid)?["get","title"]:""})(e),"text-size":12,"text-offset":[0,1.5],"text-anchor":"top",visibility:f(e)},paint:{"text-halo-color":"#FFFFFF","text-halo-width":2,"text-halo-blur":.5}}:d(e)?{id:e,type:"symbol",source:u[e],layout:{"icon-image":"red-dot","icon-size":.2,"icon-offset":[35,-35],"icon-allow-overlap":!0,"icon-ignore-placement":!0,visibility:f(e)},filter:(e=>{if(!d(e))throw Error(`Invalid note red dot layer ID: ${e}`);switch(e){case o.n6.NORMAL_RED_DOT:case o.n6.THREE_D_RED_DOT:return[">",["length",["get","notification_ids"]],0];case o.n6.NORMAL_CLUSTER_RED_DOT:case o.n6.THREE_D_CLUSTER_RED_DOT:return["all",["has","point_count"],[">",["get","unread_count"],0]];default:return[]}})(e)}:e===o.n6.NORMAL_CLUSTER_TEXT||e===o.n6.THREE_D_CLUSTER_TEXT?{id:e,type:"symbol",source:u[e],filter:["has","point_count"],layout:{"text-field":["get","point_count_abbreviated"],"text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12,"text-offset":[0,0],"icon-offset":[0,0],"icon-size":.9,"icon-allow-overlap":!0,visibility:f(e)}}:e===o.n6.NORMAL_CLUSTER_CIRCLE||e===o.n6.THREE_D_CLUSTER_CIRCLE?{id:e,type:"circle",source:u[e],filter:["has","point_count"],paint:{"circle-color":"#92bbfc","circle-radius":30,"circle-stroke-width":1,"circle-stroke-color":"#92bbfc","circle-opacity":.35},layout:{visibility:f(e)}}:void 0},47133:(e,r,i)=>{"use strict";i.d(r,{EX:()=>l,QS:()=>u,c3:()=>a,d8:()=>h,mb:()=>c,ox:()=>s});var n,o=i(80856);let a=o.S$.megabyte/2,s=600,l=32*o.S$.megabyte,u=8;var c=((n={}).DXF="DXF",n.GeoJSON="GeoJSON",n.GeoTiff="GeoTiff",n.ShapeFile="ShapeFile",n.WFS="WFS",n.WMS="WMS",n.WMTS="WMTS",n.Tours="Tours",n.ArcGIS="ArcGIS",n.IFC="IFC",n.Pointcloud="Pointcloud",n.CustomForm="CustomForm",n.KML="KML",n);let h={DXF:{displayName:"DXF",sourceType:"file",fileAccept:["dxf"],maxSizeBytes:0x40000000,isBeta:!0,labelSupport:!0,blobFilePath:"layers/"},GeoJSON:{displayName:"GeoJSON",sourceType:"file",fileAccept:["geojson","json"],maxSizeBytes:0x40000000,labelSupport:!0,blobFilePath:"layers/"},GeoTiff:{displayName:"GeoTiff",sourceType:"file",fileAccept:["tif","tiff"],maxSizeBytes:0x140000000,blobFilePath:"raster/"},ShapeFile:{displayName:"ShapeFile",sourceType:"file",fileAccept:["shp","shx","dbf","prj"],requiredFiles:4,allowMultiple:!0,maxSizeBytes:0x40000000,labelSupport:!0,blobFilePath:"layers/"},WFS:{displayName:"WFS",sourceType:"url",supportAuth:!0,isMultiLayerService:!0,labelSupport:!0},WMS:{displayName:"WMS",sourceType:"url",isMultiLayerService:!0}
113,WMTS:{displayName:"WMTS",sourceType:"url"},Tours:{displayName:"Tours",sourceType:"file",fileAccept:["zip","csv"],maxSizeBytes:0x280000000,isBeta:!0},ArcGIS:{displayName:"ArcGIS REST Servers",sourceType:"url",labelSupport:!0},IFC:{displayName:"IFC",sourceType:"file",fileAccept:["ifc","glb","gltf"],maxSizeBytes:0x3200000,isBeta:!0,blobFilePath:"layers/"},Pointcloud:{displayName:"LAS",sourceType:"file",fileAccept:["las","laz","e57"],maxSizeBytes:0xc80000000,isPointCloud:!0,blobFilePath:"lidar/raw/"},CustomForm:{displayName:"Custom Form",sourceType:"custom"},KML:{displayName:"KML",sourceType:"file",fileAccept:["kml"],maxSizeBytes:0x280000000,blobFilePath:"layers/",isBeta:!0,labelSupport:!0}}},48012:(e,r,i)=>{"use strict";function n(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var o=i(67129),a=i(9610),s=i(15796);e.exports=function(){function e(e){n(this,"_defaultDir",void 0),n(this,"_lastDir",void 0),e?a.isStrong(e)||s(!1):e=a.getGlobalDir(),this._defaultDir=e,this.reset()}var r=e.prototype;return r.reset=function(){this._lastDir=this._defaultDir},r.getDirection=function(e){return this._lastDir=o.getDirection(e,this._lastDir),this._lastDir},e}()},48708:(e,r)=>{"use strict";function i(e,r,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=r||{},n.geometry=e,n}function n(e,r,n){if(void 0===n&&(n={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!f(e[0])||!f(e[1]))throw Error("coordinates must contain numbers");return i({type:"Point",coordinates:e},r,n)}function o(e,r,n){void 0===n&&(n={});for(var o=0;o<e.length;o++){var a=e[o];if(a.length<4)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:e},r,n)}function a(e,r,n){if(void 0===n&&(n={}),e.length<2)throw Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:e},r,n)}function s(e,r){void 0===r&&(r={});var i={type:"FeatureCollection"};return r.id&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.features=e,i}function l(e,r,n){return void 0===n&&(n={}),i({type:"MultiLineString",coordinates:e},r,n)}function u(e,r,n){return void 0===n&&(n={}),i({type:"MultiPoint",coordinates:e},r,n)}function c(e,r,n){return void 0===n&&(n={}),i({type:"MultiPolygon",coordinates:e},r,n)}function h(e,i){void 0===i&&(i="kilometers");var n=r.factors[i];
113if(!n)throw Error(i+" units is invalid");return e*n}function p(e,i){void 0===i&&(i="kilometers");var n=r.factors[i];if(!n)throw Error(i+" units is invalid");return e/n}function d(e){return e%(2*Math.PI)*180/Math.PI}function f(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:1.0936*r.earthRadius},r.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/r.earthRadius,yards:1.0936133},r.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},r.feature=i,r.geometry=function(e,r,i){switch(void 0===i&&(i={}),e){case"Point":return n(r).geometry;case"LineString":return a(r).geometry;case"Polygon":return o(r).geometry;case"MultiPoint":return u(r).geometry;case"MultiLineString":return l(r).geometry;case"MultiPolygon":return c(r).geometry;default:throw Error(e+" is invalid")}},r.point=n,r.points=function(e,r,i){return void 0===i&&(i={}),s(e.map(function(e){return n(e,r)}),i)},r.polygon=o,r.polygons=function(e,r,i){return void 0===i&&(i={}),s(e.map(function(e){return o(e,r)}),i)},r.lineString=a,r.lineStrings=function(e,r,i){return void 0===i&&(i={}),s(e.map(function(e){return a(e,r)}),i)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=u,r.multiPolygon=c,r.geometryCollection=function(e,r,n){return void 0===n&&(n={}),i({type:"GeometryCollection",geometries:e},r,n)},r.round=function(e,r){if(void 0===r&&(r=0),r&&!(r>=0))throw Error("precision must be a positive number");var i=Math.pow(10,r||0);return Math.round(e*i)/i},r.radiansToLength=h,r.lengthToRadians=p,r.lengthToDegrees=function(e,r){return d(p(e,r))},r.bearingToAzimuth=function(e){var r=e%360;return r<0&&(r+=360),r},r.radiansToDegrees=d,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,r,i){if(void 0===r&&(r="kilometers"),void 0===i&&(i="kilometers"),!(e>=0))throw Error("length must be a positive number");return h(p(e,r),i)},r.convertArea=function(e,i,n){if(void 0===i&&(i="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw Error("area must be a positive number");var o=r.areaFactors[i];if(!o)throw Error("invalid original units");var a=r.areaFactors[n];if(!a)throw Error("invalid final units");return e/o*a},r.isNumber=f,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw Error("bbox is required");if(!Array.isArray(e))throw Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!f(e))throw Error("bbox must only contain numbers")})},r.validateId=function(e){if(!e)throw Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw Error("id must be a number or a string")}},48744:(e,r,i)=>{"use strict";var n=i(77785);e.exports=function(){return n()&&!!Symbol.toStringTag}},49292:(e,r,i)=>{"use strict";var n=i(16576).supportsDescriptors,o=i(30286),a=i(10221),s=Object.defineProperty,l=i(29351),u=i(34816),c=/a/;e.exports=function(){if(!n||!u)throw new l("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=o(),r=u(c),i=a(r,"flags");return i&&i.get===e||s(r,"flags",{configurable:!0,enumerable:!1,get:e}),e}},49949:e=>{function r(e,r,i,n){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(e,r,i,n)}r.prototype.run=function(e,r,i,n){this._init(e,r,i,n);for(var o=0;o<this._datasetLength;o++)if(1!==this._visited[o]){this._visited[o]=1;var a=this._regionQuery(o);if(a.length<this.minPts)this.noise.push(o);
113else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(o,s),this._expandCluster(s,a)}}return this.clusters},r.prototype._init=function(e,r,i,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this.noise=[],this._datasetLength=e.length,this._visited=Array(this._datasetLength),this._assigned=Array(this._datasetLength)}r&&(this.epsilon=r),i&&(this.minPts=i),n&&(this.distance=n)},r.prototype._expandCluster=function(e,r){for(var i=0;i<r.length;i++){var n=r[i];if(1!==this._visited[n]){this._visited[n]=1;var o=this._regionQuery(n);o.length>=this.minPts&&(r=this._mergeArrays(r,o))}1!==this._assigned[n]&&this._addToCluster(n,e)}},r.prototype._addToCluster=function(e,r){this.clusters[r].push(e),this._assigned[e]=1},r.prototype._regionQuery=function(e){for(var r=[],i=0;i<this._datasetLength;i++)this.distance(this.dataset[e],this.dataset[i])<this.epsilon&&r.push(i);return r},r.prototype._mergeArrays=function(e,r){for(var i=r.length,n=0;n<i;n++){var o=r[n];0>e.indexOf(o)&&e.push(o)}return e},r.prototype._euclideanDistance=function(e,r){for(var i=0,n=Math.min(e.length,r.length);n--;)i+=(e[n]-r[n])*(e[n]-r[n]);return Math.sqrt(i)},e.exports&&(e.exports=r)},50844:(e,r,i)=>{if(e.exports)var n=i(89989);function o(e,r,i,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(e,r,i,n)}o.prototype.run=function(e,r,i,o){this._init(e,r,i,o);for(var a=0,s=this.dataset.length;a<s;a++)if(1!==this._processed[a]){this._processed[a]=1,this.clusters.push([a]);
113var l=this.clusters.length-1;this._orderedList.push(a);var u=new n(null,null,"asc"),c=this._regionQuery(a);void 0!==this._distanceToCore(a)&&(this._updateQueue(a,c,u),this._expandCluster(l,u))}return this.clusters},o.prototype.getReachabilityPlot=function(){for(var e=[],r=0,i=this._orderedList.length;r<i;r++){var n=this._orderedList[r],o=this._reachability[n];e.push([n,o])}return e},o.prototype._init=function(e,r,i,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this._reachability=Array(this.dataset.length),this._processed=Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}r&&(this.epsilon=r),i&&(this.minPts=i),n&&(this.distance=n)},o.prototype._updateQueue=function(e,r,i){var n=this;this._coreDistance=this._distanceToCore(e),r.forEach(function(r){if(void 0===n._processed[r]){var o=n.distance(n.dataset[e],n.dataset[r]),a=Math.max(n._coreDistance,o);void 0===n._reachability[r]?(n._reachability[r]=a,i.insert(r,a)):a<n._reachability[r]&&(n._reachability[r]=a,i.remove(r),i.insert(r,a))}})},o.prototype._expandCluster=function(e,r){for(var i=r.getElements(),n=0,o=i.length;n<o;n++){var a=i[n];if(void 0===this._processed[a]){var s=this._regionQuery(a);this._processed[a]=1,this.clusters[e].push(a),this._orderedList.push(a),void 0!==this._distanceToCore(a)&&(this._updateQueue(a,s,r),this._expandCluster(e,r))}}},o.prototype._distanceToCore=function(e){for(var r=this.epsilon,i=0;i<r;i++)if(this._regionQuery(e,i).length>=this.minPts)return i},o.prototype._regionQuery=function(e,r){r=r||this.epsilon;for(var i=[],n=0,o=this.dataset.length;n<o;n++)this.distance(this.dataset[e],this.dataset[n])<r&&i.push(n);return i},o.prototype._euclideanDistance=function(e,r){for(var i=0,n=Math.min(e.length,r.length);n--;)i+=(e[n]-r[n])*(e[n]-r[n]);return Math.sqrt(i)},e.exports&&(e.exports=o)},50906:(e,r,i)=>{"use strict";function n(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var a=i(14232),s=i(39052),l=i(15796),u=i(9426),c=s.isBrowser("IE <= 11");e.exports=function(e){function r(r){var i;return o(n(i=e.call(this,r)||this),"_forceFlag",void 0),o(n(i),"_node",void 0),i._forceFlag=!1,i}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.shouldComponentUpdate=function(e){var r=this._node,i=""===e.children;return(u(r)||l(!1),i)?c?"\n"!==r.textContent:"BR"!==r.tagName:r.textContent!==e.children},i.componentDidMount=function(){this._forceFlag=!this._forceFlag},i.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},i.render=function(){var e,r,i=this;return""===this.props.children?this._forceFlag?(e=function(e){return i._node=e},c?a.createElement("span",{key:"A","data-text":"true",ref:e},"\n"):a.createElement("br",{key:"A","data-text":"true",ref:e})):(r=function(e){return i._node=e},c?a.createElement("span",{key:"B","data-text":"true",ref:r},"\n"):a.createElement("br",{key:"B","data-text":"true",ref:r})):a.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true",ref:function(e){return i._node=e}},this.props.children)},r}(a.Component)},51678:()=>{},51729:(e,r,i)=>{"use strict";i.d(r,{k5:()=>u});var n=i(14232),o={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=n.createContext&&n.createContext(o),s=function(){return(s=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)},l=function(e,r){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>r.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>r.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]]);return i};function u(e){return function(r){return n.createElement(c,s({attr:s({},e.attr)},r),function e(r){return r&&r.map(function(r,i){return n.createElement(r.tag,s({key:i},r.attr),e(r.child))})}(e.child))}}function c(e){var r=function(r){var i,o=e.attr,a=e.size,u=e.title,c=l(e,["attr","size","title"]),h=a||r.size||"1em";return r.className&&(i=r.className),e.className&&(i=(i?i+" ":"")+e.className),n.createElement("svg",s({stroke:"currentColor",fill:"
113currentColor",strokeWidth:"0"},r.attr,o,c,{className:i,style:s(s({color:e.color||r.color},r.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),u&&n.createElement("title",null,u),e.children)};return void 0!==a?n.createElement(a.Consumer,null,function(e){return r(e)}):r(o)}},51877:(e,r,i)=>{"use strict";i.d(r,{Cq:()=>N,JO:()=>x,KI:()=>y,M6:()=>L,N3:()=>M,P6:()=>F,Qo:()=>k,To:()=>A,Tt:()=>v,V9:()=>C,bh:()=>P,cM:()=>p,gS:()=>f,qE:()=>I,wk:()=>m,zK:()=>w});var n=i(84412),o=i(80856),a=i(11257),s=i(88321),l=i(45602);let u=!1,c=.5,h="null",p=e=>{if(null==e||""===e)return h;if("string"==typeof e){let r=e.trim();return""===r||r.toLowerCase()===h?h:r}return"number"==typeof e||"boolean"==typeof e?String(e):h},d=(e,r)=>{if(!r)return r;for(let i of e.features??[]){let e=i.properties??{},n=e[r];e[r]="string"==typeof n?p(n):n??null,i.properties=e}return r},f=e=>(Number.isFinite(e)?Math.min(100,Math.max(0,e)):0)/100*c,m=(e,r)=>{u||(e.current.on("click",(0,a.hC)(e,r)),e.current.on("touchend",(0,a.hC)(e,r)),u=!0)},g={"text-halo-color":"#FFFFFF","text-halo-width":2,"text-halo-blur":.5},_=(e,r,i,n,o,a,s)=>{let l={"text-field":["get",o],"text-size":12,"text-offset":[0,1],"text-anchor":"center","text-justify":"center","symbol-placement":"LineString"===a?"line-center":"point"},u=(e.current.getLayer(s)&&e.current.getLayoutProperty(s,"visibility"))??"visible";e.current.getLayer(r)?(Object.entries(l).forEach(([i,n])=>{e.current.setLayoutProperty(r,i,n)}),e.current.setLayoutProperty(r,"visibility",u),Object.entries(g).forEach(([i,n])=>{e.current.setPaintProperty(r,i,n)})):e.current.addLayer({id:r,type:"symbol",source:i,filter:n,layout:{...l,visibility:u},paint:g})},y=(e,r,i,n,a,c,h,p,g,y,b,S,I,M,C,A,O)=>{let R,k,z,B,U,j,V=r;return"string"!=typeof V&&(V=JSON.stringify(V)),v(i,e),k=d(R=(0,l.e_)(JSON.parse(V)),h),V=JSON.stringify(R),z=(0,l.gl)(R),(B=(0,l.NG)(String(O??"")))&&z.add(B),0===(U=l.w2.filter(e=>z.has(e))).length&&U.push(B??"Point"),j=U[0],e.current.getSource(i+"-source")||e.current.addSource(i+"-source",{type:"geojson",data:R,tolerance:1.25}),U.forEach(r=>{let u=(0,l.bj)(i,r,j),c=l.AP[r],{layerType:h,style:d}=((e,r,i,n,a,l,u,c,h,p,d,m,g)=>{let _=(a??100)/100,y=l?x(u,c,h,p,l,n,i):n;if("Polygon"===e)return{layerType:"fill",style:{"fill-color":y,"fill-opacity":p===o.nd.categorical&&l?F(m,l,a??100):f(a??100)}};if("LineString"===e)return{layerType:"line",style:{"line-color":y,"line-width":2,"line-gap-width":3*!!g,"line-opacity":l?N(m,l,a??100):_}};if(d){let e=w(d,s.w);return r.current.loadImage(d,(i,n)=>{if(i)throw i;r.current.hasImage(e)||r.current.addImage(e,n)}),{layerType:"symbol",style:{"icon-image":e,"icon-size":1,"icon-allow-overlap":!0,"icon-ignore-placement":!0}}}return{layerType:"circle",style:{"circle-color":y,"circle-radius":4,"circle-stroke-width":2,"circle-stroke-color":"transparent","circle-stroke-opacity":1,"circle-opacity":l?N(m,l,a??100):_}}})(r,e,V,n,a,k,p,g,y,S,I,b,M);e.current.getLayer(u)||e.current.addLayer({id:u,type:h,source:i+"-source",filter:c,...I&&"Point"===r?{layout:d}:{paint:d}}),A&&_(e,`${u}-vector-label`,`${i}-source`,c,A,r,u),"Polygon"===r?E(e,u,`${i}-source`,S===o.nd.categorical&&k?F(b,k,a??100):f(a??100)):"LineString"===r?T(e,u,C,`${i}-source`):I?L(e,u,`${i}-source`):P(e,u,`${i}-source`),D(e,u,"Point"===r,`${i}-source`)}),!u&&c&&m(e,c),e},v=(e,r)=>{r.current.getSource(`${e}-source`)&&((0,l.tP)(e).forEach(e=>{let i=O.get(e);i&&(i(),O.delete(e)),r.current.getLayer(e)&&r.current.removeLayer(e),r.current.getLayer(`${e}-halo`)&&r.current.removeLayer(`${e}-halo`),r.current.getLayer(`${e}-stroke`)&&r.current.removeLayer(`${e}-stroke`),r.current.getLayer(`${e}-vector-label`)&&r.current.removeLayer(`${e}-vector-label`)}),r.current.removeSource(`${e}-source`))},x=(e,r,i,n,a,s,u)=>{let c,d,f;if(n===o.nd.categorical)return k(i,a,s);let m=new Set,g=!1,_=[],y=(0,l.e_)(JSON.parse(u)),v=["any",["==",["get",a],null],["==",["get",a],""],["==",["downcase",["to-string",["get",a]]],"null"]];for(let e of y.features){let r=e.properties?.[a];p(r)!==h&&m.add(r)}if(0===m.size)return e;Array.from(m).every(e=>"number"==typeof e)?(g=!0,c=Array.from(m).sort((e,r)=>e-r)):c=Array.from(m).sort();let x=[...m=new Set(c)],w=0;if(g){if(d=Math.min(...x),0==(w=Math.max(...x)-d))return["case",v,r,e]}else if(c.length<=1)return["case",v,r,e];for(let i of m){let n=g?(i-d)/w:c.indexOf(i)/(c.length-1),o=Math.ceil(Number.parseInt(e.substring(1,3),16)*(1-n)+Number.parseInt(r.substring(1,3),16)*n),a=Math.ceil(Number.parseInt(e.substring(3,5),16)*(1-n)+Number.parseInt(r.substring(3,5),16)*n),s=Math.ceil(Number.parseInt(e.substring(5,7),16)*(1-n)+Number.parseInt(r.substring(5,7),16)*n),l=`#${b(o)}${b(a)}${b(s)}`;_.push(i,l)}if(g)f=["case",v,r,["!=",["typeof",["get",a]],"number"],e,["interpolate",["linear"],["get",a],..._]];else{let i=[];for(let e=0;e<_.length;e+=2)i.push(["==",["get",a],_[e]],_[e+1]);f=["case",v,r,...i,e]}return f},b=function(e){return 1==(e=e.toString(16)).length?"0"+e:e},w=(e,r)=>{let i=r.find(r=>r.image===e);return i?.title},E=(e,r,i,n=c)=>{e.current.setPaintProperty(r,"fill-opacity",["case",["boolean",["feature-state","hidden"],!1],0,["boolean",["feature-state","selected"],!1],1,n]);let o=`${r}-stroke`;e.current.getLayer(o)||e.current.addLayer({id:o,type:"line",source:i||`${r}-source`,filter:l.AP.Polygon,paint:{"line-color":"#FFFFFF","line-width":["case",["boolean",["feature-state","selected"],!1],2,1],"line-opacity":["case",["boolean",["feature-state","hidden"],!1],0,["boolean",["feature-state","selected"],!1],1,n]},layout:{"line-join":"round","line-cap":"round"}})},S=(e,r,i)=>{e.current.getLayer(r)&&((i===o.jV.ss||void 0===i||i===o.jV.ds)&&(e.current.setPaintProperty(r,"line-dasharray",null),e.current.setLayoutProperty(r,"line-cap",null),e.current.setLayoutProperty(r,"line-join",null),e.current.setPaintProperty(r,"line-gap-width",i===o.jV.ds?5:null)),i===o.jV.sda&&(e.current.setPaintProperty(r,"line-dasharray",[4,4]),e.current.setLayoutProperty(r,"line-cap",null),e.current.setLayoutProperty(r,"line-join",null),e.current.setPaintProperty(r,"line-gap-width",null)),i===o.jV.sdo&&(e.current.setPaintProperty(r,"line-dasharray",[.1,5]),e.current.setLayoutProperty(r,"line-cap","round"),e.current.setLayoutProperty(r,"line-join","round"),e.current.setPaintProperty(r,"line-gap-width",null)))},T=(e,r,i,n)=>{if(!e.current.getLayer(r))return;e.current.setPaintProperty(r,"line-width",["case",["boolean",["feature-state","hover"],!1],6,["boolean",["feature-state","selected"],!1],6,2]);let o=e.current.getPaintProperty(r,"line-opacity");e.current.setPaintProperty(r,"line-opacity",["case",["boolean",["feature-state","hidden"],!1],0,o??1]),S(e,r,i);let a=r+"-halo";e.current.getLayer(a)||e.current.addLayer({id:a,type:"line",source:n||r+"-source",filter:l.AP.LineString,paint:{"line-color":"#FFFFFF","line-width":["case",["boolean",["feature-state","hover"],!1],8,["boolean",["feature-state","selected"],!1],8,0],"line-opacity":["case",["boolean",["feature-state","hidden"],!1],0,.5]},layout:{"line-cap":"round","line-join":"round"}})},I=async(e,r,i,o)=>{let s,u=i.properties.gradientData,c=(0,l.tP)(i.id).filter(r=>e.current.getLayer(r)),h=r=>{let n=d(r,u.property);
113c.forEach(o=>{let a=e.current.getLayer(o)?.type;"symbol"!==a&&e.current.setPaintProperty(o,a+"-color",x(u.gradient1,u.gradient2,u.categorical,u.gradientType,n,i.properties.color,JSON.stringify(r)))})};if(o){h(o),e.current?.triggerRepaint?.();return}let p=(0,a.oD)(i.id);if(p.length>0){h({type:"FeatureCollection",features:p}),e.current?.triggerRepaint?.();return}try{let e=await fetch(n.oj+r.container_name+"/layers/"+i.file_path);if(!e.ok)return void console.warn("Skipping gradient refresh because the GeoJSON blob could not be fetched:",{status:e.status,statusText:e.statusText});let o=await e.text(),a=JSON.parse(o);if(!a||"object"!=typeof a||!Array.isArray(a.features))return void console.warn("Skipping gradient refresh because blob JSON is not a GeoJSON feature collection:",a);s=a}catch(e){console.warn("Skipping gradient refresh due to invalid blob response: ",e);return}h(s),e.current?.triggerRepaint?.()},M=(e,r,i=r.properties.lineStyle)=>{e.current&&((0,l.tP)(r.id).forEach(r=>{e.current.getLayer(r)?.type==="line"&&S(e,r,i)}),e.current.triggerRepaint())},C=(e,r)=>{let i=`${r.id}-source`;(0,l.tP)(r.id).forEach(n=>{let o=e.current.getLayer(n);if(!o)return;let a=o.type;"symbol"!==a&&(e.current.setPaintProperty(n,`${a}-color`,String(r?.properties.color)),r?.properties.lineStyle&&"line"===a&&T(e,n,r.properties.lineStyle,i))}),A(e,r.id,r?.properties?.labelProperty,r?.properties?.geojson_type,!1),e.current.triggerRepaint()},A=(e,r,i,n,o=!0)=>{let a=`${r}-source`,s="string"==typeof i&&i.trim().length>0;(0,l.tP)(r).forEach(r=>{if(!e.current.getLayer(r))return;let o=`${r}-vector-label`,u=(0,l.gh)(e,r)??(0,l.kj)(r,n),c=l.AP[u];if(!s){e.current.getLayer(o)&&e.current.removeLayer(o);return}_(e,o,a,c,i,u,r)}),o&&e.current.triggerRepaint()},P=(e,r,i)=>{let n=r+"-halo";e.current.getLayer(n)||e.current.addLayer({id:n,type:"circle",source:i||r+"-source",filter:l.AP.Point,paint:{"circle-radius":6,"circle-color":"transparent","circle-stroke-color":"transparent","circle-stroke-width":2,"circle-stroke-opacity":0}}),e.current.setPaintProperty(r,"circle-radius",["case",["boolean",["feature-state","hover"],!1],5,["boolean",["feature-state","selected"],!1],5,4]);let o=e.current.getPaintProperty(r,"circle-opacity");e.current.setPaintProperty(r,"circle-opacity",["case",["boolean",["feature-state","hidden"],!1],0,o??1]),e.current.setPaintProperty(`${r}-halo`,"circle-stroke-color",["case",["boolean",["feature-state","hover"],!1],"white",["boolean",["feature-state","selected"],!1],"white","transparent"])},L=(e,r,i)=>{let n=r+"-halo";e.current.getLayer(n)||e.current.addLayer({id:n,type:"circle",source:i||r+"-source",filter:l.AP.Point,paint:{"circle-radius":13,"circle-color":"transparent","circle-stroke-color":"transparent","circle-stroke-width":2,"circle-stroke-opacity":0}}),e.current.setPaintProperty(`${r}-halo`,"circle-stroke-color",["case",["boolean",["feature-state","hover"],!1],"yellow",["boolean",["feature-state","selected"],!1],"yellow","transparent"])},O=new Map,D=(e,r,i,n)=>{let o=null,a=null,s=!1,l=null,u=n||`${r}-source`,c=n=>{e.current.getCanvas().style.cursor="pointer";let c=n.features;if(!c||0===c.length)return;let h=c[0];h&&(o&&o!==h.id&&(e.current.setFeatureState({source:u,id:o},{hover:!1}),!s&&l&&(l(),l=null)),o=h.id,s||!i||a||(l=R(e,r)),e.current.setFeatureState({source:u,id:h.id},{hover:!0}))},h=()=>{e.current.getCanvas().style.cursor="auto",o&&(e.current.setFeatureState({source:u,id:o},{hover:!1}),o=null),!s&&l&&(l(),l=null)},p=n=>{if(!i)return;let o=n.features;if(!o||0===o.length)return;let l=o[0];l&&(s=!0,a=l.id,e.current.setFeatureState({source:u,id:l.id},{selected:!0}),R(e,r),s=!1)};e.current.on("mouseenter",r,c),e.current.on("mouseleave",r,h),e.current.on("click",r,p);let d=O.get(r);d&&d(),O.set(r,()=>{e.current.off("mouseenter",r,c),e.current.off("mouseleave",r,h),e.current.off("click",r,p),l&&(l(),l=null)})},R=(e,r)=>{let i=0,n=null,o=()=>{if(450==(i=(i+6)%3600)){null!==n&&(cancelAnimationFrame(n),n=null);return}let a=["interpolate",["linear"],["sin",i*Math.PI/180],-1,.2,1,.8];e.current.setPaintProperty(`${r}-halo`,"circle-stroke-opacity",["case",["boolean",["feature-state","hidden"],!1],0,["boolean",["feature-state","hover"],!1],a,["boolean",["feature-state","selected"],!1],a,0]),n=requestAnimationFrame(o)};return o(),()=>{null!==n&&(cancelAnimationFrame(n),n=null)}},k=(e,r,i)=>{let n=Object.keys(e).filter(e=>e!==h),o=e[h]??i,a=["any",["==",["get",r],null],["==",["get",r],""],["==",["downcase",["to-string",["get",r]]],"null"]];return 0===n.length?["case",a,o,i]:["case",a,o,["match",["to-string",["get",r]],...n.flatMap(r=>[r,e[r]]),i]]},N=(e,r,i)=>{let n=Object.keys(e??{}).filter(e=>e!==h),o=(e?.[h]??i)/100,a=["any",["==",["get",r],null],["==",["get",r],""],["==",["downcase",["to-string",["get",r]]],"null"]];return 0===n.length?["case",a,o,i/100]:["case",a,o,["match",["to-string",["get",r]],...n.flatMap(r=>[r,e[r]/100]),i/100]]},F=(e,r,i)=>{let n=Object.keys(e??{}).filter(e=>e!==h),o=f(e?.[h]??i),a=f(i),s=["any",["==",["get",r],null],["==",["get",r],""],["==",["downcase",["to-string",["get",r]]],"null"]];return 0===n.length?["case",s,o,a]:["case",s,o,["match",["to-string",["get",r]],...n.flatMap(r=>[r,f(e[r])]),a]]}},52075:(e,r,i)=>{"use strict";i.d(r,{w6:()=>I,HT:()=>A,oB:()=>w,k4:()=>E,hh:()=>C,r3:()=>T,hz:()=>b,C1:()=>M});var n=i(37876),o=i(84412),a=i(23323),s=i(22629),l=i(97685),u=i(38960),c=i(36531),h=i(85428),p=i(80856),d=i(44845),f=i(14232),m=i(29374);let g=({capabilities:e,create:r,layerChoice:i})=>{let{goBack:o}=(0,m.p)(),[a,s]=(0,f.useState)({}
113),l=e?.typeNames.length||0,u=Object.values(a).filter(Boolean).length,c=u===l&&l>0,h=0!==u&&!c,p=e=>{s(r=>({...r,[e]:!r[e]}))},d=()=>Object.entries(a).filter(([,e])=>!0===e).map(([e])=>e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"overflow-x-auto max-w-full",children:(0,n.jsxs)("table",{className:"table w-full table-fixed",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"text-left w-[85%]",children:"Layer Name"}),(0,n.jsx)("th",{className:"text-right w-[18%] align-middle",children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-2 float-right",children:[(0,n.jsx)("span",{children:"Include"}),(0,n.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:c,ref:e=>{e&&(e.indeterminate=h)},onChange:()=>{let r=!c;s(e.typeNames.reduce((e,i)=>(e[i]=r,e),{}))}})]})})]})}),(0,n.jsx)("tbody",{children:e.typeNames.map((e,r)=>(0,n.jsxs)("tr",{className:"hover cursor-pointer",onClick:()=>p(e),children:[(0,n.jsx)("td",{title:e,className:"text-left pr-2 break-words whitespace-normal",children:e}),(0,n.jsx)("td",{className:"text-right align-middle",children:(0,n.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:!!a[e],onClick:e=>e.stopPropagation(),onChange:()=>p(e)})})]},r))})]})}),(0,n.jsxs)("div",{className:"modal-action",children:[(0,n.jsx)("div",{className:"mt-2 flex flex-row gap-2 mr-2",onClick:o,children:(0,n.jsx)("label",{htmlFor:"add-layer-modal",className:"btn btn-outline",children:"Back"})}),(0,n.jsx)("button",{className:"btn tt-blue-button text-white mt-2",disabled:0===d().length,onClick:()=>{let n=d();switch(i){case"WFS":let a=JSON.parse(JSON.stringify(e));a.typeNames=n,r(a);break;case"WMTS":let s=[];n.forEach(r=>{let{url:i,lat:n,lon:o}=e?.layersMap[r];s.push({name:r,url:i,lat:n,lon:o})}),r(s);break;case"WMS":let{maxWidth:l,maxHeight:u,version:c,url:h,coordsMap:p}=e||{};r({maxWidth:l,maxHeight:u,version:c,url:h,layers:n,coordsMap:p})}o()},children:"Add Layers"})]})]})};var _=i(47133),y=i(51877),v=i(11257);let x=(e,r)=>{let i=r.replace(/\.(tif|tiff)$/i,""),n=`${e}:${i}`;return`${o.Rt}/gwc/service/wmts/rest/${encodeURIComponent(n)}/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=image/png`},b=async({layerType:e,refresh:r,body:i})=>{let n=(0,s.e3)(e,r),o=r?"PUT":"POST";return(await (0,a.x)(n,{method:o,json:i,rawResponse:!1})).data},w=async({body:e})=>(await (0,a.x)("/layer/create",{method:"POST",json:e})).data,E=async({layer:e,mapContext:r,layerContext:i,projectContext:n,layerType:a,refresh:c,onFeatureClick:h,setAvailableRoutes:f,featureType:m})=>{let g=[];if(Array.isArray(e))e.forEach(e=>{e.id=e.id.toString()+"-layer"}),g=[...i.customLayers,...e];else{if(e.id=e.id.toString()+"-layer","GeoTiff"==a){let i=x(`ws_${n.project?.project_uuid}`,e.file_path);r.map=await (0,s.Hu)(r.map,i,e.id.toString(),e.properties.opacity)}else"IFC"==a&&await fetch(o.oj+n.project?.container_name+"/layers/"+e.file_path);g=c?[...i.customLayers.map(r=>r.id===e.id?e:r)]:[...i.customLayers,e]}if((0,u.J3)(a)||a===_.mb.GeoTiff)(Array.isArray(e)?e.map(e=>e.id):[e.id]).forEach(e=>{(0,d.X)(e.replace("-layer",""),r.map,n.project,p.iO.processing,h,i.setCustomLayers,f)});else if((0,u.fR)(a))(Array.isArray(e)?e.map(e=>e.id):[e.id]).forEach(async e=>{(await (0,v.A1)(n.project.project_uuid,r.map,[e.toString()+"-layer"])).forEach(e=>{S(e,r,h,m)})});else if((0,u.wv)(a)){l.Ay.success("Layer added successfully");let i=Array.isArray(e)?e:[e];switch(a){case _.mb.WMS:await (0,s.I8)(r.map,i[0].source_url,i[0].id.toString(),i[0].properties.opacity);break;case _.mb.WMTS:await (0,s.WD)(r.map,i[0].source_url,i[0].id.toString(),i[0].properties.opacity)}}i.setCustomLayers(e=>Array.from(new Map([...e,...g].map(e=>[e.id,e])).values()))},S=async(e,r,i,n)=>{let o=`${e.layer_id}-layer`;r.map=(0,y.KI)(r.map,e.geojson,o,e.layer_properties.color,e.layer_properties.opacity,i,e.layer_properties.gradientData.property,e.layer_properties.gradientData.gradient1,e.layer_properties.gradientData.gradient2,e.layer_properties.gradientData.categorical,e.layer_properties.gradientData.categoricalOpacities,e.layer_properties.gradientData.gradientType,e.layer_properties.icon,"ProjectGIS"===e.scope,e.layer_properties.lineStyle,void 0,n)},T=async({mapContext:e,layerContext:r,customLayer:i,layerType:n,customLayerName:a,uploadingManager:f,closeAddCustomLayerPanel:m,setAddingLayerState:g,formData:y,refresh:b,onFeatureClick:w,setAvailableRoutes:E})=>{let S;g(!0);let T=(0,h.Ky)(),I=new c.A;(i&&i.length>0&&i[0].size>o.sS||(0,u.pA)(n))&&(S=(0,h.kX)(),f.addUploading({title:a,type:p.dP.layer,progress:0,id:S,worker:I,layerStatus:p.iO.processing}));let M=!1,C=!1;I.addEventListener("message",async i=>{let o,{type:c}=i.data,{percentCompleted:h,response:y,status:I}=i.data;switch((0,u.pA)(n)&&(o=(0,s.F0)(b?"refresh":"create",I)),y&&(void 0===y||"Invalid JSON response from server"===y||"error"===JSON.parse(y).status)&&(c="error"),c){case"progress":S?(M||(m(),g(!1),M=!0),f.updateUploading(S,{progress:h})):C||(l.Ay.success("Layer uploaded. Please wait until processing is complete",{duration:4e3}),C=!0);break;case"done":let A=JSON.parse(y).data,P=JSON.parse(y).failed||[];if(!A){l.Ay.error("Failed to upload layer"),S&&f.updateUploading(S,{progress:100,status:p.nW.error,message:o,title:P.length>0?`${P[0].error}: ${P[0].name.split(":").pop()}`:a});return}let L={},O=[];
113if(Array.isArray(A))A.forEach(e=>{e.id=e.id.toString()+"-layer",e.properties.zoomLocation&&(L={lat:e.properties.zoomLocation.long,lon:e.properties.zoomLocation.lat})}),O=[...r.customLayers,...A];else{if(A.id=A.id.toString()+"-layer",n===_.mb.GeoTiff){let r=x(`ws_${T?.project_uuid}`,A.file_path);e.map=await (0,s.Hu)(e.map,r,A.id.toString(),A.properties.opacity)}L={lat:A.properties.zoomLocation?.long||0,lon:A.properties.zoomLocation?.lat||0},b?((0,v.E3)(A.id),O=[...r.customLayers.map(e=>e.id===A.id?A:e)]):O=[...r.customLayers,A]}if(g(!1),M||(m(),M=!0),S){let e=207===I;f.updateUploading(S,{progress:100,status:e?p.nW.error:p.nW.upload_complete,coordinates:L,message:o,title:e?`Failed: ${P.map(e=>e.name.split(":").pop()).join(", ")}`:a})}if((0,u.J3)(n)||n===_.mb.GeoTiff)(Array.isArray(A)?A.map(e=>e.id):[A.id]).forEach(i=>{(0,d.X)(i.replace("-layer",""),e.map,T,p.iO.processing,w,r.setCustomLayers,E)});else if((0,u.wv)(n)){l.Ay.success("Layer added successfully");let r=Array.isArray(A)?A:[A];switch(n){case _.mb.WMS:await (0,s.I8)(e.map,r[0].source_url,r[0].id.toString(),r[0].properties.opacity);break;case _.mb.WMTS:await (0,s.WD)(e.map,r[0].source_url,r[0].id.toString(),r[0].properties.opacity)}}r.setCustomLayers(e=>Array.from(new Map([...e,...O].map(e=>[e.id,e])).values()));break;case"error":if(console.error("Request failed with status: "+I),g(!1),S)return void f.updateUploading(S,{progress:100,status:p.nW.error,message:o});l.Ay.error("Failed to upload layer")}}),console.log("IN HERE",y);let A=Array.from(y.entries());n===_.mb.CustomForm&&A.push(["customFormFields",'{"template":{"task_data":[{"id":"B3C95D87-C02D-4626-B826-138AFF243B3C","element":"Dropdown","text":"Dropdown","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"dropdown_7E5B5803-0AF8-4401-85FA-94A60CB6B972","label":"Place holder label","options":[{"value":"place_holder_option_1","text":"Place holder option 1","key":"dropdown_option_A10367CE-8EE1-49BE-9CD2-1640F271097E"},{"value":"place_holder_option_2","text":"Place holder option 2","key":"dropdown_option_E1CAAE10-52A7-4156-8B92-937FFBE5552E"},{"value":"place_holder_option_3","text":"Place holder option 3","key":"dropdown_option_940BBD6C-7808-4870-A942-183ECB032AE4"}]},{"id":"A8D44070-EA71-40BB-A2FC-F7C677894589","element":"Checkboxes","text":"Checkboxes","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"checkboxes_55AE22CE-83AD-4A56-B87C-5D48CF9C5307","label":"Place holder label","options":[{"value":"place_holder_option_1","text":"Place holder option 1","key":"checkboxes_option_EF1344AD-98BF-495A-A003-DA1B2FE5FDE0"},{"value":"place_holder_option_2","text":"Place holder option 2","key":"checkboxes_option_CAF8562D-CF87-442A-AC59-80BB2CECD81C"},{"value":"place_holder_option_3","text":"Place holder option 3","key":"checkboxes_option_EBC4D1E0-93DF-4D51-9543-303E258380DA"}]},{"id":"9242420B-2EFB-423F-A601-CC6253B0A243","element":"RadioButtons","text":"Multiple choice","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"radiobuttons_872D864C-40DA-4630-8719-09761407BEA2","label":"Place holder label","options":[{"value":"place_holder_option_1","text":"Place holder option 1","key":"radiobuttons_option_9C0AF78B-FE51-4673-88E3-915267C178F0"},{"value":"place_holder_option_2","text":"Place holder option 2","key":"radiobuttons_option_6A8F1CE6-2D77-4DBD-A0F3-DEB2F3DECC78"},{"value":"place_holder_option_3","text":"Place holder option 3","key":"radiobuttons_option_A866FE2E-4755-4C90-B2DD-EBFAF1CD42B8"}]},{"id":"E5E76349-4BE7-48EE-8649-0C7C177847C3","element":"TextInput","text":"Text input","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"text_input_8FE037F0-9872-409E-938A-0B9743C6E6C2","label":"Place holder label"},{"id":"72B39FE0-A958-418A-AEA8-0AF3A93750DA","element":"EmailInput","text":"Email input","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"email_input_E276DD26-FFA6-44B3-85D3-06E1B8940E3A","label":"Place holder email"},{"id":"4EAB301C-6CAA-4A5A-8786-EE6A4067464E","element":"NumberInput","text":"Number input","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"number_input_ADC3745F-6B67-46CB-A57F-9061C5114863","label":"Place holder label"},{"id":"729AFB1E-058F-4F2E-B13B-A3460A82F5E0","element":"PhoneNumber","text":"Phone number","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"phone_input_79D0619A-B4BE-4213-8A06-77131094247A","label":"Place holder phone number"},{"id":"C6F9ABA6-9B3C-497A-A189-553F046C7341","element":"TextArea","text":"Multi line input","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"text_area_08507641-D362-422C-B996-65E8F1A80C9F","label":"Place holder label"},{"id":"A5FBB2E3-F930-4681-B109-27CC75B0F0DD","element":"TwoColumnRow","text":"Two columns row","required":false,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"two_col_row_7748C077-1934-49E5-A6A1-9CC698C06D49","childItems":["F0583C21-1AE9-4E24-B0AD-83004E38A5A2","76E8AEAE-B08D-4AF1-94F5-D2B8DF4256E8"],"isContainer":true},{"id":"2830BD43-645D-490A-8841-1363921829D8","element":"Rating","text":"Rating","required":false,"canHaveAnswer":true,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"rating_DBDCBCF6-25B9-4D44-977A-EC964364FD09","label":"Place holder label"},{"id":"AB40BB75-E916-4A1D-8D3D-5E89730EED57","element":"DatePicker","text":"Date picker","required":false,"readOnly":false,"defaultToday":false,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"dateFormat":"MM/dd/yyyy","timeFormat":"hh:mm aa","showTimeSelect":false,"showTimeSelectOnly":false,"showTimeInput"
113:false,"field_name":"date_picker_3B996143-BA09-4F11-AFAB-671423703D81","label":"Place holder label"},{"id":"04DE50E6-9C73-41E4-82E5-252231B82301","element":"HyperLink","text":"Website","static":true,"required":false,"bold":false,"italic":false,"content":"Place holder website link","href":"http://www.example.com","canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true},{"id":"422B65D3-75CF-4B25-AD60-1711F04D1F9D","element":"Range","text":"Range","required":false,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"step":1,"default_value":3,"min_value":1,"max_value":5,"min_label":"Easy","max_label":"Difficult","field_name":"range_F35D577C-0FC7-44A3-8815-5DDC8E628688","label":"Place holder label"},{"id":"95BC95EC-DCD0-41FB-B95D-1ECFC8046E62","element":"FileUpload","text":"File upload","required":false,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"file_upload_3DD9C4CC-7992-4DEF-A849-33382B100AD5","label":"Place holder label"},{"id":"F0583C21-1AE9-4E24-B0AD-83004E38A5A2","element":"Range","text":"Range","required":false,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"step":1,"default_value":3,"min_value":1,"max_value":5,"min_label":"Easy","max_label":"Difficult","field_name":"range_FCED9F96-F107-42DF-8FFC-34DFD6C5922E","label":"Place holder label","col":0,"parentId":"A5FBB2E3-F930-4681-B109-27CC75B0F0DD","parentIndex":8},{"id":"76E8AEAE-B08D-4AF1-94F5-D2B8DF4256E8","element":"FileUpload","text":"File upload","required":false,"canHavePageBreakBefore":true,"canHaveAlternateForm":true,"canHaveDisplayHorizontal":true,"canHaveOptionCorrect":true,"canHaveOptionValue":true,"canPopulateFromApi":true,"field_name":"file_upload_4828D43C-8B3A-49BB-9DCD-1545183F6948","label":"Place holder label","col":1,"parentId":"A5FBB2E3-F930-4681-B109-27CC75B0F0DD","parentIndex":8}]}}']),console.log(A),I.postMessage({url:(0,s.e3)(n,b,!0),formDataObject:A,method:b?"PUT":"POST"})},I=async(e,r,i)=>{if((0,u.J3)(e.source)||(0,u.fR)(e.source))return;if(e.source==_.mb.WMS)r=await (0,s.I8)(r,e.source_url,`${e.id.toString()}-layer`,e.properties.opacity);else if(e.source==_.mb.WMTS)r=await (0,s.WD)(r,e.source_url,`${e.id.toString()}-layer`,e.properties.opacity);else if(e.source==_.mb.GeoTiff&&e.file_path){let n=x(`ws_${i.project_uuid}`,e.file_path);r=await (0,s.Hu)(r,n,`${e.id.toString()}-layer`,e.properties.opacity)}else e.source;let n=e.id.toString();r.current.setLayoutProperty(n.includes("-layer")?n:n+"-layer","visibility","true"===e.properties.visible||!0===e.properties.visible?"visible":"none")},M=(e,r,i,n,o,a,s)=>""!==e||(0,u.OT)(r)?(0,u.Lg)(r)&&!i?(l.Ay.error("Layer file is required"),!1):(0,u.Wl)(r)&&""===n?(l.Ay.error("Layer URL is required"),!1):r!==_.mb.Tours||o?(0,u.fR)(r)&&0===a.task_data.length?(l.Ay.error("Form cannot be empty"),!1):!(0,u.fR)(r)||!s||(l.Ay.error("Custom Form is invalid"),!1):(l.Ay.error("Tour CSV file is required"),!1):(l.Ay.error("Layer name is required"),!1),C=({layerType:e,integrationFile:r,ifcCoordinates:i,featureType:n,mapContext:o})=>{let a={color:(0,s.NP)(),symbol:"circle",visible:!0,opacity:100,gradientData:{}};if(e===_.mb.IFC&&r){let e=o.map.current?.queryTerrainElevation([i.lon,i.lat]);a={...a,ifcLat:i.lat??void 0,ifcLon:i.lon??void 0,ifcElevation:null!==e?e:0,ifcScale:1,ifcX:0,ifcY:0,ifcZ:0,zoomLocation:{lat:i?.lat??0,long:i?.lon??0}}}return(0,u.fR)(e)&&(a.geojson_type=n),a},A=async({layerType:e,layerUrl:r,username:i,password:o,body:a,pushSubPage:l,setUploading:u})=>{let c=async r=>await new Promise(i=>{l((0,n.jsx)(g,{capabilities:r,create:e=>i(e),layerChoice:e}),{title:`${e} Layer`})});if(e===_.mb.WFS){let e=await (0,s.TI)(r,i,o);if(!e)return u(!1),!1;u(!1);let n=await c(e);u(!0),(0,s.o0)(a,n)}if(e===_.mb.WMS){let e=await (0,s.cL)(r);if(!e)return u(!1),!1;u(!1),a.capabilities=await c(e),u(!0)}if(e===_.mb.WMTS){let e=await (0,s.W1)(r);if(!e)return u(!1),!1;u(!1),a.capabilities=await c(e),u(!0)}return e===_.mb.ArcGIS&&(a.url=r),!0}},52164:(e,r,i)=>{"use strict";var n=i(41822);function o(){return(o=n||function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function a(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}
113))),n.forEach(function(r){s(e,r,i[r])})}return e}function s(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}var l=i(13405),u=i(99297),c=i(14232),h=i(38305),p=i(20109),d=i(27543),f=i(56810),m=i(16363),g=i(93710),_=i(15796),y=i(4833);g.List;var v=function(e,r){return e.getAnchorKey()===r||e.getFocusKey()===r},x=function(e,r){var i=e.getNextSiblingKey();return!!i&&r.getBlockForKey(i).getType()===e.getType()},b=function(e,r,i){var n=[],o=!0,a=!1,s=void 0;try{for(var l,h=i.reverse()[Symbol.iterator]();!(o=(l=h.next()).done);o=!0){var p=l.value;if(p.type!==r)break;n.push(p)}}catch(e){a=!0,s=e}finally{try{o||null==h.return||h.return()}finally{if(a)throw s}}i.splice(i.indexOf(n[0]),n.length+1);var d=n.reverse(),f=d[0].key;return i.push(c.cloneElement(e,{key:"".concat(f,"-wrap"),"data-offset-key":u.encode(f,0,0)},d)),i},w=function(e,r){var i=r.get(e.getType())||r.get("unstyled"),n=i.wrapper;return{Element:i.element||r.get("unstyled").element,wrapperTemplate:n}},E=function(e,r){var i=r(e);return i?{CustomComponent:i.component,customProps:i.props,customEditable:i.editable}:{}},S=function(e,r,i,n,o,s){var l={"data-block":!0,"data-editor":r,"data-offset-key":i,key:e.getKey(),ref:s},u=n(e);return u&&(l.className=u),void 0!==o.customEditable&&(l=a({},l,{contentEditable:o.customEditable,suppressContentEditableWarning:!0})),l};e.exports=function(e){function r(){for(var r,i=arguments.length,n=Array(i),o=0;o<i;o++)n[o]=arguments[o];return s(function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r=e.call.apply(e,[this].concat(n))||this),"wrapperRef",c.createRef()),r}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.shouldComponentUpdate=function(e){var r=this.props,i=r.block,n=r.direction,o=r.tree,a=!i.getChildKeys().isEmpty(),s=i!==e.block||o!==e.tree||n!==e.direction||v(e.selection,e.block.getKey())&&e.forceSelection;return a||s},i.componentDidMount=function(){var e,r=this.props.selection,i=r.getEndKey();if(r.getHasFocus()&&i===this.props.block.getKey()){var n=this.wrapperRef.current;if(n){var o=p.getScrollParent(n),a=f(o);if(o===window){var s=d(n);(e=s.y+s.height-m().height)>0&&window.scrollTo(a.x,a.y+e+10)}else y(n)||_(!1),(e=n.offsetHeight+n.offsetTop-(o.offsetHeight+a.y))>0&&h.setTop(o,h.getTop(o)+e+10)}}},i.render=function(){var e=this,i=this.props,n=i.block,s=i.blockRenderMap,h=i.blockRendererFn,p=i.blockStyleFn,d=i.contentState,f=i.decorator,m=i.editorKey,g=i.editorState,_=i.customStyleFn,y=i.customStyleMap,T=i.direction,I=i.forceSelection,M=i.selection,C=i.tree,A=null;n.children.size&&(A=n.children.reduce(function(i,n){var o=u.encode(n,0,0),l=d.getBlockForKey(n),f=E(l,h),_=f.CustomComponent||r,y=w(l,s),v=y.Element,T=y.wrapperTemplate,I=S(l,m,o,p,f,null),M=a({},e.props,{tree:g.getBlockTree(n),blockProps:f.customProps,offsetKey:o,block:l});return i.push(c.createElement(v,I,c.createElement(_,M))),!T||x(l,d)||b(T,v,i),i},[]));var P=n.getKey(),L=u.encode(P,0,0),O=E(n,h),D=O.CustomComponent,R=null!=D?c.createElement(D,o({},this.props,{tree:g.getBlockTree(P),blockProps:O.customProps,offsetKey:L,block:n})):c.createElement(l,{block:n,children:A,contentState:d,customStyleFn:_,customStyleMap:y,decorator:f,direction:T,forceSelection:I,hasSelection:v(M,P),selection:M,tree:C});if(n.getParentKey())return R;var k=w(n,s).Element,N=S(n,m,L,p,O,this.wrapperRef);return c.createElement(k,N,R)},r}(c.Component)},52171:(e,r,i)=>{"use strict";function n(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}i.d(r,{A:()=>n})},52400:(e,r,i)=>{"use strict";var n=i(93710),o=i(5733),a=i(15796),s=n.Repeat;e.exports=function(e,r,i,n){r.isCollapsed()||a(!1);var l=null;if(null!=i&&(l=i.length),null==l||0===l)return e;var u=e.getBlockMap(),c=r.getStartKey(),h=r.getStartOffset(),p=u.get(c),d=p.getText(),f=p.merge({text:d.slice(0,h)+i+d.slice(h,p.getLength()),characterList:o(p.getCharacterList(),s(n,l).toList(),h)}),m=h+l;return e.merge({blockMap:u.set(c,f),selectionAfter:r.merge({anchorOffset:m,focusOffset:m})})}},52468:e=>{"use strict";e.exports=Object},52676:(e,r,i)=>{"use strict";var n=i(18916);e.exports=function(e,r,i){var o=n.undo(r);if("spellcheck-change"===r.getLastChangeType()){var a=o.getCurrentContent();i(n.set(o,{nativelyRenderedContent:a}));return}(e.preventDefault(),r.getNativelyRenderedContent())?(i(n.set(r,{nativelyRenderedContent:null})),setTimeout(function(){i(o)},0)):i(o)}},53506:(e,r,i)=>{"use strict";var n=i(1289),o=i(64754),a=i(39052),s=i(67605),l=i(44094),u=i(37525),c=i(15796),h=i(9426),p=a.isBrowser("IE");function d(e,r){for(var i=e,n=i;i;)if(h(i)&&n.hasAttribute("contenteditable"))return function(e,r){if(!e)return"[empty]";var i=function e(r,i){var n=void 0!==i?i(r):[];if(r.nodeType===Node.TEXT_NODE){var o=r.textContent.length;return u(r).createTextNode("[text "+o+(n.length?" | "+n.join(", "):"")+"]")}var a=r.cloneNode();1===a.nodeType&&n.length&&a.setAttribute("data-labels",n.join(", "));for(var s=r.childNodes,l=0;l<s.length;l++)a.appendChild(e(s[l],i));return a}(e,r);return i.nodeType===Node.TEXT_NODE?i.textContent:(h(i)||c(!1),i.outerHTML)}(i,r);else n=i=i.parentNode;return"Could not find contentEditable parent of node"}
113function f(e){return null===e.nodeValue?e.childNodes.length:e.nodeValue.length}function m(e,r,i,n){var a=l();if(e.extend&&null!=r&&s(a,r)){i>f(r)&&o.logSelectionStateFailure({anonymizedDom:d(r),extraParams:JSON.stringify({offset:i}),selectionState:JSON.stringify(n.toJS())});var u=r===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(r,i)}catch(s){throw o.logSelectionStateFailure({anonymizedDom:d(r,function(r){var i=[];return r===a&&i.push("active element"),r===e.anchorNode&&i.push("selection anchor node"),r===e.focusNode&&i.push("selection focus node"),i}),extraParams:JSON.stringify({activeElementName:a?a.nodeName:null,nodeIsFocus:r===e.focusNode,nodeWasFocus:u,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:s?""+s:null,offset:i},null,2),selectionState:JSON.stringify(n.toJS(),null,2)}),s}}else if(r&&e.rangeCount>0){var c=e.getRangeAt(0);c.setEnd(r,i),e.addRange(c.cloneRange())}}function g(e,r,i,a){var s=u(r).createRange();if(i>f(r)&&(o.logSelectionStateFailure({anonymizedDom:d(r),extraParams:JSON.stringify({offset:i}),selectionState:JSON.stringify(a.toJS())}),n.handleExtensionCausedError()),s.setStart(r,i),p)try{e.addRange(s)}catch(e){}else e.addRange(s)}e.exports={setDraftEditorSelection:function(e,r,i,n,o){var a=u(r);if(s(a.documentElement,r)){var l=a.defaultView.getSelection(),c=e.getAnchorKey(),h=e.getAnchorOffset(),p=e.getFocusKey(),d=e.getFocusOffset(),f=e.getIsBackward();if(!l.extend&&f){var _=c,y=h;c=p,h=d,p=_,d=y,f=!1}var v=c===i&&n<=h&&o>=h,x=p===i&&n<=d&&o>=d;if(v&&x){l.removeAllRanges(),g(l,r,h-n,e),m(l,r,d-n,e);return}if(f){if(x&&(l.removeAllRanges(),g(l,r,d-n,e)),v){var b=l.focusNode,w=l.focusOffset;l.removeAllRanges(),g(l,r,h-n,e),m(l,b,w,e)}}else v&&(l.removeAllRanges(),g(l,r,h-n,e)),x&&m(l,r,d-n,e)}},addFocusToSelection:m}},53669:(e,r,i)=>{"use strict";i.d(r,{F:()=>c,u:()=>u});var n=i(37876),o=i(14232),a=i(43299),s=i(63797);let l=(0,o.createContext)(null);function u({children:e}){let[r,i]=(0,o.useState)(!1),{drawingGeojson:c}=(0,s.g)(),{areaInSquareMeters:h,distanceInCentimeters:p}=(0,o.useMemo)(()=>{let e=c?.features??[];if(0===e.length)return{areaInSquareMeters:0,distanceInCentimeters:0};let r=e[0],i=a.Wcw(r),n=a.Bw9(r,{units:"centimeters"});return{areaInSquareMeters:Number.isFinite(i)?Number(i.toFixed(2)):0,distanceInCentimeters:Number.isFinite(n)?Number(n.toFixed(2)):0}},[c]);return(0,n.jsx)(l.Provider,{value:{elevationMeasurementEnabled:r,setElevationMeasurementEnabled:i,areaInSquareMeters:h,distanceInCentimeters:p},children:e})}function c(){let e=(0,o.useContext)(l);if(!e)throw Error("useMeasurementContext must be used within a MeasurementProvider");return e}},54366:e=>{"use strict";e.exports=Math.min},54380:(e,r,i)=>{"use strict";i(23588),e.exports=function(e,r){var i,n=e.getSelection(),o=n.getStartKey(),a=n.getStartOffset(),s=e.getCurrentContent(),l=o;return r>s.getBlockForKey(o).getText().length-a?(l=s.getKeyAfter(o),i=0):i=a+r,n.merge({focusKey:l,focusOffset:i})}},54780:(e,r,i)=>{"use strict";var n=i(15796),o=/[\uD800-\uDFFF]/;function a(e){return 55296<=e&&e<=57343}function s(e){return o.test(e)}function l(e,r){return 1+a(e.charCodeAt(r))}function u(e,r,i){if(r=r||0,i=void 0===i?1/0:i||0,!s(e))return e.substr(r,i);var n=e.length;if(n<=0||r>n||i<=0)return"";var o=0;if(r>0){for(;r>0&&o<n;r--)o+=l(e,o);if(o>=n)return""}else if(r<0){for(o=n;r<0&&0<o;r++)o-=l(e,o-1);o<0&&(o=0)}var a=n;if(i<n)for(a=o;i>0&&a<n;i--)a+=l(e,a);return e.substring(o,a)}e.exports={getCodePoints:function(e){for(var r=[],i=0;i<e.length;i+=l(e,i))r.push(e.codePointAt(i));return r},getUTF16Length:l,hasSurrogateUnit:s,isCodeUnitInSurrogateRange:a,isSurrogatePair:function(e,r){if(0<=r&&r<e.length||n(!1),r+1===e.length)return!1;var i=e.charCodeAt(r),o=e.charCodeAt(r+1);return 55296<=i&&i<=56319&&56320<=o&&o<=57343},strlen:function(e){if(!s(e))return e.length;for(var r=0,i=0;i<e.length;i+=l(e,i))r++;return r},substring:function(e,r,i){(r=r||0)<0&&(r=0),(i=void 0===i?1/0:i||0)<0&&(i=0);var n=Math.abs(i-r);return u(e,r=r<i?r:i,n)},substr:u}},54945:(e,r,i)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}i.d(r,{A:()=>n})},55283:(e,r,i)=>{"use strict";i.d(r,{JY:()=>u,lo:()=>l});var n=i(37876),o=i(14232);let a=(0,o.createContext)(null),s={alerts:null,notes:null},l=({children:e})=>{let r=(0,o.useRef)(null),i=(0,o.useRef)(null),l=(0,o.useRef)(null),[u,c]=(0,o.useState)(!1),h=(0,o.useRef)(s);
113return(0,n.jsx)(a.Provider,{value:{map:r,altMap:i,markerRef:l,splitViewEnabled:u,setSplitViewEnabled:c,layerFilterOptions:h},children:e})},u=()=>{let e=(0,o.useContext)(a);if(!e)throw Error("useMapContext must be used within a MapContextProvider");return e}},55450:(e,r,i)=>{"use strict";var n,o=i(66530),a=i(10221);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&a&&a(Object.prototype,"__proto__"),l=Object,u=l.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof u&&function(e){return u(null==e?e:l(e))}},55502:e=>{"use strict";e.exports=RangeError},56334:(e,r,i)=>{"use strict";var n=i(60620);e.exports=function(e,r,i,o){for(var a=r,s=e.getCharacterList();a<i;)s=s.set(a,n.applyEntity(s.get(a),o)),a++;return e.set("characterList",s)}},56557:function(e){e.exports=function(){"use strict";var e="millisecond",r="second",i="minute",n="hour",o="week",a="month",s="quarter",l="year",u="date",c="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(e,r,i){var n=String(e);return!n||n.length>=r?e:""+Array(r+1-n.length).join(i)+e},f="en",m={};m[f]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var r=["th","st","nd","rd"],i=e%100;return"["+e+(r[(i-20)%10]||r[i]||r[0])+"]"}};var g="$isDayjsObject",_=function(e){return e instanceof b||!(!e||!e[g])},y=function e(r,i,n){var o;if(!r)return f;if("string"==typeof r){var a=r.toLowerCase();m[a]&&(o=a),i&&(m[a]=i,o=a);var s=r.split("-");if(!o&&s.length>1)return e(s[0])}else{var l=r.name;m[l]=r,o=l}return!n&&o&&(f=o),o||!n&&f},v=function(e,r){if(_(e))return e.clone();var i="object"==typeof r?r:{};return i.date=e,i.args=arguments,new b(i)},x={s:d,z:function(e){var r=-e.utcOffset(),i=Math.abs(r);return(r<=0?"+":"-")+d(Math.floor(i/60),2,"0")+":"+d(i%60,2,"0")},m:function e(r,i){if(r.date()<i.date())return-e(i,r);var n=12*(i.year()-r.year())+(i.month()-r.month()),o=r.clone().add(n,a),s=i-o<0,l=r.clone().add(n+(s?-1:1),a);return+(-(n+(i-o)/(s?o-l:l-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(c){return({M:a,y:l,w:o,d:"day",D:u,h:n,m:i,s:r,ms:e,Q:s})[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};x.l=y,x.i=_,x.w=function(e,r){return v(e,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var b=function(){function d(e){this.$L=y(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[g]=!0}var f=d.prototype;return f.parse=function(e){this.$d=function(e){var r=e.date,i=e.utc;if(null===r)return new Date(NaN);if(x.u(r))return new Date;if(r instanceof Date)return new Date(r);if("string"==typeof r&&!/Z$/i.test(r)){var n=r.match(h);if(n){var o=n[2]-1||0,a=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(r)}(e),this.init()},f.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},f.$utils=function(){return x},f.isValid=function(){return this.$d.toString()!==c},f.isSame=function(e,r){var i=v(e);return this.startOf(r)<=i&&i<=this.endOf(r)},f.isAfter=function(e,r){return v(e)<this.startOf(r)},f.isBefore=function(e,r){return this.endOf(r)<v(e)},f.$g=function(e,r,i){return x.u(e)?this[r]:this.set(i,e)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(e,s){var c=this,h=!!x.u(s)||s,p=x.p(e),d=function(e,r){var i=x.w(c.$u?Date.UTC(c.$y,r,e):new Date(c.$y,r,e),c);return h?i:i.endOf("day")},f=function(e,r){return x.w(c.toDate()[e].apply(c.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(r)),c)},m=this.$W,g=this.$M,_=this.$D,y="set"+(this.$u?"UTC":"");switch(p){case l:return h?d(1,0):d(31,11);case a:return h?d(1,g):d(0,g+1);case o:var v=this.$locale().weekStart||0,b=(m<v?m+7:m)-v;return d(h?_-b:_+(6-b),g);case"day":case u:return f(y+"Hours",0);case n:return f(y+"Minutes",1);case i:return f(y+"Seconds",2);case r:return f(y+"Milliseconds",3);default:return this.clone()}},f.endOf=function(e){return this.startOf(e,!1)},f.$set=function(o,s){var c,h=x.p(o),p="set"+(this.$u?"UTC":""),d=((c={}).day=p+"Date",c[u]=p+"Date",c[a]=p+"Month",c[l]=p+"FullYear",c[n]=p+"Hours",c[i]=p+"Minutes",c[r]=p+"Seconds",c[e]=p+"Milliseconds",c)[h],f="day"===h?this.$D+(s-this.$W):s;if(h===a||h===l){var m=this.clone().set(u,1);
113m.$d[d](f),m.init(),this.$d=m.set(u,Math.min(this.$D,m.daysInMonth())).$d}else d&&this.$d[d](f);return this.init(),this},f.set=function(e,r){return this.clone().$set(e,r)},f.get=function(e){return this[x.p(e)]()},f.add=function(e,s){var u,c=this;e=Number(e);var h=x.p(s),p=function(r){var i=v(c);return x.w(i.date(i.date()+Math.round(r*e)),c)};if(h===a)return this.set(a,this.$M+e);if(h===l)return this.set(l,this.$y+e);if("day"===h)return p(1);if(h===o)return p(7);var d=((u={})[i]=6e4,u[n]=36e5,u[r]=1e3,u)[h]||1,f=this.$d.getTime()+e*d;return x.w(f,this)},f.subtract=function(e,r){return this.add(-1*e,r)},f.format=function(e){var r=this,i=this.$locale();if(!this.isValid())return i.invalidDate||c;var n=e||"YYYY-MM-DDTHH:mm:ssZ",o=x.z(this),a=this.$H,s=this.$m,l=this.$M,u=i.weekdays,h=i.months,d=i.meridiem,f=function(e,i,o,a){return e&&(e[i]||e(r,n))||o[i].slice(0,a)},m=function(e){return x.s(a%12||12,e,"0")},g=d||function(e,r,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(p,function(e,n){return n||function(e){switch(e){case"YY":return String(r.$y).slice(-2);case"YYYY":return x.s(r.$y,4,"0");case"M":return l+1;case"MM":return x.s(l+1,2,"0");case"MMM":return f(i.monthsShort,l,h,3);case"MMMM":return f(h,l);case"D":return r.$D;case"DD":return x.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return f(i.weekdaysMin,r.$W,u,2);case"ddd":return f(i.weekdaysShort,r.$W,u,3);case"dddd":return u[r.$W];case"H":return String(a);case"HH":return x.s(a,2,"0");case"h":return m(1);case"hh":return m(2);case"a":return g(a,s,!0);case"A":return g(a,s,!1);case"m":return String(s);case"mm":return x.s(s,2,"0");case"s":return String(r.$s);case"ss":return x.s(r.$s,2,"0");case"SSS":return x.s(r.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},f.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},f.diff=function(e,u,c){var h,p=this,d=x.p(u),f=v(e),m=(f.utcOffset()-this.utcOffset())*6e4,g=this-f,_=function(){return x.m(p,f)};switch(d){case l:h=_()/12;break;case a:h=_();break;case s:h=_()/3;break;case o:h=(g-m)/6048e5;break;case"day":h=(g-m)/864e5;break;case n:h=g/36e5;break;case i:h=g/6e4;break;case r:h=g/1e3;break;default:h=g}return c?h:x.a(h)},f.daysInMonth=function(){return this.endOf(a).$D},f.$locale=function(){return m[this.$L]},f.locale=function(e,r){if(!e)return this.$L;var i=this.clone(),n=y(e,r,!0);return n&&(i.$L=n),i},f.clone=function(){return x.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},d}(),w=b.prototype;return v.prototype=w,[["$ms",e],["$s",r],["$m",i],["$H",n],["$W","day"],["$M",a],["$y",l],["$D",u]].forEach(function(e){w[e[1]]=function(r){return this.$g(r,e[0],e[1])}}),v.extend=function(e,r){return e.$i||(e(r,b,v),e.$i=!0),v},v.locale=y,v.isDayjs=_,v.unix=function(e){return v(1e3*e)},v.en=m[f],v.Ls=m,v.p={},v}()},56810:(e,r,i)=>{"use strict";var n=i(75448),o=i(88294);e.exports=function(e){var r=n(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=r);var i=o(e),a=e===r?e.ownerDocument.documentElement:e,s=e.scrollWidth-a.clientWidth,l=e.scrollHeight-a.clientHeight;return i.x=Math.max(0,Math.min(i.x,s)),i.y=Math.max(0,Math.min(i.y,l)),i}},57186:(e,r,i)=>{"use strict";let n;i.d(r,{A:()=>l});let o="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),a=new Uint8Array(16),s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));let l=function(e,r,i){if(o&&!r&&!e)return o();let l=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(a)})();if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,r){i=i||0;for(let e=0;e<16;++e)r[i+e]=l[e];return r}return function(e,r=0){return s[e[r+0]]+s[e[r+1]]+s[e[r+2]]+s[e[r+3]]+"-"+s[e[r+4]]+s[e[r+5]]+"-"+s[e[r+6]]+s[e[r+7]]+"-"+s[e[r+8]]+s[e[r+9]]+"-"+s[e[r+10]]+s[e[r+11]]+s[e[r+12]]+s[e[r+13]]+s[e[r+14]]+s[e[r+15]]}(l)}},57271:(e,r,i)=>{"use strict";i.d(r,{D:()=>p,d:()=>h});var n=i(37876),o=i(14232),a=i(77784),s=i(9380),l=i(55283),u=i(5913);let c=(0,o.createContext)(void 0);function h({children:e}){let r=(0,a.O)(),i=(0,l.JY)(),[p,d]=(0,o.useState)([]),[f,m]=(0,o.useState)([]),[g,_]=(0,o.useState)(0),y=(0,o.useRef)(null);return(0,o.useEffect)(()=>
113{if(!i.map||!r.project)return;let e=async()=>{if(!r.project)return[];let e=await (0,s.i2)(null,i.map,!0);return d(e),e};(async()=>{r.project&&await Promise.all([e(),(0,u.T)(r.project,i.map)])})()},[g,i.map,r.project]),(0,n.jsx)(c.Provider,{value:{lidarPositionMarkerRef:y,allLidars:p,availableLidars:f,setRefreshLidars:_,setAvailableLidars:m},children:e})}function p(){let e=(0,o.useContext)(c);if(void 0===e)throw Error("useLidarContext must be used within a LidarContextProvider");return e}},57294:(e,r,i)=>{"use strict";i.d(r,{IM:()=>_,OY:()=>m,T8:()=>l,g_:()=>h,gv:()=>g,vu:()=>f});var n=i(84412),o=i(11324),a=i.n(o),s=i(43299);let l=(e,r)=>e===r,u=new Map,c="meters",h=e=>{if(e.length<2)return null;let r=e.slice(1).reduce((r,i,n)=>r+s.EUY(e[n],i,{units:c}),0);if(!Number.isFinite(r)||r<=0)return null;let i=r<=2980?Array.from({length:Math.ceil(r/20)+1},(e,i)=>Math.min(20*i,r)):Array.from({length:150},(e,i)=>r*i/149);return{coordinates:i.map(r=>((e,r)=>{let i=r;for(let r=1;r<e.length;r+=1){let n=e[r-1],o=e[r],a=s.EUY(n,o,{units:c});if(0!==a){if(i<=a){if(i===a)return o;let e=s.Fc$(n,o);return s.rmV(n,i,e,{units:c}).geometry.coordinates}i-=a}}return e.at(-1)})(e,r)),distances:i,totalDistance:r}},p=(e,r)=>{e.isStyleLoaded()?r():e.once("style.load",r)},d=e=>e.getZoom()>18?.1:1.5,f=e=>{p(e,()=>{e.getSource("mapbox-dem")||e.addSource("mapbox-dem",{type:"raster-dem",url:"mapbox://mapbox.mapbox-terrain-dem-v1",tileSize:512,maxzoom:14}),e.setTerrain({source:"mapbox-dem",exaggeration:d(e)})})},m=e=>{p(e,()=>e.setTerrain(null))},g=e=>{let r=1.5;e.on("zoom",()=>{if(!e.isStyleLoaded()||!e.getTerrain())return;let i=d(e);i!==r&&(r=i,e.setTerrain({source:"mapbox-dem",exaggeration:i}))})},_=async e=>{let r=(e=>{try{let r=a().LngLat.convert(e);if(!Number.isFinite(r.lng)||!Number.isFinite(r.lat))return null;let i=r.wrap().lng,n=Math.max(-85.05112878,Math.min(85.05112878,r.lat)),o=Math.min(16383.999999999,Math.max(0,(i+180)/360*16384)),s=Math.sin(n*Math.PI/180),l=(.5-Math.log((1+s)/(1-s))/(4*Math.PI))*16384,u=Math.min(16383.999999999,Math.max(0,l)),c=Math.floor(o),h=Math.floor(u);return{tileKey:`14/${c}/${h}`,tileX:c,tileY:h,tileXFrac:o,tileYFrac:u}}catch{return null}})(e);if(!r)return null;try{let e=(e=>{let r=u.get(e);if(r)return u.delete(e),u.set(e,r),r;let i=(async()=>{try{let r=`https://api.mapbox.com/v4/mapbox.terrain-rgb/${e}@2x.pngraw?access_token=${n.Et}`,i=await fetch(r,{signal:AbortSignal.timeout(8e3)});if(!i.ok)return null;let o=await createImageBitmap(await i.blob()),a=document.createElement("canvas");a.width=a.height=512;let s=a.getContext("2d");if(!s)return o.close(),null;s.drawImage(o,0,0),o.close();let l=s.getImageData(0,0,512,512);return{data:l.data,width:l.width}}catch{return null}})();if(u.set(e,i),u.size>16){let e=u.keys().next().value;e&&u.delete(e)}return i})(r.tileKey),i=await e;if(!i)return u.get(r.tileKey)===e&&u.delete(r.tileKey),null;let o=Math.floor((r.tileXFrac-r.tileX)*512),a=(Math.floor((r.tileYFrac-r.tileY)*512)*i.width+o)*4,s=i.data[a],l=i.data[a+1],c=i.data[a+2];return Math.round(10*(-1e4+(65536*s+256*l+c)*.1))/10}catch{return null}}},57448:e=>{e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},57575:(e,r,i)=>{"use strict";var n=i(18916),o=i(11821),a=i(10875),s=i(82326),l=i(20740);e.exports=function(e,r){var i=l(e,function(e){var i=e.getSelection();if(i.isCollapsed()&&0===i.getAnchorOffset())return s(e,1);var n=r.currentTarget.ownerDocument.defaultView.getSelection().getRangeAt(0);return a(e,null,(n=o(n)).endContainer,n.endOffset,n.startContainer,n.startOffset).selectionState},"backward");return i===e.getCurrentContent()?e:n.push(e,i,"remove-range")}},57793:e=>{"use strict";var r={isImage:function(e){return"image"===i(e)[0]},isJpeg:function(e){var n=i(e);return r.isImage(e)&&("jpeg"===n[1]||"pjpeg"===n[1])}};function i(e){return e.split("/")}e.exports=r},57913:(e,r,i)=>{"use strict";i(27348),e.exports=i.g.setImmediate},58217:e=>{"use strict";var r={};e.exports=function(){for(var e;void 0===e||r.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(0x1000000*Math.random()).toString(32);return r[e]=!0,e}},58240:e=>{"use strict";e.exports=function(e){return"u">typeof window&&!!window.__DRAFT_GKX&&!!window.__DRAFT_GKX[e]}},59356:(e,r,i)=>{"use strict";var n=i(34068),o=i(20726);e.exports=function(e,r){var i=r.getStartKey(),a=r.getStartOffset(),s=r.getEndKey(),l=r.getEndOffset(),u=o(e,r).getBlockMap(),c=u.keySeq(),h=c.indexOf(i),p=c.indexOf(s)+1;return n(u.slice(h,p).map(function(e,r){var n=e.getText(),o=e.getCharacterList();return i===s?e.merge({text:n.slice(a,l),characterList:o.slice(a,l)}):r===i?e.merge({text:n.slice(a),characterList:o.slice(a)}):r===s?e.merge({text:n.slice(0,l),characterList:o.slice(0,l)}):e}))}},59411:(e,r,i)=>{"use strict";i.d(r,{a:()=>h,g:()=>c});var n=i(43299),o=i(38595),a=i.n(o);let s=new WeakMap,l=new Map,u=(e,r=!1)=>({id:e.id,user_id:e.user_id,issuer:e.properties?.issuer,title:e.properties?.title,category:e.properties?.category,description:e.properties?.description,base:e.properties?.folder_path?.base,files:e.properties?.folder_path?.files,folder_path:e.properties?.folder_path,img:e.properties?.folder_path?.base?e.properties.folder_path.files?.[0]:null,create_date:e.create_date,severity:e.properties?.severity,verified:e.properties?.validated?.toString(),verify_status:e.properties?.verify_status??null,reviewed:e.reviewed?.toString()||"false",notification_ids:Array.isArray(e.notification_ids)?e.notification_ids:[],is_polygon_icon:r}),c=e=>{let r=new Set(e.map(e=>e.id).filter(e=>"number"==typeof e));for(let e of l.keys())r.has(e)||l.delete(e);return{type:"FeatureCollection",features:[...e.map(e=>({type:"Feature",properties:u(e),geometry:e.geojson?.geometry})),...e.filter(e=>{let r=e.geojson?.geometry?.type;return"Polygon"===r||"MultiPolygon"===r}).flatMap(e=>(e=>{let r=e.geojson?.geometry??e.geojson;if(!r||"object"!=typeof r)return[];let i=s.get(r);if(i)return i;if("number"==typeof e.id){let i=l.get(e.id);if(i&&i.geometryRef===r)return s.set(r,i.points),i.points}let o=(e=>{let r=e&&"geometry"in e?e.geometry:e;if(!r)return[];try{if("Polygon"===r.type){let e=r.coordinates;return[{type:"Point",coordinates:a()(e,.001)}]}
113if("MultiPolygon"===r.type)return r.coordinates.map(e=>({type:"Point",coordinates:a()(e,.001)}))}catch(e){console.log("Failed to compute polygon icon geometry using polylabel: ",e)}try{let[e,i]=n.QwJ(r).geometry.coordinates;return[{type:"Point",coordinates:[e,i]}]}catch(e){return console.log("Failed to compute polygon icon geometry using turf.pointOnFeature: ",e),[]}})(e.geojson);return s.set(r,o),"number"==typeof e.id&&l.set(e.id,{geometryRef:r,points:o}),o})(e).map((r,i)=>({type:"Feature",id:`polygon-icon-${e.id}-${i}`,properties:u(e,!0),geometry:r})))]}},h=e=>({type:"FeatureCollection",features:e.map((e,r)=>{let i=(e=>{if(Array.isArray(e)&&e.length>=2)return{type:"Point",coordinates:e};try{let r=JSON.parse(e);if(r?.type==="Feature"&&r?.geometry)return r.geometry;return r}catch{return null}})(e.centroid);return i&&"type"in i&&"Point"===i.type?{type:"Feature",id:`alert-cluster-${r}`,properties:{count:e.count,point_count:e.count,point_count_abbreviated:e.count.toString()},geometry:i}:null}).filter(e=>null!==e)})},59487:e=>{"use strict";e.exports={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}}},60577:e=>{"use strict";var r=function(e){return e!=e};e.exports=function(e,i){return 0===e&&0===i?1/e==1/i:!!(e===i||r(e)&&r(i))}},60620:(e,r,i)=>{"use strict";var n=i(93710),o=n.Map,a=n.OrderedSet,s=n.Record,l=a(),u={style:l,entity:null},c=function(e){function r(){return e.apply(this,arguments)||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.getStyle=function(){return this.get("style")},i.getEntity=function(){return this.get("entity")},i.hasStyle=function(e){return this.getStyle().includes(e)},r.applyStyle=function(e,i){var n=e.set("style",e.getStyle().add(i));return r.create(n)},r.removeStyle=function(e,i){var n=e.set("style",e.getStyle().remove(i));return r.create(n)},r.applyEntity=function(e,i){var n=e.getEntity()===i?e:e.set("entity",i);return r.create(n)},r.create=function(e){if(!e)return h;var i=o({style:l,entity:null}).merge(e),n=p.get(i);if(n)return n;var a=new r(i);return p=p.set(i,a),a},r.fromJS=function(e){var i=e.style,n=e.entity;return new r({style:Array.isArray(i)?a(i):i,entity:Array.isArray(n)?a(n):n})},r}(s(u)),h=new c,p=o([[o(u),h]]);c.EMPTY=h,e.exports=c},61389:(e,r,i)=>{"use strict";var n=i(31114),o=i(18916),a=i(54380),s=i(20740);e.exports=function(e){var r=s(e,function(e){var r=e.getSelection(),i=r.getStartOffset(),o=r.getStartKey(),s=e.getCurrentContent().getBlockForKey(o).getText().slice(i);return a(e,n.getForward(s).length||1)},"forward");return r===e.getCurrentContent()?e:o.push(e,r,"remove-range")}},61519:(e,r,i)=>{"use strict";i.d(r,{$z:()=>d,W_:()=>u,ZQ:()=>h,bB:()=>c});var n,o=i(23323),a=i(84412),s=i(85428),l=i(47133),u=((n={}).readOnly="r",n.listWrite="rawcl",n.readWriteDelete="rawcd",n);let c=async(e,r=!1)=>{let i=e.split("/").map(e=>encodeURIComponent(e)).join("/");return`${a.oj}${i}?${await h(r)}`},h=async(e=!1)=>{if(e||!sessionStorage.getItem("project_access_token")||p(sessionStorage.getItem("project_access_token")||"")){let e=(0,s.Ky)();if(!e)throw Error("No project found");sessionStorage.setItem("project_access_token",await d("r",e.project_uuid))}return sessionStorage.getItem("project_access_token")},p=e=>{let r=new URLSearchParams(e.startsWith("?")?e:"?"+e).get("se");return!r||new Date(r)<=new Date},d=async(e,r,i=l.ox)=>await (0,o.x)("/auth/sastoken",{params:{permissions:e,duration:i,project_id:r}})},61664:(e,r,i)=>{"use strict";e.exports=i(52468).getPrototypeOf||null},61715:(e,r,i)=>{"use strict";var n=i(14842),o=i(9912),a=i(93710),s=i(5733),l=i(15796),u=i(34068),c=a.List,h=function(e,r,i,n,o,a){var l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"REPLACE_WITH_NEW_DATA",u=i.get(o),c=u.getText(),h=u.getCharacterList(),p=a+n.getText().length,d=null;switch(l){case"MERGE_OLD_DATA_TO_NEW_DATA":d=n.getData().merge(u.getData());break;case"REPLACE_WITH_NEW_DATA":d=n.getData()}var f=u.getType();c&&"unstyled"===f&&(f=n.getType());var m=u.merge({text:c.slice(0,a)+n.getText()+c.slice(a),characterList:s(h,n.getCharacterList(),a),type:f,data:d});return e.merge({blockMap:i.set(o,m),selectionBefore:r,selectionAfter:r.merge({anchorKey:o,anchorOffset:p,focusKey:o,focusOffset:p,isBackward:!1})})},p=function(e,r,i){var n=e.getText(),o=e.getCharacterList(),a=n.slice(0,r),s=o.slice(0,r),l=i.first();return e.merge({text:a+l.getText(),characterList:s.concat(l.getCharacterList()),type:a?e.getType():l.getType(),data:l.getData()})},d=function(e,r,i){var n=e.getText(),o=e.getCharacterList(),a=n.length,s=n.slice(r,a),l=o.slice(r,a),u=i.last();return u.merge({text:u.getText()+s,characterList:u.getCharacterList().concat(l),data:u.getData()})},f=function(e,r){var i=e.getKey(),n=e,o=[];for(r.get(i)&&o.push(i);n&&n.getNextSiblingKey();){var a=n.getNextSiblingKey();if(!a)break;o.push(a),n=r.get(a)}return o},m=function(e,r,i,a,s,l){var u,h=i.first()instanceof o,m=[],g=a.size,_=i.get(s),y=a.first(),v=a.last(),x=v.getLength(),b=v.getKey(),w=h&&(!_.getChildKeys().isEmpty()||!y.getChildKeys().isEmpty());
113i.forEach(function(e,r){r!==s?m.push(e):(w?m.push(e):m.push(p(e,l,a)),a.slice(+!w,g-1).forEach(function(e){return m.push(e)}),m.push(d(e,l,a)))});var E=n.createFromArray(m);return h&&(E=(u=E).withMutations(function(e){var r=_.getKey(),i=y.getKey(),n=_.getNextSiblingKey(),o=_.getParentKey(),a=f(y,u),s=a[a.length-1];if(e.get(i)?(e.setIn([r,"nextSibling"],i),e.setIn([i,"prevSibling"],r)):(e.setIn([r,"nextSibling"],y.getNextSiblingKey()),e.setIn([y.getNextSiblingKey(),"prevSibling"],r)),e.setIn([s,"nextSibling"],n),n&&e.setIn([n,"prevSibling"],s),a.forEach(function(r){return e.setIn([r,"parent"],o)}),o){var l=u.get(o).getChildKeys(),h=l.indexOf(r),p=l.toArray();p.splice.apply(p,[h+1,0].concat(a)),e.setIn([o,"children"],c(p))}})),e.merge({blockMap:E,selectionBefore:r,selectionAfter:r.merge({anchorKey:b,anchorOffset:x,focusKey:b,focusOffset:x,isBackward:!1})})};e.exports=function(e,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA";r.isCollapsed()||l(!1);var a=e.getBlockMap(),s=u(i),c=r.getStartKey(),p=r.getStartOffset(),d=a.get(c);return(d instanceof o&&(d.getChildKeys().isEmpty()||l(!1)),1===s.size)?h(e,r,a,s.first(),c,p,n):m(e,r,a,s,c,p)}},62070:(e,r,i)=>{"use strict";var n=i(39636),o=i(18916),a=i(18544),s=i(12968),l={currentBlockContainsLink:function(e){var r=e.getSelection(),i=e.getCurrentContent(),n=i.getEntityMap();return i.getBlockForKey(r.getAnchorKey()).getCharacterList().slice(r.getStartOffset(),r.getEndOffset()).some(function(e){var r=e.getEntity();return!!r&&"LINK"===n.__get(r).getType()})},getCurrentBlockType:function(e){var r=e.getSelection();return e.getCurrentContent().getBlockForKey(r.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,r,i){switch(r){case"bold":return l.toggleInlineStyle(e,"BOLD");case"italic":return l.toggleInlineStyle(e,"ITALIC");case"underline":return l.toggleInlineStyle(e,"UNDERLINE");case"code":return l.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return l.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return l.onDelete(e);default:return null}},insertSoftNewline:function(e){var r=n.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),i=o.push(e,r,"insert-characters");return o.forceSelection(i,r.getSelectionAfter())},onBackspace:function(e){var r=e.getSelection();if(!r.isCollapsed()||r.getAnchorOffset()||r.getFocusOffset())return null;var i=e.getCurrentContent(),n=r.getStartKey(),a=i.getBlockBefore(n);if(a&&"atomic"===a.getType()){var s=i.getBlockMap().delete(a.getKey()),u=i.merge({blockMap:s,selectionAfter:r});if(u!==i)return o.push(e,u,"remove-range")}var c=l.tryToRemoveBlockStyle(e);return c?o.push(e,c,"change-block-type"):null},onDelete:function(e){var r=e.getSelection();if(!r.isCollapsed())return null;var i=e.getCurrentContent(),a=r.getStartKey(),s=i.getBlockForKey(a).getLength();if(r.getStartOffset()<s)return null;var l=i.getBlockAfter(a);if(!l||"atomic"!==l.getType())return null;var u=r.merge({focusKey:l.getKey(),focusOffset:l.getLength()}),c=n.removeRange(i,u,"forward");return c!==i?o.push(e,c,"remove-range"):null},onTab:function(e,r,i){var n=r.getSelection(),s=n.getAnchorKey();if(s!==n.getFocusKey())return r;var l=r.getCurrentContent(),u=l.getBlockForKey(s),c=u.getType();if("unordered-list-item"!==c&&"ordered-list-item"!==c)return r;e.preventDefault();var h=u.getDepth();if(!e.shiftKey&&h===i)return r;var p=a(l,n,e.shiftKey?-1:1,i);return o.push(r,p,"adjust-depth")},toggleBlockType:function(e,r){var i=e.getSelection(),a=i.getStartKey(),l=i.getEndKey(),u=e.getCurrentContent(),c=i;if(a!==l&&0===i.getEndOffset()){var h=s(u.getBlockBefore(l));l=h.getKey(),c=c.merge({anchorKey:a,anchorOffset:i.getStartOffset(),focusKey:l,focusOffset:h.getLength(),isBackward:!1})}if(u.getBlockMap().skipWhile(function(e,r){return r!==a}).reverse().skipWhile(function(e,r){return r!==l}).some(function(e){return"atomic"===e.getType()}))return e;var p=u.getBlockForKey(a).getType()===r?"unstyled":r;return o.push(e,n.setBlockType(u,c,p),"change-block-type")},toggleCode:function(e){var r=e.getSelection(),i=r.getAnchorKey(),n=r.getFocusKey();return r.isCollapsed()||i!==n?l.toggleBlockType(e,"code-block"):l.toggleInlineStyle(e,"CODE")},toggleInlineStyle:function(e,r){var i,a=e.getSelection(),s=e.getCurrentInlineStyle();if(a.isCollapsed())return o.setInlineStyleOverride(e,s.has(r)?s.remove(r):s.add(r));var l=e.getCurrentContent();return i=s.has(r)?n.removeInlineStyle(l,a,r):n.applyInlineStyle(l,a,r),o.push(e,i,"change-inline-style")},toggleLink:function(e,r,i){var a=n.applyEntity(e.getCurrentContent(),r,i);return o.push(e,a,"apply-entity")},tryToRemoveBlockStyle:function(e){var r=e.getSelection(),i=r.getAnchorOffset();if(r.isCollapsed()&&0===i){var o=r.getAnchorKey(),a=e.getCurrentContent(),s=a.getBlockForKey(o).getType(),l=a.getBlockBefore(o);if("code-block"===s&&l&&"code-block"===l.getType()&&0!==l.getLength())return null;if("unstyled"!==s)return n.setBlockType(a,r,"unstyled")}return null}};e.exports=l},62191:(e,r,i)=>{"use strict";var n=i(88017).notEmptyKey;function o(e,r){return n(r)&&"MUTABLE"===e.__get(r).getMutability()?r:null}e.exports=function(e,r){if(r.isCollapsed()){var i,n=r.getAnchorKey(),a=r.getAnchorOffset();return a>0?(i=e.getBlockForKey(n).getEntityAt(a-1))!==e.getBlockForKey(n).getEntityAt(a)?null:o(e.getEntity
113Map(),i):null}var s=r.getStartKey(),l=r.getStartOffset(),u=e.getBlockForKey(s);return i=l===u.getLength()?null:u.getEntityAt(l),o(e.getEntityMap(),i)}},62648:(e,r,i)=>{"use strict";i.d(r,{DE:()=>y,HW:()=>_,VE:()=>f});var n=i(22629),o=i(40430),a=i(85428),s=i(23323);let l=new Map,u=null,c=[],h=!1,p=()=>{for(;c.length>0;){let{resolve:e}=c.shift();e()}},d=e=>{let r=new Map;return Array.from(l.values()).filter(i=>{let n=i.properties?.tour_id;return!n||(r.has(n)||r.set(n,(0,o.xe)(n,e)),r.get(n))})},f=e=>{let r=e?.current?.getSource("map-points");r&&r.setData({type:"FeatureCollection",features:d((0,a.Ky)().project_uuid)})},m=async(e,r=!1)=>{let i=async()=>{try{u&&(u.abort(),p()),u=new AbortController;let i=(0,a.jp)(window.innerWidth,0,e),o=(0,a.jp)(0,window.innerHeight,e),c=e.current.getZoom(),h=await (0,s.x)("/map/display-project",{method:"POST",signal:u.signal,json:{zoom:r?4:c,screen:r?{TR:{lon:180,lat:90},BL:{lon:-180,lat:-90}}:{TR:i,BL:o},initialLoad:r}});Array.isArray(h)?h.forEach(e=>{let r=`${e.lon}-${e.lat}-${e.tour_id??""}-${e.date}`;l.has(r)||l.set(r,{type:"Feature",hover:!1,id:r,properties:{date:e.date,route:e.route,tour_id:e.tour_id},geometry:{type:"Point",coordinates:[e.lon,e.lat]}})}):console.error("Expected mapPoints to be an array, but got:",h);let f={type:"FeatureCollection",features:d((0,a.Ky)().project_uuid)};e.current.getSource("map-points")?e.current.getSource("map-points").setData(f):(e.current.getSource("map-points")||e.current.addSource("map-points",{type:"geojson",data:f,cluster:!0,clusterMaxZoom:14,clusterRadius:2}),e.current.getLayer("data-layer")||e.current.addLayer({id:"data-layer",type:"circle",layout:{visibility:null===(0,n.YN)("data-layer",(0,a.Ky)().project_uuid)||!0===(0,n.YN)("data-layer",(0,a.Ky)().project_uuid)?"visible":"none"},source:"map-points",paint:{"circle-radius":2,"circle-color":"#2563eb","circle-stroke-width":20,"circle-stroke-color":"rgba(0, 0, 0, 0)"}}))}catch(e){if("AbortError"===e.name)return}};return await i(),e.current.on("style.load",async()=>{await i()}),e},g=async e=>{if(h||0===c.length)return;let{loadAll:r,resolve:i}=c.shift();h=!0;try{await m(e,r)}finally{h=!1,i(),g(e)}},_=(e,r=!1)=>(p(),c=[],new Promise(i=>{c.push({loadAll:r,resolve:i}),g(e)})),y=async(e,r,i=[])=>{let n=new Set(i.map(e=>`${e.lon}-${e.lat}`));l.forEach((e,i)=>{let o=e.properties?.tour_id,[a,s]=e.geometry.coordinates;(o?o===r:n.has(`${a}-${s}`))&&l.delete(i)}),await _(e)}},62899:e=>{"use strict";var r=RegExp("\r","g");e.exports=function(e){return e.replace(r,"")}},62989:e=>{"use strict";e.exports=function(e,r,i,n){if(e.size){var o=0;e.reduce(function(e,a,s){return r(e,a)||(i(e)&&n(o,s),o=s),a}),i(e.last())&&n(o,e.count())}}},63122:(e,r,i)=>{var n=i(72365),o=i(91097);e.exports=function(e,r,i,a){return r.length>0&&Array.isArray(r[0])?o(e,r,i,a):n(e,r,i,a)},e.exports.nested=o,e.exports.flat=n},63578:(e,r,i)=>{"use strict";var n=i(39636),o=i(18916),a=i(95182),s=i(4708),l=i(35558),u=i(39052),c=i(75936),h=i(57575),p=i(30753),d=i(61389),f=i(88913),m=i(1011),g=i(22732),_=i(84785),y=i(29333),v=i(45941),x=i(52676),b=a.isOptionKeyCommand,w=u.isBrowser("Chrome");e.exports=function(e,r){var i=r.which,a=e._latestEditorState;function u(i){var n=e.props[i];return!!n&&(n(r),!0)}switch(i){case s.RETURN:if(r.preventDefault(),e.props.handleReturn&&c(e.props.handleReturn(r,a)))return;break;case s.ESC:if(r.preventDefault(),u("onEscape"))return;break;case s.TAB:if(u("onTab"))return;break;case s.UP:if(u("onUpArrow"))return;break;case s.RIGHT:if(u("onRightArrow"))return;break;case s.DOWN:if(u("onDownArrow"))return;break;case s.LEFT:if(u("onLeftArrow"))return;break;case s.SPACE:w&&b(r)&&r.preventDefault()}var E=e.props.keyBindingFn(r);if(null==E||""===E){if(i===s.SPACE&&w&&b(r)){var S=n.replaceText(a.getCurrentContent(),a.getSelection(),"\xa0");e.update(o.push(a,S,"insert-characters"))}return}if("undo"===E)return void x(r,a,e.update);if(r.preventDefault(),!(e.props.handleKeyCommand&&c(e.props.handleKeyCommand(E,a,r.timeStamp)))){var T=function(e,r,i){switch(e){case"redo":return o.redo(r);case"delete":return y(r);case"delete-word":return d(r);case"backspace":return _(r);case"backspace-word":return p(r);case"backspace-to-start-of-line":return h(r,i);case"split-block":return f(r);case"transpose-characters":return v(r);case"move-selection-to-start-of-block":return g(r);case"move-selection-to-end-of-block":return m(r);case"secondary-cut":return l.cut(r);case"secondary-paste":return l.paste(r);default:return r}}(E,a,r);T!==a&&e.update(T)}}},63797:(e,r,i)=>{"use strict";i.d(r,{P:()=>tc,g:()=>th});var n={};i.r(n),i.d(n,{LAT_MAX:()=>w,LAT_MIN:()=>x,LAT_RENDERED_MAX:()=>E,LAT_RENDERED_MIN:()=>b,LNG_MAX:()=>T,LNG_MIN:()=>S,activeStates:()=>y,classes:()=>u,cursors:()=>h,events:()=>m,geojsonTypes:()=>d,interactions:()=>v,meta:()=>_,modes:()=>f,sources:()=>c,types:()=>p,updateActions:()=>g});var o={};i.r(o),i.d(o,{isActiveFeature:()=>C,isBackspaceKey:()=>N,isDeleteKey:()=>F,isDigit1Key:()=>z,isDigit2Key:()=>B,isDigit3Key:()=>U,isDigitKey:()=>j,isEnterKey:()=>k,isEscapeKey:()=>R,isFeature:()=>L,isInactiveFeature:()=>A,isOfMetaType:()=>I,isShiftDown:()=>D,isShiftMousedown:()=>M,isTrue:()=>V,isVertex:()=>O,noTarget:()=>P});var a={};i.r(a),i.d(a,{CommonSelectors:()=>o,ModeHandler:()=>ei,StringSet:()=>Z,constrainFeatureMovement:()=>eV,createMidPoint:()=>eD,createSupplementaryPoints:()=>eR,createVertex:()=>eI,doubleClickZoom:()=>ek,euclideanDistance:()=>ee,featuresAt:()=>K,getFeatureAtAndSetCursors:()=>J,isClick:()=>et,isEventAtCoordinates:()=>eZ,isTap:()=>er,mapEventToBoundingBox:()=>W,moveFeatures:()=>eG,sortFeatures:()=>$,stringSetsAreEqual:()=>e4,theme:()=>eE,toDenseArray:()=>em});var s=i(37876),l=i(14232);let u={CANVAS:"mapboxgl-canvas",CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMB
113INE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},c={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},h={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},p={POLYGON:"polygon",LINE:"line_string",POINT:"point"},d={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},f={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select"},m={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},g={MOVE:"move",CHANGE_PROPERTIES:"change_properties",CHANGE_COORDINATES:"change_coordinates"},_={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},y={ACTIVE:"true",INACTIVE:"false"},v=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],x=-90,b=-85,w=90,E=85,S=-270,T=270;function I(e){return function(r){let i=r.featureTarget;return!!i&&!!i.properties&&i.properties.meta===e}}function M(e){return!!e.originalEvent&&!!e.originalEvent.shiftKey&&0===e.originalEvent.button}function C(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===y.ACTIVE&&e.featureTarget.properties.meta===_.FEATURE}function A(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===y.INACTIVE&&e.featureTarget.properties.meta===_.FEATURE}function P(e){return void 0===e.featureTarget}function L(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.meta===_.FEATURE}function O(e){let r=e.featureTarget;return!!r&&!!r.properties&&r.properties.meta===_.VERTEX}function D(e){return!!e.originalEvent&&!0===e.originalEvent.shiftKey}function R(e){return"Escape"===e.key||27===e.keyCode}function k(e){return"Enter"===e.key||13===e.keyCode}function N(e){return"Backspace"===e.key||8===e.keyCode}function F(e){return"Delete"===e.key||46===e.keyCode}function z(e){return"1"===e.key||49===e.keyCode}function B(e){return"2"===e.key||50===e.keyCode}function U(e){return"3"===e.key||51===e.keyCode}function j(e){let r=e.key||String.fromCharCode(e.keyCode);return r>="0"&&r<="9"}function V(){return!0}var G=i(32736);let q={Point:0,LineString:1,MultiLineString:1,Polygon:2};function H(e,r){let i=q[e.geometry.type]-q[r.geometry.type];return 0===i&&e.geometry.type===d.POLYGON?e.area-r.area:i}let $=function(e){return e.map(e=>(e.geometry.type===d.POLYGON&&(e.area=G.geometry({type:d.FEATURE,property:{},geometry:e.geometry})),e)).sort(H).map(e=>(delete e.area,e))},W=function(e,r=0){return[[e.point.x-r,e.point.y-r],[e.point.x+r,e.point.y+r]]};function Y(e){if(this._items={},this._nums={},this._length=e?e.length:0,e)for(let r=0,i=e.length;r<i;r++)this.add(e[r]),void 0!==e[r]&&("string"==typeof e[r]?this._items[e[r]]=r:this._nums[e[r]]=r)}Y.prototype.add=function(e){return this.has(e)||(this._length++,"string"==typeof e?this._items[e]=this._length:this._nums[e]=this._length),this},Y.prototype.delete=function(e){return!1===this.has(e)||(this._length--,delete this._items[e],delete this._nums[e]),this},Y.prototype.has=function(e){return("string"==typeof e||"number"==typeof e)&&(void 0!==this._items[e]||void 0!==this._nums[e])},Y.prototype.values=function(){let e=[];return Object.keys(this._items).forEach(r=>{e.push({k:r,v:this._items[r]})}),Object.keys(this._nums).forEach(r=>{e.push({k:JSON.parse(r),v:this._nums[r]})}),e.sort((e,r)=>e.v-r.v).map(e=>e.k)},Y.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};let Z=Y,X=[_.FEATURE,_.MIDPOINT,_.VERTEX],K={click:function(e,r,i){return Q(e,r,i,i.options.clickBuffer)},touch:function(e,r,i){return Q(e,r,i,i.options.touchBuffer)}};function Q(e,r,i,n){if(null===i.map)return[];let o=e?W(e,n):r,a={};i.options.styles&&(a.layers=i.options.styles.map(e=>e.id).filter(e=>null!=i.map.getLayer(e)));let s=i.map.queryRenderedFeatures(o,a).filter(e=>-1!==X.indexOf(e.properties.meta)),l=new Z,u=[];
113return s.forEach(e=>{let r=e.properties.id;l.has(r)||(l.add(r),u.push(e))}),$(u)}function J(e,r){let i=K.click(e,null,r),n={mouse:h.NONE};return i[0]&&(n.mouse=i[0].properties.active===y.ACTIVE?h.MOVE:h.POINTER,n.feature=i[0].properties.meta),-1!==r.events.currentModeName().indexOf("draw")&&(n.mouse=h.ADD),r.ui.queueMapClasses(n),r.ui.updateMapClasses(),i[0]}function ee(e,r){let i=e.x-r.x,n=e.y-r.y;return Math.sqrt(i*i+n*n)}function et(e,r,i={}){let n=null!=i.fineTolerance?i.fineTolerance:4,o=null!=i.grossTolerance?i.grossTolerance:12,a=null!=i.interval?i.interval:500;e.point=e.point||r.point,e.time=e.time||r.time;let s=ee(e.point,r.point);return s<n||s<o&&r.time-e.time<a}function er(e,r,i={}){let n=null!=i.tolerance?i.tolerance:25,o=null!=i.interval?i.interval:250;return e.point=e.point||r.point,e.time=e.time||r.time,ee(e.point,r.point)<n&&r.time-e.time<o}let ei=function(e,r){let i={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},n={on(e,r,n){if(void 0===i[e])throw Error(`Invalid event type: ${e}`);i[e].push({selector:r,fn:n})},render(e){r.store.featureChanged(e)}},o=function(e,o){let a=i[e],s=a.length;for(;s--;){let e=a[s];if(e.selector(o)){e.fn.call(n,o)||r.store.render(),r.ui.updateMapClasses();break}}};return e.start.call(n),{render:e.render,stop(){e.stop&&e.stop()},trash(){e.trash&&(e.trash(),r.store.render())},combineFeatures(){e.combineFeatures&&e.combineFeatures()},uncombineFeatures(){e.uncombineFeatures&&e.uncombineFeatures()},drag(e){o("drag",e)},click(e){o("click",e)},mousemove(e){o("mousemove",e)},mousedown(e){o("mousedown",e)},mouseup(e){o("mouseup",e)},mouseout(e){o("mouseout",e)},keydown(e){o("keydown",e)},keyup(e){o("keyup",e)},touchstart(e){o("touchstart",e)},touchmove(e){o("touchmove",e)},touchend(e){o("touchend",e)},tap(e){o("tap",e)}}},en=((e,r=21)=>(i=r)=>{let n="",o=0|i;for(;o-- >0;)n+=e[Math.random()*e.length|0];return n})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",32),eo=function(e,r){this.ctx=e,this.properties=r.properties||{},this.coordinates=r.geometry.coordinates,this.id=r.id||en(),this.type=r.geometry.type};eo.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},eo.prototype.incomingCoords=function(e){this.setCoordinates(e)},eo.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},eo.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},eo.prototype.setProperty=function(e,r){this.properties[e]=r},eo.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:d.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.t
113ype}}))},eo.prototype.internal=function(e){let r={id:this.id,meta:_.FEATURE,"meta:type":this.type,active:y.INACTIVE,mode:e};if(this.ctx.options.userProperties)for(let e in this.properties)r[`user_${e}`]=this.properties[e];return{type:d.FEATURE,properties:r,geometry:{coordinates:this.getCoordinates(),type:this.type}}};let ea=function(e,r){eo.call(this,e,r)};ea.prototype=Object.create(eo.prototype),ea.prototype.isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},ea.prototype.updateCoordinate=function(e,r,i){3==arguments.length?this.coordinates=[r,i]:this.coordinates=[e,r],this.changed()},ea.prototype.getCoordinate=function(){return this.getCoordinates()};let es=function(e,r){eo.call(this,e,r)};es.prototype=Object.create(eo.prototype),es.prototype.isValid=function(){return this.coordinates.length>1},es.prototype.addCoordinate=function(e,r,i){this.changed();let n=parseInt(e,10);this.coordinates.splice(n,0,[r,i])},es.prototype.getCoordinate=function(e){let r=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[r]))},es.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)},es.prototype.updateCoordinate=function(e,r,i){let n=parseInt(e,10);this.coordinates[n]=[r,i],this.changed()};let el=function(e,r){eo.call(this,e,r),this.coordinates=this.coordinates.map(e=>e.slice(0,-1))};el.prototype=Object.create(eo.prototype),el.prototype.isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every(e=>e.length>2)},el.prototype.incomingCoords=function(e){this.coordinates=e.map(e=>e.slice(0,-1)),this.changed()},el.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},el.prototype.addCoordinate=function(e,r,i){this.changed();let n=e.split(".").map(e=>parseInt(e,10));this.coordinates[n[0]].splice(n[1],0,[r,i])},el.prototype.removeCoordinate=function(e){this.changed();let r=e.split(".").map(e=>parseInt(e,10)),i=this.coordinates[r[0]];i&&(i.splice(r[1],1),i.length<3&&this.coordinates.splice(r[0],1))},el.prototype.getCoordinate=function(e){let r=e.split(".").map(e=>parseInt(e,10));return JSON.parse(JSON.stringify(this.coordinates[r[0]][r[1]]))},el.prototype.getCoordinates=function(){return this.coordinates.map(e=>e.concat([e[0]]))},el.prototype.updateCoordinate=function(e,r,i){this.changed();let n=e.split("."),o=parseInt(n[0],10),a=parseInt(n[1],10);void 0===this.coordinates[o]&&(this.coordinates[o]=[]),this.coordinates[o][a]=[r,i]};let eu={MultiPoint:ea,MultiLineString:es,MultiPolygon:el},ec=(e,r,i,n,o)=>{let a=i.split("."),s=parseInt(a[0],10),l=a[1]?a.slice(1).join("."):null;return e[s][r](l,n,o)},eh=function(e,r){if(eo.call(this,e,r),delete this.coordinates,this.model=eu[r.geometry.type],void 0===this.model)throw TypeError(`${r.geometry.type} is not a valid type`);this.features=this._coordinatesToFeatures(r.geometry.coordinates)};function ep(e){this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}eh.prototype=Object.create(eo.prototype),eh.prototype._coordinatesToFeatures=function(e){let r=this.model.bind(this);return e.map(e=>new r(this.ctx,{id:en(),type:d.FEATURE,properties:{},geometry:{coordinates:e,type:this.type.replace("Multi","")}}))},eh.prototype.isValid=function(){return this.features.every(e=>e.isValid())},eh.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()},eh.prototype.getCoordinate=function(e){return ec(this.features,"getCoordinate",e)},eh.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(e=>e.type===d.POLYGON?e.getCoordinates():e.coordinates)))},eh.prototype.updateCoordinate=function(e,r,i){ec(this.features,"updateCoordinate",e,r,i),this.changed()},eh.prototype.addCoordinate=function(e,r,i){ec(this.features,"addCoordinate",e,r,i),this.changed()},eh.prototype.removeCoordinate=function(e){ec(this.features,"removeCoordinate",e),this.changed()},eh.prototype.getFeatures=function(){return this.features},ep.prototype.setSelected=function(e){return this._ctx.store.setSelected(e)},ep.prototype.setSelectedCoordinates=function(e){this._ctx.store.setSelectedCoordinates(e),e.reduce((e,r)=>(void 0===e[r.feature_id]&&(e[r.feature_id]=!0,this._ctx.store.get(r.feature_id).changed()),e),{})},ep.prototype.getSelected=function(){return this._ctx.store.getSelected()},ep.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},ep.prototype.isSelected=function(e){return this._ctx.store.isSelected(e)},ep.prototype.getFeature=function(e){return this._ctx.store.get(e)},ep.prototype.select=function(e){return this._ctx.store.select(e)},ep.prototype.deselect=function(e){return this._ctx.store.deselect(e)},ep.prototype.deleteFeature=function(e,r={}){return this._ctx.store.delete(e,r)},ep.prototype.addFeature=function(e,r={}){return this._ctx.store.add(e,r)},ep.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},ep.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},ep.prototype.setActionableState=function(e={}
113){let r={trash:e.trash||!1,combineFeatures:e.combineFeatures||!1,uncombineFeatures:e.uncombineFeatures||!1};return this._ctx.events.actionable(r)},ep.prototype.changeMode=function(e,r={},i={}){return this._ctx.events.changeMode(e,r,i)},ep.prototype.fire=function(e,r){return this._ctx.events.fire(e,r)},ep.prototype.updateUIClasses=function(e){return this._ctx.ui.queueMapClasses(e)},ep.prototype.activateUIButton=function(e){return this._ctx.ui.setActiveButton(e)},ep.prototype.featuresAt=function(e,r,i="click"){if("click"!==i&&"touch"!==i)throw Error("invalid buffer type");return K[i](e,r,this._ctx)},ep.prototype.newFeature=function(e){let r=e.geometry.type;return r===d.POINT?new ea(this._ctx,e):r===d.LINE_STRING?new es(this._ctx,e):r===d.POLYGON?new el(this._ctx,e):new eh(this._ctx,e)},ep.prototype.isInstanceOf=function(e,r){if(e===d.POINT)return r instanceof ea;if(e===d.LINE_STRING)return r instanceof es;if(e===d.POLYGON)return r instanceof el;if("MultiFeature"===e)return r instanceof eh;throw Error(`Unknown feature class: ${e}`)},ep.prototype.doRender=function(e){return this._ctx.store.featureChanged(e)},ep.prototype.onSetup=function(){},ep.prototype.onDrag=function(){},ep.prototype.onClick=function(){},ep.prototype.onMouseMove=function(){},ep.prototype.onMouseDown=function(){},ep.prototype.onMouseUp=function(){},ep.prototype.onMouseOut=function(){},ep.prototype.onKeyUp=function(){},ep.prototype.onKeyDown=function(){},ep.prototype.onTouchStart=function(){},ep.prototype.onTouchMove=function(){},ep.prototype.onTouchEnd=function(){},ep.prototype.onTap=function(){},ep.prototype.onStop=function(){},ep.prototype.onTrash=function(){},ep.prototype.onCombineFeature=function(){},ep.prototype.onUncombineFeature=function(){},ep.prototype.toDisplayFeatures=function(){throw Error("You must overwrite toDisplayFeatures")};let ed={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},ef=Object.keys(ed),em=function(e){return[].concat(e).filter(e=>void 0!==e)};function eg(){let e=this;if(!(e.ctx.map&&void 0!==e.ctx.map.getSource(c.HOT)))return l();let r=e.ctx.events.currentModeName();e.ctx.ui.queueMapClasses({mode:r});let i=[],n=[];e.isDirty?n=e.getAllIds():(i=e.getChangedIds().filter(r=>void 0!==e.get(r)),n=e.sources.hot.filter(r=>r.properties.id&&-1===i.indexOf(r.properties.id)&&void 0!==e.get(r.properties.id)).map(e=>e.properties.id)),e.sources.hot=[];let o=e.sources.cold.length;e.sources.cold=e.isDirty?[]:e.sources.cold.filter(e=>{let r=e.properties.id||e.properties.parent;return -1===i.indexOf(r)});let a=o!==e.sources.cold.length||n.length>0;function s(i,n){let o=e.get(i).internal(r);e.ctx.events.currentModeRender(o,i=>{i.properties.mode=r,e.sources[n].push(i)})}function l(){e.isDirty=!1,e.clearChangedIds()}i.forEach(e=>
113s(e,"hot")),n.forEach(e=>s(e,"cold")),a&&e.ctx.map.getSource(c.COLD).setData({type:d.FEATURE_COLLECTION,features:e.sources.cold}),e.ctx.map.getSource(c.HOT).setData({type:d.FEATURE_COLLECTION,features:e.sources.hot}),l()}function e_(e){let r;this._features={},this._featureIds=new Z,this._selectedFeatureIds=new Z,this._selectedCoordinates=[],this._changedFeatureIds=new Z,this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=e,this.sources={hot:[],cold:[]},this.render=()=>{r||(r=requestAnimationFrame(()=>{r=null,eg.call(this),this._emitSelectionChange&&(this.ctx.events.fire(m.SELECTION_CHANGE,{features:this.getSelected().map(e=>e.toGeoJSON()),points:this.getSelectedCoordinates().map(e=>({type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:e.coordinates}}))}),this._emitSelectionChange=!1),this.ctx.events.fire(m.RENDER,{})}))},this.isDirty=!1}function ey(e,r={}){let i=e._selectedCoordinates.filter(r=>e._selectedFeatureIds.has(r.feature_id));e._selectedCoordinates.length===i.length||r.silent||(e._emitSelectionChange=!0),e._selectedCoordinates=i}e_.prototype.createRenderBatch=function(){let e=this.render,r=0;return this.render=function(){r++},()=>{this.render=e,r>0&&this.render()}},e_.prototype.setDirty=function(){return this.isDirty=!0,this},e_.prototype.featureCreated=function(e,r={}){if(this._changedFeatureIds.add(e),!0!==(null!=r.silent?r.silent:this.ctx.options.suppressAPIEvents)){let r=this.get(e);this.ctx.events.fire(m.CREATE,{features:[r.toGeoJSON()]})}return this},e_.prototype.featureChanged=function(e,r={}){return this._changedFeatureIds.add(e),!0!==(null!=r.silent?r.silent:this.ctx.options.suppressAPIEvents)&&this.ctx.events.fire(m.UPDATE,{action:r.action?r.action:g.CHANGE_COORDINATES,features:[this.get(e).toGeoJSON()]}),this},e_.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},e_.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},e_.prototype.getAllIds=function(){return this._featureIds.values()},e_.prototype.add=function(e,r={}){return this._features[e.id]=e,this._featureIds.add(e.id),this.featureCreated(e.id,{silent:r.silent}),this},e_.prototype.delete=function(e,r={}){let i=[];return em(e).forEach(e=>{this._featureIds.has(e)&&(this._featureIds.delete(e),this._selectedFeatureIds.delete(e),r.silent||-1!==i.indexOf(this._features[e])||i.push(this._features[e].toGeoJSON()),delete this._features[e],this.isDirty=!0)}),i.length&&this.ctx.events.fire(m.DELETE,{features:i}),ey(this,r),this},e_.prototype.get=function(e){return this._features[e]},e_.prototype.getAll=function(){return Object.keys(this._features).map(e=>this._features[e])},e_.prototype.select=function(e,r={}){return em(e).forEach(e=>{!this._selectedFeatureIds.has(e)&&(this._selectedFeatureIds.add(e),this._changedFeatureIds.add(e),r.silent||(this._emitSelectionChange=!0))}),this},e_.prototype.deselect=function(e,r={}){return em(e).forEach(e=>{this._selectedFeatureIds.has(e)&&(this._selectedFeatureIds.delete(e),this._changedFeatureIds.add(e),r.silent||(this._emitSelectionChange=!0))}),ey(this,r),this},e_.prototype.clearSelected=function(e={}){return this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this},e_.prototype.setSelected=function(e,r={}){return e=em(e),this.deselect(this._selectedFeatureIds.values().filter(r=>-1===e.indexOf(r)),{silent:r.silent}),this.select(e.filter(e=>!this._selectedFeatureIds.has(e)),{silent:r.silent}),this},e_.prototype.setSelectedCoordinates=function(e){return this._selectedCoordinates=e,this._emitSelectionChange=!0,this},e_.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},e_.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},e_.prototype.getSelected=function(){return this.getSelectedIds().map(e=>this.get(e))},e_.prototype.getSelectedCoordinates=function(){return this._selectedCoordinates.map(e=>({coordinates:this.get(e.feature_id).getCoordinate(e.coord_path)}))},e_.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)},e_.prototype.setFeatureProperty=function(e,r,i,n={}){this.get(e).setProperty(r,i),this.featureChanged(e,{silent:n.silent,action:g.CHANGE_PROPERTIES})}
113,e_.prototype.storeMapConfig=function(){v.forEach(e=>{this.ctx.map[e]&&(this._mapInitialConfig[e]=this.ctx.map[e].isEnabled())})},e_.prototype.restoreMapConfig=function(){Object.keys(this._mapInitialConfig).forEach(e=>{this._mapInitialConfig[e]?this.ctx.map[e].enable():this.ctx.map[e].disable()})},e_.prototype.getInitialConfigValue=function(e){return void 0===this._mapInitialConfig[e]||this._mapInitialConfig[e]};let ev=["mode","feature","mouse"],ex="#3bb2d0",eb="#fbb03b",ew="#fff",eE=[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":["case",["==",["get","active"],"true"],eb,ex],"fill-opacity":.1}},{id:"gl-draw-lines",type:"line",filter:["any",["==","$type","LineString"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["==",["get","active"],"true"],eb,ex],"line-dasharray":["case",["==",["get","active"],"true"],[.2,2],[2,0]],"line-width":2}},{id:"gl-draw-point-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":ew}},{id:"gl-draw-point-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":["case",["==",["get","active"],"true"],eb,ex]}},{id:"gl-draw-vertex-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":ew}},{id:"gl-draw-vertex-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":eb}},{id:"gl-draw-midpoint",type:"circle",filter:["all",["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":eb}}];function eS(e,r){this.x=e,this.y=r}eS.prototype={clone(){return new eS(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,r){return this.clone()._rotateAround(e,r)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let r=e.x-this.x,i=e.y-this.y;return r*r+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)},_matMult(e){let r=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=r,this.y=i,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let r=Math.cos(e),i=Math.sin(e),n=r*this.x-i*this.y,o=i*this.x+r*this.y;return this.x=n,this.y=o,this},_rotateAround(e,r){let i=Math.cos(e),n=Math.sin(e),o=r.x+i*(this.x-r.x)-n*(this.y-r.y),a=r.y+n*(this.x-r.x)+i*(this.y-r.y);return this.x=o,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:eS},eS.convert=function(e){if(e instanceof eS)return e;if(Array.isArray(e))return new eS(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new eS(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};let eT=function(e,r){let i=r.getBoundingClientRect();return new eS(e.clientX-i.left-(r.clientLeft||0),e.clientY-i.top-(r.clientTop||0))};function eI(e,r,i,n){return{type:d.FEATURE,properties:{meta:_.VERTEX,parent:e,coord_path:i,active:n?y.ACTIVE:y.INACTIVE},geometry:{type:d.POINT,coordinates:r}}}function eM(e){let r={type:"Feature"};return Object.keys(e).forEach(i=>
113{switch(i){case"type":case"properties":case"geometry":return;default:r[i]=e[i]}}),r.properties=function e(r){let i={};return r&&Object.keys(r).forEach(n=>{let o=r[n];"object"==typeof o?null===o?i[n]=null:Array.isArray(o)?i[n]=o.map(e=>e):i[n]=e(o):i[n]=o}),i}(e.properties),null==e.geometry?r.geometry=null:r.geometry=eC(e.geometry),r}function eC(e){let r={type:e.type};return(e.bbox&&(r.bbox=e.bbox),"GeometryCollection"===e.type)?r.geometries=e.geometries.map(e=>eC(e)):r.coordinates=function e(r){return"object"!=typeof r[0]?r.slice():r.map(r=>e(r))}(e.coordinates),r}function eA(e,r={}){return eP(e,"mercator",r)}function eP(e,r,i={}){var n,o=(i=i||{}).mutate;if(!e)throw Error("geojson is required");return!Array.isArray(e)||isNaN(n=e[0])||null===n||Array.isArray(n)?(!0!==o&&(e=function(e){if(!e)throw Error("geojson is required");switch(e.type){case"Feature":return eM(e);case"FeatureCollection":var r;let i;return i={type:"FeatureCollection"},Object.keys(r=e).forEach(e=>{switch(e){case"type":case"features":return;default:i[e]=r[e]}}),i.features=r.features.map(e=>eM(e)),i;case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return eC(e);default:throw Error("unknown GeoJSON type")}}(e)),function e(r,i,n){if(null!==r)for(var o,a,s,l,u,c,h,p,d=0,f=0,m=r.type,g="FeatureCollection"===m,_="Feature"===m,y=g?r.features.length:1,v=0;v<y;v++){u=(p=!!(h=g?r.features[v].geometry:_?r.geometry:r)&&"GeometryCollection"===h.type)?h.geometries.length:1;for(var x=0;x<u;x++){var b=0,w=0;if(null!==(l=p?h.geometries[x]:h)){c=l.coordinates;var E=l.type;switch(d=n&&("Polygon"===E||"MultiPolygon"===E)?1:0,E){case null:break;case"Point":if(!1===i(c,f,v,b,w))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(o=0;o<c.length;o++){if(!1===i(c[o],f,v,b,w))return!1;f++,"MultiPoint"===E&&b++}"LineString"===E&&b++;break;case"Polygon":case"MultiLineString":for(o=0;o<c.length;o++){for(a=0;a<c[o].length-d;a++){if(!1===i(c[o][a],f,v,b,w))return!1;f++}"MultiLineString"===E&&b++,"Polygon"===E&&w++}"Polygon"===E&&b++;break;case"MultiPolygon":for(o=0;o<c.length;o++){for(a=0,w=0;a<c[o].length;a++){for(s=0;s<c[o][a].length-d;s++){if(!1===i(c[o][a][s],f,v,b,w))return!1;f++}w++}b++}break;case"GeometryCollection":for(o=0;o<l.geometries.length;o++)if(!1===e(l.geometries[o],i,n))return!1;break;default:throw Error("Unknown Geometry Type")}}}}}(e,function(e){var i="mercator"===r?eL(e):eO(e);e[0]=i[0],e[1]=i[1]})):e="mercator"===r?eL(e):eO(e),e}function eL(e){var r,i=Math.PI/180,n=[6378137*(180>=Math.abs(e[0])?e[0]:e[0]-360*((r=e[0])<0?-1:+(r>0)))*i,6378137*Math.log(Math.tan(.25*Math.PI+.5*e[1]*i))];return n[0]>20037508.342789244&&(n[0]=20037508.342789244),n[0]<-20037508.342789244&&(n[0]=-20037508.342789244),n[1]>20037508.342789244&&(n[1]=20037508.342789244),n[1]<-20037508.342789244&&(n[1]=-20037508.342789244),n}function eO(e){var r=180/Math.PI;return[e[0]*r/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-e[1]/6378137)))*r]}function eD(e,r,i){let n=r.geometry.coordinates,o=i.geometry.coordinates;if(n[1]>E||n[1]<b||o[1]>E||o[1]<b)return null;let a=eA(n),s=eA(o),l=e=>Number(e.toFixed(8)),u=function(e,r={}){return eP(e,"wgs84",r)}([(a[0]+s[0])/2,(a[1]+s[1])/2]),c=[l(u[0]),l(u[1])];return{type:d.FEATURE,properties:{meta:_.MIDPOINT,parent:e,lng:c[0],lat:c[1],coord_path:i.properties.coord_path},geometry:{type:d.POINT,coordinates:c}}}let eR=function e(r,i={},n=null){let o,{type:a,coordinates:s}=r.geometry,l=r.properties&&r.properties.id,u=[];function c(e,r){let n="",o=null;e.forEach((e,a)=>{let s=null!=r?`${r}.${a}`:String(a),c=eI(l,e,s,h(s));if(i.midpoints&&o){let e=eD(l,o,c);e&&u.push(e)}o=c;let p=JSON.stringify(e);n!==p&&u.push(c),0===a&&(n=p)})}function h(e){return!!i.selectedPaths&&-1!==i.selectedPaths.indexOf(e)}return a===d.POINT?u.push(eI(l,s,n,h(n))):a===d.POLYGON?s.forEach((e,r)=>{c(e,null!==n?`${n}.${r}`:String(r))}):a===d.LINE_STRING?c(s,n):0===a.indexOf(d.MULTI_PREFIX)&&(o=a.replace(d.MULTI_PREFIX,""),s.forEach((n,a)=>{let s={type:d.FEATURE,properties:r.properties,geometry:{type:o,coordinates:n}};u=u.concat(e(s,i,a))})),u},ek={enable(e){setTimeout(()=>{e.map&&e.map.doubleClickZoom&&e._ctx&&e._ctx.store&&e._ctx.store.getInitialConfigValue&&e._ctx.store.getInitialConfigValue("doubleClickZoom")&&e.map.doubleClickZoom.enable()},0)},disable(e){setTimeout(()=>{e.map&&e.map.doubleClickZoom&&e.map.doubleClickZoom.disable()},0)}},{LAT_MIN:eN,LAT_MAX:eF,LAT_RENDERED_MIN:ez,LAT_RENDERED_MAX:eB,LNG_MIN:eU,LNG_MAX:ej}=n;function eV(e,r){let i=eN,n=eF,o=eN,a=eF,s=ej,l=eU;
113return e.forEach(e=>{let r,u,c,h,p,d,f=(r=({Point:0,LineString:1,Polygon:2,MultiPoint:1,MultiLineString:2,MultiPolygon:3})[e.geometry.type],c=(u=[e.geometry.coordinates].flat(r)).map(e=>e[0]),h=u.map(e=>e[1]),p=e=>Math.min.apply(null,e),d=e=>Math.max.apply(null,e),[p(c),p(h),d(c),d(h)]),m=f[1],g=f[3],_=f[0],y=f[2];m>i&&(i=m),g<n&&(n=g),g>o&&(o=g),m<a&&(a=m),_<s&&(s=_),y>l&&(l=y)}),i+r.lat>eB&&(r.lat=eB-i),o+r.lat>eF&&(r.lat=eF-o),n+r.lat<ez&&(r.lat=ez-n),a+r.lat<eN&&(r.lat=eN-a),s+r.lng<=eU&&(r.lng+=360*Math.ceil(Math.abs(r.lng)/360)),l+r.lng>=ej&&(r.lng-=360*Math.ceil(Math.abs(r.lng)/360)),r}function eG(e,r){let i=eV(e.map(e=>e.toGeoJSON()),r);e.forEach(e=>{let r,n=e.getCoordinates(),o=e=>{let r={lng:e[0]+i.lng,lat:e[1]+i.lat};return[r.lng,r.lat]},a=e=>e.map(e=>o(e));e.type===d.POINT?r=o(n):e.type===d.LINE_STRING||e.type===d.MULTI_POINT?r=n.map(o):e.type===d.POLYGON||e.type===d.MULTI_LINE_STRING?r=n.map(a):e.type===d.MULTI_POLYGON&&(r=n.map(e=>e.map(e=>a(e)))),e.incomingCoords(r)})}let eq={};eq.onSetup=function(e){let r={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initialDragPanState:this.map.dragPan.isEnabled(),initiallySelectedFeatureIds:e.featureIds||[]};return this.setSelected(r.initiallySelectedFeatureIds.filter(e=>void 0!==this.getFeature(e))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),r},eq.fireUpdate=function(){this.fire(m.UPDATE,{action:g.MOVE,features:this.getSelected().map(e=>e.toGeoJSON())})},eq.fireActionable=function(){let e=this.getSelected(),r=e.filter(e=>this.isInstanceOf("MultiFeature",e)),i=!1;if(e.length>1){i=!0;let r=e[0].type.replace("Multi","");e.forEach(e=>{e.type.replace("Multi","")!==r&&(i=!1)})}let n=r.length>0,o=e.length>0;this.setActionableState({combineFeatures:i,uncombineFeatures:n,trash:o})},eq.getUniqueIds=function(e){return e.length?e.map(e=>e.properties.id).filter(e=>void 0!==e).reduce((e,r)=>(e.add(r),e),new Z).values():[]},eq.stopExtendedInteractions=function(e){e.boxSelectElement&&(e.boxSelectElement.parentNode&&e.boxSelectElement.parentNode.removeChild(e.boxSelectElement),e.boxSelectElement=null),(e.canDragMove||e.canBoxSelect)&&!0===e.initialDragPanState&&this.map.dragPan.enable(),e.boxSelecting=!1,e.canBoxSelect=!1,e.dragMoving=!1,e.canDragMove=!1},eq.onStop=function(){ek.enable(this)},eq.onMouseMove=function(e,r){return L(r)&&e.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(e),!0},eq.onMouseOut=function(e){return!e.dragMoving||this.fireUpdate()},eq.onTap=eq.onClick=function(e,r){return P(r)?this.clickAnywhere(e,r):I(_.VERTEX)(r)?this.clickOnVertex(e,r):L(r)?this.clickOnFeature(e,r):void 0},eq.clickAnywhere=function(e){let r=this.getSelectedIds();r.length&&(this.clearSelectedFeatures(),r.forEach(e=>this.doRender(e))),ek.enable(this),this.stopExtendedInteractions(e)},eq.clickOnVertex=function(e,r){this.changeMode(f.DIRECT_SELECT,{featureId:r.featureTarget.properties.parent,coordPath:r.featureTarget.properties.coord_path,startPos:r.lngLat}),this.updateUIClasses({mouse:h.MOVE})},eq.startOnActiveFeature=function(e,r){this.stopExtendedInteractions(e),this.map.dragPan.disable(),this.doRender(r.featureTarget.properties.id),e.canDragMove=!0,e.dragMoveLocation=r.lngLat},eq.clickOnFeature=function(e,r){ek.disable(this),this.stopExtendedInteractions(e);let i=D(r),n=this.getSelectedIds(),o=r.featureTarget.properties.id,a=this.isSelected(o);if(!i&&a&&this.getFeature(o).type!==d.POINT)return this.changeMode(f.DIRECT_SELECT,{featureId:o});a&&i?(this.deselect(o),this.updateUIClasses({mouse:h.POINTER}),1===n.length&&ek.enable(this)):!a&&i?(this.select(o),this.updateUIClasses({mouse:h.MOVE})):a||i||(n.forEach(e=>this.doRender(e)),this.setSelected(o),this.updateUIClasses({mouse:h.MOVE})),this.doRender(o)},eq.onMouseDown=function(e,r){return(e.initialDragPanState=this.map.dragPan.isEnabled(),C(r))?this.startOnActiveFeature
113(e,r):this.drawConfig.boxSelect&&M(r)?this.startBoxSelect(e,r):void 0},eq.startBoxSelect=function(e,r){this.stopExtendedInteractions(e),this.map.dragPan.disable(),e.boxSelectStartLocation=eT(r.originalEvent,this.map.getContainer()),e.canBoxSelect=!0},eq.onTouchStart=function(e,r){if(C(r))return this.startOnActiveFeature(e,r)},eq.onDrag=function(e,r){return e.canDragMove?this.dragMove(e,r):this.drawConfig.boxSelect&&e.canBoxSelect?this.whileBoxSelect(e,r):void 0},eq.whileBoxSelect=function(e,r){e.boxSelecting=!0,this.updateUIClasses({mouse:h.ADD}),e.boxSelectElement||(e.boxSelectElement=document.createElement("div"),e.boxSelectElement.classList.add(u.BOX_SELECT),this.map.getContainer().appendChild(e.boxSelectElement));let i=eT(r.originalEvent,this.map.getContainer()),n=Math.min(e.boxSelectStartLocation.x,i.x),o=Math.max(e.boxSelectStartLocation.x,i.x),a=Math.min(e.boxSelectStartLocation.y,i.y),s=Math.max(e.boxSelectStartLocation.y,i.y),l=`translate(${n}px, ${a}px)`;e.boxSelectElement.style.transform=l,e.boxSelectElement.style.WebkitTransform=l,e.boxSelectElement.style.width=`${o-n}px`,e.boxSelectElement.style.height=`${s-a}px`},eq.dragMove=function(e,r){e.dragMoving=!0,r.originalEvent.stopPropagation();let i={lng:r.lngLat.lng-e.dragMoveLocation.lng,lat:r.lngLat.lat-e.dragMoveLocation.lat};eG(this.getSelected(),i),e.dragMoveLocation=r.lngLat},eq.onTouchEnd=eq.onMouseUp=function(e,r){if(e.dragMoving)this.fireUpdate();else if(e.boxSelecting){let i=[e.boxSelectStartLocation,eT(r.originalEvent,this.map.getContainer())],n=this.featuresAt(null,i,"click"),o=this.getUniqueIds(n).filter(e=>!this.isSelected(e));o.length&&(this.select(o),o.forEach(e=>this.doRender(e)),this.updateUIClasses({mouse:h.MOVE}))}this.stopExtendedInteractions(e)},eq.toDisplayFeatures=function(e,r,i){r.properties.active=this.isSelected(r.properties.id)?y.ACTIVE:y.INACTIVE,i(r),this.fireActionable(),r.properties.active===y.ACTIVE&&r.geometry.type!==d.POINT&&eR(r).forEach(i)},eq.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},eq.onCombineFeatures=function(){let e=this.getSelected();if(0===e.length||e.length<2)return;let r=[],i=[],n=e[0].type.replace("Multi","");for(let o=0;o<e.length;o++){let a=e[o];if(a.type.replace("Multi","")!==n)return;
113a.type.includes("Multi")?a.getCoordinates().forEach(e=>{r.push(e)}):r.push(a.getCoordinates()),i.push(a.toGeoJSON())}if(i.length>1){let e=this.newFeature({type:d.FEATURE,properties:i[0].properties,geometry:{type:`Multi${n}`,coordinates:r}});this.addFeature(e),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([e.id]),this.fire(m.COMBINE_FEATURES,{createdFeatures:[e.toGeoJSON()],deletedFeatures:i})}this.fireActionable()},eq.onUncombineFeatures=function(){let e=this.getSelected();if(0===e.length)return;let r=[],i=[];for(let n=0;n<e.length;n++){let o=e[n];this.isInstanceOf("MultiFeature",o)&&(o.getFeatures().forEach(e=>{this.addFeature(e),e.properties=o.properties,r.push(e.toGeoJSON()),this.select([e.id])}),this.deleteFeature(o.id,{silent:!0}),i.push(o.toGeoJSON()))}r.length>1&&this.fire(m.UNCOMBINE_FEATURES,{createdFeatures:r,deletedFeatures:i}),this.fireActionable()};let eH=I(_.VERTEX),e$=I(_.MIDPOINT),eW={};eW.fireUpdate=function(){this.fire(m.UPDATE,{action:g.CHANGE_COORDINATES,features:this.getSelected().map(e=>e.toGeoJSON())})},eW.fireActionable=function(e){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:e.selectedCoordPaths.length>0})},eW.startDragging=function(e,r){null==e.initialDragPanState&&(e.initialDragPanState=this.map.dragPan.isEnabled()),this.map.dragPan.disable(),e.canDragMove=!0,e.dragMoveLocation=r.lngLat},eW.stopDragging=function(e){e.canDragMove&&!0===e.initialDragPanState&&this.map.dragPan.enable(),e.initialDragPanState=null,e.dragMoving=!1,e.canDragMove=!1,e.dragMoveLocation=null},eW.onVertex=function(e,r){this.startDragging(e,r);let i=r.featureTarget.properties,n=e.selectedCoordPaths.indexOf(i.coord_path);D(r)||-1!==n?D(r)&&-1===n&&e.selectedCoordPaths.push(i.coord_path):e.selectedCoordPaths=[i.coord_path];let o=this.pathsToCoordinates(e.featureId,e.selectedCoordPaths);this.setSelectedCoordinates(o)},eW.onMidpoint=function(e,r){this.startDragging(e,r);let i=r.featureTarget.properties;e.feature.addCoordinate(i.coord_path,i.lng,i.lat),this.fireUpdate(),e.selectedCoordPaths=[i.coord_path]},eW.pathsToCoordinates=function(e,r){return r.map(r=>({feature_id:e,coord_path:r}))},eW.onFeature=function(e,r){0===e.selectedCoordPaths.length?this.startDragging(e,r):this.stopDragging(e)},eW.dragFeature=function(e,r,i){eG(this.getSelected(),i),e.dragMoveLocation=r.lngLat},eW.dragVertex=function(e,r,i){let n=e.selectedCoordPaths.map(r=>e.feature.getCoordinate(r)),o=eV(n.map(e=>({type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:e}})),i);for(let r=0;r<n.length;r++){let i=n[r];e.feature.updateCoordinate(e.selectedCoordPaths[r],i[0]+o.lng,i[1]+o.lat)}},eW.clickNoTarget=function(){this.changeMode(f.SIMPLE_SELECT)},eW.clickInactive=function(){this.changeMode(f.SIMPLE_SELECT)},eW.clickActiveFeature=function(e){e.selectedCoordPaths=[],this.clearSelectedCoordinates(),e.feature.changed()},eW.onSetup=function(e){let r=e.featureId,i=this.getFeature(r);if(!i)throw Error("You must provide a featureId to enter direct_select mode");if(i.type===d.POINT)throw TypeError("direct_select mode doesn't handle point features");let n={featureId:r,feature:i,dragMoveLocation:e.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:e.coordPath?[e.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(r,n.selectedCoordPaths)),this.setSelected(r),ek.disable(this),this.setActionableState({trash:!0}),n},eW.onStop=function(){ek.enable(this),this.clearSelectedCoordinates()},eW.toDisplayFeatures=function(e,r,i){e.featureId===r.properties.id?(r.properties.active=y.ACTIVE,i(r),eR(r,{map:this.map,midpoints:!0,selectedPaths:e.selectedCoordPaths}).forEach(i)):(r.properties.active=y.INACTIVE,i(r)),this.fireActionable(e)},eW.onTrash=function(e){e.selectedCoordPaths.sort((e,r)=>r.localeCompare(e,"en",{numeric:!0})).forEach(r=>e.feature.removeCoordinate(r)),this.fireUpdate(),e.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(e),!1===e.feature.isValid()&&(this.deleteFeature([e.featureId]),this.changeMode(f.SIMPLE_SELECT,{}))},eW.onMouseMove=function(e,r){let i=C(r),n=eH(r),o=e$(r),a=0===e.selectedCoordPaths.length;return i&&a||n&&!a?this.updateUIClasses({mouse:h.MOVE}):this.updateUIClasses({mouse:h.NONE}),(n||i||o)&&e.dragMoving&&this.fireUpdate(),this.stopDragging(e),!0},eW.onMouseOut=function(e){return e.dragMoving&&this.fireUpdate(),!0},eW.onTouchStart=eW.onMouseDown=function(e,r){return eH(r)?this.onVertex(e,r):C(r)?this.onFeature(e,r):e$(r)?this.onMidpoint(e,r):void 0},eW.onDrag=function(e,r){if(!0!==e.canDragMove)return;e.dragMoving=!0,r.originalEvent.stopPropagation();let i={lng:r.lngLat.lng-e.dragMoveLocation.lng,lat:r.lngLat.lat-e.dragMoveLocation.lat};e.selectedCoordPaths.length>
1130?this.dragVertex(e,r,i):this.dragFeature(e,r,i),e.dragMoveLocation=r.lngLat},eW.onClick=function(e,r){return P(r)?this.clickNoTarget(e,r):C(r)?this.clickActiveFeature(e,r):A(r)?this.clickInactive(e,r):void this.stopDragging(e)},eW.onTap=function(e,r){return P(r)?this.clickNoTarget(e,r):C(r)?this.clickActiveFeature(e,r):A(r)?this.clickInactive(e,r):void 0},eW.onTouchEnd=eW.onMouseUp=function(e){e.dragMoving&&this.fireUpdate(),this.stopDragging(e)};let eY={};eY.onSetup=function(){let e=this.newFeature({type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:[]}});return this.addFeature(e),this.clearSelectedFeatures(),this.updateUIClasses({mouse:h.ADD}),this.activateUIButton(p.POINT),this.setActionableState({trash:!0}),{point:e}},eY.stopDrawingAndRemove=function(e){this.deleteFeature([e.point.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)},eY.onTap=eY.onClick=function(e,r){this.updateUIClasses({mouse:h.MOVE}),e.point.updateCoordinate("",r.lngLat.lng,r.lngLat.lat),this.fire(m.CREATE,{features:[e.point.toGeoJSON()]}),this.changeMode(f.SIMPLE_SELECT,{featureIds:[e.point.id]})},eY.onStop=function(e){this.activateUIButton(),e.point.getCoordinate().length||this.deleteFeature([e.point.id],{silent:!0})},eY.toDisplayFeatures=function(e,r,i){let n=r.properties.id===e.point.id;if(r.properties.active=n?y.ACTIVE:y.INACTIVE,!n)return i(r)},eY.onTrash=eY.stopDrawingAndRemove,eY.onKeyUp=function(e,r){if(R(r)||k(r))return this.stopDrawingAndRemove(e,r)};let eZ=function(e,r){return!!e.lngLat&&e.lngLat.lng===r[0]&&e.lngLat.lat===r[1]},eX={};eX.onSetup=function(){let e=this.newFeature({type:d.FEATURE,properties:{},geometry:{type:d.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),ek.disable(this),this.updateUIClasses({mouse:h.ADD}),this.activateUIButton(p.POLYGON),this.setActionableState({trash:!0}),{polygon:e,currentVertexPosition:0}},eX.clickAnywhere=function(e,r){if(e.currentVertexPosition>0&&eZ(r,e.polygon.coordinates[0][e.currentVertexPosition-1]))return this.changeMode(f.SIMPLE_SELECT,{featureIds:[e.polygon.id]});this.updateUIClasses({mouse:h.ADD}),e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,r.lngLat.lng,r.lngLat.lat),e.currentVertexPosition++,e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,r.lngLat.lng,r.lngLat.lat)},eX.clickOnVertex=function(e){return this.changeMode(f.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},eX.onMouseMove=function(e,r){e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,r.lngLat.lng,r.lngLat.lat),O(r)&&this.updateUIClasses({mouse:h.POINTER})},eX.onTap=eX.onClick=function(e,r){return O(r)?this.clickOnVertex(e,r):this.clickAnywhere(e,r)},eX.onKeyUp=function(e,r){R(r)?(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)):k(r)&&this.changeMode(f.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},eX.onStop=function(e){this.updateUIClasses({mouse:h.NONE}),ek.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.polygon.id)&&(e.polygon.removeCoordinate(`0.${e.currentVertexPosition}`),e.polygon.isValid()?this.fire(m.CREATE,{features:[e.polygon.toGeoJSON()]}):(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT,{},{silent:!0})))},eX.toDisplayFeatures=function(e,r,i){let n=r.properties.id===e.polygon.id;if(r.properties.active=n?y.ACTIVE:y.INACTIVE,!n)return i(r);if(0===r.geometry.coordinates.length)return;let o=r.geometry.coordinates[0].length;if(!(o<3)){if(r.properties.meta=_.FEATURE,i(eI(e.polygon.id,r.geometry.coordinates[0][0],"0.0",!1)),o>3){let n=r.geometry.coordinates[0].length-3;i(eI(e.polygon.id,r.geometry.coordinates[0][n],`0.${n}`,!1))}if(o<=4){let e=[[r.geometry.coordinates[0][0][0],r.geometry.coordinates[0][0][1]],[r.geometry.coordinates[0][1][0],r.geometry.coordinates[0][1][1]]];if(i({type:d.FEATURE,properties:r.properties,geometry:{coordinates:e,type:d.LINE_STRING}}),3===o)return}return i(r)}},eX.onTrash=function(e){this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)};let eK={};eK.onSetup=function(e){let r,i,n=(e=e||{}).featureId,o="forward";if(n){if(!(r=this.getFeature(n)))throw Error("Could not find a feature with the provided featureId");let a=e.from;if(a&&"Feature"===a.type&&a.geometry&&"Point"===a.geometry.type&&(a=a.geometry),a&&"Point"===a.type&&a.coordinates&&2===a.coordinates.length&&(a=a.coordinates),!a||!Array.isArray(a))throw Error("Please use the `from` property to indicate which point to continue the line from");let s=r.coordinates.length-1;if(r.coordinates[s][0]===a[0]&&r.coordinates[s][1]===a[1])i=s+1,r.addCoordinate(i,...r.coordinates[s]);else if(r.coordinates[0][0]===a[0]&&r.coordinates[0][1]===a[1])o="backwards",i=0,r.addCoordinate(i,...r.coordinates[0]);else throw Error("`from` should match the point at either the start or the end of the provided LineString")}else r=this.newFeature({type:d.FEATURE,properties:{},geometry:{type:d.LINE_STRING,coordinates:[]}}),i=0,this.addFeature(r);return this.clearSelectedFeatures(),ek.disable(this),this.updateUIClasses({mouse:h.ADD}),this.activateUIButton(p.LINE),this.setActionableState({trash:!0}),{line:r,currentVertexPosition:i,direction:o}},eK.clickAnywhere=function(e,r){if(e.currentVertexPosition>0&&eZ(r,e.line.coordinates[e.currentVertexPosition-1])||"backwards"===e.direction&&eZ(r,e.line.coordinates[e.currentVertexPosition+1]))return this.changeMode(f.SIMPLE_SELECT,{featureIds:[e.line.id]});this.updateUIClasses({mouse:h.ADD}),e.line.updateCoordinate(e.currentVertexPosition,r.lngLat.lng,r.lngLat.lat),"forward"===e.direction?(e.currentVertexPosition++,e.line.updateCoordinate(e.currentVertexPosition,r.lngLat.lng,r.lngLat.lat)):e.line.addCoordinate(0,r.lngLat.lng,r.lngLat.lat)},eK.clickOnVertex=function(e){return this.changeMode(f.SIMPLE_SELECT,{featureIds:[e.line.id]})},eK.onMouseMove=function(e,r){e.line.updateCoordinate(e.currentVertexPosition,r.lngLat.lng,r.lngLat.lat),O(r)&&this.updateUIClasses({mouse:h.POINTER})},eK.onTap=eK.onClick=function(e,r){if(O(r))return this.clickOnVertex(e,r);this.clickAnywhere(e,r)},eK.onKeyUp=function(e,r){k(r)?this.changeMode(f.SIMPLE_SELECT,{featureIds:[e.line.id]}
113):R(r)&&(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT))},eK.onStop=function(e){ek.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.line.id)&&(e.line.removeCoordinate(`${e.currentVertexPosition}`),e.line.isValid()?this.fire(m.CREATE,{features:[e.line.toGeoJSON()]}):(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT,{},{silent:!0})))},eK.onTrash=function(e){this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)},eK.toDisplayFeatures=function(e,r,i){let n=r.properties.id===e.line.id;if(r.properties.active=n?y.ACTIVE:y.INACTIVE,!n)return i(r);r.geometry.coordinates.length<2||(r.properties.meta=_.FEATURE,i(eI(e.line.id,r.geometry.coordinates["forward"===e.direction?r.geometry.coordinates.length-2:1],`${"forward"===e.direction?r.geometry.coordinates.length-2:1}`,!1)),i(r))};let eQ={simple_select:eq,direct_select:eW,draw_point:eY,draw_polygon:eX,draw_line_string:eK},eJ={defaultMode:f.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:eE,modes:eQ,controls:{},userProperties:!1,suppressAPIEvents:!0},e0={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},e1={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function e2(e,r){return e.map(e=>e.source?e:Object.assign({},e,{id:`${e.id}.${r}`,source:"hot"===r?c.HOT:c.COLD}))}var e3=i(34349),e5=i(7234);function e4(e,r){return e.length===r.length&&JSON.stringify(e.map(e=>e).sort())===JSON.stringify(r.map(e=>e).sort())}let e6={Polygon:el,LineString:es,Point:ea,MultiPolygon:eh,MultiLineString:eh,MultiPoint:eh},e8=function(e,r){var i;let n,o,a,s,l={options:e=function(e={}){let r=Object.assign({},e);return e.controls||(r.controls={}),!1===e.displayControlsDefault?r.controls=Object.assign({},e1,e.controls):r.controls=Object.assign({},e0,e.controls),(r=Object.assign({},eJ,r)).styles=e2(r.styles,"cold").concat(e2(r.styles,"hot")),r}(e)};(i=r).modes=f,n=void 0===l.options.suppressAPIEvents||!!l.options.suppressAPIEvents,i.getFeatureIdsAt=function(e){return K.click({point:e},null,l).map(e=>e.properties.id)},i.getSelectedIds=function(){return l.store.getSelectedIds()},i.getSelected=function(){return{type:d.FEATURE_COLLECTION,features:l.store.getSelectedIds().map(e=>l.store.get(e)).map(e=>e.toGeoJSON())}},i.getSelectedPoints=function(){return{type:d.FEATURE_COLLECTION,features:l.store.getSelectedCoordinates().map(e=>({type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:e.coordinates}}))}},i.set=function(e){if(void 0===e.type||e.type!==d.FEATURE_COLLECTION||!Array.isArray(e.features))throw Error("Invalid FeatureCollection");let r=l.store.createRenderBatch(),n=l.store.getAllIds().slice(),o=i.add(e),a=new Z(o);return(n=n.filter(e=>!a.has(e))).length&&i.delete(n),r(),o},i.add=function(e){let r=JSON.parse(JSON.stringify(e5(e))).features.map(e=>{if(e.id=e.id||en(),null===e.geometry)throw Error("Invalid geometry: null");if(void 0===l.store.get(e.id)||l.store.get(e.id).type!==e.geometry.type){let r=e6[e.geometry.type];if(void 0===r)throw Error(`Invalid geometry type: ${e.geometry.type}.`);let i=new r(l,e);l.store.add(i,{silent:n})}else{let r=l.store.get(e.id),i=r.properties;r.properties=e.properties,e3(i,e.properties)||l.store.featureChanged(r.id,{silent:n}),e3(r.getCoordinates(),e.geometry.coordinates)||r.incomingCoords(e.geometry.coordinates)}return e.id});return l.store.render(),r},i.get=function(e){let r=l.store.get(e);if(r)return r.toGeoJSON()},i.getAll=function(){return{type:d.FEATURE_COLLECTION,features:l.store.getAll().map(e=>e.toGeoJSON())}},i.delete=function(e){return l.store.delete(e,{silent:n}),i.getMode()!==f.DIRECT_SELECT||l.store.getSelectedIds().length?l.store.render():l.events.changeMode(f.SIMPLE_SELECT,void 0,{silent:n}),i},i.deleteAll=function(){return l.store.delete(l.store.getAllIds(),{silent:n}),i.getMode()===f.DIRECT_SELECT?l.events.changeMode(f.SIMPLE_SELECT,void 0,{silent:n}):l.store.render(),i},i.changeMode=function(e,r={}){return e===f.SIMPLE_SELECT&&i.getMode()===f.SIMPLE_SELECT?(e4(r.featureIds||[],l.store.getSelectedIds())||
113(l.store.setSelected(r.featureIds,{silent:n}),l.store.render()),i):(e===f.DIRECT_SELECT&&i.getMode()===f.DIRECT_SELECT&&r.featureId===l.store.getSelectedIds()[0]||l.events.changeMode(e,r,{silent:n}),i)},i.getMode=function(){return l.events.getMode()},i.trash=function(){return l.events.trash({silent:n}),i},i.combineFeatures=function(){return l.events.combineFeatures({silent:n}),i},i.uncombineFeatures=function(){return l.events.uncombineFeatures({silent:n}),i},i.setFeatureProperty=function(e,r,o){return l.store.setFeatureProperty(e,r,o,{silent:n}),i},l.api=r=i;let g=(o=null,a=null,s={onRemove(){return l.map.off("load",s.connect),clearInterval(a),s.removeLayers(),l.store.restoreMapConfig(),l.ui.removeButtons(),l.events.removeEventListeners(),l.ui.clearMapClasses(),l.boxZoomInitial&&l.map.boxZoom.enable(),l.map=null,l.container=null,l.store=null,o&&o.parentNode&&o.parentNode.removeChild(o),o=null,this},connect(){l.map.off("load",s.connect),clearInterval(a),s.addLayers(),l.store.storeMapConfig(),l.events.addEventListeners()},onAdd(e){if(l.map=e,l.events=function(e){let r=Object.keys(e.options.modes).reduce((r,i)=>{var n;let o;return r[i]=(o=Object.keys(n=e.options.modes[i]),function(e,r={}){let i={},a=o.reduce((e,r)=>(e[r]=n[r],e),new ep(e));return{start(){i=a.onSetup(r),ef.forEach(e=>{let r=ed[e],o=()=>!1;n[r]&&(o=()=>!0),this.on(e,o,e=>a[r](i,e))})},stop(){a.onStop(i)},trash(){a.onTrash(i)},combineFeatures(){a.onCombineFeatures(i)},uncombineFeatures(){a.onUncombineFeatures(i)},render(e,r){a.toDisplayFeatures(i,e,r)}}}),r},{}),i={},n={},o={},a=null,s=null;o.drag=function(r,i){i({point:r.point,time:new Date().getTime()})?(e.ui.queueMapClasses({mouse:h.DRAG}),s.drag(r)):r.originalEvent.stopPropagation()},o.mousedrag=function(e){o.drag(e,e=>!et(i,e))},o.touchdrag=function(e){o.drag(e,e=>!er(n,e))},o.mousemove=function(r){if(1===(void 0!==r.originalEvent.buttons?r.originalEvent.buttons:r.originalEvent.which))return o.mousedrag(r);let i=J(r,e);r.featureTarget=i,s.mousemove(r)},o.mousedown=function(r){i={time:new Date().getTime(),point:r.point};let n=J(r,e);r.featureTarget=n,s.mousedown(r)},o.mouseup=function(r){let n=J(r,e);r.featureTarget=n,et(i,{point:r.point,time:new Date().getTime()})?s.click(r):s.mouseup(r)},o.mouseout=function(e){s.mouseout(e)},o.touchstart=function(r){if(!e.options.touchEnabled)return;n={time:new Date().getTime(),point:r.point};let i=K.touch(r,null,e)[0];r.featureTarget=i,s.touchstart(r)},o.touchmove=function(r){if(e.options.touchEnabled)return s.touchmove(r),o.touchdrag(r)},o.touchend=function(r){if(r.originalEvent.preventDefault(),!e.options.touchEnabled)return;let i=K.touch(r,null,e)[0];r.featureTarget=i,er(n,{time:new Date().getTime(),point:r.point})?s.tap(r):s.touchend(r)};let l=e=>{let r=N(e),i=F(e),n=j(e);return!(r||i||n)};function c(i,n,o={}){s.stop();let l=r[i];if(void 0===l)throw Error(`${i} is not valid`);a=i,s=ei(l(e,n),e),o.silent||e.map.fire(m.MODE_CHANGE,{mode:i}),e.store.setDirty(),e.store.render()}o.keydown=function(r){(r.srcElement||r.target).classList.contains(u.CANVAS)&&((N(r)||F(r))&&e.options.controls.trash?(r.preventDefault(),s.trash()):l(r)?s.keydown(r):z(r)&&e.options.controls.point?c(f.DRAW_POINT):B(r)&&e.options.controls.line_string?c(f.DRAW_LINE_STRING):U(r)&&e.options.controls.polygon&&c(f.DRAW_POLYGON))},o.keyup=function(e){l(e)&&s.keyup(e)},o.zoomend=function(){e.store.changeZoom()},o.data=function(r){if("style"===r.dataType){let{setup:r,map:i,options:n,store:o}=e;n.styles.some(e=>i.getLayer(e.id))||(r.addLayers(),o.setDirty(),o.render())}};let p={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start(){s=ei(r[a=e.options.defaultMode](e),e)},changeMode:c,actionable:function(r){let i=!1;Object.keys(r).forEach(e=>{if(void 0===p[e])throw Error("Invalid action type");p[e]!==r[e]&&(i=!0),p[e]=r[e]}),i&&e.map.fire(m.ACTIONABLE,{actions:p})},currentModeName:()=>a,currentModeRender:(e,r)=>s.render(e,r),fire(r,i){e.map&&e.map.fire(r,i)},addEventListeners(){e.map.on("mousemove",o.mousemove),e.map.on("mousedown",o.mousedown),e.map.on("mouseup",o.mouseup),e.map.on("data",o.data),e.map.on("touchmove",o.touchmove),e.map.on("touchstart",o.touchstart),e.map.on("touchend",o.touchend),e.container.addEventListener("mouseout",o.mou
113seout),e.options.keybindings&&(e.container.addEventListener("keydown",o.keydown),e.container.addEventListener("keyup",o.keyup))},removeEventListeners(){e.map.off("mousemove",o.mousemove),e.map.off("mousedown",o.mousedown),e.map.off("mouseup",o.mouseup),e.map.off("data",o.data),e.map.off("touchmove",o.touchmove),e.map.off("touchstart",o.touchstart),e.map.off("touchend",o.touchend),e.container.removeEventListener("mouseout",o.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",o.keydown),e.container.removeEventListener("keyup",o.keyup))},trash(e){s.trash(e)},combineFeatures(){s.combineFeatures()},uncombineFeatures(){s.uncombineFeatures()},getMode:()=>a}}(l),l.ui=function(e){let r={},i=null,n={mode:null,feature:null,mouse:null},o={mode:null,feature:null,mouse:null};function a(e){o=Object.assign(o,e)}function s(){if(!e.container)return;let r=[],i=[];ev.forEach(e=>{o[e]!==n[e]&&(r.push(`${e}-${n[e]}`),null!==o[e]&&i.push(`${e}-${o[e]}`))}),r.length>0&&e.container.classList.remove(...r),i.length>0&&e.container.classList.add(...i),n=Object.assign(n,o)}function l(e,r={}){let n=document.createElement("button");return n.className=`${u.CONTROL_BUTTON} ${r.className}`,n.setAttribute("title",r.title),r.container.appendChild(n),n.addEventListener("click",n=>{if(n.preventDefault(),n.stopPropagation(),n.target===i){c(),r.onDeactivate();return}h(e),r.onActivate()},!0),n}function c(){i&&(i.classList.remove(u.ACTIVE_BUTTON),i=null)}function h(e){c();let n=r[e];n&&n&&"trash"!==e&&(n.classList.add(u.ACTIVE_BUTTON),i=n)}return{setActiveButton:h,queueMapClasses:a,updateMapClasses:s,clearMapClasses:function(){a({mode:null,feature:null,mouse:null}),s()},addButtons:function(){let i=e.options.controls,n=document.createElement("div");return n.className=`${u.CONTROL_GROUP} ${u.CONTROL_BASE}`,i&&(i[p.POINT]&&(r[p.POINT]=l(p.POINT,{container:n,className:u.CONTROL_BUTTON_POINT,title:`Marker tool ${e.options.keybindings?"(1)":""}`,onActivate:()=>e.events.changeMode(f.DRAW_POINT),onDeactivate:()=>e.events.trash()})),i[p.LINE]&&(r[p.LINE]=l(p.LINE,{container:n,className:u.CONTROL_BUTTON_LINE,title:`LineString tool ${e.options.keybindings?"(2)":""}`,onActivate:()=>e.events.changeMode(f.DRAW_LINE_STRING),onDeactivate:()=>e.events.trash()})),i[p.POLYGON]&&(r[p.POLYGON]=l(p.POLYGON,{container:n,className:u.CONTROL_BUTTON_POLYGON,title:`Polygon tool ${e.options.keybindings?"(3)":""}`,onActivate:()=>e.events.changeMode(f.DRAW_POLYGON),onDeactivate:()=>e.events.trash()})),i.trash&&(r.trash=l("trash",{container:n,className:u.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:()=>{e.events.trash()}})),i.combine_features&&(r.combine_features=l("combineFeatures",{container:n,className:u.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:()=>{e.events.combineFeatures()}})),i.uncombine_features&&(r.uncombine_features=l("uncombineFeatures",{container:n,className:u.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:()=>{e.events.uncombineFeatures()}}))),n},removeButtons:function(){Object.keys(r).forEach(e=>{let i=r[e];i.parentNode&&i.parentNode.removeChild(i),delete r[e]})}}}(l),l.container=e.getContainer(),l.store=new e_(l),o=l.ui.addButtons(),l.options.boxSelect){l.boxZoomInitial=e.boxZoom.isEnabled(),e.boxZoom.disable();let r=e.dragPan.isEnabled();e.dragPan.disable(),e.dragPan.enable(),r||e.dragPan.disable()}return e.loaded()?s.connect():(e.on("load",s.connect),a=setInterval(()=>{e.loaded()&&s.connect()},16)),l.events.start(),o},addLayers(){l.map.addSource(c.COLD,{data:{type:d.FEATURE_COLLECTION,features:[]},type:"geojson"}),l.map.addSource(c.HOT,{data:{type:d.FEATURE_COLLECTION,features:[]},type:"geojson"}),l.options.styles.forEach(e=>{l.map.addLayer(e)}),l.store.setDirty(!0),l.store.render()},removeLayers(){l.options.styles.forEach(e=>{l.map.getLayer(e.id)&&l.map.removeLayer(e.id)}),l.map.getSource(c.COLD)&&l.map.removeSource(c.COLD),l.map.getSource(c.HOT)&&l.map.removeSource(c.HOT)}},l.setup=s,s);return r.onAdd=g.onAdd,r.onRemove=g.onRemove,r.types=p,r.options=e,r};function e9(e){e8(e,this)}e9.modes=eQ,e9.constants=n,e9.lib=a;var e7=i(55283),te=i(80856),tt=i(85428),tr=i(35344),ti=i(67989),tn=i(84091);function to(e,...r){try{return e(...r),!0}catch{return!1}}function ta(e,r){e.changeMode("simple_select",{featureIds:[r]})}function ts(e,r){e.changeMode("direct_select",{featureId:r})}function tl(e,r,i,n){ta(e,i),n&&setTimeout(()=>{let e=r.current;e&&to(ts,e,i)},0)}let tu=(0,l.createContext)(null);function tc({children:e}
113){let{drawingGeojson:r,isDrawing:i,drawingModeCaller:n,setDrawingModeCaller:o,skipClearOnModeExit:a,setSkipClearOnModeExit:u,drawingColor:c,setDrawingColor:h,importFeatures:p,clearDrawing:d,selectFeatureForEditing:f,initializeMapboxDraw:m}=function(e={}){let{onRender:r}=e,i=(0,e7.JY)(),n=(0,l.useRef)(null),[o,a]=(0,l.useState)(tr.O),[s,u]=(0,l.useState)(null),[c,h]=(0,l.useState)(!1),p=(0,l.useRef)(!1),[d,f]=(0,l.useState)({type:"FeatureCollection",features:[]}),m=!!s||d.features.length>0,g=(0,l.useRef)(tr.O),_=(0,l.useRef)(r),y=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{p.current=e,h(e)},[]);(0,l.useEffect)(()=>{_.current=r},[r]);let x=(0,l.useCallback)(()=>{n.current&&f(n.current.getAll())},[]),b=(0,l.useCallback)(()=>{let e;if(!n.current)return;let r=n.current,i=r.getAll().features;if(0===i.length)return;let o=y.current,a=(o?i.find(e=>String(e.id)===o.featureId):void 0)??i[0],s=a?.id;if(null==s)return;let l=String(s);var u,c,h=g.current;r.setFeatureProperty(s,"color",h),u=r,c=s,(e=u.get(c))&&(r.add(e),1)&&o?.featureId===l&&to("direct_select"===o.mode?ts:ta,r,s)},[]),w=(0,l.useCallback)(e=>{if(!n.current)return;let r=n.current,i=r.getAll().features;if(0===i.length)return;let o=e?.featureId==null?void 0:String(e.featureId),a=(o?i.find(e=>String(e.id)===o):void 0)??i[0];if(a?.id==null)return;let s=a.id,l=String(s),u=a.geometry?.type,c="Point"!==u&&"MultiPoint"!==u;y.current={featureId:l,mode:c?"direct_select":"simple_select"},to(tl,r,n,s,c)||setTimeout(()=>{let e=n.current;e&&to(tl,e,n,s,c)},0)},[]),E=(0,l.useCallback)(e=>{n.current&&(n.current.set(e),x())},[x]),S=(0,l.useCallback)((e=!0)=>{if(n.current){if(n.current.deleteAll(),f({type:"FeatureCollection",features:[]}),y.current=null,e)a(tr.O);else if(s){let e=te.QL[s];n.current?.changeMode(e)}}},[s]),T=(0,l.useCallback)(e=>{if("simple_select"===e.mode&&0===n.current?.getAll().features.length&&s){let e=te.QL[s];n.current?.changeMode(e)}},[s]),I=(0,l.useCallback)(()=>{n.current?.changeMode("simple_select");let e=n.current?.getMode();e&&T({mode:e})},[T]),M=(0,l.useCallback)(e=>{if(n.current)return;let r=new e9({displayControlsDefault:!1,controls:{polygon:!0,line_string:!0,point:!0,trash:!0},userProperties:!0,styles:tr.A});n.current=r,e.addControl(r,"top-left");let i=(0,tt.nF)(()=>{let e=n.current?.getAll();e&&_.current&&_.current(e)},20),o=()=>{b(),x()};_.current&&e.on("draw.render",i),e.on("draw.create",o),e.on("draw.delete",x),e.on("draw.update",x);let a=()=>{if(e&&n.current)try{_.current&&e.off("draw.render",i),e.off("draw.create",o),e.off("draw.delete",x),e.off("draw.update",x),e.off("remove",a),e.hasControl(n.current)&&e.removeControl(n.current)}catch{}finally{n.current=null}};return e.on("remove",a),a},[x,b]);return(0,l.useEffect)(()=>{let e=i.map.current;if(!e||!n.current||!s)return;let r=()=>(0,tn.y)(e),o=te.QL[s];n.current.changeMode(o),r();let a=e.dragPan.isEnabled();a&&e.dragPan.disable(),(0,ti.dK)(e),e.on("contextmenu",I),e.on("draw.modechange",T),e.on("styledata",r);let l=(0,ti.D)(e,ti.Ap);return()=>{if(!e||!n.current)return;p.current||S();let i=e.getCanvas().style;i.removeProperty("cursor"),i.cursor="auto",a&&e.dragPan.enable(),e.off("contextmenu",I),e.off("draw.modechange",T),e.off("styledata",r),l()}},[S,s,i.map,I,T]),(0,l.useEffect)(()=>{g.current=o,b()},[o,b]),{drawingGeojson:d,isDrawing:m,drawingModeCaller:s,setDrawingModeCaller:u,skipClearOnModeExit:c,setSkipClearOnModeExit:v,drawingColor:o,setDrawingColor:a,importFeatures:E,clearDrawing:S,selectFeatureForEditing:w,initializeMapboxDraw:M}}(),[g,_]=(0,l.useState)(null),[y,v]=(0,l.useState)([]);return(0,s.jsx)(tu.Provider,{value:{drawingGeojson:r,isDrawing:i,drawingModeCaller:n,setDrawingModeCaller:o,skipClearOnModeExit:a,setSkipClearOnModeExit:u,drawingColor:c,setDrawingColor:h,importFeatures:p,clearDrawing:d,selectFeatureForEditing:f,initializeMapboxDraw:m,editGeometriesLayer:g,setEditGeometriesLayer:_,editGeometriesEnabled:!!g,deleteSelectionUuids:y,setDeleteSelectionUuids:v},children:e})}function th(){let e=(0,l.useContext)(tu);if(!e)throw Error("useMapboxDrawContext must be used within a MapboxDrawProvider");return e}}
113,64313:(e,r,i)=>{"use strict";var n=i(9912),o=i(85256),a=i(93710),s=i(15796),l=a.OrderedMap,u=a.List,c=function(e,r,i){if(e){var n=r.get(e);n&&r.set(e,i(n))}},h=function(e,r,i,n,o){if(!o)return e;var a="after"===n,s=r.getKey(),l=i.getKey(),h=r.getParentKey(),p=r.getNextSiblingKey(),d=r.getPrevSiblingKey(),f=i.getParentKey(),m=a?i.getNextSiblingKey():l,g=a?l:i.getPrevSiblingKey();return e.withMutations(function(e){c(h,e,function(e){var r=e.getChildKeys();return e.merge({children:r.delete(r.indexOf(s))})}),c(d,e,function(e){return e.merge({nextSibling:p})}),c(p,e,function(e){return e.merge({prevSibling:d})}),c(m,e,function(e){return e.merge({prevSibling:s})}),c(g,e,function(e){return e.merge({nextSibling:s})}),c(f,e,function(e){var r=e.getChildKeys(),i=r.indexOf(l),n=r.toArray();return n.splice(a?i+1:0!==i?i-1:0,0,s),e.merge({children:u(n)})}),c(s,e,function(e){return e.merge({nextSibling:m,prevSibling:g,parent:f})})})};e.exports=function(e,r,i,a){"replace"===a&&s(!1);var u=i.getKey(),c=r.getKey();c===u&&s(!1);var p=e.getBlockMap(),d=r instanceof n,f=[r],m=p.delete(c);d&&(f=[],m=p.withMutations(function(e){var i=r.getNextSiblingKey(),n=o(r,e);e.toSeq().skipUntil(function(e){return e.getKey()===c}).takeWhile(function(e){var r=e.getKey(),o=r===c,a=!i&&e.getParentKey()&&(!n||r!==n);return!!(o||i&&r!==i||a)}).forEach(function(r){f.push(r),e.delete(r.getKey())})}));var g=m.toSeq().takeUntil(function(e){return e===i}),_=m.toSeq().skipUntil(function(e){return e===i}).skip(1),y=f.map(function(e){return[e.getKey(),e]}),v=l();if("before"===a){var x=e.getBlockBefore(u);x&&x.getKey()===r.getKey()&&s(!1),v=g.concat([].concat(y,[[u,i]]),_).toOrderedMap()}else if("after"===a){var b=e.getBlockAfter(u);b&&b.getKey()===c&&s(!1),v=g.concat([[u,i]].concat(y),_).toOrderedMap()}return e.merge({blockMap:h(v,r,i,a,d),selectionBefore:e.getSelectionAfter(),selectionAfter:e.getSelectionAfter().merge({anchorKey:c,focusKey:c})})}},64485:(e,r,i)=>{"use strict";var n=i(9426);e.exports=function e(r){if(n(r)){var i=r.getAttribute("data-offset-key");if(i)return i;for(var o=0;o<r.childNodes.length;o++){var a=e(r.childNodes[o]);if(a)return a}}return null}},64545:e=>{"use strict";e.exports={getPunctuation:function(){return"[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞\xa1-\xb1\xb4-\xb8\xba\xbb\xbf]"}}},64754:e=>{"use strict";e.exports={logBlockedSelectionEvent:function(){return null},logSelectionStateFailure:function(){return null}}},65225:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},65701:(e,r,i)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=i(76061),l=Object.prototype.propertyIsEnumerable,u=!l.call({toString:null},"toString"),c=l.call(function(){},"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var r=e.constructor;return r&&r.prototype===e},d={$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("u"<typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}(),m=function(e){if("u"<typeof window||!f)return p(e);try{return p(e)}catch(e){return!1}};n=function(e){var r=null!==e&&"object"==typeof e,i="[object Function]"===a.call(e),n=s(e),l=r&&"[object String]"===a.call(e),p=[];if(!r&&!i&&!n)throw TypeError("Object.keys called on a non-object");var d=c&&i;if(l&&e.length>0&&!o.call(e,0))for(var f=0;f<e.length;++f)p.push(String(f));if(n&&e.length>0)for(var g=0;g<e.length;++g)p.push(String(g));else for(var _ in e)!(d&&"prototype"===_)&&o.call(e,_)&&p.push(String(_));if(u)for(var y=m(e),v=0;v<h.length;++v)!(y&&"constructor"===h[v])&&o.call(e,h[v])&&p.push(h[v]);return p}}
113e.exports=n},65829:(e,r,i)=>{var n=i(44335),o=i(91505),a=i(43791),s=i(87573).A,l=a.featureEach;a.coordEach,o.polygon;var u=o.featureCollection;function c(e){var r=new n(e);return r.insert=function(e){if("Feature"!==e.type)throw Error("invalid feature");return e.bbox=e.bbox?e.bbox:s(e),n.prototype.insert.call(this,e)},r.load=function(e){var r=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw Error("invalid features");e.bbox=e.bbox?e.bbox:s(e),r.push(e)}):l(e,function(e){if("Feature"!==e.type)throw Error("invalid features");e.bbox=e.bbox?e.bbox:s(e),r.push(e)}),n.prototype.load.call(this,r)},r.remove=function(e,r){if("Feature"!==e.type)throw Error("invalid feature");return e.bbox=e.bbox?e.bbox:s(e),n.prototype.remove.call(this,e,r)},r.clear=function(){return n.prototype.clear.call(this)},r.search=function(e){return u(n.prototype.search.call(this,this.toBBox(e)))},r.collides=function(e){return n.prototype.collides.call(this,this.toBBox(e))},r.all=function(){return u(n.prototype.all.call(this))},r.toJSON=function(){return n.prototype.toJSON.call(this)},r.fromJSON=function(e){return n.prototype.fromJSON.call(this,e)},r.toBBox=function(e){var r;if(e.bbox)r=e.bbox;else if(Array.isArray(e)&&4===e.length)r=e;else if(Array.isArray(e)&&6===e.length)r=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)r=s(e);else if("FeatureCollection"===e.type)r=s(e);else throw Error("invalid geojson");return{minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}},r}e.exports=c,e.exports.default=c},65865:e=>{"use strict";e.exports=TypeError},66530:(e,r,i)=>{"use strict";var n=i(28419),o=i(65865),a=i(66958),s=i(34140);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return s(n,a,e)}},66825:(e,r,i)=>{"use strict";var n=Array.prototype.slice,o=i(76061),a=Object.keys,s=a?function(e){return a(e)}:i(65701),l=Object.keys;s.shim=function(){return Object.keys?!function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)&&(Object.keys=function(e){return o(e)?l(n.call(e)):l(e)}):Object.keys=s,Object.keys||s},e.exports=s},66958:e=>{"use strict";e.exports=Function.prototype.call},67129:(e,r,i)=>{"use strict";var n=i(9610),o=i(15796),a="֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",s="؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾",l=RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ
113-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"+a+s+"]"),u=RegExp("["+a+s+"]");function c(e){var r=l.exec(e);return null==r?null:r[0]}function h(e){var r=c(e);return null==r?n.NEUTRAL:u.exec(r)?n.RTL:n.LTR}function p(e,r){if(r=r||n.NEUTRAL,!e.length)return r;var i=h(e);return i===n.NEUTRAL?r:i}function d(e,r){return r||(r=n.getGlobalDir()),n.isStrong(r)||o(!1),p(e,r)}e.exports={firstStrongChar:c,firstStrongCharDir:h,resolveBlockDir:p,getDirection:d,isDirectionLTR:function(e,r){return d(e,r)===n.LTR},isDirectionRTL:function(e,r){return d(e,r)===n.RTL}}},67432:e=>{"use strict";e.exports=function(e){var r=(e?e.ownerDocument||e:document).defaultView||window;return!!(e&&("function"==typeof r.Node?e instanceof r.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},67605:(e,r,i)=>{"use strict";var n=i(12483);e.exports=function e(r,i){if(!r||!i)return!1;if(r===i)return!0;if(n(r))return!1;if(n(i))return e(r,i.parentNode);if("contains"in r)return r.contains(i);else if(r.compareDocumentPosition)return!!(16&r.compareDocumentPosition(i));else return!1}},67989:(e,r,i)=>{"use strict";i.d(r,{Ap:()=>v,D:()=>b,Gr:()=>O,JX:()=>C,Ls:()=>L,QH:()=>S,S6:()=>k,UA:()=>P,Ul:()=>y,Uy:()=>D,bq:()=>M,dK:()=>x,dc:()=>N,fu:()=>T,wY:()=>A});var n=i(84412),o=i(57294),a=i(11324),s=i.n(a),l=i(95471),u=i(97685),c=i(25236),h=i(83964),p=i(11257),d=i(62648),f=i(5913),m=i(6507),g=i(38960),_=i(69585);let y=["mousemove","mousedown","mouseup","click","touchend"],v=[...y,"draw.render","draw.create","draw.update","draw.selectionchange","draw.modechange"];function x(e){let r=e.getCanvas().style;("crosshair"!==r.getPropertyValue("cursor")||"important"!==r.getPropertyPriority("cursor"))&&r.setProperty("cursor","crosshair","important")}function b(e,r){let i=()=>x(e);for(let n of r)e.on(n,i);return()=>{for(let n of r)e.off(n,i)}}let w=new WeakMap,E=(e,r,i)=>{let n=w.get(e);n||(n=new Map,w.set(e,n));let o=n.get(r);if(o){o.retry=i;return}let a=()=>{let e=n.get(r);n.delete(r),e?.retry()};n.set(r,{retry:i,onIdle:a}),e.once("idle",a)};function S(e,r){let i=e?.current,n=i&&w.get(i)?.get(r);if(i&&n)return i.off("idle",n.onIdle),w.get(i).delete(r),n.retry}function T(e,r,i){let n=e?.current;if(!n)return!1;try{if("function"==typeof n.isStyleLoaded&&!n.isStyleLoaded())return E(n,r,i),!1;n.getStyle()}catch{return E(n,r,i),!1}return!0}let I=0,M=async e=>{try{let r=await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e}.json?access_token=${n.Et}`);if(r.ok)return await r.json();return null}catch(e){return console.error("Error searching location:",e),null}},C=(e,r,i,n,o,a,l)=>{if(e.map.current)if(l)r.setBottomMenuOpen({open:!1,id:0,event:null}),e.markerRef?.current&&"function"==typeof e.markerRef.current.remove&&e.markerRef.current.remove(),e.markerRef.current=null;else{let r=document.createElement("div");r.className=a;let l=new(s()).Marker(r,{rotationAlignment:"map"}).setLngLat([o,n]).addTo(e.map.current);e.markerRef?.current&&"function"==typeof e.markerRef.current.remove&&e.markerRef.current.remove(),e.markerRef.current=l;var u=i?.project_uuid;let c=localStorage.getItem("last_location");if(null==c)localStorage.setItem("last_location",JSON.stringify({[u]:{lat:n,lon:o}}));else{let e=JSON.parse(c);e[u]={lat:n,lon:o},localStorage.setItem("last_location",JSON.stringify(e))}}},A=(e,r)=>{let i=e=>{if(!e)return null;let r=parseFloat(e);return isNaN(r)?null:r},n={lat:e.lat??0,lon:e.lon??0,zoom:e.zoom??14},o=localStorage.getItem("last_location");if(o)try{let r=JSON.parse(o)[e.project_uuid];r&&"number"==typeof r.lat&&"number"==typeof r.lon&&(n.lat=r.lat,n.lon=r.lon)}catch(e){console.warn("Invalid last_location JSON",e)}let a=i(r.get("lat")),s=i(r.get("lon"));return null!==a&&null!==s&&(n.lat=a,n.lon=s),{lat:"number"==typeof n.lat?n.lat:0,lon:"number"==typeof n.lon?n.lon:0,zoom:"number"==typeof n.zoom?n.zoom:14}},P=async(e,r,i,n,o=!1)=>
113{if(e.map.current)try{I++,i(!0);let a=[];a.push((0,c.xx)(e.layerFilterOptions.current?.notes,e.map).then(()=>{(0,c.mE)(e.map,!1)})),a.push((0,h.R7)(e.layerFilterOptions.current?.alerts,e.map).then(()=>{(0,h.aM)(e.map)})),a.push((0,p.lk)(r.project_uuid,e.map,o,n)),a.push((0,f.T)(r,e.map)),(r.data_types?.includes("lidar")||r.data_types?.includes("pano")||r.data_types?.some(e=>/camera/i.test(e)))&&a.push((0,d.HW)(e.map,o)),await Promise.all(a)}finally{0==--I&&i(!1)}},L=({isAlt:e,mapContext:r,mapContainer:i,layerContext:n,mapCoord:a,initializeMapboxDraw:l})=>{if(!i.current)return null;let c=new(s()).Map({container:i.current,style:{version:8,imports:[{id:"basemap",url:n.mapStyle}],sources:{},layers:[]},center:[a.lon,a.lat],zoom:a.zoom,pitch:e?r.map.current?.getPitch():0,bearing:e?r.map.current?.getBearing():0,preserveDrawingBuffer:!e,maxZoom:_.nD,minZoom:0,fadeDuration:0}),h=new(s()).GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0,showUserHeading:!0});return h.on("error",()=>{u.oR.error("GPS permission required to access current location")}),c.addControl(new(s()).NavigationControl,"bottom-right"),c.addControl(h,"bottom-right"),c.setProjection("mercator"),c.getCanvas().style.cursor="auto",(0,o.gv)(c),e||(c.isStyleLoaded()?l(c):c.once("style.load",()=>l(c))),c},O=(e,r,i)=>{let n=r instanceof s().LngLatBounds?r:s().LngLatBounds.convert(r),o=n.getSouthWest
113(),a=n.getNorthEast();if(!Number.isFinite(o.lng)||!Number.isFinite(o.lat)||!Number.isFinite(a.lng)||!Number.isFinite(a.lat))throw Error("Invalid bounds");let l=Math.floor(Math.log2(360/Math.max(Math.abs(a.lat-o.lat),Math.abs(a.lng-o.lng))));if(!Number.isFinite(l))throw Error("Failed to calculate valid zoom level");let u=Math.max(_.DQ,Math.min(_.nD,l)),c=(o.lat+a.lat)/2,h=(o.lng+a.lng)/2,p=D(c,h);if(!p.isValid)throw Error(p.error);let d=[h,c];e.flyTo({center:d,zoom:u,essential:i?.essential??!0,padding:i?.padding??0,...i?.duration!==void 0?{duration:i.duration}:{}})};function D(e,r){if(null==e||null==r)return{isValid:!1,error:"Latitude and longitude cannot be null or undefined"};let i="string"==typeof e?parseFloat(e):e,n="string"==typeof r?parseFloat(r):r;return isFinite(i)&&isFinite(n)?i<-90||i>90?{isValid:!1,error:`Invalid latitude: ${i}. Must be between -90 and 90`}:n<-180||n>180?{isValid:!1,error:`Invalid longitude: ${n}. Must be between -180 and 180`}:{isValid:!0}:{isValid:!1,error:"Latitude and longitude must be finite numbers"}}let R=(e,r)=>{let i=Math.abs(e)>360?Math.max(-180,Math.min(180,e)):e,n=Math.abs(r)>90?Math.max(-90,Math.min(90,r)):r;return{lon:i,lat:n,wasClamped:i!==e||n!==r}},k=(e,r)=>{if(!r.properties.zoomLocation)return;if("IFC"===r.source)return void e.current.flyTo({center:[globalThis.tb.models[r.id].coordinates[0],globalThis.tb.models[r.id].coordinates[1]],zoom:Math.max(e.current.getZoom(),18),duration:l.AD});let{minLat:i,minLon:n,maxLat:o,maxLon:a,lat:c,long:h}=r.properties.zoomLocation;if((0,g.J3)(r.source)&&void 0!==i&&void 0!==n&&void 0!==o&&void 0!==a){let r,c,h,p,d,f;r=R(n,i),c=R(a,o),(r.wasClamped||c.wasClamped)&&(console.warn(`Bounding box coordinates were clamped. Original: [${n}, ${i}, ${a}, ${o}]`),(0,u.oR)("Layer contains out-of-range coordinates. Zoom may be inaccurate.",{icon:"⚠️"})),h=new(s()).LngLatBounds([r.lon,r.lat],[c.lon,c.lat]),e.current.fitBounds(h,{padding:(p=globalThis.innerWidth<l.Yp,d=Number.parseInt(m.nt,10),f=globalThis.innerHeight*Number.parseInt(m.Uh,10)/100,{top:50,bottom:p?f+50:50,left:50,right:p?50:d+50}),duration:l.AD})}else{let r=R(c,h);r.wasClamped&&(console.warn(`Zoom coordinates were clamped. Original: [${c}, ${h}]`),(0,u.oR)("Layer contains out-of-range coordinates. Zoom may be inaccurate.",{icon:"⚠️"})),e.current.flyTo({center:[r.lon,r.lat],zoom:Math.max(e.current.getZoom(),13),duration:l.AD})}},N=(e,r)=>{let i=e?._controlContainer;if(!i||!e?._onDown)return;r.current?.();let n=r=>{let i=r.target;i?.closest(".compare-swiper-vertical")||e._onDown(r)};i.addEventListener("mousedown",n),i.addEventListener("touchstart",n,{passive:!1}),r.current=()=>{i.removeEventListener("mousedown",n),i.removeEventListener("touchstart",n)}}},69560:(e,r,i)=>{var n=i(66825),o=i(35302),a=i(31717),s=i(85125),l=i(16211),u=i(42970),c=Date.prototype.getTime;function h(e){return!!e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.copy&&"function"==typeof e.slice&&(!(e.length>0)||"number"==typeof e[0])}e.exports=function e(r,i,p){var d=p||{};return(d.strict?!!a(r,i):r===i)||(r&&i&&("object"==typeof r||"object"==typeof i)?function(r,i,a){if(typeof r!=typeof i||null==r||null==i||r.prototype!==i.prototype||o(r)!==o(i))return!1;var p,d,f=s(r),m=s(i);if(f!==m)return!1;if(f||m)return r.source===i.source&&l(r)===l(i);if(u(r)&&u(i))return c.call(r)===c.call(i);var g=h(r),_=h(i);if(g!==_)return!1;if(g||_){if(r.length!==i.length)return!1;for(p=0;p<r.length;p++)if(r[p]!==i[p])return!1;return!0}if(typeof r!=typeof i)return!1;try{var y=n(r),v=n(i)}catch(e){return!1}if(y.length!==v.length)return!1;for(y.sort(),v.sort(),p=y.length-1;p>=0;p--)if(y[p]!=v[p])return!1;for(p=y.length-1;p>=0;p--)if(!e(r[d=y[p]],i[d],a))return!1;return!0}(r,i,d):d.strict?a(r,i):r==i)}},69585:(e,r,i)=>{"use strict";i.d(r,{Bh:()=>o,DQ:()=>u,E:()=>a,Uj:()=>l,nD:()=>c,yU:()=>n,ye:()=>s});let n=512,o=256,a=25,s=25,l=25,u=0,c=25},69904:(e,r,i)=>{"use strict";i.d(r,{K:()=>d,H:()=>f});var n=i(37876),o=i(14232);let a=(e,r)=>{if(void 0===globalThis.window)return r;try{let i=localStorage.getItem(e);if(null===i)return r;let n=JSON.parse(i);return"boolean"==typeof n?n:r}catch{return r}},s={"Camera Points":!1,Notes:!1,Alerts:!1,"3D Notes":!1,"AI Notes":!1,Measurements:!1,"Building Footprints":!1,"Project GIS":!0,"Weather Overlay":!1,Pointclouds:!1}
113,l={Notes:!0,"3D Notes":!0,"AI Notes":!0,Measurements:!0},u="premium-layer-raster-visuals",c={opacity:1,brightness:0,contrast:0,saturation:0},h=()=>{if(void 0===globalThis.window)return c;try{let e=localStorage.getItem(u);if(!e)return c;let r=JSON.parse(e);return{opacity:Number.isFinite(r.opacity)?Number(r.opacity):c.opacity,brightness:Number.isFinite(r.brightness)?Number(r.brightness):c.brightness,contrast:Number.isFinite(r.contrast)?Number(r.contrast):c.contrast,saturation:Number.isFinite(r.saturation)?Number(r.saturation):c.saturation}}catch{return c}},p=(0,o.createContext)(null),d=({children:e})=>{let[r,i]=(0,o.useState)(null),[c,d]=(0,o.useState)(null),[f,m]=(0,o.useState)("mapbox://styles/mapbox/outdoors-v12"),[g,_]=(0,o.useState)({selected:!1,layer:null}),[y,v]=(0,o.useState)({selected:!1,layer:null}),[x,b]=(0,o.useState)(!0),[w,E]=(0,o.useState)(!0),[S,T]=(0,o.useState)([]),[I,M]=(0,o.useState)(s),[C,A]=(0,o.useState)(l),[P,L]=(0,o.useState)(null),[O,D]=(0,o.useState)([]),[R,k]=(0,o.useState)(null),[N,F]=(0,o.useState)(null),[z,B]=(0,o.useState)(null),[U,j]=(0,o.useState)(null),[V,G]=(0,o.useState)(0),q=(0,o.useRef)(z),[H,$]=(0,o.useState)(null),{mergedDate:W,setMergedDate:Y,mergedDateAlt:Z,setMergedDateAlt:X}=(()=>{let[e,r]=(0,o.useState)(()=>a("mergedDate",!0)),[i,n]=(0,o.useState)(()=>a("mergedDateAlt",!0));return(0,o.useEffect)(()=>{try{localStorage.setItem("mergedDate",JSON.stringify(e))}catch(e){console.error("Failed to save mergedDate to localStorage",e)}},[e]),(0,o.useEffect)(()=>{try{localStorage.setItem("mergedDateAlt",JSON.stringify(i))}catch(e){console.error("Failed to save mergedDateAlt to localStorage",e)}},[i]),{mergedDate:e,setMergedDate:r,mergedDateAlt:i,setMergedDateAlt:n}})(),[K,Q]=(0,o.useState)(h);(0,o.useEffect)(()=>{try{localStorage.setItem(u,JSON.stringify(K))}catch(e){console.error("Failed to save premium layer raster visuals to localStorage",e)}},[K]),(0,o.useLayoutEffect)(()=>{q.current=z},[z]);let J=(0,o.useCallback)(e=>{q.current===e.toString()&&G(e=>e+1)},[]),ee=(0,o.useMemo)(()=>({date:r,setDate:i,altDate:c,setAltDate:d,mapStyle:f,setMapStyle:m,premiumLayer:g,setPremiumLayer:_,altPremiumLayer:y,setAltPremiumLayer:v,premiumLayerAddedToMap:x,setPremiumLayerAddedToMap:b,altPremiumLayerAddedToMap:w,setAltPremiumLayerAddedToMap:E,customLayers:S,setCustomLayers:T,layersCheckboxState:I,setLayersCheckboxState:M,layersLabelState:C,setLayersLabelState:A,dropFile:P,setDropFile:L,uploadingTours:O,setUploadingTours:D,tourCsvName:R,setTourCsvName:k,uploadedTourCsv:N,setUploadedTourCsv:F,activeTabularLayerID:z,setActiveTabularLayerID:B,activeTabularLayerName:U,setActiveTabularLayerName:j,tabularDataRefreshKey:V,setTabularDataRefreshKey:G,refreshActiveTabularLayer:J,editingCustomLayerId:H,setEditingCustomLayerId:$,mergedDate:W,setMergedDate:Y,mergedDateAlt:Z,setMergedDateAlt:X,rasterVisuals:K,setRasterVisuals:Q}),[r,c,f,g,y,x,w,S,I,C,P,O,R,N,z,U,V,J,H,W,Z,K]);return(0,n.jsx)(p.Provider,{value:ee,children:e})},f=()=>{let e=o.useContext(p);if(!e)throw Error("useLayersContext must be used within a LayersProvider");return e}},70803:(e,r,i)=>{"use strict";var n=i(39052),o=i(15796);e.exports=n.isBrowser("Chrome")?function(e){for(var r=e.cloneRange(),i=[],n=e.endContainer;null!=n;n=n.parentNode){var a,s=n===e.commonAncestorContainer;s?r.setStart(e.startContainer,e.startOffset):r.setStart(r.endContainer,0);var l=Array.from(r.getClientRects());if(i.push(l),s)return i.reverse(),(a=[]).concat.apply(a,i);r.setEndBefore(n)}o(!1)}:function(e){return Array.from(e.getClientRects())}},71306:(e,r,i)=>{"use strict";var n=i(93710).Map;e.exports=function(e,r,i){var o=r.getStartKey(),a=r.getEndKey(),s=e.getBlockMap(),l=s.toSeq().skipUntil(function(e,r){return r===o}).takeUntil(function(e,r){return r===a}).concat(n([[a,s.get(a)]])).map(i);return e.merge({blockMap:s.merge(l),selectionBefore:r,selectionAfter:r})}},71355:(e,r,i)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty;e.exports=i(28419).call(n,o)},71742:e=>{"use strict";e.exports=SyntaxError},71938:e=>{"use strict";e.exports=Function.prototype.apply},72080:(e,r,i)=>{"use strict";i.d(r,{LD:()=>s,bM:()=>a,xS:()=>l});var n=i(37876),o=i(14232);let a=(0,o.createContext)(void 0),s=({children:e})=>{let[r,i]=(0,o.useState)(0);return(0,n.jsx)(a.Provider,{value:{update:r,setUpdate:i},children:e})},l=()=>{let e=(0,o.useContext)(a);
113if(void 0===e)throw Error("useUpdate must be used within an UpdateProvider");return e}},72130:e=>{"use strict";e.exports=ReferenceError},72365:e=>{e.exports=function(e,r,i,n){var o=e[0],a=e[1],s=!1;void 0===i&&(i=0),void 0===n&&(n=r.length);for(var l=(n-i)/2,u=0,c=l-1;u<l;c=u++){var h=r[i+2*u+0],p=r[i+2*u+1],d=r[i+2*c+0],f=r[i+2*c+1];p>a!=f>a&&o<(d-h)*(a-p)/(f-p)+h&&(s=!s)}return s}},72445:function(e,r){!function(e){"use strict";function r(){}function i(e){this.message=e||""}function n(e){this.message=e||""}function o(e){this.message=e||""}function a(){}function s(e){return null===e?eU:e.color}function l(e){return null===e?null:e.parent}function u(e,r){null!==e&&(e.color=r)}function c(e){return null===e?null:e.left}function h(e){return null===e?null:e.right}function p(){this.root_=null,this.size_=0}function d(){}function f(){this.array_=[],arguments[0]instanceof eI&&this.addAll(arguments[0])}function m(){}function g(e){this.message=e||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(void 0===this||null===this)throw TypeError(this+" is not an object");var r=Object(this),i=Math.max(Math.min(r.length,0x1fffffffffffff),0)||0,n=1 in arguments&&parseInt(Number(arguments[1]),10)||0;n=n<0?Math.max(i+n,0):Math.min(n,i);var o=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:i;for(o=o<0?Math.max(i+arguments[2],0):Math.min(o,i);n<o;)r[n]=e,++n;return r},writable:!0}),Number.isFinite=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(e){return e!=e},Math.trunc=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};var y=function(){};y.prototype.interfaces_=function(){return[]},y.prototype.getClass=function(){return y},y.prototype.equalsWithTolerance=function(e,r,i){return Math.abs(e-r)<=i};var v=function(e){function r(r){e.call(this,r),this.name="IllegalArgumentException",this.message=r,this.stack=(new e).stack}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r}(Error),x=function(){},b={MAX_VALUE:{configurable:!0}};x.isNaN=function(e){return Number.isNaN(e)},x.doubleToLongBits=function(e){return e},x.longBitsToDouble=function(e){return e},x.isInfinite=function(e){return!Number.isFinite(e)},b.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(x,b);var w=function(){},E=function(){},S=function(){},T=function e(){if(this.x=null,this.y=null,this.z=null,0==arguments.length)this.x=0,this.y=0,this.z=e.NULL_ORDINATE;else if(1==arguments.length){var r=arguments[0];this.x=r.x,this.y=r.y,this.z=r.z}else 2==arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=e.NULL_ORDINATE):3==arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},I={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};T.prototype.setOrdinate=function(e,r){switch(e){case T.X:this.x=r;break;case T.Y:this.y=r;break;case T.Z:this.z=r;break;default:throw new v("Invalid ordinate index: "+e)}},T.prototype.equals2D=function(){if(1==arguments.length){var e=arguments[0];return this.x===e.x&&this.y===e.y}if(2==arguments.length){var r=arguments[0],i=arguments[1];return!!y.equalsWithTolerance(this.x,r.x,i)&&!!y.equalsWithTolerance(this.y,r.y,i)}},T.prototype.getOrdinate=function(e){switch(e){case T.X:return this.x;case T.Y:return this.y;case T.Z:return this.z}throw new v("Invalid ordinate index: "+e)},T.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||x.isNaN(this.z))&&x.isNaN(e.z)},T.prototype.equals=function(e){return e instanceof T&&this.equals2D(e)},T.prototype.equalInZ=function(e,r){return y.equalsWithTolerance(this.z,e.z,r)},T.prototype.compareTo=function(e){return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:+(this.y>e.y)},T.prototype.clone=function(){},T.prototype.copy=function(){return new T(this)},T.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},T.prototype.distance3D=function(e){var r=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return Math.sqrt(r*r+i*i+n*n)},T.prototype.distance=function(e){var r=this.x-e.x,i=this.y-e.y;return Math.sqrt(r*r+i*i)},T.prototype.hashCode=function(){return 37*(629+T.hashCode(this.x))+T.hashCode(this.y)},T.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z},T.prototype.interfaces_=function(){return[w,E,r]},T.prototype.getClass=function(){return T},T.hashCode=function(){if(1==arguments.length){var e=arguments[0],r=x.doubleToLongBits(e);return Math.trunc((r^r)>>>32)}},I.DimensionalComparator.get=function(){return M}
113,I.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},I.NULL_ORDINATE.get=function(){return x.NaN},I.X.get=function(){return 0},I.Y.get=function(){return 1},I.Z.get=function(){return 2},Object.defineProperties(T,I);var M=function(e){if(this._dimensionsToTest=2,0==arguments.length);else if(1==arguments.length){var r=arguments[0];if(2!==r&&3!==r)throw new v("only 2 or 3 dimensions may be specified");this._dimensionsToTest=r}};M.prototype.compare=function(e,r){var i=M.compare(e.x,r.x);if(0!==i)return i;var n=M.compare(e.y,r.y);return 0!==n?n:this._dimensionsToTest<=2?0:M.compare(e.z,r.z)},M.prototype.interfaces_=function(){return[S]},M.prototype.getClass=function(){return M},M.compare=function(e,r){return e<r?-1:e>r?1:x.isNaN(e)?x.isNaN(r)?0:-1:+!!x.isNaN(r)};var C=function(){};C.prototype.create=function(){},C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C};var A=function(){},P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};A.prototype.interfaces_=function(){return[]},A.prototype.getClass=function(){return A},A.toLocationSymbol=function(e){switch(e){case A.EXTERIOR:return"e";case A.BOUNDARY:return"b";case A.INTERIOR:return"i";case A.NONE:return"-"}throw new v("Unknown location value: "+e)},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(A,P);var L=function(e,r){return e.interfaces_&&e.interfaces_().indexOf(r)>-1},O=function(){},D={LOG_10:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.log10=function(e){var r=Math.log(e);return x.isInfinite(r)||x.isNaN(r)?r:r/O.LOG_10},O.min=function(e,r,i,n){var o=e;return r<o&&(o=r),i<o&&(o=i),n<o&&(o=n),o},O.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],r=arguments[1],i=arguments[2];return e<r?r:e>i?i:e}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],o=arguments[1],a=arguments[2];return n<o?o:n>a?a:n}},O.wrap=function(e,r){return e<0?r- -e%r:e%r},O.max=function(){if(3==arguments.length){var e=arguments[0],r=arguments[1],i=arguments[2],n=e;return r>n&&(n=r),i>n&&(n=i),n}if(4==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],l=arguments[3],u=o;return a>u&&(u=a),s>u&&(u=s),l>u&&(u=l),u}},O.average=function(e,r){return(e+r)/2},D.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(O,D);var R=function(e){this.str=e};R.prototype.append=function(e){this.str+=e},R.prototype.setCharAt=function(e,r){this.str=this.str.substr(0,e)+r+this.str.substr(e+1)},R.prototype.toString=function(e){return this.str};var k=function(e){this.value=e};k.prototype.intValue=function(){return this.value},k.prototype.compareTo=function(e){return this.value<e?-1:+(this.value>e)},k.isNaN=function(e){return Number.isNaN(e)};var N=function(){};N.isWhitespace=function(e){return e<=32&&e>=0||127===e},N.toUpperCase=function(e){return e.toUpperCase()};var F=function e(){if(this._hi=0,this._lo=0,0==arguments.length)this.init(0);else if(1==arguments.length){if("number"==typeof arguments[0]){var r=arguments[0];this.init(r)}else if(arguments[0]instanceof e){var i=arguments[0];this.init(i)}else if("string"==typeof arguments[0]){var n=arguments[0];e.call(this,e.parse(n))}}else if(2==arguments.length){var o=arguments[0],a=arguments[1];this.init(o,a)}},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(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo},F.prototype.extractSignificantDigits=function(e,r){var i=this.abs(),n=F.magnitude(i._hi),o=F.TEN.pow(n);(i=i.divide(o)).gt(F.TEN)?(i=i.divide(F.TEN),n+=1):i.lt(F.ONE)&&(i=i.multiply(F.TEN),n-=1);for(var a=n+1,s=new R,l=F.MAX_PRINT_DIGITS-1,u=0;u<=l;u++){e&&u===a&&s.append(".");var c=Math.trunc(i._hi);if(c<0)break;var h=!1,p=0;c>9?(h=!0,p="9"):p="0"+c,s.append(p),i=i.subtract(F.valueOf(c)).multiply(F.TEN),h&&i.selfAdd(F.TEN);var d=!0,f=F.magnitude(i._hi);if(f<0&&Math.abs(f)>=l-u&&(d=!1),!d)break}return r[0]=n,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 e=arguments[0];return this.add(e.negate())}if("number"==typeof arguments[0]){var r=arguments[0];return this.add(-r)}},F.prototype.equals=function(){if(1==arguments.length){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},F.prototype.isZero=function(){return 0===this._hi&&0===this._lo},F.prototype.selfSubtract=function(){if(arguments[0]instanceof F){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}if("number"==typeof arguments[0]){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r,0)}},F.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},F.prototype.min=function(e){return this.le(e)?this:e},F.prototype.selfDivide=function(){if(1==arguments.length){if(arguments[0]instanceof F){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}if("number"==typeof arguments[0]){var r=arguments[0];return this.selfDivide(r,0)}}else if(2==arguments.length){var i=arguments[0],n=arguments[1],o=null,a=null,s=null,l=null,u=null,c=null,h=null,p=null;return u=this._hi/i,o=(c=F.SPLIT*u)-u,p=F.SPLIT*i,a=u-(o=c-o),s=p-i,h=u*i,l=i-(s=p-s),p=o*s-h+o*l+a*s+a*l,c=(this._hi-h-p+this._lo-u*n)/i,p=u+c,this._hi=p,this._lo=u-p+c,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){var e=arguments[0],r=null,i=null,n=null,o=null,a=null,s=null,l=null,u=null;return i=(a=this._hi/e._hi)-(r=(s=F.SPLIT*a)-(r=s-a)),u=r*(n=(u=F.SPLIT*e._hi)-(n=u-e._hi))-(l=a*e._hi)+r*(o=e._hi-n)+i*n+i*o,s=(this._hi-l-u+this._lo-a*e._lo)/e._hi,new F(u=a+s,a-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return x.isNaN(c)?F.createNaN():F.copy(this).selfDivide(c,0)}},F.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},F.prototype.pow=function(e){if(0===e)return F.valueOf(1);var r=new F(this),i=F.valueOf(1),n=Math.abs(e);if(n>1)for(;n>0;)n%2==1&&i.selfMultiply(r),(n/=2)>0&&(r=r.sqr());else i=r;return e<0?i.reciprocal():i},F.prototype.ceil=function(){if(this.isNaN())return F.NaN;var e=Math.ceil(this._hi),r=0;return e===this._hi&&(r=Math.ceil(this._lo)),new F(e,r)},F.prototype.compareTo=function(e){return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:+(this._lo>e._lo)},F.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},F.prototype.setValue=function(){if(arguments[0]instanceof F){var e=arguments[0];return this.init(e),this}if("number"==typeof arguments[0]){var r=arguments[0];return this.init(r),this}},F.prototype.max=function(e){return this.ge(e)?this:e},F.prototype.sqrt=function(){if(this.isZero())return F.valueOf(0);if(this.isNegative())return F.NaN;var e=1/Math.sqrt(this._hi),r=this._hi*e,i=F.valueOf(r),n=this.subtract(i.sqr())._hi*(.5*e);return i.add(n)},F.prototype.selfAdd=function(){if(1==arguments.length){if(arguments[0]instanceof F){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}if("number"==typeof arguments[0]){var r=arguments[0],i=null,n=null,o=null,a=null,s=null,l=null;return s=(o=this._hi+r)-this._hi,a=o-s,i=o+(l=(a=r-s+(this._hi-a))+this._lo),n=l+(o-i),this._hi=i+n,this._lo=n+(i-this._hi),this}}else if(2==arguments.length){var u=arguments[0],c=arguments[1],h=null,p=null,d=null,f=null,m=null,g=null,_=null;f=this._hi+u,p=this._lo+c,m=f-(g=f-this._hi),d=p-(_=p-this._lo);var y=(h=f+(g=(m=u-g+(this._hi-m))+p))+(g=(d=c-_+(this._lo-d))+(g+(f-h))),v=g+(h-y);return this._hi=y,this._lo=v,this}},F.prototype.selfMultiply=function(){if(1==arguments.length){if(arguments[0]instanceof F){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}if("number"==typeof arguments[0]){var r=arguments[0];return this.selfMultiply(r,0)}}else if(2==arguments.length){var i=arguments[0],n=arguments[1],o=null,a=null,s=null,l=null,u=null,c=null;o=(u=F.SPLIT*this._hi)-this._hi,c=F.SPLIT*i,o=u-o,a=this._hi-o,s=c-i;var h=(u=this._hi*i)+(c=o*(s=c-s)-u+o*(l=i-s)+a*s+a*l+(this._hi*n+this._lo*i)),p=c+(o=u-h);
113return this._hi=h,this._lo=p,this}},F.prototype.selfSqr=function(){return this.selfMultiply(this)},F.prototype.floor=function(){if(this.isNaN())return F.NaN;var e=Math.floor(this._hi),r=0;return e===this._hi&&(r=Math.floor(this._lo)),new F(e,r)},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 e=arguments[0];return e.isNaN()?F.createNaN():F.copy(this).selfMultiply(e)}if("number"==typeof arguments[0]){var r=arguments[0];return x.isNaN(r)?F.createNaN():F.copy(this).selfMultiply(r,0)}},F.prototype.isNaN=function(){return x.isNaN(this._hi)},F.prototype.intValue=function(){return Math.trunc(this._hi)},F.prototype.toString=function(){var e=F.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},F.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(null!==e)return e;var r=[,].fill(null),i=this.extractSignificantDigits(!0,r),n=r[0]+1,o=i;if("."===i.charAt(0))o="0"+i;else if(n<0)o="0."+F.stringOfChar("0",-n)+i;else if(-1===i.indexOf(".")){var a=n-i.length;o=i+F.stringOfChar("0",a)+".0"}return this.isNegative()?"-"+o:o},F.prototype.reciprocal=function(){var e=null,r=null,i=null,n=null,o=null,a=null,s=null,l=null;r=(o=1/this._hi)-(e=(a=F.SPLIT*o)-(e=a-o)),i=(l=F.SPLIT*this._hi)-this._hi;var u=o+(a=(1-(s=o*this._hi)-(l=e*(i=l-i)-s+e*(n=this._hi-i)+r*i+r*n)-o*this._lo)/this._hi);return new F(u,o-u+a)},F.prototype.toSciNotation=function(){if(this.isZero())return F.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(null!==e)return e;var r=[,].fill(null),i=this.extractSignificantDigits(!1,r),n=F.SCI_NOT_EXPONENT_CHAR+r[0];if("0"===i.charAt(0))throw Error("Found leading zero: "+i);var o="";i.length>1&&(o=i.substring(1));var a=i.charAt(0)+"."+o;return this.isNegative()?"-"+a+n:a+n},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(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo},F.prototype.add=function(){if(arguments[0]instanceof F){var e=arguments[0];return F.copy(this).selfAdd(e)}if("number"==typeof arguments[0]){var r=arguments[0];return F.copy(this).selfAdd(r)}},F.prototype.init=function(){if(1==arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof F){var r=arguments[0];this._hi=r._hi,this._lo=r._lo}}else if(2==arguments.length){var i=arguments[0],n=arguments[1];this._hi=i,this._lo=n}},F.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._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[r,w,E]},F.prototype.getClass=function(){return F},F.sqr=function(e){return F.valueOf(e).selfMultiply(e)},F.valueOf=function(){if("string"==typeof arguments[0]){var e=arguments[0];return F.parse(e)}if("number"==typeof arguments[0]){var r=arguments[0];return new F(r)}},F.sqrt=function(e){return F.valueOf(e).sqrt()},F.parse=function(e){for(var r=0,i=e.length;N.isWhitespace(e.charAt(r));)r++;var n=!1;if(r<i){var o=e.charAt(r);"-"!==o&&"+"!==o||(r++,"-"===o&&(n=!0))}for(var a=new F,s=0,l=0,u=0;!(r>=i);){var c=e.charAt(r);if(r++,N.isDigit(c)){var h=c-0;a.selfMultiply(F.TEN),a.selfAdd(h),s++}else{if("."!==c){if("e"===c||"E"===c){var p=e.substring(r);try{u=k.parseInt(p)}catch(r){throw r instanceof Error?Error("Invalid exponent "+p+" in string "+e):r}break}throw Error("Unexpected character '"+c+"' at position "+r+" in string "+e)}l=s}}var d=a,f=s-l-u;if(0===f)d=a;else if(f>0){var m=F.TEN.pow(f);d=a.divide(m)}else if(f<0){var g=F.TEN.pow(-f);d=a.multiply(g)}return n?d.negate():d},F.createNaN=function(){return new F(x.NaN,x.NaN)},F.copy=function(e){return new F(e)},F.magnitude=function(e){var r=Math.abs(e),i=Math.trunc(Math.floor(Math.log(r)/Math.log(10)));return 10*Math.pow(10,i)<=r&&(i+=1),i},F.stringOfChar=function(e,r){for(var i=new R,n=0;n<r;n++)i.append(e);return i.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(x.NaN,x.NaN)},z.EPS.get=function(){return 123259516440783e-46},z.SPLIT.get=function(){return 0x8000001},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 B=function(){},U={DP_SAFE_EPSILON:{configurable:!0}};B.prototype.interfaces_=function(){return[]},B.prototype.getClass=function(){return B},B.orientationIndex=function(e,r,i){var n=B.orientationIndexFilter(e,r,i);if(n<=1)return n;var o=F.valueOf(r.x).selfAdd(-e.x),a=F.valueOf(r.y).selfAdd(-e.y),s=F.valueOf(i.x).selfAdd(-r.x),l=F.valueOf(i.y).selfAdd(-r.y);return o.selfMultiply(l).selfSubtract(a.selfMultiply(s)).signum()},B.signOfDet2x2=function(e,r,i,n){return e.multiply(n).selfSubtract(r.multiply(i)).signum()},B.intersection=function(e,r,i,n){var o=F.valueOf(n.y).selfSubtract(i.y).selfMultiply(F.valueOf(r.x).selfSubtract(e.x)),a=F.valueOf(n.x).selfSubtract(i.x).selfMultiply(F.valueOf(r.y).selfSubtract(e.y)),s=o.subtract(a),l=F.valueOf(n.x).selfSubtract(i.x).selfMultiply(F.valueOf(e.y).selfSubtract(i.y)),u=F.valueOf(n.y).selfSubtract(i.y).selfMultiply(F.valueOf(e.x).selfSubtract(i.x)),c=l.subtract(u).selfDivide(s).doubleValue(),h=F.valueOf(e.x).selfAdd(F.valueOf(r.x).selfSubtract(e.x).selfMultiply(c)).doubleValue(),p=F.valueOf(r.x).selfSubtract(e.x).selfMultiply(F.valueOf(e.y).selfSubtract(i.y)),d=F.valueOf(r.y).selfSubtract(e.y).selfMultiply(F.valueOf(e.x).selfSubtract(i.x)),f=p.subtract(d).selfDivide(s).doubleValue();return new T(h,F.valueOf(i.y).selfAdd(F.valueOf(n.y).selfSubtract(i.y).selfMultiply(f)).doubleValue())},B.orientationIndexFilter=function(e,r,i){var n=null,o=(e.x-i.x)*(r.y-i.y),a=(e.y-i.y)*(r.x-i.x),s=o-a;if(o>0){if(a<=0)return B.signum(s);n=o+a}else{if(!(o<0)||a>=0)return B.signum(s);n=-o-a}var l=B.DP_SAFE_EPSILON*n;return s>=l||-s>=l?B.signum(s):2},B.signum=function(e){return e>0?1:e<0?-1:0},U.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(B,U);var j=function(){},V={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};V.X.get=function(){return 0},V.Y.get=function(){return 1},V.Z.get=function(){return 2},V.M.get=function(){return 3},j.prototype.setOrdinate=function(e,r,i){},j.prototype.size=function(){},j.prototype.getOrdinate=function(e,r){},j.prototype.getCoordinate=function(){},j.prototype.getCoordinateCopy=function(e){},j.prototype.getDimension=function(){},j.prototype.getX=function(e){},j.prototype.clone=function(){},j.prototype.expandEnvelope=function(e){},j.prototype.copy=function(){},j.prototype.getY=function(e){},j.prototype.toCoordinateArray=function(){},j.prototype.interfaces_=function(){return[E]},j.prototype.getClass=function(){return j},Object.defineProperties(j,V);var G=function(){},q=function(e){function r(){e.call(this,"Projective point not representable on the Cartesian plane.")}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(G),H=function(){};H.arraycopy=function(e,r,i,n,o){for(var a=0,s=r;s<r+o;s++)i[n+a]=e[s],a++},H.getProperty=function(e){return({"line.separator":"\n"})[e]};var $=function e(){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 r=arguments[0];this.x=r.x,this.y=r.y,this.w=1}else if(2==arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var i=arguments[0],n=arguments[1];this.x=i,this.y=n,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){var o=arguments[0],a=arguments[1];this.x=o.y*a.w-a.y*o.w,this.y=a.x*o.w-o.x*a.w,this.w=o.x*a.y-a.x*o.y}else if(arguments[0]instanceof T&&arguments[1]instanceof T){var s=arguments[0],l=arguments[1];this.x=s.y-l.y,this.y=l.x-s.x,this.w=s.x*l.y-l.x*s.y}}else if(3==arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2];this.x=u,this.y=c,this.w=h}else if(4==arguments.length){var p=arguments[0],d=arguments[1],f=arguments[2],m=arguments[3],g=p.y-d.y,_=d.x-p.x,y=p.x*d.y-d.x*p.y,v=f.y-m.y,x=m.x-f.x,b=f.x*m.y-m.x*f.y;this.x=_*b-x*y,this.y=v*y-g*b,this.w=g*x-v*_}};$.prototype.getY=function(){var e=this.y/this.w;if(x.isNaN(e)||x.isInfinite(e))throw new q;return e},$.prototype.getX=function(){var e=this.x/this.w;if(x.isNaN(e)||x.isInfinite(e))throw new q;return e},$.prototype.getCoordinate=function(){var e=new T;return e.x=this.getX(),e.y=this.getY(),e},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.intersection=function(e,r,i,n){var o=e.y-r.y,a=r.x-e.x,s=e.x*r.y-r.x*e.y,l=i.y-n.y,u=n.x-i.x,c=i.x*n.y-n.x*i.y,h=o*u-l*a,p=(a*c-u*s)/h,d=(l*s-o*c)/h;if(x.isNaN(p)||x.isInfinite(p)||x.isNaN(d)||x.isInfinite(d))throw new q;return new T(p,d)};
113var W=function e(){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 T){var r=arguments[0];this.init(r.x,r.x,r.y,r.y)}else if(arguments[0]instanceof e){var i=arguments[0];this.init(i)}}else if(2==arguments.length){var n=arguments[0],o=arguments[1];this.init(n.x,o.x,n.y,o.y)}else if(4==arguments.length){var a=arguments[0],s=arguments[1],l=arguments[2],u=arguments[3];this.init(a,s,l,u)}},Y={serialVersionUID:{configurable:!0}};W.prototype.getArea=function(){return this.getWidth()*this.getHeight()},W.prototype.equals=function(e){return e instanceof W&&(this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY())},W.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new W;var r=this._minx>e._minx?this._minx:e._minx,i=this._miny>e._miny?this._miny:e._miny;return new W(r,this._maxx<e._maxx?this._maxx:e._maxx,i,this._maxy<e._maxy?this._maxy:e._maxy)},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 T){var e=arguments[0];return this.covers(e.x,e.y)}if(arguments[0]instanceof W){var r=arguments[0];return!this.isNull()&&!r.isNull()&&r.getMinX()>=this._minx&&r.getMaxX()<=this._maxx&&r.getMinY()>=this._miny&&r.getMaxY()<=this._maxy}}else if(2==arguments.length){var i=arguments[0],n=arguments[1];return!this.isNull()&&i>=this._minx&&i<=this._maxx&&n>=this._miny&&n<=this._maxy}},W.prototype.intersects=function(){if(1==arguments.length){if(arguments[0]instanceof W){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}if(arguments[0]instanceof T){var r=arguments[0];return this.intersects(r.x,r.y)}}else if(2==arguments.length){var i=arguments[0],n=arguments[1];return!this.isNull()&&!(i>this._maxx||i<this._minx||n>this._maxy||n<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 T){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof W){var r=arguments[0];if(r.isNull())return null;this.isNull()?(this._minx=r.getMinX(),this._maxx=r.getMaxX(),this._miny=r.getMinY(),this._maxy=r.getMaxY()):(r._minx<this._minx&&(this._minx=r._minx),r._maxx>this._maxx&&(this._maxx=r._maxx),r._miny<this._miny&&(this._miny=r._miny),r._maxy>this._maxy&&(this._maxy=r._maxy))}}else if(2==arguments.length){var i=arguments[0],n=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=n,this._maxy=n):(i<this._minx&&(this._minx=i),i>this._maxx&&(this._maxx=i),n<this._miny&&(this._miny=n),n>this._maxy&&(this._maxy=n))}},W.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),r=this.getHeight();return e<r?e:r},W.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},W.prototype.compareTo=function(e){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)},W.prototype.translate=function(e,r){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+r,this.getMaxY()+r)},W.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}
113,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 e=this.getWidth(),r=this.getHeight();return e>r?e:r},W.prototype.expandBy=function(){if(1==arguments.length){var e=arguments[0];this.expandBy(e,e)}else if(2==arguments.length){var r=arguments[0],i=arguments[1];if(this.isNull())return null;this._minx-=r,this._maxx+=r,this._miny-=i,this._maxy+=i,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},W.prototype.contains=function(){if(1==arguments.length){if(arguments[0]instanceof W){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof T){var r=arguments[0];return this.covers(r)}}else if(2==arguments.length){var i=arguments[0],n=arguments[1];return this.covers(i,n)}},W.prototype.centre=function(){return this.isNull()?null:new T((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 T){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof W){var r=arguments[0];this._minx=r._minx,this._maxx=r._maxx,this._miny=r._miny,this._maxy=r._maxy}}else if(2==arguments.length){var i=arguments[0],n=arguments[1];this.init(i.x,n.x,i.y,n.y)}else if(4==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],l=arguments[3];o<a?(this._minx=o,this._maxx=a):(this._minx=a,this._maxx=o),s<l?(this._miny=s,this._maxy=l):(this._miny=l,this._maxy=s)}},W.prototype.getMaxY=function(){return this._maxy},W.prototype.distance=function(e){if(this.intersects(e))return 0;var r=0;this._maxx<e._minx?r=e._minx-this._maxx:this._minx>e._maxx&&(r=this._minx-e._maxx);var i=0;return this._maxy<e._miny?i=e._miny-this._maxy:this._miny>e._maxy&&(i=this._miny-e._maxy),0===r?i:0===i?r:Math.sqrt(r*r+i*i)},W.prototype.hashCode=function(){return 37*(37*(37*(629+T.hashCode(this._minx))+T.hashCode(this._maxx))+T.hashCode(this._miny))+T.hashCode(this._maxy)},W.prototype.interfaces_=function(){return[w,r]},W.prototype.getClass=function(){return W},W.intersects=function(){if(3==arguments.length){var e=arguments[0],r=arguments[1],i=arguments[2];return i.x>=(e.x<r.x?e.x:r.x)&&i.x<=(e.x>r.x?e.x:r.x)&&i.y>=(e.y<r.y?e.y:r.y)&&i.y<=(e.y>r.y?e.y:r.y)}if(4==arguments.length){var n=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],l=Math.min(a.x,s.x),u=Math.max(a.x,s.x),c=Math.min(n.x,o.x),h=Math.max(n.x,o.x);return!(c>u)&&!(h<l)&&(l=Math.min(a.y,s.y),u=Math.max(a.y,s.y),c=Math.min(n.y,o.y),h=Math.max(n.y,o.y),!(c>u)&&!(h<l))}},Y.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(W,Y);var Z=/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,X=/^\s*(\w+)\s*EMPTY\s*$/,K=/\s+/,Q=/\)\s*,\s*\(/,J=/\)\s*\)\s*,\s*\(\s*\(/,ee=/^\s*\(?(.*?)\)?\s*$/,et=function(e){this.geometryFactory=e||new td};et.prototype.read=function(e){e=e.replace(/[\n\r]/g," ");var r,i,n,o=Z.exec(e);if(-1!==e.search("EMPTY")&&((o=X.exec(e))[2]=void 0),o&&(i=o[1].toLowerCase(),n=o[2],ei[i]&&(r=ei[i].apply(this,[n]))),void 0===r)throw Error("Could not parse WKT "+e);return r},et.prototype.write=function(e){return this.extractGeometry(e)},et.prototype.extractGeometry=function(e){var r=e.getGeometryType().toLowerCase();if(!er[r])return null;var i=r.toUpperCase();return e.isEmpty()?i+" EMPTY":i+"("+er[r].apply(this,[e])+")"};var er={coordinate:function(e){return e.x+" "+e.y},point:function(e){return er.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var r=[],i=0,n=e._geometries.length;i<n;++i)r.push("("+er.point.apply(this,[e._geometries[i]])+")");return r.join(",")},linestring:function(e){for(var r=[],i=0,n=e._points._coordinates.length;i<n;++i)r.push(er.coordinate.apply(this,[e._points._coordinates[i]]));return r.join(",")},linearring:function(e){for(var r=[],i=0,n=e._points._coordinates.length;i<n;++i)r.push(er.coordinate.apply(this,[e._points._coordinates[i]]));return r.join(",")},multilinestring:function(e){for(var r=[],i=0,n=e._geometries.length;i<n;++i)r.push("("+er.linestring.apply(this,[e._geometries[i]])+")");return r.join(",")},polygon:function(e){var r=[];r.push("("+er.linestring.apply(this,[e._shell])+")");for(var i=0,n=e._holes.length;i<n;++i)r.push("("+er.linestring.apply(this,[e._holes[i]])+")");return r.join(",")},multipolygon:function(e){for(var r=[],i=0,n=e._geometries.length;i<n;++i)r.push("("+er.polygon.apply(this,[e._geometries[i]])+")");return r.join(",")},geometrycollection:function(e){for(var r=[],i=0,n=e._geometries.length;i<n;
113++i)r.push(this.extractGeometry(e._geometries[i]));return r.join(",")}},ei={point:function(e){if(void 0===e)return this.geometryFactory.createPoint();var r=e.trim().split(K);return this.geometryFactory.createPoint(new T(Number.parseFloat(r[0]),Number.parseFloat(r[1])))},multipoint:function(e){if(void 0===e)return this.geometryFactory.createMultiPoint();for(var r,i=e.trim().split(","),n=[],o=0,a=i.length;o<a;++o)r=i[o].replace(ee,"$1"),n.push(ei.point.apply(this,[r]));return this.geometryFactory.createMultiPoint(n)},linestring:function(e){if(void 0===e)return this.geometryFactory.createLineString();for(var r,i=e.trim().split(","),n=[],o=0,a=i.length;o<a;++o)r=i[o].trim().split(K),n.push(new T(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLineString(n)},linearring:function(e){if(void 0===e)return this.geometryFactory.createLinearRing();for(var r,i=e.trim().split(","),n=[],o=0,a=i.length;o<a;++o)r=i[o].trim().split(K),n.push(new T(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(e){if(void 0===e)return this.geometryFactory.createMultiLineString();for(var r,i=e.trim().split(Q),n=[],o=0,a=i.length;o<a;++o)r=i[o].replace(ee,"$1"),n.push(ei.linestring.apply(this,[r]));return this.geometryFactory.createMultiLineString(n)},polygon:function(e){if(void 0===e)return this.geometryFactory.createPolygon();for(var r,i,n,o,a=e.trim().split(Q),s=[],l=0,u=a.length;l<u;++l)r=a[l].replace(ee,"$1"),i=ei.linestring.apply(this,[r]),n=this.geometryFactory.createLinearRing(i._points),0===l?o=n:s.push(n);return this.geometryFactory.createPolygon(o,s)},multipolygon:function(e){if(void 0===e)return this.geometryFactory.createMultiPolygon();for(var r,i=e.trim().split(J),n=[],o=0,a=i.length;o<a;++o)r=i[o].replace(ee,"$1"),n.push(ei.polygon.apply(this,[r]));return this.geometryFactory.createMultiPolygon(n)},geometrycollection:function(e){if(void 0===e)return this.geometryFactory.createGeometryCollection();for(var r=(e=e.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),i=[],n=0,o=r.length;n<o;++n)i.push(this.read(r[n]));return this.geometryFactory.createGeometryCollection(i)}},en=function(e){this.parser=new et(e)};en.prototype.write=function(e){return this.parser.write(e)},en.toLineString=function(e,r){if(2!=arguments.length)throw Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+r.x+" "+r.y+" )"};var eo=function(e){function r(r){e.call(this,r),this.name="RuntimeException",this.message=r,this.stack=(new e).stack}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r}(Error),ea=function(e){function r(){if(e.call(this),0==arguments.length)e.call(this);else if(1==arguments.length){var r=arguments[0];e.call(this,r)}}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(eo),es=function(){};es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es},es.shouldNeverReachHere=function(){if(0==arguments.length)es.shouldNeverReachHere(null);else if(1==arguments.length){var e=arguments[0];throw new ea("Should never reach here"+(null!==e?": "+e:""))}},es.isTrue=function(){var e,r;if(1==arguments.length)e=arguments[0],es.isTrue(e,null);else if(2==arguments.length&&(e=arguments[0],r=arguments[1],!e))throw null===r?new ea:new ea(r)},es.equals=function(){var e,r,i;if(2==arguments.length)e=arguments[0],r=arguments[1],es.equals(e,r,null);else if(3==arguments.length&&(e=arguments[0],r=arguments[1],i=arguments[2],!r.equals(e)))throw new ea("Expected "+e+" but encountered "+r+(null!==i?": "+i:""))};var el=function(){this._result=null,this._inputLines=[,,].fill().map(function(){return[,,]}),this._intPt=[,,].fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new T,this._intPt[1]=new T,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},eu={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};el.prototype.getIndexAlongSegment=function(e,r){return this.computeIntLineIndex(),this._intLineIndex[e][r]},el.prototype.getTopologySummary=function(){var e=new R;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},el.prototype.computeIntersection=function(e,r,i,n){this._inputLines[0][0]=e,this._inputLines[0][1]=r,this._inputLines[1][0]=i,this._inputLines[1][1]=n,this._result=this.computeIntersect(e,r,i,n)},el.prototype.getIntersectionNum=function(){return this._result},el.prototype.computeIntLineIndex=function(){if(0==arguments.length)null===this._intLineIndex&&(this._intLineIndex=[,,].fill().map(function(){return[,,]}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1==arguments.length){var e=arguments[0];this.getEdgeDistance(e,0)>this.getEdgeDistance(e,1)?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},el.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},el.prototype.setPrecisionModel=function(e){this._precisionModel=e},el.prototype.isInteriorIntersection=function(){if(0==arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1==arguments.length){for(var e=arguments[0],r=0;r<this._result;r++)if(!this._intPt[r].equals2D(this._inputLines[e][0])&&!this._intPt[r].equals2D(this._inputLines[e][1]))return!0;return!1}},el.prototype.getIntersection=function(e){return this._intPt[e]},el.prototype.isEndPoint=function(){return this.hasIntersection()&&
113!this._isProper},el.prototype.hasIntersection=function(){return this._result!==el.NO_INTERSECTION},el.prototype.getEdgeDistance=function(e,r){return el.computeEdgeDistance(this._intPt[r],this._inputLines[e][0],this._inputLines[e][1])},el.prototype.isCollinear=function(){return this._result===el.COLLINEAR_INTERSECTION},el.prototype.toString=function(){return en.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+en.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},el.prototype.getEndpoint=function(e,r){return this._inputLines[e][r]},el.prototype.isIntersection=function(e){for(var r=0;r<this._result;r++)if(this._intPt[r].equals2D(e))return!0;return!1},el.prototype.getIntersectionAlongSegment=function(e,r){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][r]]},el.prototype.interfaces_=function(){return[]},el.prototype.getClass=function(){return el},el.computeEdgeDistance=function(e,r,i){var n=Math.abs(i.x-r.x),o=Math.abs(i.y-r.y),a=-1;if(e.equals(r))a=0;else if(e.equals(i))a=n>o?n:o;else{var s=Math.abs(e.x-r.x),l=Math.abs(e.y-r.y);0!==(a=n>o?s:l)||e.equals(r)||(a=Math.max(s,l))}return es.isTrue(!(0===a&&!e.equals(r)),"Bad distance calculation"),a},el.nonRobustComputeEdgeDistance=function(e,r,i){var n=e.x-r.x,o=e.y-r.y,a=Math.sqrt(n*n+o*o);return es.isTrue(!(0===a&&!e.equals(r)),"Invalid distance calculation"),a},eu.DONT_INTERSECT.get=function(){return 0},eu.DO_INTERSECT.get=function(){return 1},eu.COLLINEAR.get=function(){return 2},eu.NO_INTERSECTION.get=function(){return 0},eu.POINT_INTERSECTION.get=function(){return 1},eu.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(el,eu);var ec=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isInSegmentEnvelopes=function(e){var r=new W(this._inputLines[0][0],this._inputLines[0][1]),i=new W(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(e)&&i.contains(e)},r.prototype.computeIntersection=function(){if(3!=arguments.length)return e.prototype.computeIntersection.apply(this,arguments);var r=arguments[0],i=arguments[1],n=arguments[2];if(this._isProper=!1,W.intersects(i,n,r)&&0===ed.orientationIndex(i,n,r)&&0===ed.orientationIndex(n,i,r))return this._isProper=!0,(r.equals(i)||r.equals(n))&&(this._isProper=!1),this._result=e.POINT_INTERSECTION,null;this._result=e.NO_INTERSECTION},r.prototype.normalizeToMinimum=function(e,r,i,n,o){o.x=this.smallestInAbsValue(e.x,r.x,i.x,n.x),o.y=this.smallestInAbsValue(e.y,r.y,i.y,n.y),e.x-=o.x,e.y-=o.y,r.x-=o.x,r.y-=o.y,i.x-=o.x,i.y-=o.y,n.x-=o.x,n.y-=o.y},r.prototype.safeHCoordinateIntersection=function(e,i,n,o){var a=null;try{a=$.intersection(e,i,n,o)}catch(s){if(!(s instanceof q))throw s;a=r.nearestEndpoint(e,i,n,o)}return a},r.prototype.intersection=function(e,i,n,o){var a=this.intersectionWithNormalization(e,i,n,o);return this.isInSegmentEnvelopes(a)||(a=new T(r.nearestEndpoint(e,i,n,o))),null!==this._precisionModel&&this._precisionModel.makePrecise(a),a},r.prototype.smallestInAbsValue=function(e,r,i,n){var o=e,a=Math.abs(o);return Math.abs(r)<a&&(o=r,a=Math.abs(r)),Math.abs(i)<a&&(o=i,a=Math.abs(i)),Math.abs(n)<a&&(o=n),o},r.prototype.checkDD=function(e,r,i,n,o){var a=B.intersection(e,r,i,n),s=this.isInSegmentEnvelopes(a);H.out.println("DD in env = "+s+"  --------------------- "+a),o.distance(a)>1e-4&&H.out.println("Distance = "+o.distance(a))},r.prototype.intersectionWithNormalization=function(e,r,i,n){var o=new T(e),a=new T(r),s=new T(i),l=new T(n),u=new T;this.normalizeToEnvCentre(o,a,s,l,u);var c=this.safeHCoordinateIntersection(o,a,s,l);return c.x+=u.x,c.y+=u.y,c},r.prototype.computeCollinearIntersection=function(r,i,n,o){var a=W.intersects(r,i,n),s=W.intersects(r,i,o),l=W.intersects(n,o,r),u=W.intersects(n,o,i);return a&&s?(this._intPt[0]=n,this._intPt[1]=o,e.COLLINEAR_INTERSECTION):l&&u?(this._intPt[0]=r,this._intPt[1]=i,e.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=n,this._intPt[1]=r,!n.equals(r)||s||u?e.COLLINEAR_INTERSECTION:e.POINT_INTERSECTION):a&&u?(this._intPt[0]=n,this._intPt[1]=i,!n.equals(i)||s||l?e.COLLINEAR_INTERSECTION:e.POINT_INTERSECTION):s&&l?(this._intPt[0]=o,this._intPt[1]=r,!o.equals(r)||a||u?e.COLLINEAR_INTERSECTION:e.POINT_INTERSECTION):s&&u?(this._intPt[0]=o,this._intPt[1]=i,!o.equals(i)||a||l?e.COLLINEAR_INTERSECTION:e.POINT_INTERSECTION):e.NO_INTERSECTION},r.prototype.normalizeToEnvCentre=function(e,r,i,n,o){var a=e.x<r.x?e.x:r.x,s=e.y<r.y?e.y:r.y,l=e.x>r.x?e.x:r.x,u=e.y>r.y?e.y:r.y,c=i.x<n.x?i.x:n.x,h=i.y<n.y?i.y:n.y,p=i.x>n.x?i.x:n.x,d=i.y>n.y?i.y:n.y;o.x=((a>c?a:c)+(l<p?l:p))/2,o.y=((s>h?s:h)+(u<d?u:d))/2,e.x-=o.x,e.y-=o.y,r.x-=o.x,r.y-=o.y,i.x-=o.x,i.y-=o.y,n.x-=o.x,n.y-=o.y},r.prototype.computeIntersect=function(r,i,n,o){if(this._isProper=!1,!W.intersects(r,i,n,o))return e.NO_INTERSECTION;var a=ed.orientationIndex(r,i,n),s=ed.orientationIndex(r,i,o);if(a>0&&s>0||a<0&&s<0)return e.NO_INTERSECTION;var l=ed.orientationIndex(n,o,r),u=ed.orientationIndex(n,o,i);return l>0&&u>0||l<0&&u<0?e.NO_INTERSECTION:0===a&&0===s&&0===l&&0===u?this.computeCollinearIntersection(r,i,n,o):(0===a||0===s||0===l||0===u?(this._isProper=!1,r.equals2D(n)||r.equals2D(o)?this._intPt[0]=r:i.equals2D(n)||i.equals2D(o)?this._intPt[0]=i:0===a?this._intPt[0]=new T(n):0===s?this._intPt[0]=new T(o):0===l?this._intPt[0]=new T(r):0===u&&(this._intPt[0]=new T(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,n,o)),e.POINT_INTERSECTION)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r.nearestEndpoint=function(e,r,i,n){var o=e,a=ed.distancePointLine(e,i,n),s=ed.distancePointLine(r,i,n);return s<a&&(a=s,o=r),(s=ed.distancePointLine(i,e,r))<a&&(a=s,o=i),(s=ed.distancePointLine(n,e,r))<a&&(a=s,o=n),o},r}(el),eh=function(){};eh.prototype.interfaces_=function(){return[]},eh.prototype.getClass=function(){return eh},eh.orientationIndex=function(e,r,i){var n=r.x-e.x,o=r.y-e.y,a=i.x-r.x,s=i.y-r.y;return eh.signOfDet2x2(n,o,a,s)},eh.signOfDet2x2=function(e,r,i,n){var o=null,a=null,s=null;
113if(o=1,0===e||0===n)return 0===r||0===i?0:r>0?i>0?-o:o:i>0?o:-o;if(0===r||0===i)return n>0?e>0?o:-o:e>0?-o:o;if(r>0?n>0?r<=n||(o=-o,a=e,e=i,i=a,a=r,r=n,n=a):r<=-n?(o=-o,i=-i,n=-n):(a=e,e=-i,i=a,a=r,r=-n,n=a):n>0?-r<=n?(o=-o,e=-e,r=-r):(a=-e,e=i,i=a,a=-r,r=n,n=a):r>=n?(e=-e,r=-r,i=-i,n=-n):(o=-o,a=-e,e=-i,i=a,a=-r,r=-n,n=a),e>0){if(!(i>0)||!(e<=i))return o}else{if(i>0||!(e>=i))return-o;o=-o,e=-e,i=-i}for(;;){if(s=Math.floor(i/e),i-=s*e,(n-=s*r)<0)return-o;if(n>r)return o;if(e>i+i){if(r<n+n)return o}else{if(r>n+n)return-o;i=e-i,n=r-n,o=-o}if(0===n)return 0===i?0:-o;if(0===i||(s=Math.floor(e/i),e-=s*i,(r-=s*n)<0))return o;if(r>n)return-o;if(i>e+e){if(n<r+r)return-o}else{if(n>r+r)return o;e=i-e,r=n-r,o=-o}if(0===r)return 0===e?0:o;if(0===e)return-o}};var ep=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};ep.prototype.countSegment=function(e,r){if(e.x<this._p.x&&r.x<this._p.x)return null;if(this._p.x===r.x&&this._p.y===r.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&r.y===this._p.y){var i=e.x,n=r.x;return i>n&&(i=r.x,n=e.x),this._p.x>=i&&this._p.x<=n&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&r.y<=this._p.y||r.y>this._p.y&&e.y<=this._p.y){var o=e.x-this._p.x,a=e.y-this._p.y,s=r.x-this._p.x,l=r.y-this._p.y,u=eh.signOfDet2x2(o,a,s,l);if(0===u)return this._isPointOnSegment=!0,null;l<a&&(u=-u),u>0&&this._crossingCount++}},ep.prototype.isPointInPolygon=function(){return this.getLocation()!==A.EXTERIOR},ep.prototype.getLocation=function(){return this._isPointOnSegment?A.BOUNDARY:this._crossingCount%2==1?A.INTERIOR:A.EXTERIOR},ep.prototype.isOnSegment=function(){return this._isPointOnSegment},ep.prototype.interfaces_=function(){return[]},ep.prototype.getClass=function(){return ep},ep.locatePointInRing=function(){if(arguments[0]instanceof T&&L(arguments[1],j)){for(var e=arguments[0],r=arguments[1],i=new ep(e),n=new T,o=new T,a=1;a<r.size()&&(r.getCoordinate(a,n),r.getCoordinate(a-1,o),i.countSegment(n,o),!i.isOnSegment());a++);return i.getLocation()}if(arguments[0]instanceof T&&arguments[1]instanceof Array){for(var s=arguments[0],l=arguments[1],u=new ep(s),c=1;c<l.length;c++){var h=l[c],p=l[c-1];if(u.countSegment(h,p),u.isOnSegment())break}return u.getLocation()}};var ed=function(){},ef={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};ed.prototype.interfaces_=function(){return[]},ed.prototype.getClass=function(){return ed},ed.orientationIndex=function(e,r,i){return B.orientationIndex(e,r,i)},ed.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var r=0,i=e[0].x,n=1;n<e.length-1;n++){var o=e[n].x-i,a=e[n+1].y;r+=o*(e[n-1].y-a)}return r/2}if(L(arguments[0],j)){var s=arguments[0],l=s.size();if(l<3)return 0;var u=new T,c=new T,h=new T;s.getCoordinate(0,c),s.getCoordinate(1,h);var p=c.x;h.x-=p;for(var d=0,f=1;f<l-1;f++)u.y=c.y,c.x=h.x,c.y=h.y,s.getCoordinate(f+1,h),h.x-=p,d+=c.x*(u.y-h.y);return d/2}},ed.distanceLineLine=function(e,r,i,n){if(e.equals(r))return ed.distancePointLine(e,i,n);if(i.equals(n))return ed.distancePointLine(n,e,r);var o=!1;if(W.intersects(e,r,i,n)){var a=(r.x-e.x)*(n.y-i.y)-(r.y-e.y)*(n.x-i.x);if(0===a)o=!0;else{var s=(e.y-i.y)*(n.x-i.x)-(e.x-i.x)*(n.y-i.y),l=((e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y))/a,u=s/a;(u<0||u>1||l<0||l>1)&&(o=!0)}}else o=!0;return o?O.min(ed.distancePointLine(e,i,n),ed.distancePointLine(r,i,n),ed.distancePointLine(i,e,r),ed.distancePointLine(n,e,r)):0},ed.isPointInRing=function(e,r){return ed.locatePointInRing(e,r)!==A.EXTERIOR},ed.computeLength=function(e){var r=e.size();if(r<=1)return 0;var i=0,n=new T;e.getCoordinate(0,n);for(var o=n.x,a=n.y,s=1;s<r;s++){e.getCoordinate(s,n);var l=n.x,u=n.y,c=l-o,h=u-a;i+=Math.sqrt(c*c+h*h),o=l,a=u}return i},ed.isCCW=function(e){var r=e.length-1;if(r<3)throw new v("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=e[0],n=0,o=1;o<=r;o++){var a=e[o];a.y>i.y&&(i=a,n=o)}var s=n;do(s-=1)<0&&(s=r);while(e[s].equals2D(i)&&s!==n);var l=n;do l=(l+1)%r;while(e[l].equals2D(i)&&l!==n);var u=e[s],c=e[l];
113if(u.equals2D(i)||c.equals2D(i)||u.equals2D(c))return!1;var h=ed.computeOrientation(u,i,c);return 0===h?u.x>c.x:h>0},ed.locatePointInRing=function(e,r){return ep.locatePointInRing(e,r)},ed.distancePointLinePerpendicular=function(e,r,i){var n=(i.x-r.x)*(i.x-r.x)+(i.y-r.y)*(i.y-r.y);return Math.abs(((r.y-e.y)*(i.x-r.x)-(r.x-e.x)*(i.y-r.y))/n)*Math.sqrt(n)},ed.computeOrientation=function(e,r,i){return ed.orientationIndex(e,r,i)},ed.distancePointLine=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];if(0===r.length)throw new v("Line array must contain at least one vertex");for(var i=e.distance(r[0]),n=0;n<r.length-1;n++){var o=ed.distancePointLine(e,r[n],r[n+1]);o<i&&(i=o)}return i}if(3==arguments.length){var a=arguments[0],s=arguments[1],l=arguments[2];if(s.x===l.x&&s.y===l.y)return a.distance(s);var u=(l.x-s.x)*(l.x-s.x)+(l.y-s.y)*(l.y-s.y),c=((a.x-s.x)*(l.x-s.x)+(a.y-s.y)*(l.y-s.y))/u;return c<=0?a.distance(s):c>=1?a.distance(l):Math.abs(((s.y-a.y)*(l.x-s.x)-(s.x-a.x)*(l.y-s.y))/u)*Math.sqrt(u)}},ed.isOnLine=function(e,r){for(var i=new ec,n=1;n<r.length;n++){var o=r[n-1],a=r[n];if(i.computeIntersection(e,o,a),i.hasIntersection())return!0}return!1},ef.CLOCKWISE.get=function(){return -1},ef.RIGHT.get=function(){return ed.CLOCKWISE},ef.COUNTERCLOCKWISE.get=function(){return 1},ef.LEFT.get=function(){return ed.COUNTERCLOCKWISE},ef.COLLINEAR.get=function(){return 0},ef.STRAIGHT.get=function(){return ed.COLLINEAR},Object.defineProperties(ed,ef);var em=function(){};em.prototype.filter=function(e){},em.prototype.interfaces_=function(){return[]},em.prototype.getClass=function(){return em};var eg=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},e_={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}};eg.prototype.isGeometryCollection=function(){return this.getSortIndex()===eg.SORTINDEX_GEOMETRYCOLLECTION},eg.prototype.getFactory=function(){return this._factory},eg.prototype.getGeometryN=function(e){return this},eg.prototype.getArea=function(){return 0},eg.prototype.isRectangle=function(){return!1},eg.prototype.equals=function(){if(arguments[0]instanceof eg){var e=arguments[0];return null!==e&&this.equalsTopo(e)}if(arguments[0]instanceof Object){var r=arguments[0];return r instanceof eg&&this.equalsExact(r)}},eg.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)},eg.prototype.geometryChanged=function(){this.apply(eg.geometryChangedFilter)},eg.prototype.geometryChangedAction=function(){this._envelope=null},eg.prototype.equalsNorm=function(e){return null!==e&&this.norm().equalsExact(e.norm())},eg.prototype.getLength=function(){return 0},eg.prototype.getNumGeometries=function(){return 1},eg.prototype.compareTo=function(){if(1==arguments.length){var e=arguments[0];return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(e)}if(2==arguments.length){var r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}},eg.prototype.getUserData=function(){return this._userData},eg.prototype.getSRID=function(){return this._SRID},eg.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},eg.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===eg.SORTINDEX_GEOMETRYCOLLECTION)throw new v("This method does not support GeometryCollection arguments")},eg.prototype.equal=function(e,r,i){return 0===i?e.equals(r):e.distance(r)<=i},eg.prototype.norm=function(){var e=this.copy();return e.normalize(),e},eg.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},eg.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new W(this._envelope)},eg.prototype.setSRID=function(e){this._SRID=e},eg.prototype.setUserData=function(e){this._userData=e},eg.prototype.compare=function(e,r){for(var i=e.iterator(),n=r.iterator();i.hasNext()&&n.hasNext();){var o=i.next(),a=n.next(),s=o.compareTo(a);if(0!==s)return s}return i.hasNext()?1:n.hasNext()?-1:0},eg.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},eg.prototype.isGeometryCollectionOrDerived=function(){return this.get
113SortIndex()===eg.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===eg.SORTINDEX_MULTIPOINT||this.getSortIndex()===eg.SORTINDEX_MULTILINESTRING||this.getSortIndex()===eg.SORTINDEX_MULTIPOLYGON},eg.prototype.interfaces_=function(){return[E,w,r]},eg.prototype.getClass=function(){return eg},eg.hasNonEmptyElements=function(e){for(var r=0;r<e.length;r++)if(!e[r].isEmpty())return!0;return!1},eg.hasNullElements=function(e){for(var r=0;r<e.length;r++)if(null===e[r])return!0;return!1},e_.serialVersionUID.get=function(){return 0x799ea46522854c00},e_.SORTINDEX_POINT.get=function(){return 0},e_.SORTINDEX_MULTIPOINT.get=function(){return 1},e_.SORTINDEX_LINESTRING.get=function(){return 2},e_.SORTINDEX_LINEARRING.get=function(){return 3},e_.SORTINDEX_MULTILINESTRING.get=function(){return 4},e_.SORTINDEX_POLYGON.get=function(){return 5},e_.SORTINDEX_MULTIPOLYGON.get=function(){return 6},e_.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},e_.geometryChangedFilter.get=function(){return ey},Object.defineProperties(eg,e_);var ey=function(){};ey.interfaces_=function(){return[em]},ey.filter=function(e){e.geometryChangedAction()};var ev=function(){};ev.prototype.filter=function(e){},ev.prototype.interfaces_=function(){return[]},ev.prototype.getClass=function(){return ev};var ex=function(){},eb={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}};ex.prototype.isInBoundary=function(e){},ex.prototype.interfaces_=function(){return[]},ex.prototype.getClass=function(){return ex},eb.Mod2BoundaryNodeRule.get=function(){return ew},eb.EndPointBoundaryNodeRule.get=function(){return eE},eb.MultiValentEndPointBoundaryNodeRule.get=function(){return eS},eb.MonoValentEndPointBoundaryNodeRule.get=function(){return eT},eb.MOD2_BOUNDARY_RULE.get=function(){return new ew},eb.ENDPOINT_BOUNDARY_RULE.get=function(){return new eE},eb.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new eS},eb.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new eT},eb.OGC_SFS_BOUNDARY_RULE.get=function(){return ex.MOD2_BOUNDARY_RULE},Object.defineProperties(ex,eb);var ew=function(){};ew.prototype.isInBoundary=function(e){return e%2==1},ew.prototype.interfaces_=function(){return[ex]},ew.prototype.getClass=function(){return ew};var eE=function(){};eE.prototype.isInBoundary=function(e){return e>0},eE.prototype.interfaces_=function(){return[ex]},eE.prototype.getClass=function(){return eE};var eS=function(){};eS.prototype.isInBoundary=function(e){return e>1},eS.prototype.interfaces_=function(){return[ex]},eS.prototype.getClass=function(){return eS};var eT=function(){};eT.prototype.isInBoundary=function(e){return 1===e},eT.prototype.interfaces_=function(){return[ex]},eT.prototype.getClass=function(){return eT};var eI=function(){};eI.prototype.add=function(){},eI.prototype.addAll=function(){},eI.prototype.isEmpty=function(){},eI.prototype.iterator=function(){},eI.prototype.size=function(){},eI.prototype.toArray=function(){},eI.prototype.remove=function(){},(i.prototype=Error()).name="IndexOutOfBoundsException";var eM=function(){};eM.prototype.hasNext=function(){},eM.prototype.next=function(){},eM.prototype.remove=function(){};var eC=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.get=function(){},r.prototype.set=function(){},r.prototype.isEmpty=function(){},r}(eI);(n.prototype=Error()).name="NoSuchElementException";var eA=function(e){function r(){e.call(this),this.array_=[],arguments[0]instanceof eI&&this.addAll(arguments[0])}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.ensureCapacity=function(){},r.prototype.interfaces_=function(){return[e,eI]},r.prototype.add=function(e){return 1==arguments.length?this.array_.push(e):this.array_.splice(arguments[0],arguments[1]),!0},r.prototype.clear=function(){this.array_=[]},r.prototype.addAll=function(e){for(var r=e.iterator();r.hasNext();)this.add(r.next());return!0},r.prototype.set=function(e,r){var i=this.array_[e];return this.array_[e]=r,i},r.prototype.iterator=function(){return new eP(this)},r.prototype.get=function(e){if(e<0||e>=this.size())throw new i;return this.array_[e]},r.prototype.isEmpty=function(){return 0===this.array_.length},r.prototype.size=function(){return this.array_.length},r.prototype.toArray=function(){for(var e=[],r=0,i=this.array_.length;r<i;r++)e.push(this.array_[r]);return e},r.prototype.remove=function(e){for(var r=!1,i=0,n=this.array_.length;i<n;i++)if(this.array_[i]===e){this.array_.splice(i,1),r=!0;break}return r},r}(eC),eP=function(e){function r(r){e.call(this),this.arrayList_=r,this.position_=0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new n;return this.arrayList_.get(this.position_++)},r.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},r.prototype.set=function(e){return this.arrayList_.set(this.position_-1,e)},r.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},r}(eM),eL=function(e){function r(){if(e.call(this),0==arguments.length);else if(1==arguments.length){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(2==arguments.length){var i=arguments[0],n=arguments[1];this.ensureCapacity(i.length),this.add(i,n)}}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={coordArrayType:{configurable:!0}};return i.coordArrayType.get=function(){return[].fill(null)},r.prototype.getCoordinate=function(e){return this.get(e)},r.prototype.addAll=function(){if(2==arguments.length){for(var r=arguments[0],i=arguments[1],n=!1,o=r.iterator();o.hasNext();)this.add(o.next(),i),n=!0;return n}return e.prototype.addAll.apply(this,arguments)},r.prototype.clone=function(){for(var r=e.prototype.clone.call(this),i=0;i<this.size();i++)r.add(i,this.get(i).copy());return r},r.prototype.toCoordinateArray=function(){return this.toArray(r.coordArrayType)},r.prototype.add=function(){if(1==arguments.length){var r=arguments[0];e.prototype.add.call(this,r)}else if(2==arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var i=arguments[0],n=arguments[1];return this.add(i,n,!0),!0}if(arguments[0]instanceof T&&"boolean"==typeof arguments[1]){var o=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(o))return null;e.prototype.add.call(this,o)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var a=arguments[0],s=arguments[1];return this.add(a,s),!0}}else if(3==arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var l=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c<l.length;c++)this.add(l[c],u);else for(var h=l.length-1;h>=0;h--)this.add(l[h],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof T){var p=arguments[0],d=arguments[1];if(!arguments[2]){var f=this.size();if(f>0&&(p>0&&this.get(p-1).equals2D(d)||p<f&&this.get(p).equals2D(d)))return null}e.prototype.add.call(this,p,d)}}else if(4==arguments.length){var m=arguments[0],g=arguments[1],_=arguments[2],y=arguments[3],v=1;_>y&&(v=-1);for(var x=_;x!==y;x+=v)this.add(m[x],g);return!0}},r.prototype.closeRing=function(){this.size()>0&&this.add(new T(this.get(0)),!1)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},Object.defineProperties(r,i),r}(eA),eO=function(){},eD={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};eD.ForwardComparator.get=function(){return eR},eD.BidirectionalComparator.get=function(){return ek},eD.coordArrayType.get=function(){return[].fill(null)},eO.prototype.interfaces_=function(){return[]},eO.prototype.getClass=function(){return eO},eO.isRing=function(e){return!(e.length<4)&&!!e[0].equals2D(e[e.length-1])},eO.ptNotInList=function(e,r){for(var i=0;i<e.length;i++){var n=e[i];if(0>eO.indexOf(n,r))return n}return null},eO.scroll=function(e,r){var i=eO.indexOf(r,e);if(i<0)return null;var n=Array(e.length).fill(null);H.arraycopy(e,i,n,0,e.length-i),H.arraycopy(e,0,n,e.length-i,i),H.arraycopy(n,0,e,0,e.length)},eO.equals=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];if(e===r)return!0;
113if(null===e||null===r||e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].equals(r[i]))return!1;return!0}if(3==arguments.length){var n=arguments[0],o=arguments[1],a=arguments[2];if(n===o)return!0;if(null===n||null===o||n.length!==o.length)return!1;for(var s=0;s<n.length;s++)if(0!==a.compare(n[s],o[s]))return!1;return!0}},eO.intersection=function(e,r){for(var i=new eL,n=0;n<e.length;n++)r.intersects(e[n])&&i.add(e[n],!0);return i.toCoordinateArray()},eO.hasRepeatedPoints=function(e){for(var r=1;r<e.length;r++)if(e[r-1].equals(e[r]))return!0;return!1},eO.removeRepeatedPoints=function(e){return eO.hasRepeatedPoints(e)?new eL(e,!1).toCoordinateArray():e},eO.reverse=function(e){for(var r=e.length-1,i=Math.trunc(r/2),n=0;n<=i;n++){var o=e[n];e[n]=e[r-n],e[r-n]=o}},eO.removeNull=function(e){for(var r=0,i=0;i<e.length;i++)null!==e[i]&&r++;var n=Array(r).fill(null);if(0===r)return n;for(var o=0,a=0;a<e.length;a++)null!==e[a]&&(n[o++]=e[a]);return n},eO.copyDeep=function(){if(1==arguments.length){for(var e=arguments[0],r=Array(e.length).fill(null),i=0;i<e.length;i++)r[i]=new T(e[i]);return r}if(5==arguments.length)for(var n=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],l=arguments[4],u=0;u<l;u++)a[s+u]=new T(n[o+u])},eO.isEqualReversed=function(e,r){for(var i=0;i<e.length;i++){var n=e[i],o=r[e.length-i-1];if(0!==n.compareTo(o))return!1}return!0},eO.envelope=function(e){for(var r=new W,i=0;i<e.length;i++)r.expandToInclude(e[i]);return r},eO.toCoordinateArray=function(e){return e.toArray(eO.coordArrayType)},eO.atLeastNCoordinatesOrNothing=function(e,r){return r.length>=e?r:[]},eO.indexOf=function(e,r){for(var i=0;i<r.length;i++)if(e.equals(r[i]))return i;return -1},eO.increasingDirection=function(e){for(var r=0;r<Math.trunc(e.length/2);r++){var i=e.length-1-r,n=e[r].compareTo(e[i]);if(0!==n)return n}return 1},eO.compare=function(e,r){for(var i=0;i<e.length&&i<r.length;){var n=e[i].compareTo(r[i]);if(0!==n)return n;i++}return i<r.length?-1:+(i<e.length)},eO.minCoordinate=function(e){for(var r=null,i=0;i<e.length;i++)(null===r||r.compareTo(e[i])>0)&&(r=e[i]);return r},eO.extract=function(e,r,i){r=O.clamp(r,0,e.length);var n=(i=O.clamp(i,-1,e.length))-r+1;i<0&&(n=0),r>=e.length&&(n=0),i<r&&(n=0);var o=Array(n).fill(null);if(0===n)return o;for(var a=0,s=r;s<=i;s++)o[a++]=e[s];return o},Object.defineProperties(eO,eD);var eR=function(){};eR.prototype.compare=function(e,r){return eO.compare(e,r)},eR.prototype.interfaces_=function(){return[S]},eR.prototype.getClass=function(){return eR};var ek=function(){};ek.prototype.compare=function(e,r){if(e.length<r.length)return -1;if(e.length>r.length)return 1;if(0===e.length)return 0;var i=eO.compare(e,r);return eO.isEqualReversed(e,r)?0:i},ek.prototype.OLDcompare=function(e,r){if(e.length<r.length)return -1;if(e.length>r.length)return 1;if(0===e.length)return 0;for(var i=eO.increasingDirection(e),n=eO.increasingDirection(r),o=i>0?0:e.length-1,a=n>0?0:e.length-1,s=0;s<e.length;s++){var l=e[o].compareTo(r[a]);if(0!==l)return l;o+=i,a+=n}return 0},ek.prototype.interfaces_=function(){return[S]},ek.prototype.getClass=function(){return ek};var eN=function(){};eN.prototype.get=function(){},eN.prototype.put=function(){},eN.prototype.size=function(){},eN.prototype.values=function(){},eN.prototype.entrySet=function(){};var eF=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r}(eN);(o.prototype=Error()).name="OperationNotSupported",(a.prototype=new eI).contains=function(){};var ez=function(e){function r(){e.call(this),this.array_=[],arguments[0]instanceof eI&&this.addAll(arguments[0])}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.contains=function(e){for(var r=0,i=this.array_.length;r<i;r++)if(this.array_[r]===e)return!0;return!1},r.prototype.add=function(e){return!this.contains(e)&&(this.array_.push(e),!0)},r.prototype.addAll=function(e){for(var r=e.iterator();r.hasNext();)this.add(r.next());return!0},r.prototype.remove=function(e){throw Error()},r.prototype.size=function(){return this.array_.length},r.prototype.isEmpty=function(){return 0===this.array_.length},r.prototype.toArray=function(){for(var e=[],r=0,i=this.array_.length;r<i;r++)e.push(this.array_[r]);return e},r.prototype.iterator=function(){return new eB(this)},r}(a),eB=function(e){function r(r){e.call(this),this.hashSet_=r,this.position_=0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.next=function(){if(this.position_===this.hashSet_.
113size())throw new n;return this.hashSet_.array_[this.position_++]},r.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},r.prototype.remove=function(){throw new o},r}(eM),eU=0;(p.prototype=new eF).get=function(e){for(var r=this.root_;null!==r;){var i=e.compareTo(r.key);if(i<0)r=r.left;else{if(!(i>0))return r.value;r=r.right}}return null},p.prototype.put=function(e,r){if(null===this.root_)return this.root_={key:e,value:r,left:null,right:null,parent:null,color:eU,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var i,n,o=this.root_;do if(i=o,(n=e.compareTo(o.key))<0)o=o.left;else{if(!(n>0)){var a=o.value;return o.value=r,a}o=o.right}while(null!==o);var s={key:e,left:null,right:null,value:r,parent:i,color:eU,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?i.left=s:i.right=s,this.fixAfterInsertion(s),this.size_++,null},p.prototype.fixAfterInsertion=function(e){for(e.color=1;null!=e&&e!==this.root_&&1===e.parent.color;)if(l(e)===c(l(l(e)))){var r=h(l(l(e)));1===s(r)?(u(l(e),eU),u(r,eU),u(l(l(e)),1),e=l(l(e))):(e===h(l(e))&&(e=l(e),this.rotateLeft(e)),u(l(e),eU),u(l(l(e)),1),this.rotateRight(l(l(e))))}else{var i=c(l(l(e)));1===s(i)?(u(l(e),eU),u(i,eU),u(l(l(e)),1),e=l(l(e))):(e===c(l(e))&&(e=l(e),this.rotateRight(e)),u(l(e),eU),u(l(l(e)),1),this.rotateLeft(l(l(e))))}this.root_.color=eU},p.prototype.values=function(){var e=new eA,r=this.getFirstEntry();if(null!==r)for(e.add(r.value);null!==(r=p.successor(r));)e.add(r.value);return e},p.prototype.entrySet=function(){var e=new ez,r=this.getFirstEntry();if(null!==r)for(e.add(r);null!==(r=p.successor(r));)e.add(r);return e},p.prototype.rotateLeft=function(e){if(null!=e){var r=e.right;e.right=r.left,null!=r.left&&(r.left.parent=e),r.parent=e.parent,null===e.parent?this.root_=r:e.parent.left===e?e.parent.left=r:e.parent.right=r,r.left=e,e.parent=r}},p.prototype.rotateRight=function(e){if(null!=e){var r=e.left;e.left=r.right,null!=r.right&&(r.right.parent=e),r.parent=e.parent,null===e.parent?this.root_=r:e.parent.right===e?e.parent.right=r:e.parent.left=r,r.right=e,e.parent=r}},p.prototype.getFirstEntry=function(){var e=this.root_;if(null!=e)for(;null!=e.left;)e=e.left;return e},p.successor=function(e){if(null===e)return null;if(null!==e.right){for(var r=e.right;null!==r.left;)r=r.left;return r}for(var i=e.parent,n=e;null!==i&&n===i.right;)n=i,i=i.parent;return i},p.prototype.size=function(){return this.size_};var ej=function(){};ej.prototype.interfaces_=function(){return[]},ej.prototype.getClass=function(){return ej},d.prototype=new a,(f.prototype=new d).contains=function(e){for(var r=0,i=this.array_.length;r<i;r++)if(0===this.array_[r].compareTo(e))return!0;return!1},f.prototype.add=function(e){if(this.contains(e))return!1;for(var r=0,i=this.array_.length;r<i;r++)if(1===this.array_[r].compareTo(e))return this.array_.splice(r,0,e),!0;return this.array_.push(e),!0},f.prototype.addAll=function(e){for(var r=e.iterator();r.hasNext();)this.add(r.next());return!0},f.prototype.remove=function(e){throw new o},f.prototype.size=function(){return this.array_.length},f.prototype.isEmpty=function(){return 0===this.array_.length},f.prototype.toArray=function(){for(var e=[],r=0,i=this.array_.length;r<i;r++)e.push(this.array_[r]);return e},f.prototype.iterator=function(){return new eV(this)};var eV=function(e){this.treeSet_=e,this.position_=0};eV.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new n;return this.treeSet_.array_[this.position_++]},eV.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},eV.prototype.remove=function(){throw new o};var eG=function(){};eG.sort=function(){var e,r,i,n,o=arguments[0];if(1==arguments.length)n=function(e,r){return e.compareTo(r)},o.sort(n);else if(2==arguments.length)i=arguments[1],n=function(e,r){return i.compare(e,r)},o.sort(n);else if(3==arguments.length){(r=o.slice(arguments[1],arguments[2])).sort();var a=o.slice(0,arguments[1]).concat(r,o.slice(arguments[2],o.length));for(o.splice(0,o.length),e=0;e<a.length;e++)o.push(a[e])}else if(4==arguments.length)for(r=o.slice(arguments[1],arguments[2]),i=arguments[3],n=function(e,r){return i.compare(e,r)},r.sort(n),a=o.slice(0,arguments[1]).concat(r,o.slice(arguments[2],o.length)),o.splice(0,o.length),e=0;e<a.length;e++)o.push(a[e])},eG.asList=function(e){for(var r=new eA,i=0,n=e.length;i<n;i++)r.add(e[i]);return r};var eq=function(){},eH={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}};eH.P.get=function(){return 0},eH.L.get=function(){return 1},eH.A.get=function(){return 2},eH.FALSE.get=function(){return -1},eH.TRUE.get=function(){return -2},eH.DONTCARE.get=function(){return -3},eH.SYM_FALSE.get=function(){return"F"},eH.SYM_TRUE.get=function(){return"T"},eH.SYM_DONTCARE.get=function(){return"*"},eH.SYM_P.get=function(){return"0"},eH.SYM_L.get=function(){return"1"},eH.SYM_A.get=function(){return"2"},eq.prototype.interfaces_=function(){return[]},eq.prototype.getClass=function(){return eq}
113,eq.toDimensionSymbol=function(e){switch(e){case eq.FALSE:return eq.SYM_FALSE;case eq.TRUE:return eq.SYM_TRUE;case eq.DONTCARE:return eq.SYM_DONTCARE;case eq.P:return eq.SYM_P;case eq.L:return eq.SYM_L;case eq.A:return eq.SYM_A}throw new v("Unknown dimension value: "+e)},eq.toDimensionValue=function(e){switch(N.toUpperCase(e)){case eq.SYM_FALSE:return eq.FALSE;case eq.SYM_TRUE:return eq.TRUE;case eq.SYM_DONTCARE:return eq.DONTCARE;case eq.SYM_P:return eq.P;case eq.SYM_L:return eq.L;case eq.SYM_A:return eq.A}throw new v("Unknown dimension symbol: "+e)},Object.defineProperties(eq,eH);var e$=function(){};e$.prototype.filter=function(e){},e$.prototype.interfaces_=function(){return[]},e$.prototype.getClass=function(){return e$};var eW=function(){};eW.prototype.filter=function(e,r){},eW.prototype.isDone=function(){},eW.prototype.isGeometryChanged=function(){},eW.prototype.interfaces_=function(){return[]},eW.prototype.getClass=function(){return eW};var eY=function(e){function r(r,i){if(e.call(this,i),this._geometries=r||[],e.hasNullElements(this._geometries))throw new v("geometries must not contain null elements")}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={serialVersionUID:{configurable:!0}};return r.prototype.computeEnvelopeInternal=function(){for(var e=new W,r=0;r<this._geometries.length;r++)e.expandToInclude(this._geometries[r].getEnvelopeInternal());return e},r.prototype.getGeometryN=function(e){return this._geometries[e]},r.prototype.getSortIndex=function(){return e.SORTINDEX_GEOMETRYCOLLECTION},r.prototype.getCoordinates=function(){for(var e=Array(this.getNumPoints()).fill(null),r=-1,i=0;i<this._geometries.length;i++)for(var n=this._geometries[i].getCoordinates(),o=0;o<n.length;o++)e[++r]=n[o];return e},r.prototype.getArea=function(){for(var e=0,r=0;r<this._geometries.length;r++)e+=this._geometries[r].getArea();return e},r.prototype.equalsExact=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];if(!this.isEquivalentClass(r)||this._geometries.length!==r._geometries.length)return!1;for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].equalsExact(r._geometries[n],i))return!1;return!0}return e.prototype.equalsExact.apply(this,arguments)},r.prototype.normalize=function(){for(var e=0;e<this._geometries.length;e++)this._geometries[e].normalize();eG.sort(this._geometries)},r.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},r.prototype.getBoundaryDimension=function(){for(var e=eq.FALSE,r=0;r<this._geometries.length;r++)e=Math.max(e,this._geometries[r].getBoundaryDimension());return e},r.prototype.getDimension=function(){for(var e=eq.FALSE,r=0;r<this._geometries.length;r++)e=Math.max(e,this._geometries[r].getDimension());return e},r.prototype.getLength=function(){for(var e=0,r=0;r<this._geometries.length;r++)e+=this._geometries[r].getLength();return e},r.prototype.getNumPoints=function(){for(var e=0,r=0;r<this._geometries.length;r++)e+=this._geometries[r].getNumPoints();return e},r.prototype.getNumGeometries=function(){return this._geometries.length},r.prototype.reverse=function(){for(var e=this._geometries.length,r=Array(e).fill(null),i=0;i<this._geometries.length;i++)r[i]=this._geometries[i].reverse();return this.getFactory().createGeometryCollection(r)},r.prototype.compareToSameClass=function(){if(1==arguments.length){var e=arguments[0],r=new f(eG.asList(this._geometries)),i=new f(eG.asList(e._geometries));return this.compare(r,i)}if(2==arguments.length){for(var n=arguments[0],o=arguments[1],a=this.getNumGeometries(),s=n.getNumGeometries(),l=0;l<a&&l<s;){var u=this.getGeometryN(l),c=n.getGeometryN(l),h=u.compareToSameClass(c,o);if(0!==h)return h;l++}return l<a?1:l<s?-1:0}},r.prototype.apply=function(){if(L(arguments[0],ev))for(var e=arguments[0],r=0;r<this._geometries.length;r++)this._geometries[r].apply(e);else if(L(arguments[0],eW)){var i=arguments[0];if(0===this._geometries.length)return null;for(var n=0;n<this._geometries.length&&(this._geometries[n].apply(i),!i.isDone());n++);i.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],e$)){var o=arguments[0];o.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(o)}else if(L(arguments[0],em)){var s=arguments[0];s.filter(this);for(var l=0;l<this._geometries.length;l++)this._geometries[l].apply(s)}},r.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),es.shouldNeverReachHere(),null},r.prototype.clone=function(){var r=e.prototype.clone.call(this);r._geometries=Array(this._geometries.length).fill(null);for(var i=0;i<this._geometries.length;i++)r._geometries[i]=this._geometries[i].clone();return r},r.prototype.getGeometryType=function(){return"GeometryCollection"},r.prototype.copy=function(){for(var e=Array(this._geometries.length).fill(null),i=0;i<e.length;i++)e[i]=this._geometries[i].copy();return new r(e,this._factory)},r.prototype.isEmpty=function(){for(var e=0;e<this._geometries.length;e++)if(!this._geometries[e].isEmpty())return!1;return!0},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},i.serialVersionUID.get=function(){return -0x4f07bcb1f857d800},Object.defineProperties(r,i),r}(eg),eZ=function(e){function r(){e.apply(this,arguments)}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={serialVersionUID:{configurable:!0}};return r.prototype.getSortIndex=function(){return eg.SORTINDEX_MULTILINESTRING},r.prototype.equalsExact=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];return!!this.isEquivalentClass(r)&&e.prototype.equalsExact.call(this,r,i)}return e.prototype.equalsExact.apply(this,arguments)},r.prototype.getBoundaryDimension=function(){return this.isClosed()?eq.FALSE:0},r.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var e=0;e<this._geometries.length;e++)if(!this._geometries[e].isClosed())return!1;return!0},r.prototype.getDimension=function(){return 1},r.prototype.reverse=function(){for(var e=this._geometries.length,r=Array(e).fill(null),i=0;i<this._geometries.length;i++)r[e-1-i]=this._geometries[i].reverse();return this.getFactory().createMultiLineString(r)},r.prototype.getBoundary=function(){return new eX(this).getBoundary()},r.prototype.getGeometryType=function(){return"MultiLineString"},r.prototype.copy=function(){for(var e=Array(this._geometries.length).fill(null),i=0;i<e.length;i++)e[i]=this._geometries[i].copy();return new r(e,this._factory)},r.prototype.interfaces_=function(){return[ej]},r.prototype.getClass=function(){return r},i.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(r,i),r}(eY),eX=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1==arguments.length){var e=arguments[0],r=ex.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=r}else if(2==arguments.length){var i=arguments[0],n=arguments[1];this._geom=i,this._geomFact=i.getFactory(),this._bnRule=n}};eX.prototype.boundaryMultiLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var r=this.computeBoundaryCoordinates(e);return 1===r.length?this._geomFact.createPoint(r[0]):this._geomFact.createMultiPointFromCoords(r)},eX.prototype.getBoundary=function(){return this._geom instanceof e1?this.boundaryLineString(this._geom):this._geom instanceof eZ?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},eX.prototype.boundaryLineString=function(e){return this._geom.isEmpty()?this.getEmptyMultiPoint():e.isClosed()?this._bnRule.isInBoundary(2)?e.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])},eX.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},eX.prototype.computeBoundaryCoordinates=function(e){var r=new eA;this._endpointMap=new p;for(var i=0;i<e.getNumGeometries();i++){var n=e.getGeometryN(i);0!==n.getNumPoints()&&(this.addEndpoint(n.getCoordinateN(0)),this.addEndpoint(n.getCoordinateN(n.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),s=a.getValue().count;this._bnRule.isInBoundary(s)&&r.add(a.getKey())}return eO.toCoordinateArray(r)},eX.prototype.addEndpoint=function(e){var r=this._endpointMap.get(e);null===r&&(r=new eK,this._endpointMap.put(e,r)),r.count++},eX.prototype.interfaces_=function(){return[]},eX.prototype.getClass=function(){return eX},eX.getBoundary=function(){if(1==arguments.length){var e=arguments[0];return new eX(e).getBoundary()}if(2==arguments.length){var r=arguments[0],i=arguments[1];return new eX(r,i).getBoundary()}};var eK=function(){this.count=null};eK.prototype.interfaces_=function(){return[]},eK.prototype.getClass=function(){return eK};var eQ=function(){},eJ={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};eQ.prototype.interfaces_=function(){return[]},eQ.prototype.getClass=function(){return eQ},eQ.chars=function(e,r){for(var i=Array(r).fill(null),n=0;n<r;n++)i[n]=e;return String(i)},eQ.getStackTrace=function(){if(1==arguments.length){var e=arguments[0],r=new function(){},i=new function(){}(r);return e.printStackTrace(i),r.toString()}if(2==arguments.length){for(var n=arguments[0],o=arguments[1],a="",s=new function(){}(new function(){}(eQ.getStackTrace(n))),l=0;l<o;l++)try{a+=s.readLine()+eQ.NEWLINE}catch(e){if(!(e instanceof m))throw e;es.shouldNeverReachHere()}return a}},eQ.split=function(e,r){for(var i=r.length,n=new eA,o=""+e,a=o.indexOf(r);a>=0;){var s=o.substring(0,a);n.add(s),a=(o=o.substring(a+i)).indexOf(r)}o.length>0&&n.add(o);for(var l=Array(n.size()).fill(null),u=0;u<l.length;u++)l[u]=n.get(u);return l},eQ.toString=function(){if(1==arguments.length){var e=arguments[0];return eQ.SIMPLE_ORDINATE_FORMAT.format(e)}},eQ.spaces=function(e){return eQ.chars(" ",e)},eJ.NEWLINE.get=function(){return H.getProperty("line.separator")},eJ.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(eQ,eJ);var e0=function(){};e0.prototype.interfaces_=function(){return[]},e0.prototype.getClass=function(){return e0},e0.copyCoord=function(e,r,i,n){for(var o=Math.min(e.getDimension(),i.getDimension()),a=0;a<o;a++)i.setOrdinate(n,a,e.getOrdinate(r,a))},e0.isRing=function(e){var r=e.size();return 0===r||!(r<=3)&&e.getOrdinate(0,j.X)===e.getOrdinate(r-1,j.X)&&e.getOrdinate(0,j.Y)===e.getOrdinate(r-1,j.Y)},e0.isEqual=function(e,r){var i=e.size();if(i!==r.size())return!1;for(var n=Math.min(e.getDimension(),r.getDimension()),o=0;o<i;o++)for(var a=0;a<n;a++){var s=e.getOrdinate(o,a),l=r.getOrdinate(o,a);if(e.getOrdinate(o,a)!==r.getOrdinate(o,a)&&(!x.isNaN(s)||!x.isNaN(l)))return!1}return!0},e0.extend=function(e,r,i){var n=e.create(i,r.getDimension()),o=r.size();
113if(e0.copy(r,0,n,0,o),o>0)for(var a=o;a<i;a++)e0.copy(r,o-1,n,a,1);return n},e0.reverse=function(e){for(var r=e.size()-1,i=Math.trunc(r/2),n=0;n<=i;n++)e0.swap(e,n,r-n)},e0.swap=function(e,r,i){if(r===i)return null;for(var n=0;n<e.getDimension();n++){var o=e.getOrdinate(r,n);e.setOrdinate(r,n,e.getOrdinate(i,n)),e.setOrdinate(i,n,o)}},e0.copy=function(e,r,i,n,o){for(var a=0;a<o;a++)e0.copyCoord(e,r+a,i,n+a)},e0.toString=function(){if(1==arguments.length){var e=arguments[0],r=e.size();if(0===r)return"()";var i=e.getDimension(),n=new R;n.append("(");for(var o=0;o<r;o++){o>0&&n.append(" ");for(var a=0;a<i;a++)a>0&&n.append(","),n.append(eQ.toString(e.getOrdinate(o,a)))}return n.append(")"),n.toString()}},e0.ensureValidRing=function(e,r){var i=r.size();return 0===i?r:i<=3?e0.createClosedRing(e,r,4):r.getOrdinate(0,j.X)===r.getOrdinate(i-1,j.X)&&r.getOrdinate(0,j.Y)===r.getOrdinate(i-1,j.Y)?r:e0.createClosedRing(e,r,i+1)},e0.createClosedRing=function(e,r,i){var n=e.create(i,r.getDimension()),o=r.size();e0.copy(r,0,n,0,o);for(var a=o;a<i;a++)e0.copy(r,0,n,a,1);return n};var e1=function(e){function r(r,i){e.call(this,i),this._points=null,this.init(r)}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={serialVersionUID:{configurable:!0}};return r.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new W:this._points.expandEnvelope(new W)},r.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},r.prototype.getSortIndex=function(){return e.SORTINDEX_LINESTRING},r.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},r.prototype.equalsExact=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];if(!this.isEquivalentClass(r)||this._points.size()!==r._points.size())return!1;for(var n=0;n<this._points.size();n++)if(!this.equal(this._points.getCoordinate(n),r._points.getCoordinate(n),i))return!1;return!0}return e.prototype.equalsExact.apply(this,arguments)},r.prototype.normalize=function(){for(var e=0;e<Math.trunc(this._points.size()/2);e++){var r=this._points.size()-1-e;if(!this._points.getCoordinate(e).equals(this._points.getCoordinate(r)))return this._points.getCoordinate(e).compareTo(this._points.getCoordinate(r))>0&&e0.reverse(this._points),null}},r.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},r.prototype.getBoundaryDimension=function(){return this.isClosed()?eq.FALSE:0},r.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},r.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},r.prototype.getDimension=function(){return 1},r.prototype.getLength=function(){return ed.computeLength(this._points)},r.prototype.getNumPoints=function(){return this._points.size()},r.prototype.reverse=function(){var e=this._points.copy();return e0.reverse(e),this.getFactory().createLineString(e)},r.prototype.compareToSameClass=function(){if(1==arguments.length){for(var e=arguments[0],r=0,i=0;r<this._points.size()&&i<e._points.size();){var n=this._points.getCoordinate(r).compareTo(e._points.getCoordinate(i));if(0!==n)return n;r++,i++}
113return r<this._points.size()?1:i<e._points.size()?-1:0}if(2==arguments.length){var o=arguments[0];return arguments[1].compare(this._points,o._points)}},r.prototype.apply=function(){if(L(arguments[0],ev))for(var e=arguments[0],r=0;r<this._points.size();r++)e.filter(this._points.getCoordinate(r));else if(L(arguments[0],eW)){var i=arguments[0];if(0===this._points.size())return null;for(var n=0;n<this._points.size()&&(i.filter(this._points,n),!i.isDone());n++);i.isGeometryChanged()&&this.geometryChanged()}else L(arguments[0],e$)?arguments[0].filter(this):L(arguments[0],em)&&arguments[0].filter(this)},r.prototype.getBoundary=function(){return new eX(this).getBoundary()},r.prototype.isEquivalentClass=function(e){return e instanceof r},r.prototype.clone=function(){var r=e.prototype.clone.call(this);return r._points=this._points.clone(),r},r.prototype.getCoordinateN=function(e){return this._points.getCoordinate(e)},r.prototype.getGeometryType=function(){return"LineString"},r.prototype.copy=function(){return new r(this._points.copy(),this._factory)},r.prototype.getCoordinateSequence=function(){return this._points},r.prototype.isEmpty=function(){return 0===this._points.size()},r.prototype.init=function(e){if(null===e&&(e=this.getFactory().getCoordinateSequenceFactory().create([])),1===e.size())throw new v("Invalid number of points in LineString (found "+e.size()+" - must be 0 or >= 2)");this._points=e},r.prototype.isCoordinate=function(e){for(var r=0;r<this._points.size();r++)if(this._points.getCoordinate(r).equals(e))return!0;return!1},r.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},r.prototype.getPointN=function(e){return this.getFactory().createPoint(this._points.getCoordinate(e))},r.prototype.interfaces_=function(){return[ej]},r.prototype.getClass=function(){return r},i.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(r,i),r}(eg),e2=function(){};e2.prototype.interfaces_=function(){return[]},e2.prototype.getClass=function(){return e2};var e3=function(e){function r(r,i){e.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={serialVersionUID:{configurable:!0}};return r.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new W;var e=new W;return e.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),e},r.prototype.getSortIndex=function(){return e.SORTINDEX_POINT},r.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},r.prototype.equalsExact=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];return!!this.isEquivalentClass(r)&&(!(!this.isEmpty()||!r.isEmpty())||this.isEmpty()===r.isEmpty()&&this.equal(r.getCoordinate(),this.getCoordinate(),i))}return e.prototype.equalsExact.apply(this,arguments)},r.prototype.normalize=function(){},r.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},r.prototype.getBoundaryDimension=function(){return eq.FALSE},r.prototype.getDimension=function(){return 0},r.prototype.getNumPoints=function(){return+!this.isEmpty()},r.prototype.reverse=function(){return this.copy()},r.prototype.getX=function(){if(null===this.getCoordinate())throw Error("getX called on empty Point");return this.getCoordinate().x},r.prototype.compareToSameClass=function(){if(1==arguments.length){var e=arguments[0];return this.getCoordinate().compareTo(e.getCoordinate())}if(2==arguments.length){var r=arguments[0];return arguments[1].compare(this._coordinates,r._coordinates)}},r.prototype.apply=function(){if(L(arguments[0],ev)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this.getCoordinate())}else if(L(arguments[0],eW)){var r=arguments[0];if(this.isEmpty())return null;r.filter(this._coordinates,0),r.isGeometryChanged()&&this.geometryChanged()}else L(arguments[0],e$)?arguments[0].filter(this):L(arguments[0],em)&&arguments[0].filter(this)},r.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},r.prototype.clone=function(){var r=e.prototype.clone.call(this);return r._coordinates=this._coordinates.clone(),r},r.prototype.getGeometryType=function(){return"Point"},r.prototype.copy=function(){return new r(this._coordinates.copy(),this._factory)},r.prototype.getCoordinateSequence=function(){return this._coordinates},r.prototype.getY=function(){if(null===this.getCoordinate())throw Error("getY called on empty Point");return this.getCoordinate().y},r.prototype.isEmpty=function(){return 0===this._coordinates.size()},r.prototype.init=function(e){null===e&&(e=this.getFactory().getCoordinateSequenceFactory().create([])),es.isTrue(1>=e.size()),this._coordinates=e},r.prototype.isSimple=function(){return!0},r.prototype.interfaces_=function(){return[e2]},r.prototype.getClass=function(){return r},i.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(r,i),r}(eg),e5=function(){};e5.prototype.interfaces_=function(){return[]},e5.prototype.getClass=function(){return e5};var e4=function(e){function r(r,i,n){if(e.call(this,n),this._shell=null,this._holes=null,null===r&&(r=this.getFactory().createLinearRing()),null===i&&(i=[]),e.hasNullElements(i))throw new v("holes must not contain null elements");if(r.isEmpty()&&e.hasNonEmptyElements(i))throw new v("shell is empty but holes are not");this._shell=r,this._holes=i}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={serialVersionUID:{configurable:!0}};return r.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},r.prototype.getSortIndex=function(){return e.SORTINDEX_POLYGON},r.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var e=Array(this.getNumPoints()).fill(null),r=-1,i=this._shell.getCoordinates(),n=0;n<i.length;n++)e[++r]=i[n];for(var o=0;o<this._holes.length;o++)for(var a=this._holes[o].getCoordinates(),s=0;s<a.length;s++)e[++r]=a[s];return e},r.prototype.getArea=function(){var e;e=0+Math.abs(ed.signedArea(this._shell.getCoordinateSequence()));for(var r=0;r<this._holes.length;r++)e-=Math.abs(ed.signedArea(this._holes[r].getCoordinateSequence()));return e},r.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing()||null===this._shell||5!==this._shell.getNumPoints())return!1;for(var e=this._shell.getCoordinateSequence(),r=this.getEnvelopeInternal(),i=0;i<5;i++){var n=e.getX(i);if(n!==r.getMinX()&&n!==r.getMaxX())return!1;var o=e.getY(i);if(o!==r.getMinY()&&o!==r.getMaxY())return!1}for(var a=e.getX(0),s=e.getY(0),l=1;l<=4;l++){var u=e.getX(l),c=e.getY(l);if(u!==a==(c!==s))return!1;a=u,s=c}return!0},r.prototype.equalsExact=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];if(!this.isEquivalentClass(r))return!1;var n=this._shell,o=r._shell;if(!n.equalsExact(o,i)||this._holes.length!==r._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!this._holes[a].equalsExact(r._holes[a],i))return!1;return!0}return e.prototype.equalsExact.apply(this,arguments)},r.prototype.normalize=function(){if(0==arguments.length){this.normalize(this._shell,!0);for(var e=0;e<this._holes.length;e++)this.normalize(this._holes[e],!1);eG.sort(this._holes)}else if(2==arguments.length){var r=arguments[0],i=arguments[1];if(r.isEmpty())return null;var n=Array(r.getCoordinates().length-1).fill(null);H.arraycopy(r.getCoordinates(),0,n,0,n.length);var o=eO.minCoordinate(r.getCoordinates());eO.scroll(n,o),H.arraycopy(n,0,r.getCoordinates(),0,n.length),r.getCoordinates()[n.length]=n[0],ed.isCCW(r.getCoordinates())===i&&eO.reverse(r.getCoordinates())}},r.prototype.getCoordinate=function(){return this._shell.getCoordinate()},r.prototype.getNumInteriorRing=function(){return this._holes.length},r.prototype.getBoundaryDimension=function(){return 1},r.prototype.getDimension=function(){return 2},r.prototype.getLength=function(){var e;e=0+this._shell.getLength();for(var r=0;r<this._holes.length;r++)e+=this._holes[r].getLength();return e},r.prototype.getNumPoints=function(){for(var e=this._shell.getNumPoints(),r=0;r<this._holes.length;r++)e+=this._holes[r].getNumPoints();return e},r.prototype.reverse=function(){var e=this.copy();e._shell=this._shell.copy().reverse(),e._holes=Array(this._holes.length).fill(null);for(var r=0;r<this._holes.length;r++)e._holes[r]=this._holes[r].copy().reverse();return e},r.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},r.prototype.compareToSameClass=function(){if(1==arguments.length){var e=arguments[0],r=this._shell,i=e._shell;return r.compareToSameClass(i)}if(2==arguments.length){var n=arguments[0],o=arguments[1],a=this._shell,s=n._shell,l=a.compareToSameClass(s,o);if(0!==l)return l;for(var u=this.getNumInteriorRing(),c=n.getNumInteriorRing(),h=0;h<u&&h<c;){var p=this.getInteriorRingN(h),d=n.getInteriorRingN(h),f=p.compareToSameClass(d,o);if(0!==f)return f;h++}return h<u?1:h<c?-1:0}},r.prototype.apply=function(e){if(L(e,ev)){this._shell.apply(e);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(e)}else if(L(e,eW)){if(this._shell.apply(e),!e.isDone())for(var i=0;i<this._holes.length&&(this._holes[i].apply(e),!e.isDone());i++);e.isGeometryChanged()&&this.geometryChanged()}else if(L(e,e$))e.filter(this);else if(L(e,em)){e.filter(this),this._shell.apply(e);for(var n=0;n<this._holes.length;n++)this._holes[n].apply(e)}},r.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var e=Array(this._holes.length+1).fill(null);e[0]=this._shell;for(var r=0;r<this._holes.length;r++)e[r+1]=this._holes[r];return e.length<=1?this.getFactory().createLinearRing(e[0].getCoordinateSequence()):this.getFactory().createMultiLineString(e)},r.prototype.clone=function(){var r=e.prototype.clone.call(this);r._shell=this._shell.clone(),r._holes=Array(this._holes.length).fill(null);for(var i=0;i<this._holes.length;i++)r._holes[i]=this._holes[i].clone();return r},r.prototype.getGeometryType=function(){return"Polygon"},r.prototype.copy=function(){for(var e=this._shell.copy(),i=Array(this._holes.length).fill(null),n=0;n<i.length;n++)i[n]=this._holes[n].copy();return new r(e,i,this._factory)},r.prototype.getExteriorRing=function(){return this._shell},r.prototype.isEmpty=function(){return this._shell.isEmpty()},r.prototype.getInteriorRingN=function(e){return this._holes[e]},r.prototype.interfaces_=function(){return[e5]},r.prototype.getClass=function(){return r},i.serialVersionUID.get=function(){return -0x307ffefd8dc97200},Object.defineProperties(r,i),r}(eg),e6=function(e){function r(){e.apply(this,arguments)}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={serialVersionUID:{configurable:!0}};return r.prototype.getSortIndex=function(){return eg.SORTINDEX_MULTIPOINT},r.prototype.isValid=function(){return!0},r.prototype.equalsExact=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];return!!this.isEquivalentClass(r)&&e.prototype.equalsExact.call(this,r,i)}return e.prototype.equalsExact.apply(this,arguments)},r.prototype.getCoordinate=function(){if(1==arguments.length){var r=arguments[0];return this._geometries[r].getCoordinate()}return e.prototype.getCoordinate.apply(this,arguments)},r.prototype.getBoundaryDimension=function(){return eq.FALSE},r.prototype.getDimension=function(){return 0},r.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},r.prototype.getGeometryType=function(){return"MultiPoint"},r.prototype.copy=function(){for(var e=Array(this._geometries.length).fill(null),i=0;i<e.length;i++)e[i]=this._geometries[i].copy();return new r(e,this._factory)},r.prototype.interfaces_=function(){return[e2]},r.prototype.getClass=function(){return r},i.serialVersionUID.get=function(){return -0x6fb1ed4162e0fc00},Object.defineProperties(r,i),r}(eY),e8=function(e){function r(r,i){r instanceof T&&i instanceof td&&(r=i.getCoordinateSequenceFactory().create(r)),e.call(this,r,i),this.validateConstruction()}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return r.prototype.getSortIndex=function(){return eg.SORTINDEX_LINEARRING},r.prototype.getBoundaryDimension=function(){return eq.FALSE},r.prototype.isClosed=function(){return!!this.isEmpty()||e.prototype.isClosed.call(this)},r.prototype.reverse=function(){var e=this._points.copy();return e0.reverse(e),this.getFactory().createLinearRing(e)},r.prototype.validateConstruction=function(){if(!this.isEmpty()&&!e.prototype.isClosed.call(this))throw new v("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<r.MINIMUM_VALID_SIZE)throw new v("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},r.prototype.getGeometryType=function(){return"LinearRing"},r.prototype.copy=function(){return new r(this._points.copy(),this._factory)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},i.MINIMUM_VALID_SIZE.get=function(){return 4},i.serialVersionUID.get=function(){return -0x3b229e262367a600},Object.defineProperties(r,i),r}(e1),e9=function(e){function r(){e.apply(this,arguments)}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={serialVersionUID:{configurable:!0}};return r.prototype.getSortIndex=function(){return eg.SORTINDEX_MULTIPOLYGON},r.prototype.equalsExact=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];return!!this.isEquivalentClass(r)&&e.prototype.equalsExact.call(this,r,i)}return e.prototype.equalsExact.apply(this,arguments)},r.prototype.getBoundaryDimension=function(){return 1},r.prototype.getDimension=function(){return 2},r.prototype.reverse=function(){for(var e=this._geometries.length,r=Array(e).fill(null),i=0;i<this._geometries.length;i++)r[i]=this._geometries[i].reverse();return this.getFactory().createMultiPolygon(r)},r.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var e=new eA,r=0;r<this._geometries.length;r++)for(var i=this._geometries[r].getBoundary(),n=0;n<i.getNumGeometries();n++)e.add(i.getGeometryN(n));var o=Array(e.size()).fill(null);return this.getFactory().createMultiLineString(e.toArray(o))},r.prototype.getGeometryType=function(){return"MultiPolygon"},r.prototype.copy=function(){for(var e=Array(this._geometries.length).fill(null),i=0;i<e.length;i++)e[i]=this._geometries[i].copy();return new r(e,this._factory)},r.prototype.interfaces_=function(){return[e5]},r.prototype.getClass=function(){return r},i.serialVersionUID.get=function(){return -0x7a5aa1369171980},Object.defineProperties(r,i),r}(eY),e7=function(e){this._factory=e||null,this._isUserDataCopied=!1},te={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};e7.prototype.setCopyUserData=function(e){this._isUserDataCopied=e},e7.prototype.edit=function(e,r){if(null===e)return null;var i=this.editInternal(e,r);return this._isUserDataCopied&&i.setUserData(e.getUserData()),i},e7.prototype.editInternal=function(e,r){return null===this._factory&&(this._factory=e.getFactory()),e instanceof eY?this.editGeometryCollection(e,r):e instanceof e4?this.editPolygon(e,r):e instanceof e3||e instanceof e1?r.edit(e,this._factory):(es.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},e7.prototype.editGeometryCollection=function(e,r){for(var i=r.edit(e,this._factory),n=new eA,o=0;o<i.getNumGeometries();o++){var a=this.edit(i.getGeometryN(o),r);null===a||a.isEmpty()||n.add(a)}return i.getClass()===e6?this._factory.createMultiPoint(n.toArray([])):i.getClass()===eZ?this._factory.createMultiLineString(n.toArray([])):i.getClass()===e9?this._factory.createMultiPolygon(n.toArray([])):this._factory.createGeometryCollection(n.toArray([]))},e7.prototype.editPolygon=function(e,r){var i=r.edit(e,this._factory);if(null===i&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var n=this.edit(i.getExteriorRing(),r);if(null===n||n.isEmpty())return this._factory.createPolygon();for(var o=new eA,a=0;a<i.getNumInteriorRing();a++){var s=this.edit(i.getInteriorRingN(a),r);null===s||s.isEmpt
113y()||o.add(s)}return this._factory.createPolygon(n,o.toArray([]))},e7.prototype.interfaces_=function(){return[]},e7.prototype.getClass=function(){return e7},e7.GeometryEditorOperation=function(){},te.NoOpGeometryOperation.get=function(){return tt},te.CoordinateOperation.get=function(){return tr},te.CoordinateSequenceOperation.get=function(){return ti},Object.defineProperties(e7,te);var tt=function(){};tt.prototype.edit=function(e,r){return e},tt.prototype.interfaces_=function(){return[e7.GeometryEditorOperation]},tt.prototype.getClass=function(){return tt};var tr=function(){};tr.prototype.edit=function(e,r){var i=this.editCoordinates(e.getCoordinates(),e);return null===i?e:e instanceof e8?r.createLinearRing(i):e instanceof e1?r.createLineString(i):e instanceof e3?i.length>0?r.createPoint(i[0]):r.createPoint():e},tr.prototype.interfaces_=function(){return[e7.GeometryEditorOperation]},tr.prototype.getClass=function(){return tr};var ti=function(){};ti.prototype.edit=function(e,r){return e instanceof e8?r.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof e1?r.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof e3?r.createPoint(this.edit(e.getCoordinateSequence(),e)):e},ti.prototype.interfaces_=function(){return[e7.GeometryEditorOperation]},ti.prototype.getClass=function(){return ti};var tn=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 e=arguments[0];this._coordinates=Array(e).fill(null);for(var r=0;r<e;r++)this._coordinates[r]=new T}else if(L(arguments[0],j)){var i=arguments[0];if(null===i)return this._coordinates=[].fill(null),null;this._dimension=i.getDimension(),this._coordinates=Array(i.size()).fill(null);for(var n=0;n<this._coordinates.length;n++)this._coordinates[n]=i.getCoordinateCopy(n)}}else if(2==arguments.length){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,null===o&&(this._coordinates=[].fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],l=arguments[1];this._coordinates=Array(s).fill(null),this._dimension=l;for(var u=0;u<s;u++)this._coordinates[u]=new T}}},to={serialVersionUID:{configurable:!0}};tn.prototype.setOrdinate=function(e,r,i){switch(r){case j.X:this._coordinates[e].x=i;break;case j.Y:this._coordinates[e].y=i;break;case j.Z:this._coordinates[e].z=i;break;default:throw new v("invalid ordinateIndex")}},tn.prototype.size=function(){return this._coordinates.length},tn.prototype.getOrdinate=function(e,r){switch(r){case j.X:return this._coordinates[e].x;case j.Y:return this._coordinates[e].y;case j.Z:return this._coordinates[e].z}return x.NaN},tn.prototype.getCoordinate=function(){if(1==arguments.length){var e=arguments[0];return this._coordinates[e]}if(2==arguments.length){var r=arguments[0],i=arguments[1];i.x=this._coordinates[r].x,i.y=this._coordinates[r].y,i.z=this._coordinates[r].z}},tn.prototype.getCoordinateCopy=function(e){return new T(this._coordinates[e])},tn.prototype.getDimension=function(){return this._dimension},tn.prototype.getX=function(e){return this._coordinates[e].x},tn.prototype.clone=function(){for(var e=Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=this._coordinates[r].clone();return new tn(e,this._dimension)},tn.prototype.expandEnvelope=function(e){for(var r=0;r<this._coordinates.length;r++)e.expandToInclude(this._coordinates[r]);return e},tn.prototype.copy=function(){for(var e=Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=this._coordinates[r].copy();return new tn(e,this._dimension)},tn.prototype.toString=function(){if(this._coordinates.length>0){var e=new R(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)e.append(", "),e.append(this._coordinates[r]);return e.append(")"),e.toString()}return"()"},tn.prototype.getY=function(e){return this._coordinates[e].y},tn.prototype.toCoordinateArray=function(){return this._coordinates},tn.prototype.interfaces_=function(){return[j,r]},tn.prototype.getClass=function(){return tn},to.serialVersionUID.get=function(){return -0xcb44a778db18e00},Object.defineProperties(tn,to);var ta=function(){},ts={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ta.prototype.readResolve=function(){return ta.instance()},ta.prototype.create=function(){if(1==arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return new tn(e)}if(L(arguments[0],j)){var r=arguments[0];return new tn(r)}}else if(2==arguments.length){var i=arguments[0],n=arguments[1];return n>3&&(n=3),n<2?new tn(i):new tn(i,n)}},ta.prototype.interfaces_=function(){return[C,r]},ta.prototype.getClass=function(){return ta},ta.instance=function(){return ta.instanceObject},ts.serialVersionUID.get=function(){return -0x38e49fa6cf6f2e00},ts.instanceObject.get=function(){return new ta},Object.defineProperties(ta,ts);var tl=function(e){function r(){e.call(this),this.map_=new Map}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.get=function(e){return this.map_.get(e)||null},r.prototype.put=function(e,r){return this.map_.set(e,r),r},r.prototype.values=function(){for(var e=new eA,r=this.map_.values(),i=r.next();!i.done;)e.add(i.value),i=r.next();return e},r.prototype.entrySet=function(){var e=new ez;
113return this.map_.entries().forEach(function(r){return e.add(r)}),e},r.prototype.size=function(){return this.map_.size()},r}(eN),tu=function e(){if(this._modelType=null,this._scale=null,0==arguments.length)this._modelType=e.FLOATING;else if(1==arguments.length){if(arguments[0]instanceof th){var r=arguments[0];this._modelType=r,r===e.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var i=arguments[0];this._modelType=e.FIXED,this.setScale(i)}else if(arguments[0]instanceof e){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},tc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};tu.prototype.equals=function(e){return e instanceof tu&&this._modelType===e._modelType&&this._scale===e._scale},tu.prototype.compareTo=function(e){var r=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new k(r).compareTo(new k(i))},tu.prototype.getScale=function(){return this._scale},tu.prototype.isFloating=function(){return this._modelType===tu.FLOATING||this._modelType===tu.FLOATING_SINGLE},tu.prototype.getType=function(){return this._modelType},tu.prototype.toString=function(){var e="UNKNOWN";return this._modelType===tu.FLOATING?e="Floating":this._modelType===tu.FLOATING_SINGLE?e="Floating-Single":this._modelType===tu.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},tu.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var e=arguments[0];return x.isNaN(e)||this._modelType===tu.FLOATING_SINGLE?e:this._modelType===tu.FIXED?Math.round(e*this._scale)/this._scale:e}if(arguments[0]instanceof T){var r=arguments[0];if(this._modelType===tu.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}},tu.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===tu.FLOATING?e=16:this._modelType===tu.FLOATING_SINGLE?e=6:this._modelType===tu.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},tu.prototype.setScale=function(e){this._scale=Math.abs(e)},tu.prototype.interfaces_=function(){return[r,w]},tu.prototype.getClass=function(){return tu},tu.mostPrecise=function(e,r){return e.compareTo(r)>=0?e:r},tc.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},tc.maximumPreciseValue.get=function(){return 0x20000000000000},Object.defineProperties(tu,tc);var th=function e(r){this._name=r||null,e.nameToTypeMap.put(r,this)},tp={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};th.prototype.readResolve=function(){return th.nameToTypeMap.get(this._name)},th.prototype.toString=function(){return this._name},th.prototype.interfaces_=function(){return[r]},th.prototype.getClass=function(){return th},tp.serialVersionUID.get=function(){return -0x4cb98acd40a6b400},tp.nameToTypeMap.get=function(){return new tl},Object.defineProperties(th,tp),tu.Type=th,tu.FIXED=new th("FIXED"),tu.FLOATING=new th("FLOATING"),tu.FLOATING_SINGLE=new th("FLOATING SINGLE");var td=function e(){this._precisionModel=new tu,this._SRID=0,this._coordinateSequenceFactory=e.getDefaultCoordinateSequenceFactory(),0==arguments.length||(1==arguments.length?L(arguments[0],C)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof tu&&(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]))},tf={serialVersionUID:{configurable:!0}};td.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new T(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new T(e.getMinX(),e.getMinY()),new T(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new T(e.getMinX(),e.getMinY()),new T(e.getMinX(),e.getMaxY()),new T(e.getMaxX(),e.getMaxY()),new T(e.getMaxX(),e.getMinY()),new T(e.getMinX(),e.getMinY())]),null)},td.prototype.createLineString=function(e){return e?e instanceof Array?new e1(this.getCoordinateSequenceFactory().create(e),this):L(e,j)?new e1(e,this):void 0:new e1(this.getCoordinateSequenceFactory().create([]),this)},td.prototype.createMultiLineString=function(){if(0==arguments.length)return new eZ(null,this);if(1==arguments.length){var e=arguments[0];return new eZ(e,this)}},td.prototype.buildGeometry=function(e){for(var r=null,i=!1,n=!1,o=e.iterator();o.hasNext();){var a=o.next(),s=a.getClass();null===r&&(r=s),s!==r&&(i=!0),a.isGeometryCollectionOrDerived()&&(n=!0)}if(null===r)return this.createGeometryCollection();if(i||n)return this.createGeometryCollection(td.toGeometryArray(e));var l=e.iterator().next();if(e.size()>1){if(l instanceof e4)return this.createMultiPolygon(td.toPolygonArray(e));if(l instanceof e1)return this.createMultiLineString(td.toLineStringArray(e));if(l instanceof e3)return this.createMultiPoint(td.toPointArray(e));es.shouldNeverReachHere("Unhandled class: "+l.getClass().getName())}return l},td.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)},td.prototype.createPoint=function(){if(0==arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1==arguments.length){if(arguments[0]instanceof T){var e=arguments[0];return this.createPoint(null!==e?this.getCoordinateSequenceFactory().create([e]):null)}if(L(arguments[0],j)){var r=arguments[0];return new e3(r,this)}}},td.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},td.prototype.createPolygon=function(){if(0==arguments.length)return new e4(null,null,this);if(1==arguments.length){if(L(arguments[0],j)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Array){var r=arguments[0];return this.createPolygon(this.createLinearRing(r))}if(arguments[0]instanceof e8){var i=arguments[0];return this.createPolygon(i,null)}}else if(2==arguments.length){var n=arguments[0],o=arguments[1];return new e4(n,o,this)}},td.prototype.getSRID=function(){return this._SRID},td.prototype.createGeometryCollection=function(){if(0==arguments.length)return new eY(null,this);if(1==arguments.length){var e=arguments[0];return new eY(e,this)}},td.prototype.createGeometry=function(e){return new e7(this).edit(e,{edit:function(){if(2==arguments.length){var e=arguments[0];return this._coordinateSequenceFactory.create(e)}}})},td.prototype.getPrecisionModel=function(){return this._precisionModel},td.prototype.createLinearRing=function(){if(0==arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1==arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(L(arguments[0],j)){var r=arguments[0];return new e8(r,this)}}},td.prototype.createMultiPolygon=function(){if(0==arguments.length)return new e9(null,this);if(1==arguments.length){var e=arguments[0];return new e9(e,this)}},td.prototype.createMultiPoint=function(){if(0==arguments.length)return new e6(null,this);if(1==arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return new e6(e,this)}
113if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(null!==r?this.getCoordinateSequenceFactory().create(r):null)}if(L(arguments[0],j)){var i=arguments[0];if(null===i)return this.createMultiPoint([].fill(null));for(var n=Array(i.size()).fill(null),o=0;o<i.size();o++){var a=this.getCoordinateSequenceFactory().create(1,i.getDimension());e0.copy(i,o,a,0,1),n[o]=this.createPoint(a)}return this.createMultiPoint(n)}}},td.prototype.interfaces_=function(){return[r]},td.prototype.getClass=function(){return td},td.toMultiPolygonArray=function(e){var r=Array(e.size()).fill(null);return e.toArray(r)},td.toGeometryArray=function(e){if(null===e)return null;var r=Array(e.size()).fill(null);return e.toArray(r)},td.getDefaultCoordinateSequenceFactory=function(){return ta.instance()},td.toMultiLineStringArray=function(e){var r=Array(e.size()).fill(null);return e.toArray(r)},td.toLineStringArray=function(e){var r=Array(e.size()).fill(null);return e.toArray(r)},td.toMultiPointArray=function(e){var r=Array(e.size()).fill(null);return e.toArray(r)},td.toLinearRingArray=function(e){var r=Array(e.size()).fill(null);return e.toArray(r)},td.toPointArray=function(e){var r=Array(e.size()).fill(null);return e.toArray(r)},td.toPolygonArray=function(e){var r=Array(e.size()).fill(null);return e.toArray(r)},td.createPointFromInternalCoord=function(e,r){return r.getPrecisionModel().makePrecise(e),r.getFactory().createPoint(e)},tf.serialVersionUID.get=function(){return -0x5ea75f2051eeb400},Object.defineProperties(td,tf);var tm=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],tg=function(e){this.geometryFactory=e||new td};tg.prototype.read=function(e){var r,i=(r="string"==typeof e?JSON.parse(e):e).type;if(!t_[i])throw Error("Unknown GeoJSON type: "+r.type);return -1!==tm.indexOf(i)?t_[i].apply(this,[r.coordinates]):"GeometryCollection"===i?t_[i].apply(this,[r.geometries]):t_[i].apply(this,[r])},tg.prototype.write=function(e){var r=e.getGeometryType();if(!ty[r])throw Error("Geometry is not supported");return ty[r].apply(this,[e])};var t_={Feature:function(e){var r={};for(var i in e)r[i]=e[i];if(e.geometry){if(!t_[e.geometry.type])throw Error("Unknown GeoJSON type: "+e.type);r.geometry=this.read(e.geometry)}return e.bbox&&(r.bbox=t_.bbox.apply(this,[e.bbox])),r},FeatureCollection:function(e){var r={};if(e.features){r.features=[];for(var i=0;i<e.features.length;++i)r.features.push(this.read(e.features[i]))}return e.bbox&&(r.bbox=this.parse.bbox.apply(this,[e.bbox])),r},coordinates:function(e){for(var r=[],i=0;i<e.length;++i){var n=e[i];r.push(new T(n[0],n[1]))}return r},bbox:function(e){return this.geometryFactory.createLinearRing([new T(e[0],e[1]),new T(e[2],e[1]),new T(e[2],e[3]),new T(e[0],e[3]),new T(e[0],e[1])])},Point:function(e){var r=new T(e[0],e[1]);return this.geometryFactory.createPoint(r)},MultiPoint:function(e){for(var r=[],i=0;i<e.length;++i)r.push(t_.Point.apply(this,[e[i]]));return this.geometryFactory.createMultiPoint(r)},LineString:function(e){var r=t_.coordinates.apply(this,[e]);return this.geometryFactory.createLineString(r)},MultiLineString:function(e){for(var r=[],i=0;i<e.length;++i)r.push(t_.LineString.apply(this,[e[i]]));return this.geometryFactory.createMultiLineString(r)},Polygon:function(e){for(var r=t_.coordinates.apply(this,[e[0]]),i=this.geometryFactory.createLinearRing(r),n=[],o=1;o<e.length;++o){var a=e[o],s=t_.coordinates.apply(this,[a]),l=this.geometryFactory.createLinearRing(s);n.push(l)}return this.geometryFactory.createPolygon(i,n)},MultiPolygon:function(e){for(var r=[],i=0;i<e.length;++i){var n=e[i];r.push(t_.Polygon.apply(this,[n]))}return this.geometryFactory.createMultiPolygon(r)},GeometryCollection:function(e){for(var r=[],i=0;i<e.length;++i){var n=e[i];r.push(this.read(n))}return this.geometryFactory.createGeometryCollection(r)}},ty={coordinate:function(e){return[e.x,e.y]},Point:function(e){return{type:"Point",coordinates:ty.coordinate.apply(this,[e.getCoordinate()])}},MultiPoint:function(e){for(var r=[],i=0;i<e._geometries.length;++i){var n=e._geometries[i],o=ty.Point.apply(this,[n]);r.push(o.coordinates)}return{type:"MultiPoint",coordinates:r}},LineString:function(e){for(var r=[],i=e.getCoordinates(),n=0;n<i.length;++n){var o=i[n];r.push(ty.coordinate.apply(this,[o]))}return{type:"LineString",coordinates:r}},MultiLineString:function(e){for(var r=[],i=0;i<e._geometries.length;++i){var n=e._geometries[i],o=ty.LineString.apply(this,[n]);r.push(o.coordinates)}return{type:"MultiLineString",coordinates:r}},Polygon:function(e){var r=[],i=ty.LineString.apply(this,[e._shell]);r.push(i.coordinates);for(var n=0;n<e._holes.length;++n){var o=e._holes[n],a=ty.LineString.apply(this,[o]);r.push(a.coordinates)}return{type:"Polygon",coordinates:r}},MultiPolygon:function(e){for(var r=[],i=0;i<e._geometries.length;++i){var n=e._geometries[i],o=ty.Polygon.apply(this,[n]);r.push(o.coordinates)}return{type:"MultiPolygon",coordinates:r}},GeometryCollection:function(e){for(var r=[],i=0;i<e._geometries.length;++i){var n=e._geometries[i],o=n.getGeometryType();r.push(ty[o].apply(this,[n]))}return{type:"GeometryCollection",geometries:r}}},tv=function(e){this.geometryFactory=e||new td,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new tg(this.geometryFactory)};tv.prototype.read=function(e){var r=this.parser.read(e);
113return this.precisionModel.getType()===tu.FIXED&&this.reducePrecision(r),r},tv.prototype.reducePrecision=function(e){var r,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(r=0,i=e.points.length;r<i;r++)this.precisionModel.makePrecise(e.points[r]);else if(e.geometries)for(r=0,i=e.geometries.length;r<i;r++)this.reducePrecision(e.geometries[r])};var tx=function(){this.parser=new tg(this.geometryFactory)};tx.prototype.write=function(e){return this.parser.write(e)};var tb=function(){},tw={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};tb.prototype.interfaces_=function(){return[]},tb.prototype.getClass=function(){return tb},tb.opposite=function(e){return e===tb.LEFT?tb.RIGHT:e===tb.RIGHT?tb.LEFT:e},tw.ON.get=function(){return 0},tw.LEFT.get=function(){return 1},tw.RIGHT.get=function(){return 2},Object.defineProperties(tb,tw),(g.prototype=Error()).name="EmptyStackException",(_.prototype=new eC).add=function(e){return this.array_.push(e),!0},_.prototype.get=function(e){if(e<0||e>=this.size())throw Error();return this.array_[e]},_.prototype.push=function(e){return this.array_.push(e),e},_.prototype.pop=function(e){if(0===this.array_.length)throw new g;return this.array_.pop()},_.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},_.prototype.empty=function(){return 0===this.array_.length},_.prototype.isEmpty=function(){return this.empty()},_.prototype.search=function(e){return this.array_.indexOf(e)},_.prototype.size=function(){return this.array_.length},_.prototype.toArray=function(){for(var e=[],r=0,i=this.array_.length;r<i;r++)e.push(this.array_[r]);return e};var tE=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};tE.prototype.getCoordinate=function(){return this._minCoord},tE.prototype.getRightmostSide=function(e,r){var i=this.getRightmostSideOfSegment(e,r);return i<0&&(i=this.getRightmostSideOfSegment(e,r-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),i},tE.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();es.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var r=e[this._minIndex-1],i=e[this._minIndex+1],n=ed.computeOrientation(this._minCoord,i,r),o=!1;r.y<this._minCoord.y&&i.y<this._minCoord.y&&n===ed.COUNTERCLOCKWISE?o=!0:r.y>this._minCoord.y&&i.y>this._minCoord.y&&n===ed.CLOCKWISE&&(o=!0),o&&(this._minIndex=this._minIndex-1)},tE.prototype.getRightmostSideOfSegment=function(e,r){var i=e.getEdge().getCoordinates();if(r<0||r+1>=i.length||i[r].y===i[r+1].y)return -1;var n=tb.LEFT;return i[r].y<i[r+1].y&&(n=tb.RIGHT),n},tE.prototype.getEdge=function(){return this._orientedDe},tE.prototype.checkForRightmostCoordinate=function(e){for(var r=e.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(null===this._minCoord||r[i].x>this._minCoord.x)&&(this._minDe=e,this._minIndex=i,this._minCoord=r[i])},tE.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode().getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},tE.prototype.findEdge=function(e){for(var r=e.iterator();r.hasNext();){var i=r.next();i.isForward()&&this.checkForRightmostCoordinate(i)}es.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)===tb.LEFT&&(this._orientedDe=this._minDe.getSym())},tE.prototype.interfaces_=function(){return[]},tE.prototype.getClass=function(){return tE};var tS=function(e){function r(i,n){e.call(this,r.msgWithCoord(i,n)),this.pt=n?new T(n):null,this.name="TopologyException"}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCoordinate=function(){return this.pt},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r.msgWithCoord=function(e,r){return r?e:e+" [ "+r+" ]"},r}(eo),tT=function(){this.array_=[]};tT.prototype.addLast=function(e){this.array_.push(e)},tT.prototype.removeFirst=function(){return this.array_.shift()},tT.prototype.isEmpty=function(){return 0===this.array_.length};var tI=function(){this._finder=null,this._dirEdgeList=new eA,this._nodes=new eA,this._rightMostCoord=null,this._env=null,this._finder=new tE};tI.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();)e.next().setVisited(!1)},tI.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},tI.prototype.computeNodeDepth=function(e){for(var r=null,i=e.getEdges().iterator();i.hasNext();){var n=i.next();if(n.isVisited()||n.getSym().isVisited()){r=n;break}}if(null===r)throw new tS("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(r);for(var o=e.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),this.copySymDepths(a)}},tI.prototype.computeDepth=function(e){this.clearVisitedEdges();var r=this._finder.getEdge();r.setEdgeDepths(tb.RIGHT,e),this.copySymDepths(r),this.computeDepths(r)},tI.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},tI.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var r=e.next();r.getDepth(tb.RIGHT)>=1&&0>=r.getDepth(tb.LEFT)&&!r.isInteriorAreaEdge()&&r.setInResult(!0)}},tI.prototype.computeDepths=function(e){var r=new ez,i=new tT,n=e.getNode();for(i.addLast(n),r.add(n),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();r.add(o),this.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var s=a.next().getSym();if(!s.isVisited()){var l=s.getNode();r.contains(l)||(i.addLast(l),r.add(l))}}}},tI.prototype.compareTo=function(e){return this._rightMostCoord.x<e._rightMostCoord.x?-1:+(this._rightMostCoord.x>e._rightMostCoord.x)},tI.prototype.getEnvelope=function(){if(null===this._env){for(var e=new W,r=this._dirEdgeList.iterator();r.hasNext();)for(var i=r.next().getEdge().getCoordinates(),n=0;n<i.length-1;n++)e.expandToInclude(i[n]);this._env=e}return this._env},tI.prototype.addReachable=function(e){var r=new _;for(r.add(e);!r.empty();){var i=r.pop();this.add(i,r)}},tI.prototype.copySymDepths=function(e){var r=e.getSym();r.setDepth(tb.LEFT,e.getDepth(tb.RIGHT)),r.setDepth(tb.RIGHT,e.getDepth(tb.LEFT))},tI.prototype.add=function(e,r){e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var n=i.next();this._dirEdgeList.add(n);
113var o=n.getSym().getNode();o.isVisited()||r.push(o)}},tI.prototype.getNodes=function(){return this._nodes},tI.prototype.getDirectedEdges=function(){return this._dirEdgeList},tI.prototype.interfaces_=function(){return[w]},tI.prototype.getClass=function(){return tI};var tM=function e(){if(this.location=null,1==arguments.length){if(arguments[0]instanceof Array){var r=arguments[0];this.init(r.length)}else if(Number.isInteger(arguments[0])){var i=arguments[0];this.init(1),this.location[tb.ON]=i}else if(arguments[0]instanceof e){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var o=0;o<this.location.length;o++)this.location[o]=n.location[o]}}else if(3==arguments.length){var a=arguments[0],s=arguments[1],l=arguments[2];this.init(3),this.location[tb.ON]=a,this.location[tb.LEFT]=s,this.location[tb.RIGHT]=l}};tM.prototype.setAllLocations=function(e){for(var r=0;r<this.location.length;r++)this.location[r]=e},tM.prototype.isNull=function(){for(var e=0;e<this.location.length;e++)if(this.location[e]!==A.NONE)return!1;return!0},tM.prototype.setAllLocationsIfNull=function(e){for(var r=0;r<this.location.length;r++)this.location[r]===A.NONE&&(this.location[r]=e)},tM.prototype.isLine=function(){return 1===this.location.length},tM.prototype.merge=function(e){if(e.location.length>this.location.length){var r=[,,,].fill(null);r[tb.ON]=this.location[tb.ON],r[tb.LEFT]=A.NONE,r[tb.RIGHT]=A.NONE,this.location=r}for(var i=0;i<this.location.length;i++)this.location[i]===A.NONE&&i<e.location.length&&(this.location[i]=e.location[i])},tM.prototype.getLocations=function(){return this.location},tM.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[tb.LEFT];this.location[tb.LEFT]=this.location[tb.RIGHT],this.location[tb.RIGHT]=e},tM.prototype.toString=function(){var e=new R;return this.location.length>1&&e.append(A.toLocationSymbol(this.location[tb.LEFT])),e.append(A.toLocationSymbol(this.location[tb.ON])),this.location.length>1&&e.append(A.toLocationSymbol(this.location[tb.RIGHT])),e.toString()},tM.prototype.setLocations=function(e,r,i){this.location[tb.ON]=e,this.location[tb.LEFT]=r,this.location[tb.RIGHT]=i},tM.prototype.get=function(e){return e<this.location.length?this.location[e]:A.NONE},tM.prototype.isArea=function(){return this.location.length>1},tM.prototype.isAnyNull=function(){for(var e=0;e<this.location.length;e++)if(this.location[e]===A.NONE)return!0;return!1},tM.prototype.setLocation=function(){if(1==arguments.length){var e=arguments[0];this.setLocation(tb.ON,e)}else if(2==arguments.length){var r=arguments[0],i=arguments[1];this.location[r]=i}},tM.prototype.init=function(e){this.location=Array(e).fill(null),this.setAllLocations(A.NONE)},tM.prototype.isEqualOnSide=function(e,r){return this.location[r]===e.location[r]},tM.prototype.allPositionsEqual=function(e){for(var r=0;r<this.location.length;r++)if(this.location[r]!==e)return!1;return!0},tM.prototype.interfaces_=function(){return[]},tM.prototype.getClass=function(){return tM};var tC=function e(){if(this.elt=[,,].fill(null),1==arguments.length){if(Number.isInteger(arguments[0])){var r=arguments[0];this.elt[0]=new tM(r),this.elt[1]=new tM(r)}else if(arguments[0]instanceof e){var i=arguments[0];this.elt[0]=new tM(i.elt[0]),this.elt[1]=new tM(i.elt[1])}}else if(2==arguments.length){var n=arguments[0],o=arguments[1];this.elt[0]=new tM(A.NONE),this.elt[1]=new tM(A.NONE),this.elt[n].setLocation(o)}else if(3==arguments.length){var a=arguments[0],s=arguments[1],l=arguments[2];this.elt[0]=new tM(a,s,l),this.elt[1]=new tM(a,s,l)}else if(4==arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2],p=arguments[3];this.elt[0]=new tM(A.NONE,A.NONE,A.NONE),this.elt[1]=new tM(A.NONE,A.NONE,A.NONE),this.elt[u].setLocations(c,h,p)}};tC.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},tC.prototype.setAllLocations=function(e,r){this.elt[e].setAllLocations(r)},tC.prototype.isNull=function(e){return this.elt[e].isNull()},tC.prototype.setAllLocationsIfNull=function(){if(1==arguments.length){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(2==arguments.length){var r=arguments[0],i=arguments[1];this.elt[r].setAllLocationsIfNull(i)}},tC.prototype.isLine=function(e){return this.elt[e].isLine()},tC.prototype.merge=function(e){for(var r=0;r<2;r++)null===this.elt[r]&&null!==e.elt[r]?this.elt[r]=new tM(e.elt[r]):this.elt[r].merge(e.elt[r])},tC.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},tC.prototype.getLocation=function(){if(1==arguments.length){var e=arguments[0];return this.elt[e].get(tb.ON)}if(2==arguments.length){var r=arguments[0],i=arguments[1];return this.elt[r].get(i)}},tC.prototype.toString=function(){var e=new R;
113return null!==this.elt[0]&&(e.append("A:"),e.append(this.elt[0].toString())),null!==this.elt[1]&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()},tC.prototype.isArea=function(){if(0==arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1==arguments.length){var e=arguments[0];return this.elt[e].isArea()}},tC.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()},tC.prototype.setLocation=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];this.elt[e].setLocation(tb.ON,r)}else if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2];this.elt[i].setLocation(n,o)}},tC.prototype.isEqualOnSide=function(e,r){return this.elt[0].isEqualOnSide(e.elt[0],r)&&this.elt[1].isEqualOnSide(e.elt[1],r)},tC.prototype.allPositionsEqual=function(e,r){return this.elt[e].allPositionsEqual(r)},tC.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new tM(this.elt[e].location[0]))},tC.prototype.interfaces_=function(){return[]},tC.prototype.getClass=function(){return tC},tC.toLineLabel=function(e){for(var r=new tC(A.NONE),i=0;i<2;i++)r.setLocation(i,e.getLocation(i));return r};var tA=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new eA,this._pts=new eA,this._label=new tC(A.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new eA,this._geometryFactory=null;var e=arguments[0],r=arguments[1];this._geometryFactory=r,this.computePoints(e),this.computeRing()};tA.prototype.computeRing=function(){if(null!==this._ring)return null;for(var e=Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)e[r]=this._pts.get(r);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=ed.isCCW(this._ring.getCoordinates())},tA.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},tA.prototype.computePoints=function(e){this._startDe=e;var r=e,i=!0;do{if(null===r)throw new tS("Found null DirectedEdge");if(r.getEdgeRing()===this)throw new tS("Directed Edge visited twice during ring-building at "+r.getCoordinate());this._edges.add(r);var n=r.getLabel();es.isTrue(n.isArea()),this.mergeLabel(n),this.addPoints(r.getEdge(),r.isForward(),i),i=!1,this.setEdgeRing(r,this),r=this.getNext(r)}while(r!==this._startDe)},tA.prototype.getLinearRing=function(){return this._ring},tA.prototype.getCoordinate=function(e){return this._pts.get(e)},tA.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var e=this._startDe;do{var r=e.getNode().getEdges().getOutgoingDegree(this);r>this._maxNodeDegree&&(this._maxNodeDegree=r),e=this.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},tA.prototype.addPoints=function(e,r,i){var n=e.getCoordinates();if(r){var o=1;i&&(o=0);for(var a=o;a<n.length;a++)this._pts.add(n[a])}else{var s=n.length-2;i&&(s=n.length-1);for(var l=s;l>=0;l--)this._pts.add(n[l])}},tA.prototype.isHole=function(){return this._isHole},tA.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)},tA.prototype.containsPoint=function(e){var r=this.getLinearRing();if(!r.getEnvelopeInternal().contains(e)||!ed.isPointInRing(e,r.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();)if(i.next().containsPoint(e))return!1;return!0},tA.prototype.addHole=function(e){this._holes.add(e)},tA.prototype.isShell=function(){return null===this._shell},tA.prototype.getLabel=function(){return this._label},tA.prototype.getEdges=function(){return this._edges},tA.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},tA.prototype.getShell=function(){return this._shell},tA.prototype.mergeLabel=function(){if(1==arguments.length){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(2==arguments.length){var r=arguments[0],i=arguments[1],n=r.getLocation(i,tb.RIGHT);if(n===A.NONE)return null;if(this._label.getLocation(i)===A.NONE)return this._label.setLocation(i,n),null}},tA.prototype.setShell=function(e){this._shell=e,null!==e&&e.addHole(this)},tA.prototype.toPolygon=function(e){for(var r=Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=this._holes.get(i).getLinearRing();return e.createPolygon(this.getLinearRing(),r)},tA.prototype.interfaces_=function(){return[]},tA.prototype.getClass=function(){return tA};var tP=function(e){function r(){var r=arguments[0],i=arguments[1];e.call(this,r,i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.setEdgeRing=function(e,r){e.setMinEdgeRing(r)},r.prototype.getNext=function(e){return e.getNextMin()},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(tA),tL=function(e){function r(){var r=arguments[0],i=arguments[1];e.call(this,r,i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.buildMinimalRings=function(){var e=new eA,r=this._startDe;do{if(null===r.getMinEdgeRing()){var i=new tP(r,this._geometryFactory);e.add(i)}r=r.getNext()}while(r!==this._startDe);return e},r.prototype.setEdgeRing=function(e,r){e.setEdgeRing(r)},r.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var e=this._startDe;do e.getNode().getEdges().linkMinimalDirectedEdges(this),e=e.getNext();while(e!==this._startDe)},r.prototype.getNext=function(e){return e.getNext()},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(tA),tO=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0==arguments.length);else if(1==arguments.length){var e=arguments[0];this._label=e}};tO.prototype.setVisited=function(e){this._isVisited=e},tO.prototype.setInResult=function(e){this._isInResult=e},tO.prototype.isCovered=function(){return this._isCovered},tO.prototype.isCoveredSet=function(){return this._isCoveredSet},tO.prototype.setLabel=function(e){this._label=e},tO.prototype.getLabel=function(){return this._label},tO.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0},tO.prototype.updateIM=function(e){es.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)},tO.prototype.isInResult=function(){return this._isInResult},tO.prototype.isVisited=function(){return this._isVisited},tO.prototype.interfaces_=function(){return[]},tO.prototype.getClass=function(){return tO};var tD=function(e){function r(){e.call(this),this._coord=null,this._edges=null;var r=arguments[0],i=arguments[1];this._coord=r,this._edges=i,this._label=new tC(0,A.NONE)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isIncidentEdgeInResult=function(){for(var e=this.getEdges().getEdges().iterator();e.hasNext();)if(e.next().getEdge().isInResult())return!0;return!1},r.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},r.prototype.getCoordinate=function(){return this._coord},r.prototype.print=function(e){e.println("node "+this._coord+" lbl: "+this._label)},r.prototype.computeIM=function(e){},r.prototype.computeMergedLocation=function(e,r){var i=A.NONE;if(i=this._label.getLocation(r),!e.isNull(r)){var n=e.getLocation(r);i!==A.BOUNDARY&&(i=n)}return i},r.prototype.setLabel=function(){if(2!=arguments.length)return e.prototype.setLabel.apply(this,arguments);var r=arguments[0],i=arguments[1];null===this._label?this._label=new tC(r,i):this._label.setLocation(r,i)},r.prototype.getEdges=function(){return this._edges},r.prototype.mergeLabel=function(){if(arguments[0]instanceof r){var e=arguments[0];this.mergeLabel(e._label)}else if(arguments[0]instanceof tC)for(var i=arguments[0],n=0;n<2;n++){var o=this.computeMergedLocation(i,n);this._label.getLocation(n)===A.NONE&&this._label.setLocation(n,o)}},r.prototype.add=function(e){this._edges.insert(e),e.setNode(this)},r.prototype.setLabelBoundary=function(e){if(null===this._label)return null;var r=A.NONE;null!==this._label&&(r=this._label.getLocation(e));var i=null;switch(r){case A.BOUNDARY:i=A.INTERIOR;break;case A.INTERIOR:default:i=A.BOUNDARY}this._label.setLocation(e,i)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(tO),tR=function(){this.nodeMap=new p,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};tR.prototype.find=function(e){return this.nodeMap.get(e)},tR.prototype.addNode=function(){if(arguments[0]instanceof T){var e=arguments[0],r=this.nodeMap.get(e);return null===r&&(r=this.nodeFact.createNode(e),this.nodeMap.put(e,r)),r}if(arguments[0]instanceof tD){var i=arguments[0],n=this.nodeMap.get(i.getCoordinate());return null===n?(this.nodeMap.put(i.getCoordinate(),i),i):(n.mergeLabel(i),n)}},tR.prototype.print=function(e){for(var r=this.iterator();r.hasNext();)r.next().print(e)},tR.prototype.iterator=function(){return this.nodeMap.values().iterator()},tR.prototype.values=function(){return this.nodeMap.values()},tR.prototype.getBoundaryNodes=function(e){for(var r=new eA,i=this.iterator();i.hasNext();){var n=i.next();n.getLabel().getLocation(e)===A.BOUNDARY&&r.add(n)}return r},tR.prototype.add=function(e){var r=e.getCoordinate();this.addNode(r).add(e)},tR.prototype.interfaces_=function(){return[]},tR.prototype.getClass=function(){return tR};var tk=function(){},tN={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};tk.prototype.interfaces_=function(){return[]},tk.prototype.getClass=function(){return tk},tk.isNorthern=function(e){return e===tk.NE||e===tk.NW},tk.isOpposite=function(e,r){return e!==r&&2==(e-r+4)%4},tk.commonHalfPlane=function(e,r){if(e===r)return e;if(2==(e-r+4)%4)return -1;var i=e<r?e:r;return 0===i&&3===(e>r?e:r)?3:i}
113,tk.isInHalfPlane=function(e,r){return r===tk.SE?e===tk.SE||e===tk.SW:e===r||e===r+1},tk.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],r=arguments[1];if(0===e&&0===r)throw new v("Cannot compute the quadrant for point ( "+e+", "+r+" )");return e>=0?r>=0?tk.NE:tk.SE:r>=0?tk.NW:tk.SW}if(arguments[0]instanceof T&&arguments[1]instanceof T){var i=arguments[0],n=arguments[1];if(n.x===i.x&&n.y===i.y)throw new v("Cannot compute the quadrant for two identical points "+i);return n.x>=i.x?n.y>=i.y?tk.NE:tk.SE:n.y>=i.y?tk.NW:tk.SW}},tN.NE.get=function(){return 0},tN.NW.get=function(){return 1},tN.SW.get=function(){return 2},tN.SE.get=function(){return 3},Object.defineProperties(tk,tN);var tF=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 e=arguments[0];this._edge=e}else if(3==arguments.length){var r=arguments[0],i=arguments[1],n=arguments[2];this._edge=r,this.init(i,n),this._label=null}else if(4==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],l=arguments[3];this._edge=o,this.init(a,s),this._label=l}};tF.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:ed.computeOrientation(e._p0,e._p1,this._p1)},tF.prototype.getDy=function(){return this._dy},tF.prototype.getCoordinate=function(){return this._p0},tF.prototype.setNode=function(e){this._node=e},tF.prototype.print=function(e){var r=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),n=i.lastIndexOf("."),o=i.substring(n+1);e.print("  "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+r+"   "+this._label)},tF.prototype.compareTo=function(e){return this.compareDirection(e)},tF.prototype.getDirectedCoordinate=function(){return this._p1},tF.prototype.getDx=function(){return this._dx},tF.prototype.getLabel=function(){return this._label},tF.prototype.getEdge=function(){return this._edge},tF.prototype.getQuadrant=function(){return this._quadrant},tF.prototype.getNode=function(){return this._node},tF.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf(".");return"  "+r.substring(i+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+"   "+this._label},tF.prototype.computeLabel=function(e){},tF.prototype.init=function(e,r){this._p0=e,this._p1=r,this._dx=r.x-e.x,this._dy=r.y-e.y,this._quadrant=tk.quadrant(this._dx,this._dy),es.isTrue(0!==this._dx||0!==this._dy,"EdgeEnd with identical endpoints found")},tF.prototype.interfaces_=function(){return[w]},tF.prototype.getClass=function(){return tF};var tz=function(e){function r(){var r=arguments[0],i=arguments[1];if(e.call(this,r),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=i,i)this.init(r.getCoordinate(0),r.getCoordinate(1));else{var n=r.getNumPoints()-1;this.init(r.getCoordinate(n),r.getCoordinate(n-1))}this.computeDirectedLabel()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getNextMin=function(){return this._nextMin},r.prototype.getDepth=function(e){return this._depth[e]},r.prototype.setVisited=function(e){this._isVisited=e},r.prototype.computeDirectedLabel=function(){this._label=new tC(this._edge.getLabel()),this._isForward||this._label.flip()},r.prototype.getNext=function(){return this._next},r.prototype.setDepth=function(e,r){if(-999!==this._depth[e]&&this._depth[e]!==r)throw new tS("assigned depths do not match",this.getCoordinate());this._depth[e]=r},r.prototype.isInteriorAreaEdge=function(){for(var e=!0,r=0;r<2;r++)this._label.isArea(r)&&this._label.getLocation(r,tb.LEFT)===A.INTERIOR&&this._label.getLocation(r,tb.RIGHT)===A.INTERIOR||(e=!1);return e},r.prototype.setNextMin=function(e){this._nextMin=e},r.prototype.print=function(r){e.prototype.print.call(this,r),r.print(" "+this._depth[tb.LEFT]+"/"+this._depth[tb.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},r.prototype.setMinEdgeRing=function(e){this._minEdgeRing=e},r.prototype.isLineEdge=function(){var e=this._label.isLine(0)||this._label.isLine(1),r=!this._label.isArea(0)||this._label.allPositionsEqual(0,A.EXTERIOR),i=!this._label.isArea(1)||this._label.allPositionsEqual(1,A.EXTERIOR);return e&&r&&i},r.prototype.setEdgeRing=function(e){this._edgeRing=e},r.prototype.getMinEdgeRing=function(){return this._minEdgeRing},r.prototype.getDepthDelta=function(){var e=this._edge.getDepthDelta();return this._isForward||(e=-e),e},r.prototype.setInResult=function(e){this._isInResult=e},r.prototype.getSym=function(){return this._sym},r.prototype.isForward=function(){return this._isForward},r.prototype.getEdge=function(){return this._edge},r.prototype.printEdge=function(e){this.print(e),e.print(" "),this._isForward?this._edge.print(e):this._edge.printReverse(e)},r.prototype.setSym=function(e){this._sym=e},r.prototype.setVisitedEdge=function(e){this.setVisited(e),this._sym.setVisited(e)},r.prototype.setEdgeDepths=function(e,r){var i=this.getEdge().getDepthDelta();this._isForward||(i=-i);var n=1;e===tb.LEFT&&(n=-1);var o=tb.opposite(e),a=r+i*n;this.setDepth(e,r),this.setDepth(o,a)},r.prototype.getEdgeRing=function(){return this._edgeRing},r.prototype.isInResult=function(){return this._isInResult},r.prototype.setNext=function(e){this._next=e},r.prototype.isVisited=function(){return this._isVisited},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r.depthFactor=function(e,r){return e===A.EXTERIOR&&r===A.INTERIOR?1:e===A.INTERIOR&&r===A.EXTERIOR?-1:0},r}(tF),tB=function(){};tB.prototype.createNode=function(e){return new tD(e,null)},tB.prototype.interfaces_=function(){return[]},tB.prototype.getClass=function(){return tB};var tU=function(){if(this._edges=new eA,this._nodes=null,this._edgeEndList=new eA,0==arguments.length)this._nodes=new tR(new tB);else if(1==arguments.length){var e=arguments[0];this._nodes=new tR(e)}};tU.prototype.printEdges=function(e){e.println("Edges:");for(var r=0;r<this._edges.size();r++){e.println("edge "+r+":");var i=this._edges.get(r);i.print(e),i.eiList.print(e)}},tU.prototype.find=function(e){return this._nodes.find(e)},tU.prototype.addNode=function(){if(arguments[0]instanceof tD){var e=arguments[0];return this._nodes.addNode(e)}if(arguments[0]instanceof T){var r=arguments[0];return this._nodes.addNode(r)}}
113,tU.prototype.getNodeIterator=function(){return this._nodes.iterator()},tU.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()},tU.prototype.debugPrintln=function(e){H.out.println(e)},tU.prototype.isBoundaryNode=function(e,r){var i=this._nodes.find(r);if(null===i)return!1;var n=i.getLabel();return null!==n&&n.getLocation(e)===A.BOUNDARY},tU.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkAllDirectedEdges()},tU.prototype.matchInSameDirection=function(e,r,i,n){return!!e.equals(i)&&ed.computeOrientation(e,r,n)===ed.COLLINEAR&&tk.quadrant(e,r)===tk.quadrant(i,n)},tU.prototype.getEdgeEnds=function(){return this._edgeEndList},tU.prototype.debugPrint=function(e){H.out.print(e)},tU.prototype.getEdgeIterator=function(){return this._edges.iterator()},tU.prototype.findEdgeInSameDirection=function(e,r){for(var i=0;i<this._edges.size();i++){var n=this._edges.get(i),o=n.getCoordinates();if(this.matchInSameDirection(e,r,o[0],o[1])||this.matchInSameDirection(e,r,o[o.length-1],o[o.length-2]))return n}return null},tU.prototype.insertEdge=function(e){this._edges.add(e)},tU.prototype.findEdgeEnd=function(e){for(var r=this.getEdgeEnds().iterator();r.hasNext();){var i=r.next();if(i.getEdge()===e)return i}return null},tU.prototype.addEdges=function(e){for(var r=e.iterator();r.hasNext();){var i=r.next();this._edges.add(i);var n=new tz(i,!0),o=new tz(i,!1);n.setSym(o),o.setSym(n),this.add(n),this.add(o)}},tU.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)},tU.prototype.getNodes=function(){return this._nodes.values()},tU.prototype.findEdge=function(e,r){for(var i=0;i<this._edges.size();i++){var n=this._edges.get(i),o=n.getCoordinates();if(e.equals(o[0])&&r.equals(o[1]))return n}return null},tU.prototype.interfaces_=function(){return[]},tU.prototype.getClass=function(){return tU},tU.linkResultDirectedEdges=function(e){for(var r=e.iterator();r.hasNext();)r.next().getEdges().linkResultDirectedEdges()};var tj=function(){this._geometryFactory=null,this._shellList=new eA;var e=arguments[0];this._geometryFactory=e};tj.prototype.sortShellsAndHoles=function(e,r,i){for(var n=e.iterator();n.hasNext();){var o=n.next();o.isHole()?i.add(o):r.add(o)}},tj.prototype.computePolygons=function(e){for(var r=new eA,i=e.iterator();i.hasNext();){var n=i.next().toPolygon(this._geometryFactory);r.add(n)}return r},tj.prototype.placeFreeHoles=function(e,r){for(var i=r.iterator();i.hasNext();){var n=i.next();if(null===n.getShell()){var o=this.findEdgeRingContaining(n,e);if(null===o)throw new tS("unable to assign hole to a shell",n.getCoordinate(0));n.setShell(o)}}},tj.prototype.buildMinimalEdgeRings=function(e,r,i){for(var n=new eA,o=e.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var s=a.buildMinimalRings(),l=this.findShell(s);null!==l?(this.placePolygonHoles(l,s),r.add(l)):i.addAll(s)}else n.add(a)}return n},tj.prototype.containsPoint=function(e){for(var r=this._shellList.iterator();r.hasNext();)if(r.next().containsPoint(e))return!0;return!1},tj.prototype.buildMaximalEdgeRings=function(e){for(var r=new eA,i=e.iterator();i.hasNext();){var n=i.next();if(n.isInResult()&&n.getLabel().isArea()&&null===n.getEdgeRing()){var o=new tL(n,this._geometryFactory);r.add(o),o.setInResult()}}return r},tj.prototype.placePolygonHoles=function(e,r){for(var i=r.iterator();i.hasNext();){var n=i.next();n.isHole()&&n.setShell(e)}},tj.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},tj.prototype.findEdgeRingContaining=function(e,r){for(var i=e.getLinearRing(),n=i.getEnvelopeInternal(),o=i.getCoordinateN(0),a=null,s=null,l=r.iterator();l.hasNext();){var u=l.next(),c=u.getLinearRing(),h=c.getEnvelopeInternal();null!==a&&(s=a.getLinearRing().getEnvelopeInternal());var p=!1;h.contains(n)&&ed.isPointInRing(o,c.getCoordinates())&&(p=!0),p&&(null===a||s.contains(h))&&(a=u)}return a},tj.prototype.findShell=function(e){for(var r=0,i=null,n=e.iterator();n.hasNext();){var o=n.next();o.isHole()||(i=o,r++)}return es.isTrue(r<=1,"found two shells in MinimalEdgeRing list"),i},tj.prototype.add=function(){if(1==arguments.length){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(2==arguments.length){var r=arguments[0],i=arguments[1];tU.linkResultDirectedEdges(i);var n=this.buildMaximalEdgeRings(r),o=new eA,a=this.buildMinimalEdgeRings(n,this._shellList,o);this.sortShellsAndHoles(a,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},tj.prototype.interfaces_=function(){return[]},tj.prototype.getClass=function(){return tj};var tV=function(){};tV.prototype.getBounds=function(){},tV.prototype.interfaces_=function(){return[]},tV.prototype.getClass=function(){return tV};var tG=function(){this._bounds=null,this._item=null;var e=arguments[0],r=arguments[1];this._bounds=e,this._item=r};tG.prototype.getItem=function(){return this._item},tG.prototype.getBounds=function(){return this._bounds},tG.prototype.interfaces_=function(){return[tV,r]},tG.prototype.getClass=function(){return tG};var tq=function(){this._size=null,this._items=null,this._size=0,this._items=new eA,this._items.add(null)};tq.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},tq.prototype.size=function(){return this._size},tq.prototype.reorder=function(e){for(var r=null,i=this._items.get(e);2*e<=this._size&&((r=2*e)!==this._size&&0>this._items.get(r+1).compareTo(this._items.get(r))&&r++,0>this._items.get(r).compareTo(i));e=r)this._items.set(e,this._items.get(r));this._items.set(e,i)},tq.prototype.clear=function(){this._size=0,this._items.clear()},tq.prototype.isEmpty=function(){return 0===this._size},tq.prototype.add=function(e){this._items.add(null),this._size+=1;var r=this._size;
113for(this._items.set(0,e);0>e.compareTo(this._items.get(Math.trunc(r/2)));r/=2)this._items.set(r,this._items.get(Math.trunc(r/2)));this._items.set(r,e)},tq.prototype.interfaces_=function(){return[]},tq.prototype.getClass=function(){return tq};var tH=function(){};tH.prototype.visitItem=function(e){},tH.prototype.interfaces_=function(){return[]},tH.prototype.getClass=function(){return tH};var t$=function(){};t$.prototype.insert=function(e,r){},t$.prototype.remove=function(e,r){},t$.prototype.query=function(){},t$.prototype.interfaces_=function(){return[]},t$.prototype.getClass=function(){return t$};var tW=function(){if(this._childBoundables=new eA,this._bounds=null,this._level=null,0==arguments.length);else if(1==arguments.length){var e=arguments[0];this._level=e}},tY={serialVersionUID:{configurable:!0}};tW.prototype.getLevel=function(){return this._level},tW.prototype.size=function(){return this._childBoundables.size()},tW.prototype.getChildBoundables=function(){return this._childBoundables},tW.prototype.addChildBoundable=function(e){es.isTrue(null===this._bounds),this._childBoundables.add(e)},tW.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},tW.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},tW.prototype.interfaces_=function(){return[tV,r]},tW.prototype.getClass=function(){return tW},tY.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(tW,tY);var tZ=function(){};tZ.reverseOrder=function(){return{compare:function(e,r){return r.compareTo(e)}}},tZ.min=function(e){return tZ.sort(e),e.get(0)},tZ.sort=function(e,r){var i=e.toArray();r?eG.sort(i,r):eG.sort(i);for(var n=e.iterator(),o=0,a=i.length;o<a;o++)n.next(),n.set(i[o])},tZ.singletonList=function(e){var r=new eA;return r.add(e),r};var tX=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._boundable1=e,this._boundable2=r,this._itemDistance=i,this._distance=this.distance()};tX.prototype.expandToQueue=function(e,r){var i=tX.isComposite(this._boundable1),n=tX.isComposite(this._boundable2);if(i&&n)return tX.area(this._boundable1)>tX.area(this._boundable2)?this.expand(this._boundable1,this._boundable2,e,r):this.expand(this._boundable2,this._boundable1,e,r),null;if(i)return this.expand(this._boundable1,this._boundable2,e,r),null;if(n)return this.expand(this._boundable2,this._boundable1,e,r),null;throw new v("neither boundable is composite")},tX.prototype.isLeaves=function(){return!(tX.isComposite(this._boundable1)||tX.isComposite(this._boundable2))},tX.prototype.compareTo=function(e){return this._distance<e._distance?-1:+(this._distance>e._distance)},tX.prototype.expand=function(e,r,i,n){for(var o=e.getChildBoundables().iterator();o.hasNext();){var a=new tX(o.next(),r,this._itemDistance);a.getDistance()<n&&i.add(a)}},tX.prototype.getBoundable=function(e){return 0===e?this._boundable1:this._boundable2},tX.prototype.getDistance=function(){return this._distance},tX.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tX.prototype.interfaces_=function(){return[w]},tX.prototype.getClass=function(){return tX},tX.area=function(e){return e.getBounds().getArea()},tX.isComposite=function(e){return e instanceof tW};var tK=function e(){if(this._root=null,this._built=!1,this._itemBoundables=new eA,this._nodeCapacity=null,0==arguments.length){var r=e.DEFAULT_NODE_CAPACITY;this._nodeCapacity=r}else if(1==arguments.length){var i=arguments[0];es.isTrue(i>
1131,"Node capacity must be greater than 1"),this._nodeCapacity=i}},tQ={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};tK.prototype.getNodeCapacity=function(){return this._nodeCapacity},tK.prototype.lastNode=function(e){return e.get(e.size()-1)},tK.prototype.size=function(){if(0==arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1==arguments.length){for(var e=0,r=arguments[0].getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof tW?e+=this.size(i):i instanceof tG&&(e+=1)}return e}},tK.prototype.removeItem=function(e,r){for(var i=null,n=e.getChildBoundables().iterator();n.hasNext();){var o=n.next();o instanceof tG&&o.getItem()===r&&(i=o)}return null!==i&&(e.getChildBoundables().remove(i),!0)},tK.prototype.itemsTree=function(){if(0==arguments.length){this.build();var e=this.itemsTree(this._root);return null===e?new eA:e}if(1==arguments.length){for(var r=arguments[0],i=new eA,n=r.getChildBoundables().iterator();n.hasNext();){var o=n.next();if(o instanceof tW){var a=this.itemsTree(o);null!==a&&i.add(a)}else o instanceof tG?i.add(o.getItem()):es.shouldNeverReachHere()}return 0>=i.size()?null:i}},tK.prototype.insert=function(e,r){es.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new tG(e,r))},tK.prototype.boundablesAtLevel=function(){if(1==arguments.length){var e=arguments[0],r=new eA;return this.boundablesAtLevel(e,this._root,r),r}if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2];if(es.isTrue(i>-2),n.getLevel()===i)return o.add(n),null;for(var a=n.getChildBoundables().iterator();a.hasNext();){var s=a.next();s instanceof tW?this.boundablesAtLevel(i,s,o):(es.isTrue(s instanceof tG),-1===i&&o.add(s))}return null}},tK.prototype.query=function(){if(1==arguments.length){var e=arguments[0];this.build();var r=new eA;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,r),r}if(2==arguments.length){var i=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,n)}else if(3==arguments.length){if(L(arguments[2],tH)&&arguments[0]instanceof Object&&arguments[1]instanceof tW)for(var o=arguments[0],a=arguments[1],s=arguments[2],l=a.getChildBoundables(),u=0;u<l.size();u++){var c=l.get(u);this.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof tW?this.query(o,c,s):c instanceof tG?s.visitItem(c.getItem()):es.shouldNeverReachHere())}else if(L(arguments[2],eC)&&arguments[0]instanceof Object&&arguments[1]instanceof tW)for(var h=arguments[0],p=arguments[1],d=arguments[2],f=p.getChildBoundables(),m=0;m<f.size();m++){var g=f.get(m);this.getIntersectsOp().intersects(g.getBounds(),h)&&(g instanceof tW?this.query(h,g,d):g instanceof tG?d.add(g.getItem()):es.shouldNeverReachHere())}}},tK.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},tK.prototype.getRoot=function(){return this.build(),this._root},tK.prototype.remove=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.remove(e,this._root,r)}if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2],a=this.removeItem(n,o);if(a)return!0;for(var s=null,l=n.getChildBoundables().iterator();l.hasNext();){var u=l.next();if(this.getIntersectsOp().intersects(u.getBounds(),i)&&u instanceof tW&&(a=this.remove(i,u,o))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&n.getChildBoundables().remove(s),a}},tK.prototype.createHigherLevels=function(e,r){es.isTrue(!e.isEmpty());var i=this.createParentBoundables(e,r+1);return 1===i.size()?i.get(0):this.createHigherLevels(i,r+1)},tK.prototype.depth=function(){if(0==arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1==arguments.length){for(var e=0,r=arguments[0].getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof tW){var n=this.depth(i);n>e&&(e=n)}}return e+1}},tK.prototype.createParentBoundables=function(e,r){es.isTrue(!e.isEmpty());var i=new eA;i.add(this.createNode(r));var n=new eA(e);tZ.sort(n,this.getComparator());for(var o=n.iterator();o.hasNext();){var a=o.next();this.lastNode(i).getChildBoundables().size()===this.getNodeCapacity()&&i.add(this.createNode(r)),this.lastNode(i).addChildBoundable(a)}return i},tK.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},tK.prototype.interfaces_=function(){return[r]},tK.prototype.getClass=function(){return tK},tK.compareDoubles=function(e,r){return e>r?1:e<r?-1:0},tQ.IntersectsOp.get=function(){return tJ}
113,tQ.serialVersionUID.get=function(){return -0x35ef64c82d4c5400},tQ.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(tK,tQ);var tJ=function(){},t0=function(){};t0.prototype.distance=function(e,r){},t0.prototype.interfaces_=function(){return[]},t0.prototype.getClass=function(){return t0};var t1=function(e){function i(r){r=r||i.DEFAULT_NODE_CAPACITY,e.call(this,r)}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return i.prototype.createParentBoundablesFromVerticalSlices=function(e,r){es.isTrue(e.length>0);for(var i=new eA,n=0;n<e.length;n++)i.addAll(this.createParentBoundablesFromVerticalSlice(e[n],r));return i},i.prototype.createNode=function(e){return new t2(e)},i.prototype.size=function(){return 0==arguments.length?e.prototype.size.call(this):e.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(2!=arguments.length)return e.prototype.insert.apply(this,arguments);var r=arguments[0],i=arguments[1];if(r.isNull())return null;e.prototype.insert.call(this,r,i)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(e,r){for(var i=Math.trunc(Math.ceil(e.size()/r)),n=Array(r).fill(null),o=e.iterator(),a=0;a<r;a++){n[a]=new eA;for(var s=0;o.hasNext()&&s<i;){var l=o.next();n[a].add(l),s++}}return n},i.prototype.query=function(){if(1==arguments.length){var r=arguments[0];return e.prototype.query.call(this,r)}if(2==arguments.length){var i=arguments[0],n=arguments[1];e.prototype.query.call(this,i,n)}else if(3==arguments.length){if(L(arguments[2],tH)&&arguments[0]instanceof Object&&arguments[1]instanceof tW){var o=arguments[0],a=arguments[1],s=arguments[2];e.prototype.query.call(this,o,a,s)}else if(L(arguments[2],eC)&&arguments[0]instanceof Object&&arguments[1]instanceof tW){var l=arguments[0],u=arguments[1],c=arguments[2];e.prototype.query.call(this,l,u,c)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(r,i){return e.prototype.createParentBoundables.call(this,r,i)},i.prototype.remove=function(){if(2==arguments.length){var r=arguments[0],i=arguments[1];return e.prototype.remove.call(this,r,i)}return e.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return 0==arguments.length?e.prototype.depth.call(this):e.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(e,r){es.isTrue(!e.isEmpty());var n=Math.trunc(Math.ceil(e.size()/this.getNodeCapacity())),o=new eA(e);tZ.sort(o,i.xComparator);var a=this.verticalSlices(o,Math.trunc(Math.ceil(Math.sqrt(n))));return this.createParentBoundablesFromVerticalSlices(a,r)},i.prototype.nearestNeighbour=function(){if(1==arguments.length){if(L(arguments[0],t0)){var e=arguments[0],r=new tX(this.getRoot(),this.getRoot(),e);return this.nearestNeighbour(r)}if(arguments[0]instanceof tX){var n=arguments[0];return this.nearestNeighbour(n,x.POSITIVE_INFINITY)}}else if(2==arguments.length){if(arguments[0]instanceof i&&L(arguments[1],t0)){var o=arguments[0],a=arguments[1],s=new tX(this.getRoot(),o.getRoot(),a);return this.nearestNeighbour(s)}if(arguments[0]instanceof tX&&"number"==typeof arguments[1]){var l=arguments[0],u=arguments[1],c=null,h=new tq;for(h.add(l);!h.isEmpty()&&u>0;){var p=h.poll(),d=p.getDistance();if(d>=u)break;p.isLeaves()?(u=d,c=p):p.expandToQueue(h,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3==arguments.length){var f=arguments[0],m=arguments[1],g=arguments[2],_=new tG(f,m),y=new tX(this.getRoot(),_,g);return this.nearestNeighbour(y)[0]}},i.prototype.interfaces_=function(){return[t$,r]},i.prototype.getClass=function(){return i},i.centreX=function(e){return i.avg(e.getMinX(),e.getMaxX())},i.avg=function(e,r){return(e+r)/2},i.centreY=function(e){return i.avg(e.getMinY(),e.getMaxY())},n.STRtreeNode.get=function(){return t2},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[S]},compare:function(r,n){return e.compareDoubles(i.centreX(r.getBounds()),i.centreX(n.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[S]},compare:function(r,n){return e.compareDoubles(i.centreY(r.getBounds()),i.centreY(n.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[e.IntersectsOp]},intersects:function(e,r){return e.intersects(r)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,n),i}(tK),t2=function(e){function r(){var r=arguments[0];e.call(this,r)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.computeBounds=function(){for(var e=null,r=this.getChildBoundables().iterator();r.hasNext();){var i=r.next();null===e?e=new W(i.getBounds()):e.expandToInclude(i.getBounds())}return e},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(tW),t3=function(){};t3.prototype.interfaces_=function(){return[]},t3.prototype.getClass=function(){return t3},t3.relativeSign=function(e,r){return e<r?-1:+(e>r)},t3.compare=function(e,r,i){if(r.equals2D(i))return 0;var n=t3.relativeSign(r.x,i.x),o=t3.relativeSign(r.y,i.y);switch(e){case 0:return t3.compareValue(n,o);case 1:return t3.compareValue(o,n);case 2:return t3.compareValue(o,-n);case 3:return t3.compareValue(-n,o);case 4:return t3.compareValue(-n,-o);case 5:return t3.compareValue(-o,-n);case 6:return t3.compareValue(-o,n);case 7:return t3.compareValue(n,-o)}return es.shouldNeverReachHere("invalid octant value"),0},t3.compareValue=function(e,r){return e<0?-1:e>0?1:r<0?-1:+(r>0)};var t5=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],r=arguments[1],i=arguments[2],n=arguments[3];this._segString=e,this.coord=new T(r),this.segmentIndex=i,this._segmentOctant=n,this._isInterior=!r.equals2D(e.getCoordinate(i))};t5.prototype.getCoordinate=function(){return this.coord},t5.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},t5.prototype.compareTo=function(e){return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:t3.compare(this._segmentOctant,this.coord,e.coord)},t5.prototype.isEndPoint=function(e){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===e},t5.prototype.isInterior=function(){return this._isInterior},t5.prototype.interfaces_=function(){return[w]},t5.prototype.getClass=function(){return t5};var t4=function(){this._nodeMap=new p,this._edge=null;var e=arguments[0];this._edge=e};t4.prototype.getSplitCoordinates=function(){var e=new eL;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var n=r.next();this.addEdgeCoordinates(i,n,e),i=n}return e.toCoordinateArray()},t4.prototype.addCollapsedNodes=function(){var e=new eA;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var r=e.iterator();r.hasNext();){var i=r.next().intValue();this.add(this._edge.getCoordinate(i),i)}},t4.prototype.print=function(e){e.println("Intersections:");for(var r=this.iterator();r.hasNext();)r.next().print(e)},t4.prototype.findCollapsesFromExistingVertices=function(e){for(var r=0;r<this._edge.size()-2;r++){var i=this._edge.getCoordinate(r),n=this._edge.getCoordinate(r+2);i.equals2D(n)&&e.add(new k(r+1))}},t4.prototype.addEdgeCoordinates=function(e,r,i){var n=this._edge.getCoordinate(r.segmentIndex),o=r.isInterior()||!r.coord.equals2D(n);i.add(new T(e.coord),!1);for(var a=e.segmentIndex+1;a<=r.segmentIndex;a++)i.add(this._edge.getCoordinate(a));o&&i.add(new T(r.coord))},t4.prototype.iterator=function(){return this._nodeMap.values().iterator()},t4.prototype.addSplitEdges=function(e){this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var n=r.next(),o=this.createSplitEdge(i,n);e.add(o),i=n}},t4.prototype.findCollapseIndex=function(e,r,i){if(!e.coord.equals2D(r.coord))return!1;var n=r.segmentIndex-e.segmentIndex;return r.isInterior()||n--,1===n&&(i[0]=e.segmentIndex+1,!0)},t4.prototype.findCollapsesFromInsertedNodes=function(e){for(var r=[,].fill(null),i=this.iterator(),n=i.next();i.hasNext();){var o=i.next();this.findCollapseIndex(n,o,r)&&e.add(new k(r[0])),n=o}},t4.prototype.getEdge=function(){return this._edge},t4.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)},t4.prototype.createSplitEdge=function(e,r){var i=r.segmentIndex-e.segmentIndex+2,n=this._edge.getCoordinate(r.segmentIndex),o=r.isInterior()||!r.coord.equals2D(n);o||i--;var a=Array(i).fill(null),s=0;a[s++]=new T(e.coord);for(var l=e.segmentIndex+1;l<=r.segmentIndex;l++)a[s++]=this._edge.getCoordinate(l);return o&&(a[s]=new T(r.coord)),new t7(a,this._edge.getData())},t4.prototype.add=function(e,r){var i=new t5(this._edge,e,r,this._edge.getSegmentOctant(r)),n=this._nodeMap.get(i);return null!==n?(es.isTrue(n.coord.equals2D(e),"Found equal nodes with different c
113oordinates"),n):(this._nodeMap.put(i,i),i)},t4.prototype.checkSplitEdgesCorrectness=function(e){var r=this._edge.getCoordinates(),i=e.get(0).getCoordinate(0);if(!i.equals2D(r[0]))throw new eo("bad split edge start point at "+i);var n=e.get(e.size()-1).getCoordinates(),o=n[n.length-1];if(!o.equals2D(r[r.length-1]))throw new eo("bad split edge end point at "+o)},t4.prototype.interfaces_=function(){return[]},t4.prototype.getClass=function(){return t4};var t6=function(){};t6.prototype.interfaces_=function(){return[]},t6.prototype.getClass=function(){return t6},t6.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],r=arguments[1];if(0===e&&0===r)throw new v("Cannot compute the octant for point ( "+e+", "+r+" )");var i=Math.abs(e),n=Math.abs(r);return e>=0?r>=0?i>=n?0:1:i>=n?7:6:r>=0?i>=n?3:2:i>=n?4:5}if(arguments[0]instanceof T&&arguments[1]instanceof T){var o=arguments[0],a=arguments[1],s=a.x-o.x,l=a.y-o.y;if(0===s&&0===l)throw new v("Cannot compute the octant for two identical points "+o);return t6.octant(s,l)}};var t8=function(){};t8.prototype.getCoordinates=function(){},t8.prototype.size=function(){},t8.prototype.getCoordinate=function(e){},t8.prototype.isClosed=function(){},t8.prototype.setData=function(e){},t8.prototype.getData=function(){},t8.prototype.interfaces_=function(){return[]},t8.prototype.getClass=function(){return t8};var t9=function(){};t9.prototype.addIntersection=function(e,r){},t9.prototype.interfaces_=function(){return[t8]},t9.prototype.getClass=function(){return t9};var t7=function(){this._nodeList=new t4(this),this._pts=null,this._data=null;var e=arguments[0],r=arguments[1];this._pts=e,this._data=r};t7.prototype.getCoordinates=function(){return this._pts},t7.prototype.size=function(){return this._pts.length},t7.prototype.getCoordinate=function(e){return this._pts[e]},t7.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},t7.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},t7.prototype.setData=function(e){this._data=e},t7.prototype.safeOctant=function(e,r){return e.equals2D(r)?0:t6.octant(e,r)},t7.prototype.getData=function(){return this._data},t7.prototype.addIntersection=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];this.addIntersectionNode(e,r)}else if(4==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[3],a=new T(i.getIntersection(o));this.addIntersection(a,n)}},t7.prototype.toString=function(){return en.toLineString(new tn(this._pts))},t7.prototype.getNodeList=function(){return this._nodeList},t7.prototype.addIntersectionNode=function(e,r){var i=r,n=i+1;if(n<this._pts.length){var o=this._pts[n];e.equals2D(o)&&(i=n)}return this._nodeList.add(e,i)},t7.prototype.addIntersections=function(e,r,i){for(var n=0;n<e.getIntersectionNum();n++)this.addIntersection(e,r,i,n)},t7.prototype.interfaces_=function(){return[t9]},t7.prototype.getClass=function(){return t7},t7.getNodedSubstrings=function(){if(1==arguments.length){var e=arguments[0],r=new eA;return t7.getNodedSubstrings(e,r),r}if(2==arguments.length)for(var i=arguments[0],n=arguments[1],o=i.iterator();o.hasNext();)o.next().getNodeList().addSplitEdges(n)};var re=function(){if(this.p0=null,this.p1=null,0==arguments.length)this.p0=new T,this.p1=new T;else if(1==arguments.length){var e=arguments[0];this.p0=new T(e.p0),this.p1=new T(e.p1)}else if(2==arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4==arguments.length){var r=arguments[0],i=arguments[1],n=arguments[2],o=arguments[3];this.p0=new T(r,i),this.p1=new T(n,o)}},rt={serialVersionUID:{configurable:!0}};re.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},re.prototype.orientationIndex=function(){if(arguments[0]instanceof re){var e=arguments[0],r=ed.orientationIndex(this.p0,this.p1,e.p0),i=ed.orientationIndex(this.p0,this.p1,e.p1);return r>=0&&i>=0||r<=0&&i<=0?Math.max(r,i):0}if(arguments[0]instanceof T){var n=arguments[0];return ed.orientationIndex(this.p0,this.p1,n)}},re.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},re.prototype.isVertical=function(){return this.p0.x===this.p1.x},re.prototype.equals=function(e){return e instanceof re&&this.p0.equals(e.p0)&&this.p1.equals(e.p1)},re.prototype.intersection=function(e){var r=new ec;return r.computeIntersection(this.p0,this.p1,e.p0,e.p1),r.hasIntersection()?r.getIntersection(0):null},re.prototype.project=function(){if(arguments[0]instanceof T){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new T(e);var r=this.projectionFactor(e),i=new T;return i.x=this.p0.x+r*(this.p1.x-this.p0.x),i.y=this.p0.y+r*(this.p1.y-this.p0.y),i}if(arguments[0]instanceof re){var n=arguments[0],o=this.projectionFactor(n.p0),a=this.projectionFactor(n.p1);if(o>=1&&a>=1||o<=0&&a<=0)return null;var s=this.project(n.p0);o<0&&(s=this.p0),o>1&&(s=this.p1);var l=this.project(n.p1);return a<0&&(l=this.p0),a>1&&(l=this.p1),new re(s,l)}},re.prototype.normalize=function(){0>this.p1.compareTo(this.p0)&&this.reverse()},re.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},re.prototype.getCoordinate=function(e){return 0===e?this.p0:this.p1},re.prototype.distancePerpendicular=function(e){return ed.distancePointLinePerpendicular(e,this.p0,this.p1)},re.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},re.prototype.midPoint=function(){return re.midPoint(this.p0,this.p1)},re.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var r=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,n=r*r+i*i;return n<=0?x.NaN:((e.x-this.p0.x)*r+(e.y-this.p0.y)*i)/n},re.prototype.closestPoints=function(e){var r=this.intersection(e);if(null!==r)return[r,r];var i=[,,].fill(null),n=x.MAX_VALUE,o=null,a=this.closestPoint(e.p0);n=a.distance(e.p0),i[0]=a,i[1]=e.p0;var s=this.closestPoint(e.p1);(o=s.distance(e.p1))<n&&(n=o,i[0]=s,i[1]=e.p1);var l=e.closestPoint(this.p0);(o=l.distance(this.p0))<n&&(n=o,i[0]=this.p0,i[1]=l);var u=e.closestPoint(this.p1);return(o=u.distance(this.p1))<n&&(n=o,i[0]=this.p1,i[1]=u),i},re.prototype.closestPoint=function(e){var r=this.projectionFactor(e);return r>0&&r<1?this.project(e):this.p0.distance(e)<this.p1.distance(e)?this.p0:this.p1},re.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},re.prototype.getLength=function(){return this.p0.distance(this.p1)},re.prototype.compareTo=function(e){var r=this.p0.compareTo(e.p0);return 0!==r?r:this.p1.compareTo(e.p1)},re.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e},re.prototype.equalsTopo=function(e){return this.p0.equals(e.p0)&&(this.p1.equals(e.p1)||this.p0.equals(e.p1))&&this.p1.equals(e.p0)},re.prototype.lineIntersection=function(e){try{return $.intersection(this.p0,this.p1,e.p0,e.p1)}catch(e){if(!(e instanceof q))throw e}return null},re.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},re.prototype.pointAlongOffset=function(e,r){var i=this.p0.x+e*(this.p1.x-this.p0.x),n=this.p0.y+e*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,a=this.p1.y-this.p0.y,s=Math.sqrt(o*o+a*a),l=0,u=0;if(0!==r){if(s<=0)throw Error("Cannot compute offset from zero-length line segment");l=r*o/s,u=r*a/s}return new T(i-u,n+l)},re.prototype.setCoordinates=function(){if(1==arguments.length){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(2==arguments.length){var r=arguments[0],i=arguments[1];this.p0.x=r.x,this.p0.y=r.y,this.p1.x=i.x,this.p1.y=i.y}},re.prototype.segmentFraction=function(e){var r=this.projectionFactor(e);return r<0?r=0:(r>1||x.isNaN(r))&&(r=1),r},re.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},re.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},re.prototype.distance=function(){if(arguments[0]instanceof re){var e=arguments[0];return ed.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof T){var r=arguments[0];return ed.distancePointLine(r,this.p0,this.p1)}},re.prototype.pointAlong=function(e){var r=new T;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r},re.prototype.hashCode=function(){var e=x.doubleToLongBits(this.p0.x),r=M
113ath.trunc(e^=31*x.doubleToLongBits(this.p0.y))^Math.trunc(e>>32),i=x.doubleToLongBits(this.p1.x);return Math.trunc(i^=31*x.doubleToLongBits(this.p1.y))^Math.trunc(i>>32)^r},re.prototype.interfaces_=function(){return[w,r]},re.prototype.getClass=function(){return re},re.midPoint=function(e,r){return new T((e.x+r.x)/2,(e.y+r.y)/2)},rt.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(re,rt);var rr=function(){this.tempEnv1=new W,this.tempEnv2=new W,this._overlapSeg1=new re,this._overlapSeg2=new re};rr.prototype.overlap=function(){if(2==arguments.length);else if(4==arguments.length){var e=arguments[0],r=arguments[1],i=arguments[2],n=arguments[3];e.getLineSegment(r,this._overlapSeg1),i.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr};var ri=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],r=arguments[1],i=arguments[2],n=arguments[3];this._pts=e,this._start=r,this._end=i,this._context=n};ri.prototype.getLineSegment=function(e,r){r.p0=this._pts[e],r.p1=this._pts[e+1]},ri.prototype.computeSelect=function(e,r,i,n){var o=this._pts[r],a=this._pts[i];if(n.tempEnv1.init(o,a),i-r==1)return n.select(this,r),null;if(!e.intersects(n.tempEnv1))return null;var s=Math.trunc((r+i)/2);r<s&&this.computeSelect(e,r,s,n),s<i&&this.computeSelect(e,s,i,n)},ri.prototype.getCoordinates=function(){for(var e=Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)e[r++]=this._pts[i];return e},ri.prototype.computeOverlaps=function(e,r){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,r)},ri.prototype.setId=function(e){this._id=e},ri.prototype.select=function(e,r){this.computeSelect(e,this._start,this._end,r)},ri.prototype.getEnvelope=function(){if(null===this._env){var e=this._pts[this._start],r=this._pts[this._end];this._env=new W(e,r)}return this._env},ri.prototype.getEndIndex=function(){return this._end},ri.prototype.getStartIndex=function(){return this._start},ri.prototype.getContext=function(){return this._context},ri.prototype.getId=function(){return this._id},ri.prototype.computeOverlapsInternal=function(e,r,i,n,o,a){var s=this._pts[e],l=this._pts[r],u=i._pts[n],c=i._pts[o];if(r-e==1&&o-n==1)return a.overlap(this,e,i,n),null;if(a.tempEnv1.init(s,l),a.tempEnv2.init(u,c),!a.tempEnv1.intersects(a.tempEnv2))return null;var h=Math.trunc((e+r)/2),p=Math.trunc((n+o)/2);e<h&&(n<p&&this.computeOverlapsInternal(e,h,i,n,p,a),p<o&&this.computeOverlapsInternal(e,h,i,p,o,a)),h<r&&(n<p&&this.computeOverlapsInternal(h,r,i,n,p,a),p<o&&this.computeOverlapsInternal(h,r,i,p,o,a))},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri};var rn=function(){};rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn},rn.getChainStartIndices=function(e){var r=0,i=new eA;i.add(new k(r));do{var n=rn.findChainEnd(e,r);i.add(new k(n)),r=n}while(r<e.length-1);return rn.toIntArray(i)},rn.findChainEnd=function(e,r){for(var i=r;i<e.length-1&&e[i].equals2D(e[i+1]);)i++;if(i>=e.length-1)return e.length-1;for(var n=tk.quadrant(e[i],e[i+1]),o=r+1;o<e.length&&(e[o-1].equals2D(e[o])||tk.quadrant(e[o-1],e[o])===n);)o++;return o-1},rn.getChains=function(){if(1==arguments.length){var e=arguments[0];return rn.getChains(e,null)}if(2==arguments.length){for(var r=arguments[0],i=arguments[1],n=new eA,o=rn.getChainStartIndices(r),a=0;a<o.length-1;a++){var s=new ri(r,o[a],o[a+1],i);n.add(s)}return n}},rn.toIntArray=function(e){for(var r=Array(e.size()).fill(null),i=0;i<r.length;i++)r[i]=e.get(i).intValue();return r};var ro=function(){};ro.prototype.computeNodes=function(e){},ro.prototype.getNodedSubstrings=function(){},ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro};var ra=function(){if(this._segInt=null,0==arguments.length);else if(1==arguments.length){var e=arguments[0];this.setSegmentIntersector(e)}};ra.prototype.setSegmentIntersector=function(e){this._segInt=e},ra.prototype.interfaces_=function(){return[ro]},ra.prototype.getClass=function(){return ra};var rs=function(e){function r(r){r?e.call(this,r):e.call(this),this._monoChains=new eA,this._index=new t1,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={SegmentOverlapAction:{configurable:!0}};return r.prototype.getMonotoneChains=function(){return this._monoChains},r.prototype.getNodedSubstrings=function(){return t7.getNodedSubstrings(this._nodedSegStrings)},r.prototype.getIndex=function(){return this._index},r.prototype.add=function(e){for(var r=rn.getChains(e.getCoordinates(),e).iterator();r.hasNext();){var i=r.next();i.setId(this._idCounter++),this._index.insert(i.getEnvelope(),i),this._monoChains.add(i)}},r.prototype.computeNodes=function(e){this._nodedSegStrings=e;for(var r=e.iterator();r.hasNext();)this.add(r.next());this.intersectChains()},r.prototype.intersectChains=function(){for(var e=new rl(this._segInt),r=this._monoChains.iterator();r.hasNext();)for(var i=r.next(),n=this._index.query(i.getEnvelope()).iterator();n.hasNext();){var o=n.next();if(o.getId()>i.getId()&&(i.computeOverlaps(o,e),this._nOverlaps++),this._segInt.isDone())return null}},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},i.SegmentOverlapAction.get=function(){return rl},Object.defineProperties(r,i),r}(ra),rl=function(e){function r(){e.call(this),this._si=null;var r=arguments[0];this._si=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.overlap=function(){if(4!=arguments.length)return e.prototype.overlap.apply(this,arguments);var r=arguments[0],i=arguments[1],n=arguments[2],o=arguments[3],a=r.getContext(),s=n.getContext();this._si.processIntersections(a,i,s,o)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(rr),ru=function e(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,0==arguments.length);else if(1==arguments.length){var r=arguments[0];this.setQuadrantSegments(r)}else if(2==arguments.length){var i=arguments[0],n=arguments[1];this.setQuadrantSegments(i),this.setEndCapStyle(n)}else if(4==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],l=arguments[3];this.setQuadrantSegments(o),this.setEndCapStyle(a),this.setJoinStyle(s),this.setMitreLimit(l)}},rc={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}};ru.prototype.getEndCapStyle=function(){return this._endCapStyle},ru.prototype.isSingleSided=function(){return this._isSingleSided},ru.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,0===this._quadrantSegments&&(this._joinStyle=ru.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=ru.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==ru.JOIN_ROUND&&(this._quadrantSegments=ru.DEFAULT_QUADRANT_SEGMENTS)},ru.prototype.getJoinStyle=function(){return this._joinStyle},ru.prototype.setJoinStyle=function(e){this._joinStyle=e},ru.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},ru.prototype.getSimplifyFactor=function(){return this._simplifyFactor},ru.prototype.getQuadrantSegments=function(){return this._quadrantSegments},ru.prototype.setEndCapStyle=function(e){this._endCapStyle=e},ru.prototype.getMitreLimit=function(){return this._mitreLimit},ru.prototype.setMitreLimit=function(e){this._mitreLimit=e},ru.prototype.setSingleSided=function(e){this._isSingleSided=e},ru.prototype.interfaces_=function(){return[]},ru.prototype.getClass=function(){return ru},ru.bufferDistanceError=function(e){return 1-Math.cos(Math.PI/2/e/2)},rc.CAP_ROUND.get=function(){return 1},rc.CAP_FLAT.get=function(){return 2},rc.CAP_SQUARE.get=function(){return 3},rc.JOIN_ROUND.get=function(){return 1},rc.JOIN_MITRE.get=function(){return 2},rc.JOIN_BEVEL.get=function(){return 3},rc.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},rc.DEFAULT_MITRE_LIMIT.get=function(){return 5},rc.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(ru,rc);var rh=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ed.COUNTERCLOCKWISE,this._inputLine=e||null},rp={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};rh.prototype.isDeletable=function(e,r,i,n){var o=this._inputLine[e],a=this._inputLine[r],s=this._inputLine[i];return!!this.isConcave(o,a,s)&&!!this.isShallow(o,a,s,n)&&this.isShallowSampled(o,a,e,i,n)},rh.prototype.deleteShallowConcavities=function(){for(var e=1,r=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(r),n=!1;i<this._inputLine.length;){var o=!1;this.isDeletable(e,r,i,this._distanceTol)&&(this._isDeleted[r]=rh.DELETE,o=!0,n=!0),e=o?i:r,r=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(r)}return n},rh.prototype.isShallowConcavity=function(e,r,i,n){return ed.computeOrientation(e,r,i)===this._angleOrientation&&ed.distancePointLine(r,e,i)<n},rh.prototype.isShallowSampled=function(e,r,i,n,o){var a=Math.trunc((n-i)/rh.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var s=i;s<n;s+=a)if(!this.isShallow(e,r,this._inputLine[s],o))return!1;return!0},rh.prototype.isConcave=function(e,r,i){return ed.computeOrientation(e,r,i)===this._angleOrientation},rh.prototype.simplify=function(e){this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=ed.CLOCKWISE),this._isDeleted=Array(this._inputLine.length).fill(null);var r=!1;do r=this.deleteShallowConcavities();while(r);return this.collapseLine()},rh.prototype.findNextNonDeletedIndex=function(e){for(var r=e+1;r<this._inputLine.length&&this._isDeleted[r]===rh.DELETE;)r++;return r},rh.prototype.isShallow=function(e,r,i,n){return ed.distancePointLine(r,e,i)<n},rh.prototype.collapseLine=function(){for(var e=new eL,r=0;r<this._inputLine.length;r++)this._isDeleted[r]!==rh.DELETE&&e.add(this._inputLine[r]);return e.toCoordinateArray()},rh.prototype.interfaces_=function(){return[]},rh.prototype.getClass=function(){return rh},rh.simplify=function(e,r){return new rh(e).simplify(r)},rp.INIT.get=function(){return 0},rp.DELETE.get=function(){return 1},rp.KEEP.get=function(){return 1},rp.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(rh,rp);var rd=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new eA},rf={COORDINATE_ARRAY_TYPE:{configurable:!0}};rd.prototype.getCoordinates=function(){return this._ptList.toArray(rd.COORDINATE_ARRAY_TYPE)},rd.prototype.setPrecisionModel=function(e){this._precisionModel=e},rd.prototype.addPt=function(e){var r=new T(e);
113if(this._precisionModel.makePrecise(r),this.isRedundant(r))return null;this._ptList.add(r)},rd.prototype.revere=function(){},rd.prototype.addPts=function(e,r){if(r)for(var i=0;i<e.length;i++)this.addPt(e[i]);else for(var n=e.length-1;n>=0;n--)this.addPt(e[n])},rd.prototype.isRedundant=function(e){if(1>this._ptList.size())return!1;var r=this._ptList.get(this._ptList.size()-1);return e.distance(r)<this._minimimVertexDistance},rd.prototype.toString=function(){return(new td).createLineString(this.getCoordinates()).toString()},rd.prototype.closeRing=function(){if(1>this._ptList.size())return null;var e=new T(this._ptList.get(0)),r=this._ptList.get(this._ptList.size()-1);if(e.equals(r))return null;this._ptList.add(e)},rd.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e},rd.prototype.interfaces_=function(){return[]},rd.prototype.getClass=function(){return rd},rf.COORDINATE_ARRAY_TYPE.get=function(){return[].fill(null)},Object.defineProperties(rd,rf);var rm=function(){},rg={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};rm.prototype.interfaces_=function(){return[]},rm.prototype.getClass=function(){return rm},rm.toDegrees=function(e){return 180*e/Math.PI},rm.normalize=function(e){for(;e>Math.PI;)e-=rm.PI_TIMES_2;for(;e<=-Math.PI;)e+=rm.PI_TIMES_2;return e},rm.angle=function(){if(1==arguments.length){var e=arguments[0];return Math.atan2(e.y,e.x)}if(2==arguments.length){var r=arguments[0],i=arguments[1],n=i.x-r.x;return Math.atan2(i.y-r.y,n)}},rm.isAcute=function(e,r,i){var n=e.x-r.x,o=e.y-r.y;return n*(i.x-r.x)+o*(i.y-r.y)>0},rm.isObtuse=function(e,r,i){var n=e.x-r.x,o=e.y-r.y;return n*(i.x-r.x)+o*(i.y-r.y)<0},rm.interiorAngle=function(e,r,i){var n=rm.angle(r,e);return Math.abs(rm.angle(r,i)-n)},rm.normalizePositive=function(e){if(e<0){for(;e<0;)e+=rm.PI_TIMES_2;e>=rm.PI_TIMES_2&&(e=0)}else{for(;e>=rm.PI_TIMES_2;)e-=rm.PI_TIMES_2;e<0&&(e=0)}return e},rm.angleBetween=function(e,r,i){var n=rm.angle(r,e),o=rm.angle(r,i);return rm.diff(n,o)},rm.diff=function(e,r){var i=null;return(i=e<r?r-e:e-r)>Math.PI&&(i=2*Math.PI-i),i},rm.toRadians=function(e){return e*Math.PI/180},rm.getTurn=function(e,r){var i=Math.sin(r-e);return i>0?rm.COUNTERCLOCKWISE:i<0?rm.CLOCKWISE:rm.NONE},rm.angleBetweenOriented=function(e,r,i){var n=rm.angle(r,e),o=rm.angle(r,i)-n;return o<=-Math.PI?o+rm.PI_TIMES_2:o>Math.PI?o-rm.PI_TIMES_2:o},rg.PI_TIMES_2.get=function(){return 2*Math.PI},rg.PI_OVER_2.get=function(){return Math.PI/2},rg.PI_OVER_4.get=function(){return Math.PI/4},rg.COUNTERCLOCKWISE.get=function(){return ed.COUNTERCLOCKWISE},rg.CLOCKWISE.get=function(){return ed.CLOCKWISE},rg.NONE.get=function(){return ed.COLLINEAR},Object.defineProperties(rm,rg);var r_=function e(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new re,this._seg1=new re,this._offset0=new re,this._offset1=new re,this._side=0,this._hasNarrowConcaveAngle=!1;var r=arguments[0],i=arguments[1],n=arguments[2];this._precisionModel=r,this._bufParams=i,this._li=new ec,this._filletAngleQuantum=Math.PI/2/i.getQuadrantSegments(),i.getQuadrantSegments()>=8&&i.getJoinStyle()===ru.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},ry={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}};r_.prototype.addNextSegment=function(e,r){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,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 i=ed.computeOrientation(this._s0,this._s1,this._s2),n=i===ed.CLOCKWISE&&this._side===tb.LEFT||i===ed.COUNTERCLOCKWISE&&this._side===tb.RIGHT;0===i?this.addCollinear(r):n?this.addOutsideTurn(i,r):this.addInsideTurn(i,r)},r_.prototype.addLineEndCap=function(e,r){var i=new re(e,r),n=new re;this.computeOffsetSegment(i,tb.LEFT,this._distance,n);var o=new re;this.computeOffsetSegment(i,tb.RIGHT,this._distance,o);var a=r.x-e.x,s=Math.atan2(r.y-e.y,a);switch(this._bufParams.getEndCapStyle()){case ru.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(r,s+Math.PI/2,s-Math.PI/2,ed.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case ru.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(o.p1);break;case ru.CAP_SQUARE:var l=new T;l.x=Math.abs(this._distance)*Math.cos(s),l.y=Math.abs(this._distance)*Math.sin(s);var u=new T(n.p1.x+l.x,n.p1.y+l.y),c=new T(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(u),this._segList.addPt(c)}},r_.prototype.getCoordinates=function(){return this._segList.getCoordinates()},r_.prototype.addMitreJoin=function(e,r,i,n){var o=!0,a=null;try{a=$.intersection(r.p0,r.p1,i.p0,i.p1),(n<=0?1:a.distance(e)/Math.abs(n))>this._bufParams.getMitreLimit()&&(o=!1)}catch(e){if(!(e instanceof q))throw e;a=new T(0,0),o=!1}o?this._segList.addPt(a):this.addLimitedMitreJoin(r,i,n,this._bufParams.getMitreLimit())},r_.prototype.addFilletCorner=function(e,r,i,n,o){var a=r.x-e.x,s=Math.atan2(r.y-e.y,a),l=i.x-e.x,u=Math.atan2(i.y-e.y,l);n===ed.CLOCKWISE?s<=u&&(s+=2*Math.PI):s>=u&&(s-=2*Math.PI),this._segList.addPt(r),this.addFilletArc(e,s,u,
113n,o),this._segList.addPt(i)},r_.prototype.addOutsideTurn=function(e,r){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*r_.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===ru.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===ru.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(r&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))},r_.prototype.createSquare=function(e){this._segList.addPt(new T(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new T(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new T(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new T(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()},r_.prototype.addSegments=function(e,r){this._segList.addPts(e,r)},r_.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},r_.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},r_.prototype.initSideSegments=function(e,r,i){this._s1=e,this._s2=r,this._side=i,this._seg1.setCoordinates(e,r),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)},r_.prototype.addLimitedMitreJoin=function(e,r,i,n){var o=this._seg0.p1,a=rm.angle(o,this._seg0.p0),s=rm.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1)/2,l=rm.normalize(a+s),u=rm.normalize(l+Math.PI),c=n*i,h=i-c*Math.abs(Math.sin(s)),p=new T(o.x+c*Math.cos(u),o.y+c*Math.sin(u)),d=new re(o,p),f=d.pointAlongOffset(1,h),m=d.pointAlongOffset(1,-h);this._side===tb.LEFT?(this._segList.addPt(f),this._segList.addPt(m)):(this._segList.addPt(m),this._segList.addPt(f))},r_.prototype.computeOffsetSegment=function(e,r,i,n){var o=r===tb.LEFT?1:-1,a=e.p1.x-e.p0.x,s=e.p1.y-e.p0.y,l=Math.sqrt(a*a+s*s),u=o*i*a/l,c=o*i*s/l;n.p0.x=e.p0.x-c,n.p0.y=e.p0.y+u,n.p1.x=e.p1.x-c,n.p1.y=e.p1.y+u},r_.prototype.addFilletArc=function(e,r,i,n,o){var a=n===ed.CLOCKWISE?-1:1,s=Math.abs(r-i),l=Math.trunc(s/this._filletAngleQuantum+.5);if(l<1)return null;for(var u=s/l,c=0,h=new T;c<s;){var p=r+a*c;h.x=e.x+o*Math.cos(p),h.y=e.y+o*Math.sin(p),this._segList.addPt(h),c+=u}},r_.prototype.addInsideTurn=function(e,r){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*r_.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var i=new T((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(i);var n=new T((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(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},r_.prototype.createCircle=function(e){var r=new T(e.x+this._distance,e.y);this._segList.addPt(r),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},r_.prototype.addBevelJoin=function(e,r){this._segList.addPt(e.p1),this._segList.addPt(r.p0)},r_.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new rd,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*r_.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},r_.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===ru.JOIN_BEVEL||this._bufParams.getJoinStyle()===ru.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,ed.CLOCKWISE,this._distance))},r_.prototype.closeRing=function(){this._segList.closeRing()},r_.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},r_.prototype.interfaces_=function(){return[]},r_.prototype.getClass=function(){return r_},ry.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},ry.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},ry.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},ry.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(r_,ry);var rv=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],r=arguments[1];this._precisionModel=e,this._bufParams=r};rv.prototype.getOffsetCurve=function(e,r){if(this._distance=r,0===r)return null;var i=r<0,n=Math.abs(r),o=this.getSegGen(n);e.length<=1?this.computePointCurve(e[0],o):this.computeOffsetCurve(e,i,o);var a=o.getCoordinates();return i&&eO.reverse(a),a},rv.prototype.computeSingleSidedBufferCurve=function(e,r,i){var n=this.simplifyTolerance(this._distance);if(r){i.addSegments(e,!0);var o=rh.simplify(e,-n),a=o.length-1;i.initSideSegments(o[a],o[a-1],tb.LEFT),i.addFirstSegment();for(var s=a-2;s>=0;s--)i.addNextSegment(o[s],!0)}else{i.addSegments(e,!1);
113var l=rh.simplify(e,n),u=l.length-1;i.initSideSegments(l[0],l[1],tb.LEFT),i.addFirstSegment();for(var c=2;c<=u;c++)i.addNextSegment(l[c],!0)}i.addLastSegment(),i.closeRing()},rv.prototype.computeRingBufferCurve=function(e,r,i){var n=this.simplifyTolerance(this._distance);r===tb.RIGHT&&(n=-n);var o=rh.simplify(e,n),a=o.length-1;i.initSideSegments(o[a-1],o[0],r);for(var s=1;s<=a;s++){var l=1!==s;i.addNextSegment(o[s],l)}i.closeRing()},rv.prototype.computeLineBufferCurve=function(e,r){var i=this.simplifyTolerance(this._distance),n=rh.simplify(e,i),o=n.length-1;r.initSideSegments(n[0],n[1],tb.LEFT);for(var a=2;a<=o;a++)r.addNextSegment(n[a],!0);r.addLastSegment(),r.addLineEndCap(n[o-1],n[o]);var s=rh.simplify(e,-i),l=s.length-1;r.initSideSegments(s[l],s[l-1],tb.LEFT);for(var u=l-2;u>=0;u--)r.addNextSegment(s[u],!0);r.addLastSegment(),r.addLineEndCap(s[1],s[0]),r.closeRing()},rv.prototype.computePointCurve=function(e,r){switch(this._bufParams.getEndCapStyle()){case ru.CAP_ROUND:r.createCircle(e);break;case ru.CAP_SQUARE:r.createSquare(e)}},rv.prototype.getLineCurve=function(e,r){if(this._distance=r,r<0&&!this._bufParams.isSingleSided()||0===r)return null;var i=Math.abs(r),n=this.getSegGen(i);return e.length<=1?this.computePointCurve(e[0],n):this._bufParams.isSingleSided()?this.computeSingleSidedBufferCurve(e,r<0,n):this.computeLineBufferCurve(e,n),n.getCoordinates()},rv.prototype.getBufferParameters=function(){return this._bufParams},rv.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},rv.prototype.getRingCurve=function(e,r,i){if(this._distance=i,e.length<=2)return this.getLineCurve(e,i);if(0===i)return rv.copyCoordinates(e);var n=this.getSegGen(i);return this.computeRingBufferCurve(e,r,n),n.getCoordinates()},rv.prototype.computeOffsetCurve=function(e,r,i){var n=this.simplifyTolerance(this._distance);if(r){var o=rh.simplify(e,-n),a=o.length-1;i.initSideSegments(o[a],o[a-1],tb.LEFT),i.addFirstSegment();for(var s=a-2;s>=0;s--)i.addNextSegment(o[s],!0)}else{var l=rh.simplify(e,n),u=l.length-1;i.initSideSegments(l[0],l[1],tb.LEFT),i.addFirstSegment();for(var c=2;c<=u;c++)i.addNextSegment(l[c],!0)}i.addLastSegment()},rv.prototype.getSegGen=function(e){return new r_(this._precisionModel,this._bufParams,e)},rv.prototype.interfaces_=function(){return[]},rv.prototype.getClass=function(){return rv},rv.copyCoordinates=function(e){for(var r=Array(e.length).fill(null),i=0;i<r.length;i++)r[i]=new T(e[i]);return r};var rx=function(){this._subgraphs=null,this._seg=new re,this._cga=new ed;var e=arguments[0];this._subgraphs=e},rb={DepthSegment:{configurable:!0}};rx.prototype.findStabbedSegments=function(){if(1==arguments.length){for(var e=arguments[0],r=new eA,i=this._subgraphs.iterator();i.hasNext();){var n=i.next(),o=n.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||this.findStabbedSegments(e,n.getDirectedEdges(),r)}return r}if(3==arguments.length){if(L(arguments[2],eC)&&arguments[0]instanceof T&&arguments[1]instanceof tz){for(var a=arguments[0],s=arguments[1],l=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++)if(this._seg.p0=u[c],this._seg.p1=u[c+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<a.x)&&!(this._seg.isHorizontal()||a.y<this._seg.p0.y||a.y>this._seg.p1.y||ed.computeOrientation(this._seg.p0,this._seg.p1,a)===ed.RIGHT)){var h=s.getDepth(tb.LEFT);this._seg.p0.equals(u[c])||(h=s.getDepth(tb.RIGHT));var p=new rw(this._seg,h);l.add(p)}}else if(L(arguments[2],eC)&&arguments[0]instanceof T&&L(arguments[1],eC))for(var d=arguments[0],f=arguments[1],m=arguments[2],g=f.iterator();g.hasNext();){var _=g.next();_.isForward()&&this.findStabbedSegments(d,_,m)}}},rx.prototype.getDepth=function(e){var r=this.findStabbedSegments(e);return 0===r.size()?0:tZ.min(r)._leftDepth},rx.prototype.interfaces_=function(){return[]},rx.prototype.getClass=function(){return rx},rb.DepthSegment.get=function(){return rw},Object.defineProperties(rx,rb);var rw=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],r=arguments[1];this._upwardSeg=new re(e),this._leftDepth=r};rw.prototype.compareTo=function(e){if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return -1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==r||0!=(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?r:this._upwardSeg.compareTo(e._upwardSeg)},rw.prototype.compareX=function(e,r){var i=e.p0.compareTo(r.p0);return 0!==i?i:e.p1.compareTo(r.p1)},rw.prototype.toString=function(){return this._upwardSeg.toString()},rw.prototype.interfaces_=function(){return[w]},rw.prototype.getClass=function(){return rw};var rE=function(e,r,i){this.p0=e||null,this.p1=r||null,this.p2=i||null};rE.prototype.area=function(){return rE.area(this.p0,this.p1,this.p2)},rE.prototype.signedArea=function(){return rE.signedArea(this.p0,this.p1,this.p2)},rE.prototype.interpolateZ=function(e){if(null===e)throw new v("Supplied point is null.");return rE.interpolateZ(e,this.p0,this.p1,this.p2)},rE.prototype.longestSideLength=function(){return rE.longestSideLength(this.p0,this.p1,this.p2)},rE.prototype.isAcute=function(){return rE.isAcute(this.p0,this.p1,this.p2)},rE.prototype.circumcentre=function(){return rE.circumcentre(this.p0,this.p1,this.p2)},rE.prototype.area3D=function(){return rE.area3D(this.p0,this.p1,this.p2)},rE.prototype.centroid=function(){return rE.centroid(this.p0,this.p1,this.p2)},rE.prototype.inCentre=function(){return rE.inCentre(this.p0,this.p1,this.p2)},rE.prototype.interfaces_=function(){return[]},rE.prototype.getClass=function(){return rE},rE.area=function(e,r,i){return Math.abs(((i.x-e.x)*(r.y-e.y)-(r.x-e.x)*(i.y-e.y))/2)},rE.signedArea=function(e,r,i){return((i.x-e.x)*(r.y-e.y)-(r.x-e.x)*(i.y-e.y))/2},rE.det=function(e,r,i,n){return e*n-r*i},rE.interpolateZ=function(e,r,i,n){var o=r.x,a=r.y,s=i.x-o,l=n.x-o,u=i.y-a,c=n.y-a,h=s*c-l*u,p=e.x-o,d=e.y-a;
113return r.z+(c*p-l*d)/h*(i.z-r.z)+(-u*p+s*d)/h*(n.z-r.z)},rE.longestSideLength=function(e,r,i){var n=e.distance(r),o=r.distance(i),a=i.distance(e),s=n;return o>s&&(s=o),a>s&&(s=a),s},rE.isAcute=function(e,r,i){return!!rm.isAcute(e,r,i)&&!!rm.isAcute(r,i,e)&&!!rm.isAcute(i,e,r)},rE.circumcentre=function(e,r,i){var n=i.x,o=i.y,a=e.x-n,s=e.y-o,l=r.x-n,u=r.y-o,c=2*rE.det(a,s,l,u);return new T(n-rE.det(s,a*a+s*s,u,l*l+u*u)/c,o+rE.det(a,a*a+s*s,l,l*l+u*u)/c)},rE.perpendicularBisector=function(e,r){var i=r.x-e.x,n=r.y-e.y,o=new $(e.x+i/2,e.y+n/2,1),a=new $(e.x-n+i/2,e.y+i+n/2,1);return new $(o,a)},rE.angleBisector=function(e,r,i){var n=r.distance(e),o=n/(n+r.distance(i)),a=i.x-e.x,s=i.y-e.y;return new T(e.x+o*a,e.y+o*s)},rE.area3D=function(e,r,i){var n=r.x-e.x,o=r.y-e.y,a=r.z-e.z,s=i.x-e.x,l=i.y-e.y,u=i.z-e.z,c=o*u-a*l,h=a*s-n*u,p=n*l-o*s;return Math.sqrt(c*c+h*h+p*p)/2},rE.centroid=function(e,r,i){return new T((e.x+r.x+i.x)/3,(e.y+r.y+i.y)/3)},rE.inCentre=function(e,r,i){var n=r.distance(i),o=e.distance(i),a=e.distance(r),s=n+o+a;return new T((n*e.x+o*r.x+a*i.x)/s,(n*e.y+o*r.y+a*i.y)/s)};var rS=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new eA;var e=arguments[0],r=arguments[1],i=arguments[2];this._inputGeom=e,this._distance=r,this._curveBuilder=i};rS.prototype.addPoint=function(e){if(this._distance<=0)return null;var r=e.getCoordinates(),i=this._curveBuilder.getLineCurve(r,this._distance);this.addCurve(i,A.EXTERIOR,A.INTERIOR)},rS.prototype.addPolygon=function(e){var r=this._distance,i=tb.LEFT;this._distance<0&&(r=-this._distance,i=tb.RIGHT);var n=e.getExteriorRing(),o=eO.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,r,i,A.EXTERIOR,A.INTERIOR);for(var a=0;a<e.getNumInteriorRing();a++){var s=e.getInteriorRingN(a),l=eO.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(l,r,tb.opposite(i),A.INTERIOR,A.EXTERIOR)}},rS.prototype.isTriangleErodedCompletely=function(e,r){var i=new rE(e[0],e[1],e[2]),n=i.inCentre();return ed.distancePointLine(n,i.p0,i.p1)<Math.abs(r)},rS.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var r=eO.removeRepeatedPoints(e.getCoordinates()),i=this._curveBuilder.getLineCurve(r,this._distance);this.addCurve(i,A.EXTERIOR,A.INTERIOR)},rS.prototype.addCurve=function(e,r,i){if(null===e||e.length<2)return null;var n=new t7(e,new tC(0,A.BOUNDARY,r,i));this._curveList.add(n)},rS.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},rS.prototype.addPolygonRing=function(e,r,i,n,o){if(0===r&&e.length<e8.MINIMUM_VALID_SIZE)return null;var a=n,s=o;e.length>=e8.MINIMUM_VALID_SIZE&&ed.isCCW(e)&&(a=o,s=n,i=tb.opposite(i));var l=this._curveBuilder.getRingCurve(e,i,r);this.addCurve(l,a,s)},rS.prototype.add=function(e){if(e.isEmpty())return null;e instanceof e4?this.addPolygon(e):e instanceof e1?this.addLineString(e):e instanceof e3?this.addPoint(e):e instanceof e6||e instanceof eZ||e instanceof e9?this.addCollection(e):e instanceof eY&&this.addCollection(e)},rS.prototype.isErodedCompletely=function(e,r){var i=e.getCoordinates();if(i.length<4)return r<0;if(4===i.length)return this.isTriangleErodedCompletely(i,r);var n=e.getEnvelopeInternal(),o=Math.min(n.getHeight(),n.getWidth());return r<0&&2*Math.abs(r)>o},rS.prototype.addCollection=function(e){for(var r=0;r<e.getNumGeometries();r++){var i=e.getGeometryN(r);this.add(i)}},rS.prototype.interfaces_=function(){return[]},rS.prototype.getClass=function(){return rS};var rT=function(){};rT.prototype.locate=function(e){},rT.prototype.interfaces_=function(){return[]},rT.prototype.getClass=function(){return rT};var rI=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()};rI.prototype.next=function(){if(this._atStart)return this._atStart=!1,rI.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 n;var e=this._parent.getGeometryN(this._index++);return e instanceof eY?(this._subcollectionIterator=new rI(e),this._subcollectionIterator.next()):e},rI.prototype.remove=function(){throw Error(this.getClass().getName())},rI.prototype.hasNext=function(){if(this._atStart)return!0;
113if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},rI.prototype.interfaces_=function(){return[eM]},rI.prototype.getClass=function(){return rI},rI.isAtomic=function(e){return!(e instanceof eY)};var rM=function(){this._geom=null;var e=arguments[0];this._geom=e};rM.prototype.locate=function(e){return rM.locate(e,this._geom)},rM.prototype.interfaces_=function(){return[rT]},rM.prototype.getClass=function(){return rM},rM.isPointInRing=function(e,r){return!!r.getEnvelopeInternal().intersects(e)&&ed.isPointInRing(e,r.getCoordinates())},rM.containsPointInPolygon=function(e,r){if(r.isEmpty())return!1;var i=r.getExteriorRing();if(!rM.isPointInRing(e,i))return!1;for(var n=0;n<r.getNumInteriorRing();n++){var o=r.getInteriorRingN(n);if(rM.isPointInRing(e,o))return!1}return!0},rM.containsPoint=function(e,r){if(r instanceof e4)return rM.containsPointInPolygon(e,r);if(r instanceof eY)for(var i=new rI(r);i.hasNext();){var n=i.next();if(n!==r&&rM.containsPoint(e,n))return!0}return!1},rM.locate=function(e,r){return r.isEmpty()?A.EXTERIOR:rM.containsPoint(e,r)?A.INTERIOR:A.EXTERIOR};var rC=function(){this._edgeMap=new p,this._edgeList=null,this._ptInAreaLocation=[A.NONE,A.NONE]};rC.prototype.getNextCW=function(e){this.getEdges();var r=this._edgeList.indexOf(e),i=r-1;return 0===r&&(i=this._edgeList.size()-1),this._edgeList.get(i)},rC.prototype.propagateSideLabels=function(e){for(var r=A.NONE,i=this.iterator();i.hasNext();){var n=i.next().getLabel();n.isArea(e)&&n.getLocation(e,tb.LEFT)!==A.NONE&&(r=n.getLocation(e,tb.LEFT))}if(r===A.NONE)return null;for(var o=r,a=this.iterator();a.hasNext();){var s=a.next(),l=s.getLabel();if(l.getLocation(e,tb.ON)===A.NONE&&l.setLocation(e,tb.ON,o),l.isArea(e)){var u=l.getLocation(e,tb.LEFT),c=l.getLocation(e,tb.RIGHT);if(c!==A.NONE){if(c!==o)throw new tS("side location conflict",s.getCoordinate());u===A.NONE&&es.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),o=u}else es.isTrue(l.getLocation(e,tb.LEFT)===A.NONE,"found single null side"),l.setLocation(e,tb.RIGHT,o),l.setLocation(e,tb.LEFT,o)}}},rC.prototype.getCoordinate=function(){var e=this.iterator();return e.hasNext()?e.next().getCoordinate():null},rC.prototype.print=function(e){H.out.println("EdgeEndStar:   "+this.getCoordinate());for(var r=this.iterator();r.hasNext();)r.next().print(e)},rC.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},rC.prototype.checkAreaLabelsConsistent=function(e){var r=this.getEdges();if(0>=r.size())return!0;var i=r.size()-1,n=r.get(i).getLabel().getLocation(e,tb.LEFT);es.isTrue(n!==A.NONE,"Found unlabelled area edge");for(var o=n,a=this.iterator();a.hasNext();){var s=a.next().getLabel();es.isTrue(s.isArea(e),"Found non-area edge");var l=s.getLocation(e,tb.LEFT),u=s.getLocation(e,tb.RIGHT);if(l===u||u!==o)return!1;o=l}return!0},rC.prototype.findIndex=function(e){this.iterator();for(var r=0;r<this._edgeList.size();r++)if(this._edgeList.get(r)===e)return r;return -1},rC.prototype.iterator=function(){return this.getEdges().iterator()},rC.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new eA(this._edgeMap.values())),this._edgeList},rC.prototype.getLocation=function(e,r,i){return this._ptInAreaLocation[e]===A.NONE&&(this._ptInAreaLocation[e]=rM.locate(r,i[e].getGeometry())),this._ptInAreaLocation[e]},rC.prototype.toString=function(){var e=new R;e.append("EdgeEndStar:   "+this.getCoordinate()),e.append("\n");for(var r=this.iterator();r.hasNext();){var i=r.next();e.append(i),e.append("\n")}return e.toString()},rC.prototype.computeEdgeEndLabels=function(e){for(var r=this.iterator();r.hasNext();)r.next().computeLabel(e)},rC.prototype.computeLabelling=function(e){this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.prop
113agateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var n=i.next().getLabel(),o=0;o<2;o++)n.isLine(o)&&n.getLocation(o)===A.BOUNDARY&&(r[o]=!0);for(var a=this.iterator();a.hasNext();)for(var s=a.next(),l=s.getLabel(),u=0;u<2;u++)if(l.isAnyNull(u)){var c=A.NONE;if(r[u])c=A.EXTERIOR;else{var h=s.getCoordinate();c=this.getLocation(u,h,e)}l.setAllLocationsIfNull(u,c)}},rC.prototype.getDegree=function(){return this._edgeMap.size()},rC.prototype.insertEdgeEnd=function(e,r){this._edgeMap.put(e,r),this._edgeList=null},rC.prototype.interfaces_=function(){return[]},rC.prototype.getClass=function(){return rC};var rA=function(e){function r(){e.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var e=null,r=null,i=this._SCANNING_FOR_INCOMING,n=0;n<this._resultAreaEdgeList.size();n++){var o=this._resultAreaEdgeList.get(n),a=o.getSym();if(o.getLabel().isArea())switch(null===e&&o.isInResult()&&(e=o),i){case this._SCANNING_FOR_INCOMING:if(!a.isInResult())continue;r=a,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!o.isInResult())continue;r.setNext(o),i=this._SCANNING_FOR_INCOMING}}if(i===this._LINKING_TO_OUTGOING){if(null===e)throw new tS("no outgoing dirEdge found",this.getCoordinate());es.isTrue(e.isInResult(),"unable to link last incoming dirEdge"),r.setNext(e)}},r.prototype.insert=function(e){this.insertEdgeEnd(e,e)},r.prototype.getRightmostEdge=function(){var e=this.getEdges(),r=e.size();if(r<1)return null;var i=e.get(0);if(1===r)return i;var n=e.get(r-1),o=i.getQuadrant(),a=n.getQuadrant();return tk.isNorthern(o)&&tk.isNorthern(a)?i:tk.isNorthern(o)||tk.isNorthern(a)?0!==i.getDy()?i:0!==n.getDy()?n:(es.shouldNeverReachHere("found two horizontal edges incident on node"),null):n},r.prototype.print=function(e){H.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var r=this.iterator();r.hasNext();){var i=r.next();e.print("out "),i.print(e),e.println(),e.print("in "),i.getSym().print(e),e.println()}},r.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new eA;for(var e=this.iterator();e.hasNext();){var r=e.next();(r.isInResult()||r.getSym().isInResult())&&this._resultAreaEdgeList.add(r)}return this._resultAreaEdgeList},r.prototype.updateLabelling=function(e){for(var r=this.iterator();r.hasNext();){var i=r.next().getLabel();i.setAllLocationsIfNull(0,e.getLocation(0)),i.setAllLocationsIfNull(1,e.getLocation(1))}},r.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var e=null,r=null,i=this._edgeList.size()-1;i>=0;i--){var n=this._edgeList.get(i),o=n.getSym();null===r&&(r=o),null!==e&&o.setNext(e),e=n}r.setNext(e)},r.prototype.computeDepths=function(){if(1==arguments.length){var e=arguments[0],r=this.findIndex(e),i=e.getDepth(tb.LEFT),n=e.getDepth(tb.RIGHT),o=this.computeDepths(r+1,this._edgeList.size(),i);if(this.computeDepths(0,r,o)!==n)throw new tS("depth mismatch at "+e.getCoordinate())}else if(3==arguments.length){for(var a=arguments[0],s=arguments[1],l=arguments[2],u=a;u<s;u++){var c=this._edgeList.get(u);c.setEdgeDepths(tb.RIGHT,l),l=c.getDepth(tb.LEFT)}return l}},r.prototype.mergeSymLabels=function(){for(var e=this.iterator();e.hasNext();){var r=e.next();r.getLabel().merge(r.getSym().getLabel())}},r.prototype.linkMinimalDirectedEdges=function(e){for(var r=null,i=null,n=this._SCANNING_FOR_INCOMING,o=this._resultAreaEdgeList.size()-1;o>=0;o--){var a=this._resultAreaEdgeList.get(o),s=a.getSym();switch(null===r&&a.getEdgeRing()===e&&(r=a),n){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==e)continue;i=s,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(a.getEdgeRing()!==e)continue;i.setNextMin(a),n=this._SCANNING_FOR_INCOMING}}n===this._LINKING_TO_OUTGOING&&(es.isTrue(null!==r,"found null for first outgoing dirEdge"),es.isTrue(r.getEdgeRing()===e,"unable to link last incoming dirEdge"),i.setNextMin(r))},r.prototype.getOutgoingDegree=function(){if(0==arguments.length){for(var e=0,r=this.iterator();r.hasNext();)r.next().isInResult()&&e++;return e}if(1==arguments.length){for(var i=arguments[0],n=0,o=this.iterator();o.hasNext();)o.next().getEdgeRing()===i&&n++;return n}},r.prototype.getLabel=function(){return this._label},r.prototype.findCoveredLineEdges=function(){for(var e=A.NONE,r=this.iterator();r.hasNext();){var i=r.next(),n=i.getSym();if(!i.isLineEdge()){if(i.isInResult()){e=A.INTERIOR;break}if(n.isInResult()){e=A.EXTERIOR;break}}}if(e===A.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var s=a.next(),l=s.getSym();s.isLineEdge()?s.getEdge().setCovered(o===A.INTERIOR):(s.isInResult()&&(o=A.EXTERIOR),l.isInResult()&&(o=A.INTERIOR))}},r.prototype.computeLabelling=function(r){e.prototype.computeLabelling.call(this,r),this._label=new tC(A.NONE);for(var i=this.iterator();i.hasNext();)for(var n=i.next().getEdge().getLabel(),o=0;o<2;o++){var a=n.getLocation(o);a!==A.INTERIOR&&a!==A.BOUNDARY||this._label.setLocation(o,A.INTERIOR)}},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(rC),rP=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.createNode=function(e){return new tD(e,new rA)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(tB),rL=function e(){this._pts=null,this._orientation=null;var r=arguments[0];this._pts=r,this._orientation=e.orientation(r)};rL.prototype.compareTo=function(e){return rL.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},rL.prototype.interfaces_=function(){return[w]},rL.prototype.getClass=function(){return rL},rL.orientation=function(e){return 1===eO.increasingDirection(e)}
113,rL.compareOriented=function(e,r,i,n){for(var o=r?1:-1,a=n?1:-1,s=r?e.length:-1,l=n?i.length:-1,u=r?0:e.length-1,c=n?0:i.length-1;;){var h=e[u].compareTo(i[c]);if(0!==h)return h;var p=(u+=o)===s,d=(c+=a)===l;if(p&&!d)return -1;if(!p&&d)return 1;if(p&&d)return 0}};var rO=function(){this._edges=new eA,this._ocaMap=new p};rO.prototype.print=function(e){e.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=this._edges.get(r);r>0&&e.print(","),e.print("(");for(var n=i.getCoordinates(),o=0;o<n.length;o++)o>0&&e.print(","),e.print(n[o].x+" "+n[o].y);e.println(")")}e.print(")  ")},rO.prototype.addAll=function(e){for(var r=e.iterator();r.hasNext();)this.add(r.next())},rO.prototype.findEdgeIndex=function(e){for(var r=0;r<this._edges.size();r++)if(this._edges.get(r).equals(e))return r;return -1},rO.prototype.iterator=function(){return this._edges.iterator()},rO.prototype.getEdges=function(){return this._edges},rO.prototype.get=function(e){return this._edges.get(e)},rO.prototype.findEqualEdge=function(e){var r=new rL(e.getCoordinates());return this._ocaMap.get(r)},rO.prototype.add=function(e){this._edges.add(e);var r=new rL(e.getCoordinates());this._ocaMap.put(r,e)},rO.prototype.interfaces_=function(){return[]},rO.prototype.getClass=function(){return rO};var rD=function(){};rD.prototype.processIntersections=function(e,r,i,n){},rD.prototype.isDone=function(){},rD.prototype.interfaces_=function(){return[]},rD.prototype.getClass=function(){return rD};var rR=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 e=arguments[0];this._li=e};rR.prototype.isTrivialIntersection=function(e,r,i,n){if(e===i&&1===this._li.getIntersectionNum()){if(rR.isAdjacentSegments(r,n))return!0;if(e.isClosed()){var o=e.size()-1;if(0===r&&n===o||0===n&&r===o)return!0}}return!1},rR.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},rR.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},rR.prototype.getLineIntersector=function(){return this._li},rR.prototype.hasProperIntersection=function(){return this._hasProper},rR.prototype.processIntersections=function(e,r,i,n){if(e===i&&r===n)return null;this.numTests++;var o=e.getCoordinates()[r],a=e.getCoordinates()[r+1],s=i.getCoordinates()[n],l=i.getCoordinates()[n+1];this._li.computeIntersection(o,a,s,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,r,i,n)||(this._hasIntersection=!0,e.addIntersections(this._li,r,0),i.addIntersections(this._li,n,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},rR.prototype.hasIntersection=function(){return this._hasIntersection},rR.prototype.isDone=function(){return!1},rR.prototype.hasInteriorIntersection=function(){return this._hasInterior},rR.prototype.interfaces_=function(){return[rD]},rR.prototype.getClass=function(){return rR},rR.isAdjacentSegments=function(e,r){return 1===Math.abs(e-r)};var rk=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],r=arguments[1],i=arguments[2];this.coord=new T(e),this.segmentIndex=r,this.dist=i};rk.prototype.getSegmentIndex=function(){return this.segmentIndex},rk.prototype.getCoordinate=function(){return this.coord},rk.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},rk.prototype.compareTo=function(e){return this.compare(e.segmentIndex,e.dist)},rk.prototype.isEndPoint=function(e){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===e},rk.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},rk.prototype.getDistance=function(){return this.dist},rk.prototype.compare=function(e,r){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<r?-1:+(this.dist>r)},rk.prototype.interfaces_=function(){return[w]},rk.prototype.getClass=function(){return rk};var rN=function(){this._nodeMap=new p,this.edge=null;var e=arguments[0];this.edge=e};rN.prototype.print=function(e){e.println("Intersections:");for(var r=this.iterator();r.hasNext();)r.next().print(e)},rN.prototype.iterator=function(){return this._nodeMap.values().iterator()},rN.prototype.addSplitEdges=function(e){this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var n=r.next(),o=this.createSplitEdge(i,n);e.add(o),i=n}},rN.prototype.addEndpoints=function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)},rN.prototype.createSplitEdge=function(e,r){var i=r.segmentIndex-e.segmentIndex+2,n=this.edge.pts[r.segmentIndex],o=r.dist>0||!r.coord.equals2D(n);o||i--;var a=Array(i).fill(null),s=0;a[s++]=new T(e.coord);for(var l=e.segmentIndex+1;l<=r.segmentIndex;l++)a[s++]=this.edge.pts[l];return o&&(a[s]=r.coord),new rj(a,new tC(this.edge._label))},rN.prototype.add=function(e,r,i){var n=new rk(e,r,i),o=this._nodeMap.get(n);return null!==o?o:(this._nodeMap.put(n,n),n)},rN.prototype.isIntersection=function(e){for(var r=this.iterator();r.hasNext();)if(r.next().coord.equals(e))return!0;return!1},rN.prototype.interfaces_=function(){return[]},rN.prototype.getClass=function(){return rN};var rF=function(){};rF.prototype.getChainStartIndices=function(e){var r=0,i=new eA;i.add(new k(r));do{var n=this.findChainEnd(e,r);i.add(new k(n)),r=n}while(r<e.length-1);return rF.toIntArray(i)},rF.prototype.findChainEnd=function(e,r){for(var i=tk.quadrant(e[r],e[r+1]),n=r+1;n<e.length&&tk.quadrant(e[n-1],e[n])===i;)n++;return n-1},rF.prototype.interfaces_=function(){return[]},rF.prototype.getClass=function(){return rF},rF.toIntArray=function(e){for(var r=Array(e.size()).fill(null),i=0;i<r.length;i++)r[i]=e.get(i).intValue();return r};var rz=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new W,this.env2=new W;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var r=new rF;this.startIndex=r.getChainStartIndices(this.pts)};rz.prototype.getCoordinates=function(){return this.pts},rz.prototype.getMaxX=function(e){var r=this.pts[this.startIndex[e]].x,i=this.pts[this.startIndex[e+1]].x;return r>i?r:i},rz.prototype.getMinX=function(e){var r=this.pts[this.startIndex[e]].x,i=this.pts[this.startIndex[e+1]].x;return r<i?r:i},rz.prototype.computeIntersectsForChain=function(){if(4==arguments.length){var e=arguments[0],r=arguments[1],i=arguments[2],n=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],r,r.startIndex[i],r.startIndex[i+1],n)}else if(6==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],l=arguments[3],u=arguments[4],c=arguments[5],h=this.pts[o],p=this.pts[a],d=s.pts[l],f=s.pts[u];if(a-o==1&&u-l==1)return c.addIntersections(this.e,o,s.e,l),null;if(this.env1.init(h,p),this.env2.init(d,f),!this.env1.intersects(this.env2))return null;var m=Math.trunc((o+a)/2),g=Math.trunc((l+u)/2);o<m&&(l<g&&this.computeIntersectsForChain(o,m,s,l,g,c),g<u&&this.computeIntersectsForChain(o,m,s,g,u,c)),m<a&&(l<g&&this.computeIntersectsForChain(m,a,s,l,g,c),g<u&&this.computeIntersectsForChain(m,a,s,g,u,c))}},rz.prototype.getStartIndexes=function(){return this.startIndex},rz.prototype.computeIntersects=function(e,r){for(var i=0;i<this.startIndex.length-1;i++)for(var n=0;n<e.startIndex.length-1;n++)this.computeIntersectsForChain(i,e,n,r)},rz.prototype.interfaces_=function(){return[]},rz.prototype.getClass=function(){return rz};var rB=function e(){this._depth=[,,].fill().map(function(){return[,,,]});for(var r=0;r<2;r++)for(var i=0;i<3;i++)this._depth[r][i]=e.NULL_VALUE},rU={NULL_VALUE:{configurable:!0}};rB.prototype.getDepth=function(e,r){return this._depth[e][r]},rB.prototype.setDepth=function(e,r,i){this._depth[e][r]=i},rB.prototype.isNull=function(){if(0==arguments.length){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(this._depth[e][r]!==rB.NULL_VALUE)return!1;return!0}if(1==arguments.length){var i=arguments[0];return this._depth[i][1]===rB.NULL_VALUE}if(2==arguments.length){var n=arguments[0],o=arguments[1];return this._depth[n][o]===rB.NULL_VALUE}},rB.prototype.normalize=function(){for(var e=0;e<2;e++)if(!this.isNull(e)){var r=this._depth[e][1];this._depth[e][2]<r&&(r=this._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var n=0;this._depth[e][i]>r&&(n=1),this._depth[e][i]=n}}},rB.prototype.getDelta=function(e){return this._depth[e][tb.RIGHT]-this._depth[e][tb.LEFT]},rB.prototype.getLocation=function(e,r){return this._depth[e][r]<=0?A.EXTERIOR:A.INTERIOR},rB.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},rB.prototype.add=function(){if(1==arguments.length)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var n=e.getLocation(r,i);n!==A.EXTERIOR&&n!==A.INTERIOR||(this.isNull(r,i)?this._depth[r][i]=rB.depthAtLocation(n):this._depth[r][i]+=rB.depthAtLocation(n))}else if(3==arguments.length){var o=arguments[0],a=arguments[1];arguments[2]===A.INTERIOR&&this._depth[o][a]++}},rB.prototype.interfaces_=function(){return[]},rB.prototype.getClass=function(){return rB},rB.depthAtLocation=function(e){return e===A.EXTERIOR?0:e===A.INTERIOR?1:rB.NULL_VALUE},rU.NULL_VALUE.get=function(){return -1},Object.defineProperties(rB,rU);
113var rj=function(e){function r(){if(e.call(this),this.pts=null,this._env=null,this.eiList=new rN(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new rB,this._depthDelta=0,1==arguments.length){var i=arguments[0];r.call(this,i,null)}else if(2==arguments.length){var n=arguments[0],o=arguments[1];this.pts=n,this._label=o}}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDepth=function(){return this._depth},r.prototype.getCollapsedEdge=function(){var e=[,,].fill(null);return e[0]=this.pts[0],e[1]=this.pts[1],new r(e,tC.toLineLabel(this._label))},r.prototype.isIsolated=function(){return this._isIsolated},r.prototype.getCoordinates=function(){return this.pts},r.prototype.setIsolated=function(e){this._isIsolated=e},r.prototype.setName=function(e){this._name=e},r.prototype.equals=function(e){if(!(e instanceof r)||this.pts.length!==e.pts.length)return!1;for(var i=!0,n=!0,o=this.pts.length,a=0;a<this.pts.length;a++)if(this.pts[a].equals2D(e.pts[a])||(i=!1),this.pts[a].equals2D(e.pts[--o])||(n=!1),!i&&!n)return!1;return!0},r.prototype.getCoordinate=function(){if(0==arguments.length)return this.pts.length>0?this.pts[0]:null;if(1==arguments.length){var e=arguments[0];return this.pts[e]}},r.prototype.print=function(e){e.print("edge "+this._name+": "),e.print("LINESTRING (");for(var r=0;r<this.pts.length;r++)r>0&&e.print(","),e.print(this.pts[r].x+" "+this.pts[r].y);e.print(")  "+this._label+" "+this._depthDelta)},r.prototype.computeIM=function(e){r.updateIM(this._label,e)},r.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},r.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},r.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},r.prototype.getDepthDelta=function(){return this._depthDelta},r.prototype.getNumPoints=function(){return this.pts.length},r.prototype.printReverse=function(e){e.print("edge "+this._name+": ");for(var r=this.pts.length-1;r>=0;r--)e.print(this.pts[r]+" ");e.println("")},r.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new rz(this)),this._mce},r.prototype.getEnvelope=function(){if(null===this._env){this._env=new W;for(var e=0;e<this.pts.length;e++)this._env.expandToInclude(this.pts[e])}return this._env},r.prototype.addIntersection=function(e,r,i,n){var o=new T(e.getIntersection(n)),a=r,s=e.getEdgeDistance(i,n),l=a+1;if(l<this.pts.length){var u=this.pts[l];o.equals2D(u)&&(a=l,s=0)}this.eiList.add(o,a,s)},r.prototype.toString=function(){var e=new R;e.append("edge "+this._name+": "),e.append("LINESTRING (");for(var r=0;r<this.pts.length;r++)r>0&&e.append(","),e.append(this.pts[r].x+" "+this.pts[r].y);return e.append(")  "+this._label+" "+this._depthDelta),e.toString()},r.prototype.isPointwiseEqual=function(e){if(this.pts.length!==e.pts.length)return!1;for(var r=0;r<this.pts.length;r++)if(!this.pts[r].equals2D(e.pts[r]))return!1;return!0},r.prototype.setDepthDelta=function(e){this._depthDelta=e},r.prototype.getEdgeIntersectionList=function(){return this.eiList},r.prototype.addIntersections=function(e,r,i){for(var n=0;n<e.getIntersectionNum();n++)this.addIntersection(e,r,i,n)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r.updateIM=function(){if(2!=arguments.length)return e.prototype.updateIM.apply(this,arguments);var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,tb.ON),r.getLocation(1,tb.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,tb.LEFT),r.getLocation(1,tb.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,tb.RIGHT),r.getLocation(1,tb.RIGHT),2))},r}(tO),rV=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new rO,this._bufParams=e||null};rV.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e},rV.prototype.insertUniqueEdge=function(e){var r=this._edgeList.findEqualEdge(e);if(null!==r){var i=r.getLabel(),n=e.getLabel();r.isPointwiseEqual(e)||(n=new tC(e.getLabel())).flip(),i.merge(n);var o=rV.depthDelta(n),a=r.getDepthDelta()+o;r.setDepthDelta(a)}else this._edgeList.add(e),e.setDepthDelta(rV.depthDelta(e.getLabel()))},rV.prototype.buildSubgraphs=function(e,r){for(var i=new eA,n=e.iterator();n.hasNext();){var o=n.next(),a=o.getRightmostCoordinate(),s=new rx(i).getDepth(a);o.computeDepth(s),o.findResultEdges(),i.add(o),r.add(o.getDirectedEdges(),o.getNodes())}},rV.prototype.createSubgraphs=function(e){for(var r=new eA,i=e.getNodes().iterator();i.hasNext();){var n=i.next();if(!n.isVisited()){var o=new tI;o.create(n),r.add(o)}}return tZ.sort(r,tZ.reverseOrder()),r},rV.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rV.prototype.getNoder=function(e){if(null!==this._workingNoder)return this._workingNoder;var r=new rs,i=new ec;return i.setPrecisionModel(e),r.setSegmentIntersector(new rR(i)),r},rV.prototype.buffer=function(e,r){var i=this._workingPrecisionModel;null===i&&(i=e.getPrecisionModel()),this._geomFact=e.getFactory();var n=new rS(e,r,new rv(i,this._bufParams)).getCurves();if(0>=n.size())return this.createEmptyResultGeometry();this.computeNodedEdges(n,i),this._graph=new tU(new rP),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),a=new tj(this._geomFact);this.buildSubgraphs(o,a);var s=a.getPolygons();return 0>=s.size()?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},rV.prototype.computeNodedEdges=function(e,r){var i=this.getNoder(r);i.computeNodes(e);for(var n=i.getNodedSubstrings().iterator();n.hasNext();){var o=n.next(),a=o.getCoordinates();
113if(2!==a.length||!a[0].equals2D(a[1])){var s=o.getData(),l=new rj(o.getCoordinates(),new tC(s));this.insertUniqueEdge(l)}}},rV.prototype.setNoder=function(e){this._workingNoder=e},rV.prototype.interfaces_=function(){return[]},rV.prototype.getClass=function(){return rV},rV.depthDelta=function(e){var r=e.getLocation(0,tb.LEFT),i=e.getLocation(0,tb.RIGHT);return r===A.INTERIOR&&i===A.EXTERIOR?1:r===A.EXTERIOR&&i===A.INTERIOR?-1:0},rV.convertSegStrings=function(e){for(var r=new td,i=new eA;e.hasNext();){var n=e.next(),o=r.createLineString(n.getCoordinates());i.add(o)}return r.buildGeometry(i)};var rG=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2==arguments.length){var e=arguments[0],r=arguments[1];this._noder=e,this._scaleFactor=r,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2],a=arguments[3];this._noder=i,this._scaleFactor=n,this._offsetX=o,this._offsetY=a,this._isScaled=!this.isIntegerPrecision()}};rG.prototype.rescale=function(){if(L(arguments[0],eI))for(var e=arguments[0].iterator();e.hasNext();){var r=e.next();this.rescale(r.getCoordinates())}else if(arguments[0]instanceof Array){for(var i=arguments[0],n=0;n<i.length;n++)i[n].x=i[n].x/this._scaleFactor+this._offsetX,i[n].y=i[n].y/this._scaleFactor+this._offsetY;2===i.length&&i[0].equals2D(i[1])&&H.out.println(i)}},rG.prototype.scale=function(){if(L(arguments[0],eI)){for(var e=arguments[0],r=new eA,i=e.iterator();i.hasNext();){var n=i.next();r.add(new t7(this.scale(n.getCoordinates()),n.getData()))}return r}if(arguments[0]instanceof Array){for(var o=arguments[0],a=Array(o.length).fill(null),s=0;s<o.length;s++)a[s]=new T(Math.round((o[s].x-this._offsetX)*this._scaleFactor),Math.round((o[s].y-this._offsetY)*this._scaleFactor),o[s].z);return eO.removeRepeatedPoints(a)}},rG.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},rG.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e},rG.prototype.computeNodes=function(e){var r=e;this._isScaled&&(r=this.scale(e)),this._noder.computeNodes(r)},rG.prototype.interfaces_=function(){return[ro]},rG.prototype.getClass=function(){return rG};var rq=function(){this._li=new ec,this._segStrings=null;var e=arguments[0];this._segStrings=e},rH={fact:{configurable:!0}};rq.prototype.checkEndPtVertexIntersections=function(){if(0==arguments.length)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next().getCoordinates();this.checkEndPtVertexIntersections(r[0],this._segStrings),this.checkEndPtVertexIntersections(r[r.length-1],this._segStrings)}else if(2==arguments.length){for(var i=arguments[0],n=arguments[1].iterator();n.hasNext();)for(var o=n.next().getCoordinates(),a=1;a<o.length-1;a++)if(o[a].equals(i))throw new eo("found endpt/interior pt intersection at index "+a+" :pt "+i)}},rq.prototype.checkInteriorIntersections=function(){if(0==arguments.length)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var n=i.next();this.checkInteriorIntersections(r,n)}else if(2==arguments.length)for(var o=arguments[0],a=arguments[1],s=o.getCoordinates(),l=a.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<l.length-1;c++)this.checkInteriorIntersections(o,u,a,c);else if(4==arguments.length){var h=arguments[0],p=arguments[1],d=arguments[2],f=arguments[3];if(h===d&&p===f)return null;var m=h.getCoordinates()[p],g=h.getCoordinates()[p+1],_=d.getCoordinates()[f],y=d.getCoordinates()[f+1];if(this._li.computeIntersection(m,g,_,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,m,g)||this.hasInteriorIntersection(this._li,_,y)))throw new eo("found non-noded intersection at "+m+"-"+g+" and "+_+"-"+y)}},rq.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},rq.prototype.checkCollapses=function(){if(0==arguments.length)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();this.checkCollapses(r)}else if(1==arguments.length)for(var i=arguments[0].getCoordinates(),n=0;n<i.length-2;n++)this.checkCollapse(i[n],i[n+1],i[n+2])},rq.prototype.hasInteriorIntersection=function(e,r,i){for(var n=0;n<e.getIntersectionNum();n++){var o=e.getIntersection(n);if(!o.equals(r)&&!o.equals(i))return!0}return!1},rq.prototype.checkCollapse=function(e,r,i){if(e.equals(i))throw new eo("found non-noded collapse at "+rq.fact.createLineString([e,r,i]))},rq.prototype.interfaces_=function(){return[]},rq.prototype.getClass=function(){return rq},rH.fact.get=function(){return new td},Object.defineProperties(rq,rH);var r$=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._max
113x=null,this._miny=null,this._maxy=null,this._corner=[,,,,].fill(null),this._safeEnv=null;var e=arguments[0],r=arguments[1],i=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=r,this._li=i,r<=0)throw new v("Scale factor must be non-zero");1!==r&&(this._pt=new T(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new T,this._p1Scaled=new T),this.initCorners(this._pt)},rW={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};r$.prototype.intersectsScaled=function(e,r){var i=Math.min(e.x,r.x),n=Math.max(e.x,r.x),o=Math.min(e.y,r.y),a=Math.max(e.y,r.y),s=this._maxx<i||this._minx>n||this._maxy<o||this._miny>a;if(s)return!1;var l=this.intersectsToleranceSquare(e,r);return es.isTrue(!(s&&l),"Found bad envelope test"),l},r$.prototype.initCorners=function(e){this._minx=e.x-.5,this._maxx=e.x+.5,this._miny=e.y-.5,this._maxy=e.y+.5,this._corner[0]=new T(this._maxx,this._maxy),this._corner[1]=new T(this._minx,this._maxy),this._corner[2]=new T(this._minx,this._miny),this._corner[3]=new T(this._maxx,this._miny)},r$.prototype.intersects=function(e,r){return 1===this._scaleFactor?this.intersectsScaled(e,r):(this.copyScaled(e,this._p0Scaled),this.copyScaled(r,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},r$.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},r$.prototype.getCoordinate=function(){return this._originalPt},r$.prototype.copyScaled=function(e,r){r.x=this.scale(e.x),r.y=this.scale(e.y)},r$.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var e=r$.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new W(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},r$.prototype.intersectsPixelClosure=function(e,r){return this._li.computeIntersection(e,r,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,r,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,r,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,r,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},r$.prototype.intersectsToleranceSquare=function(e,r){var i=!1,n=!1;return this._li.computeIntersection(e,r,this._corner[0],this._corner[1]),!!this._li.isProper()||
113(this._li.computeIntersection(e,r,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,r,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,r,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!i||!n)||!!e.equals(this._pt)||!!r.equals(this._pt))))},r$.prototype.addSnappedNode=function(e,r){var i=e.getCoordinate(r),n=e.getCoordinate(r+1);return!!this.intersects(i,n)&&(e.addIntersection(this.getCoordinate(),r),!0)},r$.prototype.interfaces_=function(){return[]},r$.prototype.getClass=function(){return r$},rW.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(r$,rW);var rY=function(){this.tempEnv1=new W,this.selectedSegment=new re};rY.prototype.select=function(){if(1==arguments.length);else if(2==arguments.length){var e=arguments[0],r=arguments[1];e.getLineSegment(r,this.selectedSegment),this.select(this.selectedSegment)}},rY.prototype.interfaces_=function(){return[]},rY.prototype.getClass=function(){return rY};var rZ=function(){this._index=null;var e=arguments[0];this._index=e},rX={HotPixelSnapAction:{configurable:!0}};rZ.prototype.snap=function(){if(1==arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3==arguments.length){var r=arguments[0],i=arguments[1],n=arguments[2],o=r.getSafeEnvelope(),a=new rK(r,i,n);return this._index.query(o,{interfaces_:function(){return[tH]},visitItem:function(e){e.select(o,a)}}),a.isNodeAdded()}},rZ.prototype.interfaces_=function(){return[]},rZ.prototype.getClass=function(){return rZ},rX.HotPixelSnapAction.get=function(){return rK},Object.defineProperties(rZ,rX);var rK=function(e){function r(){e.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var r=arguments[0],i=arguments[1],n=arguments[2];this._hotPixel=r,this._parentEdge=i,this._hotPixelVertexIndex=n}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isNodeAdded=function(){return this._isNodeAdded},r.prototype.select=function(){if(2!=arguments.length)return e.prototype.select.apply(this,arguments);var r=arguments[0],i=arguments[1],n=r.getContext();if(null!==this._parentEdge&&n===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,i)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(rY),rQ=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new eA};rQ.prototype.processIntersections=function(e,r,i,n){if(e===i&&r===n)return null;var o=e.getCoordinates()[r],a=e.getCoordinates()[r+1],s=i.getCoordinates()[n],l=i.getCoordinates()[n+1];if(this._li.computeIntersection(o,a,s,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));e.addIntersections(this._li,r,0),i.addIntersections(this._li,n,1)}},rQ.prototype.isDone=function(){return!1},rQ.prototype.getInteriorIntersections=function(){return this._interiorIntersections},rQ.prototype.interfaces_=function(){return[rD]},rQ.prototype.getClass=function(){return rQ};var rJ=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new ec,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};rJ.prototype.checkCorrectness=function(e){var r=new rq(t7.getNodedSubstrings(e));try{r.checkValid()}catch(e){if(!(e instanceof G))throw e;e.printStackTrace()}},rJ.prototype.getNodedSubstrings=function(){return t7.getNodedSubstrings(this._nodedSegStrings)},rJ.prototype.snapRound=function(e,r){var i=this.findInteriorIntersections(e,r);this.computeIntersectionSnaps(i),this.computeVertexSnaps(e)},rJ.prototype.findInteriorIntersections=function(e,r){var i=new rQ(r);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(e),i.getInteriorIntersections()},rJ.prototype.computeVertexSnaps=function(){if(L(arguments[0],eI))for(var e=arguments[0].iterator();e.hasNext();){var r=e.next();this.computeVertexSnaps(r)}else if(arguments[0]instanceof t7)for(var i=arguments[0],n=i.getCoordinates(),o=0;o<n.length;o++){var a=new r$(n[o],this._scaleFactor,this._li);this._pointSnapper.snap(a,i,o)&&i.addIntersection(n[o],o)}},rJ.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new rs,this._pointSnapper=new rZ(this._noder.getIndex()),this.snapRound(e,this._li)},rJ.prototype.computeIntersectionSnaps=function(e){for(var r=e.iterator();r.hasNext();){var i=new r$(r.next(),this._scaleFactor,this._li);this._pointSnapper.snap(i)}},rJ.prototype.interfaces_=function(){return[ro]},rJ.prototype.getClass=function(){return rJ};var r0=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new ru,this._resultGeometry=null,this._saveException=null,1==arguments.length){var e=arguments[0];this._argGeom=e}else if(2==arguments.length){var r=arguments[0],i=arguments[1];this._argGeom=r,this._bufParams=i}},r1={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};r0.prototype.bufferFixedPrecision=function(e){var r=new rG(new rJ(new tu(1)),e.getScale()),i=new rV(this._bufParams);i.setWorkingPrecisionModel(e),i.setNoder(r),this._resultGeometry=i.buffer(this._argGeom,this._distance)},r0.prototype.bufferReducedPrecision=function(){if(0==arguments.length){for(var e=r0.MAX_PRECISION_DIGITS;e>=0;e--){try{this.bufferReducedPrecision(e)}catch(e){if(!(e instanceof tS))throw e;this._saveException=e}if(null!==this._resultGeometry)return null}throw this._saveException}if(1==arguments.length){var r=arguments[0],i=new tu(r0.precisionScaleFactor(this._argGeom,this._distance,r));this.bufferFixedPrecision(i)}},r0.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===tu.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},r0.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},r0.prototype.bufferOriginalPrecision=function(){try{var e=new rV(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(e){if(!(e instanceof eo))throw e;this._saveException=e}},r0.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},r0.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},r0.prototype.interfaces_=function(){return[]},r0.prototype.getClass=function(){return r0},r0.bufferOp=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];return new r0(e).getResultGeometry(r)}if(3==arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof eg&&"number"==typeof arguments[1]){var i=arguments[0],n=arguments[1],o=arguments[2],a=new r0(i);return a.setQuadrantSegments(o),a.getResultGeometry(n)}
113if(arguments[2]instanceof ru&&arguments[0]instanceof eg&&"number"==typeof arguments[1]){var s=arguments[0],l=arguments[1],u=arguments[2];return new r0(s,u).getResultGeometry(l)}}else if(4==arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],d=arguments[3],f=new r0(c);return f.setQuadrantSegments(p),f.setEndCapStyle(d),f.getResultGeometry(h)}},r0.precisionScaleFactor=function(e,r,i){var n=e.getEnvelopeInternal();return Math.pow(10,i-Math.trunc(Math.log(O.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(r>0?r:0))/Math.log(10)+1))},r1.CAP_ROUND.get=function(){return ru.CAP_ROUND},r1.CAP_BUTT.get=function(){return ru.CAP_FLAT},r1.CAP_FLAT.get=function(){return ru.CAP_FLAT},r1.CAP_SQUARE.get=function(){return ru.CAP_SQUARE},r1.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(r0,r1);var r2=function(){this._pt=[new T,new T],this._distance=x.NaN,this._isNull=!0};r2.prototype.getCoordinates=function(){return this._pt},r2.prototype.getCoordinate=function(e){return this._pt[e]},r2.prototype.setMinimum=function(){if(1==arguments.length){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(2==arguments.length){var r=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(r,i),null;var n=r.distance(i);n<this._distance&&this.initialize(r,i,n)}},r2.prototype.initialize=function(){if(0==arguments.length)this._isNull=!0;else if(2==arguments.length){var e=arguments[0],r=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(r),this._distance=e.distance(r),this._isNull=!1}else if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=o,this._isNull=!1}},r2.prototype.getDistance=function(){return this._distance},r2.prototype.setMaximum=function(){if(1==arguments.length){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(2==arguments.length){var r=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(r,i),null;var n=r.distance(i);n>this._distance&&this.initialize(r,i,n)}},r2.prototype.interfaces_=function(){return[]},r2.prototype.getClass=function(){return r2};var r3=function(){};r3.prototype.interfaces_=function(){return[]},r3.prototype.getClass=function(){return r3},r3.computeDistance=function(){if(arguments[2]instanceof r2&&arguments[0]instanceof e1&&arguments[1]instanceof T)for(var e=arguments[0],r=arguments[1],i=arguments[2],n=e.getCoordinates(),o=new re,a=0;a<n.length-1;a++){o.setCoordinates(n[a],n[a+1]);var s=o.closestPoint(r);i.setMinimum(s,r)}else if(arguments[2]instanceof r2&&arguments[0]instanceof e4&&arguments[1]instanceof T){var l=arguments[0],u=arguments[1],c=arguments[2];r3.computeDistance(l.getExteriorRing(),u,c);for(var h=0;h<l.getNumInteriorRing();h++)r3.computeDistance(l.getInteriorRingN(h),u,c)}else if(arguments[2]instanceof r2&&arguments[0]instanceof eg&&arguments[1]instanceof T){var p=arguments[0],d=arguments[1],f=arguments[2];if(p instanceof e1)r3.computeDistance(p,d,f);else if(p instanceof e4)r3.computeDistance(p,d,f);else if(p instanceof eY)for(var m=0;m<p.getNumGeometries();m++){var g=p.getGeometryN(m);r3.computeDistance(g,d,f)}else f.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof r2&&arguments[0]instanceof re&&arguments[1]instanceof T){var _=arguments[0],y=arguments[1],v=arguments[2],x=_.closestPoint(y);v.setMinimum(x,y)}};var r5=function(e){this._maxPtDist=new r2,this._inputGeom=e||null},r4={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};r5.prototype.computeMaxMidpointDistance=function(e){var r=new r8(this._inputGeom);e.apply(r),this._maxPtDist.setMaximum(r.getMaxPointDistance())},r5.prototype.computeMaxVertexDistance=function(e){var r=new r6(this._inputGeom);e.apply(r),this._maxPtDist.setMaximum(r.getMaxPointDistance())},r5.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()},r5.prototype.getDistancePoints=function(){return this._maxPtDist},r5.prototype.interfaces_=function(){return[]},r5.prototype.getClass=function(){return r5},r4.MaxPointDistanceFilter.get=function(){return r6},r4.MaxMidpointDistanceFilter.get=function(){return r8},Object.defineProperties(r5,r4);var r6=function(e){this._maxPtDist=new r2,this._minPtDist=new r2,this._geom=e||null};r6.prototype.filter=function(e){this._minPtDist.initialize(),r3.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},r6.prototype.getMaxPointDistance=function(){return this._maxPtDist},r6.prototype.interfaces_=function(){return[ev]},r6.prototype.getClass=function(){return r6};var r8=function(e){this._maxPtDist=new r2,this._minPtDist=new r2,this._geom=e||null};r8.prototype.filter=function(e,r){if(0===r)return null;var i=e.getCoordinate(r-1),n=e.getCoordinate(r),o=new T((i.x+n.x)/2,(i.y+n.y)/2);this._minPtDist.initialize(),r3.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},r8.prototype.isDone=function(){return!1},r8.prototype.isGeometryChanged=function(){return!1},r8.prototype.getMaxPointDistance=function(){return this._maxPtDist},r8.prototype.interfaces_=function(){return[eW]},r8.prototype.getClass=function(){return r8};var r9=function(e){this._comps=e||null};r9.prototype.filter=function(e){e instanceof e4&&this._comps.add(e)},r9.prototype.interfaces_=function(){return[e$]},r9.prototype.getClass=function(){return r9},r9.getPolygons=function(){if(1==arguments.length){var e=arguments[0];return r9.getPolygons(e,new eA)}if(2==arguments.length){var r=arguments[0],i=arguments[1];return r instanceof e4?i.add(r):r instanceof eY&&r.apply(new r9(i)),i}};var r7=function(){if(this._lines=null,this._isForcedToLineString=!1,1==arguments.length){var e=arguments[0];this._lines=e}else if(2==arguments.length){var r=arguments[0],i=arguments[1];this._lines=r,this._isForcedToLineString=i}};r7.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof e8){var r=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(r),null}e instanceof e1&&this._lines.add(e)},r7.prototype.setForceToLineString=function(e){this._isForcedToLineString=e},r7.prototype.interfaces_=function(){return[em]},r7.prototype.getClass=function(){return r7},r7.getGeometry=function(){if(1==arguments.length){var e=arguments[0];return e.getFactory().buildGeometry(r7.getLines(e))}if(2==arguments.length){var r=arguments[0],i=arguments[1];return r.getFactory().buildGeometry(r7.getLines(r,i))}},r7.getLines=function(){if(1==arguments.length){var e=arguments[0];return r7.getLines(e,!1)}if(2==arguments.length){if(L(arguments[0],eI)&&L(arguments[1],eI)){for(var r=arguments[0],i=arguments[1],n=r.iterator();n.hasNext();){var o=n.next();r7.getLines(o,i)}return i}if(arguments[0]instanceof eg&&"boolean"==typeof arguments[1]){var a=arguments[0],s=arguments[1],l=new eA;return a.apply(new r7(l,s)),l}if(arguments[0]instanceof eg&&L(arguments[1],eI)){var u=arguments[0],c=arguments[1];return u instanceof e1?c.add(u):u.apply(new r7(c)),c}}else if(3==arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],eI)&&L(arguments[1],eI)){for(var h=arguments[0],p=arguments[1],d=arguments[2],f=h.iterator();f.hasNext();){var m=f.next();r7.getLines(m,p,d)}return p}if("boolean"==typeof arguments[2]&&arguments[0]instanceof eg&&L(arguments[1],eI)){var g=arguments[0],_=arguments[1],y=arguments[2];return g.apply(new r7(_,y)),_}}};var ie=function(){if(this._boundaryRule=ex.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0==arguments.length);else if(1==arguments.length){var e=arguments[0];if(null===e)throw new v("Rule must be non-null");this._boundaryRule=e}};ie.prototype.locateInternal=function(){if(arguments[0]instanceof T&&arguments[1]instanceof e4){var e=arguments[0],r=arguments[1];if(r.isEmpty())return A.EXTERIOR;var i=r.getExteriorRing(),n=this.locateInPolygonRing(e,i);if(n===A.EXTERIOR)return A.EXTERIOR;if(n===A.BOUNDARY)return A.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var a=r.getInteriorRingN(o),s=this.locateInPolygonRing(e,a);if(s===A.INTERIOR)return A.EXTERIOR;if(s===A.BOUNDARY)return A.BOUNDARY}return A.INTERIOR}if(arguments[0]instanceof T&&arguments[1]instanceof e1){var l=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(l))return A.EXTERIOR;var c=u.getCoordinates();return!u.isClosed()&&(l.equals(c[0])||l.equals(c[c.length-1]))?A.BOUNDARY:ed.isOnLine(l,c)?A.INTERIOR:A.EXTERIOR}if(arguments[0]instanceof T&&arguments[1]instanceof e3){var h=arguments[0];return arguments[1].getCoordinate().equals2D(h)?A.INTERIOR:A.EXTERIOR}},ie.prototype.locateInPolygonRing=function(e,r){return r.getEnvelopeInternal().intersects(e)?ed.locatePointInRing(e,r.getCoordinates()):A.EXTERIOR},ie.prototype.intersects=function(e,r){return this.locate(e,r)!==A.EXTERIOR},ie.prototype.updateLocationInfo=function(e){e===A.INTERIOR&&(this._isIn=!0),e===A.BOUNDARY&&this._numBoundaries++},ie.prototype.computeLocation=function(e,r){if(r instanceof e3&&this.updateLocationInfo(this.locateInternal(e,r)),r instanceof e1)this.updateLocationInfo(this.locateInternal(e,r));else if(r instanceof e4)this.updateLocationInfo(this.locateInternal(e,r));else if(r instanceof eZ)for(var i=0;i<r.getNumGeometries();i++){var n=r.getGeometryN(i);this.updateLocationInfo(this.locateInternal(e,n))}else if(r instanceof e9)for(var o=0;o<r.getNumGeometries();o++){var a=r.getGeometryN(o);this.updateLocationInfo(this.locateInternal(e,a))}else if(r instanceof eY)for(var s=new rI(r);s.hasNext();){var l=s.next();l!==r&&this.computeLocation(e,l)}}
113,ie.prototype.locate=function(e,r){return r.isEmpty()?A.EXTERIOR:r instanceof e1||r instanceof e4?this.locateInternal(e,r):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,r),this._boundaryRule.isInBoundary(this._numBoundaries)?A.BOUNDARY:this._numBoundaries>0||this._isIn?A.INTERIOR:A.EXTERIOR)},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie};var it=function e(){if(this._component=null,this._segIndex=null,this._pt=null,2==arguments.length){var r=arguments[0],i=arguments[1];e.call(this,r,e.INSIDE_AREA,i)}else if(3==arguments.length){var n=arguments[0],o=arguments[1],a=arguments[2];this._component=n,this._segIndex=o,this._pt=a}},ir={INSIDE_AREA:{configurable:!0}};it.prototype.isInsideArea=function(){return this._segIndex===it.INSIDE_AREA},it.prototype.getCoordinate=function(){return this._pt},it.prototype.getGeometryComponent=function(){return this._component},it.prototype.getSegmentIndex=function(){return this._segIndex},it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it},ir.INSIDE_AREA.get=function(){return -1},Object.defineProperties(it,ir);var ii=function(e){this._pts=e||null};ii.prototype.filter=function(e){e instanceof e3&&this._pts.add(e)},ii.prototype.interfaces_=function(){return[e$]},ii.prototype.getClass=function(){return ii},ii.getPoints=function(){if(1==arguments.length){var e=arguments[0];return e instanceof e3?tZ.singletonList(e):ii.getPoints(e,new eA)}if(2==arguments.length){var r=arguments[0],i=arguments[1];return r instanceof e3?i.add(r):r instanceof eY&&r.apply(new ii(i)),i}};var io=function(){this._locations=null;var e=arguments[0];this._locations=e};io.prototype.filter=function(e){(e instanceof e3||e instanceof e1||e instanceof e4)&&this._locations.add(new it(e,0,e.getCoordinate()))},io.prototype.interfaces_=function(){return[e$]},io.prototype.getClass=function(){return io},io.getLocations=function(e){var r=new eA;return e.apply(new io(r)),r};var ia=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new ie,this._minDistanceLocation=null,this._minDistance=x.MAX_VALUE,2==arguments.length){var e=arguments[0],r=arguments[1];this._geom=[e,r],this._terminateDistance=0}else if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2];this._geom=[,,].fill(null),this._geom[0]=i,this._geom[1]=n,this._terminateDistance=o}};ia.prototype.computeContainmentDistance=function(){if(0==arguments.length){var e=[,,].fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2==arguments.length){var r=arguments[0],i=arguments[1],n=1-r,o=r9.getPolygons(this._geom[r]);if(o.size()>0){var a=io.getLocations(this._geom[n]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(3==arguments.length){if(arguments[2]instanceof Array&&L(arguments[0],eC)&&L(arguments[1],eC)){for(var s=arguments[0],l=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var h=s.get(c),p=0;p<l.size();p++)if(this.computeContainmentDistance(h,l.get(p),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof it&&arguments[1]instanceof e4){var d=arguments[0],f=arguments[1],m=arguments[2],g=d.getCoordinate();if(A.EXTERIOR!==this._ptLocator.locate(g,f))return this._minDistance=0,m[0]=d,m[1]=new it(f,g),null}}},ia.prototype.computeMinDistanceLinesPoints=function(e,r,i){for(var n=0;n<e.size();n++)for(var o=e.get(n),a=0;a<r.size();a++){var s=r.get(a);if(this.computeMinDistance(o,s,i),this._minDistance<=this._terminateDistance)return null}},ia.prototype.computeFacetDistance=function(){var e=[,,].fill(null),r=r7.getLines(this._geom[0]),i=r7.getLines(this._geom[1]),n=ii.getPoints(this._geom[0]),o=ii.getPoints(this._geom[1]);return this.computeMinDistanceLines(r,i,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(r,o,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(i,n,e),this.updateMinDistance(e,!0),this._minDistance<=this._terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistancePoints(n,o,e),void this.updateMinDistance(e,!1))
113))},ia.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},ia.prototype.updateMinDistance=function(e,r){if(null===e[0])return null;r?(this._minDistanceLocation[0]=e[1],this._minDistanceLocation[1]=e[0]):(this._minDistanceLocation[0]=e[0],this._minDistanceLocation[1]=e[1])},ia.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},ia.prototype.computeMinDistance=function(){if(0==arguments.length){if(null!==this._minDistanceLocation||(this._minDistanceLocation=[,,].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 e1&&arguments[1]instanceof e3){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var n=e.getCoordinates(),o=r.getCoordinate(),a=0;a<n.length-1;a++){var s=ed.distancePointLine(o,n[a],n[a+1]);if(s<this._minDistance){this._minDistance=s;var l=new re(n[a],n[a+1]).closestPoint(o);i[0]=new it(e,a,l),i[1]=new it(r,0,o)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof e1&&arguments[1]instanceof e1){var u=arguments[0],c=arguments[1],h=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var p=u.getCoordinates(),d=c.getCoordinates(),f=0;f<p.length-1;f++)for(var m=0;m<d.length-1;m++){var g=ed.distanceLineLine(p[f],p[f+1],d[m],d[m+1]);if(g<this._minDistance){this._minDistance=g;var _=new re(p[f],p[f+1]),y=new re(d[m],d[m+1]),v=_.closestPoints(y);h[0]=new it(u,f,v[0]),h[1]=new it(c,m,v[1])}if(this._minDistance<=this._terminateDistance)return null}}}},ia.prototype.computeMinDistancePoints=function(e,r,i){for(var n=0;n<e.size();n++)for(var o=e.get(n),a=0;a<r.size();a++){var s=r.get(a),l=o.getCoordinate().distance(s.getCoordinate());if(l<this._minDistance&&(this._minDistance=l,i[0]=new it(o,0,o.getCoordinate()),i[1]=new it(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},ia.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new v("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},ia.prototype.computeMinDistanceLines=function(e,r,i){for(var n=0;n<e.size();n++)for(var o=e.get(n),a=0;a<r.size();a++){var s=r.get(a);if(this.computeMinDistance(o,s,i),this._minDistance<=this._terminateDistance)return null}},ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia},ia.distance=function(e,r){return new ia(e,r).distance()},ia.isWithinDistance=function(e,r,i){return new ia(e,r,i).distance()<=i},ia.nearestPoints=function(e,r){return new ia(e,r).nearestPoints()};var is=function(){this._pt=[new T,new T],this._distance=x.NaN,this._isNull=!0};is.prototype.getCoordinates=function(){return this._pt},is.prototype.getCoordinate=function(e){return this._pt[e]},is.prototype.setMinimum=function(){if(1==arguments.length){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(2==arguments.length){var r=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(r,i),null;var n=r.distance(i);n<this._distance&&this.initialize(r,i,n)}},is.prototype.initialize=function(){if(0==arguments.length)this._isNull=!0;else if(2==arguments.length){var e=arguments[0],r=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(r),this._distance=e.distance(r),this._isNull=!1}else if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=o,this._isNull=!1}},is.prototype.toString=function(){return en.toLineString(this._pt[0],this._pt[1])},is.prototype.getDistance=function(){return this._distance},is.prototype.setMaximum=function(){if(1==arguments.length){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(2==arguments.length){var r=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(r,i),null;var n=r.distance(i);n>this._distance&&this.initialize(r,i,n)}},is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is};var il=function(){};il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il},il.computeDistance=function(){if(arguments[2]instanceof is&&arguments[0]instanceof e1&&arguments[1]instanceof T)for(var e=arguments[0],r=arguments[1],i=arguments[2],n=new re,o=e.getCoordinates(),a=0;a<o.length-1;
113a++){n.setCoordinates(o[a],o[a+1]);var s=n.closestPoint(r);i.setMinimum(s,r)}else if(arguments[2]instanceof is&&arguments[0]instanceof e4&&arguments[1]instanceof T){var l=arguments[0],u=arguments[1],c=arguments[2];il.computeDistance(l.getExteriorRing(),u,c);for(var h=0;h<l.getNumInteriorRing();h++)il.computeDistance(l.getInteriorRingN(h),u,c)}else if(arguments[2]instanceof is&&arguments[0]instanceof eg&&arguments[1]instanceof T){var p=arguments[0],d=arguments[1],f=arguments[2];if(p instanceof e1)il.computeDistance(p,d,f);else if(p instanceof e4)il.computeDistance(p,d,f);else if(p instanceof eY)for(var m=0;m<p.getNumGeometries();m++){var g=p.getGeometryN(m);il.computeDistance(g,d,f)}else f.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof is&&arguments[0]instanceof re&&arguments[1]instanceof T){var _=arguments[0],y=arguments[1],v=arguments[2],x=_.closestPoint(y);v.setMinimum(x,y)}};var iu=function(){this._g0=null,this._g1=null,this._ptDist=new is,this._densifyFrac=0;var e=arguments[0],r=arguments[1];this._g0=e,this._g1=r},ic={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};iu.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},iu.prototype.setDensifyFraction=function(e){if(e>1||e<=0)throw new v("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},iu.prototype.compute=function(e,r){this.computeOrientedDistance(e,r,this._ptDist),this.computeOrientedDistance(r,e,this._ptDist)},iu.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},iu.prototype.computeOrientedDistance=function(e,r,i){var n=new ih(r);if(e.apply(n),i.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var o=new ip(r,this._densifyFrac);e.apply(o),i.setMaximum(o.getMaxPointDistance())}},iu.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},iu.prototype.interfaces_=function(){return[]},iu.prototype.getClass=function(){return iu},iu.distance=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];return new iu(e,r).distance()}if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2],a=new iu(i,n);return a.setDensifyFraction(o),a.distance()}},ic.MaxPointDistanceFilter.get=function(){return ih},ic.MaxDensifiedByFractionDistanceFilter.get=function(){return ip},Object.defineProperties(iu,ic);var ih=function(){this._maxPtDist=new is,this._minPtDist=new is,this._euclideanDist=new il,this._geom=null;var e=arguments[0];this._geom=e};ih.prototype.filter=function(e){this._minPtDist.initialize(),il.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ih.prototype.getMaxPointDistance=function(){return this._maxPtDist},ih.prototype.interfaces_=function(){return[ev]},ih.prototype.getClass=function(){return ih};var ip=function(){this._maxPtDist=new is,this._minPtDist=new is,this._geom=null,this._numSubSegs=0;var e=arguments[0],r=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/r))};ip.prototype.filter=function(e,r){if(0===r)return null;for(var i=e.getCoordinate(r-1),n=e.getCoordinate(r),o=(n.x-i.x)/this._numSubSegs,a=(n.y-i.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var l=new T(i.x+s*o,i.y+s*a);this._minPtDist.initialize(),il.computeDistance(this._geom,l,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},ip.prototype.isDone=function(){return!1},ip.prototype.isGeometryChanged=function(){return!1},ip.prototype.getMaxPointDistance=function(){return this._maxPtDist},ip.prototype.interfaces_=function(){return[eW]},ip.prototype.getClass=function(){return ip};var id=function(e,r,i){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=e||null,this._bufDistance=r||null,this._result=i||null},im={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};id.prototype.checkMaximumDistance=function(e,r,i){var n=new iu(r,e);if(n.setDensifyFraction(.25),this._maxDistanceFound=n.orientedDistance(),this._maxDistanceFound>i){this._isValid=!1;var o=n.getCoordinates();this._errorLocation=o[1],this._errorIndicator=e.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+en.toLineString(o[0],o[1])+")"}},id.prototype.isValid=function(){var e=Math.abs(this._bufDistance),r=id.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-r,this._maxValidDistance=e+r,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),id.VERBOSE&&H.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},id.prototype.checkNegativeValid=function(){if(!(this._input instanceof e4||this._input instanceof e9||this._input instanceof eY))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)},id.prototype.getErrorIndicator=function(){return this._errorIndicator},id.prototype.checkMinimumDistance=function(e,r,i){var n=new ia(e,r,i
113);if(this._minDistanceFound=n.distance(),this._minDistanceFound<i){this._isValid=!1;var o=n.nearestPoints();this._errorLocation=n.nearestPoints()[1],this._errorIndicator=e.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+en.toLineString(o[0],o[1])+" )"}},id.prototype.checkPositiveValid=function(){var e=this._result.getBoundary();if(this.checkMinimumDistance(this._input,e,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,e,this._maxValidDistance)},id.prototype.getErrorLocation=function(){return this._errorLocation},id.prototype.getPolygonLines=function(e){for(var r=new eA,i=new r7(r),n=r9.getPolygons(e).iterator();n.hasNext();)n.next().apply(i);return e.getFactory().buildGeometry(r)},id.prototype.getErrorMessage=function(){return this._errMsg},id.prototype.interfaces_=function(){return[]},id.prototype.getClass=function(){return id},im.VERBOSE.get=function(){return!1},im.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(id,im);var ig=function(e,r,i){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=r||null,this._result=i||null},i_={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};ig.prototype.isValid=function(){return this.checkPolygonal(),this._isValid&&(this.checkExpectedEmpty(),this._isValid&&(this.checkEnvelope(),this._isValid&&(this.checkArea(),this._isValid&&this.checkDistance()))),this._isValid},ig.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*ig.MAX_ENV_DIFF_FRAC;0===e&&(e=.001);var r=new W(this._input.getEnvelopeInternal());r.expandBy(this._distance);var i=new W(this._result.getEnvelopeInternal());i.expandBy(e),i.contains(r)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(i)),this.report("Envelope")},ig.prototype.checkDistance=function(){var e=new id(this._input,this._distance,this._result);e.isValid()||(this._isValid=!1,this._errorMsg=e.getErrorMessage(),this._errorLocation=e.getErrorLocation(),this._errorIndicator=e.getErrorIndicator()),this.report("Distance")},ig.prototype.checkArea=function(){var e=this._input.getArea(),r=this._result.getArea();this._distance>0&&e>r&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e<r&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},ig.prototype.checkPolygonal=function(){this._result instanceof e4||this._result instanceof e9||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},ig.prototype.getErrorIndicator=function(){return this._errorIndicator},ig.prototype.getErrorLocation=function(){return this._errorLocation},ig.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"))},ig.prototype.report=function(e){if(!ig.VERBOSE)return null;H.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},ig.prototype.getErrorMessage=function(){return this._errorMsg},ig.prototype.interfaces_=function(){return[]},ig.prototype.getClass=function(){return ig},ig.isValidMsg=function(e,r,i){var n=new ig(e,r,i);return n.isValid()?null:n.getErrorMessage()},ig.isValid=function(e,r,i){return!!new ig(e,r,i).isValid()},i_.VERBOSE.get=function(){return!1},i_.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(ig,i_);var iy=function(){this._pts=null,this._data=null;var e=arguments[0],r=arguments[1];this._pts=e,this._data=r};iy.prototype.getCoordinates=function(){return this._pts},iy.prototype.size=function(){return this._pts.length},iy.prototype.getCoordinate=function(e){return this._pts[e]},iy.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},iy.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:t6.octant(this.getCoordinate(e),this.getCoordinate(e+1))},iy.prototype.setData=function(e){this._data=e},iy.prototype.getData=function(){return this._data},iy.prototype.toString=function(){return en.toLineString(new tn(this._pts))},iy.prototype.interfaces_=function(){return[t8]},iy.prototype.getClass=function(){return iy};var iv=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new eA,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};iv.prototype.getInteriorIntersection=function(){return this._interiorIntersection},iv.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},iv.prototype.getIntersectionSegments=function(){return this._intSegments},iv.prototype.count=function(){return this._intersectionCount},iv.prototype.getIntersections=function(){return this._intersections},iv.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},iv.prototype.setKeepIntersections=function(e){this._keepIntersections=e},iv.prototype.processIntersections=function(e,r,i,n){if(!this._findAllIntersections&&this.hasIntersection()||e===i&&r===n||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(e,r)||this.isEndSegment(i,n)))return null;var o=e.getCoordinates()[r],a=e.getCoordinates()[r+1],s=i.getCoordinates()[n],l=i.getCoordinates()[n+1];this._li.computeIntersection(o,a,s,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=[,,,,].fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=s,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},iv.prototype.isEndSegment=function(e,r){return 0===r||r>=e.size()-2},iv.prototype.hasIntersection=function(){return null!==this._interiorIntersection},iv.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},iv.prototype.interfaces_=function(){return[rD]},iv.prototype.getClass=function(){return iv},iv.createAllIntersectionsFinder=function(e){var r=new iv(e);return r.setFindAllIntersections(!0),r},iv.createAnyIntersectionFinder=function(e){return new iv(e)},iv.createIntersectionCounter=function(e){var r=new iv(e);return r.setFindAllIntersections(!0),r.setKeepIntersections(!1),r};var ix=function(){this._li=new ec,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};ix.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},ix.prototype.getIntersections=function(){return this._segInt.getIntersections()},ix.prototype.isValid=function(){return this.execute(),this._isValid},ix.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},ix.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new iv(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new rs;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},ix.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new tS(this.getErrorMessage(),this._segInt.getInteriorIntersection())},ix.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections foun
113d";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+en.toLineString(e[0],e[1])+" and "+en.toLineString(e[2],e[3])},ix.prototype.interfaces_=function(){return[]},ix.prototype.getClass=function(){return ix},ix.computeIntersections=function(e){var r=new ix(e);return r.setFindAllIntersections(!0),r.isValid(),r.getIntersections()};var ib=function e(){this._nv=null;var r=arguments[0];this._nv=new ix(e.toSegmentStrings(r))};ib.prototype.checkValid=function(){this._nv.checkValid()},ib.prototype.interfaces_=function(){return[]},ib.prototype.getClass=function(){return ib},ib.toSegmentStrings=function(e){for(var r=new eA,i=e.iterator();i.hasNext();){var n=i.next();r.add(new iy(n.getCoordinates(),n))}return r},ib.checkValid=function(e){new ib(e).checkValid()};var iw=function(e){this._mapOp=e};iw.prototype.map=function(e){for(var r=new eA,i=0;i<e.getNumGeometries();i++){var n=this._mapOp.map(e.getGeometryN(i));n.isEmpty()||r.add(n)}return e.getFactory().createGeometryCollection(td.toGeometryArray(r))},iw.prototype.interfaces_=function(){return[]},iw.prototype.getClass=function(){return iw},iw.map=function(e,r){return new iw(r).map(e)};var iE=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new eA,this._resultLineList=new eA;var e=arguments[0],r=arguments[1],i=arguments[2];this._op=e,this._geometryFactory=r,this._ptLocator=i};iE.prototype.collectLines=function(e){for(var r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();this.collectLineEdge(i,e,this._lineEdgesList),this.collectBoundaryTouchEdge(i,e,this._lineEdgesList)}},iE.prototype.labelIsolatedLine=function(e,r){var i=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(r));e.getLabel().setLocation(r,i)},iE.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList},iE.prototype.collectLineEdge=function(e,r,i){var n=e.getLabel(),o=e.getEdge();e.isLineEdge()&&(e.isVisited()||!i3.isResultOfOp(n,r)||o.isCovered()||(i.add(o),e.setVisitedEdge(!0)))},iE.prototype.findCoveredLineEdges=function(){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();)e.next().getEdges().findCoveredLineEdges();for(var r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next(),n=i.getEdge();if(i.isLineEdge()&&!n.isCoveredSet()){var o=this._op.isCoveredByA(i.getCoordinate());n.setCovered(o)}}},iE.prototype.labelIsolatedLines=function(e){for(var r=e.iterator();r.hasNext();){var i=r.next(),n=i.getLabel();i.isIsolated()&&(n.isNull(0)?this.labelIsolatedLine(i,0):this.labelIsolatedLine(i,1))}},iE.prototype.buildLines=function(e){for(var r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),n=this._geometryFactory.createLineString(i.getCoordinates());this._resultLineList.add(n),i.setInResult(!0)}},iE.prototype.collectBoundaryTouchEdge=function(e,r,i){var n=e.getLabel();return e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult()?null:(es.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),void(i3.isResultOfOp(n,r)&&r===i3.INTERSECTION&&(i.add(e.getEdge()),e.setVisitedEdge(!0))))},iE.prototype.interfaces_=function(){return[]},iE.prototype.getClass=function(){return iE};var iS=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new eA;var e=arguments[0],r=arguments[1];this._op=e,this._geometryFactory=r};iS.prototype.filterCoveredNodeToPoint=function(e){var r=e.getCoordinate();if(!this._op.isCoveredByLA(r)){var i=this._geometryFactory.createPoint(r);this._resultPointList.add(i)}},iS.prototype.extractNonCoveredResultNodes=function(e){for(var r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(0===i.getEdges().getDegree()||e===i3.INTERSECTION)){var n=i.getLabel();i3.isResultOfOp(n,e)&&this.filterCoveredNodeToPoint(i)}}},iS.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList},iS.prototype.interfaces_=function(){return[]},iS.prototype.getClass=function(){return iS};var iT=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};iT.prototype.transformPoint=function(e,r){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},iT.prototype.transformPolygon=function(e,r){var i=!0,n=this.transformLinearRing(e.getExteriorRing(),e);null!==n&&n instanceof e8&&!n.isEmpty()||(i=!1);for(var o=new eA,a=0;a<e.getNumInteriorRing();a++){var s=this.transformLinearRing(e.getInteriorRingN(a),e);null===s||s.isEmpty()||(s instanceof e8||(i=!1),o.add(s))}if(i)return this._factory.createPolygon(n,o.toArray([]));var l=new eA;return null!==n&&l.add(n),l.addAll(o),this._factory.buildGeometry(l)},iT.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)},iT.prototype.getInputGeometry=function(){return this._inputGeom},iT.prototype.transformMultiLineString=function(e,r){for(var i=new eA,n=0;n<e.getNumGeometries();n++){var o=this.transformLineString(e.getGeometryN(n),e);null!==o&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},iT.prototype.transformCoordinates=function(e,r){return this.copy(e)},iT.prototype.transformLineString=function(e,r){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},iT.prototype.transformMultiPoint=function(e,r){for(var i=new eA,n=0;n<e.getNumGeometries();n++){var o=this.transformPoint(e.getGeometryN(n),e);null!==o&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},iT.prototype.transformMultiPolygon=function(e,r){for(var i=new eA,n=0;n<e.getNumGeometries();n++){var o=this.transformPolygon(e.getGeometryN(n),e);null!==o&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},iT.prototype.copy=function(e){return e.copy()},iT.prototype.transformGeometryCollection=function(e,r){for(var i=new eA,n=0;n<e.getNumGeometries();n++){var o=this.transform(e.getGeometryN(n));null!==o&&(this._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(td.toGeometryArray(i)):this._factory.buildGeometry(i)},iT.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof e3)return this.transformPoint(e,null);if(e instanceof e6)return this.transformMultiPoint(e,null);if(e instanceof e8)return this.transformLinearRing(e,null);if(e instanceof e1)return this.transformLineString(e,null);if(e instanceof eZ)return this.transformMultiLineString(e,null);if(e instanceof e4)return this.transformPolygon(e,null);if(e instanceof e9)return this.transformMultiPolygon(e,null);if(e instanceof eY)return this.transformGeometryCollection(e,null);throw new v("Unknown Geometry subtype: "+e.getClass().getName())},iT.prototype.transformLinearRing=function(e,r){var i=this.transformCoordinates(e.getCoordinateSequence(),e);if(null===i)return this._factory.createLinearRing(null);var n=i.size();return n>0&&n<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)},iT.prototype.interfaces_=function(){return[]},iT.prototype.getClass=function(){return iT};var iI=function e(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new re,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof e1&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];e.call(this,r.getCoordinates(),i)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],o=arguments[1];this._srcPts=n,this._isClosed=e.isClosed(n),this._snapTolerance=o}};iI.prototype.snapVertices=function(e,r){for(var i=this._isClosed?e.size()-1:e.size(),n=0;n<i;n++){var o=e.get(n),a=this.findSnapForVertex(o,r);null!==a&&(e.set(n,new T(a)),0===n&&this._isClosed&&e.set(e.size()-1,new T(a)))}},iI.prototype.findSnapForVertex=function(e,r){for(var i=0;i<r.length&&!e.equals2D(r[i]);i++)if(e.distance(r[i])<this._snapTolerance)return r[i];return null},iI.prototype.snapTo=function(e){var r=new eL(this._srcPts);return this.snapVertices(r,e),this.snapSegments(r,e),r.toCoordinateArray()},iI.prototype.snapSegments=function(e,r){if(0===r.length)return null;var i=r.length;r[0].equals2D(r[r.length-1])&&(i=r.length-1);for(var n=0;n<i;n++){var o=r[n],a=this.findSegmentIndexToSnap(o,e);a>=0&&e.add(a+1,new T(o),!1)}},iI.prototype.findSegmentIndexToSnap=function(e,r){for(var i=x.MAX_VALUE,n=-1,o=0;o<r.size()-1;o++){if(this._seg.p0=r.get(o),this._seg.p1=r.get(o+1),this._seg.p0.equals2D(e)||this._seg.p1.equals2D(e)){
113if(this._allowSnappingToSourceVertices)continue;return -1}var a=this._seg.distance(e);a<this._snapTolerance&&a<i&&(i=a,n=o)}return n},iI.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e},iI.prototype.interfaces_=function(){return[]},iI.prototype.getClass=function(){return iI},iI.isClosed=function(e){return!(e.length<=1)&&e[0].equals2D(e[e.length-1])};var iM=function(e){this._srcGeom=e||null},iC={SNAP_PRECISION_FACTOR:{configurable:!0}};iM.prototype.snapTo=function(e,r){return new iA(r,this.extractTargetCoordinates(e)).transform(this._srcGeom)},iM.prototype.snapToSelf=function(e,r){var i=new iA(e,this.extractTargetCoordinates(this._srcGeom),!0).transform(this._srcGeom),n=i;return r&&L(n,e5)&&(n=i.buffer(0)),n},iM.prototype.computeSnapTolerance=function(e){return this.computeMinimumSegmentLength(e)/10},iM.prototype.extractTargetCoordinates=function(e){for(var r=new f,i=e.getCoordinates(),n=0;n<i.length;n++)r.add(i[n]);return r.toArray([].fill(null))},iM.prototype.computeMinimumSegmentLength=function(e){for(var r=x.MAX_VALUE,i=0;i<e.length-1;i++){var n=e[i].distance(e[i+1]);n<r&&(r=n)}return r},iM.prototype.interfaces_=function(){return[]},iM.prototype.getClass=function(){return iM},iM.snap=function(e,r,i){var n=[,,].fill(null),o=new iM(e);n[0]=o.snapTo(r,i);var a=new iM(r);return n[1]=a.snapTo(n[0],i),n},iM.computeOverlaySnapTolerance=function(){if(1==arguments.length){var e=arguments[0],r=iM.computeSizeBasedSnapTolerance(e),i=e.getPrecisionModel();if(i.getType()===tu.FIXED){var n=1/i.getScale()*2/1.415;n>r&&(r=n)}return r}if(2==arguments.length){var o=arguments[0],a=arguments[1];return Math.min(iM.computeOverlaySnapTolerance(o),iM.computeOverlaySnapTolerance(a))}},iM.computeSizeBasedSnapTolerance=function(e){var r=e.getEnvelopeInternal();return Math.min(r.getHeight(),r.getWidth())*iM.SNAP_PRECISION_FACTOR},iM.snapToSelf=function(e,r,i){return new iM(e).snapToSelf(r,i)},iC.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(iM,iC);var iA=function(e){function r(r,i,n){e.call(this),this._snapTolerance=r||null,this._snapPts=i||null,this._isSelfSnap=void 0!==n&&n}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.snapLine=function(e,r){var i=new iI(e,this._snapTolerance);return i.setAllowSnappingToSourceVertices(this._isSelfSnap),i.snapTo(r)},r.prototype.transformCoordinates=function(e,r){var i=e.toCoordinateArray(),n=this.snapLine(i,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(n)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(iT),iP=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};iP.prototype.getCommon=function(){return x.longBitsToDouble(this._commonBits)},iP.prototype.add=function(e){var r=x.doubleToLongBits(e);return this._isFirst?(this._commonBits=r,this._commonSignExp=iP.signExpBits(this._commonBits),this._isFirst=!1,null):iP.signExpBits(r)!==this._commonSignExp?(this._commonBits=0,null):void(this._commonMantissaBitsCount=iP.numCommonMostSigMantissaBits(this._commonBits,r),this._commonBits=iP.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount)))},iP.prototype.toString=function(){if(1==arguments.length){var e=arguments[0],r=x.longBitsToDouble(e),i="0000000000000000000000000000000000000000000000000000000000000000"+x.toBinaryString(e),n=i.substring(i.length-64);return n.substring(0,1)+"  "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+r+" ]"}},iP.prototype.interfaces_=function(){return[]},iP.prototype.getClass=function(){return iP},iP.getBit=function(e,r){return+(0!=(e&1<<r))},iP.signExpBits=function(e){return e>>52},iP.zeroLowerBits=function(e,r){return e&~((1<<r)-1)},iP.numCommonMostSigMantissaBits=function(e,r){for(var i=0,n=52;n>=0;n--){if(iP.getBit(e,n)!==iP.getBit(r,n))return i;i++}return 52};var iL=function(){this._commonCoord=null,this._ccFilter=new iD},iO={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};iL.prototype.addCommonBits=function(e){var r=new iR(this._commonCoord);e.apply(r),e.geometryChanged()},iL.prototype.removeCommonBits=function(e){if(0===this._commonCoord.x&&0===this._commonCoord.y)return e;var r=new T(this._commonCoord);r.x=-r.x,r.y=-r.y;var i=new iR(r);return e.apply(i),e.geometryChanged(),e},iL.prototype.getCommonCoordinate=function(){return this._commonCoord},iL.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},iL.prototype.interfaces_=function(){return[]},iL.prototype.getClass=function(){return iL},iO.CommonCoordinateFilter.get=function(){return iD},iO.Translater.get=function(){return iR},Object.defineProperties(iL,iO);var iD=function(){this._commonBitsX=new iP,this._commonBitsY=new iP};iD.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},iD.prototype.getCommonCoordinate=function(){return new T(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},iD.prototype.interfaces_=function(){return[ev]},iD.prototype.getClass=function(){return iD};var iR=function(){this.trans=null;var e=arguments[0];this.trans=e};iR.prototype.filter=function(e,r){var i=e.getOrdinate(r,0)+this.trans.x,n=e.getOrdinate(r,1)+this.trans.y;e.setOrdinate(r,0,i),e.setOrdinate(r,1,n)},iR.prototype.isDone=function(){return!1},iR.prototype.isGeometryChanged=function(){return!0},iR.prototype.interfaces_=function(){return[eW]},iR.prototype.getClass=function(){return iR};var ik=function(e,r){this._geom=[,,].fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=r,this.computeSnapTolerance()};ik.prototype.selfSnap=function(e){return new iM(e).snapTo(e,this._snapTolerance)},ik.prototype.removeCommonBits=function(e){this._cbr=new iL,this._cbr.add(e[0]),this._cbr.add(e[1]);var r=[,,].fill(null);return r[0]=this._cbr.removeCommonBits(e[0].copy()),r[1]=this._cbr.removeCommonBits(e[1].copy()),r},ik.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},ik.prototype.getResultGeometry=function(e){var r=this.snap(this._geom),i=i3.overlayOp(r[0],r[1],e);return this.prepareResult(i)},ik.prototype.checkValid=function(e){e.isValid()||H.out.println("Snapped geometry is invali
113d")},ik.prototype.computeSnapTolerance=function(){this._snapTolerance=iM.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ik.prototype.snap=function(e){var r=this.removeCommonBits(e);return iM.snap(r[0],r[1],this._snapTolerance)},ik.prototype.interfaces_=function(){return[]},ik.prototype.getClass=function(){return ik},ik.overlayOp=function(e,r,i){return new ik(e,r).getResultGeometry(i)},ik.union=function(e,r){return ik.overlayOp(e,r,i3.UNION)},ik.intersection=function(e,r){return ik.overlayOp(e,r,i3.INTERSECTION)},ik.symDifference=function(e,r){return ik.overlayOp(e,r,i3.SYMDIFFERENCE)},ik.difference=function(e,r){return ik.overlayOp(e,r,i3.DIFFERENCE)};var iN=function(e,r){this._geom=[,,].fill(null),this._geom[0]=e,this._geom[1]=r};iN.prototype.getResultGeometry=function(e){var r=null,i=!1,n=null;try{r=i3.overlayOp(this._geom[0],this._geom[1],e),i=!0}catch(e){if(!(e instanceof eo))throw e;n=e}if(!i)try{r=ik.overlayOp(this._geom[0],this._geom[1],e)}catch(e){throw e instanceof eo?n:e}return r},iN.prototype.interfaces_=function(){return[]},iN.prototype.getClass=function(){return iN},iN.overlayOp=function(e,r,i){return new iN(e,r).getResultGeometry(i)},iN.union=function(e,r){return iN.overlayOp(e,r,i3.UNION)},iN.intersection=function(e,r){return iN.overlayOp(e,r,i3.INTERSECTION)},iN.symDifference=function(e,r){return iN.overlayOp(e,r,i3.SYMDIFFERENCE)},iN.difference=function(e,r){return iN.overlayOp(e,r,i3.DIFFERENCE)};var iF=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],r=arguments[1];this.mce=e,this.chainIndex=r};iF.prototype.computeIntersections=function(e,r){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,r)},iF.prototype.interfaces_=function(){return[]},iF.prototype.getClass=function(){return iF};var iz=function e(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2==arguments.length){var r=arguments[0],i=arguments[1];this._eventType=e.DELETE,this._xValue=r,this._insertEvent=i}else if(3==arguments.length){var n=arguments[0],o=arguments[1],a=arguments[2];this._eventType=e.INSERT,this._label=n,this._xValue=o,this._obj=a}},iB={INSERT:{configurable:!0},DELETE:{configurable:!0}};iz.prototype.isDelete=function(){return this._eventType===iz.DELETE},iz.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},iz.prototype.getObject=function(){return this._obj},iz.prototype.compareTo=function(e){return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:+(this._eventType>e._eventType)},iz.prototype.getInsertEvent=function(){return this._insertEvent},iz.prototype.isInsert=function(){return this._eventType===iz.INSERT},iz.prototype.isSameLabel=function(e){return null!==this._label&&this._label===e._label},iz.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},iz.prototype.interfaces_=function(){return[w]},iz.prototype.getClass=function(){return iz},iB.INSERT.get=function(){return 1},iB.DELETE.get=function(){return 2},Object.defineProperties(iz,iB);var iU=function(){};iU.prototype.interfaces_=function(){return[]},iU.prototype.getClass=function(){return iU};var ij=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 e=arguments[0],r=arguments[1],i=arguments[2];this._li=e,this._includeProper=r,this._recordIsolated=i};ij.prototype.isTrivialIntersection=function(e,r,i,n){if(e===i&&1===this._li.getIntersectionNum()){if(ij.isAdjacentSegments(r,n))return!0;if(e.isClosed()){var o=e.getNumPoints()-1;if(0===r&&n===o||0===n&&r===o)return!0}}return!1},ij.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ij.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},ij.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ij.prototype.isBoundaryPointInternal=function(e,r){for(var i=r.iterator();i.hasNext();){var n=i.next().getCoordinate();if(e.isIntersection(n))return!0}return!1},ij.prototype.hasProperIntersection=function(){return this._hasProper},ij.prototype.hasIntersection=function(){return this._hasIntersection},ij.prototype.isDone=function(){return this._isDone},ij.prototype.isBoundaryPoint=function(e,r){return null!==r&&(!!this.isBoundaryPointInternal(e,r[0])||!!this.isBoundaryPointInternal(e,r[1]))},ij.prototype.setBoundaryNodes=function(e,r){this._bdyNodes=[,,].fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=r},ij.prototype.addIntersections=function(e,r,i,n){if(e===i&&r===n)return null;this.numTests++;var o=e.getCoordinates()[r],a=e.getCoordinates()[r+1],s=i.getCoordinates()[n],l=i.getCoordinates()[n+1];this._li.computeIntersection(o,a,s,l),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,r,i,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||
113(e.addIntersections(this._li,r,0),i.addIntersections(this._li,n,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))))},ij.prototype.interfaces_=function(){return[]},ij.prototype.getClass=function(){return ij},ij.isAdjacentSegments=function(e,r){return 1===Math.abs(e-r)};var iV=function(e){function r(){e.call(this),this.events=new eA,this.nOverlaps=null}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.prepareEvents=function(){tZ.sort(this.events);for(var e=0;e<this.events.size();e++){var r=this.events.get(e);r.isDelete()&&r.getInsertEvent().setDeleteEventIndex(e)}},r.prototype.computeIntersections=function(){if(1==arguments.length){var e=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var r=0;r<this.events.size();r++){var i=this.events.get(r);if(i.isInsert()&&this.processOverlaps(r,i.getDeleteEventIndex(),i,e),e.isDone())break}}else if(3==arguments.length){if(arguments[2]instanceof ij&&L(arguments[0],eC)&&L(arguments[1],eC)){var n=arguments[0],o=arguments[1],a=arguments[2];this.addEdges(n,n),this.addEdges(o,o),this.computeIntersections(a)}else if("boolean"==typeof arguments[2]&&L(arguments[0],eC)&&arguments[1]instanceof ij){var s=arguments[0],l=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(l)}}},r.prototype.addEdge=function(e,r){for(var i=e.getMonotoneChainEdge(),n=i.getStartIndexes(),o=0;o<n.length-1;o++){var a=new iF(i,o),s=new iz(r,i.getMinX(o),a);this.events.add(s),this.events.add(new iz(i.getMaxX(o),s))}},r.prototype.processOverlaps=function(e,r,i,n){for(var o=i.getObject(),a=e;a<r;a++){var s=this.events.get(a);if(s.isInsert()){var l=s.getObject();i.isSameLabel(s)||(o.computeIntersections(l,n),this.nOverlaps++)}}},r.prototype.addEdges=function(){if(1==arguments.length)for(var e=arguments[0].iterator();e.hasNext();){var r=e.next();this.addEdge(r,r)}else if(2==arguments.length)for(var i=arguments[0],n=arguments[1],o=i.iterator();o.hasNext();){var a=o.next();this.addEdge(a,n)}},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(iU),iG=function(){this._min=x.POSITIVE_INFINITY,this._max=x.NEGATIVE_INFINITY},iq={NodeComparator:{configurable:!0}};iG.prototype.getMin=function(){return this._min},iG.prototype.intersects=function(e,r){return!(this._min>r||this._max<e)},iG.prototype.getMax=function(){return this._max},iG.prototype.toString=function(){return en.toLineString(new T(this._min,0),new T(this._max,0))},iG.prototype.interfaces_=function(){return[]},iG.prototype.getClass=function(){return iG},iq.NodeComparator.get=function(){return iH},Object.defineProperties(iG,iq);var iH=function(){};iH.prototype.compare=function(e,r){var i=(e._min+e._max)/2,n=(r._min+r._max)/2;return i<n?-1:+(i>n)},iH.prototype.interfaces_=function(){return[S]},iH.prototype.getClass=function(){return iH};var i$=function(e){function r(){e.call(this),this._item=null;var r=arguments[0],i=arguments[1],n=arguments[2];this._min=r,this._max=i,this._item=n}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.query=function(e,r,i){if(!this.intersects(e,r))return null;i.visitItem(this._item)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(iG),iW=function(e){function r(){e.call(this),this._node1=null,this._node2=null;var r=arguments[0],i=arguments[1];this._node1=r,this._node2=i,this.buildExtent(this._node1,this._node2)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.buildExtent=function(e,r){this._min=Math.min(e._min,r._min),this._max=Math.max(e._max,r._max)},r.prototype.query=function(e,r,i){if(!this.intersects(e,r))return null;null!==this._node1&&this._node1.query(e,r,i),null!==this._node2&&this._node2.query(e,r,i)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(iG),iY=function(){this._leaves=new eA,this._root=null,this._level=0};iY.prototype.buildTree=function(){tZ.sort(this._leaves,new iG.NodeComparator);for(var e=this._leaves,r=null,i=new eA;;){if(this.buildLevel(e,i),1===i.size())return i.get(0);r=e,e=i,i=r}},iY.prototype.insert=function(e,r,i){if(null!==this._root)throw Error("Index cannot be added to once it has been queried");this._leaves.add(new i$(e,r,i))},iY.prototype.query=function(e,r,i){this.init(),this._root.query(e,r,i
113)},iY.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},iY.prototype.printNode=function(e){H.out.println(en.toLineString(new T(e._min,this._level),new T(e._max,this._level)))},iY.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},iY.prototype.buildLevel=function(e,r){this._level++,r.clear();for(var i=0;i<e.size();i+=2){var n=e.get(i);if(null===(i+1<e.size()?e.get(i):null))r.add(n);else{var o=new iW(e.get(i),e.get(i+1));r.add(o)}}},iY.prototype.interfaces_=function(){return[]},iY.prototype.getClass=function(){return iY};var iZ=function(){this._items=new eA};iZ.prototype.visitItem=function(e){this._items.add(e)},iZ.prototype.getItems=function(){return this._items},iZ.prototype.interfaces_=function(){return[tH]},iZ.prototype.getClass=function(){return iZ};var iX=function(){this._index=null;var e=arguments[0];if(!L(e,e5))throw new v("Argument must be Polygonal");this._index=new iJ(e)},iK={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};iX.prototype.locate=function(e){var r=new ep(e),i=new iQ(r);return this._index.query(e.y,e.y,i),r.getLocation()},iX.prototype.interfaces_=function(){return[rT]},iX.prototype.getClass=function(){return iX},iK.SegmentVisitor.get=function(){return iQ},iK.IntervalIndexedGeometry.get=function(){return iJ},Object.defineProperties(iX,iK);var iQ=function(){this._counter=null;var e=arguments[0];this._counter=e};iQ.prototype.visitItem=function(e){this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},iQ.prototype.interfaces_=function(){return[tH]},iQ.prototype.getClass=function(){return iQ};var iJ=function(){this._index=new iY;var e=arguments[0];this.init(e)};iJ.prototype.init=function(e){for(var r=r7.getLines(e).iterator();r.hasNext();){var i=r.next().getCoordinates();this.addLine(i)}},iJ.prototype.addLine=function(e){for(var r=1;r<e.length;r++){var i=new re(e[r-1],e[r]),n=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);this._index.insert(n,o,i)}},iJ.prototype.query=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1],i=new iZ;return this._index.query(e,r,i),i.getItems()}if(3==arguments.length){var n=arguments[0],o=arguments[1],a=arguments[2];this._index.query(n,o,a)}},iJ.prototype.interfaces_=function(){return[]},iJ.prototype.getClass=function(){return iJ};var i0=function(e){function r(){if(e.call(this),this._parentGeom=null,this._lineEdgeMap=new tl,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new ie,2==arguments.length){var r=arguments[0],i=arguments[1],n=ex.OGC_SFS_BOUNDARY_RULE;this._argIndex=r,this._parentGeom=i,this._boundaryNodeRule=n,null!==i&&this.add(i)}else if(3==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];this._argIndex=o,this._parentGeom=a,this._boundaryNodeRule=s,null!==a&&this.add(a)}}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.insertBoundaryPoint=function(e,i){var n=this._nodes.addNode(i).getLabel(),o=1;A.NONE,n.getLocation(e,tb.ON)===A.BOUNDARY&&o++;var a=r.determineBoundary(this._boundaryNodeRule,o);n.setLocation(e,a)},r.prototype.computeSelfNodes=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1];return this.computeSelfNodes(e,r,!1)}if(3==arguments.length){var i=arguments[0],n=arguments[1],o=arguments[2],a=new ij(i,!0,!1);a.setIsDoneIfProperInt(o);var s=this.createEdgeSetIntersector(),l=this._parentGeom instanceof e8||this._parentGeom instanceof e4||this._parentGeom instanceof e9;return s.computeIntersections(this._edges,a,n||!l),this.addSelfIntersectionNodes(this._argIndex),a}},r.prototype.computeSplitEdges=function(e){for(var r=this._edges.iterator();r.hasNext();)r.next().eiList.addSplitEdges(e)},r.prototype.computeEdgeIntersections=function(e,r,i){var n=new ij(r,i,!0);return n.setBoundaryNodes(this.getBoundaryNodes(),e.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,e._edges,n),n},r.prototype.getGeometry=function(){return this._parentGeom},r.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},r.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},r.prototype.addPoint=function(){if(arguments[0]instanceof e3){var e=arguments[0].getCoordinate();this.insertPoint(this._argIndex,e,A.INTERIOR)}else if(arguments[0]instanceof T){var r=arguments[0];this.insertPoint(this._argIndex,r,A.INTERIOR)}},r.prototype.addPolygon=function(e){this.addPolygonRing(e.getExteriorRing(),A.EXTERIOR,A.INTERIOR);for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);this.addPolygonRing(i,A.INTERIOR,A.EXTERIOR)}},r.prototype.addEdge=function(e){this.insertEdge(e);var r=e.getCoordinates();this.insertPoint(this._argIndex,r[0],A.BOUNDARY),this.insertPoint(this._argIndex,r[r.length-1],A.BOUNDARY)},r.prototype.addLineString=function(e){var r=eO.removeRepeatedPoints(e.getCoordinates());if(r.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=new rj(r,new tC(this._argIndex,A.INTERIOR));this._lineEdgeMap.put(e,i),this.insertEdge(i),es.isTrue(r.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},r.prototype.getInvalidPoint=function(){return this._invalidPoint},r.prototype.getBoundaryPoints=function(){for(var e=this.getBoundaryNodes(),r=Array(e.size()).fill(null),i=0,n=e.iterator();n.hasNext();){var o=n.next();r[i++]=o.getCoordinate().copy()}return r},r.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},r.prototype.addSelfIntersectionNode=function(e,r,i){if(this.isBoundaryNode(e,r))return null;i===A.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(e,r):this.insertPoint(e,r,i)},r.prototype.addPolygonRing=function(e,r,i){if(e.isEmpty())return null;var n=eO.removeRepeatedPoints(e.getCoordinates());if(n.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var o=r,a=i;ed.isCCW(n)&&(o=i,a=r);var s=new rj(n,new tC(this._argIndex,A.BOUNDARY,o,a));this._lineEdgeMap.put(e,s),this.insertEdge(s),this.insertPoint(this._argIndex,n[0],A.BOUNDARY)},r.prototype.insertPoint=function(e,r,i){var n=this._nodes.addNode(r),o=n.getLabel();null===o?n._label=new tC(e,i):o.setLocation(e,i)},r.prototype.createEdgeSetIntersector=function(){return new iV},r.prototype.addSelfIntersectionNodes=function(e){for(var r=this._edges.iterator();r.hasNext();)for(var i=r.next(),n=i.getLabel().getLocation(e),o=i.eiList.iterator();o.hasNext();){var a=o.next();this.addSelfIntersectionNode(e,a.coord,n)}},r.prototype.add=function(){if(1!=arguments.length)return e.prototype.add.apply(this,arguments);var r=arguments[0];if(r.isEmpty())return null;if(r instanceof e9&&(this._useBoundaryDeterminationRule=!1),r instanceof e4)this.addPolygon(r);else if(r instanceof e1)this.addLineString(r);else if(r instanceof e3)this.addPoint(r);else if(r instanceof e6)this.addCollection(r);else if(r instanceof eZ)this.addCollection(r);else if(r instanceof e9)this.addCollection(r);else{if(!(r instanceof eY))throw Error(r.getClass().getName());this.addCollection(r)}},r.prototype.addCollection=function(e){for(var r=0;r<e.getNumGeometries();r++){var i=e.getGeometryN(r);this.add(i)}},r.prototype.locate=function(e){return L(this._parentGeom,e5)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new iX(this._parentGeom)),this._areaPtLocator.locate(e)):this._ptLocator.locate(e,this._parentGeom)},r.prototype.findEdge=function(){if(1==arguments.length){var r=arguments[0];return this._lineEdgeMap.get(r)}return e.prototype.findEdge.apply(this,arguments)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r.determineBoundary=function(e,r){return e.isInBoundary(r)?A.BOUNDARY:A.INTERIOR},r}
113(tU),i1=function(){if(this._li=new ec,this._resultPrecisionModel=null,this._arg=null,1==arguments.length){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=[,].fill(null),this._arg[0]=new i0(0,e)}else if(2==arguments.length){var r=arguments[0],i=arguments[1],n=ex.OGC_SFS_BOUNDARY_RULE;r.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=[,,].fill(null),this._arg[0]=new i0(0,r,n),this._arg[1]=new i0(1,i,n)}else if(3==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];o.getPrecisionModel().compareTo(a.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=[,,].fill(null),this._arg[0]=new i0(0,o,s),this._arg[1]=new i0(1,a,s)}};i1.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},i1.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},i1.prototype.interfaces_=function(){return[]},i1.prototype.getClass=function(){return i1};var i2=function(){};i2.prototype.interfaces_=function(){return[]},i2.prototype.getClass=function(){return i2},i2.map=function(){if(arguments[0]instanceof eg&&L(arguments[1],i2.MapOp)){for(var e=arguments[0],r=arguments[1],i=new eA,n=0;n<e.getNumGeometries();n++){var o=r.map(e.getGeometryN(n));null!==o&&i.add(o)}return e.getFactory().buildGeometry(i)}if(L(arguments[0],eI)&&L(arguments[1],i2.MapOp)){for(var a=arguments[0],s=arguments[1],l=new eA,u=a.iterator();u.hasNext();){var c=u.next(),h=s.map(c);null!==h&&l.add(h)}return l}},i2.MapOp=function(){};var i3=function(e){function r(){var r=arguments[0],i=arguments[1];e.call(this,r,i),this._ptLocator=new ie,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new rO,this._resultPolyList=new eA,this._resultLineList=new eA,this._resultPointList=new eA,this._graph=new tU(new rP),this._geomFact=r.getFactory()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.insertUniqueEdge=function(e){var r=this._edgeList.findEqualEdge(e);if(null!==r){var i=r.getLabel(),n=e.getLabel();r.isPointwiseEqual(e)||(n=new tC(e.getLabel())).flip();var o=r.getDepth();o.isNull()&&o.add(i),o.add(n),i.merge(n)}else this._edgeList.add(e)},r.prototype.getGraph=function(){return this._graph},r.prototype.cancelDuplicateResultEdges=function(){for(var e=this._graph.getEdgeEnds().iterator();e.hasNext();){var r=e.next(),i=r.getSym();r.isInResult()&&i.isInResult()&&(r.setInResult(!1),i.setInResult(!1))}},r.prototype.isCoveredByLA=function(e){return!!this.isCovered(e,this._resultLineList)||!!this.isCovered(e,this._resultPolyList)},r.prototype.computeGeometry=function(e,i,n,o){var a=new eA;return a.addAll(e),a.addAll(i),a.addAll(n),a.isEmpty()?r.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},r.prototype.mergeSymLabels=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();)e.next().getEdges().mergeSymLabels()},r.prototype.isCovered=function(e,r){for(var i=r.iterator();i.hasNext();){var n=i.next();if(this._ptLocator.locate(e,n)!==A.EXTERIOR)return!0}return!1},r.prototype.replaceCollapsedEdges=function(){for(var e=new eA,r=this._edgeList.iterator();r.hasNext();){var i=r.next();i.isCollapsed()&&(r.remove(),e.add(i.getCollapsedEdge()))}this._edgeList.addAll(e)},r.prototype.updateNodeLabelling=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();){var r=e.next(),i=r.getEdges().getLabel();r.getLabel().merge(i)}},r.prototype.getResultGeometry=function(e){return this.computeOverlay(e),this._resultGeom},r.prototype.insertUniqueEdges=function(e){for(var r=e.iterator();r.hasNext();){var i=r.next();this.insertUniqueEdge(i)}},r.prototype.computeOverlay=function(e){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 r=new eA;this._arg[0].computeSplitEdges(r),this._arg[1].computeSplitEdges(r),this.insertUniqueEdges(r),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),ib.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(e),this.cancelDuplicateResultEdges();var i=new tj(this._geomFact);i.add(this._graph),this._resultPolyList=i.getPolygons();var n=new iE(this,this._geomFact,this._ptLocator);this._resultLineList=n.build(e);var o=new iS(this,this._geomFact,this._ptLocator);this._resultPointList=o.build(e),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,e)},r.prototype.labelIncompleteNode=function(e,r){var i=this._ptLocator.locate(e.getCoordinate(),this._arg[r].getGeometry());e.getLabel().setLocation(r,i)},r.prototype.copyPoints=function(e){for(var r=this._arg[e].getNodeIterator();r.hasNext();){var i=r.next();this._graph.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},r.prototype.findResultAreaEdges=function(e){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var n=i.next(),o=n.getLabel();o.isArea()&&!n.isInteriorAreaEdge()&&r.isResultOfOp(o.getLocation(0,tb.RIGHT),o.getL
113ocation(1,tb.RIGHT),e)&&n.setInResult(!0)}},r.prototype.computeLabelsFromDepths=function(){for(var e=this._edgeList.iterator();e.hasNext();){var r=e.next(),i=r.getLabel(),n=r.getDepth();if(!n.isNull()){n.normalize();for(var o=0;o<2;o++)i.isNull(o)||!i.isArea()||n.isNull(o)||(0===n.getDelta(o)?i.toLine(o):(es.isTrue(!n.isNull(o,tb.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(o,tb.LEFT,n.getLocation(o,tb.LEFT)),es.isTrue(!n.isNull(o,tb.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(o,tb.RIGHT,n.getLocation(o,tb.RIGHT))))}}},r.prototype.computeLabelling=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();)e.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},r.prototype.labelIncompleteNodes=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();){var r=e.next(),i=r.getLabel();r.isIsolated()&&(i.isNull(0)?this.labelIncompleteNode(r,0):this.labelIncompleteNode(r,1)),r.getEdges().updateLabelling(i)}},r.prototype.isCoveredByA=function(e){return!!this.isCovered(e,this._resultPolyList)},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r}(i1);i3.overlayOp=function(e,r,i){return new i3(e,r).getResultGeometry(i)},i3.intersection=function(e,r){return e.isEmpty()||r.isEmpty()?i3.createEmptyResult(i3.INTERSECTION,e,r,e.getFactory()):e.isGeometryCollection()?iw.map(e,{interfaces_:function(){return[i2.MapOp]},map:function(e){return e.intersection(r)}}):(e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(r),iN.overlayOp(e,r,i3.INTERSECTION))},i3.symDifference=function(e,r){if(e.isEmpty()||r.isEmpty()){if(e.isEmpty()&&r.isEmpty())return i3.createEmptyResult(i3.SYMDIFFERENCE,e,r,e.getFactory());if(e.isEmpty())return r.copy();if(r.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(r),iN.overlayOp(e,r,i3.SYMDIFFERENCE)},i3.resultDimension=function(e,r,i){var n=r.getDimension(),o=i.getDimension(),a=-1;switch(e){case i3.INTERSECTION:a=Math.min(n,o);break;case i3.UNION:a=Math.max(n,o);break;case i3.DIFFERENCE:a=n;break;case i3.SYMDIFFERENCE:a=Math.max(n,o)}return a},i3.createEmptyResult=function(e,r,i,n){var o=null;switch(i3.resultDimension(e,r,i)){case -1:o=n.createGeometryCollection([].fill(null));break;case 0:o=n.createPoint();break;case 1:o=n.createLineString();break;case 2:o=n.createPolygon()}return o},i3.difference=function(e,r){return e.isEmpty()?i3.createEmptyResult(i3.DIFFERENCE,e,r,e.getFactory()):r.isEmpty()?e.copy():(e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(r),iN.overlayOp(e,r,i3.DIFFERENCE))},i3.isResultOfOp=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1],i=e.getLocation(0),n=e.getLocation(1);return i3.isResultOfOp(i,n,r)}if(3==arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];switch(o===A.BOUNDARY&&(o=A.INTERIOR),a===A.BOUNDARY&&(a=A.INTERIOR),s){case i3.INTERSECTION:return o===A.INTERIOR&&a===A.INTERIOR;case i3.UNION:return o===A.INTERIOR||a===A.INTERIOR;case i3.DIFFERENCE:return o===A.INTERIOR&&a!==A.INTERIOR;case i3.SYMDIFFERENCE:return o===A.INTERIOR&&a!==A.INTERIOR||o!==A.INTERIOR&&a===A.INTERIOR}return!1}},i3.INTERSECTION=1,i3.UNION=2,i3.DIFFERENCE=3,i3.SYMDIFFERENCE=4;var i5=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new ie,this._seg=new re;var e=arguments[0],r=arguments[1];this._g=e,this._boundaryDistanceTolerance=r,this._linework=this.extractLinework(e)};i5.prototype.isWithinToleranceOfBoundary=function(e){for(var r=0;r<this._linework.getNumGeometries();r++)for(var i=this._linework.getGeometryN(r).getCoordinateSequence(),n=0;n<i.size()-1;n++)if(i.getCoordinate(n,this._seg.p0),i.getCoordinate(n+1,this._seg.p1),this._seg.distance(e)<=this._boundaryDistanceTolerance)return!0;return!1},i5.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?A.BOUNDARY:this._ptLocator.locate(e,this._g)},i5.prototype.extractLinework=function(e){var r=new i4;e.apply(r);var i=r.getLinework(),n=td.toLineStringArray(i);return e.getFactory().createMultiLineString(n)},i5.prototype.interfaces_=function(){return[]},i5.prototype.getClass=function(){return i5};var i4=function(){this._linework=null,this._linework=new eA};i4.prototype.getLinework=function(){return this._linework},i4.prototype.filter=function(e){if(e instanceof e4){this._linework.add(e.getExteriorRing());for(var r=0;r<e.getNumInteriorRing();r++)this._linework.add(e.getInteriorRingN(r))}},i4.prototype.interfaces_=function(){return[e$]},i4.prototype.getClass=function(){return i4};var i6=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};i6.prototype.extractPoints=function(e,r,i){for(var n=e.getCoordinates(),o=0;o<n.length-1;o++)this.computeOffsetPoints(n[o],n[o+1],r,i)},i6.prototype.setSidesToGenerate=function(e,r){this._doLeft=e,this._doRight=r},i6.prototype.getPoints=function(e){for(var r=new eA,i=r7.getLines(this._g).iterator();i.hasNext();){var n=i.next();this.extractPoints(n,e,r)}return r},i6.prototype.computeOffsetPoints=function(e,r,i,n){var o=r.x-e.x,a=r.y-e.y,s=Math.sqrt(o*o+a*a),l=i*o/s,u=i*a/s,c=(r.x+e.x)/2,h=(r.y+e.y)/2;if(this._doLeft){var p=new T(c-u,h+l);n.add(p)}if(this._doRight){var d=new T(c+u,h-l);n.add(d)}},i6.prototype.interfaces_=function(){return[]},i6.prototype.getClass=function(){return i6};var i8=function e(){this._geom=null,this._locFinder=null,this._location=[,,,].fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=e.TOLERANCE,this._testCoords=new eA;var r=arguments[0],i=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=e.computeBoundaryDistanceTolerance(r,i),this._geom=[r,i,n],this._locFinder=[new i5(this._geom[0],this._boundaryDistanceTolerance),new i5(this._geom[1],this._boundaryDistanceTolerance),new i5(this._geom[2],this._boundaryDistanceTolerance)]},i9={TOLERANCE:{configurable:!0}};i8.prototype.reportResult=function(e,r,i){H.out.println("Overlay result invalid - A:"+A.toLocationSymbol(r[0])+" B:"+A.toLocationSymbol(r[1])+" expected:"+(i?"i":"e")+" actual:"+A.toLocationSymbol(r[2]))}
113,i8.prototype.isValid=function(e){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(e)},i8.prototype.checkValid=function(){if(1==arguments.length){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=this._testCoords.get(r);if(!this.checkValid(e,i))return this._invalidLocation=i,!1}return!0}if(2==arguments.length){var n=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),!!i8.hasLocation(this._location,A.BOUNDARY)||this.isValidResult(n,this._location)}},i8.prototype.addTestPts=function(e){var r=new i6(e);this._testCoords.addAll(r.getPoints(5*this._boundaryDistanceTolerance))},i8.prototype.isValidResult=function(e,r){var i=i3.isResultOfOp(r[0],r[1],e),n=!(i^r[2]===A.INTERIOR);return n||this.reportResult(e,r,i),n},i8.prototype.getInvalidLocation=function(){return this._invalidLocation},i8.prototype.interfaces_=function(){return[]},i8.prototype.getClass=function(){return i8},i8.hasLocation=function(e,r){for(var i=0;i<3;i++)if(e[i]===r)return!0;return!1},i8.computeBoundaryDistanceTolerance=function(e,r){return Math.min(iM.computeSizeBasedSnapTolerance(e),iM.computeSizeBasedSnapTolerance(r))},i8.isValid=function(e,r,i,n){return new i8(e,r,n).isValid(i)},i9.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(i8,i9);var i7=function e(r){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=e.extractFactory(r),this._inputGeoms=r};i7.prototype.extractElements=function(e,r){if(null===e)return null;for(var i=0;i<e.getNumGeometries();i++){var n=e.getGeometryN(i);this._skipEmpty&&n.isEmpty()||r.add(n)}},i7.prototype.combine=function(){for(var e=new eA,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();this.extractElements(i,e)}return 0===e.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},i7.prototype.interfaces_=function(){return[]},i7.prototype.getClass=function(){return i7},i7.combine=function(){if(1==arguments.length){var e=arguments[0];return new i7(e).combine()}if(2==arguments.length){var r=arguments[0],i=arguments[1];return new i7(i7.createList(r,i)).combine()}if(3==arguments.length){var n=arguments[0],o=arguments[1],a=arguments[2];return new i7(i7.createList(n,o,a)).combine()}},i7.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},i7.createList=function(){if(2==arguments.length){var e=arguments[0],r=arguments[1],i=new eA;return i.add(e),i.add(r),i}if(3==arguments.length){var n=arguments[0],o=arguments[1],a=arguments[2],s=new eA;return s.add(n),s.add(o),s.add(a),s}};var ne=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,null===this._inputPolys&&(this._inputPolys=new eA)},nt={STRTREE_NODE_CAPACITY:{configurable:!0}};ne.prototype.reduceToGeometries=function(e){for(var r=new eA,i=e.iterator();i.hasNext();){var n=i.next(),o=null;L(n,eC)?o=this.unionTree(n):n instanceof eg&&(o=n),r.add(o)}return r},ne.prototype.extractByEnvelope=function(e,r,i){for(var n=new eA,o=0;o<r.getNumGeometries();o++){var a=r.getGeometryN(o);a.getEnvelopeInternal().intersects(e)?n.add(a):i.add(a)}return this._geomFactory.buildGeometry(n)},ne.prototype.unionOptimized=function(e,r){var i=e.getEnvelopeInternal(),n=r.getEnvelopeInternal();if(!i.intersects(n))return i7.combine(e,r);if(1>=e.getNumGeometries()&&1>=r.getNumGeometries())return this.unionActual(e,r);var o=i.intersection(n);return this.unionUsingEnvelopeIntersection(e,r,o)},ne.prototype.union=function(){if(null===this._inputPolys)throw Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var e=new t1(ne.STRTREE_NODE_CAPACITY),r=this._inputPolys.iterator();r.hasNext();){var i=r.next();e.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;var n=e.itemsTree();return this.unionTree(n)},ne.prototype.binaryUnion=function(){if(1==arguments.length){var e=arguments[0];return this.binaryUnion(e,0,e.size())}if(3==arguments.length){var r=arguments[0],i=arguments[1],n=arguments[2];if(n-i<=1){var o=ne.getGeometry(r,i);return this.unionSafe(o,null)}if(n-i==2)return this.unionSafe(ne.getGeometry(r,i),ne.getGeometry(r,i+1));var a=Math.trunc((n+i)/2),s=this.binaryUnion(r,i,a),l=this.binaryUnion(r,a,n);return this.unionSafe(s,l)}},ne.prototype.repeatedUnion=function(e){for(var r=null,i=e.iterator();i.hasNext();){var n=i.next();r=null===r?n.copy():r.union(n)}return r},ne.prototype.unionSafe=function(e,r){return null===e&&null===r?null:null===e?r.copy():null===r?e.copy():this.unionOptimized(e,r)},ne.prototype.unionActual=function(e,r){return ne.restrictToPolygons(e.union(r))},ne.prototype.unionTree=function(e){var r=this.reduceToGeometries(e);return this.binaryUnion(r)},ne.prototype.unionUsingEnvelopeIntersection=function(e,r,i){var n=new eA,o=this.extractByEnvelope(i,e,n),a=this.extractByEnvelope(i,r,n),s=this.unionActual(o,a);return n.add(s),i7.combine(n)},ne.prototype.bufferUnion=function(){if(1==arguments.length){var e=arguments[0];return e.get(0).getFactory().buildGeometry(e).buffer(0)}if(2==arguments.length){var r=arguments[0],i=arguments[1];return r.getFactory().createGeometryCollection([r,i]).buffer(0)}},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne},ne.restrictToPolygons=function(e){if(L(e,e5))return e;var r=r9.getPolygons(e);return 1===r.size()?r.get(0):e.getFactory().createMultiPolygon(td.toPolygonArray(r))},ne.getGeometry=function(e,r){return r>=e.size()?null:e.get(r)},ne.union=function(e){return new ne(e).union()},nt.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(ne,nt);var nr=function(){};nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr},nr.union=function(e,r){if(e.isEmpty()||r.isEmpty()){if(e.isEmpty()&&r.isEmpty())return i3.createEmptyResult(i3.UNION,e,r,e.getFactory());if(e.isEmpty())return r.copy();if(r.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(r),iN.overlayOp(e,r,i3.UNION)},e.GeoJSONReader=tv,e.GeoJSONWriter=tx,e.OverlayOp=i3,e.UnionOp=nr,e.BufferOp=r0,Object.defineProperty(e,"__esMo
113dule",{value:!0})}(r)},72936:(e,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=i(64252)._(i(14232)).default.createContext(null)},73239:e=>{"use strict";function r(e){return e.replace(/\//g,"-")}e.exports=function(e){return"object"==typeof e?Object.keys(e).filter(function(r){return e[r]}).map(r).join(" "):Array.prototype.map.call(arguments,r).join(" ")}},73305:e=>{"use strict";e.exports=URIError},73442:(e,r,i)=>{"use strict";var n=i(45525),o=i(66530),a=o([n("%String.prototype.indexOf%")]);e.exports=function(e,r){var i=n(e,!!r);return"function"==typeof i&&a(e,".prototype.")>-1?o([i]):i}},73862:(e,r,i)=>{"use strict";var n=i(76184),o=i(5870),a=n.eudist,s=(n.mandist,n.dist,o.kmrand),l=o.kmpp;function u(e,r,i){i=i||[];for(var n=0;n<e;n++)i[n]=r;return i}e.exports=function(e,r,i,n){var o=[],c=[],h=[],p=[],d=!1,f=n||1e4,m=e.length,g=e[0].length,_=g>0,y=[];if(i)o="kmrand"==i?s(e,r):"kmpp"==i?l(e,r):i;else for(var v={};o.length<r;){var x=Math.floor(Math.random()*m);v[x]||(v[x]=!0,o.push(e[x]))}do{u(r,0,y);for(var b=0;b<m;b++){for(var w=1/0,E=0,S=0;S<r;S++){var p=_?a(e[b],o[S]):Math.abs(e[b]-o[S]);p<=w&&(w=p,E=S)}h[b]=E,y[E]++}for(var T=[],c=[],I=0;I<r;I++)T[I]=_?u(g,0,T[I]):0,c[I]=o[I];if(_){for(var M=0;M<r;M++)o[M]=[];for(var C=0;C<m;C++)for(var A=T[h[C]],P=e[C],L=0;L<g;L++)A[L]+=P[L];d=!0;for(var O=0;O<r;O++){for(var D=o[O],R=T[O],k=c[O],N=y[O],F=0;F<g;F++)D[F]=R[F]/N||0;if(d){for(var z=0;z<g;z++)if(k[z]!=D[z]){d=!1;break}}}}else{for(var B=0;B<m;B++){var U=h[B];T[U]+=e[B]}for(var j=0;j<r;j++)o[j]=T[j]/y[j]||0;d=!0;for(var V=0;V<r;V++)if(c[V]!=o[V]){d=!1;break}}d=d||--f<=0}while(!d);return{it:1e4-f,k:r,idxs:h,centroids:o}}},74011:(e,r,i)=>{"use strict";var n=i(14232),o=i(73239);e.exports=(0,i(93710).Map)({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:n.createElement("ul",{className:o("public/DraftStyleDefault/ul")})},"ordered-list-item":{element:"li",wrapper:n.createElement("ol",{className:o("public/DraftStyleDefault/ol")})},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:n.createElement("pre",{className:o("public/DraftStyleDefault/pre")})},unstyled:{element:"div",aliasedElements:["p"]}})},74637:e=>{"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},75269:(e,r,i)=>{"use strict";e.exports=function(e){function r(){return e.apply(this,arguments)||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},i.getAnchorKey=function(){return this.get("anchorKey")},i.getAnchorOffset=function(){return this.get("anchorOffset")},i.getFocusKey=function(){return this.get("focusKey")},i.getFocusOffset=function(){return this.get("focusOffset")},i.getIsBackward=function(){return this.get("isBackward")},i.getHasFocus=function(){return this.get("hasFocus")},i.hasEdgeWithin=function(e,r,i){var n=this.getAnchorKey(),o=this.getFocusKey();if(n===o&&n===e){var a=this.getStartOffset(),s=this.getEndOffset();return r<=a&&a<=i||r<=s&&s<=i}if(e!==n&&e!==o)return!1;var l=e===n?this.getAnchorOffset():this.getFocusOffset();return r<=l&&i>=l},i.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},i.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},i.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},i.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},i.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},r.createEmpty=function(e){return new r({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},r}((0,i(93710).Record)({anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1}))},75448:e=>{"use strict";var r="u">typeof navigator&&navigator.userAgent.indexOf("AppleWebKit")>-1;e.exports=function(e){return(e=e||document).scrollingElement?e.scrollingElement:r||"CSS1Compat"!==e.compatMode?e.body:e.documentElement}},75864:(e,r,i)=>{"use strict";var n=i(15796);e.exports=function(e){if(!(e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)))return[e];if(Array.isArray(e))return e.slice();var r=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&n(!1),"number"!=typeof r&&n(!1),0===r||r-1 in e||n(!1),"function"==typeof e.callee&&n(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var i=Array(r),o=0;o<r;o++)i[o]=e[o];return i}},75936:e=>{"use strict";e.exports=function(e){return"handled"===e||!0===e}},76061:e=>{"use strict";var r=Object.prototype.toString;e.exports=function(e){var i=r.call(e),n="[object Arguments]"===i;return n||(n="[object Array]"!==i&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}},76184:e=>{"use strict";e.exports={eudist:function(e,r,i){for(var n=e.length,o=0,a=0;a<n;a++){var s=(e[a]||0)-(r[a]||0);o+=s*s}return i?Math.sqrt(o):o},mandist:function(e,r,i){for(var n=e.length,o=0,a=0;a<n;a++)o+=Math.abs((e[a]||0)-(r[a]||0));return i?Math.sqrt(o):o},dist:function(e,r,i){var n=Math.abs(e-r);return i?n:n*n}}},77097:(e,r,i)=>{"use strict";
113var n=i(59487),o=i(54780).strlen;e.exports=function(e,r){var i=[];return e.findEntityRanges(function(e){return!!e.getEntity()},function(a,s){var l=e.getText(),u=e.getEntityAt(a);i.push({offset:o(l.slice(0,a)),length:o(l.slice(a,s)),key:Number(r[n.stringify(u)])})}),i}},77580:(e,r,i)=>{"use strict";var n,o=i(39746),a="Unknown",s=new o().getResult(),l=function(e){if(!e)return{major:"",minor:""};var r=e.split(".");return{major:r[0],minor:r[1]}}(s.browser.version);e.exports={browserArchitecture:s.cpu.architecture||a,browserFullVersion:s.browser.version||a,browserMinorVersion:l.minor||a,browserName:s.browser.name||a,browserVersion:s.browser.major||a,deviceName:s.device.model||a,engineName:s.engine.name||a,engineVersion:s.engine.version||a,platformArchitecture:s.cpu.architecture||a,platformName:({"Mac OS":"Mac OS X"})[n=s.os.name]||n||a,platformVersion:s.os.version||a,platformFullVersion:s.os.version||a}},77582:(e,r,i)=>{"use strict";i.d(r,{m:()=>u,r:()=>l});var n=i(38521),o=i(84412),a=i(5168);let s=!1,l=async(e=!0,r)=>{if(await Promise.race([a.y.signOut().catch(()=>void 0),new Promise(e=>setTimeout(e,3e3))]),localStorage.clear(),sessionStorage.clear(),!e)return;(0,n.S)(!0);let i=r?`?error=${encodeURIComponent(r)}`:"";window.location.href=`${o.Z7}/login${i}`},u=()=>{s||(s=!0,(0,n.S)(!0),l(!0,"session_expired"))}},77784:(e,r,i)=>{"use strict";i.d(r,{O:()=>c,g:()=>u});var n=i(37876),o=i(14232),a=i(61519),s=i(84412);let l=(0,o.createContext)(void 0);function u({children:e}){let[r,i]=(0,o.useState)(void 0),[c,h]=(0,o.useState)(null);return(0,o.useEffect)(()=>{!async function(){if(r?.project_imageLink)try{let e=await (0,a.bB)(r.project_imageLink.replace(s.oj,""));h(e)}catch{h(null)}}()},[r?.project_imageLink]),(0,n.jsx)(l.Provider,{value:{project:r,setProject:i,projectImageUrl:c},children:e})}function c(){let e=(0,o.useContext)(l);if(void 0===e)throw Error("useProjectContext must be used within a ProjectContextProvider");return e}},77785:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},r=Symbol("test"),i=Object(r);if("string"==typeof r||"[object Symbol]"!==Object.prototype.toString.call(r)||"[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var n in e[r]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,r);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},78036:(e,r,i)=>{"use strict";var n=i(18428),o=i(9912),a=i(11228),s=i(58217),l=i(5686),u=i(58240),c=i(93710),h=i(62899),p=c.List,d=c.Repeat,f=u("draft_tree_data_support"),m=f?o:n;e.exports={processHTML:function(e,r){return a(e,l,r)},processText:function(e,r,i){return e.reduce(function(e,n,o){n=h(n);var a=s(),l={key:a,type:i,text:n,characterList:p(d(r,n.length))};if(f&&0!==o){var u=o-1;l=function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},l,{prevSibling:(e[u]=e[u].merge({nextSibling:a})).getKey()})}return e.push(new m(l)),e},[])}}},78121:e=>{"use strict";e.exports="u">typeof Reflect&&Reflect&&Reflect.apply},78594:(e,r,i)=>{"use strict";i.d(r,{JH:()=>D,MR:()=>B,V0:()=>O,VG:()=>R,Vj:()=>S,XB:()=>I,b8:()=>L,bh:()=>M,gp:()=>T,k7:()=>U,kD:()=>N,og:()=>k,q$:()=>C,xL:()=>P,yh:()=>F});var n=i(37876),o=i(88321),a=i(84412),s=i(97685),l=i(36531),u=i(80856),c=i(8135),h=i(39149),p=i(85428),d=i(67989),f=i(38960),m=i(23323),g=i(69585),_=i(22629),y=i(51877),v=i(16614),x=i(44845),b=i(47133),w=i(43299),E=i(82909).hp;let S=(e,r)=>{let i=r.id+"-source",n=e.current.getLayer(r.id)?.type,a=r.id+"-vector-label";if("fill"===n||"line"===n||e.current.getLayer(r.id+"-polygon")||e.current.getLayer(r.id+"-linestring"))return;let s=()=>{e.current.getLayer(r.id+"-halo")&&e.current.removeLayer(r.id+"-halo"),e.current.getLayer(r.id)&&e.current.removeLayer(r.id)},l=()=>{let r=e.current.getLayer(a),n=r?e.current.getLayoutProperty(a,"text-field"):null;r&&e.current.removeLayer(a),(e.current.getStyle()?.layers??[]).forEac
113h(r=>{r.source===i&&e.current.getLayer(r.id)&&e.current.removeLayer(r.id)});let o=e.current.getSource(i),s=o?._data;o&&s&&(e.current.removeSource(i),e.current.addSource(i,{type:"geojson",data:s,tolerance:1.25})),r&&n&&e.current.addLayer({id:a,type:"symbol",source:i,layout:{"text-field":n,"text-size":12,"text-offset":[0,1],"text-anchor":"center","text-justify":"center"},paint:{"text-halo-color":"#FFFFFF","text-halo-width":2,"text-halo-blur":.5}})};if(r.properties.icon){s(),n&&"symbol"!==n&&l();let a=(0,y.zK)(r.properties.icon,o.w);e.current.hasImage(a)||e.current.loadImage(r.properties.icon,(r,i)=>{if(r)throw r;e.current.addImage(a,i)}),e.current.getLayer(r.id)||e.current.addLayer({id:r.id,type:"symbol",source:i,layout:{"icon-image":a,"icon-size":1,"icon-allow-overlap":!0}}),(0,y.M6)(e,r.id)}else r.properties.gradientData.gradientType!==u.nd.categorical&&(s(),n&&"circle"!==n&&l(),e.current.addLayer({id:r.id,type:"circle",source:i,paint:{"circle-color":String(r?.properties.color),"circle-radius":4,"circle-stroke-width":2,"circle-stroke-color":"transparent","circle-stroke-opacity":1,"circle-opacity":(r?.properties?.opacity??100)/100}}),(0,y.bh)(e,r.id))};function T(e,r,i,o,a){return(0,n.jsx)("div",{children:r.map(r=>(0,n.jsx)("div",{className:"label",children:(0,n.jsx)("div",{className:"flex flex-col w-full",children:(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsxs)("span",{className:"label-text",children:[r.name," ","Draft"==r.scope&&(0,n.jsx)("span",{className:"badge badge-neutral ml-1 text-xs",children:"Draft"})]}),(0,n.jsxs)("div",{className:"flex items-center mr-1",children:[(0,n.jsx)("button",{className:"btn btn-xs mr-1 text-black",id:"toggle-visibility-button",onClick:async()=>await a(r),children:"true"===r.properties.visible||!0===r.properties.visible?(0,n.jsx)(h.JPe,{className:"text-black"}):(0,n.jsx)(h.Sq0,{className:"text-red-500"})}),!!r.properties.zoomLocation&&(0,n.jsx)("button",{onClick:()=>(0,d.S6)(e,r),className:"btn btn-xs mr-1 text-black",id:"zoom-layer-button",children:(0,n.jsx)(h.YQq,{})}),(0,n.jsxs)("details",{className:"dropdown dropdown-end fm-dropdown dropdown-close-outside",children:[(0,n.jsx)("summary",{id:`${r.id}-summary`,className:"btn btn-xs text-xs mr-1",title:"Show more options",children:(0,n.jsx)(h.mqA,{})}),(0,n.jsx)("ul",{className:"p-2 shadow menu dropdown-content z-1 bg-base-100 rounded-box w-52 static",children:(0,n.jsx)("label",{htmlFor:"edit-layer-modal",children:(0,n.jsx)("li",{onClick:()=>{i(r),o(r)},children:(0,n.jsxs)("a",{children:[(0,n.jsx)(c.VZ_,{})," Edit"]})})})})]})]})]})})},r.id))})}let I=(e,r,i,n,o,a,s,l)=>{r(e?.properties.ifcLat!==void 0?e?.properties.ifcLat:null),i(e?.properties.ifcLon!==void 0?e?.properties.ifcLon:null),n(e?.properties.ifcScale?e?.properties.ifcScale:null),o(e?.properties.ifcElevation!==void 0?e?.properties.ifcElevation:null),a(e?.properties.ifcX!==void 0?e?.properties.ifcX:null),s(e?.properties.ifcY!==void 0?e?.properties.ifcY:null),l(e?.properties.ifcZ!==void 0?e?.properties.ifcZ:null)},M=e=>{if(window.tb&&window.tb.models&&window.tb.models[e.id.toString()]){let r=window.tb.models[e.id.toString()];r.visible?r.visible=!1:r.visible=!0}},C=async(e,r,i,n,o,c,h,d,m,y,w,E,S,T,I,M,C,P,L,O,D,R,k,N,F,z,B,U,j,V,G,q,H,$,W)=>{let Y;E(!0);let Z=(0,_.NP)(),X=new FormData,K={};if(K={color:Z,symbol:"circle",visible:!0,opacity:100,gradientData:{}},"IFC"===o&&(L||G)){let e=n.current.queryTerrainElevation([V,j]);K={...K,ifcLat:j,ifcLon:V,ifcElevation:null!==e?e:0,ifcScale:1,ifcX:0,ifcY:0,ifcZ:0,zoomLocation:{lat:V,long:j}}}"WMTS"===o&&(K={...K,baseURL:W}),X.append("scope",q?"Published":d),X.append("project_id",i?.project_uuid),X.append("name",c),X.append("source",o),X.append("properties",JSON.stringify(K)),G&&X.append("integration_file",JSON.stringify(G)),X.append("enable_lrs",q),X.append("reference_date",$?$.toISOString():new Date().toISOString());let Q=null;switch(o){case"GeoJSON":Q=P;break;case"KML":Q=O;break;case"ShapeFile":if(D)for(let e=0;e<D.length;e++)X.append("file_upload",D[e]);break;case"WFS":A(X,R);break;case"WMS":X.append("capabilities",JSON.stringify(k));break;case"WMTS":X.append("capabilities",JSON.stringify(N));break;case"GeoTiff":Q=z;break;case"KMZ":Q=B;break;case"DXF":Q=U;break;case"IFC":Q=L;break;case"ArcGIS":X.append("url",F)}null==Q||Q instanceof Array||X.append("file_upload",Q);let J=new l.A;(Q&&Q?.size>a.sS||"WFS"===o)&&(Y=(0,p.kX)(),y.addUploading({title:c,type:u.dP.layer,progress:0,id:Y,worker:J}));let ee=!1;J.addEventListener("message",async e=>{let r,{type:l,percentCompleted:p,response:d,status:A}=e.data;if(R){let e=R?.refresh?"refresh":"create";r=(0,_.F0)(e,A)}switch(d&&(void 0===d||"Invalid JSON response from server"===d||"error"===JSON.parse(d).status)&&(l="error"),l){case"progress":Y&&(ee||(w(),E(!1),ee=!0),y.updateUploading(Y,{progress:p}));break;case"done":let P=JSON.parse(d).data,L=JSON.parse(d).failed||[];if(!P){s.Ay.error("Failed to upload layer"),Y&&y.updateUploading(Y,{progress:100,status:u.nW.error,message:r,title:L.length>0?`${L[0].error}: ${L[0].name.split(":").pop()}`:c}),h(""),m("Draft"),E(!1);return}let O={},D=[];
113if(Array.isArray(P))P.forEach(e=>{e.id=e.id.toString()+"-layer",e.properties.zoomLocation&&(O={lat:e.properties.zoomLocation.long,lon:e.properties.zoomLocation.lat})}),D=[...S,...P];else{if(P.id=P.id.toString()+"-layer","GeoTiff"==o){let e=`ws_${i?.project_uuid}`,r=`${a.Rt}/${e}/wms?service=WMS&version=1.1.0&request=GetMap&layers=${e}:${P.file_path.replace(/\.(tif|tiff)$/i,"")}&styles=&bbox={bbox-epsg-3857}&width=${g.yU}&height=${g.yU}&srs=EPSG:3857&format=image%2Fpng&transparent=true`;n=await (0,_.Hu)(n,r,P.id.toString(),P.properties.opacity)}else"IFC"==o&&(await fetch(a.oj+i?.container_name+"/layers/"+P.file_path),await (0,v.F)(n,i,P,I,M));O={lat:P.properties.zoomLocation?.long||0,lon:P.properties.zoomLocation?.lat||0},D=R?.refresh||F?.refresh?[...S.map(e=>e.id===P.id?P:e)]:[...S,P]}if(h(""),m("Draft"),E(!1),ee||(w(),ee=!0),Y){let e=207===A;y.updateUploading(Y,{progress:100,status:e?u.nW.error:u.nW.upload_complete,coordinates:O,message:r,title:e?`Failed: ${L.map(e=>e.name.split(":").pop()).join(", ")}`:c})}(0,f.J3)(o)||b.mb.GeoTiff?(Array.isArray(P)?P.map(e=>e.id):[P.id]).forEach(e=>{(0,x.X)(e.replace("-layer",""),n,i,u.iO.processing,C,T,H)}):(0,f.wv)(o)&&s.Ay.success("Layer added successfully"),T(D);break;case"error":if(console.error("Request failed with status: "+A),E(!1),Y)return void y.updateUploading(Y,{progress:100,status:u.nW.error,message:r});s.Ay.error("Failed to upload layer")}});let et=(0,_.e3)(o,!!(R?.refresh||F?.refresh),!0),er=R?.refresh||F?.refresh?"PUT":"POST",ei=Array.from(X.entries());J.postMessage({url:et,formDataObject:ei,method:er})},A=(e,r)=>{e.append("serverCapabilities",JSON.stringify(r)),r.refresh&&r.id&&e.append("id",r.id)},P=async(e,r)=>await (0,m.x)("/layer/populate",{method:"POST",rawResponse:!0,json:{id:Number(e.id.replace("-layer","")),project_id:r,status:u.iO.cancelled}}),L=(e,r)=>{let i=new Set(["uuid","user_id","type","contour","metric","opacity","layer","timestamp"]),n=["color","user","name","description","area","distance","range","range_min","center","source"];return e.map(e=>{let o=e.geojson.properties??{},a=[];for(let[e,n]of Object.entries(o))if(!(i.has(e)||e.includes("fill"))&&null!=n)if(["area","distance","range"].includes(e)){let i=parseFloat(n);isNaN(i)||a.push([e,D(e,i,r)])}else if("center"===e){let r=String(n).replace(/[\[\]]/g,"").split(",").map(e=>e.trim());2===r.length&&a.push([e,`${r[0]}, ${r[1]}`])}else a.push([e,n]);let s=new Map(a),l=Object.fromEntries(n.map(e=>[e,s.get(e)??""]));for(let[e,r]of a)l.hasOwnProperty(e)||(l[e]=r);return{type:e.type,create_date:e.create_date,last_updated:e.last_updated||"",lat:e?.lat,lon:e?.lon,...l,geometry:e.geojson.geometry,properties:e.geojson.properties}})},O=(e,r)=>{let i=r===u.WU.Imperial;return"distance"===e?i?"distance (ft)":"distance (m)":"area"===e?i?"area (ft\xb2)":"area (m\xb2)":"range"===e?i?"range (ft)":"range (m)":e},D=(e,r,i)=>{if(i===u.WU.Imperial){if("distance"===e)return r/.3048;if("area"===e)return r/.092903;if("range"===e)return r/.3048}return r},R=(e,r,i)=>{if(i===u.WU.Imperial){if("distance"===e)return .3048*r;if("area"===e)return .092903*r;if("range"===e)return .3048*r}return r},k=async(e,r)=>{try{return await (0,m.x)("/layer/feature",{params:{id:e,featureId:r}})}catch(r){let e=r.message||"";if(e.includes("layer nonexistent"))throw Error("Layer has been deleted");if(e.includes("vector nonexistent"))throw Error("Please try again later. Layer is being refreshed by a user");throw Error("An error occurred")}};async function N(e,r,i){let n={};r&&i&&(n.Authorization=`Basic ${E.from(`${r}:${i}`).toString("base64")}`);let o=await fetch(e,{method:"GET",headers:n}),a=await o.text(),s=new DOMParser().parseFromString(a,"application/xml"),l=s.querySelector("parsererror");if(l)throw Error("Error parsing XML: "+l.textContent);return s}let F=(e,r,i)=>{let n=e.target.value;if(n.length>100)return null;let o=n;if("number"==typeof r)return""===n?"":isNaN(n)?null:n;if("boolean"==typeof r)return e.target.checked;if(z(r))try{o=JSON.parse(n),e.target.style.backgroundColor="",i(!1)}catch{e.target.style.backgroundColor="#ffe5e5",i(!0)}return o},z=e=>{let r=JSON.stringify(e);return r.startsWith("[")&&r.endsWith("]")||r.startsWith("{")&&r.endsWith("}")},B=e=>{if(e&&"string"==typeof e.id)return e.id?.split("-")[0]},U=e=>{if(!e)throw Error("No geojson provided");let r=e.geometry||e;if(!r||!r.type)throw Error("Invalid GeoJSON structure");
113if("Polygon"===r.type){let r=j(e);return{lat:r.lat,lon:r.lon}}if("MultiPolygon"===r.type)if(r.coordinates?.[0]?.[0]?.[0])return{lat:r.coordinates[0][0][0][1],lon:r.coordinates[0][0][0][0]};else throw Error("Invalid MultiPolygon coordinates");if("Point"===r.type)return{lat:r.coordinates[1],lon:r.coordinates[0]};throw Error("Can not find location")},j=e=>{if(!e)return{lat:0,lon:0};let[r,i]=w.vh2(e).geometry.coordinates;return{lat:i,lon:r}}},78725:(e,r,i)=>{"use strict";var n=i(39636),o=i(18916),a=i(20109),s=i(15172),l=i(56810),u=i(37820);e.exports=function(e,r){var i,c=e._latestEditorState,h=c.getSelection(),p=r.target;if(h.isCollapsed())return void r.preventDefault();u(p)&&(i=l(a.getScrollParent(p)));var d=s(c);e.setClipboard(d),e.setMode("cut"),setTimeout(function(){var r,a;e.restoreEditorDOM(i),e.exitCurrentMode(),e.update((r=c,a=n.removeRange(r.getCurrentContent(),r.getSelection(),"forward"),o.push(r,a,"remove-range")))},0)}},79226:e=>{"use strict";var r=/\r\n?|\n/g;e.exports=function(e){return e.split(r)}},79362:(e,r,i)=>{"use strict";var n=i(18428),o=i(9912),a=i(59487),s=i(77097),l=i(34868),u=i(15796),c=function(e,r){return{key:e.getKey(),text:e.getText(),type:e.getType(),depth:e.getDepth(),inlineStyleRanges:l(e),entityRanges:s(e,r),data:e.getData().toObject()}},h=function(e,r,i,a){if(e instanceof n)return void i.push(c(e,r));e instanceof o||u(!1);var s=e.getParentKey(),l=a[e.getKey()]=function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},c(e,r),{children:[]});s?a[s].children.push(l):i.push(l)},p=function(e,r){var i=r.entityMap,n=[],o={},s={},l=0;return e.getBlockMap().forEach(function(e){e.findEntityRanges(function(e){return null!==e.getEntity()},function(r){var n=e.getEntityAt(r),o=a.stringify(n);!s[o]&&(s[o]=n,i[o]="".concat(l),l++)}),h(e,i,n,o)}),{blocks:n,entityMap:i}},d=function(e,r){var i=r.blocks,n=r.entityMap,o={};return Object.keys(n).forEach(function(r,i){var n=e.getEntity(a.unstringify(r));o[i]={type:n.getType(),mutability:n.getMutability(),data:n.getData()}}),{blocks:i,entityMap:o}};e.exports=function(e){var r={entityMap:{},blocks:[]};return r=p(e,r),r=d(e,r)}},79725:(e,r,i)=>{"use strict";i.d(r,{c_:()=>m});let n=(3+8881784197001252e-31)*11102230246251565e-32;function o(e,r,i,n,o){let a,s,l,u,c=r[0],h=n[0],p=0,d=0;h>c==h>-c?(a=c,c=r[++p]):(a=h,h=n[++d]);let f=0;if(p<e&&d<i)for(h>c==h>-c?(s=c+a,l=a-(s-c),c=r[++p]):(s=h+a,l=a-(s-h),h=n[++d]),a=s,0!==l&&(o[f++]=l);p<e&&d<i;)h>c==h>-c?(u=(s=a+c)-a,l=a-(s-u)+(c-u),c=r[++p]):(u=(s=a+h)-a,l=a-(s-u)+(h-u),h=n[++d]),a=s,0!==l&&(o[f++]=l);for(;p<e;)u=(s=a+c)-a,l=a-(s-u)+(c-u),c=r[++p],a=s,0!==l&&(o[f++]=l);for(;d<i;)u=(s=a+h)-a,l=a-(s-u)+(h-u),h=n[++d],a=s,0!==l&&(o[f++]=l);return(0!==a||0===f)&&(o[f++]=a),f}function a(e){return new Float64Array(e)}let s=(3+17763568394002505e-31)*11102230246251565e-32,l=(2+13322676295501878e-31)*11102230246251565e-32,u=(9+7105427357601002e-30)*11102230246251565e-32*11102230246251565e-32,c=a(4),h=a(8),p=a(12),d=a(16),f=a(4);function m(e,r,i,a,m,g){let _=(r-g)*(i-m),y=(e-m)*(a-g),v=_-y,x=Math.abs(_+y);return Math.abs(v)>=s*x?v:-function(e,r,i,a,s,m,g){let _,y,v,x,b,w,E,S,T,I,M,C,A,P,L,O,D,R,k=e-s,N=i-s,F=r-m,z=a-m;P=k*z,E=(w=0x8000001*k)-(w-k),S=k-E,T=(w=0x8000001*z)-(w-z),L=S*(I=z-T)-(P-E*T-S*T-E*I),O=F*N,E=(w=0x8000001*F)-(w-F),S=F-E,T=(w=0x8000001*N)-(w-N),M=L-(D=S*(I=N-T)-(O-E*T-S*T-E*I)),b=L-M,c[0]=L-(M+b)+(b-D),b=(C=P+M)-P,M=(A=P-(C-b)+(M-b))-O,b=A-M,c[1]=A-(M+b)+(b-O),b=(R=C+M)-C,c[2]=C-(R-b)+(M-b),c[3]=R;let B=function(e){let r=e[0];for(let i=1;i<4;i++)r+=e[i];return r}(c),U=l*g;if(B>=U||-B>=U||(b=e-k,_=e-(k+b)+(b-s),b=i-N,v=i-(N+b)+(b-s),b=r-F,y=r-(F+b)+(b-m),b=a-z,x=a-(z+b)+(b-m),0===_&&0===y&&0===v&&0===x)||(U=u*g+n*Math.abs(B),(B+=k*x+z*_-(F*v+N*y))>=U||-B>=U))return B;P=_*z,E=(w=0x8000001*_)-(w-_),S=_-E,T=(w=0x8000001*z)-(w-z),L=S*(I=z-T)-(P-E*T-S*T-E*I),O=y*N,E=(w=0x8000001*y)-(w-y),S=y-E,T=(w=0x8000001*N)-(w-N),M=L-(D=S*(I=N-T)-(O-E*T-S*T-E*I)),b=L-M,f[0]=L-(M+b)+(b-D),b=(C=P+M)-P,M=(A=P-(C-b)+(M-b))-O,b=A-M,f[1]=A-(M+b)+(b-O),b=(R=C+M)-C,f[2]=C-(R-b)+(M-b),f[3]=R;let j=o(4,c,4,f,h);P=k*x,E=(w=0x8000001*k)-(w-k),S=k-E,T=(w=0x8000001*x)-(w-x),L=S*(I=x-T)-(P-E*T-S*T-E*I),O=F*v,E=(w=0x8000001*F)-(w-F),S=F-E,T=(w=0x8000001*v)-(w-v),M=L-(D=S*(I=v-T)-(O-E*T-S*T-E*I)),b=L-M,f[0]=L-(M+b)+(b-D),b=(C=P+M)-P,M=(A=P-(C-b)+(M-b))-O,b=A-M,f[1]=A-(M+b)+(b-O),b=(R=C+M)-C,f[2]=C-(R-b)+(M-b),f[3]=R;let V=o(j,h,4,f,p);P=_*x,E=(w=0x8000001*_)-(w-_),S=_-E,T=(w=0x8000001*x)-(w-x),L=S*(I=x-T)-(P-E*T-S*T-E*I),O=y*v,E=(w=0x8000001*y)-(w-y),S=y-E,T=(w=0x8000001*v)-(w-v),M=L-(D=S*(I=v-T)-(O-E*T-S*T-E*I)),b=L-M,f[0]=L-(M+b)+(b-D),b=(C=P+M)-P,M=(A=P-(C-b)+(M-b))-O,b=A-M,f[1]=A-(M+b)+(b-O),b=(R=C+M)-C,f[2]=C-(R-b)+(M-b),f[3]=R;
113let G=o(V,p,4,f,d);return d[G-1]}(e,r,i,a,m,g,x)}a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(8),a(8),a(8),a(4),a(8),a(8),a(16),a(12),a(192),a(192),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(8),a(8),a(8),a(8),a(8),a(8),a(8),a(8),a(8),a(4),a(4),a(4),a(8),a(16),a(16),a(16),a(32),a(32),a(48),a(64),a(1152),a(1152),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(4),a(24),a(24),a(24),a(24),a(24),a(24),a(24),a(24),a(24),a(24),a(1152),a(1152),a(1152),a(1152),a(1152),a(2304),a(2304),a(3456),a(5760),a(8),a(8),a(8),a(16),a(24),a(48),a(48),a(96),a(192),a(384),a(384),a(384),a(768),a(96),a(96),a(96),a(1152)},79926:(e,r,i)=>{"use strict";i.d(r,{u:()=>l,y:()=>s});var n=i(37876),o=i(14232);let a=(0,o.createContext)(void 0);function s({children:e}){let[r,i]=(0,o.useState)([]),[l,u]=(0,o.useState)(""),[c,h]=(0,o.useState)(0),[p,d]=(0,o.useState)(null);return(0,n.jsx)(a.Provider,{value:{availableRoutes:r,currentRoute:l,currentChainage:c,currentLRS:p,setAvailableRoutes:i,setCurrentRoute:u,setCurrentChainage:h,setCurrentLRS:d},children:e})}function l(){let e=(0,o.useContext)(a);if(void 0===e)throw Error("useLRSContext must be used within a LRSContextProvider");return e}},80611:(e,r,i)=>{"use strict";var n=i(93023);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},80856:(e,r,i)=>{"use strict";i.d(r,{$$:()=>K,AT:()=>eo,Ce:()=>et,Dr:()=>em,Fq:()=>eR,Jd:()=>eV,Jr:()=>ed,M2:()=>eG,My:()=>eF,Nq:()=>ex,QL:()=>ej,Qb:()=>X,S$:()=>ea,S3:()=>eC,Sw:()=>eE,TG:()=>eP,T_:()=>ec,UE:()=>eL,Uz:()=>ew,W7:()=>ee,WU:()=>eN,Zg:()=>eT,dP:()=>Q,dW:()=>en,g6:()=>ei,gG:()=>Z,i7:()=>eO,iO:()=>ef,iT:()=>ey,jV:()=>ev,jw:()=>eA,kQ:()=>ez,lo:()=>eB,ly:()=>eM,md:()=>es,mt:()=>ek,n6:()=>eI,nW:()=>ep,nd:()=>eg,ni:()=>eb,o:()=>eu,pp:()=>J,pt:()=>eS,ss:()=>eD,xB:()=>eh,xH:()=>el,xY:()=>eU,y$:()=>e_,z:()=>er});var n,o,a,s,l,u,c,h,p,d,f,m,g,_,y,v,x,b,w,E,S,T,I,M,C,A,P,L,O,D,R,k,N,F,z,B,U,j,V,G,q,H,$,W,Y,Z=((n={}).user="user",n.admin="admin",n),X=((o={}).active="active",o.pending="pending",o),K=((a={}).default="default",a.model="model",a.ai="ai",a.luma="luma",a.scan="scan",a),Q=((s={}).note="note",s.alert="alert",s.las="las",s.measurement="measurement",s.layer="layer",s.tour="tour",s.delete_tour="delete tour",s),J=((l={}).notes="note_layer_point",l.alerts_point="alert_layer_point",l.alerts_polygon="alert_layer_polygon",l.measurements_polygon="measurement_layer_polygon",l.measurements_line="measurement_layer_linestring",l),ee=((u={}).cameraPoints="map-points",u.noteLayer="note-layer",u.noteLayer3D="3dnote-layer",u.alertLayer="alerts",u.measurementLayer="measurements",u.buildings="buildings",u.pointclouds="pointclouds",u),et=((c={}).note="0",c.alert="1",c);let er={NEXT:"next",PREV:"prev",NEXT10:"next100m",PREV10:"prev100m"};var ei=((h={}).SQL="sql",h.PDF="pdf",h),en=((p={}).LidarModal="LidarModal",p.HybridViewModal="HybridViewModal",p.CameraModal="CameraModal",p.EagleVueModal="EagleVueModal",p.NotesModal="NotesModal",p.Note3DModal="Note3DModal",p.AlertsModal="AlertsModal",p.CalendarModal="CalendarModal",p.AltCalendarModal="AltCalendarModal",p.LRSModal="LRSModal",p.MeasurementsModal="MeasurementsModal",p.GISModal="GISModal",p.PointcloudsModal="PointcloudsModal",p.MetadataModal="MetadataModal",p.PDFViewerModal="PDFViewerModal",p.DashboardModal="DashboardModal",p),eo=((d={}).none="0",d.default="1",d.custom="-1",d),ea=((f={})[f.gigabyte=0x40000000]="gigabyte",f[f.megabyte=1048576]="megabyte",f),es=((m={})[m.DEFAULT=0]="DEFAULT",m[m.VIDEO_TO_3D=1]="VIDEO_TO_3D",m[m.SCANNER=2]="SCANNER",m[m.EDIT=3]="EDIT",m),el=((g={}).email="login",g.microsoft="microsoft",g.google="google",g.apple="apple",g),eu=((_={}).like="like",_.dislike="dislike",_),ec=((y={}).users="users",y.name="name",y),eh=((v={}).asc="asc",v.dsc="dsc",v),ep=((x={}).processing="processing",x.upload_complete="upload_complete",x.complete="complete",x.error="error",x.processing_las="processing_las",x.processing_tour="processing_tour",x.cancelled="cancelled",x.deleting_tour="deleting_tour",x),ed=((b={}).premium="premium",b.trial="trial",b.basic="basic",b),ef=((w={}).processing="processing",w.initial="initial",w.complete="complete",w.failed="failed",w.cancelled="cancelled",w),em=((E={})[E.in_progress=0]="in_progress",E[E.complete=1]="complete",E[E.error=-1]="error",E[E.tour_indexing=2]="tour_indexing",E),eg=((S={}).gradient="gradient",S.categorical="categorical",S),e_=((T={}).color="Color",T.icon="Icon",T.gradient="Gradient",T.categorical="Categorical",T.line="Line",T.label="Label",T);let ey="/images/layer_icons/no-icon.svg";var ev=((I={}).ss="Single Solid",I.sda="Single Dashed",I.sdo="Single Dotted",I.ds="Double Solid",I),ex=((M={}).color="color",M.text="text",M),eb=((C={}).mm="mm",C.cm="cm",C.in="in",C.ft="ft",C),ew=((A={}).geojson="geojson",A.json="json",A.kml="kml",A.shp="shp",A.shx="shx",A.dbf="dbf",A.prj="prj",A.tif="tif",A.tiff="tiff",A.dxf="dxf",A.ifc="ifc",A.glb="glb",A.gltf="gltf",A.laz="laz",A.las="las",A.ply="ply",A.e57="e57",A.csv="csv",A.zip="zip",A),eE=((P={})[P.STANDALONE=-1]="STANDALONE",P[P.NOTE=0]="NOTE",P[P.ALERT=1]="ALERT",P),eS=((L={}).pdf="application/pdf",L),eT=((O={}).NORMAL="note-layer",O.THREE_D="3dnote-layer",O.AI="ainote-layer",O),eI=((D={}).NORMAL_ICON="note-layer",D.NORMAL_RED_DOT="red-dot-layer",D.NORMAL_CLUSTER_TEXT="cluster-note-text",D.NORMAL_CLUSTER_RED_DOT="cluster
113s-note-red-dot",D.NORMAL_CLUSTER_CIRCLE="clusters-note-circle",D.THREE_D_ICON="3dnote-layer",D.THREE_D_RED_DOT="3dnote-layer-red-dot",D.THREE_D_CLUSTER_TEXT="cluster-3dnote-text",D.THREE_D_CLUSTER_RED_DOT="clusters-3dnote-red-dot",D.THREE_D_CLUSTER_CIRCLE="clusters-3dnote-circle",D.AI_ICON="ainote-layer",D),eM=((R={}).NORMAL="alerts",R),eC=((k={}).POINT="point",k.CLUSTER="cluster",k.POLYGON="polygon",k),eA=((N={}).ICON="alerts-point-layer",N.RED_DOT="alert-red-dot-layer",N.CLUSTER_TEXT="cluster-alert-text",N.CLUSTER_CIRCLE="cluster-alert-circle",N.POLYGON="alerts-polygon-layer",N.POLYGON_ICON="alerts-polygon-layer-symbol",N.POLYGON_OUTLINE="alerts-polygon-layer-outline",N),eP=((F={}).note="note",F.alert="alert",F),eL=((z={}).asc="asc",z.desc="desc",z),eO=((B={}).Banner="banner",B.Box="dropdown",B),eD=((U={}).text="text",U.date="date",U.color="color",U.option="option",U.processingStatus="processing-status",U.attachment="attachment",U),eR=((j={}).canvas="canvas",j.screenshot="screenshot",j),ek=((V={}).tiff="tiff",V.pdf="pdf",V.png="png",V),eN=((G={}).Imperial="Imperial",G.Metric="Metric",G),eF=((q={}).Distance="distance",q.Time="time",q),ez=((H={}).Driving="driving",H.DrivingTraffic="driving-traffic",H.Walking="walking",H.Cycling="cycling",H),eB=(($={}).LineString="LineString",$.Polygon="Polygon",$.Point="Point",$),eU=((W={}).DISTANCE_TOOL="distance_tool",W.AREA_TOOL="area_tool",W.POINT_TOOL="point_tool",W.ADD_LINE="add_line",W.ADD_POLYGON="add_polygon",W.ADD_POINT="add_point",W);let ej={distance_tool:"draw_line_string",area_tool:"draw_polygon",point_tool:"draw_point",add_line:"draw_line_string",add_polygon:"draw_polygon",add_point:"draw_point"},eV={LineString:"add_line",Polygon:"add_polygon",Point:"add_point"};var eG=((Y={}).ADD="add",Y.DELETE="delete",Y.EXIT="exit",Y)},80985:(e,r,i)=>{"use strict";var n=i(45525),o=i(27239),a=i(96058)(),s=i(10221),l=i(65865),u=n("%Math.floor%");e.exports=function(e,r){if("function"!=typeof e)throw new l("`fn` is not a function");if("number"!=typeof r||r<0||r>0xffffffff||u(r)!==r)throw new l("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&s){var h=s(e,"length");h&&!h.configurable&&(n=!1),h&&!h.writable&&(c=!1)}return(n||c||!i)&&(a?o(e,"length",r,!0,!0):o(e,"length",r)),e}},81370:(e,r)=>{"use strict";r.byteLength=function(e){var r=u(e),i=r[0],n=r[1];return(i+n)*3/4-n},r.toByteArray=function(e){var r,i,a=u(e),s=a[0],l=a[1],c=new o((s+l)*3/4-l),h=0,p=l>0?s-4:s;for(i=0;i<p;i+=4)r=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],c[h++]=r>>16&255,c[h++]=r>>8&255,c[h++]=255&r;return 2===l&&(r=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,c[h++]=255&r),1===l&&(r=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,c[h++]=r>>8&255,c[h++]=255&r),c},r.fromByteArray=function(e){for(var r,n=e.length,o=n%3,a=[],s=0,l=n-o;s<l;s+=16383)a.push(function(e,r,n){for(var o,a=[],s=r;s<n;s+=3)o=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(i[o>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}(e,s,s+16383>l?l:s+16383));return 1===o?a.push(i[(r=e[n-1])>>2]+i[r<<4&63]+"=="):2===o&&a.push(i[(r=(e[n-2]<<8)+e[n-1])>>10]+i[r>>4&63]+i[r<<2&63]+"="),a.join("")};for(var i=[],n=[],o="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)i[s]=a[s],n[a.charCodeAt(s)]=s;function u(e){var r=e.length;if(r%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=r);var n=i===r?0:4-i%4;return[i,n]}n[45]=62,n[95]=63},82326:(e,r,i)=>{"use strict";i(23588),e.exports=function(e,r){var i=e.getSelection(),n=e.getCurrentContent(),o=i.getStartKey(),a=i.getStartOffset(),s=o,l=0;if(r>a){var u=n.getKeyBefore(o);null==u?s=o:(s=u,l=n.getBlockForKey(u).getText().length)}else l=a-r;return i.merge({focusKey:s,focusOffset:l,isBackward:!0})}},82909:(e,r,i)=>{"use strict";let n=i(81370),o=i(87247),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>
vendor: 21,046 bytes, line 113
1130x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,l.prototype),r}function l(e,r,i){if("number"==typeof e){if("string"==typeof r)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,r,i)}function u(e,r,i){if("string"==typeof e){var n=e,o=r;if(("string"!=typeof o||""===o)&&(o="utf8"),!l.isEncoding(o))throw TypeError("Unknown encoding: "+o);let i=0|m(n,o),a=s(i),u=a.write(n,o);return u!==i&&(a=a.slice(0,u)),a}if(ArrayBuffer.isView(e)){var a=e;if(z(a,Uint8Array)){let e=new Uint8Array(a);return d(e.buffer,e.byteOffset,e.byteLength)}return p(a)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return d(e,r,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return l.from(u,r,i);let c=function(e){if(l.isBuffer(e)){let r=0|f(e.length),i=s(r);return 0===i.length||e.copy(i,0,0,r),i}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(c)return c;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),r,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),s(e<0?0:0|f(e))}function p(e){let r=e.length<0?0:0|f(e.length),i=s(r);for(let n=0;n<r;n+=1)i[n]=255&e[n];return i}function d(e,r,i){let n;if(r<0||e.byteLength<r)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===r&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,r):new Uint8Array(e,r,i),l.prototype),n}function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function m(e,r){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;let o=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(e).length;default:if(o)return n?-1:k(e).length;r=(""+r).toLowerCase(),o=!0}}function g(e,r,i){let o=!1;if((void 0===r||r<0)&&(r=0),r>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(r>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,r,i){let n=e.length;(!r||r<0)&&(r=0),(!i||i<0||i>n)&&(i=n);let o="";for(let n=r;n<i;++n)o+=B[e[n]];return o}(this,r,i);case"utf8":case"utf-8":return x(this,r,i);case"ascii":return function(e,r,i){let n="";i=Math.min(e.length,i);for(let o=r;o<i;++o)n+=String.fromCharCode(127&e[o]);return n}(this,r,i);case"latin1":case"binary":return function(e,r,i){let n="";i=Math.min(e.length,i);for(let o=r;o<i;++o)n+=String.fromCharCode(e[o]);return n}(this,r,i);case"base64":var a,s,l;return a=this,s=r,l=i,0===s&&l===a.length?n.fromByteArray(a):n.fromByteArray(a.slice(s,l));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,r,i){let n=e.slice(r,i),o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}(this,r,i);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function _(e,r,i){let n=e[r];e[r]=e[i],e[i]=n}function y(e,r,i,n,o){var a;if(0===e.length)return -1;if("string"==typeof i?(n=i,i=0):i>0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),(a=i*=1)!=a&&(i=o?0:e.length-1),i<0&&(i=e.length+i),i>=e.length)if(o)return -1;else i=e.length-1;else if(i<0)if(!o)return -1;else i=0;if("string"==typeof r&&(r=l.from(r,n)),l.isBuffer(r))return 0===r.length?-1:v(e,r,i,n,o);if("number"==typeof r){if(r&=255,"function"==typeof Uint8Array.prototype.indexOf)if(o)return Uint8Array.prototype.indexOf.call(e,r,i);else return Uint8Array.prototype.lastIndexOf.call(e,r,i);return v(e,[r],i,n,o)}throw TypeError("val must be string, number or Buffer")}function v(e,r,i,n,o){let a,s=1,l=e.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||r.length<2)return -1;s=2,l/=2,u/=2,i/=2}function c(e,r){return 1===s?e[r]:e.readUInt16BE(r*s)}if(o){let n=-1;for(a=i;a<l;a++)if(c(e,a)===c(r,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===u)return n*s}else -1!==n&&(a-=a-n),n=-1}else for(i+u>l&&(i=l-u),a=i;a>=0;a--){let i=!0;for(let n=0;n<u;n++)if(c(e,a+n)!==c(r,n)){i=!1;break}if(i)return a}return -1}function x(e,r,i){i=Math.min(e.length,i);let n=[],o=r;for(;o<i;){let r=e[o],a=null,s=r>239?4:r>223?3:r>191?2:1;if(o+s<=i){let i,n,l,u;switch(s){case 1:r<128&&(a=r);break;case 2:(192&(i=e[o+1]))==128&&(u=(31&r)<<6|63&i)>127&&(a=u);break;case 3:i=e[o+1],n=e[o+2],(192&i)==128&&(192&n)==128&&(u=(15&r)<<12|(63&i)<<6|63&n)>2047&&(u<55296||u>57343)&&(a=u);break;case 4:i=e[o+1],n=e[o+2],l=e[o+3],(192&i)==128&&(192&n)==128&&(192&l)==128&&(u=(15&r)<<18|(63&i)<<12|(63&n)<<6|63&l)>65535&&u<1114112&&(a=u)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=s}var a=n;let s=a.length;if(s<=4096)return String.fromCharCode.apply(String,a);let l="",u=0;for(;u<s;)l+=String.fromCharCode.apply(String,a.slice(u,u+=4096));return l}function b(e,r,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+r>i)throw RangeError("Trying to access beyond buffer length")}function w(e,r,i,n,o,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw RangeError('"value" argument is out of bounds');if(i+n>e.length)throw RangeError("Index out of range")}function E(e,r,i,n,o){L(r,n,o,e,i,7);let a=Number(r&BigInt(0xffffffff));e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a;let s=Number(r>>BigInt(32)&BigInt(0xffffffff));return e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s,i}function S(e,r,i,n,o){L(r,n,o,e,i,7);let a=Number(r&BigInt(0xffffffff));e[i+7]=a,a>>=8,e[i+6]=a,a>>=8,e[i+5]=a,a>>=8,e[i+4]=a;let s=Number(r>>BigInt(32)&BigInt(0xffffffff));return e[i+3]=s,s>>=8,e[i+2]=s,s>>=8,e[i+1]=s,s>>=8,e[i]=s,i+8}function T(e,r,i,n,o,a){if(i+n>e.length||i<0)throw RangeError("Index out of range")}function I(e,r,i,n,a){return r*=1,i>>>=0,a||T(e,r,i,4,34028234663852886e22,-34028234663852886e22),o.write(e,r,i,n,23,4),i+4}function M(e,r,i,n,a){return r*=1,i>>>=0,a||T(e,r,i,8,17976931348623157e292,-17976931348623157e292),o.write(e,r,i,n,52,8),i+8}r.hp=l,r.IS=50,l.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),42===e.foo()}catch(e){return!1}}(),!l.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,r,i){return u(e,r,i)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,r,i){return(c(e),e<=0)?s(e):void 0!==r?"string"==typeof i?s(e).fill(r,i):s(e).fill(r):s(e)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,r){if(z(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),z(r,Uint8Array)&&(r=l.from(r,r.offset,r.byteLength)),!l.isBuffer(e)||!l.isBuffer(r))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:+(n<i)},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,r){let i;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);if(void 0===r)for(i=0,r=0;i<e.length;++i)r+=e[i].length;let n=l.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let r=e[i];if(z(r,Uint8Array))o+r.length>n.length?(l.isBuffer(r)||(r=l.from(r)),r.copy(n,o)):Uint8Array.prototype.set.call(n,r,o);else if(l.isBuffer(r))r.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=r.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)_(this,r,r+1);return this},l.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)_(this,r,r+3),_(this,r+1,r+2);return this},l.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)_(this,r,r+7),_(this,r+1,r+6),_(this,r+2,r+5),_(this,r+3,r+4);return this},l.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?x(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="",i=r.IS;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,r,i,n,o){if(z(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return -1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,s=i-r,u=Math.min(a,s),c=this.slice(n,o),h=e.slice(r,i);for(let e=0;e<u;++e)if(c[e]!==h[e]){a=c[e],s=h[e];break}return a<s?-1:+(s<a)},l.prototype.includes=function(e,r,i){return -1!==this.indexOf(e,r,i)},l.prototype.indexOf=function(e,r,i){return y(this,e,r,i,!0)},l.prototype.lastIndexOf=function(e,r,i){return y(this,e,r,i,!1)},l.prototype.write=function(e,r,i,n){var o,a,s,l,u,c,h,p;if(void 0===r)n="utf8",i=this.length,r=0;else if(void 0===i&&"string"==typeof r)n=r,i=this.length,r=0;else if(isFinite(r))r>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let d=this.length-r;if((void 0===i||i>d)&&(i=d),e.length>0&&(i<0||r<0)||r>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let f=!1;for(;;)switch(n){case"hex":return function(e,r,i,n){let o;i=Number(i)||0;let a=e.length-i;n?(n=Number(n))>a&&(n=a):n=a;let s=r.length;for(n>s/2&&(n=s/2),o=0;o<n;++o){var l;let n=parseInt(r.substr(2*o,2),16);if((l=n)!=l)break;e[i+o]=n}return o}(this,e,r,i);case"utf8":case"utf-8":return o=r,a=i,F(k(e,this.length-o),this,o,a);case"ascii":case"latin1":case"binary":return s=r,l=i,F(function(e){let r=[];for(let i=0;i<e.length;++i)r.push(255&e.charCodeAt(i));return r}(e),this,s,l);case"base64":return u=r,c=i,F(N(e),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=r,p=i,F(function(e,r){let i,n,o=[];for(let a=0;a<e.length&&!((r-=2)<0);++a)n=(i=e.charCodeAt(a))>>8,o.push(i%256),o.push(n);return o}(e,this.length-h),this,h,p);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,r){let i=this.length;e=~~e,r=void 0===r?i:~~r,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),r<0?(r+=i)<0&&(r=0):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,r,i){e>>>=0,r>>>=0,i||b(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,r,i){e>>>=0,r>>>=0,i||b(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,r){return e>>>=0,r||b(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,r){return e>>>=0,r||b(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,r){return e>>>=0,r||b(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,r){return e>>>=0,r||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,r){return e>>>=0,r||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=U(function(e){O(e>>>=0,"offset");let r=this[e],i=this[e+7];(void 0===r||void 0===i)&&D(e,this.length-8);let n=r+256*this[++e]+65536*this[++e]+0x1000000*this[++e],o=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*i;return BigInt(n)+(BigInt(o)<<BigInt(32))}),l.prototype.readBigUInt64BE=U(function(e){O(e>>>=0,"offset");let r=this[e],i=this[e+7];(void 0===r||void 0===i)&&D(e,this.length-8);let n=0x1000000*r+65536*this[++e]+256*this[++e]+this[++e],o=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+i;return(BigInt(n)<<BigInt(32))+BigInt(o)}),l.prototype.readIntLE=function(e,r,i){e>>>=0,r>>>=0,i||b(e,r,this.length);let n=this[e],o=1,a=0;for(;++a<r&&(o*=256);)n+=this[e+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},l.prototype.readIntBE=function(e,r,i){e>>>=0,r>>>=0,i||b(e,r,this.length);let n=r,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*r)),a},l.prototype.readInt8=function(e,r){return(e>>>=0,r||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,r){e>>>=0,r||b(e,2,this.length);let i=this[e]|this[e+1]<<8;return 32768&i?0xffff0000|i:i},l.prototype.readInt16BE=function(e,r){e>>>=0,r||b(e,2,this.length);let i=this[e+1]|this[e]<<8;return 32768&i?0xffff0000|i:i},l.prototype.readInt32LE=function(e,r){return e>>>=0,r||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,r){return e>>>=0,r||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=U(function(e){O(e>>>=0,"offset");let r=this[e],i=this[e+7];return(void 0===r||void 0===i)&&D(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(i<<24))<<BigInt(32))+BigInt(r+256*this[++e]+65536*this[++e]+0x1000000*this[++e])}),l.prototype.readBigInt64BE=U(function(e){O(e>>>=0,"offset");let r=this[e],i=this[e+7];return(void 0===r||void 0===i)&&D(e,this.length-8),(BigInt((r<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+i)}),l.prototype.readFloatLE=function(e,r){return e>>>=0,r||b(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,r){return e>>>=0,r||b(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,r){return e>>>=0,r||b(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,r){return e>>>=0,r||b(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,r,i,n){if(e*=1,r>>>=0,i>>>=0,!n){let n=Math.pow(2,8*i)-1;w(this,e,r,i,n,0)}let o=1,a=0;for(this[r]=255&e;++a<i&&(o*=256);)this[r+a]=e/o&255;return r+i},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,r,i,n){if(e*=1,r>>>=0,i>>>=0,!n){let n=Math.pow(2,8*i)-1;w(this,e,r,i,n,0)}let o=i-1,a=1;for(this[r+o]=255&e;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+i},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,1,255,0),this[r]=255&e,r+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,2,65535,0),this[r]=255&e,this[r+1]=e>>>8,r+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=255&e,r+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,4,0xffffffff,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e,r+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,4,0xffffffff,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e,r+4},l.prototype.writeBigUInt64LE=U(function(e,r=0){return E(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=U(function(e,r=0){return S(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,r,i,n){if(e*=1,r>>>=0,!n){let n=Math.pow(2,8*i-1);w(this,e,r,i,n-1,-n)}let o=0,a=1,s=0;for(this[r]=255&e;++o<i&&(a*=256);)e<0&&0===s&&0!==this[r+o-1]&&(s=1),this[r+o]=(e/a|0)-s&255;return r+i},l.prototype.writeIntBE=function(e,r,i,n){if(e*=1,r>>>=0,!n){let n=Math.pow(2,8*i-1);w(this,e,r,i,n-1,-n)}let o=i-1,a=1,s=0;for(this[r+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[r+o+1]&&(s=1),this[r+o]=(e/a|0)-s&255;return r+i},l.prototype.writeInt8=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=255&e,r+1},l.prototype.writeInt16LE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,2,32767,-32768),this[r]=255&e,this[r+1]=e>>>8,r+2},l.prototype.writeInt16BE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=255&e,r+2},l.prototype.writeInt32LE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,4,0x7fffffff,-0x80000000),this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},l.prototype.writeInt32BE=function(e,r,i){return e*=1,r>>>=0,i||w(this,e,r,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e,r+4},l.prototype.writeBigInt64LE=U(function(e,r=0){return E(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=U(function(e,r=0){return S(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,r,i){return I(this,e,r,!0,i)},l.prototype.writeFloatBE=function(e,r,i){return I(this,e,r,!1,i)},l.prototype.writeDoubleLE=function(e,r,i){return M(this,e,r,!0,i)},l.prototype.writeDoubleBE=function(e,r,i){return M(this,e,r,!1,i)},l.prototype.copy=function(e,r,i,n){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||0===e.length||0===this.length)return 0;if(r<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o},l.prototype.fill=function(e,r,i,n){let o;if("string"==typeof e){if("string"==typeof r?(n=r,r=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let r=e.charCodeAt(0);("utf8"===n&&r<128||"latin1"===n)&&(e=r)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw RangeError("Out of range index");if(i<=r)return this;if(r>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=r;o<i;++o)this[o]=e;else{let a=l.isBuffer(e)?e:l.from(e,n),s=a.length;
113if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=a[o%s]}return this};let C={};function A(e,r,i){C[e]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function P(e){let r="",i=e.length,n=+("-"===e[0]);for(;i>=n+4;i-=3)r=`_${e.slice(i-3,i)}${r}`;return`${e.slice(0,i)}${r}`}function L(e,r,i,n,o,a){if(e>i||e<r){let n,o="bigint"==typeof r?"n":"";throw n=a>3?0===r||r===BigInt(0)?`>= 0${o} and < 2${o} ** ${(a+1)*8}${o}`:`>= -(2${o} ** ${(a+1)*8-1}${o}) and < 2 ** ${(a+1)*8-1}${o}`:`>= ${r}${o} and <= ${i}${o}`,new C.ERR_OUT_OF_RANGE("value",n,e)}O(o,"offset"),(void 0===n[o]||void 0===n[o+a])&&D(o,n.length-(a+1))}function O(e,r){if("number"!=typeof e)throw new C.ERR_INVALID_ARG_TYPE(r,"number",e)}function D(e,r,i){if(Math.floor(e)!==e)throw O(e,i),new C.ERR_OUT_OF_RANGE(i||"offset","an integer",e);if(r<0)throw new C.ERR_BUFFER_OUT_OF_BOUNDS;throw new C.ERR_OUT_OF_RANGE(i||"offset",`>= ${+!!i} and <= ${r}`,e)}A("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),A("ERR_INVALID_ARG_TYPE",function(e,r){return`The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError),A("ERR_OUT_OF_RANGE",function(e,r,i){let n=`The value of "${e}" is out of range.`,o=i;return Number.isInteger(i)&&Math.abs(i)>0x100000000?o=P(String(i)):"bigint"==typeof i&&(o=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(o=P(o)),o+="n"),n+=` It must be ${r}. Received ${o}`},RangeError);let R=/[^+/0-9A-Za-z-_]/g;function k(e,r){let i;r=r||1/0;let n=e.length,o=null,a=[];for(let s=0;s<n;++s){if((i=e.charCodeAt(s))>55295&&i<57344){if(!o){if(i>56319||s+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=i;continue}if(i<56320){(r-=3)>-1&&a.push(239,191,189),o=i;continue}i=(o-55296<<10|i-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,i<128){if((r-=1)<0)break;a.push(i)}else if(i<2048){if((r-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((r-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((r-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return a}function N(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,r,i,n){let o;for(o=0;o<n&&!(o+i>=r.length)&&!(o>=e.length);++o)r[o+i]=e[o];return o}function z(e,r){return e instanceof r||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===r.name}let B=function(){let e="0123456789abcdef",r=Array(256);for(let i=0;i<16;++i){let n=16*i;for(let o=0;o<16;++o)r[n+o]=e[i]+e[o]}return r}();function U(e){return"u"<typeof BigInt?j:e}function j(){throw Error("BigInt not supported")}},83176:e=>{"use strict";var r=/-(.)/g;e.exports=function(e){return e.replace(r,function(e,r){return r.toUpperCase()})}},83964:(e,r,i)=>{"use strict";i.d(r,{AP:()=>C,Cq:()=>P,HN:()=>N,Lz:()=>M,Mn:()=>L,QT:()=>S,QY:()=>A,R7:()=>D,TD:()=>R,VZ:()=>T,Z_:()=>k,a7:()=>x,aM:()=>E,pQ:()=>I,qe:()=>b});var n=i(84412),o=i(80856),a=i(59411),s=i(85428),l=i(7121),u=i(10841),c=i.n(u),h=i(92909),p=i(23323);let d=new Map,f=[],m=!1,g=null,_=[],y=!1,v=0,x=8,b=[{label:"Issuer",columnId:"issuer",getValueAsString:e=>e.properties.issuer},{label:"Category",columnId:"category",getValueAsString:e=>e.properties.category},{label:"Title",columnId:"title",getValueAsString:e=>e.properties.title},{label:"Description",columnId:"description",getValueAsString:e=>e.properties.description},{label:"Time",columnId:"create_date",getValueAsString:e=>c()(e.create_date).format("YYYY-MM-DD HH:mm:ss")},{label:"Reviewed",columnId:"reviewed",getValueAsString:e=>e.reviewed?"Yes":"No"},{label:"Severity",columnId:"severity",getValueAsString:e=>(0,s.Wl)(e.properties.severity)},{label:"Verify",columnId:"verify_status",getValueAsString:e=>e.properties.verify_status??"Unset"}],w=()=>{for(;_.length>0;){let{resolve:e}=_.shift();
113e(Array.from(d.values()))}},E=e=>{let r=m?(0,a.a)(f):(0,a.g)(Array.from(d.values()));(0,l.US)(e,o.ly.NORMAL,r)},S=async(e,r)=>{await D(r,e,!0),E(e)},T=(e,r)=>{d.has(r.id)||(d.set(r.id,r),E(e))},I=(e,r)=>{r.forEach(e=>{d.has(e)&&d.delete(e)}),E(e)},M=async(e,r,i,n)=>{let o=d.get(r);if(o){let r=new Set(o.notification_ids||[]);i?.length&&i.forEach(e=>r.delete(e)),n?.length&&n.forEach(e=>r.add(e)),o.notification_ids=Array.from(r),E(e)}},C=(e,r)=>{r.forEach(e=>{let r=d.get(e.id);if(r){let i={...r,...e,properties:{...r.properties,...e.properties}};d.set(e.id,i)}}),E(e)},A=(e,r)=>{if(!r)return!1;let i=null!=r.reviewed;return e.some(e=>(0,h.ur)(e,i))},P=async(e,r,i=!1)=>{let n;g&&(g.abort("New fetch made"),w()),g=new AbortController,e={...e,screen:(0,s.i6)(r),doubleBB:!0};let o="number"==typeof(n=r?.current?.getZoom?.())&&n<x?Number((x-n+1).toFixed(2)):void 0,a=await L(e,null,!0,void 0,o),l=Array.isArray(a)?a:[],u=Array.isArray(a)&&l.every(e=>e&&"count"in e&&"centroid"in e),c="clusters"in a?a.clusters:[],h="alerts"in a?a.alerts:[],p=void 0!==o&&(u||!Array.isArray(a)&&"clusters"in a);return(i&&(v=0,d.clear(),f=[]),p)?(m=!0,f=c,[]):(m=!1,f=[],d.clear(),v=0,h.forEach(e=>{e.notification_ids=e.notification_ids??[];let r=d.get(e.id);if(r){let i=e.notification_ids.length-(r.notification_ids?.length??0);v+i<=2e3?v+=i:e.notification_ids=r.notification_ids}else v+e.notification_ids.length<2e3?v+=e.notification_ids.length:e.notification_ids=[];d.set(e.id,e)}),Array.from(d.values()))};async function L(e,r,i,n,o){try{let a=e?{...e,screen:i?e.screen:void 0}:void 0,l=(0,s.Ky)().project_uuid;if(void 0===o)return await (0,p.x)("/alert/filter",{method:"POST",json:{project_id:l,range:n,filterOptions:a,sortConfig:r??void 0}});return await (0,p.x)("/alert/clusters",{method:"POST",json:{projectId:l,clusteringFactor:o,filterOptions:a}})}catch(e){return console.error("Request failed:",e),{alerts:[],count:0}}}let O=async(e,r,i=!1)=>
113{if(y||0===_.length)return[];let{resolve:n}=_.shift();y=!0;let o=[];try{o=await P(e,r,i)}finally{y=!1,n(o),O(e,r,i)}},D=(e,r,i=!1)=>(w(),_=[],new Promise(n=>{_.push({resolve:n}),O(e,r,i)})),R=async e=>{let r=JSON.parse(localStorage.getItem("project")??"{}"),i=r?.container_name;try{let r=new URLSearchParams({alerts:JSON.stringify(e),container_name:i??""});return await (0,p.x)(`${n.fn}/alert/delete?${r.toString()}`,{method:"DELETE"}),(0,s.By)(),!0}catch(e){return console.error("Request failed:",e),!1}};function k(e){let r=b.map(e=>"verify_status"===e.columnId?{...e,getValueAsString:e=>e.properties.verify_status??""}:e);return{fields:r.map(e=>e.label),data:e.map(e=>r.map(r=>r.getValueAsString(e)))}}let N=(e,r)=>{let i=e.geometry;switch(i.type){case"Point":return i.coordinates.slice();case"Polygon":return r?[r.lng,r.lat]:i.coordinates[0][0];default:return r?[r.lng,r.lat]:[0,0]}}},84091:(e,r,i)=>{"use strict";i.d(r,{y:()=>x});var n=i(80856);function o(e,r,i){let n=(e.getStyle()?.layers??[]).map(e=>e.id),o=r.filter(r=>!!e.getLayer(r));if(0===o.length)return;let a=new Set(o),s=n.filter(e=>!a.has(e)),l=i?s.indexOf(i):-1,u=-1===l?s.length:l,c=[...s.slice(0,u),...o,...s.slice(u)];c.length===n.length&&c.every((e,r)=>e===n[r])||o.forEach(r=>{try{e.moveLayer(r,i)}catch(e){console.warn(`Failed to move layer ${r}:`,e)}})}let a=e=>"raster"===e.type&&"string"==typeof e.source&&e.source===`${e.id}-source`,s=new Set(["elevation-points","elevation-lines"]),l=e=>new Map(e.flatMap(([e,r])=>e.map(e=>[e,r]))),u=new Set(Object.values(n.Zg)),c=l([[[n.n6.NORMAL_ICON,n.n6.THREE_D_ICON,n.n6.AI_ICON],"note-icon"],[[n.n6.NORMAL_CLUSTER_CIRCLE,n.n6.THREE_D_CLUSTER_CIRCLE],"note-cluster-circle"],[[n.n6.NORMAL_CLUSTER_TEXT,n.n6.THREE_D_CLUSTER_TEXT],"note-cluster-text"],[[n.n6.NORMAL_RED_DOT,n.n6.THREE_D_RED_DOT,n.n6.NORMAL_CLUSTER_RED_DOT,n.n6.THREE_D_CLUSTER_RED_DOT],"note-red-dot"]]),h=new Set(Object.values(n.jw)),p=["alerts-","cluster-alert-"],d=l([[[n.jw.POLYGON],"alert-polygon"],[[n.jw.POLYGON_OUTLINE],"alert-polygon-outline"],[[n.jw.ICON,n.jw.POLYGON_ICON],"alert-icon"],[[n.jw.CLUSTER_CIRCLE],"alert-cluster-circle"],[[n.jw.CLUSTER_TEXT],"alert-cluster-text"],[[n.jw.RED_DOT],"alert-red-dot"]]),f=l([[["polygon-layer"],"measurement-polygon"],[["line-layer"],"measurement-line"],[["point-layer"],"measurement-point"],[["polygon-layer-labels"],"measurement-polygon-label"],[["line-layer-labels"],"measurement-line-label"]]),m="-source",g=["geotiff","vector-polygon-fill","vector-polygon-stroke","vector-line-halo","vector-line","vector-point-halo","vector-point","vector-icon-halo","vector-icon"],_=new Set([0]),y=(e,r,i,n)=>{if(0===r.length)return i;let a=i??n;return void 0!==a&&o(e,r,a),r[0]},v=(e,r,i)=>(o(e,r,i),r.length>0?r[0]:i),x=e=>{let r,i,n,o,l;if(!e||"function"!=typeof e.getStyle)return;try{r=e.getStyle()?.layers??[]}catch{return}if(0===r.length)return;let{rasterLayerIds:x,geometryBandLayerIds:b,systemGeometryLayerIds:w,systemIconLayerIds:E,systemLabelLayerIds:S,drawLayerIds:T}=(i=new Map((C=r).map(e=>[e.id,e])),n=new Map(C.map((e,r)=>[e.id,r])),o={raster:[],geotiff:[],draw:[],"note-icon":[],"note-cluster-circle":[],"note-cluster-text":[],"note-red-dot":[],"alert-polygon":[],"alert-polygon-outline":[],"alert-icon":[],"alert-cluster-circle":[],"alert-cluster-text":[],"alert-red-dot":[],"measurement-polygon":[],"measurement-line":[],"measurement-point":[],"measurement-polygon-label":[],"measurement-line-label":[],"vector-polygon-fill":[],"vector-polygon-stroke":[],"vector-line":[],"vector-line-halo":[],"vector-point":[],"vector-point-halo":[],"vector-icon":[],"vector-icon-halo":[],"vector-label":[]},C.forEach(e=>{let r=((e,r)=>{let{id:i}=e;if(i.startsWith("gl-draw-")||s.has(i))return"draw";if("string"==typeof e.source&&u.has(e.source))return c.get(i)??null;if(f.has(i))return f.get(i)??null;if(h.has(i)||p.some(e=>i.startsWith(e)))return d.get(i)??"alert-icon";if(a(e))return"geotiff";if("raster"===e.type&&!a(e)&&"string"==typeof e.source&&e.source===e.id)return"raster";if((e=>{if(!e.type||!["fill","line","circle","symbol"].includes(e.type)||"string"!=typeof e.source||!e.source.endsWith(m))return!1;let r=e.source.slice(0,-m.length);return e.id===r||e.id.startsWith(`${r}-`)})(e)){let i=e.id;if(i.endsWith("-vector-label"))return"vector-label";if(i.endsWith("-stroke"))return"vector-polygon-stroke";if(i.endsWith("-halo")){if("line"===e.type)return"vector-line-halo";let n=r.get(i.slice(0,-5));return n?.type==="symbol"?"vector-icon-halo":"vector-point-halo"}return"fill"===e.type?"vector-polygon-fill":"line"===e.type?"vector-line":"circle"===e.type?"vector-point":"symbol"===e.type?"vector-icon":null}return null})(e,i);r&&o[r].push(e.id)}),{rasterLayerIds:o.raster,geometryBandLayerIds:[...(l=new Map,g.forEach((e,r)=>
113{o[e].forEach(e=>{let o=i.get(e);if(!o)return;let a="string"==typeof o.source&&o.source.endsWith(m)?o.source.slice(0,-m.length):o.id,s={rank:r,id:e,index:n.get(e)??0},u=l.get(a);u?u.push(s):l.set(a,[s])})}),[...l.values()].sort((e,r)=>Math.min(...e.map(e=>e.index))-Math.min(...r.map(e=>e.index))).flatMap(e=>e.slice().sort((e,r)=>e.rank-r.rank).map(e=>e.id))),...o["alert-polygon"],...o["alert-polygon-outline"],...o["measurement-polygon"]],systemGeometryLayerIds:[...o["measurement-line"],...o["measurement-point"]],systemIconLayerIds:[...o["alert-icon"],...o["alert-cluster-circle"],...o["alert-cluster-text"],...o["alert-red-dot"],...o["note-icon"],...o["note-cluster-circle"],...o["note-cluster-text"],...o["note-red-dot"]],systemLabelLayerIds:[...o["vector-label"],...o["measurement-polygon-label"],...o["measurement-line-label"]],drawLayerIds:o.draw}),I=new Set([...x,...b,...w,...E,...S,...T]),M=r.find(e=>!I.has(e.id)&&e.id.includes("label"))?.id;var C,A=[x,b,w,E,S,T];let P,L=M;for(let r=A.length-1;r>=0;r--){let i=A[r];_.has(r)?L=y(e,i,L,P):P=v(e,i,P)}}},84412:(e,r,i)=>{"use strict";i.d(r,{Et:()=>x,Km:()=>o,PW:()=>_,Rt:()=>c,Sl:()=>S,U6:()=>b,Z7:()=>l,d:()=>y,dH:()=>d,ff:()=>M,fn:()=>u,gV:()=>g,gq:()=>T,m8:()=>I,no:()=>E,oj:()=>h,qn:()=>f,sS:()=>v,sc:()=>m,u3:()=>p,xD:()=>w,xe:()=>C,xv:()=>a});var n=i(99742),o="prod";let a="",s=n.env.NEXT_PUBLIC_MAPBOX_LOCAL_TOKEN,l=I(),u="test"===o?"http://localhost:4321":I()+"/express",c=function(){switch(o){case"test":case"dev":return"https://ttdevopscusdevwebapp-fusionmap-nginx.azurewebsites.net/geoserver";case"beta":return"https://ttdevopseus2testwebapp-fusionmap-eceahnfufkhua4a2.eastus2-01.azurewebsites.net/geoserver";case"prod":return"https://ttdevopscusprodwebapp-fusionmap-nginx.azurewebsites.net/geoserver";case"ca-prod":return"https://ttdevopscacprodwebapp-fusionmap-nginx.azurewebsites.net/geoserver";case"au-prod":return"https://ttdevopsaueprodrgwebapp-fusionmap-nginx.azurewebsites.net/geoserver";case"uk-prod":return"https://ttdevopsuksprodwebapp-fusionmap-nginx.azurewebsites.net/geoserver";default:return""}}(),h=function(){switch(o){case"test":case"dev":return"https://ttdevopsusdevsadsfmap1.blob.core.windows.net/";case"prod":return"https://ttdevopssadsfmap1.blob.core.windows.net/";case"ca-prod":return"https://ttdevopscacprodsadsfmap1.blob.core.windows.net/";case"au-prod":return"https://ttdevopsaueprodsadsfmap1.blob.core.windows.net/";case"uk-prod":return"https://ttdevopsuksprodsadsfmap1.blob.core.windows.net/";case"beta":return"https://ttdveus2testsadsfmap1.blob.core.windows.net/";default:return""}}(),p=function(){switch(o){case"prod":return{proxied:"https://us.fusionmap.com/dashboardadmin",non_proxied:"https://ttdevopscusprodwebapp-fusionmap-sdk.azurewebsites.net"};case"ca-prod":return{proxied:"https://ca.fusionmap.com/dashboardadmin",non_proxied:"https://ttdevopscacprodwebapp-fusionmap-sdk.azurewebsites.net"};case"au-prod":return{proxied:"https://au.fusionmap.com/dashboardadmin",non_proxied:"https://ttdevopsaueprodwebapp-fusionmap-sdk.azurewebsites.net"};case"uk-prod":return{proxied:"https://uk.fusionmap.com/dashboardadmin",non_proxied:"https://ttdevopsuksprodwebapp-fusionmap-sdk.azurewebsites.net"};case"beta":return{proxied:"https://beta.fusionmap.com/dashboardadmin",non_proxied:"https://ttdevopseus2testwebapp-fusionmap-sdk.azurewebsites.net"};case"dev":return{proxied:"https://usdev.fusionmap.com/dashboardadmin",non_proxied:"https://ttdevopsusdevtestwebapp-fusionmap-sdk.azurewebsites.net"};case"test":return{proxied:"http://localhost:8888/dashboardadmin",non_proxied:"https://ttdevopsusdevtestwebapp-fusionmap-sdk.azurewebsites.net"};default:return{proxied:"http://localhost:8888/usdev/dashboardadmin",non_proxied:"https://ttdevopsusdevtestwebapp-fusionmap-sdk.azurewebsites.net"}}}(),d="https://fusionmap.com/blog",f=l+"/beast",m=50,g=null,_=7,y=200,v=5242880,x=("test"==o?s:"pk.eyJ1IjoiZmFyaXNrYXptaSIsImEiOiJjbXMzdmY5bmwwYWRuMnlxOWZsejg5YjJmIn0.68FoGiJi3PHDBNnDdKpGMA")||"",b="1e16142f-3359-433d-a1ab-7cfbacaffd1c",w="[email protected]",E=function(){switch(o){case"prod":case"ca-prod":case"au-prod":case"uk-prod":case"dev":case"beta":return{premium_layers_product_id:"prod_QhkPCgjg9af7IW",premium_layers_monthly_price_id:"price_1PqKurCVjZ5JaIqceYeEzYmG",stripe_billing_page:"https://billing.stripe.com/p/login/aEU29a9ahbHiahG5kk",stripe_publishable_key:"pk_live_51PT4MPCVjZ5JaIqc6zOCvQoCzOMCDuWwbzX6l7sNgwXa5SmVZPlqTGJBVzAz2KGrrEJQtG74iOUpCX2Ae1iOda1R00QshGwM48"};default:return{premium_layers_product_id:"prod_QaCUxJSawcuw81",premium_layers_monthly_price_id:"price_1Pj25pCVjZ5JaIqc1ogfiv1Y",stripe_billing_page:"https://billing.stripe.com/p/login/test_3csbMEex8dBDe0EdQQ",stripe_publishable_key:"pk_test_51PT4MPCVjZ5JaIqcu3GtYTzytWkZlM5da0TbXG3g11aSCYPxq5oUIjPfsegQo2kr0ro8Dg8lzgTn7c0NaIvvRLZ800uihfRf1H"}}}(),S="G-K8TV7Z72S1",T=[{label:"English",value:"en",google:"en"},{label:"Fran\xe7ais",value:"fr",google:"fr"},{label:"Espa\xf1ol",value:"es"},{label:"Deutsch",value:"de"},{label:"Italiano",value:"it"},{label:"Nederlands",value:"nl"},{label:"Portugu\xe9s",value:"pt"}];function I(e=""){switch(e.length>1?e:o){case"test":return"http://localhost:3000";case"prod":return"https://us.fusionmap.com";case"dev":return"https://usdev.fusionmap.com";case"ca-prod":return"https://ca.fusionmap.com";case"au-prod":return"https://au.fusionmap.com";case"uk-prod":return"https://uk.fusionmap.com";case"beta":return"https://beta.fusionmap.com";default:return""}}let M=[{id:"1",names:["Note Marker"],imgUrl:"/images/symbols/note-marker.png"},{id:"1ai",names:["AI Note Marker"],imgUrl:"/images/symbols/ai-note-marker.png"},{id:"2",names:["Highrise"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f3e2.png"},{id:"3",names:["Stop"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f6ab.png"},{id:"4",names:["Construction"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f6a7.png"},{id:"5",names:["Tree"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f332.png"},{id:"6",names:["Star"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/2b50.png"},{id:"7",names:["Repair"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f6e0-fe0f.png"},{id:"8",names:["Rail"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f686.png"},{id:"9",names:["Utility"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/26a1.png"},{id:"10",names:["Down"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/2b07-fe0f.png"},{id:"11",names:["Traffic"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f6a6.png"},{id:"12",names:["Speed"],imgUrl:"/images/symbols/speed-limit.png"},{id:"13",names:["Stop Sign"],imgUrl:"/images/symbols/stop-sign.png"},{id:"14",names:["PDF"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f4c4.png"},{id:"15",names:["Lidar"],imgUrl:"/images/symbols/lidar.png"},{id:"16",names:["Movie"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f3ac.png"},{id:"17",names:["Camera"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f4f8.png"},{id:"18",names:["Bridge"],imgUrl:"/images/symbols/bridge.png"},{id:"19",names:["Dam"],imgUrl:"/images/symbols/dam.png"}
113,{id:"20",names:["Earthquake"],imgUrl:"/images/symbols/earthquake.png"},{id:"21",names:["Landslide"],imgUrl:"/images/symbols/landslide.png"},{id:"22",names:["Toll"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f6e3-fe0f.png"},{id:"23",names:["Manhole"],imgUrl:"/images/symbols/manhole.png"},{id:"24",names:["Deforest"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1fab5.png"},{id:"25",names:["AED"],imgUrl:"/images/symbols/aed.png"},{id:"26",names:["Transformer"],imgUrl:"/images/symbols/electrical-transformer.png"},{id:"27",names:["Utility Pole"],imgUrl:"/images/symbols/utility-pole.png"},{id:"28",names:["Culvert"],imgUrl:"/images/symbols/culvert.png"},{id:"29",names:["Beaver"],imgUrl:"https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f9ab.png"}],C=[{title:"US Server",env_var:"dev",icon:"us",dev_only:!0},{title:"US Server",env_var:"prod",icon:"us",dev_only:!1},{title:"CA Server",env_var:"ca-prod",icon:"ca",dev_only:!1},{title:"AU Server",env_var:"au-prod",icon:"au",dev_only:!1},{title:"UK Server",env_var:"uk-prod",icon:"gb",dev_only:!1},{title:"Beta Server",env_var:"beta",icon:"us",dev_only:!0}]},84785:(e,r,i)=>{"use strict";var n=i(18916),o=i(54780),a=i(82326),s=i(20740);e.exports=function(e){var r=s(e,function(e){var r=e.getSelection(),i=e.getCurrentContent(),n=r.getAnchorKey(),s=r.getAnchorOffset(),l=i.getBlockForKey(n).getText()[s-1];return a(e,l?o.getUTF16Length(l,0):1)},"backward");if(r===e.getCurrentContent())return e;var i=e.getSelection();return n.push(e,r.set("selectionBefore",i),i.isCollapsed()?"backspace-character":"remove-range")}},85125:(e,r,i)=>{"use strict";var n,o=i(73442),a=i(48744)(),s=i(71355),l=i(10221);if(a){var u=o("RegExp.prototype.exec"),c={},h=function(){throw c},p={toString:h,valueOf:h};"symbol"==typeof Symbol.toPrimitive&&(p[Symbol.toPrimitive]=h),n=function(e){if(!e||"object"!=typeof e)return!1;var r=l(e,"lastIndex");if(!(r&&s(r,"value")))return!1;try{u(e,p)}catch(e){return e===c}}}else{var d=o("Object.prototype.toString");n=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"[object RegExp]"===d(e)}}e.exports=n},85256:(e,r,i)=>{"use strict";var n=i(9912);e.exports=function(e,r){if(!(e instanceof n))return null;var i=e.getNextSiblingKey();if(i)return i;var o=e.getParentKey();if(!o)return null;for(var a=r.get(o);a&&!a.getNextSiblingKey();){var s=a.getParentKey();a=s?r.get(s):null}return a?a.getNextSiblingKey():null}},85428:(e,r,i)=>{"use strict";let n;i.d(r,{xR:()=>ec,qK:()=>ef,Z:()=>$,Iv:()=>Z,_A:()=>ez,hf:()=>ed,lW:()=>q,ah:()=>ep,sg:()=>es,vS:()=>eM,oo:()=>L,tr:()=>eG,Tk:()=>eC,BG:()=>ek,_G:()=>N,DA:()=>eA,N6:()=>K,z3:()=>eh,rm:()=>ee,qR:()=>X,kX:()=>W,Nc:()=>R,GF:()=>eb,F$:()=>ew,Rq:()=>eV,S1:()=>k,ti:()=>B,sW:()=>U,gY:()=>eT,Ky:()=>eF,A9:()=>eU,Rf:()=>eo,i6:()=>ea,ke:()=>J,Qn:()=>eE,vM:()=>F,$R:()=>H,e$:()=>eS,By:()=>z,Sw:()=>eg,Q2:()=>eL,_Y:()=>eB,bX:()=>ej,IX:()=>V,Fr:()=>O,I7:()=>G,KV:()=>j,v1:()=>D,zx:()=>eq,td:()=>e_,VJ:()=>P,n_:()=>et,M5:()=>eD,$S:()=>Q,s8:()=>ei,Wl:()=>er,jp:()=>en,nF:()=>el,zc:()=>eu,Ed:()=>eN,gb:()=>eO,Ne:()=>eR,i$:()=>eP,V6:()=>eI,uW:()=>em,uE:()=>ey,K6:()=>ev,SG:()=>ex,y9:()=>Y});var o=i(37876),a=i(39149),s=i(95471),l=i(84412),u=i(23323),c=i(80856),h=i(31985),p=i(97685),d=i(10841),f=i.n(d),m=i(56557),g=i.n(m),_=i(8135),y=i(12227),v=i(43299),x=i(98477),b=i(23117),w=i(11324),E=i.n(w),S=i(97853);function T(e,r,i){let n=e.features;(!n||n.length>0)&&r({show:!0,action:i,data:n[0]})}function I(e,r){e({show:!1,action:null,data:null}),r({show:!1,noteMode:c.md.DEFAULT})}var M=i(14104),C=i(13260),A=i(78594);let P=async(e,r)=>{let i="https://www.google.com/maps?saddr=My+Location&daddr="+r+","+e;(0,h.KR)()?(0,h.tL)(i,"map"):window.open(i,"_blank")},L=async(e,r)=>{try{return await (0,u.x)("/measurement/sync",{method:"POST",json:{project_id:e,geojson:{updated:R,deleted:{type:"FeatureCollection",features:[r]}}}}),!0}catch(e){return console.error("Request failed:",e),!1}},O=()=>window.innerWidth<=s.Yp,D=()=>window.innerWidth<=s.GH,R={type:"FeatureCollection",features:[]};async function k(e,r){let i=`https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/tilequery/${r},${e}.json?layers=contour&limit=1&access_token=${l.Et}`;try{let e=await fetch(i),r=await e.json();if(0===r.features.length)return null;return r.features[0].properties.ele}catch(e){return console.error("Error fetching elevation:",e),null}}let N=async(e,r,i)=>{try{let n=await fetch(l.fn+"/public/coordinates/"+r?.user?.id+"_"+i.project_uuid+"_coordinates.txt"),o=(await n.text()).split("\n");if(o.length>0)return o[e].split("	")}catch(e){console.error("Error fetching first line:",e)}};async function F(){return new Promise((e,r)=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(r=>{e({latitude:r.coords.latitude,longitude:r.coords.longitude})},e=>{r(e)}):r(Error("Geolocation is not supported by this browser."))})}let z=()=>{let e=document.querySelectorAll(".mapboxgl-popup");
113e.forEach(e=>e.remove()),e=[]},B=e=>{let r=(e=>{try{let r=new URL(e).searchParams;return["st","se","sp","sv","sig","sr","spr"].some(e=>r.has(e))}catch{return!1}})(e)?(e=>{try{let r=new URL(e).pathname,i=r.substring(r.lastIndexOf("/")+1);return(i.includes(".")?i.split(".").pop()??"":"").toLowerCase()}catch{return""}})(e).split(".").pop():e.split(".").pop();if(r)switch(r.toLowerCase()){case"pdf":return"pdf";case"zip":return"zip";case"obj":return"obj";case"jpg":case"jpeg":case"png":return"image";case"mp4":case"avi":case"mov":return"video";case"glb":return"glb";case"gltf":return"gltf";case"ply":return"ply";case"las":return"las"}return"file"},U=e=>{switch(e){case"pdf":return(0,o.jsx)(a.oSi,{size:20});case"zip":return(0,o.jsx)(a.$kB,{size:20});case"glb":return(0,o.jsx)(_.P7h,{size:20});default:return(0,o.jsx)(a.WsZ,{size:20})}},j=()=>{try{if(l.Km.includes("prod"))return!0;return!1}catch{return!0}},V=()=>{try{return l.Km.includes("local")||l.Km.includes("test")}catch{return!0}},G=()=>{try{if(l.Km.includes("aws"))return!0;return!1}catch{return!0}},q=e=>{navigator.clipboard.writeText(e),p.Ay.success("Copied to clipboard")};function H(e,r,i,n,o,a){e.current.on("movestart",()=>{I(r,i)}),e.current.on("moveend",()=>{I(r,i)}),e.current.on("move",()=>{I(r,i)});let s=r=>{if(n.drawingModeCaller)return void n.setShowRightClickMenu({show:!1,action:null,data:null});let i=E().LngLat.convert(r.lngLat).wrap(),s={lat:i.lat,lon:i.lng};r.preventDefault(),n.setShowAddNoteWindow({show:!1,noteMode:c.md.DEFAULT}),n.setElevationMeasurementEnabled(!1),n.setShowRightClickMenu({show:!0,action:null,data:null}),n.setRightClickMenuPoint(r.point),n.setAddNoteLngLat({lng:i.lng,lat:i.lat}),n.setMapCoord({...s,zoom:n.mapCoord.zoom}),n.setClickedPositionCoord(s);let l=e.current.queryRenderedFeatures(r.point).find(e=>e.layer?.id===M.pI);l&&l.id?a(s).then(e=>{o.setAvailableLidars([...e])}):o.setAvailableLidars([])},l=e=>T(e,r,"note"),u=e=>T(e,r,"alert"),h=e=>T(e,r,"measurement"),p=e=>T(e,r,"data");return e.current.on("contextmenu",s),e.current.on("contextmenu","note-layer",l),e.current.on("contextmenu","3dnote-layer",l),e.current.on("contextmenu","ainote-layer",l),e.current.on("contextmenu","alerts-point-layer",u),e.current.on("contextmenu","alerts-polygon-layer",u),e.current.on("contextmenu","line-layer",h),e.current.on("contextmenu","point-layer",h),e.current.on("contextmenu","polygon-layer",h),e.current.on("contextmenu","data-layer",p),()=>{e.current.off("contextmenu",s),e.current.off("contextmenu","note-layer",l),e.current.off("contextmenu","3dnote-layer",l),e.current.off("contextmenu","ainote-layer",l),e.current.off("contextmenu","alerts-point-layer",u),e.current.off("contextmenu","alerts-polygon-layer",u),e.current.off("contextmenu","line-layer",h),e.current.off("contextmenu","point-layer",h),e.current.off("contextmenu","polygon-layer",h),e.current.off("contextmenu","data-layer",p)}}async function $(e,r,i){let n=atob(e),o=new Uint8Array(n.length);for(let e=0;e<n.length;e++)o[e]=n.charCodeAt(e);return new File([new Blob([o],{type:i})],r,{type:i})}function W(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}let Y=async(e,r)=>{let i=(0,A.k7)(e);r.current.flyTo({center:[i.lon,i.lat],zoom:r.current.getZoom()>14?r.current.getZoom():14,duration:s.AD})};function Z(e){let r=f().utc(e),i=f().utc();if(r.isBefore(i)){let e=f().duration(i.diff(r)),n=e.asMinutes(),o=e.asHours(),a=e.asDays();return a>=1?`${Math.floor(a)} day${1===Math.floor(a)?"":"s"} ago`:o>=1?`${Math.floor(o)} hour${1===Math.floor(o)?"":"s"} ago`:n<1?"Just now":`${Math.floor(n)} minute${1===Math.floor(n)?"":"s"} ago`}{let e=f().duration(r.diff(i)),n=e.asDays();if(n>=365)return null;if(n>=7){let e=Math.floor(n/7);return`${e} week${1===e?"":"s"} left`}{if(n>=1)return`${Math.floor(n)} day${1===n?"":"s"} left`;let r=e.asHours();return`${Math.floor(r)} hour${1===r?"":"s"} left`}}}function X(e){if(void 0===e||!f().utc(e).isValid())return(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsx)("div",{className:"circle red"}),"Never logged in"]});let r=Z(e),i=f().utc(e),n=f().utc();return 24>f().duration(n.diff(i)).asHours()?(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsx)("div",{className:"circle pulse green"}),r]}):(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsx)("div",{className:"circle red"}),r]})}async function K(e){try{if((await fetch(e,{method:"HEAD"})).ok)return!0;return!1}catch(e){return console.error("Error checking file existence:",e),!1}}function Q(e){return e?e.base+"/"+e.files[0]:""}function J(e,r,i){if(!r||!e||!e.files||0===e.files.length)return"";let n=e.files.find(e=>e.includes("_thumbnail"))||e.files[0];return`${r.container_name}/${i}/${e.base+"/"+n}`}let ee=(e,r=!0)=>{let i="string"==typeof e?g()(e).toDate():e;return Number.isNaN(i.getTime())?"":(0,C.A)(i,r?"yyyy-MM-dd'T'HH:mm":"yyyy-MM-dd")},et=(e,r)=>{let i=e.getTime();return e.setTime(i+6e4*r),e},er=e=>{switch(e){case 1:return"Observed";case 2:return"Low Priority";case 3:return"Near Urgent";case 4:return"High Priority";case 5:return"Urgent";default:return"N/A"}},ei=e=>{switch(e){case 1:return"#90EE90";case 2:return"#ADD8E6";case 3:return"#1E90FF";case 4:return"#FFA500";case 5:return"#FF0000";default:return"#000000"}};function en(e,r,i){let{lng:n,lat:o}=i.current.unproject([e,r]);return{lon:n,lat:o}}let eo=e=>
113({TR:en(window.innerWidth,0,e),BL:en(0,window.innerHeight,e)}),ea=e=>{let r=e.current?.getBounds?.();return r?{TR:{lon:r.getNorthEast().lng,lat:r.getNorthEast().lat},BL:{lon:r.getSouthWest().lng,lat:r.getSouthWest().lat}}:void 0},es=(e,r)=>{let i;return(...n)=>{i&&clearTimeout(i),i=setTimeout(()=>{e(...n)},r)}},el=(e,r)=>{let i=0;return(...n)=>{let o=Date.now();o-i>=r&&(i=o,e(...n))}},eu=e=>{let r=e.split("?")[0].split("/").pop()||"file";fetch(e).then(e=>e.blob()).then(e=>{let i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=r,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)})};function ec(){y.A.addHook("afterSanitizeAttributes",function(e){"a"===e.tagName.toLowerCase()&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer"),e.style.textDecoration="underline",e.style.color="blue")})}function eh(e){if(0===e)return"0 Bytes";let r=Math.floor(Math.log(e)/Math.log(1024)),i=Math.round(e/Math.pow(1024,r));return`${i} ${["Bytes","KB","MB","GB","TB"][r]}`}function ep(e){let[r,i,n,o]=e,a=[i,r];return v.n1([[a,[i,n],[o,n],[o,r],a]])}function ed(e){let[r,i,n,o]=e;return[[i,r],[o,n]]}let ef=async(e,r,i,n,o,a)=>{if(n||!e||"image"!==B(e.name))return;let s=new AbortController,l=setTimeout(()=>{s.abort()},3e4);try{let n=new FormData;n.append("image",e),a&&n.append("additionalPrompt",a),o?.(!0);let l=await (0,u.x)(`/imageanalyzer/${i}`,{method:"POST",form:n,signal:s.signal});r(l.result)}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)console.error("Request timed out after 30 seconds"),r(null,"Request timed out. Please try again later.");else{let i=e instanceof Error?e.message:"Unexpected error occurred. Please try again later.";console.error("Unexpected error:",e),r(null,i)}}finally{clearTimeout(l),o?.(!1)}},em=async(e,r,i,n,o)=>{let a=new FormData;e&&a.append("file_upload",e),a.append("container_name",r.container_name||""),o&&a.append("integration_file",JSON.stringify(o)),a.append("project_id",r.project_uuid);try{let e=await (0,u.x)("/fusionchat/saveFile",{method:"POST",form:a,rawResponse:!0});n&&n(e)}catch{i&&p.Ay.error("File upload failed. Please try again.")}};function eg(e){let r=e.replace(/FusionMap&reg;/g,'<span style="color: #2563eb;">FusionMap&reg;</span>');return(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:r}})}function e_(e){let r={type:"FeatureCollection",features:[]};return r.features=e,r}function ey(e){if(!b.th.test(e.trim()))return`Invalid format: ${e} is not a valid number.`;let r=parseFloat(e);if(r<-90||r>90)return`Invalid latitude: ${r}. Latitude must be between -90 and 90.`;let i=e.split(".")[1];return!i||!(i.length>6)||`Invalid latitude: ${e}. Latitude cannot have more than 6 decimal places.`}function ev(e){if(!b.th.test(e.trim()))return`Invalid format: ${e} is not a valid number.`;let r=parseFloat(e);if(r<-180||r>180)return`Invalid longitude: ${r}. Longitude must be between -180 and 180.`;let i=e.split(".")[1];return!i||!(i.length>6)||`Invalid longitude: ${e}. Longitude cannot have more than 6 decimal places.`}function ex(e){return b.s.test(e.trim())||"Zoom string is not a number between 0 and 100"}let eb=(e,r)=>{let i=0;return r.percent_off&&(i=e/100*r.percent_off/100),r.amount_off&&(i=r.amount_off/100),i.toFixed(2)},ew=(e,r)=>{let i=0;return r.percent_off?i=r.percent_off:r.amount_off&&(i=r.amount_off/e*100),i.toFixed(0)},eE=(e,r)=>{let i=e/100;return r&&(i-=parseFloat(eb(e,r))),i.toFixed(2)},eS=async(e,r,i)=>{if(e)try{await (0,u.x)("/main/invitations",{method:"POST",params:{project_uuid:e.project_uuid,decision:r}}),p.Ay.success(`Successfully ${"accept"===r?"accepted":"declined"} project`),i?.refetch({query:{disableCookieCache:!0}})}catch{p.Ay.error("There was an error processing your response. Please try again.")}},eT=(e,r)=>{let i=r.find(r=>r.image===e);return i?.id},eI=async e=>{let r=new FormData;return r.append("image",e),(await (0,u.x)("/auth/upload-picture",{method:"POST",form:r})).result},eM=async()=>{await (0,u.x)("/auth/delete-picture",{method:"DELETE"})},eC=async(e,r,i)=>{await (0,u.x)("/auth/update-profile",{method:"POST",json:{first_name:e,last_name:r,email:i}})},eA=async()=>await (0,u.x)("/main/counts",{method:"GET"}
113),eP=async(e,r)=>{let i=new FormData;i.append("project",JSON.stringify(e)),i.append("integrations",JSON.stringify(r));try{return await (0,u.x)("/admin/project-init/update",{method:"PATCH",form:i})}catch(e){console.error("An error occurred while updating integrations:",e.message)}},eL=(n=!1,()=>{n||(window.addEventListener("click",e=>{e.target.closest(".icons-dropdown")||document.querySelectorAll(".dropdown").forEach(r=>{r.contains(e.target)||(r.open=!1)})}),n=!0)}),eO=(e,r,i)=>{i(i=>({...i,[e]:r}))},eD=(e,r)=>{let i=[];return Object.entries(Object.keys(e).filter(e=>"pano"!==e).reduce((r,i)=>(r[i]=e[i],r),{})).sort(([e],[r])=>e.localeCompare(r)).forEach(([e,n],a)=>{let s=`/images/camera_icons/${e}.png`;i.push((0,o.jsx)("div",{className:"tooltip tooltip-right","data-tip":"Camera "+(a+1),children:(0,o.jsx)("button",{onClick:()=>eO(e,!n,r),"data-tooltip-id":"eaglevue-tt","data-tooltip-content":"EagleVue",className:"mapbox-left-menu-btn",children:(0,o.jsx)("img",{src:s,alt:`${e}`,width:20,height:20,style:{color:n?"#2563eb":"#000"}})})},a))}),i},eR=(e,r,i,n)=>{let o=document.createElement("div");o.className="defaultmarker";let a=new(E()).Marker(o,{rotationAlignment:"map"}).setLngLat([i,r]).addTo(e.current);n.current&&n.current.remove(),n.current=a},ek=e=>{let r=e.getCurrentContent(),i=(0,S.convertToRaw)(r),n="",o="",a=[];return i.blocks.forEach(e=>{let r=e.text;n+=r;let s=r;
113e.entityRanges.forEach(e=>{let{key:n,offset:o,length:l}=e,u=i.entityMap[n];if(u&&"mention"===u.type){let{email:e,id:i}=u.data.mention;a.push({id:i,email:e});let n=r.slice(o,o+l);s=s.replace(n,`@{${i}}`)}}),o+=s}),{plainText:n,modifiedText:o,mentions:a}};async function eN(e,r,i,n,o){let a=0;o?.(!0);let s=()=>{if(a<e.length){let o=n.getCurrentContent(),l=n.getSelection(),u=S.Modifier.insertText(o,l,e[a]);n=S.EditorState.push(n,u,"insert-characters"),(0,x.flushSync)(()=>{i(n)}),a++,setTimeout(s,r)}else o?.(!1)};s()}function eF(){return JSON.parse(localStorage.getItem("project")||"{}")}let ez=(e,r)=>e?.is_developer||(e?.admin_projects??[]).includes(r),eB=e=>e?.is_developer||(e?.admin_projects??[]).length>0,eU=async e=>{try{let r={project_id:e?.project_id,question:"Show to user: This file is about (very briefly max 320 chars, explain the document what is it about). Also generate 3 short Fusion hint question, each question should be max 40 characters.",history:[""],agent:"sql",pdfs:[e]};return await (0,u.x)("/fusionchat/chat",{method:"POST",json:r})}catch(e){return console.error("Error getting pulse summary:",e),null}};function ej(e,r){return null!=e&&Object.prototype.hasOwnProperty.call(e,r)}let eV=e=>{let r=new Date;return r.setDate(r.getDate()-e),r};function eG(e,r){let i=new Blob([e],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(i);try{let e=document.createElement("a");e.href=n,e.download=r,e.click()}finally{URL.revokeObjectURL(n)}}function eq(e){try{return JSON.parse(e)}catch{return}}},85452:e=>{"use strict";e.exports=function(e){var r=e||"",i=arguments.length;if(i>1)for(var n=1;n<i;n++){var o=arguments[n];o&&(r=(r?r+" ":"")+o)}return r}},85788:(e,r,i)=>{"use strict";var n=i(39636),o=i(18916),a=i(39052),s=i(62191),l=i(75936),u=i(92967),c=i(12968),h=i(57913),p=a.isBrowser("Firefox");function d(e,r,i,a,s){var l=n.replaceText(e.getCurrentContent(),e.getSelection(),r,i,a);return o.push(e,l,"insert-characters",s)}e.exports=function(e,r){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var i=e._latestEditorState,n=r.data;if(n){if(e.props.handleBeforeInput&&l(e.props.handleBeforeInput(n,i,r.timeStamp)))return void r.preventDefault();var a=i.getSelection(),f=a.getStartOffset(),m=a.getAnchorKey();if(!a.isCollapsed()){r.preventDefault(),e.update(d(i,n,i.getCurrentInlineStyle(),s(i.getCurrentContent(),i.getSelection()),!0));return}var g=d(i,n,i.getCurrentInlineStyle(),s(i.getCurrentContent(),i.getSelection()),!1),_=!1;if(!(_=u(e._latestCommittedEditorState))){var y=i.getBlockTree(m),v=g.getBlockTree(m);_=y.size!==v.size||y.zip(v).some(function(e){var r=e[0],i=e[1],o=r.get("start"),a=o+(o>=f?n.length:0),s=r.get("end"),l=s+(s>=f?n.length:0),u=i.get("start"),c=i.get("end"),h=i.get("decoratorKey");return r.get("decoratorKey")!==h||r.get("leaves").size!==i.get("leaves").size||a!==u||l!==c||null!=h&&c-u!=s-o})}if(_||(_=p&&("'"==n||"/"==n)),_||(_=c(g.getDirectionMap()).get(m)!==c(i.getDirectionMap()).get(m)),_){r.preventDefault(),g=o.set(g,{forceSelection:!0}
113),e.update(g);return}e._pendingStateFromBeforeInput=g=o.set(g,{nativelyRenderedContent:g.getCurrentContent()}),h(function(){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)})}}},86533:(e,r,i)=>{"use strict";var n=i(41822),o=i(50906),a=i(14232),s=i(15796),l=i(34769),u=i(53506).setDraftEditorSelection;e.exports=function(e){function r(){for(var r,i,n,o,a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return i=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r=e.call.apply(e,[this].concat(s))||this),o=void 0,(n="leaf")in i?Object.defineProperty(i,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[n]=o,r}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i._setSelection=function(){var e,r=this.props.selection;if(null!=r&&r.getHasFocus()){var i=this.props,n=i.block,o=i.start,a=i.text,c=n.getKey(),h=o+a.length;if(r.hasEdgeWithin(c,o,h)){var p=this.leaf;p||s(!1);var d=p.firstChild;d||s(!1),d.nodeType===Node.TEXT_NODE?e=d:l(d)?e=p:(e=d.firstChild)||s(!1),u(r,e,c,o,h)}}},i.shouldComponentUpdate=function(e){var r=this.leaf;return r||s(!1),r.textContent!==e.text||e.styleSet!==this.props.styleSet||e.forceSelection},i.componentDidUpdate=function(){this._setSelection()},i.componentDidMount=function(){this._setSelection()},i.render=function(){var e=this,r=this.props.block,i=this.props.text;i.endsWith("\n")&&this.props.isLast&&(i+="\n");var s=this.props,l=s.customStyleMap,u=s.customStyleFn,c=s.offsetKey,h=s.styleSet,p=h.reduce(function(e,r){var i={},o=l[r];return void 0!==o&&e.textDecoration!==o.textDecoration&&(i.textDecoration=[e.textDecoration,o.textDecoration].join(" ").trim()),n(e,o,i)},{});return u&&(p=n(p,u(h,r))),a.createElement("span",{"data-offset-key":c,ref:function(r){return e.leaf=r},style:p},a.createElement(o,null,i))},r}(a.Component)},86558:e=>{"use strict";e.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null},86733:(e,r,i)=>{"use strict";var n=i(41822);function o(){return(o=n||function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}var a=i(52164),s=i(99297),l=i(14232),u=i(12968);e.exports=function(e){function r(){return e.apply(this,arguments)||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.shouldComponentUpdate=function(e){var r=this.props.editorState,i=e.editorState;if(r.getDirectionMap()!==i.getDirectionMap()||r.getSelection().getHasFocus()!==i.get
113Selection().getHasFocus())return!0;var n=i.getNativelyRenderedContent(),o=r.isInCompositionMode(),a=i.isInCompositionMode();if(r===i||null!==n&&i.getCurrentContent()===n||o&&a)return!1;var s=r.getCurrentContent(),l=i.getCurrentContent(),u=r.getDecorator(),c=i.getDecorator();return o!==a||s!==l||u!==c||i.mustForceSelection()},i.render=function(){for(var e=this.props,r=e.blockRenderMap,i=e.blockRendererFn,n=e.blockStyleFn,c=e.customStyleMap,h=e.customStyleFn,p=e.editorState,d=e.editorKey,f=e.textDirectionality,m=p.getCurrentContent(),g=p.getSelection(),_=p.mustForceSelection(),y=p.getDecorator(),v=u(p.getDirectionMap()),x=m.getBlocksAsArray()[0],b=[],w=x;w;){var E=w.getKey(),S={blockRenderMap:r,blockRendererFn:i,blockStyleFn:n,contentState:m,customStyleFn:h,customStyleMap:c,decorator:y,editorKey:d,editorState:p,forceSelection:_,selection:g,block:w,direction:f||v.get(E),tree:p.getBlockTree(E)},T=(r.get(w.getType())||r.get("unstyled")).wrapper;b.push({block:l.createElement(a,o({key:E},S)),wrapperTemplate:T,key:E,offsetKey:s.encode(E,0,0)});var I=w.getNextSiblingKey();w=I?m.getBlockForKey(I):null}for(var M=[],C=0;C<b.length;){var A=b[C];if(A.wrapperTemplate){var P=[];do P.push(b[C].block),C++;while(C<b.length&&b[C].wrapperTemplate===A.wrapperTemplate);var L=l.cloneElement(A.wrapperTemplate,{key:A.key+"-wrap","data-offset-key":A.offsetKey},P);M.push(L)}else M.push(A.block),C++}return l.createElement("div",{"data-contents":"true"},M)},r}(l.Component)},87247:(e,r)=>{r.read=function(e,r,i,n,o){var a,s,l=8*o-n-1,u=(1<<l)-1,c=u>>1,h=-7,p=i?o-1:0,d=i?-1:1,f=e[r+p];for(p+=d,a=f&(1<<-h)-1,f>>=-h,h+=l;h>0;a=256*a+e[r+p],p+=d,h-=8);for(s=a&(1<<-h)-1,a>>=-h,h+=n;h>0;s=256*s+e[r+p],p+=d,h-=8);if(0===a)a=1-c;else{if(a===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),a-=c}return(f?-1:1)*s*Math.pow(2,a-n)},r.write=function(e,r,i,n,o,a){var s,l,u,c=8*a-o-1,h=(1<<c)-1,p=h>>1,d=5960464477539062e-23*(23===o),f=n?0:a-1,m=n?1:-1,g=+(r<0||0===r&&1/r<0);for(isNaN(r=Math.abs(r))||r===1/0?(l=+!!isNaN(r),s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+p>=1?r+=d/u:r+=d*Math.pow(2,1-p),r*u>=2&&(s++,u/=2),s+p>=h?(l=0,s=h):s+p>=1?(l=(r*u-1)*Math.pow(2,o),s+=p):(l=r*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;e[i+f]=255&l,f+=m,l/=256,o-=8);for(s=s<<o|l,c+=o;c>0;e[i+f]=255&s,f+=m,s/=256,c-=8);e[i+f-m]|=128*g}},87573:(e,r,i)=>{"use strict";var n=i(43791);function o(e){var r=[1/0,1/0,-1/0,-1/0];return n.coordEach(e,function(e){r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r}o.default=o,r.A=o},87729:(e,r,i)=>{"use strict";e.exports=function(e){function r(){return e.apply(this,arguments)||this}r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var i=r.prototype;return i.getType=function(){return this.get("type")},i.getMutability=function(){return this.get("mutability")},i.getData=function(){return this.get("data")},r}((0,i(93710).Record)({type:"TOKEN",mutability:"IMMUTABLE",data:Object}))},87962:e=>{"use strict";e.exports=Math.round},88017:e=>{"use strict";e.exports={notEmptyKey:function(e){return null!=e&&""!=e}}},88294:e=>{"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},88321:(e,r,i)=>{"use strict";i.d(r,{w:()=>n});let n=[{id:"1",title:"None",image:"/images/layer_icons/no-icon.svg"},{id:"2",title:"Aerialway",image:"/images/layer_icons/aerialway.png"},{id:"3",title:"Airfield",image:"/images/layer_icons/airfield.png"},{id:"4",title:"Airport",image:"/images/layer_icons/airport.png"},{id:"5",title:"Alcohol Shop",image:"/images/layer_icons/alcohol-shop.png"},{id:"6",title:"American Football",image:"/images/layer_icons/american-football.png"},{id:"7",title:"Amusement Park",image:"/images/layer_icons/amusement-park.png"},{id:"8",title:"Aquarium",image:"/images/layer_icons/aquarium.png"},{id:"9",title:"Arrow",image:"/images/layer_icons/arrow.png"},{id:"10",title:"Art Gallery",image:"/images/layer_icons/art-gallery.png"},{id:"11",title:"Attraction",image:"/images/layer_icons/attraction.png"},{id:"12",title:"Bakery",image:"/images/layer_icons/bakery.png"},{id:"13",title:"Bank",image:"/images/layer_icons/bank.png"},{id:"14",title:"Bar",image:"/images/layer_icons/bar.png"},{id:"15",title:"Barrier",image:"/images/layer_icons/barrier.png"},{id:"16",title:"Baseball",image:"/images/layer_icons/baseball.png"},{id:"17",title:"Basketball",image:"/images/layer_icons/basketball.png"},{id:"18",title:"Beach",image:"/images/layer_icons/beach.png"},{id:"19",title:"Beer",image:"/images/layer_icons/beer.png"},{id:"20",title:"Bicycle Share",image:"/images/layer_icons/bicycle-share.png"},{id:"21",title:"Bicycle",image:"/images/layer_icons/bicycle.png"},{id:"22",title:"Bowling Alley",image:"/images/layer_icons/bowling-alley.png"},{id:"23",title:"Bridge",image:"/images/layer_icons/bridge.png"},{id:"24",title:"Building (1)",image:"/images/layer_icons/building-alt1.png"},{id:"25",title:"Building (2)",image:"/images/layer_icons/building.png"},{id:"26",title:"Bus",image:"/images/layer_icons/bus.png"},{id:"27",title:"Cafe",image:"/images/layer_icons/cafe.png"},{id:"28",title:"Campsite",image:"/images/layer_icons/campsite.png"},{id:"29",title:"Car Rental",image:"/images/layer_icons/car-rental.png"},{id:"30",title:"Car Repair",image:"/images/layer_icons/car-repair.png"},{id:"31",title:"Car",image:"/images/layer_icons/car.png"},{id:"32",title:"Casino",image:"/images/layer_icons/casino.png"},{id:"33",title:"Castle (1)",image:"/images/layer_icons/castle-JP.png"},{id:"34",title:"Castle",image:"/images/layer_icons/castle.png"},{id:"35",title:"Caution",image:"/images/layer_icons/caution.png"},{id:"36",title:"Cemetery (1)",image:"/images/layer_icons/cemetery-JP.png"},{id:"37",title:"Cemetery",image:"/images/layer_icons/cemetery.png"},{id:"38",title:"Charging Station",image:"/images/layer_icons/charging-station.png"},{id:"39",title:"Cinema",image:"/images/layer_icons/cinema.png"},{id:"40",title:"Circle Stroked",image:"/images/layer_icons/circle-stroked.png"},{id:"41",title:"Circle",image:"/images/layer_icons/circle.png"},{id:"42",title:"City",image:"/images/layer_icons/city.png"},{id:"43",title:"Clothing Store",image:"/images/layer_icons/clothing-store.png"},{id:"44",title:"College",image:"/images/layer_icons/college.png"},{id:"45",title:"Commercial",image:"/images/layer_icons/commercial.png"},{id:"46",title:"Communications Tower",image:"/images/layer_icons/communications-tower.png"}
113,{id:"47",title:"Confectionery",image:"/images/layer_icons/confectionery.png"},{id:"48",title:"Construction",image:"/images/layer_icons/construction.png"},{id:"49",title:"Convenience",image:"/images/layer_icons/convenience.png"},{id:"50",title:"Cricket",image:"/images/layer_icons/cricket.png"},{id:"51",title:"Cross",image:"/images/layer_icons/cross.png"},{id:"52",title:"Dam",image:"/images/layer_icons/dam.png"},{id:"53",title:"Danger",image:"/images/layer_icons/danger.png"},{id:"54",title:"Defibrillator",image:"/images/layer_icons/defibrillator.png"},{id:"55",title:"Dentist",image:"/images/layer_icons/dentist.png"},{id:"56",title:"Diamond",image:"/images/layer_icons/diamond.png"},{id:"57",title:"Doctor",image:"/images/layer_icons/doctor.png"},{id:"58",title:"Dog Park",image:"/images/layer_icons/dog-park.png"},{id:"59",title:"Drinking Water",image:"/images/layer_icons/drinking-water.png"},{id:"60",title:"Elevator",image:"/images/layer_icons/elevator.png"},{id:"61",title:"Embassy",image:"/images/layer_icons/embassy.png"},{id:"62",title:"Emergency Phone",image:"/images/layer_icons/emergency-phone.png"},{id:"63",title:"Entrance (1)",image:"/images/layer_icons/entrance-alt1.png"},{id:"64",title:"Entrance (2)",image:"/images/layer_icons/entrance.png"},{id:"65",title:"Farm",image:"/images/layer_icons/farm.png"},{id:"66",title:"Fast Food",image:"/images/layer_icons/fast-food.png"},{id:"67",title:"Fence",image:"/images/layer_icons/fence.png"},{id:"68",title:"Ferry (1)",image:"/images/layer_icons/ferry-JP.png"},{id:"69",title:"Ferry (2)",image:"/images/layer_icons/ferry.png"},{id:"70",title:"Fire Station (1)",image:"/images/layer_icons/fire-station-JP.png"},{id:"71",title:"Fire Station (2)",image:"/images/layer_icons/fire-station.png"},{id:"72",title:"Fitness Centre",image:"/images/layer_icons/fitness-centre.png"},{id:"73",title:"Florist",image:"/images/layer_icons/florist.png"},{id:"74",title:"Fuel",image:"/images/layer_icons/fuel.png"},{id:"75",title:"Furniture",image:"/images/layer_icons/furniture.png"},{id:"76",title:"Gaming",image:"/images/layer_icons/gaming.png"},{id:"77",title:"Garden Centre",image:"/images/layer_icons/garden-centre.png"},{id:"78",title:"Garden",image:"/images/layer_icons/garden.png"},{id:"79",title:"Gift",image:"/images/layer_icons/gift.png"},{id:"80",title:"Globe",image:"/images/layer_icons/globe.png"},{id:"81",title:"Golf",image:"/images/layer_icons/golf.png"},{id:"82",title:"Grocery",image:"/images/layer_icons/grocery.png"},{id:"83",title:"Hairdresser",image:"/images/layer_icons/hairdresser.png"},{id:"84",title:"Harbor",image:"/images/layer_icons/harbor.png"},{id:"85",title:"Hardware",image:"/images/layer_icons/hardware.png"},{id:"86",title:"Heart",image:"/images/layer_icons/heart.png"},{id:"87",title:"Heliport",image:"/images/layer_icons/heliport.png"},{id:"88",title:"Highway Rest Area",image:"/images/layer_icons/highway-rest-area.png"},{id:"89",title:"Home",image:"/images/layer_icons/home.png"},{id:"90",title:"Horse Riding",image:"/images/layer_icons/horse-riding.png"},{id:"91",title:"Hospital (1)",image:"/images/layer_icons/hospital-JP.png"},{id:"92",title:"Hospital (2)",image:"/images/layer_icons/hospital.png"},{id:"93",title:"Hot Spring",image:"/images/layer_icons/hot-spring.png"},{id:"94",title:"Ice Cream",image:"/images/layer_icons/ice-cream.png"},{id:"95",title:"Industry",image:"/images/layer_icons/industry.png"},{id:"96",title:"Information",image:"/images/layer_icons/information.png"},{id:"97",title:"Jewelry Store",image:"/images/layer_icons/jewelry-store.png"},{id:"98",title:"Karaoke",image:"/images/layer_icons/karaoke.png"},{id:"99",title:"Landmark (1)",image:"/images/layer_icons/landmark-JP.png"},{id:"100",title:"Landmark (2)",image:"/images/layer_icons/landmark.png"},{id:"101",title:"Landuse",image:"/images/layer_icons/landuse.png"},{id:"102",title:"Laundry",image:"/images/layer_icons/laundry.png"},{id:"103",title:"Library",image:"/images/layer_icons/library.png"},{id:"104",title:"Lighthouse (1)",image:"/images/layer_icons/lighthouse-JP.png"},{id:"105",title:"Lighthouse (2)",image:"/images/layer_icons/lighthouse.png"},{id:"106",title:"Lodging",image:"/images/layer_icons/lodging.png"},{id:"107",title:"Logging",image:"/images/layer_icons/logging.png"},{id:"108",title:"Marker Stroked",image:"/images/layer_icons/marker-stroked.png"},{id:"109",title:"Marker",image:"/images/layer_icons/marker.png"},{id:"110",title:"Mobile Phone",image:"/images/layer_icons/mobile-phone.png"},{id:"111",title:"Monument (1)",image:"/images/layer_icons/monument-JP.png"},{id:"112",title:"Monument (2)",image:"/images/layer_icons/monument.png"},{id:"113",title:"Mountain",image:"/images/layer_icons/mountain.png"},{id:"114",title:"Museum",image:"/images/layer_icons/museum.png"},{id:"115",title:"Music",image:"/images/layer_icons/music.png"},{id:"116",title:"Natural",image:"/images/layer_icons/natural.png"},{id:"117",title:"Observation Tower",image:"/images/layer_icons/observation-tower.png"},{id:"118",title:"Optician",image:"/images/layer_icons/optician.png"},{id:"119",title:"Paint",image:"/images/layer_icons/paint.png"},{id:"120",title:"Park (1)",image:"/images/layer_icons/park-alt1.png"},{id:"121",title:"Park (2)",image:"/images/layer_icons/park.png"},{id:"122",title:"Parking Garage",image:"/images/layer_icons/parking-garage.png"},{id:"123",title:"Parking",image:"/images/layer_icons/parking.png"},{id:"124",title:"Pharmacy",image:"/images/layer_icons/pharmacy.png"},{id:"125",title:"Picnic Site",image:"/images/layer_icons/picnic-site.png"},{id:"126",title:"Pitch",image:"/images/layer_icons/pitch.png"},{id:"127",title:"Place of Worship",image:"/images/layer_icons/place-of-worship.png"},{id:"128",title:"Playground",image:"/images/layer_icons/playground.png"},{id:"129",title:"Police (1)",image:"/images/layer_icons/police-JP.png"},{id:"130",title:"Police (2)",image:"/images/layer_icons/police.png"},{id:"131",title:"Post (1)",image:"/images/layer_icons/post-JP.png"},{id:"132",title:"Post (2)",image:"/images/layer_icons/post.png"},{id:"133",title:"Prison",image:"/images/layer_icons/prison.png"},{id:"134",title:"Racetrack Boat",image:"/images/layer_icons/racetrack-boat.png"},{id:"135",title:"Racetrack Cycling",image:"/images/layer_icons/racetrack-cycling.png"},{id:"136",title:"Racetrack Horse",image:"/images/layer_icons/racetrack-horse.png"},{id:"137",title:"Racetrack",image:"/images/layer_icons/racetrack.png"},{id:"138",title:"Rail Light",image:"/images/layer_icons/rail-light.png"},{id:"139",title:"Rail Metro",image:"/images/layer_icons/rail-metro.png"},{id:"140",title:"Rail",image:"/images/layer_icons/rail.png"},{id:"141",title:"Ranger Station",image:"/images/layer_icons/ranger-station.png"},{id:"142",title:"Recycling",image:"/images/layer_icons/recycling.png"},{id:"143",title:"Buddhist",image:"/images/layer_icons/religious-buddhist.png"},{id:"144",title:"Christian",image:"/images/layer_icons/religious-christian.png"},{id:"145",title:"Jewish",image:"/images/layer_icons/religious-jewish.png"}
113,{id:"146",title:"Muslim",image:"/images/layer_icons/religious-muslim.png"},{id:"147",title:"Shinto",image:"/images/layer_icons/religious-shinto.png"},{id:"148",title:"Residential Community",image:"/images/layer_icons/residential-community.png"},{id:"149",title:"BBQ",image:"/images/layer_icons/restaurant-bbq.png"},{id:"150",title:"Noodle",image:"/images/layer_icons/restaurant-noodle.png"},{id:"151",title:"Pizza",image:"/images/layer_icons/restaurant-pizza.png"},{id:"152",title:"Seafood",image:"/images/layer_icons/restaurant-seafood.png"},{id:"153",title:"Sushi",image:"/images/layer_icons/restaurant-sushi.png"},{id:"154",title:"Restaurant",image:"/images/layer_icons/restaurant.png"},{id:"155",title:"Road Accident",image:"/images/layer_icons/road-accident.png"},{id:"156",title:"Roadblock",image:"/images/layer_icons/roadblock.png"},{id:"157",title:"Rocket",image:"/images/layer_icons/rocket.png"},{id:"158",title:"School (1)",image:"/images/layer_icons/school-JP.png"},{id:"159",title:"School (2)",image:"/images/layer_icons/school.png"},{id:"160",title:"Scooter",image:"/images/layer_icons/scooter.png"},{id:"161",title:"Shelter",image:"/images/layer_icons/shelter.png"},{id:"162",title:"Shoe",image:"/images/layer_icons/shoe.png"},{id:"163",title:"Shop",image:"/images/layer_icons/shop.png"},{id:"164",title:"Skateboard",image:"/images/layer_icons/skateboard.png"},{id:"165",title:"Skiing",image:"/images/layer_icons/skiing.png"},{id:"166",title:"Slaughterhouse",image:"/images/layer_icons/slaughterhouse.png"},{id:"167",title:"Slipway",image:"/images/layer_icons/slipway.png"},{id:"168",title:"Snowmobile",image:"/images/layer_icons/snowmobile.png"},{id:"169",title:"Soccer",image:"/images/layer_icons/soccer.png"},{id:"170",title:"Square Stroked",image:"/images/layer_icons/square-stroked.png"},{id:"171",title:"Square",image:"/images/layer_icons/square.png"},{id:"172",title:"Stadium",image:"/images/layer_icons/stadium.png"},{id:"173",title:"Star Stroked",image:"/images/layer_icons/star-stroked.png"},{id:"174",title:"Star",image:"/images/layer_icons/star.png"},{id:"175",title:"Suitcase",image:"/images/layer_icons/suitcase.png"},{id:"176",title:"Swimming",image:"/images/layer_icons/swimming.png"},{id:"177",title:"Table Tennis",image:"/images/layer_icons/table-tennis.png"},{id:"178",title:"Teahouse",image:"/images/layer_icons/teahouse.png"},{id:"179",title:"Telephone",image:"/images/layer_icons/telephone.png"},{id:"180",title:"Tennis",image:"/images/layer_icons/tennis.png"},{id:"181",title:"Theatre",image:"/images/layer_icons/theatre.png"},{id:"182",title:"Toilet",image:"/images/layer_icons/toilet.png"},{id:"183",title:"Town Hall",image:"/images/layer_icons/town-hall.png"},{id:"184",title:"Town",image:"/images/layer_icons/town.png"},{id:"185",title:"Triangle Stroked",image:"/images/layer_icons/triangle-stroked.png"},{id:"186",title:"Triangle",image:"/images/layer_icons/triangle.png"},{id:"187",title:"Veterinary",image:"/images/layer_icons/veterinary.png"},{id:"188",title:"Viewpoint",image:"/images/layer_icons/viewpoint.png"},{id:"189",title:"Village",image:"/images/layer_icons/village.png"},{id:"190",title:"Volcano",image:"/images/layer_icons/volcano.png"},{id:"191",title:"Volleyball",image:"/images/layer_icons/volleyball.png"},{id:"192",title:"Warehouse",image:"/images/layer_icons/warehouse.png"},{id:"193",title:"Waste Basket",image:"/images/layer_icons/waste-basket.png"},{id:"194",title:"Watch",image:"/images/layer_icons/watch.png"},{id:"195",title:"Water",image:"/images/layer_icons/water.png"},{id:"196",title:"Waterfall",image:"/images/layer_icons/waterfall.png"},{id:"197",title:"Watermill",image:"/images/layer_icons/watermill.png"},{id:"198",title:"Wetland",image:"/images/layer_icons/wetland.png"},{id:"199",title:"Wheelchair",image:"/images/layer_icons/wheelchair.png"},{id:"200",title:"Windmill",image:"/images/layer_icons/windmill.png"},{id:"201",title:"Zoo",image:"/images/layer_icons/zoo.png"}]},88913:(e,r,i)=>{"use strict";var n=i(39636),o=i(18916);e.exports=function(e){var r=n.splitBlock(e.getCurrentContent(),e.getSelection());return o.push(e,r,"split-block")}},89289:()=>{},89314:(e,r,i)=>{"use strict";var n=i(14842),o=i(60620),a=i(11151),s=i(39636),l=i(78036),u=i(18916),c=i(62070),h=i(62191),p=i(23061),d=i(75936),f=i(79226);function m(e,r,i){var n=s.replaceWithFragment(e.getCurrentContent(),e.getSelection(),r);return u.push(e,n.set("entityMap",i),"insert-fragment")}e.exports=function(e,r){r.preventDefault();var i=new a(r.clipboardData);if(!i.isRichText()){var g=i.getFiles(),_=i.getText();if(g.length>0){if(e.props.handlePastedFiles&&d(e.props.handlePastedFiles(g)))return;p(g,function(r){if(r=r||_){var i=e._latestEditorState,a=f(r),p=o.create({style:i.getCurrentInlineStyle(),entity:h(i.getCurrentContent(),i.getSelection())}),d=c.getCurrentBlockType(i),m=l.processText(a,p,d),g=n.createFromArray(m),y=s.replaceWithFragment(i.getCurrentContent(),i.getSelection(),g);e.update(u.push(i,y,"insert-fragment"))}});return}}var y=[],v=i.getText(),x=i.getHTML(),b=e._latestEditorState;if(e.props.formatPastedText){var w=e.props.formatPastedText(v,x),E=w.text,S=w.html;v=E,x=S}if(!(e.props.handlePastedText&&d(e.props.handlePastedText(v,x,b)))){if(v&&(y=f(v)),!e.props.stripPastedStyles){var T,I,M,C=e.getClipboard();if(!e.props.formatPastedText&&i.isRichText()&&C){if((null==(M=x)?void 0:M.indexOf(e.getEditorKey()))!==-1||1===y.length&&1===C.size&&C.first().getText()===v)return void e.update(m(e._latestEditorState,C))}else{if(C&&i.types.includes("com.apple.webarchive")&&!i.types.includes("text/html")&&(T=y,I=C,T.length===I.size&&I.valueSeq().every(function(e,r){return e.getText()===T[r]})))return void e.update(m(e._latestEditorState,C))}if(x){var A=l.processHTML(x,e.props.blockRenderMap);if(A){var P=A.contentBlocks,L=A.entityMap;if(P){var O=n.createFromArray(P);e.update(m(e._latestEditorState,O,L));return}}}e.setClipboard(null)}if(y.length){var D=o.create({style:b.getCurrentInlineStyle(),entity:h(b.getCurrentContent(),b.getSelection())}),R=c.getCurrentBlockType(b),k=l.processText(y,D,R),N=n.createFromArray(k);e.update(m(e._latestEditorState,N))}}}},89977:(e,r,i)=>{"use strict";i.d(r,{H:()=>l,s:()=>s});var n=i(37876),o=i(14232);let a=(0,o.createContext)(null),s=({children:e})=>{let[r,i]=(0,o.useState)({}),[s,l]=(0,o.useState)({open:!1,id:0,event:null});return(0,n.jsx)(a.Provider,{value:{showModals:r,setShowModals:i,isBottomMenuOpen:s,setBottomMenuOpen:l},children:e})},l=()=>{let e=(0,o.useContext)(a);if(!e)throw Error("useOverlayContext must be used within a OverlayProvider");return e}},89989:e=>{function r(e,r,i){this._queue=[],this._priorities=[],this._sorting="desc",this._init(e,r,i)}r.prototype.insert=function(e,r){for(var i=this._queue.length,n=i;n--;){var o=this._priorities[n];"desc"===this._sorting?r>o&&(i=n):r<o&&(i=n)}this._insertAt(e,r,i)},r.prototype.remove=function(e){for(var r=this._queue.length;r--;)if(e===this._queue[r]){this._queue.splice(r,1),this._priorities.splice(r,1);break}},r.prototype.forEach=function(e){this._queue.forEach(e)},r.prototype.getElements=function(){return this._queue},r.prototype.getElementPriority=function(e){return this._priorities[e]},r.prototype.getPriorities=function(){return this._priorities},r.prototype.getElementsWithPriorities=function(){for(var e=[],r=0,i=this._queue.length;r<i;r++)e.push([this._queue[r],this._priorities[r]]);return e},r.prototype._init=function(e,r,i){if(e&&r){if(this._queue=[],this._priorities=[],e.length!==r.length)throw Error("Arrays must have the same length");for(var n=0;n<e.length;n++)this.insert(e[n],r[n])}i&&(this._sorting=i)},r.prototype._insertAt=function(e,r,i){this._queue.length===i?(this._queue.push(e),this._priorities.push(r)):(this._queue.splice(i,0,e),this._priorities.splice(i,0,r))},e.exports&&(e.exports=r)},90326:function(e,r,i){var n=i(99742);e.exports=function(){"use strict";var e=function(e,r){this.next=null,this.key=e,this.data=r,this.left=null,this.right=null};function r(e,r){return e>r?1:e<r?-1:0}function i(r,i,n){for(var o=new e(null,null),a=o,s=o;;){var l=n(r,i.key);if(l<0){if(null===i.left)break;if(0>
113n(r,i.left.key)){var u=i.left;if(i.left=u.right,u.right=i,null===(i=u).left)break}s.left=i,s=i,i=i.left}else if(l>0){if(null===i.right)break;if(n(r,i.right.key)>0){var u=i.right;if(i.right=u.left,u.left=i,null===(i=u).right)break}a.right=i,a=i,i=i.right}else break}return a.right=i.left,s.left=i.right,i.left=o.right,i.right=o.left,i}function o(r,n,o,a){var s=new e(r,n);if(null===o)return s.left=s.right=null,s;o=i(r,o,a);var l=a(r,o.key);return l<0?(s.left=o.left,s.right=o,o.left=null):l>=0&&(s.right=o.right,s.left=o,o.right=null),s}function a(e,r,n){var o=null,a=null;if(r){r=i(e,r,n);var s=n(r.key,e);0===s?(o=r.left,a=r.right):s<0?(a=r.right,r.right=null,o=r):(o=r.left,r.left=null,a=r)}return{left:o,right:a}}var s=function(){function n(e){void 0===e&&(e=r),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,r){return this._size++,this._root=o(e,r,this._root,this._comparator)},n.prototype.add=function(r,n){var o=new e(r,n);null===this._root&&(o.left=o.right=null,this._size++,this._root=o);var a=this._comparator,s=i(r,this._root,a),l=a(r,s.key);return 0===l?this._root=s:(l<0?(o.left=s.left,o.right=s,s.left=null):l>0&&(o.right=s.right,o.left=s,s.right=null),this._size++,this._root=o),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,r,n){var o;return null===r?null:(r=i(e,r,n),0===n(e,r.key))?(null===r.left?o=r.right:(o=i(e,r.left,n)).right=r.right,this._size--,o):r},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=i(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var r=this._root,i=this._comparator;r;){var n=i(e,r.key);if(0===n)return r;r=n<0?r.left:r.right}return null},n.prototype.find=function(e){return this._root&&(this._root=i(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},n.prototype.contains=function(e){for(var r=this._root,i=this._comparator;r;){var n=i(e,r.key);if(0===n)return!0;r=n<0?r.left:r.right}return!1},n.prototype.forEach=function(e,r){for(var i=this._root,n=[],o=!1;!o;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),e.call(r,i),i=i.right):o=!0;return this},n.prototype.range=function(e,r,i,n){for(var o=[],a=this._comparator,s=this._root;0!==o.length||s;)if(s)o.push(s),s=s.left;else{if(a((s=o.pop()).key,r)>0)break;if(a(s.key,e)>=0&&i.call(n,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(r){var i=r.key;return e.push(i)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(r){var i=r.data;return e.push(i)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var r=this._root,i=!1,n=0,o=[];!i;)if(r)o.push(r),r=r.left;else if(o.length>0){if(r=o.pop(),n===e)return r;n++,r=r.right}else i=!0;return null},n.prototype.next=function(e){var r=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var n=this._comparator;r;){var o=n(e.key,r.key);if(0===o)break;o<0?(i=r,r=r.left):r=r.right}return i},n.prototype.prev=function(e){var r=this._root,i=null;if(null!==e.left){for(i=e.left;i.right;)i=i.right;return i}for(var n=this._comparator;r;){var o=n(e.key,r.key);if(0===o)break;o<0?r=r.left:(i=r,r=r.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return function(r){for(var i=r,n=[],o=!1,a=new e(null,null),s=a;!o;)i?(n.push(i),i=i.left):n.length>0?i=(i=s=s.next=n.pop()).right:o=!0;return s.next=null,a.next}(this._root)},n.prototype.load=function(r,i,n){void 0===i&&(i=[]),void 0===n&&(n=!1);var o=r.length,a=this._comparator;if(n&&function e(r,i,n,o,a){if(!(n>=o)){for(var s=r[n+o>>1],l=n-1,u=o+1;;){do l++;while(0>a(r[l],s));do u--;while(a(r[u],s)>0);if(l>=u)break;var c=r[l];r[l]=r[u],r[u]=c,c=i[l],i[l]=i[u],i[u]=c}e(r,i,n,u,a),e(r,i,u+1,o,a)}}(r,i,0,o-1,a),null===this._root)this._root=function r(i,n,o,a){var s=a-o;if(s>0){var l=o+Math.floor(s/2),u=new e(i[l],n[l]);
113return u.left=r(i,n,o,l),u.right=r(i,n,l+1,a),u}return null}(r,i,0,o),this._size=o;else{var s=function(r,i,n){for(var o=new e(null,null),a=o,s=r,l=i;null!==s&&null!==l;)0>n(s.key,l.key)?(a.next=s,s=s.next):(a.next=l,l=l.next),a=a.next;return null!==s?a.next=s:null!==l&&(a.next=l),o.next}(this.toList(),function(r,i){for(var n=new e(null,null),o=n,a=0;a<r.length;a++)o=o.next=new e(r[a],i[a]);return o.next=null,n.next}(r,i),a);o=this._size+o,this._root=function e(r,i,n){var o=n-i;if(o>0){var a=i+Math.floor(o/2),s=e(r,i,a),l=r.head;return l.left=s,r.head=r.head.next,l.right=e(r,a+1,n),l}return null}({head:s},0,o)}return this},n.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var r=[];return!function e(r,i,n,o,a){if(r){o(""+i+(n?"└── ":"├── ")+a(r)+"\n");var s=i+(n?"    ":"│   ");r.left&&e(r.left,s,!1,o,a),r.right&&e(r.right,s,!0,o,a)}}(this._root,"",!0,function(e){return r.push(e)},e),r.join("")},n.prototype.update=function(e,r,n){var s,l,u=this._comparator,c=a(e,this._root,u),h=c.left,p=c.right;0>u(e,r)?p=o(r,n,p,u):h=o(r,n,h,u),this._root=(s=h,null===(l=p)?s:(null===s||((l=i(s.key,l,u)).left=s),l))},n.prototype.split=function(e){return a(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,r,i;return function(e,r){var i,n,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var u=[a,l];if(i)throw TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){s=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){s.label=u[1];break}if(6===u[0]&&s.label<o[1]){s.label=o[1],o=u;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(u);break}o[2]&&s.ops.pop(),s.trys.pop();continue}u=r.call(e,s)}catch(e){u=[6,e],n=0}finally{i=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:e=this._root,r=[],i=!1,n.label=1;case 1:if(i)return[3,6];if(null===e)return[3,2];return r.push(e),e=e.left,[3,5];case 2:if(0===r.length)return[3,4];return[4,e=r.pop()];case 3:return n.sent(),e=e.right,[3,5];case 4:i=!0,n.label=5;case 5:return[3,1];case 6:return[2]}})},n}();let l=(e,r)=>e.ll.x<=r.x&&r.x<=e.ur.x&&e.ll.y<=r.y&&r.y<=e.ur.y,u=(e,r)=>{if(r.ur.x<e.ll.x||e.ur.x<r.ll.x||r.ur.y<e.ll.y||e.ur.y<r.ll.y)return null;let i=e.ll.x<r.ll.x?r.ll.x:e.ll.x,n=e.ur.x<r.ur.x?e.ur.x:r.ur.x;return{ll:{x:i,y:e.ll.y<r.ll.y?r.ll.y:e.ll.y},ur:{x:n,y:e.ur.y<r.ur.y?e.ur.y:r.ur.y}}},c=Number.EPSILON;void 0===c&&(c=2220446049250313e-31);let h=c*c,p=(e,r)=>{if(-c<e&&e<c&&-c<r&&r<c)return 0;let i=e-r;return i*i<h*e*r?0:e<r?-1:1};class d{constructor(){this.reset()}reset(){this.xRounder=new f,this.yRounder=new f}round(e,r){return{x:this.xRounder.round(e),y:this.yRounder.round(r)}}}class f{constructor(){this.tree=new s,this.round(0)}round(e){let r=this.tree.add(e),i=this.tree.prev(r);if(null!==i&&0===p(r.key,i.key))return this.tree.remove(e),i.key;let n=this.tree.next(r);return null!==n&&0===p(r.key,n.key)?(this.tree.remove(e),n.key):e}}let m=new d,g=(3+8881784197001252e-31)*11102230246251565e-32;function _(e,r,i,n,o){let a,s,l,u,c=r[0],h=n[0],p=0,d=0;h>c==h>-c?(a=c,c=r[++p]):(a=h,h=n[++d]);let f=0;if(p<e&&d<i)for(h>c==h>-c?(s=c+a,l=a-(s-c),c=r[++p]):(s=h+a,l=a-(s-h),h=n[++d]),a=s,0!==l&&(o[f++]=l);p<e&&d<i;)h>c==h>-c?(u=(s=a+c)-a,l=a-(s-u)+(c-u),c=r[++p]):(u=(s=a+h)-a,l=a-(s-u)+(h-u),h=n[++d]),a=s,0!==l&&(o[f++]=l);for(;p<e;)u=(s=a+c)-a,l=a-(s-u)+(c-u),c=r[++p],a=s,0!==l&&(o[f++]=l);for(;d<i;)u=(s=a+h)-a,l=a-(s-u)+(h-u),h=n[++d],a=s,0!==l&&(o[f++]=l);return(0!==a||0===f)&&(o[f++]=a),f}function y(e){return new Float64Array(e)}let v=(3+17763568394002505e-31)*11102230246251565e-32,x=(2+13322676295501878e-31)*11102230246251565e-32,b=(9+7105427357601002e-30)*11102230246251565e-32*11102230246251565e-32,w=y(4),E=y(8),S=y(12),T=y(16),I=y(4),M=(e,r)=>e.x*r.y-e.y*r.x,C=(e,r)=>e.x*r.x+e.y*r.y,A=(e,r,i)=>{var n,o,a,s,l,u;let c,h,p,d,f=(n=e.x,o=e.y,a=r.x,s=r.y,l=i.x,c=(o-(u=i.y))*(a-l),p=c-(h=(n-l)*(s-u)),Math.abs(p)>=v*(d=Math.abs(c+h))?p:-function(e,r,i,n,o,a,s){let l,u,c,h,p,d,f,m,y,v,M,C,A,P,L,O,D,R,k=e-o,N=i-o,F=r-a,z=n-a;P=k*z,f=(d=0x8000001*k)-(d-k),m=k-f,y=(d=0x8000001*z)-(d-z),L=m*(v=z-y)-(P-f*y-m*y-f*v),O=F*N,f=(d=0x8000001*F)-(d-F),m=F-f,y=(d=0x8000001*N)-(d-N),M=L-(D=m*(v=N-y)-(O-f*y-m*y-f*v)),p=L-M,w[0]=L-(M+p)+(p-D),p=(C=P+M)-P,M=(A=P-(C-p)+(M-p))-O,p=A-M,w[1]=A-(M+p)+(p-O),p=(R=C+M)-C,w[2]=C-(R-p)+(M-p),w[3]=R;let B=function(e){let r=e[0];for(let i=1;i<4;i++)r+=e[i];return r}(w),U=x*s;if(B>=U||-B>=U||(p=e-k,l=e-(k+p)+(p-o),p=i-N,c=i-(N+p)+(p-o),p=r-F,u=r-(F+p)+(p-a),p=n-z,h=n-(z+p)+(p-a),0===l&&0===u&&0===c&&0===h)||(U=b*s+g*Math.abs(B),(B+=k*h+z*l-(F*c+N*u))>=U||-B>=U))return B;P=l*z,f=(d=0x8000001*l)-(d-l),m=l-f,y=(d=0x8000001*z)-(d-z),L=m*(v=z-y)-(P-f*y-m*y-f*v),O=u*N,f=(d=0x8000001*u)-(d-u),m=u-f,y=(d=0x8000001*N)-(d-N),M=L-(D=m*(v=N-y)-(O-f*y-m*y-f*v)),p=L-M,I[0]=L-(M+p)+(p-D),p=(C=P+M)-P,M=(A=P-(C-p)+(M-p))-O,p=A-M,I[1]=A-(M+p)+(p-O),p=(R=C+M)-C,I[2]=C-(R-p)+(M-p),I[3]=R;let j=_(4,w,4,I,E);P=k*h,f=(d=0x8000001*k)-(d-k),m=k-f,y=(d=0x8000001*h)-(d-h),L=m*(v=h-y)-(P-f*y-m*y-f*v),O=F*c,f=(d=0x8000001*F)-(d-F),m=F-f,y=(d=0x8000001*c)-(d-c),M=L-(D=m*(v=c-y)-(O-f*y-m*y-f*v)),p=L-M,I[0]=L-(M+p)+(p-D),p=(C=P+M)-P,M=(A=P-(C-p)+(M-p))-O,p=A-M,I[1]=A-(M+p)+(p-O),p=(R=C+M)-C,I[2]=C-(R-p)+(M-p),I[3]=R;let V=_(j,E,4,I,S);P=l*h,f=(d=0x8000001*l)-(d-l),m=l-f,y=(d=0x8000001*h)-(d-h),L=m*(v=h-y)-(P-f*y-m*y-f*v),O=u*c,f=(d=0x8000001*u)-(d-u),m=u-f,y=(d=0x8000001*c)-(d-c),M=L-(D=m*(v=c-y)-(O-f*y-m*y-f*v)),p=L-M,I[0]=L-(M+p)+(p-D),p=(C=P+M)-P,M=(A=P-(C-p)+(M-p))-O,p=A-M,I[1]=A-(M+p)+(p-O),p=(R=C+M)-C,I[2]=C-(R-p)+(M-p),I[3]=R;let G=_(V,S,4,I,T);return T[G-1]}(n,o,a,s,l,u,d));return f>0?-1:+(f<0)},P=e=>Math.sqrt(C(e,e)),L=(e,r,i)=>0===r.y?null:{x:e.x+r.x/r.y*(i-e.y),y:i}
113,O=(e,r,i)=>0===r.x?null:{x:i,y:e.y+r.y/r.x*(i-e.x)};class D{static compare(e,r){let i=D.comparePoints(e.point,r.point);return 0!==i?i:(e.point!==r.point&&e.link(r),e.isLeft!==r.isLeft)?e.isLeft?1:-1:k.compare(e.segment,r.segment)}static comparePoints(e,r){return e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:+(e.y>r.y)}constructor(e,r){void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=r}link(e){if(e.point===this.point)throw Error("Tried to link already linked events");let r=e.point.events;for(let e=0,i=r.length;e<i;e++){let i=r[e];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}checkForConsuming(){let e=this.point.events.length;for(let r=0;r<e;r++){let i=this.point.events[r];if(void 0===i.segment.consumedBy)for(let n=r+1;n<e;n++){let e=this.point.events[n];void 0===e.consumedBy&&i.otherSE.point.events===e.otherSE.point.events&&i.segment.consume(e.segment)}}}getAvailableLinkedEvents(){let e=[];for(let r=0,i=this.point.events.length;r<i;r++){let i=this.point.events[r];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&e.push(i)}return e}getLeftmostComparator(e){let r=new Map,i=i=>{var n,o,a,s,l,u;let c,h,p,d,f=i.otherSE;r.set(i,{sine:(n=this.point,o=e.point,a=f.point,c={x:o.x-n.x,y:o.y-n.y},M(h={x:a.x-n.x,y:a.y-n.y},c)/P(h)/P(c)),cosine:(s=this.point,l=e.point,u=f.point,p={x:l.x-s.x,y:l.y-s.y},C(d={x:u.x-s.x,y:u.y-s.y},p)/P(d)/P(p))})};return(e,n)=>{r.has(e)||i(e),r.has(n)||i(n);let{sine:o,cosine:a}=r.get(e),{sine:s,cosine:l}=r.get(n);return o>=0&&s>=0?a<l?1:a>l?-1:0:o<0&&s<0?a<l?-1:+(a>l):s<o?-1:+(s>o)}}}let R=0;class k{static compare(e,r){let i=e.leftSE.point.x,n=r.leftSE.point.x,o=e.rightSE.point.x,a=r.rightSE.point.x;if(a<i)return 1;if(o<n)return -1;let s=e.leftSE.point.y,l=r.leftSE.point.y,u=e.rightSE.point.y,c=r.rightSE.point.y;if(i<n){if(l<s&&l<u)return 1;if(l>s&&l>u)return -1;let i=e.comparePoint(r.leftSE.point);if(i<0)return 1;if(i>0)return -1;let n=r.comparePoint(e.rightSE.point);return 0!==n?n:-1}if(i>n){if(s<l&&s<c)return -1;if(s>l&&s>c)return 1;let i=r.comparePoint(e.leftSE.point);if(0!==i)return i;let n=e.comparePoint(r.rightSE.point);return n<0?1:n>0?-1:1}if(s<l)return -1;if(s>l)return 1;if(o<a){let i=r.comparePoint(e.rightSE.point);if(0!==i)return i}if(o>a){let i=e.comparePoint(r.rightSE.point);if(i<0)return 1;if(i>0)return -1}if(o!==a){let e=u-s,r=o-i,h=c-l,p=a-n;if(e>r&&h<p)return 1;if(e<r&&h>p)return -1}return o>a?1:o<a||u<c?-1:u>c?1:e.id<r.id?-1:+(e.id>r.id)}constructor(e,r,i,n){this.id=++R,this.leftSE=e,e.segment=this,e.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=e,this.rings=i,this.windings=n}static fromRing(e,r,i){let n,o,a,s=D.comparePoints(e,r);if(s<0)n=e,o=r,a=1;else if(s>0)n=r,o=e,a=-1;else throw Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);return new k(new D(n,!0),new D(o,!1),[i],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let e=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<r?e:r},ur:{x:this.rightSE.point.x,y:e>r?e:r}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;let r=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(r.x===i.x)return e.x===r.x?0:e.x<r.x?1:-1;let o=(e.y-r.y)/n.y,a=r.x+o*n.x;if(e.x===a)return 0;let s=(e.x-r.x)/n.x,l=r.y+s*n.y;return e.y===l?0:e.y<l?-1:1}getIntersection(e){let r=this.bbox(),i=e.bbox(),n=u(r,i);if(null===n)return null;let o=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,h=l(r,s)&&0===this.comparePoint(s),p=l(i,o)&&0===e.comparePoint(o),d=l(r,c)&&0===this.comparePoint(c),f=l(i,a)&&0===e.comparePoint(a);if(p&&h)return f&&!d?a:!f&&d?c:null;if(p)return d&&o.x===c.x&&o.y===c.y?null:o;if(h)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&d)return null;if(f)return a;
113if(d)return c;let g=((e,r,i,n)=>{if(0===r.x)return O(i,n,e.x);if(0===n.x)return O(e,r,i.x);if(0===r.y)return L(i,n,e.y);if(0===n.y)return L(e,r,i.y);let o=M(r,n);if(0==o)return null;let a={x:i.x-e.x,y:i.y-e.y},s=M(a,r)/o,l=M(a,n)/o;return{x:(e.x+l*r.x+(i.x+s*n.x))/2,y:(e.y+l*r.y+(i.y+s*n.y))/2}})(o,this.vector(),s,e.vector());return null!==g&&l(n,g)?m.round(g.x,g.y):null}split(e){let r=[],i=void 0!==e.events,n=new D(e,!0),o=new D(e,!1),a=this.rightSE;this.replaceRightSE(o),r.push(o),r.push(n);let s=new k(n,a,this.rings.slice(),this.windings.slice());return D.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),D.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(n.checkForConsuming(),o.checkForConsuming()),r}swapEvents(){let e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,r=this.windings.length;e<r;e++)this.windings[e]*=-1}consume(e){let r=this,i=e;for(;r.consumedBy;)r=r.consumedBy;for(;i.consumedBy;)i=i.consumedBy;let n=k.compare(r,i);if(0!==n){if(n>0){let e=r;r=i,i=e}if(r.prev===i){let e=r;r=i,i=e}for(let e=0,n=i.rings.length;e<n;e++){let n=i.rings[e],o=i.windings[e],a=r.rings.indexOf(n);-1===a?(r.rings.push(n),r.windings.push(o)):r.windings[a]+=o}i.rings=null,i.windings=null,i.consumedBy=r,i.leftSE.consumedBy=r.leftSE,i.rightSE.consumedBy=r.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){let e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;let e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};let r=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys;for(let e=0,n=this.rings.length;e<n;e++){let n=this.rings[e],o=this.windings[e],a=r.indexOf(n);-1===a?(r.push(n),i.push(o)):i[a]+=o}let o=[],a=[];for(let e=0,n=r.length;e<n;e++){if(0===i[e])continue;let n=r[e],s=n.poly;if(-1===a.indexOf(s))if(n.isExterior)o.push(s);else{-1===a.indexOf(s)&&a.push(s);let e=o.indexOf(n.poly);-1!==e&&o.splice(e,1)}}for(let e=0,r=o.length;e<r;e++){let r=o[e].multiPoly;-1===n.indexOf(r)&&n.push(r)}return this._afterState}
113isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;let e=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch($.type){case"union":{let i=0===e.length,n=0===r.length;this._isInResult=i!==n;break}case"intersection":{let i,n;e.length<r.length?(i=e.length,n=r.length):(i=r.length,n=e.length),this._isInResult=n===$.numMultiPolys&&i<n;break}case"xor":{let i=Math.abs(e.length-r.length);this._isInResult=i%2==1;break}case"difference":{let i=e=>1===e.length&&e[0].isSubject;this._isInResult=i(e)!==i(r);break}default:throw Error(`Unrecognized operation type found ${$.type}`)}return this._isInResult}}class N{constructor(e,r,i){if(!Array.isArray(e)||0===e.length||(this.poly=r,this.isExterior=i,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1]))throw Error("Input geometry is not a valid Polygon or MultiPolygon");const n=m.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let o=n;for(let r=1,i=e.length;r<i;r++){if("number"!=typeof e[r][0]||"number"!=typeof e[r][1])throw Error("Input geometry is not a valid Polygon or MultiPolygon");let i=m.round(e[r][0],e[r][1]);(i.x!==o.x||i.y!==o.y)&&(this.segments.push(k.fromRing(o,i,this)),i.x<this.bbox.ll.x&&(this.bbox.ll.x=i.x),i.y<this.bbox.ll.y&&(this.bbox.ll.y=i.y),i.x>this.bbox.ur.x&&(this.bbox.ur.x=i.x),i.y>this.bbox.ur.y&&(this.bbox.ur.y=i.y),o=i)}(n.x!==o.x||n.y!==o.y)&&this.segments.push(k.fromRing(o,n,this))}getSweepEvents(){let e=[];for(let r=0,i=this.segments.length;r<i;r++){let i=this.segments[r];e.push(i.leftSE),e.push(i.rightSE)}return e}}class F{constructor(e,r){if(!Array.isArray(e))throw Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new N(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,i=e.length;r<i;r++){const i=new N(e[r],this,!1);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=r}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let r=0,i=this.interiorRings.length;r<i;r++){let i=this.interiorRings[r].getSweepEvents();for(let r=0,n=i.length;r<n;r++)e.push(i[r])}return e}}class z{constructor(e,r){if(!Array.isArray(e))throw Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(e){}this.polys=[],this.bbox={ll:{x:1/0,y:1/0},ur:{x:-1/0,y:-1/0}};for(let r=0,i=e.length;r<i;r++){const i=new F(e[r],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=r}getSweepEvents(){let e=[];for(let r=0,i=this.polys.length;r<i;r++){let i=this.polys[r].getSweepEvents();for(let r=0,n=i.length;r<n;r++)e.push(i[r])}return e}}class B{static factory(e){let r=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];if(!n.isInResult()||n.ringOut)continue;let o=null,a=n.leftSE,s=n.rightSE,l=[a],u=a.point,c=[];for(;o=a,a=s,l.push(a),a.point!==u;)for(;;){let e=a.getAvailableLinkedEvents();if(0===e.length){let e=l[0].point,r=l[l.length-1].point;throw Error(`Unable to complete output ring starting at [${e.x}, ${e.y}]. Last matching segment found ends at [${r.x}, ${r.y}].`)}if(1===e.length){s=e[0].otherSE;break}let i=null;for(let e=0,r=c.length;e<r;e++)if(c[e].point===a.point){i=e;break}if(null!==i){let e=c.splice(i)[0],n=l.splice(e.index);n.unshift(n[0].otherSE),r.push(new B(n.reverse()));continue}c.push({index:l.length,point:a.point});let n=a.getLeftmostComparator(o);s=e.sort(n)[0].otherSE;break}r.push(new B(l))}return r}constructor(e){this.events=e;for(let r=0,i=e.length;r<i;r++)e[r].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point,r=[e];for(let i=1,n=this.events.length-1;i<n;i++){let n=this.events[i].point;0!==A(n,e,this.events[i+1].point)&&(r.push(n),e=n)}if(1===r.length)return null;0===A(r[0],e,r[1])&&r.shift(),r.push(r[0]);let i=this.isExteriorRing()?1:-1,n=this.isExteriorRing()?0:r.length-1,o=this.isExteriorRing()?r.length:-1,a=[];for(let e=n;e!=o;e+=i)a.push([r[e].x,r[e].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){let e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,i=this.events.length;r<i;r++){let i=this.events[r];D.compare(e,i)>0&&(e=i)}let r=e.segment.prevInResult(),i=r?r.prevInResult():null;for(;;){if(!r)return null;if(!i)return r.ringOut;if(i.ringOut!==r.ringOut)if(i.ringOut.enclosingRing()!==r.ringOut)return r.ringOut;else return r.ringOut.enclosingRing();i=(r=i.prevInResult())?r.prevInResult():null}}}class U{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){let e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(let r=0,i=this.interiorRings.length;r<i;r++){let i=this.interiorRings[r].getGeom();null!==i&&e.push(i)}return e}}class j{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){let e=[];for(let r=0,i=this.polys.length;r<i;r++){let i=this.polys[r].getGeom();null!==i&&e.push(i)}return e}_composePolys(e){let r=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];if(!n.poly)if(n.isExteriorRing())r.push(new U(n));else{let e=n.enclosingRing();e.poly||r.push(new U(e)),e.poly.addInterior(n)}}return r}}class V{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.compare;this.queue=e,this.tree=new s(r),this.segments=[]}process(e){let r,i,n=e.segment,o=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),o;let a=e.isLeft?this.tree.add(n):this.tree.find(n);if(!a)throw Error(`Unable to find segment #${n.id} [${n.leftSE.point.x}, ${n.leftSE.point.y}] -> [${n.rightSE.point.x}, ${n.rightSE.point.y}] in SweepLine tree.`);let s=a,l=a;for(;void 0===r;)null===(s=this.tree.prev(s))?r=null:void 0===s.key.consumedBy&&(r=s.key);for(;void 0===i;
113)null===(l=this.tree.next(l))?i=null:void 0===l.key.consumedBy&&(i=l.key);if(e.isLeft){let a=null;if(r){let e=r.getIntersection(n);if(null!==e&&(n.isAnEndpoint(e)||(a=e),!r.isAnEndpoint(e))){let i=this._splitSafely(r,e);for(let e=0,r=i.length;e<r;e++)o.push(i[e])}}let s=null;if(i){let e=i.getIntersection(n);if(null!==e&&(n.isAnEndpoint(e)||(s=e),!i.isAnEndpoint(e))){let r=this._splitSafely(i,e);for(let e=0,i=r.length;e<i;e++)o.push(r[e])}}if(null!==a||null!==s){let e=null;e=null===a?s:null===s||0>=D.comparePoints(a,s)?a:s,this.queue.remove(n.rightSE),o.push(n.rightSE);let r=n.split(e);for(let e=0,i=r.length;e<i;e++)o.push(r[e])}o.length>0?(this.tree.remove(n),o.push(e)):(this.segments.push(n),n.prev=r)}else{if(r&&i){let e=r.getIntersection(i);if(null!==e){if(!r.isAnEndpoint(e)){let i=this._splitSafely(r,e);for(let e=0,r=i.length;e<r;e++)o.push(i[e])}if(!i.isAnEndpoint(e)){let r=this._splitSafely(i,e);for(let e=0,i=r.length;e<i;e++)o.push(r[e])}}}this.tree.remove(n)}return o}_splitSafely(e,r){this.tree.remove(e);let i=e.rightSE;this.queue.remove(i);let n=e.split(r);return n.push(i),void 0===e.consumedBy&&this.tree.add(e),n}}let G=void 0!==n&&n.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,q=void 0!==n&&n.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class H{run(e,r,i){$.type=e,m.reset();let n=[new z(r,!0)];for(let e=0,r=i.length;e<r;e++)n.push(new z(i[e],!1));if($.numMultiPolys=n.length,"difference"===$.type){let e=n[0],r=1;for(;r<n.length;)null!==u(n[r].bbox,e.bbox)?r++:n.splice(r,1)}if("intersection"===$.type)for(let e=0,r=n.length;e<r;e++){let r=n[e];for(let i=e+1,o=n.length;i<o;i++)if(null===u(r.bbox,n[i].bbox))return[]}let o=new s(D.compare);for(let e=0,r=n.length;e<r;e++){let r=n[e].getSweepEvents();for(let e=0,i=r.length;e<i;e++)if(o.insert(r[e]),o.size>G)throw Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let a=new V(o),l=o.size,c=o.pop();for(;c;){let e=c.key;if(o.size===l){let r=e.segment;throw Error(`Unable to pop() ${e.isLeft?"left":"right"} SweepEvent [${e.point.x}, ${e.point.y}] from segment #${r.id} [${r.leftSE.point.x}, ${r.leftSE.point.y}] -> [${r.rightSE.point.x}, ${r.rightSE.point.y}] from queue.`)}if(o.size>G)throw Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>q)throw Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let r=a.process(e);for(let e=0,i=r.length;e<i;e++){let i=r[e];void 0===i.consumedBy&&o.insert(i)}l=o.size,c=o.pop()}return m.reset(),new j(B.factory(a.segments)).getGeom()}}let $=new H;return{union:function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return $.run("union",e,i)},intersection:function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return $.run("intersection",e,i)},xor:function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return $.run("xor",e,i)},difference:function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return $.run("difference",e,i)}}}()},90781:(e,r,i)=>{"use strict";i.d(r,{E:()=>a,q:()=>o});var n={};function o(){return n}function a(e){n=e}},91097:e=>{e.exports=function(e,r,i,n){var o=e[0],a=e[1],s=!1;void 0===i&&(i=0),void 0===n&&(n=r.length);for(var l=n-i,u=0,c=l-1;u<l;c=u++){var h=r[u+i][0],p=r[u+i][1],d=r[c+i][0],f=r[c+i][1];p>a!=f>a&&o<(d-h)*(a-p)/(f-p)+h&&(s=!s)}return s}},91431:(e,r,i)=>{"use strict";i.d(r,{KW:()=>s,Sw:()=>c,ZM:()=>h});var n=i(37876),o=i(14232);let a=globalThis.window,s="alert-notifications-enabled",l=()=>void 0===a||"true"===a.localStorage.getItem(s),u=(0,o.createContext)(null),c=({children:e})=>{let[r,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)({}),[c,h]=(0,o.useState)(0),[p,d]=(0,o.useState)(0),[f,m]=(0,o.useState)([]),[g,_]=(0,o.useState)(l),[y,v]=(0,o.useState)(!1),x=(0,o.useMemo)(()=>({showIssueAlertWindow:r,alertReadStatus:a,alertUnreadCount:c,refreshAlerts:p,alertMentions:f,alertNotificationsEnabled:g,showFilterModal:y,setShowIssueAlertWindow:i,setAlertReadStatus:s,setAlertUnreadCount:h,setRefreshAlerts:d,setAlertMentions:m,setAlertNotificationsEnabled:_,setShowFilterModal:v}),[r,a,c,p,f,g,y]);return(0,n.jsx)(u.Provider,{value:x,children:e})},h=()=>{let e=(0,o.useContext)(u);if(!e)throw Error("useAlertContext must be used within a AlertProvider");return e}},91505:(e,r)=>{"use strict";
113function i(e,r,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=r||{},n.geometry=e,n}function n(e,r,n){if(void 0===n&&(n={}),!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!f(e[0])||!f(e[1]))throw Error("coordinates must contain numbers");return i({type:"Point",coordinates:e},r,n)}function o(e,r,n){void 0===n&&(n={});for(var o=0;o<e.length;o++){var a=e[o];if(a.length<4)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:e},r,n)}function a(e,r,n){if(void 0===n&&(n={}),e.length<2)throw Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:e},r,n)}function s(e,r){void 0===r&&(r={});var i={type:"FeatureCollection"};return r.id&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.features=e,i}function l(e,r,n){return void 0===n&&(n={}),i({type:"MultiLineString",coordinates:e},r,n)}function u(e,r,n){return void 0===n&&(n={}),i({type:"MultiPoint",coordinates:e},r,n)}function c(e,r,n){return void 0===n&&(n={}),i({type:"MultiPolygon",coordinates:e},r,n)}function h(e,i){void 0===i&&(i="kilometers");var n=r.factors[i];
113if(!n)throw Error(i+" units is invalid");return e*n}function p(e,i){void 0===i&&(i="kilometers");var n=r.factors[i];if(!n)throw Error(i+" units is invalid");return e/n}function d(e){return e%(2*Math.PI)*180/Math.PI}function f(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:1.0936*r.earthRadius},r.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/r.earthRadius,yards:1.0936133},r.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},r.feature=i,r.geometry=function(e,r,i){switch(void 0===i&&(i={}),e){case"Point":return n(r).geometry;case"LineString":return a(r).geometry;case"Polygon":return o(r).geometry;case"MultiPoint":return u(r).geometry;case"MultiLineString":return l(r).geometry;case"MultiPolygon":return c(r).geometry;default:throw Error(e+" is invalid")}},r.point=n,r.points=function(e,r,i){return void 0===i&&(i={}),s(e.map(function(e){return n(e,r)}),i)},r.polygon=o,r.polygons=function(e,r,i){return void 0===i&&(i={}),s(e.map(function(e){return o(e,r)}),i)},r.lineString=a,r.lineStrings=function(e,r,i){return void 0===i&&(i={}),s(e.map(function(e){return a(e,r)}),i)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=u,r.multiPolygon=c,r.geometryCollection=function(e,r,n){return void 0===n&&(n={}),i({type:"GeometryCollection",geometries:e},r,n)},r.round=function(e,r){if(void 0===r&&(r=0),r&&!(r>=0))throw Error("precision must be a positive number");var i=Math.pow(10,r||0);return Math.round(e*i)/i},r.radiansToLength=h,r.lengthToRadians=p,r.lengthToDegrees=function(e,r){return d(p(e,r))},r.bearingToAzimuth=function(e){var r=e%360;return r<0&&(r+=360),r},r.radiansToDegrees=d,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,r,i){if(void 0===r&&(r="kilometers"),void 0===i&&(i="kilometers"),!(e>=0))throw Error("length must be a positive number");return h(p(e,r),i)},r.convertArea=function(e,i,n){if(void 0===i&&(i="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw Error("area must be a positive number");var o=r.areaFactors[i];if(!o)throw Error("invalid original units");var a=r.areaFactors[n];if(!a)throw Error("invalid final units");return e/o*a},r.isNumber=f,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw Error("bbox is required");if(!Array.isArray(e))throw Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!f(e))throw Error("bbox must only contain numbers")})},r.validateId=function(e){if(!e)throw Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw Error("id must be a number or a string")}},91570:(e,r,i)=>{"use strict";var n=i(70803);e.exports=function(e){var r=n(e),i=0,o=0,a=0,s=0;if(r.length){if(r.length>1&&0===r[0].width){var l=r[1];i=l.top,o=l.right,a=l.bottom,s=l.left}else{var u=r[0];i=u.top,o=u.right,a=u.bottom,s=u.left}for(var c=1;c<r.length;c++){var h=r[c];0!==h.height&&0!==h.width&&(i=Math.min(i,h.top),o=Math.max(o,h.right),a=Math.max(a,h.bottom),s=Math.min(s,h.left))}}return{top:i,right:o,bottom:a,left:s,width:o-s,height:a-i}}},91685:(e,r,i)=>{"use strict";function n(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}
113))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}var o=i(14842),a=i(60620),s=i(18428),l=i(9912),u=i(39636),c=i(18916),h=i(58217),p=i(58240),d=i(93710),f=i(64313),m=p("draft_tree_data_support"),g=m?l:s,_=d.List,y=d.Repeat;e.exports={insertAtomicBlock:function(e,r,i){var s=e.getCurrentContent(),l=e.getSelection(),p=u.removeRange(s,l,"backward"),d=p.getSelectionAfter(),f=u.splitBlock(p,d),v=f.getSelectionAfter(),x=u.setBlockType(f,v,"atomic"),b=a.create({entity:r}),w={key:h(),type:"atomic",text:i,characterList:_(y(b,i.length))},E={key:h(),type:"unstyled"};m&&(w=n({},w,{nextSibling:E.key}),E=n({},E,{prevSibling:w.key}));var S=[new g(w),new g(E)],T=o.createFromArray(S),I=u.replaceWithFragment(x,v,T),M=I.merge({selectionBefore:l,selectionAfter:I.getSelectionAfter().set("hasFocus",!0)});return c.push(e,M,"insert-fragment")},moveAtomicBlock:function(e,r,i,n){var o,a=e.getCurrentContent(),s=e.getSelection();if("before"===n||"after"===n){var l=a.getBlockForKey("before"===n?i.getStartKey():i.getEndKey());o=f(a,r,l,n)}else{var h=u.removeRange(a,i,"backward"),p=h.getSelectionAfter(),d=h.getBlockForKey(p.getFocusKey());if(0===p.getStartOffset())o=f(h,r,d,"before");else if(p.getEndOffset()===d.getLength())o=f(h,r,d,"after");else{var m=u.splitBlock(h,p),g=m.getSelectionAfter(),_=m.getBlockForKey(g.getFocusKey());o=f(m,r,_,"before")}}var y=o.merge({selectionBefore:s,selectionAfter:o.getSelectionAfter().set("hasFocus",!0)});return c.push(e,y,"move-block")}}},92382:(e,r,i)=>{"use strict";i.r(r),i.d(r,{default:()=>B});var n=i(37876),o=i(14232);function a({beforeSend:e,debug:r=!0,mode:i="auto"}){return(0,o.useEffect)(()=>{((e={debug:!0})=>{var r;if(!("u">typeof window))return;let i=function(e="auto"){return"auto"===e?!function(){try{return!1}catch(e){return!1}}()?"production":"development":e}(e.mode);window.va||(window.va=function(...e){(window.vaq=window.vaq||[]).push(e)}),e.beforeSend&&(null==(r=window.va)||r.call(window,"beforeSend",e.beforeSend));let n="development"===i?"https://cdn.vercel-insights.com/v1/script.debug.js":"/_vercel/insights/script.js";if(document.head.querySelector(`script[src*="${n}"]`))return;let o=document.createElement("script");o.src=n,o.defer=!0,o.setAttribute("data-sdkn","@vercel/analytics"),o.setAttribute("data-sdkv","0.1.11"),"development"===i&&!1===e.debug&&o.setAttribute("data-debug","false"),document.head.appendChild(o)})({beforeSend:e,debug:r,mode:i})},[e,r,i]),null}i(51678);var s=i(72080),l=i(97415),u=i(29374),c=i(30328),h=i(21034),p=i(69904),d=i(99637),f=i(91431),m=i(53669),g=i(63797),_=i(89977),y=i(55283),v=i(93258),x=i(79926),b=i(57271),w=i(29782),E=i(77784),S=i(92797),T=i(56011),I=i(18334),M=i(68285),C=i(81632),A=i(82155);function P(e={}){let r=A.jf.document,i=r?.head||r?.body;if(!i){C.T&&T.Yz.error("[showReportDialog] Global document not defined");return}let n=(0,S.o5)(),o=(0,S.KU)(),a=o?.getDsn();if(!a){C.T&&T.Yz.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...n.getUser(),...e.user},eventId:e.eventId||(0,I.Q)()},l=A.jf.document.createElement("script");l.async=!0,l.crossOrigin="anonymous",l.src=(0,M.kJ)(a,s);let{onLoad:u,onClose:c}=s;if(u&&(l.onload=u),c){let e=r=>{if("__sentry_reportdialog_closed__"===r.data)try{c()}finally{A.jf.removeEventListener("message",e)}};A.jf.addEventListener("message",e)}i.appendChild(l)}let L="u"<typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var O=i(50045);let D={componentStack:null,error:null,eventId:null};class R extends o.Component{constructor(e){super(e),this.state=D,this._openFallbackReportDialog=!0;const r=(0,S.KU)();r&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=r.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&P({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,r){let{componentStack:i}=r,{beforeCapture:n,onError:a,showDialog:s,dialogOptions:l}=this.props;(0,S.v4)(u=>{n&&n(u,e,i);let c=function(e,{componentStack:r},i){let n;if(null!==(n=o.version.match(/^([^.]+)/))&&parseInt(n[0])>=17&&(0,O.bJ)(e)&&r){let i,n=Error(e.message);n.name=`React ErrorBoundary ${e.name}`,n.stack=r,i=new WeakSet,function e(r,n){if(!i.has(r)){if(r.cause)return i.add(r),e(r.cause,n);r.cause=n}}(e,n)}return(0,I.Cp)(e,i)}(e,r,{mechanism:{handled:null!=this.props.handled?this.props.handled:!!this.props.fallback,type:"auto.function.react.error_boundary"}});a&&a(e,i,c),s&&(this._lastEventId=c,this._openFallbackReportDialog&&P({...l,eventId:c})),this.setState({error:e,componentStack:i,eventId:c})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:r,eventId:i}=this.state,{onUnmount:n}=this.props;n&&(this.state===D?n(null,null,null):n(e,r,i)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){let{onReset:e}=this.props,{error:r,componentStack:i,eventId:n}=this.state;e&&e(r,i,n),this.setState(D)}render(){let{fallback:e,children:r}=this.props,i=this.state;if(null===i.componentStack)return"function"==typeof r?r():r;let n="function"==typeof e?o.createElement(e,{error:i.error,componentStack:i.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:i.eventId}):e;return o.isValidElement(n)?n:(e&&L&&T.Yz.warn("fallback did not produce a valid ReactElement"),null)}}function k(){return(0,n.jsx)("main",{className:"flex min-h-screen items-center justify-center bg-[#17181C] p-6 text-center text-white",children:(0,n.jsxs)("section",{children:[(0,n.jsx)("h1",{className:"text-xl font-semibold",children:"Something went wrong"}),(0,n.jsx)("p",{className:"mt-2 text-sm text-gray-300",children:"Please try loading FusionMap again."}),(0,n.jsx)("button",{className:"mt-4 rounded bg-blue-600 px-4 py-2 text-sm font-medium hover:bg-blue-500",onClick:()=>window.location.reload(),type:"button",children:"Try again"})]})})}function N({children:e}){return(0,n.jsx)(R,{fallback:k,children:e})}var F=i(18847);let z=i.n(F)()(()=>i.e(7007).then(i.bind(i,47007)),{ssr:!1}),B=function({Component:e,pageProps:r}){return(0,n.jsx)(N,{children:(0,n.jsx)(h.a,{children:(0,n.jsx)(s.LD,{children:(0,n.jsx)(l.a,{children:(0,n.jsx)(y.lo,{children:(0,n.jsx)(v.r,{children:(0,n.jsx)(p.K,{children:(0,n.jsx)(d.i,{children:(0,n.jsx)(f.Sw,{children:(0,n.jsx)(g.P,{children:(0,n.jsx)(m.u,{children:(0,n.jsx)(_.s,{children:(0,n.jsx)(c.i,{children:(0,n.jsx)(x.y,{children:(0,n.jsx)(E.g,{children:(0,n.jsx)(w.A,{children:(0,n.jsx)(b.d,{children:(0,n.jsxs)(u.J,{children:[(0,n.jsx)(z,{}),(0,n.jsx)(e,{...r}),(0,n.jsx)(a,{})]})})})})})})})})})})})})})})})})})})}}
113,92909:(e,r,i)=>{"use strict";i.d(r,{Fn:()=>n,ur:()=>o});let n=["Confirmed","Escalate","De-escalate","False positive"],o=(e,r)=>!(e=>{if(!Object.keys(e).every(e=>"id"===e||"properties"===e))return!1;let r=Object.keys(e.properties??{});return 1===r.length&&"verify_status"===r[0]})(e)&&(!Object.keys(e).every(e=>"id"===e||"reviewed"===e)||"reviewed"in e&&r)},92967:e=>{"use strict";e.exports=function(e){var r=e.getSelection(),i=r.getAnchorKey(),n=e.getBlockTree(i),o=r.getStartOffset(),a=!1;return n.some(function(e){return o===e.get("start")?(a=!0,!0):o<e.get("end")&&e.get("leaves").some(function(e){return o===e.get("start")&&(a=!0,!0)})}),a}},93023:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},93258:(e,r,i)=>{"use strict";i.d(r,{i:()=>l,r:()=>s});var n=i(37876),o=i(14232);let a=(0,o.createContext)(null),s=({children:e})=>{let[r,i]=(0,o.useState)(0),s=(0,o.useMemo)(()=>({gisDataVersion:r,triggerGisDataUpdate:async e=>{let r=e?await e():void 0;return i(e=>e+1),r}}),[r]);return(0,n.jsx)(a.Provider,{value:s,children:e})},l=()=>{let e=(0,o.useContext)(a);if(!e)throw Error("useGisDataVersionContext must be used within a GisDataVersionProvider");return e}},93544:(e,r,i)=>{"use strict";var n=i(91570);e.exports=function(e){var r=e.getSelection();if(!r.rangeCount)return null;var i=n(r.getRangeAt(0)),o=i.top,a=i.right,s=i.bottom,l=i.left;return 0===o&&0===a&&0===s&&0===l?null:i}},93692:(e,r,i)=>{"use strict";var n=i(8908),o=i(15065),a=i(15796);
113function s(e,r,i,s,l,u,c){var h=i.getStartOffset(),p=i.getEndOffset(),d=e.__get(l).getMutability(),f=c?h:p;if("MUTABLE"===d)return i;var m=o(r,l).filter(function(e){return f<=e.end&&f>=e.start});1!=m.length&&a(!1);var g=m[0];if("IMMUTABLE"===d)return i.merge({anchorOffset:g.start,focusOffset:g.end,isBackward:!1});u||(c?p=g.end:h=g.start);var _=n.getRemovalRange(h,p,r.getText().slice(g.start,g.end),g.start,s);return i.merge({anchorOffset:_.start,focusOffset:_.end,isBackward:!1})}e.exports=function(e,r,i,n,o){var a=n.getStartOffset(),l=n.getEndOffset(),u=r.getEntityAt(a),c=i.getEntityAt(l-1);if(!u&&!c)return n;var h=n;if(u&&u===c)h=s(e,r,h,o,u,!0,!0);else if(u&&c){var p=s(e,r,h,o,u,!1,!0),d=s(e,i,h,o,c,!1,!1);h=h.merge({anchorOffset:p.getAnchorOffset(),focusOffset:d.getFocusOffset(),isBackward:!1})}else if(u){var f=s(e,r,h,o,u,!1,!0);h=h.merge({anchorOffset:f.getStartOffset(),isBackward:!1})}else if(c){var m=s(e,i,h,o,c,!1,!1);h=h.merge({focusOffset:m.getEndOffset(),isBackward:!1})}return h}},93710:function(e){e.exports=function(){"use strict";var e,r,i,n,o,a,s,l,u,c,h=Array.prototype.slice;function p(e,r){r&&(e.prototype=Object.create(r.prototype)),e.prototype.constructor=e}function d(e){return _(e)?e:Z(e)}function f(e){return y(e)?e:X(e)}function m(e){return v(e)?e:K(e)}function g(e){return _(e)&&!x(e)?e:Q(e)}function _(e){return!!(e&&e[w])}function y(e){return!!(e&&e[E])}function v(e){return!!(e&&e[S])}function x(e){return y(e)||v(e)}function b(e){return!!(e&&e[T])}p(f,d),p(m,d),p(g,d),d.isIterable=_,d.isKeyed=y,d.isIndexed=v,d.isAssociative=x,d.isOrdered=b,d.Keyed=f,d.Indexed=m,d.Set=g;var w="@@__IMMUTABLE_ITERABLE__@@",E="@@__IMMUTABLE_KEYED__@@",S="@@__IMMUTABLE_INDEXED__@@",T="@@__IMMUTABLE_ORDERED__@@",I="delete",M={},C={value:!1},A={value:!1};function P(e){return e.value=!1,e}function L(e){e&&(e.value=!0)}function O(){}function D(e,r){r=r||0;for(var i=Math.max(0,e.length-r),n=Array(i),o=0;o<i;o++)n[o]=e[o+r];return n}function R(e){return void 0===e.size&&(e.size=e.__iterate(N)),e.size}function k(e,r){if("number"!=typeof r){var i=r>>>0;if(""+i!==r||0xffffffff===i)return NaN;r=i}return r<0?R(e)+r:r}function N(){return!0}function F(e,r,i){return(0===e||void 0!==i&&e<=-i)&&(void 0===r||void 0!==i&&r>=i)}function z(e,r,i){return void 0===e?i:e<0?Math.max(0,r+e):void 0===r?e:Math.min(r,e)}var B="function"==typeof Symbol&&Symbol.iterator,U="@@iterator",j=B||U;function V(e){this.next=e}function G(e,r,i,n){var o=0===e?r:1===e?i:[r,i];return n?n.value=o:n={value:o,done:!1},n}function q(){return{value:void 0,done:!0}}function H(e){return e&&"function"==typeof e.next}function $(e){var r=W(e);return r&&r.call(e)}function W(e){var r=e&&(B&&e[B]||e[U]);if("function"==typeof r)return r}function Y(e){return e&&"number"==typeof e.length}function Z(e){return null==e?eo():_(e)?e.toSeq():function(e){var r=el(e)||"object"==typeof e&&new et(e);if(!r)throw TypeError("Expected Array or iterable object of values, or keyed object: "+e);return r}(e)}function X(e){return null==e?eo().toKeyedSeq():_(e)?y(e)?e.toSeq():e.fromEntrySeq():ea(e)}function K(e){return null==e?eo():_(e)?y(e)?e.entrySeq():e.toIndexedSeq():es(e)}function Q(e){return(null==e?eo():!_(e)?es(e):y(e)?e.entrySeq():e).toSetSeq()}V.prototype.toString=function(){return"[Iterator]"},V.KEYS=0,V.VALUES=1,V.ENTRIES=2,V.prototype.inspect=V.prototype.toSource=function(){return this.toString()},V.prototype[j]=function(){return this},p(Z,d),Z.of=function(){return Z(arguments)},Z.prototype.toSeq=function(){return this},Z.prototype.toString=function(){return this.__toString("Seq {","}")},Z.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Z.prototype.__iterate=function(e,r){return eu(this,e,r,!0)},Z.prototype.__iterator=function(e,r){return ec(this,e,r,!0)},p(X,Z),X.prototype.toKeyedSeq=function(){return this},p(K,Z),K.of=function(){return K(arguments)},K.prototype.toIndexedSeq=function(){return this},K.prototype.toString=function(){return this.__toString("Seq [","]")},K.prototype.__iterate=function(e,r){return eu(this,e,r,!1)},K.prototype.__iterator=function(e,r){return ec(this,e,r,!1)},p(Q,Z),Q.of=function(){return Q(arguments)},Q.prototype.toSetSeq=function(){return this},Z.isSeq=en,Z.Keyed=X,Z.Set=Q,Z.Indexed=K;
113var J="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function et(e){var r=Object.keys(e);this._object=e,this._keys=r,this.size=r.length}function er(e){this._iterable=e,this.size=e.length||e.size}function ei(e){this._iterator=e,this._iteratorCache=[]}function en(e){return!!(e&&e[J])}function eo(){return e||(e=new ee([]))}function ea(e){var r=Array.isArray(e)?new ee(e).fromEntrySeq():H(e)?new ei(e).fromEntrySeq():W(e)?new er(e).fromEntrySeq():"object"==typeof e?new et(e):void 0;if(!r)throw TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return r}function es(e){var r=el(e);if(!r)throw TypeError("Expected Array or iterable object of values: "+e);return r}function el(e){return Y(e)?new ee(e):H(e)?new ei(e):W(e)?new er(e):void 0}function eu(e,r,i,n){var o=e._cache;if(o){for(var a=o.length-1,s=0;s<=a;s++){var l=o[i?a-s:s];if(!1===r(l[1],n?l[0]:s,e))return s+1}return s}return e.__iterateUncached(r,i)}function ec(e,r,i,n){var o=e._cache;if(o){var a=o.length-1,s=0;return new V(function(){var e=o[i?a-s:s];return s++>a?q():G(r,n?e[0]:s-1,e[1])})}return e.__iteratorUncached(r,i)}function eh(e,r){return r?function e(r,i,n,o){return Array.isArray(i)?r.call(o,n,K(i).map(function(n,o){return e(r,n,o,i)})):ep(i)?r.call(o,n,X(i).map(function(n,o){return e(r,n,o,i)})):i}(r,e,"",{"":e}):function e(r){return Array.isArray(r)?K(r).map(e).toList():ep(r)?X(r).map(e).toMap():r}(e)}function ep(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ed(e,r){if(e===r||e!=e&&r!=r)return!0;if(!e||!r)return!1;if("function"==typeof e.valueOf&&"function"==typeof r.valueOf){if((e=e.valueOf())===(r=r.valueOf())||e!=e&&r!=r)return!0;if(!e||!r)return!1}return!!("function"==typeof e.equals&&"function"==typeof r.equals&&e.equals(r))}function ef(e,r){if(e===r)return!0;if(!_(r)||void 0!==e.size&&void 0!==r.size&&e.size!==r.size||void 0!==e.__hash&&void 0!==r.__hash&&e.__hash!==r.__hash||y(e)!==y(r)||v(e)!==v(r)||b(e)!==b(r))return!1;if(0===e.size&&0===r.size)return!0;var i=!x(e);if(b(e)){var n=e.entries();return r.every(function(e,r){var o=n.next().value;return o&&ed(o[1],e)&&(i||ed(o[0],r))})&&n.next().done}var o=!1;if(void 0===e.size)if(void 0===r.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var a=e;e=r,r=a}var s=!0,l=r.__iterate(function(r,n){if(i?!e.has(r):o?!ed(r,e.get(n,M)):!ed(e.get(n,M),r))return s=!1,!1});return s&&e.size===l}function em(e,i){if(!(this instanceof em))return new em(e,i);if(this._value=e,this.size=void 0===i?1/0:Math.max(0,i),0===this.size){if(r)return r;r=this}}function eg(e,r){if(!e)throw Error(r)}function e_(e,r,n){if(!(this instanceof e_))return new e_(e,r,n);if(eg(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<e&&(n=-n),this._start=e,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-e)/n-1)+1),0===this.size){if(i)return i;i=this}}function ey(){throw TypeError("Abstract")}function ev(){}function ex(){}function eb(){}Z.prototype[J]=!0,p(ee,K),ee.prototype.get=function(e,r){return this.has(e)?this._array[k(this,e)]:r},ee.prototype.__iterate=function(e,r){for(var i=this._array,n=i.length-1,o=0;o<=n;o++)if(!1===e(i[r?n-o:o],o,this))return o+1;return o},ee.prototype.__iterator=function(e,r){var i=this._array,n=i.length-1,o=0;return new V(function(){return o>n?q():G(e,o,i[r?n-o++:o++])})},p(et,X),et.prototype.get=function(e,r){return void 0===r||this.has(e)?this._object[e]:r},et.prototype.has=function(e){return this._object.hasOwnProperty(e)},et.prototype.__iterate=function(e,r){for(var i=this._object,n=this._keys,o=n.length-1,a=0;a<=o;a++){var s=n[r?o-a:a];if(!1===e(i[s],s,this))return a+1}return a},et.prototype.__iterator=function(e,r){var i=this._object,n=this._keys,o=n.length-1,a=0;return new V(function(){var s=n[r?o-a:a];return a++>o?q():G(e,s,i[s])})},et.prototype[T]=!0,p(er,K),er.prototype.__iterateUncached=function(e,r){if(r)return this.cacheResult().__iterate(e,r);var i,n=$(this._iterable),o=0;if(H(n))for(;!(i=n.next()).done&&!1!==e(i.value,o++,this););return o},er.prototype.__iteratorUncached=function(e,r){if(r)return this.cacheResult().__iterator(e,r);var i=$(this._iterable);if(!H(i))return new V(q);var n=0;return new V(function(){var r=i.next();return r.done?r:G(e,n++,r.value)})},p(ei,K),ei.prototype.__iterateUncached=function(e,r){if(r)return this.cacheResult().__iterate(e,r);for(var i,n=this._iterator,o=this._iteratorCache,a=0;a<o.length;)if(!1===e(o[a],a++,this))return a;for(;!(i=n.next()).done;){var s=i.value;if(o[a]=s,!1===e(s,a++,this))break}return a},ei.prototype.__iteratorUncached=function(e,r){if(r)return this.cacheResult().__iterator(e,r);var i=this._iterator,n=this._iteratorCache,o=0;return new V(function(){if(o>=n.length){var r=i.next();if(r.done)return r;n[o]=r.value}return G(e,o,n[o++])})},p(em,K),em.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},em.prototype.get=function(e,r){return this.has(e)?this._value:r},em.prototype.includes=function(e){return ed(this._value,e)},em.prototype.slice=function(e,r){var i=this.size;return F(e,r,i)?this:new em(this._value,z(r,i,i)-z(e,i,0))},em.prototype.reverse=function(){return this},em.prototype.indexOf=function(e){return ed(this._value,e)?0:-1},em.prototype.lastIndexOf=function(e){return ed(this._value,e)?this.size:-1},em.prototype.__iterate=function(e,r){for(var i=0;i<this.size;i++)if(!1===e(this._value,i,this))return i+1;return i},em.prototype.__iterator=function(e,r){var i=this,n=0;return new V(function(){return n<i.size?G(e,n++,i._value):q()})},em.prototype.equals=function(e){return e instanceof em?ed(this._value,e._value):ef(e)},p(e_,K),e_.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},e_.prototype.get=function(e,r){return this.has(e)?this._start+k(this,e)*this._step:r},e_.prototype.includes=function(e){var r=(e-this._start)/this._step;return r>=0&&r<this.size&&r===Math.floor(r)},e_.prototype.slice=function(e,r){var i;return F(e,r,this.size)?this:(e=z(e,this.size,0),(r=z(r,i=this.size,i))<=e)?new e_(0,0):new e_(this.get(e,this._end),this.get(r,this._end),this._step)},e_.prototype.indexOf=function(e){var r=e-this._start;if(r%this._step==0){var i=r/this._step;if(i>=0&&i<this.size)return i}return -1},e_.prototype.lastIndexOf=function(e){return this.indexOf(e)},e_.prototype.__iterate=function(e,r){for(var i=this.size-1,n=this._step,o=r?this._start+i*n:this._start,a=0;a<=i;a++){if(!1===e(o,a,this))return a+1;o+=r?-n:n}return a},e_.prototype.__iterator=function(e,r){var i=this.size-1,n=this._step,o=r?this._start+i*n:this._start,a=0;return new V(function(){var s=o;return o+=r?-n:n,a>i?q():G(e,a++,s)})},e_.prototype.equals=function(e){return e instanceof e_?this._start===e._start&&this._end===e._end&&this._step===e._step:ef(this,e)},p(ey,d),p(ev,ey),p(ex,ey),p(eb,ey),ey.Keyed=ev,ey.Indexed=ex,ey.Set=eb;var ew="function"==typeof Math.imul&&-2===Math.imul(0xffffffff,2)?Math.imul:function(e,r){var i=65535&(e|=0),n=65535&(r|=0);return i*n+((e>>>16)*n+i*(r>>>16)<<16>>>0)|0};function eE(e){return e>>>1&0x40000000|0xbfffffff&e}function eS(e){if(!1===e||null==e||"function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var r=typeof e;if("number"===r){var i=0|e;for(i!==e&&(i^=0xffffffff*e);e>0xffffffff;)e/=0xffffffff,i^=e;return eE(i)}if("string"===r){return e.length>eL?(void 0===(a=eR[o=e])&&(a=eT(o),eD===eO&&(eD=0,eR={}),eD++,eR[o]=a),a):eT(e)}if("function"==typeof e.hashCode)return e.hashCode();if("object"===r){var o,a,s,l=e;if(eC&&void 0!==(s=n.get(l))||void 0!==(s=l[eP])||!eM&&(void 0!==(s=l.propertyIsEnumerable&&l.propertyIsEnumerable[eP])||void 0!==(s=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(l))))return s;if(s=++eA,0x40000000&eA&&(eA=0),eC)n.set(l,s);else if(void 0!==eI&&!1===eI(l))throw Error("Non-extensible objects are not allowed as keys.");
113else if(eM)Object.defineProperty(l,eP,{enumerable:!1,configurable:!1,writable:!1,value:s});else if(void 0!==l.propertyIsEnumerable&&l.propertyIsEnumerable===l.constructor.prototype.propertyIsEnumerable)l.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},l.propertyIsEnumerable[eP]=s;else if(void 0!==l.nodeType)l[eP]=s;else throw Error("Unable to set a non-enumerable property on object.");return s}if("function"==typeof e.toString)return eT(e.toString());throw Error("Value type "+r+" cannot be hashed.")}function eT(e){for(var r=0,i=0;i<e.length;i++)r=31*r+e.charCodeAt(i)|0;return eE(r)}var eI=Object.isExtensible,eM=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),eC="function"==typeof WeakMap;eC&&(n=new WeakMap);var eA=0,eP="__immutablehash__";"function"==typeof Symbol&&(eP=Symbol(eP));var eL=16,eO=255,eD=0,eR={};function ek(e){eg(e!==1/0,"Cannot perform this action with an infinite size.")}function eN(e){return null==e?eZ():eF(e)&&!b(e)?e:eZ().withMutations(function(r){var i=f(e);ek(i.size),i.forEach(function(e,i){return r.set(i,e)})})}function eF(e){return!!(e&&e[ez])}p(eN,ev),eN.prototype.toString=function(){return this.__toString("Map {","}")},eN.prototype.get=function(e,r){return this._root?this._root.get(0,void 0,e,r):r},eN.prototype.set=function(e,r){return eX(this,e,r)},eN.prototype.setIn=function(e,r){return this.updateIn(e,M,function(){return r})},eN.prototype.remove=function(e){return eX(this,e,M)},eN.prototype.deleteIn=function(e){return this.updateIn(e,function(){return M})},eN.prototype.update=function(e,r,i){return 1==arguments.length?e(this):this.updateIn([e],r,i)},eN.prototype.updateIn=function(e,r,i){i||(i=r,r=void 0);var n=function e(r,i,n,o){var a=r===M,s=i.next();if(s.done){var l=a?n:r,u=o(l);return u===l?r:u}eg(a||r&&r.set,"invalid keyPath");var c=s.value,h=a?M:r.get(c,M),p=e(h,i,n,o);return p===h?r:p===M?r.remove(c):(a?eZ():r).set(c,p)}(this,tj(e),r,i);return n===M?void 0:n},eN.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):eZ()},eN.prototype.merge=function(){return e0(this,void 0,arguments)},eN.prototype.mergeWith=function(e){var r=h.call(arguments,1);return e0(this,e,r)},eN.prototype.mergeIn=function(e){var r=h.call(arguments,1);return this.updateIn(e,eZ(),function(e){return"function"==typeof e.merge?e.merge.apply(e,r):r[r.length-1]})},eN.prototype.mergeDeep=function(){return e0(this,e1,arguments)},eN.prototype.mergeDeepWith=function(e){var r=h.call(arguments,1);return e0(this,e2(e),r)},eN.prototype.mergeDeepIn=function(e){var r=h.call(arguments,1);return this.updateIn(e,eZ(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,r):r[r.length-1]})},eN.prototype.sort=function(e){return tf(tP(this,e))},eN.prototype.sortBy=function(e,r){return tf(tP(this,r,e))},eN.prototype.withMutations=function(e){var r=this.asMutable();return e(r),r.wasAltered()?r.__ensureOwner(this.__ownerID):this},eN.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new O)},eN.prototype.asImmutable=function(){return this.__ensureOwner()},eN.prototype.wasAltered=function(){return this.__altered},eN.prototype.__iterator=function(e,r){return new eH(this,e,r)},eN.prototype.__iterate=function(e,r){var i=this,n=0;return this._root&&this._root.iterate(function(r){return n++,e(r[1],r[0],i)},r),n},eN.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?eY(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},eN.isMap=eF;var ez="@@__IMMUTABLE_MAP__@@",eB=eN.prototype;function eU(e,r){this.ownerID=e,this.entries=r}function ej(e,r,i){this.ownerID=e,this.bitmap=r,this.nodes=i}
113function eV(e,r,i){this.ownerID=e,this.count=r,this.nodes=i}function eG(e,r,i){this.ownerID=e,this.keyHash=r,this.entries=i}function eq(e,r,i){this.ownerID=e,this.keyHash=r,this.entry=i}function eH(e,r,i){this._type=r,this._reverse=i,this._stack=e._root&&eW(e._root)}function e$(e,r){return G(e,r[0],r[1])}function eW(e,r){return{node:e,index:0,__prev:r}}function eY(e,r,i,n){var o=Object.create(eB);return o.size=e,o._root=r,o.__ownerID=i,o.__hash=n,o.__altered=!1,o}function eZ(){return o||(o=eY(0))}function eX(e,r,i){if(e._root){var n,o,a=P(C),s=P(A);if(n=eK(e._root,e.__ownerID,0,void 0,r,i,a,s),!s.value)return e;o=e.size+(a.value?i===M?-1:1:0)}else{if(i===M)return e;o=1,n=new eU(e.__ownerID,[[r,i]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?eY(o,n):eZ()}function eK(e,r,i,n,o,a,s,l){return e?e.update(r,i,n,o,a,s,l):a===M?e:(L(l),L(s),new eq(r,n,[o,a]))}function eQ(e){return e.constructor===eq||e.constructor===eG}function eJ(e,r,i,n,o){if(e.keyHash===n)return new eG(r,n,[e.entry,o]);var a,s=(0===i?e.keyHash:e.keyHash>>>i)&31,l=(0===i?n:n>>>i)&31,u=s===l?[eJ(e,r,i+5,n,o)]:(a=new eq(r,n,o),s<l?[e,a]:[a,e]);return new ej(r,1<<s|1<<l,u)}function e0(e,r,i){for(var n=[],o=0;o<i.length;o++){var a=i[o],s=f(a);_(a)||(s=s.map(function(e){return eh(e)})),n.push(s)}return e3(e,r,n)}function e1(e,r,i){return e&&e.mergeDeep&&_(r)?e.mergeDeep(r):ed(e,r)?e:r}function e2(e){return function(r,i,n){if(r&&r.mergeDeepWith&&_(i))return r.mergeDeepWith(e,i);var o=e(r,i,n);return ed(r,o)?r:o}}function e3(e,r,i){return 0===(i=i.filter(function(e){return 0!==e.size})).length?e:0!==e.size||e.__ownerID||1!==i.length?e.withMutations(function(e){for(var n=r?function(i,n){e.update(n,M,function(e){return e===M?i:r(e,i,n)})}:function(r,i){e.set(i,r)},o=0;o<i.length;o++)i[o].forEach(n)}):e.constructor(i[0])}function e5(e){return e-=e>>1&0x55555555,e=(e=(0x33333333&e)+(e>>2&0x33333333))+(e>>4)&0xf0f0f0f,e+=e>>8,127&(e+=e>>16)}function e4(e,r,i,n){var o=n?e:D(e);return o[r]=i,o}eB[ez]=!0,eB[I]=eB.remove,eB.removeIn=eB.deleteIn,eU.prototype.get=function(e,r,i,n){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(ed(i,o[a][0]))return o[a][1];return n},eU.prototype.update=function(e,r,i,n,o,a,s){for(var l=o===M,u=this.entries,c=0,h=u.length;c<h&&!ed(n,u[c][0]);c++);var p=c<h;if(p?u[c][1]===o:l)return this;if(L(s),(l||!p)&&L(a),!l||1!==u.length){if(!p&&!l&&u.length>=e6){var d=e,f=u,m=n,g=o;d||(d=new O);for(var _=new eq(d,eS(m),[m,g]),y=0;y<f.length;y++){var v=f[y];_=_.update(d,0,void 0,v[0],v[1])}return _}var x=e&&e===this.ownerID,b=x?u:D(u);return(p?l?c===h-1?b.pop():b[c]=b.pop():b[c]=[n,o]:b.push([n,o]),x)?(this.entries=b,this):new eU(e,b)}},ej.prototype.get=function(e,r,i,n){void 0===r&&(r=eS(i));var o=1<<((0===e?r:r>>>e)&31),a=this.bitmap;return(a&o)==0?n:this.nodes[e5(a&o-1)].get(e+5,r,i,n)},ej.prototype.update=function(e,r,i,n,o,a,s){void 0===i&&(i=eS(n));var l=(0===r?i:i>>>r)&31,u=1<<l,c=this.bitmap,h=(c&u)!=0;if(!h&&o===M)return this;var p=e5(c&u-1),d=this.nodes,f=h?d[p]:void 0,m=eK(f,e,r+5,i,n,o,a,s);if(m===f)return this;if(!h&&m&&d.length>=e8){for(var g=e,_=d,y=c,v=l,x=m,b=0,w=Array(32),E=0;0!==y;E++,y>>>=1)w[E]=1&y?_[b++]:void 0;return w[v]=x,new eV(g,b+1,w)}if(h&&!m&&2===d.length&&eQ(d[1^p]))return d[1^p];if(h&&m&&1===d.length&&eQ(m))return m;var S=e&&e===this.ownerID,T=h?m?c:c^u:c|u,I=h?m?e4(d,p,m,S):function(e,r,i){var n=e.length-1;if(i&&r===n)return e.pop(),e;for(var o=Array(n),a=0,s=0;s<n;s++)s===r&&(a=1),o[s]=e[s+a];return o}(d,p,S):function(e,r,i,n){var o=e.length+1;if(n&&r+1===o)return e[r]=i,e;for(var a=Array(o),s=0,l=0;l<o;l++)l===r?(a[l]=i,s=-1):a[l]=e[l+s];return a}(d,p,m,S);return S?(this.bitmap=T,this.nodes=I,this):new ej(e,T,I)},eV.prototype.get=function(e,r,i,n){void 0===r&&(r=eS(i));var o=(0===e?r:r>>>e)&31,a=this.nodes[o];return a?a.get(e+5,r,i,n):n},eV.prototype.update=function(e,r,i,n,o,a,s){void 0===i&&(i=eS(n));var l=(0===r?i:i>>>r)&31,u=o===M,c=this.nodes,h=c[l];if(u&&!h)return this;var p=eK(h,e,r+5,i,n,o,a,s);if(p===h)return this;var d=this.count;if(h){if(!p&&--d<e9)return function(e,r,i,n){for(var o=0,a=0,s=Array(i),l=0,u=1,c=r.length;l<c;l++,u<<=1){var h=r[l];void 0!==h&&l!==n&&(o|=u,s[a++]=h)}return new ej(e,o,s)}(e,c,d,l)}else d++;var f=e&&e===this.ownerID,m=e4(c,l,p,f);return f?(this.count=d,this.nodes=m,this):new eV(e,d,m)},eG.prototype.get=function(e,r,i,n){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(ed(i,o[a][0]))return o[a][1];return n},eG.prototype.update=function(e,r,i,n,o,a,s){void 0===i&&(i=eS(n));var l=o===M;if(i!==this.keyHash)return l?this:(L(s),L(a),eJ(this,e,r,i,[n,o]));for(var u=this.entries,c=0,h=u.length;c<h&&!ed(n,u[c][0]);c++);var p=c<h;if(p?u[c][1]===o:l)return this;if(L(s),(l||!p)&&L(a),l&&2===h)return new eq(e,this.keyHash,u[1^c]);var d=e&&e===this.ownerID,f=d?u:D(u);
113return(p?l?c===h-1?f.pop():f[c]=f.pop():f[c]=[n,o]:f.push([n,o]),d)?(this.entries=f,this):new eG(e,this.keyHash,f)},eq.prototype.get=function(e,r,i,n){return ed(i,this.entry[0])?this.entry[1]:n},eq.prototype.update=function(e,r,i,n,o,a,s){var l=o===M,u=ed(n,this.entry[0]);return(u?o===this.entry[1]:l)?this:(L(s),l)?void L(a):u?e&&e===this.ownerID?(this.entry[1]=o,this):new eq(e,this.keyHash,[n,o]):(L(a),eJ(this,e,r,eS(n),[n,o]))},eU.prototype.iterate=eG.prototype.iterate=function(e,r){for(var i=this.entries,n=0,o=i.length-1;n<=o;n++)if(!1===e(i[r?o-n:n]))return!1},ej.prototype.iterate=eV.prototype.iterate=function(e,r){for(var i=this.nodes,n=0,o=i.length-1;n<=o;n++){var a=i[r?o-n:n];if(a&&!1===a.iterate(e,r))return!1}},eq.prototype.iterate=function(e,r){return e(this.entry)},p(eH,V),eH.prototype.next=function(){for(var e=this._type,r=this._stack;r;){var i,n=r.node,o=r.index++;if(n.entry){if(0===o)return e$(e,n.entry)}else if(n.entries){if(o<=(i=n.entries.length-1))return e$(e,n.entries[this._reverse?i-o:o])}else if(o<=(i=n.nodes.length-1)){var a=n.nodes[this._reverse?i-o:o];if(a){if(a.entry)return e$(e,a.entry);r=this._stack=eW(a,r)}continue}r=this._stack=this._stack.__prev}return q()};var e6=8,e8=16,e9=8;function e7(e){var r=ts();if(null==e)return r;if(te(e))return e;var i=m(e),n=i.size;return 0===n?r:(ek(n),n>0&&n<32)?ta(0,n,5,null,new ti(i.toArray())):r.withMutations(function(e){e.setSize(n),i.forEach(function(r,i){return e.set(i,r)})})}function te(e){return!!(e&&e[tt])}p(e7,ex),e7.of=function(){return this(arguments)},e7.prototype.toString=function(){return this.__toString("List [","]")},e7.prototype.get=function(e,r){if((e=k(this,e))>=0&&e<this.size){var i=tc(this,e+=this._origin);return i&&i.array[31&e]}return r},e7.prototype.set=function(e,r){return function(e,r,i){if((r=k(e,r))!=r)return e;if(r>=e.size||r<0)return e.withMutations(function(e){r<0?th(e,r).set(0,i):th(e,0,r+1).set(r,i)});r+=e._origin;var n=e._tail,o=e._root,a=P(A);return(r>=td(e._capacity)?n=tl(n,e.__ownerID,0,r,i,a):o=tl(o,e.__ownerID,e._level,r,i,a),a.value)?e.__ownerID?(e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e):ta(e._origin,e._capacity,e._level,o,n):e}(this,e,r)},e7.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},e7.prototype.insert=function(e,r){return this.splice(e,0,r)},e7.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ts()},e7.prototype.push=function(){var e=arguments,r=this.size;return this.withMutations(function(i){th(i,0,r+e.length);for(var n=0;n<e.length;n++)i.set(r+n,e[n])})},e7.prototype.pop=function(){return th(this,0,-1)},e7.prototype.unshift=function(){var e=arguments;return this.withMutations(function(r){th(r,-e.length);for(var i=0;i<e.length;i++)r.set(i,e[i])})},e7.prototype.shift=function(){return th(this,1)},e7.prototype.merge=function(){return tp(this,void 0,arguments)},e7.prototype.mergeWith=function(e){var r=h.call(arguments,1);return tp(this,e,r)},e7.prototype.mergeDeep=function(){return tp(this,e1,arguments)},e7.prototype.mergeDeepWith=function(e){var r=h.call(arguments,1);return tp(this,e2(e),r)},e7.prototype.setSize=function(e){return th(this,0,e)},e7.prototype.slice=function(e,r){var i=this.size;return F(e,r,i)?this:th(this,z(e,i,0),z(r,i,i))},e7.prototype.__iterator=function(e,r){var i=0,n=to(this,r);return new V(function(){var r=n();return r===tn?q():G(e,i++,r)})},e7.prototype.__iterate=function(e,r){for(var i,n=0,o=to(this,r);(i=o())!==tn&&!1!==e(i,n++,this););return n},e7.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ta(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},e7.isList=te;
113var tt="@@__IMMUTABLE_LIST__@@",tr=e7.prototype;function ti(e,r){this.array=e,this.ownerID=r}tr[tt]=!0,tr[I]=tr.remove,tr.setIn=eB.setIn,tr.deleteIn=tr.removeIn=eB.removeIn,tr.update=eB.update,tr.updateIn=eB.updateIn,tr.mergeIn=eB.mergeIn,tr.mergeDeepIn=eB.mergeDeepIn,tr.withMutations=eB.withMutations,tr.asMutable=eB.asMutable,tr.asImmutable=eB.asImmutable,tr.wasAltered=eB.wasAltered,ti.prototype.removeBefore=function(e,r,i){if(i===r?1<<r:0===this.array.length)return this;var n,o=i>>>r&31;if(o>=this.array.length)return new ti([],e);var a=0===o;if(r>0){var s=this.array[o];if((n=s&&s.removeBefore(e,r-5,i))===s&&a)return this}if(a&&!n)return this;var l=tu(this,e);if(!a)for(var u=0;u<o;u++)l.array[u]=void 0;return n&&(l.array[o]=n),l},ti.prototype.removeAfter=function(e,r,i){if(i===(r?1<<r:0)||0===this.array.length)return this;var n,o=i-1>>>r&31;if(o>=this.array.length)return this;if(r>0){var a=this.array[o];if((n=a&&a.removeAfter(e,r-5,i))===a&&o===this.array.length-1)return this}var s=tu(this,e);return s.array.splice(o+1),n&&(s.array[o]=n),s};var tn={};function to(e,r){var i=e._origin,n=e._capacity,o=td(n),a=e._tail;return function e(s,l,u){var c,h,p,d,f,m,g,_,y,v,x,b;return 0===l?(c=s,p=(h=u)===o?a&&a.array:c&&c.array,d=h>i?0:i-h,(f=n-h)>32&&(f=32),function(){if(d===f)return tn;var e=r?--f:d++;return p&&p[e]}):(m=s,g=l,_=u,v=m&&m.array,x=_>i?0:i-_>>g,(b=(n-_>>g)+1)>32&&(b=32),function(){for(;;){if(y){var i=y();if(i!==tn)return i;y=null}if(x===b)return tn;var n=r?--b:x++;y=e(v&&v[n],g-5,_+(n<<g))}})}(e._root,e._level,0)}function ta(e,r,i,n,o,a,s){var l=Object.create(tr);return l.size=r-e,l._origin=e,l._capacity=r,l._level=i,l._root=n,l._tail=o,l.__ownerID=a,l.__hash=s,l.__altered=!1,l}function ts(){return a||(a=ta(0,0,5))}function tl(e,r,i,n,o,a){var s,l=n>>>i&31,u=e&&l<e.array.length;if(!u&&void 0===o)return e;if(i>0){var c=e&&e.array[l],h=tl(c,r,i-5,n,o,a);return h===c?e:((s=tu(e,r)).array[l]=h,s)}return u&&e.array[l]===o?e:(L(a),s=tu(e,r),void 0===o&&l===s.array.length-1?s.array.pop():s.array[l]=o,s)}function tu(e,r){return r&&e&&r===e.ownerID?e:new ti(e?e.array.slice():[],r)}function tc(e,r){if(r>=td(e._capacity))return e._tail;if(r<1<<e._level+5){for(var i=e._root,n=e._level;i&&n>0;)i=i.array[r>>>n&31],n-=5;return i}}function th(e,r,i){void 0!==r&&(r|=0),void 0!==i&&(i|=0);var n=e.__ownerID||new O,o=e._origin,a=e._capacity,s=o+r,l=void 0===i?a:i<0?a+i:o+i;if(s===o&&l===a)return e;if(s>=l)return e.clear();for(var u=e._level,c=e._root,h=0;s+h<0;)c=new ti(c&&c.array.length?[void 0,c]:[],n),u+=5,h+=1<<u;h&&(s+=h,o+=h,l+=h,a+=h);for(var p=td(a),d=td(l);d>=1<<u+5;)c=new ti(c&&c.array.length?[c]:[],n),u+=5;var f=e._tail,m=d<p?tc(e,l-1):d>p?new ti([],n):f;if(f&&d>p&&s<a&&f.array.length){for(var g=c=tu(c,n),_=u;_>5;_-=5){var y=p>>>_&31;g=g.array[y]=tu(g.array[y],n)}g.array[p>>>5&31]=f}if(l<a&&(m=m&&m.removeAfter(n,0,l)),s>=d)s-=d,l-=d,u=5,c=null,m=m&&m.removeBefore(n,0,s);else if(s>o||d<p){for(h=0;c;){var v=s>>>u&31;if(v!==d>>>u&31)break;v&&(h+=(1<<u)*v),u-=5,c=c.array[v]}c&&s>o&&(c=c.removeBefore(n,u,s-h)),c&&d<p&&(c=c.removeAfter(n,u,d-h)),h&&(s-=h,l-=h)}return e.__ownerID?(e.size=l-s,e._origin=s,e._capacity=l,e._level=u,e._root=c,e._tail=m,e.__hash=void 0,e.__altered=!0,e):ta(s,l,u,c,m)}function tp(e,r,i){for(var n=[],o=0,a=0;a<i.length;a++){var s=i[a],l=m(s);l.size>o&&(o=l.size),_(s)||(l=l.map(function(e){return eh(e)})),n.push(l)}return o>e.size&&(e=e.setSize(o)),e3(e,r,n)}function td(e){return e<32?0:e-1>>>5<<5}function tf(e){return null==e?t_():tm(e)?e:t_().withMutations(function(r){var i=f(e);ek(i.size),i.forEach(function(e,i){return r.set(i,e)})})}function tm(e){return eF(e)&&b(e)}function tg(e,r,i,n){var o=Object.create(tf.prototype);return o.size=e?e.size:0,o._map=e,o._list=r,o.__ownerID=i,o.__hash=n,o}function t_(){return s||(s=tg(eZ(),ts()))}function ty(e,r,i){var n,o,a=e._map,s=e._list,l=a.get(r),u=void 0!==l;if(i===M){if(!u)return e;s.size>=32&&s.size>=2*a.size?(n=(o=s.filter(function(e,r){return void 0!==e&&l!==r})).toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(n.__ownerID=o.__ownerID=e.__ownerID)):(n=a.remove(r),o=l===s.size-1?s.pop():s.set(l,void 0))}else if(u){if(i===s.get(l)[1])return e;n=a,o=s.set(l,[r,i])}else n=a.set(r,s.size),o=s.set(s.size,[r,i]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=o,e.__hash=void 0,e):tg(n,o)}function tv(e,r){this._iter=e,this._useKeys=r,this.size=e.size}function tx(e){this._iter=e,this.size=e.size}function tb(e){this._iter=e,this.size=e.size}function tw(e){this._iter=e,this.size=e.size}function tE(e){var r=tz(e);return r._iter=e,r.size=e.size,r.flip=function(){return e},r.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},r.has=function(r){return e.includes(r)},r.includes=function(r){return e.has(r)},r.cacheResult=tB,r.__iterateUncached=function(r,i){var n=this;return e.__iterate(function(e,i){return!1!==r(i,e,n)},i)},r.__iteratorUncached=function(r,i){if(2===r){var n=e.__iterator(r,i);return new V(function(){var e=n.next();if(!e.done){var r=e.value[0];e.value[0]=e.value[1],e.value[1]=r}return e})}return e.__iterator(+(1!==r),i)},r}
113function tS(e,r,i){var n=tz(e);return n.size=e.size,n.has=function(r){return e.has(r)},n.get=function(n,o){var a=e.get(n,M);return a===M?o:r.call(i,a,n,e)},n.__iterateUncached=function(n,o){var a=this;return e.__iterate(function(e,o,s){return!1!==n(r.call(i,e,o,s),o,a)},o)},n.__iteratorUncached=function(n,o){var a=e.__iterator(2,o);return new V(function(){var o=a.next();if(o.done)return o;var s=o.value,l=s[0];return G(n,l,r.call(i,s[1],l,e),o)})},n}function tT(e,r){var i=tz(e);return i._iter=e,i.size=e.size,i.reverse=function(){return e},e.flip&&(i.flip=function(){var r=tE(e);return r.reverse=function(){return e.flip()},r}),i.get=function(i,n){return e.get(r?i:-1-i,n)},i.has=function(i){return e.has(r?i:-1-i)},i.includes=function(r){return e.includes(r)},i.cacheResult=tB,i.__iterate=function(r,i){var n=this;return e.__iterate(function(e,i){return r(e,i,n)},!i)},i.__iterator=function(r,i){return e.__iterator(r,!i)},i}function tI(e,r,i,n){var o=tz(e);return n&&(o.has=function(n){var o=e.get(n,M);return o!==M&&!!r.call(i,o,n,e)},o.get=function(n,o){var a=e.get(n,M);return a!==M&&r.call(i,a,n,e)?a:o}),o.__iterateUncached=function(o,a){var s=this,l=0;return e.__iterate(function(e,a,u){if(r.call(i,e,a,u))return l++,o(e,n?a:l-1,s)},a),l},o.__iteratorUncached=function(o,a){var s=e.__iterator(2,a),l=0;return new V(function(){for(;;){var a=s.next();if(a.done)return a;var u=a.value,c=u[0],h=u[1];if(r.call(i,h,c,e))return G(o,n?c:l++,h,a)}})},o}function tM(e,r,i,n){var o,a=e.size;if(void 0!==r&&(r|=0),void 0!==i&&(i|=0),F(r,i,a))return e;var s=z(r,a,0),l=z(i,a,a);if(s!=s||l!=l)return tM(e.toSeq().cacheResult(),r,i,n);var u=l-s;u==u&&(o=u<0?0:u);var c=tz(e);return c.size=0===o?o:e.size&&o||void 0,!n&&en(e)&&o>=0&&(c.get=function(r,i){return(r=k(this,r))>=0&&r<o?e.get(r+s,i):i}),c.__iterateUncached=function(r,i){var a=this;if(0===o)return 0;if(i)return this.cacheResult().__iterate(r,i);var l=0,u=!0,c=0;return e.__iterate(function(e,i){if(!(u&&(u=l++<s)))return c++,!1!==r(e,n?i:c-1,a)&&c!==o}),c},c.__iteratorUncached=function(r,i){if(0!==o&&i)return this.cacheResult().__iterator(r,i);var a=0!==o&&e.__iterator(r,i),l=0,u=0;return new V(function(){for(;l++<s;)a.next();if(++u>o)return q();var e=a.next();return n||1===r?e:0===r?G(r,u-1,void 0,e):G(r,u-1,e.value[1],e)})},c}function tC(e,r,i,n){var o=tz(e);return o.__iterateUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterate(o,a);var l=!0,u=0;return e.__iterate(function(e,a,c){if(!(l&&(l=r.call(i,e,a,c))))return u++,o(e,n?a:u-1,s)}),u},o.__iteratorUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterator(o,a);var l=e.__iterator(2,a),u=!0,c=0;return new V(function(){var e,a,h;do{if((e=l.next()).done)if(n||1===o)return e;else if(0===o)return G(o,c++,void 0,e);else return G(o,c++,e.value[1],e);var p=e.value;a=p[0],h=p[1],u&&(u=r.call(i,h,a,s))}while(u);return 2===o?e:G(o,a,h,e)})},o}function tA(e,r,i){var n=tz(e);return n.__iterateUncached=function(n,o){var a=0,s=!1;return!function e(l,u){var c=this;l.__iterate(function(o,l){return(!r||u<r)&&_(o)?e(o,u+1):!1===n(o,i?l:a++,c)&&(s=!0),!s},o)}(e,0),a},n.__iteratorUncached=function(n,o){var a=e.__iterator(n,o),s=[],l=0;return new V(function(){for(;a;){var e=a.next();if(!1!==e.done){a=s.pop();continue}var u=e.value;if(2===n&&(u=u[1]),!((!r||s.length<r)&&_(u)))return i?e:G(n,l++,u,e);s.push(a),a=u.__iterator(n,o)}return q()})},n}function tP(e,r,i){r||(r=tU);var n=y(e),o=0,a=e.toSeq().map(function(r,n){return[n,r,o++,i?i(r,n,e):r]}).toArray();return a.sort(function(e,i){return r(e[3],i[3])||e[2]-i[2]}).forEach(n?function(e,r){a[r].length=2}:function(e,r){a[r]=e[1]}),n?X(a):v(e)?K(a):Q(a)}function tL(e,r,i){if(r||(r=tU),!i)return e.reduce(function(e,i){return tO(r,e,i)?i:e});var n=e.toSeq().map(function(r,n){return[r,i(r,n,e)]}).reduce(function(e,i){return tO(r,e[1],i[1])?i:e});return n&&n[0]}function tO(e,r,i){var n=e(i,r);return 0===n&&i!==r&&(null==i||i!=i)||n>0}function tD(e,r,i){var n=tz(e);return n.size=new ee(i).map(function(e){return e.size}).min(),n.__iterate=function(e,r){for(var i,n=this.__iterator(1,r),o=0;!(i=n.next()).done&&!1!==e(i.value,o++,this););return o},n.__iteratorUncached=function(e,n){var o=i.map(function(e){return e=d(e),$(n?e.reverse():e)}),a=0,s=!1;return new V(function(){var i;return(s||(s=(i=o.map(function(e){return e.next()})).some(function(e){return e.done})),s)?q():G(e,a++,r.apply(null,i.map(function(e){return e.value})))})},n}function tR(e,r){return en(e)?r:e.constructor(r)}function tk(e){if(e!==Object(e))throw TypeError("Expected [K, V] tuple: "+e)}function tN(e){return ek(e.size),R(e)}function tF(e){return y(e)?f:v(e)?m:g}function tz(e){return Object.create((y(e)?X:v(e)?K:Q).prototype)}function tB(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Z.prototype.cacheResult.call(this)}function tU(e,r){return e>r?1:e<r?-1:0}function tj(e){var r=$(e);
vendor: 21,886 bytes, line 113
113if(!r){if(!Y(e))throw TypeError("Expected iterable or array-like: "+e);r=$(d(e))}return r}function tV(e,r){var i,n=function(a){if(a instanceof n)return a;if(!(this instanceof n))return new n(a);if(!i){i=!0;var s=Object.keys(e);(function(e,r){try{r.forEach(t$.bind(void 0,e))}catch(e){}})(o,s),o.size=s.length,o._name=r,o._keys=s,o._defaultValues=e}this._map=eN(a)},o=n.prototype=Object.create(tG);return o.constructor=n,n}p(tf,eN),tf.of=function(){return this(arguments)},tf.prototype.toString=function(){return this.__toString("OrderedMap {","}")},tf.prototype.get=function(e,r){var i=this._map.get(e);return void 0!==i?this._list.get(i)[1]:r},tf.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):t_()},tf.prototype.set=function(e,r){return ty(this,e,r)},tf.prototype.remove=function(e){return ty(this,e,M)},tf.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},tf.prototype.__iterate=function(e,r){var i=this;return this._list.__iterate(function(r){return r&&e(r[1],r[0],i)},r)},tf.prototype.__iterator=function(e,r){return this._list.fromEntrySeq().__iterator(e,r)},tf.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var r=this._map.__ensureOwner(e),i=this._list.__ensureOwner(e);return e?tg(r,i,e,this.__hash):(this.__ownerID=e,this._map=r,this._list=i,this)},tf.isOrderedMap=tm,tf.prototype[T]=!0,tf.prototype[I]=tf.prototype.remove,p(tv,X),tv.prototype.get=function(e,r){return this._iter.get(e,r)},tv.prototype.has=function(e){return this._iter.has(e)},tv.prototype.valueSeq=function(){return this._iter.valueSeq()},tv.prototype.reverse=function(){var e=this,r=tT(this,!0);return this._useKeys||(r.valueSeq=function(){return e._iter.toSeq().reverse()}),r},tv.prototype.map=function(e,r){var i=this,n=tS(this,e,r);return this._useKeys||(n.valueSeq=function(){return i._iter.toSeq().map(e,r)}),n},tv.prototype.__iterate=function(e,r){var i,n=this;return this._iter.__iterate(this._useKeys?function(r,i){return e(r,i,n)}:(i=r?tN(this):0,function(o){return e(o,r?--i:i++,n)}),r)},tv.prototype.__iterator=function(e,r){if(this._useKeys)return this._iter.__iterator(e,r);var i=this._iter.__iterator(1,r),n=r?tN(this):0;return new V(function(){var o=i.next();return o.done?o:G(e,r?--n:n++,o.value,o)})},tv.prototype[T]=!0,p(tx,K),tx.prototype.includes=function(e){return this._iter.includes(e)},tx.prototype.__iterate=function(e,r){var i=this,n=0;return this._iter.__iterate(function(r){return e(r,n++,i)},r)},tx.prototype.__iterator=function(e,r){var i=this._iter.__iterator(1,r),n=0;return new V(function(){var r=i.next();return r.done?r:G(e,n++,r.value,r)})},p(tb,Q),tb.prototype.has=function(e){return this._iter.includes(e)},tb.prototype.__iterate=function(e,r){var i=this;return this._iter.__iterate(function(r){return e(r,r,i)},r)},tb.prototype.__iterator=function(e,r){var i=this._iter.__iterator(1,r);return new V(function(){var r=i.next();return r.done?r:G(e,r.value,r.value,r)})},p(tw,X),tw.prototype.entrySeq=function(){return this._iter.toSeq()},tw.prototype.__iterate=function(e,r){var i=this;return this._iter.__iterate(function(r){if(r){tk(r);var n=_(r);return e(n?r.get(1):r[1],n?r.get(0):r[0],i)}},r)},tw.prototype.__iterator=function(e,r){var i=this._iter.__iterator(1,r);return new V(function(){for(;;){var r=i.next();if(r.done)return r;var n=r.value;if(n){tk(n);var o=_(n);return G(e,o?n.get(0):n[0],o?n.get(1):n[1],r)}}})},tx.prototype.cacheResult=tv.prototype.cacheResult=tb.prototype.cacheResult=tw.prototype.cacheResult=tB,p(tV,ev),tV.prototype.toString=function(){return this.__toString(tH(this)+" {","}")},tV.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},tV.prototype.get=function(e,r){if(!this.has(e))return r;var i=this._defaultValues[e];return this._map?this._map.get(e,i):i},tV.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=tq(this,eZ()))},tV.prototype.set=function(e,r){if(!this.has(e))throw Error('Cannot set unknown key "'+e+'" on '+tH(this));var i=this._map&&this._map.set(e,r);return this.__ownerID||i===this._map?this:tq(this,i)},tV.prototype.remove=function(e){if(!this.has(e))return this;var r=this._map&&this._map.remove(e);return this.__ownerID||r===this._map?this:tq(this,r)},tV.prototype.wasAltered=function(){return this._map.wasAltered()},tV.prototype.__iterator=function(e,r){var i=this;return f(this._defaultValues).map(function(e,r){return i.get(r)}).__iterator(e,r)},tV.prototype.__iterate=function(e,r){var i=this;return f(this._defaultValues).map(function(e,r){return i.get(r)}).__iterate(e,r)},tV.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var r=this._map&&this._map.__ensureOwner(e);return e?tq(this,r,e):(this.__ownerID=e,this._map=r,this)};var tG=tV.prototype;function tq(e,r,i){var n=Object.create(Object.getPrototypeOf(e));return n._map=r,n.__ownerID=i,n}function tH(e){return e._name||e.constructor.name||"Record"}function t$(e,r){Object.defineProperty(e,r,{get:function(){return this.get(r)},set:function(e){eg(this.__ownerID,"Cannot set on an immutable record."),this.set(r,e)}})}function tW(e){return null==e?tJ():tY(e)&&!b(e)?e:tJ().withMutations(function(r){var i=g(e);ek(i.size),i.forEach(function(e){return r.add(e)})})}function tY(e){return!!(e&&e[tZ])}tG[I]=tG.remove,tG.deleteIn=tG.removeIn=eB.removeIn,tG.merge=eB.merge,tG.mergeWith=eB.mergeWith,tG.mergeIn=eB.mergeIn,tG.mergeDeep=eB.mergeDeep,tG.mergeDeepWith=eB.mergeDeepWith,tG.mergeDeepIn=eB.mergeDeepIn,tG.setIn=eB.setIn,tG.update=eB.update,tG.updateIn=eB.updateIn,tG.withMutations=eB.withMutations,tG.asMutable=eB.asMutable,tG.asImmutable=eB.asImmutable,p(tW,eb),tW.of=function(){return this(arguments)},tW.fromKeys=function(e){return this(f(e).keySeq())},tW.prototype.toString=function(){return this.__toString("Set {","}")},tW.prototype.has=function(e){return this._map.has(e)},tW.prototype.add=function(e){return tK(this,this._map.set(e,!0))},tW.prototype.remove=function(e){return tK(this,this._map.remove(e))},tW.prototype.clear=function(){return tK(this,this._map.clear())},tW.prototype.union=function(){var e=h.call(arguments,0);return 0===(e=e.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(r){for(var i=0;i<e.length;i++)g(e[i]).forEach(function(e){return r.add(e)})}):this.constructor(e[0])},tW.prototype.intersect=function(){var e=h.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return g(e)});var r=this;return this.withMutations(function(i){r.forEach(function(r){e.every(function(e){return e.includes(r)})||i.remove(r)})})},tW.prototype.subtract=function(){var e=h.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return g(e)});var r=this;return this.withMutations(function(i){r.forEach(function(r){e.some(function(e){return e.includes(r)})&&i.remove(r)})})},tW.prototype.merge=function(){return this.union.apply(this,arguments)},tW.prototype.mergeWith=function(e){var r=h.call(arguments,1);return this.union.apply(this,r)},tW.prototype.sort=function(e){return t0(tP(this,e))},tW.prototype.sortBy=function(e,r){return t0(tP(this,r,e))},tW.prototype.wasAltered=function(){return this._map.wasAltered()},tW.prototype.__iterate=function(e,r){var i=this;return this._map.__iterate(function(r,n){return e(n,n,i)},r)},tW.prototype.__iterator=function(e,r){return this._map.map(function(e,r){return r}).__iterator(e,r)},tW.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var r=this._map.__ensureOwner(e);return e?this.__make(r,e):(this.__ownerID=e,this._map=r,this)},tW.isSet=tY;var tZ="@@__IMMUTABLE_SET__@@",tX=tW.prototype;function tK(e,r){return e.__ownerID?(e.size=r.size,e._map=r,e):r===e._map?e:0===r.size?e.__empty():e.__make(r)}function tQ(e,r){var i=Object.create(tX);return i.size=e?e.size:0,i._map=e,i.__ownerID=r,i}function tJ(){return l||(l=tQ(eZ()))}function t0(e){return null==e?t5():t1(e)?e:t5().withMutations(function(r){var i=g(e);ek(i.size),i.forEach(function(e){return r.add(e)})})}function t1(e){return tY(e)&&b(e)}tX[tZ]=!0,tX[I]=tX.remove,tX.mergeDeep=tX.merge,tX.mergeDeepWith=tX.mergeWith,tX.withMutations=eB.withMutations,tX.asMutable=eB.asMutable,tX.asImmutable=eB.asImmutable,tX.__empty=tJ,tX.__make=tQ,p(t0,tW),t0.of=function(){return this(arguments)},t0.fromKeys=function(e){return this(f(e).keySeq())},t0.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t0.isOrderedSet=t1;var t2=t0.prototype;function t3(e,r){var i=Object.create(t2);return i.size=e?e.size:0,i._map=e,i.__ownerID=r,i}function t5(){return u||(u=t3(t_()))}function t4(e){return null==e?re():t6(e)?e:re().unshiftAll(e)}function t6(e){return!!(e&&e[t8])}t2[T]=!0,t2.__empty=t5,t2.__make=t3,p(t4,ex),t4.of=function(){return this(arguments)},t4.prototype.toString=function(){return this.__toString("Stack [","]")},t4.prototype.get=function(e,r){var i=this._head;for(e=k(this,e);i&&e--;)i=i.next;return i?i.value:r},t4.prototype.peek=function(){return this._head&&this._head.value},t4.prototype.push=function(){if(0==arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,i=arguments.length-1;i>=0;i--)r={value:arguments[i],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):t7(e,r)},t4.prototype.pushAll=function(e){if(0===(e=m(e)).size)return this;ek(e.size);var r=this.size,i=this._head;return(e.reverse().forEach(function(e){r++,i={value:e,next:i}}),this.__ownerID)?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):t7(r,i)},t4.prototype.pop=function(){return this.slice(1)},t4.prototype.unshift=function(){return this.push.apply(this,arguments)},t4.prototype.unshiftAll=function(e){return this.pushAll(e)},t4.prototype.shift=function(){return this.pop.apply(this,arguments)},t4.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):re()},t4.prototype.slice=function(e,r){if(F(e,r,this.size))return this;var i,n=z(e,this.size,0);if(z(r,i=this.size,i)!==this.size)return ex.prototype.slice.call(this,e,r);for(var o=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=o,this._head=a,this.__hash=void 0,this.__altered=!0,this):t7(o,a)},t4.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?t7(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},t4.prototype.__iterate=function(e,r){if(r)return this.reverse().__iterate(e);for(var i=0,n=this._head;n&&!1!==e(n.value,i++,this);)n=n.next;return i},t4.prototype.__iterator=function(e,r){if(r)return this.reverse().__iterator(e);var i=0,n=this._head;return new V(function(){if(n){var r=n.value;return n=n.next,G(e,i++,r)}return q()})},t4.isStack=t6;var t8="@@__IMMUTABLE_STACK__@@",t9=t4.prototype;function t7(e,r,i,n){var o=Object.create(t9);return o.size=e,o._head=r,o.__ownerID=i,o.__hash=n,o.__altered=!1,o}function re(){return c||(c=t7(0))}function rt(e,r){var i=function(i){e.prototype[i]=r[i]};return Object.keys(r).forEach(i),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(r).forEach(i),e}t9[t8]=!0,t9.withMutations=eB.withMutations,t9.asMutable=eB.asMutable,t9.asImmutable=eB.asImmutable,t9.wasAltered=eB.wasAltered,d.Iterator=V,rt(d,{toArray:function(){ek(this.size);var e=Array(this.size||0);return this.valueSeq().__iterate(function(r,i){e[i]=r}),e},toIndexedSeq:function(){return new tx(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new tv(this,!0)},toMap:function(){return eN(this.toKeyedSeq())},toObject:function(){ek(this.size);var e={};return this.__iterate(function(r,i){e[i]=r}),e},toOrderedMap:function(){return tf(this.toKeyedSeq())},toOrderedSet:function(){return t0(y(this)?this.valueSeq():this)},toSet:function(){return tW(y(this)?this.valueSeq():this)},toSetSeq:function(){return new tb(this)},toSeq:function(){return v(this)?this.toIndexedSeq():y(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return t4(y(this)?this.valueSeq():this)},toList:function(){return e7(y(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,r){return 0===this.size?e+r:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+r},concat:function(){var e=h.call(arguments,0);return tR(this,function(e,r){var i=y(e),n=[e].concat(r).map(function(e){return _(e)?i&&(e=f(e)):e=i?ea(e):es(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===n.length)return e;if(1===n.length){var o=n[0];if(o===e||i&&y(o)||v(e)&&v(o))return o}var a=new ee(n);return i?a=a.toKeyedSeq():v(e)||(a=a.toSetSeq()),(a=a.flatten(!0)).size=n.reduce(function(e,r){if(void 0!==e){var i=r.size;if(void 0!==i)return e+i}},0),a}(this,e))},includes:function(e){return this.some(function(r){return ed(r,e)})},entries:function(){return this.__iterator(2)},every:function(e,r){ek(this.size);var i=!0;return this.__iterate(function(n,o,a){if(!e.call(r,n,o,a))return i=!1,!1}),i},filter:function(e,r){return tR(this,tI(this,e,r,!0))},find:function(e,r,i){var n=this.findEntry(e,r);return n?n[1]:i},findEntry:function(e,r){var i;return this.__iterate(function(n,o,a){if(e.call(r,n,o,a))return i=[o,n],!1}),i},findLastEntry:function(e,r){return this.toSeq().reverse().findEntry(e,r)},forEach:function(e,r){return ek(this.size),this.__iterate(r?e.bind(r):e)},join:function(e){ek(this.size),e=void 0!==e?""+e:",";var r="",i=!0;return this.__iterate(function(n){i?i=!1:r+=e,r+=null!=n?n.toString():""}),r},keys:function(){return this.__iterator(0)},map:function(e,r){return tR(this,tS(this,e,r))},reduce:function(e,r,i){var n,o;return ek(this.size),arguments.length<2?o=!0:n=r,this.__iterate(function(r,a,s){o?(o=!1,n=r):n=e.call(i,n,r,a,s)}),n},reduceRight:function(e,r,i){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return tR(this,tT(this,!0))},slice:function(e,r){return tR(this,tM(this,e,r,!0))},some:function(e,r){return!this.every(ra(e),r)},sort:function(e){return tR(this,tP(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,r){return R(e?this.toSeq().filter(e,r):this)},countBy:function(e,r){var i,n;return i=this,n=eN().asMutable(),i.__iterate(function(o,a){n.update(e.call(r,o,a,i),0,function(e){return e+1})}),n.asImmutable()},equals:function(e){return ef(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var r=e.toSeq().map(ro).toIndexedSeq();return r.fromEntrySeq=function(){return e.toSeq()},r},filterNot:function(e,r){return this.filter(ra(e),r)},findLast:function(e,r,i){return this.toKeyedSeq().reverse().find(e,r,i)},first:function(){return this.find(N)},flatMap:function(e,r){var i,n;return tR(this,(i=this,n=tF(i),i.toSeq().map(function(o,a){return n(e.call(r,o,a,i))}).flatten(!0)))},flatten:function(e){return tR(this,tA(this,e,!0))},fromEntrySeq:function(){return new tw(this)},get:function(e,r){return this.find(function(r,i){return ed(i,e)},void 0,r)},getIn:function(e,r){for(var i,n=this,o=tj(e);!(i=o.next()).done;){var a=i.value;if((n=n&&n.get?n.get(a,M):M)===M)return r}return n},groupBy:function(e,r){var i,n,o,a;return i=this,n=y(i),o=(b(i)?tf():eN()).asMutable(),i.__iterate(function(a,s){o.update(e.call(r,a,s,i),function(e){return(e=e||[]).push(n?[s,a]:a),e})}),a=tF(i),o.map(function(e){return tR(i,a(e))})},has:function(e){return this.get(e,M)!==M},hasIn:function(e){return this.getIn(e,M)!==M},isSubset:function(e){return e="function"==typeof e.includes?e:d(e),this.every(function(r){return e.includes(r)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:d(e)).isSubset(this)},keySeq:function(){return this.toSeq().map(rn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return tL(this,e)},maxBy:function(e,r){return tL(this,r,e)},min:function(e){return tL(this,e?rs(e):rc)},minBy:function(e,r){return tL(this,r?rs(r):rc,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return tR(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,r){return tR(this,tC(this,e,r,!0))},skipUntil:function(e,r){return this.skipWhile(ra(e),r)},sortBy:function(e,r){return tR(this,tP(this,r,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return tR(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,r){var i,n;return tR(this,(i=this,(n=tz(i)).__iterateUncached=function(n,o){var a=this;if(o)return this.cacheResult().__iterate(n,o);var s=0;return i.__iterate(function(i,o,l){return e.call(r,i,o,l)&&++s&&n(i,o,a)}),s},n.__iteratorUncached=function(n,o){var a=this;if(o)return this.cacheResult().__iterator(n,o);var s=i.__iterator(2,o),l=!0;return new V(function(){if(!l)return q();var i=s.next();if(i.done)return i;var o=i.value,u=o[0],c=o[1];return e.call(r,c,u,a)?2===n?i:G(n,u,c,i):(l=!1,q())})},n))},takeUntil:function(e,r){return this.takeWhile(ra(e),r)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var r,i,n=b(e),o=y(e),a=+!!n;return r=e.__iterate(o?n?function(e,r){a=31*a+rh(eS(e),eS(r))|0}:function(e,r){a=a+rh(eS(e),eS(r))|0}:n?function(e){a=31*a+eS(e)|0}:function(e){a=a+eS(e)|0}),i=ew(i=a,0xcc9e2d51),i=ew(i<<15|i>>>-15,0x1b873593),i=(i=ew(i<<13|i>>>-13,5))+0xe6546b64^r,i=ew(i^i>>>16,0x85ebca6b),i=eE((i=ew(i^i>>>13,0xc2b2ae35))^i>>>16)}(this))}});var rr=d.prototype;rr[w]=!0,rr[j]=rr.values,rr.__toJS=rr.toArray,rr.__toStringMapper=rl,rr.inspect=rr.toSource=function(){return this.toString()},rr.chain=rr.flatMap,rr.contains=rr.includes;try{Object.defineProperty(rr,"length",{get:function(){if(!d.noLengthWarning){var e;try{throw Error()}catch(r){e=r.stack}if(-1===e.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+e),this.size}}})}catch(e){}rt(f,{flip:function(){return tR(this,tE(this))},findKey:function(e,r){var i=this.findEntry(e,r);return i&&i[0]},findLastKey:function(e,r){return this.toSeq().reverse().findKey(e,r)},keyOf:function(e){return this.findKey(function(r){return ed(r,e)})},lastKeyOf:function(e){return this.findLastKey(function(r){return ed(r,e)})},mapEntries:function(e,r){var i=this,n=0;return tR(this,this.toSeq().map(function(o,a){return e.call(r,[a,o],n++,i)}).fromEntrySeq())},mapKeys:function(e,r){var i=this;return tR(this,this.toSeq().flip().map(function(n,o){return e.call(r,n,o,i)}).flip())}});var ri=f.prototype;function rn(e,r){return r}function ro(e,r){return[r,e]}function ra(e){return function(){return!e.apply(this,arguments)}}function rs(e){return function(){return-e.apply(this,arguments)}}function rl(e){return"string"==typeof e?JSON.stringify(e):e}function ru(){return D(arguments)}function rc(e,r){return e<r?1:e>r?-1:0}function rh(e,r){return e^r+0x9e3779b9+(e<<6)+(e>>2)}return ri[E]=!0,ri[j]=rr.entries,ri.__toJS=rr.toObject,ri.__toStringMapper=function(e,r){return JSON.stringify(r)+": "+rl(e)},rt(m,{toKeyedSeq:function(){return new tv(this,!1)},filter:function(e,r){return tR(this,tI(this,e,r,!1))},findIndex:function(e,r){var i=this.findEntry(e,r);return i?i[0]:-1},indexOf:function(e){var r=this.toKeyedSeq().keyOf(e);return void 0===r?-1:r},lastIndexOf:function(e){var r=this.toKeyedSeq().reverse().keyOf(e);return void 0===r?-1:r},reverse:function(){return tR(this,tT(this,!1))},slice:function(e,r){return tR(this,tM(this,e,r,!1))},splice:function(e,r){var i=arguments.length;if(r=Math.max(0|r,0),0===i||2===i&&!r)return this;e=z(e,e<0?this.count():this.size,0);var n=this.slice(0,e);return tR(this,1===i?n:n.concat(D(arguments,2),this.slice(e+r)))},findLastIndex:function(e,r){var i=this.toKeyedSeq().findLastKey(e,r);return void 0===i?-1:i},first:function(){return this.get(0)},flatten:function(e){return tR(this,tA(this,e,!1))},get:function(e,r){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?r:this.find(function(r,i){return i===e},void 0,r)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){var r,i;return tR(this,(r=this,(i=tz(r)).size=r.size&&2*r.size-1,i.__iterateUncached=function(i,n){var o=this,a=0;return r.__iterate(function(r,n){return(!a||!1!==i(e,a++,o))&&!1!==i(r,a++,o)},n),a},i.__iteratorUncached=function(i,n){var o,a=r.__iterator(1,n),s=0;return new V(function(){return(!o||s%2)&&(o=a.next()).done?o:s%2?G(i,s++,e):G(i,s++,o.value,o)})},i))},interleave:function(){var e=[this].concat(D(arguments)),r=tD(this.toSeq(),K.of,e),i=r.flatten(!0);return r.size&&(i.size=r.size*e.length),tR(this,i)},last:function(){return this.get(-1)},skipWhile:function(e,r){return tR(this,tC(this,e,r,!1))},zip:function(){var e=[this].concat(D(arguments));return tR(this,tD(this,ru,e))},zipWith:function(e){var r=D(arguments);return r[0]=this,tR(this,tD(this,e,r))}}),m.prototype[S]=!0,m.prototype[T]=!0,rt(g,{get:function(e,r){return this.has(e)?e:r},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),g.prototype.has=rr.includes,rt(X,f.prototype),rt(K,m.prototype),rt(Q,g.prototype),rt(ev,f.prototype),rt(ex,m.prototype),rt(eb,g.prototype),{Iterable:d,Seq:Z,Collection:ey,Map:eN,OrderedMap:tf,List:e7,Stack:t4,Set:tW,OrderedSet:t0,Record:tV,Range:e_,Repeat:em,is:ed,fromJS:eh}}()}
113,94584:(e,r,i)=>{"use strict";function n(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(r){var n,o,a;n=e,o=r,a=i[r],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}var o=i(58217),a=i(15796),s=function(e,r){for(var i=[].concat(e).reverse();i.length;){var n=i.pop();r(n);var o=n.children;Array.isArray(o)||a(!1),i=i.concat([].concat(o.reverse()))}},l=function(e){if(!(e&&e.type))return!1;var r=e.type;return"unordered-list-item"===r||"ordered-list-item"===r},u=function(e){Array.isArray(e.children)&&(e.children=e.children.map(function(r){return r.type===e.type?n({},r,{depth:(e.depth||0)+1}):r}))};e.exports={fromRawTreeStateToRawState:function(e){var r=e.blocks,i=[];return(Array.isArray(r)||a(!1),Array.isArray(r)&&r.length)?(s(r,function(e){var r=n({},e);l(e)&&(r.depth=r.depth||0,u(e),null!=e.children&&e.children.length>0)||(delete r.children,i.push(r))}),e.blocks=i,n({},e,{blocks:i})):e},fromRawStateToRawTreeState:function(e){var r=[],i=[];return e.blocks.forEach(function(e){var a=l(e),s=e.depth||0,u=n({},e,{children:[]});if(!a)return void r.push(u);var c=i[0];if(null==c&&0===s)r.push(u);else if(null==c||c.depth<s-1){var h={key:o(),text:"",depth:s-1,type:e.type,children:[],entityRanges:[],inlineStyleRanges:[]};i.unshift(h),1===s?r.push(h):null!=c&&c.children.push(h),h.children.push(u)}else if(c.depth===s-1)c.children.push(u);else{for(;null!=c&&c.depth>=s;)i.shift(),c=i[0];s>0?c.children.push(u):r.push(u)}}),n({},e,{blocks:r})}}},95182:(e,r,i)=>{"use strict";var n=i(39052),o=i(98334),a=n.isPlatform("Mac OS X"),s={isCtrlKeyCommand:function(e){return!!e.ctrlKey&&!e.altKey},isOptionKeyCommand:function(e){return a&&e.altKey},usesMacOSHeuristics:function(){return a},hasCommandModifier:function(e){return a?!!e.metaKey&&!e.altKey:s.isCtrlKeyCommand(e)},isSoftNewlineEvent:o};e.exports=s},95295:(e,r,i)=>{"use strict";var n="u">typeof Symbol&&Symbol,o=i(77785);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},95392:(e,r,i)=>{"use strict";i.d(r,{A:()=>a});var n=i(54945),o=i(99468);function a(e){(0,o.A)(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,n.A)(e)&&"[object Date]"===r?new Date(e.getTime()):"number"==typeof e||"[object Number]"===r?new Date(e):(("string"==typeof e||"[object String]"===r)&&"u">typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},95431:(e,r,i)=>{"use strict";var n=i(64754),o=i(18916),a=i(18034),s=i(3774);e.exports=function(e){if(e._blockSelectEvents||e._latestEditorState!==e.props.editorState){if(e._blockSelectEvents){var r=e.props.editorState.getSelection();n.logBlockedSelectionEvent({anonymizedDom:"N/A",extraParams:JSON.stringify({stacktrace:Error().stack}),selectionState:JSON.stringify(r.toJS())})}return}var i=e.props.editorState,l=s(i,a(e)),u=l.selectionState;u!==i.getSelection()&&(i=l.needsRecovery?o.forceSelection(i,u):o.acceptSelection(i,u),e.update(i))}},95471:(e,r,i)=>{"use strict";i.d(r,{AD:()=>_,FC:()=>f,GH:()=>g,LV:()=>a,WX:()=>c,Yp:()=>m,fh:()=>h,il:()=>u,oc:()=>s,pB:()=>l,qe:()=>p,rz:()=>n,ss:()=>d,u_:()=>o});let n=20,o=621371e-9,a=.001,s=3.28084,l=5280,u=100,c=1e3,h=0x1a96400,p=1e6,d=864e5,f=6e4,m=800,g=1200,_=0},95674:(e,r,i)=>{"use strict";i.d(r,{SL:()=>u,Ym:()=>h,b1:()=>l,ef:()=>c}),i(85428);var n=i(47054),o=i(84412);i(22629);var a=i(84091);let s=(e,r)=>{e.current.getLayer(r)&&e.current.removeLayer(r),e.current.addLayer((0,n.iF)(r))},l=(e,r)=>{for(let i of n.wb[r])s(e,i);(0,a.y)(e.current)},u=(e,r,i)=>{for(let i of n.wb[r])e.current.getLayer(i)&&e.current.removeLayer(i);e.current.getSource(r)&&e.current.removeSource(r),e.current.addSource(r,(0,n.Mv)(r,i))},c=(e,r,i)=>{e.current.getSource(r)?.setData(i)},h=e=>{[...o.ff,...n.IS].map(r=>{e.current.loadImage(r.imgUrl,(i,n)=>{if(i)throw i;e.current.hasImage(r.id)||e.current.addImage(r.id,n)})})}}
113,96058:(e,r,i)=>{"use strict";var n=i(98857),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},96634:(e,r,i)=>{"use strict";var n=i(18916),o=i(67605),a=i(44094);e.exports=function(e,r){var i=r.currentTarget.ownerDocument;if(!e.props.preserveSelectionOnBlur&&a(i)===i.body){var s=i.defaultView.getSelection(),l=e.editor;1===s.rangeCount&&o(l,s.anchorNode)&&o(l,s.focusNode)&&s.removeAllRanges()}var u=e._latestEditorState,c=u.getSelection();if(c.getHasFocus()){var h=c.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(r),e.update(n.acceptSelection(u,h))}}},97415:(e,r,i)=>{"use strict";i.d(r,{a:()=>s,l:()=>l});var n=i(37876),o=i(14232);let a=(0,o.createContext)({addUploading:()=>{},updateUploading:()=>{},removeUploading:()=>{},uploadings:[]}),s=({children:e})=>{let[r,i]=(0,o.useState)([]),s=(0,o.useCallback)(e=>{i(r=>[...r,e])},[]),l=(0,o.useCallback)((e,r)=>{i(i=>i.map(i=>i.id===e?{...i,...r}:i))},[]),u=(0,o.useCallback)(e=>{i(r=>r.filter(r=>r.id!==e))},[]);return(0,n.jsx)(a.Provider,{value:{addUploading:s,updateUploading:l,removeUploading:u,uploadings:r},children:e})},l=()=>{let e=(0,o.useContext)(a);if(!e)throw Error("useUploadingManagerContext must be used within UploadingManagerProvider");return e}},97487:function(e){e.exports=function(){"use strict";function e(e,r,i){var n=e[r];e[r]=e[i],e[i]=n}function r(e,r){return e<r?-1:+(e>r)}return function(i,n,o,a,s){!function r(i,n,o,a,s){for(;a>o;){if(a-o>600){var l=a-o+1,u=n-o+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),d=Math.max(o,Math.floor(n-u*h/l+p)),f=Math.min(a,Math.floor(n+(l-u)*h/l+p));r(i,n,d,f,s)}var m=i[n],g=o,_=a;for(e(i,o,n),s(i[a],m)>0&&e(i,o,a);g<_;){for(e(i,g,_),g++,_--;0>s(i[g],m);)g++;for(;s(i[_],m)>0;)_--}0===s(i[o],m)?e(i,o,_):e(i,++_,a),_<=n&&(o=_+1),n<=_&&(a=_-1)}}(i,n,o||0,a||i.length-1,s||r)}}()},97685:(e,r,i)=>{"use strict";let n,o;i.d(r,{l$:()=>et,Ay:()=>er,oR:()=>R});var a,s=i(14232);let l={data:""},u=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,c=/\/\*[^]*?\*\/|  +/g,h=/\n+/g,p=(e,r)=>{let i="",n="",o="";for(let a in e){let s=e[a];"@"==a[0]?"i"==a[1]?i=a+" "+s+";":n+="f"==a[1]?p(s,a):a+"{"+p(s,"k"==a[1]?"":r)+"}":"object"==typeof s?n+=p(s,r?r.replace(/([^,])+/g,e=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,r=>/&/.test(r)?r.replace(/&/g,e):e?e+" "+r:r)):a):null!=s&&(a="-"==a[1]?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=p.p?p.p(a,s):a+":"+s+";")}return i+(r&&o?r+"{"+o+"}":o)+n},d={},f=e=>{if("object"==typeof e){let r="";for(let i in e)r+=i+f(e[i]);return r}return e};function m(e){let r,i,n=this||{},o=e.call?e(n.p):e;return((e,r,i,n,o)=>{var a;let s=f(e),l=d[s]||(d[s]=(e=>{let r=0,i=11;for(;r<e.length;)i=101*i+e.charCodeAt(r++)>>>0;return"go"+i})(s));if(!d[l]){let r=s!==e?e:(e=>{let r,i,n=[{}];for(;r=u.exec(e.replace(c,""));)r[4]?n.shift():r[3]?(i=r[3].replace(h," ").trim(),n.unshift(n[0][i]=n[0][i]||{})):n[0][r[1]]=r[2].replace(h," ").trim();return n[0]})(e);d[l]=p(o?{["@keyframes "+l]:r}:r,i?"":"."+l)}let m=i&&d.g;return i&&(d.g=d[l]),a=d[l],m?r.data=r.data.replace(m,a):-1===r.data.indexOf(a)&&(r.data=n?a+r.data:r.data+a),l})(o.unshift?o.raw?(r=[].slice.call(arguments,1),i=n.p,o.reduce((e,n,o)=>{let a=r[o];if(a&&a.call){let e=a(i),r=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=r?"."+r:e&&"object"==typeof e?e.props?"":p(e,""):!1===e?"":e}return e+n+(null==a?"":a)},"")):o.reduce((e,r)=>Object.assign(e,r&&r.call?r(n.p):r),{}):o,(e=>{if("object"==typeof window){let r=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return r.nonce=window.__nonce__,r.parentNode||(e||document.head).appendChild(r),r.firstChild}return e||l})(n.target),n.g,n.o,n.k)}m.bind({g:1});let g,_,y,v=m.bind({k:1});function x(e,r){let i=this||{};return function(){let n=arguments;function o(a,s){let l=Object.assign({},a),u=l.className||o.className;i.p=Object.assign({theme:_&&_()},l),i.o=/go\d/.test(u),l.className=m.apply(i,n)+(u?" "+u:""),r&&(l.ref=s);let c=e;return e[0]&&(c=l.as||e,delete l.as),y&&c[0]&&y(l),g(c,l)}return r?r(o):o}}var b=(e,r)=>"function"==typeof e?e(r):e,w=(n=0,()=>(++n).toString()),E=()=>
113{if(void 0===o&&"u">typeof window){let e=matchMedia("(prefers-reduced-motion: reduce)");o=!e||e.matches}return o},S="default",T=(e,r)=>{let{toastLimit:i}=e.settings;switch(r.type){case 0:return{...e,toasts:[r.toast,...e.toasts].slice(0,i)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===r.toast.id?{...e,...r.toast}:e)};case 2:let{toast:n}=r;return T(e,{type:+!!e.toasts.find(e=>e.id===n.id),toast:n});case 3:let{toastId:o}=r;return{...e,toasts:e.toasts.map(e=>e.id===o||void 0===o?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===r.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==r.toastId)};case 5:return{...e,pausedAt:r.time};case 6:let a=r.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+a}))}}},I=[],M={toasts:[],pausedAt:void 0,settings:{toastLimit:20}},C={},A=(e,r=S)=>{C[r]=T(C[r]||M,e),I.forEach(([e,i])=>{e===r&&i(C[r])})},P=e=>Object.keys(C).forEach(r=>A(e,r)),L=(e=S)=>r=>{A(r,e)},O={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},D=e=>(r,i)=>{let n,o=((e,r="blank",i)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:r,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...i,id:(null==i?void 0:i.id)||w()}))(r,e,i);return L(o.toasterId||(n=o.id,Object.keys(C).find(e=>C[e].toasts.some(e=>e.id===n))))({type:2,toast:o}),o.id},R=(e,r)=>D("blank")(e,r);R.error=D("error"),R.success=D("success"),R.loading=D("loading"),R.custom=D("custom"),R.dismiss=(e,r)=>{let i={type:3,toastId:e};r?L(r)(i):P(i)},R.dismissAll=e=>R.dismiss(void 0,e),R.remove=(e,r)=>{let i={type:4,toastId:e};r?L(r)(i):P(i)},R.removeAll=e=>R.remove(void 0,e),R.promise=(e,r,i)=>{let n=R.loading(r.loading,{...i,...null==i?void 0:i.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let o=r.success?b(r.success,e):void 0;return o?R.success(o,{id:n,...i,...null==i?void 0:i.success}):R.dismiss(n),e}).catch(e=>{let o=r.error?b(r.error,e):void 0;o?R.error(o,{id:n,...i,...null==i?void 0:i.error}):R.dismiss(n)}),e};var k=1e3,N=v`
114from {
115  transform: scale(0) rotate(45deg);
116	opacity: 0;
117}
118to {
119 transform: scale(1) rotate(45deg);
120  opacity: 1;
121}`,F=v`
122from {
123  transform: scale(0);
124  opacity: 0;
125}
126to {
127  transform: scale(1);
128  opacity: 1;
129}`,z=v`
130from {
131  transform: scale(0) rotate(90deg);
132	opacity: 0;
133}
134to {
135  transform: scale(1) rotate(90deg);
136	opacity: 1;
137}`,B=x("div")`
138  width: 20px;
139  opacity: 0;
140  height: 20px;
141  border-radius: 10px;
142  background: ${e=>e.primary||"#ff4b4b"};
143  position: relative;
144  transform: rotate(45deg);
145
146  animation: ${N} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
147    forwards;
148  animation-delay: 100ms;
149
150  &:after,
151  &:before {
152    content: '';
153    animation: ${F} 0.15s ease-out forwards;
154    animation-delay: 150ms;
155    position: absolute;
156    border-radius: 3px;
157    opacity: 0;
158    background: ${e=>e.secondary||"#fff"};
159    bottom: 9px;
160    left: 4px;
161    height: 2px;
162    width: 12px;
163  }
164
165  &:before {
166    animation: ${z} 0.15s ease-out forwards;
167    animation-delay: 180ms;
168    transform: rotate(90deg);
169  }
170`,U=v`
171  from {
172    transform: rotate(0deg);
173  }
174  to {
175    transform: rotate(360deg);
176  }
177`,j=x("div")`
178  width: 12px;
179  height: 12px;
180  box-sizing: border-box;
181  border: 2px solid;
182  border-radius: 100%;
183  border-color: ${e=>e.secondary||"#e0e0e0"};
184  border-right-color: ${e=>e.primary||"#616161"};
185  animation: ${U} 1s linear infinite;
186`,V=v`
187from {
188  transform: scale(0) rotate(45deg);
189	opacity: 0;
190}
191to {
192  transform: scale(1) rotate(45deg);
193	opacity: 1;
194}`,G=v`
1950% {
196	height: 0;
197	width: 0;
198	opacity: 0;
199}
20040% {
201  height: 0;
202	width: 6px;
203	opacity: 1;
204}
205100% {
206  opacity: 1;
207  height: 10px;
208}`,q=x("div")`
209  width: 20px;
210  opacity: 0;
211  height: 20px;
212  border-radius: 10px;
213  background: ${e=>e.primary||"#61d345"};
214  position: relative;
215  transform: rotate(45deg);
216
217  animation: ${V} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
218    forwards;
219  animation-delay: 100ms;
220  &:after {
221    content: '';
222    box-sizing: border-box;
223    animation: ${G} 0.2s ease-out forwards;
224    opacity: 0;
225    animation-delay: 200ms;
226    position: absolute;
227    border-right: 2px solid;
228    border-bottom: 2px solid;
229    border-color: ${e=>e.secondary||"#fff"};
230    bottom: 6px;
231    left: 6px;
232    height: 10px;
233    width: 6px;
234  }
235`,H=x("div")`
236  position: absolute;
237`,$=x("div")`
238  position: relative;
239  display: flex;
240  justify-content: center;
241  align-items: center;
242  min-width: 20px;
243  min-height: 20px;
244`,W=v`
245from {
246  transform: scale(0.6);
247  opacity: 0.4;
248}
249to {
250  transform: scale(1);
251  opacity: 1;
252}`,Y=x("div")`
253  position: relative;
254  transform: scale(0.6);
255  opacity: 0.4;
256  min-width: 20px;
257  animation: ${W} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
258    forwards;
259`,Z=({toast:e})=>{let{icon:r,type:i,iconTheme:n}=e;return void 0!==r?"string"==typeof r?s.createElement(Y,null,r):r:"blank"===i?null:s.createElement($,null,s.createElement(j,{...n}),"loading"!==i&&s.createElement(H,null,"error"===i?s.createElement(B,{...n}):s.createElement(q,{...n})))},X=x("div")`
260  display: flex;
261  align-items: center;
262  background: #fff;
263  color: #363636;
264  line-height: 1.3;
265  will-change: transform;
266  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
267  max-width: 350px;
268  pointer-events: auto;
269  padding: 8px 10px;
270  border-radius: 8px;
271`,K=x("div")`
272  display: flex;
273  justify-content: center;
274  margin: 4px 10px;
275  color: inherit;
276  flex: 1 1 auto;
277  white-space: pre-line;
278`,Q=s.memo(({toast:e,position:r,style:i,children:n})=>{let o=e.height?((e,r)=>{let i=e.includes("top")?1:-1,[n,o]=E()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[`
2790% {transform: translate3d(0,${-200*i}%,0) scale(.6); opacity:.5;}
280100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
281`,`
2820% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
283100% {transform: translate3d(0,${-150*i}%,-1px) scale(.6); opacity:0;}
284`];return{animation:r?`${v(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${v(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||r||"top-center",e.visible):{opacity:0},a=s.createElement(Z,{toast:e}),l=s.createElement(K,{...e.ariaProps},b(e.message,e));return s.createElement(X,{className:e.className,style:{...o,...i,...e.style}},"function"==typeof n?n({icon:a,message:l}):s.createElement(s.Fragment,null,a,l))});a=s.createElement,p.p=void 0,g=a,_=void 0,y=void 0;var J=({id:e,className:r,style:i,onHeightUpdate:n,children:o})=>{let a=s.useCallback(r=>{if(r){let i=()=>{n(e,r.getBoundingClientRect().height)};i(),new MutationObserver(i).observe(r,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return s.createElement("div",{ref:a,className:r,style:i},o)},ee=m`
285  z-index: 9999;
286  > * {
287    pointer-events: auto;
288  }
289`,et=({reverseOrder:e,position:r="top-center",toastOptions:i,gutter:n,children:o,toasterId:a,containerStyle:l,containerClassName:u})=>{let{toasts:c,handlers:h}=((e,r="default")=>{let{toasts:i,pausedAt:n}=((e={},r=S)=>{let[i,n]=(0,s.useState)(C[r]||M),o=(0,s.useRef)(C[r]);(0,s.useEffect)(()=>(o.current!==C[r]&&n(C[r]),I.push([r,n]),()=>{let e=I.findIndex(([e])=>e===r);e>-1&&I.splice(e,1)}),[r]);let a=i.toasts.map(r=>{var i,n,o;return{...e,...e[r.type],...r,removeDelay:r.removeDelay||(null==(i=e[r.type])?void 0:i.removeDelay)||(null==e?void 0:e.removeDelay),duration:r.duration||(null==(n=e[r.type])?void 0:n.duration)||(null==e?void 0:e.duration)||O[r.type],style:{...e.style,...null==(o=e[r.type])?void 0:o.style,...r.style}}});return{...i,toasts:a}})(e,r),o=(0,s.useRef)(new Map).current,a=(0,s.useCallback)((e,r=k)=>{if(o.has(e))return;let i=setTimeout(()=>{o.delete(e),l({type:4,toastId:e})},r);o.set(e,i)},[]);(0,s.useEffect)(()=>{if(n)return;let e=Date.now(),o=i.map(i=>{if(i.duration===1/0)return;let n=(i.duration||0)+i.pauseDuration-(e-i.createdAt);if(n<0){i.visible&&R.dismiss(i.id);return}return setTimeout(()=>R.dismiss(i.id,r),n)});return()=>{o.forEach(e=>e&&clearTimeout(e))}},[i,n,r]);let l=(0,s.useCallback)(L(r),[r]),u=(0,s.useCallback)(()=>{l({type:5,time:Date.now()})},[l]),c=(0,s.useCallback)((e,r)=>{l({type:1,toast:{id:e,height:r}})},[l]),h=(0,s.useCallback)(()=>{n&&l({type:6,time:Date.now()})},[n,l]),p=(0,s.useCallback)((e,r)=>{let{reverseOrder:n=!1,gutter:o=8,defaultPosition:a}=r||{},s=i.filter(r=>(r.position||a)===(e.position||a)&&r.height),l=s.findIndex(r=>
289r.id===e.id),u=s.filter((e,r)=>r<l&&e.visible).length;return s.filter(e=>e.visible).slice(...n?[u+1]:[0,u]).reduce((e,r)=>e+(r.height||0)+o,0)},[i]);return(0,s.useEffect)(()=>{i.forEach(e=>{if(e.dismissed)a(e.id,e.removeDelay);else{let r=o.get(e.id);r&&(clearTimeout(r),o.delete(e.id))}})},[i,a]),{toasts:i,handlers:{updateHeight:c,startPause:u,endPause:h,calculateOffset:p}}})(i,a);return s.createElement("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...l},className:u,onMouseEnter:h.startPause,onMouseLeave:h.endPause},c.map(i=>{let a,l,u=i.position||r,c=h.calculateOffset(i,{reverseOrder:e,gutter:n,defaultPosition:r}),p=(a=u.includes("top"),l=u.includes("center")?{justifyContent:"center"}:u.includes("right")?{justifyContent:"flex-end"}:{},{left:0,right:0,display:"flex",position:"absolute",transition:E()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${c*(a?1:-1)}px)`,...a?{top:0}:{bottom:0},...l});return s.createElement(J,{id:i.id,key:i.id,onHeightUpdate:h.updateHeight,className:i.visible?ee:"",style:p},"custom"===i.type?b(i.message,i):o?o(i):s.createElement(Q,{toast:i,position:u}))}))},er=R},97794:(e,r,i)=>{"use strict";var n=i(12192),o=i(16576);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},97853:(e,r,i)=>{"use strict";var n=i(91685),o=i(14842),a=i(60620),s=i(22957),l=i(18428),u=i(45288),c=i(74011),h=i(98900),p=i(44793),d=i(45668),f=i(44510),m=i(39636),g=i(87729),_=i(18916),y=i(95182),v=i(89289),x=i(62070),b=i(75269),w=i(79362),E=i(3792),S=i(58217),T=i(14147),I=i(93544);e.exports={Editor:p,EditorBlock:d,EditorState:_,CompositeDecorator:s,Entity:f,EntityInstance:g,BlockMapBuilder:o,CharacterMetadata:a,ContentBlock:l,ContentState:u,RawDraftContentState:v,SelectionState:b,AtomicBlockUtils:n,KeyBindingUtil:y,Modifier:m,RichUtils:x,DefaultDraftBlockRenderMap:c,DefaultDraftInlineStyle:h,convertFromHTML:i(11228),convertFromRaw:E,convertToRaw:w,genKey:S,getDefaultKeyBinding:T,getVisibleSelectionRect:I}}
289,97984:(e,r,i)=>{"use strict";i.d(r,{W:()=>a});var n=i(14232),o=i(95471);let a=(e=o.GH)=>{let[r,i]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let r=()=>{i(window.innerWidth<=e)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[e]),r}},98287:(e,r,i)=>{"use strict";i.d(r,{FQ:()=>s,bY:()=>a,gr:()=>l});var n=i(85428),o=i(80856);let a=e=>({type:"FeatureCollection",features:e.filter(e=>"default"===e.properties.type).map(e=>({type:"Feature",id:e.id,properties:{id:e.id,user:e.first_name+" "+e.last_name,user_id:e.user_id,title:e.properties.title,description:e.properties.description,base:e.properties.folder_path?.base,files:e.properties.folder_path?.files,folder_path:e.properties.folder_path,img:e.properties.folder_path&&e.properties.folder_path.base?e.properties.folder_path.files[0]:null,create_date:e.create_date,category:e.properties.type,data:e.properties.data,condition:e.properties.condition,icon:e.properties.data&&e.properties.data.icon||"1",source:e.properties.data?.source&&"Mapbox"!=e.properties.data.source?e.properties.data.source:"Map",notification_ids:Array.isArray(e.notification_ids)?e.notification_ids:[]},geometry:{type:"Point",coordinates:void 0!==e.location.elevation&&null!==e.location.elevation?[e.location.lon,e.location.lat,e.location.elevation]:[e.location.lon,e.location.lat]}}))}),s=e=>({type:"FeatureCollection",features:e.filter(e=>"model"===e.properties.type||"scan"===e.properties.type).map(e=>{let r="custom-marker-3d";return e.properties.data&&"uploading"===String(e.properties.data.status)?r="custom-marker-3d-temp":e.properties.data&&"error"===String(e.properties.data.status)?r="custom-marker-3d-failed":e.properties.type==o.$$.scan&&(r="scan-note-marker"),{type:"Feature",id:e.id,properties:{id:e.id,user:e.first_name+" "+e.last_name,title:e.properties.title,description:e.properties.description,base:e.properties.folder_path?.base,files:e.properties.folder_path?.files,img:e.properties.folder_path&&e.properties.folder_path.base?(0,n.$S)(e.properties.folder_path):null,create_date:e.create_date,category:e.properties.type,data:e.properties.data,folder_path:e.properties.folder_path,icon:r,user_id:e.user_id,project:(0,n.Ky)().project_name,notification_ids:Array.isArray(e.notification_ids)?e.notification_ids:[]},geometry:{type:"Point",coordinates:[e.location.lon,e.location.lat]}}})}),l=e=>({type:"FeatureCollection",features:e.filter(e=>"ai"===e.properties.type).map(e=>({type:"Feature",id:e.id,properties:{id:e.id,user:e.first_name+" "+e.last_name,title:e.properties.title,description:e.properties.description,img:e.properties.folder_path&&e.properties.folder_path.base?(0,n.$S)(e.properties.folder_path):null,create_date:e.create_date,category:e.properties.type,data:e.properties.data,icon:e.properties.data&&e.properties.data.icon||"1ai",source:e.properties.data?.source&&"Mapbox"!=e.properties.data.source?e.properties.data.source:"Map"},geometry:{type:"Point",coordinates:[e.location.lon,e.location.lat]}}))})},98334:(e,r,i)=>{"use strict";var n=i(4708);e.exports=function(e){return e.which===n.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}},98369:(e,r,i)=>{"use strict";var n=i(54780).substr;e.exports=function(e,r){var i=Array(e.length).fill(null);return r&&r.forEach(function(r){for(var o=n(e,0,r.offset).length,a=o+n(e,r.offset,r.length).length,s=o;s<a;s++)i[s]=r.key}),i}},98857:e=>{"use strict";var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch(e){r=!1}e.exports=r},98900:e=>{"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},99297:e=>{"use strict";e.exports={encode:function(e,r,i){return e+"-"+r+"-"+i},decode:function(e){var r=e.split("-").reverse(),i=r[0],n=r[1];return{blockKey:r.slice(2).reverse().join("-"),decoratorKey:parseInt(n,10),leafKey:parseInt(i,10)}}}},99468:(e,r,i)=>{"use strict";function n(e,r){if(r.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+r.length+" present")}i.d(r,{A:()=>n})},99637:(e,r,i)=>{"use strict";i.d(r,{N:()=>u,i:()=>l});var n=i(37876),o=i(14232),a=i(80856);let s=(0,o.createContext)(null),l=({children:e})=>{let[r,i]=(0,o.useState)(null),[l,u]=(0,o.useState)({show:!1,noteMode:a.md.DEFAULT}),[c,h]=(0,o.useState)({}),[p,d]=(0,o.useState)(0),[f,m]=(0,o.useState)(0),[g,_]=(0,o.useState)([]);return(0,n.jsx)(s.Provider,{value:{note3DData:r,showAddNoteWindow:l,noteReadStatus:c,noteUnreadCount:p,refreshNotes:f,noteMentions:g,setNote3DData:i,setShowAddNoteWindow:u,setNoteReadStatus:h,setNoteUnreadCount:d,setRefreshNotes:m,setN
289oteMentions:_},children:e})},u=()=>{let e=(0,o.useContext)(s);if(!e)throw Error("useNoteContext must be used within a NoteProvider");return e}}},e=>{var r=r=>e(e.s=r);e.O(0,[6593,8792],()=>(r(86539),r(92),r(59603))),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.