@basemaps/landing 6.35.0 → 6.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/build/__tests__/map.config.test.js +15 -15
  3. package/build/__tests__/map.config.test.js.map +1 -1
  4. package/build/attribution.js +1 -1
  5. package/build/attribution.js.map +1 -1
  6. package/build/components/copyable.d.ts +2 -2
  7. package/build/components/copyable.d.ts.map +1 -1
  8. package/build/components/copyable.js +9 -4
  9. package/build/components/copyable.js.map +1 -1
  10. package/build/components/debug.d.ts +21 -18
  11. package/build/components/debug.d.ts.map +1 -1
  12. package/build/components/debug.js +48 -18
  13. package/build/components/debug.js.map +1 -1
  14. package/build/components/layer.switcher.dropdown.d.ts +19 -5
  15. package/build/components/layer.switcher.dropdown.d.ts.map +1 -1
  16. package/build/components/layer.switcher.dropdown.js +40 -32
  17. package/build/components/layer.switcher.dropdown.js.map +1 -1
  18. package/build/components/layout.footer.d.ts +3 -3
  19. package/build/components/layout.footer.d.ts.map +1 -1
  20. package/build/components/layout.footer.js +5 -5
  21. package/build/components/layout.footer.js.map +1 -1
  22. package/build/components/layout.header.d.ts +12 -10
  23. package/build/components/layout.header.d.ts.map +1 -1
  24. package/build/components/layout.header.js +20 -21
  25. package/build/components/layout.header.js.map +1 -1
  26. package/build/components/link.d.ts +4 -3
  27. package/build/components/link.d.ts.map +1 -1
  28. package/build/components/link.js +6 -6
  29. package/build/components/link.js.map +1 -1
  30. package/build/components/map.d.ts +2 -2
  31. package/build/components/map.d.ts.map +1 -1
  32. package/build/components/map.js +5 -3
  33. package/build/components/map.js.map +1 -1
  34. package/build/components/map.switcher.d.ts +2 -2
  35. package/build/components/map.switcher.d.ts.map +1 -1
  36. package/build/components/map.switcher.js +4 -4
  37. package/build/components/map.switcher.js.map +1 -1
  38. package/build/config.debug.d.ts +1 -1
  39. package/build/config.debug.d.ts.map +1 -1
  40. package/build/config.layer.d.ts.map +1 -1
  41. package/build/config.layer.js +19 -1
  42. package/build/config.layer.js.map +1 -1
  43. package/build/debug.map.d.ts +5 -4
  44. package/build/debug.map.d.ts.map +1 -1
  45. package/build/debug.map.js +8 -7
  46. package/build/debug.map.js.map +1 -1
  47. package/build/index.js +5 -3
  48. package/build/index.js.map +1 -1
  49. package/build/tile.matrix.js +1 -1
  50. package/build/tile.matrix.js.map +1 -1
  51. package/build/url.d.ts +1 -1
  52. package/build/url.d.ts.map +1 -1
  53. package/build/url.js +7 -7
  54. package/build/url.js.map +1 -1
  55. package/dist/examples/index.openlayers.attribution.wmts.3857.html +1 -1
  56. package/dist/{index-6.35.0-467e63869a31f2e1.css → index-6.37.0-40fc4132c6bdc9c0.css} +2527 -591
  57. package/dist/index-6.37.0-c739bbc6df67e9f2.js +623 -0
  58. package/dist/index-6.37.0-ed6257a27cf37921.js +59113 -0
  59. package/dist/index.css +2527 -591
  60. package/dist/index.html +2 -2
  61. package/dist/index.js +117 -61
  62. package/dist/lib/{attribution-6.35.0-b4a0b401b1a4cc45.js → attribution-6.37.0-b4a0b401b1a4cc45.js} +0 -0
  63. package/dist/lib/{attribution-6.35.0-fc88f809368e4547.js → attribution-6.37.0-fc88f809368e4547.js} +0 -0
  64. package/package.json +15 -13
  65. package/dist/index-6.35.0-5eab7867ea4ef021.js +0 -29591
  66. package/dist/index-6.35.0-96a7f42b0fdac497.js +0 -567
@@ -0,0 +1,623 @@
1
+ "use strict";var w3=Object.create;var rb=Object.defineProperty;var I3=Object.getOwnPropertyDescriptor;var S3=Object.getOwnPropertyNames;var C3=Object.getPrototypeOf,M3=Object.prototype.hasOwnProperty;var Gt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var E3=(e,t,r,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of S3(t))!M3.call(e,u)&&u!==r&&rb(e,u,{get:()=>t[u],enumerable:!(l=I3(t,u))||l.enumerable});return e};var Nt=(e,t,r)=>(r=e!=null?w3(C3(e)):{},E3(t||!e||!e.__esModule?rb(r,"default",{value:e,enumerable:!0}):r,e));var fb=Gt(ui=>{"use strict";var Vh=Symbol.for("react.element"),A3=Symbol.for("react.portal"),T3=Symbol.for("react.fragment"),P3=Symbol.for("react.strict_mode"),k3=Symbol.for("react.profiler"),z3=Symbol.for("react.provider"),L3=Symbol.for("react.context"),R3=Symbol.for("react.forward_ref"),D3=Symbol.for("react.suspense"),B3=Symbol.for("react.memo"),N3=Symbol.for("react.lazy"),nb=Symbol.iterator;function F3(e){return e===null||typeof e!="object"?null:(e=nb&&e[nb]||e["@@iterator"],typeof e=="function"?e:null)}var ab={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lb=Object.assign,ub={};function Ou(e,t,r){this.props=e,this.context=t,this.refs=ub,this.updater=r||ab}Ou.prototype.isReactComponent={};Ou.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ou.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cb(){}cb.prototype=Ou.prototype;function X0(e,t,r){this.props=e,this.context=t,this.refs=ub,this.updater=r||ab}var $0=X0.prototype=new cb;$0.constructor=X0;lb($0,Ou.prototype);$0.isPureReactComponent=!0;var ob=Array.isArray,hb=Object.prototype.hasOwnProperty,Y0={current:null},db={key:!0,ref:!0,__self:!0,__source:!0};function pb(e,t,r){var l,u={},o=null,m=null;if(t!=null)for(l in t.ref!==void 0&&(m=t.ref),t.key!==void 0&&(o=""+t.key),t)hb.call(t,l)&&!db.hasOwnProperty(l)&&(u[l]=t[l]);var v=arguments.length-2;if(v===1)u.children=r;else if(1<v){for(var b=Array(v),C=0;C<v;C++)b[C]=arguments[C+2];u.children=b}if(e&&e.defaultProps)for(l in v=e.defaultProps,v)u[l]===void 0&&(u[l]=v[l]);return{$$typeof:Vh,type:e,key:o,ref:m,props:u,_owner:Y0.current}}function O3(e,t){return{$$typeof:Vh,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function q0(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vh}function G3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var sb=/\/+/g;function H0(e,t){return typeof e=="object"&&e!==null&&e.key!=null?G3(""+e.key):t.toString(36)}function af(e,t,r,l,u){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var m=!1;if(e===null)m=!0;else switch(o){case"string":case"number":m=!0;break;case"object":switch(e.$$typeof){case Vh:case A3:m=!0}}if(m)return m=e,u=u(m),e=l===""?"."+H0(m,0):l,ob(u)?(r="",e!=null&&(r=e.replace(sb,"$&/")+"/"),af(u,t,r,"",function(C){return C})):u!=null&&(q0(u)&&(u=O3(u,r+(!u.key||m&&m.key===u.key?"":(""+u.key).replace(sb,"$&/")+"/")+e)),t.push(u)),1;if(m=0,l=l===""?".":l+":",ob(e))for(var v=0;v<e.length;v++){o=e[v];var b=l+H0(o,v);m+=af(o,t,r,b,u)}else if(b=F3(e),typeof b=="function")for(e=b.call(e),v=0;!(o=e.next()).done;)o=o.value,b=l+H0(o,v++),m+=af(o,t,r,b,u);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return m}function sf(e,t,r){if(e==null)return e;var l=[],u=0;return af(e,l,"","",function(o){return t.call(r,o,u++)}),l}function V3(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Rn={current:null},lf={transition:null},U3={ReactCurrentDispatcher:Rn,ReactCurrentBatchConfig:lf,ReactCurrentOwner:Y0};ui.Children={map:sf,forEach:function(e,t,r){sf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return sf(e,function(){t++}),t},toArray:function(e){return sf(e,function(t){return t})||[]},only:function(e){if(!q0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ui.Component=Ou;ui.Fragment=T3;ui.Profiler=k3;ui.PureComponent=X0;ui.StrictMode=P3;ui.Suspense=D3;ui.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U3;ui.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var l=lb({},e.props),u=e.key,o=e.ref,m=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,m=Y0.current),t.key!==void 0&&(u=""+t.key),e.type&&e.type.defaultProps)var v=e.type.defaultProps;for(b in t)hb.call(t,b)&&!db.hasOwnProperty(b)&&(l[b]=t[b]===void 0&&v!==void 0?v[b]:t[b])}var b=arguments.length-2;if(b===1)l.children=r;else if(1<b){v=Array(b);for(var C=0;C<b;C++)v[C]=arguments[C+2];l.children=v}return{$$typeof:Vh,type:e.type,key:u,ref:o,props:l,_owner:m}};ui.createContext=function(e){return e={$$typeof:L3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:z3,_context:e},e.Consumer=e};ui.createElement=pb;ui.createFactory=function(e){var t=pb.bind(null,e);return t.type=e,t};ui.createRef=function(){return{current:null}};ui.forwardRef=function(e){return{$$typeof:R3,render:e}};ui.isValidElement=q0;ui.lazy=function(e){return{$$typeof:N3,_payload:{_status:-1,_result:e},_init:V3}};ui.memo=function(e,t){return{$$typeof:B3,type:e,compare:t===void 0?null:t}};ui.startTransition=function(e){var t=lf.transition;lf.transition={};try{e()}finally{lf.transition=t}};ui.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ui.useCallback=function(e,t){return Rn.current.useCallback(e,t)};ui.useContext=function(e){return Rn.current.useContext(e)};ui.useDebugValue=function(){};ui.useDeferredValue=function(e){return Rn.current.useDeferredValue(e)};ui.useEffect=function(e,t){return Rn.current.useEffect(e,t)};ui.useId=function(){return Rn.current.useId()};ui.useImperativeHandle=function(e,t,r){return Rn.current.useImperativeHandle(e,t,r)};ui.useInsertionEffect=function(e,t){return Rn.current.useInsertionEffect(e,t)};ui.useLayoutEffect=function(e,t){return Rn.current.useLayoutEffect(e,t)};ui.useMemo=function(e,t){return Rn.current.useMemo(e,t)};ui.useReducer=function(e,t,r){return Rn.current.useReducer(e,t,r)};ui.useRef=function(e){return Rn.current.useRef(e)};ui.useState=function(e){return Rn.current.useState(e)};ui.useSyncExternalStore=function(e,t,r){return Rn.current.useSyncExternalStore(e,t,r)};ui.useTransition=function(){return Rn.current.useTransition()};ui.version="18.2.0"});var Pr=Gt((sB,mb)=>{"use strict";mb.exports=fb()});var Cb=Gt(Yi=>{"use strict";function ey(e,t){var r=e.length;e.push(t);e:for(;0<r;){var l=r-1>>>1,u=e[l];if(0<uf(u,t))e[l]=t,e[r]=u,r=l;else break e}}function Oo(e){return e.length===0?null:e[0]}function hf(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var l=0,u=e.length,o=u>>>1;l<o;){var m=2*(l+1)-1,v=e[m],b=m+1,C=e[b];if(0>uf(v,r))b<u&&0>uf(C,v)?(e[l]=C,e[b]=r,l=b):(e[l]=v,e[m]=r,l=m);else if(b<u&&0>uf(C,r))e[l]=C,e[b]=r,l=b;else break e}}return t}function uf(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(gb=performance,Yi.unstable_now=function(){return gb.now()}):(J0=Date,yb=J0.now(),Yi.unstable_now=function(){return J0.now()-yb});var gb,J0,yb,is=[],Ma=[],W3=1,Mo=null,yn=3,df=!1,Sl=!1,Wh=!1,_b=typeof setTimeout=="function"?setTimeout:null,bb=typeof clearTimeout=="function"?clearTimeout:null,vb=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ty(e){for(var t=Oo(Ma);t!==null;){if(t.callback===null)hf(Ma);else if(t.startTime<=e)hf(Ma),t.sortIndex=t.expirationTime,ey(is,t);else break;t=Oo(Ma)}}function iy(e){if(Wh=!1,ty(e),!Sl)if(Oo(is)!==null)Sl=!0,ny(ry);else{var t=Oo(Ma);t!==null&&oy(iy,t.startTime-e)}}function ry(e,t){Sl=!1,Wh&&(Wh=!1,bb(Zh),Zh=-1),df=!0;var r=yn;try{for(ty(t),Mo=Oo(is);Mo!==null&&(!(Mo.expirationTime>t)||e&&!Sb());){var l=Mo.callback;if(typeof l=="function"){Mo.callback=null,yn=Mo.priorityLevel;var u=l(Mo.expirationTime<=t);t=Yi.unstable_now(),typeof u=="function"?Mo.callback=u:Mo===Oo(is)&&hf(is),ty(t)}else hf(is);Mo=Oo(is)}if(Mo!==null)var o=!0;else{var m=Oo(Ma);m!==null&&oy(iy,m.startTime-t),o=!1}return o}finally{Mo=null,yn=r,df=!1}}var pf=!1,cf=null,Zh=-1,wb=5,Ib=-1;function Sb(){return!(Yi.unstable_now()-Ib<wb)}function Q0(){if(cf!==null){var e=Yi.unstable_now();Ib=e;var t=!0;try{t=cf(!0,e)}finally{t?Uh():(pf=!1,cf=null)}}else pf=!1}var Uh;typeof vb=="function"?Uh=function(){vb(Q0)}:typeof MessageChannel<"u"?(K0=new MessageChannel,xb=K0.port2,K0.port1.onmessage=Q0,Uh=function(){xb.postMessage(null)}):Uh=function(){_b(Q0,0)};var K0,xb;function ny(e){cf=e,pf||(pf=!0,Uh())}function oy(e,t){Zh=_b(function(){e(Yi.unstable_now())},t)}Yi.unstable_IdlePriority=5;Yi.unstable_ImmediatePriority=1;Yi.unstable_LowPriority=4;Yi.unstable_NormalPriority=3;Yi.unstable_Profiling=null;Yi.unstable_UserBlockingPriority=2;Yi.unstable_cancelCallback=function(e){e.callback=null};Yi.unstable_continueExecution=function(){Sl||df||(Sl=!0,ny(ry))};Yi.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):wb=0<e?Math.floor(1e3/e):5};Yi.unstable_getCurrentPriorityLevel=function(){return yn};Yi.unstable_getFirstCallbackNode=function(){return Oo(is)};Yi.unstable_next=function(e){switch(yn){case 1:case 2:case 3:var t=3;break;default:t=yn}var r=yn;yn=t;try{return e()}finally{yn=r}};Yi.unstable_pauseExecution=function(){};Yi.unstable_requestPaint=function(){};Yi.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=yn;yn=e;try{return t()}finally{yn=r}};Yi.unstable_scheduleCallback=function(e,t,r){var l=Yi.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?l+r:l):r=l,e){case 1:var u=-1;break;case 2:u=250;break;case 5:u=1073741823;break;case 4:u=1e4;break;default:u=5e3}return u=r+u,e={id:W3++,callback:t,priorityLevel:e,startTime:r,expirationTime:u,sortIndex:-1},r>l?(e.sortIndex=r,ey(Ma,e),Oo(is)===null&&e===Oo(Ma)&&(Wh?(bb(Zh),Zh=-1):Wh=!0,oy(iy,r-l))):(e.sortIndex=u,ey(is,e),Sl||df||(Sl=!0,ny(ry))),e};Yi.unstable_shouldYield=Sb;Yi.unstable_wrapCallback=function(e){var t=yn;return function(){var r=yn;yn=t;try{return e.apply(this,arguments)}finally{yn=r}}}});var Eb=Gt((lB,Mb)=>{"use strict";Mb.exports=Cb()});var LI=Gt(fo=>{"use strict";var R2=Pr(),ho=Eb();function Qe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var D2=new Set,dd={};function Nl(e,t){sc(e,t),sc(e+"Capture",t)}function sc(e,t){for(dd[e]=t,e=0;e<t.length;e++)D2.add(t[e])}var Vs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ay=Object.prototype.hasOwnProperty,Z3=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ab={},Tb={};function j3(e){return Ay.call(Tb,e)?!0:Ay.call(Ab,e)?!1:Z3.test(e)?Tb[e]=!0:(Ab[e]=!0,!1)}function H3(e,t,r,l){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function X3(e,t,r,l){if(t===null||typeof t>"u"||H3(e,t,r,l))return!0;if(l)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Nn(e,t,r,l,u,o,m){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=u,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=m}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){cn[e]=new Nn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];cn[t]=new Nn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){cn[e]=new Nn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){cn[e]=new Nn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){cn[e]=new Nn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){cn[e]=new Nn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){cn[e]=new Nn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){cn[e]=new Nn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){cn[e]=new Nn(e,5,!1,e.toLowerCase(),null,!1,!1)});var _v=/[\-:]([a-z])/g;function bv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_v,bv);cn[t]=new Nn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_v,bv);cn[t]=new Nn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_v,bv);cn[t]=new Nn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){cn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!1,!1)});cn.xlinkHref=new Nn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){cn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!0,!0)});function wv(e,t,r,l){var u=cn.hasOwnProperty(t)?cn[t]:null;(u!==null?u.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(X3(t,r,u,l)&&(r=null),l||u===null?j3(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):u.mustUseProperty?e[u.propertyName]=r===null?u.type===3?!1:"":r:(t=u.attributeName,l=u.attributeNamespace,r===null?e.removeAttribute(t):(u=u.type,r=u===3||u===4&&r===!0?"":""+r,l?e.setAttributeNS(l,t,r):e.setAttribute(t,r))))}var js=R2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ff=Symbol.for("react.element"),Uu=Symbol.for("react.portal"),Wu=Symbol.for("react.fragment"),Iv=Symbol.for("react.strict_mode"),Ty=Symbol.for("react.profiler"),B2=Symbol.for("react.provider"),N2=Symbol.for("react.context"),Sv=Symbol.for("react.forward_ref"),Py=Symbol.for("react.suspense"),ky=Symbol.for("react.suspense_list"),Cv=Symbol.for("react.memo"),Aa=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var F2=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Pb=Symbol.iterator;function jh(e){return e===null||typeof e!="object"?null:(e=Pb&&e[Pb]||e["@@iterator"],typeof e=="function"?e:null)}var fr=Object.assign,sy;function Kh(e){if(sy===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);sy=t&&t[1]||""}return`
2
+ `+sy+e}var ay=!1;function ly(e,t){if(!e||ay)return"";ay=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(C){var l=C}Reflect.construct(e,[],t)}else{try{t.call()}catch(C){l=C}e.call(t.prototype)}else{try{throw Error()}catch(C){l=C}e()}}catch(C){if(C&&l&&typeof C.stack=="string"){for(var u=C.stack.split(`
3
+ `),o=l.stack.split(`
4
+ `),m=u.length-1,v=o.length-1;1<=m&&0<=v&&u[m]!==o[v];)v--;for(;1<=m&&0<=v;m--,v--)if(u[m]!==o[v]){if(m!==1||v!==1)do if(m--,v--,0>v||u[m]!==o[v]){var b=`
5
+ `+u[m].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),b}while(1<=m&&0<=v);break}}}finally{ay=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Kh(e):""}function $3(e){switch(e.tag){case 5:return Kh(e.type);case 16:return Kh("Lazy");case 13:return Kh("Suspense");case 19:return Kh("SuspenseList");case 0:case 2:case 15:return e=ly(e.type,!1),e;case 11:return e=ly(e.type.render,!1),e;case 1:return e=ly(e.type,!0),e;default:return""}}function zy(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Wu:return"Fragment";case Uu:return"Portal";case Ty:return"Profiler";case Iv:return"StrictMode";case Py:return"Suspense";case ky:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case N2:return(e.displayName||"Context")+".Consumer";case B2:return(e._context.displayName||"Context")+".Provider";case Sv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cv:return t=e.displayName||null,t!==null?t:zy(e.type)||"Memo";case Aa:t=e._payload,e=e._init;try{return zy(e(t))}catch{}}return null}function Y3(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zy(t);case 8:return t===Iv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ua(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function O2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function q3(e){var t=O2(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(m){l=""+m,o.call(this,m)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(m){l=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mf(e){e._valueTracker||(e._valueTracker=q3(e))}function G2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),l="";return e&&(l=O2(e)?e.checked?"true":"false":e.value),e=l,e!==r?(t.setValue(e),!0):!1}function Wf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ly(e,t){var r=t.checked;return fr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function kb(e,t){var r=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;r=Ua(t.value!=null?t.value:r),e._wrapperState={initialChecked:l,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function V2(e,t){t=t.checked,t!=null&&wv(e,"checked",t,!1)}function Ry(e,t){V2(e,t);var r=Ua(t.value),l=t.type;if(r!=null)l==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dy(e,t.type,r):t.hasOwnProperty("defaultValue")&&Dy(e,t.type,Ua(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function zb(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Dy(e,t,r){(t!=="number"||Wf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ed=Array.isArray;function ec(e,t,r,l){if(e=e.options,t){t={};for(var u=0;u<r.length;u++)t["$"+r[u]]=!0;for(r=0;r<e.length;r++)u=t.hasOwnProperty("$"+e[r].value),e[r].selected!==u&&(e[r].selected=u),u&&l&&(e[r].defaultSelected=!0)}else{for(r=""+Ua(r),t=null,u=0;u<e.length;u++){if(e[u].value===r){e[u].selected=!0,l&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function By(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Qe(91));return fr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Lb(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Qe(92));if(ed(r)){if(1<r.length)throw Error(Qe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ua(r)}}function U2(e,t){var r=Ua(t.value),l=Ua(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),l!=null&&(e.defaultValue=""+l)}function Rb(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function W2(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ny(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?W2(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gf,Z2=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,l,u){MSApp.execUnsafeLocalFunction(function(){return e(t,r,l,u)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(gf=gf||document.createElement("div"),gf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pd(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var rd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},J3=["Webkit","ms","Moz","O"];Object.keys(rd).forEach(function(e){J3.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rd[t]=rd[e]})});function j2(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||rd.hasOwnProperty(e)&&rd[e]?(""+t).trim():t+"px"}function H2(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var l=r.indexOf("--")===0,u=j2(r,t[r],l);r==="float"&&(r="cssFloat"),l?e.setProperty(r,u):e[r]=u}}var Q3=fr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fy(e,t){if(t){if(Q3[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Qe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Qe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Qe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Qe(62))}}function Oy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gy=null;function Mv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vy=null,tc=null,ic=null;function Db(e){if(e=kd(e)){if(typeof Vy!="function")throw Error(Qe(280));var t=e.stateNode;t&&(t=ym(t),Vy(e.stateNode,e.type,t))}}function X2(e){tc?ic?ic.push(e):ic=[e]:tc=e}function $2(){if(tc){var e=tc,t=ic;if(ic=tc=null,Db(e),t)for(e=0;e<t.length;e++)Db(t[e])}}function Y2(e,t){return e(t)}function q2(){}var uy=!1;function J2(e,t,r){if(uy)return e(t,r);uy=!0;try{return Y2(e,t,r)}finally{uy=!1,(tc!==null||ic!==null)&&(q2(),$2())}}function fd(e,t){var r=e.stateNode;if(r===null)return null;var l=ym(r);if(l===null)return null;r=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Qe(231,t,typeof r));return r}var Uy=!1;if(Vs)try{Gu={},Object.defineProperty(Gu,"passive",{get:function(){Uy=!0}}),window.addEventListener("test",Gu,Gu),window.removeEventListener("test",Gu,Gu)}catch{Uy=!1}var Gu;function K3(e,t,r,l,u,o,m,v,b){var C=Array.prototype.slice.call(arguments,3);try{t.apply(r,C)}catch(A){this.onError(A)}}var nd=!1,Zf=null,jf=!1,Wy=null,e4={onError:function(e){nd=!0,Zf=e}};function t4(e,t,r,l,u,o,m,v,b){nd=!1,Zf=null,K3.apply(e4,arguments)}function i4(e,t,r,l,u,o,m,v,b){if(t4.apply(this,arguments),nd){if(nd){var C=Zf;nd=!1,Zf=null}else throw Error(Qe(198));jf||(jf=!0,Wy=C)}}function Fl(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Q2(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Bb(e){if(Fl(e)!==e)throw Error(Qe(188))}function r4(e){var t=e.alternate;if(!t){if(t=Fl(e),t===null)throw Error(Qe(188));return t!==e?null:e}for(var r=e,l=t;;){var u=r.return;if(u===null)break;var o=u.alternate;if(o===null){if(l=u.return,l!==null){r=l;continue}break}if(u.child===o.child){for(o=u.child;o;){if(o===r)return Bb(u),e;if(o===l)return Bb(u),t;o=o.sibling}throw Error(Qe(188))}if(r.return!==l.return)r=u,l=o;else{for(var m=!1,v=u.child;v;){if(v===r){m=!0,r=u,l=o;break}if(v===l){m=!0,l=u,r=o;break}v=v.sibling}if(!m){for(v=o.child;v;){if(v===r){m=!0,r=o,l=u;break}if(v===l){m=!0,l=o,r=u;break}v=v.sibling}if(!m)throw Error(Qe(189))}}if(r.alternate!==l)throw Error(Qe(190))}if(r.tag!==3)throw Error(Qe(188));return r.stateNode.current===r?e:t}function K2(e){return e=r4(e),e!==null?ew(e):null}function ew(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ew(e);if(t!==null)return t;e=e.sibling}return null}var tw=ho.unstable_scheduleCallback,Nb=ho.unstable_cancelCallback,n4=ho.unstable_shouldYield,o4=ho.unstable_requestPaint,kr=ho.unstable_now,s4=ho.unstable_getCurrentPriorityLevel,Ev=ho.unstable_ImmediatePriority,iw=ho.unstable_UserBlockingPriority,Hf=ho.unstable_NormalPriority,a4=ho.unstable_LowPriority,rw=ho.unstable_IdlePriority,pm=null,ss=null;function l4(e){if(ss&&typeof ss.onCommitFiberRoot=="function")try{ss.onCommitFiberRoot(pm,e,void 0,(e.current.flags&128)===128)}catch{}}var Zo=Math.clz32?Math.clz32:h4,u4=Math.log,c4=Math.LN2;function h4(e){return e>>>=0,e===0?32:31-(u4(e)/c4|0)|0}var yf=64,vf=4194304;function td(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Xf(e,t){var r=e.pendingLanes;if(r===0)return 0;var l=0,u=e.suspendedLanes,o=e.pingedLanes,m=r&268435455;if(m!==0){var v=m&~u;v!==0?l=td(v):(o&=m,o!==0&&(l=td(o)))}else m=r&~u,m!==0?l=td(m):o!==0&&(l=td(o));if(l===0)return 0;if(t!==0&&t!==l&&(t&u)===0&&(u=l&-l,o=t&-t,u>=o||u===16&&(o&4194240)!==0))return t;if((l&4)!==0&&(l|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)r=31-Zo(t),u=1<<r,l|=e[r],t&=~u;return l}function d4(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function p4(e,t){for(var r=e.suspendedLanes,l=e.pingedLanes,u=e.expirationTimes,o=e.pendingLanes;0<o;){var m=31-Zo(o),v=1<<m,b=u[m];b===-1?((v&r)===0||(v&l)!==0)&&(u[m]=d4(v,t)):b<=t&&(e.expiredLanes|=v),o&=~v}}function Zy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nw(){var e=yf;return yf<<=1,(yf&4194240)===0&&(yf=64),e}function cy(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Td(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zo(t),e[t]=r}function f4(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<r;){var u=31-Zo(r),o=1<<u;t[u]=0,l[u]=-1,e[u]=-1,r&=~o}}function Av(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var l=31-Zo(r),u=1<<l;u&t|e[l]&t&&(e[l]|=t),r&=~u}}var Di=0;function ow(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var sw,Tv,aw,lw,uw,jy=!1,xf=[],Ra=null,Da=null,Ba=null,md=new Map,gd=new Map,Pa=[],m4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fb(e,t){switch(e){case"focusin":case"focusout":Ra=null;break;case"dragenter":case"dragleave":Da=null;break;case"mouseover":case"mouseout":Ba=null;break;case"pointerover":case"pointerout":md.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gd.delete(t.pointerId)}}function Hh(e,t,r,l,u,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:l,nativeEvent:o,targetContainers:[u]},t!==null&&(t=kd(t),t!==null&&Tv(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function g4(e,t,r,l,u){switch(t){case"focusin":return Ra=Hh(Ra,e,t,r,l,u),!0;case"dragenter":return Da=Hh(Da,e,t,r,l,u),!0;case"mouseover":return Ba=Hh(Ba,e,t,r,l,u),!0;case"pointerover":var o=u.pointerId;return md.set(o,Hh(md.get(o)||null,e,t,r,l,u)),!0;case"gotpointercapture":return o=u.pointerId,gd.set(o,Hh(gd.get(o)||null,e,t,r,l,u)),!0}return!1}function cw(e){var t=El(e.target);if(t!==null){var r=Fl(t);if(r!==null){if(t=r.tag,t===13){if(t=Q2(r),t!==null){e.blockedOn=t,uw(e.priority,function(){aw(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Hy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var l=new r.constructor(r.type,r);Gy=l,r.target.dispatchEvent(l),Gy=null}else return t=kd(r),t!==null&&Tv(t),e.blockedOn=r,!1;t.shift()}return!0}function Ob(e,t,r){Lf(e)&&r.delete(t)}function y4(){jy=!1,Ra!==null&&Lf(Ra)&&(Ra=null),Da!==null&&Lf(Da)&&(Da=null),Ba!==null&&Lf(Ba)&&(Ba=null),md.forEach(Ob),gd.forEach(Ob)}function Xh(e,t){e.blockedOn===t&&(e.blockedOn=null,jy||(jy=!0,ho.unstable_scheduleCallback(ho.unstable_NormalPriority,y4)))}function yd(e){function t(u){return Xh(u,e)}if(0<xf.length){Xh(xf[0],e);for(var r=1;r<xf.length;r++){var l=xf[r];l.blockedOn===e&&(l.blockedOn=null)}}for(Ra!==null&&Xh(Ra,e),Da!==null&&Xh(Da,e),Ba!==null&&Xh(Ba,e),md.forEach(t),gd.forEach(t),r=0;r<Pa.length;r++)l=Pa[r],l.blockedOn===e&&(l.blockedOn=null);for(;0<Pa.length&&(r=Pa[0],r.blockedOn===null);)cw(r),r.blockedOn===null&&Pa.shift()}var rc=js.ReactCurrentBatchConfig,$f=!0;function v4(e,t,r,l){var u=Di,o=rc.transition;rc.transition=null;try{Di=1,Pv(e,t,r,l)}finally{Di=u,rc.transition=o}}function x4(e,t,r,l){var u=Di,o=rc.transition;rc.transition=null;try{Di=4,Pv(e,t,r,l)}finally{Di=u,rc.transition=o}}function Pv(e,t,r,l){if($f){var u=Hy(e,t,r,l);if(u===null)yy(e,t,l,Yf,r),Fb(e,l);else if(g4(u,e,t,r,l))l.stopPropagation();else if(Fb(e,l),t&4&&-1<m4.indexOf(e)){for(;u!==null;){var o=kd(u);if(o!==null&&sw(o),o=Hy(e,t,r,l),o===null&&yy(e,t,l,Yf,r),o===u)break;u=o}u!==null&&l.stopPropagation()}else yy(e,t,l,null,r)}}var Yf=null;function Hy(e,t,r,l){if(Yf=null,e=Mv(l),e=El(e),e!==null)if(t=Fl(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Q2(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yf=e,null}function hw(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(s4()){case Ev:return 1;case iw:return 4;case Hf:case a4:return 16;case rw:return 536870912;default:return 16}default:return 16}}var za=null,kv=null,Rf=null;function dw(){if(Rf)return Rf;var e,t=kv,r=t.length,l,u="value"in za?za.value:za.textContent,o=u.length;for(e=0;e<r&&t[e]===u[e];e++);var m=r-e;for(l=1;l<=m&&t[r-l]===u[o-l];l++);return Rf=u.slice(e,1<l?1-l:void 0)}function Df(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _f(){return!0}function Gb(){return!1}function po(e){function t(r,l,u,o,m){this._reactName=r,this._targetInst=u,this.type=l,this.nativeEvent=o,this.target=m,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(r=e[v],this[v]=r?r(o):o[v]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?_f:Gb,this.isPropagationStopped=Gb,this}return fr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=_f)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=_f)},persist:function(){},isPersistent:_f}),t}var pc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zv=po(pc),Pd=fr({},pc,{view:0,detail:0}),_4=po(Pd),hy,dy,$h,fm=fr({},Pd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==$h&&($h&&e.type==="mousemove"?(hy=e.screenX-$h.screenX,dy=e.screenY-$h.screenY):dy=hy=0,$h=e),hy)},movementY:function(e){return"movementY"in e?e.movementY:dy}}),Vb=po(fm),b4=fr({},fm,{dataTransfer:0}),w4=po(b4),I4=fr({},Pd,{relatedTarget:0}),py=po(I4),S4=fr({},pc,{animationName:0,elapsedTime:0,pseudoElement:0}),C4=po(S4),M4=fr({},pc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),E4=po(M4),A4=fr({},pc,{data:0}),Ub=po(A4),T4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},P4={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},k4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function z4(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=k4[e])?!!t[e]:!1}function Lv(){return z4}var L4=fr({},Pd,{key:function(e){if(e.key){var t=T4[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Df(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?P4[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lv,charCode:function(e){return e.type==="keypress"?Df(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Df(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),R4=po(L4),D4=fr({},fm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wb=po(D4),B4=fr({},Pd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lv}),N4=po(B4),F4=fr({},pc,{propertyName:0,elapsedTime:0,pseudoElement:0}),O4=po(F4),G4=fr({},fm,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),V4=po(G4),U4=[9,13,27,32],Rv=Vs&&"CompositionEvent"in window,od=null;Vs&&"documentMode"in document&&(od=document.documentMode);var W4=Vs&&"TextEvent"in window&&!od,pw=Vs&&(!Rv||od&&8<od&&11>=od),Zb=String.fromCharCode(32),jb=!1;function fw(e,t){switch(e){case"keyup":return U4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zu=!1;function Z4(e,t){switch(e){case"compositionend":return mw(t);case"keypress":return t.which!==32?null:(jb=!0,Zb);case"textInput":return e=t.data,e===Zb&&jb?null:e;default:return null}}function j4(e,t){if(Zu)return e==="compositionend"||!Rv&&fw(e,t)?(e=dw(),Rf=kv=za=null,Zu=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return pw&&t.locale!=="ko"?null:t.data;default:return null}}var H4={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!H4[e.type]:t==="textarea"}function gw(e,t,r,l){X2(l),t=qf(t,"onChange"),0<t.length&&(r=new zv("onChange","change",null,r,l),e.push({event:r,listeners:t}))}var sd=null,vd=null;function X4(e){Ew(e,0)}function mm(e){var t=Xu(e);if(G2(t))return e}function $4(e,t){if(e==="change")return t}var yw=!1;Vs&&(Vs?(wf="oninput"in document,wf||(fy=document.createElement("div"),fy.setAttribute("oninput","return;"),wf=typeof fy.oninput=="function"),bf=wf):bf=!1,yw=bf&&(!document.documentMode||9<document.documentMode));var bf,wf,fy;function Xb(){sd&&(sd.detachEvent("onpropertychange",vw),vd=sd=null)}function vw(e){if(e.propertyName==="value"&&mm(vd)){var t=[];gw(t,vd,e,Mv(e)),J2(X4,t)}}function Y4(e,t,r){e==="focusin"?(Xb(),sd=t,vd=r,sd.attachEvent("onpropertychange",vw)):e==="focusout"&&Xb()}function q4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mm(vd)}function J4(e,t){if(e==="click")return mm(t)}function Q4(e,t){if(e==="input"||e==="change")return mm(t)}function K4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ho=typeof Object.is=="function"?Object.is:K4;function xd(e,t){if(Ho(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),l=Object.keys(t);if(r.length!==l.length)return!1;for(l=0;l<r.length;l++){var u=r[l];if(!Ay.call(t,u)||!Ho(e[u],t[u]))return!1}return!0}function $b(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yb(e,t){var r=$b(e);e=0;for(var l;r;){if(r.nodeType===3){if(l=e+r.textContent.length,e<=t&&l>=t)return{node:r,offset:t-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=$b(r)}}function xw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _w(){for(var e=window,t=Wf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Wf(e.document)}return t}function Dv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function eP(e){var t=_w(),r=e.focusedElem,l=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&xw(r.ownerDocument.documentElement,r)){if(l!==null&&Dv(r)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=r.textContent.length,o=Math.min(l.start,u);l=l.end===void 0?o:Math.min(l.end,u),!e.extend&&o>l&&(u=l,l=o,o=u),u=Yb(r,o);var m=Yb(r,l);u&&m&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==m.node||e.focusOffset!==m.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),o>l?(e.addRange(t),e.extend(m.node,m.offset)):(t.setEnd(m.node,m.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tP=Vs&&"documentMode"in document&&11>=document.documentMode,ju=null,Xy=null,ad=null,$y=!1;function qb(e,t,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;$y||ju==null||ju!==Wf(l)||(l=ju,"selectionStart"in l&&Dv(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ad&&xd(ad,l)||(ad=l,l=qf(Xy,"onSelect"),0<l.length&&(t=new zv("onSelect","select",null,t,r),e.push({event:t,listeners:l}),t.target=ju)))}function If(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Hu={animationend:If("Animation","AnimationEnd"),animationiteration:If("Animation","AnimationIteration"),animationstart:If("Animation","AnimationStart"),transitionend:If("Transition","TransitionEnd")},my={},bw={};Vs&&(bw=document.createElement("div").style,"AnimationEvent"in window||(delete Hu.animationend.animation,delete Hu.animationiteration.animation,delete Hu.animationstart.animation),"TransitionEvent"in window||delete Hu.transitionend.transition);function gm(e){if(my[e])return my[e];if(!Hu[e])return e;var t=Hu[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in bw)return my[e]=t[r];return e}var ww=gm("animationend"),Iw=gm("animationiteration"),Sw=gm("animationstart"),Cw=gm("transitionend"),Mw=new Map,Jb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Za(e,t){Mw.set(e,t),Nl(t,[e])}for(Sf=0;Sf<Jb.length;Sf++)Cf=Jb[Sf],Qb=Cf.toLowerCase(),Kb=Cf[0].toUpperCase()+Cf.slice(1),Za(Qb,"on"+Kb);var Cf,Qb,Kb,Sf;Za(ww,"onAnimationEnd");Za(Iw,"onAnimationIteration");Za(Sw,"onAnimationStart");Za("dblclick","onDoubleClick");Za("focusin","onFocus");Za("focusout","onBlur");Za(Cw,"onTransitionEnd");sc("onMouseEnter",["mouseout","mouseover"]);sc("onMouseLeave",["mouseout","mouseover"]);sc("onPointerEnter",["pointerout","pointerover"]);sc("onPointerLeave",["pointerout","pointerover"]);Nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Nl("onBeforeInput",["compositionend","keypress","textInput","paste"]);Nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var id="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),iP=new Set("cancel close invalid load scroll toggle".split(" ").concat(id));function e2(e,t,r){var l=e.type||"unknown-event";e.currentTarget=r,i4(l,t,void 0,e),e.currentTarget=null}function Ew(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var l=e[r],u=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var m=l.length-1;0<=m;m--){var v=l[m],b=v.instance,C=v.currentTarget;if(v=v.listener,b!==o&&u.isPropagationStopped())break e;e2(u,v,C),o=b}else for(m=0;m<l.length;m++){if(v=l[m],b=v.instance,C=v.currentTarget,v=v.listener,b!==o&&u.isPropagationStopped())break e;e2(u,v,C),o=b}}}if(jf)throw e=Wy,jf=!1,Wy=null,e}function Ki(e,t){var r=t[Ky];r===void 0&&(r=t[Ky]=new Set);var l=e+"__bubble";r.has(l)||(Aw(t,e,2,!1),r.add(l))}function gy(e,t,r){var l=0;t&&(l|=4),Aw(r,e,l,t)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function _d(e){if(!e[Mf]){e[Mf]=!0,D2.forEach(function(r){r!=="selectionchange"&&(iP.has(r)||gy(r,!1,e),gy(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mf]||(t[Mf]=!0,gy("selectionchange",!1,t))}}function Aw(e,t,r,l){switch(hw(t)){case 1:var u=v4;break;case 4:u=x4;break;default:u=Pv}r=u.bind(null,t,r,e),u=void 0,!Uy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),l?u!==void 0?e.addEventListener(t,r,{capture:!0,passive:u}):e.addEventListener(t,r,!0):u!==void 0?e.addEventListener(t,r,{passive:u}):e.addEventListener(t,r,!1)}function yy(e,t,r,l,u){var o=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var v=l.stateNode.containerInfo;if(v===u||v.nodeType===8&&v.parentNode===u)break;if(m===4)for(m=l.return;m!==null;){var b=m.tag;if((b===3||b===4)&&(b=m.stateNode.containerInfo,b===u||b.nodeType===8&&b.parentNode===u))return;m=m.return}for(;v!==null;){if(m=El(v),m===null)return;if(b=m.tag,b===5||b===6){l=o=m;continue e}v=v.parentNode}}l=l.return}J2(function(){var C=o,A=Mv(r),B=[];e:{var Z=Mw.get(e);if(Z!==void 0){var q=zv,ee=e;switch(e){case"keypress":if(Df(r)===0)break e;case"keydown":case"keyup":q=R4;break;case"focusin":ee="focus",q=py;break;case"focusout":ee="blur",q=py;break;case"beforeblur":case"afterblur":q=py;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Vb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=w4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=N4;break;case ww:case Iw:case Sw:q=C4;break;case Cw:q=O4;break;case"scroll":q=_4;break;case"wheel":q=V4;break;case"copy":case"cut":case"paste":q=E4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=Wb}var le=(t&4)!==0,de=!le&&e==="scroll",H=le?Z!==null?Z+"Capture":null:Z;le=[];for(var Q=C,te;Q!==null;){te=Q;var ve=te.stateNode;if(te.tag===5&&ve!==null&&(te=ve,H!==null&&(ve=fd(Q,H),ve!=null&&le.push(bd(Q,ve,te)))),de)break;Q=Q.return}0<le.length&&(Z=new q(Z,ee,null,r,A),B.push({event:Z,listeners:le}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",Z&&r!==Gy&&(ee=r.relatedTarget||r.fromElement)&&(El(ee)||ee[Us]))break e;if((q||Z)&&(Z=A.window===A?A:(Z=A.ownerDocument)?Z.defaultView||Z.parentWindow:window,q?(ee=r.relatedTarget||r.toElement,q=C,ee=ee?El(ee):null,ee!==null&&(de=Fl(ee),ee!==de||ee.tag!==5&&ee.tag!==6)&&(ee=null)):(q=null,ee=C),q!==ee)){if(le=Vb,ve="onMouseLeave",H="onMouseEnter",Q="mouse",(e==="pointerout"||e==="pointerover")&&(le=Wb,ve="onPointerLeave",H="onPointerEnter",Q="pointer"),de=q==null?Z:Xu(q),te=ee==null?Z:Xu(ee),Z=new le(ve,Q+"leave",q,r,A),Z.target=de,Z.relatedTarget=te,ve=null,El(A)===C&&(le=new le(H,Q+"enter",ee,r,A),le.target=te,le.relatedTarget=de,ve=le),de=ve,q&&ee)t:{for(le=q,H=ee,Q=0,te=le;te;te=Vu(te))Q++;for(te=0,ve=H;ve;ve=Vu(ve))te++;for(;0<Q-te;)le=Vu(le),Q--;for(;0<te-Q;)H=Vu(H),te--;for(;Q--;){if(le===H||H!==null&&le===H.alternate)break t;le=Vu(le),H=Vu(H)}le=null}else le=null;q!==null&&t2(B,Z,q,le,!1),ee!==null&&de!==null&&t2(B,de,ee,le,!0)}}e:{if(Z=C?Xu(C):window,q=Z.nodeName&&Z.nodeName.toLowerCase(),q==="select"||q==="input"&&Z.type==="file")var Ce=$4;else if(Hb(Z))if(yw)Ce=Q4;else{Ce=q4;var Se=Y4}else(q=Z.nodeName)&&q.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(Ce=J4);if(Ce&&(Ce=Ce(e,C))){gw(B,Ce,r,A);break e}Se&&Se(e,Z,C),e==="focusout"&&(Se=Z._wrapperState)&&Se.controlled&&Z.type==="number"&&Dy(Z,"number",Z.value)}switch(Se=C?Xu(C):window,e){case"focusin":(Hb(Se)||Se.contentEditable==="true")&&(ju=Se,Xy=C,ad=null);break;case"focusout":ad=Xy=ju=null;break;case"mousedown":$y=!0;break;case"contextmenu":case"mouseup":case"dragend":$y=!1,qb(B,r,A);break;case"selectionchange":if(tP)break;case"keydown":case"keyup":qb(B,r,A)}var Be;if(Rv)e:{switch(e){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else Zu?fw(e,r)&&(Fe="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Fe="onCompositionStart");Fe&&(pw&&r.locale!=="ko"&&(Zu||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&Zu&&(Be=dw()):(za=A,kv="value"in za?za.value:za.textContent,Zu=!0)),Se=qf(C,Fe),0<Se.length&&(Fe=new Ub(Fe,e,null,r,A),B.push({event:Fe,listeners:Se}),Be?Fe.data=Be:(Be=mw(r),Be!==null&&(Fe.data=Be)))),(Be=W4?Z4(e,r):j4(e,r))&&(C=qf(C,"onBeforeInput"),0<C.length&&(A=new Ub("onBeforeInput","beforeinput",null,r,A),B.push({event:A,listeners:C}),A.data=Be))}Ew(B,t)})}function bd(e,t,r){return{instance:e,listener:t,currentTarget:r}}function qf(e,t){for(var r=t+"Capture",l=[];e!==null;){var u=e,o=u.stateNode;u.tag===5&&o!==null&&(u=o,o=fd(e,r),o!=null&&l.unshift(bd(e,o,u)),o=fd(e,t),o!=null&&l.push(bd(e,o,u))),e=e.return}return l}function Vu(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function t2(e,t,r,l,u){for(var o=t._reactName,m=[];r!==null&&r!==l;){var v=r,b=v.alternate,C=v.stateNode;if(b!==null&&b===l)break;v.tag===5&&C!==null&&(v=C,u?(b=fd(r,o),b!=null&&m.unshift(bd(r,b,v))):u||(b=fd(r,o),b!=null&&m.push(bd(r,b,v)))),r=r.return}m.length!==0&&e.push({event:t,listeners:m})}var rP=/\r\n?/g,nP=/\u0000|\uFFFD/g;function i2(e){return(typeof e=="string"?e:""+e).replace(rP,`
6
+ `).replace(nP,"")}function Ef(e,t,r){if(t=i2(t),i2(e)!==t&&r)throw Error(Qe(425))}function Jf(){}var Yy=null,qy=null;function Jy(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qy=typeof setTimeout=="function"?setTimeout:void 0,oP=typeof clearTimeout=="function"?clearTimeout:void 0,r2=typeof Promise=="function"?Promise:void 0,sP=typeof queueMicrotask=="function"?queueMicrotask:typeof r2<"u"?function(e){return r2.resolve(null).then(e).catch(aP)}:Qy;function aP(e){setTimeout(function(){throw e})}function vy(e,t){var r=t,l=0;do{var u=r.nextSibling;if(e.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"){if(l===0){e.removeChild(u),yd(t);return}l--}else r!=="$"&&r!=="$?"&&r!=="$!"||l++;r=u}while(r);yd(t)}function Na(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function n2(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var fc=Math.random().toString(36).slice(2),os="__reactFiber$"+fc,wd="__reactProps$"+fc,Us="__reactContainer$"+fc,Ky="__reactEvents$"+fc,lP="__reactListeners$"+fc,uP="__reactHandles$"+fc;function El(e){var t=e[os];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Us]||r[os]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=n2(e);e!==null;){if(r=e[os])return r;e=n2(e)}return t}e=r,r=e.parentNode}return null}function kd(e){return e=e[os]||e[Us],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xu(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Qe(33))}function ym(e){return e[wd]||null}var ev=[],$u=-1;function ja(e){return{current:e}}function er(e){0>$u||(e.current=ev[$u],ev[$u]=null,$u--)}function qi(e,t){$u++,ev[$u]=e.current,e.current=t}var Wa={},bn=ja(Wa),qn=ja(!1),zl=Wa;function ac(e,t){var r=e.type.contextTypes;if(!r)return Wa;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var u={},o;for(o in r)u[o]=t[o];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function Jn(e){return e=e.childContextTypes,e!=null}function Qf(){er(qn),er(bn)}function o2(e,t,r){if(bn.current!==Wa)throw Error(Qe(168));qi(bn,t),qi(qn,r)}function Tw(e,t,r){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return r;l=l.getChildContext();for(var u in l)if(!(u in t))throw Error(Qe(108,Y3(e)||"Unknown",u));return fr({},r,l)}function Kf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wa,zl=bn.current,qi(bn,e),qi(qn,qn.current),!0}function s2(e,t,r){var l=e.stateNode;if(!l)throw Error(Qe(169));r?(e=Tw(e,t,zl),l.__reactInternalMemoizedMergedChildContext=e,er(qn),er(bn),qi(bn,e)):er(qn),qi(qn,r)}var Ns=null,vm=!1,xy=!1;function Pw(e){Ns===null?Ns=[e]:Ns.push(e)}function cP(e){vm=!0,Pw(e)}function Ha(){if(!xy&&Ns!==null){xy=!0;var e=0,t=Di;try{var r=Ns;for(Di=1;e<r.length;e++){var l=r[e];do l=l(!0);while(l!==null)}Ns=null,vm=!1}catch(u){throw Ns!==null&&(Ns=Ns.slice(e+1)),tw(Ev,Ha),u}finally{Di=t,xy=!1}}return null}var Yu=[],qu=0,em=null,tm=0,Eo=[],Ao=0,Ll=null,Fs=1,Os="";function Cl(e,t){Yu[qu++]=tm,Yu[qu++]=em,em=e,tm=t}function kw(e,t,r){Eo[Ao++]=Fs,Eo[Ao++]=Os,Eo[Ao++]=Ll,Ll=e;var l=Fs;e=Os;var u=32-Zo(l)-1;l&=~(1<<u),r+=1;var o=32-Zo(t)+u;if(30<o){var m=u-u%5;o=(l&(1<<m)-1).toString(32),l>>=m,u-=m,Fs=1<<32-Zo(t)+u|r<<u|l,Os=o+e}else Fs=1<<o|r<<u|l,Os=e}function Bv(e){e.return!==null&&(Cl(e,1),kw(e,1,0))}function Nv(e){for(;e===em;)em=Yu[--qu],Yu[qu]=null,tm=Yu[--qu],Yu[qu]=null;for(;e===Ll;)Ll=Eo[--Ao],Eo[Ao]=null,Os=Eo[--Ao],Eo[Ao]=null,Fs=Eo[--Ao],Eo[Ao]=null}var co=null,uo=null,ar=!1,Wo=null;function zw(e,t){var r=To(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function a2(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,co=e,uo=Na(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,co=e,uo=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ll!==null?{id:Fs,overflow:Os}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=To(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,co=e,uo=null,!0):!1;default:return!1}}function tv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function iv(e){if(ar){var t=uo;if(t){var r=t;if(!a2(e,t)){if(tv(e))throw Error(Qe(418));t=Na(r.nextSibling);var l=co;t&&a2(e,t)?zw(l,r):(e.flags=e.flags&-4097|2,ar=!1,co=e)}}else{if(tv(e))throw Error(Qe(418));e.flags=e.flags&-4097|2,ar=!1,co=e}}}function l2(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;co=e}function Af(e){if(e!==co)return!1;if(!ar)return l2(e),ar=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Jy(e.type,e.memoizedProps)),t&&(t=uo)){if(tv(e))throw Lw(),Error(Qe(418));for(;t;)zw(e,t),t=Na(t.nextSibling)}if(l2(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Qe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){uo=Na(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}uo=null}}else uo=co?Na(e.stateNode.nextSibling):null;return!0}function Lw(){for(var e=uo;e;)e=Na(e.nextSibling)}function lc(){uo=co=null,ar=!1}function Fv(e){Wo===null?Wo=[e]:Wo.push(e)}var hP=js.ReactCurrentBatchConfig;function Vo(e,t){if(e&&e.defaultProps){t=fr({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var im=ja(null),rm=null,Ju=null,Ov=null;function Gv(){Ov=Ju=rm=null}function Vv(e){var t=im.current;er(im),e._currentValue=t}function rv(e,t,r){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===r)break;e=e.return}}function nc(e,t){rm=e,Ov=Ju=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Yn=!0),e.firstContext=null)}function ko(e){var t=e._currentValue;if(Ov!==e)if(e={context:e,memoizedValue:t,next:null},Ju===null){if(rm===null)throw Error(Qe(308));Ju=e,rm.dependencies={lanes:0,firstContext:e}}else Ju=Ju.next=e;return t}var Al=null;function Uv(e){Al===null?Al=[e]:Al.push(e)}function Rw(e,t,r,l){var u=t.interleaved;return u===null?(r.next=r,Uv(t)):(r.next=u.next,u.next=r),t.interleaved=r,Ws(e,l)}function Ws(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ta=!1;function Wv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Dw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Gs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(wi&2)!==0){var u=l.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),l.pending=t,Ws(e,r)}return u=l.interleaved,u===null?(t.next=t,Uv(l)):(t.next=u.next,u.next=t),l.interleaved=t,Ws(e,r)}function Bf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,Av(e,r)}}function u2(e,t){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var u=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var m={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?u=o=m:o=o.next=m,r=r.next}while(r!==null);o===null?u=o=t:o=o.next=t}else u=o=t;r={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:o,shared:l.shared,effects:l.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function nm(e,t,r,l){var u=e.updateQueue;Ta=!1;var o=u.firstBaseUpdate,m=u.lastBaseUpdate,v=u.shared.pending;if(v!==null){u.shared.pending=null;var b=v,C=b.next;b.next=null,m===null?o=C:m.next=C,m=b;var A=e.alternate;A!==null&&(A=A.updateQueue,v=A.lastBaseUpdate,v!==m&&(v===null?A.firstBaseUpdate=C:v.next=C,A.lastBaseUpdate=b))}if(o!==null){var B=u.baseState;m=0,A=C=b=null,v=o;do{var Z=v.lane,q=v.eventTime;if((l&Z)===Z){A!==null&&(A=A.next={eventTime:q,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var ee=e,le=v;switch(Z=t,q=r,le.tag){case 1:if(ee=le.payload,typeof ee=="function"){B=ee.call(q,B,Z);break e}B=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=le.payload,Z=typeof ee=="function"?ee.call(q,B,Z):ee,Z==null)break e;B=fr({},B,Z);break e;case 2:Ta=!0}}v.callback!==null&&v.lane!==0&&(e.flags|=64,Z=u.effects,Z===null?u.effects=[v]:Z.push(v))}else q={eventTime:q,lane:Z,tag:v.tag,payload:v.payload,callback:v.callback,next:null},A===null?(C=A=q,b=B):A=A.next=q,m|=Z;if(v=v.next,v===null){if(v=u.shared.pending,v===null)break;Z=v,v=Z.next,Z.next=null,u.lastBaseUpdate=Z,u.shared.pending=null}}while(1);if(A===null&&(b=B),u.baseState=b,u.firstBaseUpdate=C,u.lastBaseUpdate=A,t=u.shared.interleaved,t!==null){u=t;do m|=u.lane,u=u.next;while(u!==t)}else o===null&&(u.shared.lanes=0);Dl|=m,e.lanes=m,e.memoizedState=B}}function c2(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],u=l.callback;if(u!==null){if(l.callback=null,l=r,typeof u!="function")throw Error(Qe(191,u));u.call(l)}}}var Bw=new R2.Component().refs;function nv(e,t,r,l){t=e.memoizedState,r=r(l,t),r=r==null?t:fr({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var xm={isMounted:function(e){return(e=e._reactInternals)?Fl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var l=Bn(),u=Ga(e),o=Gs(l,u);o.payload=t,r!=null&&(o.callback=r),t=Fa(e,o,u),t!==null&&(jo(t,e,u,l),Bf(t,e,u))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var l=Bn(),u=Ga(e),o=Gs(l,u);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=Fa(e,o,u),t!==null&&(jo(t,e,u,l),Bf(t,e,u))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Bn(),l=Ga(e),u=Gs(r,l);u.tag=2,t!=null&&(u.callback=t),t=Fa(e,u,l),t!==null&&(jo(t,e,l,r),Bf(t,e,l))}};function h2(e,t,r,l,u,o,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,m):t.prototype&&t.prototype.isPureReactComponent?!xd(r,l)||!xd(u,o):!0}function Nw(e,t,r){var l=!1,u=Wa,o=t.contextType;return typeof o=="object"&&o!==null?o=ko(o):(u=Jn(t)?zl:bn.current,l=t.contextTypes,o=(l=l!=null)?ac(e,u):Wa),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xm,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=u,e.__reactInternalMemoizedMaskedChildContext=o),t}function d2(e,t,r,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,l),t.state!==e&&xm.enqueueReplaceState(t,t.state,null)}function ov(e,t,r,l){var u=e.stateNode;u.props=r,u.state=e.memoizedState,u.refs=Bw,Wv(e);var o=t.contextType;typeof o=="object"&&o!==null?u.context=ko(o):(o=Jn(t)?zl:bn.current,u.context=ac(e,o)),u.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(nv(e,t,o,r),u.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(t=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),t!==u.state&&xm.enqueueReplaceState(u,u.state,null),nm(e,r,u,l),u.state=e.memoizedState),typeof u.componentDidMount=="function"&&(e.flags|=4194308)}function Yh(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Qe(309));var l=r.stateNode}if(!l)throw Error(Qe(147,e));var u=l,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(m){var v=u.refs;v===Bw&&(v=u.refs={}),m===null?delete v[o]:v[o]=m},t._stringRef=o,t)}if(typeof e!="string")throw Error(Qe(284));if(!r._owner)throw Error(Qe(290,e))}return e}function Tf(e,t){throw e=Object.prototype.toString.call(t),Error(Qe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function p2(e){var t=e._init;return t(e._payload)}function Fw(e){function t(H,Q){if(e){var te=H.deletions;te===null?(H.deletions=[Q],H.flags|=16):te.push(Q)}}function r(H,Q){if(!e)return null;for(;Q!==null;)t(H,Q),Q=Q.sibling;return null}function l(H,Q){for(H=new Map;Q!==null;)Q.key!==null?H.set(Q.key,Q):H.set(Q.index,Q),Q=Q.sibling;return H}function u(H,Q){return H=Va(H,Q),H.index=0,H.sibling=null,H}function o(H,Q,te){return H.index=te,e?(te=H.alternate,te!==null?(te=te.index,te<Q?(H.flags|=2,Q):te):(H.flags|=2,Q)):(H.flags|=1048576,Q)}function m(H){return e&&H.alternate===null&&(H.flags|=2),H}function v(H,Q,te,ve){return Q===null||Q.tag!==6?(Q=My(te,H.mode,ve),Q.return=H,Q):(Q=u(Q,te),Q.return=H,Q)}function b(H,Q,te,ve){var Ce=te.type;return Ce===Wu?A(H,Q,te.props.children,ve,te.key):Q!==null&&(Q.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===Aa&&p2(Ce)===Q.type)?(ve=u(Q,te.props),ve.ref=Yh(H,Q,te),ve.return=H,ve):(ve=Uf(te.type,te.key,te.props,null,H.mode,ve),ve.ref=Yh(H,Q,te),ve.return=H,ve)}function C(H,Q,te,ve){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==te.containerInfo||Q.stateNode.implementation!==te.implementation?(Q=Ey(te,H.mode,ve),Q.return=H,Q):(Q=u(Q,te.children||[]),Q.return=H,Q)}function A(H,Q,te,ve,Ce){return Q===null||Q.tag!==7?(Q=kl(te,H.mode,ve,Ce),Q.return=H,Q):(Q=u(Q,te),Q.return=H,Q)}function B(H,Q,te){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=My(""+Q,H.mode,te),Q.return=H,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case ff:return te=Uf(Q.type,Q.key,Q.props,null,H.mode,te),te.ref=Yh(H,null,Q),te.return=H,te;case Uu:return Q=Ey(Q,H.mode,te),Q.return=H,Q;case Aa:var ve=Q._init;return B(H,ve(Q._payload),te)}if(ed(Q)||jh(Q))return Q=kl(Q,H.mode,te,null),Q.return=H,Q;Tf(H,Q)}return null}function Z(H,Q,te,ve){var Ce=Q!==null?Q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Ce!==null?null:v(H,Q,""+te,ve);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case ff:return te.key===Ce?b(H,Q,te,ve):null;case Uu:return te.key===Ce?C(H,Q,te,ve):null;case Aa:return Ce=te._init,Z(H,Q,Ce(te._payload),ve)}if(ed(te)||jh(te))return Ce!==null?null:A(H,Q,te,ve,null);Tf(H,te)}return null}function q(H,Q,te,ve,Ce){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return H=H.get(te)||null,v(Q,H,""+ve,Ce);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case ff:return H=H.get(ve.key===null?te:ve.key)||null,b(Q,H,ve,Ce);case Uu:return H=H.get(ve.key===null?te:ve.key)||null,C(Q,H,ve,Ce);case Aa:var Se=ve._init;return q(H,Q,te,Se(ve._payload),Ce)}if(ed(ve)||jh(ve))return H=H.get(te)||null,A(Q,H,ve,Ce,null);Tf(Q,ve)}return null}function ee(H,Q,te,ve){for(var Ce=null,Se=null,Be=Q,Fe=Q=0,qe=null;Be!==null&&Fe<te.length;Fe++){Be.index>Fe?(qe=Be,Be=null):qe=Be.sibling;var ht=Z(H,Be,te[Fe],ve);if(ht===null){Be===null&&(Be=qe);break}e&&Be&&ht.alternate===null&&t(H,Be),Q=o(ht,Q,Fe),Se===null?Ce=ht:Se.sibling=ht,Se=ht,Be=qe}if(Fe===te.length)return r(H,Be),ar&&Cl(H,Fe),Ce;if(Be===null){for(;Fe<te.length;Fe++)Be=B(H,te[Fe],ve),Be!==null&&(Q=o(Be,Q,Fe),Se===null?Ce=Be:Se.sibling=Be,Se=Be);return ar&&Cl(H,Fe),Ce}for(Be=l(H,Be);Fe<te.length;Fe++)qe=q(Be,H,Fe,te[Fe],ve),qe!==null&&(e&&qe.alternate!==null&&Be.delete(qe.key===null?Fe:qe.key),Q=o(qe,Q,Fe),Se===null?Ce=qe:Se.sibling=qe,Se=qe);return e&&Be.forEach(function(At){return t(H,At)}),ar&&Cl(H,Fe),Ce}function le(H,Q,te,ve){var Ce=jh(te);if(typeof Ce!="function")throw Error(Qe(150));if(te=Ce.call(te),te==null)throw Error(Qe(151));for(var Se=Ce=null,Be=Q,Fe=Q=0,qe=null,ht=te.next();Be!==null&&!ht.done;Fe++,ht=te.next()){Be.index>Fe?(qe=Be,Be=null):qe=Be.sibling;var At=Z(H,Be,ht.value,ve);if(At===null){Be===null&&(Be=qe);break}e&&Be&&At.alternate===null&&t(H,Be),Q=o(At,Q,Fe),Se===null?Ce=At:Se.sibling=At,Se=At,Be=qe}if(ht.done)return r(H,Be),ar&&Cl(H,Fe),Ce;if(Be===null){for(;!ht.done;Fe++,ht=te.next())ht=B(H,ht.value,ve),ht!==null&&(Q=o(ht,Q,Fe),Se===null?Ce=ht:Se.sibling=ht,Se=ht);return ar&&Cl(H,Fe),Ce}for(Be=l(H,Be);!ht.done;Fe++,ht=te.next())ht=q(Be,H,Fe,ht.value,ve),ht!==null&&(e&&ht.alternate!==null&&Be.delete(ht.key===null?Fe:ht.key),Q=o(ht,Q,Fe),Se===null?Ce=ht:Se.sibling=ht,Se=ht);return e&&Be.forEach(function(Ot){return t(H,Ot)}),ar&&Cl(H,Fe),Ce}function de(H,Q,te,ve){if(typeof te=="object"&&te!==null&&te.type===Wu&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case ff:e:{for(var Ce=te.key,Se=Q;Se!==null;){if(Se.key===Ce){if(Ce=te.type,Ce===Wu){if(Se.tag===7){r(H,Se.sibling),Q=u(Se,te.props.children),Q.return=H,H=Q;break e}}else if(Se.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===Aa&&p2(Ce)===Se.type){r(H,Se.sibling),Q=u(Se,te.props),Q.ref=Yh(H,Se,te),Q.return=H,H=Q;break e}r(H,Se);break}else t(H,Se);Se=Se.sibling}te.type===Wu?(Q=kl(te.props.children,H.mode,ve,te.key),Q.return=H,H=Q):(ve=Uf(te.type,te.key,te.props,null,H.mode,ve),ve.ref=Yh(H,Q,te),ve.return=H,H=ve)}return m(H);case Uu:e:{for(Se=te.key;Q!==null;){if(Q.key===Se)if(Q.tag===4&&Q.stateNode.containerInfo===te.containerInfo&&Q.stateNode.implementation===te.implementation){r(H,Q.sibling),Q=u(Q,te.children||[]),Q.return=H,H=Q;break e}else{r(H,Q);break}else t(H,Q);Q=Q.sibling}Q=Ey(te,H.mode,ve),Q.return=H,H=Q}return m(H);case Aa:return Se=te._init,de(H,Q,Se(te._payload),ve)}if(ed(te))return ee(H,Q,te,ve);if(jh(te))return le(H,Q,te,ve);Tf(H,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,Q!==null&&Q.tag===6?(r(H,Q.sibling),Q=u(Q,te),Q.return=H,H=Q):(r(H,Q),Q=My(te,H.mode,ve),Q.return=H,H=Q),m(H)):r(H,Q)}return de}var uc=Fw(!0),Ow=Fw(!1),zd={},as=ja(zd),Id=ja(zd),Sd=ja(zd);function Tl(e){if(e===zd)throw Error(Qe(174));return e}function Zv(e,t){switch(qi(Sd,t),qi(Id,e),qi(as,zd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ny(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ny(t,e)}er(as),qi(as,t)}function cc(){er(as),er(Id),er(Sd)}function Gw(e){Tl(Sd.current);var t=Tl(as.current),r=Ny(t,e.type);t!==r&&(qi(Id,e),qi(as,r))}function jv(e){Id.current===e&&(er(as),er(Id))}var dr=ja(0);function om(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _y=[];function Hv(){for(var e=0;e<_y.length;e++)_y[e]._workInProgressVersionPrimary=null;_y.length=0}var Nf=js.ReactCurrentDispatcher,by=js.ReactCurrentBatchConfig,Rl=0,pr=null,Gr=null,Jr=null,sm=!1,ld=!1,Cd=0,dP=0;function vn(){throw Error(Qe(321))}function Xv(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ho(e[r],t[r]))return!1;return!0}function $v(e,t,r,l,u,o){if(Rl=o,pr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Nf.current=e===null||e.memoizedState===null?gP:yP,e=r(l,u),ld){o=0;do{if(ld=!1,Cd=0,25<=o)throw Error(Qe(301));o+=1,Jr=Gr=null,t.updateQueue=null,Nf.current=vP,e=r(l,u)}while(ld)}if(Nf.current=am,t=Gr!==null&&Gr.next!==null,Rl=0,Jr=Gr=pr=null,sm=!1,t)throw Error(Qe(300));return e}function Yv(){var e=Cd!==0;return Cd=0,e}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jr===null?pr.memoizedState=Jr=e:Jr=Jr.next=e,Jr}function zo(){if(Gr===null){var e=pr.alternate;e=e!==null?e.memoizedState:null}else e=Gr.next;var t=Jr===null?pr.memoizedState:Jr.next;if(t!==null)Jr=t,Gr=e;else{if(e===null)throw Error(Qe(310));Gr=e,e={memoizedState:Gr.memoizedState,baseState:Gr.baseState,baseQueue:Gr.baseQueue,queue:Gr.queue,next:null},Jr===null?pr.memoizedState=Jr=e:Jr=Jr.next=e}return Jr}function Md(e,t){return typeof t=="function"?t(e):t}function wy(e){var t=zo(),r=t.queue;if(r===null)throw Error(Qe(311));r.lastRenderedReducer=e;var l=Gr,u=l.baseQueue,o=r.pending;if(o!==null){if(u!==null){var m=u.next;u.next=o.next,o.next=m}l.baseQueue=u=o,r.pending=null}if(u!==null){o=u.next,l=l.baseState;var v=m=null,b=null,C=o;do{var A=C.lane;if((Rl&A)===A)b!==null&&(b=b.next={lane:0,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),l=C.hasEagerState?C.eagerState:e(l,C.action);else{var B={lane:A,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null};b===null?(v=b=B,m=l):b=b.next=B,pr.lanes|=A,Dl|=A}C=C.next}while(C!==null&&C!==o);b===null?m=l:b.next=v,Ho(l,t.memoizedState)||(Yn=!0),t.memoizedState=l,t.baseState=m,t.baseQueue=b,r.lastRenderedState=l}if(e=r.interleaved,e!==null){u=e;do o=u.lane,pr.lanes|=o,Dl|=o,u=u.next;while(u!==e)}else u===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Iy(e){var t=zo(),r=t.queue;if(r===null)throw Error(Qe(311));r.lastRenderedReducer=e;var l=r.dispatch,u=r.pending,o=t.memoizedState;if(u!==null){r.pending=null;var m=u=u.next;do o=e(o,m.action),m=m.next;while(m!==u);Ho(o,t.memoizedState)||(Yn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,l]}function Vw(){}function Uw(e,t){var r=pr,l=zo(),u=t(),o=!Ho(l.memoizedState,u);if(o&&(l.memoizedState=u,Yn=!0),l=l.queue,qv(jw.bind(null,r,l,e),[e]),l.getSnapshot!==t||o||Jr!==null&&Jr.memoizedState.tag&1){if(r.flags|=2048,Ed(9,Zw.bind(null,r,l,u,t),void 0,null),Qr===null)throw Error(Qe(349));(Rl&30)!==0||Ww(r,t,u)}return u}function Ww(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=pr.updateQueue,t===null?(t={lastEffect:null,stores:null},pr.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Zw(e,t,r,l){t.value=r,t.getSnapshot=l,Hw(t)&&Xw(e)}function jw(e,t,r){return r(function(){Hw(t)&&Xw(e)})}function Hw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ho(e,r)}catch{return!0}}function Xw(e){var t=Ws(e,1);t!==null&&jo(t,e,1,-1)}function f2(e){var t=ns();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Md,lastRenderedState:e},t.queue=e,e=e.dispatch=mP.bind(null,pr,e),[t.memoizedState,e]}function Ed(e,t,r,l){return e={tag:e,create:t,destroy:r,deps:l,next:null},t=pr.updateQueue,t===null?(t={lastEffect:null,stores:null},pr.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(l=r.next,r.next=e,e.next=l,t.lastEffect=e)),e}function $w(){return zo().memoizedState}function Ff(e,t,r,l){var u=ns();pr.flags|=e,u.memoizedState=Ed(1|t,r,void 0,l===void 0?null:l)}function _m(e,t,r,l){var u=zo();l=l===void 0?null:l;var o=void 0;if(Gr!==null){var m=Gr.memoizedState;if(o=m.destroy,l!==null&&Xv(l,m.deps)){u.memoizedState=Ed(t,r,o,l);return}}pr.flags|=e,u.memoizedState=Ed(1|t,r,o,l)}function m2(e,t){return Ff(8390656,8,e,t)}function qv(e,t){return _m(2048,8,e,t)}function Yw(e,t){return _m(4,2,e,t)}function qw(e,t){return _m(4,4,e,t)}function Jw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qw(e,t,r){return r=r!=null?r.concat([e]):null,_m(4,4,Jw.bind(null,t,e),r)}function Jv(){}function Kw(e,t){var r=zo();t=t===void 0?null:t;var l=r.memoizedState;return l!==null&&t!==null&&Xv(t,l[1])?l[0]:(r.memoizedState=[e,t],e)}function eI(e,t){var r=zo();t=t===void 0?null:t;var l=r.memoizedState;return l!==null&&t!==null&&Xv(t,l[1])?l[0]:(e=e(),r.memoizedState=[e,t],e)}function tI(e,t,r){return(Rl&21)===0?(e.baseState&&(e.baseState=!1,Yn=!0),e.memoizedState=r):(Ho(r,t)||(r=nw(),pr.lanes|=r,Dl|=r,e.baseState=!0),t)}function pP(e,t){var r=Di;Di=r!==0&&4>r?r:4,e(!0);var l=by.transition;by.transition={};try{e(!1),t()}finally{Di=r,by.transition=l}}function iI(){return zo().memoizedState}function fP(e,t,r){var l=Ga(e);if(r={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null},rI(e))nI(t,r);else if(r=Rw(e,t,r,l),r!==null){var u=Bn();jo(r,e,l,u),oI(r,t,l)}}function mP(e,t,r){var l=Ga(e),u={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null};if(rI(e))nI(t,u);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,v=o(m,r);if(u.hasEagerState=!0,u.eagerState=v,Ho(v,m)){var b=t.interleaved;b===null?(u.next=u,Uv(t)):(u.next=b.next,b.next=u),t.interleaved=u;return}}catch{}finally{}r=Rw(e,t,u,l),r!==null&&(u=Bn(),jo(r,e,l,u),oI(r,t,l))}}function rI(e){var t=e.alternate;return e===pr||t!==null&&t===pr}function nI(e,t){ld=sm=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function oI(e,t,r){if((r&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,Av(e,r)}}var am={readContext:ko,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},gP={readContext:ko,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:ko,useEffect:m2,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ff(4194308,4,Jw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ff(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ff(4,2,e,t)},useMemo:function(e,t){var r=ns();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var l=ns();return t=r!==void 0?r(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=fP.bind(null,pr,e),[l.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:f2,useDebugValue:Jv,useDeferredValue:function(e){return ns().memoizedState=e},useTransition:function(){var e=f2(!1),t=e[0];return e=pP.bind(null,e[1]),ns().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var l=pr,u=ns();if(ar){if(r===void 0)throw Error(Qe(407));r=r()}else{if(r=t(),Qr===null)throw Error(Qe(349));(Rl&30)!==0||Ww(l,t,r)}u.memoizedState=r;var o={value:r,getSnapshot:t};return u.queue=o,m2(jw.bind(null,l,o,e),[e]),l.flags|=2048,Ed(9,Zw.bind(null,l,o,r,t),void 0,null),r},useId:function(){var e=ns(),t=Qr.identifierPrefix;if(ar){var r=Os,l=Fs;r=(l&~(1<<32-Zo(l)-1)).toString(32)+r,t=":"+t+"R"+r,r=Cd++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=dP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},yP={readContext:ko,useCallback:Kw,useContext:ko,useEffect:qv,useImperativeHandle:Qw,useInsertionEffect:Yw,useLayoutEffect:qw,useMemo:eI,useReducer:wy,useRef:$w,useState:function(){return wy(Md)},useDebugValue:Jv,useDeferredValue:function(e){var t=zo();return tI(t,Gr.memoizedState,e)},useTransition:function(){var e=wy(Md)[0],t=zo().memoizedState;return[e,t]},useMutableSource:Vw,useSyncExternalStore:Uw,useId:iI,unstable_isNewReconciler:!1},vP={readContext:ko,useCallback:Kw,useContext:ko,useEffect:qv,useImperativeHandle:Qw,useInsertionEffect:Yw,useLayoutEffect:qw,useMemo:eI,useReducer:Iy,useRef:$w,useState:function(){return Iy(Md)},useDebugValue:Jv,useDeferredValue:function(e){var t=zo();return Gr===null?t.memoizedState=e:tI(t,Gr.memoizedState,e)},useTransition:function(){var e=Iy(Md)[0],t=zo().memoizedState;return[e,t]},useMutableSource:Vw,useSyncExternalStore:Uw,useId:iI,unstable_isNewReconciler:!1};function hc(e,t){try{var r="",l=t;do r+=$3(l),l=l.return;while(l);var u=r}catch(o){u=`
7
+ Error generating stack: `+o.message+`
8
+ `+o.stack}return{value:e,source:t,stack:u,digest:null}}function Sy(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function sv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var xP=typeof WeakMap=="function"?WeakMap:Map;function sI(e,t,r){r=Gs(-1,r),r.tag=3,r.payload={element:null};var l=t.value;return r.callback=function(){um||(um=!0,gv=l),sv(e,t)},r}function aI(e,t,r){r=Gs(-1,r),r.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var u=t.value;r.payload=function(){return l(u)},r.callback=function(){sv(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){sv(e,t),typeof l!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var m=t.stack;this.componentDidCatch(t.value,{componentStack:m!==null?m:""})}),r}function g2(e,t,r){var l=e.pingCache;if(l===null){l=e.pingCache=new xP;var u=new Set;l.set(t,u)}else u=l.get(t),u===void 0&&(u=new Set,l.set(t,u));u.has(r)||(u.add(r),e=LP.bind(null,e,t,r),t.then(e,e))}function y2(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function v2(e,t,r,l,u){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Gs(-1,1),t.tag=2,Fa(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=u,e)}var _P=js.ReactCurrentOwner,Yn=!1;function Dn(e,t,r,l){t.child=e===null?Ow(t,null,r,l):uc(t,e.child,r,l)}function x2(e,t,r,l,u){r=r.render;var o=t.ref;return nc(t,u),l=$v(e,t,r,l,o,u),r=Yv(),e!==null&&!Yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,Zs(e,t,u)):(ar&&r&&Bv(t),t.flags|=1,Dn(e,t,l,u),t.child)}function _2(e,t,r,l,u){if(e===null){var o=r.type;return typeof o=="function"&&!o1(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,lI(e,t,o,l,u)):(e=Uf(r.type,null,l,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,(e.lanes&u)===0){var m=o.memoizedProps;if(r=r.compare,r=r!==null?r:xd,r(m,l)&&e.ref===t.ref)return Zs(e,t,u)}return t.flags|=1,e=Va(o,l),e.ref=t.ref,e.return=t,t.child=e}function lI(e,t,r,l,u){if(e!==null){var o=e.memoizedProps;if(xd(o,l)&&e.ref===t.ref)if(Yn=!1,t.pendingProps=l=o,(e.lanes&u)!==0)(e.flags&131072)!==0&&(Yn=!0);else return t.lanes=e.lanes,Zs(e,t,u)}return av(e,t,r,l,u)}function uI(e,t,r){var l=t.pendingProps,u=l.children,o=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qi(Ku,lo),lo|=r;else{if((r&1073741824)===0)return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qi(Ku,lo),lo|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=o!==null?o.baseLanes:r,qi(Ku,lo),lo|=l}else o!==null?(l=o.baseLanes|r,t.memoizedState=null):l=r,qi(Ku,lo),lo|=l;return Dn(e,t,u,r),t.child}function cI(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function av(e,t,r,l,u){var o=Jn(r)?zl:bn.current;return o=ac(t,o),nc(t,u),r=$v(e,t,r,l,o,u),l=Yv(),e!==null&&!Yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,Zs(e,t,u)):(ar&&l&&Bv(t),t.flags|=1,Dn(e,t,r,u),t.child)}function b2(e,t,r,l,u){if(Jn(r)){var o=!0;Kf(t)}else o=!1;if(nc(t,u),t.stateNode===null)Of(e,t),Nw(t,r,l),ov(t,r,l,u),l=!0;else if(e===null){var m=t.stateNode,v=t.memoizedProps;m.props=v;var b=m.context,C=r.contextType;typeof C=="object"&&C!==null?C=ko(C):(C=Jn(r)?zl:bn.current,C=ac(t,C));var A=r.getDerivedStateFromProps,B=typeof A=="function"||typeof m.getSnapshotBeforeUpdate=="function";B||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==l||b!==C)&&d2(t,m,l,C),Ta=!1;var Z=t.memoizedState;m.state=Z,nm(t,l,m,u),b=t.memoizedState,v!==l||Z!==b||qn.current||Ta?(typeof A=="function"&&(nv(t,r,A,l),b=t.memoizedState),(v=Ta||h2(t,r,v,l,Z,b,C))?(B||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=b),m.props=l,m.state=b,m.context=C,l=v):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{m=t.stateNode,Dw(e,t),v=t.memoizedProps,C=t.type===t.elementType?v:Vo(t.type,v),m.props=C,B=t.pendingProps,Z=m.context,b=r.contextType,typeof b=="object"&&b!==null?b=ko(b):(b=Jn(r)?zl:bn.current,b=ac(t,b));var q=r.getDerivedStateFromProps;(A=typeof q=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==B||Z!==b)&&d2(t,m,l,b),Ta=!1,Z=t.memoizedState,m.state=Z,nm(t,l,m,u);var ee=t.memoizedState;v!==B||Z!==ee||qn.current||Ta?(typeof q=="function"&&(nv(t,r,q,l),ee=t.memoizedState),(C=Ta||h2(t,r,C,l,Z,ee,b)||!1)?(A||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,ee,b),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,ee,b)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ee),m.props=l,m.state=ee,m.context=b,l=C):(typeof m.componentDidUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),l=!1)}return lv(e,t,r,l,o,u)}function lv(e,t,r,l,u,o){cI(e,t);var m=(t.flags&128)!==0;if(!l&&!m)return u&&s2(t,r,!1),Zs(e,t,o);l=t.stateNode,_P.current=t;var v=m&&typeof r.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&m?(t.child=uc(t,e.child,null,o),t.child=uc(t,null,v,o)):Dn(e,t,v,o),t.memoizedState=l.state,u&&s2(t,r,!0),t.child}function hI(e){var t=e.stateNode;t.pendingContext?o2(e,t.pendingContext,t.pendingContext!==t.context):t.context&&o2(e,t.context,!1),Zv(e,t.containerInfo)}function w2(e,t,r,l,u){return lc(),Fv(u),t.flags|=256,Dn(e,t,r,l),t.child}var uv={dehydrated:null,treeContext:null,retryLane:0};function cv(e){return{baseLanes:e,cachePool:null,transitions:null}}function dI(e,t,r){var l=t.pendingProps,u=dr.current,o=!1,m=(t.flags&128)!==0,v;if((v=m)||(v=e!==null&&e.memoizedState===null?!1:(u&2)!==0),v?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(u|=1),qi(dr,u&1),e===null)return iv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(m=l.children,e=l.fallback,o?(l=t.mode,o=t.child,m={mode:"hidden",children:m},(l&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=m):o=Im(m,l,0,null),e=kl(e,l,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=cv(r),t.memoizedState=uv,e):Qv(t,m));if(u=e.memoizedState,u!==null&&(v=u.dehydrated,v!==null))return bP(e,t,m,l,v,u,r);if(o){o=l.fallback,m=t.mode,u=e.child,v=u.sibling;var b={mode:"hidden",children:l.children};return(m&1)===0&&t.child!==u?(l=t.child,l.childLanes=0,l.pendingProps=b,t.deletions=null):(l=Va(u,b),l.subtreeFlags=u.subtreeFlags&14680064),v!==null?o=Va(v,o):(o=kl(o,m,r,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,l=o,o=t.child,m=e.child.memoizedState,m=m===null?cv(r):{baseLanes:m.baseLanes|r,cachePool:null,transitions:m.transitions},o.memoizedState=m,o.childLanes=e.childLanes&~r,t.memoizedState=uv,l}return o=e.child,e=o.sibling,l=Va(o,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=r),l.return=t,l.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=l,t.memoizedState=null,l}function Qv(e,t){return t=Im({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Pf(e,t,r,l){return l!==null&&Fv(l),uc(t,e.child,null,r),e=Qv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bP(e,t,r,l,u,o,m){if(r)return t.flags&256?(t.flags&=-257,l=Sy(Error(Qe(422))),Pf(e,t,m,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=l.fallback,u=t.mode,l=Im({mode:"visible",children:l.children},u,0,null),o=kl(o,u,m,null),o.flags|=2,l.return=t,o.return=t,l.sibling=o,t.child=l,(t.mode&1)!==0&&uc(t,e.child,null,m),t.child.memoizedState=cv(m),t.memoizedState=uv,o);if((t.mode&1)===0)return Pf(e,t,m,null);if(u.data==="$!"){if(l=u.nextSibling&&u.nextSibling.dataset,l)var v=l.dgst;return l=v,o=Error(Qe(419)),l=Sy(o,l,void 0),Pf(e,t,m,l)}if(v=(m&e.childLanes)!==0,Yn||v){if(l=Qr,l!==null){switch(m&-m){case 4:u=2;break;case 16:u=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(l.suspendedLanes|m))!==0?0:u,u!==0&&u!==o.retryLane&&(o.retryLane=u,Ws(e,u),jo(l,e,u,-1))}return n1(),l=Sy(Error(Qe(421))),Pf(e,t,m,l)}return u.data==="$?"?(t.flags|=128,t.child=e.child,t=RP.bind(null,e),u._reactRetry=t,null):(e=o.treeContext,uo=Na(u.nextSibling),co=t,ar=!0,Wo=null,e!==null&&(Eo[Ao++]=Fs,Eo[Ao++]=Os,Eo[Ao++]=Ll,Fs=e.id,Os=e.overflow,Ll=t),t=Qv(t,l.children),t.flags|=4096,t)}function I2(e,t,r){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),rv(e.return,t,r)}function Cy(e,t,r,l,u){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:r,tailMode:u}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=l,o.tail=r,o.tailMode=u)}function pI(e,t,r){var l=t.pendingProps,u=l.revealOrder,o=l.tail;if(Dn(e,t,l.children,r),l=dr.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&I2(e,r,t);else if(e.tag===19)I2(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(qi(dr,l),(t.mode&1)===0)t.memoizedState=null;else switch(u){case"forwards":for(r=t.child,u=null;r!==null;)e=r.alternate,e!==null&&om(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=t.child,t.child=null):(u=r.sibling,r.sibling=null),Cy(t,!1,u,r,o);break;case"backwards":for(r=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&om(e)===null){t.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}Cy(t,!0,r,null,o);break;case"together":Cy(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Of(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zs(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Dl|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(Qe(153));if(t.child!==null){for(e=t.child,r=Va(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Va(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function wP(e,t,r){switch(t.tag){case 3:hI(t),lc();break;case 5:Gw(t);break;case 1:Jn(t.type)&&Kf(t);break;case 4:Zv(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,u=t.memoizedProps.value;qi(im,l._currentValue),l._currentValue=u;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(qi(dr,dr.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?dI(e,t,r):(qi(dr,dr.current&1),e=Zs(e,t,r),e!==null?e.sibling:null);qi(dr,dr.current&1);break;case 19:if(l=(r&t.childLanes)!==0,(e.flags&128)!==0){if(l)return pI(e,t,r);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),qi(dr,dr.current),l)break;return null;case 22:case 23:return t.lanes=0,uI(e,t,r)}return Zs(e,t,r)}var fI,hv,mI,gI;fI=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};hv=function(){};mI=function(e,t,r,l){var u=e.memoizedProps;if(u!==l){e=t.stateNode,Tl(as.current);var o=null;switch(r){case"input":u=Ly(e,u),l=Ly(e,l),o=[];break;case"select":u=fr({},u,{value:void 0}),l=fr({},l,{value:void 0}),o=[];break;case"textarea":u=By(e,u),l=By(e,l),o=[];break;default:typeof u.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Jf)}Fy(r,l);var m;r=null;for(C in u)if(!l.hasOwnProperty(C)&&u.hasOwnProperty(C)&&u[C]!=null)if(C==="style"){var v=u[C];for(m in v)v.hasOwnProperty(m)&&(r||(r={}),r[m]="")}else C!=="dangerouslySetInnerHTML"&&C!=="children"&&C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(dd.hasOwnProperty(C)?o||(o=[]):(o=o||[]).push(C,null));for(C in l){var b=l[C];if(v=u?.[C],l.hasOwnProperty(C)&&b!==v&&(b!=null||v!=null))if(C==="style")if(v){for(m in v)!v.hasOwnProperty(m)||b&&b.hasOwnProperty(m)||(r||(r={}),r[m]="");for(m in b)b.hasOwnProperty(m)&&v[m]!==b[m]&&(r||(r={}),r[m]=b[m])}else r||(o||(o=[]),o.push(C,r)),r=b;else C==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,v=v?v.__html:void 0,b!=null&&v!==b&&(o=o||[]).push(C,b)):C==="children"?typeof b!="string"&&typeof b!="number"||(o=o||[]).push(C,""+b):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&(dd.hasOwnProperty(C)?(b!=null&&C==="onScroll"&&Ki("scroll",e),o||v===b||(o=[])):(o=o||[]).push(C,b))}r&&(o=o||[]).push("style",r);var C=o;(t.updateQueue=C)&&(t.flags|=4)}};gI=function(e,t,r,l){r!==l&&(t.flags|=4)};function qh(e,t){if(!ar)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function xn(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,l=0;if(t)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags&14680064,l|=u.flags&14680064,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags,l|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=l,e.childLanes=r,t}function IP(e,t,r){var l=t.pendingProps;switch(Nv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(t),null;case 1:return Jn(t.type)&&Qf(),xn(t),null;case 3:return l=t.stateNode,cc(),er(qn),er(bn),Hv(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Af(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Wo!==null&&(xv(Wo),Wo=null))),hv(e,t),xn(t),null;case 5:jv(t);var u=Tl(Sd.current);if(r=t.type,e!==null&&t.stateNode!=null)mI(e,t,r,l,u),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(Qe(166));return xn(t),null}if(e=Tl(as.current),Af(t)){l=t.stateNode,r=t.type;var o=t.memoizedProps;switch(l[os]=t,l[wd]=o,e=(t.mode&1)!==0,r){case"dialog":Ki("cancel",l),Ki("close",l);break;case"iframe":case"object":case"embed":Ki("load",l);break;case"video":case"audio":for(u=0;u<id.length;u++)Ki(id[u],l);break;case"source":Ki("error",l);break;case"img":case"image":case"link":Ki("error",l),Ki("load",l);break;case"details":Ki("toggle",l);break;case"input":kb(l,o),Ki("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!o.multiple},Ki("invalid",l);break;case"textarea":Lb(l,o),Ki("invalid",l)}Fy(r,o),u=null;for(var m in o)if(o.hasOwnProperty(m)){var v=o[m];m==="children"?typeof v=="string"?l.textContent!==v&&(o.suppressHydrationWarning!==!0&&Ef(l.textContent,v,e),u=["children",v]):typeof v=="number"&&l.textContent!==""+v&&(o.suppressHydrationWarning!==!0&&Ef(l.textContent,v,e),u=["children",""+v]):dd.hasOwnProperty(m)&&v!=null&&m==="onScroll"&&Ki("scroll",l)}switch(r){case"input":mf(l),zb(l,o,!0);break;case"textarea":mf(l),Rb(l);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(l.onclick=Jf)}l=u,t.updateQueue=l,l!==null&&(t.flags|=4)}else{m=u.nodeType===9?u:u.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=W2(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=m.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=m.createElement(r,{is:l.is}):(e=m.createElement(r),r==="select"&&(m=e,l.multiple?m.multiple=!0:l.size&&(m.size=l.size))):e=m.createElementNS(e,r),e[os]=t,e[wd]=l,fI(e,t,!1,!1),t.stateNode=e;e:{switch(m=Oy(r,l),r){case"dialog":Ki("cancel",e),Ki("close",e),u=l;break;case"iframe":case"object":case"embed":Ki("load",e),u=l;break;case"video":case"audio":for(u=0;u<id.length;u++)Ki(id[u],e);u=l;break;case"source":Ki("error",e),u=l;break;case"img":case"image":case"link":Ki("error",e),Ki("load",e),u=l;break;case"details":Ki("toggle",e),u=l;break;case"input":kb(e,l),u=Ly(e,l),Ki("invalid",e);break;case"option":u=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},u=fr({},l,{value:void 0}),Ki("invalid",e);break;case"textarea":Lb(e,l),u=By(e,l),Ki("invalid",e);break;default:u=l}Fy(r,u),v=u;for(o in v)if(v.hasOwnProperty(o)){var b=v[o];o==="style"?H2(e,b):o==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,b!=null&&Z2(e,b)):o==="children"?typeof b=="string"?(r!=="textarea"||b!=="")&&pd(e,b):typeof b=="number"&&pd(e,""+b):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(dd.hasOwnProperty(o)?b!=null&&o==="onScroll"&&Ki("scroll",e):b!=null&&wv(e,o,b,m))}switch(r){case"input":mf(e),zb(e,l,!1);break;case"textarea":mf(e),Rb(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ua(l.value));break;case"select":e.multiple=!!l.multiple,o=l.value,o!=null?ec(e,!!l.multiple,o,!1):l.defaultValue!=null&&ec(e,!!l.multiple,l.defaultValue,!0);break;default:typeof u.onClick=="function"&&(e.onclick=Jf)}switch(r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xn(t),null;case 6:if(e&&t.stateNode!=null)gI(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(Qe(166));if(r=Tl(Sd.current),Tl(as.current),Af(t)){if(l=t.stateNode,r=t.memoizedProps,l[os]=t,(o=l.nodeValue!==r)&&(e=co,e!==null))switch(e.tag){case 3:Ef(l.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ef(l.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else l=(r.nodeType===9?r:r.ownerDocument).createTextNode(l),l[os]=t,t.stateNode=l}return xn(t),null;case 13:if(er(dr),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ar&&uo!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Lw(),lc(),t.flags|=98560,o=!1;else if(o=Af(t),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(Qe(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Qe(317));o[os]=t}else lc(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xn(t),o=!1}else Wo!==null&&(xv(Wo),Wo=null),o=!0;if(!o)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(dr.current&1)!==0?Vr===0&&(Vr=3):n1())),t.updateQueue!==null&&(t.flags|=4),xn(t),null);case 4:return cc(),hv(e,t),e===null&&_d(t.stateNode.containerInfo),xn(t),null;case 10:return Vv(t.type._context),xn(t),null;case 17:return Jn(t.type)&&Qf(),xn(t),null;case 19:if(er(dr),o=t.memoizedState,o===null)return xn(t),null;if(l=(t.flags&128)!==0,m=o.rendering,m===null)if(l)qh(o,!1);else{if(Vr!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=om(e),m!==null){for(t.flags|=128,qh(o,!1),l=m.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=r,r=t.child;r!==null;)o=r,e=l,o.flags&=14680066,m=o.alternate,m===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=m.childLanes,o.lanes=m.lanes,o.child=m.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=m.memoizedProps,o.memoizedState=m.memoizedState,o.updateQueue=m.updateQueue,o.type=m.type,e=m.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return qi(dr,dr.current&1|2),t.child}e=e.sibling}o.tail!==null&&kr()>dc&&(t.flags|=128,l=!0,qh(o,!1),t.lanes=4194304)}else{if(!l)if(e=om(m),e!==null){if(t.flags|=128,l=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),qh(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!ar)return xn(t),null}else 2*kr()-o.renderingStartTime>dc&&r!==1073741824&&(t.flags|=128,l=!0,qh(o,!1),t.lanes=4194304);o.isBackwards?(m.sibling=t.child,t.child=m):(r=o.last,r!==null?r.sibling=m:t.child=m,o.last=m)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=kr(),t.sibling=null,r=dr.current,qi(dr,l?r&1|2:r&1),t):(xn(t),null);case 22:case 23:return r1(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(lo&1073741824)!==0&&(xn(t),t.subtreeFlags&6&&(t.flags|=8192)):xn(t),null;case 24:return null;case 25:return null}throw Error(Qe(156,t.tag))}function SP(e,t){switch(Nv(t),t.tag){case 1:return Jn(t.type)&&Qf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cc(),er(qn),er(bn),Hv(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return jv(t),null;case 13:if(er(dr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Qe(340));lc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return er(dr),null;case 4:return cc(),null;case 10:return Vv(t.type._context),null;case 22:case 23:return r1(),null;case 24:return null;default:return null}}var kf=!1,_n=!1,CP=typeof WeakSet=="function"?WeakSet:Set,_t=null;function Qu(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(l){Ir(e,t,l)}else r.current=null}function dv(e,t,r){try{r()}catch(l){Ir(e,t,l)}}var S2=!1;function MP(e,t){if(Yy=$f,e=_w(),Dv(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var u=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var m=0,v=-1,b=-1,C=0,A=0,B=e,Z=null;t:for(;;){for(var q;B!==r||u!==0&&B.nodeType!==3||(v=m+u),B!==o||l!==0&&B.nodeType!==3||(b=m+l),B.nodeType===3&&(m+=B.nodeValue.length),(q=B.firstChild)!==null;)Z=B,B=q;for(;;){if(B===e)break t;if(Z===r&&++C===u&&(v=m),Z===o&&++A===l&&(b=m),(q=B.nextSibling)!==null)break;B=Z,Z=B.parentNode}B=q}r=v===-1||b===-1?null:{start:v,end:b}}else r=null}r=r||{start:0,end:0}}else r=null;for(qy={focusedElem:e,selectionRange:r},$f=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){t=_t;try{var ee=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ee!==null){var le=ee.memoizedProps,de=ee.memoizedState,H=t.stateNode,Q=H.getSnapshotBeforeUpdate(t.elementType===t.type?le:Vo(t.type,le),de);H.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var te=t.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Qe(163))}}catch(ve){Ir(t,t.return,ve)}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}return ee=S2,S2=!1,ee}function ud(e,t,r){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var u=l=l.next;do{if((u.tag&e)===e){var o=u.destroy;u.destroy=void 0,o!==void 0&&dv(t,r,o)}u=u.next}while(u!==l)}}function bm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var l=r.create;r.destroy=l()}r=r.next}while(r!==t)}}function pv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function yI(e){var t=e.alternate;t!==null&&(e.alternate=null,yI(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[os],delete t[wd],delete t[Ky],delete t[lP],delete t[uP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vI(e){return e.tag===5||e.tag===3||e.tag===4}function C2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vI(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fv(e,t,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Jf));else if(l!==4&&(e=e.child,e!==null))for(fv(e,t,r),e=e.sibling;e!==null;)fv(e,t,r),e=e.sibling}function mv(e,t,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(mv(e,t,r),e=e.sibling;e!==null;)mv(e,t,r),e=e.sibling}var ln=null,Uo=!1;function Ea(e,t,r){for(r=r.child;r!==null;)xI(e,t,r),r=r.sibling}function xI(e,t,r){if(ss&&typeof ss.onCommitFiberUnmount=="function")try{ss.onCommitFiberUnmount(pm,r)}catch{}switch(r.tag){case 5:_n||Qu(r,t);case 6:var l=ln,u=Uo;ln=null,Ea(e,t,r),ln=l,Uo=u,ln!==null&&(Uo?(e=ln,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ln.removeChild(r.stateNode));break;case 18:ln!==null&&(Uo?(e=ln,r=r.stateNode,e.nodeType===8?vy(e.parentNode,r):e.nodeType===1&&vy(e,r),yd(e)):vy(ln,r.stateNode));break;case 4:l=ln,u=Uo,ln=r.stateNode.containerInfo,Uo=!0,Ea(e,t,r),ln=l,Uo=u;break;case 0:case 11:case 14:case 15:if(!_n&&(l=r.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){u=l=l.next;do{var o=u,m=o.destroy;o=o.tag,m!==void 0&&((o&2)!==0||(o&4)!==0)&&dv(r,t,m),u=u.next}while(u!==l)}Ea(e,t,r);break;case 1:if(!_n&&(Qu(r,t),l=r.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=r.memoizedProps,l.state=r.memoizedState,l.componentWillUnmount()}catch(v){Ir(r,t,v)}Ea(e,t,r);break;case 21:Ea(e,t,r);break;case 22:r.mode&1?(_n=(l=_n)||r.memoizedState!==null,Ea(e,t,r),_n=l):Ea(e,t,r);break;default:Ea(e,t,r)}}function M2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new CP),t.forEach(function(l){var u=DP.bind(null,e,l);r.has(l)||(r.add(l),l.then(u,u))})}}function Go(e,t){var r=t.deletions;if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];try{var o=e,m=t,v=m;e:for(;v!==null;){switch(v.tag){case 5:ln=v.stateNode,Uo=!1;break e;case 3:ln=v.stateNode.containerInfo,Uo=!0;break e;case 4:ln=v.stateNode.containerInfo,Uo=!0;break e}v=v.return}if(ln===null)throw Error(Qe(160));xI(o,m,u),ln=null,Uo=!1;var b=u.alternate;b!==null&&(b.return=null),u.return=null}catch(C){Ir(u,t,C)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)_I(t,e),t=t.sibling}function _I(e,t){var r=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Go(t,e),rs(e),l&4){try{ud(3,e,e.return),bm(3,e)}catch(le){Ir(e,e.return,le)}try{ud(5,e,e.return)}catch(le){Ir(e,e.return,le)}}break;case 1:Go(t,e),rs(e),l&512&&r!==null&&Qu(r,r.return);break;case 5:if(Go(t,e),rs(e),l&512&&r!==null&&Qu(r,r.return),e.flags&32){var u=e.stateNode;try{pd(u,"")}catch(le){Ir(e,e.return,le)}}if(l&4&&(u=e.stateNode,u!=null)){var o=e.memoizedProps,m=r!==null?r.memoizedProps:o,v=e.type,b=e.updateQueue;if(e.updateQueue=null,b!==null)try{v==="input"&&o.type==="radio"&&o.name!=null&&V2(u,o),Oy(v,m);var C=Oy(v,o);for(m=0;m<b.length;m+=2){var A=b[m],B=b[m+1];A==="style"?H2(u,B):A==="dangerouslySetInnerHTML"?Z2(u,B):A==="children"?pd(u,B):wv(u,A,B,C)}switch(v){case"input":Ry(u,o);break;case"textarea":U2(u,o);break;case"select":var Z=u._wrapperState.wasMultiple;u._wrapperState.wasMultiple=!!o.multiple;var q=o.value;q!=null?ec(u,!!o.multiple,q,!1):Z!==!!o.multiple&&(o.defaultValue!=null?ec(u,!!o.multiple,o.defaultValue,!0):ec(u,!!o.multiple,o.multiple?[]:"",!1))}u[wd]=o}catch(le){Ir(e,e.return,le)}}break;case 6:if(Go(t,e),rs(e),l&4){if(e.stateNode===null)throw Error(Qe(162));u=e.stateNode,o=e.memoizedProps;try{u.nodeValue=o}catch(le){Ir(e,e.return,le)}}break;case 3:if(Go(t,e),rs(e),l&4&&r!==null&&r.memoizedState.isDehydrated)try{yd(t.containerInfo)}catch(le){Ir(e,e.return,le)}break;case 4:Go(t,e),rs(e);break;case 13:Go(t,e),rs(e),u=e.child,u.flags&8192&&(o=u.memoizedState!==null,u.stateNode.isHidden=o,!o||u.alternate!==null&&u.alternate.memoizedState!==null||(t1=kr())),l&4&&M2(e);break;case 22:if(A=r!==null&&r.memoizedState!==null,e.mode&1?(_n=(C=_n)||A,Go(t,e),_n=C):Go(t,e),rs(e),l&8192){if(C=e.memoizedState!==null,(e.stateNode.isHidden=C)&&!A&&(e.mode&1)!==0)for(_t=e,A=e.child;A!==null;){for(B=_t=A;_t!==null;){switch(Z=_t,q=Z.child,Z.tag){case 0:case 11:case 14:case 15:ud(4,Z,Z.return);break;case 1:Qu(Z,Z.return);var ee=Z.stateNode;if(typeof ee.componentWillUnmount=="function"){l=Z,r=Z.return;try{t=l,ee.props=t.memoizedProps,ee.state=t.memoizedState,ee.componentWillUnmount()}catch(le){Ir(l,r,le)}}break;case 5:Qu(Z,Z.return);break;case 22:if(Z.memoizedState!==null){A2(B);continue}}q!==null?(q.return=Z,_t=q):A2(B)}A=A.sibling}e:for(A=null,B=e;;){if(B.tag===5){if(A===null){A=B;try{u=B.stateNode,C?(o=u.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(v=B.stateNode,b=B.memoizedProps.style,m=b!=null&&b.hasOwnProperty("display")?b.display:null,v.style.display=j2("display",m))}catch(le){Ir(e,e.return,le)}}}else if(B.tag===6){if(A===null)try{B.stateNode.nodeValue=C?"":B.memoizedProps}catch(le){Ir(e,e.return,le)}}else if((B.tag!==22&&B.tag!==23||B.memoizedState===null||B===e)&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===e)break e;for(;B.sibling===null;){if(B.return===null||B.return===e)break e;A===B&&(A=null),B=B.return}A===B&&(A=null),B.sibling.return=B.return,B=B.sibling}}break;case 19:Go(t,e),rs(e),l&4&&M2(e);break;case 21:break;default:Go(t,e),rs(e)}}function rs(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(vI(r)){var l=r;break e}r=r.return}throw Error(Qe(160))}switch(l.tag){case 5:var u=l.stateNode;l.flags&32&&(pd(u,""),l.flags&=-33);var o=C2(e);mv(e,o,u);break;case 3:case 4:var m=l.stateNode.containerInfo,v=C2(e);fv(e,v,m);break;default:throw Error(Qe(161))}}catch(b){Ir(e,e.return,b)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function EP(e,t,r){_t=e,bI(e,t,r)}function bI(e,t,r){for(var l=(e.mode&1)!==0;_t!==null;){var u=_t,o=u.child;if(u.tag===22&&l){var m=u.memoizedState!==null||kf;if(!m){var v=u.alternate,b=v!==null&&v.memoizedState!==null||_n;v=kf;var C=_n;if(kf=m,(_n=b)&&!C)for(_t=u;_t!==null;)m=_t,b=m.child,m.tag===22&&m.memoizedState!==null?T2(u):b!==null?(b.return=m,_t=b):T2(u);for(;o!==null;)_t=o,bI(o,t,r),o=o.sibling;_t=u,kf=v,_n=C}E2(e,t,r)}else(u.subtreeFlags&8772)!==0&&o!==null?(o.return=u,_t=o):E2(e,t,r)}}function E2(e){for(;_t!==null;){var t=_t;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:_n||bm(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!_n)if(r===null)l.componentDidMount();else{var u=t.elementType===t.type?r.memoizedProps:Vo(t.type,r.memoizedProps);l.componentDidUpdate(u,r.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&c2(t,o,l);break;case 3:var m=t.updateQueue;if(m!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}c2(t,m,r)}break;case 5:var v=t.stateNode;if(r===null&&t.flags&4){r=v;var b=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":b.autoFocus&&r.focus();break;case"img":b.src&&(r.src=b.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var C=t.alternate;if(C!==null){var A=C.memoizedState;if(A!==null){var B=A.dehydrated;B!==null&&yd(B)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Qe(163))}_n||t.flags&512&&pv(t)}catch(Z){Ir(t,t.return,Z)}}if(t===e){_t=null;break}if(r=t.sibling,r!==null){r.return=t.return,_t=r;break}_t=t.return}}function A2(e){for(;_t!==null;){var t=_t;if(t===e){_t=null;break}var r=t.sibling;if(r!==null){r.return=t.return,_t=r;break}_t=t.return}}function T2(e){for(;_t!==null;){var t=_t;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{bm(4,t)}catch(b){Ir(t,r,b)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var u=t.return;try{l.componentDidMount()}catch(b){Ir(t,u,b)}}var o=t.return;try{pv(t)}catch(b){Ir(t,o,b)}break;case 5:var m=t.return;try{pv(t)}catch(b){Ir(t,m,b)}}}catch(b){Ir(t,t.return,b)}if(t===e){_t=null;break}var v=t.sibling;if(v!==null){v.return=t.return,_t=v;break}_t=t.return}}var AP=Math.ceil,lm=js.ReactCurrentDispatcher,Kv=js.ReactCurrentOwner,Po=js.ReactCurrentBatchConfig,wi=0,Qr=null,Br=null,un=0,lo=0,Ku=ja(0),Vr=0,Ad=null,Dl=0,wm=0,e1=0,cd=null,$n=null,t1=0,dc=1/0,Bs=null,um=!1,gv=null,Oa=null,zf=!1,La=null,cm=0,hd=0,yv=null,Gf=-1,Vf=0;function Bn(){return(wi&6)!==0?kr():Gf!==-1?Gf:Gf=kr()}function Ga(e){return(e.mode&1)===0?1:(wi&2)!==0&&un!==0?un&-un:hP.transition!==null?(Vf===0&&(Vf=nw()),Vf):(e=Di,e!==0||(e=window.event,e=e===void 0?16:hw(e.type)),e)}function jo(e,t,r,l){if(50<hd)throw hd=0,yv=null,Error(Qe(185));Td(e,r,l),((wi&2)===0||e!==Qr)&&(e===Qr&&((wi&2)===0&&(wm|=r),Vr===4&&ka(e,un)),Qn(e,l),r===1&&wi===0&&(t.mode&1)===0&&(dc=kr()+500,vm&&Ha()))}function Qn(e,t){var r=e.callbackNode;p4(e,t);var l=Xf(e,e===Qr?un:0);if(l===0)r!==null&&Nb(r),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(r!=null&&Nb(r),t===1)e.tag===0?cP(P2.bind(null,e)):Pw(P2.bind(null,e)),sP(function(){(wi&6)===0&&Ha()}),r=null;else{switch(ow(l)){case 1:r=Ev;break;case 4:r=iw;break;case 16:r=Hf;break;case 536870912:r=rw;break;default:r=Hf}r=TI(r,wI.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function wI(e,t){if(Gf=-1,Vf=0,(wi&6)!==0)throw Error(Qe(327));var r=e.callbackNode;if(oc()&&e.callbackNode!==r)return null;var l=Xf(e,e===Qr?un:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=hm(e,l);else{t=l;var u=wi;wi|=2;var o=SI();(Qr!==e||un!==t)&&(Bs=null,dc=kr()+500,Pl(e,t));do try{kP();break}catch(v){II(e,v)}while(1);Gv(),lm.current=o,wi=u,Br!==null?t=0:(Qr=null,un=0,t=Vr)}if(t!==0){if(t===2&&(u=Zy(e),u!==0&&(l=u,t=vv(e,u))),t===1)throw r=Ad,Pl(e,0),ka(e,l),Qn(e,kr()),r;if(t===6)ka(e,l);else{if(u=e.current.alternate,(l&30)===0&&!TP(u)&&(t=hm(e,l),t===2&&(o=Zy(e),o!==0&&(l=o,t=vv(e,o))),t===1))throw r=Ad,Pl(e,0),ka(e,l),Qn(e,kr()),r;switch(e.finishedWork=u,e.finishedLanes=l,t){case 0:case 1:throw Error(Qe(345));case 2:Ml(e,$n,Bs);break;case 3:if(ka(e,l),(l&130023424)===l&&(t=t1+500-kr(),10<t)){if(Xf(e,0)!==0)break;if(u=e.suspendedLanes,(u&l)!==l){Bn(),e.pingedLanes|=e.suspendedLanes&u;break}e.timeoutHandle=Qy(Ml.bind(null,e,$n,Bs),t);break}Ml(e,$n,Bs);break;case 4:if(ka(e,l),(l&4194240)===l)break;for(t=e.eventTimes,u=-1;0<l;){var m=31-Zo(l);o=1<<m,m=t[m],m>u&&(u=m),l&=~o}if(l=u,l=kr()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*AP(l/1960))-l,10<l){e.timeoutHandle=Qy(Ml.bind(null,e,$n,Bs),l);break}Ml(e,$n,Bs);break;case 5:Ml(e,$n,Bs);break;default:throw Error(Qe(329))}}}return Qn(e,kr()),e.callbackNode===r?wI.bind(null,e):null}function vv(e,t){var r=cd;return e.current.memoizedState.isDehydrated&&(Pl(e,t).flags|=256),e=hm(e,t),e!==2&&(t=$n,$n=r,t!==null&&xv(t)),e}function xv(e){$n===null?$n=e:$n.push.apply($n,e)}function TP(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var l=0;l<r.length;l++){var u=r[l],o=u.getSnapshot;u=u.value;try{if(!Ho(o(),u))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ka(e,t){for(t&=~e1,t&=~wm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Zo(t),l=1<<r;e[r]=-1,t&=~l}}function P2(e){if((wi&6)!==0)throw Error(Qe(327));oc();var t=Xf(e,0);if((t&1)===0)return Qn(e,kr()),null;var r=hm(e,t);if(e.tag!==0&&r===2){var l=Zy(e);l!==0&&(t=l,r=vv(e,l))}if(r===1)throw r=Ad,Pl(e,0),ka(e,t),Qn(e,kr()),r;if(r===6)throw Error(Qe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ml(e,$n,Bs),Qn(e,kr()),null}function i1(e,t){var r=wi;wi|=1;try{return e(t)}finally{wi=r,wi===0&&(dc=kr()+500,vm&&Ha())}}function Bl(e){La!==null&&La.tag===0&&(wi&6)===0&&oc();var t=wi;wi|=1;var r=Po.transition,l=Di;try{if(Po.transition=null,Di=1,e)return e()}finally{Di=l,Po.transition=r,wi=t,(wi&6)===0&&Ha()}}function r1(){lo=Ku.current,er(Ku)}function Pl(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,oP(r)),Br!==null)for(r=Br.return;r!==null;){var l=r;switch(Nv(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Qf();break;case 3:cc(),er(qn),er(bn),Hv();break;case 5:jv(l);break;case 4:cc();break;case 13:er(dr);break;case 19:er(dr);break;case 10:Vv(l.type._context);break;case 22:case 23:r1()}r=r.return}if(Qr=e,Br=e=Va(e.current,null),un=lo=t,Vr=0,Ad=null,e1=wm=Dl=0,$n=cd=null,Al!==null){for(t=0;t<Al.length;t++)if(r=Al[t],l=r.interleaved,l!==null){r.interleaved=null;var u=l.next,o=r.pending;if(o!==null){var m=o.next;o.next=u,l.next=m}r.pending=l}Al=null}return e}function II(e,t){do{var r=Br;try{if(Gv(),Nf.current=am,sm){for(var l=pr.memoizedState;l!==null;){var u=l.queue;u!==null&&(u.pending=null),l=l.next}sm=!1}if(Rl=0,Jr=Gr=pr=null,ld=!1,Cd=0,Kv.current=null,r===null||r.return===null){Vr=1,Ad=t,Br=null;break}e:{var o=e,m=r.return,v=r,b=t;if(t=un,v.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){var C=b,A=v,B=A.tag;if((A.mode&1)===0&&(B===0||B===11||B===15)){var Z=A.alternate;Z?(A.updateQueue=Z.updateQueue,A.memoizedState=Z.memoizedState,A.lanes=Z.lanes):(A.updateQueue=null,A.memoizedState=null)}var q=y2(m);if(q!==null){q.flags&=-257,v2(q,m,v,o,t),q.mode&1&&g2(o,C,t),t=q,b=C;var ee=t.updateQueue;if(ee===null){var le=new Set;le.add(b),t.updateQueue=le}else ee.add(b);break e}else{if((t&1)===0){g2(o,C,t),n1();break e}b=Error(Qe(426))}}else if(ar&&v.mode&1){var de=y2(m);if(de!==null){(de.flags&65536)===0&&(de.flags|=256),v2(de,m,v,o,t),Fv(hc(b,v));break e}}o=b=hc(b,v),Vr!==4&&(Vr=2),cd===null?cd=[o]:cd.push(o),o=m;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var H=sI(o,b,t);u2(o,H);break e;case 1:v=b;var Q=o.type,te=o.stateNode;if((o.flags&128)===0&&(typeof Q.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(Oa===null||!Oa.has(te)))){o.flags|=65536,t&=-t,o.lanes|=t;var ve=aI(o,v,t);u2(o,ve);break e}}o=o.return}while(o!==null)}MI(r)}catch(Ce){t=Ce,Br===r&&r!==null&&(Br=r=r.return);continue}break}while(1)}function SI(){var e=lm.current;return lm.current=am,e===null?am:e}function n1(){(Vr===0||Vr===3||Vr===2)&&(Vr=4),Qr===null||(Dl&268435455)===0&&(wm&268435455)===0||ka(Qr,un)}function hm(e,t){var r=wi;wi|=2;var l=SI();(Qr!==e||un!==t)&&(Bs=null,Pl(e,t));do try{PP();break}catch(u){II(e,u)}while(1);if(Gv(),wi=r,lm.current=l,Br!==null)throw Error(Qe(261));return Qr=null,un=0,Vr}function PP(){for(;Br!==null;)CI(Br)}function kP(){for(;Br!==null&&!n4();)CI(Br)}function CI(e){var t=AI(e.alternate,e,lo);e.memoizedProps=e.pendingProps,t===null?MI(e):Br=t,Kv.current=null}function MI(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=IP(r,t,lo),r!==null){Br=r;return}}else{if(r=SP(r,t),r!==null){r.flags&=32767,Br=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Vr=6,Br=null;return}}if(t=t.sibling,t!==null){Br=t;return}Br=t=e}while(t!==null);Vr===0&&(Vr=5)}function Ml(e,t,r){var l=Di,u=Po.transition;try{Po.transition=null,Di=1,zP(e,t,r,l)}finally{Po.transition=u,Di=l}return null}function zP(e,t,r,l){do oc();while(La!==null);if((wi&6)!==0)throw Error(Qe(327));r=e.finishedWork;var u=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Qe(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(f4(e,o),e===Qr&&(Br=Qr=null,un=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||zf||(zf=!0,TI(Hf,function(){return oc(),null})),o=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||o){o=Po.transition,Po.transition=null;var m=Di;Di=1;var v=wi;wi|=4,Kv.current=null,MP(e,r),_I(r,e),eP(qy),$f=!!Yy,qy=Yy=null,e.current=r,EP(r,e,u),o4(),wi=v,Di=m,Po.transition=o}else e.current=r;if(zf&&(zf=!1,La=e,cm=u),o=e.pendingLanes,o===0&&(Oa=null),l4(r.stateNode,l),Qn(e,kr()),t!==null)for(l=e.onRecoverableError,r=0;r<t.length;r++)u=t[r],l(u.value,{componentStack:u.stack,digest:u.digest});if(um)throw um=!1,e=gv,gv=null,e;return(cm&1)!==0&&e.tag!==0&&oc(),o=e.pendingLanes,(o&1)!==0?e===yv?hd++:(hd=0,yv=e):hd=0,Ha(),null}function oc(){if(La!==null){var e=ow(cm),t=Po.transition,r=Di;try{if(Po.transition=null,Di=16>e?16:e,La===null)var l=!1;else{if(e=La,La=null,cm=0,(wi&6)!==0)throw Error(Qe(331));var u=wi;for(wi|=4,_t=e.current;_t!==null;){var o=_t,m=o.child;if((_t.flags&16)!==0){var v=o.deletions;if(v!==null){for(var b=0;b<v.length;b++){var C=v[b];for(_t=C;_t!==null;){var A=_t;switch(A.tag){case 0:case 11:case 15:ud(8,A,o)}var B=A.child;if(B!==null)B.return=A,_t=B;else for(;_t!==null;){A=_t;var Z=A.sibling,q=A.return;if(yI(A),A===C){_t=null;break}if(Z!==null){Z.return=q,_t=Z;break}_t=q}}}var ee=o.alternate;if(ee!==null){var le=ee.child;if(le!==null){ee.child=null;do{var de=le.sibling;le.sibling=null,le=de}while(le!==null)}}_t=o}}if((o.subtreeFlags&2064)!==0&&m!==null)m.return=o,_t=m;else e:for(;_t!==null;){if(o=_t,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:ud(9,o,o.return)}var H=o.sibling;if(H!==null){H.return=o.return,_t=H;break e}_t=o.return}}var Q=e.current;for(_t=Q;_t!==null;){m=_t;var te=m.child;if((m.subtreeFlags&2064)!==0&&te!==null)te.return=m,_t=te;else e:for(m=Q;_t!==null;){if(v=_t,(v.flags&2048)!==0)try{switch(v.tag){case 0:case 11:case 15:bm(9,v)}}catch(Ce){Ir(v,v.return,Ce)}if(v===m){_t=null;break e}var ve=v.sibling;if(ve!==null){ve.return=v.return,_t=ve;break e}_t=v.return}}if(wi=u,Ha(),ss&&typeof ss.onPostCommitFiberRoot=="function")try{ss.onPostCommitFiberRoot(pm,e)}catch{}l=!0}return l}finally{Di=r,Po.transition=t}}return!1}function k2(e,t,r){t=hc(r,t),t=sI(e,t,1),e=Fa(e,t,1),t=Bn(),e!==null&&(Td(e,1,t),Qn(e,t))}function Ir(e,t,r){if(e.tag===3)k2(e,e,r);else for(;t!==null;){if(t.tag===3){k2(t,e,r);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Oa===null||!Oa.has(l))){e=hc(r,e),e=aI(t,e,1),t=Fa(t,e,1),e=Bn(),t!==null&&(Td(t,1,e),Qn(t,e));break}}t=t.return}}function LP(e,t,r){var l=e.pingCache;l!==null&&l.delete(t),t=Bn(),e.pingedLanes|=e.suspendedLanes&r,Qr===e&&(un&r)===r&&(Vr===4||Vr===3&&(un&130023424)===un&&500>kr()-t1?Pl(e,0):e1|=r),Qn(e,t)}function EI(e,t){t===0&&((e.mode&1)===0?t=1:(t=vf,vf<<=1,(vf&130023424)===0&&(vf=4194304)));var r=Bn();e=Ws(e,t),e!==null&&(Td(e,t,r),Qn(e,r))}function RP(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),EI(e,r)}function DP(e,t){var r=0;switch(e.tag){case 13:var l=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(Qe(314))}l!==null&&l.delete(t),EI(e,r)}var AI;AI=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||qn.current)Yn=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Yn=!1,wP(e,t,r);Yn=(e.flags&131072)!==0}else Yn=!1,ar&&(t.flags&1048576)!==0&&kw(t,tm,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;Of(e,t),e=t.pendingProps;var u=ac(t,bn.current);nc(t,r),u=$v(null,t,l,e,u,r);var o=Yv();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jn(l)?(o=!0,Kf(t)):o=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Wv(t),u.updater=xm,t.stateNode=u,u._reactInternals=t,ov(t,l,e,r),t=lv(null,t,l,!0,o,r)):(t.tag=0,ar&&o&&Bv(t),Dn(null,t,u,r),t=t.child),t;case 16:l=t.elementType;e:{switch(Of(e,t),e=t.pendingProps,u=l._init,l=u(l._payload),t.type=l,u=t.tag=NP(l),e=Vo(l,e),u){case 0:t=av(null,t,l,e,r);break e;case 1:t=b2(null,t,l,e,r);break e;case 11:t=x2(null,t,l,e,r);break e;case 14:t=_2(null,t,l,Vo(l.type,e),r);break e}throw Error(Qe(306,l,""))}return t;case 0:return l=t.type,u=t.pendingProps,u=t.elementType===l?u:Vo(l,u),av(e,t,l,u,r);case 1:return l=t.type,u=t.pendingProps,u=t.elementType===l?u:Vo(l,u),b2(e,t,l,u,r);case 3:e:{if(hI(t),e===null)throw Error(Qe(387));l=t.pendingProps,o=t.memoizedState,u=o.element,Dw(e,t),nm(t,l,null,r);var m=t.memoizedState;if(l=m.element,o.isDehydrated)if(o={element:l,isDehydrated:!1,cache:m.cache,pendingSuspenseBoundaries:m.pendingSuspenseBoundaries,transitions:m.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){u=hc(Error(Qe(423)),t),t=w2(e,t,l,r,u);break e}else if(l!==u){u=hc(Error(Qe(424)),t),t=w2(e,t,l,r,u);break e}else for(uo=Na(t.stateNode.containerInfo.firstChild),co=t,ar=!0,Wo=null,r=Ow(t,null,l,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(lc(),l===u){t=Zs(e,t,r);break e}Dn(e,t,l,r)}t=t.child}return t;case 5:return Gw(t),e===null&&iv(t),l=t.type,u=t.pendingProps,o=e!==null?e.memoizedProps:null,m=u.children,Jy(l,u)?m=null:o!==null&&Jy(l,o)&&(t.flags|=32),cI(e,t),Dn(e,t,m,r),t.child;case 6:return e===null&&iv(t),null;case 13:return dI(e,t,r);case 4:return Zv(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=uc(t,null,l,r):Dn(e,t,l,r),t.child;case 11:return l=t.type,u=t.pendingProps,u=t.elementType===l?u:Vo(l,u),x2(e,t,l,u,r);case 7:return Dn(e,t,t.pendingProps,r),t.child;case 8:return Dn(e,t,t.pendingProps.children,r),t.child;case 12:return Dn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(l=t.type._context,u=t.pendingProps,o=t.memoizedProps,m=u.value,qi(im,l._currentValue),l._currentValue=m,o!==null)if(Ho(o.value,m)){if(o.children===u.children&&!qn.current){t=Zs(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var v=o.dependencies;if(v!==null){m=o.child;for(var b=v.firstContext;b!==null;){if(b.context===l){if(o.tag===1){b=Gs(-1,r&-r),b.tag=2;var C=o.updateQueue;if(C!==null){C=C.shared;var A=C.pending;A===null?b.next=b:(b.next=A.next,A.next=b),C.pending=b}}o.lanes|=r,b=o.alternate,b!==null&&(b.lanes|=r),rv(o.return,r,t),v.lanes|=r;break}b=b.next}}else if(o.tag===10)m=o.type===t.type?null:o.child;else if(o.tag===18){if(m=o.return,m===null)throw Error(Qe(341));m.lanes|=r,v=m.alternate,v!==null&&(v.lanes|=r),rv(m,r,t),m=o.sibling}else m=o.child;if(m!==null)m.return=o;else for(m=o;m!==null;){if(m===t){m=null;break}if(o=m.sibling,o!==null){o.return=m.return,m=o;break}m=m.return}o=m}Dn(e,t,u.children,r),t=t.child}return t;case 9:return u=t.type,l=t.pendingProps.children,nc(t,r),u=ko(u),l=l(u),t.flags|=1,Dn(e,t,l,r),t.child;case 14:return l=t.type,u=Vo(l,t.pendingProps),u=Vo(l.type,u),_2(e,t,l,u,r);case 15:return lI(e,t,t.type,t.pendingProps,r);case 17:return l=t.type,u=t.pendingProps,u=t.elementType===l?u:Vo(l,u),Of(e,t),t.tag=1,Jn(l)?(e=!0,Kf(t)):e=!1,nc(t,r),Nw(t,l,u),ov(t,l,u,r),lv(null,t,l,!0,e,r);case 19:return pI(e,t,r);case 22:return uI(e,t,r)}throw Error(Qe(156,t.tag))};function TI(e,t){return tw(e,t)}function BP(e,t,r,l){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function To(e,t,r,l){return new BP(e,t,r,l)}function o1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function NP(e){if(typeof e=="function")return o1(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sv)return 11;if(e===Cv)return 14}return 2}function Va(e,t){var r=e.alternate;return r===null?(r=To(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Uf(e,t,r,l,u,o){var m=2;if(l=e,typeof e=="function")o1(e)&&(m=1);else if(typeof e=="string")m=5;else e:switch(e){case Wu:return kl(r.children,u,o,t);case Iv:m=8,u|=8;break;case Ty:return e=To(12,r,t,u|2),e.elementType=Ty,e.lanes=o,e;case Py:return e=To(13,r,t,u),e.elementType=Py,e.lanes=o,e;case ky:return e=To(19,r,t,u),e.elementType=ky,e.lanes=o,e;case F2:return Im(r,u,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B2:m=10;break e;case N2:m=9;break e;case Sv:m=11;break e;case Cv:m=14;break e;case Aa:m=16,l=null;break e}throw Error(Qe(130,e==null?e:typeof e,""))}return t=To(m,r,t,u),t.elementType=e,t.type=l,t.lanes=o,t}function kl(e,t,r,l){return e=To(7,e,l,t),e.lanes=r,e}function Im(e,t,r,l){return e=To(22,e,l,t),e.elementType=F2,e.lanes=r,e.stateNode={isHidden:!1},e}function My(e,t,r){return e=To(6,e,null,t),e.lanes=r,e}function Ey(e,t,r){return t=To(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function FP(e,t,r,l,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cy(0),this.expirationTimes=cy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cy(0),this.identifierPrefix=l,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function s1(e,t,r,l,u,o,m,v,b){return e=new FP(e,t,r,v,b),t===1?(t=1,o===!0&&(t|=8)):t=0,o=To(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:l,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wv(o),e}function OP(e,t,r){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Uu,key:l==null?null:""+l,children:e,containerInfo:t,implementation:r}}function PI(e){if(!e)return Wa;e=e._reactInternals;e:{if(Fl(e)!==e||e.tag!==1)throw Error(Qe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Qe(171))}if(e.tag===1){var r=e.type;if(Jn(r))return Tw(e,r,t)}return t}function kI(e,t,r,l,u,o,m,v,b){return e=s1(r,l,!0,e,u,o,m,v,b),e.context=PI(null),r=e.current,l=Bn(),u=Ga(r),o=Gs(l,u),o.callback=t??null,Fa(r,o,u),e.current.lanes=u,Td(e,u,l),Qn(e,l),e}function Sm(e,t,r,l){var u=t.current,o=Bn(),m=Ga(u);return r=PI(r),t.context===null?t.context=r:t.pendingContext=r,t=Gs(o,m),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Fa(u,t,m),e!==null&&(jo(e,u,m,o),Bf(e,u,m)),m}function dm(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function z2(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function a1(e,t){z2(e,t),(e=e.alternate)&&z2(e,t)}function GP(){return null}var zI=typeof reportError=="function"?reportError:function(e){console.error(e)};function l1(e){this._internalRoot=e}Cm.prototype.render=l1.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Qe(409));Sm(e,t,null,null)};Cm.prototype.unmount=l1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bl(function(){Sm(null,e,null,null)}),t[Us]=null}};function Cm(e){this._internalRoot=e}Cm.prototype.unstable_scheduleHydration=function(e){if(e){var t=lw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Pa.length&&t!==0&&t<Pa[r].priority;r++);Pa.splice(r,0,e),r===0&&cw(e)}};function u1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Mm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function L2(){}function VP(e,t,r,l,u){if(u){if(typeof l=="function"){var o=l;l=function(){var C=dm(m);o.call(C)}}var m=kI(t,l,e,0,null,!1,!1,"",L2);return e._reactRootContainer=m,e[Us]=m.current,_d(e.nodeType===8?e.parentNode:e),Bl(),m}for(;u=e.lastChild;)e.removeChild(u);if(typeof l=="function"){var v=l;l=function(){var C=dm(b);v.call(C)}}var b=s1(e,0,!1,null,null,!1,!1,"",L2);return e._reactRootContainer=b,e[Us]=b.current,_d(e.nodeType===8?e.parentNode:e),Bl(function(){Sm(t,b,r,l)}),b}function Em(e,t,r,l,u){var o=r._reactRootContainer;if(o){var m=o;if(typeof u=="function"){var v=u;u=function(){var b=dm(m);v.call(b)}}Sm(t,m,e,u)}else m=VP(r,t,e,u,l);return dm(m)}sw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=td(t.pendingLanes);r!==0&&(Av(t,r|1),Qn(t,kr()),(wi&6)===0&&(dc=kr()+500,Ha()))}break;case 13:Bl(function(){var l=Ws(e,1);if(l!==null){var u=Bn();jo(l,e,1,u)}}),a1(e,1)}};Tv=function(e){if(e.tag===13){var t=Ws(e,134217728);if(t!==null){var r=Bn();jo(t,e,134217728,r)}a1(e,134217728)}};aw=function(e){if(e.tag===13){var t=Ga(e),r=Ws(e,t);if(r!==null){var l=Bn();jo(r,e,t,l)}a1(e,t)}};lw=function(){return Di};uw=function(e,t){var r=Di;try{return Di=e,t()}finally{Di=r}};Vy=function(e,t,r){switch(t){case"input":if(Ry(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var l=r[t];if(l!==e&&l.form===e.form){var u=ym(l);if(!u)throw Error(Qe(90));G2(l),Ry(l,u)}}}break;case"textarea":U2(e,r);break;case"select":t=r.value,t!=null&&ec(e,!!r.multiple,t,!1)}};Y2=i1;q2=Bl;var UP={usingClientEntryPoint:!1,Events:[kd,Xu,ym,X2,$2,i1]},Jh={findFiberByHostInstance:El,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},WP={bundleType:Jh.bundleType,version:Jh.version,rendererPackageName:Jh.rendererPackageName,rendererConfig:Jh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:js.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=K2(e),e===null?null:e.stateNode},findFiberByHostInstance:Jh.findFiberByHostInstance||GP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Qh.isDisabled&&Qh.supportsFiber))try{pm=Qh.inject(WP),ss=Qh}catch{}var Qh;fo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=UP;fo.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u1(t))throw Error(Qe(200));return OP(e,t,null,r)};fo.createRoot=function(e,t){if(!u1(e))throw Error(Qe(299));var r=!1,l="",u=zI;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=s1(e,1,!1,null,null,r,!1,l,u),e[Us]=t.current,_d(e.nodeType===8?e.parentNode:e),new l1(t)};fo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Qe(188)):(e=Object.keys(e).join(","),Error(Qe(268,e)));return e=K2(t),e=e===null?null:e.stateNode,e};fo.flushSync=function(e){return Bl(e)};fo.hydrate=function(e,t,r){if(!Mm(t))throw Error(Qe(200));return Em(null,e,t,!0,r)};fo.hydrateRoot=function(e,t,r){if(!u1(e))throw Error(Qe(405));var l=r!=null&&r.hydratedSources||null,u=!1,o="",m=zI;if(r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(m=r.onRecoverableError)),t=kI(t,null,e,1,r??null,u,!1,o,m),e[Us]=t.current,_d(e),l)for(e=0;e<l.length;e++)r=l[e],u=r._getVersion,u=u(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,u]:t.mutableSourceEagerHydrationData.push(r,u);return new Cm(t)};fo.render=function(e,t,r){if(!Mm(t))throw Error(Qe(200));return Em(null,e,t,!1,r)};fo.unmountComponentAtNode=function(e){if(!Mm(e))throw Error(Qe(40));return e._reactRootContainer?(Bl(function(){Em(null,null,e,!1,function(){e._reactRootContainer=null,e[Us]=null})}),!0):!1};fo.unstable_batchedUpdates=i1;fo.unstable_renderSubtreeIntoContainer=function(e,t,r,l){if(!Mm(r))throw Error(Qe(200));if(e==null||e._reactInternals===void 0)throw Error(Qe(38));return Em(e,t,r,!1,l)};fo.version="18.2.0-next-9e3b772b8-20220608"});var Am=Gt((cB,DI)=>{"use strict";function RI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RI)}catch(e){console.error(e)}}RI(),DI.exports=LI()});var NI=Gt(c1=>{"use strict";var BI=Am();c1.createRoot=BI.createRoot,c1.hydrateRoot=BI.hydrateRoot;var hB});var FI=Gt(()=>{});var XI=Gt(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Nztm2000Quad=void 0;Pm.Nztm2000Quad={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid V2",abstract:"",identifier:"NZTM2000Quad",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[419435.9938,-32605867284e-4],upperCorner:[104381901652e-4,6758167443e-3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:139770566007179e-6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:698852830035895e-7,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:3494264150179475e-8,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:17471320750897374e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:8735660375448687e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:4.3678301877243435e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:2.1839150938621718e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:1.0919575469310859e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:545978.7734655429,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:272989.38673277147,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:136494.69336638573,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:68247.34668319287,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:34123.67334159643,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:17061.836670798217,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:8530.918335399108,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:4265.459167699554,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:2132.729583849777,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:1066.3647919248886,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:533.1823959624443,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:266.59119798122214,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:133.29559899061107,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:66.64779949530553,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152}]}});var $I=Gt(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.Nztm2000=void 0;km.Nztm2000={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid",abstract:"See https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/nztm2000-map-tile-service-schema",identifier:"NZTM2000",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[3087e3,274e3],upperCorner:[7173e3,3327e3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:32e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:4},{type:"TileMatrixType",identifier:"1",scaleDenominator:16e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:8},{type:"TileMatrixType",identifier:"2",scaleDenominator:8e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:16},{type:"TileMatrixType",identifier:"3",scaleDenominator:4e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:32},{type:"TileMatrixType",identifier:"4",scaleDenominator:2e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:64},{type:"TileMatrixType",identifier:"5",scaleDenominator:1e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:128},{type:"TileMatrixType",identifier:"6",scaleDenominator:5e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:256},{type:"TileMatrixType",identifier:"7",scaleDenominator:25e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:512},{type:"TileMatrixType",identifier:"8",scaleDenominator:1e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:640,matrixHeight:1280},{type:"TileMatrixType",identifier:"9",scaleDenominator:5e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:1280,matrixHeight:2560},{type:"TileMatrixType",identifier:"10",scaleDenominator:25e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2560,matrixHeight:5120},{type:"TileMatrixType",identifier:"11",scaleDenominator:1e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:6400,matrixHeight:12800},{type:"TileMatrixType",identifier:"12",scaleDenominator:5e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:12800,matrixHeight:25600},{type:"TileMatrixType",identifier:"13",scaleDenominator:2500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:25600,matrixHeight:51200},{type:"TileMatrixType",identifier:"14",scaleDenominator:1e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64e3,matrixHeight:128e3},{type:"TileMatrixType",identifier:"15",scaleDenominator:500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128e3,matrixHeight:256e3},{type:"TileMatrixType",identifier:"16",scaleDenominator:250,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256e3,matrixHeight:512e3}]}});var YI=Gt(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.Nztm2000=yc.Nztm2000Quad=void 0;var QP=XI();Object.defineProperty(yc,"Nztm2000Quad",{enumerable:!0,get:function(){return QP.Nztm2000Quad}});var KP=$I();Object.defineProperty(yc,"Nztm2000",{enumerable:!0,get:function(){return KP.Nztm2000}})});var JI=Gt(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.once=Xs.Emitter=Xs.ALL_EVENTS=void 0;Xs.ALL_EVENTS=Symbol("ALL_EVENTS");function e5(e,t){return e.add(t),function(){return e.delete(t)}}function qI(e,...t){if(e)for(let{fn:r}of e)r(...t)}var m1=class{constructor(){this.$=Object.create(null)}on(t,r){let l=this.$[t]=this.$[t]||new Set;return e5(l,{fn:r})}emit(t,...r){qI(this.$[t],...r),qI(this.$[Xs.ALL_EVENTS],{type:t,args:r})}};Xs.Emitter=m1;function t5(e,t,r){let l=e.on(t,function(...o){return l(),r(...o)});return l}Xs.once=t5});var KI=Gt((nN,QI)=>{"use strict";QI.exports=Lm;Lm.polyline=Lm;Lm.polygon=r5;function Lm(e,t,r){var l=e.length,u=xc(e[0],t),o=[],m,v,b,C,A;for(r||(r=[]),m=1;m<l;m++){for(v=e[m-1],b=e[m],C=A=xc(b,t);;)if(u|C){if(u&C)break;u?(v=y1(v,b,u,t),u=xc(v,t)):(b=y1(v,b,C,t),C=xc(b,t))}else{o.push(v),C!==A?(o.push(b),m<l-1&&(r.push(o),o=[])):m===l-1&&o.push(b);break}u=A}return o.length&&r.push(o),r}function r5(e,t){var r,l,u,o,m,v,b;for(l=1;l<=8;l*=2){for(r=[],u=e[e.length-1],o=!(xc(u,t)&l),m=0;m<e.length;m++)v=e[m],b=!(xc(v,t)&l),b!==o&&r.push(y1(u,v,l,t)),b&&r.push(v),u=v,o=b;if(e=r,!e.length)break}return r}function y1(e,t,r,l){return r&8?[e[0]+(t[0]-e[0])*(l[3]-e[1])/(t[1]-e[1]),l[3]]:r&4?[e[0]+(t[0]-e[0])*(l[1]-e[1])/(t[1]-e[1]),l[1]]:r&2?[l[2],e[1]+(t[1]-e[1])*(l[2]-e[0])/(t[0]-e[0])]:r&1?[l[0],e[1]+(t[1]-e[1])*(l[0]-e[0])/(t[0]-e[0])]:null}function xc(e,t){var r=0;return e[0]<t[0]?r|=1:e[0]>t[2]&&(r|=2),e[1]<t[1]?r|=4:e[1]>t[3]&&(r|=8),r}});var eS=Gt((v1,x1)=>{(function(e,t){typeof v1=="object"&&typeof x1<"u"?x1.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(v1,function(){"use strict";function e(_e,V){if(!(_e instanceof V))throw new TypeError("Cannot call a class as a function")}function t(_e,V){for(var F=0;F<V.length;F++){var U=V[F];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(_e,U.key,U)}}function r(_e,V,F){return V&&t(_e.prototype,V),F&&t(_e,F),_e}var l=function(){function _e(V,F){this.next=null,this.key=V,this.data=F,this.left=null,this.right=null}return _e}();function u(_e,V){return _e>V?1:_e<V?-1:0}function o(_e,V,F){for(var U=new l(null,null),K=U,he=U;;){var Ie=F(_e,V.key);if(Ie<0){if(V.left===null)break;if(F(_e,V.left.key)<0){var Ve=V.left;if(V.left=Ve.right,Ve.right=V,V=Ve,V.left===null)break}he.left=V,he=V,V=V.left}else if(Ie>0){if(V.right===null)break;if(F(_e,V.right.key)>0){var Ve=V.right;if(V.right=Ve.left,Ve.left=V,V=Ve,V.right===null)break}K.right=V,K=V,V=V.right}else break}return K.right=V.left,he.left=V.right,V.left=U.right,V.right=U.left,V}function m(_e,V,F,U){var K=new l(_e,V);if(F===null)return K.left=K.right=null,K;F=o(_e,F,U);var he=U(_e,F.key);return he<0?(K.left=F.left,K.right=F,F.left=null):he>=0&&(K.right=F.right,K.left=F,F.right=null),K}function v(_e,V,F){var U=null,K=null;if(V){V=o(_e,V,F);var he=F(V.key,_e);he===0?(U=V.left,K=V.right):he<0?(K=V.right,V.right=null,U=V):(U=V.left,V.left=null,K=V)}return{left:U,right:K}}function b(_e,V,F){return V===null?_e:(_e===null||(V=o(_e.key,V,F),V.left=_e),V)}function C(_e,V,F,U,K){if(_e){U(""+V+(F?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+K(_e)+`
9
+ `);var he=V+(F?" ":"\u2502 ");_e.left&&C(_e.left,he,!1,U,K),_e.right&&C(_e.right,he,!0,U,K)}}var A=function(){function _e(V){V===void 0&&(V=u),this._root=null,this._size=0,this._comparator=V}return _e.prototype.insert=function(V,F){return this._size++,this._root=m(V,F,this._root,this._comparator)},_e.prototype.add=function(V,F){var U=new l(V,F);this._root===null&&(U.left=U.right=null,this._size++,this._root=U);var K=this._comparator,he=o(V,this._root,K),Ie=K(V,he.key);return Ie===0?this._root=he:(Ie<0?(U.left=he.left,U.right=he,he.left=null):Ie>0&&(U.right=he.right,U.left=he,he.right=null),this._size++,this._root=U),this._root},_e.prototype.remove=function(V){this._root=this._remove(V,this._root,this._comparator)},_e.prototype._remove=function(V,F,U){var K;if(F===null)return null;F=o(V,F,U);var he=U(V,F.key);return he===0?(F.left===null?K=F.right:(K=o(V,F.left,U),K.right=F.right),this._size--,K):F},_e.prototype.pop=function(){var V=this._root;if(V){for(;V.left;)V=V.left;return this._root=o(V.key,this._root,this._comparator),this._root=this._remove(V.key,this._root,this._comparator),{key:V.key,data:V.data}}return null},_e.prototype.findStatic=function(V){for(var F=this._root,U=this._comparator;F;){var K=U(V,F.key);if(K===0)return F;K<0?F=F.left:F=F.right}return null},_e.prototype.find=function(V){return this._root&&(this._root=o(V,this._root,this._comparator),this._comparator(V,this._root.key)!==0)?null:this._root},_e.prototype.contains=function(V){for(var F=this._root,U=this._comparator;F;){var K=U(V,F.key);if(K===0)return!0;K<0?F=F.left:F=F.right}return!1},_e.prototype.forEach=function(V,F){for(var U=this._root,K=[],he=!1;!he;)U!==null?(K.push(U),U=U.left):K.length!==0?(U=K.pop(),V.call(F,U),U=U.right):he=!0;return this},_e.prototype.range=function(V,F,U,K){for(var he=[],Ie=this._comparator,Ve=this._root,He;he.length!==0||Ve;)if(Ve)he.push(Ve),Ve=Ve.left;else{if(Ve=he.pop(),He=Ie(Ve.key,F),He>0)break;if(Ie(Ve.key,V)>=0&&U.call(K,Ve))return this;Ve=Ve.right}return this},_e.prototype.keys=function(){var V=[];return this.forEach(function(F){var U=F.key;return V.push(U)}),V},_e.prototype.values=function(){var V=[];return this.forEach(function(F){var U=F.data;return V.push(U)}),V},_e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},_e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},_e.prototype.minNode=function(V){if(V===void 0&&(V=this._root),V)for(;V.left;)V=V.left;return V},_e.prototype.maxNode=function(V){if(V===void 0&&(V=this._root),V)for(;V.right;)V=V.right;return V},_e.prototype.at=function(V){for(var F=this._root,U=!1,K=0,he=[];!U;)if(F)he.push(F),F=F.left;else if(he.length>0){if(F=he.pop(),K===V)return F;K++,F=F.right}else U=!0;return null},_e.prototype.next=function(V){var F=this._root,U=null;if(V.right){for(U=V.right;U.left;)U=U.left;return U}for(var K=this._comparator;F;){var he=K(V.key,F.key);if(he===0)break;he<0?(U=F,F=F.left):F=F.right}return U},_e.prototype.prev=function(V){var F=this._root,U=null;if(V.left!==null){for(U=V.left;U.right;)U=U.right;return U}for(var K=this._comparator;F;){var he=K(V.key,F.key);if(he===0)break;he<0?F=F.left:(U=F,F=F.right)}return U},_e.prototype.clear=function(){return this._root=null,this._size=0,this},_e.prototype.toList=function(){return q(this._root)},_e.prototype.load=function(V,F,U){F===void 0&&(F=[]),U===void 0&&(U=!1);var K=V.length,he=this._comparator;if(U&&de(V,F,0,K-1,he),this._root===null)this._root=B(V,F,0,K),this._size=K;else{var Ie=le(this.toList(),Z(V,F),he);K=this._size+K,this._root=ee({head:Ie},0,K)}return this},_e.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(_e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(_e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),_e.prototype.toString=function(V){V===void 0&&(V=function(K){return String(K.key)});var F=[];return C(this._root,"",!0,function(U){return F.push(U)},V),F.join("")},_e.prototype.update=function(V,F,U){var K=this._comparator,he=v(V,this._root,K),Ie=he.left,Ve=he.right;K(V,F)<0?Ve=m(F,U,Ve,K):Ie=m(F,U,Ie,K),this._root=b(Ie,Ve,K)},_e.prototype.split=function(V){return v(V,this._root,this._comparator)},_e}();function B(_e,V,F,U){var K=U-F;if(K>0){var he=F+Math.floor(K/2),Ie=_e[he],Ve=V[he],He=new l(Ie,Ve);return He.left=B(_e,V,F,he),He.right=B(_e,V,he+1,U),He}return null}function Z(_e,V){for(var F=new l(null,null),U=F,K=0;K<_e.length;K++)U=U.next=new l(_e[K],V[K]);return U.next=null,F.next}function q(_e){for(var V=_e,F=[],U=!1,K=new l(null,null),he=K;!U;)V?(F.push(V),V=V.left):F.length>0?(V=he=he.next=F.pop(),V=V.right):U=!0;return he.next=null,K.next}function ee(_e,V,F){var U=F-V;if(U>0){var K=V+Math.floor(U/2),he=ee(_e,V,K),Ie=_e.head;return Ie.left=he,_e.head=_e.head.next,Ie.right=ee(_e,K+1,F),Ie}return null}function le(_e,V,F){for(var U=new l(null,null),K=U,he=_e,Ie=V;he!==null&&Ie!==null;)F(he.key,Ie.key)<0?(K.next=he,he=he.next):(K.next=Ie,Ie=Ie.next),K=K.next;return he!==null?K.next=he:Ie!==null&&(K.next=Ie),U.next}function de(_e,V,F,U,K){if(!(F>=U)){for(var he=_e[F+U>>1],Ie=F-1,Ve=U+1;;){do Ie++;while(K(_e[Ie],he)<0);do Ve--;while(K(_e[Ve],he)>0);if(Ie>=Ve)break;var He=_e[Ie];_e[Ie]=_e[Ve],_e[Ve]=He,He=V[Ie],V[Ie]=V[Ve],V[Ve]=He}de(_e,V,F,Ve,K),de(_e,V,Ve+1,U,K)}}var H=function(V,F){return V.ll.x<=F.x&&F.x<=V.ur.x&&V.ll.y<=F.y&&F.y<=V.ur.y},Q=function(V,F){if(F.ur.x<V.ll.x||V.ur.x<F.ll.x||F.ur.y<V.ll.y||V.ur.y<F.ll.y)return null;var U=V.ll.x<F.ll.x?F.ll.x:V.ll.x,K=V.ur.x<F.ur.x?V.ur.x:F.ur.x,he=V.ll.y<F.ll.y?F.ll.y:V.ll.y,Ie=V.ur.y<F.ur.y?V.ur.y:F.ur.y;return{ll:{x:U,y:he},ur:{x:K,y:Ie}}},te=Number.EPSILON;te===void 0&&(te=Math.pow(2,-52));var ve=te*te,Ce=function(V,F){if(-te<V&&V<te&&-te<F&&F<te)return 0;var U=V-F;return U*U<ve*V*F?0:V<F?-1:1},Se=function(){function _e(){e(this,_e),this.reset()}return r(_e,[{key:"reset",value:function(){this.xRounder=new Be,this.yRounder=new Be}},{key:"round",value:function(F,U){return{x:this.xRounder.round(F),y:this.yRounder.round(U)}}}]),_e}(),Be=function(){function _e(){e(this,_e),this.tree=new A,this.round(0)}return r(_e,[{key:"round",value:function(F){var U=this.tree.add(F),K=this.tree.prev(U);if(K!==null&&Ce(U.key,K.key)===0)return this.tree.remove(F),K.key;var he=this.tree.next(U);return he!==null&&Ce(U.key,he.key)===0?(this.tree.remove(F),he.key):F}}]),_e}(),Fe=new Se,qe=function(V,F){return V.x*F.y-V.y*F.x},ht=function(V,F){return V.x*F.x+V.y*F.y},At=function(V,F,U){var K={x:F.x-V.x,y:F.y-V.y},he={x:U.x-V.x,y:U.y-V.y},Ie=qe(K,he);return Ce(Ie,0)},Ot=function(V){return Math.sqrt(ht(V,V))},Yt=function(V,F,U){var K={x:F.x-V.x,y:F.y-V.y},he={x:U.x-V.x,y:U.y-V.y};return qe(he,K)/Ot(he)/Ot(K)},at=function(V,F,U){var K={x:F.x-V.x,y:F.y-V.y},he={x:U.x-V.x,y:U.y-V.y};return ht(he,K)/Ot(he)/Ot(K)},Zt=function(V,F,U){return F.y===0?null:{x:V.x+F.x/F.y*(U-V.y),y:U}},zi=function(V,F,U){return F.x===0?null:{x:U,y:V.y+F.y/F.x*(U-V.x)}},Ii=function(V,F,U,K){if(F.x===0)return zi(U,K,V.x);if(K.x===0)return zi(V,F,U.x);if(F.y===0)return Zt(U,K,V.y);if(K.y===0)return Zt(V,F,U.y);var he=qe(F,K);if(he==0)return null;var Ie={x:U.x-V.x,y:U.y-V.y},Ve=qe(Ie,F)/he,He=qe(Ie,K)/he,ye=V.x+He*F.x,Re=U.x+Ve*K.x,ie=V.y+He*F.y,Xe=U.y+Ve*K.y,$e=(ye+Re)/2,ft=(ie+Xe)/2;return{x:$e,y:ft}},jt=function(){r(_e,null,[{key:"compare",value:function(F,U){var K=_e.comparePoints(F.point,U.point);return K!==0?K:(F.point!==U.point&&F.link(U),F.isLeft!==U.isLeft?F.isLeft?1:-1:Xi.compare(F.segment,U.segment))}},{key:"comparePoints",value:function(F,U){return F.x<U.x?-1:F.x>U.x?1:F.y<U.y?-1:F.y>U.y?1:0}}]);function _e(V,F){e(this,_e),V.events===void 0?V.events=[this]:V.events.push(this),this.point=V,this.isLeft=F}return r(_e,[{key:"link",value:function(F){if(F.point===this.point)throw new Error("Tried to link already linked events");for(var U=F.point.events,K=0,he=U.length;K<he;K++){var Ie=U[K];this.point.events.push(Ie),Ie.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var F=this.point.events.length,U=0;U<F;U++){var K=this.point.events[U];if(K.segment.consumedBy===void 0)for(var he=U+1;he<F;he++){var Ie=this.point.events[he];Ie.consumedBy===void 0&&K.otherSE.point.events===Ie.otherSE.point.events&&K.segment.consume(Ie.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var F=[],U=0,K=this.point.events.length;U<K;U++){var he=this.point.events[U];he!==this&&!he.segment.ringOut&&he.segment.isInResult()&&F.push(he)}return F}},{key:"getLeftmostComparator",value:function(F){var U=this,K=new Map,he=function(Ve){var He=Ve.otherSE;K.set(Ve,{sine:Yt(U.point,F.point,He.point),cosine:at(U.point,F.point,He.point)})};return function(Ie,Ve){K.has(Ie)||he(Ie),K.has(Ve)||he(Ve);var He=K.get(Ie),ye=He.sine,Re=He.cosine,ie=K.get(Ve),Xe=ie.sine,$e=ie.cosine;return ye>=0&&Xe>=0?Re<$e?1:Re>$e?-1:0:ye<0&&Xe<0?Re<$e?-1:Re>$e?1:0:Xe<ye?-1:Xe>ye?1:0}}}]),_e}(),ur=0,Xi=function(){r(_e,null,[{key:"compare",value:function(F,U){var K=F.leftSE.point.x,he=U.leftSE.point.x,Ie=F.rightSE.point.x,Ve=U.rightSE.point.x;if(Ve<K)return 1;if(Ie<he)return-1;var He=F.leftSE.point.y,ye=U.leftSE.point.y,Re=F.rightSE.point.y,ie=U.rightSE.point.y;if(K<he){if(ye<He&&ye<Re)return 1;if(ye>He&&ye>Re)return-1;var Xe=F.comparePoint(U.leftSE.point);if(Xe<0)return 1;if(Xe>0)return-1;var $e=U.comparePoint(F.rightSE.point);return $e!==0?$e:-1}if(K>he){if(He<ye&&He<ie)return-1;if(He>ye&&He>ie)return 1;var ft=U.comparePoint(F.leftSE.point);if(ft!==0)return ft;var ut=F.comparePoint(U.rightSE.point);return ut<0?1:ut>0?-1:1}if(He<ye)return-1;if(He>ye)return 1;if(Ie<Ve){var Ht=U.comparePoint(F.rightSE.point);if(Ht!==0)return Ht}if(Ie>Ve){var Tt=F.comparePoint(U.rightSE.point);if(Tt<0)return 1;if(Tt>0)return-1}if(Ie!==Ve){var Ue=Re-He,It=Ie-K,yt=ie-ye,ri=Ve-he;if(Ue>It&&yt<ri)return 1;if(Ue<It&&yt>ri)return-1}return Ie>Ve?1:Ie<Ve||Re<ie?-1:Re>ie?1:F.id<U.id?-1:F.id>U.id?1:0}}]);function _e(V,F,U,K){e(this,_e),this.id=++ur,this.leftSE=V,V.segment=this,V.otherSE=F,this.rightSE=F,F.segment=this,F.otherSE=V,this.rings=U,this.windings=K}return r(_e,[{key:"replaceRightSE",value:function(F){this.rightSE=F,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var F=this.leftSE.point.y,U=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:F<U?F:U},ur:{x:this.rightSE.point.x,y:F>U?F:U}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(F){return F.x===this.leftSE.point.x&&F.y===this.leftSE.point.y||F.x===this.rightSE.point.x&&F.y===this.rightSE.point.y}},{key:"comparePoint",value:function(F){if(this.isAnEndpoint(F))return 0;var U=this.leftSE.point,K=this.rightSE.point,he=this.vector();if(U.x===K.x)return F.x===U.x?0:F.x<U.x?1:-1;var Ie=(F.y-U.y)/he.y,Ve=U.x+Ie*he.x;if(F.x===Ve)return 0;var He=(F.x-U.x)/he.x,ye=U.y+He*he.y;return F.y===ye?0:F.y<ye?-1:1}},{key:"getIntersection",value:function(F){var U=this.bbox(),K=F.bbox(),he=Q(U,K);if(he===null)return null;var Ie=this.leftSE.point,Ve=this.rightSE.point,He=F.leftSE.point,ye=F.rightSE.point,Re=H(U,He)&&this.comparePoint(He)===0,ie=H(K,Ie)&&F.comparePoint(Ie)===0,Xe=H(U,ye)&&this.comparePoint(ye)===0,$e=H(K,Ve)&&F.comparePoint(Ve)===0;if(ie&&Re)return $e&&!Xe?Ve:!$e&&Xe?ye:null;if(ie)return Xe&&Ie.x===ye.x&&Ie.y===ye.y?null:Ie;if(Re)return $e&&Ve.x===He.x&&Ve.y===He.y?null:He;if($e&&Xe)return null;if($e)return Ve;if(Xe)return ye;var ft=Ii(Ie,this.vector(),He,F.vector());return ft===null||!H(he,ft)?null:Fe.round(ft.x,ft.y)}},{key:"split",value:function(F){var U=[],K=F.events!==void 0,he=new jt(F,!0),Ie=new jt(F,!1),Ve=this.rightSE;this.replaceRightSE(Ie),U.push(Ie),U.push(he);var He=new _e(he,Ve,this.rings.slice(),this.windings.slice());return jt.comparePoints(He.leftSE.point,He.rightSE.point)>0&&He.swapEvents(),jt.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),K&&(he.checkForConsuming(),Ie.checkForConsuming()),U}},{key:"swapEvents",value:function(){var F=this.rightSE;this.rightSE=this.leftSE,this.leftSE=F,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var U=0,K=this.windings.length;U<K;U++)this.windings[U]*=-1}},{key:"consume",value:function(F){for(var U=this,K=F;U.consumedBy;)U=U.consumedBy;for(;K.consumedBy;)K=K.consumedBy;var he=_e.compare(U,K);if(he!==0){if(he>0){var Ie=U;U=K,K=Ie}if(U.prev===K){var Ve=U;U=K,K=Ve}for(var He=0,ye=K.rings.length;He<ye;He++){var Re=K.rings[He],ie=K.windings[He],Xe=U.rings.indexOf(Re);Xe===-1?(U.rings.push(Re),U.windings.push(ie)):U.windings[Xe]+=ie}K.rings=null,K.windings=null,K.consumedBy=U,K.leftSE.consumedBy=U.leftSE,K.rightSE.consumedBy=U.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var F=this.prev.consumedBy||this.prev;this._beforeState=F.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var F=this.beforeState();this._afterState={rings:F.rings.slice(0),windings:F.windings.slice(0),multiPolys:[]};for(var U=this._afterState.rings,K=this._afterState.windings,he=this._afterState.multiPolys,Ie=0,Ve=this.rings.length;Ie<Ve;Ie++){var He=this.rings[Ie],ye=this.windings[Ie],Re=U.indexOf(He);Re===-1?(U.push(He),K.push(ye)):K[Re]+=ye}for(var ie=[],Xe=[],$e=0,ft=U.length;$e<ft;$e++)if(K[$e]!==0){var ut=U[$e],Ht=ut.poly;if(Xe.indexOf(Ht)===-1)if(ut.isExterior)ie.push(Ht);else{Xe.indexOf(Ht)===-1&&Xe.push(Ht);var Tt=ie.indexOf(ut.poly);Tt!==-1&&ie.splice(Tt,1)}}for(var Ue=0,It=ie.length;Ue<It;Ue++){var yt=ie[Ue].multiPoly;he.indexOf(yt)===-1&&he.push(yt)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var F=this.beforeState().multiPolys,U=this.afterState().multiPolys;switch(ii.type){case"union":{var K=F.length===0,he=U.length===0;this._isInResult=K!==he;break}case"intersection":{var Ie,Ve;F.length<U.length?(Ie=F.length,Ve=U.length):(Ie=U.length,Ve=F.length),this._isInResult=Ve===ii.numMultiPolys&&Ie<Ve;break}case"xor":{var He=Math.abs(F.length-U.length);this._isInResult=He%2===1;break}case"difference":{var ye=function(ie){return ie.length===1&&ie[0].isSubject};this._isInResult=ye(F)!==ye(U);break}default:throw new Error("Unrecognized operation type found ".concat(ii.type))}return this._isInResult}}],[{key:"fromRing",value:function(F,U,K){var he,Ie,Ve,He=jt.comparePoints(F,U);if(He<0)he=F,Ie=U,Ve=1;else if(He>0)he=U,Ie=F,Ve=-1;else throw new Error("Tried to create degenerate segment at [".concat(F.x,", ").concat(F.y,"]"));var ye=new jt(he,!0),Re=new jt(Ie,!1);return new _e(ye,Re,[K],[Ve])}}]),_e}(),si=function(){function _e(V,F,U){if(e(this,_e),!Array.isArray(V)||V.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=F,this.isExterior=U,this.segments=[],typeof V[0][0]!="number"||typeof V[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var K=Fe.round(V[0][0],V[0][1]);this.bbox={ll:{x:K.x,y:K.y},ur:{x:K.x,y:K.y}};for(var he=K,Ie=1,Ve=V.length;Ie<Ve;Ie++){if(typeof V[Ie][0]!="number"||typeof V[Ie][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var He=Fe.round(V[Ie][0],V[Ie][1]);He.x===he.x&&He.y===he.y||(this.segments.push(Xi.fromRing(he,He,this)),He.x<this.bbox.ll.x&&(this.bbox.ll.x=He.x),He.y<this.bbox.ll.y&&(this.bbox.ll.y=He.y),He.x>this.bbox.ur.x&&(this.bbox.ur.x=He.x),He.y>this.bbox.ur.y&&(this.bbox.ur.y=He.y),he=He)}(K.x!==he.x||K.y!==he.y)&&this.segments.push(Xi.fromRing(he,K,this))}return r(_e,[{key:"getSweepEvents",value:function(){for(var F=[],U=0,K=this.segments.length;U<K;U++){var he=this.segments[U];F.push(he.leftSE),F.push(he.rightSE)}return F}}]),_e}(),ti=function(){function _e(V,F){if(e(this,_e),!Array.isArray(V))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new si(V[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var U=1,K=V.length;U<K;U++){var he=new si(V[U],this,!1);he.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=he.bbox.ll.x),he.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=he.bbox.ll.y),he.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=he.bbox.ur.x),he.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=he.bbox.ur.y),this.interiorRings.push(he)}this.multiPoly=F}return r(_e,[{key:"getSweepEvents",value:function(){for(var F=this.exteriorRing.getSweepEvents(),U=0,K=this.interiorRings.length;U<K;U++)for(var he=this.interiorRings[U].getSweepEvents(),Ie=0,Ve=he.length;Ie<Ve;Ie++)F.push(he[Ie]);return F}}]),_e}(),_i=function(){function _e(V,F){if(e(this,_e),!Array.isArray(V))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof V[0][0][0]=="number"&&(V=[V])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var U=0,K=V.length;U<K;U++){var he=new ti(V[U],this);he.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=he.bbox.ll.x),he.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=he.bbox.ll.y),he.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=he.bbox.ur.x),he.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=he.bbox.ur.y),this.polys.push(he)}this.isSubject=F}return r(_e,[{key:"getSweepEvents",value:function(){for(var F=[],U=0,K=this.polys.length;U<K;U++)for(var he=this.polys[U].getSweepEvents(),Ie=0,Ve=he.length;Ie<Ve;Ie++)F.push(he[Ie]);return F}}]),_e}(),Ei=function(){r(_e,null,[{key:"factory",value:function(F){for(var U=[],K=0,he=F.length;K<he;K++){var Ie=F[K];if(!(!Ie.isInResult()||Ie.ringOut)){for(var Ve=null,He=Ie.leftSE,ye=Ie.rightSE,Re=[He],ie=He.point,Xe=[];Ve=He,He=ye,Re.push(He),He.point!==ie;)for(;;){var $e=He.getAvailableLinkedEvents();if($e.length===0){var ft=Re[0].point,ut=Re[Re.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(ft.x,",")+" ".concat(ft.y,"]. Last matching segment found ends at")+" [".concat(ut.x,", ").concat(ut.y,"]."))}if($e.length===1){ye=$e[0].otherSE;break}for(var Ht=null,Tt=0,Ue=Xe.length;Tt<Ue;Tt++)if(Xe[Tt].point===He.point){Ht=Tt;break}if(Ht!==null){var It=Xe.splice(Ht)[0],yt=Re.splice(It.index);yt.unshift(yt[0].otherSE),U.push(new _e(yt.reverse()));continue}Xe.push({index:Re.length,point:He.point});var ri=He.getLeftmostComparator(Ve);ye=$e.sort(ri)[0].otherSE;break}U.push(new _e(Re))}}return U}}]);function _e(V){e(this,_e),this.events=V;for(var F=0,U=V.length;F<U;F++)V[F].segment.ringOut=this;this.poly=null}return r(_e,[{key:"getGeom",value:function(){for(var F=this.events[0].point,U=[F],K=1,he=this.events.length-1;K<he;K++){var Ie=this.events[K].point,Ve=this.events[K+1].point;At(Ie,F,Ve)!==0&&(U.push(Ie),F=Ie)}if(U.length===1)return null;var He=U[0],ye=U[1];At(He,F,ye)===0&&U.shift(),U.push(U[0]);for(var Re=this.isExteriorRing()?1:-1,ie=this.isExteriorRing()?0:U.length-1,Xe=this.isExteriorRing()?U.length:-1,$e=[],ft=ie;ft!=Xe;ft+=Re)$e.push([U[ft].x,U[ft].y]);return $e}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var F=this.enclosingRing();this._isExteriorRing=F?!F.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var F=this.events[0],U=1,K=this.events.length;U<K;U++){var he=this.events[U];jt.compare(F,he)>0&&(F=he)}for(var Ie=F.segment.prevInResult(),Ve=Ie?Ie.prevInResult():null;;){if(!Ie)return null;if(!Ve)return Ie.ringOut;if(Ve.ringOut!==Ie.ringOut)return Ve.ringOut.enclosingRing()!==Ie.ringOut?Ie.ringOut:Ie.ringOut.enclosingRing();Ie=Ve.prevInResult(),Ve=Ie?Ie.prevInResult():null}}}]),_e}(),Li=function(){function _e(V){e(this,_e),this.exteriorRing=V,V.poly=this,this.interiorRings=[]}return r(_e,[{key:"addInterior",value:function(F){this.interiorRings.push(F),F.poly=this}},{key:"getGeom",value:function(){var F=[this.exteriorRing.getGeom()];if(F[0]===null)return null;for(var U=0,K=this.interiorRings.length;U<K;U++){var he=this.interiorRings[U].getGeom();he!==null&&F.push(he)}return F}}]),_e}(),Fi=function(){function _e(V){e(this,_e),this.rings=V,this.polys=this._composePolys(V)}return r(_e,[{key:"getGeom",value:function(){for(var F=[],U=0,K=this.polys.length;U<K;U++){var he=this.polys[U].getGeom();he!==null&&F.push(he)}return F}},{key:"_composePolys",value:function(F){for(var U=[],K=0,he=F.length;K<he;K++){var Ie=F[K];if(!Ie.poly)if(Ie.isExteriorRing())U.push(new Li(Ie));else{var Ve=Ie.enclosingRing();Ve.poly||U.push(new Li(Ve)),Ve.poly.addInterior(Ie)}}return U}}]),_e}(),Ji=function(){function _e(V){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xi.compare;e(this,_e),this.queue=V,this.tree=new A(F),this.segments=[]}return r(_e,[{key:"process",value:function(F){var U=F.segment,K=[];if(F.consumedBy)return F.isLeft?this.queue.remove(F.otherSE):this.tree.remove(U),K;var he=F.isLeft?this.tree.insert(U):this.tree.find(U);if(!he)throw new Error("Unable to find segment #".concat(U.id," ")+"[".concat(U.leftSE.point.x,", ").concat(U.leftSE.point.y,"] -> ")+"[".concat(U.rightSE.point.x,", ").concat(U.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Ie=he,Ve=he,He=void 0,ye=void 0;He===void 0;)Ie=this.tree.prev(Ie),Ie===null?He=null:Ie.key.consumedBy===void 0&&(He=Ie.key);for(;ye===void 0;)Ve=this.tree.next(Ve),Ve===null?ye=null:Ve.key.consumedBy===void 0&&(ye=Ve.key);if(F.isLeft){var Re=null;if(He){var ie=He.getIntersection(U);if(ie!==null&&(U.isAnEndpoint(ie)||(Re=ie),!He.isAnEndpoint(ie)))for(var Xe=this._splitSafely(He,ie),$e=0,ft=Xe.length;$e<ft;$e++)K.push(Xe[$e])}var ut=null;if(ye){var Ht=ye.getIntersection(U);if(Ht!==null&&(U.isAnEndpoint(Ht)||(ut=Ht),!ye.isAnEndpoint(Ht)))for(var Tt=this._splitSafely(ye,Ht),Ue=0,It=Tt.length;Ue<It;Ue++)K.push(Tt[Ue])}if(Re!==null||ut!==null){var yt=null;if(Re===null)yt=ut;else if(ut===null)yt=Re;else{var ri=jt.comparePoints(Re,ut);yt=ri<=0?Re:ut}this.queue.remove(U.rightSE),K.push(U.rightSE);for(var gi=U.split(yt),St=0,tr=gi.length;St<tr;St++)K.push(gi[St])}K.length>0?(this.tree.remove(U),K.push(F)):(this.segments.push(U),U.prev=He)}else{if(He&&ye){var ci=He.getIntersection(ye);if(ci!==null){if(!He.isAnEndpoint(ci))for(var Ri=this._splitSafely(He,ci),hi=0,Ft=Ri.length;hi<Ft;hi++)K.push(Ri[hi]);if(!ye.isAnEndpoint(ci))for(var di=this._splitSafely(ye,ci),ir=0,Ai=di.length;ir<Ai;ir++)K.push(di[ir])}}this.tree.remove(U)}return K}},{key:"_splitSafely",value:function(F,U){this.tree.remove(F);var K=F.rightSE;this.queue.remove(K);var he=F.split(U);return he.push(K),F.consumedBy===void 0&&this.tree.insert(F),he}}]),_e}(),Cr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,tn=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,no=function(){function _e(){e(this,_e)}return r(_e,[{key:"run",value:function(F,U,K){ii.type=F,Fe.reset();for(var he=[new _i(U,!0)],Ie=0,Ve=K.length;Ie<Ve;Ie++)he.push(new _i(K[Ie],!1));if(ii.numMultiPolys=he.length,ii.type==="difference")for(var He=he[0],ye=1;ye<he.length;)Q(he[ye].bbox,He.bbox)!==null?ye++:he.splice(ye,1);if(ii.type==="intersection"){for(var Re=0,ie=he.length;Re<ie;Re++)for(var Xe=he[Re],$e=Re+1,ft=he.length;$e<ft;$e++)if(Q(Xe.bbox,he[$e].bbox)===null)return[]}for(var ut=new A(jt.compare),Ht=0,Tt=he.length;Ht<Tt;Ht++)for(var Ue=he[Ht].getSweepEvents(),It=0,yt=Ue.length;It<yt;It++)if(ut.insert(Ue[It]),ut.size>Cr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var ri=new Ji(ut),gi=ut.size,St=ut.pop();St;){var tr=St.key;if(ut.size===gi){var ci=tr.segment;throw new Error("Unable to pop() ".concat(tr.isLeft?"left":"right"," SweepEvent ")+"[".concat(tr.point.x,", ").concat(tr.point.y,"] from segment #").concat(ci.id," ")+"[".concat(ci.leftSE.point.x,", ").concat(ci.leftSE.point.y,"] -> ")+"[".concat(ci.rightSE.point.x,", ").concat(ci.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(ut.size>Cr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(ri.segments.length>tn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var Ri=ri.process(tr),hi=0,Ft=Ri.length;hi<Ft;hi++){var di=Ri[hi];di.consumedBy===void 0&&ut.insert(di)}gi=ut.size,St=ut.pop()}Fe.reset();var ir=Ei.factory(ri.segments),Ai=new Fi(ir);return Ai.getGeom()}}]),_e}(),ii=new no,Hr=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ii.run("union",V,U)},hn=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ii.run("intersection",V,U)},rn=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ii.run("xor",V,U)},zr=function(V){for(var F=arguments.length,U=new Array(F>1?F-1:0),K=1;K<F;K++)U[K-1]=arguments[K];return ii.run("difference",V,U)},Qo={union:Hr,intersection:hn,xor:rn,difference:zr};return Qo})});var WC=Gt((EV,UC)=>{"use strict";function $L(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var l=0;l<e.length;l++){var u=e.charAt(l),o=u.charCodeAt(0);if(t[o]!==255)throw new TypeError(u+" is ambiguous");t[o]=l}var m=e.length,v=e.charAt(0),b=Math.log(m)/Math.log(256),C=Math.log(256)/Math.log(m);function A(q){if(q instanceof Uint8Array||(ArrayBuffer.isView(q)?q=new Uint8Array(q.buffer,q.byteOffset,q.byteLength):Array.isArray(q)&&(q=Uint8Array.from(q))),!(q instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(q.length===0)return"";for(var ee=0,le=0,de=0,H=q.length;de!==H&&q[de]===0;)de++,ee++;for(var Q=(H-de)*C+1>>>0,te=new Uint8Array(Q);de!==H;){for(var ve=q[de],Ce=0,Se=Q-1;(ve!==0||Ce<le)&&Se!==-1;Se--,Ce++)ve+=256*te[Se]>>>0,te[Se]=ve%m>>>0,ve=ve/m>>>0;if(ve!==0)throw new Error("Non-zero carry");le=Ce,de++}for(var Be=Q-le;Be!==Q&&te[Be]===0;)Be++;for(var Fe=v.repeat(ee);Be<Q;++Be)Fe+=e.charAt(te[Be]);return Fe}function B(q){if(typeof q!="string")throw new TypeError("Expected String");if(q.length===0)return new Uint8Array;for(var ee=0,le=0,de=0;q[ee]===v;)le++,ee++;for(var H=(q.length-ee)*b+1>>>0,Q=new Uint8Array(H);q[ee];){var te=t[q.charCodeAt(ee)];if(te===255)return;for(var ve=0,Ce=H-1;(te!==0||ve<de)&&Ce!==-1;Ce--,ve++)te+=m*Q[Ce]>>>0,Q[Ce]=te%256>>>0,te=te/256>>>0;if(te!==0)throw new Error("Non-zero carry");de=ve,ee++}for(var Se=H-de;Se!==H&&Q[Se]===0;)Se++;for(var Be=new Uint8Array(le+(H-Se)),Fe=le;Se!==H;)Be[Fe++]=Q[Se++];return Be}function Z(q){var ee=B(q);if(ee)return ee;throw new Error("Non-base"+m+" character")}return{encode:A,decodeUnsafe:B,decode:Z}}UC.exports=$L});var eM=Gt(eg=>{"use strict";var r6=Pr(),n6=Symbol.for("react.element"),o6=Symbol.for("react.fragment"),s6=Object.prototype.hasOwnProperty,a6=r6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l6={key:!0,ref:!0,__self:!0,__source:!0};function KC(e,t,r){var l,u={},o=null,m=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(m=t.ref);for(l in t)s6.call(t,l)&&!l6.hasOwnProperty(l)&&(u[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps,t)u[l]===void 0&&(u[l]=t[l]);return{$$typeof:n6,type:e,key:o,ref:m,props:u,_owner:a6.current}}eg.Fragment=o6;eg.jsx=KC;eg.jsxs=KC});var Zr=Gt((i7,tM)=>{"use strict";tM.exports=eM()});var sM=Gt(F1=>{"use strict";Object.defineProperty(F1,"__esModule",{value:!0});function c6(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function h6(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var d6=function(){function e(r){var l=this;this._insertTag=function(u){var o;l.tags.length===0?l.insertionPoint?o=l.insertionPoint.nextSibling:l.prepend?o=l.container.firstChild:o=l.before:o=l.tags[l.tags.length-1].nextSibling,l.container.insertBefore(u,o),l.tags.push(u)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(l){l.forEach(this._insertTag)},t.insert=function(l){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(h6(this));var u=this.tags[this.tags.length-1];if(this.isSpeedy){var o=c6(u);try{o.insertRule(l,o.cssRules.length)}catch{}}else u.appendChild(document.createTextNode(l));this.ctr++},t.flush=function(){this.tags.forEach(function(l){return l.parentNode&&l.parentNode.removeChild(l)}),this.tags=[],this.ctr=0},e}();F1.StyleSheet=d6});var lM=Gt((g7,aM)=>{"use strict";aM.exports=sM()});var cM=Gt((ng,uM)=>{(function(e,t){typeof ng=="object"&&typeof uM<"u"?t(ng):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.stylis={}))})(ng,function(e){"use strict";var t="-ms-",r="-moz-",l="-webkit-",u="comm",o="rule",m="decl",v="@page",b="@media",C="@import",A="@charset",B="@viewport",Z="@supports",q="@document",ee="@namespace",le="@keyframes",de="@font-face",H="@counter-style",Q="@font-feature-values",te=Math.abs,ve=String.fromCharCode,Ce=Object.assign;function Se(ie,Xe){return(((Xe<<2^At(ie,0))<<2^At(ie,1))<<2^At(ie,2))<<2^At(ie,3)}function Be(ie){return ie.trim()}function Fe(ie,Xe){return(ie=Xe.exec(ie))?ie[0]:ie}function qe(ie,Xe,$e){return ie.replace(Xe,$e)}function ht(ie,Xe){return ie.indexOf(Xe)}function At(ie,Xe){return ie.charCodeAt(Xe)|0}function Ot(ie,Xe,$e){return ie.slice(Xe,$e)}function Yt(ie){return ie.length}function at(ie){return ie.length}function Zt(ie,Xe){return Xe.push(ie),ie}function zi(ie,Xe){return ie.map(Xe).join("")}e.line=1,e.column=1,e.length=0,e.position=0,e.character=0,e.characters="";function Ii(ie,Xe,$e,ft,ut,Ht,Tt){return{value:ie,root:Xe,parent:$e,type:ft,props:ut,children:Ht,line:e.line,column:e.column,length:Tt,return:""}}function jt(ie,Xe){return Ce(Ii("",null,null,"",null,null,0),ie,{length:-ie.length},Xe)}function ur(){return e.character}function Xi(){return e.character=e.position>0?At(e.characters,--e.position):0,e.column--,e.character===10&&(e.column=1,e.line--),e.character}function si(){return e.character=e.position<e.length?At(e.characters,e.position++):0,e.column++,e.character===10&&(e.column=1,e.line++),e.character}function ti(){return At(e.characters,e.position)}function _i(){return e.position}function Ei(ie,Xe){return Ot(e.characters,ie,Xe)}function Li(ie){switch(ie){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Fi(ie){return e.line=e.column=1,e.length=Yt(e.characters=ie),e.position=0,[]}function Ji(ie){return e.characters="",ie}function Cr(ie){return Be(Ei(e.position-1,hn(ie===91?ie+2:ie===40?ie+1:ie)))}function tn(ie){return Ji(ii(Fi(ie)))}function no(ie){for(;(e.character=ti())&&e.character<33;)si();return Li(ie)>2||Li(e.character)>3?"":" "}function ii(ie){for(;si();)switch(Li(e.character)){case 0:Zt(zr(e.position-1),ie);break;case 2:Zt(Cr(e.character),ie);break;default:Zt(ve(e.character),ie)}return ie}function Hr(ie,Xe){for(;--Xe&&si()&&!(e.character<48||e.character>102||e.character>57&&e.character<65||e.character>70&&e.character<97););return Ei(ie,_i()+(Xe<6&&ti()==32&&si()==32))}function hn(ie){for(;si();)switch(e.character){case ie:return e.position;case 34:case 39:ie!==34&&ie!==39&&hn(e.character);break;case 40:ie===41&&hn(ie);break;case 92:si();break}return e.position}function rn(ie,Xe){for(;si()&&ie+e.character!==47+10;)if(ie+e.character===42+42&&ti()===47)break;return"/*"+Ei(Xe,e.position-1)+"*"+ve(ie===47?ie:si())}function zr(ie){for(;!Li(ti());)si();return Ei(ie,e.position)}function Qo(ie){return Ji(_e("",null,null,null,[""],ie=Fi(ie),0,[0],ie))}function _e(ie,Xe,$e,ft,ut,Ht,Tt,Ue,It){for(var yt=0,ri=0,gi=Tt,St=0,tr=0,ci=0,Ri=1,hi=1,Ft=1,di=0,ir="",Ai=ut,Mr=Ht,rr=ft,Ti=ir;hi;)switch(ci=di,di=si()){case 40:if(ci!=108&&Ti.charCodeAt(gi-1)==58){ht(Ti+=qe(Cr(di),"&","&\f"),"&\f")!=-1&&(Ft=-1);break}case 34:case 39:case 91:Ti+=Cr(di);break;case 9:case 10:case 13:case 32:Ti+=no(ci);break;case 92:Ti+=Hr(_i()-1,7);continue;case 47:switch(ti()){case 42:case 47:Zt(F(rn(si(),_i()),Xe,$e),It);break;default:Ti+="/"}break;case 123*Ri:Ue[yt++]=Yt(Ti)*Ft;case 125*Ri:case 59:case 0:switch(di){case 0:case 125:hi=0;case 59+ri:tr>0&&Yt(Ti)-gi&&Zt(tr>32?U(Ti+";",ft,$e,gi-1):U(qe(Ti," ","")+";",ft,$e,gi-2),It);break;case 59:Ti+=";";default:if(Zt(rr=V(Ti,Xe,$e,yt,ri,ut,Ue,ir,Ai=[],Mr=[],gi),Ht),di===123)if(ri===0)_e(Ti,Xe,rr,rr,Ai,Ht,gi,Ue,Mr);else switch(St){case 100:case 109:case 115:_e(ie,rr,rr,ft&&Zt(V(ie,rr,rr,0,0,ut,Ue,ir,ut,Ai=[],gi),Mr),ut,Mr,gi,Ue,ft?Ai:Mr);break;default:_e(Ti,rr,rr,rr,[""],Mr,0,Ue,Mr)}}yt=ri=tr=0,Ri=Ft=1,ir=Ti="",gi=Tt;break;case 58:gi=1+Yt(Ti),tr=ci;default:if(Ri<1){if(di==123)--Ri;else if(di==125&&Ri++==0&&Xi()==125)continue}switch(Ti+=ve(di),di*Ri){case 38:Ft=ri>0?1:(Ti+="\f",-1);break;case 44:Ue[yt++]=(Yt(Ti)-1)*Ft,Ft=1;break;case 64:ti()===45&&(Ti+=Cr(si())),St=ti(),ri=gi=Yt(ir=Ti+=zr(_i())),di++;break;case 45:ci===45&&Yt(Ti)==2&&(Ri=0)}}return Ht}function V(ie,Xe,$e,ft,ut,Ht,Tt,Ue,It,yt,ri){for(var gi=ut-1,St=ut===0?Ht:[""],tr=at(St),ci=0,Ri=0,hi=0;ci<ft;++ci)for(var Ft=0,di=Ot(ie,gi+1,gi=te(Ri=Tt[ci])),ir=ie;Ft<tr;++Ft)(ir=Be(Ri>0?St[Ft]+" "+di:qe(di,/&\f/g,St[Ft])))&&(It[hi++]=ir);return Ii(ie,Xe,$e,ut===0?o:Ue,It,yt,ri)}function F(ie,Xe,$e){return Ii(ie,Xe,$e,u,ve(ur()),Ot(ie,2,-2),0)}function U(ie,Xe,$e,ft){return Ii(ie,Xe,$e,m,Ot(ie,0,ft),Ot(ie,ft+1,-1),ft)}function K(ie,Xe){switch(Se(ie,Xe)){case 5103:return l+"print-"+ie+ie;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return l+ie+ie;case 5349:case 4246:case 4810:case 6968:case 2756:return l+ie+r+ie+t+ie+ie;case 6828:case 4268:return l+ie+t+ie+ie;case 6165:return l+ie+t+"flex-"+ie+ie;case 5187:return l+ie+qe(ie,/(\w+).+(:[^]+)/,l+"box-$1$2"+t+"flex-$1$2")+ie;case 5443:return l+ie+t+"flex-item-"+qe(ie,/flex-|-self/,"")+ie;case 4675:return l+ie+t+"flex-line-pack"+qe(ie,/align-content|flex-|-self/,"")+ie;case 5548:return l+ie+t+qe(ie,"shrink","negative")+ie;case 5292:return l+ie+t+qe(ie,"basis","preferred-size")+ie;case 6060:return l+"box-"+qe(ie,"-grow","")+l+ie+t+qe(ie,"grow","positive")+ie;case 4554:return l+qe(ie,/([^-])(transform)/g,"$1"+l+"$2")+ie;case 6187:return qe(qe(qe(ie,/(zoom-|grab)/,l+"$1"),/(image-set)/,l+"$1"),ie,"")+ie;case 5495:case 3959:return qe(ie,/(image-set\([^]*)/,l+"$1$`$1");case 4968:return qe(qe(ie,/(.+:)(flex-)?(.*)/,l+"box-pack:$3"+t+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+l+ie+ie;case 4095:case 3583:case 4068:case 2532:return qe(ie,/(.+)-inline(.+)/,l+"$1$2")+ie;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Yt(ie)-1-Xe>6)switch(At(ie,Xe+1)){case 109:if(At(ie,Xe+4)!==45)break;case 102:return qe(ie,/(.+:)(.+)-([^]+)/,"$1"+l+"$2-$3$1"+r+(At(ie,Xe+3)==108?"$3":"$2-$3"))+ie;case 115:return~ht(ie,"stretch")?K(qe(ie,"stretch","fill-available"),Xe)+ie:ie}break;case 4949:if(At(ie,Xe+1)!==115)break;case 6444:switch(At(ie,Yt(ie)-3-(~ht(ie,"!important")&&10))){case 107:return qe(ie,":",":"+l)+ie;case 101:return qe(ie,/(.+:)([^;!]+)(;|!.+)?/,"$1"+l+(At(ie,14)===45?"inline-":"")+"box$3$1"+l+"$2$3$1"+t+"$2box$3")+ie}break;case 5936:switch(At(ie,Xe+11)){case 114:return l+ie+t+qe(ie,/[svh]\w+-[tblr]{2}/,"tb")+ie;case 108:return l+ie+t+qe(ie,/[svh]\w+-[tblr]{2}/,"tb-rl")+ie;case 45:return l+ie+t+qe(ie,/[svh]\w+-[tblr]{2}/,"lr")+ie}return l+ie+t+ie+ie}return ie}function he(ie,Xe){for(var $e="",ft=at(ie),ut=0;ut<ft;ut++)$e+=Xe(ie[ut],ut,ie,Xe)||"";return $e}function Ie(ie,Xe,$e,ft){switch(ie.type){case C:case m:return ie.return=ie.return||ie.value;case u:return"";case le:return ie.return=ie.value+"{"+he(ie.children,ft)+"}";case o:ie.value=ie.props.join(",")}return Yt($e=he(ie.children,ft))?ie.return=ie.value+"{"+$e+"}":""}function Ve(ie){var Xe=at(ie);return function($e,ft,ut,Ht){for(var Tt="",Ue=0;Ue<Xe;Ue++)Tt+=ie[Ue]($e,ft,ut,Ht)||"";return Tt}}function He(ie){return function(Xe){Xe.root||(Xe=Xe.return)&&ie(Xe)}}function ye(ie,Xe,$e,ft){if(ie.length>-1&&!ie.return)switch(ie.type){case m:ie.return=K(ie.value,ie.length);break;case le:return he([jt(ie,{value:qe(ie.value,"@","@"+l)})],ft);case o:if(ie.length)return zi(ie.props,function(ut){switch(Fe(ut,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return he([jt(ie,{props:[qe(ut,/:(read-\w+)/,":"+r+"$1")]})],ft);case"::placeholder":return he([jt(ie,{props:[qe(ut,/:(plac\w+)/,":"+l+"input-$1")]}),jt(ie,{props:[qe(ut,/:(plac\w+)/,":"+r+"$1")]}),jt(ie,{props:[qe(ut,/:(plac\w+)/,t+"input-$1")]})],ft)}return""})}}function Re(ie){switch(ie.type){case o:ie.props=ie.props.map(function(Xe){return zi(tn(Xe),function($e,ft,ut){switch(At($e,0)){case 12:return Ot($e,1,Yt($e));case 0:case 40:case 43:case 62:case 126:return $e;case 58:ut[++ft]==="global"&&(ut[ft]="",ut[++ft]="\f"+Ot(ut[ft],ft=1,-1));case 32:return ft===1?"":$e;default:switch(ft){case 0:return ie=$e,at(ut)>1?"":$e;case(ft=at(ut)-1):case 2:return ft===2?$e+ie+ie:$e+ie;default:return $e}}})})}}e.CHARSET=A,e.COMMENT=u,e.COUNTER_STYLE=H,e.DECLARATION=m,e.DOCUMENT=q,e.FONT_FACE=de,e.FONT_FEATURE_VALUES=Q,e.IMPORT=C,e.KEYFRAMES=le,e.MEDIA=b,e.MOZ=r,e.MS=t,e.NAMESPACE=ee,e.PAGE=v,e.RULESET=o,e.SUPPORTS=Z,e.VIEWPORT=B,e.WEBKIT=l,e.abs=te,e.alloc=Fi,e.append=Zt,e.assign=Ce,e.caret=_i,e.char=ur,e.charat=At,e.combine=zi,e.comment=F,e.commenter=rn,e.compile=Qo,e.copy=jt,e.dealloc=Ji,e.declaration=U,e.delimit=Cr,e.delimiter=hn,e.escaping=Hr,e.from=ve,e.hash=Se,e.identifier=zr,e.indexof=ht,e.match=Fe,e.middleware=Ve,e.namespace=Re,e.next=si,e.node=Ii,e.parse=_e,e.peek=ti,e.prefix=K,e.prefixer=ye,e.prev=Xi,e.replace=qe,e.ruleset=V,e.rulesheet=He,e.serialize=he,e.sizeof=at,e.slice=Ei,e.stringify=Ie,e.strlen=Yt,e.substr=Ot,e.token=Li,e.tokenize=tn,e.tokenizer=ii,e.trim=Be,e.whitespace=no,Object.defineProperty(e,"__esModule",{value:!0})})});var hM=Gt(O1=>{"use strict";Object.defineProperty(O1,"__esModule",{value:!0});var p6=function(t){var r=new WeakMap;return function(l){if(r.has(l))return r.get(l);var u=t(l);return r.set(l,u),u}};O1.default=p6});var og=Gt((v7,dM)=>{"use strict";dM.exports=hM()});var pM=Gt(G1=>{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});function f6(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}G1.default=f6});var V1=Gt((_7,fM)=>{"use strict";fM.exports=pM()});var yM=Gt(U1=>{"use strict";Object.defineProperty(U1,"__esModule",{value:!0});var m6=lM(),lr=cM(),g6=og(),y6=V1();function gM(e){return e&&e.__esModule?e:{default:e}}var v6=gM(g6),x6=gM(y6),_6=function(t,r,l){for(var u=0,o=0;u=o,o=lr.peek(),u===38&&o===12&&(r[l]=1),!lr.token(o);)lr.next();return lr.slice(t,lr.position)},b6=function(t,r){var l=-1,u=44;do switch(lr.token(u)){case 0:u===38&&lr.peek()===12&&(r[l]=1),t[l]+=_6(lr.position-1,r,l);break;case 2:t[l]+=lr.delimit(u);break;case 4:if(u===44){t[++l]=lr.peek()===58?"&\f":"",r[l]=t[l].length;break}default:t[l]+=lr.from(u)}while(u=lr.next());return t},w6=function(t,r){return lr.dealloc(b6(lr.alloc(t),r))},mM=new WeakMap,I6=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,l=t.parent,u=t.column===l.column&&t.line===l.line;l.type!=="rule";)if(l=l.parent,!l)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!mM.get(l))&&!u){mM.set(t,!0);for(var o=[],m=w6(r,o),v=l.props,b=0,C=0;b<m.length;b++)for(var A=0;A<v.length;A++,C++)t.props[C]=o[b]?m[b].replace(/&\f/g,v[A]):v[A]+" "+m[b]}}},S6=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}},sg=typeof document<"u",C6=sg?void 0:v6.default(function(){return x6.default(function(){var e={};return function(t){return e[t]}})}),M6=[lr.prefixer],E6=function(t){var r=t.key;if(sg&&r==="css"){var l=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(l,function(ve){var Ce=ve.getAttribute("data-emotion");Ce.indexOf(" ")!==-1&&(document.head.appendChild(ve),ve.setAttribute("data-s",""))})}var u=t.stylisPlugins||M6,o={},m,v=[];sg&&(m=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(ve){for(var Ce=ve.getAttribute("data-emotion").split(" "),Se=1;Se<Ce.length;Se++)o[Ce[Se]]=!0;v.push(ve)}));var b,C=[I6,S6];if(sg){var A,B=[lr.stringify,lr.rulesheet(function(ve){A.insert(ve)})],Z=lr.middleware(C.concat(u,B)),q=function(Ce){return lr.serialize(lr.compile(Ce),Z)};b=function(Ce,Se,Be,Fe){A=Be,q(Ce?Ce+"{"+Se.styles+"}":Se.styles),Fe&&(te.inserted[Se.name]=!0)}}else{var ee=[lr.stringify],le=lr.middleware(C.concat(u,ee)),de=function(Ce){return lr.serialize(lr.compile(Ce),le)},H=C6(u)(r),Q=function(Ce,Se){var Be=Se.name;return H[Be]===void 0&&(H[Be]=de(Ce?Ce+"{"+Se.styles+"}":Se.styles)),H[Be]};b=function(Ce,Se,Be,Fe){var qe=Se.name,ht=Q(Ce,Se);if(te.compat===void 0)return Fe&&(te.inserted[qe]=!0),ht;if(Fe)te.inserted[qe]=ht;else return ht}}var te={key:r,sheet:new m6.StyleSheet({key:r,container:m,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:b};return te.sheet.hydrate(v),te};U1.default=E6});var ag=Gt((w7,vM)=>{"use strict";vM.exports=yM()});var Z1=Gt((I7,ra)=>{function W1(){return ra.exports=W1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},ra.exports.__esModule=!0,ra.exports.default=ra.exports,W1.apply(this,arguments)}ra.exports=W1,ra.exports.__esModule=!0,ra.exports.default=ra.exports});var _M=Gt(Bi=>{"use strict";var Kr=typeof Symbol=="function"&&Symbol.for,j1=Kr?Symbol.for("react.element"):60103,H1=Kr?Symbol.for("react.portal"):60106,lg=Kr?Symbol.for("react.fragment"):60107,ug=Kr?Symbol.for("react.strict_mode"):60108,cg=Kr?Symbol.for("react.profiler"):60114,hg=Kr?Symbol.for("react.provider"):60109,dg=Kr?Symbol.for("react.context"):60110,X1=Kr?Symbol.for("react.async_mode"):60111,pg=Kr?Symbol.for("react.concurrent_mode"):60111,fg=Kr?Symbol.for("react.forward_ref"):60112,mg=Kr?Symbol.for("react.suspense"):60113,A6=Kr?Symbol.for("react.suspense_list"):60120,gg=Kr?Symbol.for("react.memo"):60115,yg=Kr?Symbol.for("react.lazy"):60116,T6=Kr?Symbol.for("react.block"):60121,P6=Kr?Symbol.for("react.fundamental"):60117,k6=Kr?Symbol.for("react.responder"):60118,z6=Kr?Symbol.for("react.scope"):60119;function yo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case j1:switch(e=e.type,e){case X1:case pg:case lg:case cg:case ug:case mg:return e;default:switch(e=e&&e.$$typeof,e){case dg:case fg:case yg:case gg:case hg:return e;default:return t}}case H1:return t}}}function xM(e){return yo(e)===pg}Bi.AsyncMode=X1;Bi.ConcurrentMode=pg;Bi.ContextConsumer=dg;Bi.ContextProvider=hg;Bi.Element=j1;Bi.ForwardRef=fg;Bi.Fragment=lg;Bi.Lazy=yg;Bi.Memo=gg;Bi.Portal=H1;Bi.Profiler=cg;Bi.StrictMode=ug;Bi.Suspense=mg;Bi.isAsyncMode=function(e){return xM(e)||yo(e)===X1};Bi.isConcurrentMode=xM;Bi.isContextConsumer=function(e){return yo(e)===dg};Bi.isContextProvider=function(e){return yo(e)===hg};Bi.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===j1};Bi.isForwardRef=function(e){return yo(e)===fg};Bi.isFragment=function(e){return yo(e)===lg};Bi.isLazy=function(e){return yo(e)===yg};Bi.isMemo=function(e){return yo(e)===gg};Bi.isPortal=function(e){return yo(e)===H1};Bi.isProfiler=function(e){return yo(e)===cg};Bi.isStrictMode=function(e){return yo(e)===ug};Bi.isSuspense=function(e){return yo(e)===mg};Bi.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===lg||e===pg||e===cg||e===ug||e===mg||e===A6||typeof e=="object"&&e!==null&&(e.$$typeof===yg||e.$$typeof===gg||e.$$typeof===hg||e.$$typeof===dg||e.$$typeof===fg||e.$$typeof===P6||e.$$typeof===k6||e.$$typeof===z6||e.$$typeof===T6)};Bi.typeOf=yo});var wM=Gt((C7,bM)=>{"use strict";bM.exports=_M()});var q1=Gt((M7,AM)=>{"use strict";var $1=wM(),L6={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},R6={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},D6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},MM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Y1={};Y1[$1.ForwardRef]=D6;Y1[$1.Memo]=MM;function IM(e){return $1.isMemo(e)?MM:Y1[e.$$typeof]||L6}var B6=Object.defineProperty,N6=Object.getOwnPropertyNames,SM=Object.getOwnPropertySymbols,F6=Object.getOwnPropertyDescriptor,O6=Object.getPrototypeOf,CM=Object.prototype;function EM(e,t,r){if(typeof t!="string"){if(CM){var l=O6(t);l&&l!==CM&&EM(e,l,r)}var u=N6(t);SM&&(u=u.concat(SM(t)));for(var o=IM(e),m=IM(t),v=0;v<u.length;++v){var b=u[v];if(!R6[b]&&!(r&&r[b])&&!(m&&m[b])&&!(o&&o[b])){var C=F6(t,b);try{B6(e,b,C)}catch{}}}}return e}AM.exports=EM});var Q1=Gt(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});var G6=q1();function V6(e){return e&&e.__esModule?e:{default:e}}var U6=V6(G6),W6=function(e,t){return U6.default(e,t)};J1.default=W6});var PM=Gt(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var K1=typeof document<"u";function Z6(e,t,r){var l="";return r.split(" ").forEach(function(u){e[u]!==void 0?t.push(e[u]+";"):l+=u+" "}),l}var TM=function(t,r,l){var u=t.key+"-"+r.name;(l===!1||K1===!1&&t.compat!==void 0)&&t.registered[u]===void 0&&(t.registered[u]=r.styles)},j6=function(t,r,l){TM(t,r,l);var u=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var o="",m=r;do{var v=t.insert(r===m?"."+u:"",m,t.sheet,!0);!K1&&v!==void 0&&(o+=v),m=m.next}while(m!==void 0);if(!K1&&o.length!==0)return o}};Hd.getRegisteredStyles=Z6;Hd.insertStyles=j6;Hd.registerStyles=TM});var ex=Gt((T7,kM)=>{"use strict";kM.exports=PM()});var zM=Gt(tx=>{"use strict";Object.defineProperty(tx,"__esModule",{value:!0});function H6(e){for(var t=0,r,l=0,u=e.length;u>=4;++l,u-=4)r=e.charCodeAt(l)&255|(e.charCodeAt(++l)&255)<<8|(e.charCodeAt(++l)&255)<<16|(e.charCodeAt(++l)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(u){case 3:t^=(e.charCodeAt(l+2)&255)<<16;case 2:t^=(e.charCodeAt(l+1)&255)<<8;case 1:t^=e.charCodeAt(l)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}tx.default=H6});var RM=Gt((k7,LM)=>{"use strict";LM.exports=zM()});var DM=Gt(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:!0});var X6={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};ix.default=X6});var NM=Gt((L7,BM)=>{"use strict";BM.exports=DM()});var UM=Gt(ox=>{"use strict";Object.defineProperty(ox,"__esModule",{value:!0});var $6=RM(),Y6=NM(),q6=V1();function nx(e){return e&&e.__esModule?e:{default:e}}var J6=nx($6),Q6=nx(Y6),K6=nx(q6),eR=/[A-Z]|^ms/g,tR=/_EMO_([^_]+?)_([^]*?)_EMO_/g,VM=function(t){return t.charCodeAt(1)===45},FM=function(t){return t!=null&&typeof t!="boolean"},rx=K6.default(function(e){return VM(e)?e:e.replace(eR,"-$&").toLowerCase()}),OM=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(tR,function(l,u,o){return ms={name:u,styles:o,next:ms},u})}return Q6.default[t]!==1&&!VM(t)&&typeof r=="number"&&r!==0?r+"px":r};function Xd(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return ms={name:r.name,styles:r.styles,next:ms},r.name;if(r.styles!==void 0){var l=r.next;if(l!==void 0)for(;l!==void 0;)ms={name:l.name,styles:l.styles,next:ms},l=l.next;var u=r.styles+";";return u}return iR(e,t,r)}case"function":{if(e!==void 0){var o=ms,m=r(e);return ms=o,Xd(e,t,m)}break}}if(t==null)return r;var v=t[r];return v!==void 0?v:r}function iR(e,t,r){var l="";if(Array.isArray(r))for(var u=0;u<r.length;u++)l+=Xd(e,t,r[u])+";";else for(var o in r){var m=r[o];if(typeof m!="object")t!=null&&t[m]!==void 0?l+=o+"{"+t[m]+"}":FM(m)&&(l+=rx(o)+":"+OM(o,m)+";");else if(Array.isArray(m)&&typeof m[0]=="string"&&(t==null||t[m[0]]===void 0))for(var v=0;v<m.length;v++)FM(m[v])&&(l+=rx(o)+":"+OM(o,m[v])+";");else{var b=Xd(e,t,m);switch(o){case"animation":case"animationName":{l+=rx(o)+":"+b+";";break}default:l+=o+"{"+b+"}"}}}return l}var GM=/label:\s*([^\s;\n{]+)\s*(;|$)/g,ms,rR=function(t,r,l){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var u=!0,o="";ms=void 0;var m=t[0];m==null||m.raw===void 0?(u=!1,o+=Xd(l,r,m)):o+=m[0];for(var v=1;v<t.length;v++)o+=Xd(l,r,t[v]),u&&(o+=m[v]);GM.lastIndex=0;for(var b="",C;(C=GM.exec(o))!==null;)b+="-"+C[1];var A=J6.default(o)+b;return{name:A,styles:o,next:ms}};ox.serializeStyles=rR});var sx=Gt((D7,WM)=>{"use strict";WM.exports=UM()});var $M=Gt(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});var HM=Pr();function nR(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var ZM=nR(HM),oR=typeof document<"u",jM=function(t){return t()},XM=ZM["useInsertionEffect"]?ZM["useInsertionEffect"]:!1,sR=oR&&XM||jM,aR=XM||HM.useLayoutEffect;vg.useInsertionEffectAlwaysWithSyncFallback=sR;vg.useInsertionEffectWithLayoutFallback=aR});var ax=Gt((N7,YM)=>{"use strict";YM.exports=$M()});var eE=Gt(ro=>{"use strict";var jr=Pr(),lR=ag(),JM=Z1(),uR=og(),cR=Q1(),lx=ex(),hR=sx(),dR=ax();function QM(e){return e&&e.__esModule?e:{default:e}}var KM=QM(lR),qM=QM(uR),cx=typeof document<"u",hx={}.hasOwnProperty,$d=jr.createContext(typeof HTMLElement<"u"?KM.default({key:"css"}):null),pR=$d.Provider,fR=function(){return jr.useContext($d)};ro.withEmotionCache=function(t){return jr.forwardRef(function(r,l){var u=jr.useContext($d);return t(r,u,l)})};cx||(ro.withEmotionCache=function(t){return function(r){var l=jr.useContext($d);return l===null?(l=KM.default({key:"css"}),jr.createElement($d.Provider,{value:l},t(r,l))):t(r,l)}});var Rc=jr.createContext({}),mR=function(){return jr.useContext(Rc)},gR=function(t,r){if(typeof r=="function"){var l=r(t);return l}return JM({},t,r)},yR=qM.default(function(e){return qM.default(function(t){return gR(e,t)})}),vR=function(t){var r=jr.useContext(Rc);return t.theme!==r&&(r=yR(r)(t.theme)),jr.createElement(Rc.Provider,{value:r},t.children)};function xR(e){var t=e.displayName||e.name||"Component",r=function(o,m){var v=jr.useContext(Rc);return jr.createElement(e,JM({theme:v,ref:m},o))},l=jr.forwardRef(r);return l.displayName="WithTheme("+t+")",cR.default(l,e)}var ux="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",_R=function(t,r){var l={};for(var u in r)hx.call(r,u)&&(l[u]=r[u]);return l[ux]=t,l},bR=function(t){var r=t.cache,l=t.serialized,u=t.isStringTag;lx.registerStyles(r,l,u);var o=dR.useInsertionEffectAlwaysWithSyncFallback(function(){return lx.insertStyles(r,l,u)});if(!cx&&o!==void 0){for(var m,v=l.name,b=l.next;b!==void 0;)v+=" "+b.name,b=b.next;return jr.createElement("style",(m={},m["data-emotion"]=r.key+" "+v,m.dangerouslySetInnerHTML={__html:o},m.nonce=r.sheet.nonce,m))}return null},wR=ro.withEmotionCache(function(e,t,r){var l=e.css;typeof l=="string"&&t.registered[l]!==void 0&&(l=t.registered[l]);var u=e[ux],o=[l],m="";typeof e.className=="string"?m=lx.getRegisteredStyles(t.registered,o,e.className):e.className!=null&&(m=e.className+" ");var v=hR.serializeStyles(o,void 0,jr.useContext(Rc));m+=t.key+"-"+v.name;var b={};for(var C in e)hx.call(e,C)&&C!=="css"&&C!==ux&&(b[C]=e[C]);return b.ref=r,b.className=m,jr.createElement(jr.Fragment,null,jr.createElement(bR,{cache:t,serialized:v,isStringTag:typeof u=="string"}),jr.createElement(u,b))});ro.CacheProvider=pR;ro.Emotion=wR;ro.ThemeContext=Rc;ro.ThemeProvider=vR;ro.__unsafe_useEmotionCache=fR;ro.createEmotionProps=_R;ro.hasOwnProperty=hx;ro.isBrowser=cx;ro.useTheme=mR;ro.withTheme=xR});var rE=Gt(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});var gs=Pr();ag();var en=eE();Z1();og();q1();Q1();var xg=ex(),px=sx(),dx=ax(),tE=function(t,r){var l=arguments;if(r==null||!en.hasOwnProperty.call(r,"css"))return gs.createElement.apply(void 0,l);var u=l.length,o=new Array(u);o[0]=en.Emotion,o[1]=en.createEmotionProps(t,r);for(var m=2;m<u;m++)o[m]=l[m];return gs.createElement.apply(null,o)},IR=en.withEmotionCache(function(e,t){var r=e.styles,l=px.serializeStyles([r],void 0,gs.useContext(en.ThemeContext));if(!en.isBrowser){for(var u,o=l.name,m=l.styles,v=l.next;v!==void 0;)o+=" "+v.name,m+=v.styles,v=v.next;var b=t.compat===!0,C=t.insert("",{name:o,styles:m},t.sheet,b);return b?null:gs.createElement("style",(u={},u["data-emotion"]=t.key+"-global "+o,u.dangerouslySetInnerHTML={__html:C},u.nonce=t.sheet.nonce,u))}var A=gs.useRef();return dx.useInsertionEffectWithLayoutFallback(function(){var B=t.key+"-global",Z=new t.sheet.constructor({key:B,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),q=!1,ee=document.querySelector('style[data-emotion="'+B+" "+l.name+'"]');return t.sheet.tags.length&&(Z.before=t.sheet.tags[0]),ee!==null&&(q=!0,ee.setAttribute("data-emotion",B),Z.hydrate([ee])),A.current=[Z,q],function(){Z.flush()}},[t]),dx.useInsertionEffectWithLayoutFallback(function(){var B=A.current,Z=B[0],q=B[1];if(q){B[1]=!1;return}if(l.next!==void 0&&xg.insertStyles(t,l.next,!0),Z.tags.length){var ee=Z.tags[Z.tags.length-1].nextElementSibling;Z.before=ee,Z.flush()}t.insert("",l,Z,!1)},[t,l.name]),null});function iE(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return px.serializeStyles(t)}var SR=function(){var t=iE.apply(void 0,arguments),r="animation-"+t.name;return{name:r,styles:"@keyframes "+r+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},CR=function e(t){for(var r=t.length,l=0,u="";l<r;l++){var o=t[l];if(o!=null){var m=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))m=e(o);else{m="";for(var v in o)o[v]&&v&&(m&&(m+=" "),m+=v)}break}default:m=o}m&&(u&&(u+=" "),u+=m)}}return u};function MR(e,t,r){var l=[],u=xg.getRegisteredStyles(e,l,r);return l.length<2?r:u+t(l)}var ER=function(t){var r=t.cache,l=t.serializedArr,u=dx.useInsertionEffectAlwaysWithSyncFallback(function(){for(var m="",v=0;v<l.length;v++){var b=xg.insertStyles(r,l[v],!1);!en.isBrowser&&b!==void 0&&(m+=b)}if(!en.isBrowser)return m});if(!en.isBrowser&&u.length!==0){var o;return gs.createElement("style",(o={},o["data-emotion"]=r.key+" "+l.map(function(m){return m.name}).join(" "),o.dangerouslySetInnerHTML={__html:u},o.nonce=r.sheet.nonce,o))}return null},AR=en.withEmotionCache(function(e,t){var r=!1,l=[],u=function(){for(var C=arguments.length,A=new Array(C),B=0;B<C;B++)A[B]=arguments[B];var Z=px.serializeStyles(A,t.registered);return l.push(Z),xg.registerStyles(t,Z,!1),t.key+"-"+Z.name},o=function(){for(var C=arguments.length,A=new Array(C),B=0;B<C;B++)A[B]=arguments[B];return MR(t.registered,u,CR(A))},m={css:u,cx:o,theme:gs.useContext(en.ThemeContext)},v=e.children(m);return r=!0,gs.createElement(gs.Fragment,null,gs.createElement(ER,{cache:t,serializedArr:l}),v)});Wn.CacheProvider=en.CacheProvider;Wn.ThemeContext=en.ThemeContext;Wn.ThemeProvider=en.ThemeProvider;Wn.__unsafe_useEmotionCache=en.__unsafe_useEmotionCache;Wn.useTheme=en.useTheme;Object.defineProperty(Wn,"withEmotionCache",{enumerable:!0,get:function(){return en.withEmotionCache}});Wn.withTheme=en.withTheme;Wn.ClassNames=AR;Wn.Global=IR;Wn.createElement=tE;Wn.css=iE;Wn.jsx=tE;Wn.keyframes=SR});var fx=Gt((G7,nE)=>{"use strict";nE.exports=rE()});var zg=Gt((Lx,Rx)=>{(function(e,t){typeof Lx=="object"&&typeof Rx<"u"?Rx.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.maplibregl=t())})(Lx,function(){"use strict";var e,t,r;function l(o,m){if(!e)e=m;else if(!t)t=m;else{var v="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",b={};e(b),r=m(b),typeof window<"u"&&(r.workerUrl=window.URL.createObjectURL(new Blob([v],{type:"text/javascript"})))}}l(["exports"],function(o){"use strict";var m=v;function v(s,i,a,h){this.cx=3*s,this.bx=3*(a-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(h-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=i,this.p2x=a,this.p2y=h}function b(s,i,a,h){let p=new m(s,i,a,h);return function(y){return p.solve(y)}}v.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,i){if(i===void 0&&(i=1e-6),s<0)return 0;if(s>1)return 1;for(var a=s,h=0;h<8;h++){var p=this.sampleCurveX(a)-s;if(Math.abs(p)<i)return a;var y=this.sampleCurveDerivativeX(a);if(Math.abs(y)<1e-6)break;a-=p/y}var x=0,w=1;for(a=s,h=0;h<20&&(p=this.sampleCurveX(a),!(Math.abs(p-s)<i));h++)s>p?x=a:w=a,a=.5*(w-x)+x;return a},solve:function(s,i){return this.sampleCurveY(this.solveCurveX(s,i))}};let C=b(.25,.1,.25,1);function A(s,i,a){return Math.min(a,Math.max(i,s))}function B(s,i,a){let h=a-i,p=((s-i)%h+h)%h+i;return p===i?a:p}function Z(s,...i){for(let a of i)for(let h in a)s[h]=a[h];return s}let q=1;function ee(s,i){s.forEach(a=>{i[a]&&(i[a]=i[a].bind(i))})}function le(s,i,a){let h={};for(let p in s)h[p]=i.call(a||this,s[p],p,s);return h}function de(s,i,a){let h={};for(let p in s)i.call(a||this,s[p],p,s)&&(h[p]=s[p]);return h}function H(s){return Array.isArray(s)?s.map(H):typeof s=="object"&&s?le(s,H):s}let Q={};function te(s){Q[s]||(typeof console<"u"&&console.warn(s),Q[s]=!0)}function ve(s,i,a){return(a.y-s.y)*(i.x-s.x)>(i.y-s.y)*(a.x-s.x)}function Ce(s){let i=0;for(let a,h,p=0,y=s.length,x=y-1;p<y;x=p++)a=s[p],h=s[x],i+=(h.x-a.x)*(a.y+h.y);return i}function Se(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Be(s){let i={};if(s.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(a,h,p,y)=>{let x=p||y;return i[h]=!x||x.toLowerCase(),""}),i["max-age"]){let a=parseInt(i["max-age"],10);isNaN(a)?delete i["max-age"]:i["max-age"]=a}return i}let Fe,qe,ht=null;function At(s){if(ht==null){let i=s.navigator?s.navigator.userAgent:null;ht=!!s.safari||!(!i||!(/\b(iPad|iPhone|iPod)\b/.test(i)||i.match("Safari")&&!i.match("Chrome")))}return ht}function Ot(s){return typeof ImageBitmap<"u"&&s instanceof ImageBitmap}let Yt={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(s){let i=requestAnimationFrame(s);return{cancel:()=>cancelAnimationFrame(i)}},getImageData(s,i=0){let a=window.document.createElement("canvas"),h=a.getContext("2d");if(!h)throw new Error("failed to create canvas 2d context");return a.width=s.width,a.height=s.height,h.drawImage(s,0,0,s.width,s.height),h.getImageData(-i,-i,s.width+2*i,s.height+2*i)},resolveURL:s=>(Fe||(Fe=document.createElement("a")),Fe.href=s,Fe.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(qe==null&&(qe=matchMedia("(prefers-reduced-motion: reduce)")),qe.matches)}};var at=Zt;function Zt(s,i){this.x=s,this.y=i}Zt.prototype={clone:function(){return new Zt(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,i){return this.clone()._rotateAround(s,i)},matMult:function(s){return this.clone()._matMult(s)},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(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var i=s.x-this.x,a=s.y-this.y;return i*i+a*a},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,i){return Math.atan2(this.x*i-this.y*s,this.x*s+this.y*i)},_matMult:function(s){var i=s[2]*this.x+s[3]*this.y;return this.x=s[0]*this.x+s[1]*this.y,this.y=i,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var i=Math.cos(s),a=Math.sin(s),h=a*this.x+i*this.y;return this.x=i*this.x-a*this.y,this.y=h,this},_rotateAround:function(s,i){var a=Math.cos(s),h=Math.sin(s),p=i.y+h*(this.x-i.x)+a*(this.y-i.y);return this.x=i.x+a*(this.x-i.x)-h*(this.y-i.y),this.y=p,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Zt.convert=function(s){return s instanceof Zt?s:Array.isArray(s)?new Zt(s[0],s[1]):s};let zi={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},Ii="mapbox-tiles",jt,ur,Xi=500,si=50;function ti(){typeof caches>"u"||jt||(jt=caches.open(Ii))}let _i=1/0,Ei={supported:!1,testSupport:function(s){!Ji&&Fi&&(Cr?tn(s):Li=s)}},Li,Fi,Ji=!1,Cr=!1;function tn(s){let i=s.createTexture();s.bindTexture(s.TEXTURE_2D,i);try{if(s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,Fi),s.isContextLost())return;Ei.supported=!0}catch{}s.deleteTexture(i),Ji=!0}typeof document<"u"&&(Fi=document.createElement("img"),Fi.onload=function(){Li&&tn(Li),Li=null,Cr=!0},Fi.onerror=function(){Ji=!0,Li=null},Fi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");let no={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(no);class ii extends Error{constructor(i,a,h,p){super(`AJAXError: ${a} (${i}): ${h}`),this.status=i,this.statusText=a,this.url=h,this.body=p}}let Hr=Se()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function hn(s,i){let a=new AbortController,h=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,referrer:Hr(),signal:a.signal}),p=!1,y=!1;return s.type==="json"&&h.headers.set("Accept","application/json"),((x,w,S)=>{if(y)return;let T=Date.now();fetch(h).then(z=>z.ok?((R,N,G)=>{(s.type==="arrayBuffer"?R.arrayBuffer():s.type==="json"?R.json():R.text()).then(W=>{y||(N&&G&&function(se,ae,be){if(ti(),!jt)return;let Ee={status:ae.status,statusText:ae.statusText,headers:new Headers};ae.headers.forEach((Le,We)=>Ee.headers.set(We,Le));let Me=Be(ae.headers.get("Cache-Control")||"");Me["no-store"]||(Me["max-age"]&&Ee.headers.set("Expires",new Date(be+1e3*Me["max-age"]).toUTCString()),new Date(Ee.headers.get("Expires")).getTime()-be<42e4||function(Le,We){if(ur===void 0)try{new Response(new ReadableStream),ur=!0}catch{ur=!1}ur?We(Le.body):Le.blob().then(We)}(ae,Le=>{let We=new Response(Le,Ee);ti(),jt&&jt.then(Oe=>Oe.put(function(pt){let bt=pt.indexOf("?");return bt<0?pt:pt.slice(0,bt)}(se.url),We)).catch(Oe=>te(Oe.message))}))}(h,N,G),p=!0,i(null,W,R.headers.get("Cache-Control"),R.headers.get("Expires")))}).catch(W=>{y||i(new Error(W.message))})})(z,null,T):z.blob().then(R=>i(new ii(z.status,z.statusText,s.url,R)))).catch(z=>{z.code!==20&&i(new Error(z.message))})})(),{cancel:()=>{y=!0,p||a.abort()}}}let rn=function(s,i){if(/:\/\//.test(s.url)&&!/^https?:|^file:/.test(s.url)){if(Se()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",s,i);if(!Se()){let h=s.url.substring(0,s.url.indexOf("://"));return(zi.REGISTERED_PROTOCOLS[h]||hn)(s,i)}}if(!(/^file:/.test(a=s.url)||/^file:/.test(Hr())&&!/^\w+:/.test(a))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return hn(s,i);if(Se()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",s,i,void 0,!0)}var a;return function(h,p){let y=new XMLHttpRequest;y.open(h.method||"GET",h.url,!0),h.type==="arrayBuffer"&&(y.responseType="arraybuffer");for(let x in h.headers)y.setRequestHeader(x,h.headers[x]);return h.type==="json"&&(y.responseType="text",y.setRequestHeader("Accept","application/json")),y.withCredentials=h.credentials==="include",y.onerror=()=>{p(new Error(y.statusText))},y.onload=()=>{if((y.status>=200&&y.status<300||y.status===0)&&y.response!==null){let x=y.response;if(h.type==="json")try{x=JSON.parse(y.response)}catch(w){return p(w)}p(null,x,y.getResponseHeader("Cache-Control"),y.getResponseHeader("Expires"))}else{let x=new Blob([y.response],{type:y.getResponseHeader("Content-Type")});p(new ii(y.status,y.statusText,h.url,x))}},y.send(h.body),{cancel:()=>y.abort()}}(s,i)},zr=function(s,i){return rn(Z(s,{type:"arrayBuffer"}),i)};function Qo(s){let i=window.document.createElement("a");return i.href=s,i.protocol===window.document.location.protocol&&i.host===window.document.location.host}let _e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",V,F;V=[],F=0;let U=function(s,i){if(Ei.supported&&(s.headers||(s.headers={}),s.headers.accept="image/webp,*/*"),F>=zi.MAX_PARALLEL_IMAGE_REQUESTS){let y={requestParameters:s,callback:i,cancelled:!1,cancel(){this.cancelled=!0}};return V.push(y),y}F++;let a=!1,h=()=>{if(!a)for(a=!0,F--;V.length&&F<zi.MAX_PARALLEL_IMAGE_REQUESTS;){let y=V.shift(),{requestParameters:x,callback:w,cancelled:S}=y;S||(y.cancel=U(x,w).cancel)}},p=zr(s,(y,x,w,S)=>{h(),y?i(y):x&&function(T,z){typeof createImageBitmap=="function"?function(R,N){let G=new Blob([new Uint8Array(R)],{type:"image/png"});createImageBitmap(G).then(W=>{N(null,W)}).catch(W=>{N(new Error(`Could not load image because of ${W.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(T,z):function(R,N){let G=new Image;G.onload=()=>{N(null,G),URL.revokeObjectURL(G.src),G.onload=null,window.requestAnimationFrame(()=>{G.src=_e})},G.onerror=()=>N(new 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."));let W=new Blob([new Uint8Array(R)],{type:"image/png"});G.src=R.byteLength?URL.createObjectURL(W):_e}(T,z)}(x,(T,z)=>{T!=null?i(T):z!=null&&i(null,z,{cacheControl:w,expires:S})})});return{cancel:()=>{p.cancel(),h()}}};function K(s,i,a){a[s]&&a[s].indexOf(i)!==-1||(a[s]=a[s]||[],a[s].push(i))}function he(s,i,a){if(a&&a[s]){let h=a[s].indexOf(i);h!==-1&&a[s].splice(h,1)}}class Ie{constructor(i,a={}){Z(this,a),this.type=i}}class Ve extends Ie{constructor(i,a={}){super("error",Z({error:i},a))}}class He{on(i,a){return this._listeners=this._listeners||{},K(i,a,this._listeners),this}off(i,a){return he(i,a,this._listeners),he(i,a,this._oneTimeListeners),this}once(i,a){return this._oneTimeListeners=this._oneTimeListeners||{},K(i,a,this._oneTimeListeners),this}fire(i,a){typeof i=="string"&&(i=new Ie(i,a||{}));let h=i.type;if(this.listens(h)){i.target=this;let p=this._listeners&&this._listeners[h]?this._listeners[h].slice():[];for(let w of p)w.call(this,i);let y=this._oneTimeListeners&&this._oneTimeListeners[h]?this._oneTimeListeners[h].slice():[];for(let w of y)he(h,w,this._oneTimeListeners),w.call(this,i);let x=this._eventedParent;x&&(Z(i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(i))}else i instanceof Ve&&console.error(i.error);return this}listens(i){return this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i)}setEventedParent(i,a){return this._eventedParent=i,this._eventedParentData=a,this}}var ye={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},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:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},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,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},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,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{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_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},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:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Re{constructor(i,a,h,p){this.message=(i?`${i}: `:"")+h,p&&(this.identifier=p),a!=null&&a.__line__&&(this.line=a.__line__)}}function ie(s){let i=s.value;return i?[new Re(s.key,i,"constants have been deprecated as of v8")]:[]}function Xe(s,...i){for(let a of i)for(let h in a)s[h]=a[h];return s}function $e(s){return s instanceof Number||s instanceof String||s instanceof Boolean?s.valueOf():s}function ft(s){if(Array.isArray(s))return s.map(ft);if(s instanceof Object&&!(s instanceof Number||s instanceof String||s instanceof Boolean)){let i={};for(let a in s)i[a]=ft(s[a]);return i}return $e(s)}class ut extends Error{constructor(i,a){super(a),this.message=a,this.key=i}}class Ht{constructor(i,a=[]){this.parent=i,this.bindings={};for(let[h,p]of a)this.bindings[h]=p}concat(i){return new Ht(this,i)}get(i){if(this.bindings[i])return this.bindings[i];if(this.parent)return this.parent.get(i);throw new Error(`${i} not found in scope.`)}has(i){return!!this.bindings[i]||!!this.parent&&this.parent.has(i)}}let Tt={kind:"null"},Ue={kind:"number"},It={kind:"string"},yt={kind:"boolean"},ri={kind:"color"},gi={kind:"object"},St={kind:"value"},tr={kind:"collator"},ci={kind:"formatted"},Ri={kind:"resolvedImage"};function hi(s,i){return{kind:"array",itemType:s,N:i}}function Ft(s){if(s.kind==="array"){let i=Ft(s.itemType);return typeof s.N=="number"?`array<${i}, ${s.N}>`:s.itemType.kind==="value"?"array":`array<${i}>`}return s.kind}let di=[Tt,Ue,It,yt,ri,ci,gi,hi(St),Ri];function ir(s,i){if(i.kind==="error")return null;if(s.kind==="array"){if(i.kind==="array"&&(i.N===0&&i.itemType.kind==="value"||!ir(s.itemType,i.itemType))&&(typeof s.N!="number"||s.N===i.N))return null}else{if(s.kind===i.kind)return null;if(s.kind==="value"){for(let a of di)if(!ir(a,i))return null}}return`Expected ${Ft(s)} but found ${Ft(i)} instead.`}function Ai(s,i){return i.some(a=>a.kind===s.kind)}function Mr(s,i){return i.some(a=>a==="null"?s===null:a==="array"?Array.isArray(s):a==="object"?s&&!Array.isArray(s)&&typeof s=="object":a===typeof s)}var rr,Ti={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 oa(s){return(s=Math.round(s))<0?0:s>255?255:s}function sa(s){return oa(s[s.length-1]==="%"?parseFloat(s)/100*255:parseInt(s))}function Y(s){return(i=s[s.length-1]==="%"?parseFloat(s)/100:parseFloat(s))<0?0:i>1?1:i;var i}function P(s,i,a){return a<0?a+=1:a>1&&(a-=1),6*a<1?s+(i-s)*a*6:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s}try{rr={}.parseCSSColor=function(s){var i,a=s.replace(/ /g,"").toLowerCase();if(a in Ti)return Ti[a].slice();if(a[0]==="#")return a.length===4?(i=parseInt(a.substr(1),16))>=0&&i<=4095?[(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1]:null:a.length===7&&(i=parseInt(a.substr(1),16))>=0&&i<=16777215?[(16711680&i)>>16,(65280&i)>>8,255&i,1]:null;var h=a.indexOf("("),p=a.indexOf(")");if(h!==-1&&p+1===a.length){var y=a.substr(0,h),x=a.substr(h+1,p-(h+1)).split(","),w=1;switch(y){case"rgba":if(x.length!==4)return null;w=Y(x.pop());case"rgb":return x.length!==3?null:[sa(x[0]),sa(x[1]),sa(x[2]),w];case"hsla":if(x.length!==4)return null;w=Y(x.pop());case"hsl":if(x.length!==3)return null;var S=(parseFloat(x[0])%360+360)%360/360,T=Y(x[1]),z=Y(x[2]),R=z<=.5?z*(T+1):z+T-z*T,N=2*z-R;return[oa(255*P(N,R,S+1/3)),oa(255*P(N,R,S)),oa(255*P(N,R,S-1/3)),w];default:return null}}return null}}catch{}class L{constructor(i,a,h,p=1){this.r=i,this.g=a,this.b=h,this.a=p}static parse(i){if(!i)return;if(i instanceof L)return i;if(typeof i!="string")return;let a=rr(i);return a?new L(a[0]/255*a[3],a[1]/255*a[3],a[2]/255*a[3],a[3]):void 0}toString(){let[i,a,h,p]=this.toArray();return`rgba(${Math.round(i)},${Math.round(a)},${Math.round(h)},${p})`}toArray(){let{r:i,g:a,b:h,a:p}=this;return p===0?[0,0,0,0]:[255*i/p,255*a/p,255*h/p,p]}}L.black=new L(0,0,0,1),L.white=new L(1,1,1,1),L.transparent=new L(0,0,0,0),L.red=new L(1,0,0,1);class j{constructor(i,a,h){this.sensitivity=i?a?"variant":"case":a?"accent":"base",this.locale=h,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(i,a){return this.collator.compare(i,a)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class J{constructor(i,a,h,p,y){this.text=i,this.image=a,this.scale=h,this.fontStack=p,this.textColor=y}}class re{constructor(i){this.sections=i}static fromString(i){return new re([new J(i,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(i=>i.text.length!==0||i.image&&i.image.name.length!==0)}static factory(i){return i instanceof re?i:re.fromString(i)}toString(){return this.sections.length===0?"":this.sections.map(i=>i.text).join("")}serialize(){let i=["format"];for(let a of this.sections){if(a.image){i.push(["image",a.image.name]);continue}i.push(a.text);let h={};a.fontStack&&(h["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(h["font-scale"]=a.scale),a.textColor&&(h["text-color"]=["rgba"].concat(a.textColor.toArray())),i.push(h)}return i}}class pe{constructor(i){this.name=i.name,this.available=i.available}toString(){return this.name}static fromString(i){return i?new pe({name:i,available:!1}):null}serialize(){return["image",this.name]}}function ue(s,i,a,h){return typeof s=="number"&&s>=0&&s<=255&&typeof i=="number"&&i>=0&&i<=255&&typeof a=="number"&&a>=0&&a<=255?h===void 0||typeof h=="number"&&h>=0&&h<=1?null:`Invalid rgba value [${[s,i,a,h].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof h=="number"?[s,i,a,h]:[s,i,a]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ce(s){if(s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"||s instanceof L||s instanceof j||s instanceof re||s instanceof pe)return!0;if(Array.isArray(s)){for(let i of s)if(!ce(i))return!1;return!0}if(typeof s=="object"){for(let i in s)if(!ce(s[i]))return!1;return!0}return!1}function fe(s){if(s===null)return Tt;if(typeof s=="string")return It;if(typeof s=="boolean")return yt;if(typeof s=="number")return Ue;if(s instanceof L)return ri;if(s instanceof j)return tr;if(s instanceof re)return ci;if(s instanceof pe)return Ri;if(Array.isArray(s)){let i=s.length,a;for(let h of s){let p=fe(h);if(a){if(a===p)continue;a=St;break}a=p}return hi(a||St,i)}return gi}function Pe(s){let i=typeof s;return s===null?"":i==="string"||i==="number"||i==="boolean"?String(s):s instanceof L||s instanceof re||s instanceof pe?s.toString():JSON.stringify(s)}class Ge{constructor(i,a){this.type=i,this.value=a}static parse(i,a){if(i.length!==2)return a.error(`'literal' expression requires exactly one argument, but found ${i.length-1} instead.`);if(!ce(i[1]))return a.error("invalid value");let h=i[1],p=fe(h),y=a.expectedType;return p.kind!=="array"||p.N!==0||!y||y.kind!=="array"||typeof y.N=="number"&&y.N!==0||(p=y),new Ge(p,h)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof L?["rgba"].concat(this.value.toArray()):this.value instanceof re?this.value.serialize():this.value}}class Ae{constructor(i){this.name="ExpressionEvaluationError",this.message=i}toJSON(){return this.message}}let gt={string:It,number:Ue,boolean:yt,object:gi};class lt{constructor(i,a){this.type=i,this.args=a}static parse(i,a){if(i.length<2)return a.error("Expected at least one argument.");let h,p=1,y=i[0];if(y==="array"){let w,S;if(i.length>2){let T=i[1];if(typeof T!="string"||!(T in gt)||T==="object")return a.error('The item type argument of "array" must be one of string, number, boolean',1);w=gt[T],p++}else w=St;if(i.length>3){if(i[2]!==null&&(typeof i[2]!="number"||i[2]<0||i[2]!==Math.floor(i[2])))return a.error('The length argument to "array" must be a positive integer literal',2);S=i[2],p++}h=hi(w,S)}else h=gt[y];let x=[];for(;p<i.length;p++){let w=a.parse(i[p],p,St);if(!w)return null;x.push(w)}return new lt(h,x)}evaluate(i){for(let a=0;a<this.args.length;a++){let h=this.args[a].evaluate(i);if(!ir(this.type,fe(h)))return h;if(a===this.args.length-1)throw new Ae(`Expected value to be of type ${Ft(this.type)}, but found ${Ft(fe(h))} instead.`)}return null}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){let i=this.type,a=[i.kind];if(i.kind==="array"){let h=i.itemType;if(h.kind==="string"||h.kind==="number"||h.kind==="boolean"){a.push(h.kind);let p=i.N;(typeof p=="number"||this.args.length>1)&&a.push(p)}}return a.concat(this.args.map(h=>h.serialize()))}}class xt{constructor(i){this.type=ci,this.sections=i}static parse(i,a){if(i.length<2)return a.error("Expected at least one argument.");let h=i[1];if(!Array.isArray(h)&&typeof h=="object")return a.error("First argument must be an image or text section.");let p=[],y=!1;for(let x=1;x<=i.length-1;++x){let w=i[x];if(y&&typeof w=="object"&&!Array.isArray(w)){y=!1;let S=null;if(w["font-scale"]&&(S=a.parse(w["font-scale"],1,Ue),!S))return null;let T=null;if(w["text-font"]&&(T=a.parse(w["text-font"],1,hi(It)),!T))return null;let z=null;if(w["text-color"]&&(z=a.parse(w["text-color"],1,ri),!z))return null;let R=p[p.length-1];R.scale=S,R.font=T,R.textColor=z}else{let S=a.parse(i[x],1,St);if(!S)return null;let T=S.type.kind;if(T!=="string"&&T!=="value"&&T!=="null"&&T!=="resolvedImage")return a.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");y=!0,p.push({content:S,scale:null,font:null,textColor:null})}}return new xt(p)}evaluate(i){return new re(this.sections.map(a=>{let h=a.content.evaluate(i);return fe(h)===Ri?new J("",h,null,null,null):new J(Pe(h),null,a.scale?a.scale.evaluate(i):null,a.font?a.font.evaluate(i).join(","):null,a.textColor?a.textColor.evaluate(i):null)}))}eachChild(i){for(let a of this.sections)i(a.content),a.scale&&i(a.scale),a.font&&i(a.font),a.textColor&&i(a.textColor)}outputDefined(){return!1}serialize(){let i=["format"];for(let a of this.sections){i.push(a.content.serialize());let h={};a.scale&&(h["font-scale"]=a.scale.serialize()),a.font&&(h["text-font"]=a.font.serialize()),a.textColor&&(h["text-color"]=a.textColor.serialize()),i.push(h)}return i}}class Ct{constructor(i){this.type=Ri,this.input=i}static parse(i,a){if(i.length!==2)return a.error("Expected two arguments.");let h=a.parse(i[1],1,It);return h?new Ct(h):a.error("No image name provided.")}evaluate(i){let a=this.input.evaluate(i),h=pe.fromString(a);return h&&i.availableImages&&(h.available=i.availableImages.indexOf(a)>-1),h}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}let ni={"to-boolean":yt,"to-color":ri,"to-number":Ue,"to-string":It};class $t{constructor(i,a){this.type=i,this.args=a}static parse(i,a){if(i.length<2)return a.error("Expected at least one argument.");let h=i[0];if((h==="to-boolean"||h==="to-string")&&i.length!==2)return a.error("Expected one argument.");let p=ni[h],y=[];for(let x=1;x<i.length;x++){let w=a.parse(i[x],x,St);if(!w)return null;y.push(w)}return new $t(p,y)}evaluate(i){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(i));if(this.type.kind==="color"){let a,h;for(let p of this.args){if(a=p.evaluate(i),h=null,a instanceof L)return a;if(typeof a=="string"){let y=i.parseColor(a);if(y)return y}else if(Array.isArray(a)&&(h=a.length<3||a.length>4?`Invalid rbga value ${JSON.stringify(a)}: expected an array containing either three or four numeric values.`:ue(a[0],a[1],a[2],a[3]),!h))return new L(a[0]/255,a[1]/255,a[2]/255,a[3])}throw new Ae(h||`Could not parse color from value '${typeof a=="string"?a:String(JSON.stringify(a))}'`)}if(this.type.kind==="number"){let a=null;for(let h of this.args){if(a=h.evaluate(i),a===null)return 0;let p=Number(a);if(!isNaN(p))return p}throw new Ae(`Could not convert ${JSON.stringify(a)} to number.`)}return this.type.kind==="formatted"?re.fromString(Pe(this.args[0].evaluate(i))):this.type.kind==="resolvedImage"?pe.fromString(Pe(this.args[0].evaluate(i))):Pe(this.args[0].evaluate(i))}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){if(this.type.kind==="formatted")return new xt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ct(this.args[0]).serialize();let i=[`to-${this.type.kind}`];return this.eachChild(a=>{i.push(a.serialize())}),i}}let Ut=["Unknown","Point","LineString","Polygon"];class Bt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ut[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||{}}parseColor(i){let a=this._parseColorCache[i];return a||(a=this._parseColorCache[i]=L.parse(i)),a}}class Rt{constructor(i,a,h,p){this.name=i,this.type=a,this._evaluate=h,this.args=p}evaluate(i){return this._evaluate(i,this.args)}eachChild(i){this.args.forEach(i)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(i=>i.serialize()))}static parse(i,a){let h=i[0],p=Rt.definitions[h];if(!p)return a.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0);let y=Array.isArray(p)?p[0]:p.type,x=Array.isArray(p)?[[p[1],p[2]]]:p.overloads,w=x.filter(([T])=>!Array.isArray(T)||T.length===i.length-1),S=null;for(let[T,z]of w){S=new tu(a.registry,a.path,null,a.scope);let R=[],N=!1;for(let G=1;G<i.length;G++){let W=i[G],se=Array.isArray(T)?T[G-1]:T.type,ae=S.parse(W,1+R.length,se);if(!ae){N=!0;break}R.push(ae)}if(!N)if(Array.isArray(T)&&T.length!==R.length)S.error(`Expected ${T.length} arguments, but found ${R.length} instead.`);else{for(let G=0;G<R.length;G++){let W=Array.isArray(T)?T[G]:T.type,se=R[G];S.concat(G+1).checkSubtype(W,se.type)}if(S.errors.length===0)return new Rt(h,y,z,R)}}if(w.length===1)a.errors.push(...S.errors);else{let T=(w.length?w:x).map(([R])=>{return N=R,Array.isArray(N)?`(${N.map(Ft).join(", ")})`:`(${Ft(N.type)}...)`;var N}).join(" | "),z=[];for(let R=1;R<i.length;R++){let N=a.parse(i[R],1+z.length);if(!N)return null;z.push(Ft(N.type))}a.error(`Expected arguments of type ${T}, but found (${z.join(", ")}) instead.`)}return null}static register(i,a){Rt.definitions=a;for(let h in a)i[h]=Rt}}class cr{constructor(i,a,h){this.type=tr,this.locale=h,this.caseSensitive=i,this.diacriticSensitive=a}static parse(i,a){if(i.length!==2)return a.error("Expected one argument.");let h=i[1];if(typeof h!="object"||Array.isArray(h))return a.error("Collator options argument must be an object.");let p=a.parse(h["case-sensitive"]!==void 0&&h["case-sensitive"],1,yt);if(!p)return null;let y=a.parse(h["diacritic-sensitive"]!==void 0&&h["diacritic-sensitive"],1,yt);if(!y)return null;let x=null;return h.locale&&(x=a.parse(h.locale,1,It),!x)?null:new cr(p,y,x)}evaluate(i){return new j(this.caseSensitive.evaluate(i),this.diacriticSensitive.evaluate(i),this.locale?this.locale.evaluate(i):null)}eachChild(i){i(this.caseSensitive),i(this.diacriticSensitive),this.locale&&i(this.locale)}outputDefined(){return!1}serialize(){let i={};return i["case-sensitive"]=this.caseSensitive.serialize(),i["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(i.locale=this.locale.serialize()),["collator",i]}}let nr=8192;function Lr(s,i){s[0]=Math.min(s[0],i[0]),s[1]=Math.min(s[1],i[1]),s[2]=Math.max(s[2],i[0]),s[3]=Math.max(s[3],i[1])}function Nr(s,i){return!(s[0]<=i[0]||s[2]>=i[2]||s[1]<=i[1]||s[3]>=i[3])}function Gc(s,i){let a=(180+s[0])/360,h=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s[1]*Math.PI/360)))/360,p=Math.pow(2,i.z);return[Math.round(a*p*nr),Math.round(h*p*nr)]}function Vc(s,i,a){let h=s[0]-i[0],p=s[1]-i[1],y=s[0]-a[0],x=s[1]-a[1];return h*x-y*p==0&&h*y<=0&&p*x<=0}function Pi(s,i){let a=!1;for(let x=0,w=i.length;x<w;x++){let S=i[x];for(let T=0,z=S.length;T<z-1;T++){if(Vc(s,S[T],S[T+1]))return!1;(p=S[T])[1]>(h=s)[1]!=(y=S[T+1])[1]>h[1]&&h[0]<(y[0]-p[0])*(h[1]-p[1])/(y[1]-p[1])+p[0]&&(a=!a)}}var h,p,y;return a}function Vg(s,i){for(let a=0;a<i.length;a++)if(Pi(s,i[a]))return!0;return!1}function Uc(s,i,a,h){let p=h[0]-a[0],y=h[1]-a[1],x=(s[0]-a[0])*y-p*(s[1]-a[1]),w=(i[0]-a[0])*y-p*(i[1]-a[1]);return x>0&&w<0||x<0&&w>0}function Ug(s,i,a){for(let T of a)for(let z=0;z<T.length-1;++z)if((w=[(x=T[z+1])[0]-(y=T[z])[0],x[1]-y[1]])[0]*(S=[(p=i)[0]-(h=s)[0],p[1]-h[1]])[1]-w[1]*S[0]!=0&&Uc(h,p,y,x)&&Uc(y,x,h,p))return!0;var h,p,y,x,w,S;return!1}function Wc(s,i){for(let a=0;a<s.length;++a)if(!Pi(s[a],i))return!1;for(let a=0;a<s.length-1;++a)if(Ug(s[a],s[a+1],i))return!1;return!0}function op(s,i){for(let a=0;a<i.length;a++)if(Wc(s,i[a]))return!0;return!1}function Zc(s,i,a){let h=[];for(let p=0;p<s.length;p++){let y=[];for(let x=0;x<s[p].length;x++){let w=Gc(s[p][x],a);Lr(i,w),y.push(w)}h.push(y)}return h}function jc(s,i,a){let h=[];for(let p=0;p<s.length;p++){let y=Zc(s[p],i,a);h.push(y)}return h}function Hc(s,i,a,h){if(s[0]<a[0]||s[0]>a[2]){let p=.5*h,y=s[0]-a[0]>p?-h:a[0]-s[0]>p?h:0;y===0&&(y=s[0]-a[2]>p?-h:a[2]-s[0]>p?h:0),s[0]+=y}Lr(i,s)}function sp(s,i,a,h){let p=Math.pow(2,h.z)*nr,y=[h.x*nr,h.y*nr],x=[];for(let w of s)for(let S of w){let T=[S.x+y[0],S.y+y[1]];Hc(T,i,a,p),x.push(T)}return x}function ap(s,i,a,h){let p=Math.pow(2,h.z)*nr,y=[h.x*nr,h.y*nr],x=[];for(let S of s){let T=[];for(let z of S){let R=[z.x+y[0],z.y+y[1]];Lr(i,R),T.push(R)}x.push(T)}if(i[2]-i[0]<=p/2){(w=i)[0]=w[1]=1/0,w[2]=w[3]=-1/0;for(let S of x)for(let T of S)Hc(T,i,a,p)}var w;return x}class xs{constructor(i,a){this.type=yt,this.geojson=i,this.geometries=a}static parse(i,a){if(i.length!==2)return a.error(`'within' expression requires exactly one argument, but found ${i.length-1} instead.`);if(ce(i[1])){let h=i[1];if(h.type==="FeatureCollection")for(let p=0;p<h.features.length;++p){let y=h.features[p].geometry.type;if(y==="Polygon"||y==="MultiPolygon")return new xs(h,h.features[p].geometry)}else if(h.type==="Feature"){let p=h.geometry.type;if(p==="Polygon"||p==="MultiPolygon")return new xs(h,h.geometry)}else if(h.type==="Polygon"||h.type==="MultiPolygon")return new xs(h,h)}return a.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(i){if(i.geometry()!=null&&i.canonicalID()!=null){if(i.geometryType()==="Point")return function(a,h){let p=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],x=a.canonicalID();if(h.type==="Polygon"){let w=Zc(h.coordinates,y,x),S=sp(a.geometry(),p,y,x);if(!Nr(p,y))return!1;for(let T of S)if(!Pi(T,w))return!1}if(h.type==="MultiPolygon"){let w=jc(h.coordinates,y,x),S=sp(a.geometry(),p,y,x);if(!Nr(p,y))return!1;for(let T of S)if(!Vg(T,w))return!1}return!0}(i,this.geometries);if(i.geometryType()==="LineString")return function(a,h){let p=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],x=a.canonicalID();if(h.type==="Polygon"){let w=Zc(h.coordinates,y,x),S=ap(a.geometry(),p,y,x);if(!Nr(p,y))return!1;for(let T of S)if(!Wc(T,w))return!1}if(h.type==="MultiPolygon"){let w=jc(h.coordinates,y,x),S=ap(a.geometry(),p,y,x);if(!Nr(p,y))return!1;for(let T of S)if(!op(T,w))return!1}return!0}(i,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Kl(s){if(s instanceof Rt&&(s.name==="get"&&s.args.length===1||s.name==="feature-state"||s.name==="has"&&s.args.length===1||s.name==="properties"||s.name==="geometry-type"||s.name==="id"||/^filter-/.test(s.name))||s instanceof xs)return!1;let i=!0;return s.eachChild(a=>{i&&!Kl(a)&&(i=!1)}),i}function aa(s){if(s instanceof Rt&&s.name==="feature-state")return!1;let i=!0;return s.eachChild(a=>{i&&!aa(a)&&(i=!1)}),i}function tl(s,i){if(s instanceof Rt&&i.indexOf(s.name)>=0)return!1;let a=!0;return s.eachChild(h=>{a&&!tl(h,i)&&(a=!1)}),a}class eu{constructor(i,a){this.type=a.type,this.name=i,this.boundExpression=a}static parse(i,a){if(i.length!==2||typeof i[1]!="string")return a.error("'var' expression requires exactly one string literal argument.");let h=i[1];return a.scope.has(h)?new eu(h,a.scope.get(h)):a.error(`Unknown variable "${h}". Make sure "${h}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(i){return this.boundExpression.evaluate(i)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class tu{constructor(i,a=[],h,p=new Ht,y=[]){this.registry=i,this.path=a,this.key=a.map(x=>`[${x}]`).join(""),this.scope=p,this.errors=y,this.expectedType=h}parse(i,a,h,p,y={}){return a?this.concat(a,h,p)._parse(i,y):this._parse(i,y)}_parse(i,a){function h(p,y,x){return x==="assert"?new lt(y,[p]):x==="coerce"?new $t(y,[p]):p}if(i!==null&&typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"||(i=["literal",i]),Array.isArray(i)){if(i.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let p=i[0];if(typeof p!="string")return this.error(`Expression name must be a string, but found ${typeof p} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let y=this.registry[p];if(y){let x=y.parse(i,this);if(!x)return null;if(this.expectedType){let w=this.expectedType,S=x.type;if(w.kind!=="string"&&w.kind!=="number"&&w.kind!=="boolean"&&w.kind!=="object"&&w.kind!=="array"||S.kind!=="value")if(w.kind!=="color"&&w.kind!=="formatted"&&w.kind!=="resolvedImage"||S.kind!=="value"&&S.kind!=="string"){if(this.checkSubtype(w,S))return null}else x=h(x,w,a.typeAnnotation||"coerce");else x=h(x,w,a.typeAnnotation||"assert")}if(!(x instanceof Ge)&&x.type.kind!=="resolvedImage"&&il(x)){let w=new Bt;try{x=new Ge(x.type,x.evaluate(w))}catch(S){return this.error(S.message),null}}return x}return this.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(i===void 0?"'undefined' value invalid. Use null instead.":typeof i=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof i} instead.`)}concat(i,a,h){let p=typeof i=="number"?this.path.concat(i):this.path,y=h?this.scope.concat(h):this.scope;return new tu(this.registry,p,a||null,y,this.errors)}error(i,...a){let h=`${this.key}${a.map(p=>`[${p}]`).join("")}`;this.errors.push(new ut(h,i))}checkSubtype(i,a){let h=ir(i,a);return h&&this.error(h),h}}function il(s){if(s instanceof eu)return il(s.boundExpression);if(s instanceof Rt&&s.name==="error"||s instanceof cr||s instanceof xs)return!1;let i=s instanceof $t||s instanceof lt,a=!0;return s.eachChild(h=>{a=i?a&&il(h):a&&h instanceof Ge}),!!a&&Kl(s)&&tl(s,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function iu(s,i){let a=s.length-1,h,p,y=0,x=a,w=0;for(;y<=x;)if(w=Math.floor((y+x)/2),h=s[w],p=s[w+1],h<=i){if(w===a||i<p)return w;y=w+1}else{if(!(h>i))throw new Ae("Input is not a number.");x=w-1}return 0}class rl{constructor(i,a,h){this.type=i,this.input=a,this.labels=[],this.outputs=[];for(let[p,y]of h)this.labels.push(p),this.outputs.push(y)}static parse(i,a){if(i.length-1<4)return a.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return a.error("Expected an even number of arguments.");let h=a.parse(i[1],1,Ue);if(!h)return null;let p=[],y=null;a.expectedType&&a.expectedType.kind!=="value"&&(y=a.expectedType);for(let x=1;x<i.length;x+=2){let w=x===1?-1/0:i[x],S=i[x+1],T=x,z=x+1;if(typeof w!="number")return a.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',T);if(p.length&&p[p.length-1][0]>=w)return a.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',T);let R=a.parse(S,z,y);if(!R)return null;y=y||R.type,p.push([w,R])}return new rl(y,h,p)}evaluate(i){let a=this.labels,h=this.outputs;if(a.length===1)return h[0].evaluate(i);let p=this.input.evaluate(i);if(p<=a[0])return h[0].evaluate(i);let y=a.length;return p>=a[y-1]?h[y-1].evaluate(i):h[iu(a,p)].evaluate(i)}eachChild(i){i(this.input);for(let a of this.outputs)i(a)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i=["step",this.input.serialize()];for(let a=0;a<this.labels.length;a++)a>0&&i.push(this.labels[a]),i.push(this.outputs[a].serialize());return i}}function vr(s,i,a){return s*(1-a)+i*a}var nl=Object.freeze({__proto__:null,number:vr,color:function(s,i,a){return new L(vr(s.r,i.r,a),vr(s.g,i.g,a),vr(s.b,i.b,a),vr(s.a,i.a,a))},array:function(s,i,a){return s.map((h,p)=>vr(h,i[p],a))}});let Xc=.95047,lp=1.08883,up=4/29,ru=6/29,$c=3*ru*ru,Wg=Math.PI/180,Zg=180/Math.PI;function Yc(s){return s>.008856451679035631?Math.pow(s,1/3):s/$c+up}function qc(s){return s>ru?s*s*s:$c*(s-up)}function Jc(s){return 255*(s<=.0031308?12.92*s:1.055*Math.pow(s,1/2.4)-.055)}function Qc(s){return(s/=255)<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}function cp(s){let i=Qc(s.r),a=Qc(s.g),h=Qc(s.b),p=Yc((.4124564*i+.3575761*a+.1804375*h)/Xc),y=Yc((.2126729*i+.7151522*a+.072175*h)/1);return{l:116*y-16,a:500*(p-y),b:200*(y-Yc((.0193339*i+.119192*a+.9503041*h)/lp)),alpha:s.a}}function pi(s){let i=(s.l+16)/116,a=isNaN(s.a)?i:i+s.a/500,h=isNaN(s.b)?i:i-s.b/200;return i=1*qc(i),a=Xc*qc(a),h=lp*qc(h),new L(Jc(3.2404542*a-1.5371385*i-.4985314*h),Jc(-.969266*a+1.8760108*i+.041556*h),Jc(.0556434*a-.2040259*i+1.0572252*h),s.alpha)}function jg(s,i,a){let h=i-s;return s+a*(h>180||h<-180?h-360*Math.round(h/360):h)}let ol={forward:cp,reverse:pi,interpolate:function(s,i,a){return{l:vr(s.l,i.l,a),a:vr(s.a,i.a,a),b:vr(s.b,i.b,a),alpha:vr(s.alpha,i.alpha,a)}}},sl={forward:function(s){let{l:i,a,b:h}=cp(s),p=Math.atan2(h,a)*Zg;return{h:p<0?p+360:p,c:Math.sqrt(a*a+h*h),l:i,alpha:s.a}},reverse:function(s){let i=s.h*Wg,a=s.c;return pi({l:s.l,a:Math.cos(i)*a,b:Math.sin(i)*a,alpha:s.alpha})},interpolate:function(s,i,a){return{h:jg(s.h,i.h,a),c:vr(s.c,i.c,a),l:vr(s.l,i.l,a),alpha:vr(s.alpha,i.alpha,a)}}};var hp=Object.freeze({__proto__:null,lab:ol,hcl:sl});class Cn{constructor(i,a,h,p,y){this.type=i,this.operator=a,this.interpolation=h,this.input=p,this.labels=[],this.outputs=[];for(let[x,w]of y)this.labels.push(x),this.outputs.push(w)}static interpolationFactor(i,a,h,p){let y=0;if(i.name==="exponential")y=Kc(a,i.base,h,p);else if(i.name==="linear")y=Kc(a,1,h,p);else if(i.name==="cubic-bezier"){let x=i.controlPoints;y=new m(x[0],x[1],x[2],x[3]).solve(Kc(a,1,h,p))}return y}static parse(i,a){let[h,p,y,...x]=i;if(!Array.isArray(p)||p.length===0)return a.error("Expected an interpolation type expression.",1);if(p[0]==="linear")p={name:"linear"};else if(p[0]==="exponential"){let T=p[1];if(typeof T!="number")return a.error("Exponential interpolation requires a numeric base.",1,1);p={name:"exponential",base:T}}else{if(p[0]!=="cubic-bezier")return a.error(`Unknown interpolation type ${String(p[0])}`,1,0);{let T=p.slice(1);if(T.length!==4||T.some(z=>typeof z!="number"||z<0||z>1))return a.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);p={name:"cubic-bezier",controlPoints:T}}}if(i.length-1<4)return a.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return a.error("Expected an even number of arguments.");if(y=a.parse(y,2,Ue),!y)return null;let w=[],S=null;h==="interpolate-hcl"||h==="interpolate-lab"?S=ri:a.expectedType&&a.expectedType.kind!=="value"&&(S=a.expectedType);for(let T=0;T<x.length;T+=2){let z=x[T],R=x[T+1],N=T+3,G=T+4;if(typeof z!="number")return a.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',N);if(w.length&&w[w.length-1][0]>=z)return a.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',N);let W=a.parse(R,G,S);if(!W)return null;S=S||W.type,w.push([z,W])}return S.kind==="number"||S.kind==="color"||S.kind==="array"&&S.itemType.kind==="number"&&typeof S.N=="number"?new Cn(S,h,p,y,w):a.error(`Type ${Ft(S)} is not interpolatable.`)}evaluate(i){let a=this.labels,h=this.outputs;if(a.length===1)return h[0].evaluate(i);let p=this.input.evaluate(i);if(p<=a[0])return h[0].evaluate(i);let y=a.length;if(p>=a[y-1])return h[y-1].evaluate(i);let x=iu(a,p),w=Cn.interpolationFactor(this.interpolation,p,a[x],a[x+1]),S=h[x].evaluate(i),T=h[x+1].evaluate(i);return this.operator==="interpolate"?nl[this.type.kind.toLowerCase()](S,T,w):this.operator==="interpolate-hcl"?sl.reverse(sl.interpolate(sl.forward(S),sl.forward(T),w)):ol.reverse(ol.interpolate(ol.forward(S),ol.forward(T),w))}eachChild(i){i(this.input);for(let a of this.outputs)i(a)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i;i=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);let a=[this.operator,i,this.input.serialize()];for(let h=0;h<this.labels.length;h++)a.push(this.labels[h],this.outputs[h].serialize());return a}}function Kc(s,i,a,h){let p=h-a,y=s-a;return p===0?0:i===1?y/p:(Math.pow(i,y)-1)/(Math.pow(i,p)-1)}class nu{constructor(i,a){this.type=i,this.args=a}static parse(i,a){if(i.length<2)return a.error("Expectected at least one argument.");let h=null,p=a.expectedType;p&&p.kind!=="value"&&(h=p);let y=[];for(let w of i.slice(1)){let S=a.parse(w,1+y.length,h,void 0,{typeAnnotation:"omit"});if(!S)return null;h=h||S.type,y.push(S)}let x=p&&y.some(w=>ir(p,w.type));return new nu(x?St:h,y)}evaluate(i){let a,h=null,p=0;for(let y of this.args)if(p++,h=y.evaluate(i),h&&h instanceof pe&&!h.available&&(a||(a=h.name),h=null,p===this.args.length&&(h=a)),h!==null)break;return h}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){let i=["coalesce"];return this.eachChild(a=>{i.push(a.serialize())}),i}}class ou{constructor(i,a){this.type=a.type,this.bindings=[].concat(i),this.result=a}evaluate(i){return this.result.evaluate(i)}eachChild(i){for(let a of this.bindings)i(a[1]);i(this.result)}static parse(i,a){if(i.length<4)return a.error(`Expected at least 3 arguments, but found ${i.length-1} instead.`);let h=[];for(let y=1;y<i.length-1;y+=2){let x=i[y];if(typeof x!="string")return a.error(`Expected string, but found ${typeof x} instead.`,y);if(/[^a-zA-Z0-9_]/.test(x))return a.error("Variable names must contain only alphanumeric characters or '_'.",y);let w=a.parse(i[y+1],y+1);if(!w)return null;h.push([x,w])}let p=a.parse(i[i.length-1],i.length-1,a.expectedType,h);return p?new ou(h,p):null}outputDefined(){return this.result.outputDefined()}serialize(){let i=["let"];for(let[a,h]of this.bindings)i.push(a,h.serialize());return i.push(this.result.serialize()),i}}class eh{constructor(i,a,h){this.type=i,this.index=a,this.input=h}static parse(i,a){if(i.length!==3)return a.error(`Expected 2 arguments, but found ${i.length-1} instead.`);let h=a.parse(i[1],1,Ue),p=a.parse(i[2],2,hi(a.expectedType||St));return h&&p?new eh(p.type.itemType,h,p):null}evaluate(i){let a=this.index.evaluate(i),h=this.input.evaluate(i);if(a<0)throw new Ae(`Array index out of bounds: ${a} < 0.`);if(a>=h.length)throw new Ae(`Array index out of bounds: ${a} > ${h.length-1}.`);if(a!==Math.floor(a))throw new Ae(`Array index must be an integer, but found ${a} instead.`);return h[a]}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class th{constructor(i,a){this.type=yt,this.needle=i,this.haystack=a}static parse(i,a){if(i.length!==3)return a.error(`Expected 2 arguments, but found ${i.length-1} instead.`);let h=a.parse(i[1],1,St),p=a.parse(i[2],2,St);return h&&p?Ai(h.type,[yt,It,Ue,Tt,St])?new th(h,p):a.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(h.type)} instead`):null}evaluate(i){let a=this.needle.evaluate(i),h=this.haystack.evaluate(i);if(!h)return!1;if(!Mr(a,["boolean","string","number","null"]))throw new Ae(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(fe(a))} instead.`);if(!Mr(h,["string","array"]))throw new Ae(`Expected second argument to be of type array or string, but found ${Ft(fe(h))} instead.`);return h.indexOf(a)>=0}eachChild(i){i(this.needle),i(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class su{constructor(i,a,h){this.type=Ue,this.needle=i,this.haystack=a,this.fromIndex=h}static parse(i,a){if(i.length<=2||i.length>=5)return a.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);let h=a.parse(i[1],1,St),p=a.parse(i[2],2,St);if(!h||!p)return null;if(!Ai(h.type,[yt,It,Ue,Tt,St]))return a.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(h.type)} instead`);if(i.length===4){let y=a.parse(i[3],3,Ue);return y?new su(h,p,y):null}return new su(h,p)}evaluate(i){let a=this.needle.evaluate(i),h=this.haystack.evaluate(i);if(!Mr(a,["boolean","string","number","null"]))throw new Ae(`Expected first argument to be of type boolean, string, number or null, but found ${Ft(fe(a))} instead.`);if(!Mr(h,["string","array"]))throw new Ae(`Expected second argument to be of type array or string, but found ${Ft(fe(h))} instead.`);if(this.fromIndex){let p=this.fromIndex.evaluate(i);return h.indexOf(a,p)}return h.indexOf(a)}eachChild(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){let i=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),i]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ih{constructor(i,a,h,p,y,x){this.inputType=i,this.type=a,this.input=h,this.cases=p,this.outputs=y,this.otherwise=x}static parse(i,a){if(i.length<5)return a.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length%2!=1)return a.error("Expected an even number of arguments.");let h,p;a.expectedType&&a.expectedType.kind!=="value"&&(p=a.expectedType);let y={},x=[];for(let T=2;T<i.length-1;T+=2){let z=i[T],R=i[T+1];Array.isArray(z)||(z=[z]);let N=a.concat(T);if(z.length===0)return N.error("Expected at least one branch label.");for(let W of z){if(typeof W!="number"&&typeof W!="string")return N.error("Branch labels must be numbers or strings.");if(typeof W=="number"&&Math.abs(W)>Number.MAX_SAFE_INTEGER)return N.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof W=="number"&&Math.floor(W)!==W)return N.error("Numeric branch labels must be integer values.");if(h){if(N.checkSubtype(h,fe(W)))return null}else h=fe(W);if(y[String(W)]!==void 0)return N.error("Branch labels must be unique.");y[String(W)]=x.length}let G=a.parse(R,T,p);if(!G)return null;p=p||G.type,x.push(G)}let w=a.parse(i[1],1,St);if(!w)return null;let S=a.parse(i[i.length-1],i.length-1,p);return S?w.type.kind!=="value"&&a.concat(1).checkSubtype(h,w.type)?null:new ih(h,p,w,y,x,S):null}evaluate(i){let a=this.input.evaluate(i);return(fe(a)===this.inputType&&this.outputs[this.cases[a]]||this.otherwise).evaluate(i)}eachChild(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)}outputDefined(){return this.outputs.every(i=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){let i=["match",this.input.serialize()],a=Object.keys(this.cases).sort(),h=[],p={};for(let x of a){let w=p[this.cases[x]];w===void 0?(p[this.cases[x]]=h.length,h.push([this.cases[x],[x]])):h[w][1].push(x)}let y=x=>this.inputType.kind==="number"?Number(x):x;for(let[x,w]of h)i.push(w.length===1?y(w[0]):w.map(y)),i.push(this.outputs[x].serialize());return i.push(this.otherwise.serialize()),i}}class rh{constructor(i,a,h){this.type=i,this.branches=a,this.otherwise=h}static parse(i,a){if(i.length<4)return a.error(`Expected at least 3 arguments, but found only ${i.length-1}.`);if(i.length%2!=0)return a.error("Expected an odd number of arguments.");let h;a.expectedType&&a.expectedType.kind!=="value"&&(h=a.expectedType);let p=[];for(let x=1;x<i.length-1;x+=2){let w=a.parse(i[x],x,yt);if(!w)return null;let S=a.parse(i[x+1],x+1,h);if(!S)return null;p.push([w,S]),h=h||S.type}let y=a.parse(i[i.length-1],i.length-1,h);return y?new rh(h,p,y):null}evaluate(i){for(let[a,h]of this.branches)if(a.evaluate(i))return h.evaluate(i);return this.otherwise.evaluate(i)}eachChild(i){for(let[a,h]of this.branches)i(a),i(h);i(this.otherwise)}outputDefined(){return this.branches.every(([i,a])=>a.outputDefined())&&this.otherwise.outputDefined()}serialize(){let i=["case"];return this.eachChild(a=>{i.push(a.serialize())}),i}}class au{constructor(i,a,h,p){this.type=i,this.input=a,this.beginIndex=h,this.endIndex=p}static parse(i,a){if(i.length<=2||i.length>=5)return a.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);let h=a.parse(i[1],1,St),p=a.parse(i[2],2,Ue);if(!h||!p)return null;if(!Ai(h.type,[hi(St),It,St]))return a.error(`Expected first argument to be of type array or string, but found ${Ft(h.type)} instead`);if(i.length===4){let y=a.parse(i[3],3,Ue);return y?new au(h.type,h,p,y):null}return new au(h.type,h,p)}evaluate(i){let a=this.input.evaluate(i),h=this.beginIndex.evaluate(i);if(!Mr(a,["string","array"]))throw new Ae(`Expected first argument to be of type array or string, but found ${Ft(fe(a))} instead.`);if(this.endIndex){let p=this.endIndex.evaluate(i);return a.slice(h,p)}return a.slice(h)}eachChild(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){let i=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),i]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function dp(s,i){return s==="=="||s==="!="?i.kind==="boolean"||i.kind==="string"||i.kind==="number"||i.kind==="null"||i.kind==="value":i.kind==="string"||i.kind==="number"||i.kind==="value"}function pp(s,i,a,h){return h.compare(i,a)===0}function la(s,i,a){let h=s!=="=="&&s!=="!=";return class SA{constructor(y,x,w){this.type=yt,this.lhs=y,this.rhs=x,this.collator=w,this.hasUntypedArgument=y.type.kind==="value"||x.type.kind==="value"}static parse(y,x){if(y.length!==3&&y.length!==4)return x.error("Expected two or three arguments.");let w=y[0],S=x.parse(y[1],1,St);if(!S)return null;if(!dp(w,S.type))return x.concat(1).error(`"${w}" comparisons are not supported for type '${Ft(S.type)}'.`);let T=x.parse(y[2],2,St);if(!T)return null;if(!dp(w,T.type))return x.concat(2).error(`"${w}" comparisons are not supported for type '${Ft(T.type)}'.`);if(S.type.kind!==T.type.kind&&S.type.kind!=="value"&&T.type.kind!=="value")return x.error(`Cannot compare types '${Ft(S.type)}' and '${Ft(T.type)}'.`);h&&(S.type.kind==="value"&&T.type.kind!=="value"?S=new lt(T.type,[S]):S.type.kind!=="value"&&T.type.kind==="value"&&(T=new lt(S.type,[T])));let z=null;if(y.length===4){if(S.type.kind!=="string"&&T.type.kind!=="string"&&S.type.kind!=="value"&&T.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(z=x.parse(y[3],3,tr),!z)return null}return new SA(S,T,z)}evaluate(y){let x=this.lhs.evaluate(y),w=this.rhs.evaluate(y);if(h&&this.hasUntypedArgument){let S=fe(x),T=fe(w);if(S.kind!==T.kind||S.kind!=="string"&&S.kind!=="number")throw new Ae(`Expected arguments for "${s}" to be (string, string) or (number, number), but found (${S.kind}, ${T.kind}) instead.`)}if(this.collator&&!h&&this.hasUntypedArgument){let S=fe(x),T=fe(w);if(S.kind!=="string"||T.kind!=="string")return i(y,x,w)}return this.collator?a(y,x,w,this.collator.evaluate(y)):i(y,x,w)}eachChild(y){y(this.lhs),y(this.rhs),this.collator&&y(this.collator)}outputDefined(){return!0}serialize(){let y=[s];return this.eachChild(x=>{y.push(x.serialize())}),y}}}let Hg=la("==",function(s,i,a){return i===a},pp),Xg=la("!=",function(s,i,a){return i!==a},function(s,i,a,h){return!pp(0,i,a,h)}),$g=la("<",function(s,i,a){return i<a},function(s,i,a,h){return h.compare(i,a)<0}),Yg=la(">",function(s,i,a){return i>a},function(s,i,a,h){return h.compare(i,a)>0}),qg=la("<=",function(s,i,a){return i<=a},function(s,i,a,h){return h.compare(i,a)<=0}),Jg=la(">=",function(s,i,a){return i>=a},function(s,i,a,h){return h.compare(i,a)>=0});class nh{constructor(i,a,h,p,y){this.type=It,this.number=i,this.locale=a,this.currency=h,this.minFractionDigits=p,this.maxFractionDigits=y}static parse(i,a){if(i.length!==3)return a.error("Expected two arguments.");let h=a.parse(i[1],1,Ue);if(!h)return null;let p=i[2];if(typeof p!="object"||Array.isArray(p))return a.error("NumberFormat options argument must be an object.");let y=null;if(p.locale&&(y=a.parse(p.locale,1,It),!y))return null;let x=null;if(p.currency&&(x=a.parse(p.currency,1,It),!x))return null;let w=null;if(p["min-fraction-digits"]&&(w=a.parse(p["min-fraction-digits"],1,Ue),!w))return null;let S=null;return p["max-fraction-digits"]&&(S=a.parse(p["max-fraction-digits"],1,Ue),!S)?null:new nh(h,y,x,w,S)}evaluate(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))}eachChild(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)}outputDefined(){return!1}serialize(){let i={};return this.locale&&(i.locale=this.locale.serialize()),this.currency&&(i.currency=this.currency.serialize()),this.minFractionDigits&&(i["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(i["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),i]}}class oh{constructor(i){this.type=Ue,this.input=i}static parse(i,a){if(i.length!==2)return a.error(`Expected 1 argument, but found ${i.length-1} instead.`);let h=a.parse(i[1],1);return h?h.type.kind!=="array"&&h.type.kind!=="string"&&h.type.kind!=="value"?a.error(`Expected argument of type string or array, but found ${Ft(h.type)} instead.`):new oh(h):null}evaluate(i){let a=this.input.evaluate(i);if(typeof a=="string"||Array.isArray(a))return a.length;throw new Ae(`Expected value to be of type string or array, but found ${Ft(fe(a))} instead.`)}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){let i=["length"];return this.eachChild(a=>{i.push(a.serialize())}),i}}let ua={"==":Hg,"!=":Xg,">":Yg,"<":$g,">=":Jg,"<=":qg,array:lt,at:eh,boolean:lt,case:rh,coalesce:nu,collator:cr,format:xt,image:Ct,in:th,"index-of":su,interpolate:Cn,"interpolate-hcl":Cn,"interpolate-lab":Cn,length:oh,let:ou,literal:Ge,match:ih,number:lt,"number-format":nh,object:lt,slice:au,step:rl,string:lt,"to-boolean":$t,"to-color":$t,"to-number":$t,"to-string":$t,var:eu,within:xs};function fp(s,[i,a,h,p]){i=i.evaluate(s),a=a.evaluate(s),h=h.evaluate(s);let y=p?p.evaluate(s):1,x=ue(i,a,h,y);if(x)throw new Ae(x);return new L(i/255*y,a/255*y,h/255*y,y)}function mp(s,i){return s in i}function sh(s,i){let a=i[s];return a===void 0?null:a}function _s(s){return{type:s}}function gp(s){return{result:"success",value:s}}function bs(s){return{result:"error",value:s}}function ca(s){return s["property-type"]==="data-driven"||s["property-type"]==="cross-faded-data-driven"}function yp(s){return!!s.expression&&s.expression.parameters.indexOf("zoom")>-1}function ah(s){return!!s.expression&&s.expression.interpolated}function Lt(s){return s instanceof Number?"number":s instanceof String?"string":s instanceof Boolean?"boolean":Array.isArray(s)?"array":s===null?"null":typeof s}function lu(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function bi(s){return s}function uu(s,i){let a=i.type==="color",h=s.stops&&typeof s.stops[0][0]=="object",p=h||!(h||s.property!==void 0),y=s.type||(ah(i)?"exponential":"interval");if(a&&((s=Xe({},s)).stops&&(s.stops=s.stops.map(T=>[T[0],L.parse(T[1])])),s.default=L.parse(s.default?s.default:i.default)),s.colorSpace&&s.colorSpace!=="rgb"&&!hp[s.colorSpace])throw new Error(`Unknown color space: ${s.colorSpace}`);let x,w,S;if(y==="exponential")x=lh;else if(y==="interval")x=cu;else if(y==="categorical"){x=or,w=Object.create(null);for(let T of s.stops)w[T[0]]=T[1];S=typeof s.stops[0][0]}else{if(y!=="identity")throw new Error(`Unknown function type "${y}"`);x=Qg}if(h){let T={},z=[];for(let G=0;G<s.stops.length;G++){let W=s.stops[G],se=W[0].zoom;T[se]===void 0&&(T[se]={zoom:se,type:s.type,property:s.property,default:s.default,stops:[]},z.push(se)),T[se].stops.push([W[0].value,W[1]])}let R=[];for(let G of z)R.push([T[G].zoom,uu(T[G],i)]);let N={name:"linear"};return{kind:"composite",interpolationType:N,interpolationFactor:Cn.interpolationFactor.bind(void 0,N),zoomStops:R.map(G=>G[0]),evaluate:({zoom:G},W)=>lh({stops:R,base:s.base},i,G).evaluate(G,W)}}if(p){let T=y==="exponential"?{name:"exponential",base:s.base!==void 0?s.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:Cn.interpolationFactor.bind(void 0,T),zoomStops:s.stops.map(z=>z[0]),evaluate:({zoom:z})=>x(s,i,z,w,S)}}return{kind:"source",evaluate(T,z){let R=z&&z.properties?z.properties[s.property]:void 0;return R===void 0?Gi(s.default,i.default):x(s,i,R,w,S)}}}function Gi(s,i,a){return s!==void 0?s:i!==void 0?i:a!==void 0?a:void 0}function or(s,i,a,h,p){return Gi(typeof a===p?h[a]:void 0,s.default,i.default)}function cu(s,i,a){if(Lt(a)!=="number")return Gi(s.default,i.default);let h=s.stops.length;if(h===1||a<=s.stops[0][0])return s.stops[0][1];if(a>=s.stops[h-1][0])return s.stops[h-1][1];let p=iu(s.stops.map(y=>y[0]),a);return s.stops[p][1]}function lh(s,i,a){let h=s.base!==void 0?s.base:1;if(Lt(a)!=="number")return Gi(s.default,i.default);let p=s.stops.length;if(p===1||a<=s.stops[0][0])return s.stops[0][1];if(a>=s.stops[p-1][0])return s.stops[p-1][1];let y=iu(s.stops.map(z=>z[0]),a),x=function(z,R,N,G){let W=G-N,se=z-N;return W===0?0:R===1?se/W:(Math.pow(R,se)-1)/(Math.pow(R,W)-1)}(a,h,s.stops[y][0],s.stops[y+1][0]),w=s.stops[y][1],S=s.stops[y+1][1],T=nl[i.type]||bi;if(s.colorSpace&&s.colorSpace!=="rgb"){let z=hp[s.colorSpace];T=(R,N)=>z.reverse(z.interpolate(z.forward(R),z.forward(N),x))}return typeof w.evaluate=="function"?{evaluate(...z){let R=w.evaluate.apply(void 0,z),N=S.evaluate.apply(void 0,z);if(R!==void 0&&N!==void 0)return T(R,N,x)}}:T(w,S,x)}function Qg(s,i,a){return i.type==="color"?a=L.parse(a):i.type==="formatted"?a=re.fromString(a.toString()):i.type==="resolvedImage"?a=pe.fromString(a.toString()):Lt(a)===i.type||i.type==="enum"&&i.values[a]||(a=void 0),Gi(a,s.default,i.default)}Rt.register(ua,{error:[{kind:"error"},[It],(s,[i])=>{throw new Ae(i.evaluate(s))}],typeof:[It,[St],(s,[i])=>Ft(fe(i.evaluate(s)))],"to-rgba":[hi(Ue,4),[ri],(s,[i])=>i.evaluate(s).toArray()],rgb:[ri,[Ue,Ue,Ue],fp],rgba:[ri,[Ue,Ue,Ue,Ue],fp],has:{type:yt,overloads:[[[It],(s,[i])=>mp(i.evaluate(s),s.properties())],[[It,gi],(s,[i,a])=>mp(i.evaluate(s),a.evaluate(s))]]},get:{type:St,overloads:[[[It],(s,[i])=>sh(i.evaluate(s),s.properties())],[[It,gi],(s,[i,a])=>sh(i.evaluate(s),a.evaluate(s))]]},"feature-state":[St,[It],(s,[i])=>sh(i.evaluate(s),s.featureState||{})],properties:[gi,[],s=>s.properties()],"geometry-type":[It,[],s=>s.geometryType()],id:[St,[],s=>s.id()],zoom:[Ue,[],s=>s.globals.zoom],"heatmap-density":[Ue,[],s=>s.globals.heatmapDensity||0],"line-progress":[Ue,[],s=>s.globals.lineProgress||0],accumulated:[St,[],s=>s.globals.accumulated===void 0?null:s.globals.accumulated],"+":[Ue,_s(Ue),(s,i)=>{let a=0;for(let h of i)a+=h.evaluate(s);return a}],"*":[Ue,_s(Ue),(s,i)=>{let a=1;for(let h of i)a*=h.evaluate(s);return a}],"-":{type:Ue,overloads:[[[Ue,Ue],(s,[i,a])=>i.evaluate(s)-a.evaluate(s)],[[Ue],(s,[i])=>-i.evaluate(s)]]},"/":[Ue,[Ue,Ue],(s,[i,a])=>i.evaluate(s)/a.evaluate(s)],"%":[Ue,[Ue,Ue],(s,[i,a])=>i.evaluate(s)%a.evaluate(s)],ln2:[Ue,[],()=>Math.LN2],pi:[Ue,[],()=>Math.PI],e:[Ue,[],()=>Math.E],"^":[Ue,[Ue,Ue],(s,[i,a])=>Math.pow(i.evaluate(s),a.evaluate(s))],sqrt:[Ue,[Ue],(s,[i])=>Math.sqrt(i.evaluate(s))],log10:[Ue,[Ue],(s,[i])=>Math.log(i.evaluate(s))/Math.LN10],ln:[Ue,[Ue],(s,[i])=>Math.log(i.evaluate(s))],log2:[Ue,[Ue],(s,[i])=>Math.log(i.evaluate(s))/Math.LN2],sin:[Ue,[Ue],(s,[i])=>Math.sin(i.evaluate(s))],cos:[Ue,[Ue],(s,[i])=>Math.cos(i.evaluate(s))],tan:[Ue,[Ue],(s,[i])=>Math.tan(i.evaluate(s))],asin:[Ue,[Ue],(s,[i])=>Math.asin(i.evaluate(s))],acos:[Ue,[Ue],(s,[i])=>Math.acos(i.evaluate(s))],atan:[Ue,[Ue],(s,[i])=>Math.atan(i.evaluate(s))],min:[Ue,_s(Ue),(s,i)=>Math.min(...i.map(a=>a.evaluate(s)))],max:[Ue,_s(Ue),(s,i)=>Math.max(...i.map(a=>a.evaluate(s)))],abs:[Ue,[Ue],(s,[i])=>Math.abs(i.evaluate(s))],round:[Ue,[Ue],(s,[i])=>{let a=i.evaluate(s);return a<0?-Math.round(-a):Math.round(a)}],floor:[Ue,[Ue],(s,[i])=>Math.floor(i.evaluate(s))],ceil:[Ue,[Ue],(s,[i])=>Math.ceil(i.evaluate(s))],"filter-==":[yt,[It,St],(s,[i,a])=>s.properties()[i.value]===a.value],"filter-id-==":[yt,[St],(s,[i])=>s.id()===i.value],"filter-type-==":[yt,[It],(s,[i])=>s.geometryType()===i.value],"filter-<":[yt,[It,St],(s,[i,a])=>{let h=s.properties()[i.value],p=a.value;return typeof h==typeof p&&h<p}],"filter-id-<":[yt,[St],(s,[i])=>{let a=s.id(),h=i.value;return typeof a==typeof h&&a<h}],"filter->":[yt,[It,St],(s,[i,a])=>{let h=s.properties()[i.value],p=a.value;return typeof h==typeof p&&h>p}],"filter-id->":[yt,[St],(s,[i])=>{let a=s.id(),h=i.value;return typeof a==typeof h&&a>h}],"filter-<=":[yt,[It,St],(s,[i,a])=>{let h=s.properties()[i.value],p=a.value;return typeof h==typeof p&&h<=p}],"filter-id-<=":[yt,[St],(s,[i])=>{let a=s.id(),h=i.value;return typeof a==typeof h&&a<=h}],"filter->=":[yt,[It,St],(s,[i,a])=>{let h=s.properties()[i.value],p=a.value;return typeof h==typeof p&&h>=p}],"filter-id->=":[yt,[St],(s,[i])=>{let a=s.id(),h=i.value;return typeof a==typeof h&&a>=h}],"filter-has":[yt,[St],(s,[i])=>i.value in s.properties()],"filter-has-id":[yt,[],s=>s.id()!==null&&s.id()!==void 0],"filter-type-in":[yt,[hi(It)],(s,[i])=>i.value.indexOf(s.geometryType())>=0],"filter-id-in":[yt,[hi(St)],(s,[i])=>i.value.indexOf(s.id())>=0],"filter-in-small":[yt,[It,hi(St)],(s,[i,a])=>a.value.indexOf(s.properties()[i.value])>=0],"filter-in-large":[yt,[It,hi(St)],(s,[i,a])=>function(h,p,y,x){for(;y<=x;){let w=y+x>>1;if(p[w]===h)return!0;p[w]>h?x=w-1:y=w+1}return!1}(s.properties()[i.value],a.value,0,a.value.length-1)],all:{type:yt,overloads:[[[yt,yt],(s,[i,a])=>i.evaluate(s)&&a.evaluate(s)],[_s(yt),(s,i)=>{for(let a of i)if(!a.evaluate(s))return!1;return!0}]]},any:{type:yt,overloads:[[[yt,yt],(s,[i,a])=>i.evaluate(s)||a.evaluate(s)],[_s(yt),(s,i)=>{for(let a of i)if(a.evaluate(s))return!0;return!1}]]},"!":[yt,[yt],(s,[i])=>!i.evaluate(s)],"is-supported-script":[yt,[It],(s,[i])=>{let a=s.globals&&s.globals.isSupportedScript;return!a||a(i.evaluate(s))}],upcase:[It,[It],(s,[i])=>i.evaluate(s).toUpperCase()],downcase:[It,[It],(s,[i])=>i.evaluate(s).toLowerCase()],concat:[It,_s(St),(s,i)=>i.map(a=>Pe(a.evaluate(s))).join("")],"resolved-locale":[It,[tr],(s,[i])=>i.evaluate(s).resolvedLocale()]});class uh{constructor(i,a){this.expression=i,this._warningHistory={},this._evaluator=new Bt,this._defaultValue=a?function(h){return h.type==="color"&&lu(h.default)?new L(0,0,0,0):h.type==="color"?L.parse(h.default)||null:h.default===void 0?null:h.default}(a):null,this._enumValues=a&&a.type==="enum"?a.values:null}evaluateWithoutErrorHandling(i,a,h,p,y,x){return this._evaluator.globals=i,this._evaluator.feature=a,this._evaluator.featureState=h,this._evaluator.canonical=p,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(i,a,h,p,y,x){this._evaluator.globals=i,this._evaluator.feature=a||null,this._evaluator.featureState=h||null,this._evaluator.canonical=p,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=x||null;try{let w=this.expression.evaluate(this._evaluator);if(w==null||typeof w=="number"&&w!=w)return this._defaultValue;if(this._enumValues&&!(w in this._enumValues))throw new Ae(`Expected value to be one of ${Object.keys(this._enumValues).map(S=>JSON.stringify(S)).join(", ")}, but found ${JSON.stringify(w)} instead.`);return w}catch(w){return this._warningHistory[w.message]||(this._warningHistory[w.message]=!0,typeof console<"u"&&console.warn(w.message)),this._defaultValue}}}function hu(s){return Array.isArray(s)&&s.length>0&&typeof s[0]=="string"&&s[0]in ua}function du(s,i){let a=new tu(ua,[],i?function(p){let y={color:ri,string:It,number:Ue,enum:It,boolean:yt,formatted:ci,resolvedImage:Ri};return p.type==="array"?hi(y[p.value]||St,p.length):y[p.type]}(i):void 0),h=a.parse(s,void 0,void 0,void 0,i&&i.type==="string"?{typeAnnotation:"coerce"}:void 0);return h?gp(new uh(h,i)):bs(a.errors)}class pu{constructor(i,a){this.kind=i,this._styleExpression=a,this.isStateDependent=i!=="constant"&&!aa(a.expression)}evaluateWithoutErrorHandling(i,a,h,p,y,x){return this._styleExpression.evaluateWithoutErrorHandling(i,a,h,p,y,x)}evaluate(i,a,h,p,y,x){return this._styleExpression.evaluate(i,a,h,p,y,x)}}class fu{constructor(i,a,h,p){this.kind=i,this.zoomStops=h,this._styleExpression=a,this.isStateDependent=i!=="camera"&&!aa(a.expression),this.interpolationType=p}evaluateWithoutErrorHandling(i,a,h,p,y,x){return this._styleExpression.evaluateWithoutErrorHandling(i,a,h,p,y,x)}evaluate(i,a,h,p,y,x){return this._styleExpression.evaluate(i,a,h,p,y,x)}interpolationFactor(i,a,h){return this.interpolationType?Cn.interpolationFactor(this.interpolationType,i,a,h):0}}function ch(s,i){let a=du(s,i);if(a.result==="error")return a;let h=a.value.expression,p=Kl(h);if(!p&&!ca(i))return bs([new ut("","data expressions not supported")]);let y=tl(h,["zoom"]);if(!y&&!yp(i))return bs([new ut("","zoom expressions not supported")]);let x=mu(h);return x||y?x instanceof ut?bs([x]):x instanceof Cn&&!ah(i)?bs([new ut("",'"interpolate" expressions cannot be used with this property')]):gp(x?new fu(p?"camera":"composite",a.value,x.labels,x instanceof Cn?x.interpolation:void 0):new pu(p?"constant":"source",a.value)):bs([new ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ha{constructor(i,a){this._parameters=i,this._specification=a,Xe(this,uu(this._parameters,this._specification))}static deserialize(i){return new ha(i._parameters,i._specification)}static serialize(i){return{_parameters:i._parameters,_specification:i._specification}}}function mu(s){let i=null;if(s instanceof ou)i=mu(s.result);else if(s instanceof nu){for(let a of s.args)if(i=mu(a),i)break}else(s instanceof rl||s instanceof Cn)&&s.input instanceof Rt&&s.input.name==="zoom"&&(i=s);return i instanceof ut||s.eachChild(a=>{let h=mu(a);h instanceof ut?i=h:!i&&h?i=new ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&h&&i!==h&&(i=new ut("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}function oo(s){let i=s.key,a=s.value,h=s.valueSpec||{},p=s.objectElementValidators||{},y=s.style,x=s.styleSpec,w=[],S=Lt(a);if(S!=="object")return[new Re(i,a,`object expected, ${S} found`)];for(let T in a){let z=T.split(".")[0],R=h[z]||h["*"],N;if(p[z])N=p[z];else if(h[z])N=dn;else if(p["*"])N=p["*"];else{if(!h["*"]){w.push(new Re(i,a[T],`unknown property "${T}"`));continue}N=dn}w=w.concat(N({key:(i&&`${i}.`)+T,value:a[T],valueSpec:R,style:y,styleSpec:x,object:a,objectKey:T},a))}for(let T in h)p[T]||h[T].required&&h[T].default===void 0&&a[T]===void 0&&w.push(new Re(i,a,`missing required property "${T}"`));return w}function vp(s){let i=s.value,a=s.valueSpec,h=s.style,p=s.styleSpec,y=s.key,x=s.arrayElementValidator||dn;if(Lt(i)!=="array")return[new Re(y,i,`array expected, ${Lt(i)} found`)];if(a.length&&i.length!==a.length)return[new Re(y,i,`array length ${a.length} expected, length ${i.length} found`)];if(a["min-length"]&&i.length<a["min-length"])return[new Re(y,i,`array length at least ${a["min-length"]} expected, length ${i.length} found`)];let w={type:a.value,values:a.values};p.$version<7&&(w.function=a.function),Lt(a.value)==="object"&&(w=a.value);let S=[];for(let T=0;T<i.length;T++)S=S.concat(x({array:i,arrayIndex:T,value:i[T],valueSpec:w,style:h,styleSpec:p,key:`${y}[${T}]`}));return S}function xp(s){let i=s.key,a=s.value,h=s.valueSpec,p=Lt(a);return p==="number"&&a!=a&&(p="NaN"),p!=="number"?[new Re(i,a,`number expected, ${p} found`)]:"minimum"in h&&a<h.minimum?[new Re(i,a,`${a} is less than the minimum value ${h.minimum}`)]:"maximum"in h&&a>h.maximum?[new Re(i,a,`${a} is greater than the maximum value ${h.maximum}`)]:[]}function _p(s){let i=s.valueSpec,a=$e(s.value.type),h,p,y,x={},w=a!=="categorical"&&s.value.property===void 0,S=!w,T=Lt(s.value.stops)==="array"&&Lt(s.value.stops[0])==="array"&&Lt(s.value.stops[0][0])==="object",z=oo({key:s.key,value:s.value,valueSpec:s.styleSpec.function,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{stops:function(G){if(a==="identity")return[new Re(G.key,G.value,'identity function may not have a "stops" property')];let W=[],se=G.value;return W=W.concat(vp({key:G.key,value:se,valueSpec:G.valueSpec,style:G.style,styleSpec:G.styleSpec,arrayElementValidator:R})),Lt(se)==="array"&&se.length===0&&W.push(new Re(G.key,se,"array must have at least one stop")),W},default:function(G){return dn({key:G.key,value:G.value,valueSpec:i,style:G.style,styleSpec:G.styleSpec})}}});return a==="identity"&&w&&z.push(new Re(s.key,s.value,'missing required property "property"')),a==="identity"||s.value.stops||z.push(new Re(s.key,s.value,'missing required property "stops"')),a==="exponential"&&s.valueSpec.expression&&!ah(s.valueSpec)&&z.push(new Re(s.key,s.value,"exponential functions not supported")),s.styleSpec.$version>=8&&(S&&!ca(s.valueSpec)?z.push(new Re(s.key,s.value,"property functions not supported")):w&&!yp(s.valueSpec)&&z.push(new Re(s.key,s.value,"zoom functions not supported"))),a!=="categorical"&&!T||s.value.property!==void 0||z.push(new Re(s.key,s.value,'"property" property is required')),z;function R(G){let W=[],se=G.value,ae=G.key;if(Lt(se)!=="array")return[new Re(ae,se,`array expected, ${Lt(se)} found`)];if(se.length!==2)return[new Re(ae,se,`array length 2 expected, length ${se.length} found`)];if(T){if(Lt(se[0])!=="object")return[new Re(ae,se,`object expected, ${Lt(se[0])} found`)];if(se[0].zoom===void 0)return[new Re(ae,se,"object stop key must have zoom")];if(se[0].value===void 0)return[new Re(ae,se,"object stop key must have value")];if(y&&y>$e(se[0].zoom))return[new Re(ae,se[0].zoom,"stop zoom values must appear in ascending order")];$e(se[0].zoom)!==y&&(y=$e(se[0].zoom),p=void 0,x={}),W=W.concat(oo({key:`${ae}[0]`,value:se[0],valueSpec:{zoom:{}},style:G.style,styleSpec:G.styleSpec,objectElementValidators:{zoom:xp,value:N}}))}else W=W.concat(N({key:`${ae}[0]`,value:se[0],valueSpec:{},style:G.style,styleSpec:G.styleSpec},se));return hu(ft(se[1]))?W.concat([new Re(`${ae}[1]`,se[1],"expressions are not allowed in function stops.")]):W.concat(dn({key:`${ae}[1]`,value:se[1],valueSpec:i,style:G.style,styleSpec:G.styleSpec}))}function N(G,W){let se=Lt(G.value),ae=$e(G.value),be=G.value!==null?G.value:W;if(h){if(se!==h)return[new Re(G.key,be,`${se} stop domain type must match previous stop domain type ${h}`)]}else h=se;if(se!=="number"&&se!=="string"&&se!=="boolean")return[new Re(G.key,be,"stop domain value must be a number, string, or boolean")];if(se!=="number"&&a!=="categorical"){let Ee=`number expected, ${se} found`;return ca(i)&&a===void 0&&(Ee+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Re(G.key,be,Ee)]}return a!=="categorical"||se!=="number"||isFinite(ae)&&Math.floor(ae)===ae?a!=="categorical"&&se==="number"&&p!==void 0&&ae<p?[new Re(G.key,be,"stop domain values must appear in ascending order")]:(p=ae,a==="categorical"&&ae in x?[new Re(G.key,be,"stop domain values must be unique")]:(x[ae]=!0,[])):[new Re(G.key,be,`integer expected, found ${ae}`)]}}function da(s){let i=(s.expressionContext==="property"?ch:du)(ft(s.value),s.valueSpec);if(i.result==="error")return i.value.map(h=>new Re(`${s.key}${h.key}`,s.value,h.message));let a=i.value.expression||i.value._styleExpression.expression;if(s.expressionContext==="property"&&s.propertyKey==="text-font"&&!a.outputDefined())return[new Re(s.key,s.value,`Invalid data expression for "${s.propertyKey}". Output values must be contained as literals within the expression.`)];if(s.expressionContext==="property"&&s.propertyType==="layout"&&!aa(a))return[new Re(s.key,s.value,'"feature-state" data expressions are not supported with layout properties.')];if(s.expressionContext==="filter"&&!aa(a))return[new Re(s.key,s.value,'"feature-state" data expressions are not supported with filters.')];if(s.expressionContext&&s.expressionContext.indexOf("cluster")===0){if(!tl(a,["zoom","feature-state"]))return[new Re(s.key,s.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(s.expressionContext==="cluster-initial"&&!Kl(a))return[new Re(s.key,s.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gu(s){let i=s.key,a=s.value,h=s.valueSpec,p=[];return Array.isArray(h.values)?h.values.indexOf($e(a))===-1&&p.push(new Re(i,a,`expected one of [${h.values.join(", ")}], ${JSON.stringify(a)} found`)):Object.keys(h.values).indexOf($e(a))===-1&&p.push(new Re(i,a,`expected one of [${Object.keys(h.values).join(", ")}], ${JSON.stringify(a)} found`)),p}function hh(s){if(s===!0||s===!1)return!0;if(!Array.isArray(s)||s.length===0)return!1;switch(s[0]){case"has":return s.length>=2&&s[1]!=="$id"&&s[1]!=="$type";case"in":return s.length>=3&&(typeof s[1]!="string"||Array.isArray(s[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return s.length!==3||Array.isArray(s[1])||Array.isArray(s[2]);case"any":case"all":for(let i of s.slice(1))if(!hh(i)&&typeof i!="boolean")return!1;return!0;default:return!0}}let bp={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function yu(s){if(s==null)return{filter:()=>!0,needGeometry:!1};hh(s)||(s=al(s));let i=du(s,bp);if(i.result==="error")throw new Error(i.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,h,p)=>i.value.evaluate(a,h,{},p),needGeometry:wp(s)}}function vu(s,i){return s<i?-1:s>i?1:0}function wp(s){if(!Array.isArray(s))return!1;if(s[0]==="within")return!0;for(let i=1;i<s.length;i++)if(wp(s[i]))return!0;return!1}function al(s){if(!s)return!0;let i=s[0];return s.length<=1?i!=="any":i==="=="?dh(s[1],s[2],"=="):i==="!="?pa(dh(s[1],s[2],"==")):i==="<"||i===">"||i==="<="||i===">="?dh(s[1],s[2],i):i==="any"?(a=s.slice(1),["any"].concat(a.map(al))):i==="all"?["all"].concat(s.slice(1).map(al)):i==="none"?["all"].concat(s.slice(1).map(al).map(pa)):i==="in"?xu(s[1],s.slice(2)):i==="!in"?pa(xu(s[1],s.slice(2))):i==="has"?_u(s[1]):i==="!has"?pa(_u(s[1])):i!=="within"||s;var a}function dh(s,i,a){switch(s){case"$type":return[`filter-type-${a}`,i];case"$id":return[`filter-id-${a}`,i];default:return[`filter-${a}`,s,i]}}function xu(s,i){if(i.length===0)return!1;switch(s){case"$type":return["filter-type-in",["literal",i]];case"$id":return["filter-id-in",["literal",i]];default:return i.length>200&&!i.some(a=>typeof a!=typeof i[0])?["filter-in-large",s,["literal",i.sort(vu)]]:["filter-in-small",s,["literal",i]]}}function _u(s){switch(s){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",s]}}function pa(s){return["!",s]}function ll(s){return hh(ft(s.value))?da(Xe({},s,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ip(s)}function Ip(s){let i=s.value,a=s.key;if(Lt(i)!=="array")return[new Re(a,i,`array expected, ${Lt(i)} found`)];let h=s.styleSpec,p,y=[];if(i.length<1)return[new Re(a,i,"filter array must have at least 1 element")];switch(y=y.concat(gu({key:`${a}[0]`,value:i[0],valueSpec:h.filter_operator,style:s.style,styleSpec:s.styleSpec})),$e(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&$e(i[1])==="$type"&&y.push(new Re(a,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":i.length!==3&&y.push(new Re(a,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(p=Lt(i[1]),p!=="string"&&y.push(new Re(`${a}[1]`,i[1],`string expected, ${p} found`)));for(let x=2;x<i.length;x++)p=Lt(i[x]),$e(i[1])==="$type"?y=y.concat(gu({key:`${a}[${x}]`,value:i[x],valueSpec:h.geometry_type,style:s.style,styleSpec:s.styleSpec})):p!=="string"&&p!=="number"&&p!=="boolean"&&y.push(new Re(`${a}[${x}]`,i[x],`string, number, or boolean expected, ${p} found`));break;case"any":case"all":case"none":for(let x=1;x<i.length;x++)y=y.concat(Ip({key:`${a}[${x}]`,value:i[x],style:s.style,styleSpec:s.styleSpec}));break;case"has":case"!has":p=Lt(i[1]),i.length!==2?y.push(new Re(a,i,`filter array for "${i[0]}" operator must have 2 elements`)):p!=="string"&&y.push(new Re(`${a}[1]`,i[1],`string expected, ${p} found`));break;case"within":p=Lt(i[1]),i.length!==2?y.push(new Re(a,i,`filter array for "${i[0]}" operator must have 2 elements`)):p!=="object"&&y.push(new Re(`${a}[1]`,i[1],`object expected, ${p} found`))}return y}function ul(s,i){let a=s.key,h=s.style,p=s.styleSpec,y=s.value,x=s.objectKey,w=p[`${i}_${s.layerType}`];if(!w)return[];let S=x.match(/^(.*)-transition$/);if(i==="paint"&&S&&w[S[1]]&&w[S[1]].transition)return dn({key:a,value:y,valueSpec:p.transition,style:h,styleSpec:p});let T=s.valueSpec||w[x];if(!T)return[new Re(a,y,`unknown property "${x}"`)];let z;if(Lt(y)==="string"&&ca(T)&&!T.tokens&&(z=/^{([^}]+)}$/.exec(y)))return[new Re(a,y,`"${x}" does not support interpolation syntax
10
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(z[1])} }\`.`)];let R=[];return s.layerType==="symbol"&&(x==="text-field"&&h&&!h.glyphs&&R.push(new Re(a,y,'use of "text-field" requires a style "glyphs" property')),x==="text-font"&&lu(ft(y))&&$e(y.type)==="identity"&&R.push(new Re(a,y,'"text-font" does not support identity functions'))),R.concat(dn({key:s.key,value:y,valueSpec:T,style:h,styleSpec:p,expressionContext:"property",propertyType:i,propertyKey:x}))}function Sp(s){return ul(s,"paint")}function Cp(s){return ul(s,"layout")}function Mp(s){let i=[],a=s.value,h=s.key,p=s.style,y=s.styleSpec;a.type||a.ref||i.push(new Re(h,a,'either "type" or "ref" is required'));let x=$e(a.type),w=$e(a.ref);if(a.id){let S=$e(a.id);for(let T=0;T<s.arrayIndex;T++){let z=p.layers[T];$e(z.id)===S&&i.push(new Re(h,a.id,`duplicate layer id "${a.id}", previously used at line ${z.id.__line__}`))}}if("ref"in a){let S;["type","source","source-layer","filter","layout"].forEach(T=>{T in a&&i.push(new Re(h,a[T],`"${T}" is prohibited for ref layers`))}),p.layers.forEach(T=>{$e(T.id)===w&&(S=T)}),S?S.ref?i.push(new Re(h,a.ref,"ref cannot reference another ref layer")):x=$e(S.type):i.push(new Re(h,a.ref,`ref layer "${w}" not found`))}else if(x!=="background")if(a.source){let S=p.sources&&p.sources[a.source],T=S&&$e(S.type);S?T==="vector"&&x==="raster"?i.push(new Re(h,a.source,`layer "${a.id}" requires a raster source`)):T==="raster"&&x!=="raster"?i.push(new Re(h,a.source,`layer "${a.id}" requires a vector source`)):T!=="vector"||a["source-layer"]?T==="raster-dem"&&x!=="hillshade"?i.push(new Re(h,a.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!a.paint||!a.paint["line-gradient"]||T==="geojson"&&S.lineMetrics||i.push(new Re(h,a,`layer "${a.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new Re(h,a,`layer "${a.id}" must specify a "source-layer"`)):i.push(new Re(h,a.source,`source "${a.source}" not found`))}else i.push(new Re(h,a,'missing required property "source"'));return i=i.concat(oo({key:h,value:a,valueSpec:y.layer,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{"*":()=>[],type:()=>dn({key:`${h}.type`,value:a.type,valueSpec:y.layer.type,style:s.style,styleSpec:s.styleSpec,object:a,objectKey:"type"}),filter:ll,layout:S=>oo({layer:a,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,objectElementValidators:{"*":T=>Cp(Xe({layerType:x},T))}}),paint:S=>oo({layer:a,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,objectElementValidators:{"*":T=>Sp(Xe({layerType:x},T))}})}})),i}function fa(s){let i=s.value,a=s.key,h=Lt(i);return h!=="string"?[new Re(a,i,`string expected, ${h} found`)]:[]}let Ep={promoteId:function({key:s,value:i}){if(Lt(i)==="string")return fa({key:s,value:i});{let a=[];for(let h in i)a.push(...fa({key:`${s}.${h}`,value:i[h]}));return a}}};function cl(s){let i=s.value,a=s.key,h=s.styleSpec,p=s.style;if(!i.type)return[new Re(a,i,'"type" is required')];let y=$e(i.type),x;switch(y){case"vector":case"raster":case"raster-dem":return x=oo({key:a,value:i,valueSpec:h[`source_${y.replace("-","_")}`],style:s.style,styleSpec:h,objectElementValidators:Ep}),x;case"geojson":if(x=oo({key:a,value:i,valueSpec:h.source_geojson,style:p,styleSpec:h,objectElementValidators:Ep}),i.cluster)for(let w in i.clusterProperties){let[S,T]=i.clusterProperties[w],z=typeof S=="string"?[S,["accumulated"],["get",w]]:S;x.push(...da({key:`${a}.${w}.map`,value:T,expressionContext:"cluster-map"})),x.push(...da({key:`${a}.${w}.reduce`,value:z,expressionContext:"cluster-reduce"}))}return x;case"video":return oo({key:a,value:i,valueSpec:h.source_video,style:p,styleSpec:h});case"image":return oo({key:a,value:i,valueSpec:h.source_image,style:p,styleSpec:h});case"canvas":return[new Re(a,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return gu({key:`${a}.type`,value:i.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:p,styleSpec:h})}}function hl(s){let i=s.value,a=s.styleSpec,h=a.light,p=s.style,y=[],x=Lt(i);if(i===void 0)return y;if(x!=="object")return y=y.concat([new Re("light",i,`object expected, ${x} found`)]),y;for(let w in i){let S=w.match(/^(.*)-transition$/);y=y.concat(S&&h[S[1]]&&h[S[1]].transition?dn({key:w,value:i[w],valueSpec:a.transition,style:p,styleSpec:a}):h[w]?dn({key:w,value:i[w],valueSpec:h[w],style:p,styleSpec:a}):[new Re(w,i[w],`unknown property "${w}"`)])}return y}let Mn={"*":()=>[],array:vp,boolean:function(s){let i=s.value,a=s.key,h=Lt(i);return h!=="boolean"?[new Re(a,i,`boolean expected, ${h} found`)]:[]},number:xp,color:function(s){let i=s.key,a=s.value,h=Lt(a);return h!=="string"?[new Re(i,a,`color expected, ${h} found`)]:rr(a)===null?[new Re(i,a,`color expected, "${a}" found`)]:[]},constants:ie,enum:gu,filter:ll,function:_p,layer:Mp,object:oo,source:cl,light:hl,string:fa,formatted:function(s){return fa(s).length===0?[]:da(s)},resolvedImage:function(s){return fa(s).length===0?[]:da(s)}};function dn(s){let i=s.value,a=s.valueSpec,h=s.styleSpec;return a.expression&&lu($e(i))?_p(s):a.expression&&hu(ft(i))?da(s):a.type&&Mn[a.type]?Mn[a.type](s):oo(Xe({},s,{valueSpec:a.type?h[a.type]:a}))}function Kg(s){let i=s.value,a=s.key,h=fa(s);return h.length||(i.indexOf("{fontstack}")===-1&&h.push(new Re(a,i,'"glyphs" url must include a "{fontstack}" token')),i.indexOf("{range}")===-1&&h.push(new Re(a,i,'"glyphs" url must include a "{range}" token'))),h}function ws(s,i=ye){let a=[];return a=a.concat(dn({key:"",value:s,valueSpec:i.$root,styleSpec:i,style:s,objectElementValidators:{glyphs:Kg,"*":()=>[]}})),s.constants&&(a=a.concat(ie({key:"constants",value:s.constants,style:s,styleSpec:i}))),Ap(a)}function Ap(s){return[].concat(s).sort((i,a)=>i.line-a.line)}function ma(s){return function(...i){return Ap(s.apply(this,i))}}ws.source=ma(cl),ws.light=ma(hl),ws.layer=ma(Mp),ws.filter=ma(ll),ws.paintProperty=ma(Sp),ws.layoutProperty=ma(Cp);let Is=ws,e0=Is.light,ph=Is.paintProperty,t0=Is.layoutProperty;function Tp(s,i){let a=!1;if(i&&i.length)for(let h of i)s.fire(new Ve(new Error(h.message))),a=!0;return a}class Ss{constructor(i,a,h){let p=this.cells=[];if(i instanceof ArrayBuffer){this.arrayBuffer=i;let x=new Int32Array(this.arrayBuffer);i=x[0],this.d=(a=x[1])+2*(h=x[2]);for(let S=0;S<this.d*this.d;S++){let T=x[3+S],z=x[3+S+1];p.push(T===z?null:x.subarray(T,z))}let w=x[3+p.length+1];this.keys=x.subarray(x[3+p.length],w),this.bboxes=x.subarray(w),this.insert=this._insertReadonly}else{this.d=a+2*h;for(let x=0;x<this.d*this.d;x++)p.push([]);this.keys=[],this.bboxes=[]}this.n=a,this.extent=i,this.padding=h,this.scale=a/i,this.uid=0;let y=h/a*i;this.min=-y,this.max=i+y}insert(i,a,h,p,y){this._forEachCell(a,h,p,y,this._insertCell,this.uid++,void 0,void 0),this.keys.push(i),this.bboxes.push(a),this.bboxes.push(h),this.bboxes.push(p),this.bboxes.push(y)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(i,a,h,p,y,x){this.cells[y].push(x)}query(i,a,h,p,y){let x=this.min,w=this.max;if(i<=x&&a<=x&&w<=h&&w<=p&&!y)return Array.prototype.slice.call(this.keys);{let S=[];return this._forEachCell(i,a,h,p,this._queryCell,S,{},y),S}}_queryCell(i,a,h,p,y,x,w,S){let T=this.cells[y];if(T!==null){let z=this.keys,R=this.bboxes;for(let N=0;N<T.length;N++){let G=T[N];if(w[G]===void 0){let W=4*G;(S?S(R[W+0],R[W+1],R[W+2],R[W+3]):i<=R[W+2]&&a<=R[W+3]&&h>=R[W+0]&&p>=R[W+1])?(w[G]=!0,x.push(z[G])):w[G]=!1}}}}_forEachCell(i,a,h,p,y,x,w,S){let T=this._convertToCellCoord(i),z=this._convertToCellCoord(a),R=this._convertToCellCoord(h),N=this._convertToCellCoord(p);for(let G=T;G<=R;G++)for(let W=z;W<=N;W++){let se=this.d*W+G;if((!S||S(this._convertFromCellCoord(G),this._convertFromCellCoord(W),this._convertFromCellCoord(G+1),this._convertFromCellCoord(W+1)))&&y.call(this,i,a,h,p,se,x,w,S))return}}_convertFromCellCoord(i){return(i-this.padding)/this.scale}_convertToCellCoord(i){return Math.max(0,Math.min(this.d-1,Math.floor(i*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let i=this.cells,a=3+this.cells.length+1+1,h=0;for(let x=0;x<this.cells.length;x++)h+=this.cells[x].length;let p=new Int32Array(a+h+this.keys.length+this.bboxes.length);p[0]=this.extent,p[1]=this.n,p[2]=this.padding;let y=a;for(let x=0;x<i.length;x++){let w=i[x];p[3+x]=y,p.set(w,y),y+=w.length}return p[3+i.length]=y,p.set(this.keys,y),y+=this.keys.length,p[3+i.length+1]=y,p.set(this.bboxes,y),y+=this.bboxes.length,p.buffer}static serialize(i,a){let h=i.toArrayBuffer();return a&&a.push(h),{buffer:h}}static deserialize(i){return new Ss(i.buffer)}}let ga={};function dt(s,i,a={}){Object.defineProperty(i,"_classRegistryKey",{value:s,writeable:!1}),ga[s]={klass:i,omit:a.omit||[],shallow:a.shallow||[]}}dt("Object",Object),dt("TransferableGridIndex",Ss),dt("Color",L),dt("Error",Error),dt("AJAXError",ii),dt("ResolvedImage",pe),dt("StylePropertyFunction",ha),dt("StyleExpression",uh,{omit:["_evaluator"]}),dt("ZoomDependentExpression",fu),dt("ZoomConstantExpression",pu),dt("CompoundExpression",Rt,{omit:["_evaluate"]});for(let s in ua)ua[s]._classRegistryKey||dt(`Expression_${s}`,ua[s]);function fh(s){return s&&typeof ArrayBuffer<"u"&&(s instanceof ArrayBuffer||s.constructor&&s.constructor.name==="ArrayBuffer")}function dl(s,i){if(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp||s instanceof Blob)return s;if(fh(s)||Ot(s))return i&&i.push(s),s;if(ArrayBuffer.isView(s)){let a=s;return i&&i.push(a.buffer),a}if(s instanceof ImageData)return i&&i.push(s.data.buffer),s;if(Array.isArray(s)){let a=[];for(let h of s)a.push(dl(h,i));return a}if(typeof s=="object"){let a=s.constructor,h=a._classRegistryKey;if(!h)throw new Error("can't serialize object of unregistered class");let p=a.serialize?a.serialize(s,i):{};if(!a.serialize){for(let y in s){if(!s.hasOwnProperty(y)||ga[h].omit.indexOf(y)>=0)continue;let x=s[y];p[y]=ga[h].shallow.indexOf(y)>=0?x:dl(x,i)}s instanceof Error&&(p.message=s.message)}if(p.$name)throw new Error("$name property is reserved for worker serialization logic.");return h!=="Object"&&(p.$name=h),p}throw new Error("can't serialize object of type "+typeof s)}function Cs(s){if(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp||s instanceof Blob||fh(s)||Ot(s)||ArrayBuffer.isView(s)||s instanceof ImageData)return s;if(Array.isArray(s))return s.map(Cs);if(typeof s=="object"){let i=s.$name||"Object";if(!ga[i])throw new Error(`can't deserialize unregistered class ${i}`);let{klass:a}=ga[i];if(!a)throw new Error(`can't deserialize unregistered class ${i}`);if(a.deserialize)return a.deserialize(s);let h=Object.create(a.prototype);for(let p of Object.keys(s)){if(p==="$name")continue;let y=s[p];h[p]=ga[i].shallow.indexOf(p)>=0?y:Cs(y)}return h}throw new Error("can't deserialize object of type "+typeof s)}class pl{constructor(){this.first=!0}update(i,a){let h=Math.floor(i);return this.first?(this.first=!1,this.lastIntegerZoom=h,this.lastIntegerZoomTime=0,this.lastZoom=i,this.lastFloorZoom=h,!0):(this.lastFloorZoom>h?(this.lastIntegerZoom=h+1,this.lastIntegerZoomTime=a):this.lastFloorZoom<h&&(this.lastIntegerZoom=h,this.lastIntegerZoomTime=a),i!==this.lastZoom&&(this.lastZoom=i,this.lastFloorZoom=h,!0))}}let it={"Latin-1 Supplement":s=>s>=128&&s<=255,Arabic:s=>s>=1536&&s<=1791,"Arabic Supplement":s=>s>=1872&&s<=1919,"Arabic Extended-A":s=>s>=2208&&s<=2303,"Hangul Jamo":s=>s>=4352&&s<=4607,"Unified Canadian Aboriginal Syllabics":s=>s>=5120&&s<=5759,Khmer:s=>s>=6016&&s<=6143,"Unified Canadian Aboriginal Syllabics Extended":s=>s>=6320&&s<=6399,"General Punctuation":s=>s>=8192&&s<=8303,"Letterlike Symbols":s=>s>=8448&&s<=8527,"Number Forms":s=>s>=8528&&s<=8591,"Miscellaneous Technical":s=>s>=8960&&s<=9215,"Control Pictures":s=>s>=9216&&s<=9279,"Optical Character Recognition":s=>s>=9280&&s<=9311,"Enclosed Alphanumerics":s=>s>=9312&&s<=9471,"Geometric Shapes":s=>s>=9632&&s<=9727,"Miscellaneous Symbols":s=>s>=9728&&s<=9983,"Miscellaneous Symbols and Arrows":s=>s>=11008&&s<=11263,"CJK Radicals Supplement":s=>s>=11904&&s<=12031,"Kangxi Radicals":s=>s>=12032&&s<=12255,"Ideographic Description Characters":s=>s>=12272&&s<=12287,"CJK Symbols and Punctuation":s=>s>=12288&&s<=12351,Hiragana:s=>s>=12352&&s<=12447,Katakana:s=>s>=12448&&s<=12543,Bopomofo:s=>s>=12544&&s<=12591,"Hangul Compatibility Jamo":s=>s>=12592&&s<=12687,Kanbun:s=>s>=12688&&s<=12703,"Bopomofo Extended":s=>s>=12704&&s<=12735,"CJK Strokes":s=>s>=12736&&s<=12783,"Katakana Phonetic Extensions":s=>s>=12784&&s<=12799,"Enclosed CJK Letters and Months":s=>s>=12800&&s<=13055,"CJK Compatibility":s=>s>=13056&&s<=13311,"CJK Unified Ideographs Extension A":s=>s>=13312&&s<=19903,"Yijing Hexagram Symbols":s=>s>=19904&&s<=19967,"CJK Unified Ideographs":s=>s>=19968&&s<=40959,"Yi Syllables":s=>s>=40960&&s<=42127,"Yi Radicals":s=>s>=42128&&s<=42191,"Hangul Jamo Extended-A":s=>s>=43360&&s<=43391,"Hangul Syllables":s=>s>=44032&&s<=55215,"Hangul Jamo Extended-B":s=>s>=55216&&s<=55295,"Private Use Area":s=>s>=57344&&s<=63743,"CJK Compatibility Ideographs":s=>s>=63744&&s<=64255,"Arabic Presentation Forms-A":s=>s>=64336&&s<=65023,"Vertical Forms":s=>s>=65040&&s<=65055,"CJK Compatibility Forms":s=>s>=65072&&s<=65103,"Small Form Variants":s=>s>=65104&&s<=65135,"Arabic Presentation Forms-B":s=>s>=65136&&s<=65279,"Halfwidth and Fullwidth Forms":s=>s>=65280&&s<=65519};function mh(s){for(let i of s)if(fl(i.charCodeAt(0)))return!0;return!1}function Pp(s){for(let i of s)if(!i0(i.charCodeAt(0)))return!1;return!0}function i0(s){return!(it.Arabic(s)||it["Arabic Supplement"](s)||it["Arabic Extended-A"](s)||it["Arabic Presentation Forms-A"](s)||it["Arabic Presentation Forms-B"](s))}function fl(s){return!(s!==746&&s!==747&&(s<4352||!(it["Bopomofo Extended"](s)||it.Bopomofo(s)||it["CJK Compatibility Forms"](s)&&!(s>=65097&&s<=65103)||it["CJK Compatibility Ideographs"](s)||it["CJK Compatibility"](s)||it["CJK Radicals Supplement"](s)||it["CJK Strokes"](s)||!(!it["CJK Symbols and Punctuation"](s)||s>=12296&&s<=12305||s>=12308&&s<=12319||s===12336)||it["CJK Unified Ideographs Extension A"](s)||it["CJK Unified Ideographs"](s)||it["Enclosed CJK Letters and Months"](s)||it["Hangul Compatibility Jamo"](s)||it["Hangul Jamo Extended-A"](s)||it["Hangul Jamo Extended-B"](s)||it["Hangul Jamo"](s)||it["Hangul Syllables"](s)||it.Hiragana(s)||it["Ideographic Description Characters"](s)||it.Kanbun(s)||it["Kangxi Radicals"](s)||it["Katakana Phonetic Extensions"](s)||it.Katakana(s)&&s!==12540||!(!it["Halfwidth and Fullwidth Forms"](s)||s===65288||s===65289||s===65293||s>=65306&&s<=65310||s===65339||s===65341||s===65343||s>=65371&&s<=65503||s===65507||s>=65512&&s<=65519)||!(!it["Small Form Variants"](s)||s>=65112&&s<=65118||s>=65123&&s<=65126)||it["Unified Canadian Aboriginal Syllabics"](s)||it["Unified Canadian Aboriginal Syllabics Extended"](s)||it["Vertical Forms"](s)||it["Yijing Hexagram Symbols"](s)||it["Yi Syllables"](s)||it["Yi Radicals"](s))))}function kp(s){return!(fl(s)||function(i){return!!(it["Latin-1 Supplement"](i)&&(i===167||i===169||i===174||i===177||i===188||i===189||i===190||i===215||i===247)||it["General Punctuation"](i)&&(i===8214||i===8224||i===8225||i===8240||i===8241||i===8251||i===8252||i===8258||i===8263||i===8264||i===8265||i===8273)||it["Letterlike Symbols"](i)||it["Number Forms"](i)||it["Miscellaneous Technical"](i)&&(i>=8960&&i<=8967||i>=8972&&i<=8991||i>=8996&&i<=9e3||i===9003||i>=9085&&i<=9114||i>=9150&&i<=9165||i===9167||i>=9169&&i<=9179||i>=9186&&i<=9215)||it["Control Pictures"](i)&&i!==9251||it["Optical Character Recognition"](i)||it["Enclosed Alphanumerics"](i)||it["Geometric Shapes"](i)||it["Miscellaneous Symbols"](i)&&!(i>=9754&&i<=9759)||it["Miscellaneous Symbols and Arrows"](i)&&(i>=11026&&i<=11055||i>=11088&&i<=11097||i>=11192&&i<=11243)||it["CJK Symbols and Punctuation"](i)||it.Katakana(i)||it["Private Use Area"](i)||it["CJK Compatibility Forms"](i)||it["Small Form Variants"](i)||it["Halfwidth and Fullwidth Forms"](i)||i===8734||i===8756||i===8757||i>=9984&&i<=10087||i>=10102&&i<=10131||i===65532||i===65533)}(s))}function zp(s){return s>=1424&&s<=2303||it["Arabic Presentation Forms-A"](s)||it["Arabic Presentation Forms-B"](s)}function r0(s,i){return!(!i&&zp(s)||s>=2304&&s<=3583||s>=3840&&s<=4255||it.Khmer(s))}function n0(s){for(let i of s)if(zp(i.charCodeAt(0)))return!0;return!1}let bu="deferred",gh="loading",yh="loaded",vh=null,pn="unavailable",Ko=null,Lp=function(s){s&&typeof s=="string"&&s.indexOf("NetworkError")>-1&&(pn="error"),vh&&vh(s)};function xh(){ya.fire(new Ie("pluginStateChange",{pluginStatus:pn,pluginURL:Ko}))}let ya=new He,_h=function(){return pn},wu=function(){if(pn!==bu||!Ko)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");pn=gh,xh(),Ko&&zr({url:Ko},s=>{s?Lp(s):(pn=yh,xh())})},Zn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>pn===yh||Zn.applyArabicShaping!=null,isLoading:()=>pn===gh,setState(s){pn=s.pluginStatus,Ko=s.pluginURL},isParsed:()=>Zn.applyArabicShaping!=null&&Zn.processBidirectionalText!=null&&Zn.processStyledBidirectionalText!=null,getPluginURL:()=>Ko};class Vi{constructor(i,a){this.zoom=i,a?(this.now=a.now,this.fadeDuration=a.fadeDuration,this.zoomHistory=a.zoomHistory,this.transition=a.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new pl,this.transition={})}isSupportedScript(i){return function(a,h){for(let p of a)if(!r0(p.charCodeAt(0),h))return!1;return!0}(i,Zn.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let i=this.zoom,a=i-Math.floor(i),h=this.crossFadingFactor();return i>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:a+(1-a)*h}:{fromScale:.5,toScale:1,t:1-(1-h)*a}}}class Iu{constructor(i,a){this.property=i,this.value=a,this.expression=function(h,p){if(lu(h))return new ha(h,p);if(hu(h)){let y=ch(h,p);if(y.result==="error")throw new Error(y.value.map(x=>`${x.key}: ${x.message}`).join(", "));return y.value}{let y=h;return typeof h=="string"&&p.type==="color"&&(y=L.parse(h)),{kind:"constant",evaluate:()=>y}}}(a===void 0?i.specification.default:a,i.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(i,a,h){return this.property.possiblyEvaluate(this,i,a,h)}}class Su{constructor(i){this.property=i,this.value=new Iu(i,void 0)}transitioned(i,a){return new Rp(this.property,this.value,a,Z({},i.transition,this.transition),i.now)}untransitioned(){return new Rp(this.property,this.value,null,{},0)}}class bh{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitionablePropertyValues)}getValue(i){return H(this._values[i].value.value)}setValue(i,a){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new Su(this._values[i].property)),this._values[i].value=new Iu(this._values[i].property,a===null?void 0:H(a))}getTransition(i){return H(this._values[i].transition)}setTransition(i,a){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new Su(this._values[i].property)),this._values[i].transition=H(a)||void 0}serialize(){let i={};for(let a of Object.keys(this._values)){let h=this.getValue(a);h!==void 0&&(i[a]=h);let p=this.getTransition(a);p!==void 0&&(i[`${a}-transition`]=p)}return i}transitioned(i,a){let h=new Dp(this._properties);for(let p of Object.keys(this._values))h._values[p]=this._values[p].transitioned(i,a._values[p]);return h}untransitioned(){let i=new Dp(this._properties);for(let a of Object.keys(this._values))i._values[a]=this._values[a].untransitioned();return i}}class Rp{constructor(i,a,h,p,y){this.property=i,this.value=a,this.begin=y+p.delay||0,this.end=this.begin+p.duration||0,i.specification.transition&&(p.delay||p.duration)&&(this.prior=h)}possiblyEvaluate(i,a,h){let p=i.now||0,y=this.value.possiblyEvaluate(i,a,h),x=this.prior;if(x){if(p>this.end)return this.prior=null,y;if(this.value.isDataDriven())return this.prior=null,y;if(p<this.begin)return x.possiblyEvaluate(i,a,h);{let w=(p-this.begin)/(this.end-this.begin);return this.property.interpolate(x.possiblyEvaluate(i,a,h),y,function(S){if(S<=0)return 0;if(S>=1)return 1;let T=S*S,z=T*S;return 4*(S<.5?z:3*(S-T)+z-.75)}(w))}}return y}}class Dp{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitioningPropertyValues)}possiblyEvaluate(i,a,h){let p=new Cu(this._properties);for(let y of Object.keys(this._values))p._values[y]=this._values[y].possiblyEvaluate(i,a,h);return p}hasTransition(){for(let i of Object.keys(this._values))if(this._values[i].prior)return!0;return!1}}class o0{constructor(i){this._properties=i,this._values=Object.create(i.defaultPropertyValues)}getValue(i){return H(this._values[i].value)}setValue(i,a){this._values[i]=new Iu(this._values[i].property,a===null?void 0:H(a))}serialize(){let i={};for(let a of Object.keys(this._values)){let h=this.getValue(a);h!==void 0&&(i[a]=h)}return i}possiblyEvaluate(i,a,h){let p=new Cu(this._properties);for(let y of Object.keys(this._values))p._values[y]=this._values[y].possiblyEvaluate(i,a,h);return p}}class xo{constructor(i,a,h){this.property=i,this.value=a,this.parameters=h}isConstant(){return this.value.kind==="constant"}constantOr(i){return this.value.kind==="constant"?this.value.value:i}evaluate(i,a,h,p){return this.property.evaluate(this.value,this.parameters,i,a,h,p)}}class Cu{constructor(i){this._properties=i,this._values=Object.create(i.defaultPossiblyEvaluatedValues)}get(i){return this._values[i]}}class vt{constructor(i){this.specification=i}possiblyEvaluate(i,a){return i.expression.evaluate(a)}interpolate(i,a,h){let p=nl[this.specification.type];return p?p(i,a,h):i}}class Mt{constructor(i,a){this.specification=i,this.overrides=a}possiblyEvaluate(i,a,h,p){return new xo(this,i.expression.kind==="constant"||i.expression.kind==="camera"?{kind:"constant",value:i.expression.evaluate(a,null,{},h,p)}:i.expression,a)}interpolate(i,a,h){if(i.value.kind!=="constant"||a.value.kind!=="constant")return i;if(i.value.value===void 0||a.value.value===void 0)return new xo(this,{kind:"constant",value:void 0},i.parameters);let p=nl[this.specification.type];return p?new xo(this,{kind:"constant",value:p(i.value.value,a.value.value,h)},i.parameters):i}evaluate(i,a,h,p,y,x){return i.kind==="constant"?i.value:i.evaluate(a,h,p,y,x)}}class ml extends Mt{possiblyEvaluate(i,a,h,p){if(i.value===void 0)return new xo(this,{kind:"constant",value:void 0},a);if(i.expression.kind==="constant"){let y=i.expression.evaluate(a,null,{},h,p),x=i.property.specification.type==="resolvedImage"&&typeof y!="string"?y.name:y,w=this._calculate(x,x,x,a);return new xo(this,{kind:"constant",value:w},a)}if(i.expression.kind==="camera"){let y=this._calculate(i.expression.evaluate({zoom:a.zoom-1}),i.expression.evaluate({zoom:a.zoom}),i.expression.evaluate({zoom:a.zoom+1}),a);return new xo(this,{kind:"constant",value:y},a)}return new xo(this,i.expression,a)}evaluate(i,a,h,p,y,x){if(i.kind==="source"){let w=i.evaluate(a,h,p,y,x);return this._calculate(w,w,w,a)}return i.kind==="composite"?this._calculate(i.evaluate({zoom:Math.floor(a.zoom)-1},h,p),i.evaluate({zoom:Math.floor(a.zoom)},h,p),i.evaluate({zoom:Math.floor(a.zoom)+1},h,p),a):i.value}_calculate(i,a,h,p){return p.zoom>p.zoomHistory.lastIntegerZoom?{from:i,to:a}:{from:h,to:a}}interpolate(i){return i}}class gl{constructor(i){this.specification=i}possiblyEvaluate(i,a,h,p){if(i.value!==void 0){if(i.expression.kind==="constant"){let y=i.expression.evaluate(a,null,{},h,p);return this._calculate(y,y,y,a)}return this._calculate(i.expression.evaluate(new Vi(Math.floor(a.zoom-1),a)),i.expression.evaluate(new Vi(Math.floor(a.zoom),a)),i.expression.evaluate(new Vi(Math.floor(a.zoom+1),a)),a)}}_calculate(i,a,h,p){return p.zoom>p.zoomHistory.lastIntegerZoom?{from:i,to:a}:{from:h,to:a}}interpolate(i){return i}}class wh{constructor(i){this.specification=i}possiblyEvaluate(i,a,h,p){return!!i.expression.evaluate(a,null,{},h,p)}interpolate(){return!1}}class Er{constructor(i){this.properties=i,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let a in i){let h=i[a];h.specification.overridable&&this.overridableProperties.push(a);let p=this.defaultPropertyValues[a]=new Iu(h,void 0),y=this.defaultTransitionablePropertyValues[a]=new Su(h);this.defaultTransitioningPropertyValues[a]=y.untransitioned(),this.defaultPossiblyEvaluatedValues[a]=p.possiblyEvaluate({})}}}dt("DataDrivenProperty",Mt),dt("DataConstantProperty",vt),dt("CrossFadedDataDrivenProperty",ml),dt("CrossFadedProperty",gl),dt("ColorRampProperty",wh);let Ms="-transition";class fn extends He{constructor(i,a){if(super(),this.id=i.id,this.type=i.type,this._featureFilter={filter:()=>!0,needGeometry:!1},i.type!=="custom"&&(this.metadata=(i=i).metadata,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,i.type!=="background"&&(this.source=i.source,this.sourceLayer=i["source-layer"],this.filter=i.filter),a.layout&&(this._unevaluatedLayout=new o0(a.layout)),a.paint)){this._transitionablePaint=new bh(a.paint);for(let h in i.paint)this.setPaintProperty(h,i.paint[h],{validate:!1});for(let h in i.layout)this.setLayoutProperty(h,i.layout[h],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Cu(a.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(i){return i==="visibility"?this.visibility:this._unevaluatedLayout.getValue(i)}setLayoutProperty(i,a,h={}){a!=null&&this._validate(t0,`layers.${this.id}.layout.${i}`,i,a,h)||(i!=="visibility"?this._unevaluatedLayout.setValue(i,a):this.visibility=a)}getPaintProperty(i){return i.endsWith(Ms)?this._transitionablePaint.getTransition(i.slice(0,-Ms.length)):this._transitionablePaint.getValue(i)}setPaintProperty(i,a,h={}){if(a!=null&&this._validate(ph,`layers.${this.id}.paint.${i}`,i,a,h))return!1;if(i.endsWith(Ms))return this._transitionablePaint.setTransition(i.slice(0,-Ms.length),a||void 0),!1;{let p=this._transitionablePaint._values[i],y=p.property.specification["property-type"]==="cross-faded-data-driven",x=p.value.isDataDriven(),w=p.value;this._transitionablePaint.setValue(i,a),this._handleSpecialPaintPropertyUpdate(i);let S=this._transitionablePaint._values[i].value;return S.isDataDriven()||x||y||this._handleOverridablePaintPropertyUpdate(i,w,S)}}_handleSpecialPaintPropertyUpdate(i){}_handleOverridablePaintPropertyUpdate(i,a,h){return!1}isHidden(i){return!!(this.minzoom&&i<this.minzoom)||!!(this.maxzoom&&i>=this.maxzoom)||this.visibility==="none"}updateTransitions(i){this._transitioningPaint=this._transitionablePaint.transitioned(i,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(i,a){i.getCrossfadeParameters&&(this._crossfadeParameters=i.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(i,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(i,void 0,a)}serialize(){let i={id:this.id,type:this.type,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()};return this.visibility&&(i.layout=i.layout||{},i.layout.visibility=this.visibility),de(i,(a,h)=>!(a===void 0||h==="layout"&&!Object.keys(a).length||h==="paint"&&!Object.keys(a).length))}_validate(i,a,h,p,y={}){return(!y||y.validate!==!1)&&Tp(this,i.call(Is,{key:a,layerType:this.type,objectKey:h,value:p,styleSpec:ye,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let i in this.paint._values){let a=this.paint.get(i);if(a instanceof xo&&ca(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1}}let s0={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class yl{constructor(i,a){this._structArray=i,this._pos1=a*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Oi{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(i,a){return i._trim(),a&&(i.isTransferred=!0,a.push(i.arrayBuffer)),{length:i.length,arrayBuffer:i.arrayBuffer}}static deserialize(i){let a=Object.create(this.prototype);return a.arrayBuffer=i.arrayBuffer,a.length=i.length,a.capacity=i.arrayBuffer.byteLength/a.bytesPerElement,a._refreshViews(),a}_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(i){this.reserve(i),this.length=i}reserve(i){if(i>this.capacity){this.capacity=Math.max(i,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let a=this.uint8;this._refreshViews(),a&&this.uint8.set(a)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ar(s,i=1){let a=0,h=0;return{members:s.map(p=>{let y=s0[p.type].BYTES_PER_ELEMENT,x=a=Bp(a,Math.max(i,y)),w=p.components||1;return h=Math.max(h,y),a+=y*w,{name:p.name,type:p.type,components:w,offset:x}}),size:Bp(a,Math.max(h,i)),alignment:i}}function Bp(s,i){return Math.ceil(s/i)*i}class va extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,a){let h=this.length;return this.resize(h+1),this.emplace(h,i,a)}emplace(i,a,h){let p=2*i;return this.int16[p+0]=a,this.int16[p+1]=h,i}}va.prototype.bytesPerElement=4,dt("StructArrayLayout2i4",va);class vl extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,a,h,p){let y=this.length;return this.resize(y+1),this.emplace(y,i,a,h,p)}emplace(i,a,h,p,y){let x=4*i;return this.int16[x+0]=a,this.int16[x+1]=h,this.int16[x+2]=p,this.int16[x+3]=y,i}}vl.prototype.bytesPerElement=8,dt("StructArrayLayout4i8",vl);class f extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x){let w=this.length;return this.resize(w+1),this.emplace(w,i,a,h,p,y,x)}emplace(i,a,h,p,y,x,w){let S=6*i;return this.int16[S+0]=a,this.int16[S+1]=h,this.int16[S+2]=p,this.int16[S+3]=y,this.int16[S+4]=x,this.int16[S+5]=w,i}}f.prototype.bytesPerElement=12,dt("StructArrayLayout2i4i12",f);class n extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x){let w=this.length;return this.resize(w+1),this.emplace(w,i,a,h,p,y,x)}emplace(i,a,h,p,y,x,w){let S=4*i,T=8*i;return this.int16[S+0]=a,this.int16[S+1]=h,this.uint8[T+4]=p,this.uint8[T+5]=y,this.uint8[T+6]=x,this.uint8[T+7]=w,i}}n.prototype.bytesPerElement=8,dt("StructArrayLayout2i4ub8",n);class c extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,a){let h=this.length;return this.resize(h+1),this.emplace(h,i,a)}emplace(i,a,h){let p=2*i;return this.float32[p+0]=a,this.float32[p+1]=h,i}}c.prototype.bytesPerElement=8,dt("StructArrayLayout2f8",c);class d extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x,w,S,T,z){let R=this.length;return this.resize(R+1),this.emplace(R,i,a,h,p,y,x,w,S,T,z)}emplace(i,a,h,p,y,x,w,S,T,z,R){let N=10*i;return this.uint16[N+0]=a,this.uint16[N+1]=h,this.uint16[N+2]=p,this.uint16[N+3]=y,this.uint16[N+4]=x,this.uint16[N+5]=w,this.uint16[N+6]=S,this.uint16[N+7]=T,this.uint16[N+8]=z,this.uint16[N+9]=R,i}}d.prototype.bytesPerElement=20,dt("StructArrayLayout10ui20",d);class g extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x,w,S,T,z,R,N){let G=this.length;return this.resize(G+1),this.emplace(G,i,a,h,p,y,x,w,S,T,z,R,N)}emplace(i,a,h,p,y,x,w,S,T,z,R,N,G){let W=12*i;return this.int16[W+0]=a,this.int16[W+1]=h,this.int16[W+2]=p,this.int16[W+3]=y,this.uint16[W+4]=x,this.uint16[W+5]=w,this.uint16[W+6]=S,this.uint16[W+7]=T,this.int16[W+8]=z,this.int16[W+9]=R,this.int16[W+10]=N,this.int16[W+11]=G,i}}g.prototype.bytesPerElement=24,dt("StructArrayLayout4i4ui4i24",g);class _ extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,a,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,a,h)}emplace(i,a,h,p){let y=3*i;return this.float32[y+0]=a,this.float32[y+1]=h,this.float32[y+2]=p,i}}_.prototype.bytesPerElement=12,dt("StructArrayLayout3f12",_);class I extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(i){let a=this.length;return this.resize(a+1),this.emplace(a,i)}emplace(i,a){return this.uint32[1*i+0]=a,i}}I.prototype.bytesPerElement=4,dt("StructArrayLayout1ul4",I);class M extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x,w,S,T){let z=this.length;return this.resize(z+1),this.emplace(z,i,a,h,p,y,x,w,S,T)}emplace(i,a,h,p,y,x,w,S,T,z){let R=10*i,N=5*i;return this.int16[R+0]=a,this.int16[R+1]=h,this.int16[R+2]=p,this.int16[R+3]=y,this.int16[R+4]=x,this.int16[R+5]=w,this.uint32[N+3]=S,this.uint16[R+8]=T,this.uint16[R+9]=z,i}}M.prototype.bytesPerElement=20,dt("StructArrayLayout6i1ul2ui20",M);class E extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x){let w=this.length;return this.resize(w+1),this.emplace(w,i,a,h,p,y,x)}emplace(i,a,h,p,y,x,w){let S=6*i;return this.int16[S+0]=a,this.int16[S+1]=h,this.int16[S+2]=p,this.int16[S+3]=y,this.int16[S+4]=x,this.int16[S+5]=w,i}}E.prototype.bytesPerElement=12,dt("StructArrayLayout2i2i2i12",E);class k extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y){let x=this.length;return this.resize(x+1),this.emplace(x,i,a,h,p,y)}emplace(i,a,h,p,y,x){let w=4*i,S=8*i;return this.float32[w+0]=a,this.float32[w+1]=h,this.float32[w+2]=p,this.int16[S+6]=y,this.int16[S+7]=x,i}}k.prototype.bytesPerElement=16,dt("StructArrayLayout2f1f2i16",k);class D extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,a,h,p){let y=this.length;return this.resize(y+1),this.emplace(y,i,a,h,p)}emplace(i,a,h,p,y){let x=12*i,w=3*i;return this.uint8[x+0]=a,this.uint8[x+1]=h,this.float32[w+1]=p,this.float32[w+2]=y,i}}D.prototype.bytesPerElement=12,dt("StructArrayLayout2ub2f12",D);class O extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,a,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,a,h)}emplace(i,a,h,p){let y=3*i;return this.uint16[y+0]=a,this.uint16[y+1]=h,this.uint16[y+2]=p,i}}O.prototype.bytesPerElement=6,dt("StructArrayLayout3ui6",O);class X extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x,w,S,T,z,R,N,G,W,se,ae,be){let Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,i,a,h,p,y,x,w,S,T,z,R,N,G,W,se,ae,be)}emplace(i,a,h,p,y,x,w,S,T,z,R,N,G,W,se,ae,be,Ee){let Me=24*i,Le=12*i,We=48*i;return this.int16[Me+0]=a,this.int16[Me+1]=h,this.uint16[Me+2]=p,this.uint16[Me+3]=y,this.uint32[Le+2]=x,this.uint32[Le+3]=w,this.uint32[Le+4]=S,this.uint16[Me+10]=T,this.uint16[Me+11]=z,this.uint16[Me+12]=R,this.float32[Le+7]=N,this.float32[Le+8]=G,this.uint8[We+36]=W,this.uint8[We+37]=se,this.uint8[We+38]=ae,this.uint32[Le+10]=be,this.int16[Me+22]=Ee,i}}X.prototype.bytesPerElement=48,dt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",X);class oe extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,a,h,p,y,x,w,S,T,z,R,N,G,W,se,ae,be,Ee,Me,Le,We,Oe,pt,bt,nt,ot,tt,ct){let st=this.length;return this.resize(st+1),this.emplace(st,i,a,h,p,y,x,w,S,T,z,R,N,G,W,se,ae,be,Ee,Me,Le,We,Oe,pt,bt,nt,ot,tt,ct)}emplace(i,a,h,p,y,x,w,S,T,z,R,N,G,W,se,ae,be,Ee,Me,Le,We,Oe,pt,bt,nt,ot,tt,ct,st){let Ye=34*i,Et=17*i;return this.int16[Ye+0]=a,this.int16[Ye+1]=h,this.int16[Ye+2]=p,this.int16[Ye+3]=y,this.int16[Ye+4]=x,this.int16[Ye+5]=w,this.int16[Ye+6]=S,this.int16[Ye+7]=T,this.uint16[Ye+8]=z,this.uint16[Ye+9]=R,this.uint16[Ye+10]=N,this.uint16[Ye+11]=G,this.uint16[Ye+12]=W,this.uint16[Ye+13]=se,this.uint16[Ye+14]=ae,this.uint16[Ye+15]=be,this.uint16[Ye+16]=Ee,this.uint16[Ye+17]=Me,this.uint16[Ye+18]=Le,this.uint16[Ye+19]=We,this.uint16[Ye+20]=Oe,this.uint16[Ye+21]=pt,this.uint16[Ye+22]=bt,this.uint32[Et+12]=nt,this.float32[Et+13]=ot,this.float32[Et+14]=tt,this.float32[Et+15]=ct,this.float32[Et+16]=st,i}}oe.prototype.bytesPerElement=68,dt("StructArrayLayout8i15ui1ul4f68",oe);class $ extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i){let a=this.length;return this.resize(a+1),this.emplace(a,i)}emplace(i,a){return this.float32[1*i+0]=a,i}}$.prototype.bytesPerElement=4,dt("StructArrayLayout1f4",$);class ne extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,a,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,a,h)}emplace(i,a,h,p){let y=3*i;return this.int16[y+0]=a,this.int16[y+1]=h,this.int16[y+2]=p,i}}ne.prototype.bytesPerElement=6,dt("StructArrayLayout3i6",ne);class me extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,a,h){let p=this.length;return this.resize(p+1),this.emplace(p,i,a,h)}emplace(i,a,h,p){let y=4*i;return this.uint32[2*i+0]=a,this.uint16[y+2]=h,this.uint16[y+3]=p,i}}me.prototype.bytesPerElement=8,dt("StructArrayLayout1ul2ui8",me);class ge extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,a){let h=this.length;return this.resize(h+1),this.emplace(h,i,a)}emplace(i,a,h){let p=2*i;return this.uint16[p+0]=a,this.uint16[p+1]=h,i}}ge.prototype.bytesPerElement=4,dt("StructArrayLayout2ui4",ge);class we extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i){let a=this.length;return this.resize(a+1),this.emplace(a,i)}emplace(i,a){return this.uint16[1*i+0]=a,i}}we.prototype.bytesPerElement=2,dt("StructArrayLayout1ui2",we);class xe extends Oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,a,h,p){let y=this.length;return this.resize(y+1),this.emplace(y,i,a,h,p)}emplace(i,a,h,p,y){let x=4*i;return this.float32[x+0]=a,this.float32[x+1]=h,this.float32[x+2]=p,this.float32[x+3]=y,i}}xe.prototype.bytesPerElement=16,dt("StructArrayLayout4f16",xe);class Ne extends yl{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new at(this.anchorPointX,this.anchorPointY)}}Ne.prototype.size=20;class Te extends M{get(i){return new Ne(this,i)}}dt("CollisionBoxArray",Te);class ke extends yl{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(i){this._structArray.uint8[this._pos1+37]=i}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(i){this._structArray.uint8[this._pos1+38]=i}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(i){this._structArray.uint32[this._pos4+10]=i}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ke.prototype.size=48;class je extends X{get(i){return new ke(this,i)}}dt("PlacedSymbolArray",je);class Ke extends yl{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(i){this._structArray.uint32[this._pos4+12]=i}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}Ke.prototype.size=68;class De extends oe{get(i){return new Ke(this,i)}}dt("SymbolInstanceArray",De);class mt extends ${getoffsetX(i){return this.float32[1*i+0]}}dt("GlyphOffsetArray",mt);class rt extends ne{getx(i){return this.int16[3*i+0]}gety(i){return this.int16[3*i+1]}gettileUnitDistanceFromAnchor(i){return this.int16[3*i+2]}}dt("SymbolLineVertexArray",rt);class Pt extends yl{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]}}Pt.prototype.size=8;class Qt extends me{get(i){return new Pt(this,i)}}dt("FeatureIndexArray",Qt);class Wt extends va{}class qt extends va{}class Qi extends f{}class zt extends n{}class ai extends c{}class Si extends d{}class Fr extends g{}class En extends _{}class jn extends I{}class Hn extends E{}class es extends D{}class mn extends O{}class _o extends ge{}let Es=Ar([{name:"a_pos",components:2,type:"Int16"}],4),{members:An}=Es;class li{constructor(i=[]){this.segments=i}prepareSegment(i,a,h,p){let y=this.segments[this.segments.length-1];return i>li.MAX_VERTEX_ARRAY_LENGTH&&te(`Max vertices per segment is ${li.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${i}`),(!y||y.vertexLength+i>li.MAX_VERTEX_ARRAY_LENGTH||y.sortKey!==p)&&(y={vertexOffset:a.length,primitiveOffset:h.length,vertexLength:0,primitiveLength:0},p!==void 0&&(y.sortKey=p),this.segments.push(y)),y}get(){return this.segments}destroy(){for(let i of this.segments)for(let a in i.vaos)i.vaos[a].destroy()}static simpleSegment(i,a,h,p){return new li([{vertexOffset:i,primitiveOffset:a,vertexLength:h,primitiveLength:p,vaos:{},sortKey:0}])}}function yi(s,i){return 256*(s=A(Math.floor(s),0,255))+A(Math.floor(i),0,255)}li.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dt("SegmentVector",li);let xr=Ar([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var nn={exports:{}},Ui={exports:{}};Ui.exports=function(s,i){var a,h,p,y,x,w,S,T;for(h=s.length-(a=3&s.length),p=i,x=3432918353,w=461845907,T=0;T<h;)S=255&s.charCodeAt(T)|(255&s.charCodeAt(++T))<<8|(255&s.charCodeAt(++T))<<16|(255&s.charCodeAt(++T))<<24,++T,p=27492+(65535&(y=5*(65535&(p=(p^=S=(65535&(S=(S=(65535&S)*x+(((S>>>16)*x&65535)<<16)&4294967295)<<15|S>>>17))*w+(((S>>>16)*w&65535)<<16)&4294967295)<<13|p>>>19))+((5*(p>>>16)&65535)<<16)&4294967295))+((58964+(y>>>16)&65535)<<16);switch(S=0,a){case 3:S^=(255&s.charCodeAt(T+2))<<16;case 2:S^=(255&s.charCodeAt(T+1))<<8;case 1:p^=S=(65535&(S=(S=(65535&(S^=255&s.charCodeAt(T)))*x+(((S>>>16)*x&65535)<<16)&4294967295)<<15|S>>>17))*w+(((S>>>16)*w&65535)<<16)&4294967295}return p^=s.length,p=2246822507*(65535&(p^=p>>>16))+((2246822507*(p>>>16)&65535)<<16)&4294967295,p=3266489909*(65535&(p^=p>>>13))+((3266489909*(p>>>16)&65535)<<16)&4294967295,(p^=p>>>16)>>>0};var As={exports:{}};As.exports=function(s,i){for(var a,h=s.length,p=i^h,y=0;h>=4;)a=1540483477*(65535&(a=255&s.charCodeAt(y)|(255&s.charCodeAt(++y))<<8|(255&s.charCodeAt(++y))<<16|(255&s.charCodeAt(++y))<<24))+((1540483477*(a>>>16)&65535)<<16),p=1540483477*(65535&p)+((1540483477*(p>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),h-=4,++y;switch(h){case 3:p^=(255&s.charCodeAt(y+2))<<16;case 2:p^=(255&s.charCodeAt(y+1))<<8;case 1:p=1540483477*(65535&(p^=255&s.charCodeAt(y)))+((1540483477*(p>>>16)&65535)<<16)}return p=1540483477*(65535&(p^=p>>>13))+((1540483477*(p>>>16)&65535)<<16),(p^=p>>>15)>>>0};var bo=Ui.exports,Mu=As.exports;nn.exports=bo,nn.exports.murmur3=bo,nn.exports.murmur2=Mu;var Ih=nn.exports;class Eu{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(i,a,h,p){this.ids.push(Np(i)),this.positions.push(a,h,p)}getPositions(i){let a=Np(i),h=0,p=this.ids.length-1;for(;h<p;){let x=h+p>>1;this.ids[x]>=a?p=x:h=x+1}let y=[];for(;this.ids[h]===a;)y.push({index:this.positions[3*h],start:this.positions[3*h+1],end:this.positions[3*h+2]}),h++;return y}static serialize(i,a){let h=new Float64Array(i.ids),p=new Uint32Array(i.positions);return Ts(h,p,0,h.length-1),a&&a.push(h.buffer,p.buffer),{ids:h,positions:p}}static deserialize(i){let a=new Eu;return a.ids=i.ids,a.positions=i.positions,a.indexed=!0,a}}function Np(s){let i=+s;return!isNaN(i)&&i<=Number.MAX_SAFE_INTEGER?i:Ih(String(s))}function Ts(s,i,a,h){for(;a<h;){let p=s[a+h>>1],y=a-1,x=h+1;for(;;){do y++;while(s[y]<p);do x--;while(s[x]>p);if(y>=x)break;Au(s,y,x),Au(i,3*y,3*x),Au(i,3*y+1,3*x+1),Au(i,3*y+2,3*x+2)}x-a<h-x?(Ts(s,i,a,x),a=x+1):(Ts(s,i,x+1,h),h=x)}}function Au(s,i,a){let h=s[i];s[i]=s[a],s[a]=h}dt("FeaturePositionMap",Eu);class wo{constructor(i,a){this.gl=i.gl,this.location=a}}class xa extends wo{constructor(i,a){super(i,a),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class Nx extends wo{constructor(i,a){super(i,a),this.current=[0,0,0,0]}set(i){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 Fx extends wo{constructor(i,a){super(i,a),this.current=L.transparent}set(i){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 DA=new Float32Array(16);function a0(s){return[yi(255*s.r,255*s.g),yi(255*s.b,255*s.a)]}class Sh{constructor(i,a,h){this.value=i,this.uniformNames=a.map(p=>`u_${p}`),this.type=h}setUniform(i,a,h){i.set(h.constantOr(this.value))}getBinding(i,a,h){return this.type==="color"?new Fx(i,a):new xa(i,a)}}class Tu{constructor(i,a){this.uniformNames=a.map(h=>`u_${h}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(i,a){this.pixelRatioFrom=a.pixelRatio,this.pixelRatioTo=i.pixelRatio,this.patternFrom=a.tlbr,this.patternTo=i.tlbr}setUniform(i,a,h,p){let y=p==="u_pattern_to"?this.patternTo:p==="u_pattern_from"?this.patternFrom:p==="u_pixel_ratio_to"?this.pixelRatioTo:p==="u_pixel_ratio_from"?this.pixelRatioFrom:null;y&&i.set(y)}getBinding(i,a,h){return h.substr(0,9)==="u_pattern"?new Nx(i,a):new xa(i,a)}}class Ps{constructor(i,a,h,p){this.expression=i,this.type=h,this.maxValue=0,this.paintVertexAttributes=a.map(y=>({name:`a_${y}`,type:"Float32",components:h==="color"?2:1,offset:0})),this.paintVertexArray=new p}populatePaintArray(i,a,h,p,y){let x=this.paintVertexArray.length,w=this.expression.evaluate(new Vi(0),a,{},p,[],y);this.paintVertexArray.resize(i),this._setPaintValue(x,i,w)}updatePaintArray(i,a,h,p){let y=this.expression.evaluate({zoom:0},h,p);this._setPaintValue(i,a,y)}_setPaintValue(i,a,h){if(this.type==="color"){let p=a0(h);for(let y=i;y<a;y++)this.paintVertexArray.emplace(y,p[0],p[1])}else{for(let p=i;p<a;p++)this.paintVertexArray.emplace(p,h);this.maxValue=Math.max(this.maxValue,Math.abs(h))}}upload(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Do{constructor(i,a,h,p,y,x){this.expression=i,this.uniformNames=a.map(w=>`u_${w}_t`),this.type=h,this.useIntegerZoom=p,this.zoom=y,this.maxValue=0,this.paintVertexAttributes=a.map(w=>({name:`a_${w}`,type:"Float32",components:h==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(i,a,h,p,y){let x=this.expression.evaluate(new Vi(this.zoom),a,{},p,[],y),w=this.expression.evaluate(new Vi(this.zoom+1),a,{},p,[],y),S=this.paintVertexArray.length;this.paintVertexArray.resize(i),this._setPaintValue(S,i,x,w)}updatePaintArray(i,a,h,p){let y=this.expression.evaluate({zoom:this.zoom},h,p),x=this.expression.evaluate({zoom:this.zoom+1},h,p);this._setPaintValue(i,a,y,x)}_setPaintValue(i,a,h,p){if(this.type==="color"){let y=a0(h),x=a0(p);for(let w=i;w<a;w++)this.paintVertexArray.emplace(w,y[0],y[1],x[0],x[1])}else{for(let y=i;y<a;y++)this.paintVertexArray.emplace(y,h,p);this.maxValue=Math.max(this.maxValue,Math.abs(h),Math.abs(p))}}upload(i){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=i.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(i,a){let h=this.useIntegerZoom?Math.floor(a.zoom):a.zoom,p=A(this.expression.interpolationFactor(h,this.zoom,this.zoom+1),0,1);i.set(p)}getBinding(i,a,h){return new xa(i,a)}}class _a{constructor(i,a,h,p,y,x){this.expression=i,this.type=a,this.useIntegerZoom=h,this.zoom=p,this.layerId=x,this.zoomInPaintVertexArray=new y,this.zoomOutPaintVertexArray=new y}populatePaintArray(i,a,h){let p=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(i),this.zoomOutPaintVertexArray.resize(i),this._setPaintValues(p,i,a.patterns&&a.patterns[this.layerId],h)}updatePaintArray(i,a,h,p,y){this._setPaintValues(i,a,h.patterns&&h.patterns[this.layerId],y)}_setPaintValues(i,a,h,p){if(!p||!h)return;let{min:y,mid:x,max:w}=h,S=p[y],T=p[x],z=p[w];if(S&&T&&z)for(let R=i;R<a;R++)this.zoomInPaintVertexArray.emplace(R,T.tl[0],T.tl[1],T.br[0],T.br[1],S.tl[0],S.tl[1],S.br[0],S.br[1],T.pixelRatio,S.pixelRatio),this.zoomOutPaintVertexArray.emplace(R,T.tl[0],T.tl[1],T.br[0],T.br[1],z.tl[0],z.tl[1],z.br[0],z.br[1],T.pixelRatio,z.pixelRatio)}upload(i){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=i.createVertexBuffer(this.zoomInPaintVertexArray,xr.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=i.createVertexBuffer(this.zoomOutPaintVertexArray,xr.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ox{constructor(i,a,h){this.binders={},this._buffers=[];let p=[];for(let y in i.paint._values){if(!h(y))continue;let x=i.paint.get(y);if(!(x instanceof xo&&ca(x.property.specification)))continue;let w=BA(y,i.type),S=x.value,T=x.property.specification.type,z=x.property.useIntegerZoom,R=x.property.specification["property-type"],N=R==="cross-faded"||R==="cross-faded-data-driven";if(S.kind==="constant")this.binders[y]=N?new Tu(S.value,w):new Sh(S.value,w,T),p.push(`/u_${y}`);else if(S.kind==="source"||N){let G=Gx(y,T,"source");this.binders[y]=N?new _a(S,T,z,a,G,i.id):new Ps(S,w,T,G),p.push(`/a_${y}`)}else{let G=Gx(y,T,"composite");this.binders[y]=new Do(S,w,T,z,a,G),p.push(`/z_${y}`)}}this.cacheKey=p.sort().join("")}getMaxValue(i){let a=this.binders[i];return a instanceof Ps||a instanceof Do?a.maxValue:0}populatePaintArrays(i,a,h,p,y){for(let x in this.binders){let w=this.binders[x];(w instanceof Ps||w instanceof Do||w instanceof _a)&&w.populatePaintArray(i,a,h,p,y)}}setConstantPatternPositions(i,a){for(let h in this.binders){let p=this.binders[h];p instanceof Tu&&p.setConstantPatternPositions(i,a)}}updatePaintArrays(i,a,h,p,y){let x=!1;for(let w in i){let S=a.getPositions(w);for(let T of S){let z=h.feature(T.index);for(let R in this.binders){let N=this.binders[R];if((N instanceof Ps||N instanceof Do||N instanceof _a)&&N.expression.isStateDependent===!0){let G=p.paint.get(R);N.expression=G.value,N.updatePaintArray(T.start,T.end,z,i[w],y),x=!0}}}}return x}defines(){let i=[];for(let a in this.binders){let h=this.binders[a];(h instanceof Sh||h instanceof Tu)&&i.push(...h.uniformNames.map(p=>`#define HAS_UNIFORM_${p}`))}return i}getBinderAttributes(){let i=[];for(let a in this.binders){let h=this.binders[a];if(h instanceof Ps||h instanceof Do)for(let p=0;p<h.paintVertexAttributes.length;p++)i.push(h.paintVertexAttributes[p].name);else if(h instanceof _a)for(let p=0;p<xr.members.length;p++)i.push(xr.members[p].name)}return i}getBinderUniforms(){let i=[];for(let a in this.binders){let h=this.binders[a];if(h instanceof Sh||h instanceof Tu||h instanceof Do)for(let p of h.uniformNames)i.push(p)}return i}getPaintVertexBuffers(){return this._buffers}getUniforms(i,a){let h=[];for(let p in this.binders){let y=this.binders[p];if(y instanceof Sh||y instanceof Tu||y instanceof Do){for(let x of y.uniformNames)if(a[x]){let w=y.getBinding(i,a[x],x);h.push({name:x,property:p,binding:w})}}}return h}setUniforms(i,a,h,p){for(let{name:y,property:x,binding:w}of a)this.binders[x].setUniform(w,p,h.get(x),y)}updatePaintBuffers(i){this._buffers=[];for(let a in this.binders){let h=this.binders[a];if(i&&h instanceof _a){let p=i.fromScale===2?h.zoomInPaintVertexBuffer:h.zoomOutPaintVertexBuffer;p&&this._buffers.push(p)}else(h instanceof Ps||h instanceof Do)&&h.paintVertexBuffer&&this._buffers.push(h.paintVertexBuffer)}}upload(i){for(let a in this.binders){let h=this.binders[a];(h instanceof Ps||h instanceof Do||h instanceof _a)&&h.upload(i)}this.updatePaintBuffers()}destroy(){for(let i in this.binders){let a=this.binders[i];(a instanceof Ps||a instanceof Do||a instanceof _a)&&a.destroy()}}}class xl{constructor(i,a,h=()=>!0){this.programConfigurations={};for(let p of i)this.programConfigurations[p.id]=new Ox(p,a,h);this.needsUpload=!1,this._featureMap=new Eu,this._bufferOffset=0}populatePaintArrays(i,a,h,p,y,x){for(let w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(i,a,p,y,x);a.id!==void 0&&this._featureMap.add(a.id,h,this._bufferOffset,i),this._bufferOffset=i,this.needsUpload=!0}updatePaintArrays(i,a,h,p){for(let y of h)this.needsUpload=this.programConfigurations[y.id].updatePaintArrays(i,this._featureMap,a,y,p)||this.needsUpload}get(i){return this.programConfigurations[i]}upload(i){if(this.needsUpload){for(let a in this.programConfigurations)this.programConfigurations[a].upload(i);this.needsUpload=!1}}destroy(){for(let i in this.programConfigurations)this.programConfigurations[i].destroy()}}function BA(s,i){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"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":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[s]||[s.replace(`${i}-`,"").replace(/-/g,"_")]}function Gx(s,i,a){let h={color:{source:c,composite:xe},number:{source:$,composite:c}},p=function(y){return{"line-pattern":{source:Si,composite:Si},"fill-pattern":{source:Si,composite:Si},"fill-extrusion-pattern":{source:Si,composite:Si}}[y]}(s);return p&&p[a]||h[i][a]}dt("ConstantBinder",Sh),dt("CrossFadedConstantBinder",Tu),dt("SourceExpressionBinder",Ps),dt("CrossFadedCompositeBinder",_a),dt("CompositeExpressionBinder",Do),dt("ProgramConfiguration",Ox,{omit:["_buffers"]}),dt("ProgramConfigurationSet",xl);var Tr=8192;let l0=Math.pow(2,14)-1,Vx=-l0-1;function _l(s){let i=Tr/s.extent,a=s.loadGeometry();for(let h=0;h<a.length;h++){let p=a[h];for(let y=0;y<p.length;y++){let x=p[y],w=Math.round(x.x*i),S=Math.round(x.y*i);x.x=A(w,Vx,l0),x.y=A(S,Vx,l0),(w<x.x||w>x.x+1||S<x.y||S>x.y+1)&&te("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return a}function bl(s,i){return{type:s.type,id:s.id,properties:s.properties,geometry:i?_l(s):[]}}function Fp(s,i,a,h,p){s.emplaceBack(2*i+(h+1)/2,2*a+(p+1)/2)}class u0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(a=>a.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new Wt,this.indexArray=new mn,this.segments=new li,this.programConfigurations=new xl(i.layers,i.zoom),this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(i,a,h){let p=this.layers[0],y=[],x=null,w=!1;p.type==="circle"&&(x=p.layout.get("circle-sort-key"),w=!x.isConstant());for(let{feature:S,id:T,index:z,sourceLayerIndex:R}of i){let N=this.layers[0]._featureFilter.needGeometry,G=bl(S,N);if(!this.layers[0]._featureFilter.filter(new Vi(this.zoom),G,h))continue;let W=w?x.evaluate(G,{},h):void 0,se={id:T,properties:S.properties,type:S.type,sourceLayerIndex:R,index:z,geometry:N?G.geometry:_l(S),patterns:{},sortKey:W};y.push(se)}w&&y.sort((S,T)=>S.sortKey-T.sortKey);for(let S of y){let{geometry:T,index:z,sourceLayerIndex:R}=S,N=i[z].feature;this.addFeature(S,T,z,h),a.featureIndex.insert(N,T,z,R,this.index)}}update(i,a,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,a,this.stateDependentLayers,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,An),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(i,a,h,p){for(let y of a)for(let x of y){let w=x.x,S=x.y;if(w<0||w>=Tr||S<0||S>=Tr)continue;let T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,i.sortKey),z=T.vertexLength;Fp(this.layoutVertexArray,w,S,-1,-1),Fp(this.layoutVertexArray,w,S,1,-1),Fp(this.layoutVertexArray,w,S,1,1),Fp(this.layoutVertexArray,w,S,-1,1),this.indexArray.emplaceBack(z,z+1,z+2),this.indexArray.emplaceBack(z,z+3,z+2),T.vertexLength+=4,T.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,{},p)}}function Ux(s,i){for(let a=0;a<s.length;a++)if(Pu(i,s[a]))return!0;for(let a=0;a<i.length;a++)if(Pu(s,i[a]))return!0;return!!c0(s,i)}function NA(s,i,a){return!!Pu(s,i)||!!h0(i,s,a)}function Wx(s,i){if(s.length===1)return jx(i,s[0]);for(let a=0;a<i.length;a++){let h=i[a];for(let p=0;p<h.length;p++)if(Pu(s,h[p]))return!0}for(let a=0;a<s.length;a++)if(jx(i,s[a]))return!0;for(let a=0;a<i.length;a++)if(c0(s,i[a]))return!0;return!1}function FA(s,i,a){if(s.length>1){if(c0(s,i))return!0;for(let h=0;h<i.length;h++)if(h0(i[h],s,a))return!0}for(let h=0;h<s.length;h++)if(h0(s[h],i,a))return!0;return!1}function c0(s,i){if(s.length===0||i.length===0)return!1;for(let a=0;a<s.length-1;a++){let h=s[a],p=s[a+1];for(let y=0;y<i.length-1;y++)if(OA(h,p,i[y],i[y+1]))return!0}return!1}function OA(s,i,a,h){return ve(s,a,h)!==ve(i,a,h)&&ve(s,i,a)!==ve(s,i,h)}function h0(s,i,a){let h=a*a;if(i.length===1)return s.distSqr(i[0])<h;for(let p=1;p<i.length;p++)if(Zx(s,i[p-1],i[p])<h)return!0;return!1}function Zx(s,i,a){let h=i.distSqr(a);if(h===0)return s.distSqr(i);let p=((s.x-i.x)*(a.x-i.x)+(s.y-i.y)*(a.y-i.y))/h;return s.distSqr(p<0?i:p>1?a:a.sub(i)._mult(p)._add(i))}function jx(s,i){let a,h,p,y=!1;for(let x=0;x<s.length;x++){a=s[x];for(let w=0,S=a.length-1;w<a.length;S=w++)h=a[w],p=a[S],h.y>i.y!=p.y>i.y&&i.x<(p.x-h.x)*(i.y-h.y)/(p.y-h.y)+h.x&&(y=!y)}return y}function Pu(s,i){let a=!1;for(let h=0,p=s.length-1;h<s.length;p=h++){let y=s[h],x=s[p];y.y>i.y!=x.y>i.y&&i.x<(x.x-y.x)*(i.y-y.y)/(x.y-y.y)+y.x&&(a=!a)}return a}function GA(s,i,a){let h=a[0],p=a[2];if(s.x<h.x&&i.x<h.x||s.x>p.x&&i.x>p.x||s.y<h.y&&i.y<h.y||s.y>p.y&&i.y>p.y)return!1;let y=ve(s,i,a[0]);return y!==ve(s,i,a[1])||y!==ve(s,i,a[2])||y!==ve(s,i,a[3])}function Ch(s,i,a){let h=i.paint.get(s).value;return h.kind==="constant"?h.value:a.programConfigurations.get(i.id).getMaxValue(s)}function Op(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}function Gp(s,i,a,h,p){if(!i[0]&&!i[1])return s;let y=at.convert(i)._mult(p);a==="viewport"&&y._rotate(-h);let x=[];for(let w=0;w<s.length;w++)x.push(s[w].sub(y));return x}dt("CircleBucket",u0,{omit:["layers"]});let VA=new Er({"circle-sort-key":new Mt(ye.layout_circle["circle-sort-key"])});var UA={paint:new Er({"circle-radius":new Mt(ye.paint_circle["circle-radius"]),"circle-color":new Mt(ye.paint_circle["circle-color"]),"circle-blur":new Mt(ye.paint_circle["circle-blur"]),"circle-opacity":new Mt(ye.paint_circle["circle-opacity"]),"circle-translate":new vt(ye.paint_circle["circle-translate"]),"circle-translate-anchor":new vt(ye.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new vt(ye.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new vt(ye.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Mt(ye.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Mt(ye.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Mt(ye.paint_circle["circle-stroke-opacity"])}),layout:VA},ku=typeof Float32Array<"u"?Float32Array:Array;function d0(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s}function Hx(s,i,a){var h=i[0],p=i[1],y=i[2],x=i[3],w=i[4],S=i[5],T=i[6],z=i[7],R=i[8],N=i[9],G=i[10],W=i[11],se=i[12],ae=i[13],be=i[14],Ee=i[15],Me=a[0],Le=a[1],We=a[2],Oe=a[3];return s[0]=Me*h+Le*w+We*R+Oe*se,s[1]=Me*p+Le*S+We*N+Oe*ae,s[2]=Me*y+Le*T+We*G+Oe*be,s[3]=Me*x+Le*z+We*W+Oe*Ee,s[4]=(Me=a[4])*h+(Le=a[5])*w+(We=a[6])*R+(Oe=a[7])*se,s[5]=Me*p+Le*S+We*N+Oe*ae,s[6]=Me*y+Le*T+We*G+Oe*be,s[7]=Me*x+Le*z+We*W+Oe*Ee,s[8]=(Me=a[8])*h+(Le=a[9])*w+(We=a[10])*R+(Oe=a[11])*se,s[9]=Me*p+Le*S+We*N+Oe*ae,s[10]=Me*y+Le*T+We*G+Oe*be,s[11]=Me*x+Le*z+We*W+Oe*Ee,s[12]=(Me=a[12])*h+(Le=a[13])*w+(We=a[14])*R+(Oe=a[15])*se,s[13]=Me*p+Le*S+We*N+Oe*ae,s[14]=Me*y+Le*T+We*G+Oe*be,s[15]=Me*x+Le*z+We*W+Oe*Ee,s}Math.hypot||(Math.hypot=function(){for(var s=0,i=arguments.length;i--;)s+=arguments[i]*arguments[i];return Math.sqrt(s)});var Mh,WA=Hx;function Vp(s,i,a){var h=i[0],p=i[1],y=i[2],x=i[3];return s[0]=a[0]*h+a[4]*p+a[8]*y+a[12]*x,s[1]=a[1]*h+a[5]*p+a[9]*y+a[13]*x,s[2]=a[2]*h+a[6]*p+a[10]*y+a[14]*x,s[3]=a[3]*h+a[7]*p+a[11]*y+a[15]*x,s}function Xx(s,i){let a=Vp([],[s.x,s.y,0,1],i);return new at(a[0]/a[3],a[1]/a[3])}Mh=new ku(4),ku!=Float32Array&&(Mh[0]=0,Mh[1]=0,Mh[2]=0,Mh[3]=0);class $x extends u0{}dt("HeatmapBucket",$x,{omit:["layers"]});var ZA={paint:new Er({"heatmap-radius":new Mt(ye.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Mt(ye.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new vt(ye.paint_heatmap["heatmap-intensity"]),"heatmap-color":new wh(ye.paint_heatmap["heatmap-color"]),"heatmap-opacity":new vt(ye.paint_heatmap["heatmap-opacity"])})};function p0(s,{width:i,height:a},h,p){if(p){if(p instanceof Uint8ClampedArray)p=new Uint8Array(p.buffer);else if(p.length!==i*a*h)throw new RangeError(`mismatched image size. expected: ${p.length} but got: ${i*a*h}`)}else p=new Uint8Array(i*a*h);return s.width=i,s.height=a,s.data=p,s}function Yx(s,{width:i,height:a},h){if(i===s.width&&a===s.height)return;let p=p0({},{width:i,height:a},h);f0(s,p,{x:0,y:0},{x:0,y:0},{width:Math.min(s.width,i),height:Math.min(s.height,a)},h),s.width=i,s.height=a,s.data=p.data}function f0(s,i,a,h,p,y){if(p.width===0||p.height===0)return i;if(p.width>s.width||p.height>s.height||a.x>s.width-p.width||a.y>s.height-p.height)throw new RangeError("out of range source coordinates for image copy");if(p.width>i.width||p.height>i.height||h.x>i.width-p.width||h.y>i.height-p.height)throw new RangeError("out of range destination coordinates for image copy");let x=s.data,w=i.data;for(let S=0;S<p.height;S++){let T=((a.y+S)*s.width+a.x)*y,z=((h.y+S)*i.width+h.x)*y;for(let R=0;R<p.width*y;R++)w[z+R]=x[T+R]}return i}class Eh{constructor(i,a){p0(this,i,1,a)}resize(i){Yx(this,i,1)}clone(){return new Eh({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(i,a,h,p,y){f0(i,a,h,p,y,1)}}class so{constructor(i,a){p0(this,i,4,a)}resize(i){Yx(this,i,4)}replace(i,a){a?this.data.set(i):this.data=i instanceof Uint8ClampedArray?new Uint8Array(i.buffer):i}clone(){return new so({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(i,a,h,p,y){f0(i,a,h,p,y,4)}}function qx(s){let i={},a=s.resolution||256,h=s.clips?s.clips.length:1,p=s.image||new so({width:a,height:h}),y=(x,w,S)=>{i[s.evaluationKey]=S;let T=s.expression.evaluate(i);p.data[x+w+0]=Math.floor(255*T.r/T.a),p.data[x+w+1]=Math.floor(255*T.g/T.a),p.data[x+w+2]=Math.floor(255*T.b/T.a),p.data[x+w+3]=Math.floor(255*T.a)};if(s.clips)for(let x=0,w=0;x<h;++x,w+=4*a)for(let S=0,T=0;S<a;S++,T+=4){let z=S/(a-1),{start:R,end:N}=s.clips[x];y(w,T,R*(1-z)+N*z)}else for(let x=0,w=0;x<a;x++,w+=4)y(0,w,x/(a-1));return p}dt("AlphaImage",Eh),dt("RGBAImage",so);var jA={paint:new Er({"hillshade-illumination-direction":new vt(ye.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new vt(ye.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new vt(ye.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new vt(ye.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new vt(ye.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new vt(ye.paint_hillshade["hillshade-accent-color"])})};let HA=Ar([{name:"a_pos",components:2,type:"Int16"}],4),{members:XA}=HA;var m0={exports:{}};function Up(s,i,a){a=a||2;var h,p,y,x,w,S,T,z=i&&i.length,R=z?i[0]*a:s.length,N=Jx(s,0,R,a,!0),G=[];if(!N||N.next===N.prev)return G;if(z&&(N=function(se,ae,be,Ee){var Me,Le,We,Oe=[];for(Me=0,Le=ae.length;Me<Le;Me++)(We=Jx(se,ae[Me]*Ee,Me<Le-1?ae[Me+1]*Ee:se.length,Ee,!1))===We.next&&(We.steiner=!0),Oe.push(tT(We));for(Oe.sort(QA),Me=0;Me<Oe.length;Me++)be=ba(be=KA(Oe[Me],be),be.next);return be}(s,i,N,a)),s.length>80*a){h=y=s[0],p=x=s[1];for(var W=a;W<R;W+=a)(w=s[W])<h&&(h=w),(S=s[W+1])<p&&(p=S),w>y&&(y=w),S>x&&(x=S);T=(T=Math.max(y-h,x-p))!==0?1/T:0}return Ah(N,G,a,h,p,T),G}function Jx(s,i,a,h,p){var y,x;if(p===v0(s,i,a,h)>0)for(y=i;y<a;y+=h)x=e_(y,s[y],s[y+1],x);else for(y=a-h;y>=i;y-=h)x=e_(y,s[y],s[y+1],x);return x&&Wp(x,x.next)&&(Ph(x),x=x.next),x}function ba(s,i){if(!s)return s;i||(i=s);var a,h=s;do if(a=!1,h.steiner||!Wp(h,h.next)&&hr(h.prev,h,h.next)!==0)h=h.next;else{if(Ph(h),(h=i=h.prev)===h.next)break;a=!0}while(a||h!==i);return i}function Ah(s,i,a,h,p,y,x){if(s){!x&&y&&function(z,R,N,G){var W=z;do W.z===null&&(W.z=g0(W.x,W.y,R,N,G)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==z);W.prevZ.nextZ=null,W.prevZ=null,function(se){var ae,be,Ee,Me,Le,We,Oe,pt,bt=1;do{for(be=se,se=null,Le=null,We=0;be;){for(We++,Ee=be,Oe=0,ae=0;ae<bt&&(Oe++,Ee=Ee.nextZ);ae++);for(pt=bt;Oe>0||pt>0&&Ee;)Oe!==0&&(pt===0||!Ee||be.z<=Ee.z)?(Me=be,be=be.nextZ,Oe--):(Me=Ee,Ee=Ee.nextZ,pt--),Le?Le.nextZ=Me:se=Me,Me.prevZ=Le,Le=Me;be=Ee}Le.nextZ=null,bt*=2}while(We>1)}(W)}(s,h,p,y);for(var w,S,T=s;s.prev!==s.next;)if(w=s.prev,S=s.next,y?YA(s,h,p,y):$A(s))i.push(w.i/a),i.push(s.i/a),i.push(S.i/a),Ph(s),s=S.next,T=S.next;else if((s=S)===T){x?x===1?Ah(s=qA(ba(s),i,a),i,a,h,p,y,2):x===2&&JA(s,i,a,h,p,y):Ah(ba(s),i,a,h,p,y,1);break}}}function $A(s){var i=s.prev,a=s,h=s.next;if(hr(i,a,h)>=0)return!1;for(var p=s.next.next;p!==s.prev;){if(zu(i.x,i.y,a.x,a.y,h.x,h.y,p.x,p.y)&&hr(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function YA(s,i,a,h){var p=s.prev,y=s,x=s.next;if(hr(p,y,x)>=0)return!1;for(var w=p.x>y.x?p.x>x.x?p.x:x.x:y.x>x.x?y.x:x.x,S=p.y>y.y?p.y>x.y?p.y:x.y:y.y>x.y?y.y:x.y,T=g0(p.x<y.x?p.x<x.x?p.x:x.x:y.x<x.x?y.x:x.x,p.y<y.y?p.y<x.y?p.y:x.y:y.y<x.y?y.y:x.y,i,a,h),z=g0(w,S,i,a,h),R=s.prevZ,N=s.nextZ;R&&R.z>=T&&N&&N.z<=z;){if(R!==s.prev&&R!==s.next&&zu(p.x,p.y,y.x,y.y,x.x,x.y,R.x,R.y)&&hr(R.prev,R,R.next)>=0||(R=R.prevZ,N!==s.prev&&N!==s.next&&zu(p.x,p.y,y.x,y.y,x.x,x.y,N.x,N.y)&&hr(N.prev,N,N.next)>=0))return!1;N=N.nextZ}for(;R&&R.z>=T;){if(R!==s.prev&&R!==s.next&&zu(p.x,p.y,y.x,y.y,x.x,x.y,R.x,R.y)&&hr(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;N&&N.z<=z;){if(N!==s.prev&&N!==s.next&&zu(p.x,p.y,y.x,y.y,x.x,x.y,N.x,N.y)&&hr(N.prev,N,N.next)>=0)return!1;N=N.nextZ}return!0}function qA(s,i,a){var h=s;do{var p=h.prev,y=h.next.next;!Wp(p,y)&&Qx(p,h,h.next,y)&&Th(p,y)&&Th(y,p)&&(i.push(p.i/a),i.push(h.i/a),i.push(y.i/a),Ph(h),Ph(h.next),h=s=y),h=h.next}while(h!==s);return ba(h)}function JA(s,i,a,h,p,y){var x=s;do{for(var w=x.next.next;w!==x.prev;){if(x.i!==w.i&&iT(x,w)){var S=Kx(x,w);return x=ba(x,x.next),S=ba(S,S.next),Ah(x,i,a,h,p,y),void Ah(S,i,a,h,p,y)}w=w.next}x=x.next}while(x!==s)}function QA(s,i){return s.x-i.x}function KA(s,i){var a=function(y,x){var w,S=x,T=y.x,z=y.y,R=-1/0;do{if(z<=S.y&&z>=S.next.y&&S.next.y!==S.y){var N=S.x+(z-S.y)*(S.next.x-S.x)/(S.next.y-S.y);if(N<=T&&N>R){if(R=N,N===T){if(z===S.y)return S;if(z===S.next.y)return S.next}w=S.x<S.next.x?S:S.next}}S=S.next}while(S!==x);if(!w)return null;if(T===R)return w;var G,W=w,se=w.x,ae=w.y,be=1/0;S=w;do T>=S.x&&S.x>=se&&T!==S.x&&zu(z<ae?T:R,z,se,ae,z<ae?R:T,z,S.x,S.y)&&(G=Math.abs(z-S.y)/(T-S.x),Th(S,y)&&(G<be||G===be&&(S.x>w.x||S.x===w.x&&eT(w,S)))&&(w=S,be=G)),S=S.next;while(S!==W);return w}(s,i);if(!a)return i;var h=Kx(a,s),p=ba(a,a.next);return ba(h,h.next),i===a?p:i}function eT(s,i){return hr(s.prev,s,i.prev)<0&&hr(i.next,s,s.next)<0}function g0(s,i,a,h,p){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=32767*(s-a)*p)|s<<8))|s<<4))|s<<2))|s<<1))|(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-h)*p)|i<<8))|i<<4))|i<<2))|i<<1))<<1}function tT(s){var i=s,a=s;do(i.x<a.x||i.x===a.x&&i.y<a.y)&&(a=i),i=i.next;while(i!==s);return a}function zu(s,i,a,h,p,y,x,w){return(p-x)*(i-w)-(s-x)*(y-w)>=0&&(s-x)*(h-w)-(a-x)*(i-w)>=0&&(a-x)*(y-w)-(p-x)*(h-w)>=0}function iT(s,i){return s.next.i!==i.i&&s.prev.i!==i.i&&!function(a,h){var p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==h.i&&p.next.i!==h.i&&Qx(p,p.next,a,h))return!0;p=p.next}while(p!==a);return!1}(s,i)&&(Th(s,i)&&Th(i,s)&&function(a,h){var p=a,y=!1,x=(a.x+h.x)/2,w=(a.y+h.y)/2;do p.y>w!=p.next.y>w&&p.next.y!==p.y&&x<(p.next.x-p.x)*(w-p.y)/(p.next.y-p.y)+p.x&&(y=!y),p=p.next;while(p!==a);return y}(s,i)&&(hr(s.prev,s,i.prev)||hr(s,i.prev,i))||Wp(s,i)&&hr(s.prev,s,s.next)>0&&hr(i.prev,i,i.next)>0)}function hr(s,i,a){return(i.y-s.y)*(a.x-i.x)-(i.x-s.x)*(a.y-i.y)}function Wp(s,i){return s.x===i.x&&s.y===i.y}function Qx(s,i,a,h){var p=jp(hr(s,i,a)),y=jp(hr(s,i,h)),x=jp(hr(a,h,s)),w=jp(hr(a,h,i));return p!==y&&x!==w||!(p!==0||!Zp(s,a,i))||!(y!==0||!Zp(s,h,i))||!(x!==0||!Zp(a,s,h))||!(w!==0||!Zp(a,i,h))}function Zp(s,i,a){return i.x<=Math.max(s.x,a.x)&&i.x>=Math.min(s.x,a.x)&&i.y<=Math.max(s.y,a.y)&&i.y>=Math.min(s.y,a.y)}function jp(s){return s>0?1:s<0?-1:0}function Th(s,i){return hr(s.prev,s,s.next)<0?hr(s,i,s.next)>=0&&hr(s,s.prev,i)>=0:hr(s,i,s.prev)<0||hr(s,s.next,i)<0}function Kx(s,i){var a=new y0(s.i,s.x,s.y),h=new y0(i.i,i.x,i.y),p=s.next,y=i.prev;return s.next=i,i.prev=s,a.next=p,p.prev=a,h.next=a,a.prev=h,y.next=h,h.prev=y,h}function e_(s,i,a,h){var p=new y0(s,i,a);return h?(p.next=h.next,p.prev=h,h.next.prev=p,h.next=p):(p.prev=p,p.next=p),p}function Ph(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function y0(s,i,a){this.i=s,this.x=i,this.y=a,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function v0(s,i,a,h){for(var p=0,y=i,x=a-h;y<a;y+=h)p+=(s[x]-s[y])*(s[y+1]+s[x+1]),x=y;return p}m0.exports=Up,m0.exports.default=Up,Up.deviation=function(s,i,a,h){var p=i&&i.length,y=Math.abs(v0(s,0,p?i[0]*a:s.length,a));if(p)for(var x=0,w=i.length;x<w;x++)y-=Math.abs(v0(s,i[x]*a,x<w-1?i[x+1]*a:s.length,a));var S=0;for(x=0;x<h.length;x+=3){var T=h[x]*a,z=h[x+1]*a,R=h[x+2]*a;S+=Math.abs((s[T]-s[R])*(s[z+1]-s[T+1])-(s[T]-s[z])*(s[R+1]-s[T+1]))}return y===0&&S===0?0:Math.abs((S-y)/y)},Up.flatten=function(s){for(var i=s[0][0].length,a={vertices:[],holes:[],dimensions:i},h=0,p=0;p<s.length;p++){for(var y=0;y<s[p].length;y++)for(var x=0;x<i;x++)a.vertices.push(s[p][y][x]);p>0&&a.holes.push(h+=s[p-1].length)}return a};var t_=m0.exports;function rT(s,i,a,h,p){i_(s,i,a||0,h||s.length-1,p||nT)}function i_(s,i,a,h,p){for(;h>a;){if(h-a>600){var y=h-a+1,x=i-a+1,w=Math.log(y),S=.5*Math.exp(2*w/3),T=.5*Math.sqrt(w*S*(y-S)/y)*(x-y/2<0?-1:1);i_(s,i,Math.max(a,Math.floor(i-x*S/y+T)),Math.min(h,Math.floor(i+(y-x)*S/y+T)),p)}var z=s[i],R=a,N=h;for(kh(s,a,i),p(s[h],z)>0&&kh(s,a,h);R<N;){for(kh(s,R,N),R++,N--;p(s[R],z)<0;)R++;for(;p(s[N],z)>0;)N--}p(s[a],z)===0?kh(s,a,N):kh(s,++N,h),N<=i&&(a=N+1),i<=N&&(h=N-1)}}function kh(s,i,a){var h=s[i];s[i]=s[a],s[a]=h}function nT(s,i){return s<i?-1:s>i?1:0}function x0(s,i){let a=s.length;if(a<=1)return[s];let h=[],p,y;for(let x=0;x<a;x++){let w=Ce(s[x]);w!==0&&(s[x].area=Math.abs(w),y===void 0&&(y=w<0),y===w<0?(p&&h.push(p),p=[s[x]]):p.push(s[x]))}if(p&&h.push(p),i>1)for(let x=0;x<h.length;x++)h[x].length<=i||(rT(h[x],i,1,h[x].length-1,oT),h[x]=h[x].slice(0,i));return h}function oT(s,i){return i.area-s.area}function _0(s,i,a){let h=a.patternDependencies,p=!1;for(let y of i){let x=y.paint.get(`${s}-pattern`);x.isConstant()||(p=!0);let w=x.constantOr(null);w&&(p=!0,h[w.to]=!0,h[w.from]=!0)}return p}function b0(s,i,a,h,p){let y=p.patternDependencies;for(let x of i){let w=x.paint.get(`${s}-pattern`).value;if(w.kind!=="constant"){let S=w.evaluate({zoom:h-1},a,{},p.availableImages),T=w.evaluate({zoom:h},a,{},p.availableImages),z=w.evaluate({zoom:h+1},a,{},p.availableImages);S=S&&S.name?S.name:S,T=T&&T.name?T.name:T,z=z&&z.name?z.name:z,y[S]=!0,y[T]=!0,y[z]=!0,a.patterns[x.id]={min:S,mid:T,max:z}}}return a}class w0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(a=>a.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new qt,this.indexArray=new mn,this.indexArray2=new _o,this.programConfigurations=new xl(i.layers,i.zoom),this.segments=new li,this.segments2=new li,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(i,a,h){this.hasPattern=_0("fill",this.layers,a);let p=this.layers[0].layout.get("fill-sort-key"),y=!p.isConstant(),x=[];for(let{feature:w,id:S,index:T,sourceLayerIndex:z}of i){let R=this.layers[0]._featureFilter.needGeometry,N=bl(w,R);if(!this.layers[0]._featureFilter.filter(new Vi(this.zoom),N,h))continue;let G=y?p.evaluate(N,{},h,a.availableImages):void 0,W={id:S,properties:w.properties,type:w.type,sourceLayerIndex:z,index:T,geometry:R?N.geometry:_l(w),patterns:{},sortKey:G};x.push(W)}y&&x.sort((w,S)=>w.sortKey-S.sortKey);for(let w of x){let{geometry:S,index:T,sourceLayerIndex:z}=w;if(this.hasPattern){let R=b0("fill",this.layers,w,this.zoom,a);this.patternFeatures.push(R)}else this.addFeature(w,S,T,h,{});a.featureIndex.insert(i[T].feature,S,T,z,this.index)}}update(i,a,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,a,this.stateDependentLayers,h)}addFeatures(i,a,h){for(let p of this.patternFeatures)this.addFeature(p,p.geometry,p.index,a,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,XA),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.indexBuffer2=i.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(i),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(i,a,h,p,y){for(let x of x0(a,500)){let w=0;for(let G of x)w+=G.length;let S=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),T=S.vertexLength,z=[],R=[];for(let G of x){if(G.length===0)continue;G!==x[0]&&R.push(z.length/2);let W=this.segments2.prepareSegment(G.length,this.layoutVertexArray,this.indexArray2),se=W.vertexLength;this.layoutVertexArray.emplaceBack(G[0].x,G[0].y),this.indexArray2.emplaceBack(se+G.length-1,se),z.push(G[0].x),z.push(G[0].y);for(let ae=1;ae<G.length;ae++)this.layoutVertexArray.emplaceBack(G[ae].x,G[ae].y),this.indexArray2.emplaceBack(se+ae-1,se+ae),z.push(G[ae].x),z.push(G[ae].y);W.vertexLength+=G.length,W.primitiveLength+=G.length}let N=t_(z,R);for(let G=0;G<N.length;G+=3)this.indexArray.emplaceBack(T+N[G],T+N[G+1],T+N[G+2]);S.vertexLength+=w,S.primitiveLength+=N.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,y,p)}}dt("FillBucket",w0,{omit:["layers","patternFeatures"]});let sT=new Er({"fill-sort-key":new Mt(ye.layout_fill["fill-sort-key"])});var aT={paint:new Er({"fill-antialias":new vt(ye.paint_fill["fill-antialias"]),"fill-opacity":new Mt(ye.paint_fill["fill-opacity"]),"fill-color":new Mt(ye.paint_fill["fill-color"]),"fill-outline-color":new Mt(ye.paint_fill["fill-outline-color"]),"fill-translate":new vt(ye.paint_fill["fill-translate"]),"fill-translate-anchor":new vt(ye.paint_fill["fill-translate-anchor"]),"fill-pattern":new ml(ye.paint_fill["fill-pattern"])}),layout:sT};let lT=Ar([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),{members:uT}=lT;var wa={},cT=at,r_=Lu;function Lu(s,i,a,h,p){this.properties={},this.extent=a,this.type=0,this._pbf=s,this._geometry=-1,this._keys=h,this._values=p,s.readFields(hT,this,i)}function hT(s,i,a){s==1?i.id=a.readVarint():s==2?function(h,p){for(var y=h.readVarint()+h.pos;h.pos<y;){var x=p._keys[h.readVarint()],w=p._values[h.readVarint()];p.properties[x]=w}}(a,i):s==3?i.type=a.readVarint():s==4&&(i._geometry=a.pos)}function dT(s){for(var i,a,h=0,p=0,y=s.length,x=y-1;p<y;x=p++)h+=((a=s[x]).x-(i=s[p]).x)*(i.y+a.y);return h}Lu.types=["Unknown","Point","LineString","Polygon"],Lu.prototype.loadGeometry=function(){var s=this._pbf;s.pos=this._geometry;for(var i,a=s.readVarint()+s.pos,h=1,p=0,y=0,x=0,w=[];s.pos<a;){if(p<=0){var S=s.readVarint();h=7&S,p=S>>3}if(p--,h===1||h===2)y+=s.readSVarint(),x+=s.readSVarint(),h===1&&(i&&w.push(i),i=[]),i.push(new cT(y,x));else{if(h!==7)throw new Error("unknown command "+h);i&&i.push(i[0].clone())}}return i&&w.push(i),w},Lu.prototype.bbox=function(){var s=this._pbf;s.pos=this._geometry;for(var i=s.readVarint()+s.pos,a=1,h=0,p=0,y=0,x=1/0,w=-1/0,S=1/0,T=-1/0;s.pos<i;){if(h<=0){var z=s.readVarint();a=7&z,h=z>>3}if(h--,a===1||a===2)(p+=s.readSVarint())<x&&(x=p),p>w&&(w=p),(y+=s.readSVarint())<S&&(S=y),y>T&&(T=y);else if(a!==7)throw new Error("unknown command "+a)}return[x,S,w,T]},Lu.prototype.toGeoJSON=function(s,i,a){var h,p,y=this.extent*Math.pow(2,a),x=this.extent*s,w=this.extent*i,S=this.loadGeometry(),T=Lu.types[this.type];function z(G){for(var W=0;W<G.length;W++){var se=G[W];G[W]=[360*(se.x+x)/y-180,360/Math.PI*Math.atan(Math.exp((180-360*(se.y+w)/y)*Math.PI/180))-90]}}switch(this.type){case 1:var R=[];for(h=0;h<S.length;h++)R[h]=S[h][0];z(S=R);break;case 2:for(h=0;h<S.length;h++)z(S[h]);break;case 3:for(S=function(G){var W=G.length;if(W<=1)return[G];for(var se,ae,be=[],Ee=0;Ee<W;Ee++){var Me=dT(G[Ee]);Me!==0&&(ae===void 0&&(ae=Me<0),ae===Me<0?(se&&be.push(se),se=[G[Ee]]):se.push(G[Ee]))}return se&&be.push(se),be}(S),h=0;h<S.length;h++)for(p=0;p<S[h].length;p++)z(S[h][p])}S.length===1?S=S[0]:T="Multi"+T;var N={type:"Feature",geometry:{type:T,coordinates:S},properties:this.properties};return"id"in this&&(N.id=this.id),N};var pT=r_,n_=o_;function o_(s,i){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=s,this._keys=[],this._values=[],this._features=[],s.readFields(fT,this,i),this.length=this._features.length}function fT(s,i,a){s===15?i.version=a.readVarint():s===1?i.name=a.readString():s===5?i.extent=a.readVarint():s===2?i._features.push(a.pos):s===3?i._keys.push(a.readString()):s===4&&i._values.push(function(h){for(var p=null,y=h.readVarint()+h.pos;h.pos<y;){var x=h.readVarint()>>3;p=x===1?h.readString():x===2?h.readFloat():x===3?h.readDouble():x===4?h.readVarint64():x===5?h.readVarint():x===6?h.readSVarint():x===7?h.readBoolean():null}return p}(a))}o_.prototype.feature=function(s){if(s<0||s>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[s];var i=this._pbf.readVarint()+this._pbf.pos;return new pT(this._pbf,i,this.extent,this._keys,this._values)};var mT=n_;function gT(s,i,a){if(s===3){var h=new mT(a,a.readVarint()+a.pos);h.length&&(i[h.name]=h)}}wa.VectorTile=function(s,i){this.layers=s.readFields(gT,{},i)},wa.VectorTileFeature=r_,wa.VectorTileLayer=n_;let yT=wa.VectorTileFeature.types,I0=Math.pow(2,13);function zh(s,i,a,h,p,y,x,w){s.emplaceBack(i,a,2*Math.floor(h*I0)+x,p*I0*2,y*I0*2,Math.round(w))}class S0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(a=>a.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new Qi,this.indexArray=new mn,this.programConfigurations=new xl(i.layers,i.zoom),this.segments=new li,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(i,a,h){this.features=[],this.hasPattern=_0("fill-extrusion",this.layers,a);for(let{feature:p,id:y,index:x,sourceLayerIndex:w}of i){let S=this.layers[0]._featureFilter.needGeometry,T=bl(p,S);if(!this.layers[0]._featureFilter.filter(new Vi(this.zoom),T,h))continue;let z={id:y,sourceLayerIndex:w,index:x,geometry:S?T.geometry:_l(p),properties:p.properties,type:p.type,patterns:{}};this.hasPattern?this.features.push(b0("fill-extrusion",this.layers,z,this.zoom,a)):this.addFeature(z,z.geometry,x,h,{}),a.featureIndex.insert(p,z.geometry,x,w,this.index,!0)}}addFeatures(i,a,h){for(let p of this.features){let{geometry:y}=p;this.addFeature(p,y,p.index,a,h)}}update(i,a,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,a,this.stateDependentLayers,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,uT),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(i,a,h,p,y){for(let x of x0(a,500)){let w=0;for(let G of x)w+=G.length;let S=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let G of x){if(G.length===0||xT(G))continue;let W=0;for(let se=0;se<G.length;se++){let ae=G[se];if(se>=1){let be=G[se-1];if(!vT(ae,be)){S.vertexLength+4>li.MAX_VERTEX_ARRAY_LENGTH&&(S=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let Ee=ae.sub(be)._perp()._unit(),Me=be.dist(ae);W+Me>32768&&(W=0),zh(this.layoutVertexArray,ae.x,ae.y,Ee.x,Ee.y,0,0,W),zh(this.layoutVertexArray,ae.x,ae.y,Ee.x,Ee.y,0,1,W),W+=Me,zh(this.layoutVertexArray,be.x,be.y,Ee.x,Ee.y,0,0,W),zh(this.layoutVertexArray,be.x,be.y,Ee.x,Ee.y,0,1,W);let Le=S.vertexLength;this.indexArray.emplaceBack(Le,Le+2,Le+1),this.indexArray.emplaceBack(Le+1,Le+2,Le+3),S.vertexLength+=4,S.primitiveLength+=2}}}}if(S.vertexLength+w>li.MAX_VERTEX_ARRAY_LENGTH&&(S=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray)),yT[i.type]!=="Polygon")continue;let T=[],z=[],R=S.vertexLength;for(let G of x)if(G.length!==0){G!==x[0]&&z.push(T.length/2);for(let W=0;W<G.length;W++){let se=G[W];zh(this.layoutVertexArray,se.x,se.y,0,0,1,1,0),T.push(se.x),T.push(se.y)}}let N=t_(T,z);for(let G=0;G<N.length;G+=3)this.indexArray.emplaceBack(R+N[G],R+N[G+2],R+N[G+1]);S.primitiveLength+=N.length/3,S.vertexLength+=w}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,y,p)}}function vT(s,i){return s.x===i.x&&(s.x<0||s.x>Tr)||s.y===i.y&&(s.y<0||s.y>Tr)}function xT(s){return s.every(i=>i.x<0)||s.every(i=>i.x>Tr)||s.every(i=>i.y<0)||s.every(i=>i.y>Tr)}dt("FillExtrusionBucket",S0,{omit:["layers","features"]});var _T={paint:new Er({"fill-extrusion-opacity":new vt(ye["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Mt(ye["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new vt(ye["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new vt(ye["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ml(ye["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Mt(ye["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Mt(ye["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new vt(ye["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Lh(s,i){return s.x*i.x+s.y*i.y}function s_(s,i){if(s.length===1){let a=0,h=i[a++],p;for(;!p||h.equals(p);)if(p=i[a++],!p)return 1/0;for(;a<i.length;a++){let y=i[a],x=s[0],w=p.sub(h),S=y.sub(h),T=x.sub(h),z=Lh(w,w),R=Lh(w,S),N=Lh(S,S),G=Lh(T,w),W=Lh(T,S),se=z*N-R*R,ae=(N*G-R*W)/se,be=(z*W-R*G)/se,Ee=h.z*(1-ae-be)+p.z*ae+y.z*be;if(isFinite(Ee))return Ee}return 1/0}{let a=1/0;for(let h of i)a=Math.min(a,h.z);return a}}let bT=Ar([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:wT}=bT,IT=Ar([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:ST}=IT,CT=wa.VectorTileFeature.types,MT=Math.cos(Math.PI/180*37.5),a_=Math.pow(2,14)/.5;class C0{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(a=>a.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(a=>{this.gradients[a.id]={}}),this.layoutVertexArray=new zt,this.layoutVertexArray2=new ai,this.indexArray=new mn,this.programConfigurations=new xl(i.layers,i.zoom),this.segments=new li,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(a=>a.isStateDependent()).map(a=>a.id)}populate(i,a,h){this.hasPattern=_0("line",this.layers,a);let p=this.layers[0].layout.get("line-sort-key"),y=!p.isConstant(),x=[];for(let{feature:w,id:S,index:T,sourceLayerIndex:z}of i){let R=this.layers[0]._featureFilter.needGeometry,N=bl(w,R);if(!this.layers[0]._featureFilter.filter(new Vi(this.zoom),N,h))continue;let G=y?p.evaluate(N,{},h):void 0,W={id:S,properties:w.properties,type:w.type,sourceLayerIndex:z,index:T,geometry:R?N.geometry:_l(w),patterns:{},sortKey:G};x.push(W)}y&&x.sort((w,S)=>w.sortKey-S.sortKey);for(let w of x){let{geometry:S,index:T,sourceLayerIndex:z}=w;if(this.hasPattern){let R=b0("line",this.layers,w,this.zoom,a);this.patternFeatures.push(R)}else this.addFeature(w,S,T,h,{});a.featureIndex.insert(i[T].feature,S,T,z,this.index)}}update(i,a,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,a,this.stateDependentLayers,h)}addFeatures(i,a,h){for(let p of this.patternFeatures)this.addFeature(p,p.geometry,p.index,a,h)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=i.createVertexBuffer(this.layoutVertexArray2,ST)),this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,wT),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(i){if(i.properties&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_end"))return{start:+i.properties.mapbox_clip_start,end:+i.properties.mapbox_clip_end}}addFeature(i,a,h,p,y){let x=this.layers[0].layout,w=x.get("line-join").evaluate(i,{}),S=x.get("line-cap"),T=x.get("line-miter-limit"),z=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(i);for(let R of a)this.addLine(R,i,w,S,T,z);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,h,y,p)}addLine(i,a,h,p,y,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let be=0;be<i.length-1;be++)this.totalDistance+=i[be].dist(i[be+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let w=CT[a.type]==="Polygon",S=i.length;for(;S>=2&&i[S-1].equals(i[S-2]);)S--;let T=0;for(;T<S-1&&i[T].equals(i[T+1]);)T++;if(S<(w?3:2))return;h==="bevel"&&(y=1.05);let z=this.overscaling<=16?122880/(512*this.overscaling):0,R=this.segments.prepareSegment(10*S,this.layoutVertexArray,this.indexArray),N,G,W,se,ae;this.e1=this.e2=-1,w&&(N=i[S-2],ae=i[T].sub(N)._unit()._perp());for(let be=T;be<S;be++){if(W=be===S-1?w?i[T+1]:void 0:i[be+1],W&&i[be].equals(W))continue;ae&&(se=ae),N&&(G=N),N=i[be],ae=W?W.sub(N)._unit()._perp():se,se=se||ae;let Ee=se.add(ae);Ee.x===0&&Ee.y===0||Ee._unit();let Me=se.x*ae.x+se.y*ae.y,Le=Ee.x*ae.x+Ee.y*ae.y,We=Le!==0?1/Le:1/0,Oe=2*Math.sqrt(2-2*Le),pt=Le<MT&&G&&W,bt=se.x*ae.y-se.y*ae.x>0;if(pt&&be>T){let tt=N.dist(G);if(tt>2*z){let ct=N.sub(N.sub(G)._mult(z/tt)._round());this.updateDistance(G,ct),this.addCurrentVertex(ct,se,0,0,R),G=ct}}let nt=G&&W,ot=nt?h:w?"butt":p;if(nt&&ot==="round"&&(We<x?ot="miter":We<=2&&(ot="fakeround")),ot==="miter"&&We>y&&(ot="bevel"),ot==="bevel"&&(We>2&&(ot="flipbevel"),We<y&&(ot="miter")),G&&this.updateDistance(G,N),ot==="miter")Ee._mult(We),this.addCurrentVertex(N,Ee,0,0,R);else if(ot==="flipbevel"){if(We>100)Ee=ae.mult(-1);else{let tt=We*se.add(ae).mag()/se.sub(ae).mag();Ee._perp()._mult(tt*(bt?-1:1))}this.addCurrentVertex(N,Ee,0,0,R),this.addCurrentVertex(N,Ee.mult(-1),0,0,R)}else if(ot==="bevel"||ot==="fakeround"){let tt=-Math.sqrt(We*We-1),ct=bt?tt:0,st=bt?0:tt;if(G&&this.addCurrentVertex(N,se,ct,st,R),ot==="fakeround"){let Ye=Math.round(180*Oe/Math.PI/20);for(let Et=1;Et<Ye;Et++){let wt=Et/Ye;if(wt!==.5){let vi=wt-.5;wt+=wt*vi*(wt-1)*((1.0904+Me*(Me*(3.55645-1.43519*Me)-3.2452))*vi*vi+(.848013+Me*(.215638*Me-1.06021)))}let Jt=ae.sub(se)._mult(wt)._add(se)._unit()._mult(bt?-1:1);this.addHalfVertex(N,Jt.x,Jt.y,!1,bt,0,R)}}W&&this.addCurrentVertex(N,ae,-ct,-st,R)}else if(ot==="butt")this.addCurrentVertex(N,Ee,0,0,R);else if(ot==="square"){let tt=G?1:-1;this.addCurrentVertex(N,Ee,tt,tt,R)}else ot==="round"&&(G&&(this.addCurrentVertex(N,se,0,0,R),this.addCurrentVertex(N,se,1,1,R,!0)),W&&(this.addCurrentVertex(N,ae,-1,-1,R,!0),this.addCurrentVertex(N,ae,0,0,R)));if(pt&&be<S-1){let tt=N.dist(W);if(tt>2*z){let ct=N.add(W.sub(N)._mult(z/tt)._round());this.updateDistance(N,ct),this.addCurrentVertex(ct,ae,0,0,R),N=ct}}}}addCurrentVertex(i,a,h,p,y,x=!1){let w=a.y*p-a.x,S=-a.y-a.x*p;this.addHalfVertex(i,a.x+a.y*h,a.y-a.x*h,x,!1,h,y),this.addHalfVertex(i,w,S,x,!0,-p,y),this.distance>a_/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(i,a,h,p,y,x))}addHalfVertex({x:i,y:a},h,p,y,x,w,S){let T=.5*(this.lineClips?this.scaledDistance*(a_-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((i<<1)+(y?1:0),(a<<1)+(x?1:0),Math.round(63*h)+128,Math.round(63*p)+128,1+(w===0?0:w<0?-1:1)|(63&T)<<2,T>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let z=S.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,z),S.primitiveLength++),x?this.e2=z:this.e1=z}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(i,a){this.distance+=i.dist(a),this.updateScaledDistance()}}dt("LineBucket",C0,{omit:["layers","patternFeatures"]});let ET=new Er({"line-cap":new vt(ye.layout_line["line-cap"]),"line-join":new Mt(ye.layout_line["line-join"]),"line-miter-limit":new vt(ye.layout_line["line-miter-limit"]),"line-round-limit":new vt(ye.layout_line["line-round-limit"]),"line-sort-key":new Mt(ye.layout_line["line-sort-key"])});var l_={paint:new Er({"line-opacity":new Mt(ye.paint_line["line-opacity"]),"line-color":new Mt(ye.paint_line["line-color"]),"line-translate":new vt(ye.paint_line["line-translate"]),"line-translate-anchor":new vt(ye.paint_line["line-translate-anchor"]),"line-width":new Mt(ye.paint_line["line-width"]),"line-gap-width":new Mt(ye.paint_line["line-gap-width"]),"line-offset":new Mt(ye.paint_line["line-offset"]),"line-blur":new Mt(ye.paint_line["line-blur"]),"line-dasharray":new gl(ye.paint_line["line-dasharray"]),"line-pattern":new ml(ye.paint_line["line-pattern"]),"line-gradient":new wh(ye.paint_line["line-gradient"])}),layout:ET};let u_=new class extends Mt{possiblyEvaluate(s,i){return i=new Vi(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(s,i)}evaluate(s,i,a,h){return i=Z({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(s,i,a,h)}}(l_.paint.properties["line-width"].specification);function c_(s,i){return i>0?i+2*s:s}u_.useIntegerZoom=!0;let AT=Ar([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),TT=Ar([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ar([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let PT=Ar([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Ar([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let h_=Ar([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kT=Ar([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function zT(s,i,a){return s.sections.forEach(h=>{h.text=function(p,y,x){let w=y.layout.get("text-transform").evaluate(x,{});return w==="uppercase"?p=p.toLocaleUpperCase():w==="lowercase"&&(p=p.toLocaleLowerCase()),Zn.applyArabicShaping&&(p=Zn.applyArabicShaping(p)),p}(h.text,i,a)}),s}Ar([{name:"triangle",components:3,type:"Uint16"}]),Ar([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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"}]),Ar([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ar([{type:"Float32",name:"offsetX"}]),Ar([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);let Rh={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};var Or=24,M0=Ci,d_=function(s,i,a,h,p){var y,x,w=8*p-h-1,S=(1<<w)-1,T=S>>1,z=-7,R=a?p-1:0,N=a?-1:1,G=s[i+R];for(R+=N,y=G&(1<<-z)-1,G>>=-z,z+=w;z>0;y=256*y+s[i+R],R+=N,z-=8);for(x=y&(1<<-z)-1,y>>=-z,z+=h;z>0;x=256*x+s[i+R],R+=N,z-=8);if(y===0)y=1-T;else{if(y===S)return x?NaN:1/0*(G?-1:1);x+=Math.pow(2,h),y-=T}return(G?-1:1)*x*Math.pow(2,y-h)},p_=function(s,i,a,h,p,y){var x,w,S,T=8*y-p-1,z=(1<<T)-1,R=z>>1,N=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=h?0:y-1,W=h?1:-1,se=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(w=isNaN(i)?1:0,x=z):(x=Math.floor(Math.log(i)/Math.LN2),i*(S=Math.pow(2,-x))<1&&(x--,S*=2),(i+=x+R>=1?N/S:N*Math.pow(2,1-R))*S>=2&&(x++,S/=2),x+R>=z?(w=0,x=z):x+R>=1?(w=(i*S-1)*Math.pow(2,p),x+=R):(w=i*Math.pow(2,R-1)*Math.pow(2,p),x=0));p>=8;s[a+G]=255&w,G+=W,w/=256,p-=8);for(x=x<<p|w,T+=p;T>0;s[a+G]=255&x,G+=W,x/=256,T-=8);s[a+G-W]|=128*se};function Ci(s){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(s)?s:new Uint8Array(s||0),this.pos=0,this.type=0,this.length=this.buf.length}Ci.Varint=0,Ci.Fixed64=1,Ci.Bytes=2,Ci.Fixed32=5;var Ia,E0=4294967296,f_=1/E0,m_=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ks(s){return s.type===Ci.Bytes?s.readVarint()+s.pos:s.pos+1}function Ru(s,i,a){return a?4294967296*i+(s>>>0):4294967296*(i>>>0)+(s>>>0)}function g_(s,i,a){var h=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));a.realloc(h);for(var p=a.pos-1;p>=s;p--)a.buf[p+h]=a.buf[p]}function LT(s,i){for(var a=0;a<s.length;a++)i.writeVarint(s[a])}function RT(s,i){for(var a=0;a<s.length;a++)i.writeSVarint(s[a])}function DT(s,i){for(var a=0;a<s.length;a++)i.writeFloat(s[a])}function BT(s,i){for(var a=0;a<s.length;a++)i.writeDouble(s[a])}function NT(s,i){for(var a=0;a<s.length;a++)i.writeBoolean(s[a])}function FT(s,i){for(var a=0;a<s.length;a++)i.writeFixed32(s[a])}function OT(s,i){for(var a=0;a<s.length;a++)i.writeSFixed32(s[a])}function GT(s,i){for(var a=0;a<s.length;a++)i.writeFixed64(s[a])}function VT(s,i){for(var a=0;a<s.length;a++)i.writeSFixed64(s[a])}function Hp(s,i){return(s[i]|s[i+1]<<8|s[i+2]<<16)+16777216*s[i+3]}function Du(s,i,a){s[a]=i,s[a+1]=i>>>8,s[a+2]=i>>>16,s[a+3]=i>>>24}function y_(s,i){return(s[i]|s[i+1]<<8|s[i+2]<<16)+(s[i+3]<<24)}function UT(s,i,a){s===1&&a.readMessage(WT,i)}function WT(s,i,a){if(s===3){let{id:h,bitmap:p,width:y,height:x,left:w,top:S,advance:T}=a.readMessage(ZT,{});i.push({id:h,bitmap:new Eh({width:y+6,height:x+6},p),metrics:{width:y,height:x,left:w,top:S,advance:T}})}}function ZT(s,i,a){s===1?i.id=a.readVarint():s===2?i.bitmap=a.readBytes():s===3?i.width=a.readVarint():s===4?i.height=a.readVarint():s===5?i.left=a.readSVarint():s===6?i.top=a.readSVarint():s===7&&(i.advance=a.readVarint())}function v_(s){let i=0,a=0;for(let x of s)i+=x.w*x.h,a=Math.max(a,x.w);s.sort((x,w)=>w.h-x.h);let h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(i/.95)),a),h:1/0}],p=0,y=0;for(let x of s)for(let w=h.length-1;w>=0;w--){let S=h[w];if(!(x.w>S.w||x.h>S.h)){if(x.x=S.x,x.y=S.y,y=Math.max(y,x.y+x.h),p=Math.max(p,x.x+x.w),x.w===S.w&&x.h===S.h){let T=h.pop();w<h.length&&(h[w]=T)}else x.h===S.h?(S.x+=x.w,S.w-=x.w):x.w===S.w?(S.y+=x.h,S.h-=x.h):(h.push({x:S.x+x.w,y:S.y,w:S.w-x.w,h:x.h}),S.y+=x.h,S.h-=x.h);break}}return{w:p,h:y,fill:i/(p*y)||0}}Ci.prototype={destroy:function(){this.buf=null},readFields:function(s,i,a){for(a=a||this.length;this.pos<a;){var h=this.readVarint(),p=h>>3,y=this.pos;this.type=7&h,s(p,i,this),this.pos===y&&this.skip(h)}return i},readMessage:function(s,i){return this.readFields(s,i,this.readVarint()+this.pos)},readFixed32:function(){var s=Hp(this.buf,this.pos);return this.pos+=4,s},readSFixed32:function(){var s=y_(this.buf,this.pos);return this.pos+=4,s},readFixed64:function(){var s=Hp(this.buf,this.pos)+Hp(this.buf,this.pos+4)*E0;return this.pos+=8,s},readSFixed64:function(){var s=Hp(this.buf,this.pos)+y_(this.buf,this.pos+4)*E0;return this.pos+=8,s},readFloat:function(){var s=d_(this.buf,this.pos,!0,23,4);return this.pos+=4,s},readDouble:function(){var s=d_(this.buf,this.pos,!0,52,8);return this.pos+=8,s},readVarint:function(s){var i,a,h=this.buf;return i=127&(a=h[this.pos++]),a<128?i:(i|=(127&(a=h[this.pos++]))<<7,a<128?i:(i|=(127&(a=h[this.pos++]))<<14,a<128?i:(i|=(127&(a=h[this.pos++]))<<21,a<128?i:function(p,y,x){var w,S,T=x.buf;if(w=(112&(S=T[x.pos++]))>>4,S<128||(w|=(127&(S=T[x.pos++]))<<3,S<128)||(w|=(127&(S=T[x.pos++]))<<10,S<128)||(w|=(127&(S=T[x.pos++]))<<17,S<128)||(w|=(127&(S=T[x.pos++]))<<24,S<128)||(w|=(1&(S=T[x.pos++]))<<31,S<128))return Ru(p,w,y);throw new Error("Expected varint not more than 10 bytes")}(i|=(15&(a=h[this.pos]))<<28,s,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var s=this.readVarint();return s%2==1?(s+1)/-2:s/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var s=this.readVarint()+this.pos,i=this.pos;return this.pos=s,s-i>=12&&m_?function(a,h,p){return m_.decode(a.subarray(h,p))}(this.buf,i,s):function(a,h,p){for(var y="",x=h;x<p;){var w,S,T,z=a[x],R=null,N=z>239?4:z>223?3:z>191?2:1;if(x+N>p)break;N===1?z<128&&(R=z):N===2?(192&(w=a[x+1]))==128&&(R=(31&z)<<6|63&w)<=127&&(R=null):N===3?(S=a[x+2],(192&(w=a[x+1]))==128&&(192&S)==128&&((R=(15&z)<<12|(63&w)<<6|63&S)<=2047||R>=55296&&R<=57343)&&(R=null)):N===4&&(S=a[x+2],T=a[x+3],(192&(w=a[x+1]))==128&&(192&S)==128&&(192&T)==128&&((R=(15&z)<<18|(63&w)<<12|(63&S)<<6|63&T)<=65535||R>=1114112)&&(R=null)),R===null?(R=65533,N=1):R>65535&&(R-=65536,y+=String.fromCharCode(R>>>10&1023|55296),R=56320|1023&R),y+=String.fromCharCode(R),x+=N}return y}(this.buf,i,s)},readBytes:function(){var s=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,s);return this.pos=s,i},readPackedVarint:function(s,i){if(this.type!==Ci.Bytes)return s.push(this.readVarint(i));var a=ks(this);for(s=s||[];this.pos<a;)s.push(this.readVarint(i));return s},readPackedSVarint:function(s){if(this.type!==Ci.Bytes)return s.push(this.readSVarint());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readSVarint());return s},readPackedBoolean:function(s){if(this.type!==Ci.Bytes)return s.push(this.readBoolean());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readBoolean());return s},readPackedFloat:function(s){if(this.type!==Ci.Bytes)return s.push(this.readFloat());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readFloat());return s},readPackedDouble:function(s){if(this.type!==Ci.Bytes)return s.push(this.readDouble());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readDouble());return s},readPackedFixed32:function(s){if(this.type!==Ci.Bytes)return s.push(this.readFixed32());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readFixed32());return s},readPackedSFixed32:function(s){if(this.type!==Ci.Bytes)return s.push(this.readSFixed32());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readSFixed32());return s},readPackedFixed64:function(s){if(this.type!==Ci.Bytes)return s.push(this.readFixed64());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readFixed64());return s},readPackedSFixed64:function(s){if(this.type!==Ci.Bytes)return s.push(this.readSFixed64());var i=ks(this);for(s=s||[];this.pos<i;)s.push(this.readSFixed64());return s},skip:function(s){var i=7&s;if(i===Ci.Varint)for(;this.buf[this.pos++]>127;);else if(i===Ci.Bytes)this.pos=this.readVarint()+this.pos;else if(i===Ci.Fixed32)this.pos+=4;else{if(i!==Ci.Fixed64)throw new Error("Unimplemented type: "+i);this.pos+=8}},writeTag:function(s,i){this.writeVarint(s<<3|i)},realloc:function(s){for(var i=this.length||16;i<this.pos+s;)i*=2;if(i!==this.length){var a=new Uint8Array(i);a.set(this.buf),this.buf=a,this.length=i}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(s){this.realloc(4),Du(this.buf,s,this.pos),this.pos+=4},writeSFixed32:function(s){this.realloc(4),Du(this.buf,s,this.pos),this.pos+=4},writeFixed64:function(s){this.realloc(8),Du(this.buf,-1&s,this.pos),Du(this.buf,Math.floor(s*f_),this.pos+4),this.pos+=8},writeSFixed64:function(s){this.realloc(8),Du(this.buf,-1&s,this.pos),Du(this.buf,Math.floor(s*f_),this.pos+4),this.pos+=8},writeVarint:function(s){(s=+s||0)>268435455||s<0?function(i,a){var h,p;if(i>=0?(h=i%4294967296|0,p=i/4294967296|0):(p=~(-i/4294967296),4294967295^(h=~(-i%4294967296))?h=h+1|0:(h=0,p=p+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");a.realloc(10),function(y,x,w){w.buf[w.pos++]=127&y|128,y>>>=7,w.buf[w.pos++]=127&y|128,y>>>=7,w.buf[w.pos++]=127&y|128,y>>>=7,w.buf[w.pos++]=127&y|128,w.buf[w.pos]=127&(y>>>=7)}(h,0,a),function(y,x){var w=(7&y)<<4;x.buf[x.pos++]|=w|((y>>>=3)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y)))))}(p,a)}(s,this):(this.realloc(4),this.buf[this.pos++]=127&s|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=s>>>7&127))))},writeSVarint:function(s){this.writeVarint(s<0?2*-s-1:2*s)},writeBoolean:function(s){this.writeVarint(Boolean(s))},writeString:function(s){s=String(s),this.realloc(4*s.length),this.pos++;var i=this.pos;this.pos=function(h,p,y){for(var x,w,S=0;S<p.length;S++){if((x=p.charCodeAt(S))>55295&&x<57344){if(!w){x>56319||S+1===p.length?(h[y++]=239,h[y++]=191,h[y++]=189):w=x;continue}if(x<56320){h[y++]=239,h[y++]=191,h[y++]=189,w=x;continue}x=w-55296<<10|x-56320|65536,w=null}else w&&(h[y++]=239,h[y++]=191,h[y++]=189,w=null);x<128?h[y++]=x:(x<2048?h[y++]=x>>6|192:(x<65536?h[y++]=x>>12|224:(h[y++]=x>>18|240,h[y++]=x>>12&63|128),h[y++]=x>>6&63|128),h[y++]=63&x|128)}return y}(this.buf,s,this.pos);var a=this.pos-i;a>=128&&g_(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeFloat:function(s){this.realloc(4),p_(this.buf,s,this.pos,!0,23,4),this.pos+=4},writeDouble:function(s){this.realloc(8),p_(this.buf,s,this.pos,!0,52,8),this.pos+=8},writeBytes:function(s){var i=s.length;this.writeVarint(i),this.realloc(i);for(var a=0;a<i;a++)this.buf[this.pos++]=s[a]},writeRawMessage:function(s,i){this.pos++;var a=this.pos;s(i,this);var h=this.pos-a;h>=128&&g_(a,h,this),this.pos=a-1,this.writeVarint(h),this.pos+=h},writeMessage:function(s,i,a){this.writeTag(s,Ci.Bytes),this.writeRawMessage(i,a)},writePackedVarint:function(s,i){i.length&&this.writeMessage(s,LT,i)},writePackedSVarint:function(s,i){i.length&&this.writeMessage(s,RT,i)},writePackedBoolean:function(s,i){i.length&&this.writeMessage(s,NT,i)},writePackedFloat:function(s,i){i.length&&this.writeMessage(s,DT,i)},writePackedDouble:function(s,i){i.length&&this.writeMessage(s,BT,i)},writePackedFixed32:function(s,i){i.length&&this.writeMessage(s,FT,i)},writePackedSFixed32:function(s,i){i.length&&this.writeMessage(s,OT,i)},writePackedFixed64:function(s,i){i.length&&this.writeMessage(s,GT,i)},writePackedSFixed64:function(s,i){i.length&&this.writeMessage(s,VT,i)},writeBytesField:function(s,i){this.writeTag(s,Ci.Bytes),this.writeBytes(i)},writeFixed32Field:function(s,i){this.writeTag(s,Ci.Fixed32),this.writeFixed32(i)},writeSFixed32Field:function(s,i){this.writeTag(s,Ci.Fixed32),this.writeSFixed32(i)},writeFixed64Field:function(s,i){this.writeTag(s,Ci.Fixed64),this.writeFixed64(i)},writeSFixed64Field:function(s,i){this.writeTag(s,Ci.Fixed64),this.writeSFixed64(i)},writeVarintField:function(s,i){this.writeTag(s,Ci.Varint),this.writeVarint(i)},writeSVarintField:function(s,i){this.writeTag(s,Ci.Varint),this.writeSVarint(i)},writeStringField:function(s,i){this.writeTag(s,Ci.Bytes),this.writeString(i)},writeFloatField:function(s,i){this.writeTag(s,Ci.Fixed32),this.writeFloat(i)},writeDoubleField:function(s,i){this.writeTag(s,Ci.Fixed64),this.writeDouble(i)},writeBooleanField:function(s,i){this.writeVarintField(s,Boolean(i))}};class A0{constructor(i,{pixelRatio:a,version:h,stretchX:p,stretchY:y,content:x}){this.paddedRect=i,this.pixelRatio=a,this.stretchX=p,this.stretchY=y,this.content=x,this.version=h}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 tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class x_{constructor(i,a){let h={},p={};this.haveRenderCallbacks=[];let y=[];this.addImages(i,h,y),this.addImages(a,p,y);let{w:x,h:w}=v_(y),S=new so({width:x||1,height:w||1});for(let T in i){let z=i[T],R=h[T].paddedRect;so.copy(z.data,S,{x:0,y:0},{x:R.x+1,y:R.y+1},z.data)}for(let T in a){let z=a[T],R=p[T].paddedRect,N=R.x+1,G=R.y+1,W=z.data.width,se=z.data.height;so.copy(z.data,S,{x:0,y:0},{x:N,y:G},z.data),so.copy(z.data,S,{x:0,y:se-1},{x:N,y:G-1},{width:W,height:1}),so.copy(z.data,S,{x:0,y:0},{x:N,y:G+se},{width:W,height:1}),so.copy(z.data,S,{x:W-1,y:0},{x:N-1,y:G},{width:1,height:se}),so.copy(z.data,S,{x:0,y:0},{x:N+W,y:G},{width:1,height:se})}this.image=S,this.iconPositions=h,this.patternPositions=p}addImages(i,a,h){for(let p in i){let y=i[p],x={x:0,y:0,w:y.data.width+2,h:y.data.height+2};h.push(x),a[p]=new A0(x,y),y.hasRenderCallback&&this.haveRenderCallbacks.push(p)}}patchUpdatedImages(i,a){i.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let h in i.updatedImages)this.patchUpdatedImage(this.iconPositions[h],i.getImage(h),a),this.patchUpdatedImage(this.patternPositions[h],i.getImage(h),a)}patchUpdatedImage(i,a,h){if(!i||!a||i.version===a.version)return;i.version=a.version;let[p,y]=i.tl;h.update(a.data,void 0,{x:p,y})}}dt("ImagePosition",A0),dt("ImageAtlas",x_),o.WritingMode=void 0,(Ia=o.WritingMode||(o.WritingMode={}))[Ia.none=0]="none",Ia[Ia.horizontal=1]="horizontal",Ia[Ia.vertical=2]="vertical",Ia[Ia.horizontalOnly=3]="horizontalOnly";let Xp=-17;class Dh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(i,a){let h=new Dh;return h.scale=i||1,h.fontStack=a,h}static forImage(i){let a=new Dh;return a.imageName=i,a}}class Bu{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(i,a){let h=new Bu;for(let p=0;p<i.sections.length;p++){let y=i.sections[p];y.image?h.addImageSection(y):h.addTextSection(y,a)}return h}length(){return this.text.length}getSection(i){return this.sections[this.sectionIndex[i]]}getSectionIndex(i){return this.sectionIndex[i]}getCharCode(i){return this.text.charCodeAt(i)}verticalizePunctuation(){this.text=function(i){let a="";for(let h=0;h<i.length;h++){let p=i.charCodeAt(h+1)||null,y=i.charCodeAt(h-1)||null;a+=p&&kp(p)&&!Rh[i[h+1]]||y&&kp(y)&&!Rh[i[h-1]]||!Rh[i[h]]?i[h]:Rh[i[h]]}return a}(this.text)}trim(){let i=0;for(let h=0;h<this.text.length&&Yp[this.text.charCodeAt(h)];h++)i++;let a=this.text.length;for(let h=this.text.length-1;h>=0&&h>=i&&Yp[this.text.charCodeAt(h)];h--)a--;this.text=this.text.substring(i,a),this.sectionIndex=this.sectionIndex.slice(i,a)}substring(i,a){let h=new Bu;return h.text=this.text.substring(i,a),h.sectionIndex=this.sectionIndex.slice(i,a),h.sections=this.sections,h}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((i,a)=>Math.max(i,this.sections[a].scale),0)}addTextSection(i,a){this.text+=i.text,this.sections.push(Dh.forText(i.scale,i.fontStack||a));let h=this.sections.length-1;for(let p=0;p<i.text.length;++p)this.sectionIndex.push(h)}addImageSection(i){let a=i.image?i.image.name:"";if(a.length===0)return void te("Can't add FormattedSection with an empty image.");let h=this.getNextImageSectionCharCode();h?(this.text+=String.fromCharCode(h),this.sections.push(Dh.forImage(a)),this.sectionIndex.push(this.sections.length-1)):te("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function $p(s,i,a,h,p,y,x,w,S,T,z,R,N,G,W,se){let ae=Bu.fromFeature(s,p),be;R===o.WritingMode.vertical&&ae.verticalizePunctuation();let{processBidirectionalText:Ee,processStyledBidirectionalText:Me}=Zn;if(Ee&&ae.sections.length===1){be=[];let Oe=Ee(ae.toString(),T0(ae,T,y,i,h,G,W));for(let pt of Oe){let bt=new Bu;bt.text=pt,bt.sections=ae.sections;for(let nt=0;nt<pt.length;nt++)bt.sectionIndex.push(0);be.push(bt)}}else if(Me){be=[];let Oe=Me(ae.text,ae.sectionIndex,T0(ae,T,y,i,h,G,W));for(let pt of Oe){let bt=new Bu;bt.text=pt[0],bt.sectionIndex=pt[1],bt.sections=ae.sections,be.push(bt)}}else be=function(Oe,pt){let bt=[],nt=Oe.text,ot=0;for(let tt of pt)bt.push(Oe.substring(ot,tt)),ot=tt;return ot<nt.length&&bt.push(Oe.substring(ot,nt.length)),bt}(ae,T0(ae,T,y,i,h,G,W));let Le=[],We={positionedLines:Le,text:ae.toString(),top:z[1],bottom:z[1],left:z[0],right:z[0],writingMode:R,iconsInText:!1,verticalizable:!1};return function(Oe,pt,bt,nt,ot,tt,ct,st,Ye,Et,wt,Jt){let vi=0,Wi=Xp,Zi=0,Xr=0,_r=st==="right"?1:st==="left"?0:.5,br=0;for(let wr of ot){wr.trim();let Yr=wr.getMaxScale(),sn=(Yr-1)*Or,gn={positionedGlyphs:[],lineOffset:0};Oe.positionedLines[br]=gn;let Pn=gn.positionedGlyphs,kn=0;if(!wr.length()){Wi+=tt,++br;continue}for(let Dr=0;Dr<wr.length();Dr++){let Xt=wr.getSection(Dr),Xn=wr.getSectionIndex(Dr),qr=wr.getCharCode(Dr),an=0,So=null,Bo=null,No=null,Ls=Or,Co=!(Ye===o.WritingMode.horizontal||!wt&&!fl(qr)||wt&&(Yp[qr]||(Rr=qr,it.Arabic(Rr)||it["Arabic Supplement"](Rr)||it["Arabic Extended-A"](Rr)||it["Arabic Presentation Forms-A"](Rr)||it["Arabic Presentation Forms-B"](Rr))));if(Xt.imageName){let ao=nt[Xt.imageName];if(!ao)continue;No=Xt.imageName,Oe.iconsInText=Oe.iconsInText||!0,Bo=ao.paddedRect;let zn=ao.displaySize;Xt.scale=Xt.scale*Or/Jt,So={width:zn[0],height:zn[1],left:1,top:-3,advance:Co?zn[1]:zn[0]},an=sn+(Or-zn[1]*Xt.scale),Ls=So.advance;let Rs=Co?zn[0]*Xt.scale-Or*Yr:zn[1]*Xt.scale-Or*Yr;Rs>0&&Rs>kn&&(kn=Rs)}else{let ao=bt[Xt.fontStack],zn=ao&&ao[qr];if(zn&&zn.rect)Bo=zn.rect,So=zn.metrics;else{let Rs=pt[Xt.fontStack],Fh=Rs&&Rs[qr];if(!Fh)continue;So=Fh.metrics}an=(Yr-Xt.scale)*Or}Co?(Oe.verticalizable=!0,Pn.push({glyph:qr,imageName:No,x:vi,y:Wi+an,vertical:Co,scale:Xt.scale,fontStack:Xt.fontStack,sectionIndex:Xn,metrics:So,rect:Bo}),vi+=Ls*Xt.scale+Et):(Pn.push({glyph:qr,imageName:No,x:vi,y:Wi+an,vertical:Co,scale:Xt.scale,fontStack:Xt.fontStack,sectionIndex:Xn,metrics:So,rect:Bo}),vi+=So.advance*Xt.scale+Et)}Pn.length!==0&&(Zi=Math.max(vi-Et,Zi),XT(Pn,0,Pn.length-1,_r,kn)),vi=0;let $i=tt*Yr+kn;gn.lineOffset=Math.max(kn,sn),Wi+=$i,Xr=Math.max($i,Xr),++br}var Rr;let $r=Wi-Xp,{horizontalAlign:on,verticalAlign:Tn}=P0(ct);(function(wr,Yr,sn,gn,Pn,kn,$i,Dr,Xt){let Xn=(Yr-sn)*Pn,qr=0;qr=kn!==$i?-Dr*gn-Xp:(-gn*Xt+.5)*$i;for(let an of wr)for(let So of an.positionedGlyphs)So.x+=Xn,So.y+=qr})(Oe.positionedLines,_r,on,Tn,Zi,Xr,tt,$r,ot.length),Oe.top+=-Tn*$r,Oe.bottom=Oe.top+$r,Oe.left+=-on*Zi,Oe.right=Oe.left+Zi}(We,i,a,h,be,x,w,S,R,T,N,se),!function(Oe){for(let pt of Oe)if(pt.positionedGlyphs.length!==0)return!1;return!0}(Le)&&We}let Yp={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},jT={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 __(s,i,a,h,p,y){if(i.imageName){let x=h[i.imageName];return x?x.displaySize[0]*i.scale*Or/y+p:0}{let x=a[i.fontStack],w=x&&x[s];return w?w.metrics.advance*i.scale+p:0}}function b_(s,i,a,h){let p=Math.pow(s-i,2);return h?s<i?p/2:2*p:p+Math.abs(a)*a}function HT(s,i,a){let h=0;return s===10&&(h-=1e4),a&&(h+=150),s!==40&&s!==65288||(h+=50),i!==41&&i!==65289||(h+=50),h}function w_(s,i,a,h,p,y){let x=null,w=b_(i,a,p,y);for(let S of h){let T=b_(i-S.x,a,p,y)+S.badness;T<=w&&(x=S,w=T)}return{index:s,x:i,priorBreak:x,badness:w}}function I_(s){return s?I_(s.priorBreak).concat(s.index):[]}function T0(s,i,a,h,p,y,x){if(y!=="point")return[];if(!s)return[];let w=[],S=function(N,G,W,se,ae,be){let Ee=0;for(let Me=0;Me<N.length();Me++){let Le=N.getSection(Me);Ee+=__(N.getCharCode(Me),Le,se,ae,G,be)}return Ee/Math.max(1,Math.ceil(Ee/W))}(s,i,a,h,p,x),T=s.text.indexOf("\u200B")>=0,z=0;for(let N=0;N<s.length();N++){let G=s.getSection(N),W=s.getCharCode(N);if(Yp[W]||(z+=__(W,G,h,p,i,x)),N<s.length()-1){let se=!((R=W)<11904||!(it["Bopomofo Extended"](R)||it.Bopomofo(R)||it["CJK Compatibility Forms"](R)||it["CJK Compatibility Ideographs"](R)||it["CJK Compatibility"](R)||it["CJK Radicals Supplement"](R)||it["CJK Strokes"](R)||it["CJK Symbols and Punctuation"](R)||it["CJK Unified Ideographs Extension A"](R)||it["CJK Unified Ideographs"](R)||it["Enclosed CJK Letters and Months"](R)||it["Halfwidth and Fullwidth Forms"](R)||it.Hiragana(R)||it["Ideographic Description Characters"](R)||it["Kangxi Radicals"](R)||it["Katakana Phonetic Extensions"](R)||it.Katakana(R)||it["Vertical Forms"](R)||it["Yi Radicals"](R)||it["Yi Syllables"](R)));(jT[W]||se||G.imageName)&&w.push(w_(N+1,z,S,w,HT(W,s.getCharCode(N+1),se&&T),!1))}}var R;return I_(w_(s.length(),z,S,w,0,!0))}function P0(s){let i=.5,a=.5;switch(s){case"right":case"top-right":case"bottom-right":i=1;break;case"left":case"top-left":case"bottom-left":i=0}switch(s){case"bottom":case"bottom-right":case"bottom-left":a=1;break;case"top":case"top-right":case"top-left":a=0}return{horizontalAlign:i,verticalAlign:a}}function XT(s,i,a,h,p){if(!h&&!p)return;let y=s[a],x=(s[a].x+y.metrics.advance*y.scale)*h;for(let w=i;w<=a;w++)s[w].x-=x,s[w].y+=p}function $T(s,i,a){let{horizontalAlign:h,verticalAlign:p}=P0(a),y=i[0]-s.displaySize[0]*h,x=i[1]-s.displaySize[1]*p;return{image:s,top:x,bottom:x+s.displaySize[1],left:y,right:y+s.displaySize[0]}}function S_(s,i,a,h,p,y){let x=s.image,w;if(x.content){let ae=x.content,be=x.pixelRatio||1;w=[ae[0]/be,ae[1]/be,x.displaySize[0]-ae[2]/be,x.displaySize[1]-ae[3]/be]}let S=i.left*y,T=i.right*y,z,R,N,G;a==="width"||a==="both"?(G=p[0]+S-h[3],R=p[0]+T+h[1]):(G=p[0]+(S+T-x.displaySize[0])/2,R=G+x.displaySize[0]);let W=i.top*y,se=i.bottom*y;return a==="height"||a==="both"?(z=p[1]+W-h[0],N=p[1]+se+h[2]):(z=p[1]+(W+se-x.displaySize[1])/2,N=z+x.displaySize[1]),{image:x,top:z,right:R,bottom:N,left:G,collisionPadding:w}}let zs=128;function C_(s,i){let{expression:a}=i;if(a.kind==="constant")return{kind:"constant",layoutSize:a.evaluate(new Vi(s+1))};if(a.kind==="source")return{kind:"source"};{let{zoomStops:h,interpolationType:p}=a,y=0;for(;y<h.length&&h[y]<=s;)y++;y=Math.max(0,y-1);let x=y;for(;x<h.length&&h[x]<s+1;)x++;x=Math.min(h.length-1,x);let w=h[y],S=h[x];return a.kind==="composite"?{kind:"composite",minZoom:w,maxZoom:S,interpolationType:p}:{kind:"camera",minZoom:w,maxZoom:S,minSize:a.evaluate(new Vi(w)),maxSize:a.evaluate(new Vi(S)),interpolationType:p}}}class Sa extends at{constructor(i,a,h,p){super(i,a),this.angle=h,p!==void 0&&(this.segment=p)}clone(){return new Sa(this.x,this.y,this.angle,this.segment)}}function M_(s,i,a,h,p){if(i.segment===void 0)return!0;let y=i,x=i.segment+1,w=0;for(;w>-a/2;){if(x--,x<0)return!1;w-=s[x].dist(y),y=s[x]}w+=s[x].dist(s[x+1]),x++;let S=[],T=0;for(;w<a/2;){let z=s[x],R=s[x+1];if(!R)return!1;let N=s[x-1].angleTo(z)-z.angleTo(R);for(N=Math.abs((N+3*Math.PI)%(2*Math.PI)-Math.PI),S.push({distance:w,angleDelta:N}),T+=N;w-S[0].distance>h;)T-=S.shift().angleDelta;if(T>p)return!1;x++,w+=z.dist(R)}return!0}function E_(s){let i=0;for(let a=0;a<s.length-1;a++)i+=s[a].dist(s[a+1]);return i}function A_(s,i,a){return s?.6*i*a:0}function T_(s,i){return Math.max(s?s.right-s.left:0,i?i.right-i.left:0)}function YT(s,i,a,h,p,y){let x=A_(a,p,y),w=T_(a,h)*y,S=0,T=E_(s)/2;for(let z=0;z<s.length-1;z++){let R=s[z],N=s[z+1],G=R.dist(N);if(S+G>T){let W=(T-S)/G,se=vr(R.x,N.x,W),ae=vr(R.y,N.y,W),be=new Sa(se,ae,N.angleTo(R),z);return be._round(),!x||M_(s,be,w,x,i)?be:void 0}S+=G}}function qT(s,i,a,h,p,y,x,w,S){let T=A_(h,y,x),z=T_(h,p),R=z*x,N=s[0].x===0||s[0].x===S||s[0].y===0||s[0].y===S;return i-R<i/4&&(i=R+i/4),P_(s,N?i/2*w%i:(z/2+2*y)*x*w%i,i,T,a,R,N,!1,S)}function P_(s,i,a,h,p,y,x,w,S){let T=y/2,z=E_(s),R=0,N=i-a,G=[];for(let W=0;W<s.length-1;W++){let se=s[W],ae=s[W+1],be=se.dist(ae),Ee=ae.angleTo(se);for(;N+a<R+be;){N+=a;let Me=(N-R)/be,Le=vr(se.x,ae.x,Me),We=vr(se.y,ae.y,Me);if(Le>=0&&Le<S&&We>=0&&We<S&&N-T>=0&&N+T<=z){let Oe=new Sa(Le,We,Ee,W);Oe._round(),h&&!M_(s,Oe,y,h,p)||G.push(Oe)}}R+=be}return w||G.length||x||(G=P_(s,R/2,a,h,p,y,x,!0,S)),G}function k_(s,i,a,h,p){let y=[];for(let x=0;x<s.length;x++){let w=s[x],S;for(let T=0;T<w.length-1;T++){let z=w[T],R=w[T+1];z.x<i&&R.x<i||(z.x<i?z=new at(i,z.y+(i-z.x)/(R.x-z.x)*(R.y-z.y))._round():R.x<i&&(R=new at(i,z.y+(i-z.x)/(R.x-z.x)*(R.y-z.y))._round()),z.y<a&&R.y<a||(z.y<a?z=new at(z.x+(a-z.y)/(R.y-z.y)*(R.x-z.x),a)._round():R.y<a&&(R=new at(z.x+(a-z.y)/(R.y-z.y)*(R.x-z.x),a)._round()),z.x>=h&&R.x>=h||(z.x>=h?z=new at(h,z.y+(h-z.x)/(R.x-z.x)*(R.y-z.y))._round():R.x>=h&&(R=new at(h,z.y+(h-z.x)/(R.x-z.x)*(R.y-z.y))._round()),z.y>=p&&R.y>=p||(z.y>=p?z=new at(z.x+(p-z.y)/(R.y-z.y)*(R.x-z.x),p)._round():R.y>=p&&(R=new at(z.x+(p-z.y)/(R.y-z.y)*(R.x-z.x),p)._round()),S&&z.equals(S[S.length-1])||(S=[z],y.push(S)),S.push(R)))))}}return y}function z_(s,i,a,h){let p=[],y=s.image,x=y.pixelRatio,w=y.paddedRect.w-2,S=y.paddedRect.h-2,T=s.right-s.left,z=s.bottom-s.top,R=y.stretchX||[[0,w]],N=y.stretchY||[[0,S]],G=(tt,ct)=>tt+ct[1]-ct[0],W=R.reduce(G,0),se=N.reduce(G,0),ae=w-W,be=S-se,Ee=0,Me=W,Le=0,We=se,Oe=0,pt=ae,bt=0,nt=be;if(y.content&&h){let tt=y.content;Ee=qp(R,0,tt[0]),Le=qp(N,0,tt[1]),Me=qp(R,tt[0],tt[2]),We=qp(N,tt[1],tt[3]),Oe=tt[0]-Ee,bt=tt[1]-Le,pt=tt[2]-tt[0]-Me,nt=tt[3]-tt[1]-We}let ot=(tt,ct,st,Ye)=>{let Et=Jp(tt.stretch-Ee,Me,T,s.left),wt=Qp(tt.fixed-Oe,pt,tt.stretch,W),Jt=Jp(ct.stretch-Le,We,z,s.top),vi=Qp(ct.fixed-bt,nt,ct.stretch,se),Wi=Jp(st.stretch-Ee,Me,T,s.left),Zi=Qp(st.fixed-Oe,pt,st.stretch,W),Xr=Jp(Ye.stretch-Le,We,z,s.top),_r=Qp(Ye.fixed-bt,nt,Ye.stretch,se),br=new at(Et,Jt),Rr=new at(Wi,Jt),$r=new at(Wi,Xr),on=new at(Et,Xr),Tn=new at(wt/x,vi/x),wr=new at(Zi/x,_r/x),Yr=i*Math.PI/180;if(Yr){let Pn=Math.sin(Yr),kn=Math.cos(Yr),$i=[kn,-Pn,Pn,kn];br._matMult($i),Rr._matMult($i),on._matMult($i),$r._matMult($i)}let sn=tt.stretch+tt.fixed,gn=ct.stretch+ct.fixed;return{tl:br,tr:Rr,bl:on,br:$r,tex:{x:y.paddedRect.x+1+sn,y:y.paddedRect.y+1+gn,w:st.stretch+st.fixed-sn,h:Ye.stretch+Ye.fixed-gn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Tn,pixelOffsetBR:wr,minFontScaleX:pt/x/T,minFontScaleY:nt/x/z,isSDF:a}};if(h&&(y.stretchX||y.stretchY)){let tt=L_(R,ae,W),ct=L_(N,be,se);for(let st=0;st<tt.length-1;st++){let Ye=tt[st],Et=tt[st+1];for(let wt=0;wt<ct.length-1;wt++)p.push(ot(Ye,ct[wt],Et,ct[wt+1]))}}else p.push(ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:w+1},{fixed:0,stretch:S+1}));return p}function qp(s,i,a){let h=0;for(let p of s)h+=Math.max(i,Math.min(a,p[1]))-Math.max(i,Math.min(a,p[0]));return h}function L_(s,i,a){let h=[{fixed:-1,stretch:0}];for(let[p,y]of s){let x=h[h.length-1];h.push({fixed:p-x.stretch,stretch:x.stretch}),h.push({fixed:p-x.stretch,stretch:x.stretch+(y-p)})}return h.push({fixed:i+1,stretch:a}),h}function Jp(s,i,a,h){return s/i*a+h}function Qp(s,i,a,h){return s-i*a/h}dt("Anchor",Sa);class Kp{constructor(i,a,h,p,y,x,w,S,T,z){if(this.boxStartIndex=i.length,T){let R=x.top,N=x.bottom,G=x.collisionPadding;G&&(R-=G[1],N+=G[3]);let W=N-R;W>0&&(W=Math.max(10,W),this.circleDiameter=W)}else{let R=x.top*w-S,N=x.bottom*w+S,G=x.left*w-S,W=x.right*w+S,se=x.collisionPadding;if(se&&(G-=se[0]*w,R-=se[1]*w,W+=se[2]*w,N+=se[3]*w),z){let ae=new at(G,R),be=new at(W,R),Ee=new at(G,N),Me=new at(W,N),Le=z*Math.PI/180;ae._rotate(Le),be._rotate(Le),Ee._rotate(Le),Me._rotate(Le),G=Math.min(ae.x,be.x,Ee.x,Me.x),W=Math.max(ae.x,be.x,Ee.x,Me.x),R=Math.min(ae.y,be.y,Ee.y,Me.y),N=Math.max(ae.y,be.y,Ee.y,Me.y)}i.emplaceBack(a.x,a.y,G,R,W,N,h,p,y)}this.boxEndIndex=i.length}}class JT{constructor(i=[],a=QT){if(this.data=i,this.length=this.data.length,this.compare=a,this.length>0)for(let h=(this.length>>1)-1;h>=0;h--)this._down(h)}push(i){this.data.push(i),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let i=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),i}peek(){return this.data[0]}_up(i){let{data:a,compare:h}=this,p=a[i];for(;i>0;){let y=i-1>>1,x=a[y];if(h(p,x)>=0)break;a[i]=x,i=y}a[i]=p}_down(i){let{data:a,compare:h}=this,p=this.length>>1,y=a[i];for(;i<p;){let x=1+(i<<1),w=a[x],S=x+1;if(S<this.length&&h(a[S],w)<0&&(x=S,w=a[S]),h(w,y)>=0)break;a[i]=w,i=x}a[i]=y}}function QT(s,i){return s<i?-1:s>i?1:0}function KT(s,i=1,a=!1){let h=1/0,p=1/0,y=-1/0,x=-1/0,w=s[0];for(let G=0;G<w.length;G++){let W=w[G];(!G||W.x<h)&&(h=W.x),(!G||W.y<p)&&(p=W.y),(!G||W.x>y)&&(y=W.x),(!G||W.y>x)&&(x=W.y)}let S=Math.min(y-h,x-p),T=S/2,z=new JT([],e3);if(S===0)return new at(h,p);for(let G=h;G<y;G+=S)for(let W=p;W<x;W+=S)z.push(new Nu(G+T,W+T,T,s));let R=function(G){let W=0,se=0,ae=0,be=G[0];for(let Ee=0,Me=be.length,Le=Me-1;Ee<Me;Le=Ee++){let We=be[Ee],Oe=be[Le],pt=We.x*Oe.y-Oe.x*We.y;se+=(We.x+Oe.x)*pt,ae+=(We.y+Oe.y)*pt,W+=3*pt}return new Nu(se/W,ae/W,0,G)}(s),N=z.length;for(;z.length;){let G=z.pop();(G.d>R.d||!R.d)&&(R=G,a&&console.log("found best %d after %d probes",Math.round(1e4*G.d)/1e4,N)),G.max-R.d<=i||(T=G.h/2,z.push(new Nu(G.p.x-T,G.p.y-T,T,s)),z.push(new Nu(G.p.x+T,G.p.y-T,T,s)),z.push(new Nu(G.p.x-T,G.p.y+T,T,s)),z.push(new Nu(G.p.x+T,G.p.y+T,T,s)),N+=4)}return a&&(console.log(`num probes: ${N}`),console.log(`best distance: ${R.d}`)),R.p}function e3(s,i){return i.max-s.max}function Nu(s,i,a,h){this.p=new at(s,i),this.h=a,this.d=function(p,y){let x=!1,w=1/0;for(let S=0;S<y.length;S++){let T=y[S];for(let z=0,R=T.length,N=R-1;z<R;N=z++){let G=T[z],W=T[N];G.y>p.y!=W.y>p.y&&p.x<(W.x-G.x)*(p.y-G.y)/(W.y-G.y)+G.x&&(x=!x),w=Math.min(w,Zx(p,G,W))}}return(x?1:-1)*Math.sqrt(w)}(this.p,h),this.max=this.d+this.h*Math.SQRT2}let k0=Number.POSITIVE_INFINITY;function R_(s,i){return i[1]!==k0?function(a,h,p){let y=0,x=0;switch(h=Math.abs(h),p=Math.abs(p),a){case"top-right":case"top-left":case"top":x=p-7;break;case"bottom-right":case"bottom-left":case"bottom":x=7-p}switch(a){case"top-right":case"bottom-right":case"right":y=-h;break;case"top-left":case"bottom-left":case"left":y=h}return[y,x]}(s,i[0],i[1]):function(a,h){let p=0,y=0;h<0&&(h=0);let x=h/Math.sqrt(2);switch(a){case"top-right":case"top-left":y=x-7;break;case"bottom-right":case"bottom-left":y=7-x;break;case"bottom":y=7-h;break;case"top":y=h-7}switch(a){case"top-right":case"bottom-right":p=-x;break;case"top-left":case"bottom-left":p=x;break;case"left":p=h;break;case"right":p=-h}return[p,y]}(s,i[0])}function z0(s){switch(s){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function t3(s,i,a,h,p,y,x,w,S,T,z){let R=y.textMaxSize.evaluate(i,{});R===void 0&&(R=x);let N=s.layers[0].layout,G=N.get("icon-offset").evaluate(i,{},z),W=B_(a.horizontal),se=x/24,ae=s.tilePixelRatio*se,be=s.tilePixelRatio*R/24,Ee=s.tilePixelRatio*w,Me=s.tilePixelRatio*N.get("symbol-spacing"),Le=N.get("text-padding")*s.tilePixelRatio,We=N.get("icon-padding")*s.tilePixelRatio,Oe=N.get("text-max-angle")/180*Math.PI,pt=N.get("text-rotation-alignment")!=="viewport"&&N.get("symbol-placement")!=="point",bt=N.get("icon-rotation-alignment")==="map"&&N.get("symbol-placement")!=="point",nt=N.get("symbol-placement"),ot=Me/2,tt=N.get("icon-text-fit"),ct;h&&tt!=="none"&&(s.allowVerticalPlacement&&a.vertical&&(ct=S_(h,a.vertical,tt,N.get("icon-text-fit-padding"),G,se)),W&&(h=S_(h,W,tt,N.get("icon-text-fit-padding"),G,se)));let st=(Ye,Et)=>{Et.x<0||Et.x>=Tr||Et.y<0||Et.y>=Tr||function(wt,Jt,vi,Wi,Zi,Xr,_r,br,Rr,$r,on,Tn,wr,Yr,sn,gn,Pn,kn,$i,Dr,Xt,Xn,qr,an,So){let Bo=wt.addToLineVertexArray(Jt,vi),No,Ls,Co,ao,zn=0,Rs=0,Fh=0,Q_=0,U0=-1,W0=-1,Ds={},K_=Ih(""),Z0=0,j0=0;if(br._unevaluatedLayout.getValue("text-radial-offset")===void 0?[Z0,j0]=br.layout.get("text-offset").evaluate(Xt,{},an).map(Ln=>Ln*Or):(Z0=br.layout.get("text-radial-offset").evaluate(Xt,{},an)*Or,j0=k0),wt.allowVerticalPlacement&&Wi.vertical){let Ln=br.layout.get("text-rotate").evaluate(Xt,{},an)+90;Co=new Kp(Rr,Jt,$r,on,Tn,Wi.vertical,wr,Yr,sn,Ln),_r&&(ao=new Kp(Rr,Jt,$r,on,Tn,_r,Pn,kn,sn,Ln))}if(Zi){let Ln=br.layout.get("icon-rotate").evaluate(Xt,{}),ts=br.layout.get("icon-text-fit")!=="none",Oh=z_(Zi,Ln,qr,ts),Gh=_r?z_(_r,Ln,qr,ts):void 0;Ls=new Kp(Rr,Jt,$r,on,Tn,Zi,Pn,kn,!1,Ln),zn=4*Oh.length;let ib=wt.iconSizeData,Il=null;ib.kind==="source"?(Il=[zs*br.layout.get("icon-size").evaluate(Xt,{})],Il[0]>Ca&&te(`${wt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):ib.kind==="composite"&&(Il=[zs*Xn.compositeIconSizes[0].evaluate(Xt,{},an),zs*Xn.compositeIconSizes[1].evaluate(Xt,{},an)],(Il[0]>Ca||Il[1]>Ca)&&te(`${wt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),wt.addSymbols(wt.icon,Oh,Il,Dr,$i,Xt,o.WritingMode.none,Jt,Bo.lineStartIndex,Bo.lineLength,-1,an),U0=wt.icon.placedSymbolArray.length-1,Gh&&(Rs=4*Gh.length,wt.addSymbols(wt.icon,Gh,Il,Dr,$i,Xt,o.WritingMode.vertical,Jt,Bo.lineStartIndex,Bo.lineLength,-1,an),W0=wt.icon.placedSymbolArray.length-1)}let eb=Object.keys(Wi.horizontal);for(let Ln of eb){let ts=Wi.horizontal[Ln];if(!No){K_=Ih(ts.text);let Gh=br.layout.get("text-rotate").evaluate(Xt,{},an);No=new Kp(Rr,Jt,$r,on,Tn,ts,wr,Yr,sn,Gh)}let Oh=ts.positionedLines.length===1;if(Fh+=D_(wt,Jt,ts,Xr,br,sn,Xt,gn,Bo,Wi.vertical?o.WritingMode.horizontal:o.WritingMode.horizontalOnly,Oh?eb:[Ln],Ds,U0,Xn,an),Oh)break}Wi.vertical&&(Q_+=D_(wt,Jt,Wi.vertical,Xr,br,sn,Xt,gn,Bo,o.WritingMode.vertical,["vertical"],Ds,W0,Xn,an));let f3=No?No.boxStartIndex:wt.collisionBoxArray.length,m3=No?No.boxEndIndex:wt.collisionBoxArray.length,g3=Co?Co.boxStartIndex:wt.collisionBoxArray.length,y3=Co?Co.boxEndIndex:wt.collisionBoxArray.length,v3=Ls?Ls.boxStartIndex:wt.collisionBoxArray.length,x3=Ls?Ls.boxEndIndex:wt.collisionBoxArray.length,_3=ao?ao.boxStartIndex:wt.collisionBoxArray.length,b3=ao?ao.boxEndIndex:wt.collisionBoxArray.length,Fo=-1,of=(Ln,ts)=>Ln&&Ln.circleDiameter?Math.max(Ln.circleDiameter,ts):ts;Fo=of(No,Fo),Fo=of(Co,Fo),Fo=of(Ls,Fo),Fo=of(ao,Fo);let tb=Fo>-1?1:0;tb&&(Fo*=So/Or),wt.glyphOffsetArray.length>=Fu.MAX_GLYPHS&&te("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Xt.sortKey!==void 0&&wt.addToSortKeyRanges(wt.symbolInstances.length,Xt.sortKey),wt.symbolInstances.emplaceBack(Jt.x,Jt.y,Ds.right>=0?Ds.right:-1,Ds.center>=0?Ds.center:-1,Ds.left>=0?Ds.left:-1,Ds.vertical||-1,U0,W0,K_,f3,m3,g3,y3,v3,x3,_3,b3,$r,Fh,Q_,zn,Rs,tb,0,wr,Z0,j0,Fo)}(s,Et,Ye,a,h,p,ct,s.layers[0],s.collisionBoxArray,i.index,i.sourceLayerIndex,s.index,ae,Le,pt,S,Ee,We,bt,G,i,y,T,z,x)};if(nt==="line")for(let Ye of k_(i.geometry,0,0,Tr,Tr)){let Et=qT(Ye,Me,Oe,a.vertical||W,h,24,be,s.overscaling,Tr);for(let wt of Et){let Jt=W;Jt&&i3(s,Jt.text,ot,wt)||st(Ye,wt)}}else if(nt==="line-center"){for(let Ye of i.geometry)if(Ye.length>1){let Et=YT(Ye,Oe,a.vertical||W,h,24,be);Et&&st(Ye,Et)}}else if(i.type==="Polygon")for(let Ye of x0(i.geometry,0)){let Et=KT(Ye,16);st(Ye[0],new Sa(Et.x,Et.y,0))}else if(i.type==="LineString")for(let Ye of i.geometry)st(Ye,new Sa(Ye[0].x,Ye[0].y,0));else if(i.type==="Point")for(let Ye of i.geometry)for(let Et of Ye)st([Et],new Sa(Et.x,Et.y,0))}let Ca=32640;function D_(s,i,a,h,p,y,x,w,S,T,z,R,N,G,W){let se=function(Ee,Me,Le,We,Oe,pt,bt,nt){let ot=We.layout.get("text-rotate").evaluate(pt,{})*Math.PI/180,tt=[];for(let ct of Me.positionedLines)for(let st of ct.positionedGlyphs){if(!st.rect)continue;let Ye=st.rect||{},Et=4,wt=!0,Jt=1,vi=0,Wi=(Oe||nt)&&st.vertical,Zi=st.metrics.advance*st.scale/2;if(nt&&Me.verticalizable){let $i=(st.scale-1)*Or,Dr=(Or-st.metrics.width*st.scale)/2;vi=ct.lineOffset/2-(st.imageName?-Dr:$i)}if(st.imageName){let $i=bt[st.imageName];wt=$i.sdf,Jt=$i.pixelRatio,Et=1/Jt}let Xr=Oe?[st.x+Zi,st.y]:[0,0],_r=Oe?[0,0]:[st.x+Zi+Le[0],st.y+Le[1]-vi],br=[0,0];Wi&&(br=_r,_r=[0,0]);let Rr=(st.metrics.left-Et)*st.scale-Zi+_r[0],$r=(-st.metrics.top-Et)*st.scale+_r[1],on=Rr+Ye.w*st.scale/Jt,Tn=$r+Ye.h*st.scale/Jt,wr=new at(Rr,$r),Yr=new at(on,$r),sn=new at(Rr,Tn),gn=new at(on,Tn);if(Wi){let $i=new at(-Zi,Zi-Xp),Dr=-Math.PI/2,Xt=12-Zi,Xn=new at(22-Xt,-(st.imageName?Xt:0)),qr=new at(...br);wr._rotateAround(Dr,$i)._add(Xn)._add(qr),Yr._rotateAround(Dr,$i)._add(Xn)._add(qr),sn._rotateAround(Dr,$i)._add(Xn)._add(qr),gn._rotateAround(Dr,$i)._add(Xn)._add(qr)}if(ot){let $i=Math.sin(ot),Dr=Math.cos(ot),Xt=[Dr,-$i,$i,Dr];wr._matMult(Xt),Yr._matMult(Xt),sn._matMult(Xt),gn._matMult(Xt)}let Pn=new at(0,0),kn=new at(0,0);tt.push({tl:wr,tr:Yr,bl:sn,br:gn,tex:Ye,writingMode:Me.writingMode,glyphOffset:Xr,sectionIndex:st.sectionIndex,isSDF:wt,pixelOffsetTL:Pn,pixelOffsetBR:kn,minFontScaleX:0,minFontScaleY:0})}return tt}(0,a,w,p,y,x,h,s.allowVerticalPlacement),ae=s.textSizeData,be=null;ae.kind==="source"?(be=[zs*p.layout.get("text-size").evaluate(x,{})],be[0]>Ca&&te(`${s.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):ae.kind==="composite"&&(be=[zs*G.compositeTextSizes[0].evaluate(x,{},W),zs*G.compositeTextSizes[1].evaluate(x,{},W)],(be[0]>Ca||be[1]>Ca)&&te(`${s.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),s.addSymbols(s.text,se,be,w,y,x,T,i,S.lineStartIndex,S.lineLength,N,W);for(let Ee of z)R[Ee]=s.text.placedSymbolArray.length-1;return 4*se.length}function B_(s){for(let i in s)return s[i];return null}function i3(s,i,a,h){let p=s.compareText;if(i in p){let y=p[i];for(let x=y.length-1;x>=0;x--)if(h.dist(y[x])<a)return!0}else p[i]=[];return p[i].push(h),!1}let r3=wa.VectorTileFeature.types,n3=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ef(s,i,a,h,p,y,x,w,S,T,z,R,N){let G=w?Math.min(Ca,Math.round(w[0])):0,W=w?Math.min(Ca,Math.round(w[1])):0;s.emplaceBack(i,a,Math.round(32*h),Math.round(32*p),y,x,(G<<1)+(S?1:0),W,16*T,16*z,256*R,256*N)}function L0(s,i,a){s.emplaceBack(i.x,i.y,a),s.emplaceBack(i.x,i.y,a),s.emplaceBack(i.x,i.y,a),s.emplaceBack(i.x,i.y,a)}function o3(s){for(let i of s.sections)if(n0(i.text))return!0;return!1}class R0{constructor(i){this.layoutVertexArray=new Fr,this.indexArray=new mn,this.programConfigurations=i,this.segments=new li,this.dynamicLayoutVertexArray=new En,this.opacityVertexArray=new jn,this.placedSymbolArray=new je}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(i,a,h,p){this.isEmpty()||(h&&(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,AT.members),this.indexBuffer=i.createIndexBuffer(this.indexArray,a),this.dynamicLayoutVertexBuffer=i.createVertexBuffer(this.dynamicLayoutVertexArray,TT.members,!0),this.opacityVertexBuffer=i.createVertexBuffer(this.opacityVertexArray,n3,!0),this.opacityVertexBuffer.itemSize=1),(h||p)&&this.programConfigurations.upload(i))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}dt("SymbolBuffers",R0);class D0{constructor(i,a,h){this.layoutVertexArray=new i,this.layoutAttributes=a,this.indexArray=new h,this.segments=new li,this.collisionVertexArray=new es}upload(i){this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=i.createVertexBuffer(this.collisionVertexArray,PT.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}dt("CollisionBuffers",D0);class Fu{constructor(i){this.collisionBoxArray=i.collisionBoxArray,this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(x=>x.id),this.index=i.index,this.pixelRatio=i.pixelRatio,this.sourceLayerIndex=i.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=d0([]),this.placementViewportMatrix=d0([]);let a=this.layers[0]._unevaluatedLayout._values;this.textSizeData=C_(this.zoom,a["text-size"]),this.iconSizeData=C_(this.zoom,a["icon-size"]);let h=this.layers[0].layout,p=h.get("symbol-sort-key"),y=h.get("symbol-z-order");this.canOverlap=N0(h,"text-overlap","text-allow-overlap")!=="never"||N0(h,"icon-overlap","icon-allow-overlap")!=="never"||h.get("text-ignore-placement")||h.get("icon-ignore-placement"),this.sortFeaturesByKey=y!=="viewport-y"&&!p.isConstant(),this.sortFeaturesByY=(y==="viewport-y"||y==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,h.get("symbol-placement")==="point"&&(this.writingModes=h.get("text-writing-mode").map(x=>o.WritingMode[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=i.sourceID}createArrays(){this.text=new R0(new xl(this.layers,this.zoom,i=>/^text/.test(i))),this.icon=new R0(new xl(this.layers,this.zoom,i=>/^icon/.test(i))),this.glyphOffsetArray=new mt,this.lineVertexArray=new rt,this.symbolInstances=new De}calculateGlyphDependencies(i,a,h,p,y){for(let x=0;x<i.length;x++)if(a[i.charCodeAt(x)]=!0,(h||p)&&y){let w=Rh[i.charAt(x)];w&&(a[w.charCodeAt(0)]=!0)}}populate(i,a,h){let p=this.layers[0],y=p.layout,x=y.get("text-font"),w=y.get("text-field"),S=y.get("icon-image"),T=(w.value.kind!=="constant"||w.value.value instanceof re&&!w.value.value.isEmpty()||w.value.value.toString().length>0)&&(x.value.kind!=="constant"||x.value.value.length>0),z=S.value.kind!=="constant"||!!S.value.value||Object.keys(S.parameters).length>0,R=y.get("symbol-sort-key");if(this.features=[],!T&&!z)return;let N=a.iconDependencies,G=a.glyphDependencies,W=a.availableImages,se=new Vi(this.zoom);for(let{feature:ae,id:be,index:Ee,sourceLayerIndex:Me}of i){let Le=p._featureFilter.needGeometry,We=bl(ae,Le);if(!p._featureFilter.filter(se,We,h))continue;let Oe,pt;if(Le||(We.geometry=_l(ae)),T){let nt=p.getValueAndResolveTokens("text-field",We,h,W),ot=re.factory(nt);o3(ot)&&(this.hasRTLText=!0),(!this.hasRTLText||_h()==="unavailable"||this.hasRTLText&&Zn.isParsed())&&(Oe=zT(ot,p,We))}if(z){let nt=p.getValueAndResolveTokens("icon-image",We,h,W);pt=nt instanceof pe?nt:pe.fromString(nt)}if(!Oe&&!pt)continue;let bt=this.sortFeaturesByKey?R.evaluate(We,{},h):void 0;if(this.features.push({id:be,text:Oe,icon:pt,index:Ee,sourceLayerIndex:Me,geometry:We.geometry,properties:ae.properties,type:r3[ae.type],sortKey:bt}),pt&&(N[pt.name]=!0),Oe){let nt=x.evaluate(We,{},h).join(","),ot=y.get("text-rotation-alignment")!=="viewport"&&y.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.WritingMode.vertical)>=0;for(let tt of Oe.sections)if(tt.image)N[tt.image.name]=!0;else{let ct=mh(Oe.toString()),st=tt.fontStack||nt,Ye=G[st]=G[st]||{};this.calculateGlyphDependencies(tt.text,Ye,ot,this.allowVerticalPlacement,ct)}}}y.get("symbol-placement")==="line"&&(this.features=function(ae){let be={},Ee={},Me=[],Le=0;function We(nt){Me.push(ae[nt]),Le++}function Oe(nt,ot,tt){let ct=Ee[nt];return delete Ee[nt],Ee[ot]=ct,Me[ct].geometry[0].pop(),Me[ct].geometry[0]=Me[ct].geometry[0].concat(tt[0]),ct}function pt(nt,ot,tt){let ct=be[ot];return delete be[ot],be[nt]=ct,Me[ct].geometry[0].shift(),Me[ct].geometry[0]=tt[0].concat(Me[ct].geometry[0]),ct}function bt(nt,ot,tt){let ct=tt?ot[0][ot[0].length-1]:ot[0][0];return`${nt}:${ct.x}:${ct.y}`}for(let nt=0;nt<ae.length;nt++){let ot=ae[nt],tt=ot.geometry,ct=ot.text?ot.text.toString():null;if(!ct){We(nt);continue}let st=bt(ct,tt),Ye=bt(ct,tt,!0);if(st in Ee&&Ye in be&&Ee[st]!==be[Ye]){let Et=pt(st,Ye,tt),wt=Oe(st,Ye,Me[Et].geometry);delete be[st],delete Ee[Ye],Ee[bt(ct,Me[wt].geometry,!0)]=wt,Me[Et].geometry=null}else st in Ee?Oe(st,Ye,tt):Ye in be?pt(st,Ye,tt):(We(nt),be[st]=Le-1,Ee[Ye]=Le-1)}return Me.filter(nt=>nt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ae,be)=>ae.sortKey-be.sortKey)}update(i,a,h){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(i,a,this.layers,h),this.icon.programConfigurations.updatePaintArrays(i,a,this.layers,h))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(i){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(i),this.iconCollisionBox.upload(i)),this.text.upload(i,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(i,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(i,a){let h=this.lineVertexArray.length;if(i.segment!==void 0){let p=i.dist(a[i.segment+1]),y=i.dist(a[i.segment]),x={};for(let w=i.segment+1;w<a.length;w++)x[w]={x:a[w].x,y:a[w].y,tileUnitDistanceFromAnchor:p},w<a.length-1&&(p+=a[w+1].dist(a[w]));for(let w=i.segment||0;w>=0;w--)x[w]={x:a[w].x,y:a[w].y,tileUnitDistanceFromAnchor:y},w>0&&(y+=a[w-1].dist(a[w]));for(let w=0;w<a.length;w++){let S=x[w];this.lineVertexArray.emplaceBack(S.x,S.y,S.tileUnitDistanceFromAnchor)}}return{lineStartIndex:h,lineLength:this.lineVertexArray.length-h}}addSymbols(i,a,h,p,y,x,w,S,T,z,R,N){let G=i.indexArray,W=i.layoutVertexArray,se=i.segments.prepareSegment(4*a.length,W,G,this.canOverlap?x.sortKey:void 0),ae=this.glyphOffsetArray.length,be=se.vertexLength,Ee=this.allowVerticalPlacement&&w===o.WritingMode.vertical?Math.PI/2:0,Me=x.text&&x.text.sections;for(let Le=0;Le<a.length;Le++){let{tl:We,tr:Oe,bl:pt,br:bt,tex:nt,pixelOffsetTL:ot,pixelOffsetBR:tt,minFontScaleX:ct,minFontScaleY:st,glyphOffset:Ye,isSDF:Et,sectionIndex:wt}=a[Le],Jt=se.vertexLength,vi=Ye[1];ef(W,S.x,S.y,We.x,vi+We.y,nt.x,nt.y,h,Et,ot.x,ot.y,ct,st),ef(W,S.x,S.y,Oe.x,vi+Oe.y,nt.x+nt.w,nt.y,h,Et,tt.x,ot.y,ct,st),ef(W,S.x,S.y,pt.x,vi+pt.y,nt.x,nt.y+nt.h,h,Et,ot.x,tt.y,ct,st),ef(W,S.x,S.y,bt.x,vi+bt.y,nt.x+nt.w,nt.y+nt.h,h,Et,tt.x,tt.y,ct,st),L0(i.dynamicLayoutVertexArray,S,Ee),G.emplaceBack(Jt,Jt+1,Jt+2),G.emplaceBack(Jt+1,Jt+2,Jt+3),se.vertexLength+=4,se.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ye[0]),Le!==a.length-1&&wt===a[Le+1].sectionIndex||i.programConfigurations.populatePaintArrays(W.length,x,x.index,{},N,Me&&Me[wt])}i.placedSymbolArray.emplaceBack(S.x,S.y,ae,this.glyphOffsetArray.length-ae,be,T,z,S.segment,h?h[0]:0,h?h[1]:0,p[0],p[1],w,0,!1,0,R)}_addCollisionDebugVertex(i,a,h,p,y,x){return a.emplaceBack(0,0),i.emplaceBack(h.x,h.y,p,y,Math.round(x.x),Math.round(x.y))}addCollisionDebugVertices(i,a,h,p,y,x,w){let S=y.segments.prepareSegment(4,y.layoutVertexArray,y.indexArray),T=S.vertexLength,z=y.layoutVertexArray,R=y.collisionVertexArray,N=w.anchorX,G=w.anchorY;this._addCollisionDebugVertex(z,R,x,N,G,new at(i,a)),this._addCollisionDebugVertex(z,R,x,N,G,new at(h,a)),this._addCollisionDebugVertex(z,R,x,N,G,new at(h,p)),this._addCollisionDebugVertex(z,R,x,N,G,new at(i,p)),S.vertexLength+=4;let W=y.indexArray;W.emplaceBack(T,T+1),W.emplaceBack(T+1,T+2),W.emplaceBack(T+2,T+3),W.emplaceBack(T+3,T),S.primitiveLength+=4}addDebugCollisionBoxes(i,a,h,p){for(let y=i;y<a;y++){let x=this.collisionBoxArray.get(y);this.addCollisionDebugVertices(x.x1,x.y1,x.x2,x.y2,p?this.textCollisionBox:this.iconCollisionBox,x.anchorPoint,h)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new D0(Hn,h_.members,_o),this.iconCollisionBox=new D0(Hn,h_.members,_o);for(let i=0;i<this.symbolInstances.length;i++){let a=this.symbolInstances.get(i);this.addDebugCollisionBoxes(a.textBoxStartIndex,a.textBoxEndIndex,a,!0),this.addDebugCollisionBoxes(a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a,!0),this.addDebugCollisionBoxes(a.iconBoxStartIndex,a.iconBoxEndIndex,a,!1),this.addDebugCollisionBoxes(a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex,a,!1)}}_deserializeCollisionBoxesForSymbol(i,a,h,p,y,x,w,S,T){let z={};for(let R=a;R<h;R++){let N=i.get(R);z.textBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.textFeatureIndex=N.featureIndex;break}for(let R=p;R<y;R++){let N=i.get(R);z.verticalTextBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.verticalTextFeatureIndex=N.featureIndex;break}for(let R=x;R<w;R++){let N=i.get(R);z.iconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.iconFeatureIndex=N.featureIndex;break}for(let R=S;R<T;R++){let N=i.get(R);z.verticalIconBox={x1:N.x1,y1:N.y1,x2:N.x2,y2:N.y2,anchorPointX:N.anchorPointX,anchorPointY:N.anchorPointY},z.verticalIconFeatureIndex=N.featureIndex;break}return z}deserializeCollisionBoxes(i){this.collisionArrays=[];for(let a=0;a<this.symbolInstances.length;a++){let h=this.symbolInstances.get(a);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(i,h.textBoxStartIndex,h.textBoxEndIndex,h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h.iconBoxStartIndex,h.iconBoxEndIndex,h.verticalIconBoxStartIndex,h.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}addIndicesForPlacedSymbol(i,a){let h=i.placedSymbolArray.get(a),p=h.vertexStartIndex+4*h.numGlyphs;for(let y=h.vertexStartIndex;y<p;y+=4)i.indexArray.emplaceBack(y,y+1,y+2),i.indexArray.emplaceBack(y+1,y+2,y+3)}getSortedSymbolIndexes(i){if(this.sortedAngle===i&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let a=Math.sin(i),h=Math.cos(i),p=[],y=[],x=[];for(let w=0;w<this.symbolInstances.length;++w){x.push(w);let S=this.symbolInstances.get(w);p.push(0|Math.round(a*S.anchorX+h*S.anchorY)),y.push(S.featureIndex)}return x.sort((w,S)=>p[w]-p[S]||y[S]-y[w]),x}addToSortKeyRanges(i,a){let h=this.sortKeyRanges[this.sortKeyRanges.length-1];h&&h.sortKey===a?h.symbolInstanceEnd=i+1:this.sortKeyRanges.push({sortKey:a,symbolInstanceStart:i,symbolInstanceEnd:i+1})}sortFeatures(i){if(this.sortFeaturesByY&&this.sortedAngle!==i&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(i),this.sortedAngle=i,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let a of this.symbolInstanceIndexes){let h=this.symbolInstances.get(a);this.featureSortOrder.push(h.featureIndex),[h.rightJustifiedTextSymbolIndex,h.centerJustifiedTextSymbolIndex,h.leftJustifiedTextSymbolIndex].forEach((p,y,x)=>{p>=0&&x.indexOf(p)===y&&this.addIndicesForPlacedSymbol(this.text,p)}),h.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,h.verticalPlacedTextSymbolIndex),h.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,h.placedIconSymbolIndex),h.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,h.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}dt("SymbolBucket",Fu,{omit:["layers","collisionBoxArray","features","compareText"]}),Fu.MAX_GLYPHS=65535,Fu.addDynamicAttributes=L0;let s3=new Er({"symbol-placement":new vt(ye.layout_symbol["symbol-placement"]),"symbol-spacing":new vt(ye.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new vt(ye.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Mt(ye.layout_symbol["symbol-sort-key"]),"symbol-z-order":new vt(ye.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new vt(ye.layout_symbol["icon-allow-overlap"]),"icon-overlap":new vt(ye.layout_symbol["icon-overlap"]),"icon-ignore-placement":new vt(ye.layout_symbol["icon-ignore-placement"]),"icon-optional":new vt(ye.layout_symbol["icon-optional"]),"icon-rotation-alignment":new vt(ye.layout_symbol["icon-rotation-alignment"]),"icon-size":new Mt(ye.layout_symbol["icon-size"]),"icon-text-fit":new vt(ye.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new vt(ye.layout_symbol["icon-text-fit-padding"]),"icon-image":new Mt(ye.layout_symbol["icon-image"]),"icon-rotate":new Mt(ye.layout_symbol["icon-rotate"]),"icon-padding":new vt(ye.layout_symbol["icon-padding"]),"icon-keep-upright":new vt(ye.layout_symbol["icon-keep-upright"]),"icon-offset":new Mt(ye.layout_symbol["icon-offset"]),"icon-anchor":new Mt(ye.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new vt(ye.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new vt(ye.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new vt(ye.layout_symbol["text-rotation-alignment"]),"text-field":new Mt(ye.layout_symbol["text-field"]),"text-font":new Mt(ye.layout_symbol["text-font"]),"text-size":new Mt(ye.layout_symbol["text-size"]),"text-max-width":new Mt(ye.layout_symbol["text-max-width"]),"text-line-height":new vt(ye.layout_symbol["text-line-height"]),"text-letter-spacing":new Mt(ye.layout_symbol["text-letter-spacing"]),"text-justify":new Mt(ye.layout_symbol["text-justify"]),"text-radial-offset":new Mt(ye.layout_symbol["text-radial-offset"]),"text-variable-anchor":new vt(ye.layout_symbol["text-variable-anchor"]),"text-anchor":new Mt(ye.layout_symbol["text-anchor"]),"text-max-angle":new vt(ye.layout_symbol["text-max-angle"]),"text-writing-mode":new vt(ye.layout_symbol["text-writing-mode"]),"text-rotate":new Mt(ye.layout_symbol["text-rotate"]),"text-padding":new vt(ye.layout_symbol["text-padding"]),"text-keep-upright":new vt(ye.layout_symbol["text-keep-upright"]),"text-transform":new Mt(ye.layout_symbol["text-transform"]),"text-offset":new Mt(ye.layout_symbol["text-offset"]),"text-allow-overlap":new vt(ye.layout_symbol["text-allow-overlap"]),"text-overlap":new vt(ye.layout_symbol["text-overlap"]),"text-ignore-placement":new vt(ye.layout_symbol["text-ignore-placement"]),"text-optional":new vt(ye.layout_symbol["text-optional"])});var B0={paint:new Er({"icon-opacity":new Mt(ye.paint_symbol["icon-opacity"]),"icon-color":new Mt(ye.paint_symbol["icon-color"]),"icon-halo-color":new Mt(ye.paint_symbol["icon-halo-color"]),"icon-halo-width":new Mt(ye.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Mt(ye.paint_symbol["icon-halo-blur"]),"icon-translate":new vt(ye.paint_symbol["icon-translate"]),"icon-translate-anchor":new vt(ye.paint_symbol["icon-translate-anchor"]),"text-opacity":new Mt(ye.paint_symbol["text-opacity"]),"text-color":new Mt(ye.paint_symbol["text-color"],{runtimeType:ri,getOverride:s=>s.textColor,hasOverride:s=>!!s.textColor}),"text-halo-color":new Mt(ye.paint_symbol["text-halo-color"]),"text-halo-width":new Mt(ye.paint_symbol["text-halo-width"]),"text-halo-blur":new Mt(ye.paint_symbol["text-halo-blur"]),"text-translate":new vt(ye.paint_symbol["text-translate"]),"text-translate-anchor":new vt(ye.paint_symbol["text-translate-anchor"])}),layout:s3};class N_{constructor(i){this.type=i.property.overrides?i.property.overrides.runtimeType:Tt,this.defaultValue=i}evaluate(i){if(i.formattedSection){let a=this.defaultValue.property.overrides;if(a&&a.hasOverride(i.formattedSection))return a.getOverride(i.formattedSection)}return i.feature&&i.featureState?this.defaultValue.evaluate(i.feature,i.featureState):this.defaultValue.property.specification.default}eachChild(i){this.defaultValue.isConstant()||i(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}dt("FormatSectionOverride",N_,{omit:["defaultValue"]});class tf extends fn{constructor(i){super(i,B0)}recalculate(i,a){if(super.recalculate(i,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let h=this.layout.get("text-writing-mode");if(h){let p=[];for(let y of h)p.indexOf(y)<0&&p.push(y);this.layout._values["text-writing-mode"]=p}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(i,a,h,p){let y=this.layout.get(i).evaluate(a,{},h,p),x=this._unevaluatedLayout._values[i];return x.isDataDriven()||hu(x.value)||!y?y:function(w,S){return S.replace(/{([^{}]+)}/g,(T,z)=>z in w?String(w[z]):"")}(a.properties,y)}createBucket(i){return new Fu(i)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(let i of B0.paint.overridableProperties){if(!tf.hasPaintOverride(this.layout,i))continue;let a=this.paint.get(i),h=new N_(a),p=new uh(h,a.property.specification),y=null;y=a.value.kind==="constant"||a.value.kind==="source"?new pu("source",p):new fu("composite",p,a.value.zoomStops,a.value._interpolationType),this.paint._values[i]=new xo(a.property,y,a.parameters)}}_handleOverridablePaintPropertyUpdate(i,a,h){return!(!this.layout||a.isDataDriven()||h.isDataDriven())&&tf.hasPaintOverride(this.layout,i)}static hasPaintOverride(i,a){let h=i.get("text-field"),p=B0.paint.properties[a],y=!1,x=w=>{for(let S of w)if(p.overrides&&p.overrides.hasOverride(S))return void(y=!0)};if(h.value.kind==="constant"&&h.value.value instanceof re)x(h.value.value.sections);else if(h.value.kind==="source"){let w=T=>{y||(T instanceof Ge&&fe(T.value)===ci?x(T.value.sections):T instanceof xt?x(T.sections):T.eachChild(w))},S=h.value;S._styleExpression&&w(S._styleExpression.expression)}return y}}function N0(s,i,a){let h="never",p=s.get(i);return p?h=p:s.get(a)&&(h="always"),h}var a3={paint:new Er({"background-color":new vt(ye.paint_background["background-color"]),"background-pattern":new gl(ye.paint_background["background-pattern"]),"background-opacity":new vt(ye.paint_background["background-opacity"])})},l3={paint:new Er({"raster-opacity":new vt(ye.paint_raster["raster-opacity"]),"raster-hue-rotate":new vt(ye.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new vt(ye.paint_raster["raster-brightness-min"]),"raster-brightness-max":new vt(ye.paint_raster["raster-brightness-max"]),"raster-saturation":new vt(ye.paint_raster["raster-saturation"]),"raster-contrast":new vt(ye.paint_raster["raster-contrast"]),"raster-resampling":new vt(ye.paint_raster["raster-resampling"]),"raster-fade-duration":new vt(ye.paint_raster["raster-fade-duration"])})};class u3 extends fn{constructor(i){super(i,{}),this.onAdd=a=>{this.implementation.onAdd&&this.implementation.onAdd(a,a.painter.context.gl)},this.onRemove=a=>{this.implementation.onRemove&&this.implementation.onRemove(a,a.painter.context.gl)},this.implementation=i}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}}let c3={circle:class extends fn{constructor(s){super(s,UA)}createBucket(s){return new u0(s)}queryRadius(s){let i=s;return Ch("circle-radius",this,i)+Ch("circle-stroke-width",this,i)+Op(this.paint.get("circle-translate"))}queryIntersectsFeature(s,i,a,h,p,y,x,w){let S=Gp(s,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),y.angle,x),T=this.paint.get("circle-radius").evaluate(i,a)+this.paint.get("circle-stroke-width").evaluate(i,a),z=this.paint.get("circle-pitch-alignment")==="map",R=z?S:function(G,W){return G.map(se=>Xx(se,W))}(S,w),N=z?T*x:T;for(let G of h)for(let W of G){let se=z?W:Xx(W,w),ae=N,be=Vp([],[W.x,W.y,0,1],w);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ae*=be[3]/y.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ae*=y.cameraToCenterDistance/be[3]),NA(R,se,ae))return!0}return!1}},heatmap:class extends fn{constructor(s){super(s,ZA),this._updateColorRamp()}createBucket(s){return new $x(s)}_handleSpecialPaintPropertyUpdate(s){s==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=qx({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(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends fn{constructor(s){super(s,jA)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends fn{constructor(s){super(s,aT)}recalculate(s,i){super.recalculate(s,i);let a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(s){return new w0(s)}queryRadius(){return Op(this.paint.get("fill-translate"))}queryIntersectsFeature(s,i,a,h,p,y,x){return Wx(Gp(s,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),y.angle,x),h)}isTileClipped(){return!0}},"fill-extrusion":class extends fn{constructor(s){super(s,_T)}createBucket(s){return new S0(s)}queryRadius(){return Op(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(s,i,a,h,p,y,x,w){let S=Gp(s,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),y.angle,x),T=this.paint.get("fill-extrusion-height").evaluate(i,a),z=this.paint.get("fill-extrusion-base").evaluate(i,a),R=function(G,W,se,ae){let be=[];for(let Ee of G){let Me=[Ee.x,Ee.y,0,1];Vp(Me,Me,W),be.push(new at(Me[0]/Me[3],Me[1]/Me[3]))}return be}(S,w),N=function(G,W,se,ae){let be=[],Ee=[],Me=ae[8]*W,Le=ae[9]*W,We=ae[10]*W,Oe=ae[11]*W,pt=ae[8]*se,bt=ae[9]*se,nt=ae[10]*se,ot=ae[11]*se;for(let tt of G){let ct=[],st=[];for(let Ye of tt){let Et=Ye.x,wt=Ye.y,Jt=ae[0]*Et+ae[4]*wt+ae[12],vi=ae[1]*Et+ae[5]*wt+ae[13],Wi=ae[2]*Et+ae[6]*wt+ae[14],Zi=ae[3]*Et+ae[7]*wt+ae[15],Xr=Wi+We,_r=Zi+Oe,br=Jt+pt,Rr=vi+bt,$r=Wi+nt,on=Zi+ot,Tn=new at((Jt+Me)/_r,(vi+Le)/_r);Tn.z=Xr/_r,ct.push(Tn);let wr=new at(br/on,Rr/on);wr.z=$r/on,st.push(wr)}be.push(ct),Ee.push(st)}return[be,Ee]}(h,z,T,w);return function(G,W,se){let ae=1/0;Wx(se,W)&&(ae=s_(se,W[0]));for(let be=0;be<W.length;be++){let Ee=W[be],Me=G[be];for(let Le=0;Le<Ee.length-1;Le++){let We=Ee[Le],Oe=[We,Ee[Le+1],Me[Le+1],Me[Le],We];Ux(se,Oe)&&(ae=Math.min(ae,s_(se,Oe)))}}return ae!==1/0&&ae}(N[0],N[1],R)}},line:class extends fn{constructor(s){super(s,l_),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(s){s==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof rl,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(s,i){super.recalculate(s,i),this.paint._values["line-floorwidth"]=u_.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,s)}createBucket(s){return new C0(s)}queryRadius(s){let i=s,a=c_(Ch("line-width",this,i),Ch("line-gap-width",this,i)),h=Ch("line-offset",this,i);return a/2+Math.abs(h)+Op(this.paint.get("line-translate"))}queryIntersectsFeature(s,i,a,h,p,y,x){let w=Gp(s,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),y.angle,x),S=x/2*c_(this.paint.get("line-width").evaluate(i,a),this.paint.get("line-gap-width").evaluate(i,a)),T=this.paint.get("line-offset").evaluate(i,a);return T&&(h=function(z,R){let N=[];for(let G=0;G<z.length;G++){let W=z[G],se=[];for(let ae=0;ae<W.length;ae++){let be=W[ae-1],Ee=W[ae],Me=W[ae+1],Le=ae===0?new at(0,0):Ee.sub(be)._unit()._perp(),We=ae===W.length-1?new at(0,0):Me.sub(Ee)._unit()._perp(),Oe=Le._add(We)._unit(),pt=Oe.x*We.x+Oe.y*We.y;pt!==0&&Oe._mult(1/pt),se.push(Oe._mult(R)._add(Ee))}N.push(se)}return N}(h,T*x)),function(z,R,N){for(let G=0;G<R.length;G++){let W=R[G];if(z.length>=3){for(let se=0;se<W.length;se++)if(Pu(z,W[se]))return!0}if(FA(z,W,N))return!0}return!1}(w,h,S)}isTileClipped(){return!0}},symbol:tf,background:class extends fn{constructor(s){super(s,a3)}},raster:class extends fn{constructor(s){super(s,l3)}}};class h3{constructor(i){this._callback=i,this._triggered=!1,typeof MessageChannel<"u"&&(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(){delete this._channel,this._callback=()=>{}}}let F_=63710088e-1;class sr{constructor(i,a){if(isNaN(i)||isNaN(a))throw new Error(`Invalid LngLat object: (${i}, ${a})`);if(this.lng=+i,this.lat=+a,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new sr(B(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(i){let a=Math.PI/180,h=this.lat*a,p=i.lat*a,y=Math.sin(h)*Math.sin(p)+Math.cos(h)*Math.cos(p)*Math.cos((i.lng-this.lng)*a);return F_*Math.acos(Math.min(y,1))}toBounds(i=0){let a=360*i/40075017,h=a/Math.cos(Math.PI/180*this.lat);return new wl(new sr(this.lng-h,this.lat-a),new sr(this.lng+h,this.lat+a))}static convert(i){if(i instanceof sr)return i;if(Array.isArray(i)&&(i.length===2||i.length===3))return new sr(Number(i[0]),Number(i[1]));if(!Array.isArray(i)&&typeof i=="object"&&i!==null)return new sr(Number("lng"in i?i.lng:i.lon),Number(i.lat));throw new 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 wl{constructor(i,a){i&&(a?this.setSouthWest(i).setNorthEast(a):i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1]))}setNorthEast(i){return this._ne=i instanceof sr?new sr(i.lng,i.lat):sr.convert(i),this}setSouthWest(i){return this._sw=i instanceof sr?new sr(i.lng,i.lat):sr.convert(i),this}extend(i){let a=this._sw,h=this._ne,p,y;if(i instanceof sr)p=i,y=i;else{if(!(i instanceof wl))return Array.isArray(i)?i.length===4||i.every(Array.isArray)?this.extend(wl.convert(i)):this.extend(sr.convert(i)):this;if(p=i._sw,y=i._ne,!p||!y)return this}return a||h?(a.lng=Math.min(p.lng,a.lng),a.lat=Math.min(p.lat,a.lat),h.lng=Math.max(y.lng,h.lng),h.lat=Math.max(y.lat,h.lat)):(this._sw=new sr(p.lng,p.lat),this._ne=new sr(y.lng,y.lat)),this}getCenter(){return new sr((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 sr(this.getWest(),this.getNorth())}getSouthEast(){return new sr(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(i){let{lng:a,lat:h}=sr.convert(i),p=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(p=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=h&&h<=this._ne.lat&&p}static convert(i){return i instanceof wl?i:i&&new wl(i)}}let O_=2*Math.PI*F_;function G_(s){return O_*Math.cos(s*Math.PI/180)}function V_(s){return(180+s)/360}function U_(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function W_(s,i){return s/G_(i)}function F0(s){return 360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90}class rf{constructor(i,a,h=0){this.x=+i,this.y=+a,this.z=+h}static fromLngLat(i,a=0){let h=sr.convert(i);return new rf(V_(h.lng),U_(h.lat),W_(a,h.lat))}toLngLat(){return new sr(360*this.x-180,F0(this.y))}toAltitude(){return this.z*G_(F0(this.y))}meterInMercatorCoordinateUnits(){return 1/O_*(i=F0(this.y),1/Math.cos(i*Math.PI/180));var i}}function Z_(s,i,a){var h=2*Math.PI*6378137/256/Math.pow(2,a);return[s*h-2*Math.PI*6378137/2,i*h-2*Math.PI*6378137/2]}class O0{constructor(i,a,h){this.z=i,this.x=a,this.y=h,this.key=Bh(0,i,i,a,h)}equals(i){return this.z===i.z&&this.x===i.x&&this.y===i.y}url(i,a,h){let p=(x=this.y,w=this.z,S=Z_(256*(y=this.x),256*(x=Math.pow(2,w)-x-1),w),T=Z_(256*(y+1),256*(x+1),w),S[0]+","+S[1]+","+T[0]+","+T[1]);var y,x,w,S,T;let z=function(R,N,G){let W,se="";for(let ae=R;ae>0;ae--)W=1<<ae-1,se+=(N&W?1:0)+(G&W?2:0);return se}(this.z,this.x,this.y);return i[(this.x+this.y)%i.length].replace(/{prefix}/g,(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(h==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,a>1?"@2x":"").replace(/{quadkey}/g,z).replace(/{bbox-epsg-3857}/g,p)}getTilePoint(i){let a=Math.pow(2,this.z);return new at((i.x*a-this.x)*Tr,(i.y*a-this.y)*Tr)}toString(){return`${this.z}/${this.x}/${this.y}`}}class j_{constructor(i,a){this.wrap=i,this.canonical=a,this.key=Bh(i,a.z,a.z,a.x,a.y)}}class Io{constructor(i,a,h,p,y){this.overscaledZ=i,this.wrap=a,this.canonical=new O0(h,+p,+y),this.key=Bh(a,i,h,p,y)}equals(i){return this.overscaledZ===i.overscaledZ&&this.wrap===i.wrap&&this.canonical.equals(i.canonical)}scaledTo(i){let a=this.canonical.z-i;return i>this.canonical.z?new Io(i,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Io(i,this.wrap,i,this.canonical.x>>a,this.canonical.y>>a)}calculateScaledKey(i,a){let h=this.canonical.z-i;return i>this.canonical.z?Bh(this.wrap*+a,i,this.canonical.z,this.canonical.x,this.canonical.y):Bh(this.wrap*+a,i,i,this.canonical.x>>h,this.canonical.y>>h)}isChildOf(i){if(i.wrap!==this.wrap)return!1;let a=this.canonical.z-i.canonical.z;return i.overscaledZ===0||i.overscaledZ<this.overscaledZ&&i.canonical.x===this.canonical.x>>a&&i.canonical.y===this.canonical.y>>a}children(i){if(this.overscaledZ>=i)return[new Io(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let a=this.canonical.z+1,h=2*this.canonical.x,p=2*this.canonical.y;return[new Io(a,this.wrap,a,h,p),new Io(a,this.wrap,a,h+1,p),new Io(a,this.wrap,a,h,p+1),new Io(a,this.wrap,a,h+1,p+1)]}isLessThan(i){return this.wrap<i.wrap||!(this.wrap>i.wrap)&&(this.overscaledZ<i.overscaledZ||!(this.overscaledZ>i.overscaledZ)&&(this.canonical.x<i.canonical.x||!(this.canonical.x>i.canonical.x)&&this.canonical.y<i.canonical.y))}wrapped(){return new Io(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(i){return new Io(this.overscaledZ,i,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new j_(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(i){return this.canonical.getTilePoint(new rf(i.x-this.wrap,i.y))}}function Bh(s,i,a,h,p){(s*=2)<0&&(s=-1*s-1);let y=1<<a;return(y*y*s+y*p+h).toString(36)+a.toString(36)+i.toString(36)}dt("CanonicalTileID",O0),dt("OverscaledTileID",Io,{omit:["posMatrix"]});class H_{constructor(i,a,h){if(this.uid=i,a.height!==a.width)throw new RangeError("DEM tiles must be square");if(h&&h!=="mapbox"&&h!=="terrarium")return void te(`"${h}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=a.height;let p=this.dim=a.height-2;this.data=new Uint32Array(a.data.buffer),this.encoding=h||"mapbox";for(let y=0;y<p;y++)this.data[this._idx(-1,y)]=this.data[this._idx(0,y)],this.data[this._idx(p,y)]=this.data[this._idx(p-1,y)],this.data[this._idx(y,-1)]=this.data[this._idx(y,0)],this.data[this._idx(y,p)]=this.data[this._idx(y,p-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(p,-1)]=this.data[this._idx(p-1,0)],this.data[this._idx(-1,p)]=this.data[this._idx(0,p-1)],this.data[this._idx(p,p)]=this.data[this._idx(p-1,p-1)]}get(i,a){let h=new Uint8Array(this.data.buffer),p=4*this._idx(i,a);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(h[p],h[p+1],h[p+2])}getUnpackVector(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(i,a){if(i<-1||i>=this.dim+1||a<-1||a>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(a+1)*this.stride+(i+1)}_unpackMapbox(i,a,h){return(256*i*256+256*a+h)/10-1e4}_unpackTerrarium(i,a,h){return 256*i+a+h/256-32768}getPixels(){return new so({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(i,a,h){if(this.dim!==i.dim)throw new Error("dem dimension mismatch");let p=a*this.dim,y=a*this.dim+this.dim,x=h*this.dim,w=h*this.dim+this.dim;switch(a){case-1:p=y-1;break;case 1:y=p+1}switch(h){case-1:x=w-1;break;case 1:w=x+1}let S=-a*this.dim,T=-h*this.dim;for(let z=x;z<w;z++)for(let R=p;R<y;R++)this.data[this._idx(R,z)]=i.data[this._idx(R+S,z+T)]}}dt("DEMData",H_);class X_{constructor(i){this._stringToNumber={},this._numberToString=[];for(let a=0;a<i.length;a++){let h=i[a];this._stringToNumber[h]=a,this._numberToString[a]=h}}encode(i){return this._stringToNumber[i]}decode(i){return this._numberToString[i]}}class $_{constructor(i,a,h,p,y){this.type="Feature",this._vectorTileFeature=i,i._z=a,i._x=h,i._y=p,this.properties=i.properties,this.id=y}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(i){this._geometry=i}toJSON(){let i={geometry:this.geometry};for(let a in this)a!=="_geometry"&&a!=="_vectorTileFeature"&&(i[a]=this[a]);return i}}class Y_{constructor(i,a){this.tileID=i,this.x=i.canonical.x,this.y=i.canonical.y,this.z=i.canonical.z,this.grid=new Ss(Tr,16,0),this.grid3D=new Ss(Tr,16,0),this.featureIndexArray=new Qt,this.promoteId=a}insert(i,a,h,p,y,x){let w=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(h,p,y);let S=x?this.grid3D:this.grid;for(let T=0;T<a.length;T++){let z=a[T],R=[1/0,1/0,-1/0,-1/0];for(let N=0;N<z.length;N++){let G=z[N];R[0]=Math.min(R[0],G.x),R[1]=Math.min(R[1],G.y),R[2]=Math.max(R[2],G.x),R[3]=Math.max(R[3],G.y)}R[0]<Tr&&R[1]<Tr&&R[2]>=0&&R[3]>=0&&S.insert(w,R[0],R[1],R[2],R[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new wa.VectorTile(new M0(this.rawTileData)).layers,this.sourceLayerCoder=new X_(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(i,a,h,p){this.loadVTLayers();let y=i.params||{},x=Tr/i.tileSize/i.scale,w=yu(y.filter),S=i.queryGeometry,T=i.queryPadding*x,z=J_(S),R=this.grid.query(z.minX-T,z.minY-T,z.maxX+T,z.maxY+T),N=J_(i.cameraQueryGeometry),G=this.grid3D.query(N.minX-T,N.minY-T,N.maxX+T,N.maxY+T,(ae,be,Ee,Me)=>function(Le,We,Oe,pt,bt){for(let ot of Le)if(We<=ot.x&&Oe<=ot.y&&pt>=ot.x&&bt>=ot.y)return!0;let nt=[new at(We,Oe),new at(We,bt),new at(pt,bt),new at(pt,Oe)];if(Le.length>2){for(let ot of nt)if(Pu(Le,ot))return!0}for(let ot=0;ot<Le.length-1;ot++)if(GA(Le[ot],Le[ot+1],nt))return!0;return!1}(i.cameraQueryGeometry,ae-T,be-T,Ee+T,Me+T));for(let ae of G)R.push(ae);R.sort(d3);let W={},se;for(let ae=0;ae<R.length;ae++){let be=R[ae];if(be===se)continue;se=be;let Ee=this.featureIndexArray.get(be),Me=null;this.loadMatchingFeature(W,Ee.bucketIndex,Ee.sourceLayerIndex,Ee.featureIndex,w,y.layers,y.availableImages,a,h,p,(Le,We,Oe)=>(Me||(Me=_l(Le)),We.queryIntersectsFeature(S,Le,Oe,Me,this.z,i.transform,x,i.pixelPosMatrix)))}return W}loadMatchingFeature(i,a,h,p,y,x,w,S,T,z,R){let N=this.bucketLayerIDs[a];if(x&&!function(ae,be){for(let Ee=0;Ee<ae.length;Ee++)if(be.indexOf(ae[Ee])>=0)return!0;return!1}(x,N))return;let G=this.sourceLayerCoder.decode(h),W=this.vtLayers[G].feature(p);if(y.needGeometry){let ae=bl(W,!0);if(!y.filter(new Vi(this.tileID.overscaledZ),ae,this.tileID.canonical))return}else if(!y.filter(new Vi(this.tileID.overscaledZ),W))return;let se=this.getId(W,G);for(let ae=0;ae<N.length;ae++){let be=N[ae];if(x&&x.indexOf(be)<0)continue;let Ee=S[be];if(!Ee)continue;let Me={};se&&z&&(Me=z.getState(Ee.sourceLayer||"_geojsonTileLayer",se));let Le=Z({},T[be]);Le.paint=q_(Le.paint,Ee.paint,W,Me,w),Le.layout=q_(Le.layout,Ee.layout,W,Me,w);let We=!R||R(W,Ee,Me);if(!We)continue;let Oe=new $_(W,this.z,this.x,this.y,se);Oe.layer=Le;let pt=i[be];pt===void 0&&(pt=i[be]=[]),pt.push({featureIndex:p,feature:Oe,intersectionZ:We})}}lookupSymbolFeatures(i,a,h,p,y,x,w,S){let T={};this.loadVTLayers();let z=yu(y);for(let R of i)this.loadMatchingFeature(T,h,p,R,z,x,w,S,a);return T}hasLayer(i){for(let a of this.bucketLayerIDs)for(let h of a)if(i===h)return!0;return!1}getId(i,a){let h=i.id;return this.promoteId&&(h=i.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[a]],typeof h=="boolean"&&(h=Number(h))),h}}function q_(s,i,a,h,p){return le(s,(y,x)=>{let w=i instanceof Cu?i.get(x):null;return w&&w.evaluate?w.evaluate(a,h,p):w})}function J_(s){let i=1/0,a=1/0,h=-1/0,p=-1/0;for(let y of s)i=Math.min(i,y.x),a=Math.min(a,y.y),h=Math.max(h,y.x),p=Math.max(p,y.y);return{minX:i,minY:a,maxX:h,maxY:p}}function d3(s,i){return i-s}var G0;dt("FeatureIndex",Y_,{omit:["rawTileData","sourceLayerCoder"]}),o.PerformanceMarkers=void 0,(G0=o.PerformanceMarkers||(o.PerformanceMarkers={})).create="create",G0.load="load",G0.fullLoad="fullLoad";let nf=null,Nh=[],V0=1e3/30,p3={mark(s){performance.mark(s)},frame(s){let i=s;nf!=null&&Nh.push(i-nf),nf=i},clearMetrics(){nf=null,Nh=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(let s in o.PerformanceMarkers)performance.clearMarks(o.PerformanceMarkers[s])},getPerformanceMetrics(){performance.measure("loadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.load),performance.measure("fullLoadTime",o.PerformanceMarkers.create,o.PerformanceMarkers.fullLoad);let s=performance.getEntriesByName("loadTime")[0].duration,i=performance.getEntriesByName("fullLoadTime")[0].duration,a=Nh.length,h=1/(Nh.reduce((y,x)=>y+x,0)/a/1e3),p=Nh.filter(y=>y>V0).reduce((y,x)=>y+(x-V0)/V0,0);return{loadTime:s,fullLoadTime:i,fps:h,percentDroppedFrames:p/(a+p)*100}}};o.AJAXError=ii,o.ARRAY_TYPE=ku,o.Actor=class{constructor(s,i,a){this.target=s,this.parent=i,this.mapId=a,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},ee(["receive","process"],this),this.invoker=new h3(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Se()?s:window}send(s,i,a,h,p=!1){let y=Math.round(1e18*Math.random()).toString(36).substring(0,10);a&&(this.callbacks[y]=a);let x=At(this.globalScope)?void 0:[];return this.target.postMessage({id:y,type:s,hasCallback:!!a,targetMapId:h,mustQueue:p,sourceMapId:this.mapId,data:dl(i,x)},x),{cancel:()=>{a&&delete this.callbacks[y],this.target.postMessage({id:y,type:"<cancel>",targetMapId:h,sourceMapId:this.mapId})}}}receive(s){let i=s.data,a=i.id;if(a&&(!i.targetMapId||this.mapId===i.targetMapId))if(i.type==="<cancel>"){delete this.tasks[a];let h=this.cancelCallbacks[a];delete this.cancelCallbacks[a],h&&h()}else Se()||i.mustQueue?(this.tasks[a]=i,this.taskQueue.push(a),this.invoker.trigger()):this.processTask(a,i)}process(){if(!this.taskQueue.length)return;let s=this.taskQueue.shift(),i=this.tasks[s];delete this.tasks[s],this.taskQueue.length&&this.invoker.trigger(),i&&this.processTask(s,i)}processTask(s,i){if(i.type==="<response>"){let a=this.callbacks[s];delete this.callbacks[s],a&&(i.error?a(Cs(i.error)):a(null,Cs(i.data)))}else{let a=!1,h=At(this.globalScope)?void 0:[],p=i.hasCallback?(w,S)=>{a=!0,delete this.cancelCallbacks[s],this.target.postMessage({id:s,type:"<response>",sourceMapId:this.mapId,error:w?dl(w):null,data:dl(S,h)},h)}:w=>{a=!0},y=null,x=Cs(i.data);if(this.parent[i.type])y=this.parent[i.type](i.sourceMapId,x,p);else if(this.parent.getWorkerSource){let w=i.type.split(".");y=this.parent.getWorkerSource(i.sourceMapId,w[0],x.source)[w[1]](x,p)}else p(new Error(`Could not find function ${i.type}`));!a&&y&&y.cancel&&(this.cancelCallbacks[s]=y.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},o.AlphaImage=Eh,o.CanonicalTileID=O0,o.CollisionBoxArray=Te,o.CollisionCircleLayoutArray=class extends k{},o.Color=L,o.DEMData=H_,o.DataConstantProperty=vt,o.DictionaryCoder=X_,o.EXTENT=Tr,o.ErrorEvent=Ve,o.EvaluationParameters=Vi,o.Event=Ie,o.Evented=He,o.FeatureIndex=Y_,o.FillBucket=w0,o.FillExtrusionBucket=S0,o.GeoJSONFeature=$_,o.ImageAtlas=x_,o.ImagePosition=A0,o.LineBucket=C0,o.LineStripIndexArray=class extends we{},o.LngLat=sr,o.LngLatBounds=wl,o.MercatorCoordinate=rf,o.ONE_EM=Or,o.OverscaledTileID=Io,o.PerformanceUtils=p3,o.PosArray=class extends va{},o.Properties=Er,o.QuadTriangleArray=class extends O{},o.RGBAImage=so,o.RasterBoundsArray=class extends vl{},o.RequestPerformance=class{constructor(s){this._marks={start:[s.url,"start"].join("#"),end:[s.url,"end"].join("#"),measure:s.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let s=performance.getEntriesByName(this._marks.measure);return s.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),s=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),s}},o.ResourceType=no,o.SegmentVector=li,o.SymbolBucket=Fu,o.Transitionable=bh,o.TriangleIndexArray=mn,o.Uniform1f=xa,o.Uniform1i=class extends wo{constructor(s,i){super(s,i),this.current=0}set(s){this.current!==s&&(this.current=s,this.gl.uniform1i(this.location,s))}},o.Uniform2f=class extends wo{constructor(s,i){super(s,i),this.current=[0,0]}set(s){s[0]===this.current[0]&&s[1]===this.current[1]||(this.current=s,this.gl.uniform2f(this.location,s[0],s[1]))}},o.Uniform3f=class extends wo{constructor(s,i){super(s,i),this.current=[0,0,0]}set(s){s[0]===this.current[0]&&s[1]===this.current[1]&&s[2]===this.current[2]||(this.current=s,this.gl.uniform3f(this.location,s[0],s[1],s[2]))}},o.Uniform4f=Nx,o.UniformColor=Fx,o.UniformMatrix4f=class extends wo{constructor(s,i){super(s,i),this.current=DA}set(s){if(s[12]!==this.current[12]||s[0]!==this.current[0])return this.current=s,void this.gl.uniformMatrix4fv(this.location,!1,s);for(let i=1;i<16;i++)if(s[i]!==this.current[i]){this.current=s,this.gl.uniformMatrix4fv(this.location,!1,s);break}}},o.UnwrappedTileID=j_,o.ValidationError=Re,o.ZoomHistory=pl,o.addDynamicAttributes=L0,o.asyncAll=function(s,i,a){if(!s.length)return a(null,[]);let h=s.length,p=new Array(s.length),y=null;s.forEach((x,w)=>{i(x,(S,T)=>{S&&(y=S),p[w]=T,--h==0&&a(y,p)})})},o.bezier=b,o.bindAll=ee,o.cacheEntryPossiblyAdded=function(s){_i++,_i>si&&(s.getActor().send("enforceCacheSizeLimit",Xi),_i=0)},o.clamp=A,o.clearTileCache=function(s){let i=caches.delete(Ii);s&&i.catch(s).then(()=>s())},o.clipLine=k_,o.clone=function(s){var i=new ku(16);return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],i},o.clone$1=H,o.collisionCircleLayout=kT,o.config=zi,o.create=function(){var s=new ku(16);return ku!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s},o.createExpression=du,o.createFilter=yu,o.createLayout=Ar,o.createStyleLayer=function(s){return s.type==="custom"?new u3(s):new c3[s.type](s)},o.dot=function(s,i){return s[0]*i[0]+s[1]*i[1]+s[2]*i[2]+s[3]*i[3]},o.ease=C,o.emitValidationErrors=Tp,o.enforceCacheSizeLimit=function(s){ti(),jt&&jt.then(i=>{i.keys().then(a=>{for(let h=0;h<a.length-s;h++)i.delete(a[h])})})},o.evaluateSizeForFeature=function(s,{uSize:i,uSizeT:a},{lowerSize:h,upperSize:p}){return s.kind==="source"?h/zs:s.kind==="composite"?vr(h/zs,p/zs,a):i},o.evaluateSizeForZoom=function(s,i){let a=0,h=0;if(s.kind==="constant")h=s.layoutSize;else if(s.kind!=="source"){let{interpolationType:p,minZoom:y,maxZoom:x}=s,w=p?A(Cn.interpolationFactor(p,i,y,x),0,1):0;s.kind==="camera"?h=vr(s.minSize,s.maxSize,w):a=w}return{uSizeT:a,uSize:h}},o.evaluateVariableOffset=R_,o.evented=ya,o.exported=Yt,o.exported$1=Ei,o.extend=Z,o.filterObject=de,o.getAnchorAlignment=P0,o.getAnchorJustification=z0,o.getArrayBuffer=zr,o.getImage=U,o.getJSON=function(s,i){return rn(Z(s,{type:"json"}),i)},o.getOverlapMode=N0,o.getRTLTextPluginStatus=_h,o.getReferrer=Hr,o.getVideo=function(s,i){let a=window.document.createElement("video");a.muted=!0,a.onloadstart=function(){i(null,a)};for(let h=0;h<s.length;h++){let p=window.document.createElement("source");Qo(s[h])||(a.crossOrigin="Anonymous"),p.src=s[h],a.appendChild(p)}return{cancel:()=>{}}},o.identity=d0,o.invert=function(s,i){var a=i[0],h=i[1],p=i[2],y=i[3],x=i[4],w=i[5],S=i[6],T=i[7],z=i[8],R=i[9],N=i[10],G=i[11],W=i[12],se=i[13],ae=i[14],be=i[15],Ee=a*w-h*x,Me=a*S-p*x,Le=a*T-y*x,We=h*S-p*w,Oe=h*T-y*w,pt=p*T-y*S,bt=z*se-R*W,nt=z*ae-N*W,ot=z*be-G*W,tt=R*ae-N*se,ct=R*be-G*se,st=N*be-G*ae,Ye=Ee*st-Me*ct+Le*tt+We*ot-Oe*nt+pt*bt;return Ye?(s[0]=(w*st-S*ct+T*tt)*(Ye=1/Ye),s[1]=(p*ct-h*st-y*tt)*Ye,s[2]=(se*pt-ae*Oe+be*We)*Ye,s[3]=(N*Oe-R*pt-G*We)*Ye,s[4]=(S*ot-x*st-T*nt)*Ye,s[5]=(a*st-p*ot+y*nt)*Ye,s[6]=(ae*Le-W*pt-be*Me)*Ye,s[7]=(z*pt-N*Le+G*Me)*Ye,s[8]=(x*ct-w*ot+T*bt)*Ye,s[9]=(h*ot-a*ct-y*bt)*Ye,s[10]=(W*Oe-se*Le+be*Ee)*Ye,s[11]=(R*Le-z*Oe-G*Ee)*Ye,s[12]=(w*nt-x*tt-S*bt)*Ye,s[13]=(a*tt-h*nt+p*bt)*Ye,s[14]=(se*Me-W*We-ae*Ee)*Ye,s[15]=(z*We-R*Me+N*Ee)*Ye,s):null},o.isImageBitmap=Ot,o.isSafari=At,o.keysDifference=function(s,i){let a=[];for(let h in s)h in i||a.push(h);return a},o.lazyLoadRTLTextPlugin=function(){Zn.isLoading()||Zn.isLoaded()||_h()!=="deferred"||wu()},o.makeRequest=rn,o.mapObject=le,o.mercatorXfromLng=V_,o.mercatorYfromLat=U_,o.mercatorZfromAltitude=W_,o.mul=WA,o.multiply=Hx,o.nextPowerOfTwo=function(s){return s<=1?1:Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))},o.number=vr,o.ortho=function(s,i,a,h,p,y,x){var w=1/(i-a),S=1/(h-p),T=1/(y-x);return s[0]=-2*w,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2*S,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2*T,s[11]=0,s[12]=(i+a)*w,s[13]=(p+h)*S,s[14]=(x+y)*T,s[15]=1,s},o.parseCacheControl=Be,o.parseGlyphPBF=function(s){return new M0(s).readFields(UT,[])},o.pbf=M0,o.performSymbolLayout=function(s,i,a,h,p,y,x){s.createArrays(),s.tilePixelRatio=Tr/(512*s.overscaling),s.compareText={},s.iconsNeedLinear=!1;let w=s.layers[0].layout,S=s.layers[0]._unevaluatedLayout._values,T={layoutIconSize:S["icon-size"].possiblyEvaluate(new Vi(s.zoom+1),x),layoutTextSize:S["text-size"].possiblyEvaluate(new Vi(s.zoom+1),x),textMaxSize:S["text-size"].possiblyEvaluate(new Vi(18))};if(s.textSizeData.kind==="composite"){let{minZoom:W,maxZoom:se}=s.textSizeData;T.compositeTextSizes=[S["text-size"].possiblyEvaluate(new Vi(W),x),S["text-size"].possiblyEvaluate(new Vi(se),x)]}if(s.iconSizeData.kind==="composite"){let{minZoom:W,maxZoom:se}=s.iconSizeData;T.compositeIconSizes=[S["icon-size"].possiblyEvaluate(new Vi(W),x),S["icon-size"].possiblyEvaluate(new Vi(se),x)]}let z=w.get("text-line-height")*Or,R=w.get("text-rotation-alignment")!=="viewport"&&w.get("symbol-placement")!=="point",N=w.get("text-keep-upright"),G=w.get("text-size");for(let W of s.features){let se=w.get("text-font").evaluate(W,{},x).join(","),ae=G.evaluate(W,{},x),be=T.layoutTextSize.evaluate(W,{},x),Ee=T.layoutIconSize.evaluate(W,{},x),Me={horizontal:{},vertical:void 0},Le=W.text,We,Oe=[0,0];if(Le){let nt=Le.toString(),ot=w.get("text-letter-spacing").evaluate(W,{},x)*Or,tt=Pp(nt)?ot:0,ct=w.get("text-anchor").evaluate(W,{},x),st=w.get("text-variable-anchor");if(!st){let vi=w.get("text-radial-offset").evaluate(W,{},x);Oe=vi?R_(ct,[vi*Or,k0]):w.get("text-offset").evaluate(W,{},x).map(Wi=>Wi*Or)}let Ye=R?"center":w.get("text-justify").evaluate(W,{},x),Et=w.get("symbol-placement"),wt=Et==="point"?w.get("text-max-width").evaluate(W,{},x)*Or:0,Jt=()=>{s.allowVerticalPlacement&&mh(nt)&&(Me.vertical=$p(Le,i,a,p,se,wt,z,ct,"left",tt,Oe,o.WritingMode.vertical,!0,Et,be,ae))};if(!R&&st){let vi=Ye==="auto"?st.map(Zi=>z0(Zi)):[Ye],Wi=!1;for(let Zi=0;Zi<vi.length;Zi++){let Xr=vi[Zi];if(!Me.horizontal[Xr])if(Wi)Me.horizontal[Xr]=Me.horizontal[0];else{let _r=$p(Le,i,a,p,se,wt,z,"center",Xr,tt,Oe,o.WritingMode.horizontal,!1,Et,be,ae);_r&&(Me.horizontal[Xr]=_r,Wi=_r.positionedLines.length===1)}}Jt()}else{Ye==="auto"&&(Ye=z0(ct));let vi=$p(Le,i,a,p,se,wt,z,ct,Ye,tt,Oe,o.WritingMode.horizontal,!1,Et,be,ae);vi&&(Me.horizontal[Ye]=vi),Jt(),mh(nt)&&R&&N&&(Me.vertical=$p(Le,i,a,p,se,wt,z,ct,Ye,tt,Oe,o.WritingMode.vertical,!1,Et,be,ae))}}let pt=!1;if(W.icon&&W.icon.name){let nt=h[W.icon.name];nt&&(We=$T(p[W.icon.name],w.get("icon-offset").evaluate(W,{},x),w.get("icon-anchor").evaluate(W,{},x)),pt=!!nt.sdf,s.sdfIcons===void 0?s.sdfIcons=pt:s.sdfIcons!==pt&&te("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(nt.pixelRatio!==s.pixelRatio||w.get("icon-rotate").constantOr(1)!==0)&&(s.iconsNeedLinear=!0))}let bt=B_(Me.horizontal)||Me.vertical;s.iconsInText=!!bt&&bt.iconsInText,(bt||We)&&t3(s,W,Me,We,h,T,be,Ee,Oe,pt,x)}y&&s.generateCollisionDebugBuffers()},o.perspective=function(s,i,a,h,p){var y,x=1/Math.tan(i/2);return s[0]=x/a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=x,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=-1,s[12]=0,s[13]=0,s[15]=0,p!=null&&p!==1/0?(s[10]=(p+h)*(y=1/(h-p)),s[14]=2*p*h*y):(s[10]=-1,s[14]=-2*h),s},o.pick=function(s,i){let a={};for(let h=0;h<i.length;h++){let p=i[h];p in s&&(a[p]=s[p])}return a},o.plugin=Zn,o.pointGeometry=at,o.polygonIntersectsPolygon=Ux,o.potpack=v_,o.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],o.register=dt,o.registerForPluginStateChange=function(s){return s({pluginStatus:pn,pluginURL:Ko}),ya.on("pluginStateChange",s),s},o.renderColorRamp=qx,o.rotateX=function(s,i,a){var h=Math.sin(a),p=Math.cos(a),y=i[4],x=i[5],w=i[6],S=i[7],T=i[8],z=i[9],R=i[10],N=i[11];return i!==s&&(s[0]=i[0],s[1]=i[1],s[2]=i[2],s[3]=i[3],s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15]),s[4]=y*p+T*h,s[5]=x*p+z*h,s[6]=w*p+R*h,s[7]=S*p+N*h,s[8]=T*p-y*h,s[9]=z*p-x*h,s[10]=R*p-w*h,s[11]=N*p-S*h,s},o.rotateZ=function(s,i,a){var h=Math.sin(a),p=Math.cos(a),y=i[0],x=i[1],w=i[2],S=i[3],T=i[4],z=i[5],R=i[6],N=i[7];return i!==s&&(s[8]=i[8],s[9]=i[9],s[10]=i[10],s[11]=i[11],s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15]),s[0]=y*p+T*h,s[1]=x*p+z*h,s[2]=w*p+R*h,s[3]=S*p+N*h,s[4]=T*p-y*h,s[5]=z*p-x*h,s[6]=R*p-w*h,s[7]=N*p-S*h,s},o.scale=function(s,i,a){var h=a[0],p=a[1],y=a[2];return s[0]=i[0]*h,s[1]=i[1]*h,s[2]=i[2]*h,s[3]=i[3]*h,s[4]=i[4]*p,s[5]=i[5]*p,s[6]=i[6]*p,s[7]=i[7]*p,s[8]=i[8]*y,s[9]=i[9]*y,s[10]=i[10]*y,s[11]=i[11]*y,s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15],s},o.scale$1=function(s,i,a){return s[0]=i[0]*a,s[1]=i[1]*a,s[2]=i[2]*a,s[3]=i[3]*a,s},o.setCacheLimits=function(s,i){Xi=s,si=i},o.setRTLTextPlugin=function(s,i,a=!1){if(pn===bu||pn===gh||pn===yh)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ko=Yt.resolveURL(s),pn=bu,vh=i,xh(),a||wu()},o.spec=ye,o.sphericalToCartesian=function([s,i,a]){return i+=90,i*=Math.PI/180,a*=Math.PI/180,{x:s*Math.cos(i)*Math.sin(a),y:s*Math.sin(i)*Math.sin(a),z:s*Math.cos(a)}},o.toEvaluationFeature=bl,o.transformMat4=Vp,o.translate=function(s,i,a){var h,p,y,x,w,S,T,z,R,N,G,W,se=a[0],ae=a[1],be=a[2];return i===s?(s[12]=i[0]*se+i[4]*ae+i[8]*be+i[12],s[13]=i[1]*se+i[5]*ae+i[9]*be+i[13],s[14]=i[2]*se+i[6]*ae+i[10]*be+i[14],s[15]=i[3]*se+i[7]*ae+i[11]*be+i[15]):(p=i[1],y=i[2],x=i[3],w=i[4],S=i[5],T=i[6],z=i[7],R=i[8],N=i[9],G=i[10],W=i[11],s[0]=h=i[0],s[1]=p,s[2]=y,s[3]=x,s[4]=w,s[5]=S,s[6]=T,s[7]=z,s[8]=R,s[9]=N,s[10]=G,s[11]=W,s[12]=h*se+w*ae+R*be+i[12],s[13]=p*se+S*ae+N*be+i[13],s[14]=y*se+T*ae+G*be+i[14],s[15]=x*se+z*ae+W*be+i[15]),s},o.triggerPluginCompletionEvent=Lp,o.unicodeBlockLookup=it,o.uniqueId=function(){return q++},o.validateCustomStyleLayer=function(s){let i=[],a=s.id;return a===void 0&&i.push({message:`layers.${a}: missing required property "id"`}),s.render===void 0&&i.push({message:`layers.${a}: missing required method "render"`}),s.renderingMode&&s.renderingMode!=="2d"&&s.renderingMode!=="3d"&&i.push({message:`layers.${a}: property "renderingMode" must be either "2d" or "3d"`}),i},o.validateLight=e0,o.validateStyle=Is,o.vectorTile=wa,o.warnOnce=te,o.wrap=B}),l(["./shared"],function(o){"use strict";function m(Y){let P=typeof Y;if(P==="number"||P==="boolean"||P==="string"||Y==null)return JSON.stringify(Y);if(Array.isArray(Y)){let J="[";for(let re of Y)J+=`${m(re)},`;return`${J}]`}let L=Object.keys(Y).sort(),j="{";for(let J=0;J<L.length;J++)j+=`${JSON.stringify(L[J])}:${m(Y[L[J]])},`;return`${j}}`}function v(Y){let P="";for(let L of o.refProperties)P+=`/${m(Y[L])}`;return P}class b{constructor(P){this.keyCache={},P&&this.replace(P)}replace(P){this._layerConfigs={},this._layers={},this.update(P,[])}update(P,L){for(let J of P){this._layerConfigs[J.id]=J;let re=this._layers[J.id]=o.createStyleLayer(J);re._featureFilter=o.createFilter(re.filter),this.keyCache[J.id]&&delete this.keyCache[J.id]}for(let J of L)delete this.keyCache[J],delete this._layerConfigs[J],delete this._layers[J];this.familiesBySource={};let j=function(J,re){let pe={};for(let ce=0;ce<J.length;ce++){let fe=re&&re[J[ce].id]||v(J[ce]);re&&(re[J[ce].id]=fe);let Pe=pe[fe];Pe||(Pe=pe[fe]=[]),Pe.push(J[ce])}let ue=[];for(let ce in pe)ue.push(pe[ce]);return ue}(Object.values(this._layerConfigs),this.keyCache);for(let J of j){let re=J.map(Ge=>this._layers[Ge.id]),pe=re[0];if(pe.visibility==="none")continue;let ue=pe.source||"",ce=this.familiesBySource[ue];ce||(ce=this.familiesBySource[ue]={});let fe=pe.sourceLayer||"_geojsonTileLayer",Pe=ce[fe];Pe||(Pe=ce[fe]=[]),Pe.push(re)}}}class C{constructor(P){let L={},j=[];for(let ue in P){let ce=P[ue],fe=L[ue]={};for(let Pe in ce){let Ge=ce[+Pe];if(!Ge||Ge.bitmap.width===0||Ge.bitmap.height===0)continue;let Ae={x:0,y:0,w:Ge.bitmap.width+2,h:Ge.bitmap.height+2};j.push(Ae),fe[Pe]={rect:Ae,metrics:Ge.metrics}}}let{w:J,h:re}=o.potpack(j),pe=new o.AlphaImage({width:J||1,height:re||1});for(let ue in P){let ce=P[ue];for(let fe in ce){let Pe=ce[+fe];if(!Pe||Pe.bitmap.width===0||Pe.bitmap.height===0)continue;let Ge=L[ue][fe].rect;o.AlphaImage.copy(Pe.bitmap,pe,{x:0,y:0},{x:Ge.x+1,y:Ge.y+1},Pe.bitmap)}}this.image=pe,this.positions=L}}o.register("GlyphAtlas",C);class A{constructor(P){this.tileID=new o.OverscaledTileID(P.tileID.overscaledZ,P.tileID.wrap,P.tileID.canonical.z,P.tileID.canonical.x,P.tileID.canonical.y),this.uid=P.uid,this.zoom=P.zoom,this.pixelRatio=P.pixelRatio,this.tileSize=P.tileSize,this.source=P.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=P.showCollisionBoxes,this.collectResourceTiming=!!P.collectResourceTiming,this.returnDependencies=!!P.returnDependencies,this.promoteId=P.promoteId}parse(P,L,j,J,re){this.status="parsing",this.data=P,this.collisionBoxArray=new o.CollisionBoxArray;let pe=new o.DictionaryCoder(Object.keys(P.layers).sort()),ue=new o.FeatureIndex(this.tileID,this.promoteId);ue.bucketLayerIDs=[];let ce={},fe={featureIndex:ue,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:j},Pe=L.familiesBySource[this.source];for(let Ut in Pe){let Bt=P.layers[Ut];if(!Bt)continue;Bt.version===1&&o.warnOnce(`Vector tile source "${this.source}" layer "${Ut}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let Rt=pe.encode(Ut),cr=[];for(let nr=0;nr<Bt.length;nr++){let Lr=Bt.feature(nr),Nr=ue.getId(Lr,Ut);cr.push({feature:Lr,id:Nr,index:nr,sourceLayerIndex:Rt})}for(let nr of Pe[Ut]){let Lr=nr[0];Lr.minzoom&&this.zoom<Math.floor(Lr.minzoom)||Lr.maxzoom&&this.zoom>=Lr.maxzoom||Lr.visibility!=="none"&&(B(nr,this.zoom,j),(ce[Lr.id]=Lr.createBucket({index:ue.bucketLayerIDs.length,layers:nr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Rt,sourceID:this.source})).populate(cr,fe,this.tileID.canonical),ue.bucketLayerIDs.push(nr.map(Nr=>Nr.id)))}}let Ge,Ae,gt,lt,xt=o.mapObject(fe.glyphDependencies,Ut=>Object.keys(Ut).map(Number));Object.keys(xt).length?J.send("getGlyphs",{uid:this.uid,stacks:xt},(Ut,Bt)=>{Ge||(Ge=Ut,Ae=Bt,$t.call(this))}):Ae={};let Ct=Object.keys(fe.iconDependencies);Ct.length?J.send("getImages",{icons:Ct,source:this.source,tileID:this.tileID,type:"icons"},(Ut,Bt)=>{Ge||(Ge=Ut,gt=Bt,$t.call(this))}):gt={};let ni=Object.keys(fe.patternDependencies);function $t(){if(Ge)return re(Ge);if(Ae&&gt&&lt){let Ut=new C(Ae),Bt=new o.ImageAtlas(gt,lt);for(let Rt in ce){let cr=ce[Rt];cr instanceof o.SymbolBucket?(B(cr.layers,this.zoom,j),o.performSymbolLayout(cr,Ae,Ut.positions,gt,Bt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):cr.hasPattern&&(cr instanceof o.LineBucket||cr instanceof o.FillBucket||cr instanceof o.FillExtrusionBucket)&&(B(cr.layers,this.zoom,j),cr.addFeatures(fe,this.tileID.canonical,Bt.patternPositions))}this.status="done",re(null,{buckets:Object.values(ce).filter(Rt=>!Rt.isEmpty()),featureIndex:ue,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ut.image,imageAtlas:Bt,glyphMap:this.returnDependencies?Ae:null,iconMap:this.returnDependencies?gt:null,glyphPositions:this.returnDependencies?Ut.positions:null})}}ni.length?J.send("getImages",{icons:ni,source:this.source,tileID:this.tileID,type:"patterns"},(Ut,Bt)=>{Ge||(Ge=Ut,lt=Bt,$t.call(this))}):lt={},$t.call(this)}}function B(Y,P,L){let j=new o.EvaluationParameters(P);for(let J of Y)J.recalculate(j,L)}function Z(Y,P){let L=o.getArrayBuffer(Y.request,(j,J,re,pe)=>{j?P(j):J&&P(null,{vectorTile:new o.vectorTile.VectorTile(new o.pbf(J)),rawData:J,cacheControl:re,expires:pe})});return()=>{L.cancel(),P()}}class q{constructor(P,L,j,J){this.actor=P,this.layerIndex=L,this.availableImages=j,this.loadVectorData=J||Z,this.loading={},this.loaded={}}loadTile(P,L){let j=P.uid;this.loading||(this.loading={});let J=!!(P&&P.request&&P.request.collectResourceTiming)&&new o.RequestPerformance(P.request),re=this.loading[j]=new A(P);re.abort=this.loadVectorData(P,(pe,ue)=>{if(delete this.loading[j],pe||!ue)return re.status="done",this.loaded[j]=re,L(pe);let ce=ue.rawData,fe={};ue.expires&&(fe.expires=ue.expires),ue.cacheControl&&(fe.cacheControl=ue.cacheControl);let Pe={};if(J){let Ge=J.finish();Ge&&(Pe.resourceTiming=JSON.parse(JSON.stringify(Ge)))}re.vectorTile=ue.vectorTile,re.parse(ue.vectorTile,this.layerIndex,this.availableImages,this.actor,(Ge,Ae)=>{if(Ge||!Ae)return L(Ge);L(null,o.extend({rawTileData:ce.slice(0)},Ae,fe,Pe))}),this.loaded=this.loaded||{},this.loaded[j]=re})}reloadTile(P,L){let j=this.loaded,J=P.uid,re=this;if(j&&j[J]){let pe=j[J];pe.showCollisionBoxes=P.showCollisionBoxes;let ue=(ce,fe)=>{let Pe=pe.reloadCallback;Pe&&(delete pe.reloadCallback,pe.parse(pe.vectorTile,re.layerIndex,this.availableImages,re.actor,Pe)),L(ce,fe)};pe.status==="parsing"?pe.reloadCallback=ue:pe.status==="done"&&(pe.vectorTile?pe.parse(pe.vectorTile,this.layerIndex,this.availableImages,this.actor,ue):ue())}}abortTile(P,L){let j=this.loading,J=P.uid;j&&j[J]&&j[J].abort&&(j[J].abort(),delete j[J]),L()}removeTile(P,L){let j=this.loaded,J=P.uid;j&&j[J]&&delete j[J],L()}}class ee{constructor(){this.loaded={}}loadTile(P,L){let{uid:j,encoding:J,rawImageData:re}=P,pe=o.isImageBitmap(re)?this.getImageData(re):re,ue=new o.DEMData(j,pe,J);this.loaded=this.loaded||{},this.loaded[j]=ue,L(null,ue)}getImageData(P){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(P.width,P.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=P.width,this.offscreenCanvas.height=P.height,this.offscreenCanvasContext.drawImage(P,0,0,P.width,P.height);let L=this.offscreenCanvasContext.getImageData(-1,-1,P.width+2,P.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new o.RGBAImage({width:L.width,height:L.height},L.data)}removeTile(P){let L=this.loaded,j=P.uid;L&&L[j]&&delete L[j]}}var le=function Y(P,L){var j,J=P&&P.type;if(J==="FeatureCollection")for(j=0;j<P.features.length;j++)Y(P.features[j],L);else if(J==="GeometryCollection")for(j=0;j<P.geometries.length;j++)Y(P.geometries[j],L);else if(J==="Feature")Y(P.geometry,L);else if(J==="Polygon")de(P.coordinates,L);else if(J==="MultiPolygon")for(j=0;j<P.coordinates.length;j++)de(P.coordinates[j],L);return P};function de(Y,P){if(Y.length!==0){H(Y[0],P);for(var L=1;L<Y.length;L++)H(Y[L],!P)}}function H(Y,P){for(var L=0,j=0,J=0,re=Y.length,pe=re-1;J<re;pe=J++){var ue=(Y[J][0]-Y[pe][0])*(Y[pe][1]+Y[J][1]),ce=L+ue;j+=Math.abs(L)>=Math.abs(ue)?L-ce+ue:ue-ce+L,L=ce}L+j>=0!=!!P&&Y.reverse()}let Q=o.vectorTile.VectorTileFeature.prototype.toGeoJSON;class te{constructor(P){this._feature=P,this.extent=o.EXTENT,this.type=P.type,this.properties=P.tags,"id"in P&&!isNaN(P.id)&&(this.id=parseInt(P.id,10))}loadGeometry(){if(this._feature.type===1){let P=[];for(let L of this._feature.geometry)P.push([new o.pointGeometry(L[0],L[1])]);return P}{let P=[];for(let L of this._feature.geometry){let j=[];for(let J of L)j.push(new o.pointGeometry(J[0],J[1]));P.push(j)}return P}}toGeoJSON(P,L,j){return Q.call(this,P,L,j)}}class ve{constructor(P){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=P.length,this._features=P}feature(P){return new te(this._features[P])}}var Ce={exports:{}},Se=o.pointGeometry,Be=o.vectorTile.VectorTileFeature,Fe=qe;function qe(Y,P){this.options=P||{},this.features=Y,this.length=Y.length}function ht(Y,P){this.id=typeof Y.id=="number"?Y.id:void 0,this.type=Y.type,this.rawGeometry=Y.type===1?[Y.geometry]:Y.geometry,this.properties=Y.tags,this.extent=P||4096}qe.prototype.feature=function(Y){return new ht(this.features[Y],this.options.extent)},ht.prototype.loadGeometry=function(){var Y=this.rawGeometry;this.geometry=[];for(var P=0;P<Y.length;P++){for(var L=Y[P],j=[],J=0;J<L.length;J++)j.push(new Se(L[J][0],L[J][1]));this.geometry.push(j)}return this.geometry},ht.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Y=this.geometry,P=1/0,L=-1/0,j=1/0,J=-1/0,re=0;re<Y.length;re++)for(var pe=Y[re],ue=0;ue<pe.length;ue++){var ce=pe[ue];P=Math.min(P,ce.x),L=Math.max(L,ce.x),j=Math.min(j,ce.y),J=Math.max(J,ce.y)}return[P,j,L,J]},ht.prototype.toGeoJSON=Be.prototype.toGeoJSON;var At=o.pbf,Ot=Fe;function Yt(Y){var P=new At;return function(L,j){for(var J in L.layers)j.writeMessage(3,at,L.layers[J])}(Y,P),P.finish()}function at(Y,P){var L;P.writeVarintField(15,Y.version||1),P.writeStringField(1,Y.name||""),P.writeVarintField(5,Y.extent||4096);var j={keys:[],values:[],keycache:{},valuecache:{}};for(L=0;L<Y.length;L++)j.feature=Y.feature(L),P.writeMessage(2,Zt,j);var J=j.keys;for(L=0;L<J.length;L++)P.writeStringField(3,J[L]);var re=j.values;for(L=0;L<re.length;L++)P.writeMessage(4,Xi,re[L])}function Zt(Y,P){var L=Y.feature;L.id!==void 0&&P.writeVarintField(1,L.id),P.writeMessage(2,zi,Y),P.writeVarintField(3,L.type),P.writeMessage(4,ur,L)}function zi(Y,P){var L=Y.feature,j=Y.keys,J=Y.values,re=Y.keycache,pe=Y.valuecache;for(var ue in L.properties){var ce=L.properties[ue],fe=re[ue];if(ce!==null){fe===void 0&&(j.push(ue),re[ue]=fe=j.length-1),P.writeVarint(fe);var Pe=typeof ce;Pe!=="string"&&Pe!=="boolean"&&Pe!=="number"&&(ce=JSON.stringify(ce));var Ge=Pe+":"+ce,Ae=pe[Ge];Ae===void 0&&(J.push(ce),pe[Ge]=Ae=J.length-1),P.writeVarint(Ae)}}}function Ii(Y,P){return(P<<3)+(7&Y)}function jt(Y){return Y<<1^Y>>31}function ur(Y,P){for(var L=Y.loadGeometry(),j=Y.type,J=0,re=0,pe=L.length,ue=0;ue<pe;ue++){var ce=L[ue],fe=1;j===1&&(fe=ce.length),P.writeVarint(Ii(1,fe));for(var Pe=j===3?ce.length-1:ce.length,Ge=0;Ge<Pe;Ge++){Ge===1&&j!==1&&P.writeVarint(Ii(2,Pe-1));var Ae=ce[Ge].x-J,gt=ce[Ge].y-re;P.writeVarint(jt(Ae)),P.writeVarint(jt(gt)),J+=Ae,re+=gt}j===3&&P.writeVarint(Ii(7,1))}}function Xi(Y,P){var L=typeof Y;L==="string"?P.writeStringField(1,Y):L==="boolean"?P.writeBooleanField(7,Y):L==="number"&&(Y%1!=0?P.writeDoubleField(3,Y):Y<0?P.writeSVarintField(6,Y):P.writeVarintField(5,Y))}Ce.exports=Yt,Ce.exports.fromVectorTileJs=Yt,Ce.exports.fromGeojsonVt=function(Y,P){P=P||{};var L={};for(var j in Y)L[j]=new Ot(Y[j].features,P),L[j].name=j,L[j].version=P.version,L[j].extent=P.extent;return Yt({layers:L})},Ce.exports.GeoJSONWrapper=Ot;var si=Ce.exports;function ti(Y,P,L,j,J,re){if(J-j<=L)return;let pe=j+J>>1;_i(Y,P,pe,j,J,re%2),ti(Y,P,L,j,pe-1,re+1),ti(Y,P,L,pe+1,J,re+1)}function _i(Y,P,L,j,J,re){for(;J>j;){if(J-j>600){let fe=J-j+1,Pe=L-j+1,Ge=Math.log(fe),Ae=.5*Math.exp(2*Ge/3),gt=.5*Math.sqrt(Ge*Ae*(fe-Ae)/fe)*(Pe-fe/2<0?-1:1);_i(Y,P,L,Math.max(j,Math.floor(L-Pe*Ae/fe+gt)),Math.min(J,Math.floor(L+(fe-Pe)*Ae/fe+gt)),re)}let pe=P[2*L+re],ue=j,ce=J;for(Ei(Y,P,j,L),P[2*J+re]>pe&&Ei(Y,P,j,J);ue<ce;){for(Ei(Y,P,ue,ce),ue++,ce--;P[2*ue+re]<pe;)ue++;for(;P[2*ce+re]>pe;)ce--}P[2*j+re]===pe?Ei(Y,P,j,ce):(ce++,Ei(Y,P,ce,J)),ce<=L&&(j=ce+1),L<=ce&&(J=ce-1)}}function Ei(Y,P,L,j){Li(Y,L,j),Li(P,2*L,2*j),Li(P,2*L+1,2*j+1)}function Li(Y,P,L){let j=Y[P];Y[P]=Y[L],Y[L]=j}function Fi(Y,P,L,j){let J=Y-L,re=P-j;return J*J+re*re}let Ji=Y=>Y[0],Cr=Y=>Y[1];class tn{constructor(P,L=Ji,j=Cr,J=64,re=Float64Array){this.nodeSize=J,this.points=P;let pe=P.length<65536?Uint16Array:Uint32Array,ue=this.ids=new pe(P.length),ce=this.coords=new re(2*P.length);for(let fe=0;fe<P.length;fe++)ue[fe]=fe,ce[2*fe]=L(P[fe]),ce[2*fe+1]=j(P[fe]);ti(ue,ce,J,0,ue.length-1,0)}range(P,L,j,J){return function(re,pe,ue,ce,fe,Pe,Ge){let Ae=[0,re.length-1,0],gt=[],lt,xt;for(;Ae.length;){let Ct=Ae.pop(),ni=Ae.pop(),$t=Ae.pop();if(ni-$t<=Ge){for(let Rt=$t;Rt<=ni;Rt++)lt=pe[2*Rt],xt=pe[2*Rt+1],lt>=ue&&lt<=fe&&xt>=ce&&xt<=Pe&&gt.push(re[Rt]);continue}let Ut=Math.floor(($t+ni)/2);lt=pe[2*Ut],xt=pe[2*Ut+1],lt>=ue&&lt<=fe&&xt>=ce&&xt<=Pe&&gt.push(re[Ut]);let Bt=(Ct+1)%2;(Ct===0?ue<=lt:ce<=xt)&&(Ae.push($t),Ae.push(Ut-1),Ae.push(Bt)),(Ct===0?fe>=lt:Pe>=xt)&&(Ae.push(Ut+1),Ae.push(ni),Ae.push(Bt))}return gt}(this.ids,this.coords,P,L,j,J,this.nodeSize)}within(P,L,j){return function(J,re,pe,ue,ce,fe){let Pe=[0,J.length-1,0],Ge=[],Ae=ce*ce;for(;Pe.length;){let gt=Pe.pop(),lt=Pe.pop(),xt=Pe.pop();if(lt-xt<=fe){for(let Bt=xt;Bt<=lt;Bt++)Fi(re[2*Bt],re[2*Bt+1],pe,ue)<=Ae&&Ge.push(J[Bt]);continue}let Ct=Math.floor((xt+lt)/2),ni=re[2*Ct],$t=re[2*Ct+1];Fi(ni,$t,pe,ue)<=Ae&&Ge.push(J[Ct]);let Ut=(gt+1)%2;(gt===0?pe-ce<=ni:ue-ce<=$t)&&(Pe.push(xt),Pe.push(Ct-1),Pe.push(Ut)),(gt===0?pe+ce>=ni:ue+ce>=$t)&&(Pe.push(Ct+1),Pe.push(lt),Pe.push(Ut))}return Ge}(this.ids,this.coords,P,L,j,this.nodeSize)}}let no={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Y=>Y},ii=Math.fround||(Hr=new Float32Array(1),Y=>(Hr[0]=+Y,Hr[0]));var Hr;class hn{constructor(P){this.options=K(Object.create(no),P),this.trees=new Array(this.options.maxZoom+1)}load(P){let{log:L,minZoom:j,maxZoom:J,nodeSize:re}=this.options;L&&console.time("total time");let pe=`prepare ${P.length} points`;L&&console.time(pe),this.points=P;let ue=[];for(let ce=0;ce<P.length;ce++)P[ce].geometry&&ue.push(zr(P[ce],ce));this.trees[J+1]=new tn(ue,he,Ie,re,Float32Array),L&&console.timeEnd(pe);for(let ce=J;ce>=j;ce--){let fe=+Date.now();ue=this._cluster(ue,ce),this.trees[ce]=new tn(ue,he,Ie,re,Float32Array),L&&console.log("z%d: %d clusters in %dms",ce,ue.length,+Date.now()-fe)}return L&&console.timeEnd("total time"),this}getClusters(P,L){let j=((P[0]+180)%360+360)%360-180,J=Math.max(-90,Math.min(90,P[1])),re=P[2]===180?180:((P[2]+180)%360+360)%360-180,pe=Math.max(-90,Math.min(90,P[3]));if(P[2]-P[0]>=360)j=-180,re=180;else if(j>re){let Pe=this.getClusters([j,J,180,pe],L),Ge=this.getClusters([-180,J,re,pe],L);return Pe.concat(Ge)}let ue=this.trees[this._limitZoom(L)],ce=ue.range(V(j),F(pe),V(re),F(J)),fe=[];for(let Pe of ce){let Ge=ue.points[Pe];fe.push(Ge.numPoints?Qo(Ge):this.points[Ge.index])}return fe}getChildren(P){let L=this._getOriginId(P),j=this._getOriginZoom(P),J="No cluster with the specified id.",re=this.trees[j];if(!re)throw new Error(J);let pe=re.points[L];if(!pe)throw new Error(J);let ue=this.options.radius/(this.options.extent*Math.pow(2,j-1)),ce=re.within(pe.x,pe.y,ue),fe=[];for(let Pe of ce){let Ge=re.points[Pe];Ge.parentId===P&&fe.push(Ge.numPoints?Qo(Ge):this.points[Ge.index])}if(fe.length===0)throw new Error(J);return fe}getLeaves(P,L,j){let J=[];return this._appendLeaves(J,P,L=L||10,j=j||0,0),J}getTile(P,L,j){let J=this.trees[this._limitZoom(P)],re=Math.pow(2,P),{extent:pe,radius:ue}=this.options,ce=ue/pe,fe=(j-ce)/re,Pe=(j+1+ce)/re,Ge={features:[]};return this._addTileFeatures(J.range((L-ce)/re,fe,(L+1+ce)/re,Pe),J.points,L,j,re,Ge),L===0&&this._addTileFeatures(J.range(1-ce/re,fe,1,Pe),J.points,re,j,re,Ge),L===re-1&&this._addTileFeatures(J.range(0,fe,ce/re,Pe),J.points,-1,j,re,Ge),Ge.features.length?Ge:null}getClusterExpansionZoom(P){let L=this._getOriginZoom(P)-1;for(;L<=this.options.maxZoom;){let j=this.getChildren(P);if(L++,j.length!==1)break;P=j[0].properties.cluster_id}return L}_appendLeaves(P,L,j,J,re){let pe=this.getChildren(L);for(let ue of pe){let ce=ue.properties;if(ce&&ce.cluster?re+ce.point_count<=J?re+=ce.point_count:re=this._appendLeaves(P,ce.cluster_id,j,J,re):re<J?re++:P.push(ue),P.length===j)break}return re}_addTileFeatures(P,L,j,J,re,pe){for(let ue of P){let ce=L[ue],fe=ce.numPoints,Pe,Ge,Ae;if(fe)Pe=_e(ce),Ge=ce.x,Ae=ce.y;else{let xt=this.points[ce.index];Pe=xt.properties,Ge=V(xt.geometry.coordinates[0]),Ae=F(xt.geometry.coordinates[1])}let gt={type:1,geometry:[[Math.round(this.options.extent*(Ge*re-j)),Math.round(this.options.extent*(Ae*re-J))]],tags:Pe},lt;fe?lt=ce.id:this.options.generateId?lt=ce.index:this.points[ce.index].id&&(lt=this.points[ce.index].id),lt!==void 0&&(gt.id=lt),pe.features.push(gt)}}_limitZoom(P){return Math.max(this.options.minZoom,Math.min(+P,this.options.maxZoom+1))}_cluster(P,L){let j=[],{radius:J,extent:re,reduce:pe,minPoints:ue}=this.options,ce=J/(re*Math.pow(2,L));for(let fe=0;fe<P.length;fe++){let Pe=P[fe];if(Pe.zoom<=L)continue;Pe.zoom=L;let Ge=this.trees[L+1],Ae=Ge.within(Pe.x,Pe.y,ce),gt=Pe.numPoints||1,lt=gt;for(let xt of Ae){let Ct=Ge.points[xt];Ct.zoom>L&&(lt+=Ct.numPoints||1)}if(lt>gt&&lt>=ue){let xt=Pe.x*gt,Ct=Pe.y*gt,ni=pe&&gt>1?this._map(Pe,!0):null,$t=(fe<<5)+(L+1)+this.points.length;for(let Ut of Ae){let Bt=Ge.points[Ut];if(Bt.zoom<=L)continue;Bt.zoom=L;let Rt=Bt.numPoints||1;xt+=Bt.x*Rt,Ct+=Bt.y*Rt,Bt.parentId=$t,pe&&(ni||(ni=this._map(Pe,!0)),pe(ni,this._map(Bt)))}Pe.parentId=$t,j.push(rn(xt/lt,Ct/lt,$t,lt,ni))}else if(j.push(Pe),lt>1)for(let xt of Ae){let Ct=Ge.points[xt];Ct.zoom<=L||(Ct.zoom=L,j.push(Ct))}}return j}_getOriginId(P){return P-this.points.length>>5}_getOriginZoom(P){return(P-this.points.length)%32}_map(P,L){if(P.numPoints)return L?K({},P.properties):P.properties;let j=this.points[P.index].properties,J=this.options.map(j);return L&&J===j?K({},J):J}}function rn(Y,P,L,j,J){return{x:ii(Y),y:ii(P),zoom:1/0,id:L,parentId:-1,numPoints:j,properties:J}}function zr(Y,P){let[L,j]=Y.geometry.coordinates;return{x:ii(V(L)),y:ii(F(j)),zoom:1/0,index:P,parentId:-1}}function Qo(Y){return{type:"Feature",id:Y.id,properties:_e(Y),geometry:{type:"Point",coordinates:[(P=Y.x,360*(P-.5)),U(Y.y)]}};var P}function _e(Y){let P=Y.numPoints,L=P>=1e4?`${Math.round(P/1e3)}k`:P>=1e3?Math.round(P/100)/10+"k":P;return K(K({},Y.properties),{cluster:!0,cluster_id:Y.id,point_count:P,point_count_abbreviated:L})}function V(Y){return Y/360+.5}function F(Y){let P=Math.sin(Y*Math.PI/180),L=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return L<0?0:L>1?1:L}function U(Y){let P=(180-360*Y)*Math.PI/180;return 360*Math.atan(Math.exp(P))/Math.PI-90}function K(Y,P){for(let L in P)Y[L]=P[L];return Y}function he(Y){return Y.x}function Ie(Y){return Y.y}function Ve(Y,P,L,j){for(var J,re=j,pe=L-P>>1,ue=L-P,ce=Y[P],fe=Y[P+1],Pe=Y[L],Ge=Y[L+1],Ae=P+3;Ae<L;Ae+=3){var gt=He(Y[Ae],Y[Ae+1],ce,fe,Pe,Ge);if(gt>re)J=Ae,re=gt;else if(gt===re){var lt=Math.abs(Ae-pe);lt<ue&&(J=Ae,ue=lt)}}re>j&&(J-P>3&&Ve(Y,P,J,j),Y[J+2]=re,L-J>3&&Ve(Y,J,L,j))}function He(Y,P,L,j,J,re){var pe=J-L,ue=re-j;if(pe!==0||ue!==0){var ce=((Y-L)*pe+(P-j)*ue)/(pe*pe+ue*ue);ce>1?(L=J,j=re):ce>0&&(L+=pe*ce,j+=ue*ce)}return(pe=Y-L)*pe+(ue=P-j)*ue}function ye(Y,P,L,j){var J={id:Y===void 0?null:Y,type:P,geometry:L,tags:j,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(re){var pe=re.geometry,ue=re.type;if(ue==="Point"||ue==="MultiPoint"||ue==="LineString")Re(re,pe);else if(ue==="Polygon"||ue==="MultiLineString")for(var ce=0;ce<pe.length;ce++)Re(re,pe[ce]);else if(ue==="MultiPolygon")for(ce=0;ce<pe.length;ce++)for(var fe=0;fe<pe[ce].length;fe++)Re(re,pe[ce][fe])}(J),J}function Re(Y,P){for(var L=0;L<P.length;L+=3)Y.minX=Math.min(Y.minX,P[L]),Y.minY=Math.min(Y.minY,P[L+1]),Y.maxX=Math.max(Y.maxX,P[L]),Y.maxY=Math.max(Y.maxY,P[L+1])}function ie(Y,P,L,j){if(P.geometry){var J=P.geometry.coordinates,re=P.geometry.type,pe=Math.pow(L.tolerance/((1<<L.maxZoom)*L.extent),2),ue=[],ce=P.id;if(L.promoteId?ce=P.properties[L.promoteId]:L.generateId&&(ce=j||0),re==="Point")Xe(J,ue);else if(re==="MultiPoint")for(var fe=0;fe<J.length;fe++)Xe(J[fe],ue);else if(re==="LineString")$e(J,ue,pe,!1);else if(re==="MultiLineString"){if(L.lineMetrics){for(fe=0;fe<J.length;fe++)$e(J[fe],ue=[],pe,!1),Y.push(ye(ce,"LineString",ue,P.properties));return}ft(J,ue,pe,!1)}else if(re==="Polygon")ft(J,ue,pe,!0);else{if(re!=="MultiPolygon"){if(re==="GeometryCollection"){for(fe=0;fe<P.geometry.geometries.length;fe++)ie(Y,{id:ce,geometry:P.geometry.geometries[fe],properties:P.properties},L,j);return}throw new Error("Input data is not a valid GeoJSON object.")}for(fe=0;fe<J.length;fe++){var Pe=[];ft(J[fe],Pe,pe,!0),ue.push(Pe)}}Y.push(ye(ce,re,ue,P.properties))}}function Xe(Y,P){P.push(ut(Y[0])),P.push(Ht(Y[1])),P.push(0)}function $e(Y,P,L,j){for(var J,re,pe=0,ue=0;ue<Y.length;ue++){var ce=ut(Y[ue][0]),fe=Ht(Y[ue][1]);P.push(ce),P.push(fe),P.push(0),ue>0&&(pe+=j?(J*fe-ce*re)/2:Math.sqrt(Math.pow(ce-J,2)+Math.pow(fe-re,2))),J=ce,re=fe}var Pe=P.length-3;P[2]=1,Ve(P,0,Pe,L),P[Pe+2]=1,P.size=Math.abs(pe),P.start=0,P.end=P.size}function ft(Y,P,L,j){for(var J=0;J<Y.length;J++){var re=[];$e(Y[J],re,L,j),P.push(re)}}function ut(Y){return Y/360+.5}function Ht(Y){var P=Math.sin(Y*Math.PI/180),L=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return L<0?0:L>1?1:L}function Tt(Y,P,L,j,J,re,pe,ue){if(j/=P,re>=(L/=P)&&pe<j)return Y;if(pe<L||re>=j)return null;for(var ce=[],fe=0;fe<Y.length;fe++){var Pe=Y[fe],Ge=Pe.geometry,Ae=Pe.type,gt=J===0?Pe.minX:Pe.minY,lt=J===0?Pe.maxX:Pe.maxY;if(gt>=L&&lt<j)ce.push(Pe);else if(!(lt<L||gt>=j)){var xt=[];if(Ae==="Point"||Ae==="MultiPoint")Ue(Ge,xt,L,j,J);else if(Ae==="LineString")It(Ge,xt,L,j,J,!1,ue.lineMetrics);else if(Ae==="MultiLineString")ri(Ge,xt,L,j,J,!1);else if(Ae==="Polygon")ri(Ge,xt,L,j,J,!0);else if(Ae==="MultiPolygon")for(var Ct=0;Ct<Ge.length;Ct++){var ni=[];ri(Ge[Ct],ni,L,j,J,!0),ni.length&&xt.push(ni)}if(xt.length){if(ue.lineMetrics&&Ae==="LineString"){for(Ct=0;Ct<xt.length;Ct++)ce.push(ye(Pe.id,Ae,xt[Ct],Pe.tags));continue}Ae!=="LineString"&&Ae!=="MultiLineString"||(xt.length===1?(Ae="LineString",xt=xt[0]):Ae="MultiLineString"),Ae!=="Point"&&Ae!=="MultiPoint"||(Ae=xt.length===3?"Point":"MultiPoint"),ce.push(ye(Pe.id,Ae,xt,Pe.tags))}}}return ce.length?ce:null}function Ue(Y,P,L,j,J){for(var re=0;re<Y.length;re+=3){var pe=Y[re+J];pe>=L&&pe<=j&&(P.push(Y[re]),P.push(Y[re+1]),P.push(Y[re+2]))}}function It(Y,P,L,j,J,re,pe){for(var ue,ce,fe=yt(Y),Pe=J===0?St:tr,Ge=Y.start,Ae=0;Ae<Y.length-3;Ae+=3){var gt=Y[Ae],lt=Y[Ae+1],xt=Y[Ae+2],Ct=Y[Ae+3],ni=Y[Ae+4],$t=J===0?gt:lt,Ut=J===0?Ct:ni,Bt=!1;pe&&(ue=Math.sqrt(Math.pow(gt-Ct,2)+Math.pow(lt-ni,2))),$t<L?Ut>L&&(ce=Pe(fe,gt,lt,Ct,ni,L),pe&&(fe.start=Ge+ue*ce)):$t>j?Ut<j&&(ce=Pe(fe,gt,lt,Ct,ni,j),pe&&(fe.start=Ge+ue*ce)):gi(fe,gt,lt,xt),Ut<L&&$t>=L&&(ce=Pe(fe,gt,lt,Ct,ni,L),Bt=!0),Ut>j&&$t<=j&&(ce=Pe(fe,gt,lt,Ct,ni,j),Bt=!0),!re&&Bt&&(pe&&(fe.end=Ge+ue*ce),P.push(fe),fe=yt(Y)),pe&&(Ge+=ue)}var Rt=Y.length-3;gt=Y[Rt],lt=Y[Rt+1],xt=Y[Rt+2],($t=J===0?gt:lt)>=L&&$t<=j&&gi(fe,gt,lt,xt),Rt=fe.length-3,re&&Rt>=3&&(fe[Rt]!==fe[0]||fe[Rt+1]!==fe[1])&&gi(fe,fe[0],fe[1],fe[2]),fe.length&&P.push(fe)}function yt(Y){var P=[];return P.size=Y.size,P.start=Y.start,P.end=Y.end,P}function ri(Y,P,L,j,J,re){for(var pe=0;pe<Y.length;pe++)It(Y[pe],P,L,j,J,re,!1)}function gi(Y,P,L,j){Y.push(P),Y.push(L),Y.push(j)}function St(Y,P,L,j,J,re){var pe=(re-P)/(j-P);return Y.push(re),Y.push(L+(J-L)*pe),Y.push(1),pe}function tr(Y,P,L,j,J,re){var pe=(re-L)/(J-L);return Y.push(P+(j-P)*pe),Y.push(re),Y.push(1),pe}function ci(Y,P){for(var L=[],j=0;j<Y.length;j++){var J,re=Y[j],pe=re.type;if(pe==="Point"||pe==="MultiPoint"||pe==="LineString")J=Ri(re.geometry,P);else if(pe==="MultiLineString"||pe==="Polygon"){J=[];for(var ue=0;ue<re.geometry.length;ue++)J.push(Ri(re.geometry[ue],P))}else if(pe==="MultiPolygon")for(J=[],ue=0;ue<re.geometry.length;ue++){for(var ce=[],fe=0;fe<re.geometry[ue].length;fe++)ce.push(Ri(re.geometry[ue][fe],P));J.push(ce)}L.push(ye(re.id,pe,J,re.tags))}return L}function Ri(Y,P){var L=[];L.size=Y.size,Y.start!==void 0&&(L.start=Y.start,L.end=Y.end);for(var j=0;j<Y.length;j+=3)L.push(Y[j]+P,Y[j+1],Y[j+2]);return L}function hi(Y,P){if(Y.transformed)return Y;var L,j,J,re=1<<Y.z,pe=Y.x,ue=Y.y;for(L=0;L<Y.features.length;L++){var ce=Y.features[L],fe=ce.geometry,Pe=ce.type;if(ce.geometry=[],Pe===1)for(j=0;j<fe.length;j+=2)ce.geometry.push(Ft(fe[j],fe[j+1],P,re,pe,ue));else for(j=0;j<fe.length;j++){var Ge=[];for(J=0;J<fe[j].length;J+=2)Ge.push(Ft(fe[j][J],fe[j][J+1],P,re,pe,ue));ce.geometry.push(Ge)}}return Y.transformed=!0,Y}function Ft(Y,P,L,j,J,re){return[Math.round(L*(Y*j-J)),Math.round(L*(P*j-re))]}function di(Y,P,L,j,J){for(var re=P===J.maxZoom?0:J.tolerance/((1<<P)*J.extent),pe={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:L,y:j,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},ue=0;ue<Y.length;ue++){pe.numFeatures++,ir(pe,Y[ue],re,J);var ce=Y[ue].minX,fe=Y[ue].minY,Pe=Y[ue].maxX,Ge=Y[ue].maxY;ce<pe.minX&&(pe.minX=ce),fe<pe.minY&&(pe.minY=fe),Pe>pe.maxX&&(pe.maxX=Pe),Ge>pe.maxY&&(pe.maxY=Ge)}return pe}function ir(Y,P,L,j){var J=P.geometry,re=P.type,pe=[];if(re==="Point"||re==="MultiPoint")for(var ue=0;ue<J.length;ue+=3)pe.push(J[ue]),pe.push(J[ue+1]),Y.numPoints++,Y.numSimplified++;else if(re==="LineString")Ai(pe,J,Y,L,!1,!1);else if(re==="MultiLineString"||re==="Polygon")for(ue=0;ue<J.length;ue++)Ai(pe,J[ue],Y,L,re==="Polygon",ue===0);else if(re==="MultiPolygon")for(var ce=0;ce<J.length;ce++){var fe=J[ce];for(ue=0;ue<fe.length;ue++)Ai(pe,fe[ue],Y,L,!0,ue===0)}if(pe.length){var Pe=P.tags||null;if(re==="LineString"&&j.lineMetrics){for(var Ge in Pe={},P.tags)Pe[Ge]=P.tags[Ge];Pe.mapbox_clip_start=J.start/J.size,Pe.mapbox_clip_end=J.end/J.size}var Ae={geometry:pe,type:re==="Polygon"||re==="MultiPolygon"?3:re==="LineString"||re==="MultiLineString"?2:1,tags:Pe};P.id!==null&&(Ae.id=P.id),Y.features.push(Ae)}}function Ai(Y,P,L,j,J,re){var pe=j*j;if(j>0&&P.size<(J?pe:j))L.numPoints+=P.length/3;else{for(var ue=[],ce=0;ce<P.length;ce+=3)(j===0||P[ce+2]>pe)&&(L.numSimplified++,ue.push(P[ce]),ue.push(P[ce+1])),L.numPoints++;J&&function(fe,Pe){for(var Ge=0,Ae=0,gt=fe.length,lt=gt-2;Ae<gt;lt=Ae,Ae+=2)Ge+=(fe[Ae]-fe[lt])*(fe[Ae+1]+fe[lt+1]);if(Ge>0===Pe)for(Ae=0,gt=fe.length;Ae<gt/2;Ae+=2){var xt=fe[Ae],Ct=fe[Ae+1];fe[Ae]=fe[gt-2-Ae],fe[Ae+1]=fe[gt-1-Ae],fe[gt-2-Ae]=xt,fe[gt-1-Ae]=Ct}}(ue,re),Y.push(ue)}}function Mr(Y,P){var L=(P=this.options=function(J,re){for(var pe in re)J[pe]=re[pe];return J}(Object.create(this.options),P)).debug;if(L&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var j=function(J,re){var pe=[];if(J.type==="FeatureCollection")for(var ue=0;ue<J.features.length;ue++)ie(pe,J.features[ue],re,ue);else ie(pe,J.type==="Feature"?J:{geometry:J},re);return pe}(Y,P);this.tiles={},this.tileCoords=[],L&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),j=function(J,re){var pe=re.buffer/re.extent,ue=J,ce=Tt(J,1,-1-pe,pe,0,-1,2,re),fe=Tt(J,1,1-pe,2+pe,0,-1,2,re);return(ce||fe)&&(ue=Tt(J,1,-pe,1+pe,0,-1,2,re)||[],ce&&(ue=ci(ce,1).concat(ue)),fe&&(ue=ue.concat(ci(fe,-1)))),ue}(j,P),j.length&&this.splitTile(j,0,0,0),L&&(j.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 rr(Y,P,L){return 32*((1<<Y)*L+P)+Y}function Ti(Y,P){let L=Y.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);let j=this._geoJSONIndex.getTile(L.z,L.x,L.y);if(!j)return P(null,null);let J=new ve(j.features),re=si(J);re.byteOffset===0&&re.byteLength===re.buffer.byteLength||(re=new Uint8Array(re)),P(null,{vectorTile:J,rawData:re.buffer})}Mr.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Mr.prototype.splitTile=function(Y,P,L,j,J,re,pe){for(var ue=[Y,P,L,j],ce=this.options,fe=ce.debug;ue.length;){j=ue.pop(),L=ue.pop(),P=ue.pop(),Y=ue.pop();var Pe=1<<P,Ge=rr(P,L,j),Ae=this.tiles[Ge];if(!Ae&&(fe>1&&console.time("creation"),Ae=this.tiles[Ge]=di(Y,P,L,j,ce),this.tileCoords.push({z:P,x:L,y:j}),fe)){fe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,L,j,Ae.numFeatures,Ae.numPoints,Ae.numSimplified),console.timeEnd("creation"));var gt="z"+P;this.stats[gt]=(this.stats[gt]||0)+1,this.total++}if(Ae.source=Y,J){if(P===ce.maxZoom||P===J)continue;var lt=1<<J-P;if(L!==Math.floor(re/lt)||j!==Math.floor(pe/lt))continue}else if(P===ce.indexMaxZoom||Ae.numPoints<=ce.indexMaxPoints)continue;if(Ae.source=null,Y.length!==0){fe>1&&console.time("clipping");var xt,Ct,ni,$t,Ut,Bt,Rt=.5*ce.buffer/ce.extent,cr=.5-Rt,nr=.5+Rt,Lr=1+Rt;xt=Ct=ni=$t=null,Ut=Tt(Y,Pe,L-Rt,L+nr,0,Ae.minX,Ae.maxX,ce),Bt=Tt(Y,Pe,L+cr,L+Lr,0,Ae.minX,Ae.maxX,ce),Y=null,Ut&&(xt=Tt(Ut,Pe,j-Rt,j+nr,1,Ae.minY,Ae.maxY,ce),Ct=Tt(Ut,Pe,j+cr,j+Lr,1,Ae.minY,Ae.maxY,ce),Ut=null),Bt&&(ni=Tt(Bt,Pe,j-Rt,j+nr,1,Ae.minY,Ae.maxY,ce),$t=Tt(Bt,Pe,j+cr,j+Lr,1,Ae.minY,Ae.maxY,ce),Bt=null),fe>1&&console.timeEnd("clipping"),ue.push(xt||[],P+1,2*L,2*j),ue.push(Ct||[],P+1,2*L,2*j+1),ue.push(ni||[],P+1,2*L+1,2*j),ue.push($t||[],P+1,2*L+1,2*j+1)}}},Mr.prototype.getTile=function(Y,P,L){var j=this.options,J=j.extent,re=j.debug;if(Y<0||Y>24)return null;var pe=1<<Y,ue=rr(Y,P=(P%pe+pe)%pe,L);if(this.tiles[ue])return hi(this.tiles[ue],J);re>1&&console.log("drilling down to z%d-%d-%d",Y,P,L);for(var ce,fe=Y,Pe=P,Ge=L;!ce&&fe>0;)fe--,Pe=Math.floor(Pe/2),Ge=Math.floor(Ge/2),ce=this.tiles[rr(fe,Pe,Ge)];return ce&&ce.source?(re>1&&console.log("found parent tile z%d-%d-%d",fe,Pe,Ge),re>1&&console.time("drilling down"),this.splitTile(ce.source,fe,Pe,Ge,Y,P,L),re>1&&console.timeEnd("drilling down"),this.tiles[ue]?hi(this.tiles[ue],J):null):null};class oa extends q{constructor(P,L,j,J){super(P,L,j,Ti),J&&(this.loadGeoJSON=J)}loadData(P,L){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=L,this._pendingLoadDataParams=P,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())}_loadData(){if(!this._pendingCallback||!this._pendingLoadDataParams)return;let P=this._pendingCallback,L=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;let j=!!(L&&L.request&&L.request.collectResourceTiming)&&new o.RequestPerformance(L.request);this.loadGeoJSON(L,(J,re)=>{if(J||!re)return P(J);if(typeof re!="object")return P(new Error(`Input data given to '${L.source}' is not a valid GeoJSON object.`));{le(re,!0);try{if(L.filter){let ue=o.createExpression(L.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ue.result==="error")throw new Error(ue.value.map(fe=>`${fe.key}: ${fe.message}`).join(", "));let ce=re.features.filter(fe=>ue.value.evaluate({zoom:0},fe));re={type:"FeatureCollection",features:ce}}this._geoJSONIndex=L.cluster?new hn(function({superclusterOptions:ue,clusterProperties:ce}){if(!ce||!ue)return ue;let fe={},Pe={},Ge={accumulated:null,zoom:0},Ae={properties:null},gt=Object.keys(ce);for(let lt of gt){let[xt,Ct]=ce[lt],ni=o.createExpression(Ct),$t=o.createExpression(typeof xt=="string"?[xt,["accumulated"],["get",lt]]:xt);fe[lt]=ni.value,Pe[lt]=$t.value}return ue.map=lt=>{Ae.properties=lt;let xt={};for(let Ct of gt)xt[Ct]=fe[Ct].evaluate(Ge,Ae);return xt},ue.reduce=(lt,xt)=>{Ae.properties=xt;for(let Ct of gt)Ge.accumulated=lt[Ct],lt[Ct]=Pe[Ct].evaluate(Ge,Ae)},ue}(L)).load(re.features):function(ue,ce){return new Mr(ue,ce)}(re,L.geojsonVtOptions)}catch(ue){return P(ue)}this.loaded={};let pe={};if(j){let ue=j.finish();ue&&(pe.resourceTiming={},pe.resourceTiming[L.source]=JSON.parse(JSON.stringify(ue)))}P(null,pe)}})}coalesce(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())}reloadTile(P,L){let j=this.loaded;return j&&j[P.uid]?super.reloadTile(P,L):this.loadTile(P,L)}loadGeoJSON(P,L){if(P.request)o.getJSON(P.request,L);else{if(typeof P.data!="string")return L(new Error(`Input data given to '${P.source}' is not a valid GeoJSON object.`));try{return L(null,JSON.parse(P.data))}catch{return L(new Error(`Input data given to '${P.source}' is not a valid GeoJSON object.`))}}}removeSource(P,L){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),L()}getClusterExpansionZoom(P,L){try{L(null,this._geoJSONIndex.getClusterExpansionZoom(P.clusterId))}catch(j){L(j)}}getClusterChildren(P,L){try{L(null,this._geoJSONIndex.getChildren(P.clusterId))}catch(j){L(j)}}getClusterLeaves(P,L){try{L(null,this._geoJSONIndex.getLeaves(P.clusterId,P.limit,P.offset))}catch(j){L(j)}}}class sa{constructor(P){this.self=P,this.actor=new o.Actor(P,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:q,geojson:oa},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(L,j)=>{if(this.workerSourceTypes[L])throw new Error(`Worker source with name "${L}" already registered.`);this.workerSourceTypes[L]=j},this.self.registerRTLTextPlugin=L=>{if(o.plugin.isParsed())throw new Error("RTL text plugin already registered.");o.plugin.applyArabicShaping=L.applyArabicShaping,o.plugin.processBidirectionalText=L.processBidirectionalText,o.plugin.processStyledBidirectionalText=L.processStyledBidirectionalText}}setReferrer(P,L){this.referrer=L}setImages(P,L,j){this.availableImages[P]=L;for(let J in this.workerSources[P]){let re=this.workerSources[P][J];for(let pe in re)re[pe].availableImages=L}j()}setLayers(P,L,j){this.getLayerIndex(P).replace(L),j()}updateLayers(P,L,j){this.getLayerIndex(P).update(L.layers,L.removedIds),j()}loadTile(P,L,j){this.getWorkerSource(P,L.type,L.source).loadTile(L,j)}loadDEMTile(P,L,j){this.getDEMWorkerSource(P,L.source).loadTile(L,j)}reloadTile(P,L,j){this.getWorkerSource(P,L.type,L.source).reloadTile(L,j)}abortTile(P,L,j){this.getWorkerSource(P,L.type,L.source).abortTile(L,j)}removeTile(P,L,j){this.getWorkerSource(P,L.type,L.source).removeTile(L,j)}removeDEMTile(P,L){this.getDEMWorkerSource(P,L.source).removeTile(L)}removeSource(P,L,j){if(!this.workerSources[P]||!this.workerSources[P][L.type]||!this.workerSources[P][L.type][L.source])return;let J=this.workerSources[P][L.type][L.source];delete this.workerSources[P][L.type][L.source],J.removeSource!==void 0?J.removeSource(L,j):j()}loadWorkerSource(P,L,j){try{this.self.importScripts(L.url),j()}catch(J){j(J.toString())}}syncRTLPluginState(P,L,j){try{o.plugin.setState(L);let J=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&J!=null){this.self.importScripts(J);let re=o.plugin.isParsed();j(re?void 0:new Error(`RTL Text Plugin failed to import scripts from ${J}`),re)}}catch(J){j(J.toString())}}getAvailableImages(P){let L=this.availableImages[P];return L||(L=[]),L}getLayerIndex(P){let L=this.layerIndexes[P];return L||(L=this.layerIndexes[P]=new b),L}getWorkerSource(P,L,j){if(this.workerSources[P]||(this.workerSources[P]={}),this.workerSources[P][L]||(this.workerSources[P][L]={}),!this.workerSources[P][L][j]){let J={send:(re,pe,ue)=>{this.actor.send(re,pe,ue,P)}};this.workerSources[P][L][j]=new this.workerSourceTypes[L](J,this.getLayerIndex(P),this.getAvailableImages(P))}return this.workerSources[P][L][j]}getDEMWorkerSource(P,L){return this.demWorkerSources[P]||(this.demWorkerSources[P]={}),this.demWorkerSources[P][L]||(this.demWorkerSources[P][L]=new ee),this.demWorkerSources[P][L]}enforceCacheSizeLimit(P,L){o.enforceCacheSizeLimit(L)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new sa(self)),sa}),l(["./shared"],function(o){"use strict";var m=v;function v(f){return!function(n){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var d,g,_=new Blob([""],{type:"text/javascript"}),I=URL.createObjectURL(_);try{g=new Worker(I),d=!0}catch{d=!1}return g&&g.terminate(),URL.revokeObjectURL(I),d}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var d=document.createElement("canvas");d.width=d.height=1;var g=d.getContext("2d");if(!g)return!1;var _=g.getImageData(0,0,1,1);return _&&_.width===d.width}()?(b[c=n&&n.failIfMajorPerformanceCaveat]===void 0&&(b[c]=function(d){var g,_=function(I){var M=document.createElement("canvas"),E=Object.create(v.webGLContextAttributes);return E.failIfMajorPerformanceCaveat=I,M.getContext("webgl",E)||M.getContext("experimental-webgl",E)}(d);if(!_)return!1;try{g=_.createShader(_.VERTEX_SHADER)}catch{return!1}return!(!g||_.isContextLost())&&(_.shaderSource(g,"void main() {}"),_.compileShader(g),_.getShaderParameter(g,_.COMPILE_STATUS)===!0)}(c)),b[c]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var c}(f)}var b={};function C(f,n){if(Array.isArray(f)){if(!Array.isArray(n)||f.length!==n.length)return!1;for(let c=0;c<f.length;c++)if(!C(f[c],n[c]))return!1;return!0}if(typeof f=="object"&&f!==null&&n!==null){if(typeof n!="object"||Object.keys(f).length!==Object.keys(n).length)return!1;for(let c in f)if(!C(f[c],n[c]))return!1;return!0}return f===n}v.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class A{static testProp(n){if(!A.docStyle)return n[0];for(let c=0;c<n.length;c++)if(n[c]in A.docStyle)return n[c];return n[0]}static create(n,c,d){let g=window.document.createElement(n);return c!==void 0&&(g.className=c),d&&d.appendChild(g),g}static createNS(n,c){return window.document.createElementNS(n,c)}static disableDrag(){A.docStyle&&A.selectProp&&(A.userSelect=A.docStyle[A.selectProp],A.docStyle[A.selectProp]="none")}static enableDrag(){A.docStyle&&A.selectProp&&(A.docStyle[A.selectProp]=A.userSelect)}static setTransform(n,c){n.style[A.transformProp]=c}static addEventListener(n,c,d,g={}){n.addEventListener(c,d,"passive"in g?g:g.capture)}static removeEventListener(n,c,d,g={}){n.removeEventListener(c,d,"passive"in g?g:g.capture)}static suppressClickInternal(n){n.preventDefault(),n.stopPropagation(),window.removeEventListener("click",A.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",A.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",A.suppressClickInternal,!0)},0)}static mousePos(n,c){let d=n.getBoundingClientRect();return new o.pointGeometry(c.clientX-d.left-n.clientLeft,c.clientY-d.top-n.clientTop)}static touchPos(n,c){let d=n.getBoundingClientRect(),g=[];for(let _=0;_<c.length;_++)g.push(new o.pointGeometry(c[_].clientX-d.left-n.clientLeft,c[_].clientY-d.top-n.clientTop));return g}static mouseButton(n){return n.button}static remove(n){n.parentNode&&n.parentNode.removeChild(n)}}A.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,A.selectProp=A.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),A.transformProp=A.testProp(["transform","WebkitTransform"]);class B{constructor(n){this._transformRequestFn=n}transformRequest(n,c){return this._transformRequestFn&&this._transformRequestFn(n,c)||{url:n}}normalizeSpriteURL(n,c,d){let g=function(_){let I=_.match(Z);if(!I)throw new Error(`Unable to parse URL "${_}"`);return{protocol:I[1],authority:I[2],path:I[3]||"/",params:I[4]?I[4].split("&"):[]}}(n);return g.path+=`${c}${d}`,function(_){let I=_.params.length?`?${_.params.join("&")}`:"";return`${_.protocol}://${_.authority}${_.path}${I}`}(g)}setTransformRequest(n){this._transformRequestFn=n}}let Z=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function q(f){var n=new o.ARRAY_TYPE(3);return n[0]=f[0],n[1]=f[1],n[2]=f[2],n}var ee,le=function(f,n,c){return f[0]=n[0]-c[0],f[1]=n[1]-c[1],f[2]=n[2]-c[2],f};ee=new o.ARRAY_TYPE(3),o.ARRAY_TYPE!=Float32Array&&(ee[0]=0,ee[1]=0,ee[2]=0);var de=function(f){var n=f[0],c=f[1];return n*n+c*c};(function(){var f=new o.ARRAY_TYPE(2);o.ARRAY_TYPE!=Float32Array&&(f[0]=0,f[1]=0)})();class H{constructor(n,c,d,g){this.context=n,this.format=d,this.texture=n.gl.createTexture(),this.update(c,g)}update(n,c,d){let{width:g,height:_}=n,I=!(this.size&&this.size[0]===g&&this.size[1]===_||d),{context:M}=this,{gl:E}=M;if(this.useMipmap=Boolean(c&&c.useMipmap),E.bindTexture(E.TEXTURE_2D,this.texture),M.pixelStoreUnpackFlipY.set(!1),M.pixelStoreUnpack.set(1),M.pixelStoreUnpackPremultiplyAlpha.set(this.format===E.RGBA&&(!c||c.premultiply!==!1)),I)this.size=[g,_],n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageData||o.isImageBitmap(n)?E.texImage2D(E.TEXTURE_2D,0,this.format,this.format,E.UNSIGNED_BYTE,n):E.texImage2D(E.TEXTURE_2D,0,this.format,g,_,0,this.format,E.UNSIGNED_BYTE,n.data);else{let{x:k,y:D}=d||{x:0,y:0};n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageData||o.isImageBitmap(n)?E.texSubImage2D(E.TEXTURE_2D,0,k,D,E.RGBA,E.UNSIGNED_BYTE,n):E.texSubImage2D(E.TEXTURE_2D,0,k,D,g,_,E.RGBA,E.UNSIGNED_BYTE,n.data)}this.useMipmap&&this.isSizePowerOfTwo()&&E.generateMipmap(E.TEXTURE_2D)}bind(n,c,d){let{context:g}=this,{gl:_}=g;_.bindTexture(_.TEXTURE_2D,this.texture),d!==_.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(d=_.LINEAR),n!==this.filter&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,n),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,d||n),this.filter=n),c!==this.wrap&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,c),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,c),this.wrap=c)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:n}=this.context;n.deleteTexture(this.texture),this.texture=null}}function Q(f){let{userImage:n}=f;return!!(n&&n.render&&n.render())&&(f.data.replace(new Uint8Array(n.data.buffer)),!0)}class te extends o.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new o.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(n){if(this.loaded!==n&&(this.loaded=n,n)){for(let{ids:c,callback:d}of this.requestors)this._notify(c,d);this.requestors=[]}}getImage(n){return this.images[n]}addImage(n,c){this._validate(n,c)&&(this.images[n]=c)}_validate(n,c){let d=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "stretchX" value`))),d=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "stretchY" value`))),d=!1),this._validateContent(c.content,c)||(this.fire(new o.ErrorEvent(new Error(`Image "${n}" has invalid "content" value`))),d=!1),d}_validateStretch(n,c){if(!n)return!0;let d=0;for(let g of n){if(g[0]<d||g[1]<g[0]||c<g[1])return!1;d=g[1]}return!0}_validateContent(n,c){return!(n&&(n.length!==4||n[0]<0||c.data.width<n[0]||n[1]<0||c.data.height<n[1]||n[2]<0||c.data.width<n[2]||n[3]<0||c.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))}updateImage(n,c){c.version=this.images[n].version+1,this.images[n]=c,this.updatedImages[n]=!0}removeImage(n){let c=this.images[n];delete this.images[n],delete this.patterns[n],c.userImage&&c.userImage.onRemove&&c.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(n,c){let d=!0;if(!this.isLoaded())for(let g of n)this.images[g]||(d=!1);this.isLoaded()||d?this._notify(n,c):this.requestors.push({ids:n,callback:c})}_notify(n,c){let d={};for(let g of n){this.images[g]||this.fire(new o.Event("styleimagemissing",{id:g}));let _=this.images[g];_?d[g]={data:_.data.clone(),pixelRatio:_.pixelRatio,sdf:_.sdf,version:_.version,stretchX:_.stretchX,stretchY:_.stretchY,content:_.content,hasRenderCallback:Boolean(_.userImage&&_.userImage.render)}:o.warnOnce(`Image "${g}" 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.`)}c(null,d)}getPixelSize(){let{width:n,height:c}=this.atlasImage;return{width:n,height:c}}getPattern(n){let c=this.patterns[n],d=this.getImage(n);if(!d)return null;if(c&&c.position.version===d.version)return c.position;if(c)c.position.version=d.version;else{let g={w:d.data.width+2,h:d.data.height+2,x:0,y:0},_=new o.ImagePosition(g,d);this.patterns[n]={bin:g,position:_}}return this._updatePatternAtlas(),this.patterns[n].position}bind(n){let c=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new H(n,this.atlasImage,c.RGBA),this.atlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE)}_updatePatternAtlas(){let n=[];for(let _ in this.patterns)n.push(this.patterns[_].bin);let{w:c,h:d}=o.potpack(n),g=this.atlasImage;g.resize({width:c||1,height:d||1});for(let _ in this.patterns){let{bin:I}=this.patterns[_],M=I.x+1,E=I.y+1,k=this.images[_].data,D=k.width,O=k.height;o.RGBAImage.copy(k,g,{x:0,y:0},{x:M,y:E},{width:D,height:O}),o.RGBAImage.copy(k,g,{x:0,y:O-1},{x:M,y:E-1},{width:D,height:1}),o.RGBAImage.copy(k,g,{x:0,y:0},{x:M,y:E+O},{width:D,height:1}),o.RGBAImage.copy(k,g,{x:D-1,y:0},{x:M-1,y:E},{width:1,height:O}),o.RGBAImage.copy(k,g,{x:0,y:0},{x:M+D,y:E},{width:1,height:O})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(n){for(let c of n){if(this.callbackDispatchedThisFrame[c])continue;this.callbackDispatchedThisFrame[c]=!0;let d=this.images[c];Q(d)&&this.updateImage(c,d)}}}let ve=1e20;function Ce(f,n,c,d,g,_,I,M,E){for(let k=n;k<n+d;k++)Se(f,c*_+k,_,g,I,M,E);for(let k=c;k<c+g;k++)Se(f,k*_+n,1,d,I,M,E)}function Se(f,n,c,d,g,_,I){_[0]=0,I[0]=-ve,I[1]=ve,g[0]=f[n];for(let M=1,E=0,k=0;M<d;M++){g[M]=f[n+M*c];let D=M*M;do{let O=_[E];k=(g[M]-g[O]+D-O*O)/(M-O)/2}while(k<=I[E]&&--E>-1);E++,_[E]=M,I[E]=k,I[E+1]=ve}for(let M=0,E=0;M<d;M++){for(;I[E+1]<M;)E++;let k=_[E],D=M-k;f[n+M*c]=g[k]+D*D}}class Be{constructor(n,c){this.requestManager=n,this.localIdeographFontFamily=c,this.entries={}}setURL(n){this.url=n}getGlyphs(n,c){let d=[];for(let g in n)for(let _ of n[g])d.push({stack:g,id:_});o.asyncAll(d,({stack:g,id:_},I)=>{let M=this.entries[g];M||(M=this.entries[g]={glyphs:{},requests:{},ranges:{}});let E=M.glyphs[_];if(E!==void 0)return void I(null,{stack:g,id:_,glyph:E});if(E=this._tinySDF(M,g,_),E)return M.glyphs[_]=E,void I(null,{stack:g,id:_,glyph:E});let k=Math.floor(_/256);if(256*k>65535)return void I(new Error("glyphs > 65535 not supported"));if(M.ranges[k])return void I(null,{stack:g,id:_,glyph:E});let D=M.requests[k];D||(D=M.requests[k]=[],Be.loadGlyphRange(g,k,this.url,this.requestManager,(O,X)=>{if(X){for(let oe in X)this._doesCharSupportLocalGlyph(+oe)||(M.glyphs[+oe]=X[+oe]);M.ranges[k]=!0}for(let oe of D)oe(O,X);delete M.requests[k]})),D.push((O,X)=>{O?I(O):X&&I(null,{stack:g,id:_,glyph:X[_]||null})})},(g,_)=>{if(g)c(g);else if(_){let I={};for(let{stack:M,id:E,glyph:k}of _)(I[M]||(I[M]={}))[E]=k&&{id:k.id,bitmap:k.bitmap.clone(),metrics:k.metrics};c(null,I)}})}_doesCharSupportLocalGlyph(n){return!!this.localIdeographFontFamily&&(o.unicodeBlockLookup["CJK Unified Ideographs"](n)||o.unicodeBlockLookup["Hangul Syllables"](n)||o.unicodeBlockLookup.Hiragana(n)||o.unicodeBlockLookup.Katakana(n))}_tinySDF(n,c,d){let g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(d))return;let _=n.tinySDF;if(!_){let M="400";/bold/i.test(c)?M="900":/medium/i.test(c)?M="500":/light/i.test(c)&&(M="200"),_=n.tinySDF=new Be.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:g,fontWeight:M})}let I=_.draw(String.fromCharCode(d));return{id:d,bitmap:new o.AlphaImage({width:I.width||30,height:I.height||30},I.data),metrics:{width:I.glyphWidth||24,height:I.glyphHeight||24,left:I.glyphLeft||0,top:I.glyphTop-27||-8,advance:I.glyphAdvance||24}}}}Be.loadGlyphRange=function(f,n,c,d,g){let _=256*n,I=_+255,M=d.transformRequest(c.replace("{fontstack}",f).replace("{range}",`${_}-${I}`),o.ResourceType.Glyphs);o.getArrayBuffer(M,(E,k)=>{if(E)g(E);else if(k){let D={};for(let O of o.parseGlyphPBF(k))D[O.id]=O;g(null,D)}})},Be.TinySDF=class{constructor({fontSize:f=24,buffer:n=3,radius:c=8,cutoff:d=.25,fontFamily:g="sans-serif",fontWeight:_="normal",fontStyle:I="normal"}={}){this.buffer=n,this.cutoff=d,this.radius=c;let M=this.size=f+4*n,E=this._createCanvas(M),k=this.ctx=E.getContext("2d",{willReadFrequently:!0});k.font=`${I} ${_} ${f}px ${g}`,k.textBaseline="alphabetic",k.textAlign="left",k.fillStyle="black",this.gridOuter=new Float64Array(M*M),this.gridInner=new Float64Array(M*M),this.f=new Float64Array(M),this.z=new Float64Array(M+1),this.v=new Uint16Array(M)}_createCanvas(f){let n=document.createElement("canvas");return n.width=n.height=f,n}draw(f){let{width:n,actualBoundingBoxAscent:c,actualBoundingBoxDescent:d,actualBoundingBoxLeft:g,actualBoundingBoxRight:_}=this.ctx.measureText(f),I=Math.ceil(c),M=Math.min(this.size-this.buffer,Math.ceil(_-g)),E=Math.min(this.size-this.buffer,I+Math.ceil(d)),k=M+2*this.buffer,D=E+2*this.buffer,O=Math.max(k*D,0),X=new Uint8ClampedArray(O),oe={data:X,width:k,height:D,glyphWidth:M,glyphHeight:E,glyphTop:I,glyphLeft:0,glyphAdvance:n};if(M===0||E===0)return oe;let{ctx:$,buffer:ne,gridInner:me,gridOuter:ge}=this;$.clearRect(ne,ne,M,E),$.fillText(f,ne,ne+I);let we=$.getImageData(ne,ne,M,E);ge.fill(ve,0,O),me.fill(0,0,O);for(let xe=0;xe<E;xe++)for(let Ne=0;Ne<M;Ne++){let Te=we.data[4*(xe*M+Ne)+3]/255;if(Te===0)continue;let ke=(xe+ne)*k+Ne+ne;if(Te===1)ge[ke]=0,me[ke]=ve;else{let je=.5-Te;ge[ke]=je>0?je*je:0,me[ke]=je<0?je*je:0}}Ce(ge,0,0,k,D,k,this.f,this.v,this.z),Ce(me,ne,ne,M,E,k,this.f,this.v,this.z);for(let xe=0;xe<O;xe++){let Ne=Math.sqrt(ge[xe])-Math.sqrt(me[xe]);X[xe]=Math.round(255-255*(Ne/this.radius+this.cutoff))}return oe}};let Fe=new o.Properties({anchor:new o.DataConstantProperty(o.spec.light.anchor),position:new class{constructor(){this.specification=o.spec.light.position}possiblyEvaluate(f,n){return o.sphericalToCartesian(f.expression.evaluate(n))}interpolate(f,n,c){return{x:o.number(f.x,n.x,c),y:o.number(f.y,n.y,c),z:o.number(f.z,n.z,c)}}},color:new o.DataConstantProperty(o.spec.light.color),intensity:new o.DataConstantProperty(o.spec.light.intensity)}),qe="-transition";class ht extends o.Evented{constructor(n){super(),this._transitionable=new o.Transitionable(Fe),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(n,c={}){if(!this._validate(o.validateLight,n,c))for(let d in n){let g=n[d];d.endsWith(qe)?this._transitionable.setTransition(d.slice(0,-qe.length),g):this._transitionable.setValue(d,g)}}updateTransitions(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(n){this.properties=this._transitioning.possiblyEvaluate(n)}_validate(n,c,d){return(!d||d.validate!==!1)&&o.emitValidationErrors(this,n.call(o.validateStyle,o.extend({value:c,style:{glyphs:!0,sprite:!0},styleSpec:o.spec})))}}class At{constructor(n,c){this.width=n,this.height=c,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(n,c){let d=n.join(",")+String(c);return this.dashEntry[d]||(this.dashEntry[d]=this.addDash(n,c)),this.dashEntry[d]}getDashRanges(n,c,d){let g=[],_=n.length%2==1?-n[n.length-1]*d:0,I=n[0]*d,M=!0;g.push({left:_,right:I,isDash:M,zeroLength:n[0]===0});let E=n[0];for(let k=1;k<n.length;k++){M=!M;let D=n[k];_=E*d,E+=D,I=E*d,g.push({left:_,right:I,isDash:M,zeroLength:D===0})}return g}addRoundDash(n,c,d){let g=c/2;for(let _=-d;_<=d;_++){let I=this.width*(this.nextRow+d+_),M=0,E=n[M];for(let k=0;k<this.width;k++){k/E.right>1&&(E=n[++M]);let D=Math.abs(k-E.left),O=Math.abs(k-E.right),X=Math.min(D,O),oe,$=_/d*(g+1);if(E.isDash){let ne=g-Math.abs($);oe=Math.sqrt(X*X+ne*ne)}else oe=g-Math.sqrt(X*X+$*$);this.data[I+k]=Math.max(0,Math.min(255,oe+128))}}}addRegularDash(n){for(let M=n.length-1;M>=0;--M){let E=n[M],k=n[M+1];E.zeroLength?n.splice(M,1):k&&k.isDash===E.isDash&&(k.left=E.left,n.splice(M,1))}let c=n[0],d=n[n.length-1];c.isDash===d.isDash&&(c.left=d.left-this.width,d.right=c.right+this.width);let g=this.width*this.nextRow,_=0,I=n[_];for(let M=0;M<this.width;M++){M/I.right>1&&(I=n[++_]);let E=Math.abs(M-I.left),k=Math.abs(M-I.right),D=Math.min(E,k);this.data[g+M]=Math.max(0,Math.min(255,(I.isDash?D:-D)+128))}}addDash(n,c){let d=c?7:0,g=2*d+1;if(this.nextRow+g>this.height)return o.warnOnce("LineAtlas out of space"),null;let _=0;for(let M=0;M<n.length;M++)_+=n[M];if(_!==0){let M=this.width/_,E=this.getDashRanges(n,this.width,M);c?this.addRoundDash(E,M,d):this.addRegularDash(E)}let I={y:(this.nextRow+d+.5)/this.height,height:2*d/this.height,width:_};return this.nextRow+=g,this.dirty=!0,I}bind(n){let c=n.gl;this.texture?(c.bindTexture(c.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,c.texSubImage2D(c.TEXTURE_2D,0,0,0,this.width,this.height,c.ALPHA,c.UNSIGNED_BYTE,this.data))):(this.texture=c.createTexture(),c.bindTexture(c.TEXTURE_2D,this.texture),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texImage2D(c.TEXTURE_2D,0,c.ALPHA,this.width,this.height,0,c.ALPHA,c.UNSIGNED_BYTE,this.data))}}class Ot{constructor(n,c){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=o.uniqueId();let d=this.workerPool.acquire(this.id);for(let g=0;g<d.length;g++){let _=new Ot.Actor(d[g],c,this.id);_.name=`Worker ${g}`,this.actors.push(_)}}broadcast(n,c,d){o.asyncAll(this.actors,(g,_)=>{g.send(n,c,_)},d=d||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(n=>{n.remove()}),this.actors=[],this.workerPool.release(this.id)}}function Yt(f,n,c){let d=function(g,_){if(g)return c(g);if(_){let I=o.pick(o.extend(_,f),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);_.vector_layers&&(I.vectorLayers=_.vector_layers,I.vectorLayerIds=I.vectorLayers.map(M=>M.id)),c(null,I)}};return f.url?o.getJSON(n.transformRequest(f.url,o.ResourceType.Source),d):o.exported.frame(()=>d(null,f))}Ot.Actor=o.Actor;class at{constructor(n,c,d){this.bounds=o.LngLatBounds.convert(this.validateBounds(n)),this.minzoom=c||0,this.maxzoom=d||24}validateBounds(n){return Array.isArray(n)&&n.length===4?[Math.max(-180,n[0]),Math.max(-90,n[1]),Math.min(180,n[2]),Math.min(90,n[3])]:[-180,-90,180,90]}contains(n){let c=Math.pow(2,n.z),d=Math.floor(o.mercatorXfromLng(this.bounds.getWest())*c),g=Math.floor(o.mercatorYfromLat(this.bounds.getNorth())*c),_=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*c),I=Math.ceil(o.mercatorYfromLat(this.bounds.getSouth())*c);return n.x>=d&&n.x<_&&n.y>=g&&n.y<I}}class Zt extends o.Evented{constructor(n,c,d,g){if(super(),this.id=n,this.dispatcher=d,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.extend(this,o.pick(c,["url","scheme","tileSize","promoteId"])),this._options=o.extend({type:"vector"},c),this._collectResourceTiming=c.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(g)}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Yt(this._options,this.map._requestManager,(n,c)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),n?this.fire(new o.ErrorEvent(n)):c&&(o.extend(this,c),c.bounds&&(this.tileBounds=new at(c.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}onAdd(n){this.map=n,this.load()}setSourceProperty(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.load()}setTiles(n){return this.setSourceProperty(()=>{this._options.tiles=n}),this}setUrl(n){return this.setSourceProperty(()=>{this.url=n,this._options.url=n}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}loadTile(n,c){let d=n.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),g={request:this.map._requestManager.transformRequest(d,o.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function _(I,M){return delete n.request,n.aborted?c(null):I&&I.status!==404?c(I):(M&&M.resourceTiming&&(n.resourceTiming=M.resourceTiming),this.map._refreshExpiredTiles&&M&&n.setExpiryData(M),n.loadVectorData(M,this.map.painter),o.cacheEntryPossiblyAdded(this.dispatcher),c(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}g.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=c:n.request=n.actor.send("reloadTile",g,_.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",g,_.bind(this)))}abortTile(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)}unloadTile(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class zi extends o.Evented{constructor(n,c,d,g){super(),this.id=n,this.dispatcher=d,this.setEventedParent(g),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.extend({type:"raster"},c),o.extend(this,o.pick(c,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Yt(this._options,this.map._requestManager,(n,c)=>{this._tileJSONRequest=null,this._loaded=!0,n?this.fire(new o.ErrorEvent(n)):c&&(o.extend(this,c),c.bounds&&(this.tileBounds=new at(c.bounds,this.minzoom,this.maxzoom)),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(n){this.map=n,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}hasTile(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)}loadTile(n,c){let d=n.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);n.request=o.getImage(this.map._requestManager.transformRequest(d,o.ResourceType.Tile),(g,_,I)=>{if(delete n.request,n.aborted)n.state="unloaded",c(null);else if(g)n.state="errored",c(g);else if(_){this.map._refreshExpiredTiles&&n.setExpiryData(I);let M=this.map.painter.context,E=M.gl;n.texture=this.map.painter.getTileTexture(_.width),n.texture?n.texture.update(_,{useMipmap:!0}):(n.texture=new H(M,_,E.RGBA,{useMipmap:!0}),n.texture.bind(E.LINEAR,E.CLAMP_TO_EDGE,E.LINEAR_MIPMAP_NEAREST),M.extTextureFilterAnisotropic&&E.texParameterf(E.TEXTURE_2D,M.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,M.extTextureFilterAnisotropicMax)),n.state="loaded",o.cacheEntryPossiblyAdded(this.dispatcher),c(null)}})}abortTile(n,c){n.request&&(n.request.cancel(),delete n.request),c()}unloadTile(n,c){n.texture&&this.map.painter.saveTileTexture(n.texture),c()}hasTransition(){return!1}}let Ii;class jt extends zi{constructor(n,c,d,g){super(n,c,d,g),this.type="raster-dem",this.maxzoom=22,this._options=o.extend({type:"raster-dem"},c),this.encoding=c.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(n,c){let d=n.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function g(_,I){_&&(n.state="errored",c(_)),I&&(n.dem=I,n.needsHillshadePrepare=!0,n.state="loaded",c(null))}n.request=o.getImage(this.map._requestManager.transformRequest(d,o.ResourceType.Tile),function(_,I){if(delete n.request,n.aborted)n.state="unloaded",c(null);else if(_)n.state="errored",c(_);else if(I){this.map._refreshExpiredTiles&&n.setExpiryData(I),delete I.cacheControl,delete I.expires;let M=o.isImageBitmap(I)&&(Ii==null&&(Ii=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ii)?I:o.exported.getImageData(I,1),E={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:M,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",E,g.bind(this)))}}.bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)}_getNeighboringTiles(n){let c=n.canonical,d=Math.pow(2,c.z),g=(c.x-1+d)%d,_=c.x===0?n.wrap-1:n.wrap,I=(c.x+1+d)%d,M=c.x+1===d?n.wrap+1:n.wrap,E={};return E[new o.OverscaledTileID(n.overscaledZ,_,c.z,g,c.y).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,M,c.z,I,c.y).key]={backfilled:!1},c.y>0&&(E[new o.OverscaledTileID(n.overscaledZ,_,c.z,g,c.y-1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,n.wrap,c.z,c.x,c.y-1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,M,c.z,I,c.y-1).key]={backfilled:!1}),c.y+1<d&&(E[new o.OverscaledTileID(n.overscaledZ,_,c.z,g,c.y+1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,n.wrap,c.z,c.x,c.y+1).key]={backfilled:!1},E[new o.OverscaledTileID(n.overscaledZ,M,c.z,I,c.y+1).key]={backfilled:!1}),E}unloadTile(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})}}class ur extends o.Evented{constructor(n,c,d,g){super(),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=d.getActor(),this.setEventedParent(g),this._data=c.data,this._options=o.extend({},c),this._collectResourceTiming=c.collectResourceTiming,c.maxzoom!==void 0&&(this.maxzoom=c.maxzoom),c.type&&(this.type=c.type),c.attribution&&(this.attribution=c.attribution),this.promoteId=c.promoteId;let _=o.EXTENT/this.tileSize;this.workerOptions=o.extend({source:this.id,cluster:c.cluster||!1,geojsonVtOptions:{buffer:(c.buffer!==void 0?c.buffer:128)*_,tolerance:(c.tolerance!==void 0?c.tolerance:.375)*_,extent:o.EXTENT,maxZoom:this.maxzoom,lineMetrics:c.lineMetrics||!1,generateId:c.generateId||!1},superclusterOptions:{maxZoom:c.clusterMaxZoom!==void 0?c.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,c.clusterMinPoints||2),extent:o.EXTENT,radius:(c.clusterRadius||50)*_,log:!1,generateId:c.generateId||!1},clusterProperties:c.clusterProperties,filter:c.filter},c.workerOptions)}load(){this._updateWorkerData("metadata")}onAdd(n){this.map=n,this.load()}setData(n){return this._data=n,this._updateWorkerData("content"),this}getClusterExpansionZoom(n,c){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},c),this}getClusterChildren(n,c){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},c),this}getClusterLeaves(n,c,d,g){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:c,offset:d},g),this}_updateWorkerData(n){let c=o.extend({},this.workerOptions),d=this._data;typeof d=="string"?(c.request=this.map._requestManager.transformRequest(o.exported.resolveURL(d),o.ResourceType.Source),c.request.collectResourceTiming=this._collectResourceTiming):c.data=JSON.stringify(d),this._pendingLoads++,this.fire(new o.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,c,(g,_)=>{if(this._pendingLoads--,this._removed||_&&_.abandoned)return;let I=null;if(_&&_.resourceTiming&&_.resourceTiming[this.id]&&(I=_.resourceTiming[this.id].slice(0)),this.actor.send(`${this.type}.coalesce`,{source:c.source},null),g)return void this.fire(new o.ErrorEvent(g));let M={dataType:"source",sourceDataType:n};this._collectResourceTiming&&I&&I.length>0&&o.extend(M,{resourceTiming:I}),this.fire(new o.Event("data",M))})}loaded(){return this._pendingLoads===0}loadTile(n,c){let d=n.actor?"reloadTile":"loadTile";n.actor=this.actor;let g={type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};n.request=this.actor.send(d,g,(_,I)=>(delete n.request,n.unloadVectorData(),n.aborted?c(null):_?c(_):(n.loadVectorData(I,this.map.painter,d==="reloadTile"),c(null))))}abortTile(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0}unloadTile(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return o.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Xi=o.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class si extends o.Evented{constructor(n,c,d,g){super(),this.id=n,this.dispatcher=d,this.coordinates=c.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=c}load(n,c){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this.url=this.options.url,o.getImage(this.map._requestManager.transformRequest(this.url,o.ResourceType.Image),(d,g)=>{this._loaded=!0,d?this.fire(new o.ErrorEvent(d)):g&&(this.image=g,n&&(this.coordinates=n),c&&c(),this._finishLoading())})}loaded(){return this._loaded}updateImage(n){return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(n){this.map=n,this.load()}setCoordinates(n){this.coordinates=n;let c=n.map(o.MercatorCoordinate.fromLngLat);this.tileID=function(g){let _=1/0,I=1/0,M=-1/0,E=-1/0;for(let X of g)_=Math.min(_,X.x),I=Math.min(I,X.y),M=Math.max(M,X.x),E=Math.max(E,X.y);let k=Math.max(M-_,E-I),D=Math.max(0,Math.floor(-Math.log(k)/Math.LN2)),O=Math.pow(2,D);return new o.CanonicalTileID(D,Math.floor((_+M)/2*O),Math.floor((I+E)/2*O))}(c),this.minzoom=this.maxzoom=this.tileID.z;let d=c.map(g=>this.tileID.getTilePoint(g)._round());return this._boundsArray=new o.RasterBoundsArray,this._boundsArray.emplaceBack(d[0].x,d[0].y,0,0),this._boundsArray.emplaceBack(d[1].x,d[1].y,o.EXTENT,0),this._boundsArray.emplaceBack(d[3].x,d[3].y,0,o.EXTENT),this._boundsArray.emplaceBack(d[2].x,d[2].y,o.EXTENT,o.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let n=this.map.painter.context,c=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new H(n,this.image,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE));for(let d in this.tiles){let g=this.tiles[d];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture)}}loadTile(n,c){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},c(null)):(n.state="errored",c(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ti extends si{constructor(n,c,d,g){super(n,c,d,g),this.roundZoom=!0,this.type="video",this.options=c}load(){this._loaded=!1;let n=this.options;this.urls=[];for(let c of n.urls)this.urls.push(this.map._requestManager.transformRequest(c,o.ResourceType.Source).url);o.getVideo(this.urls,(c,d)=>{this._loaded=!0,c?this.fire(new o.ErrorEvent(c)):d&&(this.video=d,this.video.loop=!0,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(n){if(this.video){let c=this.video.seekable;n<c.start(0)||n>c.end(0)?this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${c.start(0)} and ${c.end(0)}-second mark.`))):this.video.currentTime=n}}getVideo(){return this.video}onAdd(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let n=this.map.painter.context,c=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE),c.texSubImage2D(c.TEXTURE_2D,0,0,0,c.RGBA,c.UNSIGNED_BYTE,this.video)):(this.texture=new H(n,this.video,c.RGBA),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE));for(let d in this.tiles){let g=this.tiles[d];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class _i extends si{constructor(n,c,d,g){super(n,c,d,g),c.coordinates?Array.isArray(c.coordinates)&&c.coordinates.length===4&&!c.coordinates.some(_=>!Array.isArray(_)||_.length!==2||_.some(I=>typeof I!="number"))||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'missing required property "coordinates"'))),c.animate&&typeof c.animate!="boolean"&&this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'optional "animate" property must be a boolean value'))),c.canvas?typeof c.canvas=="string"||c.canvas instanceof HTMLCanvasElement||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${n}`,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 o.ErrorEvent(new o.ValidationError(`sources.${n}`,null,'missing required property "canvas"'))),this.options=c,this.animate=c.animate===void 0||c.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 o.ErrorEvent(new 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(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let c=this.map.painter.context,d=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,Xi.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new H(c,this.canvas,d.RGBA,{premultiply:!0});for(let g in this.tiles){let _=this.tiles[g];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let n of[this.canvas.width,this.canvas.height])if(isNaN(n)||n<=0)return!0;return!1}}let Ei={vector:Zt,raster:zi,"raster-dem":jt,geojson:ur,video:ti,image:si,canvas:_i};function Li(f,n){let c=o.create();return o.translate(c,c,[1,1,0]),o.scale(c,c,[.5*f.width,.5*f.height,1]),o.multiply(c,c,f.calculatePosMatrix(n.toUnwrapped()))}function Fi(f,n,c,d,g,_){let I=function(O,X,oe){if(O)for(let $ of O){let ne=X[$];if(ne&&ne.source===oe&&ne.type==="fill-extrusion")return!0}else for(let $ in X){let ne=X[$];if(ne.source===oe&&ne.type==="fill-extrusion")return!0}return!1}(g&&g.layers,n,f.id),M=_.maxPitchScaleFactor(),E=f.tilesIn(d,M,I);E.sort(Ji);let k=[];for(let O of E)k.push({wrappedTileID:O.tileID.wrapped().key,queryResults:O.tile.queryRenderedFeatures(n,c,f._state,O.queryGeometry,O.cameraQueryGeometry,O.scale,g,_,M,Li(f.transform,O.tileID))});let D=function(O){let X={},oe={};for(let $ of O){let ne=$.queryResults,me=$.wrappedTileID,ge=oe[me]=oe[me]||{};for(let we in ne){let xe=ne[we],Ne=ge[we]=ge[we]||{},Te=X[we]=X[we]||[];for(let ke of xe)Ne[ke.featureIndex]||(Ne[ke.featureIndex]=!0,Te.push(ke))}}return X}(k);for(let O in D)D[O].forEach(X=>{let oe=X.feature,$=f.getFeatureState(oe.layer["source-layer"],oe.id);oe.source=oe.layer.source,oe.layer["source-layer"]&&(oe.sourceLayer=oe.layer["source-layer"]),oe.state=$});return D}function Ji(f,n){let c=f.tileID,d=n.tileID;return c.overscaledZ-d.overscaledZ||c.canonical.y-d.canonical.y||c.wrap-d.wrap||c.canonical.x-d.canonical.x}class Cr{constructor(n,c){this.tileID=n,this.uid=o.uniqueId(),this.uses=0,this.tileSize=c,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(n){let c=n+this.timeAdded;c<o.exported.now()||this.fadeEndTime&&c<this.fadeEndTime||(this.fadeEndTime=c)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}loadVectorData(n,c,d){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",n){n.featureIndex&&(this.latestFeatureIndex=n.featureIndex,n.rawTileData?(this.latestRawTileData=n.rawTileData,this.latestFeatureIndex.rawTileData=n.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=n.collisionBoxArray,this.buckets=function(g,_){let I={};if(!_)return I;for(let M of g){let E=M.layerIds.map(k=>_.getLayer(k)).filter(Boolean);if(E.length!==0){M.layers=E,M.stateDependentLayerIds&&(M.stateDependentLayers=M.stateDependentLayerIds.map(k=>E.filter(D=>D.id===k)[0]));for(let k of E)I[k.id]=M}}return I}(n.buckets,c.style),this.hasSymbolBuckets=!1;for(let g in this.buckets){let _=this.buckets[g];if(_ instanceof o.SymbolBucket){if(this.hasSymbolBuckets=!0,!d)break;_.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let g in this.buckets){let _=this.buckets[g];if(_ instanceof o.SymbolBucket&&_.hasRTLText){this.hasRTLText=!0,o.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(let g in this.buckets){let _=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,c.style.getLayer(g).queryRadius(_))}n.imageAtlas&&(this.imageAtlas=n.imageAtlas),n.glyphAtlasImage&&(this.glyphAtlasImage=n.glyphAtlasImage)}else this.collisionBoxArray=new o.CollisionBoxArray}unloadVectorData(){for(let n in this.buckets)this.buckets[n].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(n){return this.buckets[n.id]}upload(n){for(let d in this.buckets){let g=this.buckets[d];g.uploadPending()&&g.upload(n)}let c=n.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new H(n,this.imageAtlas.image,c.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new H(n,this.glyphAtlasImage,c.ALPHA),this.glyphAtlasImage=null)}prepare(n){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(n,this.imageAtlasTexture)}queryRenderedFeatures(n,c,d,g,_,I,M,E,k,D){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:_,scale:I,tileSize:this.tileSize,pixelPosMatrix:D,transform:E,params:M,queryPadding:this.queryPadding*k},n,c,d):{}}querySourceFeatures(n,c){let d=this.latestFeatureIndex;if(!d||!d.rawTileData)return;let g=d.loadVTLayers(),_=c?c.sourceLayer:"",I=g._geojsonTileLayer||g[_];if(!I)return;let M=o.createFilter(c&&c.filter),{z:E,x:k,y:D}=this.tileID.canonical,O={z:E,x:k,y:D};for(let X=0;X<I.length;X++){let oe=I.feature(X);if(M.needGeometry){let me=o.toEvaluationFeature(oe,!0);if(!M.filter(new o.EvaluationParameters(this.tileID.overscaledZ),me,this.tileID.canonical))continue}else if(!M.filter(new o.EvaluationParameters(this.tileID.overscaledZ),oe))continue;let $=d.getId(oe,_),ne=new o.GeoJSONFeature(oe,E,k,D,$);ne.tile=O,n.push(ne)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(n){let c=this.expirationTime;if(n.cacheControl){let d=o.parseCacheControl(n.cacheControl);d["max-age"]&&(this.expirationTime=Date.now()+1e3*d["max-age"])}else n.expires&&(this.expirationTime=new Date(n.expires).getTime());if(this.expirationTime){let d=Date.now(),g=!1;if(this.expirationTime>d)g=!1;else if(c)if(this.expirationTime<c)g=!0;else{let _=this.expirationTime-c;_?this.expirationTime=d+Math.max(_,3e4):g=!0}else g=!0;g?(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(),Math.pow(2,31)-1)}setFeatureState(n,c){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(n).length===0)return;let d=this.latestFeatureIndex.loadVTLayers();for(let g in this.buckets){if(!c.style.hasLayer(g))continue;let _=this.buckets[g],I=_.layers[0].sourceLayer||"_geojsonTileLayer",M=d[I],E=n[I];if(!M||!E||Object.keys(E).length===0)continue;_.update(E,M,this.imageAtlas&&this.imageAtlas.patternPositions||{});let k=c&&c.style&&c.style.getLayer(g);k&&(this.queryPadding=Math.max(this.queryPadding,k.queryRadius(_)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(n){this.symbolFadeHoldUntil=o.exported.now()+n}setDependencies(n,c){let d={};for(let g of c)d[g]=!0;this.dependencies[n]=d}hasDependency(n,c){for(let d of n){let g=this.dependencies[d];if(g){for(let _ of c)if(g[_])return!0}}return!1}}class tn{constructor(n,c){this.max=n,this.onRemove=c,this.reset()}reset(){for(let n in this.data)for(let c of this.data[n])c.timeout&&clearTimeout(c.timeout),this.onRemove(c.value);return this.data={},this.order=[],this}add(n,c,d){let g=n.wrapped().key;this.data[g]===void 0&&(this.data[g]=[]);let _={value:c,timeout:void 0};if(d!==void 0&&(_.timeout=setTimeout(()=>{this.remove(n,_)},d)),this.data[g].push(_),this.order.push(g),this.order.length>this.max){let I=this._getAndRemoveByKey(this.order[0]);I&&this.onRemove(I)}return this}has(n){return n.wrapped().key in this.data}getAndRemove(n){return this.has(n)?this._getAndRemoveByKey(n.wrapped().key):null}_getAndRemoveByKey(n){let c=this.data[n].shift();return c.timeout&&clearTimeout(c.timeout),this.data[n].length===0&&delete this.data[n],this.order.splice(this.order.indexOf(n),1),c.value}getByKey(n){let c=this.data[n];return c?c[0].value:null}get(n){return this.has(n)?this.data[n.wrapped().key][0].value:null}remove(n,c){if(!this.has(n))return this;let d=n.wrapped().key,g=c===void 0?0:this.data[d].indexOf(c),_=this.data[d][g];return this.data[d].splice(g,1),_.timeout&&clearTimeout(_.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(_.value),this.order.splice(this.order.indexOf(d),1),this}setMaxSize(n){for(this.max=n;this.order.length>this.max;){let c=this._getAndRemoveByKey(this.order[0]);c&&this.onRemove(c)}return this}filter(n){let c=[];for(let d in this.data)for(let g of this.data[d])n(g.value)||c.push(g);for(let d of c)this.remove(d.value.tileID,d)}}class no{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(n,c,d){let g=String(c);if(this.stateChanges[n]=this.stateChanges[n]||{},this.stateChanges[n][g]=this.stateChanges[n][g]||{},o.extend(this.stateChanges[n][g],d),this.deletedStates[n]===null){this.deletedStates[n]={};for(let _ in this.state[n])_!==g&&(this.deletedStates[n][_]=null)}else if(this.deletedStates[n]&&this.deletedStates[n][g]===null){this.deletedStates[n][g]={};for(let _ in this.state[n][g])d[_]||(this.deletedStates[n][g][_]=null)}else for(let _ in d)this.deletedStates[n]&&this.deletedStates[n][g]&&this.deletedStates[n][g][_]===null&&delete this.deletedStates[n][g][_]}removeFeatureState(n,c,d){if(this.deletedStates[n]===null)return;let g=String(c);if(this.deletedStates[n]=this.deletedStates[n]||{},d&&c!==void 0)this.deletedStates[n][g]!==null&&(this.deletedStates[n][g]=this.deletedStates[n][g]||{},this.deletedStates[n][g][d]=null);else if(c!==void 0)if(this.stateChanges[n]&&this.stateChanges[n][g])for(d in this.deletedStates[n][g]={},this.stateChanges[n][g])this.deletedStates[n][g][d]=null;else this.deletedStates[n][g]=null;else this.deletedStates[n]=null}getState(n,c){let d=String(c),g=o.extend({},(this.state[n]||{})[d],(this.stateChanges[n]||{})[d]);if(this.deletedStates[n]===null)return{};if(this.deletedStates[n]){let _=this.deletedStates[n][c];if(_===null)return{};for(let I in _)delete g[I]}return g}initializeTileState(n,c){n.setFeatureState(this.state,c)}coalesceChanges(n,c){let d={};for(let g in this.stateChanges){this.state[g]=this.state[g]||{};let _={};for(let I in this.stateChanges[g])this.state[g][I]||(this.state[g][I]={}),o.extend(this.state[g][I],this.stateChanges[g][I]),_[I]=this.state[g][I];d[g]=_}for(let g in this.deletedStates){this.state[g]=this.state[g]||{};let _={};if(this.deletedStates[g]===null)for(let I in this.state[g])_[I]={},this.state[g][I]={};else for(let I in this.deletedStates[g]){if(this.deletedStates[g][I]===null)this.state[g][I]={};else for(let M of Object.keys(this.deletedStates[g][I]))delete this.state[g][I][M];_[I]=this.state[g][I]}d[g]=d[g]||{},o.extend(d[g],_)}if(this.stateChanges={},this.deletedStates={},Object.keys(d).length!==0)for(let g in n)n[g].setFeatureState(d,c)}}class ii extends o.Evented{constructor(n,c,d){super(),this.id=n,this.dispatcher=d,this.on("data",g=>{g.dataType==="source"&&g.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&g.dataType==="source"&&g.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(g,_,I,M){let E=new Ei[_.type](g,_,I,M);if(E.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${E.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],E),E}(n,c,d,this),this._tiles={},this._cache=new tn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new no}onAdd(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)}onRemove(n){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(n)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(let n in this._tiles){let c=this._tiles[n];if(c.state!=="loaded"&&c.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(n,c){return this._source.loadTile(n,c)}_unloadTile(n){if(this._source.unloadTile)return this._source.unloadTile(n,()=>{})}_abortTile(n){this._source.abortTile&&this._source.abortTile(n,()=>{}),this._source.fire(new o.Event("dataabort",{tile:n,coord:n.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(n){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let c in this._tiles){let d=this._tiles[c];d.upload(n),d.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(n=>n.tileID).sort(Hr).map(n=>n.key)}getRenderableIds(n){let c=[];for(let d in this._tiles)this._isIdRenderable(d,n)&&c.push(this._tiles[d]);return n?c.sort((d,g)=>{let _=d.tileID,I=g.tileID,M=new o.pointGeometry(_.canonical.x,_.canonical.y)._rotate(this.transform.angle),E=new o.pointGeometry(I.canonical.x,I.canonical.y)._rotate(this.transform.angle);return _.overscaledZ-I.overscaledZ||E.y-M.y||E.x-M.x}).map(d=>d.tileID.key):c.map(d=>d.tileID).sort(Hr).map(d=>d.key)}hasRenderableParent(n){let c=this.findLoadedParent(n,0);return!!c&&this._isIdRenderable(c.tileID.key)}_isIdRenderable(n,c){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(c||!this._tiles[n].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let n in this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")}}_reloadTile(n,c){let d=this._tiles[n];d&&(d.state!=="loading"&&(d.state=c),this._loadTile(d,this._tileLoaded.bind(this,d,n,c)))}_tileLoaded(n,c,d,g){if(g)return n.state="errored",void(g.status!==404?this._source.fire(new o.ErrorEvent(g,{tile:n})):this.update(this.transform));n.timeAdded=o.exported.now(),d==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(c,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),n.aborted||this._source.fire(new o.Event("data",{dataType:"source",tile:n,coord:n.tileID}))}_backfillDEM(n){let c=this.getRenderableIds();for(let g=0;g<c.length;g++){let _=c[g];if(n.neighboringTiles&&n.neighboringTiles[_]){let I=this.getTileByID(_);d(n,I),d(I,n)}}function d(g,_){g.needsHillshadePrepare=!0;let I=_.tileID.canonical.x-g.tileID.canonical.x,M=_.tileID.canonical.y-g.tileID.canonical.y,E=Math.pow(2,g.tileID.canonical.z),k=_.tileID.key;I===0&&M===0||Math.abs(M)>1||(Math.abs(I)>1&&(Math.abs(I+E)===1?I+=E:Math.abs(I-E)===1&&(I-=E)),_.dem&&g.dem&&(g.dem.backfillBorder(_.dem,I,M),g.neighboringTiles&&g.neighboringTiles[k]&&(g.neighboringTiles[k].backfilled=!0)))}}getTile(n){return this.getTileByID(n.key)}getTileByID(n){return this._tiles[n]}_retainLoadedChildren(n,c,d,g){for(let _ in this._tiles){let I=this._tiles[_];if(g[_]||!I.hasData()||I.tileID.overscaledZ<=c||I.tileID.overscaledZ>d)continue;let M=I.tileID;for(;I&&I.tileID.overscaledZ>c+1;){let k=I.tileID.scaledTo(I.tileID.overscaledZ-1);I=this._tiles[k.key],I&&I.hasData()&&(M=k)}let E=M;for(;E.overscaledZ>c;)if(E=E.scaledTo(E.overscaledZ-1),n[E.key]){g[M.key]=M;break}}}findLoadedParent(n,c){if(n.key in this._loadedParentTiles){let d=this._loadedParentTiles[n.key];return d&&d.tileID.overscaledZ>=c?d:null}for(let d=n.overscaledZ-1;d>=c;d--){let g=n.scaledTo(d),_=this._getLoadedTile(g);if(_)return _}}_getLoadedTile(n){let c=this._tiles[n.key];return c&&c.hasData()?c:this._cache.getByKey(n.wrapped().key)}updateCacheSize(n){let c=Math.ceil(n.width/this._source.tileSize)+1,d=Math.ceil(n.height/this._source.tileSize)+1,g=Math.floor(c*d*5),_=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(_)}handleWrapJump(n){let c=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,c){let d={};for(let g in this._tiles){let _=this._tiles[g];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+c),d[_.tileID.key]=_}this._tiles=d;for(let g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(let g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}update(n){if(this.transform=n,!this._sourceLoaded||this._paused)return;let c;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?c=n.getVisibleUnwrappedCoordinates(this._source.tileID).map(E=>new o.OverscaledTileID(E.canonical.z,E.wrap,E.canonical.z,E.canonical.x,E.canonical.y)):(c=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(c=c.filter(E=>this._source.hasTile(E)))):c=[];let d=n.coveringZoomLevel(this._source),g=Math.max(d-ii.maxOverzooming,this._source.minzoom),_=Math.max(d+ii.maxUnderzooming,this._source.minzoom),I=this._updateRetainedTiles(c,d);if(hn(this._source.type)){let E={},k={},D=Object.keys(I);for(let O of D){let X=I[O],oe=this._tiles[O];if(!oe||oe.fadeEndTime&&oe.fadeEndTime<=o.exported.now())continue;let $=this.findLoadedParent(X,g);$&&(this._addTile($.tileID),E[$.tileID.key]=$.tileID),k[O]=X}this._retainLoadedChildren(k,d,_,I);for(let O in E)I[O]||(this._coveredTiles[O]=!0,I[O]=E[O])}for(let E in I)this._tiles[E].clearFadeHold();let M=o.keysDifference(this._tiles,I);for(let E of M){let k=this._tiles[E];k.hasSymbolBuckets&&!k.holdingForFade()?k.setHoldDuration(this.map._fadeDuration):k.hasSymbolBuckets&&!k.symbolFadeFinished()||this._removeTile(E)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)}_updateRetainedTiles(n,c){let d={},g={},_=Math.max(c-ii.maxOverzooming,this._source.minzoom),I=Math.max(c+ii.maxUnderzooming,this._source.minzoom),M={};for(let E of n){let k=this._addTile(E);d[E.key]=E,k.hasData()||c<this._source.maxzoom&&(M[E.key]=E)}this._retainLoadedChildren(M,c,I,d);for(let E of n){let k=this._tiles[E.key];if(k.hasData())continue;if(c+1>this._source.maxzoom){let O=E.children(this._source.maxzoom)[0],X=this.getTile(O);if(X&&X.hasData()){d[O.key]=O;continue}}else{let O=E.children(this._source.maxzoom);if(d[O[0].key]&&d[O[1].key]&&d[O[2].key]&&d[O[3].key])continue}let D=k.wasRequested();for(let O=E.overscaledZ-1;O>=_;--O){let X=E.scaledTo(O);if(g[X.key]||(g[X.key]=!0,k=this.getTile(X),!k&&D&&(k=this._addTile(X)),k&&(d[X.key]=X,D=k.wasRequested(),k.hasData())))break}}return d}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let n in this._tiles){let c=[],d,g=this._tiles[n].tileID;for(;g.overscaledZ>0;){if(g.key in this._loadedParentTiles){d=this._loadedParentTiles[g.key];break}c.push(g.key);let _=g.scaledTo(g.overscaledZ-1);if(d=this._getLoadedTile(_),d)break;g=_}for(let _ of c)this._loadedParentTiles[_]=d}}_addTile(n){let c=this._tiles[n.key];if(c)return c;c=this._cache.getAndRemove(n),c&&(this._setTileReloadTimer(n.key,c),c.tileID=n,this._state.initializeTileState(c,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,c)));let d=c;return c||(c=new Cr(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(c,this._tileLoaded.bind(this,c,n.key,c.state))),c.uses++,this._tiles[n.key]=c,d||this._source.fire(new o.Event("dataloading",{tile:c,coord:c.tileID,dataType:"source"})),c}_setTileReloadTimer(n,c){n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);let d=c.getExpiryTimeout();d&&(this._timers[n]=setTimeout(()=>{this._reloadTile(n,"expired"),delete this._timers[n]},d))}_removeTile(n){let c=this._tiles[n];c&&(c.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),c.uses>0||(c.hasData()&&c.state!=="reloading"?this._cache.add(c.tileID,c,c.getExpiryTimeout()):(c.aborted=!0,this._abortTile(c),this._unloadTile(c))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let n in this._tiles)this._removeTile(n);this._cache.reset()}tilesIn(n,c,d){let g=[],_=this.transform;if(!_)return g;let I=d?_.getCameraQueryGeometry(n):n,M=n.map($=>_.pointCoordinate($)),E=I.map($=>_.pointCoordinate($)),k=this.getIds(),D=1/0,O=1/0,X=-1/0,oe=-1/0;for(let $ of E)D=Math.min(D,$.x),O=Math.min(O,$.y),X=Math.max(X,$.x),oe=Math.max(oe,$.y);for(let $=0;$<k.length;$++){let ne=this._tiles[k[$]];if(ne.holdingForFade())continue;let me=ne.tileID,ge=Math.pow(2,_.zoom-ne.tileID.overscaledZ),we=c*ne.queryPadding*o.EXTENT/ne.tileSize/ge,xe=[me.getTilePoint(new o.MercatorCoordinate(D,O)),me.getTilePoint(new o.MercatorCoordinate(X,oe))];if(xe[0].x-we<o.EXTENT&&xe[0].y-we<o.EXTENT&&xe[1].x+we>=0&&xe[1].y+we>=0){let Ne=M.map(ke=>me.getTilePoint(ke)),Te=E.map(ke=>me.getTilePoint(ke));g.push({tile:ne,tileID:me,queryGeometry:Ne,cameraQueryGeometry:Te,scale:ge})}}return g}getVisibleCoordinates(n){let c=this.getRenderableIds(n).map(d=>this._tiles[d].tileID);for(let d of c)d.posMatrix=this.transform.calculatePosMatrix(d.toUnwrapped());return c}hasTransition(){if(this._source.hasTransition())return!0;if(hn(this._source.type))for(let n in this._tiles){let c=this._tiles[n];if(c.fadeEndTime!==void 0&&c.fadeEndTime>=o.exported.now())return!0}return!1}setFeatureState(n,c,d){this._state.updateState(n=n||"_geojsonTileLayer",c,d)}removeFeatureState(n,c,d){this._state.removeFeatureState(n=n||"_geojsonTileLayer",c,d)}getFeatureState(n,c){return this._state.getState(n=n||"_geojsonTileLayer",c)}setDependencies(n,c,d){let g=this._tiles[n];g&&g.setDependencies(c,d)}reloadTilesForDependencies(n,c){for(let d in this._tiles)this._tiles[d].hasDependency(n,c)&&this._reloadTile(d,"reloading");this._cache.filter(d=>!d.hasDependency(n,c))}}function Hr(f,n){let c=Math.abs(2*f.wrap)-+(f.wrap<0),d=Math.abs(2*n.wrap)-+(n.wrap<0);return f.overscaledZ-n.overscaledZ||d-c||n.canonical.y-f.canonical.y||n.canonical.x-f.canonical.x}function hn(f){return f==="raster"||f==="image"||f==="video"}ii.maxOverzooming=10,ii.maxUnderzooming=3;let rn="mapboxgl_preloaded_worker_pool";class zr{constructor(){this.active={}}acquire(n){if(!this.workers)for(this.workers=[];this.workers.length<zr.workerCount;)this.workers.push(new Worker(vl.workerUrl));return this.active[n]=!0,this.workers.slice()}release(n){delete this.active[n],this.numActive()===0&&(this.workers.forEach(c=>{c.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[rn]}numActive(){return Object.keys(this.active).length}}let Qo=Math.floor(o.exported.hardwareConcurrency/2),_e;function V(){return _e||(_e=new zr),_e}function F(f,n){let c={};for(let d in f)d!=="ref"&&(c[d]=f[d]);return o.refProperties.forEach(d=>{d in n&&(c[d]=n[d])}),c}function U(f){f=f.slice();let n=Object.create(null);for(let c=0;c<f.length;c++)n[f[c].id]=f[c];for(let c=0;c<f.length;c++)"ref"in f[c]&&(f[c]=F(f[c],n[f[c].ref]));return f}zr.workerCount=Math.max(Math.min(Qo,6),1);let K={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",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"};function he(f,n,c){c.push({command:K.addSource,args:[f,n[f]]})}function Ie(f,n,c){n.push({command:K.removeSource,args:[f]}),c[f]=!0}function Ve(f,n,c,d){Ie(f,c,d),he(f,n,c)}function He(f,n,c){let d;for(d in f[c])if(Object.prototype.hasOwnProperty.call(f[c],d)&&d!=="data"&&!C(f[c][d],n[c][d]))return!1;for(d in n[c])if(Object.prototype.hasOwnProperty.call(n[c],d)&&d!=="data"&&!C(f[c][d],n[c][d]))return!1;return!0}function ye(f,n,c,d,g,_){let I;for(I in n=n||{},f=f||{})Object.prototype.hasOwnProperty.call(f,I)&&(C(f[I],n[I])||c.push({command:_,args:[d,I,n[I],g]}));for(I in n)Object.prototype.hasOwnProperty.call(n,I)&&!Object.prototype.hasOwnProperty.call(f,I)&&(C(f[I],n[I])||c.push({command:_,args:[d,I,n[I],g]}))}function Re(f){return f.id}function ie(f,n){return f[n.id]=n,f}class Xe{constructor(n,c){this.reset(n,c)}reset(n,c){this.points=n||[],this._distances=[0];for(let d=1;d<this.points.length;d++)this._distances[d]=this._distances[d-1]+this.points[d].dist(this.points[d-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(c||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(n){if(this.points.length===1)return this.points[0];n=o.clamp(n,0,1);let c=1,d=this._distances[c],g=n*this.paddedLength+this.padding;for(;d<g&&c<this._distances.length;)d=this._distances[++c];let _=c-1,I=this._distances[_],M=d-I,E=M>0?(g-I)/M:0;return this.points[_].mult(1-E).add(this.points[c].mult(E))}}function $e(f,n){let c=!0;return f==="always"||f!=="never"&&n!=="never"||(c=!1),c}class ft{constructor(n,c,d){let g=this.boxCells=[],_=this.circleCells=[];this.xCellCount=Math.ceil(n/d),this.yCellCount=Math.ceil(c/d);for(let I=0;I<this.xCellCount*this.yCellCount;I++)g.push([]),_.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=n,this.height=c,this.xScale=this.xCellCount/n,this.yScale=this.yCellCount/c,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(n,c,d,g,_){this._forEachCell(c,d,g,_,this._insertBoxCell,this.boxUid++),this.boxKeys.push(n),this.bboxes.push(c),this.bboxes.push(d),this.bboxes.push(g),this.bboxes.push(_)}insertCircle(n,c,d,g){this._forEachCell(c-g,d-g,c+g,d+g,this._insertCircleCell,this.circleUid++),this.circleKeys.push(n),this.circles.push(c),this.circles.push(d),this.circles.push(g)}_insertBoxCell(n,c,d,g,_,I){this.boxCells[_].push(I)}_insertCircleCell(n,c,d,g,_,I){this.circleCells[_].push(I)}_query(n,c,d,g,_,I,M){if(d<0||n>this.width||g<0||c>this.height)return[];let E=[];if(n<=0&&c<=0&&this.width<=d&&this.height<=g){if(_)return[{key:null,x1:n,y1:c,x2:d,y2:g}];for(let k=0;k<this.boxKeys.length;k++)E.push({key:this.boxKeys[k],x1:this.bboxes[4*k],y1:this.bboxes[4*k+1],x2:this.bboxes[4*k+2],y2:this.bboxes[4*k+3]});for(let k=0;k<this.circleKeys.length;k++){let D=this.circles[3*k],O=this.circles[3*k+1],X=this.circles[3*k+2];E.push({key:this.circleKeys[k],x1:D-X,y1:O-X,x2:D+X,y2:O+X})}}else this._forEachCell(n,c,d,g,this._queryCell,E,{hitTest:_,overlapMode:I,seenUids:{box:{},circle:{}}},M);return E}query(n,c,d,g){return this._query(n,c,d,g,!1,null)}hitTest(n,c,d,g,_,I){return this._query(n,c,d,g,!0,_,I).length>0}hitTestCircle(n,c,d,g,_){let I=n-d,M=n+d,E=c-d,k=c+d;if(M<0||I>this.width||k<0||E>this.height)return!1;let D=[];return this._forEachCell(I,E,M,k,this._queryCellCircle,D,{hitTest:!0,overlapMode:g,circle:{x:n,y:c,radius:d},seenUids:{box:{},circle:{}}},_),D.length>0}_queryCell(n,c,d,g,_,I,M,E){let{seenUids:k,hitTest:D,overlapMode:O}=M,X=this.boxCells[_];if(X!==null){let $=this.bboxes;for(let ne of X)if(!k.box[ne]){k.box[ne]=!0;let me=4*ne,ge=this.boxKeys[ne];if(n<=$[me+2]&&c<=$[me+3]&&d>=$[me+0]&&g>=$[me+1]&&(!E||E(ge))&&(!D||!$e(O,ge.overlapMode))&&(I.push({key:ge,x1:$[me],y1:$[me+1],x2:$[me+2],y2:$[me+3]}),D))return!0}}let oe=this.circleCells[_];if(oe!==null){let $=this.circles;for(let ne of oe)if(!k.circle[ne]){k.circle[ne]=!0;let me=3*ne,ge=this.circleKeys[ne];if(this._circleAndRectCollide($[me],$[me+1],$[me+2],n,c,d,g)&&(!E||E(ge))&&(!D||!$e(O,ge.overlapMode))){let we=$[me],xe=$[me+1],Ne=$[me+2];if(I.push({key:ge,x1:we-Ne,y1:xe-Ne,x2:we+Ne,y2:xe+Ne}),D)return!0}}}return!1}_queryCellCircle(n,c,d,g,_,I,M,E){let{circle:k,seenUids:D,overlapMode:O}=M,X=this.boxCells[_];if(X!==null){let $=this.bboxes;for(let ne of X)if(!D.box[ne]){D.box[ne]=!0;let me=4*ne,ge=this.boxKeys[ne];if(this._circleAndRectCollide(k.x,k.y,k.radius,$[me+0],$[me+1],$[me+2],$[me+3])&&(!E||E(ge))&&!$e(O,ge.overlapMode))return I.push(!0),!0}}let oe=this.circleCells[_];if(oe!==null){let $=this.circles;for(let ne of oe)if(!D.circle[ne]){D.circle[ne]=!0;let me=3*ne,ge=this.circleKeys[ne];if(this._circlesCollide($[me],$[me+1],$[me+2],k.x,k.y,k.radius)&&(!E||E(ge))&&!$e(O,ge.overlapMode))return I.push(!0),!0}}}_forEachCell(n,c,d,g,_,I,M,E){let k=this._convertToXCellCoord(n),D=this._convertToYCellCoord(c),O=this._convertToXCellCoord(d),X=this._convertToYCellCoord(g);for(let oe=k;oe<=O;oe++)for(let $=D;$<=X;$++)if(_.call(this,n,c,d,g,this.xCellCount*$+oe,I,M,E))return}_convertToXCellCoord(n){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(n*this.xScale)))}_convertToYCellCoord(n){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(n*this.yScale)))}_circlesCollide(n,c,d,g,_,I){let M=g-n,E=_-c,k=d+I;return k*k>M*M+E*E}_circleAndRectCollide(n,c,d,g,_,I,M){let E=(I-g)/2,k=Math.abs(n-(g+E));if(k>E+d)return!1;let D=(M-_)/2,O=Math.abs(c-(_+D));if(O>D+d)return!1;if(k<=E||O<=D)return!0;let X=k-E,oe=O-D;return X*X+oe*oe<=d*d}}function ut(f,n,c,d,g){let _=o.create();return n?(o.scale(_,_,[1/g,1/g,1]),c||o.rotateZ(_,_,d.angle)):o.multiply(_,d.labelPlaneMatrix,f),_}function Ht(f,n,c,d,g){if(n){let _=o.clone(f);return o.scale(_,_,[g,g,1]),c||o.rotateZ(_,_,-d.angle),_}return d.glCoordMatrix}function Tt(f,n){let c=[f.x,f.y,0,1];Ft(c,c,n);let d=c[3];return{point:new o.pointGeometry(c[0]/d,c[1]/d),signedDistanceFromCamera:d}}function Ue(f,n){return .5+f/n*.5}function It(f,n){let c=f[0]/f[3],d=f[1]/f[3];return c>=-n[0]&&c<=n[0]&&d>=-n[1]&&d<=n[1]}function yt(f,n,c,d,g,_,I,M,E){let k=d?f.textSizeData:f.iconSizeData,D=o.evaluateSizeForZoom(k,c.transform.zoom),O=[256/c.width*2+1,256/c.height*2+1],X=d?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;X.clear();let oe=f.lineVertexArray,$=d?f.text.placedSymbolArray:f.icon.placedSymbolArray,ne=c.transform.width/c.transform.height,me=!1;for(let ge=0;ge<$.length;ge++){let we=$.get(ge);if(we.hidden||we.writingMode===o.WritingMode.vertical&&!me){hi(we.numGlyphs,X);continue}me=!1;let xe=[we.anchorX,we.anchorY,0,1];if(o.transformMat4(xe,xe,n),!It(xe,O)){hi(we.numGlyphs,X);continue}let Ne=Ue(c.transform.cameraToCenterDistance,xe[3]),Te=o.evaluateSizeForFeature(k,D,we),ke=I?Te/Ne:Te*Ne,je=new o.pointGeometry(we.anchorX,we.anchorY),Ke=Tt(je,g).point,De={},mt=St(we,ke,!1,M,n,g,_,f.glyphOffsetArray,oe,X,Ke,je,De,ne,E);me=mt.useVertical,(mt.notEnoughRoom||me||mt.needsFlipping&&St(we,ke,!0,M,n,g,_,f.glyphOffsetArray,oe,X,Ke,je,De,ne,E).notEnoughRoom)&&hi(we.numGlyphs,X)}d?f.text.dynamicLayoutVertexBuffer.updateData(X):f.icon.dynamicLayoutVertexBuffer.updateData(X)}function ri(f,n,c,d,g,_,I,M,E,k,D,O){let X=M.glyphStartIndex+M.numGlyphs,oe=M.lineStartIndex,$=M.lineStartIndex+M.lineLength,ne=n.getoffsetX(M.glyphStartIndex),me=n.getoffsetX(X-1),ge=ci(f*ne,c,d,g,_,I,M.segment,oe,$,E,k,D,O);if(!ge)return null;let we=ci(f*me,c,d,g,_,I,M.segment,oe,$,E,k,D,O);return we?{first:ge,last:we}:null}function gi(f,n,c,d){return f===o.WritingMode.horizontal&&Math.abs(c.y-n.y)>Math.abs(c.x-n.x)*d?{useVertical:!0}:(f===o.WritingMode.vertical?n.y<c.y:n.x>c.x)?{needsFlipping:!0}:null}function St(f,n,c,d,g,_,I,M,E,k,D,O,X,oe,$){let ne=n/24,me=f.lineOffsetX*ne,ge=f.lineOffsetY*ne,we;if(f.numGlyphs>1){let xe=f.glyphStartIndex+f.numGlyphs,Ne=f.lineStartIndex,Te=f.lineStartIndex+f.lineLength,ke=ri(ne,M,me,ge,c,D,O,f,E,_,X,$);if(!ke)return{notEnoughRoom:!0};let je=Tt(ke.first.point,I).point,Ke=Tt(ke.last.point,I).point;if(d&&!c){let De=gi(f.writingMode,je,Ke,oe);if(De)return De}we=[ke.first];for(let De=f.glyphStartIndex+1;De<xe-1;De++)we.push(ci(ne*M.getoffsetX(De),me,ge,c,D,O,f.segment,Ne,Te,E,_,X,$));we.push(ke.last)}else{if(d&&!c){let Ne=Tt(O,g).point,Te=f.lineStartIndex+f.segment+1,ke=new o.pointGeometry(E.getx(Te),E.gety(Te)),je=Tt(ke,g),Ke=je.signedDistanceFromCamera>0?je.point:tr(O,ke,Ne,1,g),De=gi(f.writingMode,Ne,Ke,oe);if(De)return De}let xe=ci(ne*M.getoffsetX(f.glyphStartIndex),me,ge,c,D,O,f.segment,f.lineStartIndex,f.lineStartIndex+f.lineLength,E,_,X,$);if(!xe)return{notEnoughRoom:!0};we=[xe]}for(let xe of we)o.addDynamicAttributes(k,xe.point,xe.angle);return{}}function tr(f,n,c,d,g){let _=Tt(f.add(f.sub(n)._unit()),g).point,I=c.sub(_);return c.add(I._mult(d/I.mag()))}function ci(f,n,c,d,g,_,I,M,E,k,D,O,X){let oe=d?f-n:f+n,$=oe>0?1:-1,ne=0;d&&($*=-1,ne=Math.PI),$<0&&(ne+=Math.PI);let me=$>0?M+I:M+I+1,ge=g,we=g,xe=0,Ne=0,Te=Math.abs(oe),ke=[];for(;xe+Ne<=Te;){if(me+=$,me<M||me>=E)return null;if(we=ge,ke.push(ge),ge=O[me],ge===void 0){let rt=new o.pointGeometry(k.getx(me),k.gety(me)),Pt=Tt(rt,D);if(Pt.signedDistanceFromCamera>0)ge=O[me]=Pt.point;else{let Qt=me-$;ge=tr(xe===0?_:new o.pointGeometry(k.getx(Qt),k.gety(Qt)),rt,we,Te-xe+1,D)}}xe+=Ne,Ne=we.dist(ge)}let je=(Te-xe)/Ne,Ke=ge.sub(we),De=Ke.mult(je)._add(we);De._add(Ke._unit()._perp()._mult(c*$));let mt=ne+Math.atan2(ge.y-we.y,ge.x-we.x);return ke.push(De),{point:De,angle:X?mt:0,path:ke}}let Ri=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function hi(f,n){for(let c=0;c<f;c++){let d=n.length;n.resize(d+4),n.float32.set(Ri,3*d)}}function Ft(f,n,c){let d=n[0],g=n[1];return f[0]=c[0]*d+c[4]*g+c[12],f[1]=c[1]*d+c[5]*g+c[13],f[3]=c[3]*d+c[7]*g+c[15],f}let di=100;class ir{constructor(n,c=new ft(n.width+200,n.height+200,25),d=new ft(n.width+200,n.height+200,25)){this.transform=n,this.grid=c,this.ignoredGrid=d,this.pitchfactor=Math.cos(n._pitch)*n.cameraToCenterDistance,this.screenRightBoundary=n.width+di,this.screenBottomBoundary=n.height+di,this.gridRightBoundary=n.width+200,this.gridBottomBoundary=n.height+200}placeCollisionBox(n,c,d,g,_){let I=this.projectAndGetPerspectiveRatio(g,n.anchorPointX,n.anchorPointY),M=d*I.perspectiveRatio,E=n.x1*M+I.point.x,k=n.y1*M+I.point.y,D=n.x2*M+I.point.x,O=n.y2*M+I.point.y;return!this.isInsideGrid(E,k,D,O)||c!=="always"&&this.grid.hitTest(E,k,D,O,c,_)?{box:[],offscreen:!1}:{box:[E,k,D,O],offscreen:this.isOffscreen(E,k,D,O)}}placeCollisionCircles(n,c,d,g,_,I,M,E,k,D,O,X,oe){let $=[],ne=new o.pointGeometry(c.anchorX,c.anchorY),me=Tt(ne,I),ge=Ue(this.transform.cameraToCenterDistance,me.signedDistanceFromCamera),we=(D?_/ge:_*ge)/o.ONE_EM,xe=Tt(ne,M).point,Ne=ri(we,g,c.lineOffsetX*we,c.lineOffsetY*we,!1,xe,ne,c,d,M,{},!1),Te=!1,ke=!1,je=!0;if(Ne){let Ke=.5*X*ge+oe,De=new o.pointGeometry(-100,-100),mt=new o.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),rt=new Xe,Pt=Ne.first,Qt=Ne.last,Wt=[];for(let zt=Pt.path.length-1;zt>=1;zt--)Wt.push(Pt.path[zt]);for(let zt=1;zt<Qt.path.length;zt++)Wt.push(Qt.path[zt]);let qt=2.5*Ke;if(E){let zt=Wt.map(ai=>Tt(ai,E));Wt=zt.some(ai=>ai.signedDistanceFromCamera<=0)?[]:zt.map(ai=>ai.point)}let Qi=[];if(Wt.length>0){let zt=Wt[0].clone(),ai=Wt[0].clone();for(let Si=1;Si<Wt.length;Si++)zt.x=Math.min(zt.x,Wt[Si].x),zt.y=Math.min(zt.y,Wt[Si].y),ai.x=Math.max(ai.x,Wt[Si].x),ai.y=Math.max(ai.y,Wt[Si].y);Qi=zt.x>=De.x&&ai.x<=mt.x&&zt.y>=De.y&&ai.y<=mt.y?[Wt]:ai.x<De.x||zt.x>mt.x||ai.y<De.y||zt.y>mt.y?[]:o.clipLine([Wt],De.x,De.y,mt.x,mt.y)}for(let zt of Qi){rt.reset(zt,.25*Ke);let ai=0;ai=rt.length<=.5*Ke?1:Math.ceil(rt.paddedLength/qt)+1;for(let Si=0;Si<ai;Si++){let Fr=Si/Math.max(ai-1,1),En=rt.lerp(Fr),jn=En.x+di,Hn=En.y+di;$.push(jn,Hn,Ke,0);let es=jn-Ke,mn=Hn-Ke,_o=jn+Ke,Es=Hn+Ke;if(je=je&&this.isOffscreen(es,mn,_o,Es),ke=ke||this.isInsideGrid(es,mn,_o,Es),n!=="always"&&this.grid.hitTestCircle(jn,Hn,Ke,n,O)&&(Te=!0,!k))return{circles:[],offscreen:!1,collisionDetected:Te}}}}return{circles:!k&&Te||!ke?[]:$,offscreen:je,collisionDetected:Te}}queryRenderedSymbols(n){if(n.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let c=[],d=1/0,g=1/0,_=-1/0,I=-1/0;for(let D of n){let O=new o.pointGeometry(D.x+di,D.y+di);d=Math.min(d,O.x),g=Math.min(g,O.y),_=Math.max(_,O.x),I=Math.max(I,O.y),c.push(O)}let M=this.grid.query(d,g,_,I).concat(this.ignoredGrid.query(d,g,_,I)),E={},k={};for(let D of M){let O=D.key;if(E[O.bucketInstanceId]===void 0&&(E[O.bucketInstanceId]={}),E[O.bucketInstanceId][O.featureIndex])continue;let X=[new o.pointGeometry(D.x1,D.y1),new o.pointGeometry(D.x2,D.y1),new o.pointGeometry(D.x2,D.y2),new o.pointGeometry(D.x1,D.y2)];o.polygonIntersectsPolygon(c,X)&&(E[O.bucketInstanceId][O.featureIndex]=!0,k[O.bucketInstanceId]===void 0&&(k[O.bucketInstanceId]=[]),k[O.bucketInstanceId].push(O.featureIndex))}return k}insertCollisionBox(n,c,d,g,_,I){(d?this.ignoredGrid:this.grid).insert({bucketInstanceId:g,featureIndex:_,collisionGroupID:I,overlapMode:c},n[0],n[1],n[2],n[3])}insertCollisionCircles(n,c,d,g,_,I){let M=d?this.ignoredGrid:this.grid,E={bucketInstanceId:g,featureIndex:_,collisionGroupID:I,overlapMode:c};for(let k=0;k<n.length;k+=4)M.insertCircle(E,n[k],n[k+1],n[k+2])}projectAndGetPerspectiveRatio(n,c,d){let g=[c,d,0,1];return Ft(g,g,n),{point:new o.pointGeometry((g[0]/g[3]+1)/2*this.transform.width+di,(-g[1]/g[3]+1)/2*this.transform.height+di),perspectiveRatio:.5+this.transform.cameraToCenterDistance/g[3]*.5}}isOffscreen(n,c,d,g){return d<di||n>=this.screenRightBoundary||g<di||c>this.screenBottomBoundary}isInsideGrid(n,c,d,g){return d>=0&&n<this.gridRightBoundary&&g>=0&&c<this.gridBottomBoundary}getViewportMatrix(){let n=o.identity([]);return o.translate(n,n,[-100,-100,0]),n}}function Ai(f,n,c){return n*(o.EXTENT/(f.tileSize*Math.pow(2,c-f.tileID.overscaledZ)))}class Mr{constructor(n,c,d,g){this.opacity=n?Math.max(0,Math.min(1,n.opacity+(n.placed?c:-c))):g&&d?1:0,this.placed=d}isHidden(){return this.opacity===0&&!this.placed}}class rr{constructor(n,c,d,g,_){this.text=new Mr(n?n.text:null,c,d,_),this.icon=new Mr(n?n.icon:null,c,g,_)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ti{constructor(n,c,d){this.text=n,this.icon=c,this.skipFade=d}}class oa{constructor(){this.invProjMatrix=o.create(),this.viewportMatrix=o.create(),this.circles=[]}}class sa{constructor(n,c,d,g,_){this.bucketInstanceId=n,this.featureIndex=c,this.sourceLayerIndex=d,this.bucketIndex=g,this.tileID=_}}class Y{constructor(n){this.crossSourceCollisions=n,this.maxGroupID=0,this.collisionGroups={}}get(n){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[n]){let c=++this.maxGroupID;this.collisionGroups[n]={ID:c,predicate:d=>d.collisionGroupID===c}}return this.collisionGroups[n]}}function P(f,n,c,d,g){let{horizontalAlign:_,verticalAlign:I}=o.getAnchorAlignment(f),M=-(_-.5)*n,E=-(I-.5)*c,k=o.evaluateVariableOffset(f,d);return new o.pointGeometry(M+k[0]*g,E+k[1]*g)}function L(f,n,c,d,g,_){let{x1:I,x2:M,y1:E,y2:k,anchorPointX:D,anchorPointY:O}=f,X=new o.pointGeometry(n,c);return d&&X._rotate(g?_:-_),{x1:I+X.x,y1:E+X.y,x2:M+X.x,y2:k+X.y,anchorPointX:D,anchorPointY:O}}class j{constructor(n,c,d,g){this.transform=n.clone(),this.collisionIndex=new ir(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new Y(d),this.collisionCircleArrays={},this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(n,c,d,g){let _=d.getBucket(c),I=d.latestFeatureIndex;if(!_||!I||c.id!==_.layerIds[0])return;let M=d.collisionBoxArray,E=_.layers[0].layout,k=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),D=d.tileSize/o.EXTENT,O=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),X=E.get("text-pitch-alignment")==="map",oe=E.get("text-rotation-alignment")==="map",$=Ai(d,1,this.transform.zoom),ne=ut(O,X,oe,this.transform,$),me=null;if(X){let we=Ht(O,X,oe,this.transform,$);me=o.multiply([],this.transform.labelPlaneMatrix,we)}this.retainedQueryData[_.bucketInstanceId]=new sa(_.bucketInstanceId,I,_.sourceLayerIndex,_.index,d.tileID);let ge={bucket:_,layout:E,posMatrix:O,textLabelPlaneMatrix:ne,labelToScreenMatrix:me,scale:k,textPixelRatio:D,holdingForFade:d.holdingForFade(),collisionBoxArray:M,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(_.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(_.sourceID)};if(g)for(let we of _.sortKeyRanges){let{sortKey:xe,symbolInstanceStart:Ne,symbolInstanceEnd:Te}=we;n.push({sortKey:xe,symbolInstanceStart:Ne,symbolInstanceEnd:Te,parameters:ge})}else n.push({symbolInstanceStart:0,symbolInstanceEnd:_.symbolInstances.length,parameters:ge})}attemptAnchorPlacement(n,c,d,g,_,I,M,E,k,D,O,X,oe,$,ne){let me=[X.textOffset0,X.textOffset1],ge=P(n,d,g,me,_),we=this.collisionIndex.placeCollisionBox(L(c,ge.x,ge.y,I,M,this.transform.angle),O,E,k,D.predicate);if((!ne||this.collisionIndex.placeCollisionBox(L(ne,ge.x,ge.y,I,M,this.transform.angle),O,E,k,D.predicate).box.length!==0)&&we.box.length>0){let xe;return this.prevPlacement&&this.prevPlacement.variableOffsets[X.crossTileID]&&this.prevPlacement.placements[X.crossTileID]&&this.prevPlacement.placements[X.crossTileID].text&&(xe=this.prevPlacement.variableOffsets[X.crossTileID].anchor),this.variableOffsets[X.crossTileID]={textOffset:me,width:d,height:g,anchor:n,textBoxScale:_,prevAnchor:xe},this.markUsedJustification(oe,n,X,$),oe.allowVerticalPlacement&&(this.markUsedOrientation(oe,$,X),this.placedOrientations[X.crossTileID]=$),{shift:ge,placedGlyphBoxes:we}}}placeLayerBucketPart(n,c,d){let{bucket:g,layout:_,posMatrix:I,textLabelPlaneMatrix:M,labelToScreenMatrix:E,textPixelRatio:k,holdingForFade:D,collisionBoxArray:O,partiallyEvaluatedTextSize:X,collisionGroup:oe}=n.parameters,$=_.get("text-optional"),ne=_.get("icon-optional"),me=o.getOverlapMode(_,"text-overlap","text-allow-overlap"),ge=me==="always",we=o.getOverlapMode(_,"icon-overlap","icon-allow-overlap"),xe=we==="always",Ne=_.get("text-rotation-alignment")==="map",Te=_.get("text-pitch-alignment")==="map",ke=_.get("icon-text-fit")!=="none",je=_.get("symbol-z-order")==="viewport-y",Ke=ge&&(xe||!g.hasIconData()||ne),De=xe&&(ge||!g.hasTextData()||$);!g.collisionArrays&&O&&g.deserializeCollisionBoxes(O);let mt=(rt,Pt)=>{if(c[rt.crossTileID])return;if(D)return void(this.placements[rt.crossTileID]=new Ti(!1,!1,!1));let Qt=!1,Wt=!1,qt=!0,Qi=null,zt={box:null,offscreen:null},ai={box:null,offscreen:null},Si=null,Fr=null,En=null,jn=0,Hn=0,es=0;Pt.textFeatureIndex?jn=Pt.textFeatureIndex:rt.useRuntimeCollisionCircles&&(jn=rt.featureIndex),Pt.verticalTextFeatureIndex&&(Hn=Pt.verticalTextFeatureIndex);let mn=Pt.textBox;if(mn){let An=yi=>{let xr=o.WritingMode.horizontal;if(g.allowVerticalPlacement&&!yi&&this.prevPlacement){let nn=this.prevPlacement.placedOrientations[rt.crossTileID];nn&&(this.placedOrientations[rt.crossTileID]=nn,xr=nn,this.markUsedOrientation(g,xr,rt))}return xr},li=(yi,xr)=>{if(g.allowVerticalPlacement&&rt.numVerticalGlyphVertices>0&&Pt.verticalTextBox){for(let nn of g.writingModes)if(nn===o.WritingMode.vertical?(zt=xr(),ai=zt):zt=yi(),zt&&zt.box&&zt.box.length)break}else zt=yi()};if(_.get("text-variable-anchor")){let yi=_.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[rt.crossTileID]){let Ui=this.prevPlacement.variableOffsets[rt.crossTileID];yi.indexOf(Ui.anchor)>0&&(yi=yi.filter(As=>As!==Ui.anchor),yi.unshift(Ui.anchor))}let xr=(Ui,As,bo)=>{let Mu=Ui.x2-Ui.x1,Ih=Ui.y2-Ui.y1,Eu=rt.textBoxScale,Np=ke&&we==="never"?As:null,Ts={box:[],offscreen:!1},Au=me!=="never"?2*yi.length:yi.length;for(let wo=0;wo<Au;++wo){let xa=this.attemptAnchorPlacement(yi[wo%yi.length],Ui,Mu,Ih,Eu,Ne,Te,k,I,oe,wo>=yi.length?me:"never",rt,g,bo,Np);if(xa&&(Ts=xa.placedGlyphBoxes,Ts&&Ts.box&&Ts.box.length)){Qt=!0,Qi=xa.shift;break}}return Ts};li(()=>xr(mn,Pt.iconBox,o.WritingMode.horizontal),()=>{let Ui=Pt.verticalTextBox;return g.allowVerticalPlacement&&!(zt&&zt.box&&zt.box.length)&&rt.numVerticalGlyphVertices>0&&Ui?xr(Ui,Pt.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null}}),zt&&(Qt=zt.box,qt=zt.offscreen);let nn=An(zt&&zt.box);if(!Qt&&this.prevPlacement){let Ui=this.prevPlacement.variableOffsets[rt.crossTileID];Ui&&(this.variableOffsets[rt.crossTileID]=Ui,this.markUsedJustification(g,Ui.anchor,rt,nn))}}else{let yi=(xr,nn)=>{let Ui=this.collisionIndex.placeCollisionBox(xr,me,k,I,oe.predicate);return Ui&&Ui.box&&Ui.box.length&&(this.markUsedOrientation(g,nn,rt),this.placedOrientations[rt.crossTileID]=nn),Ui};li(()=>yi(mn,o.WritingMode.horizontal),()=>{let xr=Pt.verticalTextBox;return g.allowVerticalPlacement&&rt.numVerticalGlyphVertices>0&&xr?yi(xr,o.WritingMode.vertical):{box:null,offscreen:null}}),An(zt&&zt.box&&zt.box.length)}}if(Si=zt,Qt=Si&&Si.box&&Si.box.length>0,qt=Si&&Si.offscreen,rt.useRuntimeCollisionCircles){let An=g.text.placedSymbolArray.get(rt.centerJustifiedTextSymbolIndex),li=o.evaluateSizeForFeature(g.textSizeData,X,An),yi=_.get("text-padding");Fr=this.collisionIndex.placeCollisionCircles(me,An,g.lineVertexArray,g.glyphOffsetArray,li,I,M,E,d,Te,oe.predicate,rt.collisionCircleDiameter,yi),Qt=ge||Fr.circles.length>0&&!Fr.collisionDetected,qt=qt&&Fr.offscreen}if(Pt.iconFeatureIndex&&(es=Pt.iconFeatureIndex),Pt.iconBox){let An=li=>{let yi=ke&&Qi?L(li,Qi.x,Qi.y,Ne,Te,this.transform.angle):li;return this.collisionIndex.placeCollisionBox(yi,we,k,I,oe.predicate)};ai&&ai.box&&ai.box.length&&Pt.verticalIconBox?(En=An(Pt.verticalIconBox),Wt=En.box.length>0):(En=An(Pt.iconBox),Wt=En.box.length>0),qt=qt&&En.offscreen}let _o=$||rt.numHorizontalGlyphVertices===0&&rt.numVerticalGlyphVertices===0,Es=ne||rt.numIconVertices===0;if(_o||Es?Es?_o||(Wt=Wt&&Qt):Qt=Wt&&Qt:Wt=Qt=Wt&&Qt,Qt&&Si&&Si.box&&this.collisionIndex.insertCollisionBox(Si.box,me,_.get("text-ignore-placement"),g.bucketInstanceId,ai&&ai.box&&Hn?Hn:jn,oe.ID),Wt&&En&&this.collisionIndex.insertCollisionBox(En.box,we,_.get("icon-ignore-placement"),g.bucketInstanceId,es,oe.ID),Fr&&(Qt&&this.collisionIndex.insertCollisionCircles(Fr.circles,me,_.get("text-ignore-placement"),g.bucketInstanceId,jn,oe.ID),d)){let An=g.bucketInstanceId,li=this.collisionCircleArrays[An];li===void 0&&(li=this.collisionCircleArrays[An]=new oa);for(let yi=0;yi<Fr.circles.length;yi+=4)li.circles.push(Fr.circles[yi+0]),li.circles.push(Fr.circles[yi+1]),li.circles.push(Fr.circles[yi+2]),li.circles.push(Fr.collisionDetected?1:0)}this.placements[rt.crossTileID]=new Ti(Qt||Ke,Wt||De,qt||g.justReloaded),c[rt.crossTileID]=!0};if(je){let rt=g.getSortedSymbolIndexes(this.transform.angle);for(let Pt=rt.length-1;Pt>=0;--Pt){let Qt=rt[Pt];mt(g.symbolInstances.get(Qt),g.collisionArrays[Qt])}}else for(let rt=n.symbolInstanceStart;rt<n.symbolInstanceEnd;rt++)mt(g.symbolInstances.get(rt),g.collisionArrays[rt]);if(d&&g.bucketInstanceId in this.collisionCircleArrays){let rt=this.collisionCircleArrays[g.bucketInstanceId];o.invert(rt.invProjMatrix,I),rt.viewportMatrix=this.collisionIndex.getViewportMatrix()}g.justReloaded=!1}markUsedJustification(n,c,d,g){let _;_=g===o.WritingMode.vertical?d.verticalPlacedTextSymbolIndex:{left:d.leftJustifiedTextSymbolIndex,center:d.centerJustifiedTextSymbolIndex,right:d.rightJustifiedTextSymbolIndex}[o.getAnchorJustification(c)];let I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex,d.verticalPlacedTextSymbolIndex];for(let M of I)M>=0&&(n.text.placedSymbolArray.get(M).crossTileID=_>=0&&M!==_?0:d.crossTileID)}markUsedOrientation(n,c,d){let g=c===o.WritingMode.horizontal||c===o.WritingMode.horizontalOnly?c:0,_=c===o.WritingMode.vertical?c:0,I=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];for(let M of I)n.text.placedSymbolArray.get(M).placedOrientation=g;d.verticalPlacedTextSymbolIndex&&(n.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=_)}commit(n){this.commitTime=n,this.zoomAtLastRecencyCheck=this.transform.zoom;let c=this.prevPlacement,d=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;let g=c?c.symbolFadeChange(n):1,_=c?c.opacities:{},I=c?c.variableOffsets:{},M=c?c.placedOrientations:{};for(let E in this.placements){let k=this.placements[E],D=_[E];D?(this.opacities[E]=new rr(D,g,k.text,k.icon),d=d||k.text!==D.text.placed||k.icon!==D.icon.placed):(this.opacities[E]=new rr(null,g,k.text,k.icon,k.skipFade),d=d||k.text||k.icon)}for(let E in _){let k=_[E];if(!this.opacities[E]){let D=new rr(k,g,!1,!1);D.isHidden()||(this.opacities[E]=D,d=d||k.text.placed||k.icon.placed)}}for(let E in I)this.variableOffsets[E]||!this.opacities[E]||this.opacities[E].isHidden()||(this.variableOffsets[E]=I[E]);for(let E in M)this.placedOrientations[E]||!this.opacities[E]||this.opacities[E].isHidden()||(this.placedOrientations[E]=M[E]);d?this.lastPlacementChangeTime=n:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:n)}updateLayerOpacities(n,c){let d={};for(let g of c){let _=g.getBucket(n);_&&g.latestFeatureIndex&&n.id===_.layerIds[0]&&this.updateBucketOpacities(_,d,g.collisionBoxArray)}}updateBucketOpacities(n,c,d){n.hasTextData()&&n.text.opacityVertexArray.clear(),n.hasIconData()&&n.icon.opacityVertexArray.clear(),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexArray.clear(),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexArray.clear();let g=n.layers[0].layout,_=new rr(null,0,!1,!1,!0),I=g.get("text-allow-overlap"),M=g.get("icon-allow-overlap"),E=g.get("text-variable-anchor"),k=g.get("text-rotation-alignment")==="map",D=g.get("text-pitch-alignment")==="map",O=g.get("icon-text-fit")!=="none",X=new rr(null,0,I&&(M||!n.hasIconData()||g.get("icon-optional")),M&&(I||!n.hasTextData()||g.get("text-optional")),!0);!n.collisionArrays&&d&&(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData())&&n.deserializeCollisionBoxes(d);let oe=($,ne,me)=>{for(let ge=0;ge<ne/4;ge++)$.opacityVertexArray.emplaceBack(me)};for(let $=0;$<n.symbolInstances.length;$++){let ne=n.symbolInstances.get($),{numHorizontalGlyphVertices:me,numVerticalGlyphVertices:ge,crossTileID:we}=ne,xe=this.opacities[we];c[we]?xe=_:xe||(xe=X,this.opacities[we]=xe),c[we]=!0;let Ne=ne.numIconVertices>0,Te=this.placedOrientations[ne.crossTileID],ke=Te===o.WritingMode.vertical,je=Te===o.WritingMode.horizontal||Te===o.WritingMode.horizontalOnly;if(me>0||ge>0){let Ke=Ae(xe.text);oe(n.text,me,ke?gt:Ke),oe(n.text,ge,je?gt:Ke);let De=xe.text.isHidden();[ne.rightJustifiedTextSymbolIndex,ne.centerJustifiedTextSymbolIndex,ne.leftJustifiedTextSymbolIndex].forEach(Pt=>{Pt>=0&&(n.text.placedSymbolArray.get(Pt).hidden=De||ke?1:0)}),ne.verticalPlacedTextSymbolIndex>=0&&(n.text.placedSymbolArray.get(ne.verticalPlacedTextSymbolIndex).hidden=De||je?1:0);let mt=this.variableOffsets[ne.crossTileID];mt&&this.markUsedJustification(n,mt.anchor,ne,Te);let rt=this.placedOrientations[ne.crossTileID];rt&&(this.markUsedJustification(n,"left",ne,rt),this.markUsedOrientation(n,rt,ne))}if(Ne){let Ke=Ae(xe.icon),De=!(O&&ne.verticalPlacedIconSymbolIndex&&ke);ne.placedIconSymbolIndex>=0&&(oe(n.icon,ne.numIconVertices,De?Ke:gt),n.icon.placedSymbolArray.get(ne.placedIconSymbolIndex).hidden=xe.icon.isHidden()),ne.verticalPlacedIconSymbolIndex>=0&&(oe(n.icon,ne.numVerticalIconVertices,De?gt:Ke),n.icon.placedSymbolArray.get(ne.verticalPlacedIconSymbolIndex).hidden=xe.icon.isHidden())}if(n.hasIconCollisionBoxData()||n.hasTextCollisionBoxData()){let Ke=n.collisionArrays[$];if(Ke){let De=new o.pointGeometry(0,0);if(Ke.textBox||Ke.verticalTextBox){let rt=!0;if(E){let Pt=this.variableOffsets[we];Pt?(De=P(Pt.anchor,Pt.width,Pt.height,Pt.textOffset,Pt.textBoxScale),k&&De._rotate(D?this.transform.angle:-this.transform.angle)):rt=!1}Ke.textBox&&J(n.textCollisionBox.collisionVertexArray,xe.text.placed,!rt||ke,De.x,De.y),Ke.verticalTextBox&&J(n.textCollisionBox.collisionVertexArray,xe.text.placed,!rt||je,De.x,De.y)}let mt=Boolean(!je&&Ke.verticalIconBox);Ke.iconBox&&J(n.iconCollisionBox.collisionVertexArray,xe.icon.placed,mt,O?De.x:0,O?De.y:0),Ke.verticalIconBox&&J(n.iconCollisionBox.collisionVertexArray,xe.icon.placed,!mt,O?De.x:0,O?De.y:0)}}}if(n.sortFeatures(this.transform.angle),this.retainedQueryData[n.bucketInstanceId]&&(this.retainedQueryData[n.bucketInstanceId].featureSortOrder=n.featureSortOrder),n.hasTextData()&&n.text.opacityVertexBuffer&&n.text.opacityVertexBuffer.updateData(n.text.opacityVertexArray),n.hasIconData()&&n.icon.opacityVertexBuffer&&n.icon.opacityVertexBuffer.updateData(n.icon.opacityVertexArray),n.hasIconCollisionBoxData()&&n.iconCollisionBox.collisionVertexBuffer&&n.iconCollisionBox.collisionVertexBuffer.updateData(n.iconCollisionBox.collisionVertexArray),n.hasTextCollisionBoxData()&&n.textCollisionBox.collisionVertexBuffer&&n.textCollisionBox.collisionVertexBuffer.updateData(n.textCollisionBox.collisionVertexArray),n.bucketInstanceId in this.collisionCircleArrays){let $=this.collisionCircleArrays[n.bucketInstanceId];n.placementInvProjMatrix=$.invProjMatrix,n.placementViewportMatrix=$.viewportMatrix,n.collisionCircleArray=$.circles,delete this.collisionCircleArrays[n.bucketInstanceId]}}symbolFadeChange(n){return this.fadeDuration===0?1:(n-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(n){return Math.max(0,(this.transform.zoom-n)/1.5)}hasTransitions(n){return this.stale||n-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(n,c){let d=this.zoomAtLastRecencyCheck===c?1-this.zoomAdjustment(c):1;return this.zoomAtLastRecencyCheck=c,this.commitTime+this.fadeDuration*d>n}setStale(){this.stale=!0}}function J(f,n,c,d,g){f.emplaceBack(n?1:0,c?1:0,d||0,g||0),f.emplaceBack(n?1:0,c?1:0,d||0,g||0),f.emplaceBack(n?1:0,c?1:0,d||0,g||0),f.emplaceBack(n?1:0,c?1:0,d||0,g||0)}let re=Math.pow(2,25),pe=Math.pow(2,24),ue=Math.pow(2,17),ce=Math.pow(2,16),fe=Math.pow(2,9),Pe=Math.pow(2,8),Ge=Math.pow(2,1);function Ae(f){if(f.opacity===0&&!f.placed)return 0;if(f.opacity===1&&f.placed)return 4294967295;let n=f.placed?1:0,c=Math.floor(127*f.opacity);return c*re+n*pe+c*ue+n*ce+c*fe+n*Pe+c*Ge+n}let gt=0;class lt{constructor(n){this._sortAcrossTiles=n.layout.get("symbol-z-order")!=="viewport-y"&&!n.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(n,c,d,g,_){let I=this._bucketParts;for(;this._currentTileIndex<n.length;)if(c.getBucketParts(I,g,n[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,_())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,I.sort((M,E)=>M.sortKey-E.sortKey));this._currentPartIndex<I.length;)if(c.placeLayerBucketPart(I[this._currentPartIndex],this._seenCrossTileIDs,d),this._currentPartIndex++,_())return!0;return!1}}class xt{constructor(n,c,d,g,_,I,M){this.placement=new j(n,_,I,M),this._currentPlacementIndex=c.length-1,this._forceFullPlacement=d,this._showCollisionBoxes=g,this._done=!1}isDone(){return this._done}continuePlacement(n,c,d){let g=o.exported.now(),_=()=>{let I=o.exported.now()-g;return!this._forceFullPlacement&&I>2};for(;this._currentPlacementIndex>=0;){let I=c[n[this._currentPlacementIndex]],M=this.placement.collisionIndex.transform.zoom;if(I.type==="symbol"&&(!I.minzoom||I.minzoom<=M)&&(!I.maxzoom||I.maxzoom>M)){if(this._inProgressLayer||(this._inProgressLayer=new lt(I)),this._inProgressLayer.continuePlacement(d[I.source],this.placement,this._showCollisionBoxes,I,_))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(n){return this.placement.commit(n),this.placement}}let Ct=512/o.EXTENT/2;class ni{constructor(n,c,d){this.tileID=n,this.indexedSymbolInstances={},this.bucketInstanceId=d;for(let g=0;g<c.length;g++){let _=c.get(g),I=_.key;this.indexedSymbolInstances[I]||(this.indexedSymbolInstances[I]=[]),this.indexedSymbolInstances[I].push({crossTileID:_.crossTileID,coord:this.getScaledCoordinates(_,n)})}}getScaledCoordinates(n,c){let d=Ct/Math.pow(2,c.canonical.z-this.tileID.canonical.z);return{x:Math.floor((c.canonical.x*o.EXTENT+n.anchorX)*d),y:Math.floor((c.canonical.y*o.EXTENT+n.anchorY)*d)}}findMatches(n,c,d){let g=this.tileID.canonical.z<c.canonical.z?1:Math.pow(2,this.tileID.canonical.z-c.canonical.z);for(let _=0;_<n.length;_++){let I=n.get(_);if(I.crossTileID)continue;let M=this.indexedSymbolInstances[I.key];if(!M)continue;let E=this.getScaledCoordinates(I,c);for(let k of M)if(Math.abs(k.coord.x-E.x)<=g&&Math.abs(k.coord.y-E.y)<=g&&!d[k.crossTileID]){d[k.crossTileID]=!0,I.crossTileID=k.crossTileID;break}}}}class $t{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ut{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(n){let c=Math.round((n-this.lng)/360);if(c!==0)for(let d in this.indexes){let g=this.indexes[d],_={};for(let I in g){let M=g[I];M.tileID=M.tileID.unwrapTo(M.tileID.wrap+c),_[M.tileID.key]=M}this.indexes[d]=_}this.lng=n}addBucket(n,c,d){if(this.indexes[n.overscaledZ]&&this.indexes[n.overscaledZ][n.key]){if(this.indexes[n.overscaledZ][n.key].bucketInstanceId===c.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(n.overscaledZ,this.indexes[n.overscaledZ][n.key])}for(let _=0;_<c.symbolInstances.length;_++)c.symbolInstances.get(_).crossTileID=0;this.usedCrossTileIDs[n.overscaledZ]||(this.usedCrossTileIDs[n.overscaledZ]={});let g=this.usedCrossTileIDs[n.overscaledZ];for(let _ in this.indexes){let I=this.indexes[_];if(Number(_)>n.overscaledZ)for(let M in I){let E=I[M];E.tileID.isChildOf(n)&&E.findMatches(c.symbolInstances,n,g)}else{let M=I[n.scaledTo(Number(_)).key];M&&M.findMatches(c.symbolInstances,n,g)}}for(let _=0;_<c.symbolInstances.length;_++){let I=c.symbolInstances.get(_);I.crossTileID||(I.crossTileID=d.generate(),g[I.crossTileID]=!0)}return this.indexes[n.overscaledZ]===void 0&&(this.indexes[n.overscaledZ]={}),this.indexes[n.overscaledZ][n.key]=new ni(n,c.symbolInstances,c.bucketInstanceId),!0}removeBucketCrossTileIDs(n,c){for(let d in c.indexedSymbolInstances)for(let g of c.indexedSymbolInstances[d])delete this.usedCrossTileIDs[n][g.crossTileID]}removeStaleBuckets(n){let c=!1;for(let d in this.indexes){let g=this.indexes[d];for(let _ in g)n[g[_].bucketInstanceId]||(this.removeBucketCrossTileIDs(d,g[_]),delete g[_],c=!0)}return c}}class Bt{constructor(){this.layerIndexes={},this.crossTileIDs=new $t,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(n,c,d){let g=this.layerIndexes[n.id];g===void 0&&(g=this.layerIndexes[n.id]=new Ut);let _=!1,I={};g.handleWrapJump(d);for(let M of c){let E=M.getBucket(n);E&&n.id===E.layerIds[0]&&(E.bucketInstanceId||(E.bucketInstanceId=++this.maxBucketInstanceId),g.addBucket(M.tileID,E,this.crossTileIDs)&&(_=!0),I[E.bucketInstanceId]=!0)}return g.removeStaleBuckets(I)&&(_=!0),_}pruneUnusedLayers(n){let c={};n.forEach(d=>{c[d]=!0});for(let d in this.layerIndexes)c[d]||delete this.layerIndexes[d]}}let Rt=(f,n)=>o.emitValidationErrors(f,n&&n.filter(c=>c.identifier!=="source.canvas")),cr=o.pick(K,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),nr=o.pick(K,["setCenter","setZoom","setBearing","setPitch"]),Lr=function(){let f={},n=o.spec.$version;for(let c in o.spec.$root){let d=o.spec.$root[c];if(d.required){let g=null;g=c==="version"?n:d.type==="array"?[]:{},g!=null&&(f[c]=g)}}return f}();class Nr extends o.Evented{constructor(n,c={}){super(),this.map=n,this.dispatcher=new Ot(V(),this),this.imageManager=new te,this.imageManager.setEventedParent(this),this.glyphManager=new Be(n._requestManager,c.localIdeographFontFamily),this.lineAtlas=new At(256,512),this.crossTileSymbolIndex=new Bt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.getReferrer());let d=this;this._rtlTextPluginCallback=Nr.registerForPluginStateChange(g=>{d.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:g.pluginStatus,pluginURL:g.pluginURL},(_,I)=>{if(o.triggerPluginCompletionEvent(_),I&&I.every(M=>M))for(let M in d.sourceCaches)d.sourceCaches[M].reload()})}),this.on("data",g=>{if(g.dataType!=="source"||g.sourceDataType!=="metadata")return;let _=this.sourceCaches[g.sourceId];if(!_)return;let I=_.getSource();if(I&&I.vectorLayerIds)for(let M in this._layers){let E=this._layers[M];E.source===I.id&&this._validateLayer(E)}})}loadURL(n,c={}){this.fire(new o.Event("dataloading",{dataType:"style"}));let d=typeof c.validate!="boolean"||c.validate,g=this.map._requestManager.transformRequest(n,o.ResourceType.Style);this._request=o.getJSON(g,(_,I)=>{this._request=null,_?this.fire(new o.ErrorEvent(_)):I&&this._load(I,d)})}loadJSON(n,c={}){this.fire(new o.Event("dataloading",{dataType:"style"})),this._request=o.exported.frame(()=>{this._request=null,this._load(n,c.validate!==!1)})}loadEmpty(){this.fire(new o.Event("dataloading",{dataType:"style"})),this._load(Lr,!1)}_load(n,c){if(c&&Rt(this,o.validateStyle(n)))return;this._loaded=!0,this.stylesheet=n;for(let g in n.sources)this.addSource(g,n.sources[g],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);let d=U(this.stylesheet.layers);this._order=d.map(g=>g.id),this._layers={},this._serializedLayers={};for(let g of d)g=o.createStyleLayer(g),g.setEventedParent(this,{layer:{id:g.id}}),this._layers[g.id]=g,this._serializedLayers[g.id]=g.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ht(this.stylesheet.light),this.fire(new o.Event("data",{dataType:"style"})),this.fire(new o.Event("style.load"))}_loadSprite(n){this._spriteRequest=function(c,d,g,_){let I,M,E,k=g>1?"@2x":"",D=o.getJSON(d.transformRequest(d.normalizeSpriteURL(c,k,".json"),o.ResourceType.SpriteJSON),(oe,$)=>{D=null,E||(E=oe,I=$,X())}),O=o.getImage(d.transformRequest(d.normalizeSpriteURL(c,k,".png"),o.ResourceType.SpriteImage),(oe,$)=>{O=null,E||(E=oe,M=$,X())});function X(){if(E)_(E);else if(I&&M){let oe=o.exported.getImageData(M),$={};for(let ne in I){let{width:me,height:ge,x:we,y:xe,sdf:Ne,pixelRatio:Te,stretchX:ke,stretchY:je,content:Ke}=I[ne],De=new o.RGBAImage({width:me,height:ge});o.RGBAImage.copy(oe,De,{x:we,y:xe},{x:0,y:0},{width:me,height:ge}),$[ne]={data:De,pixelRatio:Te,sdf:Ne,stretchX:ke,stretchY:je,content:Ke}}_(null,$)}}return{cancel(){D&&(D.cancel(),D=null),O&&(O.cancel(),O=null)}}}(n,this.map._requestManager,this.map.getPixelRatio(),(c,d)=>{if(this._spriteRequest=null,c)this.fire(new o.ErrorEvent(c));else if(d)for(let g in d)this.imageManager.addImage(g,d[g]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))})}_validateLayer(n){let c=this.sourceCaches[n.source];if(!c)return;let d=n.sourceLayer;if(!d)return;let g=c.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(d)===-1)&&this.fire(new o.ErrorEvent(new Error(`Source layer "${d}" does not exist on source "${g.id}" as specified by style layer "${n.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(n){let c=[];for(let d of n){let g=this._layers[d];g.type!=="custom"&&c.push(g.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(let n in this._layers)if(this._layers[n].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(n){if(!this._loaded)return;let c=this._changed;if(this._changed){let g=Object.keys(this._updatedLayers),_=Object.keys(this._removedLayers);(g.length||_.length)&&this._updateWorkerLayers(g,_);for(let I in this._updatedSources){let M=this._updatedSources[I];M==="reload"?this._reloadSource(I):M==="clear"&&this._clearSource(I)}this._updateTilesForChangedImages();for(let I in this._updatedPaintProps)this._layers[I].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}let d={};for(let g in this.sourceCaches){let _=this.sourceCaches[g];d[g]=_.used,_.used=!1}for(let g of this._order){let _=this._layers[g];_.recalculate(n,this._availableImages),!_.isHidden(n.zoom)&&_.source&&(this.sourceCaches[_.source].used=!0)}for(let g in d){let _=this.sourceCaches[g];d[g]!==_.used&&_.fire(new o.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(n),this.z=n.zoom,c&&this.fire(new o.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){let n=Object.keys(this._changedImages);if(n.length){for(let c in this.sourceCaches)this.sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}}_updateWorkerLayers(n,c){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:c})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(n){if(this._checkLoaded(),Rt(this,o.validateStyle(n)))return!1;(n=o.clone$1(n)).layers=U(n.layers);let c=function(g,_){if(!g)return[{command:K.setStyle,args:[_]}];let I=[];try{if(!C(g.version,_.version))return[{command:K.setStyle,args:[_]}];C(g.center,_.center)||I.push({command:K.setCenter,args:[_.center]}),C(g.zoom,_.zoom)||I.push({command:K.setZoom,args:[_.zoom]}),C(g.bearing,_.bearing)||I.push({command:K.setBearing,args:[_.bearing]}),C(g.pitch,_.pitch)||I.push({command:K.setPitch,args:[_.pitch]}),C(g.sprite,_.sprite)||I.push({command:K.setSprite,args:[_.sprite]}),C(g.glyphs,_.glyphs)||I.push({command:K.setGlyphs,args:[_.glyphs]}),C(g.transition,_.transition)||I.push({command:K.setTransition,args:[_.transition]}),C(g.light,_.light)||I.push({command:K.setLight,args:[_.light]});let M={},E=[];(function(D,O,X,oe){let $;for($ in O=O||{},D=D||{})Object.prototype.hasOwnProperty.call(D,$)&&(Object.prototype.hasOwnProperty.call(O,$)||Ie($,X,oe));for($ in O)Object.prototype.hasOwnProperty.call(O,$)&&(Object.prototype.hasOwnProperty.call(D,$)?C(D[$],O[$])||(D[$].type==="geojson"&&O[$].type==="geojson"&&He(D,O,$)?X.push({command:K.setGeoJSONSourceData,args:[$,O[$].data]}):Ve($,O,X,oe)):he($,O,X))})(g.sources,_.sources,E,M);let k=[];g.layers&&g.layers.forEach(D=>{M[D.source]?I.push({command:K.removeLayer,args:[D.id]}):k.push(D)}),I=I.concat(E),function(D,O,X){O=O||[];let oe=(D=D||[]).map(Re),$=O.map(Re),ne=D.reduce(ie,{}),me=O.reduce(ie,{}),ge=oe.slice(),we=Object.create(null),xe,Ne,Te,ke,je,Ke,De;for(xe=0,Ne=0;xe<oe.length;xe++)Te=oe[xe],Object.prototype.hasOwnProperty.call(me,Te)?Ne++:(X.push({command:K.removeLayer,args:[Te]}),ge.splice(ge.indexOf(Te,Ne),1));for(xe=0,Ne=0;xe<$.length;xe++)Te=$[$.length-1-xe],ge[ge.length-1-xe]!==Te&&(Object.prototype.hasOwnProperty.call(ne,Te)?(X.push({command:K.removeLayer,args:[Te]}),ge.splice(ge.lastIndexOf(Te,ge.length-Ne),1)):Ne++,Ke=ge[ge.length-xe],X.push({command:K.addLayer,args:[me[Te],Ke]}),ge.splice(ge.length-xe,0,Te),we[Te]=!0);for(xe=0;xe<$.length;xe++)if(Te=$[xe],ke=ne[Te],je=me[Te],!we[Te]&&!C(ke,je))if(C(ke.source,je.source)&&C(ke["source-layer"],je["source-layer"])&&C(ke.type,je.type)){for(De in ye(ke.layout,je.layout,X,Te,null,K.setLayoutProperty),ye(ke.paint,je.paint,X,Te,null,K.setPaintProperty),C(ke.filter,je.filter)||X.push({command:K.setFilter,args:[Te,je.filter]}),C(ke.minzoom,je.minzoom)&&C(ke.maxzoom,je.maxzoom)||X.push({command:K.setLayerZoomRange,args:[Te,je.minzoom,je.maxzoom]}),ke)Object.prototype.hasOwnProperty.call(ke,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&(De.indexOf("paint.")===0?ye(ke[De],je[De],X,Te,De.slice(6),K.setPaintProperty):C(ke[De],je[De])||X.push({command:K.setLayerProperty,args:[Te,De,je[De]]}));for(De in je)Object.prototype.hasOwnProperty.call(je,De)&&!Object.prototype.hasOwnProperty.call(ke,De)&&De!=="layout"&&De!=="paint"&&De!=="filter"&&De!=="metadata"&&De!=="minzoom"&&De!=="maxzoom"&&(De.indexOf("paint.")===0?ye(ke[De],je[De],X,Te,De.slice(6),K.setPaintProperty):C(ke[De],je[De])||X.push({command:K.setLayerProperty,args:[Te,De,je[De]]}))}else X.push({command:K.removeLayer,args:[Te]}),Ke=ge[ge.lastIndexOf(Te)+1],X.push({command:K.addLayer,args:[je,Ke]})}(k,_.layers,I)}catch(M){console.warn("Unable to compute style diff:",M),I=[{command:K.setStyle,args:[_]}]}return I}(this.serialize(),n).filter(g=>!(g.command in nr));if(c.length===0)return!1;let d=c.filter(g=>!(g.command in cr));if(d.length>0)throw new Error(`Unimplemented: ${d.map(g=>g.command).join(", ")}.`);return c.forEach(g=>{g.command!=="setTransition"&&this[g.command].apply(this,g.args)}),this.stylesheet=n,!0}addImage(n,c){if(this.getImage(n))return this.fire(new o.ErrorEvent(new Error(`An image named "${n}" already exists.`)));this.imageManager.addImage(n,c),this._afterImageUpdated(n)}updateImage(n,c){this.imageManager.updateImage(n,c)}getImage(n){return this.imageManager.getImage(n)}removeImage(n){if(!this.getImage(n))return this.fire(new o.ErrorEvent(new Error(`An image named "${n}" does not exist.`)));this.imageManager.removeImage(n),this._afterImageUpdated(n)}_afterImageUpdated(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(n,c,d={}){if(this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error(`Source "${n}" already exists.`);if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(o.validateStyle.source,`sources.${n}`,c,null,d))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);let g=this.sourceCaches[n]=new ii(n,c,this.dispatcher);g.style=this,g.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:g.serialize(),sourceId:n})),g.onAdd(this.map),this._changed=!0}removeSource(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(let d in this._layers)if(this._layers[d].source===n)return this.fire(new o.ErrorEvent(new Error(`Source "${n}" cannot be removed while layer "${d}" is using it.`)));let c=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],c.fire(new o.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),c.setEventedParent(null),c.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(n,c){this._checkLoaded(),this.sourceCaches[n].getSource().setData(c),this._changed=!0}getSource(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()}addLayer(n,c,d={}){this._checkLoaded();let g=n.id;if(this.getLayer(g))return void this.fire(new o.ErrorEvent(new Error(`Layer "${g}" already exists on this map.`)));let _;if(n.type==="custom"){if(Rt(this,o.validateCustomStyleLayer(n)))return;_=o.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(g,n.source),n=o.clone$1(n),n=o.extend(n,{source:g})),this._validate(o.validateStyle.layer,`layers.${g}`,n,{arrayIndex:-1},d))return;_=o.createStyleLayer(n),this._validateLayer(_),_.setEventedParent(this,{layer:{id:g}}),this._serializedLayers[_.id]=_.serialize()}let I=c?this._order.indexOf(c):this._order.length;if(c&&I===-1)this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${g}" before non-existing layer "${c}".`)));else{if(this._order.splice(I,0,g),this._layerOrderChanged=!0,this._layers[g]=_,this._removedLayers[g]&&_.source&&_.type!=="custom"){let M=this._removedLayers[g];delete this._removedLayers[g],M.type!==_.type?this._updatedSources[_.source]="clear":(this._updatedSources[_.source]="reload",this.sourceCaches[_.source].pause())}this._updateLayer(_),_.onAdd&&_.onAdd(this.map)}}moveLayer(n,c){if(this._checkLoaded(),this._changed=!0,!this._layers[n])return void this.fire(new o.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be moved.`)));if(n===c)return;let d=this._order.indexOf(n);this._order.splice(d,1);let g=c?this._order.indexOf(c):this._order.length;c&&g===-1?this.fire(new o.ErrorEvent(new Error(`Cannot move layer "${n}" before non-existing layer "${c}".`))):(this._order.splice(g,0,n),this._layerOrderChanged=!0)}removeLayer(n){this._checkLoaded();let c=this._layers[n];if(!c)return void this.fire(new o.ErrorEvent(new Error(`Cannot remove non-existing layer "${n}".`)));c.setEventedParent(null);let d=this._order.indexOf(n);this._order.splice(d,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=c,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],c.onRemove&&c.onRemove(this.map)}getLayer(n){return this._layers[n]}hasLayer(n){return n in this._layers}setLayerZoomRange(n,c,d){this._checkLoaded();let g=this.getLayer(n);g?g.minzoom===c&&g.maxzoom===d||(c!=null&&(g.minzoom=c),d!=null&&(g.maxzoom=d),this._updateLayer(g)):this.fire(new o.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${n}".`)))}setFilter(n,c,d={}){this._checkLoaded();let g=this.getLayer(n);if(g){if(!C(g.filter,c))return c==null?(g.filter=void 0,void this._updateLayer(g)):void(this._validate(o.validateStyle.filter,`layers.${g.id}.filter`,c,null,d)||(g.filter=o.clone$1(c),this._updateLayer(g)))}else this.fire(new o.ErrorEvent(new Error(`Cannot filter non-existing layer "${n}".`)))}getFilter(n){return o.clone$1(this.getLayer(n).filter)}setLayoutProperty(n,c,d,g={}){this._checkLoaded();let _=this.getLayer(n);_?C(_.getLayoutProperty(c),d)||(_.setLayoutProperty(c,d,g),this._updateLayer(_)):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${n}".`)))}getLayoutProperty(n,c){let d=this.getLayer(n);if(d)return d.getLayoutProperty(c);this.fire(new o.ErrorEvent(new Error(`Cannot get style of non-existing layer "${n}".`)))}setPaintProperty(n,c,d,g={}){this._checkLoaded();let _=this.getLayer(n);_?C(_.getPaintProperty(c),d)||(_.setPaintProperty(c,d,g)&&this._updateLayer(_),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${n}".`)))}getPaintProperty(n,c){return this.getLayer(n).getPaintProperty(c)}setFeatureState(n,c){this._checkLoaded();let d=n.source,g=n.sourceLayer,_=this.sourceCaches[d];if(_===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${d}' does not exist in the map's style.`)));let I=_.getSource().type;I==="geojson"&&g?this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):I!=="vector"||g?(n.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),_.setFeatureState(g,n.id,c)):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(n,c){this._checkLoaded();let d=n.source,g=this.sourceCaches[d];if(g===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${d}' does not exist in the map's style.`)));let _=g.getSource().type,I=_==="vector"?n.sourceLayer:void 0;_!=="vector"||I?c&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(I,n.id,c):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(n){this._checkLoaded();let c=n.source,d=n.sourceLayer,g=this.sourceCaches[c];if(g!==void 0)return g.getSource().type!=="vector"||d?(n.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),g.getFeatureState(d,n.id)):void this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new o.ErrorEvent(new Error(`The source '${c}' does not exist in the map's style.`)))}getTransition(){return o.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return o.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,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,sources:o.mapObject(this.sourceCaches,n=>n.serialize()),layers:this._serializeLayers(this._order)},n=>n!==void 0)}_updateLayer(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(n){let c=I=>this._layers[I].type==="fill-extrusion",d={},g=[];for(let I=this._order.length-1;I>=0;I--){let M=this._order[I];if(c(M)){d[M]=I;for(let E of n){let k=E[M];if(k)for(let D of k)g.push(D)}}}g.sort((I,M)=>M.intersectionZ-I.intersectionZ);let _=[];for(let I=this._order.length-1;I>=0;I--){let M=this._order[I];if(c(M))for(let E=g.length-1;E>=0;E--){let k=g[E].feature;if(d[k.layer.id]<I)break;_.push(k),g.pop()}else for(let E of n){let k=E[M];if(k)for(let D of k)_.push(D.feature)}}return _}queryRenderedFeatures(n,c,d){c&&c.filter&&this._validate(o.validateStyle.filter,"queryRenderedFeatures.filter",c.filter,null,c);let g={};if(c&&c.layers){if(!Array.isArray(c.layers))return this.fire(new o.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(let I of c.layers){let M=this._layers[I];if(!M)return this.fire(new o.ErrorEvent(new Error(`The layer '${I}' does not exist in the map's style and cannot be queried for features.`))),[];g[M.source]=!0}}let _=[];c.availableImages=this._availableImages;for(let I in this.sourceCaches)c.layers&&!g[I]||_.push(Fi(this.sourceCaches[I],this._layers,this._serializedLayers,n,c,d));return this.placement&&_.push(function(I,M,E,k,D,O,X){let oe={},$=O.queryRenderedSymbols(k),ne=[];for(let me of Object.keys($).map(Number))ne.push(X[me]);ne.sort(Ji);for(let me of ne){let ge=me.featureIndex.lookupSymbolFeatures($[me.bucketInstanceId],M,me.bucketIndex,me.sourceLayerIndex,D.filter,D.layers,D.availableImages,I);for(let we in ge){let xe=oe[we]=oe[we]||[],Ne=ge[we];Ne.sort((Te,ke)=>{let je=me.featureSortOrder;if(je){let Ke=je.indexOf(Te.featureIndex);return je.indexOf(ke.featureIndex)-Ke}return ke.featureIndex-Te.featureIndex});for(let Te of Ne)xe.push(Te)}}for(let me in oe)oe[me].forEach(ge=>{let we=ge.feature,xe=E[I[me].source].getFeatureState(we.layer["source-layer"],we.id);we.source=we.layer.source,we.layer["source-layer"]&&(we.sourceLayer=we.layer["source-layer"]),we.state=xe});return oe}(this._layers,this._serializedLayers,this.sourceCaches,n,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(_)}querySourceFeatures(n,c){c&&c.filter&&this._validate(o.validateStyle.filter,"querySourceFeatures.filter",c.filter,null,c);let d=this.sourceCaches[n];return d?function(g,_){let I=g.getRenderableIds().map(k=>g.getTileByID(k)),M=[],E={};for(let k=0;k<I.length;k++){let D=I[k],O=D.tileID.canonical.key;E[O]||(E[O]=!0,D.querySourceFeatures(M,_))}return M}(d,c):[]}addSourceType(n,c,d){return Nr.getSourceType(n)?d(new Error(`A source type called "${n}" already exists.`)):(Nr.setSourceType(n,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:c.workerSourceURL},d):d(null,null))}getLight(){return this.light.getLight()}setLight(n,c={}){this._checkLoaded();let d=this.light.getLight(),g=!1;for(let I in n)if(!C(n[I],d[I])){g=!0;break}if(!g)return;let _={now:o.exported.now(),transition:o.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,c),this.light.updateTransitions(_)}_validate(n,c,d,g,_={}){return(!_||_.validate!==!1)&&Rt(this,n.call(o.validateStyle,o.extend({key:c,style:this.serialize(),value:d,styleSpec:o.spec},g)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),o.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(let n in this._layers)this._layers[n].setEventedParent(null);for(let n in this.sourceCaches){let c=this.sourceCaches[n];c.setEventedParent(null),c.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(n){this.sourceCaches[n].clearTiles()}_reloadSource(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()}_updateSources(n){for(let c in this.sourceCaches)this.sourceCaches[c].update(n)}_generateCollisionBoxes(){for(let n in this.sourceCaches)this._reloadSource(n)}_updatePlacement(n,c,d,g,_=!1){let I=!1,M=!1,E={};for(let k of this._order){let D=this._layers[k];if(D.type!=="symbol")continue;if(!E[D.source]){let X=this.sourceCaches[D.source];E[D.source]=X.getRenderableIds(!0).map(oe=>X.getTileByID(oe)).sort((oe,$)=>$.tileID.overscaledZ-oe.tileID.overscaledZ||(oe.tileID.isLessThan($.tileID)?-1:1))}let O=this.crossTileSymbolIndex.addLayer(D,E[D.source],n.center.lng);I=I||O}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((_=_||this._layerOrderChanged||d===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),n.zoom))&&(this.pauseablePlacement=new xt(n,this._order,_,c,d,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,E),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),M=!0),I&&this.pauseablePlacement.placement.setStale()),M||I)for(let k of this._order){let D=this._layers[k];D.type==="symbol"&&this.placement.updateLayerOpacities(D,E[D.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.exported.now())}_releaseSymbolFadeTiles(){for(let n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()}getImages(n,c,d){this.imageManager.getImages(c.icons,d),this._updateTilesForChangedImages();let g=this.sourceCaches[c.source];g&&g.setDependencies(c.tileID.key,c.type,c.icons)}getGlyphs(n,c,d){this.glyphManager.getGlyphs(c.stacks,d)}getResource(n,c,d){return o.makeRequest(c,d)}}Nr.getSourceType=function(f){return Ei[f]},Nr.setSourceType=function(f,n){Ei[f]=n},Nr.registerForPluginStateChange=o.registerForPluginStateChange;var Gc=o.createLayout([{name:"a_pos",type:"Int16",components:2}]),Vc={prelude:Pi(`#ifdef GL_ES
11
+ precision mediump float;
12
+ #else
13
+ #if !defined(lowp)
14
+ #define lowp
15
+ #endif
16
+ #if !defined(mediump)
17
+ #define mediump
18
+ #endif
19
+ #if !defined(highp)
20
+ #define highp
21
+ #endif
22
+ #endif`,`#ifdef GL_ES
23
+ precision highp float;
24
+ #else
25
+ #if !defined(lowp)
26
+ #define lowp
27
+ #endif
28
+ #if !defined(mediump)
29
+ #define mediump
30
+ #endif
31
+ #if !defined(highp)
32
+ #define highp
33
+ #endif
34
+ #endif
35
+ vec2 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(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
36
+ );}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);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),background:Pi(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
37
+ #ifdef OVERDRAW_INSPECTOR
38
+ gl_FragColor=vec4(1.0);
39
+ #endif
40
+ }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Pi(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
41
+ #ifdef OVERDRAW_INSPECTOR
42
+ gl_FragColor=vec4(1.0);
43
+ #endif
44
+ }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Pi(`varying vec3 v_data;
45
+ #pragma mapbox: define highp vec4 color
46
+ #pragma mapbox: define mediump float radius
47
+ #pragma mapbox: define lowp float blur
48
+ #pragma mapbox: define lowp float opacity
49
+ #pragma mapbox: define highp vec4 stroke_color
50
+ #pragma mapbox: define mediump float stroke_width
51
+ #pragma mapbox: define lowp float stroke_opacity
52
+ void main() {
53
+ #pragma mapbox: initialize highp vec4 color
54
+ #pragma mapbox: initialize mediump float radius
55
+ #pragma mapbox: initialize lowp float blur
56
+ #pragma mapbox: initialize lowp float opacity
57
+ #pragma mapbox: initialize highp vec4 stroke_color
58
+ #pragma mapbox: initialize mediump float stroke_width
59
+ #pragma mapbox: initialize lowp float stroke_opacity
60
+ vec2 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(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
61
+ #ifdef OVERDRAW_INSPECTOR
62
+ gl_FragColor=vec4(1.0);
63
+ #endif
64
+ }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
65
+ #pragma mapbox: define highp vec4 color
66
+ #pragma mapbox: define mediump float radius
67
+ #pragma mapbox: define lowp float blur
68
+ #pragma mapbox: define lowp float opacity
69
+ #pragma mapbox: define highp vec4 stroke_color
70
+ #pragma mapbox: define mediump float stroke_width
71
+ #pragma mapbox: define lowp float stroke_opacity
72
+ void main(void) {
73
+ #pragma mapbox: initialize highp vec4 color
74
+ #pragma mapbox: initialize mediump float radius
75
+ #pragma mapbox: initialize lowp float blur
76
+ #pragma mapbox: initialize lowp float opacity
77
+ #pragma mapbox: initialize highp vec4 stroke_color
78
+ #pragma mapbox: initialize mediump float stroke_width
79
+ #pragma mapbox: initialize lowp float stroke_opacity
80
+ vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Pi("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Pi(`uniform highp float u_intensity;varying vec2 v_extrude;
81
+ #pragma mapbox: define highp float weight
82
+ #define GAUSS_COEF 0.3989422804014327
83
+ void main() {
84
+ #pragma mapbox: initialize highp float weight
85
+ float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
86
+ #ifdef OVERDRAW_INSPECTOR
87
+ gl_FragColor=vec4(1.0);
88
+ #endif
89
+ }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
90
+ #pragma mapbox: define highp float weight
91
+ #pragma mapbox: define mediump float radius
92
+ const highp float ZERO=1.0/255.0/16.0;
93
+ #define GAUSS_COEF 0.3989422804014327
94
+ void main(void) {
95
+ #pragma mapbox: initialize highp float weight
96
+ #pragma mapbox: initialize mediump float radius
97
+ vec2 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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Pi(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
98
+ #ifdef OVERDRAW_INSPECTOR
99
+ gl_FragColor=vec4(0.0);
100
+ #endif
101
+ }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Pi("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Pi("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying 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);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying 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;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-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(0.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:Pi("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),fill:Pi(`#pragma mapbox: define highp vec4 color
102
+ #pragma mapbox: define lowp float opacity
103
+ void main() {
104
+ #pragma mapbox: initialize highp vec4 color
105
+ #pragma mapbox: initialize lowp float opacity
106
+ gl_FragColor=color*opacity;
107
+ #ifdef OVERDRAW_INSPECTOR
108
+ gl_FragColor=vec4(1.0);
109
+ #endif
110
+ }`,`attribute vec2 a_pos;uniform mat4 u_matrix;
111
+ #pragma mapbox: define highp vec4 color
112
+ #pragma mapbox: define lowp float opacity
113
+ void main() {
114
+ #pragma mapbox: initialize highp vec4 color
115
+ #pragma mapbox: initialize lowp float opacity
116
+ gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Pi(`varying vec2 v_pos;
117
+ #pragma mapbox: define highp vec4 outline_color
118
+ #pragma mapbox: define lowp float opacity
119
+ void main() {
120
+ #pragma mapbox: initialize highp vec4 outline_color
121
+ #pragma mapbox: initialize lowp float opacity
122
+ float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
123
+ #ifdef OVERDRAW_INSPECTOR
124
+ gl_FragColor=vec4(1.0);
125
+ #endif
126
+ }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
127
+ #pragma mapbox: define highp vec4 outline_color
128
+ #pragma mapbox: define lowp float opacity
129
+ void main() {
130
+ #pragma mapbox: initialize highp vec4 outline_color
131
+ #pragma mapbox: initialize lowp float opacity
132
+ gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Pi(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
133
+ #pragma mapbox: define lowp float opacity
134
+ #pragma mapbox: define lowp vec4 pattern_from
135
+ #pragma mapbox: define lowp vec4 pattern_to
136
+ void main() {
137
+ #pragma mapbox: initialize lowp float opacity
138
+ #pragma mapbox: initialize mediump vec4 pattern_from
139
+ #pragma mapbox: initialize mediump vec4 pattern_to
140
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
141
+ #ifdef OVERDRAW_INSPECTOR
142
+ gl_FragColor=vec4(1.0);
143
+ #endif
144
+ }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
145
+ #pragma mapbox: define lowp float opacity
146
+ #pragma mapbox: define lowp vec4 pattern_from
147
+ #pragma mapbox: define lowp vec4 pattern_to
148
+ #pragma mapbox: define lowp float pixel_ratio_from
149
+ #pragma mapbox: define lowp float pixel_ratio_to
150
+ void main() {
151
+ #pragma mapbox: initialize lowp float opacity
152
+ #pragma mapbox: initialize mediump vec4 pattern_from
153
+ #pragma mapbox: initialize mediump vec4 pattern_to
154
+ #pragma mapbox: initialize lowp float pixel_ratio_from
155
+ #pragma mapbox: initialize lowp float pixel_ratio_to
156
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Pi(`#ifdef GL_ES
157
+ precision highp float;
158
+ #endif
159
+ uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
160
+ #pragma mapbox: define lowp float opacity
161
+ #pragma mapbox: define lowp vec4 pattern_from
162
+ #pragma mapbox: define lowp vec4 pattern_to
163
+ void main() {
164
+ #pragma mapbox: initialize lowp float opacity
165
+ #pragma mapbox: initialize mediump vec4 pattern_from
166
+ #pragma mapbox: initialize mediump vec4 pattern_to
167
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
168
+ #ifdef OVERDRAW_INSPECTOR
169
+ gl_FragColor=vec4(1.0);
170
+ #endif
171
+ }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
172
+ #pragma mapbox: define lowp float opacity
173
+ #pragma mapbox: define lowp vec4 pattern_from
174
+ #pragma mapbox: define lowp vec4 pattern_to
175
+ #pragma mapbox: define lowp float pixel_ratio_from
176
+ #pragma mapbox: define lowp float pixel_ratio_to
177
+ void main() {
178
+ #pragma mapbox: initialize lowp float opacity
179
+ #pragma mapbox: initialize mediump vec4 pattern_from
180
+ #pragma mapbox: initialize mediump vec4 pattern_to
181
+ #pragma mapbox: initialize lowp float pixel_ratio_from
182
+ #pragma mapbox: initialize lowp float pixel_ratio_to
183
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Pi(`varying vec4 v_color;void main() {gl_FragColor=v_color;
184
+ #ifdef OVERDRAW_INSPECTOR
185
+ gl_FragColor=vec4(1.0);
186
+ #endif
187
+ }`,`uniform 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;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
188
+ #pragma mapbox: define highp float base
189
+ #pragma mapbox: define highp float height
190
+ #pragma mapbox: define highp vec4 color
191
+ void main() {
192
+ #pragma mapbox: initialize highp float base
193
+ #pragma mapbox: initialize highp float height
194
+ #pragma mapbox: initialize highp vec4 color
195
+ vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Pi(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
196
+ #pragma mapbox: define lowp float base
197
+ #pragma mapbox: define lowp float height
198
+ #pragma mapbox: define lowp vec4 pattern_from
199
+ #pragma mapbox: define lowp vec4 pattern_to
200
+ #pragma mapbox: define lowp float pixel_ratio_from
201
+ #pragma mapbox: define lowp float pixel_ratio_to
202
+ void main() {
203
+ #pragma mapbox: initialize lowp float base
204
+ #pragma mapbox: initialize lowp float height
205
+ #pragma mapbox: initialize mediump vec4 pattern_from
206
+ #pragma mapbox: initialize mediump vec4 pattern_to
207
+ #pragma mapbox: initialize lowp float pixel_ratio_from
208
+ #pragma mapbox: initialize lowp float pixel_ratio_to
209
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
210
+ #ifdef OVERDRAW_INSPECTOR
211
+ gl_FragColor=vec4(1.0);
212
+ #endif
213
+ }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
214
+ #pragma mapbox: define lowp float base
215
+ #pragma mapbox: define lowp float height
216
+ #pragma mapbox: define lowp vec4 pattern_from
217
+ #pragma mapbox: define lowp vec4 pattern_to
218
+ #pragma mapbox: define lowp float pixel_ratio_from
219
+ #pragma mapbox: define lowp float pixel_ratio_to
220
+ void main() {
221
+ #pragma mapbox: initialize lowp float base
222
+ #pragma mapbox: initialize lowp float height
223
+ #pragma mapbox: initialize mediump vec4 pattern_from
224
+ #pragma mapbox: initialize mediump vec4 pattern_to
225
+ #pragma mapbox: initialize lowp float pixel_ratio_from
226
+ #pragma mapbox: initialize lowp float pixel_ratio_to
227
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
228
+ ? a_pos
229
+ : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Pi(`#ifdef GL_ES
230
+ precision highp float;
231
+ #endif
232
+ uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);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((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
233
+ #ifdef OVERDRAW_INSPECTOR
234
+ gl_FragColor=vec4(1.0);
235
+ #endif
236
+ }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying 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:Pi(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
237
+ #define PI 3.141592653589793
238
+ void main() {vec4 pixel=texture2D(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);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
239
+ #ifdef OVERDRAW_INSPECTOR
240
+ gl_FragColor=vec4(1.0);
241
+ #endif
242
+ }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Pi(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
243
+ #pragma mapbox: define highp vec4 color
244
+ #pragma mapbox: define lowp float blur
245
+ #pragma mapbox: define lowp float opacity
246
+ void main() {
247
+ #pragma mapbox: initialize highp vec4 color
248
+ #pragma mapbox: initialize lowp float blur
249
+ #pragma mapbox: initialize lowp float opacity
250
+ 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);gl_FragColor=color*(alpha*opacity);
251
+ #ifdef OVERDRAW_INSPECTOR
252
+ gl_FragColor=vec4(1.0);
253
+ #endif
254
+ }`,`
255
+ #define scale 0.015873016
256
+ attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
257
+ #pragma mapbox: define highp vec4 color
258
+ #pragma mapbox: define lowp float blur
259
+ #pragma mapbox: define lowp float opacity
260
+ #pragma mapbox: define mediump float gapwidth
261
+ #pragma mapbox: define lowp float offset
262
+ #pragma mapbox: define mediump float width
263
+ void main() {
264
+ #pragma mapbox: initialize highp vec4 color
265
+ #pragma mapbox: initialize lowp float blur
266
+ #pragma mapbox: initialize lowp float opacity
267
+ #pragma mapbox: initialize mediump float gapwidth
268
+ #pragma mapbox: initialize lowp float offset
269
+ #pragma mapbox: initialize mediump float width
270
+ float 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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float 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;v_width2=vec2(outset,inset);}`),lineGradient:Pi(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
271
+ #pragma mapbox: define lowp float blur
272
+ #pragma mapbox: define lowp float opacity
273
+ void main() {
274
+ #pragma mapbox: initialize lowp float blur
275
+ #pragma mapbox: initialize lowp float opacity
276
+ 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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
277
+ #ifdef OVERDRAW_INSPECTOR
278
+ gl_FragColor=vec4(1.0);
279
+ #endif
280
+ }`,`
281
+ #define scale 0.015873016
282
+ attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
283
+ #pragma mapbox: define lowp float blur
284
+ #pragma mapbox: define lowp float opacity
285
+ #pragma mapbox: define mediump float gapwidth
286
+ #pragma mapbox: define lowp float offset
287
+ #pragma mapbox: define mediump float width
288
+ void main() {
289
+ #pragma mapbox: initialize lowp float blur
290
+ #pragma mapbox: initialize lowp float opacity
291
+ #pragma mapbox: initialize mediump float gapwidth
292
+ #pragma mapbox: initialize lowp float offset
293
+ #pragma mapbox: initialize mediump float width
294
+ float 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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float 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;v_width2=vec2(outset,inset);}`),linePattern:Pi(`#ifdef GL_ES
295
+ precision highp float;
296
+ #endif
297
+ uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
298
+ #pragma mapbox: define lowp vec4 pattern_from
299
+ #pragma mapbox: define lowp vec4 pattern_to
300
+ #pragma mapbox: define lowp float pixel_ratio_from
301
+ #pragma mapbox: define lowp float pixel_ratio_to
302
+ #pragma mapbox: define lowp float blur
303
+ #pragma mapbox: define lowp float opacity
304
+ void main() {
305
+ #pragma mapbox: initialize mediump vec4 pattern_from
306
+ #pragma mapbox: initialize mediump vec4 pattern_to
307
+ #pragma mapbox: initialize lowp float pixel_ratio_from
308
+ #pragma mapbox: initialize lowp float pixel_ratio_to
309
+ #pragma mapbox: initialize lowp float blur
310
+ #pragma mapbox: initialize lowp float opacity
311
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.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 x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
312
+ #ifdef OVERDRAW_INSPECTOR
313
+ gl_FragColor=vec4(1.0);
314
+ #endif
315
+ }`,`
316
+ #define scale 0.015873016
317
+ #define LINE_DISTANCE_SCALE 2.0
318
+ attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
319
+ #pragma mapbox: define lowp float blur
320
+ #pragma mapbox: define lowp float opacity
321
+ #pragma mapbox: define lowp float offset
322
+ #pragma mapbox: define mediump float gapwidth
323
+ #pragma mapbox: define mediump float width
324
+ #pragma mapbox: define lowp float floorwidth
325
+ #pragma mapbox: define lowp vec4 pattern_from
326
+ #pragma mapbox: define lowp vec4 pattern_to
327
+ #pragma mapbox: define lowp float pixel_ratio_from
328
+ #pragma mapbox: define lowp float pixel_ratio_to
329
+ void main() {
330
+ #pragma mapbox: initialize lowp float blur
331
+ #pragma mapbox: initialize lowp float opacity
332
+ #pragma mapbox: initialize lowp float offset
333
+ #pragma mapbox: initialize mediump float gapwidth
334
+ #pragma mapbox: initialize mediump float width
335
+ #pragma mapbox: initialize lowp float floorwidth
336
+ #pragma mapbox: initialize mediump vec4 pattern_from
337
+ #pragma mapbox: initialize mediump vec4 pattern_to
338
+ #pragma mapbox: initialize lowp float pixel_ratio_from
339
+ #pragma mapbox: initialize lowp float pixel_ratio_to
340
+ float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float 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;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Pi(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
341
+ #pragma mapbox: define highp vec4 color
342
+ #pragma mapbox: define lowp float blur
343
+ #pragma mapbox: define lowp float opacity
344
+ #pragma mapbox: define mediump float width
345
+ #pragma mapbox: define lowp float floorwidth
346
+ void main() {
347
+ #pragma mapbox: initialize highp vec4 color
348
+ #pragma mapbox: initialize lowp float blur
349
+ #pragma mapbox: initialize lowp float opacity
350
+ #pragma mapbox: initialize mediump float width
351
+ #pragma mapbox: initialize lowp float floorwidth
352
+ 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 sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
353
+ #ifdef OVERDRAW_INSPECTOR
354
+ gl_FragColor=vec4(1.0);
355
+ #endif
356
+ }`,`
357
+ #define scale 0.015873016
358
+ #define LINE_DISTANCE_SCALE 2.0
359
+ attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
360
+ #pragma mapbox: define highp vec4 color
361
+ #pragma mapbox: define lowp float blur
362
+ #pragma mapbox: define lowp float opacity
363
+ #pragma mapbox: define mediump float gapwidth
364
+ #pragma mapbox: define lowp float offset
365
+ #pragma mapbox: define mediump float width
366
+ #pragma mapbox: define lowp float floorwidth
367
+ void main() {
368
+ #pragma mapbox: initialize highp vec4 color
369
+ #pragma mapbox: initialize lowp float blur
370
+ #pragma mapbox: initialize lowp float opacity
371
+ #pragma mapbox: initialize mediump float gapwidth
372
+ #pragma mapbox: initialize lowp float offset
373
+ #pragma mapbox: initialize mediump float width
374
+ #pragma mapbox: initialize lowp float floorwidth
375
+ float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float 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;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Pi(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
376
+ #ifdef OVERDRAW_INSPECTOR
377
+ gl_FragColor=vec4(1.0);
378
+ #endif
379
+ }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Pi(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
380
+ #pragma mapbox: define lowp float opacity
381
+ void main() {
382
+ #pragma mapbox: initialize lowp float opacity
383
+ lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
384
+ #ifdef OVERDRAW_INSPECTOR
385
+ gl_FragColor=vec4(1.0);
386
+ #endif
387
+ }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_pitch;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;varying vec2 v_tex;varying float v_fade_opacity;
388
+ #pragma mapbox: define lowp float opacity
389
+ void main() {
390
+ #pragma mapbox: initialize lowp float opacity
391
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
392
+ camera_to_anchor_distance/u_camera_to_center_distance :
393
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),symbolSDF:Pi(`#define SDF_PX 8.0
394
+ uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
395
+ #pragma mapbox: define highp vec4 fill_color
396
+ #pragma mapbox: define highp vec4 halo_color
397
+ #pragma mapbox: define lowp float opacity
398
+ #pragma mapbox: define lowp float halo_width
399
+ #pragma mapbox: define lowp float halo_blur
400
+ void main() {
401
+ #pragma mapbox: initialize highp vec4 fill_color
402
+ #pragma mapbox: initialize highp vec4 halo_color
403
+ #pragma mapbox: initialize lowp float opacity
404
+ #pragma mapbox: initialize lowp float halo_width
405
+ #pragma mapbox: initialize lowp float halo_blur
406
+ float 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;if (u_is_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=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
407
+ #ifdef OVERDRAW_INSPECTOR
408
+ gl_FragColor=vec4(1.0);
409
+ #endif
410
+ }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_pitch;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;varying vec2 v_data0;varying vec3 v_data1;
411
+ #pragma mapbox: define highp vec4 fill_color
412
+ #pragma mapbox: define highp vec4 halo_color
413
+ #pragma mapbox: define lowp float opacity
414
+ #pragma mapbox: define lowp float halo_width
415
+ #pragma mapbox: define lowp float halo_blur
416
+ void main() {
417
+ #pragma mapbox: initialize highp vec4 fill_color
418
+ #pragma mapbox: initialize highp vec4 halo_color
419
+ #pragma mapbox: initialize lowp float opacity
420
+ #pragma mapbox: initialize lowp float halo_width
421
+ #pragma mapbox: initialize lowp float halo_blur
422
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
423
+ camera_to_anchor_distance/u_camera_to_center_distance :
424
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;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(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Pi(`#define SDF_PX 8.0
425
+ #define SDF 1.0
426
+ #define ICON 0.0
427
+ uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
428
+ #pragma mapbox: define highp vec4 fill_color
429
+ #pragma mapbox: define highp vec4 halo_color
430
+ #pragma mapbox: define lowp float opacity
431
+ #pragma mapbox: define lowp float halo_width
432
+ #pragma mapbox: define lowp float halo_blur
433
+ void main() {
434
+ #pragma mapbox: initialize highp vec4 fill_color
435
+ #pragma mapbox: initialize highp vec4 halo_color
436
+ #pragma mapbox: initialize lowp float opacity
437
+ #pragma mapbox: initialize lowp float halo_width
438
+ #pragma mapbox: initialize lowp float halo_blur
439
+ float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
440
+ #ifdef OVERDRAW_INSPECTOR
441
+ gl_FragColor=vec4(1.0);
442
+ #endif
443
+ return;}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;if (u_is_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=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
444
+ #ifdef OVERDRAW_INSPECTOR
445
+ gl_FragColor=vec4(1.0);
446
+ #endif
447
+ }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_pitch;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 vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
448
+ #pragma mapbox: define highp vec4 fill_color
449
+ #pragma mapbox: define highp vec4 halo_color
450
+ #pragma mapbox: define lowp float opacity
451
+ #pragma mapbox: define lowp float halo_width
452
+ #pragma mapbox: define lowp float halo_blur
453
+ void main() {
454
+ #pragma mapbox: initialize highp vec4 fill_color
455
+ #pragma mapbox: initialize highp vec4 halo_color
456
+ #pragma mapbox: initialize lowp float opacity
457
+ #pragma mapbox: initialize lowp float halo_width
458
+ #pragma mapbox: initialize lowp float halo_blur
459
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.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[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
460
+ camera_to_anchor_distance/u_camera_to_center_distance :
461
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;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(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`)};function Pi(f,n){let c=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,d=n.match(/attribute ([\w]+) ([\w]+)/g),g=f.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),_=n.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),I=_?_.concat(g):g,M={};return{fragmentSource:f=f.replace(c,(E,k,D,O,X)=>(M[X]=!0,k==="define"?`
462
+ #ifndef HAS_UNIFORM_u_${X}
463
+ varying ${D} ${O} ${X};
464
+ #else
465
+ uniform ${D} ${O} u_${X};
466
+ #endif
467
+ `:`
468
+ #ifdef HAS_UNIFORM_u_${X}
469
+ ${D} ${O} ${X} = u_${X};
470
+ #endif
471
+ `)),vertexSource:n=n.replace(c,(E,k,D,O,X)=>{let oe=O==="float"?"vec2":"vec4",$=X.match(/color/)?"color":oe;return M[X]?k==="define"?`
472
+ #ifndef HAS_UNIFORM_u_${X}
473
+ uniform lowp float u_${X}_t;
474
+ attribute ${D} ${oe} a_${X};
475
+ varying ${D} ${O} ${X};
476
+ #else
477
+ uniform ${D} ${O} u_${X};
478
+ #endif
479
+ `:$==="vec4"?`
480
+ #ifndef HAS_UNIFORM_u_${X}
481
+ ${X} = a_${X};
482
+ #else
483
+ ${D} ${O} ${X} = u_${X};
484
+ #endif
485
+ `:`
486
+ #ifndef HAS_UNIFORM_u_${X}
487
+ ${X} = unpack_mix_${$}(a_${X}, u_${X}_t);
488
+ #else
489
+ ${D} ${O} ${X} = u_${X};
490
+ #endif
491
+ `:k==="define"?`
492
+ #ifndef HAS_UNIFORM_u_${X}
493
+ uniform lowp float u_${X}_t;
494
+ attribute ${D} ${oe} a_${X};
495
+ #else
496
+ uniform ${D} ${O} u_${X};
497
+ #endif
498
+ `:$==="vec4"?`
499
+ #ifndef HAS_UNIFORM_u_${X}
500
+ ${D} ${O} ${X} = a_${X};
501
+ #else
502
+ ${D} ${O} ${X} = u_${X};
503
+ #endif
504
+ `:`
505
+ #ifndef HAS_UNIFORM_u_${X}
506
+ ${D} ${O} ${X} = unpack_mix_${$}(a_${X}, u_${X}_t);
507
+ #else
508
+ ${D} ${O} ${X} = u_${X};
509
+ #endif
510
+ `}),staticAttributes:d,staticUniforms:I}}class Vg{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(n,c,d,g,_,I,M,E){this.context=n;let k=this.boundPaintVertexBuffers.length!==g.length;for(let D=0;!k&&D<g.length;D++)this.boundPaintVertexBuffers[D]!==g[D]&&(k=!0);n.extVertexArrayObject&&this.vao&&this.boundProgram===c&&this.boundLayoutVertexBuffer===d&&!k&&this.boundIndexBuffer===_&&this.boundVertexOffset===I&&this.boundDynamicVertexBuffer===M&&this.boundDynamicVertexBuffer2===E?(n.bindVertexArrayOES.set(this.vao),M&&M.bind(),_&&_.dynamicDraw&&_.bind(),E&&E.bind()):this.freshBind(c,d,g,_,I,M,E)}freshBind(n,c,d,g,_,I,M){let E,k=n.numAttributes,D=this.context,O=D.gl;if(D.extVertexArrayObject)this.vao&&this.destroy(),this.vao=D.extVertexArrayObject.createVertexArrayOES(),D.bindVertexArrayOES.set(this.vao),E=0,this.boundProgram=n,this.boundLayoutVertexBuffer=c,this.boundPaintVertexBuffers=d,this.boundIndexBuffer=g,this.boundVertexOffset=_,this.boundDynamicVertexBuffer=I,this.boundDynamicVertexBuffer2=M;else{E=D.currentNumAttributes||0;for(let X=k;X<E;X++)O.disableVertexAttribArray(X)}c.enableAttributes(O,n);for(let X of d)X.enableAttributes(O,n);I&&I.enableAttributes(O,n),M&&M.enableAttributes(O,n),c.bind(),c.setVertexAttribPointers(O,n,_);for(let X of d)X.bind(),X.setVertexAttribPointers(O,n,_);I&&(I.bind(),I.setVertexAttribPointers(O,n,_)),g&&g.bind(),M&&(M.bind(),M.setVertexAttribPointers(O,n,_)),D.currentNumAttributes=k}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Uc(f){let n=[];for(let c=0;c<f.length;c++){if(f[c]===null)continue;let d=f[c].split(" ");n.push(d.pop())}return n}class Ug{constructor(n,c,d,g,_,I){let M=n.gl;this.program=M.createProgram();let E=Uc(d.staticAttributes),k=g?g.getBinderAttributes():[],D=E.concat(k),O=d.staticUniforms?Uc(d.staticUniforms):[],X=g?g.getBinderUniforms():[],oe=O.concat(X),$=[];for(let Te of oe)$.indexOf(Te)<0&&$.push(Te);let ne=g?g.defines():[];I&&ne.push("#define OVERDRAW_INSPECTOR;");let me=ne.concat(Vc.prelude.fragmentSource,d.fragmentSource).join(`
511
+ `),ge=ne.concat(Vc.prelude.vertexSource,d.vertexSource).join(`
512
+ `),we=M.createShader(M.FRAGMENT_SHADER);if(M.isContextLost())return void(this.failedToCreate=!0);M.shaderSource(we,me),M.compileShader(we),M.attachShader(this.program,we);let xe=M.createShader(M.VERTEX_SHADER);if(M.isContextLost())return void(this.failedToCreate=!0);M.shaderSource(xe,ge),M.compileShader(xe),M.attachShader(this.program,xe),this.attributes={};let Ne={};this.numAttributes=D.length;for(let Te=0;Te<this.numAttributes;Te++)D[Te]&&(M.bindAttribLocation(this.program,Te,D[Te]),this.attributes[D[Te]]=Te);M.linkProgram(this.program),M.deleteShader(xe),M.deleteShader(we);for(let Te=0;Te<$.length;Te++){let ke=$[Te];if(ke&&!Ne[ke]){let je=M.getUniformLocation(this.program,ke);je&&(Ne[ke]=je)}}this.fixedUniforms=_(n,Ne),this.binderUniforms=g?g.getUniforms(n,Ne):[]}draw(n,c,d,g,_,I,M,E,k,D,O,X,oe,$,ne,me){let ge=n.gl;if(this.failedToCreate)return;n.program.set(this.program),n.setDepthMode(d),n.setStencilMode(g),n.setColorMode(_),n.setCullFace(I);for(let xe in this.fixedUniforms)this.fixedUniforms[xe].set(M[xe]);$&&$.setUniforms(n,this.binderUniforms,X,{zoom:oe});let we={[ge.LINES]:2,[ge.TRIANGLES]:3,[ge.LINE_STRIP]:1}[c];for(let xe of O.get()){let Ne=xe.vaos||(xe.vaos={});(Ne[E]||(Ne[E]=new Vg)).bind(n,this,k,$?$.getPaintVertexBuffers():[],D,xe.vertexOffset,ne,me),ge.drawElements(c,xe.primitiveLength*we,ge.UNSIGNED_SHORT,xe.primitiveOffset*we*2)}}}function Wc(f,n,c){let d=1/Ai(c,1,n.transform.tileZoom),g=Math.pow(2,c.tileID.overscaledZ),_=c.tileSize*Math.pow(2,n.transform.tileZoom)/g,I=_*(c.tileID.canonical.x+c.tileID.wrap*g),M=_*c.tileID.canonical.y;return{u_image:0,u_texsize:c.imageAtlasTexture.size,u_scale:[d,f.fromScale,f.toScale],u_fade:f.t,u_pixel_coord_upper:[I>>16,M>>16],u_pixel_coord_lower:[65535&I,65535&M]}}let op=(f,n,c,d)=>{let g=n.style.light,_=g.properties.get("position"),I=[_.x,_.y,_.z],M=function(){var k=new o.ARRAY_TYPE(9);return o.ARRAY_TYPE!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0),k[0]=1,k[4]=1,k[8]=1,k}();g.properties.get("anchor")==="viewport"&&function(k,D){var O=Math.sin(D),X=Math.cos(D);k[0]=X,k[1]=O,k[2]=0,k[3]=-O,k[4]=X,k[5]=0,k[6]=0,k[7]=0,k[8]=1}(M,-n.transform.angle),function(k,D,O){var X=D[0],oe=D[1],$=D[2];k[0]=X*O[0]+oe*O[3]+$*O[6],k[1]=X*O[1]+oe*O[4]+$*O[7],k[2]=X*O[2]+oe*O[5]+$*O[8]}(I,I,M);let E=g.properties.get("color");return{u_matrix:f,u_lightpos:I,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[E.r,E.g,E.b],u_vertical_gradient:+c,u_opacity:d}},Zc=(f,n,c,d,g,_,I)=>o.extend(op(f,n,c,d),Wc(_,n,I),{u_height_factor:-Math.pow(2,g.overscaledZ)/I.tileSize/8}),jc=f=>({u_matrix:f}),Hc=(f,n,c,d)=>o.extend(jc(f),Wc(c,n,d)),sp=(f,n)=>({u_matrix:f,u_world:n}),ap=(f,n,c,d,g)=>o.extend(Hc(f,n,c,d),{u_world:g}),xs=(f,n,c,d)=>{let g=f.transform,_,I;if(d.paint.get("circle-pitch-alignment")==="map"){let M=Ai(c,1,g.zoom);_=!0,I=[M,M]}else _=!1,I=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(d.paint.get("circle-pitch-scale")==="map"),u_matrix:f.translatePosMatrix(n.posMatrix,c,d.paint.get("circle-translate"),d.paint.get("circle-translate-anchor")),u_pitch_with_map:+_,u_device_pixel_ratio:f.pixelRatio,u_extrude_scale:I}},Kl=(f,n,c)=>{let d=Ai(c,1,n.zoom),g=Math.pow(2,n.zoom-c.tileID.overscaledZ),_=c.tileID.overscaleFactor();return{u_matrix:f,u_camera_to_center_distance:n.cameraToCenterDistance,u_pixels_to_tile_units:d,u_extrude_scale:[n.pixelsToGLUnits[0]/(d*g),n.pixelsToGLUnits[1]/(d*g)],u_overscale_factor:_}},aa=(f,n,c=1)=>({u_matrix:f,u_color:n,u_overlay:0,u_overlay_scale:c}),tl=f=>({u_matrix:f}),eu=(f,n,c,d)=>({u_matrix:f,u_extrude_scale:Ai(n,1,c),u_intensity:d});function tu(f,n){let c=Math.pow(2,n.canonical.z),d=n.canonical.y;return[new o.MercatorCoordinate(0,d/c).toLngLat().lat,new o.MercatorCoordinate(0,(d+1)/c).toLngLat().lat]}let il=(f,n,c)=>{let d=f.transform;return{u_matrix:Xc(f,n,c),u_ratio:1/Ai(n,1,d.zoom),u_device_pixel_ratio:f.pixelRatio,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},iu=(f,n,c,d)=>o.extend(il(f,n,c),{u_image:0,u_image_height:d}),rl=(f,n,c,d)=>{let g=f.transform,_=nl(n,g);return{u_matrix:Xc(f,n,c),u_texsize:n.imageAtlasTexture.size,u_ratio:1/Ai(n,1,g.zoom),u_device_pixel_ratio:f.pixelRatio,u_image:0,u_scale:[_,d.fromScale,d.toScale],u_fade:d.t,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},vr=(f,n,c,d,g)=>{let _=f.lineAtlas,I=nl(n,f.transform),M=c.layout.get("line-cap")==="round",E=_.getDash(d.from,M),k=_.getDash(d.to,M),D=E.width*g.fromScale,O=k.width*g.toScale;return o.extend(il(f,n,c),{u_patternscale_a:[I/D,-E.height/2],u_patternscale_b:[I/O,-k.height/2],u_sdfgamma:_.width/(256*Math.min(D,O)*f.pixelRatio)/2,u_image:0,u_tex_y_a:E.y,u_tex_y_b:k.y,u_mix:g.t})};function nl(f,n){return 1/Ai(f,1,n.tileZoom)}function Xc(f,n,c){return f.translatePosMatrix(n.tileID.posMatrix,n,c.paint.get("line-translate"),c.paint.get("line-translate-anchor"))}let lp=(f,n,c,d,g)=>{return{u_matrix:f,u_tl_parent:n,u_scale_parent:c,u_buffer_scale:1,u_fade_t:d.mix,u_opacity:d.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(I=g.paint.get("raster-saturation"),I>0?1-1/(1.001-I):-I),u_contrast_factor:(_=g.paint.get("raster-contrast"),_>0?1/(1-_):1+_),u_spin_weights:up(g.paint.get("raster-hue-rotate"))};var _,I};function up(f){f*=Math.PI/180;let n=Math.sin(f),c=Math.cos(f);return[(2*c+1)/3,(-Math.sqrt(3)*n-c+1)/3,(Math.sqrt(3)*n-c+1)/3]}let ru=(f,n,c,d,g,_,I,M,E,k)=>{let D=g.transform;return{u_is_size_zoom_constant:+(f==="constant"||f==="source"),u_is_size_feature_constant:+(f==="constant"||f==="camera"),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:D.cameraToCenterDistance,u_pitch:D.pitch/360*2*Math.PI,u_rotate_symbol:+c,u_aspect_ratio:D.width/D.height,u_fade_change:g.options.fadeDuration?g.symbolFadeChange:1,u_matrix:_,u_label_plane_matrix:I,u_coord_matrix:M,u_is_text:+E,u_pitch_with_map:+d,u_texsize:k,u_texture:0}},$c=(f,n,c,d,g,_,I,M,E,k,D)=>{let O=g.transform;return o.extend(ru(f,n,c,d,g,_,I,M,E,k),{u_gamma_scale:d?Math.cos(O._pitch)*O.cameraToCenterDistance:1,u_device_pixel_ratio:g.pixelRatio,u_is_halo:+D})},Wg=(f,n,c,d,g,_,I,M,E,k)=>o.extend($c(f,n,c,d,g,_,I,M,!0,E,!0),{u_texsize_icon:k,u_texture_icon:1}),Zg=(f,n,c)=>({u_matrix:f,u_opacity:n,u_color:c}),Yc=(f,n,c,d,g,_)=>o.extend(function(I,M,E,k){let D=E.imageManager.getPattern(I.from.toString()),O=E.imageManager.getPattern(I.to.toString()),{width:X,height:oe}=E.imageManager.getPixelSize(),$=Math.pow(2,k.tileID.overscaledZ),ne=k.tileSize*Math.pow(2,E.transform.tileZoom)/$,me=ne*(k.tileID.canonical.x+k.tileID.wrap*$),ge=ne*k.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:D.tl,u_pattern_br_a:D.br,u_pattern_tl_b:O.tl,u_pattern_br_b:O.br,u_texsize:[X,oe],u_mix:M.t,u_pattern_size_a:D.displaySize,u_pattern_size_b:O.displaySize,u_scale_a:M.fromScale,u_scale_b:M.toScale,u_tile_units_to_pixels:1/Ai(k,1,E.transform.tileZoom),u_pixel_coord_upper:[me>>16,ge>>16],u_pixel_coord_lower:[65535&me,65535&ge]}}(d,_,c,g),{u_matrix:f,u_opacity:n}),qc={fillExtrusion:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_lightpos:new o.Uniform3f(f,n.u_lightpos),u_lightintensity:new o.Uniform1f(f,n.u_lightintensity),u_lightcolor:new o.Uniform3f(f,n.u_lightcolor),u_vertical_gradient:new o.Uniform1f(f,n.u_vertical_gradient),u_opacity:new o.Uniform1f(f,n.u_opacity)}),fillExtrusionPattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_lightpos:new o.Uniform3f(f,n.u_lightpos),u_lightintensity:new o.Uniform1f(f,n.u_lightintensity),u_lightcolor:new o.Uniform3f(f,n.u_lightcolor),u_vertical_gradient:new o.Uniform1f(f,n.u_vertical_gradient),u_height_factor:new o.Uniform1f(f,n.u_height_factor),u_image:new o.Uniform1i(f,n.u_image),u_texsize:new o.Uniform2f(f,n.u_texsize),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade),u_opacity:new o.Uniform1f(f,n.u_opacity)}),fill:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),fillPattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_image:new o.Uniform1i(f,n.u_image),u_texsize:new o.Uniform2f(f,n.u_texsize),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade)}),fillOutline:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_world:new o.Uniform2f(f,n.u_world)}),fillOutlinePattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_world:new o.Uniform2f(f,n.u_world),u_image:new o.Uniform1i(f,n.u_image),u_texsize:new o.Uniform2f(f,n.u_texsize),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade)}),circle:(f,n)=>({u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_scale_with_map:new o.Uniform1i(f,n.u_scale_with_map),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_extrude_scale:new o.Uniform2f(f,n.u_extrude_scale),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),collisionBox:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pixels_to_tile_units:new o.Uniform1f(f,n.u_pixels_to_tile_units),u_extrude_scale:new o.Uniform2f(f,n.u_extrude_scale),u_overscale_factor:new o.Uniform1f(f,n.u_overscale_factor)}),collisionCircle:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_inv_matrix:new o.UniformMatrix4f(f,n.u_inv_matrix),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_viewport_size:new o.Uniform2f(f,n.u_viewport_size)}),debug:(f,n)=>({u_color:new o.UniformColor(f,n.u_color),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_overlay:new o.Uniform1i(f,n.u_overlay),u_overlay_scale:new o.Uniform1f(f,n.u_overlay_scale)}),clippingMask:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),heatmap:(f,n)=>({u_extrude_scale:new o.Uniform1f(f,n.u_extrude_scale),u_intensity:new o.Uniform1f(f,n.u_intensity),u_matrix:new o.UniformMatrix4f(f,n.u_matrix)}),heatmapTexture:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_world:new o.Uniform2f(f,n.u_world),u_image:new o.Uniform1i(f,n.u_image),u_color_ramp:new o.Uniform1i(f,n.u_color_ramp),u_opacity:new o.Uniform1f(f,n.u_opacity)}),hillshade:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_image:new o.Uniform1i(f,n.u_image),u_latrange:new o.Uniform2f(f,n.u_latrange),u_light:new o.Uniform2f(f,n.u_light),u_shadow:new o.UniformColor(f,n.u_shadow),u_highlight:new o.UniformColor(f,n.u_highlight),u_accent:new o.UniformColor(f,n.u_accent)}),hillshadePrepare:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_image:new o.Uniform1i(f,n.u_image),u_dimension:new o.Uniform2f(f,n.u_dimension),u_zoom:new o.Uniform1f(f,n.u_zoom),u_unpack:new o.Uniform4f(f,n.u_unpack)}),line:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels)}),lineGradient:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels),u_image:new o.Uniform1i(f,n.u_image),u_image_height:new o.Uniform1f(f,n.u_image_height)}),linePattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_texsize:new o.Uniform2f(f,n.u_texsize),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_image:new o.Uniform1i(f,n.u_image),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels),u_scale:new o.Uniform3f(f,n.u_scale),u_fade:new o.Uniform1f(f,n.u_fade)}),lineSDF:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_ratio:new o.Uniform1f(f,n.u_ratio),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(f,n.u_units_to_pixels),u_patternscale_a:new o.Uniform2f(f,n.u_patternscale_a),u_patternscale_b:new o.Uniform2f(f,n.u_patternscale_b),u_sdfgamma:new o.Uniform1f(f,n.u_sdfgamma),u_image:new o.Uniform1i(f,n.u_image),u_tex_y_a:new o.Uniform1f(f,n.u_tex_y_a),u_tex_y_b:new o.Uniform1f(f,n.u_tex_y_b),u_mix:new o.Uniform1f(f,n.u_mix)}),raster:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_tl_parent:new o.Uniform2f(f,n.u_tl_parent),u_scale_parent:new o.Uniform1f(f,n.u_scale_parent),u_buffer_scale:new o.Uniform1f(f,n.u_buffer_scale),u_fade_t:new o.Uniform1f(f,n.u_fade_t),u_opacity:new o.Uniform1f(f,n.u_opacity),u_image0:new o.Uniform1i(f,n.u_image0),u_image1:new o.Uniform1i(f,n.u_image1),u_brightness_low:new o.Uniform1f(f,n.u_brightness_low),u_brightness_high:new o.Uniform1f(f,n.u_brightness_high),u_saturation_factor:new o.Uniform1f(f,n.u_saturation_factor),u_contrast_factor:new o.Uniform1f(f,n.u_contrast_factor),u_spin_weights:new o.Uniform3f(f,n.u_spin_weights)}),symbolIcon:(f,n)=>({u_is_size_zoom_constant:new o.Uniform1i(f,n.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(f,n.u_is_size_feature_constant),u_size_t:new o.Uniform1f(f,n.u_size_t),u_size:new o.Uniform1f(f,n.u_size),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pitch:new o.Uniform1f(f,n.u_pitch),u_rotate_symbol:new o.Uniform1i(f,n.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(f,n.u_aspect_ratio),u_fade_change:new o.Uniform1f(f,n.u_fade_change),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(f,n.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(f,n.u_coord_matrix),u_is_text:new o.Uniform1i(f,n.u_is_text),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_texsize:new o.Uniform2f(f,n.u_texsize),u_texture:new o.Uniform1i(f,n.u_texture)}),symbolSDF:(f,n)=>({u_is_size_zoom_constant:new o.Uniform1i(f,n.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(f,n.u_is_size_feature_constant),u_size_t:new o.Uniform1f(f,n.u_size_t),u_size:new o.Uniform1f(f,n.u_size),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pitch:new o.Uniform1f(f,n.u_pitch),u_rotate_symbol:new o.Uniform1i(f,n.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(f,n.u_aspect_ratio),u_fade_change:new o.Uniform1f(f,n.u_fade_change),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(f,n.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(f,n.u_coord_matrix),u_is_text:new o.Uniform1i(f,n.u_is_text),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_texsize:new o.Uniform2f(f,n.u_texsize),u_texture:new o.Uniform1i(f,n.u_texture),u_gamma_scale:new o.Uniform1f(f,n.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(f,n.u_is_halo)}),symbolTextAndIcon:(f,n)=>({u_is_size_zoom_constant:new o.Uniform1i(f,n.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(f,n.u_is_size_feature_constant),u_size_t:new o.Uniform1f(f,n.u_size_t),u_size:new o.Uniform1f(f,n.u_size),u_camera_to_center_distance:new o.Uniform1f(f,n.u_camera_to_center_distance),u_pitch:new o.Uniform1f(f,n.u_pitch),u_rotate_symbol:new o.Uniform1i(f,n.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(f,n.u_aspect_ratio),u_fade_change:new o.Uniform1f(f,n.u_fade_change),u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(f,n.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(f,n.u_coord_matrix),u_is_text:new o.Uniform1i(f,n.u_is_text),u_pitch_with_map:new o.Uniform1i(f,n.u_pitch_with_map),u_texsize:new o.Uniform2f(f,n.u_texsize),u_texsize_icon:new o.Uniform2f(f,n.u_texsize_icon),u_texture:new o.Uniform1i(f,n.u_texture),u_texture_icon:new o.Uniform1i(f,n.u_texture_icon),u_gamma_scale:new o.Uniform1f(f,n.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(f,n.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(f,n.u_is_halo)}),background:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_opacity:new o.Uniform1f(f,n.u_opacity),u_color:new o.UniformColor(f,n.u_color)}),backgroundPattern:(f,n)=>({u_matrix:new o.UniformMatrix4f(f,n.u_matrix),u_opacity:new o.Uniform1f(f,n.u_opacity),u_image:new o.Uniform1i(f,n.u_image),u_pattern_tl_a:new o.Uniform2f(f,n.u_pattern_tl_a),u_pattern_br_a:new o.Uniform2f(f,n.u_pattern_br_a),u_pattern_tl_b:new o.Uniform2f(f,n.u_pattern_tl_b),u_pattern_br_b:new o.Uniform2f(f,n.u_pattern_br_b),u_texsize:new o.Uniform2f(f,n.u_texsize),u_mix:new o.Uniform1f(f,n.u_mix),u_pattern_size_a:new o.Uniform2f(f,n.u_pattern_size_a),u_pattern_size_b:new o.Uniform2f(f,n.u_pattern_size_b),u_scale_a:new o.Uniform1f(f,n.u_scale_a),u_scale_b:new o.Uniform1f(f,n.u_scale_b),u_pixel_coord_upper:new o.Uniform2f(f,n.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(f,n.u_pixel_coord_lower),u_tile_units_to_pixels:new o.Uniform1f(f,n.u_tile_units_to_pixels)})};class Jc{constructor(n,c,d){this.context=n;let g=n.gl;this.buffer=g.createBuffer(),this.dynamicDraw=Boolean(d),this.context.unbindVAO(),n.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,c.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete c.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(n){let c=this.context.gl;this.context.unbindVAO(),this.bind(),c.bufferSubData(c.ELEMENT_ARRAY_BUFFER,0,n.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Qc={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class cp{constructor(n,c,d,g){this.length=c.length,this.attributes=d,this.itemSize=c.bytesPerElement,this.dynamicDraw=g,this.context=n;let _=n.gl;this.buffer=_.createBuffer(),n.bindVertexBuffer.set(this.buffer),_.bufferData(_.ARRAY_BUFFER,c.arrayBuffer,this.dynamicDraw?_.DYNAMIC_DRAW:_.STATIC_DRAW),this.dynamicDraw||delete c.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(n){let c=this.context.gl;this.bind(),c.bufferSubData(c.ARRAY_BUFFER,0,n.arrayBuffer)}enableAttributes(n,c){for(let d=0;d<this.attributes.length;d++){let g=c.attributes[this.attributes[d].name];g!==void 0&&n.enableVertexAttribArray(g)}}setVertexAttribPointers(n,c,d){for(let g=0;g<this.attributes.length;g++){let _=this.attributes[g],I=c.attributes[_.name];I!==void 0&&n.vertexAttribPointer(I,_.components,n[Qc[_.type]],!1,this.itemSize,_.offset+this.itemSize*(d||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class pi{constructor(n){this.gl=n.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(n){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class jg extends pi{getDefault(){return o.Color.transparent}set(n){let c=this.current;(n.r!==c.r||n.g!==c.g||n.b!==c.b||n.a!==c.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class ol extends pi{getDefault(){return 1}set(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)}}class sl extends pi{getDefault(){return 0}set(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)}}class hp extends pi{getDefault(){return[!0,!0,!0,!0]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||n[2]!==c[2]||n[3]!==c[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class Cn extends pi{getDefault(){return!0}set(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)}}class Kc extends pi{getDefault(){return 255}set(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)}}class nu extends pi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(n){let c=this.current;(n.func!==c.func||n.ref!==c.ref||n.mask!==c.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)}}class ou extends pi{getDefault(){let n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||n[2]!==c[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)}}class eh extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.STENCIL_TEST):c.disable(c.STENCIL_TEST),this.current=n,this.dirty=!1}}class th extends pi{getDefault(){return[0,1]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)}}class su extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.DEPTH_TEST):c.disable(c.DEPTH_TEST),this.current=n,this.dirty=!1}}class ih extends pi{getDefault(){return this.gl.LESS}set(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)}}class rh extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.BLEND):c.disable(c.BLEND),this.current=n,this.dirty=!1}}class au extends pi{getDefault(){let n=this.gl;return[n.ONE,n.ZERO]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)}}class dp extends pi{getDefault(){return o.Color.transparent}set(n){let c=this.current;(n.r!==c.r||n.g!==c.g||n.b!==c.b||n.a!==c.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)}}class pp extends pi{getDefault(){return this.gl.FUNC_ADD}set(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)}}class la extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;n?c.enable(c.CULL_FACE):c.disable(c.CULL_FACE),this.current=n,this.dirty=!1}}class Hg extends pi{getDefault(){return this.gl.BACK}set(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)}}class Xg extends pi{getDefault(){return this.gl.CCW}set(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)}}class $g extends pi{getDefault(){return null}set(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)}}class Yg extends pi{getDefault(){return this.gl.TEXTURE0}set(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)}}class qg extends pi{getDefault(){let n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}set(n){let c=this.current;(n[0]!==c[0]||n[1]!==c[1]||n[2]!==c[2]||n[3]!==c[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)}}class Jg extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindFramebuffer(c.FRAMEBUFFER,n),this.current=n,this.dirty=!1}}class nh extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindRenderbuffer(c.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class oh extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindTexture(c.TEXTURE_2D,n),this.current=n,this.dirty=!1}}class ua extends pi{getDefault(){return null}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.bindBuffer(c.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class fp extends pi{getDefault(){return null}set(n){let c=this.gl;c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1}}class mp extends pi{constructor(n){super(n),this.vao=n.extVertexArrayObject}getDefault(){return null}set(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)}}class sh extends pi{getDefault(){return 4}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.pixelStorei(c.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}}class _s extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}}class gp extends pi{getDefault(){return!1}set(n){if(n===this.current&&!this.dirty)return;let c=this.gl;c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}}class bs extends pi{constructor(n,c){super(n),this.context=n,this.parent=c}getDefault(){return null}}class ca extends bs{setDirty(){this.dirty=!0}set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let c=this.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}}class yp extends bs{set(n){if(n===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let c=this.gl;c.framebufferRenderbuffer(c.FRAMEBUFFER,c.DEPTH_ATTACHMENT,c.RENDERBUFFER,n),this.current=n,this.dirty=!1}}class ah{constructor(n,c,d,g){this.context=n,this.width=c,this.height=d;let _=this.framebuffer=n.gl.createFramebuffer();this.colorAttachment=new ca(n,_),g&&(this.depthAttachment=new yp(n,_))}destroy(){let n=this.context.gl,c=this.colorAttachment.get();if(c&&n.deleteTexture(c),this.depthAttachment){let d=this.depthAttachment.get();d&&n.deleteRenderbuffer(d)}n.deleteFramebuffer(this.framebuffer)}}class Lt{constructor(n,c,d){this.blendFunction=n,this.blendColor=c,this.mask=d}}Lt.Replace=[1,0],Lt.disabled=new Lt(Lt.Replace,o.Color.transparent,[!1,!1,!1,!1]),Lt.unblended=new Lt(Lt.Replace,o.Color.transparent,[!0,!0,!0,!0]),Lt.alphaBlended=new Lt([1,771],o.Color.transparent,[!0,!0,!0,!0]);class lu{constructor(n){this.gl=n,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new jg(this),this.clearDepth=new ol(this),this.clearStencil=new sl(this),this.colorMask=new hp(this),this.depthMask=new Cn(this),this.stencilMask=new Kc(this),this.stencilFunc=new nu(this),this.stencilOp=new ou(this),this.stencilTest=new eh(this),this.depthRange=new th(this),this.depthTest=new su(this),this.depthFunc=new ih(this),this.blend=new rh(this),this.blendFunc=new au(this),this.blendColor=new dp(this),this.blendEquation=new pp(this),this.cullFace=new la(this),this.cullFaceSide=new Hg(this),this.frontFace=new Xg(this),this.program=new $g(this),this.activeTexture=new Yg(this),this.viewport=new qg(this),this.bindFramebuffer=new Jg(this),this.bindRenderbuffer=new nh(this),this.bindTexture=new oh(this),this.bindVertexBuffer=new ua(this),this.bindElementBuffer=new fp(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new mp(this),this.pixelStoreUnpack=new sh(this),this.pixelStoreUnpackPremultiplyAlpha=new _s(this),this.pixelStoreUnpackFlipY=new gp(this),this.extTextureFilterAnisotropic=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=n.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=n.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(n.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=n.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=n.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)}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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(n,c){return new Jc(this,n,c)}createVertexBuffer(n,c,d){return new cp(this,n,c,d)}createRenderbuffer(n,c,d){let g=this.gl,_=g.createRenderbuffer();return this.bindRenderbuffer.set(_),g.renderbufferStorage(g.RENDERBUFFER,n,c,d),this.bindRenderbuffer.set(null),_}createFramebuffer(n,c,d){return new ah(this,n,c,d)}clear({color:n,depth:c}){let d=this.gl,g=0;n&&(g|=d.COLOR_BUFFER_BIT,this.clearColor.set(n),this.colorMask.set([!0,!0,!0,!0])),c!==void 0&&(g|=d.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(c),this.depthMask.set(!0)),d.clear(g)}setCullFace(n){n.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(n.mode),this.frontFace.set(n.frontFace))}setDepthMode(n){n.func!==this.gl.ALWAYS||n.mask?(this.depthTest.set(!0),this.depthFunc.set(n.func),this.depthMask.set(n.mask),this.depthRange.set(n.range)):this.depthTest.set(!1)}setStencilMode(n){n.test.func!==this.gl.ALWAYS||n.mask?(this.stencilTest.set(!0),this.stencilMask.set(n.mask),this.stencilOp.set([n.fail,n.depthFail,n.pass]),this.stencilFunc.set({func:n.test.func,ref:n.ref,mask:n.test.mask})):this.stencilTest.set(!1)}setColorMode(n){C(n.blendFunction,Lt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(n.blendFunction),this.blendColor.set(n.blendColor)),this.colorMask.set(n.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class bi{constructor(n,c,d){this.func=n,this.mask=c,this.range=d}}bi.ReadOnly=!1,bi.ReadWrite=!0,bi.disabled=new bi(519,bi.ReadOnly,[0,1]);let uu=7680;class Gi{constructor(n,c,d,g,_,I){this.test=n,this.ref=c,this.mask=d,this.fail=g,this.depthFail=_,this.pass=I}}Gi.disabled=new Gi({func:519,mask:0},0,0,uu,uu,uu);class or{constructor(n,c,d){this.enable=n,this.mode=c,this.frontFace=d}}let cu;function lh(f,n,c,d,g,_,I){let M=f.context,E=M.gl,k=f.useProgram("collisionBox"),D=[],O=0,X=0;for(let xe=0;xe<d.length;xe++){let Ne=d[xe],Te=n.getTile(Ne),ke=Te.getBucket(c);if(!ke)continue;let je=Ne.posMatrix;g[0]===0&&g[1]===0||(je=f.translatePosMatrix(Ne.posMatrix,Te,g,_));let Ke=I?ke.textCollisionBox:ke.iconCollisionBox,De=ke.collisionCircleArray;if(De.length>0){let mt=o.create(),rt=je;o.mul(mt,ke.placementInvProjMatrix,f.transform.glCoordMatrix),o.mul(mt,mt,ke.placementViewportMatrix),D.push({circleArray:De,circleOffset:X,transform:rt,invTransform:mt}),O+=De.length/4,X=O}Ke&&k.draw(M,E.LINES,bi.disabled,Gi.disabled,f.colorModeForRenderPass(),or.disabled,Kl(je,f.transform,Te),c.id,Ke.layoutVertexBuffer,Ke.indexBuffer,Ke.segments,null,f.transform.zoom,null,null,Ke.collisionVertexBuffer)}if(!I||!D.length)return;let oe=f.useProgram("collisionCircle"),$=new o.CollisionCircleLayoutArray;$.resize(4*O),$._trim();let ne=0;for(let xe of D)for(let Ne=0;Ne<xe.circleArray.length/4;Ne++){let Te=4*Ne,ke=xe.circleArray[Te+0],je=xe.circleArray[Te+1],Ke=xe.circleArray[Te+2],De=xe.circleArray[Te+3];$.emplace(ne++,ke,je,Ke,De,0),$.emplace(ne++,ke,je,Ke,De,1),$.emplace(ne++,ke,je,Ke,De,2),$.emplace(ne++,ke,je,Ke,De,3)}(!cu||cu.length<2*O)&&(cu=function(xe){let Ne=2*xe,Te=new o.QuadTriangleArray;Te.resize(Ne),Te._trim();for(let ke=0;ke<Ne;ke++){let je=6*ke;Te.uint16[je+0]=4*ke+0,Te.uint16[je+1]=4*ke+1,Te.uint16[je+2]=4*ke+2,Te.uint16[je+3]=4*ke+2,Te.uint16[je+4]=4*ke+3,Te.uint16[je+5]=4*ke+0}return Te}(O));let me=M.createIndexBuffer(cu,!0),ge=M.createVertexBuffer($,o.collisionCircleLayout.members,!0);for(let xe of D){let Ne={u_matrix:xe.transform,u_inv_matrix:xe.invTransform,u_camera_to_center_distance:(we=f.transform).cameraToCenterDistance,u_viewport_size:[we.width,we.height]};oe.draw(M,E.TRIANGLES,bi.disabled,Gi.disabled,f.colorModeForRenderPass(),or.disabled,Ne,c.id,ge,me,o.SegmentVector.simpleSegment(0,2*xe.circleOffset,xe.circleArray.length,xe.circleArray.length/2),null,f.transform.zoom,null,null,null)}var we;ge.destroy(),me.destroy()}or.disabled=new or(!1,1029,2305),or.backCCW=new or(!0,1029,2305);let Qg=o.identity(new Float32Array(16));function uh(f,n,c,d,g,_){let{horizontalAlign:I,verticalAlign:M}=o.getAnchorAlignment(f),E=-(I-.5)*n,k=-(M-.5)*c,D=o.evaluateVariableOffset(f,d);return new o.pointGeometry((E/g+D[0])*_,(k/g+D[1])*_)}function hu(f,n,c,d,g,_,I,M,E,k){let D=f.text.placedSymbolArray,O=f.text.dynamicLayoutVertexArray,X=f.icon.dynamicLayoutVertexArray,oe={};O.clear();for(let $=0;$<D.length;$++){let ne=D.get($),me=f.allowVerticalPlacement&&!ne.placedOrientation,ge=ne.hidden||!ne.crossTileID||me?null:d[ne.crossTileID];if(ge){let we=new o.pointGeometry(ne.anchorX,ne.anchorY),xe=Tt(we,c?I:_),Ne=Ue(g.cameraToCenterDistance,xe.signedDistanceFromCamera),Te=o.evaluateSizeForFeature(f.textSizeData,E,ne)*Ne/o.ONE_EM;c&&(Te*=f.tilePixelRatio/M);let{width:ke,height:je,anchor:Ke,textOffset:De,textBoxScale:mt}=ge,rt=uh(Ke,ke,je,De,mt,Te),Pt=c?Tt(we.add(rt),_).point:xe.point.add(n?rt.rotate(-g.angle):rt),Qt=f.allowVerticalPlacement&&ne.placedOrientation===o.WritingMode.vertical?Math.PI/2:0;for(let Wt=0;Wt<ne.numGlyphs;Wt++)o.addDynamicAttributes(O,Pt,Qt);k&&ne.associatedIconIndex>=0&&(oe[ne.associatedIconIndex]={shiftedAnchor:Pt,angle:Qt})}else hi(ne.numGlyphs,O)}if(k){X.clear();let $=f.icon.placedSymbolArray;for(let ne=0;ne<$.length;ne++){let me=$.get(ne);if(me.hidden)hi(me.numGlyphs,X);else{let ge=oe[ne];if(ge)for(let we=0;we<me.numGlyphs;we++)o.addDynamicAttributes(X,ge.shiftedAnchor,ge.angle);else hi(me.numGlyphs,X)}}f.icon.dynamicLayoutVertexBuffer.updateData(X)}f.text.dynamicLayoutVertexBuffer.updateData(O)}function du(f,n,c){return c.iconsInText&&n?"symbolTextAndIcon":f?"symbolSDF":"symbolIcon"}function pu(f,n,c,d,g,_,I,M,E,k,D,O){let X=f.context,oe=X.gl,$=f.transform,ne=M==="map",me=E==="map",ge=M!=="viewport"&&c.layout.get("symbol-placement")!=="point",we=ne&&!me&&!ge,xe=!c.layout.get("symbol-sort-key").isConstant(),Ne=!1,Te=f.depthModeForSublayer(0,bi.ReadOnly),ke=c.layout.get("text-variable-anchor"),je=[];for(let Ke of d){let De=n.getTile(Ke),mt=De.getBucket(c);if(!mt)continue;let rt=g?mt.text:mt.icon;if(!rt||!rt.segments.get().length)continue;let Pt=rt.programConfigurations.get(c.id),Qt=g||mt.sdfIcons,Wt=g?mt.textSizeData:mt.iconSizeData,qt=me||$.pitch!==0,Qi=f.useProgram(du(Qt,g,mt),Pt),zt=o.evaluateSizeForZoom(Wt,$.zoom),ai,Si,Fr,En,jn=[0,0],Hn=null;if(g){if(Si=De.glyphAtlasTexture,Fr=oe.LINEAR,ai=De.glyphAtlasTexture.size,mt.iconsInText){jn=De.imageAtlasTexture.size,Hn=De.imageAtlasTexture;let bo=Wt.kind==="composite"||Wt.kind==="camera";En=qt||f.options.rotating||f.options.zooming||bo?oe.LINEAR:oe.NEAREST}}else{let bo=c.layout.get("icon-size").constantOr(0)!==1||mt.iconsNeedLinear;Si=De.imageAtlasTexture,Fr=Qt||f.options.rotating||f.options.zooming||bo||qt?oe.LINEAR:oe.NEAREST,ai=De.imageAtlasTexture.size}let es=Ai(De,1,f.transform.zoom),mn=ut(Ke.posMatrix,me,ne,f.transform,es),_o=Ht(Ke.posMatrix,me,ne,f.transform,es),Es=ke&&mt.hasTextData(),An=c.layout.get("icon-text-fit")!=="none"&&Es&&mt.hasIconData();if(ge){let bo=c.layout.get("text-rotation-alignment")==="map";yt(mt,Ke.posMatrix,f,g,mn,_o,me,k,bo)}let li=f.translatePosMatrix(Ke.posMatrix,De,_,I),yi=ge||g&&ke||An?Qg:mn,xr=f.translatePosMatrix(_o,De,_,I,!0),nn=Qt&&c.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Ui;Ui=Qt?mt.iconsInText?Wg(Wt.kind,zt,we,me,f,li,yi,xr,ai,jn):$c(Wt.kind,zt,we,me,f,li,yi,xr,g,ai,!0):ru(Wt.kind,zt,we,me,f,li,yi,xr,g,ai);let As={program:Qi,buffers:rt,uniformValues:Ui,atlasTexture:Si,atlasTextureIcon:Hn,atlasInterpolation:Fr,atlasInterpolationIcon:En,isSDF:Qt,hasHalo:nn};if(xe&&mt.canOverlap){Ne=!0;let bo=rt.segments.get();for(let Mu of bo)je.push({segments:new o.SegmentVector([Mu]),sortKey:Mu.sortKey,state:As})}else je.push({segments:rt.segments,sortKey:0,state:As})}Ne&&je.sort((Ke,De)=>Ke.sortKey-De.sortKey);for(let Ke of je){let De=Ke.state;if(X.activeTexture.set(oe.TEXTURE0),De.atlasTexture.bind(De.atlasInterpolation,oe.CLAMP_TO_EDGE),De.atlasTextureIcon&&(X.activeTexture.set(oe.TEXTURE1),De.atlasTextureIcon&&De.atlasTextureIcon.bind(De.atlasInterpolationIcon,oe.CLAMP_TO_EDGE)),De.isSDF){let mt=De.uniformValues;De.hasHalo&&(mt.u_is_halo=1,fu(De.buffers,Ke.segments,c,f,De.program,Te,D,O,mt)),mt.u_is_halo=0}fu(De.buffers,Ke.segments,c,f,De.program,Te,D,O,De.uniformValues)}}function fu(f,n,c,d,g,_,I,M,E){let k=d.context;g.draw(k,k.gl.TRIANGLES,_,I,M,or.disabled,E,c.id,f.layoutVertexBuffer,f.indexBuffer,n,c.paint,d.transform.zoom,f.programConfigurations.get(c.id),f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer)}function ch(f,n,c,d,g,_,I){let M=f.context.gl,E=c.paint.get("fill-pattern"),k=E&&E.constantOr(1),D=c.getCrossfadeParameters(),O,X,oe,$,ne;I?(X=k&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",O=M.LINES):(X=k?"fillPattern":"fill",O=M.TRIANGLES);for(let me of d){let ge=n.getTile(me);if(k&&!ge.patternsLoaded())continue;let we=ge.getBucket(c);if(!we)continue;let xe=we.programConfigurations.get(c.id),Ne=f.useProgram(X,xe);k&&(f.context.activeTexture.set(M.TEXTURE0),ge.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),xe.updatePaintBuffers(D));let Te=E.constantOr(null);if(Te&&ge.imageAtlas){let je=ge.imageAtlas,Ke=je.patternPositions[Te.to.toString()],De=je.patternPositions[Te.from.toString()];Ke&&De&&xe.setConstantPatternPositions(Ke,De)}let ke=f.translatePosMatrix(me.posMatrix,ge,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor"));if(I){$=we.indexBuffer2,ne=we.segments2;let je=[M.drawingBufferWidth,M.drawingBufferHeight];oe=X==="fillOutlinePattern"&&k?ap(ke,f,D,ge,je):sp(ke,je)}else $=we.indexBuffer,ne=we.segments,oe=k?Hc(ke,f,D,ge):jc(ke);Ne.draw(f.context,O,g,f.stencilModeForClipping(me),_,or.disabled,oe,c.id,we.layoutVertexBuffer,$,ne,c.paint,f.transform.zoom,xe)}}function ha(f,n,c,d,g,_,I){let M=f.context,E=M.gl,k=c.paint.get("fill-extrusion-pattern"),D=k.constantOr(1),O=c.getCrossfadeParameters(),X=c.paint.get("fill-extrusion-opacity");for(let oe of d){let $=n.getTile(oe),ne=$.getBucket(c);if(!ne)continue;let me=ne.programConfigurations.get(c.id),ge=f.useProgram(D?"fillExtrusionPattern":"fillExtrusion",me);D&&(f.context.activeTexture.set(E.TEXTURE0),$.imageAtlasTexture.bind(E.LINEAR,E.CLAMP_TO_EDGE),me.updatePaintBuffers(O));let we=k.constantOr(null);if(we&&$.imageAtlas){let ke=$.imageAtlas,je=ke.patternPositions[we.to.toString()],Ke=ke.patternPositions[we.from.toString()];je&&Ke&&me.setConstantPatternPositions(je,Ke)}let xe=f.translatePosMatrix(oe.posMatrix,$,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Ne=c.paint.get("fill-extrusion-vertical-gradient"),Te=D?Zc(xe,f,Ne,X,oe,O,$):op(xe,f,Ne,X);ge.draw(M,M.gl.TRIANGLES,g,_,I,or.backCCW,Te,c.id,ne.layoutVertexBuffer,ne.indexBuffer,ne.segments,c.paint,f.transform.zoom,me)}}function mu(f,n,c,d,g,_){let I=f.context,M=I.gl,E=n.fbo;if(!E)return;let k=f.useProgram("hillshade");I.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,E.colorAttachment.get());let D=((O,X,oe)=>{let $=oe.paint.get("hillshade-shadow-color"),ne=oe.paint.get("hillshade-highlight-color"),me=oe.paint.get("hillshade-accent-color"),ge=oe.paint.get("hillshade-illumination-direction")*(Math.PI/180);oe.paint.get("hillshade-illumination-anchor")==="viewport"&&(ge-=O.transform.angle);let we=!O.options.moving;return{u_matrix:O.transform.calculatePosMatrix(X.tileID.toUnwrapped(),we),u_image:0,u_latrange:tu(0,X.tileID),u_light:[oe.paint.get("hillshade-exaggeration"),ge],u_shadow:$,u_highlight:ne,u_accent:me}})(f,n,c);k.draw(I,M.TRIANGLES,d,g,_,or.disabled,D,c.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments)}function oo(f,n,c,d,g,_){let I=f.context,M=I.gl,E=n.dem;if(E&&E.data){let k=E.dim,D=E.stride,O=E.getPixels();if(I.activeTexture.set(M.TEXTURE1),I.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||f.getTileTexture(D),n.demTexture){let oe=n.demTexture;oe.update(O,{premultiply:!1}),oe.bind(M.NEAREST,M.CLAMP_TO_EDGE)}else n.demTexture=new H(I,O,M.RGBA,{premultiply:!1}),n.demTexture.bind(M.NEAREST,M.CLAMP_TO_EDGE);I.activeTexture.set(M.TEXTURE0);let X=n.fbo;if(!X){let oe=new H(I,{width:k,height:k,data:null},M.RGBA);oe.bind(M.LINEAR,M.CLAMP_TO_EDGE),X=n.fbo=I.createFramebuffer(k,k,!0),X.colorAttachment.set(oe.texture)}I.bindFramebuffer.set(X.framebuffer),I.viewport.set([0,0,k,k]),f.useProgram("hillshadePrepare").draw(I,M.TRIANGLES,d,g,_,or.disabled,((oe,$)=>{let ne=$.stride,me=o.create();return o.ortho(me,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate(me,me,[0,-o.EXTENT,0]),{u_matrix:me,u_image:1,u_dimension:[ne,ne],u_zoom:oe.overscaledZ,u_unpack:$.getUnpackVector()}})(n.tileID,E),c.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function vp(f,n,c,d,g){let _=d.paint.get("raster-fade-duration");if(_>0){let I=o.exported.now(),M=(I-f.timeAdded)/_,E=n?(I-n.timeAdded)/_:-1,k=c.getSource(),D=g.coveringZoomLevel({tileSize:k.tileSize,roundZoom:k.roundZoom}),O=!n||Math.abs(n.tileID.overscaledZ-D)>Math.abs(f.tileID.overscaledZ-D),X=O&&f.refreshedUponExpiration?1:o.clamp(O?M:1-E,0,1);return f.refreshedUponExpiration&&M>=1&&(f.refreshedUponExpiration=!1),n?{opacity:1,mix:1-X}:{opacity:X,mix:0}}return{opacity:1,mix:0}}let xp=new o.Color(1,0,0,1),_p=new o.Color(0,1,0,1),da=new o.Color(0,0,1,1),gu=new o.Color(1,0,1,1),hh=new o.Color(0,1,1,1);function bp(f,n,c,d){vu(f,0,n+c/2,f.transform.width,c,d)}function yu(f,n,c,d){vu(f,n-c/2,0,c,f.transform.height,d)}function vu(f,n,c,d,g,_){let I=f.context,M=I.gl;M.enable(M.SCISSOR_TEST),M.scissor(n*f.pixelRatio,c*f.pixelRatio,d*f.pixelRatio,g*f.pixelRatio),I.clear({color:_}),M.disable(M.SCISSOR_TEST)}function wp(f,n,c){let d=f.context,g=d.gl,_=c.posMatrix,I=f.useProgram("debug"),M=bi.disabled,E=Gi.disabled,k=f.colorModeForRenderPass(),D="$debug";d.activeTexture.set(g.TEXTURE0),f.emptyTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),I.draw(d,g.LINE_STRIP,M,E,k,or.disabled,aa(_,o.Color.red),D,f.debugBuffer,f.tileBorderIndexBuffer,f.debugSegments);let O=n.getTileByID(c.key).latestRawTileData,X=Math.floor((O&&O.byteLength||0)/1024),oe=n.getTile(c).tileSize,$=512/Math.min(oe,512)*(c.overscaledZ/f.transform.zoom)*.5,ne=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(ne+=` => ${c.overscaledZ}`),function(me,ge){me.initDebugOverlayCanvas();let we=me.debugOverlayCanvas,xe=me.context.gl,Ne=me.debugOverlayCanvas.getContext("2d");Ne.clearRect(0,0,we.width,we.height),Ne.shadowColor="white",Ne.shadowBlur=2,Ne.lineWidth=1.5,Ne.strokeStyle="white",Ne.textBaseline="top",Ne.font="bold 36px Open Sans, sans-serif",Ne.fillText(ge,5,5),Ne.strokeText(ge,5,5),me.debugOverlayTexture.update(we),me.debugOverlayTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE)}(f,`${ne} ${X}kb`),I.draw(d,g.TRIANGLES,M,E,Lt.alphaBlended,or.disabled,aa(_,o.Color.transparent,$),D,f.debugBuffer,f.quadTriangleIndexBuffer,f.debugSegments)}let al={symbol:function(f,n,c,d,g){if(f.renderPass!=="translucent")return;let _=Gi.disabled,I=f.colorModeForRenderPass();c.layout.get("text-variable-anchor")&&function(M,E,k,D,O,X,oe){let $=E.transform,ne=O==="map",me=X==="map";for(let ge of M){let we=D.getTile(ge),xe=we.getBucket(k);if(!xe||!xe.text||!xe.text.segments.get().length)continue;let Ne=o.evaluateSizeForZoom(xe.textSizeData,$.zoom),Te=Ai(we,1,E.transform.zoom),ke=ut(ge.posMatrix,me,ne,E.transform,Te),je=k.layout.get("icon-text-fit")!=="none"&&xe.hasIconData();if(Ne){let Ke=Math.pow(2,$.zoom-we.tileID.overscaledZ);hu(xe,ne,me,oe,$,ke,ge.posMatrix,Ke,Ne,je)}}}(d,f,c,n,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),g),c.paint.get("icon-opacity").constantOr(1)!==0&&pu(f,n,c,d,!1,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),c.layout.get("icon-rotation-alignment"),c.layout.get("icon-pitch-alignment"),c.layout.get("icon-keep-upright"),_,I),c.paint.get("text-opacity").constantOr(1)!==0&&pu(f,n,c,d,!0,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),c.layout.get("text-keep-upright"),_,I),n.map.showCollisionBoxes&&(lh(f,n,c,d,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),lh(f,n,c,d,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(f,n,c,d){if(f.renderPass!=="translucent")return;let g=c.paint.get("circle-opacity"),_=c.paint.get("circle-stroke-width"),I=c.paint.get("circle-stroke-opacity"),M=!c.layout.get("circle-sort-key").isConstant();if(g.constantOr(1)===0&&(_.constantOr(1)===0||I.constantOr(1)===0))return;let E=f.context,k=E.gl,D=f.depthModeForSublayer(0,bi.ReadOnly),O=Gi.disabled,X=f.colorModeForRenderPass(),oe=[];for(let $=0;$<d.length;$++){let ne=d[$],me=n.getTile(ne),ge=me.getBucket(c);if(!ge)continue;let we=ge.programConfigurations.get(c.id),xe={programConfiguration:we,program:f.useProgram("circle",we),layoutVertexBuffer:ge.layoutVertexBuffer,indexBuffer:ge.indexBuffer,uniformValues:xs(f,ne,me,c)};if(M){let Ne=ge.segments.get();for(let Te of Ne)oe.push({segments:new o.SegmentVector([Te]),sortKey:Te.sortKey,state:xe})}else oe.push({segments:ge.segments,sortKey:0,state:xe})}M&&oe.sort(($,ne)=>$.sortKey-ne.sortKey);for(let $ of oe){let{programConfiguration:ne,program:me,layoutVertexBuffer:ge,indexBuffer:we,uniformValues:xe}=$.state;me.draw(E,k.TRIANGLES,D,O,X,or.disabled,xe,c.id,ge,we,$.segments,c.paint,f.transform.zoom,ne)}},heatmap:function(f,n,c,d){if(c.paint.get("heatmap-opacity")!==0)if(f.renderPass==="offscreen"){let g=f.context,_=g.gl,I=Gi.disabled,M=new Lt([_.ONE,_.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(E,k,D){let O=E.gl;E.activeTexture.set(O.TEXTURE1),E.viewport.set([0,0,k.width/4,k.height/4]);let X=D.heatmapFbo;if(X)O.bindTexture(O.TEXTURE_2D,X.colorAttachment.get()),E.bindFramebuffer.set(X.framebuffer);else{let oe=O.createTexture();O.bindTexture(O.TEXTURE_2D,oe),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),X=D.heatmapFbo=E.createFramebuffer(k.width/4,k.height/4,!1),function($,ne,me,ge){let we=$.gl;we.texImage2D(we.TEXTURE_2D,0,we.RGBA,ne.width/4,ne.height/4,0,we.RGBA,$.extRenderToTextureHalfFloat?$.extTextureHalfFloat.HALF_FLOAT_OES:we.UNSIGNED_BYTE,null),ge.colorAttachment.set(me)}(E,k,oe,X)}})(g,f,c),g.clear({color:o.Color.transparent});for(let E=0;E<d.length;E++){let k=d[E];if(n.hasRenderableParent(k))continue;let D=n.getTile(k),O=D.getBucket(c);if(!O)continue;let X=O.programConfigurations.get(c.id),oe=f.useProgram("heatmap",X),{zoom:$}=f.transform;oe.draw(g,_.TRIANGLES,bi.disabled,I,M,or.disabled,eu(k.posMatrix,D,$,c.paint.get("heatmap-intensity")),c.id,O.layoutVertexBuffer,O.indexBuffer,O.segments,c.paint,f.transform.zoom,X)}g.viewport.set([0,0,f.width,f.height])}else f.renderPass==="translucent"&&(f.context.setColorMode(f.colorModeForRenderPass()),function(g,_){let I=g.context,M=I.gl,E=_.heatmapFbo;if(!E)return;I.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,E.colorAttachment.get()),I.activeTexture.set(M.TEXTURE1);let k=_.colorRampTexture;k||(k=_.colorRampTexture=new H(I,_.colorRamp,M.RGBA)),k.bind(M.LINEAR,M.CLAMP_TO_EDGE),g.useProgram("heatmapTexture").draw(I,M.TRIANGLES,bi.disabled,Gi.disabled,g.colorModeForRenderPass(),or.disabled,((D,O,X,oe)=>{let $=o.create();o.ortho($,0,D.width,D.height,0,0,1);let ne=D.context.gl;return{u_matrix:$,u_world:[ne.drawingBufferWidth,ne.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:O.paint.get("heatmap-opacity")}})(g,_),_.id,g.viewportBuffer,g.quadTriangleIndexBuffer,g.viewportSegments,_.paint,g.transform.zoom)}(f,c))},line:function(f,n,c,d){if(f.renderPass!=="translucent")return;let g=c.paint.get("line-opacity"),_=c.paint.get("line-width");if(g.constantOr(1)===0||_.constantOr(1)===0)return;let I=f.depthModeForSublayer(0,bi.ReadOnly),M=f.colorModeForRenderPass(),E=c.paint.get("line-dasharray"),k=c.paint.get("line-pattern"),D=k.constantOr(1),O=c.paint.get("line-gradient"),X=c.getCrossfadeParameters(),oe=D?"linePattern":E?"lineSDF":O?"lineGradient":"line",$=f.context,ne=$.gl,me=!0;for(let ge of d){let we=n.getTile(ge);if(D&&!we.patternsLoaded())continue;let xe=we.getBucket(c);if(!xe)continue;let Ne=xe.programConfigurations.get(c.id),Te=f.context.program.get(),ke=f.useProgram(oe,Ne),je=me||ke.program!==Te,Ke=k.constantOr(null);if(Ke&&we.imageAtlas){let mt=we.imageAtlas,rt=mt.patternPositions[Ke.to.toString()],Pt=mt.patternPositions[Ke.from.toString()];rt&&Pt&&Ne.setConstantPatternPositions(rt,Pt)}let De=D?rl(f,we,c,X):E?vr(f,we,c,E,X):O?iu(f,we,c,xe.lineClipsArray.length):il(f,we,c);if(D)$.activeTexture.set(ne.TEXTURE0),we.imageAtlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),Ne.updatePaintBuffers(X);else if(E&&(je||f.lineAtlas.dirty))$.activeTexture.set(ne.TEXTURE0),f.lineAtlas.bind($);else if(O){let mt=xe.gradients[c.id],rt=mt.texture;if(c.gradientVersion!==mt.version){let Pt=256;if(c.stepInterpolant){let Qt=n.getSource().maxzoom,Wt=ge.canonical.z===Qt?Math.ceil(1<<f.transform.maxZoom-ge.canonical.z):1;Pt=o.clamp(o.nextPowerOfTwo(xe.maxLineLength/o.EXTENT*1024*Wt),256,$.maxTextureSize)}mt.gradient=o.renderColorRamp({expression:c.gradientExpression(),evaluationKey:"lineProgress",resolution:Pt,image:mt.gradient||void 0,clips:xe.lineClipsArray}),mt.texture?mt.texture.update(mt.gradient):mt.texture=new H($,mt.gradient,ne.RGBA),mt.version=c.gradientVersion,rt=mt.texture}$.activeTexture.set(ne.TEXTURE0),rt.bind(c.stepInterpolant?ne.NEAREST:ne.LINEAR,ne.CLAMP_TO_EDGE)}ke.draw($,ne.TRIANGLES,I,f.stencilModeForClipping(ge),M,or.disabled,De,c.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,c.paint,f.transform.zoom,Ne,xe.layoutVertexBuffer2),me=!1}},fill:function(f,n,c,d){let g=c.paint.get("fill-color"),_=c.paint.get("fill-opacity");if(_.constantOr(1)===0)return;let I=f.colorModeForRenderPass(),M=c.paint.get("fill-pattern"),E=f.opaquePassEnabledForLayer()&&!M.constantOr(1)&&g.constantOr(o.Color.transparent).a===1&&_.constantOr(0)===1?"opaque":"translucent";if(f.renderPass===E){let k=f.depthModeForSublayer(1,f.renderPass==="opaque"?bi.ReadWrite:bi.ReadOnly);ch(f,n,c,d,k,I,!1)}if(f.renderPass==="translucent"&&c.paint.get("fill-antialias")){let k=f.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,bi.ReadOnly);ch(f,n,c,d,k,I,!0)}},"fill-extrusion":function(f,n,c,d){let g=c.paint.get("fill-extrusion-opacity");if(g!==0&&f.renderPass==="translucent"){let _=new bi(f.context.gl.LEQUAL,bi.ReadWrite,f.depthRangeFor3D);if(g!==1||c.paint.get("fill-extrusion-pattern").constantOr(1))ha(f,n,c,d,_,Gi.disabled,Lt.disabled),ha(f,n,c,d,_,f.stencilModeFor3D(),f.colorModeForRenderPass());else{let I=f.colorModeForRenderPass();ha(f,n,c,d,_,Gi.disabled,I)}}},hillshade:function(f,n,c,d){if(f.renderPass!=="offscreen"&&f.renderPass!=="translucent")return;let g=f.context,_=f.depthModeForSublayer(0,bi.ReadOnly),I=f.colorModeForRenderPass(),[M,E]=f.renderPass==="translucent"?f.stencilConfigForOverlap(d):[{},d];for(let k of E){let D=n.getTile(k);D.needsHillshadePrepare&&f.renderPass==="offscreen"?oo(f,D,c,_,Gi.disabled,I):f.renderPass==="translucent"&&mu(f,D,c,_,M[k.overscaledZ],I)}g.viewport.set([0,0,f.width,f.height])},raster:function(f,n,c,d){if(f.renderPass!=="translucent"||c.paint.get("raster-opacity")===0||!d.length)return;let g=f.context,_=g.gl,I=n.getSource(),M=f.useProgram("raster"),E=f.colorModeForRenderPass(),[k,D]=I instanceof si?[{},d]:f.stencilConfigForOverlap(d),O=D[D.length-1].overscaledZ,X=!f.options.moving;for(let oe of D){let $=f.depthModeForSublayer(oe.overscaledZ-O,c.paint.get("raster-opacity")===1?bi.ReadWrite:bi.ReadOnly,_.LESS),ne=n.getTile(oe),me=f.transform.calculatePosMatrix(oe.toUnwrapped(),X);ne.registerFadeDuration(c.paint.get("raster-fade-duration"));let ge=n.findLoadedParent(oe,0),we=vp(ne,ge,n,c,f.transform),xe,Ne,Te=c.paint.get("raster-resampling")==="nearest"?_.NEAREST:_.LINEAR;g.activeTexture.set(_.TEXTURE0),ne.texture.bind(Te,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST),g.activeTexture.set(_.TEXTURE1),ge?(ge.texture.bind(Te,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST),xe=Math.pow(2,ge.tileID.overscaledZ-ne.tileID.overscaledZ),Ne=[ne.tileID.canonical.x*xe%1,ne.tileID.canonical.y*xe%1]):ne.texture.bind(Te,_.CLAMP_TO_EDGE,_.LINEAR_MIPMAP_NEAREST);let ke=lp(me,Ne||[0,0],xe||1,we,c);I instanceof si?M.draw(g,_.TRIANGLES,$,Gi.disabled,E,or.disabled,ke,c.id,I.boundsBuffer,f.quadTriangleIndexBuffer,I.boundsSegments):M.draw(g,_.TRIANGLES,$,k[oe.overscaledZ],E,or.disabled,ke,c.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments)}},background:function(f,n,c){let d=c.paint.get("background-color"),g=c.paint.get("background-opacity");if(g===0)return;let _=f.context,I=_.gl,M=f.transform,E=M.tileSize,k=c.paint.get("background-pattern");if(f.isPatternMissing(k))return;let D=!k&&d.a===1&&g===1&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==D)return;let O=Gi.disabled,X=f.depthModeForSublayer(0,D==="opaque"?bi.ReadWrite:bi.ReadOnly),oe=f.colorModeForRenderPass(),$=f.useProgram(k?"backgroundPattern":"background"),ne=M.coveringTiles({tileSize:E});k&&(_.activeTexture.set(I.TEXTURE0),f.imageManager.bind(f.context));let me=c.getCrossfadeParameters();for(let ge of ne){let we=f.transform.calculatePosMatrix(ge.toUnwrapped()),xe=k?Yc(we,g,f,k,{tileID:ge,tileSize:E},me):Zg(we,g,d);$.draw(_,I.TRIANGLES,X,O,oe,or.disabled,xe,c.id,f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}},debug:function(f,n,c){for(let d=0;d<c.length;d++)wp(f,n,c[d])},custom:function(f,n,c){let d=f.context,g=c.implementation;if(f.renderPass==="offscreen"){let _=g.prerender;_&&(f.setCustomLayerDefaults(),d.setColorMode(f.colorModeForRenderPass()),_.call(g,d.gl,f.transform.customLayerMatrix()),d.setDirty(),f.setBaseState())}else if(f.renderPass==="translucent"){f.setCustomLayerDefaults(),d.setColorMode(f.colorModeForRenderPass()),d.setStencilMode(Gi.disabled);let _=g.renderingMode==="3d"?new bi(f.context.gl.LEQUAL,bi.ReadWrite,f.depthRangeFor3D):f.depthModeForSublayer(0,bi.ReadOnly);d.setDepthMode(_),g.render(d.gl,f.transform.customLayerMatrix()),d.setDirty(),f.setBaseState(),d.bindFramebuffer.set(null)}}};class dh{constructor(n,c){this.context=new lu(n),this.transform=c,this._tileTextures={},this.setup(),this.numSublayers=ii.maxUnderzooming+ii.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Bt,this.gpuTimers={}}resize(n,c,d){if(this.width=n*d,this.height=c*d,this.pixelRatio=d,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let g of this.style._order)this.style._layers[g].resize()}setup(){let n=this.context,c=new o.PosArray;c.emplaceBack(0,0),c.emplaceBack(o.EXTENT,0),c.emplaceBack(0,o.EXTENT),c.emplaceBack(o.EXTENT,o.EXTENT),this.tileExtentBuffer=n.createVertexBuffer(c,Gc.members),this.tileExtentSegments=o.SegmentVector.simpleSegment(0,0,4,2);let d=new o.PosArray;d.emplaceBack(0,0),d.emplaceBack(o.EXTENT,0),d.emplaceBack(0,o.EXTENT),d.emplaceBack(o.EXTENT,o.EXTENT),this.debugBuffer=n.createVertexBuffer(d,Gc.members),this.debugSegments=o.SegmentVector.simpleSegment(0,0,4,5);let g=new o.RasterBoundsArray;g.emplaceBack(0,0,0,0),g.emplaceBack(o.EXTENT,0,o.EXTENT,0),g.emplaceBack(0,o.EXTENT,0,o.EXTENT),g.emplaceBack(o.EXTENT,o.EXTENT,o.EXTENT,o.EXTENT),this.rasterBoundsBuffer=n.createVertexBuffer(g,Xi.members),this.rasterBoundsSegments=o.SegmentVector.simpleSegment(0,0,4,2);let _=new o.PosArray;_.emplaceBack(0,0),_.emplaceBack(1,0),_.emplaceBack(0,1),_.emplaceBack(1,1),this.viewportBuffer=n.createVertexBuffer(_,Gc.members),this.viewportSegments=o.SegmentVector.simpleSegment(0,0,4,2);let I=new o.LineStripIndexArray;I.emplaceBack(0),I.emplaceBack(1),I.emplaceBack(3),I.emplaceBack(2),I.emplaceBack(0),this.tileBorderIndexBuffer=n.createIndexBuffer(I);let M=new o.TriangleIndexArray;M.emplaceBack(0,1,2),M.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=n.createIndexBuffer(M),this.emptyTexture=new H(n,{width:1,height:1,data:new Uint8Array([0,0,0,0])},n.gl.RGBA);let E=this.context.gl;this.stencilClearMode=new Gi({func:E.ALWAYS,mask:0},0,255,E.ZERO,E.ZERO,E.ZERO)}clearStencil(){let n=this.context,c=n.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let d=o.create();o.ortho(d,0,this.width,this.height,0,0,1),o.scale(d,d,[c.drawingBufferWidth,c.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(n,c.TRIANGLES,bi.disabled,this.stencilClearMode,Lt.disabled,or.disabled,tl(d),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(n,c){if(this.currentStencilSource===n.source||!n.isTileClipped()||!c||!c.length)return;this.currentStencilSource=n.source;let d=this.context,g=d.gl;this.nextStencilID+c.length>256&&this.clearStencil(),d.setColorMode(Lt.disabled),d.setDepthMode(bi.disabled);let _=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let I of c){let M=this._tileClippingMaskIDs[I.key]=this.nextStencilID++;_.draw(d,g.TRIANGLES,bi.disabled,new Gi({func:g.ALWAYS,mask:0},M,255,g.KEEP,g.KEEP,g.REPLACE),Lt.disabled,or.disabled,tl(I.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let n=this.nextStencilID++,c=this.context.gl;return new Gi({func:c.NOTEQUAL,mask:255},n,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(n){let c=this.context.gl;return new Gi({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[n.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(n){let c=this.context.gl,d=n.sort((I,M)=>M.overscaledZ-I.overscaledZ),g=d[d.length-1].overscaledZ,_=d[0].overscaledZ-g+1;if(_>1){this.currentStencilSource=void 0,this.nextStencilID+_>256&&this.clearStencil();let I={};for(let M=0;M<_;M++)I[M+g]=new Gi({func:c.GEQUAL,mask:255},M+this.nextStencilID,255,c.KEEP,c.KEEP,c.REPLACE);return this.nextStencilID+=_,[I,d]}return[{[g]:Gi.disabled},d]}colorModeForRenderPass(){let n=this.context.gl;return this._showOverdrawInspector?new Lt([n.CONSTANT_COLOR,n.ONE],new o.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Lt.unblended:Lt.alphaBlended}depthModeForSublayer(n,c,d){if(!this.opaquePassEnabledForLayer())return bi.disabled;let g=1-((1+this.currentLayer)*this.numSublayers+n)*this.depthEpsilon;return new bi(d||this.context.gl.LEQUAL,c,[g,g])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(n,c){this.style=n,this.options=c,this.lineAtlas=n.lineAtlas,this.imageManager=n.imageManager,this.glyphManager=n.glyphManager,this.symbolFadeChange=n.placement.symbolFadeChange(o.exported.now()),this.imageManager.beginFrame();let d=this.style._order,g=this.style.sourceCaches;for(let E in g){let k=g[E];k.used&&k.prepare(this.context)}let _={},I={},M={};for(let E in g){let k=g[E];_[E]=k.getVisibleCoordinates(),I[E]=_[E].slice().reverse(),M[E]=k.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let E=0;E<d.length;E++)if(this.style._layers[d[E]].is3D()){this.opaquePassCutoff=E;break}this.renderPass="offscreen";for(let E of d){let k=this.style._layers[E];if(!k.hasOffscreenPass()||k.isHidden(this.transform.zoom))continue;let D=I[k.source];(k.type==="custom"||D.length)&&this.renderLayer(this,g[k.source],k,D)}for(this.context.bindFramebuffer.set(null),this.context.clear({color:c.showOverdrawInspector?o.Color.black:o.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=c.showOverdrawInspector,this.depthRangeFor3D=[0,1-(n._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=d.length-1;this.currentLayer>=0;this.currentLayer--){let E=this.style._layers[d[this.currentLayer]],k=g[E.source],D=_[E.source];this._renderTileClippingMasks(E,D),this.renderLayer(this,k,E,D)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<d.length;this.currentLayer++){let E=this.style._layers[d[this.currentLayer]],k=g[E.source],D=(E.type==="symbol"?M:I)[E.source];this._renderTileClippingMasks(E,_[E.source]),this.renderLayer(this,k,E,D)}if(this.options.showTileBoundaries){let E,k;Object.values(this.style._layers).forEach(D=>{D.source&&!D.isHidden(this.transform.zoom)&&(D.source!==(k&&k.id)&&(k=this.style.sourceCaches[D.source]),(!E||E.getSource().maxzoom<k.getSource().maxzoom)&&(E=k))}),E&&al.debug(this,E,E.getVisibleCoordinates())}this.options.showPadding&&function(E){let k=E.transform.padding;bp(E,E.transform.height-(k.top||0),3,xp),bp(E,k.bottom||0,3,_p),yu(E,k.left||0,3,da),yu(E,E.transform.width-(k.right||0),3,gu);let D=E.transform.centerPoint;(function(O,X,oe,$){vu(O,X-1,oe-10,2,20,$),vu(O,X-10,oe-1,20,2,$)})(E,D.x,E.transform.height-D.y,hh)}(this),this.context.setDefault()}renderLayer(n,c,d,g){d.isHidden(this.transform.zoom)||(d.type==="background"||d.type==="custom"||g.length)&&(this.id=d.id,this.gpuTimingStart(d),al[d.type](n,c,d,g,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(n){if(!this.options.gpuTiming)return;let c=this.context.extTimerQuery,d=this.gpuTimers[n.id];d||(d=this.gpuTimers[n.id]={calls:0,cpuTime:0,query:c.createQueryEXT()}),d.calls++,c.beginQueryEXT(c.TIME_ELAPSED_EXT,d.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;let n=this.context.extTimerQuery;n.endQueryEXT(n.TIME_ELAPSED_EXT)}collectGpuTimers(){let n=this.gpuTimers;return this.gpuTimers={},n}queryGpuTimers(n){let c={};for(let d in n){let g=n[d],_=this.context.extTimerQuery,I=_.getQueryObjectEXT(g.query,_.QUERY_RESULT_EXT)/1e6;_.deleteQueryEXT(g.query),c[d]=I}return c}translatePosMatrix(n,c,d,g,_){if(!d[0]&&!d[1])return n;let I=_?g==="map"?this.transform.angle:0:g==="viewport"?-this.transform.angle:0;if(I){let k=Math.sin(I),D=Math.cos(I);d=[d[0]*D-d[1]*k,d[0]*k+d[1]*D]}let M=[_?d[0]:Ai(c,d[0],this.transform.zoom),_?d[1]:Ai(c,d[1],this.transform.zoom),0],E=new Float32Array(16);return o.translate(E,n,M),E}saveTileTexture(n){let c=this._tileTextures[n.size[0]];c?c.push(n):this._tileTextures[n.size[0]]=[n]}getTileTexture(n){let c=this._tileTextures[n];return c&&c.length>0?c.pop():null}isPatternMissing(n){if(!n)return!1;if(!n.from||!n.to)return!0;let c=this.imageManager.getPattern(n.from.toString()),d=this.imageManager.getPattern(n.to.toString());return!c||!d}useProgram(n,c){this.cache=this.cache||{};let d=`${n}${c?c.cacheKey:""}${this._showOverdrawInspector?"/overdraw":""}`;return this.cache[d]||(this.cache[d]=new Ug(this.context,n,Vc[n],c,qc[n],this._showOverdrawInspector)),this.cache[d]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let n=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(n.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new H(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class xu{constructor(n,c){this.points=n,this.planes=c}static fromInvProjectionMatrix(n,c,d){let g=Math.pow(2,d),_=[[-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(M=>o.transformMat4([],M,n)).map(M=>o.scale$1([],M,1/M[3]/c*g)),I=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(M=>{let E=function(X,oe){var $=oe[0],ne=oe[1],me=oe[2],ge=$*$+ne*ne+me*me;return ge>0&&(ge=1/Math.sqrt(ge)),X[0]=oe[0]*ge,X[1]=oe[1]*ge,X[2]=oe[2]*ge,X}([],function(X,oe,$){var ne=oe[0],me=oe[1],ge=oe[2],we=$[0],xe=$[1],Ne=$[2];return X[0]=me*Ne-ge*xe,X[1]=ge*we-ne*Ne,X[2]=ne*xe-me*we,X}([],le([],_[M[0]],_[M[1]]),le([],_[M[2]],_[M[1]]))),k=-((D=E)[0]*(O=_[M[1]])[0]+D[1]*O[1]+D[2]*O[2]);var D,O;return E.concat(k)});return new xu(_,I)}}class _u{constructor(n,c){this.min=n,this.max=c,this.center=function(d,g,_){return d[0]=.5*g[0],d[1]=.5*g[1],d[2]=.5*g[2],d}([],function(d,g,_){return d[0]=g[0]+_[0],d[1]=g[1]+_[1],d[2]=g[2]+_[2],d}([],this.min,this.max))}quadrant(n){let c=[n%2==0,n<2],d=q(this.min),g=q(this.max);for(let _=0;_<c.length;_++)d[_]=c[_]?this.min[_]:this.center[_],g[_]=c[_]?this.center[_]:this.max[_];return g[2]=this.max[2],new _u(d,g)}distanceX(n){return Math.max(Math.min(this.max[0],n[0]),this.min[0])-n[0]}distanceY(n){return Math.max(Math.min(this.max[1],n[1]),this.min[1])-n[1]}intersects(n){let c=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],d=!0;for(let g=0;g<n.planes.length;g++){let _=n.planes[g],I=0;for(let M=0;M<c.length;M++)o.dot(_,c[M])>=0&&I++;if(I===0)return 0;I!==c.length&&(d=!1)}if(d)return 2;for(let g=0;g<3;g++){let _=Number.MAX_VALUE,I=-Number.MAX_VALUE;for(let M=0;M<n.points.length;M++){let E=n.points[M][g]-this.min[g];_=Math.min(_,E),I=Math.max(I,E)}if(I<0||_>this.max[g]-this.min[g])return 0}return 1}}class pa{constructor(n=0,c=0,d=0,g=0){if(isNaN(n)||n<0||isNaN(c)||c<0||isNaN(d)||d<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=n,this.bottom=c,this.left=d,this.right=g}interpolate(n,c,d){return c.top!=null&&n.top!=null&&(this.top=o.number(n.top,c.top,d)),c.bottom!=null&&n.bottom!=null&&(this.bottom=o.number(n.bottom,c.bottom,d)),c.left!=null&&n.left!=null&&(this.left=o.number(n.left,c.left,d)),c.right!=null&&n.right!=null&&(this.right=o.number(n.right,c.right,d)),this}getCenter(n,c){let d=o.clamp((this.left+n-this.right)/2,0,n),g=o.clamp((this.top+c-this.bottom)/2,0,c);return new o.pointGeometry(d,g)}equals(n){return this.top===n.top&&this.bottom===n.bottom&&this.left===n.left&&this.right===n.right}clone(){return new pa(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class ll{constructor(n,c,d,g,_){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=_===void 0||!!_,this._minZoom=n||0,this._maxZoom=c||22,this._minPitch=d??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new o.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new pa,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){let n=new ll(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return n.tileSize=this.tileSize,n.latRange=this.latRange,n.width=this.width,n.height=this.height,n._center=this._center,n.zoom=this.zoom,n.angle=this.angle,n._fov=this._fov,n._pitch=this._pitch,n._unmodified=this._unmodified,n._edgeInsets=this._edgeInsets.clone(),n._calcMatrices(),n}get minZoom(){return this._minZoom}set minZoom(n){this._minZoom!==n&&(this._minZoom=n,this.zoom=Math.max(this.zoom,n))}get maxZoom(){return this._maxZoom}set maxZoom(n){this._maxZoom!==n&&(this._maxZoom=n,this.zoom=Math.min(this.zoom,n))}get minPitch(){return this._minPitch}set minPitch(n){this._minPitch!==n&&(this._minPitch=n,this.pitch=Math.max(this.pitch,n))}get maxPitch(){return this._maxPitch}set maxPitch(n){this._maxPitch!==n&&(this._maxPitch=n,this.pitch=Math.min(this.pitch,n))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(n){n===void 0?n=!0:n===null&&(n=!1),this._renderWorldCopies=n}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(n){let c=-o.wrap(n,-180,180)*Math.PI/180;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=function(){var d=new o.ARRAY_TYPE(4);return o.ARRAY_TYPE!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}(),function(d,g,_){var I=g[0],M=g[1],E=g[2],k=g[3],D=Math.sin(_),O=Math.cos(_);d[0]=I*O+E*D,d[1]=M*O+k*D,d[2]=I*-D+E*O,d[3]=M*-D+k*O}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(n){let c=o.clamp(n,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(n){n=Math.max(.01,Math.min(60,n)),this._fov!==n&&(this._unmodified=!1,this._fov=n/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(n){let c=Math.min(Math.max(n,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._zoom=c,this.scale=this.zoomScale(c),this.tileZoom=Math.floor(c),this.zoomFraction=c-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(n){n.lat===this._center.lat&&n.lng===this._center.lng||(this._unmodified=!1,this._center=n,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(n){this._edgeInsets.equals(n)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,n,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(n){return this._edgeInsets.equals(n)}interpolatePadding(n,c,d){this._unmodified=!1,this._edgeInsets.interpolate(n,c,d),this._constrain(),this._calcMatrices()}coveringZoomLevel(n){let c=(n.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/n.tileSize));return Math.max(0,c)}getVisibleUnwrappedCoordinates(n){let c=[new o.UnwrappedTileID(0,n)];if(this._renderWorldCopies){let d=this.pointCoordinate(new o.pointGeometry(0,0)),g=this.pointCoordinate(new o.pointGeometry(this.width,0)),_=this.pointCoordinate(new o.pointGeometry(this.width,this.height)),I=this.pointCoordinate(new o.pointGeometry(0,this.height)),M=Math.floor(Math.min(d.x,g.x,_.x,I.x)),E=Math.floor(Math.max(d.x,g.x,_.x,I.x)),k=1;for(let D=M-k;D<=E+k;D++)D!==0&&c.push(new o.UnwrappedTileID(D,n))}return c}coveringTiles(n){let c=this.coveringZoomLevel(n),d=c;if(n.minzoom!==void 0&&c<n.minzoom)return[];n.maxzoom!==void 0&&c>n.maxzoom&&(c=n.maxzoom);let g=o.MercatorCoordinate.fromLngLat(this.center),_=Math.pow(2,c),I=[_*g.x,_*g.y,0],M=xu.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c),E=n.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(E=c);let k=$=>({aabb:new _u([$*_,0,0],[($+1)*_,_,0]),zoom:0,x:0,y:0,wrap:$,fullyVisible:!1}),D=[],O=[],X=c,oe=n.reparseOverscaled?d:c;if(this._renderWorldCopies)for(let $=1;$<=3;$++)D.push(k(-$)),D.push(k($));for(D.push(k(0));D.length>0;){let $=D.pop(),ne=$.x,me=$.y,ge=$.fullyVisible;if(!ge){let ke=$.aabb.intersects(M);if(ke===0)continue;ge=ke===2}let we=$.aabb.distanceX(I),xe=$.aabb.distanceY(I),Ne=Math.max(Math.abs(we),Math.abs(xe)),Te=3+(1<<X-$.zoom)-2;if($.zoom===X||Ne>Te&&$.zoom>=E)O.push({tileID:new o.OverscaledTileID($.zoom===X?oe:$.zoom,$.wrap,$.zoom,ne,me),distanceSq:de([I[0]-.5-ne,I[1]-.5-me])});else for(let ke=0;ke<4;ke++){let je=(ne<<1)+ke%2,Ke=(me<<1)+(ke>>1);D.push({aabb:$.aabb.quadrant(ke),zoom:$.zoom+1,x:je,y:Ke,wrap:$.wrap,fullyVisible:ge})}}return O.sort(($,ne)=>$.distanceSq-ne.distanceSq).map($=>$.tileID)}resize(n,c){this.width=n,this.height=c,this.pixelsToGLUnits=[2/n,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(n){return Math.pow(2,n)}scaleZoom(n){return Math.log(n)/Math.LN2}project(n){let c=o.clamp(n.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.pointGeometry(o.mercatorXfromLng(n.lng)*this.worldSize,o.mercatorYfromLat(c)*this.worldSize)}unproject(n){return new o.MercatorCoordinate(n.x/this.worldSize,n.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(n,c){let d=this.pointCoordinate(c),g=this.pointCoordinate(this.centerPoint),_=this.locationCoordinate(n),I=new o.MercatorCoordinate(_.x-(d.x-g.x),_.y-(d.y-g.y));this.center=this.coordinateLocation(I),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(n){return this.coordinatePoint(this.locationCoordinate(n))}pointLocation(n){return this.coordinateLocation(this.pointCoordinate(n))}locationCoordinate(n){return o.MercatorCoordinate.fromLngLat(n)}coordinateLocation(n){return n.toLngLat()}pointCoordinate(n){let c=[n.x,n.y,0,1],d=[n.x,n.y,1,1];o.transformMat4(c,c,this.pixelMatrixInverse),o.transformMat4(d,d,this.pixelMatrixInverse);let g=c[3],_=d[3],I=c[1]/g,M=d[1]/_,E=c[2]/g,k=d[2]/_,D=E===k?0:(0-E)/(k-E);return new o.MercatorCoordinate(o.number(c[0]/g,d[0]/_,D)/this.worldSize,o.number(I,M,D)/this.worldSize)}coordinatePoint(n){let c=[n.x*this.worldSize,n.y*this.worldSize,0,1];return o.transformMat4(c,c,this.pixelMatrix),new o.pointGeometry(c[0]/c[3],c[1]/c[3])}getBounds(){return new o.LngLatBounds().extend(this.pointLocation(new o.pointGeometry(0,0))).extend(this.pointLocation(new o.pointGeometry(this.width,0))).extend(this.pointLocation(new o.pointGeometry(this.width,this.height))).extend(this.pointLocation(new o.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new o.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(n){n?(this.lngRange=[n.getWest(),n.getEast()],this.latRange=[n.getSouth(),n.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(n,c=!1){let d=n.key,g=c?this._alignedPosMatrixCache:this._posMatrixCache;if(g[d])return g[d];let _=n.canonical,I=this.worldSize/this.zoomScale(_.z),M=_.x+Math.pow(2,_.z)*n.wrap,E=o.identity(new Float64Array(16));return o.translate(E,E,[M*I,_.y*I,0]),o.scale(E,E,[I/o.EXTENT,I/o.EXTENT,1]),o.multiply(E,c?this.alignedProjMatrix:this.projMatrix,E),g[d]=new Float32Array(E),g[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let n,c,d,g,_=-90,I=90,M=-180,E=180,k=this.size,D=this._unmodified;if(this.latRange){let oe=this.latRange;_=o.mercatorYfromLat(oe[1])*this.worldSize,I=o.mercatorYfromLat(oe[0])*this.worldSize,n=I-_<k.y?k.y/(I-_):0}if(this.lngRange){let oe=this.lngRange;M=o.mercatorXfromLng(oe[0])*this.worldSize,E=o.mercatorXfromLng(oe[1])*this.worldSize,c=E-M<k.x?k.x/(E-M):0}let O=this.point,X=Math.max(c||0,n||0);if(X)return this.center=this.unproject(new o.pointGeometry(c?(E+M)/2:O.x,n?(I+_)/2:O.y)),this.zoom+=this.scaleZoom(X),this._unmodified=D,void(this._constraining=!1);if(this.latRange){let oe=O.y,$=k.y/2;oe-$<_&&(g=_+$),oe+$>I&&(g=I-$)}if(this.lngRange){let oe=O.x,$=k.x/2;oe-$<M&&(d=M+$),oe+$>E&&(d=E-$)}d===void 0&&g===void 0||(this.center=this.unproject(new o.pointGeometry(d!==void 0?d:O.x,g!==void 0?g:O.y))),this._unmodified=D,this._constraining=!1}_calcMatrices(){if(!this.height)return;let n=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;let c=Math.PI/2+this._pitch,d=this._fov*(.5+n.y/this.height),g=Math.sin(d)*this.cameraToCenterDistance/Math.sin(o.clamp(Math.PI-c-d,.01,Math.PI-.01)),_=this.point,I=_.x,M=_.y,E=1.01*(Math.cos(Math.PI/2-this._pitch)*g+this.cameraToCenterDistance),k=this.height/50,D=new Float64Array(16);o.perspective(D,this._fov,this.width/this.height,k,E),D[8]=2*-n.x/this.width,D[9]=2*n.y/this.height,o.scale(D,D,[1,-1,1]),o.translate(D,D,[0,0,-this.cameraToCenterDistance]),o.rotateX(D,D,this._pitch),o.rotateZ(D,D,this.angle),o.translate(D,D,[-I,-M,0]),this.mercatorMatrix=o.scale([],D,[this.worldSize,this.worldSize,this.worldSize]),o.scale(D,D,[1,1,o.mercatorZfromAltitude(1,this.center.lat)*this.worldSize]),this.projMatrix=D,this.invProjMatrix=o.invert([],this.projMatrix);let O=this.width%2/2,X=this.height%2/2,oe=Math.cos(this.angle),$=Math.sin(this.angle),ne=I-Math.round(I)+oe*O+$*X,me=M-Math.round(M)+oe*X+$*O,ge=new Float64Array(D);if(o.translate(ge,ge,[ne>.5?ne-1:ne,me>.5?me-1:me,0]),this.alignedProjMatrix=ge,D=o.create(),o.scale(D,D,[this.width/2,-this.height/2,1]),o.translate(D,D,[1,-1,0]),this.labelPlaneMatrix=D,D=o.create(),o.scale(D,D,[1,-1,1]),o.translate(D,D,[-1,-1,0]),o.scale(D,D,[2/this.width,2/this.height,1]),this.glCoordMatrix=D,this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),D=o.invert(new Float64Array(16),this.pixelMatrix),!D)throw new Error("failed to invert matrix");this.pixelMatrixInverse=D,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let n=this.pointCoordinate(new o.pointGeometry(0,0)),c=[n.x*this.worldSize,n.y*this.worldSize,0,1];return o.transformMat4(c,c,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let n=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.pointGeometry(0,n))}getCameraQueryGeometry(n){let c=this.getCameraPoint();if(n.length===1)return[n[0],c];{let d=c.x,g=c.y,_=c.x,I=c.y;for(let M of n)d=Math.min(d,M.x),g=Math.min(g,M.y),_=Math.max(_,M.x),I=Math.max(I,M.y);return[new o.pointGeometry(d,g),new o.pointGeometry(_,g),new o.pointGeometry(_,I),new o.pointGeometry(d,I),new o.pointGeometry(d,g)]}}}class Ip{constructor(n){this._hashName=n&&encodeURIComponent(n),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(c,d){let g=!1,_=null,I=()=>{_=null,g&&(c(),_=setTimeout(I,300),g=!1)};return()=>(g=!0,_||I(),_)}(this._updateHashUnthrottled.bind(this))}addTo(n){return this._map=n,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(n){let c=this._map.getCenter(),d=Math.round(100*this._map.getZoom())/100,g=Math.ceil((d*Math.LN2+Math.log(512/360/.5))/Math.LN10),_=Math.pow(10,g),I=Math.round(c.lng*_)/_,M=Math.round(c.lat*_)/_,E=this._map.getBearing(),k=this._map.getPitch(),D="";if(D+=n?`/${I}/${M}/${d}`:`${d}/${M}/${I}`,(E||k)&&(D+="/"+Math.round(10*E)/10),k&&(D+=`/${Math.round(k)}`),this._hashName){let O=this._hashName,X=!1,oe=window.location.hash.slice(1).split("&").map($=>{let ne=$.split("=")[0];return ne===O?(X=!0,`${ne}=${D}`):$}).filter($=>$);return X||oe.push(`${O}=${D}`),`#${oe.join("&")}`}return`#${D}`}_getCurrentHash(){let n=window.location.hash.replace("#","");if(this._hashName){let c;return n.split("&").map(d=>d.split("=")).forEach(d=>{d[0]===this._hashName&&(c=d)}),(c&&c[1]||"").split("/")}return n.split("/")}_onHashChange(){let n=this._getCurrentHash();if(n.length>=3&&!n.some(c=>isNaN(c))){let c=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:c,pitch:+(n[4]||0)}),!0}return!1}_updateHashUnthrottled(){let n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}}}let ul={linearity:.3,easing:o.bezier(0,0,.3,1)},Sp=o.extend({deceleration:2500,maxSpeed:1400},ul),Cp=o.extend({deceleration:20,maxSpeed:1400},ul),Mp=o.extend({deceleration:1e3,maxSpeed:360},ul),fa=o.extend({deceleration:1e3,maxSpeed:90},ul);class Ep{constructor(n){this._map=n,this.clear()}clear(){this._inertiaBuffer=[]}record(n){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.exported.now(),settings:n})}_drainInertiaBuffer(){let n=this._inertiaBuffer,c=o.exported.now();for(;n.length>0&&c-n[0].time>160;)n.shift()}_onMoveEnd(n){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let c={zoom:0,bearing:0,pitch:0,pan:new o.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(let{settings:_}of this._inertiaBuffer)c.zoom+=_.zoomDelta||0,c.bearing+=_.bearingDelta||0,c.pitch+=_.pitchDelta||0,_.panDelta&&c.pan._add(_.panDelta),_.around&&(c.around=_.around),_.pinchAround&&(c.pinchAround=_.pinchAround);let d=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(c.pan.mag()){let _=hl(c.pan.mag(),d,o.extend({},Sp,n||{}));g.offset=c.pan.mult(_.amount/c.pan.mag()),g.center=this._map.transform.center,cl(g,_)}if(c.zoom){let _=hl(c.zoom,d,Cp);g.zoom=this._map.transform.zoom+_.amount,cl(g,_)}if(c.bearing){let _=hl(c.bearing,d,Mp);g.bearing=this._map.transform.bearing+o.clamp(_.amount,-179,179),cl(g,_)}if(c.pitch){let _=hl(c.pitch,d,fa);g.pitch=this._map.transform.pitch+_.amount,cl(g,_)}if(g.zoom||g.bearing){let _=c.pinchAround===void 0?c.around:c.pinchAround;g.around=_?this._map.unproject(_):this._map.getCenter()}return this.clear(),o.extend(g,{noMoveStart:!0})}}function cl(f,n){(!f.duration||f.duration<n.duration)&&(f.duration=n.duration,f.easing=n.easing)}function hl(f,n,c){let{maxSpeed:d,linearity:g,deceleration:_}=c,I=o.clamp(f*g/(n/1e3),-d,d),M=Math.abs(I)/(_*g);return{easing:c.easing,duration:1e3*M,amount:I*(M/2)}}class Mn extends o.Event{constructor(n,c,d,g={}){let _=A.mousePos(c.getCanvasContainer(),d),I=c.unproject(_);super(n,o.extend({point:_,lngLat:I,originalEvent:d},g)),this._defaultPrevented=!1,this.target=c}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class dn extends o.Event{constructor(n,c,d){let g=n==="touchend"?d.changedTouches:d.touches,_=A.touchPos(c.getCanvasContainer(),g),I=_.map(E=>c.unproject(E)),M=_.reduce((E,k,D,O)=>E.add(k.div(O.length)),new o.pointGeometry(0,0));super(n,{points:_,point:M,lngLats:I,lngLat:c.unproject(M),originalEvent:d}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Kg extends o.Event{constructor(n,c,d){super(n,{originalEvent:d}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class ws{constructor(n,c){this._map=n,this._clickTolerance=c.clickTolerance}reset(){delete this._mousedownPos}wheel(n){return this._firePreventable(new Kg(n.type,this._map,n))}mousedown(n,c){return this._mousedownPos=c,this._firePreventable(new Mn(n.type,this._map,n))}mouseup(n){this._map.fire(new Mn(n.type,this._map,n))}click(n,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||this._map.fire(new Mn(n.type,this._map,n))}dblclick(n){return this._firePreventable(new Mn(n.type,this._map,n))}mouseover(n){this._map.fire(new Mn(n.type,this._map,n))}mouseout(n){this._map.fire(new Mn(n.type,this._map,n))}touchstart(n){return this._firePreventable(new dn(n.type,this._map,n))}touchmove(n){this._map.fire(new dn(n.type,this._map,n))}touchend(n){this._map.fire(new dn(n.type,this._map,n))}touchcancel(n){this._map.fire(new dn(n.type,this._map,n))}_firePreventable(n){if(this._map.fire(n),n.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ap{constructor(n){this._map=n}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(n){this._map.fire(new Mn(n.type,this._map,n))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Mn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(n){this._delayContextMenu?this._contextMenuEvent=n:this._map.fire(new Mn(n.type,this._map,n)),this._map.listens("contextmenu")&&n.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ma{constructor(n,c){this._map=n,this._el=n.getCanvasContainer(),this._container=n.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(n,c){this.isEnabled()&&n.shiftKey&&n.button===0&&(A.disableDrag(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(n,c){if(!this._active)return;let d=c;if(this._lastPos.equals(d)||!this._box&&d.dist(this._startPos)<this._clickTolerance)return;let g=this._startPos;this._lastPos=d,this._box||(this._box=A.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",n));let _=Math.min(g.x,d.x),I=Math.max(g.x,d.x),M=Math.min(g.y,d.y),E=Math.max(g.y,d.y);A.setTransform(this._box,`translate(${_}px,${M}px)`),this._box.style.width=I-_+"px",this._box.style.height=E-M+"px"}mouseupWindow(n,c){if(!this._active||n.button!==0)return;let d=this._startPos,g=c;if(this.reset(),A.suppressClick(),d.x!==g.x||d.y!==g.y)return this._map.fire(new o.Event("boxzoomend",{originalEvent:n})),{cameraAnimation:_=>_.fitScreenCoordinates(d,g,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",n)}keydown(n){this._active&&n.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",n))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(A.remove(this._box),this._box=null),A.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(n,c){return this._map.fire(new o.Event(n,{originalEvent:c}))}}function Is(f,n){let c={};for(let d=0;d<f.length;d++)c[f[d].identifier]=n[d];return c}class e0{constructor(n){this.reset(),this.numTouches=n.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(n,c,d){(this.centroid||d.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=n.timeStamp),d.length===this.numTouches&&(this.centroid=function(g){let _=new o.pointGeometry(0,0);for(let I of g)_._add(I);return _.div(g.length)}(c),this.touches=Is(d,c)))}touchmove(n,c,d){if(this.aborted||!this.centroid)return;let g=Is(d,c);for(let _ in this.touches){let I=this.touches[_],M=g[_];(!M||M.dist(I)>30)&&(this.aborted=!0)}}touchend(n,c,d){if((!this.centroid||n.timeStamp-this.startTime>500)&&(this.aborted=!0),d.length===0){let g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class ph{constructor(n){this.singleTap=new e0(n),this.numTaps=n.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(n,c,d){this.singleTap.touchstart(n,c,d)}touchmove(n,c,d){this.singleTap.touchmove(n,c,d)}touchend(n,c,d){let g=this.singleTap.touchend(n,c,d);if(g){let _=n.timeStamp-this.lastTime<500,I=!this.lastTap||this.lastTap.dist(g)<30;if(_&&I||this.reset(),this.count++,this.lastTime=n.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class t0{constructor(){this._zoomIn=new ph({numTouches:1,numTaps:2}),this._zoomOut=new ph({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(n,c,d){this._zoomIn.touchstart(n,c,d),this._zoomOut.touchstart(n,c,d)}touchmove(n,c,d){this._zoomIn.touchmove(n,c,d),this._zoomOut.touchmove(n,c,d)}touchend(n,c,d){let g=this._zoomIn.touchend(n,c,d),_=this._zoomOut.touchend(n,c,d);return g?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:I.getZoom()+1,around:I.unproject(g)},{originalEvent:n})}):_?(this._active=!0,n.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:I.getZoom()-1,around:I.unproject(_)},{originalEvent:n})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let Tp={0:1,2:2};class Ss{constructor(n){this.reset(),this._clickTolerance=n.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(n,c){return!1}_move(n,c){return{}}mousedown(n,c){if(this._lastPoint)return;let d=A.mouseButton(n);this._correctButton(n,d)&&(this._lastPoint=c,this._eventButton=d)}mousemoveWindow(n,c){let d=this._lastPoint;if(d){if(n.preventDefault(),function(g,_){let I=Tp[_];return g.buttons===void 0||(g.buttons&I)!==I}(n,this._eventButton))this.reset();else if(this._moved||!(c.dist(d)<this._clickTolerance))return this._moved=!0,this._lastPoint=c,this._move(d,c)}}mouseupWindow(n){this._lastPoint&&A.mouseButton(n)===this._eventButton&&(this._moved&&A.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ga extends Ss{mousedown(n,c){super.mousedown(n,c),this._lastPoint&&(this._active=!0)}_correctButton(n,c){return c===0&&!n.ctrlKey}_move(n,c){return{around:c,panDelta:c.sub(n)}}}class dt extends Ss{_correctButton(n,c){return c===0&&n.ctrlKey||c===2}_move(n,c){let d=.8*(c.x-n.x);if(d)return this._active=!0,{bearingDelta:d}}contextmenu(n){n.preventDefault()}}class fh extends Ss{_correctButton(n,c){return c===0&&n.ctrlKey||c===2}_move(n,c){let d=-.5*(c.y-n.y);if(d)return this._active=!0,{pitchDelta:d}}contextmenu(n){n.preventDefault()}}class dl{constructor(n){this._minTouches=1,this._clickTolerance=n.clickTolerance||1,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.pointGeometry(0,0)}touchstart(n,c,d){return this._calculateTransform(n,c,d)}touchmove(n,c,d){if(this._active&&!(d.length<this._minTouches))return n.preventDefault(),this._calculateTransform(n,c,d)}touchend(n,c,d){this._calculateTransform(n,c,d),this._active&&d.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(n,c,d){d.length>0&&(this._active=!0);let g=Is(d,c),_=new o.pointGeometry(0,0),I=new o.pointGeometry(0,0),M=0;for(let k in g){let D=g[k],O=this._touches[k];O&&(_._add(D),I._add(D.sub(O)),M++,g[k]=D)}if(this._touches=g,M<this._minTouches||!I.mag())return;let E=I.div(M);return this._sum._add(E),this._sum.mag()<this._clickTolerance?void 0:{around:_.div(M),panDelta:E}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Cs{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(n){}_move(n,c,d){return{}}touchstart(n,c,d){this._firstTwoTouches||d.length<2||(this._firstTwoTouches=[d[0].identifier,d[1].identifier],this._start([c[0],c[1]]))}touchmove(n,c,d){if(!this._firstTwoTouches)return;n.preventDefault();let[g,_]=this._firstTwoTouches,I=pl(d,c,g),M=pl(d,c,_);if(!I||!M)return;let E=this._aroundCenter?null:I.add(M).div(2);return this._move([I,M],E,n)}touchend(n,c,d){if(!this._firstTwoTouches)return;let[g,_]=this._firstTwoTouches,I=pl(d,c,g),M=pl(d,c,_);I&&M||(this._active&&A.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(n){this._enabled=!0,this._aroundCenter=!!n&&n.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function pl(f,n,c){for(let d=0;d<f.length;d++)if(f[d].identifier===c)return n[d]}function it(f,n){return Math.log(f/n)/Math.LN2}class mh extends Cs{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(n){this._startDistance=this._distance=n[0].dist(n[1])}_move(n,c){let d=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(it(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:it(this._distance,d),pinchAround:c}}}function Pp(f,n){return 180*f.angleWith(n)/Math.PI}class i0 extends Cs{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])}_move(n,c){let d=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Pp(this._vector,d),pinchAround:c}}_isBelowThreshold(n){this._minDiameter=Math.min(this._minDiameter,n.mag());let c=25/(Math.PI*this._minDiameter)*360,d=Pp(n,this._startVector);return Math.abs(d)<c}}function fl(f){return Math.abs(f.y)>Math.abs(f.x)}class kp extends Cs{reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(n){this._lastPoints=n,fl(n[0].sub(n[1]))&&(this._valid=!1)}_move(n,c,d){let g=n[0].sub(this._lastPoints[0]),_=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(g,_,d.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(g.y+_.y)/2*-.5}}gestureBeginsVertically(n,c,d){if(this._valid!==void 0)return this._valid;let g=n.mag()>=2,_=c.mag()>=2;if(!g&&!_)return;if(!g||!_)return this._firstMove===void 0&&(this._firstMove=d),d-this._firstMove<100&&void 0;let I=n.y>0==c.y>0;return fl(n)&&fl(c)&&I}}let zp={panStep:100,bearingStep:15,pitchStep:10};class r0{constructor(){let n=zp;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(n){if(n.altKey||n.ctrlKey||n.metaKey)return;let c=0,d=0,g=0,_=0,I=0;switch(n.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:n.shiftKey?d=-1:(n.preventDefault(),_=-1);break;case 39:n.shiftKey?d=1:(n.preventDefault(),_=1);break;case 38:n.shiftKey?g=1:(n.preventDefault(),I=-1);break;case 40:n.shiftKey?g=-1:(n.preventDefault(),I=1);break;default:return}return this._rotationDisabled&&(d=0,g=0),{cameraAnimation:M=>{let E=M.getZoom();M.easeTo({duration:300,easeId:"keyboardHandler",easing:n0,zoom:c?Math.round(E)+c*(n.shiftKey?2:1):E,bearing:M.getBearing()+d*this._bearingStep,pitch:M.getPitch()+g*this._pitchStep,offset:[-_*this._panStep,-I*this._panStep],center:M.getCenter()},{originalEvent:n})}}}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 n0(f){return f*(2-f)}let bu=4.000244140625;class gh{constructor(n,c){this._map=n,this._el=n.getCanvasContainer(),this._handler=c,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,o.bindAll(["_onTimeout"],this)}setZoomRate(n){this._defaultZoomRate=n}setWheelZoomRate(n){this._wheelZoomRate=n}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(n){this.isEnabled()||(this._enabled=!0,this._aroundCenter=n&&n.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(n){if(!this.isEnabled())return;let c=n.deltaMode===WheelEvent.DOM_DELTA_LINE?40*n.deltaY:n.deltaY,d=o.exported.now(),g=d-(this._lastWheelEventTime||0);this._lastWheelEventTime=d,c!==0&&c%bu==0?this._type="wheel":c!==0&&Math.abs(c)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=c,this._timeout=setTimeout(this._onTimeout,40,n)):this._type||(this._type=Math.abs(g*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),n.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=n,this._delta-=c,this._active||this._start(n)),n.preventDefault()}_onTimeout(n){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(n)}_start(n){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 c=A.mousePos(this._el,n);this._around=o.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(c)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let n=this._map.transform;if(this._delta!==0){let M=this._type==="wheel"&&Math.abs(this._delta)>bu?this._wheelZoomRate:this._defaultZoomRate,E=2/(1+Math.exp(-Math.abs(this._delta*M)));this._delta<0&&E!==0&&(E=1/E);let k=typeof this._targetZoom=="number"?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(k*E))),this._type==="wheel"&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let c=typeof this._targetZoom=="number"?this._targetZoom:n.zoom,d=this._startZoom,g=this._easing,_,I=!1;if(this._type==="wheel"&&d&&g){let M=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),E=g(M);_=o.number(d,c,E),M<1?this._frameId||(this._frameId=!0):I=!0}else _=c,I=!0;return this._active=!0,I&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!I,zoomDelta:_-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(n){let c=o.ease;if(this._prevEase){let d=this._prevEase,g=(o.exported.now()-d.start)/d.duration,_=d.easing(g+.01)-d.easing(g),I=.27/Math.sqrt(_*_+1e-4)*.01,M=Math.sqrt(.0729-I*I);c=o.bezier(I,M,.25,1)}return this._prevEase={start:o.exported.now(),duration:n,easing:c},c}reset(){this._active=!1}}class yh{constructor(n,c){this._clickZoom=n,this._tapZoom=c}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 vh{constructor(){this.reset()}reset(){this._active=!1}dblclick(n,c){return n.preventDefault(),{cameraAnimation:d=>{d.easeTo({duration:300,zoom:d.getZoom()+(n.shiftKey?-1:1),around:d.unproject(c)},{originalEvent:n})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pn{constructor(){this._tap=new ph({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(n,c,d){this._swipePoint||(this._tapTime&&n.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?d.length>0&&(this._swipePoint=c[0],this._swipeTouch=d[0].identifier):this._tap.touchstart(n,c,d))}touchmove(n,c,d){if(this._tapTime){if(this._swipePoint){if(d[0].identifier!==this._swipeTouch)return;let g=c[0],_=g.y-this._swipePoint.y;return this._swipePoint=g,n.preventDefault(),this._active=!0,{zoomDelta:_/128}}}else this._tap.touchmove(n,c,d)}touchend(n,c,d){this._tapTime?this._swipePoint&&d.length===0&&this.reset():this._tap.touchend(n,c,d)&&(this._tapTime=n.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ko{constructor(n,c,d){this._el=n,this._mousePan=c,this._touchPan=d}enable(n){this._inertiaOptions=n||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Lp{constructor(n,c,d){this._pitchWithRotate=n.pitchWithRotate,this._mouseRotate=c,this._mousePitch=d}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 xh{constructor(n,c,d,g){this._el=n,this._touchZoom=c,this._touchRotate=d,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(n){this._touchZoom.enable(n),this._rotationDisabled||this._touchRotate.enable(n),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","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 ya=f=>f.zoom||f.drag||f.pitch||f.rotate;class _h extends o.Event{}function wu(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class Zn{constructor(n,c){this._map=n,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ep(n),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(c),o.bindAll(["handleEvent","handleWindowEvent"],this);let d=this._el;this._listeners=[[d,"touchstart",{passive:!0}],[d,"touchmove",{passive:!1}],[d,"touchend",void 0],[d,"touchcancel",void 0],[d,"mousedown",void 0],[d,"mousemove",void 0],[d,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[d,"mouseover",void 0],[d,"mouseout",void 0],[d,"dblclick",void 0],[d,"click",void 0],[d,"keydown",{capture:!1}],[d,"keyup",void 0],[d,"wheel",{passive:!1}],[d,"contextmenu",void 0],[window,"blur",void 0]];for(let[g,_,I]of this._listeners)A.addEventListener(g,_,g===document?this.handleWindowEvent:this.handleEvent,I)}destroy(){for(let[n,c,d]of this._listeners)A.removeEventListener(n,c,n===document?this.handleWindowEvent:this.handleEvent,d)}_addDefaultHandlers(n){let c=this._map,d=c.getCanvasContainer();this._add("mapEvent",new ws(c,n));let g=c.boxZoom=new ma(c,n);this._add("boxZoom",g);let _=new t0,I=new vh;c.doubleClickZoom=new yh(I,_),this._add("tapZoom",_),this._add("clickZoom",I);let M=new pn;this._add("tapDragZoom",M);let E=c.touchPitch=new kp;this._add("touchPitch",E);let k=new dt(n),D=new fh(n);c.dragRotate=new Lp(n,k,D),this._add("mouseRotate",k,["mousePitch"]),this._add("mousePitch",D,["mouseRotate"]);let O=new ga(n),X=new dl(n);c.dragPan=new Ko(d,O,X),this._add("mousePan",O),this._add("touchPan",X,["touchZoom","touchRotate"]);let oe=new i0,$=new mh;c.touchZoomRotate=new xh(d,$,oe,M),this._add("touchRotate",oe,["touchPan","touchZoom"]),this._add("touchZoom",$,["touchPan","touchRotate"]);let ne=c.scrollZoom=new gh(c,this);this._add("scrollZoom",ne,["mousePan"]);let me=c.keyboard=new r0;this._add("keyboard",me),this._add("blockableMapEvent",new Ap(c));for(let ge of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])n.interactive&&n[ge]&&c[ge].enable(n[ge])}_add(n,c,d){this._handlers.push({handlerName:n,handler:c,allowed:d}),this._handlersById[n]=c}stop(n){if(!this._updatingCamera){for(let{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},n),this._changes=[]}}isActive(){for(let{handler:n}of this._handlers)if(n.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(ya(this._eventsInProgress))||this.isZooming()}_blockedByActive(n,c,d){for(let g in n)if(g!==d&&(!c||c.indexOf(g)<0))return!0;return!1}handleWindowEvent(n){this.handleEvent(n,`${n.type}Window`)}_getMapTouches(n){let c=[];for(let d of n)this._el.contains(d.target)&&c.push(d);return c}handleEvent(n,c){if(n.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let d=n.type==="renderFrame"?void 0:n,g={needsRenderFrame:!1},_={},I={},M=n.touches,E=M?this._getMapTouches(M):void 0,k=E?A.touchPos(this._el,E):A.mousePos(this._el,n);for(let{handlerName:X,handler:oe,allowed:$}of this._handlers){if(!oe.isEnabled())continue;let ne;this._blockedByActive(I,$,X)?oe.reset():oe[c||n.type]&&(ne=oe[c||n.type](n,k,E),this.mergeHandlerResult(g,_,ne,X,d),ne&&ne.needsRenderFrame&&this._triggerRenderFrame()),(ne||oe.isActive())&&(I[X]=oe)}let D={};for(let X in this._previousActiveHandlers)I[X]||(D[X]=d);this._previousActiveHandlers=I,(Object.keys(D).length||wu(g))&&(this._changes.push([g,_,D]),this._triggerRenderFrame()),(Object.keys(I).length||wu(g))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:O}=g;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))}mergeHandlerResult(n,c,d,g,_){if(!d)return;o.extend(n,d);let I={handlerName:g,originalEvent:d.originalEvent||_};d.zoomDelta!==void 0&&(c.zoom=I),d.panDelta!==void 0&&(c.drag=I),d.pitchDelta!==void 0&&(c.pitch=I),d.bearingDelta!==void 0&&(c.rotate=I)}_applyChanges(){let n={},c={},d={};for(let[g,_,I]of this._changes)g.panDelta&&(n.panDelta=(n.panDelta||new o.pointGeometry(0,0))._add(g.panDelta)),g.zoomDelta&&(n.zoomDelta=(n.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(n.bearingDelta=(n.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(n.pitchDelta=(n.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(n.around=g.around),g.pinchAround!==void 0&&(n.pinchAround=g.pinchAround),g.noInertia&&(n.noInertia=g.noInertia),o.extend(c,_),o.extend(d,I);this._updateMapTransform(n,c,d),this._changes=[]}_updateMapTransform(n,c,d){let g=this._map,_=g.transform;if(!wu(n))return this._fireEvents(c,d,!0);let{panDelta:I,zoomDelta:M,bearingDelta:E,pitchDelta:k,around:D,pinchAround:O}=n;O!==void 0&&(D=O),g._stop(!0),D=D||g.transform.centerPoint;let X=_.pointLocation(I?D.sub(I):D);E&&(_.bearing+=E),k&&(_.pitch+=k),M&&(_.zoom+=M),_.setLocationAtPoint(X,D),this._map._update(),n.noInertia||this._inertia.record(n),this._fireEvents(c,d,!0)}_fireEvents(n,c,d){let g=ya(this._eventsInProgress),_=ya(n),I={};for(let D in n){let{originalEvent:O}=n[D];this._eventsInProgress[D]||(I[`${D}start`]=O),this._eventsInProgress[D]=n[D]}!g&&_&&this._fireEvent("movestart",_.originalEvent);for(let D in I)this._fireEvent(D,I[D]);_&&this._fireEvent("move",_.originalEvent);for(let D in n){let{originalEvent:O}=n[D];this._fireEvent(D,O)}let M={},E;for(let D in this._eventsInProgress){let{handlerName:O,originalEvent:X}=this._eventsInProgress[D];this._handlersById[O].isActive()||(delete this._eventsInProgress[D],E=c[O]||X,M[`${D}end`]=E)}for(let D in M)this._fireEvent(D,M[D]);let k=ya(this._eventsInProgress);if(d&&(g||_)&&!k){this._updatingCamera=!0;let D=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=X=>X!==0&&-this._bearingSnap<X&&X<this._bearingSnap;D?(O(D.bearing||this._map.getBearing())&&(D.bearing=0),this._map.easeTo(D,{originalEvent:E})):(this._map.fire(new o.Event("moveend",{originalEvent:E})),O(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(n,c){this._map.fire(new o.Event(n,c?{originalEvent:c}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(n=>{delete this._frameId,this.handleEvent(new _h("renderFrame",{timeStamp:n})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}let Vi={extend:(f,...n)=>o.extend(f,...n),run(f){f()},logToElement(f,n=!1,c="log"){let d=window.document.getElementById(c);d&&(n&&(d.innerHTML=""),d.innerHTML+=`<br>${f}`)}};class Iu extends o.Evented{constructor(n,c){super(),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=c.bearingSnap,o.bindAll(["_renderFrameCallback"],this)}getCenter(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(n,c){return this.jumpTo({center:n},c)}panBy(n,c,d){return n=o.pointGeometry.convert(n).mult(-1),this.panTo(this.transform.center,o.extend({offset:n},c),d)}panTo(n,c,d){return this.easeTo(o.extend({center:n},c),d)}getZoom(){return this.transform.zoom}setZoom(n,c){return this.jumpTo({zoom:n},c),this}zoomTo(n,c,d){return this.easeTo(o.extend({zoom:n},c),d)}zoomIn(n,c){return this.zoomTo(this.getZoom()+1,n,c),this}zoomOut(n,c){return this.zoomTo(this.getZoom()-1,n,c),this}getBearing(){return this.transform.bearing}setBearing(n,c){return this.jumpTo({bearing:n},c),this}getPadding(){return this.transform.padding}setPadding(n,c){return this.jumpTo({padding:n},c),this}rotateTo(n,c,d){return this.easeTo(o.extend({bearing:n},c),d)}resetNorth(n,c){return this.rotateTo(0,o.extend({duration:1e3},n),c),this}resetNorthPitch(n,c){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},n),c),this}snapToNorth(n,c){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,c):this}getPitch(){return this.transform.pitch}setPitch(n,c){return this.jumpTo({pitch:n},c),this}cameraForBounds(n,c){n=o.LngLatBounds.convert(n);let d=c&&c.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),d,c)}_cameraForBoxAndBearing(n,c,d,g){let _={top:0,bottom:0,right:0,left:0};if(typeof(g=o.extend({padding:_,offset:[0,0],maxZoom:this.transform.maxZoom},g)).padding=="number"){let Te=g.padding;g.padding={top:Te,bottom:Te,right:Te,left:Te}}g.padding=o.extend(_,g.padding);let I=this.transform,M=I.padding,E=I.project(o.LngLat.convert(n)),k=I.project(o.LngLat.convert(c)),D=E.rotate(-d*Math.PI/180),O=k.rotate(-d*Math.PI/180),X=new o.pointGeometry(Math.max(D.x,O.x),Math.max(D.y,O.y)),oe=new o.pointGeometry(Math.min(D.x,O.x),Math.min(D.y,O.y)),$=X.sub(oe),ne=(I.width-(M.left+M.right+g.padding.left+g.padding.right))/$.x,me=(I.height-(M.top+M.bottom+g.padding.top+g.padding.bottom))/$.y;if(me<0||ne<0)return void o.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let ge=Math.min(I.scaleZoom(I.scale*Math.min(ne,me)),g.maxZoom),we=o.pointGeometry.convert(g.offset),xe=new o.pointGeometry((g.padding.left-g.padding.right)/2,(g.padding.top-g.padding.bottom)/2).rotate(d*Math.PI/180),Ne=we.add(xe).mult(I.scale/I.zoomScale(ge));return{center:I.unproject(E.add(k).div(2).sub(Ne)),zoom:ge,bearing:d}}fitBounds(n,c,d){return this._fitInternal(this.cameraForBounds(n,c),c,d)}fitScreenCoordinates(n,c,d,g,_){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(o.pointGeometry.convert(n)),this.transform.pointLocation(o.pointGeometry.convert(c)),d,g),g,_)}_fitInternal(n,c,d){return n?(delete(c=o.extend(n,c)).padding,c.linear?this.easeTo(c,d):this.flyTo(c,d)):this}jumpTo(n,c){this.stop();let d=this.transform,g=!1,_=!1,I=!1;return"zoom"in n&&d.zoom!==+n.zoom&&(g=!0,d.zoom=+n.zoom),n.center!==void 0&&(d.center=o.LngLat.convert(n.center)),"bearing"in n&&d.bearing!==+n.bearing&&(_=!0,d.bearing=+n.bearing),"pitch"in n&&d.pitch!==+n.pitch&&(I=!0,d.pitch=+n.pitch),n.padding==null||d.isPaddingEqual(n.padding)||(d.padding=n.padding),this.fire(new o.Event("movestart",c)).fire(new o.Event("move",c)),g&&this.fire(new o.Event("zoomstart",c)).fire(new o.Event("zoom",c)).fire(new o.Event("zoomend",c)),_&&this.fire(new o.Event("rotatestart",c)).fire(new o.Event("rotate",c)).fire(new o.Event("rotateend",c)),I&&this.fire(new o.Event("pitchstart",c)).fire(new o.Event("pitch",c)).fire(new o.Event("pitchend",c)),this.fire(new o.Event("moveend",c))}easeTo(n,c){this._stop(!1,n.easeId),((n=o.extend({offset:[0,0],duration:500,easing:o.ease},n)).animate===!1||!n.essential&&o.exported.prefersReducedMotion)&&(n.duration=0);let d=this.transform,g=this.getZoom(),_=this.getBearing(),I=this.getPitch(),M=this.getPadding(),E="zoom"in n?+n.zoom:g,k="bearing"in n?this._normalizeBearing(n.bearing,_):_,D="pitch"in n?+n.pitch:I,O="padding"in n?n.padding:d.padding,X=o.pointGeometry.convert(n.offset),oe=d.centerPoint.add(X),$=d.pointLocation(oe),ne=o.LngLat.convert(n.center||$);this._normalizeCenter(ne);let me=d.project($),ge=d.project(ne).sub(me),we=d.zoomScale(E-g),xe,Ne;n.around&&(xe=o.LngLat.convert(n.around),Ne=d.locationPoint(xe));let Te={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||E!==g,this._rotating=this._rotating||_!==k,this._pitching=this._pitching||D!==I,this._padding=!d.isPaddingEqual(O),this._easeId=n.easeId,this._prepareEase(c,n.noMoveStart,Te),this._ease(ke=>{if(this._zooming&&(d.zoom=o.number(g,E,ke)),this._rotating&&(d.bearing=o.number(_,k,ke)),this._pitching&&(d.pitch=o.number(I,D,ke)),this._padding&&(d.interpolatePadding(M,O,ke),oe=d.centerPoint.add(X)),xe)d.setLocationAtPoint(xe,Ne);else{let je=d.zoomScale(d.zoom-g),Ke=E>g?Math.min(2,we):Math.max(.5,we),De=Math.pow(Ke,1-ke),mt=d.unproject(me.add(ge.mult(ke*De)).mult(je));d.setLocationAtPoint(d.renderWorldCopies?mt.wrap():mt,oe)}this._fireMoveEvents(c)},ke=>{this._afterEase(c,ke)},n),this}_prepareEase(n,c,d={}){this._moving=!0,c||d.moving||this.fire(new o.Event("movestart",n)),this._zooming&&!d.zooming&&this.fire(new o.Event("zoomstart",n)),this._rotating&&!d.rotating&&this.fire(new o.Event("rotatestart",n)),this._pitching&&!d.pitching&&this.fire(new o.Event("pitchstart",n))}_fireMoveEvents(n){this.fire(new o.Event("move",n)),this._zooming&&this.fire(new o.Event("zoom",n)),this._rotating&&this.fire(new o.Event("rotate",n)),this._pitching&&this.fire(new o.Event("pitch",n))}_afterEase(n,c){if(this._easeId&&c&&this._easeId===c)return;delete this._easeId;let d=this._zooming,g=this._rotating,_=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,d&&this.fire(new o.Event("zoomend",n)),g&&this.fire(new o.Event("rotateend",n)),_&&this.fire(new o.Event("pitchend",n)),this.fire(new o.Event("moveend",n))}flyTo(n,c){if(!n.essential&&o.exported.prefersReducedMotion){let qt=o.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(qt,c)}this.stop(),n=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},n);let d=this.transform,g=this.getZoom(),_=this.getBearing(),I=this.getPitch(),M=this.getPadding(),E="zoom"in n?o.clamp(+n.zoom,d.minZoom,d.maxZoom):g,k="bearing"in n?this._normalizeBearing(n.bearing,_):_,D="pitch"in n?+n.pitch:I,O="padding"in n?n.padding:d.padding,X=d.zoomScale(E-g),oe=o.pointGeometry.convert(n.offset),$=d.centerPoint.add(oe),ne=d.pointLocation($),me=o.LngLat.convert(n.center||ne);this._normalizeCenter(me);let ge=d.project(ne),we=d.project(me).sub(ge),xe=n.curve,Ne=Math.max(d.width,d.height),Te=Ne/X,ke=we.mag();if("minZoom"in n){let qt=o.clamp(Math.min(n.minZoom,g,E),d.minZoom,d.maxZoom),Qi=Ne/d.zoomScale(qt-g);xe=Math.sqrt(Qi/ke*2)}let je=xe*xe;function Ke(qt){let Qi=(Te*Te-Ne*Ne+(qt?-1:1)*je*je*ke*ke)/(2*(qt?Te:Ne)*je*ke);return Math.log(Math.sqrt(Qi*Qi+1)-Qi)}function De(qt){return(Math.exp(qt)-Math.exp(-qt))/2}function mt(qt){return(Math.exp(qt)+Math.exp(-qt))/2}let rt=Ke(0),Pt=function(qt){return mt(rt)/mt(rt+xe*qt)},Qt=function(qt){return Ne*((mt(rt)*(De(Qi=rt+xe*qt)/mt(Qi))-De(rt))/je)/ke;var Qi},Wt=(Ke(1)-rt)/xe;if(Math.abs(ke)<1e-6||!isFinite(Wt)){if(Math.abs(Ne-Te)<1e-6)return this.easeTo(n,c);let qt=Te<Ne?-1:1;Wt=Math.abs(Math.log(Te/Ne))/xe,Qt=function(){return 0},Pt=function(Qi){return Math.exp(qt*xe*Qi)}}return n.duration="duration"in n?+n.duration:1e3*Wt/("screenSpeed"in n?+n.screenSpeed/xe:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=_!==k,this._pitching=D!==I,this._padding=!d.isPaddingEqual(O),this._prepareEase(c,!1),this._ease(qt=>{let Qi=qt*Wt,zt=1/Pt(Qi);d.zoom=qt===1?E:g+d.scaleZoom(zt),this._rotating&&(d.bearing=o.number(_,k,qt)),this._pitching&&(d.pitch=o.number(I,D,qt)),this._padding&&(d.interpolatePadding(M,O,qt),$=d.centerPoint.add(oe));let ai=qt===1?me:d.unproject(ge.add(we.mult(Qt(Qi))).mult(zt));d.setLocationAtPoint(d.renderWorldCopies?ai.wrap():ai,$),this._fireMoveEvents(c)},()=>this._afterEase(c),n),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(n,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let d=this._onEaseEnd;delete this._onEaseEnd,d.call(this,c)}if(!n){let d=this.handlers;d&&d.stop(!1)}return this}_ease(n,c,d){d.animate===!1||d.duration===0?(n(1),c()):(this._easeStart=o.exported.now(),this._easeOptions=d,this._onEaseFrame=n,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let n=Math.min((o.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(n,c){n=o.wrap(n,-180,180);let d=Math.abs(n-c);return Math.abs(n-360-c)<d&&(n-=360),Math.abs(n+360-c)<d&&(n+=360),n}_normalizeCenter(n){let c=this.transform;if(!c.renderWorldCopies||c.lngRange)return;let d=n.lng-c.center.lng;n.lng+=d>180?-360:d<-180?360:0}}class Su{constructor(n={}){this.options=n,o.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(n){return this._map=n,this._compact=this.options&&this.options.compact,this._container=A.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=A.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=A.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){A.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(n,c){let d=this._map._getUIString(`AttributionControl.${c}`);n.title=d,n.setAttribute("aria-label",d)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(n){!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let n=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?n=n.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&n.push(this.options.customAttribution)),this._map.style.stylesheet){let g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}let c=this._map.style.sourceCaches;for(let g in c){let _=c[g];if(_.used){let I=_.getSource();I.attribution&&n.indexOf(I.attribution)<0&&n.push(I.attribution)}}n=n.filter(g=>String(g).trim()),n.sort((g,_)=>g.length-_.length),n=n.filter((g,_)=>{for(let I=_+1;I<n.length;I++)if(n[I].indexOf(g)>=0)return!1;return!0});let d=n.join(" | ");d!==this._attribHTML&&(this._attribHTML=d,n.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class bh{constructor(n={}){this.options=n,o.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(n){this._map=n,this._compact=this.options&&this.options.compact,this._container=A.create("div","maplibregl-ctrl mapboxgl-ctrl");let c=A.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://maplibre.org/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){A.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){let n=this._container.children;if(n.length){let c=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&c.classList.add("maplibregl-compact","mapboxgl-compact"):c.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class Rp{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(n){let c=++this._id;return this._queue.push({callback:n,id:c,cancelled:!1}),c}remove(n){let c=this._currentlyRunning,d=c?this._queue.concat(c):this._queue;for(let g of d)if(g.id===n)return void(g.cancelled=!0)}run(n=0){let c=this._currentlyRunning=this._queue;this._queue=[];for(let d of c)if(!d.cancelled&&(d.callback(n),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let Dp={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},o0={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},xo={showCompass:!0,showZoom:!0,visualizePitch:!1};class Cu{constructor(n,c,d=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new dt({clickTolerance:n.dragRotate._mouseRotate._clickTolerance}),this.map=n,d&&(this.mousePitch=new fh({clickTolerance:n.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),A.addEventListener(c,"mousedown",this.mousedown),A.addEventListener(c,"touchstart",this.touchstart,{passive:!1}),A.addEventListener(c,"touchmove",this.touchmove),A.addEventListener(c,"touchend",this.touchend),A.addEventListener(c,"touchcancel",this.reset)}down(n,c){this.mouseRotate.mousedown(n,c),this.mousePitch&&this.mousePitch.mousedown(n,c),A.disableDrag()}move(n,c){let d=this.map,g=this.mouseRotate.mousemoveWindow(n,c);if(g&&g.bearingDelta&&d.setBearing(d.getBearing()+g.bearingDelta),this.mousePitch){let _=this.mousePitch.mousemoveWindow(n,c);_&&_.pitchDelta&&d.setPitch(d.getPitch()+_.pitchDelta)}}off(){let n=this.element;A.removeEventListener(n,"mousedown",this.mousedown),A.removeEventListener(n,"touchstart",this.touchstart,{passive:!1}),A.removeEventListener(n,"touchmove",this.touchmove),A.removeEventListener(n,"touchend",this.touchend),A.removeEventListener(n,"touchcancel",this.reset),this.offTemp()}offTemp(){A.enableDrag(),A.removeEventListener(window,"mousemove",this.mousemove),A.removeEventListener(window,"mouseup",this.mouseup)}mousedown(n){this.down(o.extend({},n,{ctrlKey:!0,preventDefault:()=>n.preventDefault()}),A.mousePos(this.element,n)),A.addEventListener(window,"mousemove",this.mousemove),A.addEventListener(window,"mouseup",this.mouseup)}mousemove(n){this.move(n,A.mousePos(this.element,n))}mouseup(n){this.mouseRotate.mouseupWindow(n),this.mousePitch&&this.mousePitch.mouseupWindow(n),this.offTemp()}touchstart(n){n.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=A.touchPos(this.element,n.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>n.preventDefault()},this._startPos))}touchmove(n){n.targetTouches.length!==1?this.reset():(this._lastPos=A.touchPos(this.element,n.targetTouches)[0],this.move({preventDefault:()=>n.preventDefault()},this._lastPos))}touchend(n){n.targetTouches.length===0&&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()}}function vt(f,n,c){if(f=new o.LngLat(f.lng,f.lat),n){let d=new o.LngLat(f.lng-360,f.lat),g=new o.LngLat(f.lng+360,f.lat),_=c.locationPoint(f).distSqr(n);c.locationPoint(d).distSqr(n)<_?f=d:c.locationPoint(g).distSqr(n)<_&&(f=g)}for(;Math.abs(f.lng-c.center.lng)>180;){let d=c.locationPoint(f);if(d.x>=0&&d.y>=0&&d.x<=c.width&&d.y<=c.height)break;f.lng>c.center.lng?f.lng-=360:f.lng+=360}return f}let Mt={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%)"};function ml(f,n,c){let d=f.classList;for(let g in Mt)d.remove(`maplibregl-${c}-anchor-${g}`,`mapboxgl-${c}-anchor-${g}`);d.add(`maplibregl-${c}-anchor-${n}`,`mapboxgl-${c}-anchor-${n}`)}class gl extends o.Evented{constructor(n,c){if(super(),(n instanceof HTMLElement||c)&&(n=o.extend({element:n},c)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=o.pointGeometry.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=A.create("div"),this._element.setAttribute("aria-label","Map marker");let d=A.createNS("http://www.w3.org/2000/svg","svg"),g=41,_=27;d.setAttributeNS(null,"display","block"),d.setAttributeNS(null,"height",`${g}px`),d.setAttributeNS(null,"width",`${_}px`),d.setAttributeNS(null,"viewBox",`0 0 ${_} ${g}`);let I=A.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"stroke","none"),I.setAttributeNS(null,"stroke-width","1"),I.setAttributeNS(null,"fill","none"),I.setAttributeNS(null,"fill-rule","evenodd");let M=A.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"fill-rule","nonzero");let E=A.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"transform","translate(3.0, 29.0)"),E.setAttributeNS(null,"fill","#000000");let k=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let we of k){let xe=A.createNS("http://www.w3.org/2000/svg","ellipse");xe.setAttributeNS(null,"opacity","0.04"),xe.setAttributeNS(null,"cx","10.5"),xe.setAttributeNS(null,"cy","5.80029008"),xe.setAttributeNS(null,"rx",we.rx),xe.setAttributeNS(null,"ry",we.ry),E.appendChild(xe)}let D=A.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"fill",this._color);let O=A.createNS("http://www.w3.org/2000/svg","path");O.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),D.appendChild(O);let X=A.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"opacity","0.25"),X.setAttributeNS(null,"fill","#000000");let oe=A.createNS("http://www.w3.org/2000/svg","path");oe.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),X.appendChild(oe);let $=A.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"transform","translate(6.0, 7.0)"),$.setAttributeNS(null,"fill","#FFFFFF");let ne=A.createNS("http://www.w3.org/2000/svg","g");ne.setAttributeNS(null,"transform","translate(8.0, 8.0)");let me=A.createNS("http://www.w3.org/2000/svg","circle");me.setAttributeNS(null,"fill","#000000"),me.setAttributeNS(null,"opacity","0.25"),me.setAttributeNS(null,"cx","5.5"),me.setAttributeNS(null,"cy","5.5"),me.setAttributeNS(null,"r","5.4999962");let ge=A.createNS("http://www.w3.org/2000/svg","circle");ge.setAttributeNS(null,"fill","#FFFFFF"),ge.setAttributeNS(null,"cx","5.5"),ge.setAttributeNS(null,"cy","5.5"),ge.setAttributeNS(null,"r","5.4999962"),ne.appendChild(me),ne.appendChild(ge),M.appendChild(E),M.appendChild(D),M.appendChild(X),M.appendChild($),M.appendChild(ne),d.appendChild(M),d.setAttributeNS(null,"height",g*this._scale+"px"),d.setAttributeNS(null,"width",_*this._scale+"px"),this._element.appendChild(d),this._offset=o.pointGeometry.convert(n&&n.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()}),ml(this._element,this._anchor,"marker"),this._popup=null}addTo(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),A.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(n){return this._lngLat=o.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){let g=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(n){let c=n.code,d=n.charCode||n.keyCode;c!=="Space"&&c!=="Enter"&&d!==32&&d!==13||this.togglePopup()}_onMapClick(n){let c=n.originalEvent.target,d=this._element;this._popup&&(c===d||d.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this}_update(n){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=vt(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let d="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?d="rotateX(0deg)":this._pitchAlignment==="map"&&(d=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),A.setTransform(this._element,`${Mt[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${d} ${c}`)}getOffset(){return this._offset}setOffset(n){return this._offset=o.pointGeometry.convert(n),this._update(),this}_onMove(n){if(!this._isDragging){let c=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=c}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.Event("dragstart"))),this.fire(new o.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.Event("dragend")),this._state="inactive"}_addDragHandler(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(n){return this._rotation=n||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(n){return this._rotationAlignment=n||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}let wh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Er,Ms=0,fn=!1,s0={maxWidth:100,unit:"metric"};function yl(f,n,c){let d=c&&c.maxWidth||100,g=f._container.clientHeight/2,_=f.unproject([0,g]),I=f.unproject([d,g]),M=_.distanceTo(I);if(c&&c.unit==="imperial"){let E=3.2808*M;E>5280?Oi(n,d,E/5280,f._getUIString("ScaleControl.Miles")):Oi(n,d,E,f._getUIString("ScaleControl.Feet"))}else c&&c.unit==="nautical"?Oi(n,d,M/1852,f._getUIString("ScaleControl.NauticalMiles")):M>=1e3?Oi(n,d,M/1e3,f._getUIString("ScaleControl.Kilometers")):Oi(n,d,M,f._getUIString("ScaleControl.Meters"))}function Oi(f,n,c,d){let g=function(_){let I=Math.pow(10,`${Math.floor(_)}`.length-1),M=_/I;return M=M>=10?10:M>=5?5:M>=3?3:M>=2?2:M>=1?1:function(E){let k=Math.pow(10,Math.ceil(-Math.log(E)/Math.LN10));return Math.round(E*k)/k}(M),I*M}(c);f.style.width=n*(g/c)+"px",f.innerHTML=`${g}&nbsp;${d}`}let Ar={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Bp=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function va(f){if(f){if(typeof f=="number"){let n=Math.round(Math.sqrt(.5*Math.pow(f,2)));return{center:new o.pointGeometry(0,0),top:new o.pointGeometry(0,f),"top-left":new o.pointGeometry(n,n),"top-right":new o.pointGeometry(-n,n),bottom:new o.pointGeometry(0,-f),"bottom-left":new o.pointGeometry(n,-n),"bottom-right":new o.pointGeometry(-n,-n),left:new o.pointGeometry(f,0),right:new o.pointGeometry(-f,0)}}if(f instanceof o.pointGeometry||Array.isArray(f)){let n=o.pointGeometry.convert(f);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:o.pointGeometry.convert(f.center||[0,0]),top:o.pointGeometry.convert(f.top||[0,0]),"top-left":o.pointGeometry.convert(f["top-left"]||[0,0]),"top-right":o.pointGeometry.convert(f["top-right"]||[0,0]),bottom:o.pointGeometry.convert(f.bottom||[0,0]),"bottom-left":o.pointGeometry.convert(f["bottom-left"]||[0,0]),"bottom-right":o.pointGeometry.convert(f["bottom-right"]||[0,0]),left:o.pointGeometry.convert(f.left||[0,0]),right:o.pointGeometry.convert(f.right||[0,0])}}return va(new o.pointGeometry(0,0))}let vl={supported:m,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends Iu{constructor(f){var n;if(o.PerformanceUtils.mark(o.PerformanceMarkers.create),(f=o.extend({},o0,f)).minZoom!=null&&f.maxZoom!=null&&f.minZoom>f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(f.minPitch!=null&&f.maxPitch!=null&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(f.minPitch!=null&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(f.maxPitch!=null&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ll(f.minZoom,f.maxZoom,f.minPitch,f.maxPitch,f.renderWorldCopies),{bearingSnap:f.bearingSnap}),this._interactive=f.interactive,this._maxTileCacheSize=f.maxTileCacheSize,this._failIfMajorPerformanceCaveat=f.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=f.preserveDrawingBuffer,this._antialias=f.antialias,this._trackResize=f.trackResize,this._bearingSnap=f.bearingSnap,this._refreshExpiredTiles=f.refreshExpiredTiles,this._fadeDuration=f.fadeDuration,this._crossSourceCollisions=f.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=f.collectResourceTiming,this._renderTaskQueue=new Rp,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},Dp,f.locale),this._clickTolerance=f.clickTolerance,this._pixelRatio=(n=f.pixelRatio)!==null&&n!==void 0?n:devicePixelRatio,this._requestManager=new B(f.transformRequest),typeof f.container=="string"){if(this._container=document.getElementById(f.container),!this._container)throw new Error(`Container '${f.container}' not found.`)}else{if(!(f.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(f.maxBounds&&this.setMaxBounds(f.maxBounds),o.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Zn(this,f),this._hash=f.hash&&new Ip(typeof f.hash=="string"&&f.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch}),f.bounds&&(this.resize(),this.fitBounds(f.bounds,o.extend({},f.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=f.localIdeographFontFamily,f.style&&this.setStyle(f.style,{localIdeographFontFamily:f.localIdeographFontFamily}),f.attributionControl&&this.addControl(new Su({customAttribution:f.customAttribution})),f.maplibreLogo&&this.addControl(new bh,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",c=>{this._update(c.dataType==="style"),this.fire(new o.Event(`${c.dataType}data`,c))}),this.on("dataloading",c=>{this.fire(new o.Event(`${c.dataType}dataloading`,c))}),this.on("dataabort",c=>{this.fire(new o.Event("sourcedataabort",c))})}_getMapId(){return this._mapId}addControl(f,n){if(n===void 0&&(n=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let c=f.onAdd(this);this._controls.push(f);let d=this._controlPositions[n];return n.indexOf("bottom")!==-1?d.insertBefore(c,d.firstChild):d.appendChild(c),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let n=this._controls.indexOf(f);return n>-1&&this._controls.splice(n,1),f.onRemove(this),this}hasControl(f){return this._controls.indexOf(f)>-1}resize(f){let n=this._containerDimensions(),c=n[0],d=n[1];this._resizeCanvas(c,d,this.getPixelRatio()),this.transform.resize(c,d),this.painter.resize(c,d,this.getPixelRatio());let g=!this._moving;return g&&(this.stop(),this.fire(new o.Event("movestart",f)).fire(new o.Event("move",f))),this.fire(new o.Event("resize",f)),g&&this.fire(new o.Event("moveend",f)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(f){let[n,c]=this._containerDimensions();this._pixelRatio=f,this._resizeCanvas(n,c,f),this.painter.resize(n,c,f)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(f){return this.transform.setMaxBounds(o.LngLatBounds.convert(f)),this._update()}setMinZoom(f){if((f=f??-2)>=-2&&f<=this.transform.maxZoom)return this.transform.minZoom=f,this._update(),this.getZoom()<f&&this.setZoom(f),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(f){if((f=f??22)>=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f&&this.setZoom(f),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(f){if((f=f??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(f>=0&&f<=this.transform.maxPitch)return this.transform.minPitch=f,this._update(),this.getPitch()<f&&this.setPitch(f),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(f){if((f=f??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(f>=this.transform.minPitch)return this.transform.maxPitch=f,this._update(),this.getPitch()>f&&this.setPitch(f),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(f){return this.transform.renderWorldCopies=f,this._update()}project(f){return this.transform.locationPoint(o.LngLat.convert(f))}unproject(f){return this.transform.pointLocation(o.pointGeometry.convert(f))}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(f,n,c){if(f==="mouseenter"||f==="mouseover"){let d=!1;return{layer:n,listener:c,delegates:{mousemove:_=>{let I=this.getLayer(n)?this.queryRenderedFeatures(_.point,{layers:[n]}):[];I.length?d||(d=!0,c.call(this,new Mn(f,this,_.originalEvent,{features:I}))):d=!1},mouseout:()=>{d=!1}}}}if(f==="mouseleave"||f==="mouseout"){let d=!1;return{layer:n,listener:c,delegates:{mousemove:I=>{(this.getLayer(n)?this.queryRenderedFeatures(I.point,{layers:[n]}):[]).length?d=!0:d&&(d=!1,c.call(this,new Mn(f,this,I.originalEvent)))},mouseout:I=>{d&&(d=!1,c.call(this,new Mn(f,this,I.originalEvent)))}}}}{let d=g=>{let _=this.getLayer(n)?this.queryRenderedFeatures(g.point,{layers:[n]}):[];_.length&&(g.features=_,c.call(this,g),delete g.features)};return{layer:n,listener:c,delegates:{[f]:d}}}}on(f,n,c){if(c===void 0)return super.on(f,n);let d=this._createDelegatedListener(f,n,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(d);for(let g in d.delegates)this.on(g,d.delegates[g]);return this}once(f,n,c){if(c===void 0)return super.once(f,n);let d=this._createDelegatedListener(f,n,c);for(let g in d.delegates)this.once(g,d.delegates[g]);return this}off(f,n,c){return c===void 0?super.off(f,n):(this._delegatedListeners&&this._delegatedListeners[f]&&(d=>{let g=this._delegatedListeners[f];for(let _=0;_<g.length;_++){let I=g[_];if(I.layer===n&&I.listener===c){for(let M in I.delegates)this.off(M,I.delegates[M]);return g.splice(_,1),this}}})(),this)}queryRenderedFeatures(f,n){if(!this.style)return[];let c;if(n!==void 0||f===void 0||f instanceof o.pointGeometry||Array.isArray(f)||(n=f,f=void 0),n=n||{},(f=f||[[0,0],[this.transform.width,this.transform.height]])instanceof o.pointGeometry||typeof f[0]=="number")c=[o.pointGeometry.convert(f)];else{let d=o.pointGeometry.convert(f[0]),g=o.pointGeometry.convert(f[1]);c=[d,new o.pointGeometry(g.x,d.y),g,new o.pointGeometry(d.x,g.y),d]}return this.style.queryRenderedFeatures(c,n,this.transform)}querySourceFeatures(f,n){return this.style.querySourceFeatures(f,n)}setStyle(f,n){return(n=o.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},n)).diff!==!1&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&f?(this._diffStyle(f,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(f,n))}setTransformRequest(f){return this._requestManager.setTransformRequest(f),this}_getUIString(f){let n=this._locale[f];if(n==null)throw new Error(`Missing UI string '${f}'`);return n}_updateStyle(f,n){return this.style&&(this.style.setEventedParent(null),this.style._remove()),f?(this.style=new Nr(this,n||{}),this.style.setEventedParent(this,{style:this.style}),typeof f=="string"?this.style.loadURL(f):this.style.loadJSON(f),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Nr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(f,n){if(typeof f=="string"){let c=this._requestManager.transformRequest(f,o.ResourceType.Style);o.getJSON(c,(d,g)=>{d?this.fire(new o.ErrorEvent(d)):g&&this._updateDiff(g,n)})}else typeof f=="object"&&this._updateDiff(f,n)}_updateDiff(f,n){try{this.style.setState(f)&&this._update(!0)}catch(c){o.warnOnce(`Unable to perform style diff: ${c.message||c.error||c}. Rebuilding the style from scratch.`),this._updateStyle(f,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.warnOnce("There is no style added to the map.")}addSource(f,n){return this._lazyInitEmptyStyle(),this.style.addSource(f,n),this._update(!0)}isSourceLoaded(f){let n=this.style&&this.style.sourceCaches[f];if(n!==void 0)return n.loaded();this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${f}'`)))}areTilesLoaded(){let f=this.style&&this.style.sourceCaches;for(let n in f){let c=f[n]._tiles;for(let d in c){let g=c[d];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}addSourceType(f,n,c){return this._lazyInitEmptyStyle(),this.style.addSourceType(f,n,c)}removeSource(f){return this.style.removeSource(f),this._update(!0)}getSource(f){return this.style.getSource(f)}addImage(f,n,{pixelRatio:c=1,sdf:d=!1,stretchX:g,stretchY:_,content:I}={}){if(this._lazyInitEmptyStyle(),n instanceof HTMLImageElement||o.isImageBitmap(n)){let{width:M,height:E,data:k}=o.exported.getImageData(n);this.style.addImage(f,{data:new o.RGBAImage({width:M,height:E},k),pixelRatio:c,stretchX:g,stretchY:_,content:I,sdf:d,version:0})}else{if(n.width===void 0||n.height===void 0)return this.fire(new o.ErrorEvent(new 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`")));{let{width:M,height:E,data:k}=n,D=n;this.style.addImage(f,{data:new o.RGBAImage({width:M,height:E},new Uint8Array(k)),pixelRatio:c,stretchX:g,stretchY:_,content:I,sdf:d,version:0,userImage:D}),D.onAdd&&D.onAdd(this,f)}}}updateImage(f,n){let c=this.style.getImage(f);if(!c)return this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let d=n instanceof HTMLImageElement||o.isImageBitmap(n)?o.exported.getImageData(n):n,{width:g,height:_,data:I}=d;if(g===void 0||_===void 0)return this.fire(new o.ErrorEvent(new 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(g!==c.data.width||_!==c.data.height)return this.fire(new o.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));let M=!(n instanceof HTMLImageElement||o.isImageBitmap(n));c.data.replace(I,M),this.style.updateImage(f,c)}hasImage(f){return f?!!this.style.getImage(f):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(f)}loadImage(f,n){o.getImage(this._requestManager.transformRequest(f,o.ResourceType.Image),n)}listImages(){return this.style.listImages()}addLayer(f,n){return this._lazyInitEmptyStyle(),this.style.addLayer(f,n),this._update(!0)}moveLayer(f,n){return this.style.moveLayer(f,n),this._update(!0)}removeLayer(f){return this.style.removeLayer(f),this._update(!0)}getLayer(f){return this.style.getLayer(f)}setLayerZoomRange(f,n,c){return this.style.setLayerZoomRange(f,n,c),this._update(!0)}setFilter(f,n,c={}){return this.style.setFilter(f,n,c),this._update(!0)}getFilter(f){return this.style.getFilter(f)}setPaintProperty(f,n,c,d={}){return this.style.setPaintProperty(f,n,c,d),this._update(!0)}getPaintProperty(f,n){return this.style.getPaintProperty(f,n)}setLayoutProperty(f,n,c,d={}){return this.style.setLayoutProperty(f,n,c,d),this._update(!0)}getLayoutProperty(f,n){return this.style.getLayoutProperty(f,n)}setLight(f,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(f,n),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(f,n){return this.style.setFeatureState(f,n),this._update()}removeFeatureState(f,n){return this.style.removeFeatureState(f,n),this._update()}getFeatureState(f){return this.style.getFeatureState(f)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let f=0,n=0;return this._container&&(f=this._container.clientWidth||400,n=this._container.clientHeight||300),[f,n]}_setupContainer(){let f=this._container;f.classList.add("maplibregl-map","mapboxgl-map");let n=this._canvasContainer=A.create("div","maplibregl-canvas-container mapboxgl-canvas-container",f);this._interactive&&n.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=A.create("canvas","maplibregl-canvas mapboxgl-canvas",n),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let c=this._containerDimensions();this._resizeCanvas(c[0],c[1],this.getPixelRatio());let d=this._controlContainer=A.create("div","maplibregl-control-container mapboxgl-control-container",f),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_=>{g[_]=A.create("div",`maplibregl-ctrl-${_} mapboxgl-ctrl-${_}`,d)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(f,n,c){this._canvas.width=c*f,this._canvas.height=c*n,this._canvas.style.width=`${f}px`,this._canvas.style.height=`${n}px`}_setupPainter(){let f=o.extend({},m.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",f)||this._canvas.getContext("experimental-webgl",f);n?(this.painter=new dh(n,this.transform),o.exported$1.testSupport(n)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(f){f.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:f}))}_contextRestored(f){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:f}))}_onMapScroll(f){if(f.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(f){return this.style?(this._styleDirty=this._styleDirty||f,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(f){return this._update(),this._renderTaskQueue.add(f)}_cancelRenderFrame(f){this._renderTaskQueue.remove(f)}_render(f){let n,c=0,d=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(n=d.createQueryEXT(),d.beginQueryEXT(d.TIME_ELAPSED_EXT,n),c=o.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(f),this._removed)return;let g=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let I=this.transform.zoom,M=o.exported.now();this.style.zoomHistory.update(I,M);let E=new o.EvaluationParameters(I,{now:M,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),k=E.crossFadingFactor();k===1&&k===this._crossFadingFactor||(g=!0,this._crossFadingFactor=k),this.style.update(E)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.load),this.fire(new o.Event("load"))),this.style&&(this.style.hasTransitions()||g)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){let I=o.exported.now()-c;d.endQueryEXT(d.TIME_ELAPSED_EXT,n),setTimeout(()=>{let M=d.getQueryObjectEXT(n,d.QUERY_RESULT_EXT)/1e6;d.deleteQueryEXT(n),this.fire(new o.Event("gpu-timing-frame",{cpuTime:I,gpuTime:M}))},50)}if(this.listens("gpu-timing-layer")){let I=this.painter.collectGpuTimers();setTimeout(()=>{let M=this.painter.queryGpuTimers(I);this.fire(new o.Event("gpu-timing-layer",{layerTimes:M}))},50)}let _=this._sourcesDirty||this._styleDirty||this._placementDirty;return _||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||_||(this._fullyLoaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));let f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),A.remove(this._canvasContainer),A.remove(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),o.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new o.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=o.exported.frame(f=>{o.PerformanceUtils.frame(f),this._frame=null,this._render(f)}))}_onWindowOnline(){this._update()}_onWindowResize(f){this._trackResize&&this.resize({originalEvent:f})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(f){this._showTileBoundaries!==f&&(this._showTileBoundaries=f,this._update())}get showPadding(){return!!this._showPadding}set showPadding(f){this._showPadding!==f&&(this._showPadding=f,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(f){this._showCollisionBoxes!==f&&(this._showCollisionBoxes=f,f?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(f){this._showOverdrawInspector!==f&&(this._showOverdrawInspector=f,this._update())}get repaint(){return!!this._repaint}set repaint(f){this._repaint!==f&&(this._repaint=f,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(f){this._vertices=f,this._update()}_setCacheLimits(f,n){o.setCacheLimits(f,n)}},NavigationControl:class{constructor(f){this.options=o.extend({},xo,f),this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",n=>n.preventDefault()),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",n=>this._map.zoomIn({},{originalEvent:n})),A.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",n=>this._map.zoomOut({},{originalEvent:n})),A.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",n=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:n}):this._map.resetNorth({},{originalEvent:n})}),this._compassIcon=A.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let f=this._map.getZoom(),n=f===this._map.getMaxZoom(),c=f===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=c,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",c.toString())}_rotateCompassArrow(){let f=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=f}onAdd(f){return this._map=f,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Cu(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){A.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(f,n){let c=A.create("button",f,this._container);return c.type="button",c.addEventListener("click",n),c}_setButtonTitle(f,n){let c=this._map._getUIString(`NavigationControl.${n}`);f.title=c,f.setAttribute("aria-label",c)}},GeolocateControl:class extends o.Evented{constructor(f){super(),this.options=o.extend({},wh,f),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(f){var n;return this._map=f,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,Er!==void 0?n(Er):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(c=>{Er=c.state!=="denied",n(Er)}):(Er=!!window.navigator.geolocation,n(Er)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),A.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ms=0,fn=!1}_isOutOfMapMaxBounds(f){let n=this._map.getMaxBounds(),c=f.coords;return n&&(c.longitude<n.getWest()||c.longitude>n.getEast()||c.latitude<n.getSouth()||c.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(f){if(this._map){if(this._isOutOfMapMaxBounds(f))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",f)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=f,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(f),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(f),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",f)),this._finish()}}_updateCamera(f){let n=new o.LngLat(f.coords.longitude,f.coords.latitude),c=f.coords.accuracy,d=this._map.getBearing(),g=o.extend({bearing:d},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(c),g,{geolocateSource:!0})}_updateMarker(f){if(f){let n=new o.LngLat(f.coords.longitude,f.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=f.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let f=this._map._container.clientHeight/2,n=this._map.unproject([0,f]),c=this._map.unproject([1,f]),d=n.distanceTo(c),g=Math.ceil(2*this._accuracy/d);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(f){if(this._map){if(this.options.trackUserLocation)if(f.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(f.code===3&&fn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("error",f)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(f){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=A.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),A.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",f===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{let n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=A.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new gl(this._dotElement),this._circleElement=A.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new gl({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",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new o.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return o.warnOnce("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 o.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ms--,fn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new o.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let f;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ms++,Ms>1?(f={maximumAge:6e5,timeout:0},fn=!0):(f=this.options.positionOptions,fn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,f)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Su,LogoControl:bh,ScaleControl:class{constructor(f){this.options=o.extend({},s0,f),o.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){yl(this._map,this._container,this.options)}onAdd(f){return this._map=f,this._container=A.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",f.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){A.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(f){this.options.unit=f,yl(this._map,this._container,this.options)}},FullscreenControl:class{constructor(f){this._fullscreen=!1,f&&f.container&&(f.container instanceof HTMLElement?this._container=f.container:o.warnOnce("Full screen control 'container' must be a DOM element.")),o.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=A.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){A.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){let f=this._fullscreenButton=A.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);A.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){let f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.title=f}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends o.Evented{constructor(f){super(),this.options=o.extend(Object.create(Ar),f),o.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(f){return this._map&&this.remove(),this._map=f,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new o.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&A.remove(this._content),this._container&&(A.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new o.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(f){return this._lngLat=o.LngLat.convert(f),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(f){return this.setDOMContent(document.createTextNode(f))}setHTML(f){let n=document.createDocumentFragment(),c=document.createElement("body"),d;for(c.innerHTML=f;d=c.firstChild,d;)n.appendChild(d);return this.setDOMContent(n)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=A.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(f),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(f){this._container&&this._container.classList.add(f)}removeClassName(f){this._container&&this._container.classList.remove(f)}setOffset(f){return this.options.offset=f,this._update(),this}toggleClassName(f){if(this._container)return this._container.classList.toggle(f)}_createCloseButton(){this.options.closeButton&&(this._closeButton=A.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(f){this._update(f.point)}_onMouseMove(f){this._update(f.point)}_onDrag(f){this._update(f.point)}_update(f){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=A.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=A.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(_=>this._container.classList.add(_)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=vt(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!f))return;let n=this._pos=this._trackPointer&&f?f:this._map.project(this._lngLat),c=this.options.anchor,d=va(this.options.offset);if(!c){let _=this._container.offsetWidth,I=this._container.offsetHeight,M;M=n.y+d.bottom.y<I?["top"]:n.y>this._map.transform.height-I?["bottom"]:[],n.x<_/2?M.push("left"):n.x>this._map.transform.width-_/2&&M.push("right"),c=M.length===0?"bottom":M.join("-")}let g=n.add(d[c]).round();A.setTransform(this._container,`${Mt[c]} translate(${g.x}px,${g.y}px)`),ml(this._container,c,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let f=this._container.querySelector(Bp);f&&f.focus()}_onClose(){this.remove()}},Marker:gl,Style:Nr,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.pointGeometry,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,AJAXError:o.AJAXError,config:o.config,CanvasSource:_i,GeoJSONSource:ur,ImageSource:si,RasterDEMTileSource:jt,RasterTileSource:zi,VectorTileSource:Zt,VideoSource:ti,prewarm:function(){V().acquire(rn)},clearPrewarmedResources:function(){let f=_e;f&&(f.isPreloaded()&&f.numActive()===1?(f.release(rn),_e=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()"))},get workerCount(){return zr.workerCount},set workerCount(f){zr.workerCount=f},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){o.config.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage(f){o.clearTileCache(f)},workerUrl:"",addProtocol(f,n){o.config.REGISTERED_PROTOCOLS[f]=n},removeProtocol(f){delete o.config.REGISTERED_PROTOCOLS[f]}};return Vi.extend(vl,{isSafari:o.isSafari,getPerformanceMetrics:o.PerformanceUtils.getPerformanceMetrics}),vl});var u=r;return u})});var Gg=Nt(Pr(),1),RA=Nt(NI(),1);var iM=Nt(Pr(),1);function Ol(e){var t=new Error(e);return t.source="ulid",t}var Tm="0123456789ABCDEFGHJKMNPQRSTVWXYZ",mc=Tm.length,h1=Math.pow(2,48)-1,d1=10,OI=16;function ZP(e){var t=Math.floor(e()*mc);return t===mc&&(t=mc-1),Tm.charAt(t)}function jP(e,t){if(isNaN(e))throw new Error(e+" must be a number");if(e>h1)throw Ol("cannot encode time greater than "+h1);if(e<0)throw Ol("time must be positive");if(Number.isInteger(e)===!1)throw Ol("time must be an integer");for(var r=void 0,l="";t>0;t--)r=e%mc,l=Tm.charAt(r)+l,e=(e-r)/mc;return l}function HP(e,t){for(var r="";e>0;e--)r=ZP(t)+r;return r}function GI(e){if(e.length!==d1+OI)throw Ol("malformed ulid");var t=e.substr(0,d1).split("").reverse().reduce(function(r,l,u){var o=Tm.indexOf(l);if(o===-1)throw Ol("invalid character found: "+l);return r+=o*Math.pow(mc,u)},0);if(t>h1)throw Ol("malformed ulid, timestamp too large");return t}function XP(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments[1];t||(t=typeof window<"u"?window:null);var r=t&&(t.crypto||t.msCrypto);if(r)return function(){var u=new Uint8Array(1);return r.getRandomValues(u),u[0]/255};try{var l=FI();return function(){return l.randomBytes(1).readUInt8()/255}}catch{}if(e){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw Ol("secure crypto unusable, insecure Math.random not allowed")}function $P(e){return e||(e=XP()),function(r){return isNaN(r)&&(r=Date.now()),jP(r,d1)+HP(OI,e)}}var VI=$P();var UI=()=>typeof localStorage<"u",WI=24*60*60*1e3,YP=30*WI,yB=91*WI;function Ld(){let e="c"+VI().toLowerCase();return UI()&&localStorage.setItem("api-key",e),e}function ZI(){if(!UI())return Ld();let e=localStorage.getItem("api-key");if(e==null||!e.startsWith("c"))return Ld();try{let t=GI(e.slice(1).toUpperCase());return Date.now()-YP<t?e:Ld()}catch{return Ld()}}var Sr=class{constructor(t,r,l,u){this.x=t,this.y=r,this.width=l,this.height=u}get bottom(){return this.y+this.height}get right(){return this.x+this.width}intersects(t){return this.x<t.right&&t.x<this.right&&this.y<t.bottom&&t.y<this.bottom}containsBounds(t){return Sr.contains(this,t)}intersection(t){let r=Math.max(this.x,t.x),l=Math.min(this.x+this.width,t.x+t.width),u=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return l>r&&o>u?new Sr(r,u,l-r,o-u):null}static union(t){if(t.length===0)throw new Error("Union on empty list is not allowed");let{x:r,y:l}=t[0],u=r+t[0].width,o=l+t[0].height;for(let m=1;m<t.length;++m){let v=t[m];r=Math.min(r,v.x),u=Math.max(u,v.x+v.width),l=Math.min(l,v.y),o=Math.max(o,v.y+v.height)}return new Sr(r,l,u-r,o-l)}union(t){return Sr.union([this,t])}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toBbox(){return[this.x,this.y,this.right,this.bottom]}toPolygon(){return[[[this.x,this.y],[this.x,this.bottom],[this.right,this.bottom],[this.right,this.y],[this.x,this.y]]]}scale(t,r=t){return new Sr(this.x*t,this.y*r,this.width*t,this.height*r)}scaleFromCenter(t,r=t){let l=this.width*t,u=this.height*r;return new Sr(this.x-.5*(l-this.width),this.y-.5*(u-this.height),l,u)}pad(t,r=t){return new Sr(this.x-t,this.y-r,this.width+t*2,this.height+r*2)}round(t=0){let r=Math.round(this.x-t),l=Math.round(this.y-t);return new Sr(r,l,Math.round(this.right+t)-r,Math.round(this.bottom+t)-l)}add(t){return new Sr(this.x+t.x,this.y+t.y,this.width,this.height)}subtract(t){return new Sr(this.x-t.x,this.y-t.y,this.width,this.height)}static fromMultiPolygon(t){if(t.length===0)return new Sr(0,0,0,0);let r=t[0][0][0][0],l=t[0][0][0][1],u=r,o=l;for(let[m]of t)for(let[v,b]of m)v<r?r=v:v>u&&(u=v),b<l?l=b:b>o&&(o=b);return new Sr(r,l,u-r,o-l)}static fromBbox([t,r,l,u]){return new Sr(Math.min(t,l),Math.min(r,u),Math.abs(l-t),Math.abs(u-r))}static fromUpperLeftLowerRight(t,r){return new Sr(t.x,t.y,r.x-t.x,r.y-t.y)}static fromJson(t){return new Sr(t.x,t.y,t.width,t.height)}static compareArea(t,r){let l=t.width*t.height-r.width*r.height;if(l!==0)return l;let u=t.x-r.x;return u===0?t.y-r.y:u}static contains(t,r){return t.x<=r.x&&t.x+t.width>=r.x+r.width&&t.y<=r.y&&t.y+t.height>=r.y+r.height}};var fi;(function(e){e[e.Google=3857]="Google",e[e.Wgs84=4326]="Wgs84",e[e.Nztm2000=2193]="Nztm2000",e[e.Citm2000=3793]="Citm2000"})(fi||(fi={}));var p1={google:fi.Google,epsg3857:fi.Google,[fi.Google]:fi.Google,globalmercator:fi.Google,wgs84:fi.Wgs84,epsg4326:fi.Wgs84,[fi.Wgs84]:fi.Wgs84,nztm:fi.Nztm2000,epsg2193:fi.Nztm2000,[fi.Nztm2000]:fi.Nztm2000,nztm2000:fi.Nztm2000,citm:fi.Citm2000,epsg3793:fi.Citm2000,[fi.Citm2000]:fi.Citm2000,citm2000:fi.Citm2000},oi=class{constructor(t){if(this.code=t,oi.Codes.has(t))throw new Error(`Duplicate EPSG code created: ${t}`);oi.Codes.set(this.code,this)}toString(){return this.code.toString()}toJSON(){return this.code}toEpsgString(){return`EPSG:${this.code}`}toUrn(){return`urn:ogc:def:crs:EPSG::${this.code}`}static get(t){let r=oi.Codes.get(t);if(r==null)throw new Error(`Invalid EPSG:${t}`);return r}static tryGet(t){if(t!=null)return oi.Codes.get(t)}static parseCode(t){var r;return t.startsWith("urn:")?p1[t.slice(t.lastIndexOf(":")+1)]:t.startsWith("https://")?p1[t.slice(t.lastIndexOf("/")+1)]:(r=p1[t.replace(/[\W_]/g,"").toLowerCase()])!==null&&r!==void 0?r:null}static parse(t){let r=oi.parseCode(t);return r==null?null:oi.get(r)}};oi.Codes=new Map;oi.Google=new oi(fi.Google);oi.Wgs84=new oi(fi.Wgs84);oi.Nztm2000=new oi(fi.Nztm2000);oi.Citm2000=new oi(fi.Citm2000);var bB="0".charCodeAt(0),wB="1".charCodeAt(0),IB="2".charCodeAt(0),SB="3".charCodeAt(0);var gc;(function(e){e[e.Xy=0]="Xy",e[e.Yx=1]="Yx"})(gc||(gc={}));function jI(e){return e===oi.Nztm2000?gc.Yx:gc.Xy}function qP(e,t){return t.scaleDenominator-e.scaleDenominator}var Xa=class{constructor(t){this.zooms=[],this.indexX=0,this.indexY=1,this.zoomConversionMap=new Map,this.def=t,this.tileSize=t.tileMatrix[0].tileHeight;let r=t.tileMatrix.slice().sort(qP),l={};for(let C of r){if(l[C.identifier])throw new Error(`Duplicate tileMatrix identifier ${C.identifier}`);if(C.tileHeight!==C.tileWidth)throw new Error("Only square tiles supported");if(C.tileHeight!==this.tileSize)throw new Error("All tiles must have the same tile size");l[C.identifier]=!0}this.zooms=r;let u=oi.parse(t.supportedCRS);if(u==null)throw new Error(`Unable to find supported projection ${t.supportedCRS}`);this.projection=u,jI(this.projection)===gc.Yx&&(this.indexX=1,this.indexY=0);let{lowerCorner:o,upperCorner:m}=t.boundingBox,v=o[this.indexX],b=o[this.indexY];this.extent=new Sr(v,b,m[this.indexX]-v,m[this.indexY]-b)}get maxZoom(){return this.zooms.length-1}get identifier(){return this.def.identifier}pixelScale(t){let r=this.zooms[t];if(r==null)throw new Error(`Zoom not found :${t}`);return r.scaleDenominator*28e-5}tileToPixels(t,r){return{x:t*this.tileSize,y:r*this.tileSize}}pixelsToTile(t,r,l){let u=Math.floor(t/this.tileSize),o=Math.floor(r/this.tileSize);return{x:u,y:o,z:l}}sourceToPixels(t,r,l){let u=this.zooms[l],o=this.pixelScale(l),m=(t-u.topLeftCorner[this.indexX])/o,v=(u.topLeftCorner[this.indexY]-r)/o;return{x:m,y:v}}pixelsToSource(t,r,l){let u=this.zooms[l],o=this.pixelScale(l),m=u.topLeftCorner[this.indexX]+t*o,v=u.topLeftCorner[this.indexY]-r*o;return{x:m,y:v}}tileToSource(t){let r=this.tileToPixels(t.x,t.y);return this.pixelsToSource(r.x,r.y,t.z)}tileToSourceBounds(t){let r=this.tileToSource(t),l=this.pixelScale(t.z)*this.tileSize;return new Sr(r.x,r.y-l,l,l)}*topLevelTiles(){let{matrixWidth:r,matrixHeight:l}=this.zooms[0];for(let u=0;u<l;++u)for(let o=0;o<r;++o)yield{x:o,y:u,z:0};return null}*coverTile(t){if(t==null)return yield*this.topLevelTiles(),null;let r=t.z+1,{matrixWidth:l,matrixHeight:u}=this.zooms[t.z],{matrixWidth:o,matrixHeight:m}=this.zooms[r],v=o/l,b=m/u,C=Math.floor(t.x*v),A=Math.floor(t.y*b),B=Math.ceil((t.x+1)*v),Z=Math.ceil((t.y+1)*b);for(let q=A;q<Z;++q)for(let ee=C;ee<B;++ee)yield{x:ee,y:q,z:r};return null}static tileToName(t){return`${t.z}-${t.x}-${t.y}`}static nameToTile(t){let r=t.split("-");if(r.length===3){let l=Number(r[0]),u=Number(r[1]),o=Number(r[2]);if(!(isNaN(l)||isNaN(o)||isNaN(u)))return{x:u,y:o,z:l}}throw new Error(`Invalid tile name '${t}'`)}findBestZoom(t){let r=this.zoomConversionMap.get(t);return r==null&&(r=this.convertZoomLevel(t),this.zoomConversionMap.set(t,r)),r}convertZoomLevel(t){for(let r=0;r<this.zooms.length;r++){let l=this.zooms[r].scaleDenominator-t;if(l>1e-5)continue;if(r===0)return r;let u=this.zooms[r-1].scaleDenominator-t;return Math.abs(l)<u?r:r-1}return this.maxZoom}static convertZoomLevel(t,r,l,u=!0){return r.identifier===l.identifier||(t>=r.maxZoom&&(t=r.maxZoom),u&&t===0)?t:u&&t===r.maxZoom?l.maxZoom:l.findBestZoom(r.zooms[t].scaleDenominator)}};var HI={Version:"1.0.0-beta.2",License:"CC BY 4.0",BaseMapsExtension:"https://basemaps.linz.govt.nz/json-schema/stac-basemaps-extension/1.0/schema.json"};var JP={type:"TileMatrixSetType",title:"Google Maps Compatible for the World",identifier:"WebMercatorQuad",boundingBox:{type:"BoundingBoxType",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",lowerCorner:[-200375083427892e-7,-200375083427892e-7],upperCorner:[200375083427892e-7,200375083427892e-7]},supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/3857",wellKnownScaleSet:"https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:559082264028717e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:279541132014358e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:139770566007179e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:698852830035897e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:349426415017948e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:174713207508974e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:873566037544871e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:436783018772435e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:218391509386217e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:109195754693108e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:545978.773465544,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:272989.386732772,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:136494.693366386,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:68247.346683193,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:34123.6733415964,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:17061.8366707982,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:8530.91833539913,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:4265.45916769956,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:2132.72958384978,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:1066.36479192489,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:533.182395962445,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:266.591197981222,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152},{type:"TileMatrixType",identifier:"22",scaleDenominator:133.295598990611,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4194304,matrixHeight:4194304},{type:"TileMatrixType",identifier:"23",scaleDenominator:66.6477994953056,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8388608,matrixHeight:8388608},{type:"TileMatrixType",identifier:"24",scaleDenominator:33.3238997476528,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16777216,matrixHeight:16777216}]},xi=new Xa(JP);var zm=Nt(YI(),1),Hs=new Xa(zm.Nztm2000),ls=new Xa(zm.Nztm2000Quad);var us={All:[xi,Hs,ls],Defaults:new Map([[oi.Google.code,xi],[oi.Nztm2000.code,Hs]]),get(e){let t=this.tryGet(e);if(t==null)throw new Error("Failed to lookup TileMatrixSet: "+e);return t},tryGet(e){var t,r;return e==null?null:typeof e=="number"?(t=this.Defaults.get(e))!==null&&t!==void 0?t:null:(r=this.Defaults.get(e.code))!==null&&r!==void 0?r:null},find(e,t=!0){if(e==null)return null;let r=oi.parse(e);if(r!=null)return us.tryGet(r);if(t){for(let l of us.All)if(l.identifier===e)return l;return null}for(let l of us.All)if(l.identifier.toLowerCase()===e.toLowerCase())return l;return null}};var Rd;(function(e){e.Png="png",e.Jpeg="jpeg",e.Webp="webp",e.Avif="avif"})(Rd||(Rd={}));var f1;(function(e){e.MapboxVectorTiles="pbf"})(f1||(f1={}));var QC=Nt(JI(),1);var vc={debug:!1,"debug.background":!1,"debug.source":!1,"debug.cog":!1,"debug.screenshot":!1,"debug.layer.linz-aerial":0,"debug.layer.linz-topographic":0,"debug.layer.osm":0},Dd=class{static toUrl(t,r){if(t.debug===!0){r.append("debug","true");for(let[l,u]of Object.entries(t))l==="debug"||vc[l]===u||r.append(l,String(u))}}static fromUrl(t,r){let l=r.get("debug")!=null,u=!1;if(l===!1){for(let[o,m]of Object.entries(vc))u=Gl(t,o,m)||u;return u}return u=Gl(t,"debug",!0),u=Gl(t,"debug.background",r.get("debug.background"))||u,u=Gl(t,"debug.source",r.get("debug.source")!=null)||u,u=Gl(t,"debug.cog",r.get("debug.cog")!=null)||u,u=Gl(t,"debug.screenshot",r.get("debug.screenshot")!=null)||u,u=g1(t,"debug.layer.linz-aerial",r.get("debug.layer.linz-aerial"))||u,u=g1(t,"debug.layer.linz-topographic",r.get("debug.layer.linz-topographic"))||u,u=g1(t,"debug.layer.osm",r.get("debug.layer.osm"))||u,u}};function i5(e,t=0){if(e==null)return t;let r=Number(e);return isNaN(r)?t:r}function Gl(e,t,r){return r==null&&(r=vc[t]),e[t]===r?!1:(e[t]=r,!0)}function g1(e,t,r){return Gl(e,t,i5(r))}var iS=Nt(KI(),1),rS=Nt(eS(),1);function tS(e){return[[[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]],[e[0],e[1]]]]}var{intersection:_1,union:aN}=rS.default;function n5(e,t){return e[0]===t[0]&&e[1]===t[1]}function o5(e,t){return _1(e,tS(t))}function b1(e,t){let r=[];for(let l of e){let u=iS.default.polygon(l[0],t);u.length!==0&&(n5(u[0],u[u.length-1])||u.push(u[0]),r.push([u]))}return o5(r,t)}var Bd=e=>(e<-360?e=-(-e%360):e>360&&(e=e%360),e<-180?360+e:e>180?e-360:e),Vl=(e,t)=>{let r=t-e;return r>180?r-360:r<-180?r+360:r},s5=(e,t)=>Bd(e+(t<e?t+360-e:t-e)),$a={boxLonCenter(e){return Bd(e[0]+.5*(e[2]<e[0]?360+e[2]-e[0]:e[2]-e[0]))},delta:Vl,crossesAM(e,t){return Math.sign(Vl(e,t))!==Math.sign(t-e)},normLon:Bd,normExtent(e){return[Bd(e[0]),e[1],Bd(e[2]),e[3]]},union(e,t){if(t==null)return e.slice();let r=$a.boxLonCenter(e),l=$a.boxLonCenter(t);if(Vl(r,l)<0)return this.union(t,e);let u=e.slice(),o=s5(r,l);return Vl(o,t[0])<Vl(o,e[0])&&(u[0]=t[0]),Vl(o,t[2])>Vl(o,e[2])&&(u[2]=t[2]),t[1]<e[1]&&(u[1]=t[1]),t[3]>e[3]&&(u[3]=t[3]),u},intersects(e,t){if(e[1]>t[3]||t[1]>e[3])return!1;let r=e[0],l=t[0],u=r<e[2]?e[2]:e[2]+360,o=l<t[2]?t[2]:t[2]+360;return r<=o&&l<=u||r+360<=o&&l<=u+360||r<=o+360&&l+360<=u},ringToBbox(e){if(e.length<3)throw new Error("Invalid ring");let t=!1,r=e[0],l=r[0],u=r[1],o=l,m=u,v=l;for(let b=1;b<e.length;++b){let C=e[b],A=C[0];$a.crossesAM(v,A)&&(t=!t),t&&(A<0?A+=360:(v+=360,b===1&&(l=o=v))),A<l?l=A:A>o&&(o=A);let Z=C[1];Z<u?u=Z:Z>m&&(m=Z),v=C[0]}return[this.normLon(l),u,this.normLon(o),m]},multiPolygonToBbox(e){let t=null;for(let r of e){if(r.length===0)continue;let l=r[0];if(l.length<3)continue;let u=this.ringToBbox(l);t=t==null?u:this.union(t,u)}if(t==null)throw new Error("Invalid multipolygon");return t},bboxToMultiPolygon(e){let t=[e[0],e[1]],r=[e[2],e[1]],l=[e[0],e[3]],u=[e[2],e[3]];return e[0]<e[2]?[[[t,l,u,r,t]]]:[[[t,l,[180,u[1]],[180,r[1]],t]],[[u,r,[-180,t[1]],[-180,l[1]],u]]]}};var a5=[-180,-90,180,90],l5=[180,-90,360,90];function u5(e,t,r){return[t[0]+(r[0]-t[0])*e,t[1]+(r[1]-t[1])*e]}function c5(e){let t=[];for(let r of b1(e,a5))t.push(r);for(let r of b1(e,l5))t.push(r.map(l=>l.map(u=>[u[0]-360,u[1]])));return t}function nS(e,t,r=!0){let l=!1,u=!1,o=e.map(m=>m.map(v=>{let b=[];if(v.length===0)return b;let C=v[0],A=null,B=0;for(let Z of v){let q=t(Z),ee=q[0];if(A!=null){let le=$a.crossesAM(B,ee);if(le&&(l=!0,u=!u),u&&(ee<0?q[0]=ee+360:A[0]=B+360),le){let de=(180-q[0])/(A[0]-q[0]),H=t(u5(de,Z,C));b.push([180,H[1]])}}b.push(q),C=Z,A=q,B=ee}return b}));return l&&r?c5(o):o}function h5(e){return{type:"Polygon",coordinates:e}}function oS(e,t={}){return{type:"Feature",geometry:h5(e),properties:t}}function sS(e,t={}){return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:e},properties:t}}function aS(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}var Xo=1,$o=2,_c=3,lS=4,Nd=5,w1=6378137,uS=6356752314e-3,I1=.0066943799901413165,Ul=484813681109536e-20,Ze=Math.PI/2,cS=.16666666666666666,hS=.04722222222222222,dS=.022156084656084655,Je=1e-10,mr=.017453292519943295,Kn=57.29577951308232,mi=Math.PI/4,Ya=Math.PI*2,gr=3.14159265359;var Fn={};Fn.greenwich=0;Fn.lisbon=-9.131906111111;Fn.paris=2.337229166667;Fn.bogota=-74.080916666667;Fn.madrid=-3.687938888889;Fn.rome=12.452333333333;Fn.bern=7.439583333333;Fn.jakarta=106.807719444444;Fn.ferro=-17.666666666667;Fn.brussels=4.367975;Fn.stockholm=18.058277777778;Fn.athens=23.7163375;Fn.oslo=10.722916666667;var pS={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var fS=/[\s_\-\/\(\)]/g;function mo(e,t){if(e[t])return e[t];for(var r=Object.keys(e),l=t.toLowerCase().replace(fS,""),u=-1,o,m;++u<r.length;)if(o=r[u],m=o.toLowerCase().replace(fS,""),m===l)return e[o]}function Fd(e){var t={},r=e.split("+").map(function(v){return v.trim()}).filter(function(v){return v}).reduce(function(v,b){var C=b.split("=");return C.push(!0),v[C[0].toLowerCase()]=C[1],v},{}),l,u,o,m={proj:"projName",datum:"datumCode",rf:function(v){t.rf=parseFloat(v)},lat_0:function(v){t.lat0=v*mr},lat_1:function(v){t.lat1=v*mr},lat_2:function(v){t.lat2=v*mr},lat_ts:function(v){t.lat_ts=v*mr},lon_0:function(v){t.long0=v*mr},lon_1:function(v){t.long1=v*mr},lon_2:function(v){t.long2=v*mr},alpha:function(v){t.alpha=parseFloat(v)*mr},gamma:function(v){t.rectified_grid_angle=parseFloat(v)},lonc:function(v){t.longc=v*mr},x_0:function(v){t.x0=parseFloat(v)},y_0:function(v){t.y0=parseFloat(v)},k_0:function(v){t.k0=parseFloat(v)},k:function(v){t.k0=parseFloat(v)},a:function(v){t.a=parseFloat(v)},b:function(v){t.b=parseFloat(v)},r_a:function(){t.R_A=!0},zone:function(v){t.zone=parseInt(v,10)},south:function(){t.utmSouth=!0},towgs84:function(v){t.datum_params=v.split(",").map(function(b){return parseFloat(b)})},to_meter:function(v){t.to_meter=parseFloat(v)},units:function(v){t.units=v;var b=mo(pS,v);b&&(t.to_meter=b.to_meter)},from_greenwich:function(v){t.from_greenwich=v*mr},pm:function(v){var b=mo(Fn,v);t.from_greenwich=(b||parseFloat(v))*mr},nadgrids:function(v){v==="@null"?t.datumCode="none":t.nadgrids=v},axis:function(v){var b="ewnsud";v.length===3&&b.indexOf(v.substr(0,1))!==-1&&b.indexOf(v.substr(1,1))!==-1&&b.indexOf(v.substr(2,1))!==-1&&(t.axis=v)},approx:function(){t.approx=!0}};for(l in r)u=r[l],l in m?(o=m[l],typeof o=="function"?o(u):t[o]=u):t[l]=u;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}var mS=m5,Od=1,gS=2,yS=3,Rm=4,vS=5,S1=-1,d5=/\s/,p5=/[A-Za-z]/,f5=/[A-Za-z84_]/,Dm=/[,\]]/,xS=/[\d\.E\-\+]/;function $s(e){if(typeof e!="string")throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Od}$s.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==Rm)for(;d5.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case Od:return this.neutral(e);case gS:return this.keyword(e);case Rm:return this.quoted(e);case vS:return this.afterquote(e);case yS:return this.number(e);case S1:return}};$s.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=Rm;return}if(Dm.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)};$s.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Od;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Od,this.currentObject=this.stack.pop(),this.currentObject||(this.state=S1);return}};$s.prototype.number=function(e){if(xS.test(e)){this.word+=e;return}if(Dm.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)};$s.prototype.quoted=function(e){if(e==='"'){this.state=vS;return}this.word+=e};$s.prototype.keyword=function(e){if(f5.test(e)){this.word+=e;return}if(e==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=Od;return}if(Dm.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)};$s.prototype.neutral=function(e){if(p5.test(e)){this.word=e,this.state=gS;return}if(e==='"'){this.word="",this.state=Rm;return}if(xS.test(e)){this.word=e,this.state=yS;return}if(Dm.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)};$s.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===S1)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function m5(e){var t=new $s(e);return t.output()}function _S(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var l=t?{}:e,u=r.reduce(function(o,m){return Wl(m,o),o},l);t&&(e[t]=u)}function Wl(e,t){if(!Array.isArray(e)){t[e]=!0;return}var r=e.shift();if(r==="PARAMETER"&&(r=e.shift()),e.length===1){if(Array.isArray(e[0])){t[r]={},Wl(e[0],t[r]);return}t[r]=e[0];return}if(!e.length){t[r]=!0;return}if(r==="TOWGS84"){t[r]=e;return}if(r==="AXIS"){r in t||(t[r]=[]),t[r].push(e);return}Array.isArray(r)||(t[r]={});var l;switch(r){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[r]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&Wl(e[2],t[r]);return;case"SPHEROID":case"ELLIPSOID":t[r]={name:e[0],a:e[1],rf:e[2]},e.length===4&&Wl(e[3],t[r]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":e[0]=["name",e[0]],_S(t,r,e);return;default:for(l=-1;++l<e.length;)if(!Array.isArray(e[l]))return Wl(e,t[r]);return _S(t,r,e)}}var g5=.017453292519943295;function y5(e,t){var r=t[0],l=t[1];!(r in e)&&l in e&&(e[r]=e[l],t.length===3&&(e[r]=t[2](e[r])))}function Ys(e){return e*g5}function v5(e){if(e.type==="GEOGCS"?e.projName="longlat":e.type==="LOCAL_CS"?(e.projName="identity",e.local=!0):typeof e.PROJECTION=="object"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",r=0,l=e.AXIS.length;r<l;++r){var u=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];u[0].indexOf("north")!==-1||(u[0]==="y"||u[0]==="lat")&&u[1]==="north"?t+="n":u[0].indexOf("south")!==-1||(u[0]==="y"||u[0]==="lat")&&u[1]==="south"?t+="s":u[0].indexOf("east")!==-1||(u[0]==="x"||u[0]==="lon")&&u[1]==="east"?t+="e":(u[0].indexOf("west")!==-1||(u[0]==="x"||u[0]==="lon")&&u[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.UNIT.convert&&(e.type==="GEOGCS"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type==="GEOGCS"&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),e.datumCode.slice(0,2)==="d_"&&(e.datumCode=e.datumCode.slice(2)),(e.datumCode==="new_zealand_geodetic_datum_1949"||e.datumCode==="new_zealand_1949")&&(e.datumCode="nzgd49"),(e.datumCode==="wgs_1984"||e.datumCode==="world_geodetic_system_1984")&&(e.PROJECTION==="Mercator_Auxiliary_Sphere"&&(e.sphere=!0),e.datumCode="wgs84"),e.datumCode.slice(-6)==="_ferro"&&(e.datumCode=e.datumCode.slice(0,-6)),e.datumCode.slice(-8)==="_jakarta"&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),e.ellps.toLowerCase().slice(0,13)==="international"&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),e.datumCode==="ch1903+"&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a);function m(C){var A=e.to_meter||1;return C*A}var v=function(C){return y5(e,C)},b=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Ys],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Ys],["x0","false_easting",m],["y0","false_northing",m],["long0","central_meridian",Ys],["lat0","latitude_of_origin",Ys],["lat0","standard_parallel_1",Ys],["lat1","standard_parallel_1",Ys],["lat2","standard_parallel_2",Ys],["azimuth","Azimuth"],["alpha","azimuth",Ys],["srsCode","name"]];b.forEach(v),!e.long0&&e.longc&&(e.projName==="Albers_Conic_Equal_Area"||e.projName==="Lambert_Azimuthal_Equal_Area")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(e.projName==="Stereographic_South_Pole"||e.projName==="Polar Stereographic (variant B)")&&(e.lat0=Ys(e.lat1>0?90:-90),e.lat_ts=e.lat1)}function Bm(e){var t=mS(e),r=t.shift(),l=t.shift();t.unshift(["name",l]),t.unshift(["type",r]);var u={};return Wl(t,u),v5(u),u}function Lo(e){var t=this;if(arguments.length===2){var r=arguments[1];typeof r=="string"?r.charAt(0)==="+"?Lo[e]=Fd(arguments[1]):Lo[e]=Bm(arguments[1]):Lo[e]=r}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(l){Array.isArray(l)?Lo.apply(t,l):Lo(l)});if(typeof e=="string"){if(e in Lo)return Lo[e]}else"EPSG"in e?Lo["EPSG:"+e.EPSG]=e:"ESRI"in e?Lo["ESRI:"+e.ESRI]=e:"IAU2000"in e?Lo["IAU2000:"+e.IAU2000]=e:console.log(e);return}}aS(Lo);var bc=Lo;function x5(e){return typeof e=="string"}function _5(e){return e in bc}var b5=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function w5(e){return b5.some(function(t){return e.indexOf(t)>-1})}var I5=["3857","900913","3785","102113"];function S5(e){var t=mo(e,"authority");if(!!t){var r=mo(t,"epsg");return r&&I5.indexOf(r)>-1}}function C5(e){var t=mo(e,"extension");if(!!t)return mo(t,"proj4")}function M5(e){return e[0]==="+"}function E5(e){if(x5(e)){if(_5(e))return bc[e];if(w5(e)){var t=Bm(e);if(S5(t))return bc["EPSG:3857"];var r=C5(t);return r?Fd(r):t}if(M5(e))return Fd(e)}else return e}var bS=E5;function C1(e,t){e=e||{};var r,l;if(!t)return e;for(l in t)r=t[l],r!==void 0&&(e[l]=r);return e}function wn(e,t,r){var l=e*t;return r/Math.sqrt(1-l*l)}function cs(e){return e<0?-1:1}function et(e){return Math.abs(e)<=gr?e:e-cs(e)*Ya}function On(e,t,r){var l=e*r,u=.5*e;return l=Math.pow((1-l)/(1+l),u),Math.tan(.5*(Ze-t))/l}function qs(e,t){for(var r=.5*e,l,u,o=Ze-2*Math.atan(t),m=0;m<=15;m++)if(l=e*Math.sin(o),u=Ze-2*Math.atan(t*Math.pow((1-l)/(1+l),r))-o,o+=u,Math.abs(u)<=1e-10)return o;return-9999}function A5(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=wn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function T5(e){var t=e.x,r=e.y;if(r*Kn>90&&r*Kn<-90&&t*Kn>180&&t*Kn<-180)return null;var l,u;if(Math.abs(Math.abs(r)-Ze)<=Je)return null;if(this.sphere)l=this.x0+this.a*this.k0*et(t-this.long0),u=this.y0+this.a*this.k0*Math.log(Math.tan(mi+.5*r));else{var o=Math.sin(r),m=On(this.e,r,o);l=this.x0+this.a*this.k0*et(t-this.long0),u=this.y0-this.a*this.k0*Math.log(m)}return e.x=l,e.y=u,e}function P5(e){var t=e.x-this.x0,r=e.y-this.y0,l,u;if(this.sphere)u=Ze-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var o=Math.exp(-r/(this.a*this.k0));if(u=qs(this.e,o),u===-9999)return null}return l=et(this.long0+t/(this.a*this.k0)),e.x=l,e.y=u,e}var k5=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],wS={init:A5,forward:T5,inverse:P5,names:k5};function z5(){}function IS(e){return e}var L5=["longlat","identity"],SS={init:z5,forward:IS,inverse:IS,names:L5};var R5=[wS,SS],Nm={},Fm=[];function CS(e,t){var r=Fm.length;return e.names?(Fm[r]=e,e.names.forEach(function(l){Nm[l.toLowerCase()]=r}),this):(console.log(t),!0)}function D5(e){if(!e)return!1;var t=e.toLowerCase();if(typeof Nm[t]<"u"&&Fm[Nm[t]])return Fm[Nm[t]]}function B5(){R5.forEach(CS)}var MS={start:B5,add:CS,get:D5};var Vt={};Vt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Vt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Vt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Vt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Vt.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};Vt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Vt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Vt.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};Vt.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Vt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Vt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Vt.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};Vt.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Vt.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};Vt.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};Vt.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};Vt.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Vt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Vt.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};Vt.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};Vt.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};Vt.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};Vt.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};Vt.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Vt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Vt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Vt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Vt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Vt.hough={a:6378270,rf:297,ellipseName:"Hough"};Vt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Vt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Vt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Vt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Vt.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};Vt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Vt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Vt.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};Vt.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};Vt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Vt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Vt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var ES=Vt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Vt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function AS(e,t,r,l){var u=e*e,o=t*t,m=(u-o)/u,v=0;l?(e*=1-m*(cS+m*(hS+m*dS)),u=e*e,m=0):v=Math.sqrt(m);var b=(u-o)/o;return{es:m,e:v,ep2:b}}function TS(e,t,r,l,u){if(!e){var o=mo(Vt,l);o||(o=ES),e=o.a,t=o.b,r=o.rf}return r&&!t&&(t=(1-1/r)*e),(r===0||Math.abs(e-t)<Je)&&(u=!0,t=e),{a:e,b:t,rf:r,sphere:u}}var Ur={};Ur.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};Ur.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};Ur.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};Ur.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};Ur.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};Ur.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};Ur.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};Ur.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"};Ur.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"};Ur.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};Ur.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};Ur.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};Ur.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};Ur.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};Ur.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};Ur.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};Ur.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function N5(e,t,r,l,u,o,m){var v={};return e===void 0||e==="none"?v.datum_type=Nd:v.datum_type=lS,t&&(v.datum_params=t.map(parseFloat),(v.datum_params[0]!==0||v.datum_params[1]!==0||v.datum_params[2]!==0)&&(v.datum_type=Xo),v.datum_params.length>3&&(v.datum_params[3]!==0||v.datum_params[4]!==0||v.datum_params[5]!==0||v.datum_params[6]!==0)&&(v.datum_type=$o,v.datum_params[3]*=Ul,v.datum_params[4]*=Ul,v.datum_params[5]*=Ul,v.datum_params[6]=v.datum_params[6]/1e6+1)),m&&(v.datum_type=_c,v.grids=m),v.a=r,v.b=l,v.es=u,v.ep2=o,v}var PS=N5;var kS={};function E1(e,t){var r=new DataView(t),l=O5(r),u=G5(r,l);u.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var o=V5(r,u,l),m={header:u,subgrids:o};return kS[e]=m,m}function zS(e){if(e===void 0)return null;var t=e.split(",");return t.map(F5)}function F5(e){if(e.length===0)return null;var t=e[0]==="@";return t&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:kS[e]||null,isNull:!1}}function wc(e){return e/3600*Math.PI/180}function O5(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function G5(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:M1(e,56,56+8).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function M1(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function V5(e,t,r){for(var l=176,u=[],o=0;o<t.nSubgrids;o++){var m=W5(e,l,r),v=Z5(e,l,m,r),b=Math.round(1+(m.upperLongitude-m.lowerLongitude)/m.longitudeInterval),C=Math.round(1+(m.upperLatitude-m.lowerLatitude)/m.latitudeInterval);u.push({ll:[wc(m.lowerLongitude),wc(m.lowerLatitude)],del:[wc(m.longitudeInterval),wc(m.latitudeInterval)],lim:[b,C],count:m.gridNodeCount,cvs:U5(v)})}return u}function U5(e){return e.map(function(t){return[wc(t.longitudeShift),wc(t.latitudeShift)]})}function W5(e,t,r){return{name:M1(e,t+8,t+16).trim(),parent:M1(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function Z5(e,t,r,l){for(var u=t+176,o=16,m=[],v=0;v<r.gridNodeCount;v++){var b={latitudeShift:e.getFloat32(u+v*o,l),longitudeShift:e.getFloat32(u+v*o+4,l),latitudeAccuracy:e.getFloat32(u+v*o+8,l),longitudeAccuracy:e.getFloat32(u+v*o+12,l)};m.push(b)}return m}function Ic(e,t){if(!(this instanceof Ic))return new Ic(e);t=t||function(C){if(C)throw C};var r=bS(e);if(typeof r!="object"){t(e);return}var l=Ic.projections.get(r.projName);if(!l){t(e);return}if(r.datumCode&&r.datumCode!=="none"){var u=mo(Ur,r.datumCode);u&&(r.datum_params=r.datum_params||(u.towgs84?u.towgs84.split(","):null),r.ellps=u.ellipse,r.datumName=u.datumName?u.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var o=TS(r.a,r.b,r.rf,r.ellps,r.sphere),m=AS(o.a,o.b,o.rf,r.R_A),v=zS(r.nadgrids),b=r.datum||PS(r.datumCode,r.datum_params,o.a,o.b,m.es,m.ep2,v);C1(this,r),C1(this,l),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=m.es,this.e=m.e,this.ep2=m.ep2,this.datum=b,this.init(),t(null,this)}Ic.projections=MS;Ic.projections.start();var qa=Ic;function LS(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===Xo?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===$o?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function Om(e,t,r){var l=e.x,u=e.y,o=e.z?e.z:0,m,v,b,C;if(u<-Ze&&u>-1.001*Ze)u=-Ze;else if(u>Ze&&u<1.001*Ze)u=Ze;else{if(u<-Ze)return{x:-1/0,y:-1/0,z:e.z};if(u>Ze)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),v=Math.sin(u),C=Math.cos(u),b=v*v,m=r/Math.sqrt(1-t*b),{x:(m+o)*C*Math.cos(l),y:(m+o)*C*Math.sin(l),z:(m*(1-t)+o)*v}}function Gm(e,t,r,l){var u=1e-12,o=u*u,m=30,v,b,C,A,B,Z,q,ee,le,de,H,Q,te,ve=e.x,Ce=e.y,Se=e.z?e.z:0,Be,Fe,qe;if(v=Math.sqrt(ve*ve+Ce*Ce),b=Math.sqrt(ve*ve+Ce*Ce+Se*Se),v/r<u){if(Be=0,b/r<u)return Fe=Ze,qe=-l,{x:e.x,y:e.y,z:e.z}}else Be=Math.atan2(Ce,ve);C=Se/b,A=v/b,B=1/Math.sqrt(1-t*(2-t)*A*A),ee=A*(1-t)*B,le=C*B,te=0;do te++,q=r/Math.sqrt(1-t*le*le),qe=v*ee+Se*le-q*(1-t*le*le),Z=t*q/(q+qe),B=1/Math.sqrt(1-Z*(2-Z)*A*A),de=A*(1-Z)*B,H=C*B,Q=H*ee-de*le,ee=de,le=H;while(Q*Q>o&&te<m);return Fe=Math.atan(H/Math.abs(de)),{x:Be,y:Fe,z:qe}}function RS(e,t,r){if(t===Xo)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===$o){var l=r[0],u=r[1],o=r[2],m=r[3],v=r[4],b=r[5],C=r[6];return{x:C*(e.x-b*e.y+v*e.z)+l,y:C*(b*e.x+e.y-m*e.z)+u,z:C*(-v*e.x+m*e.y+e.z)+o}}}function DS(e,t,r){if(t===Xo)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===$o){var l=r[0],u=r[1],o=r[2],m=r[3],v=r[4],b=r[5],C=r[6],A=(e.x-l)/C,B=(e.y-u)/C,Z=(e.z-o)/C;return{x:A+b*B-v*Z,y:-b*A+B+m*Z,z:v*A-m*B+Z}}}function Vm(e){return e===Xo||e===$o}function FS(e,t,r){if(LS(e,t)||e.datum_type===Nd||t.datum_type===Nd)return r;var l=e.a,u=e.es;if(e.datum_type===_c){var o=BS(e,!1,r);if(o!==0)return;l=w1,u=I1}var m=t.a,v=t.b,b=t.es;if(t.datum_type===_c&&(m=w1,v=uS,b=I1),u===b&&l===m&&!Vm(e.datum_type)&&!Vm(t.datum_type))return r;if(r=Om(r,u,l),Vm(e.datum_type)&&(r=RS(r,e.datum_type,e.datum_params)),Vm(t.datum_type)&&(r=DS(r,t.datum_type,t.datum_params)),r=Gm(r,b,m,v),t.datum_type===_c){var C=BS(t,!0,r);if(C!==0)return}return r}function BS(e,t,r){if(e.grids===null||e.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var l={x:-r.x,y:r.y},u={x:Number.NaN,y:Number.NaN},o=!1,m=[],v=0;v<e.grids.length;v++){var b=e.grids[v];if(m.push(b.name),b.isNull){u=l;break}if(o=b.mandatory,b.grid===null){if(b.mandatory)return console.log("Unable to find mandatory grid '"+b.name+"'"),-1;continue}var C=b.grid.subgrids[0],A=(Math.abs(C.del[1])+Math.abs(C.del[0]))/1e4,B=C.ll[0]-A,Z=C.ll[1]-A,q=C.ll[0]+(C.lim[0]-1)*C.del[0]+A,ee=C.ll[1]+(C.lim[1]-1)*C.del[1]+A;if(!(Z>l.y||B>l.x||ee<l.y||q<l.x)&&(u=j5(l,t,C),!isNaN(u.x)))break}return isNaN(u.x)?(console.log("Failed to find a grid shift table for location '"+-l.x*Kn+" "+l.y*Kn+" tried: '"+m+"'"),-1):(r.x=-u.x,r.y=u.y,0)}function j5(e,t,r){var l={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return l;var u={x:e.x,y:e.y};u.x-=r.ll[0],u.y-=r.ll[1],u.x=et(u.x-Math.PI)+Math.PI;var o=NS(u,r);if(t){if(isNaN(o.x))return l;o.x=u.x-o.x,o.y=u.y-o.y;var m=9,v=1e-12,b,C;do{if(C=NS(o,r),isNaN(C.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}b={x:u.x-(C.x+o.x),y:u.y-(C.y+o.y)},o.x+=b.x,o.y+=b.y}while(m--&&Math.abs(b.x)>v&&Math.abs(b.y)>v);if(m<0)return console.log("Inverse grid shift iterator failed to converge."),l;l.x=et(o.x+r.ll[0]),l.y=o.y+r.ll[1]}else isNaN(o.x)||(l.x=e.x+o.x,l.y=e.y+o.y);return l}function NS(e,t){var r={x:e.x/t.del[0],y:e.y/t.del[1]},l={x:Math.floor(r.x),y:Math.floor(r.y)},u={x:r.x-1*l.x,y:r.y-1*l.y},o={x:Number.NaN,y:Number.NaN},m;if(l.x<0||l.x>=t.lim[0]||l.y<0||l.y>=t.lim[1])return o;m=l.y*t.lim[0]+l.x;var v={x:t.cvs[m][0],y:t.cvs[m][1]};m++;var b={x:t.cvs[m][0],y:t.cvs[m][1]};m+=t.lim[0];var C={x:t.cvs[m][0],y:t.cvs[m][1]};m--;var A={x:t.cvs[m][0],y:t.cvs[m][1]},B=u.x*u.y,Z=u.x*(1-u.y),q=(1-u.x)*(1-u.y),ee=(1-u.x)*u.y;return o.x=q*v.x+Z*b.x+ee*A.x+B*C.x,o.y=q*v.y+Z*b.y+ee*A.y+B*C.y,o}function A1(e,t,r){var l=r.x,u=r.y,o=r.z||0,m,v,b,C={};for(b=0;b<3;b++)if(!(t&&b===2&&r.z===void 0))switch(b===0?(m=l,"ew".indexOf(e.axis[b])!==-1?v="x":v="y"):b===1?(m=u,"ns".indexOf(e.axis[b])!==-1?v="y":v="x"):(m=o,v="z"),e.axis[b]){case"e":C[v]=m;break;case"w":C[v]=-m;break;case"n":C[v]=m;break;case"s":C[v]=-m;break;case"u":r[v]!==void 0&&(C.z=m);break;case"d":r[v]!==void 0&&(C.z=-m);break;default:return null}return C}function Um(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function GS(e){OS(e.x),OS(e.y)}function OS(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function H5(e,t){return(e.datum.datum_type===Xo||e.datum.datum_type===$o)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Xo||t.datum.datum_type===$o)&&e.datumCode!=="WGS84"}function Zl(e,t,r,l){var u;if(Array.isArray(r)&&(r=Um(r)),GS(r),e.datum&&t.datum&&H5(e,t)&&(u=new qa("WGS84"),r=Zl(e,u,r,l),e=u),l&&e.axis!=="enu"&&(r=A1(e,!1,r)),e.projName==="longlat")r={x:r.x*mr,y:r.y*mr,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),r=e.inverse(r),!r)return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=FS(e.datum,t.datum,r),!!r)return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),t.projName==="longlat"?r={x:r.x*Kn,y:r.y*Kn,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),l&&t.axis!=="enu"?A1(t,!0,r):r}var VS=qa("WGS84");function T1(e,t,r,l){var u,o,m;return Array.isArray(r)?(u=Zl(e,t,r,l)||{x:NaN,y:NaN},r.length>2?typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof u.z=="number"?[u.x,u.y,u.z].concat(r.splice(3)):[u.x,u.y,r[2]].concat(r.splice(3)):[u.x,u.y].concat(r.splice(2)):[u.x,u.y]):(o=Zl(e,t,r,l),m=Object.keys(r),m.length===2||m.forEach(function(v){if(typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(v==="x"||v==="y"||v==="z")return}else if(v==="x"||v==="y")return;o[v]=r[v]}),o)}function US(e){return e instanceof qa?e:e.oProj?e.oProj:qa(e)}function X5(e,t,r){e=US(e);var l=!1,u;return typeof t>"u"?(t=e,e=VS,l=!0):(typeof t.x<"u"||Array.isArray(t))&&(r=t,t=e,e=VS,l=!0),t=US(t),r?T1(e,t,r):(u={forward:function(o,m){return T1(e,t,o,m)},inverse:function(o,m){return T1(t,e,o,m)}},l&&(u.oProj=t),u)}var eo=X5;var WS=6,jS="AJSAJS",HS="AFAFAF",Sc=65,to=73,Ro=79,Gd=86,Vd=90,XS={forward:k1,inverse:$5,toPoint:z1};function k1(e,t){return t=t||5,J5(Y5({lat:e[1],lon:e[0]}),t)}function $5(e){var t=L1(YS(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function z1(e){var t=L1(YS(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function P1(e){return e*(Math.PI/180)}function ZS(e){return 180*(e/Math.PI)}function Y5(e){var t=e.lat,r=e.lon,l=6378137,u=.00669438,o=.9996,m,v,b,C,A,B,Z,q=P1(t),ee=P1(r),le,de;de=Math.floor((r+180)/6)+1,r===180&&(de=60),t>=56&&t<64&&r>=3&&r<12&&(de=32),t>=72&&t<84&&(r>=0&&r<9?de=31:r>=9&&r<21?de=33:r>=21&&r<33?de=35:r>=33&&r<42&&(de=37)),m=(de-1)*6-180+3,le=P1(m),v=u/(1-u),b=l/Math.sqrt(1-u*Math.sin(q)*Math.sin(q)),C=Math.tan(q)*Math.tan(q),A=v*Math.cos(q)*Math.cos(q),B=Math.cos(q)*(ee-le),Z=l*((1-u/4-3*u*u/64-5*u*u*u/256)*q-(3*u/8+3*u*u/32+45*u*u*u/1024)*Math.sin(2*q)+(15*u*u/256+45*u*u*u/1024)*Math.sin(4*q)-35*u*u*u/3072*Math.sin(6*q));var H=o*b*(B+(1-C+A)*B*B*B/6+(5-18*C+C*C+72*A-58*v)*B*B*B*B*B/120)+5e5,Q=o*(Z+b*Math.tan(q)*(B*B/2+(5-C+9*A+4*A*A)*B*B*B*B/24+(61-58*C+C*C+600*A-330*v)*B*B*B*B*B*B/720));return t<0&&(Q+=1e7),{northing:Math.round(Q),easting:Math.round(H),zoneNumber:de,zoneLetter:q5(t)}}function L1(e){var t=e.northing,r=e.easting,l=e.zoneLetter,u=e.zoneNumber;if(u<0||u>60)return null;var o=.9996,m=6378137,v=.00669438,b,C=(1-Math.sqrt(1-v))/(1+Math.sqrt(1-v)),A,B,Z,q,ee,le,de,H,Q,te=r-5e5,ve=t;l<"N"&&(ve-=1e7),de=(u-1)*6-180+3,b=v/(1-v),le=ve/o,H=le/(m*(1-v/4-3*v*v/64-5*v*v*v/256)),Q=H+(3*C/2-27*C*C*C/32)*Math.sin(2*H)+(21*C*C/16-55*C*C*C*C/32)*Math.sin(4*H)+151*C*C*C/96*Math.sin(6*H),A=m/Math.sqrt(1-v*Math.sin(Q)*Math.sin(Q)),B=Math.tan(Q)*Math.tan(Q),Z=b*Math.cos(Q)*Math.cos(Q),q=m*(1-v)/Math.pow(1-v*Math.sin(Q)*Math.sin(Q),1.5),ee=te/(A*o);var Ce=Q-A*Math.tan(Q)/q*(ee*ee/2-(5+3*B+10*Z-4*Z*Z-9*b)*ee*ee*ee*ee/24+(61+90*B+298*Z+45*B*B-252*b-3*Z*Z)*ee*ee*ee*ee*ee*ee/720);Ce=ZS(Ce);var Se=(ee-(1+2*B+Z)*ee*ee*ee/6+(5-2*Z+28*B-3*Z*Z+8*b+24*B*B)*ee*ee*ee*ee*ee/120)/Math.cos(Q);Se=de+ZS(Se);var Be;if(e.accuracy){var Fe=L1({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});Be={top:Fe.lat,right:Fe.lon,bottom:Ce,left:Se}}else Be={lat:Ce,lon:Se};return Be}function q5(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function J5(e,t){var r="00000"+e.easting,l="00000"+e.northing;return e.zoneNumber+e.zoneLetter+Q5(e.easting,e.northing,e.zoneNumber)+r.substr(r.length-5,t)+l.substr(l.length-5,t)}function Q5(e,t,r){var l=$S(r),u=Math.floor(e/1e5),o=Math.floor(t/1e5)%20;return K5(u,o,l)}function $S(e){var t=e%WS;return t===0&&(t=WS),t}function K5(e,t,r){var l=r-1,u=jS.charCodeAt(l),o=HS.charCodeAt(l),m=u+e-1,v=o+t,b=!1;m>Vd&&(m=m-Vd+Sc-1,b=!0),(m===to||u<to&&m>to||(m>to||u<to)&&b)&&m++,(m===Ro||u<Ro&&m>Ro||(m>Ro||u<Ro)&&b)&&(m++,m===to&&m++),m>Vd&&(m=m-Vd+Sc-1),v>Gd?(v=v-Gd+Sc-1,b=!0):b=!1,(v===to||o<to&&v>to||(v>to||o<to)&&b)&&v++,(v===Ro||o<Ro&&v>Ro||(v>Ro||o<Ro)&&b)&&(v++,v===to&&v++),v>Gd&&(v=v-Gd+Sc-1);var C=String.fromCharCode(m)+String.fromCharCode(v);return C}function YS(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var t=e.length,r=null,l="",u,o=0;!/[A-Z]/.test(u=e.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+e;l+=u,o++}var m=parseInt(l,10);if(o===0||o+3>t)throw"MGRSPoint bad conversion from: "+e;var v=e.charAt(o++);if(v<="A"||v==="B"||v==="Y"||v>="Z"||v==="I"||v==="O")throw"MGRSPoint zone letter "+v+" not handled: "+e;r=e.substring(o,o+=2);for(var b=$S(m),C=ek(r.charAt(0),b),A=tk(r.charAt(1),b);A<ik(v);)A+=2e6;var B=t-o;if(B%2!==0)throw`MGRSPoint has to have an even number
513
+ of digits after the zone letter and two 100km letters - front
514
+ half for easting meters, second half for
515
+ northing meters`+e;var Z=B/2,q=0,ee=0,le,de,H,Q,te;return Z>0&&(le=1e5/Math.pow(10,Z),de=e.substring(o,o+Z),q=parseFloat(de)*le,H=e.substring(o+Z),ee=parseFloat(H)*le),Q=q+C,te=ee+A,{easting:Q,northing:te,zoneLetter:v,zoneNumber:m,accuracy:le}}function ek(e,t){for(var r=jS.charCodeAt(t-1),l=1e5,u=!1;r!==e.charCodeAt(0);){if(r++,r===to&&r++,r===Ro&&r++,r>Vd){if(u)throw"Bad character: "+e;r=Sc,u=!0}l+=1e5}return l}function tk(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var r=HS.charCodeAt(t-1),l=0,u=!1;r!==e.charCodeAt(0);){if(r++,r===to&&r++,r===Ro&&r++,r>Gd){if(u)throw"Bad character: "+e;r=Sc,u=!0}l+=1e5}return l}function ik(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Cc(e,t,r){if(!(this instanceof Cc))return new Cc(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof t>"u"){var l=e.split(",");this.x=parseFloat(l[0],10),this.y=parseFloat(l[1],10),this.z=parseFloat(l[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Cc.fromMGRS=function(e){return new Cc(z1(e))};Cc.prototype.toMGRS=function(e){return k1([this.x,this.y],e)};var qS=Cc;var rk=1,nk=.25,JS=.046875,QS=.01953125,KS=.01068115234375,ok=.75,sk=.46875,ak=.013020833333333334,lk=.007120768229166667,uk=.3645833333333333,ck=.005696614583333333,hk=.3076171875;function Wm(e){var t=[];t[0]=rk-e*(nk+e*(JS+e*(QS+e*KS))),t[1]=e*(ok-e*(JS+e*(QS+e*KS)));var r=e*e;return t[2]=r*(sk-e*(ak+e*lk)),r*=e,t[3]=r*(uk-e*ck),t[4]=r*e*hk,t}function jl(e,t,r,l){return r*=t,t*=t,l[0]*e-r*(l[1]+t*(l[2]+t*(l[3]+t*l[4])))}var dk=20;function Zm(e,t,r){for(var l=1/(1-t),u=e,o=dk;o;--o){var m=Math.sin(u),v=1-t*m*m;if(v=(jl(u,m,Math.cos(u),r)-e)*(v*Math.sqrt(v))*l,u-=v,Math.abs(v)<Je)return u}return u}function pk(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Wm(this.es),this.ml0=jl(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function fk(e){var t=e.x,r=e.y,l=et(t-this.long0),u,o,m,v=Math.sin(r),b=Math.cos(r);if(this.es){var A=b*l,B=Math.pow(A,2),Z=this.ep2*Math.pow(b,2),q=Math.pow(Z,2),ee=Math.abs(b)>Je?Math.tan(r):0,le=Math.pow(ee,2),de=Math.pow(le,2);u=1-this.es*Math.pow(v,2),A=A/Math.sqrt(u);var H=jl(r,v,b,this.en);o=this.a*(this.k0*A*(1+B/6*(1-le+Z+B/20*(5-18*le+de+14*Z-58*le*Z+B/42*(61+179*de-de*le-479*le)))))+this.x0,m=this.a*(this.k0*(H-this.ml0+v*l*A/2*(1+B/12*(5-le+9*Z+4*q+B/30*(61+de-58*le+270*Z-330*le*Z+B/56*(1385+543*de-de*le-3111*le))))))+this.y0}else{var C=b*Math.sin(l);if(Math.abs(Math.abs(C)-1)<Je)return 93;if(o=.5*this.a*this.k0*Math.log((1+C)/(1-C))+this.x0,m=b*Math.cos(l)/Math.sqrt(1-Math.pow(C,2)),C=Math.abs(m),C>=1){if(C-1>Je)return 93;m=0}else m=Math.acos(m);r<0&&(m=-m),m=this.a*this.k0*(m-this.lat0)+this.y0}return e.x=o,e.y=m,e}function mk(e){var t,r,l,u,o=(e.x-this.x0)*(1/this.a),m=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+m/this.k0,r=Zm(t,this.es,this.en),Math.abs(r)<Ze){var B=Math.sin(r),Z=Math.cos(r),q=Math.abs(Z)>Je?Math.tan(r):0,ee=this.ep2*Math.pow(Z,2),le=Math.pow(ee,2),de=Math.pow(q,2),H=Math.pow(de,2);t=1-this.es*Math.pow(B,2);var Q=o*Math.sqrt(t)/this.k0,te=Math.pow(Q,2);t=t*q,l=r-t*te/(1-this.es)*.5*(1-te/12*(5+3*de-9*ee*de+ee-4*le-te/30*(61+90*de-252*ee*de+45*H+46*ee-te/56*(1385+3633*de+4095*H+1574*H*de)))),u=et(this.long0+Q*(1-te/6*(1+2*de+ee-te/20*(5+28*de+24*H+8*ee*de+6*ee-te/42*(61+662*de+1320*H+720*H*de))))/Z)}else l=Ze*cs(m),u=0;else{var v=Math.exp(o/this.k0),b=.5*(v-1/v),C=this.lat0+m/this.k0,A=Math.cos(C);t=Math.sqrt((1-Math.pow(A,2))/(1+Math.pow(b,2))),l=Math.asin(t),m<0&&(l=-l),b===0&&A===0?u=0:u=et(Math.atan2(b,A)+this.long0)}return e.x=u,e.y=l,e}var gk=["Fast_Transverse_Mercator","Fast Transverse Mercator"],Mc={init:pk,forward:fk,inverse:mk,names:gk};function jm(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function Gn(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),l=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(l,2))}function eC(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}function tC(e){var t=Math.abs(e);return t=eC(t*(1+t/(Gn(1,t)+1))),e<0?-t:t}function Hm(e,t){for(var r=2*Math.cos(2*t),l=e.length-1,u=e[l],o=0,m;--l>=0;)m=-o+r*u+e[l],o=u,u=m;return t+m*Math.sin(2*t)}function iC(e,t){for(var r=2*Math.cos(t),l=e.length-1,u=e[l],o=0,m;--l>=0;)m=-o+r*u+e[l],o=u,u=m;return Math.sin(t)*m}function rC(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function R1(e,t,r){for(var l=Math.sin(t),u=Math.cos(t),o=jm(r),m=rC(r),v=2*u*m,b=-2*l*o,C=e.length-1,A=e[C],B=0,Z=0,q=0,ee,le;--C>=0;)ee=Z,le=B,Z=A,B=q,A=-ee+v*Z-b*B+e[C],q=-le+b*Z+v*B;return v=l*m,b=u*o,[v*A-b*q,v*q+b*A]}function yk(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Mc.init.apply(this),this.forward=Mc.forward,this.inverse=Mc.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),r=r*t,this.cgb[1]=r*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r=r*t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),r=r*t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(-12/5+t*(-24832/14175))),r=r*t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r=r*t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),r=r*t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r=r*t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r=r*t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r=r*t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var l=Hm(this.cbg,this.lat0);this.Zb=-this.Qn*(l+iC(this.gtu,2*l))}function vk(e){var t=et(e.x-this.long0),r=e.y;r=Hm(this.cbg,r);var l=Math.sin(r),u=Math.cos(r),o=Math.sin(t),m=Math.cos(t);r=Math.atan2(l,m*u),t=Math.atan2(o*u,Gn(l,u*m)),t=tC(Math.tan(t));var v=R1(this.gtu,2*r,2*t);r=r+v[0],t=t+v[1];var b,C;return Math.abs(t)<=2.623395162778?(b=this.a*(this.Qn*t)+this.x0,C=this.a*(this.Qn*r+this.Zb)+this.y0):(b=1/0,C=1/0),e.x=b,e.y=C,e}function xk(e){var t=(e.x-this.x0)*(1/this.a),r=(e.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,t=t/this.Qn;var l,u;if(Math.abs(t)<=2.623395162778){var o=R1(this.utg,2*r,2*t);r=r+o[0],t=t+o[1],t=Math.atan(jm(t));var m=Math.sin(r),v=Math.cos(r),b=Math.sin(t),C=Math.cos(t);r=Math.atan2(m*C,Gn(b,C*v)),t=Math.atan2(b,C*v),l=et(t+this.long0),u=Hm(this.cgb,r)}else l=1/0,u=1/0;return e.x=l,e.y=u,e}var _k=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],Ec={init:yk,forward:vk,inverse:xk,names:_k};function nC(e,t){if(e===void 0){if(e=Math.floor((et(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var bk="etmerc";function wk(){var e=nC(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*mr,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ec.init.apply(this),this.forward=Ec.forward,this.inverse=Ec.inverse}var Ik=["Universal Transverse Mercator System","utm"],oC={init:wk,names:Ik,dependsOn:bk};function Xm(e,t){return Math.pow((1-e)/(1+e),t)}var Sk=20;function Ck(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+mi)/(Math.pow(Math.tan(.5*this.lat0+mi),this.C)*Xm(this.e*e,this.ratexp))}function Mk(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+mi),this.C)*Xm(this.e*Math.sin(r),this.ratexp))-Ze,e.x=this.C*t,e}function Ek(e){for(var t=1e-14,r=e.x/this.C,l=e.y,u=Math.pow(Math.tan(.5*l+mi)/this.K,1/this.C),o=Sk;o>0&&(l=2*Math.atan(u*Xm(this.e*Math.sin(e.y),-.5*this.e))-Ze,!(Math.abs(l-e.y)<t));--o)e.y=l;return o?(e.x=r,e.y=l,e):null}var Ak=["gauss"],$m={init:Ck,forward:Mk,inverse:Ek,names:Ak};function Tk(){$m.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function Pk(e){var t,r,l,u;return e.x=et(e.x-this.long0),$m.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),l=Math.cos(e.x),u=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*l),e.x=u*r*Math.sin(e.x),e.y=u*(this.cosc0*t-this.sinc0*r*l),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function kk(e){var t,r,l,u,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=Math.sqrt(e.x*e.x+e.y*e.y)){var m=2*Math.atan2(o,this.R2);t=Math.sin(m),r=Math.cos(m),u=Math.asin(r*this.sinc0+e.y*t*this.cosc0/o),l=Math.atan2(e.x*t,o*this.cosc0*r-e.y*this.sinc0*t)}else u=this.phic0,l=0;return e.x=l,e.y=u,$m.inverse.apply(this,[e]),e.x=et(e.x+this.long0),e}var zk=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],sC={init:Tk,forward:Pk,inverse:kk,names:zk};function Lk(e,t,r){return t*=r,Math.tan(.5*(Ze+e))*Math.pow((1-t)/(1+t),.5*r)}function Rk(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Je&&(this.k0=.5*(1+cs(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Je&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Je&&(this.k0=.5*this.cons*wn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/On(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=wn(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Ze,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Dk(e){var t=e.x,r=e.y,l=Math.sin(r),u=Math.cos(r),o,m,v,b,C,A,B=et(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Je&&Math.abs(r+this.lat0)<=Je?(e.x=NaN,e.y=NaN,e):this.sphere?(o=2*this.k0/(1+this.sinlat0*l+this.coslat0*u*Math.cos(B)),e.x=this.a*o*u*Math.sin(B)+this.x0,e.y=this.a*o*(this.coslat0*l-this.sinlat0*u*Math.cos(B))+this.y0,e):(m=2*Math.atan(this.ssfn_(r,l,this.e))-Ze,b=Math.cos(m),v=Math.sin(m),Math.abs(this.coslat0)<=Je?(C=On(this.e,r*this.con,this.con*l),A=2*this.a*this.k0*C/this.cons,e.x=this.x0+A*Math.sin(t-this.long0),e.y=this.y0-this.con*A*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<Je?(o=2*this.a*this.k0/(1+b*Math.cos(B)),e.y=o*v):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*v+this.cosX0*b*Math.cos(B))),e.y=o*(this.cosX0*v-this.sinX0*b*Math.cos(B))+this.y0),e.x=o*b*Math.sin(B)+this.x0,e))}function Bk(e){e.x-=this.x0,e.y-=this.y0;var t,r,l,u,o,m=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var v=2*Math.atan(m/(2*this.a*this.k0));return t=this.long0,r=this.lat0,m<=Je?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(v)*this.sinlat0+e.y*Math.sin(v)*this.coslat0/m),Math.abs(this.coslat0)<Je?this.lat0>0?t=et(this.long0+Math.atan2(e.x,-1*e.y)):t=et(this.long0+Math.atan2(e.x,e.y)):t=et(this.long0+Math.atan2(e.x*Math.sin(v),m*this.coslat0*Math.cos(v)-e.y*this.sinlat0*Math.sin(v))),e.x=t,e.y=r,e)}else if(Math.abs(this.coslat0)<=Je){if(m<=Je)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,l=m*this.cons/(2*this.a*this.k0),r=this.con*qs(this.e,l),t=this.con*et(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else u=2*Math.atan(m*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,m<=Je?o=this.X0:(o=Math.asin(Math.cos(u)*this.sinX0+e.y*Math.sin(u)*this.cosX0/m),t=et(this.long0+Math.atan2(e.x*Math.sin(u),m*this.cosX0*Math.cos(u)-e.y*this.sinX0*Math.sin(u)))),r=-1*qs(this.e,Math.tan(.5*(Ze+o)));return e.x=t,e.y=r,e}var Nk=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],aC={init:Rk,forward:Dk,inverse:Bk,names:Nk,ssfn_:Lk};function Fk(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,l=this.rf,u=1/l,o=2*u-Math.pow(u,2),m=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var v=Math.log(Math.tan(Math.PI/4+this.b0/2)),b=Math.log(Math.tan(Math.PI/4+e/2)),C=Math.log((1+m*t)/(1-m*t));this.K=v-this.alpha*b+this.alpha*m/2*C}function Ok(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),l=-this.alpha*(t+r)+this.K,u=2*(Math.atan(Math.exp(l))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),m=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(u)+Math.cos(this.b0)*Math.cos(o))),v=Math.asin(Math.cos(this.b0)*Math.sin(u)-Math.sin(this.b0)*Math.cos(u)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(v))/(1-Math.sin(v)))+this.y0,e.x=this.R*m+this.x0,e}function Gk(e){for(var t=e.x-this.x0,r=e.y-this.y0,l=t/this.R,u=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(u)+Math.sin(this.b0)*Math.cos(u)*Math.cos(l)),m=Math.atan(Math.sin(l)/(Math.cos(this.b0)*Math.cos(l)-Math.sin(this.b0)*Math.tan(u))),v=this.lambda0+m/this.alpha,b=0,C=o,A=-1e3,B=0;Math.abs(C-A)>1e-7;){if(++B>20)return;b=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(C))/2)),A=C,C=2*Math.atan(Math.exp(b))-Math.PI/2}return e.x=v,e.y=C,e}var Vk=["somerc"],lC={init:Fk,forward:Ok,inverse:Gk,names:Vk};var Ac=1e-7;function Uk(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],r=typeof e.PROJECTION=="object"?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||t.indexOf(r)!==-1}function Wk(){var e,t,r,l,u,o,m,v,b,C,A=0,B,Z=0,q=0,ee=0,le=0,de=0,H=0,Q;this.no_off=Uk(this),this.no_rot="no_rot"in this;var te=!1;"alpha"in this&&(te=!0);var ve=!1;if("rectified_grid_angle"in this&&(ve=!0),te&&(H=this.alpha),ve&&(A=this.rectified_grid_angle*mr),te||ve)Z=this.longc;else if(q=this.long1,le=this.lat1,ee=this.long2,de=this.lat2,Math.abs(le-de)<=Ac||(e=Math.abs(le))<=Ac||Math.abs(e-Ze)<=Ac||Math.abs(Math.abs(this.lat0)-Ze)<=Ac||Math.abs(Math.abs(de)-Ze)<=Ac)throw new Error;var Ce=1-this.es;t=Math.sqrt(Ce),Math.abs(this.lat0)>Je?(v=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*v*v,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/Ce),this.A=this.B*this.k0*t/e,l=this.B*t/(r*Math.sqrt(e)),u=l*l-1,u<=0?u=0:(u=Math.sqrt(u),this.lat0<0&&(u=-u)),this.E=u+=l,this.E*=Math.pow(On(this.e,this.lat0,v),this.B)):(this.B=1/t,this.A=this.k0,this.E=l=u=1),te||ve?(te?(B=Math.asin(Math.sin(H)/l),ve||(A=H)):(B=A,H=Math.asin(l*Math.sin(B))),this.lam0=Z-Math.asin(.5*(u-1/u)*Math.tan(B))/this.B):(o=Math.pow(On(this.e,le,Math.sin(le)),this.B),m=Math.pow(On(this.e,de,Math.sin(de)),this.B),u=this.E/o,b=(m-o)/(m+o),C=this.E*this.E,C=(C-m*o)/(C+m*o),e=q-ee,e<-Math.pi?ee-=Ya:e>Math.pi&&(ee+=Ya),this.lam0=et(.5*(q+ee)-Math.atan(C*Math.tan(.5*this.B*(q-ee))/b)/this.B),B=Math.atan(2*Math.sin(this.B*et(q-this.lam0))/(u-1/u)),A=H=Math.asin(l*Math.sin(B))),this.singam=Math.sin(B),this.cosgam=Math.cos(B),this.sinrot=Math.sin(A),this.cosrot=Math.cos(A),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,Q=this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(l*l-1)/Math.cos(H))),this.lat0<0&&(this.u_0=-this.u_0)),u=.5*B,this.v_pole_n=this.ArB*Math.log(Math.tan(mi-u)),this.v_pole_s=this.ArB*Math.log(Math.tan(mi+u))}function Zk(e){var t={},r,l,u,o,m,v,b,C;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-Ze)>Je){if(m=this.E/Math.pow(On(this.e,e.y,Math.sin(e.y)),this.B),v=1/m,r=.5*(m-v),l=.5*(m+v),o=Math.sin(this.B*e.x),u=(r*this.singam-o*this.cosgam)/l,Math.abs(Math.abs(u)-1)<Je)throw new Error;C=.5*this.ArB*Math.log((1-u)/(1+u)),v=Math.cos(this.B*e.x),Math.abs(v)<Ac?b=this.A*e.x:b=this.ArB*Math.atan2(r*this.cosgam+o*this.singam,v)}else C=e.y>0?this.v_pole_n:this.v_pole_s,b=this.ArB*e.y;return this.no_rot?(t.x=b,t.y=C):(b-=this.u_0,t.x=C*this.cosrot+b*this.sinrot,t.y=b*this.cosrot-C*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function jk(e){var t,r,l,u,o,m,v,b={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),l=Math.exp(-this.BrA*r),u=.5*(l-1/l),o=.5*(l+1/l),m=Math.sin(this.BrA*t),v=(m*this.cosgam+u*this.singam)/o,Math.abs(Math.abs(v)-1)<Je)b.x=0,b.y=v<0?-Ze:Ze;else{if(b.y=this.E/Math.sqrt((1+v)/(1-v)),b.y=qs(this.e,Math.pow(b.y,1/this.B)),b.y===1/0)throw new Error;b.x=-this.rB*Math.atan2(u*this.cosgam-m*this.singam,Math.cos(this.BrA*t))}return b.x+=this.lam0,b}var Hk=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"],uC={init:Wk,forward:Zk,inverse:jk,names:Hk};function Xk(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Je)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),l=wn(this.e,t,r),u=On(this.e,this.lat1,t),o=Math.sin(this.lat2),m=Math.cos(this.lat2),v=wn(this.e,o,m),b=On(this.e,this.lat2,o),C=On(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Je?this.ns=Math.log(l/v)/Math.log(u/b):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=l/(this.ns*Math.pow(u,this.ns)),this.rh=this.a*this.f0*Math.pow(C,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function $k(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=Je&&(r=cs(r)*(Ze-2*Je));var l=Math.abs(Math.abs(r)-Ze),u,o;if(l>Je)u=On(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(u,this.ns);else{if(l=r*this.ns,l<=0)return null;o=0}var m=this.ns*et(t-this.long0);return e.x=this.k0*(o*Math.sin(m))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(m))+this.y0,e}function Yk(e){var t,r,l,u,o,m=(e.x-this.x0)/this.k0,v=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(m*m+v*v),r=1):(t=-Math.sqrt(m*m+v*v),r=-1);var b=0;if(t!==0&&(b=Math.atan2(r*m,r*v)),t!==0||this.ns>0){if(r=1/this.ns,l=Math.pow(t/(this.a*this.f0),r),u=qs(this.e,l),u===-9999)return null}else u=-Ze;return o=et(b/this.ns+this.long0),e.x=o,e.y=u,e}var qk=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],cC={init:Xk,forward:$k,inverse:Yk,names:qk};function Jk(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Qk(e){var t,r,l,u,o,m,v,b=e.x,C=e.y,A=et(b-this.long0);return t=Math.pow((1+this.e*Math.sin(C))/(1-this.e*Math.sin(C)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(C/2+this.s45),this.alfa)/t)-this.s45),l=-A*this.alfa,u=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(l)),o=Math.asin(Math.cos(r)*Math.sin(l)/Math.cos(u)),m=this.n*o,v=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(u/2+this.s45),this.n),e.y=v*Math.cos(m)/1,e.x=v*Math.sin(m)/1,this.czech||(e.y*=-1,e.x*=-1),e}function Kk(e){var t,r,l,u,o,m,v,b,C=e.x;e.x=e.y,e.y=C,this.czech||(e.y*=-1,e.x*=-1),m=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x),u=o/Math.sin(this.s0),l=2*(Math.atan(Math.pow(this.ro0/m,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(l)-Math.sin(this.ad)*Math.cos(l)*Math.cos(u)),r=Math.asin(Math.cos(l)*Math.sin(u)/Math.cos(t)),e.x=this.long0-r/this.alfa,v=t,b=0;var A=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(v))/(1-this.e*Math.sin(v)),this.e/2))-this.s45),Math.abs(v-e.y)<1e-10&&(b=1),v=e.y,A+=1;while(b===0&&A<15);return A>=15?null:e}var ez=["Krovak","krovak"],hC={init:Jk,forward:Qk,inverse:Kk,names:ez};function Wr(e,t,r,l,u){return e*u-t*Math.sin(2*u)+r*Math.sin(4*u)-l*Math.sin(6*u)}function Js(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function Qs(e){return .375*e*(1+.25*e*(1+.46875*e))}function Ks(e){return .05859375*e*e*(1+.75*e)}function ea(e){return e*e*e*(35/3072)}function ta(e,t,r){var l=t*r;return e/Math.sqrt(1-l*l)}function Yo(e){return Math.abs(e)<Ze?e:e-cs(e)*Math.PI}function Hl(e,t,r,l,u){var o,m;o=e/t;for(var v=0;v<15;v++)if(m=(e-(t*o-r*Math.sin(2*o)+l*Math.sin(4*o)-u*Math.sin(6*o)))/(t-2*r*Math.cos(2*o)+4*l*Math.cos(4*o)-6*u*Math.cos(6*o)),o+=m,Math.abs(m)<=1e-10)return o;return NaN}function tz(){this.sphere||(this.e0=Js(this.es),this.e1=Qs(this.es),this.e2=Ks(this.es),this.e3=ea(this.es),this.ml0=this.a*Wr(this.e0,this.e1,this.e2,this.e3,this.lat0))}function iz(e){var t,r,l=e.x,u=e.y;if(l=et(l-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(u)*Math.sin(l)),r=this.a*(Math.atan2(Math.tan(u),Math.cos(l))-this.lat0);else{var o=Math.sin(u),m=Math.cos(u),v=ta(this.a,this.e,o),b=Math.tan(u)*Math.tan(u),C=l*Math.cos(u),A=C*C,B=this.es*m*m/(1-this.es),Z=this.a*Wr(this.e0,this.e1,this.e2,this.e3,u);t=v*C*(1-A*b*(1/6-(8-b+8*B)*A/120)),r=Z-this.ml0+v*o/m*A*(.5+(5-b+6*B)*A/24)}return e.x=t+this.x0,e.y=r+this.y0,e}function rz(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,l,u;if(this.sphere){var o=r+this.lat0;l=Math.asin(Math.sin(o)*Math.cos(t)),u=Math.atan2(Math.tan(t),Math.cos(o))}else{var m=this.ml0/this.a+r,v=Hl(m,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(v)-Ze)<=Je)return e.x=this.long0,e.y=Ze,r<0&&(e.y*=-1),e;var b=ta(this.a,this.e,Math.sin(v)),C=b*b*b/this.a/this.a*(1-this.es),A=Math.pow(Math.tan(v),2),B=t*this.a/b,Z=B*B;l=v-b*Math.tan(v)/C*B*B*(.5-(1+3*A)*B*B/24),u=B*(1-Z*(A/3+(1+3*A)*A*Z/15))/Math.cos(v)}return e.x=et(u+this.long0),e.y=Yo(l),e}var nz=["Cassini","Cassini_Soldner","cass"],dC={init:tz,forward:iz,inverse:rz,names:nz};function qo(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var oz=1,sz=2,az=3,lz=4;function uz(){var e=Math.abs(this.lat0);if(Math.abs(e-Ze)<Je?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<Je?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=qo(this.e,1),this.mmf=.5/(1-this.es),this.apa=vz(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=qo(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function cz(e){var t,r,l,u,o,m,v,b,C,A,B=e.x,Z=e.y;if(B=et(B-this.long0),this.sphere){if(o=Math.sin(Z),A=Math.cos(Z),l=Math.cos(B),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+A*l:1+this.sinph0*o+this.cosph0*A*l,r<=Je)return null;r=Math.sqrt(2/r),t=r*A*Math.sin(B),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*A*l}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(l=-l),Math.abs(Z+this.lat0)<Je)return null;r=mi-Z*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),t=r*Math.sin(B),r*=l}}else{switch(v=0,b=0,C=0,l=Math.cos(B),u=Math.sin(B),o=Math.sin(Z),m=qo(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(v=m/this.qp,b=Math.sqrt(1-v*v)),this.mode){case this.OBLIQ:C=1+this.sinb1*v+this.cosb1*b*l;break;case this.EQUIT:C=1+b*l;break;case this.N_POLE:C=Ze+Z,m=this.qp-m;break;case this.S_POLE:C=Z-Ze,m=this.qp+m;break}if(Math.abs(C)<Je)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:C=Math.sqrt(2/C),this.mode===this.OBLIQ?r=this.ymf*C*(this.cosb1*v-this.sinb1*b*l):r=(C=Math.sqrt(2/(1+b*l)))*v*this.ymf,t=this.xmf*C*b*u;break;case this.N_POLE:case this.S_POLE:m>=0?(t=(C=Math.sqrt(m))*u,r=l*(this.mode===this.S_POLE?C:-C)):t=r=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e}function hz(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,l,u,o,m,v,b,C;if(this.sphere){var A=0,B,Z=0;if(B=Math.sqrt(t*t+r*r),u=B*.5,u>1)return null;switch(u=2*Math.asin(u),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(Z=Math.sin(u),A=Math.cos(u)),this.mode){case this.EQUIT:u=Math.abs(B)<=Je?0:Math.asin(r*Z/B),t*=Z,r=A*B;break;case this.OBLIQ:u=Math.abs(B)<=Je?this.lat0:Math.asin(A*this.sinph0+r*Z*this.cosph0/B),t*=Z*this.cosph0,r=(A-Math.sin(u)*this.sinph0)*B;break;case this.N_POLE:r=-r,u=Ze-u;break;case this.S_POLE:u-=Ze;break}l=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,r)}else{if(C=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,r*=this.dd,b=Math.sqrt(t*t+r*r),b<Je)return e.x=this.long0,e.y=this.lat0,e;m=2*Math.asin(.5*b/this.rq),o=Math.cos(m),t*=m=Math.sin(m),this.mode===this.OBLIQ?(C=o*this.sinb1+r*m*this.cosb1/b,v=this.qp*C,r=b*this.cosb1*o-r*this.sinb1*m):(C=r*m/b,v=this.qp*C,r=b*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),v=t*t+r*r,!v)return e.x=this.long0,e.y=this.lat0,e;C=1-v/this.qp,this.mode===this.S_POLE&&(C=-C)}l=Math.atan2(t,r),u=xz(Math.asin(C),this.apa)}return e.x=et(this.long0+l),e.y=u,e}var dz=.3333333333333333,pz=.17222222222222222,fz=.10257936507936508,mz=.06388888888888888,gz=.0664021164021164,yz=.016415012942191543;function vz(e){var t,r=[];return r[0]=e*dz,t=e*e,r[0]+=t*pz,r[1]=t*mz,t*=e,r[0]+=t*fz,r[1]+=t*gz,r[2]=t*yz,r}function xz(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var _z=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],pC={init:uz,forward:cz,inverse:hz,names:_z,S_POLE:oz,N_POLE:sz,EQUIT:az,OBLIQ:lz};function io(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function bz(){Math.abs(this.lat1+this.lat2)<Je||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=wn(this.e3,this.sin_po,this.cos_po),this.qs1=qo(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=wn(this.e3,this.sin_po,this.cos_po),this.qs2=qo(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qo(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>Je?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function wz(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var l=qo(this.e3,this.sin_phi,this.cos_phi),u=this.a*Math.sqrt(this.c-this.ns0*l)/this.ns0,o=this.ns0*et(t-this.long0),m=u*Math.sin(o)+this.x0,v=this.rh-u*Math.cos(o)+this.y0;return e.x=m,e.y=v,e}function Iz(e){var t,r,l,u,o,m;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),l=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),l=-1),u=0,t!==0&&(u=Math.atan2(l*e.x,l*e.y)),l=t*this.ns0/this.a,this.sphere?m=Math.asin((this.c-l*l)/(2*this.ns0)):(r=(this.c-l*l)/this.ns0,m=this.phi1z(this.e3,r)),o=et(u/this.ns0+this.long0),e.x=o,e.y=m,e}function Sz(e,t){var r,l,u,o,m,v=io(.5*t);if(e<Je)return v;for(var b=e*e,C=1;C<=25;C++)if(r=Math.sin(v),l=Math.cos(v),u=e*r,o=1-u*u,m=.5*o*o/l*(t/(1-b)-r/o+.5/e*Math.log((1-u)/(1+u))),v=v+m,Math.abs(m)<=1e-7)return v;return null}var Cz=["Albers_Conic_Equal_Area","Albers","aea"],fC={init:bz,forward:wz,inverse:Iz,names:Cz,phi1z:Sz};function Mz(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Ez(e){var t,r,l,u,o,m,v,b,C=e.x,A=e.y;return l=et(C-this.long0),t=Math.sin(A),r=Math.cos(A),u=Math.cos(l),m=this.sin_p14*t+this.cos_p14*r*u,o=1,m>0||Math.abs(m)<=Je?(v=this.x0+this.a*o*r*Math.sin(l)/m,b=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*u)/m):(v=this.x0+this.infinity_dist*r*Math.sin(l),b=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*u)),e.x=v,e.y=b,e}function Az(e){var t,r,l,u,o,m;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(u=Math.atan2(t,this.rc),r=Math.sin(u),l=Math.cos(u),m=io(l*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.atan2(e.x*r,t*this.cos_p14*l-e.y*this.sin_p14*r),o=et(this.long0+o)):(m=this.phic0,o=0),e.x=o,e.y=m,e}var Tz=["gnom"],mC={init:Mz,forward:Ez,inverse:Az,names:Tz};function gC(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*Ze:Ze;for(var l=Math.asin(.5*t),u,o,m,v,b=0;b<30;b++)if(o=Math.sin(l),m=Math.cos(l),v=e*o,u=Math.pow(1-v*v,2)/(2*m)*(t/(1-e*e)-o/(1-v*v)+.5/e*Math.log((1-v)/(1+v))),l+=u,Math.abs(u)<=1e-10)return l;return NaN}function Pz(){this.sphere||(this.k0=wn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function kz(e){var t=e.x,r=e.y,l,u,o=et(t-this.long0);if(this.sphere)l=this.x0+this.a*o*Math.cos(this.lat_ts),u=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var m=qo(this.e,Math.sin(r));l=this.x0+this.a*this.k0*o,u=this.y0+this.a*m*.5/this.k0}return e.x=l,e.y=u,e}function zz(e){e.x-=this.x0,e.y-=this.y0;var t,r;return this.sphere?(t=et(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=gC(this.e,2*e.y*this.k0/this.a),t=et(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e}var Lz=["cea"],yC={init:Pz,forward:kz,inverse:zz,names:Lz};function Rz(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Dz(e){var t=e.x,r=e.y,l=et(t-this.long0),u=Yo(r-this.lat0);return e.x=this.x0+this.a*l*this.rc,e.y=this.y0+this.a*u,e}function Bz(e){var t=e.x,r=e.y;return e.x=et(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Yo(this.lat0+(r-this.y0)/this.a),e}var Nz=["Equirectangular","Equidistant_Cylindrical","eqc"],vC={init:Rz,forward:Dz,inverse:Bz,names:Nz};var xC=20;function Fz(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Js(this.es),this.e1=Qs(this.es),this.e2=Ks(this.es),this.e3=ea(this.es),this.ml0=this.a*Wr(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Oz(e){var t=e.x,r=e.y,l,u,o,m=et(t-this.long0);if(o=m*Math.sin(r),this.sphere)Math.abs(r)<=Je?(l=this.a*m,u=-1*this.a*this.lat0):(l=this.a*Math.sin(o)/Math.tan(r),u=this.a*(Yo(r-this.lat0)+(1-Math.cos(o))/Math.tan(r)));else if(Math.abs(r)<=Je)l=this.a*m,u=-1*this.ml0;else{var v=ta(this.a,this.e,Math.sin(r))/Math.tan(r);l=v*Math.sin(o),u=this.a*Wr(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+v*(1-Math.cos(o))}return e.x=l+this.x0,e.y=u+this.y0,e}function Gz(e){var t,r,l,u,o,m,v,b,C;if(l=e.x-this.x0,u=e.y-this.y0,this.sphere)if(Math.abs(u+this.a*this.lat0)<=Je)t=et(l/this.a+this.long0),r=0;else{m=this.lat0+u/this.a,v=l*l/this.a/this.a+m*m,b=m;var A;for(o=xC;o;--o)if(A=Math.tan(b),C=-1*(m*(b*A+1)-b-.5*(b*b+v)*A)/((b-m)/A-1),b+=C,Math.abs(C)<=Je){r=b;break}t=et(this.long0+Math.asin(l*Math.tan(b)/this.a)/Math.sin(r))}else if(Math.abs(u+this.ml0)<=Je)r=0,t=et(this.long0+l/this.a);else{m=(this.ml0+u)/this.a,v=l*l/this.a/this.a+m*m,b=m;var B,Z,q,ee,le;for(o=xC;o;--o)if(le=this.e*Math.sin(b),B=Math.sqrt(1-le*le)*Math.tan(b),Z=this.a*Wr(this.e0,this.e1,this.e2,this.e3,b),q=this.e0-2*this.e1*Math.cos(2*b)+4*this.e2*Math.cos(4*b)-6*this.e3*Math.cos(6*b),ee=Z/this.a,C=(m*(B*ee+1)-ee-.5*B*(ee*ee+v))/(this.es*Math.sin(2*b)*(ee*ee+v-2*m*ee)/(4*B)+(m-ee)*(B*q-2/Math.sin(2*b))-q),b-=C,Math.abs(C)<=Je){r=b;break}B=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=et(this.long0+Math.asin(l*B/this.a)/Math.sin(r))}return e.x=t,e.y=r,e}var Vz=["Polyconic","poly"],_C={init:Fz,forward:Oz,inverse:Gz,names:Vz};function Uz(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Wz(e){var t,r=e.x,l=e.y,u=l-this.lat0,o=r-this.long0,m=u/Ul*1e-5,v=o,b=1,C=0;for(t=1;t<=10;t++)b=b*m,C=C+this.A[t]*b;var A=C,B=v,Z=1,q=0,ee,le,de=0,H=0;for(t=1;t<=6;t++)ee=Z*A-q*B,le=q*A+Z*B,Z=ee,q=le,de=de+this.B_re[t]*Z-this.B_im[t]*q,H=H+this.B_im[t]*Z+this.B_re[t]*q;return e.x=H*this.a+this.x0,e.y=de*this.a+this.y0,e}function Zz(e){var t,r=e.x,l=e.y,u=r-this.x0,o=l-this.y0,m=o/this.a,v=u/this.a,b=1,C=0,A,B,Z=0,q=0;for(t=1;t<=6;t++)A=b*m-C*v,B=C*m+b*v,b=A,C=B,Z=Z+this.C_re[t]*b-this.C_im[t]*C,q=q+this.C_im[t]*b+this.C_re[t]*C;for(var ee=0;ee<this.iterations;ee++){var le=Z,de=q,H,Q,te=m,ve=v;for(t=2;t<=6;t++)H=le*Z-de*q,Q=de*Z+le*q,le=H,de=Q,te=te+(t-1)*(this.B_re[t]*le-this.B_im[t]*de),ve=ve+(t-1)*(this.B_im[t]*le+this.B_re[t]*de);le=1,de=0;var Ce=this.B_re[1],Se=this.B_im[1];for(t=2;t<=6;t++)H=le*Z-de*q,Q=de*Z+le*q,le=H,de=Q,Ce=Ce+t*(this.B_re[t]*le-this.B_im[t]*de),Se=Se+t*(this.B_im[t]*le+this.B_re[t]*de);var Be=Ce*Ce+Se*Se;Z=(te*Ce+ve*Se)/Be,q=(ve*Ce-te*Se)/Be}var Fe=Z,qe=q,ht=1,At=0;for(t=1;t<=9;t++)ht=ht*Fe,At=At+this.D[t]*ht;var Ot=this.lat0+At*Ul*1e5,Yt=this.long0+qe;return e.x=Yt,e.y=Ot,e}var jz=["New_Zealand_Map_Grid","nzmg"],bC={init:Uz,forward:Wz,inverse:Zz,names:jz};function Hz(){}function Xz(e){var t=e.x,r=e.y,l=et(t-this.long0),u=this.x0+this.a*l,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return e.x=u,e.y=o,e}function $z(e){e.x-=this.x0,e.y-=this.y0;var t=et(this.long0+e.x/this.a),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e}var Yz=["Miller_Cylindrical","mill"],wC={init:Hz,forward:Xz,inverse:$z,names:Yz};var qz=20;function Jz(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Wm(this.es)}function Qz(e){var t,r,l=e.x,u=e.y;if(l=et(l-this.long0),this.sphere){if(!this.m)u=this.n!==1?Math.asin(this.n*Math.sin(u)):u;else for(var o=this.n*Math.sin(u),m=qz;m;--m){var v=(this.m*u+Math.sin(u)-o)/(this.m+Math.cos(u));if(u-=v,Math.abs(v)<Je)break}t=this.a*this.C_x*l*(this.m+Math.cos(u)),r=this.a*this.C_y*u}else{var b=Math.sin(u),C=Math.cos(u);r=this.a*jl(u,b,C,this.en),t=this.a*l*C/Math.sqrt(1-this.es*b*b)}return e.x=t,e.y=r,e}function Kz(e){var t,r,l,u;return e.x-=this.x0,l=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,l=l/(this.C_x*(this.m+Math.cos(t))),this.m?t=io((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=io(Math.sin(t)/this.n)),l=et(l+this.long0),t=Yo(t)):(t=Zm(e.y/this.a,this.es,this.en),u=Math.abs(t),u<Ze?(u=Math.sin(t),r=this.long0+e.x*Math.sqrt(1-this.es*u*u)/(this.a*Math.cos(t)),l=et(r)):u-Je<Ze&&(l=this.long0)),e.x=l,e.y=t,e}var eL=["Sinusoidal","sinu"],IC={init:Jz,forward:Qz,inverse:Kz,names:eL};function tL(){}function iL(e){for(var t=e.x,r=e.y,l=et(t-this.long0),u=r,o=Math.PI*Math.sin(r);;){var m=-(u+Math.sin(u)-o)/(1+Math.cos(u));if(u+=m,Math.abs(m)<Je)break}u/=2,Math.PI/2-Math.abs(r)<Je&&(l=0);var v=.900316316158*this.a*l*Math.cos(u)+this.x0,b=1.4142135623731*this.a*Math.sin(u)+this.y0;return e.x=v,e.y=b,e}function rL(e){var t,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),t=Math.asin(r);var l=et(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));l<-Math.PI&&(l=-Math.PI),l>Math.PI&&(l=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var u=Math.asin(r);return e.x=l,e.y=u,e}var nL=["Mollweide","moll"],SC={init:tL,forward:iL,inverse:rL,names:nL};function oL(){Math.abs(this.lat1+this.lat2)<Je||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Js(this.es),this.e1=Qs(this.es),this.e2=Ks(this.es),this.e3=ea(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=wn(this.e,this.sinphi,this.cosphi),this.ml1=Wr(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Je?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=wn(this.e,this.sinphi,this.cosphi),this.ml2=Wr(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Wr(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function sL(e){var t=e.x,r=e.y,l;if(this.sphere)l=this.a*(this.g-r);else{var u=Wr(this.e0,this.e1,this.e2,this.e3,r);l=this.a*(this.g-u)}var o=this.ns*et(t-this.long0),m=this.x0+l*Math.sin(o),v=this.y0+this.rh-l*Math.cos(o);return e.x=m,e.y=v,e}function aL(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,r,l,u;this.ns>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var o=0;if(r!==0&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere)return u=et(this.long0+o/this.ns),l=Yo(this.g-r/this.a),e.x=u,e.y=l,e;var m=this.g-r/this.a;return l=Hl(m,this.e0,this.e1,this.e2,this.e3),u=et(this.long0+o/this.ns),e.x=u,e.y=l,e}var lL=["Equidistant_Conic","eqdc"],CC={init:oL,forward:sL,inverse:aL,names:lL};function uL(){this.R=this.a}function cL(e){var t=e.x,r=e.y,l=et(t-this.long0),u,o;Math.abs(r)<=Je&&(u=this.x0+this.R*l,o=this.y0);var m=io(2*Math.abs(r/Math.PI));(Math.abs(l)<=Je||Math.abs(Math.abs(r)-Ze)<=Je)&&(u=this.x0,r>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*m):o=this.y0+Math.PI*this.R*-Math.tan(.5*m));var v=.5*Math.abs(Math.PI/l-l/Math.PI),b=v*v,C=Math.sin(m),A=Math.cos(m),B=A/(C+A-1),Z=B*B,q=B*(2/C-1),ee=q*q,le=Math.PI*this.R*(v*(B-ee)+Math.sqrt(b*(B-ee)*(B-ee)-(ee+b)*(Z-ee)))/(ee+b);l<0&&(le=-le),u=this.x0+le;var de=b+B;return le=Math.PI*this.R*(q*de-v*Math.sqrt((ee+b)*(b+1)-de*de))/(ee+b),r>=0?o=this.y0+le:o=this.y0-le,e.x=u,e.y=o,e}function hL(e){var t,r,l,u,o,m,v,b,C,A,B,Z,q;return e.x-=this.x0,e.y-=this.y0,B=Math.PI*this.R,l=e.x/B,u=e.y/B,o=l*l+u*u,m=-Math.abs(u)*(1+o),v=m-2*u*u+l*l,b=-2*m+1+2*u*u+o*o,q=u*u/b+(2*v*v*v/b/b/b-9*m*v/b/b)/27,C=(m-v*v/3/b)/b,A=2*Math.sqrt(-C/3),B=3*q/C/A,Math.abs(B)>1&&(B>=0?B=1:B=-1),Z=Math.acos(B)/3,e.y>=0?r=(-A*Math.cos(Z+Math.PI/3)-v/3/b)*Math.PI:r=-(-A*Math.cos(Z+Math.PI/3)-v/3/b)*Math.PI,Math.abs(l)<Je?t=this.long0:t=et(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(l*l-u*u)+o*o))/2/l),e.x=t,e.y=r,e}var dL=["Van_der_Grinten_I","VanDerGrinten","vandg"],MC={init:uL,forward:cL,inverse:hL,names:dL};function pL(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function fL(e){var t=e.x,r=e.y,l=Math.sin(e.y),u=Math.cos(e.y),o=et(t-this.long0),m,v,b,C,A,B,Z,q,ee,le,de,H,Q,te,ve,Ce,Se,Be,Fe,qe,ht,At,Ot;return this.sphere?Math.abs(this.sin_p12-1)<=Je?(e.x=this.x0+this.a*(Ze-r)*Math.sin(o),e.y=this.y0-this.a*(Ze-r)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Je?(e.x=this.x0+this.a*(Ze+r)*Math.sin(o),e.y=this.y0+this.a*(Ze+r)*Math.cos(o),e):(Be=this.sin_p12*l+this.cos_p12*u*Math.cos(o),Ce=Math.acos(Be),Se=Ce?Ce/Math.sin(Ce):1,e.x=this.x0+this.a*Se*u*Math.sin(o),e.y=this.y0+this.a*Se*(this.cos_p12*l-this.sin_p12*u*Math.cos(o)),e):(m=Js(this.es),v=Qs(this.es),b=Ks(this.es),C=ea(this.es),Math.abs(this.sin_p12-1)<=Je?(A=this.a*Wr(m,v,b,C,Ze),B=this.a*Wr(m,v,b,C,r),e.x=this.x0+(A-B)*Math.sin(o),e.y=this.y0-(A-B)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Je?(A=this.a*Wr(m,v,b,C,Ze),B=this.a*Wr(m,v,b,C,r),e.x=this.x0+(A+B)*Math.sin(o),e.y=this.y0+(A+B)*Math.cos(o),e):(Z=l/u,q=ta(this.a,this.e,this.sin_p12),ee=ta(this.a,this.e,l),le=Math.atan((1-this.es)*Z+this.es*q*this.sin_p12/(ee*u)),de=Math.atan2(Math.sin(o),this.cos_p12*Math.tan(le)-this.sin_p12*Math.cos(o)),de===0?Fe=Math.asin(this.cos_p12*Math.sin(le)-this.sin_p12*Math.cos(le)):Math.abs(Math.abs(de)-Math.PI)<=Je?Fe=-Math.asin(this.cos_p12*Math.sin(le)-this.sin_p12*Math.cos(le)):Fe=Math.asin(Math.sin(o)*Math.cos(le)/Math.sin(de)),H=this.e*this.sin_p12/Math.sqrt(1-this.es),Q=this.e*this.cos_p12*Math.cos(de)/Math.sqrt(1-this.es),te=H*Q,ve=Q*Q,qe=Fe*Fe,ht=qe*Fe,At=ht*Fe,Ot=At*Fe,Ce=q*Fe*(1-qe*ve*(1-ve)/6+ht/8*te*(1-2*ve)+At/120*(ve*(4-7*ve)-3*H*H*(1-7*ve))-Ot/48*te),e.x=this.x0+Ce*Math.sin(de),e.y=this.y0+Ce*Math.cos(de),e))}function mL(e){e.x-=this.x0,e.y-=this.y0;var t,r,l,u,o,m,v,b,C,A,B,Z,q,ee,le,de,H,Q,te,ve,Ce,Se,Be,Fe;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*Ze*this.a?void 0:(r=t/this.a,l=Math.sin(r),u=Math.cos(r),o=this.long0,Math.abs(t)<=Je?m=this.lat0:(m=io(u*this.sin_p12+e.y*l*this.cos_p12/t),v=Math.abs(this.lat0)-Ze,Math.abs(v)<=Je?this.lat0>=0?o=et(this.long0+Math.atan2(e.x,-e.y)):o=et(this.long0-Math.atan2(-e.x,e.y)):o=et(this.long0+Math.atan2(e.x*l,t*this.cos_p12*u-e.y*this.sin_p12*l))),e.x=o,e.y=m,e)):(b=Js(this.es),C=Qs(this.es),A=Ks(this.es),B=ea(this.es),Math.abs(this.sin_p12-1)<=Je?(Z=this.a*Wr(b,C,A,B,Ze),t=Math.sqrt(e.x*e.x+e.y*e.y),q=Z-t,m=Hl(q/this.a,b,C,A,B),o=et(this.long0+Math.atan2(e.x,-1*e.y)),e.x=o,e.y=m,e):Math.abs(this.sin_p12+1)<=Je?(Z=this.a*Wr(b,C,A,B,Ze),t=Math.sqrt(e.x*e.x+e.y*e.y),q=t-Z,m=Hl(q/this.a,b,C,A,B),o=et(this.long0+Math.atan2(e.x,e.y)),e.x=o,e.y=m,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),de=Math.atan2(e.x,e.y),ee=ta(this.a,this.e,this.sin_p12),H=Math.cos(de),Q=this.e*this.cos_p12*H,te=-Q*Q/(1-this.es),ve=3*this.es*(1-te)*this.sin_p12*this.cos_p12*H/(1-this.es),Ce=t/ee,Se=Ce-te*(1+te)*Math.pow(Ce,3)/6-ve*(1+3*te)*Math.pow(Ce,4)/24,Be=1-te*Se*Se/2-Ce*Se*Se*Se/6,le=Math.asin(this.sin_p12*Math.cos(Se)+this.cos_p12*Math.sin(Se)*H),o=et(this.long0+Math.asin(Math.sin(de)*Math.sin(Se)/Math.cos(le))),Fe=Math.sin(le),m=Math.atan2((Fe-this.es*Be*this.sin_p12)*Math.tan(le),Fe*(1-this.es)),e.x=o,e.y=m,e))}var gL=["Azimuthal_Equidistant","aeqd"],EC={init:pL,forward:fL,inverse:mL,names:gL};function yL(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function vL(e){var t,r,l,u,o,m,v,b,C=e.x,A=e.y;return l=et(C-this.long0),t=Math.sin(A),r=Math.cos(A),u=Math.cos(l),m=this.sin_p14*t+this.cos_p14*r*u,o=1,(m>0||Math.abs(m)<=Je)&&(v=this.a*o*r*Math.sin(l),b=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*u)),e.x=v,e.y=b,e}function xL(e){var t,r,l,u,o,m,v;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=io(t/this.a),l=Math.sin(r),u=Math.cos(r),m=this.long0,Math.abs(t)<=Je?(v=this.lat0,e.x=m,e.y=v,e):(v=io(u*this.sin_p14+e.y*l*this.cos_p14/t),o=Math.abs(this.lat0)-Ze,Math.abs(o)<=Je?(this.lat0>=0?m=et(this.long0+Math.atan2(e.x,-e.y)):m=et(this.long0-Math.atan2(-e.x,e.y)),e.x=m,e.y=v,e):(m=et(this.long0+Math.atan2(e.x*l,t*this.cos_p14*u-e.y*this.sin_p14*l)),e.x=m,e.y=v,e))}var _L=["ortho"],AC={init:yL,forward:vL,inverse:xL,names:_L};var yr={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ki={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function bL(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Ze-mi/2?this.face=yr.TOP:this.lat0<=-(Ze-mi/2)?this.face=yr.BOTTOM:Math.abs(this.long0)<=mi?this.face=yr.FRONT:Math.abs(this.long0)<=Ze+mi?this.face=this.long0>0?yr.RIGHT:yr.LEFT:this.face=yr.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function wL(e){var t={x:0,y:0},r,l,u,o,m,v,b={value:0};if(e.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):r=e.y,l=e.x,this.face===yr.TOP)o=Ze-r,l>=mi&&l<=Ze+mi?(b.value=ki.AREA_0,u=l-Ze):l>Ze+mi||l<=-(Ze+mi)?(b.value=ki.AREA_1,u=l>0?l-gr:l+gr):l>-(Ze+mi)&&l<=-mi?(b.value=ki.AREA_2,u=l+Ze):(b.value=ki.AREA_3,u=l);else if(this.face===yr.BOTTOM)o=Ze+r,l>=mi&&l<=Ze+mi?(b.value=ki.AREA_0,u=-l+Ze):l<mi&&l>=-mi?(b.value=ki.AREA_1,u=-l):l<-mi&&l>=-(Ze+mi)?(b.value=ki.AREA_2,u=-l-Ze):(b.value=ki.AREA_3,u=l>0?-l+gr:-l-gr);else{var C,A,B,Z,q,ee,le;this.face===yr.RIGHT?l=Tc(l,+Ze):this.face===yr.BACK?l=Tc(l,+gr):this.face===yr.LEFT&&(l=Tc(l,-Ze)),Z=Math.sin(r),q=Math.cos(r),ee=Math.sin(l),le=Math.cos(l),C=q*le,A=q*ee,B=Z,this.face===yr.FRONT?(o=Math.acos(C),u=Ym(o,B,A,b)):this.face===yr.RIGHT?(o=Math.acos(A),u=Ym(o,B,-C,b)):this.face===yr.BACK?(o=Math.acos(-C),u=Ym(o,B,-A,b)):this.face===yr.LEFT?(o=Math.acos(-A),u=Ym(o,B,C,b)):(o=u=0,b.value=ki.AREA_0)}return v=Math.atan(12/gr*(u+Math.acos(Math.sin(u)*Math.cos(mi))-Ze)),m=Math.sqrt((1-Math.cos(o))/(Math.cos(v)*Math.cos(v))/(1-Math.cos(Math.atan(1/Math.cos(u))))),b.value===ki.AREA_1?v+=Ze:b.value===ki.AREA_2?v+=gr:b.value===ki.AREA_3&&(v+=1.5*gr),t.x=m*Math.cos(v),t.y=m*Math.sin(v),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function IL(e){var t={lam:0,phi:0},r,l,u,o,m,v,b,C,A,B={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,l=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),r=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?B.value=ki.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(B.value=ki.AREA_1,r-=Ze):e.x<0&&-e.x>=Math.abs(e.y)?(B.value=ki.AREA_2,r=r<0?r+gr:r-gr):(B.value=ki.AREA_3,r+=Ze),A=gr/12*Math.tan(r),m=Math.sin(A)/(Math.cos(A)-1/Math.sqrt(2)),v=Math.atan(m),u=Math.cos(r),o=Math.tan(l),b=1-u*u*o*o*(1-Math.cos(Math.atan(1/Math.cos(v)))),b<-1?b=-1:b>1&&(b=1),this.face===yr.TOP)C=Math.acos(b),t.phi=Ze-C,B.value===ki.AREA_0?t.lam=v+Ze:B.value===ki.AREA_1?t.lam=v<0?v+gr:v-gr:B.value===ki.AREA_2?t.lam=v-Ze:t.lam=v;else if(this.face===yr.BOTTOM)C=Math.acos(b),t.phi=C-Ze,B.value===ki.AREA_0?t.lam=-v+Ze:B.value===ki.AREA_1?t.lam=-v:B.value===ki.AREA_2?t.lam=-v-Ze:t.lam=v<0?-v-gr:-v+gr;else{var Z,q,ee;Z=b,A=Z*Z,A>=1?ee=0:ee=Math.sqrt(1-A)*Math.sin(v),A+=ee*ee,A>=1?q=0:q=Math.sqrt(1-A),B.value===ki.AREA_1?(A=q,q=-ee,ee=A):B.value===ki.AREA_2?(q=-q,ee=-ee):B.value===ki.AREA_3&&(A=q,q=ee,ee=-A),this.face===yr.RIGHT?(A=Z,Z=-q,q=A):this.face===yr.BACK?(Z=-Z,q=-q):this.face===yr.LEFT&&(A=Z,Z=q,q=-A),t.phi=Math.acos(-ee)-Ze,t.lam=Math.atan2(q,Z),this.face===yr.RIGHT?t.lam=Tc(t.lam,-Ze):this.face===yr.BACK?t.lam=Tc(t.lam,-gr):this.face===yr.LEFT&&(t.lam=Tc(t.lam,+Ze))}if(this.es!==0){var le,de,H;le=t.phi<0?1:0,de=Math.tan(t.phi),H=this.b/Math.sqrt(de*de+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-H*H)/(this.one_minus_f*H)),le&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function Ym(e,t,r,l){var u;return e<Je?(l.value=ki.AREA_0,u=0):(u=Math.atan2(t,r),Math.abs(u)<=mi?l.value=ki.AREA_0:u>mi&&u<=Ze+mi?(l.value=ki.AREA_1,u-=Ze):u>Ze+mi||u<=-(Ze+mi)?(l.value=ki.AREA_2,u=u>=0?u-gr:u+gr):(l.value=ki.AREA_3,u+=Ze)),u}function Tc(e,t){var r=e+t;return r<-gr?r+=Ya:r>+gr&&(r-=Ya),r}var SL=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],TC={init:bL,forward:wL,inverse:IL,names:SL};var D1=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ud=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],PC=.8487,kC=1.3523,zC=Kn/5,CL=1/zC,Pc=18,qm=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},ML=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function EL(e,t,r,l){for(var u=t;l;--l){var o=e(u);if(u-=o,Math.abs(o)<r)break}return u}function AL(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function TL(e){var t=et(e.x-this.long0),r=Math.abs(e.y),l=Math.floor(r*zC);l<0?l=0:l>=Pc&&(l=Pc-1),r=Kn*(r-CL*l);var u={x:qm(D1[l],r)*t,y:qm(Ud[l],r)};return e.y<0&&(u.y=-u.y),u.x=u.x*this.a*PC+this.x0,u.y=u.y*this.a*kC+this.y0,u}function PL(e){var t={x:(e.x-this.x0)/(this.a*PC),y:Math.abs(e.y-this.y0)/(this.a*kC)};if(t.y>=1)t.x/=D1[Pc][0],t.y=e.y<0?-Ze:Ze;else{var r=Math.floor(t.y*Pc);for(r<0?r=0:r>=Pc&&(r=Pc-1);;)if(Ud[r][0]>t.y)--r;else if(Ud[r+1][0]<=t.y)++r;else break;var l=Ud[r],u=5*(t.y-l[0])/(Ud[r+1][0]-l[0]);u=EL(function(o){return(qm(l,o)-t.y)/ML(l,o)},u,Je,100),t.x/=qm(D1[r],u),t.y=(5*r+u)*mr,e.y<0&&(t.y=-t.y)}return t.x=et(t.x+this.long0),t}var kL=["Robinson","robin"],LC={init:AL,forward:TL,inverse:PL,names:kL};function zL(){this.name="geocent"}function LL(e){var t=Om(e,this.es,this.a);return t}function RL(e){var t=Gm(e,this.es,this.a,this.b);return t}var DL=["Geocentric","geocentric","geocent","Geocent"],RC={init:zL,forward:LL,inverse:RL,names:DL};var In={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Wd={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function BL(){if(Object.keys(Wd).forEach(function(r){if(typeof this[r]>"u")this[r]=Wd[r].def;else{if(Wd[r].num&&isNaN(this[r]))throw new Error("Invalid parameter value, must be numeric "+r+" = "+this[r]);Wd[r].num&&(this[r]=parseFloat(this[r]))}Wd[r].degrees&&(this[r]=this[r]*mr)}.bind(this)),Math.abs(Math.abs(this.lat0)-Ze)<Je?this.mode=this.lat0<0?In.S_POLE:In.N_POLE:Math.abs(this.lat0)<Je?this.mode=In.EQUIT:(this.mode=In.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function NL(e){e.x-=this.long0;var t=Math.sin(e.y),r=Math.cos(e.y),l=Math.cos(e.x),u,o;switch(this.mode){case In.OBLIQ:o=this.sinph0*t+this.cosph0*r*l;break;case In.EQUIT:o=r*l;break;case In.S_POLE:o=-t;break;case In.N_POLE:o=t;break}switch(o=this.pn1/(this.p-o),u=o*r*Math.sin(e.x),this.mode){case In.OBLIQ:o*=this.cosph0*t-this.sinph0*r*l;break;case In.EQUIT:o*=t;break;case In.N_POLE:o*=-(r*l);break;case In.S_POLE:o*=r*l;break}var m,v;return m=o*this.cg+u*this.sg,v=1/(m*this.sw*this.h1+this.cw),u=(u*this.cg-o*this.sg)*this.cw*v,o=m*v,e.x=u*this.a,e.y=o*this.a,e}function FL(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},r,l,u;u=1/(this.pn1-e.y*this.sw),r=this.pn1*e.x*u,l=this.pn1*e.y*this.cw*u,e.x=r*this.cg+l*this.sg,e.y=l*this.cg-r*this.sg;var o=Gn(e.x,e.y);if(Math.abs(o)<Je)t.x=0,t.y=e.y;else{var m,v;switch(v=1-o*o*this.pfact,v=(this.p-Math.sqrt(v))/(this.pn1/o+o/this.pn1),m=Math.sqrt(1-v*v),this.mode){case In.OBLIQ:t.y=Math.asin(m*this.sinph0+e.y*v*this.cosph0/o),e.y=(m-this.sinph0*Math.sin(t.y))*o,e.x*=v*this.cosph0;break;case In.EQUIT:t.y=Math.asin(e.y*v/o),e.y=m*o,e.x*=v;break;case In.N_POLE:t.y=Math.asin(m),e.y=-e.y;break;case In.S_POLE:t.y=-Math.asin(m);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var OL=["Tilted_Perspective","tpers"],DC={init:BL,forward:NL,inverse:FL,names:OL};function GL(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function VL(e){var t=e.x,r=e.y,l,u,o,m;if(t=t-this.long0,this.shape==="ellipse"){r=Math.atan(this.radius_p2*Math.tan(r));var v=this.radius_p/Gn(this.radius_p*Math.cos(r),Math.sin(r));if(u=v*Math.cos(t)*Math.cos(r),o=v*Math.sin(t)*Math.cos(r),m=v*Math.sin(r),(this.radius_g-u)*u-o*o-m*m*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;l=this.radius_g-u,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/Gn(m,l)),e.y=this.radius_g_1*Math.atan(m/l)):(e.x=this.radius_g_1*Math.atan(o/l),e.y=this.radius_g_1*Math.atan(m/Gn(o,l)))}else this.shape==="sphere"&&(l=Math.cos(r),u=Math.cos(t)*l,o=Math.sin(t)*l,m=Math.sin(r),l=this.radius_g-u,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/Gn(m,l)),e.y=this.radius_g_1*Math.atan(m/l)):(e.x=this.radius_g_1*Math.atan(o/l),e.y=this.radius_g_1*Math.atan(m/Gn(o,l))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function UL(e){var t=-1,r=0,l=0,u,o,m,v;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(l=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Gn(1,l)):(r=Math.tan(e.x/this.radius_g_1),l=Math.tan(e.y/this.radius_g_1)*Gn(1,r));var b=l/this.radius_p;if(u=r*r+b*b+t*t,o=2*this.radius_g*t,m=o*o-4*u*this.C,m<0)return e.x=Number.NaN,e.y=Number.NaN,e;v=(-o-Math.sqrt(m))/(2*u),t=this.radius_g+v*t,r*=v,l*=v,e.x=Math.atan2(r,t),e.y=Math.atan(l*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(l=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+l*l)):(r=Math.tan(e.x/this.radius_g_1),l=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+r*r)),u=r*r+l*l+t*t,o=2*this.radius_g*t,m=o*o-4*u*this.C,m<0)return e.x=Number.NaN,e.y=Number.NaN,e;v=(-o-Math.sqrt(m))/(2*u),t=this.radius_g+v*t,r*=v,l*=v,e.x=Math.atan2(r,t),e.y=Math.atan(l*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var WL=["Geostationary Satellite View","Geostationary_Satellite","geos"],BC={init:GL,forward:VL,inverse:UL,names:WL};function NC(e){e.Proj.projections.add(Mc),e.Proj.projections.add(Ec),e.Proj.projections.add(oC),e.Proj.projections.add(sC),e.Proj.projections.add(aC),e.Proj.projections.add(lC),e.Proj.projections.add(uC),e.Proj.projections.add(cC),e.Proj.projections.add(hC),e.Proj.projections.add(dC),e.Proj.projections.add(pC),e.Proj.projections.add(fC),e.Proj.projections.add(mC),e.Proj.projections.add(yC),e.Proj.projections.add(vC),e.Proj.projections.add(_C),e.Proj.projections.add(bC),e.Proj.projections.add(wC),e.Proj.projections.add(IC),e.Proj.projections.add(SC),e.Proj.projections.add(CC),e.Proj.projections.add(MC),e.Proj.projections.add(EC),e.Proj.projections.add(AC),e.Proj.projections.add(TC),e.Proj.projections.add(LC),e.Proj.projections.add(RC),e.Proj.projections.add(DC),e.Proj.projections.add(BC)}eo.defaultDatum="WGS84";eo.Proj=qa;eo.WGS84=new eo.Proj("WGS84");eo.Point=qS;eo.toPoint=Um;eo.defs=bc;eo.nadgrid=E1;eo.transform=Zl;eo.mgrs=XS;eo.version="__VERSION__";NC(eo);var kc=eo;var Sn;(function(e){e[e.UInt8=1]="UInt8",e[e.UInt16=2]="UInt16",e[e.UInt32=4]="UInt32",e[e.UInt64=8]="UInt64",e[e.Double=8]="Double",e[e.Float=4]="Float"})(Sn||(Sn={}));var FC=2**32,ZL=typeof setImmediate>"u"?setTimeout:setImmediate,Vn=()=>{throw new Error("Method not implemented.")},hs=class{constructor(){this.isLittleEndian=!0,this.delayMs=hs.DefaultDelayMs,this.maxChunkCount=10,this.chunks=hs.DefaultChunkCache(),this.blankFillCount=16,this.maxConcurrentRequests=50,this.toFetch=new Set,this.toFetchPromise=null,this.byteOffset=0,this.getFloat32=Vn,this.getFloat64=Vn,this.getInt8=Vn,this.getInt16=Vn,this.getInt32=Vn,this.setFloat32=Vn,this.setFloat64=Vn,this.setInt8=Vn,this.setInt16=Vn,this.setInt32=Vn,this.setUint8=Vn,this.setUint16=Vn,this.setUint32=Vn,this.setBigInt64=Vn,this.setBigUint64=Vn}static getByteRanges(t,r=32,l=16){if(t.size===0)return{chunks:[],blankFill:[]};let u=[...t.values()].sort((b,C)=>b-C),o=[],m=[];o.push(m);let v=[];for(let b=0;b<u.length;++b){let C=u[b],A=u[b-1];if(m.length>=r)m=[C],o.push(m);else if(b===0||C===A+1)m.push(C);else if(C<A+l){for(let B=A;B<C;B++)m.push(B+1),v.push(B+1);v.pop()}else m=[C],o.push(m)}return{chunks:o,blankFill:v}}async fetchData(){if(this.toFetch.size===0)return;let t=this.toFetch;this.toFetch=new Set,this.toFetchPromise=null;let r=hs.getByteRanges(t,this.maxChunkCount,this.blankFillCount),l=[];for(let u of r.chunks){let o=u[0],m=u[u.length-1],v=o*this.chunkSize,b=m*this.chunkSize+this.chunkSize-v,C=await this.fetchBytes(v,b);if(u.length===1){l[o]=C,this.chunks.set(o,new DataView(C));continue}let A=o*this.chunkSize;for(let B of u){let Z=B*this.chunkSize-A,q=C.slice(Z,Z+this.chunkSize);l[B]=q,this.chunks.set(B,new DataView(q))}}}async loadBytes(t,r){if(t<0)throw new Error("Offset must be positive");let l=Math.floor(t/this.chunkSize),u=Math.ceil((t+r)/this.chunkSize)-1;for(let o=l;o<=u;o++)this.chunks.has(o)||this.toFetch.add(o);if(this.toFetch.size!==0){if(this.toFetchPromise==null&&(this.toFetchPromise=new Promise(o=>ZL(o,this.delayMs)).then(()=>this.fetchData())),this.toFetch.size>this.maxConcurrentRequests)throw new Error("Too many outstanding requests");await this.toFetchPromise}}getChunkId(t){return Math.floor(t/this.chunkSize)}getUint(t,r){switch(r){case Sn.UInt8:return this.getUint8(t);case Sn.UInt16:return this.getUint16(t);case Sn.UInt32:return this.getUint32(t);case Sn.UInt64:return this.getUint64(t)}}bytes(t,r){let l=this.isOneChunk(t,r);if(l){let C=this.getView(l),A=t-l*this.chunkSize;return new Uint8Array(C.buffer.slice(A,A+r))}let u=new Uint8Array(r),o=t+r,m=Math.floor(t/this.chunkSize),v=Math.ceil((t+r)/this.chunkSize)-1,b=0;for(let C=m;C<=v;C++){let A=t+b,B=C*this.chunkSize,Z=this.getView(C),q=Math.min(o,B+this.chunkSize),ee=Z.buffer.slice(A-B,q-B);u.set(new Uint8Array(ee),b),b+=ee.byteLength}return u}getView(t){let r=this.chunks.get(t);if(r==null)throw new Error(`Chunk:${t} is not ready`);return r}isOneChunk(t,r){let l=t+r-1,u=Math.floor(t/this.chunkSize);return Math.floor(l/this.chunkSize)-u<1?u:null}hasBytes(t,r=1){let l=Math.floor(t/this.chunkSize),u=Math.ceil((t+r)/this.chunkSize)-1;for(let o=l;o<=u;o++)if(!this.chunks.has(o))return!1;return!0}toRange(t,r){if(r==null)return`bytes=${t}`;if(t<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${t}-${t+r}`}parseContentRange(t){let[r,l]=t.split(" ");if(r!=="bytes")throw new Error("Failed to parse content-range: "+t);if(l==null)throw new Error("Failed to parse content-range: "+t);let[,u]=l.split("/"),o=Number(u);if(isNaN(o))throw new Error("Failed to parse content-range: "+t);return o}get buffer(){throw new Error("Method not implemented.")}get byteLength(){if(this._byteLength)return this._byteLength;throw Error(".size() has not been fetched.")}getUint8(t){let r=Math.floor(t/this.chunkSize),l=this.chunks.get(r);if(l==null)throw new Error(`Chunk:${r} is not ready`);return l.getUint8(t-r*this.chunkSize)}getUint16(t){let r=this.isOneChunk(t,Sn.UInt16);if(r!=null)return this.getView(r).getUint16(t-r*this.chunkSize,this.isLittleEndian);let l=this.getUint8(t),u=this.getUint8(t+Sn.UInt8);return this.isLittleEndian?l+(u<<8):(l<<8)+u}getUint32(t){let r=this.isOneChunk(t,Sn.UInt32);if(r!=null)return this.getView(r).getUint32(t-r*this.chunkSize,this.isLittleEndian);let l=this.getUint16(t),u=this.getUint16(t+Sn.UInt16);return this.isLittleEndian?l+u*65536:l*65536+u}getUint64(t){let r=this.isOneChunk(t,Sn.UInt64);if(r!=null){let o=this.getView(r);return Number(o.getBigUint64(t-r*this.chunkSize,this.isLittleEndian))}let l=this.getUint32(t),u=this.getUint32(t+Sn.UInt32);return this.isLittleEndian?l+u*FC:l*FC+u}getBigUint64(t){let r=this.isOneChunk(t,Sn.UInt64);if(r!=null)return this.getView(r).getBigUint64(t-r*this.chunkSize,this.isLittleEndian);let l=BigInt(this.getUint32(t)),u=BigInt(this.getUint32(t+Sn.UInt32));return this.isLittleEndian?l+(u<<BigInt(32)):(l<<BigInt(32))+u}getBigInt64(){throw new Error("Not implemented.")}};hs.DefaultChunkCache=()=>new Map;hs.DefaultDelayMs=1;var zc=class extends Error{constructor(t,r,l){super(t),this.name="CompositeError",this.code=r,this.reason=l}static isCompositeError(t){return typeof t!="object"||t==null?!1:t.name==="CompositeError"}};var jL=/\/$/,HL=/^\//;function OC(e,t){return e.replace(jL,"")+"/"+t.replace(HL,"")}var GC=`PROJCS["NZGD2000 / Chatham Islands TM 2000",
516
+ GEOGCS["NZGD2000",
517
+ DATUM["New_Zealand_Geodetic_Datum_2000",
518
+ SPHEROID["GRS 1980",6378137,298.257222101,
519
+ AUTHORITY["EPSG","7019"]],
520
+ TOWGS84[0,0,0,0,0,0,0],
521
+ AUTHORITY["EPSG","6167"]],
522
+ PRIMEM["Greenwich",0,
523
+ AUTHORITY["EPSG","8901"]],
524
+ UNIT["degree",0.01745329251994328,
525
+ AUTHORITY["EPSG","9122"]],
526
+ AUTHORITY["EPSG","4167"]],
527
+ UNIT["metre",1,
528
+ AUTHORITY["EPSG","9001"]],
529
+ PROJECTION["Transverse_Mercator"],
530
+ PARAMETER["latitude_of_origin",0],
531
+ PARAMETER["central_meridian",-176.5],
532
+ PARAMETER["scale_factor",1],
533
+ PARAMETER["false_easting",3500000],
534
+ PARAMETER["false_northing",10000000],
535
+ AUTHORITY["EPSG","3793"],
536
+ AXIS["Easting",EAST],
537
+ AXIS["Northing",NORTH]]`;var VC=`PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
538
+ GEOGCS["NZGD2000",
539
+ DATUM["New_Zealand_Geodetic_Datum_2000",
540
+ SPHEROID["GRS 1980",6378137,298.257222101,
541
+ AUTHORITY["EPSG","7019"]],
542
+ TOWGS84[0,0,0,0,0,0,0],
543
+ AUTHORITY["EPSG","6167"]],
544
+ PRIMEM["Greenwich",0,
545
+ AUTHORITY["EPSG","8901"]],
546
+ UNIT["degree",0.0174532925199433,
547
+ AUTHORITY["EPSG","9122"]],
548
+ AUTHORITY["EPSG","4167"]],
549
+ PROJECTION["Transverse_Mercator"],
550
+ PARAMETER["latitude_of_origin",0],
551
+ PARAMETER["central_meridian",173],
552
+ PARAMETER["scale_factor",0.9996],
553
+ PARAMETER["false_easting",1600000],
554
+ PARAMETER["false_northing",10000000],
555
+ UNIT["metre",1,
556
+ AUTHORITY["EPSG","9001"]],
557
+ AUTHORITY["EPSG","2193"]]`;kc.defs(oi.Nztm2000.toEpsgString(),VC);kc.defs(oi.Citm2000.toEpsgString(),GC);var B1=new Map;function XL(e){return e==null?null:typeof e=="number"?e:"code"in e?e.code:"projection"in e?e.projection.code:null}var ds=class{constructor(t){this.epsg=t;try{this.projection=kc(t.toEpsgString(),oi.Wgs84.toEpsgString())}catch(r){throw new zc(`Failed to create projection: ${t.toEpsgString()}, ${oi.Wgs84.toEpsgString()}`,500,r)}}static define(t,r){if(B1.get(t.code)!=null)throw new Error("Duplicate projection definition: "+t.toEpsgString());kc.defs(t.toEpsgString(),r)}static get(t){let r=this.tryGet(t);if(r==null)throw new Error(`Invalid projection: ${t}`);return r}static tryGet(t){let r=XL(t);if(r==null)return null;let l=B1.get(r);if(l!=null)return l;let u=oi.tryGet(r);return u==null||kc.defs(u.toEpsgString())==null?null:(l=new ds(u),B1.set(r,l),l)}projectMultipolygon(t,r){if(r.epsg.code===this.epsg.code)return t;let{toWgs84:l}=this,{fromWgs84:u}=r;return t.map(o=>o.map(m=>m.map(v=>u(l(v)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(t){let r=this.toWgs84([t.x,t.y]),l=this.toWgs84([t.x+t.width,t.y+t.height]);return[r[0],r[1],l[0],l[1]]}boundsToGeoJsonFeature(t,r={}){let l=[t.x,t.y],u=[t.x+t.width,t.y],o=[t.x,t.y+t.height],m=[t.x+t.width,t.y+t.height],v=nS([[[l,o,m,u,l]]],this.toWgs84),b=v.length===1?oS(v[0],r):sS(v,r);return b.bbox=this.boundsToWgs84BoundingBox(t),b}toGeoJson(t){return{type:"FeatureCollection",features:t.map(r=>this.boundsToGeoJsonFeature(r,{name:r.name}))}}static getTiffResZoom(t,r,l=1){let u=0;for(;u<t.zooms.length;++u)if(t.pixelScale(u)<=r*l)return u;if(u===t.zooms.length)return u-1;throw new Error("ResZoom not found")}static tileToWgs84Bbox(t,r){let l=t.tileToSource(r),u=t.tileToSource({x:r.x+1,y:r.y+1,z:r.z}),o=this.get(t),[m,v]=o.toWgs84([l.x,u.y]),[b,C]=o.toWgs84([u.x,l.y]);return[m,v,b,C]}static tileCenterToLatLon(t,r){let l=t.tileToSource({x:r.x+.5,y:r.y+.5,z:r.z}),[u,o]=this.get(t).toWgs84([l.x,l.y]);return ds.wrapLatLon(o,u)}static wrapLatLon(t,r){let l={lat:t,lon:r},u=Math.floor(Math.abs(t)/90)%4,o=t>0?90:-90,m=t%90;switch(u){case 0:l.lat=m;break;case 1:l.lat=o-m,l.lon+=180;break;case 2:l.lat=-m,l.lon+=180;break;case 3:l.lat=-o+m;break}return(l.lon>180||l.lon<-180)&&(l.lon-=Math.floor((l.lon+180)/360)*360),l}static findAlignmentLevels(t,r,l){return Math.max(0,this.getTiffResZoom(t,l,2)-r.z)}static getImagePixelWidth(t,r,l){let u=t.tileToSource(r),o=t.tileToSource({x:r.x+1,y:r.y+1,z:r.z});return Math.round((o.x-u.x)/t.pixelScale(l))*2}};function Jm(e){let t=Object.entries(e);if(t.length===0)return"";let r=new URLSearchParams;for(let u of t)u[1]!=null&&r.set(u[0],u[1]);r.sort();let l=r.toString();return l===""?"":`?${l}`}var ZC=Nt(WC(),1),jC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",HC=(0,ZC.default)(jC),YL=new Set(jC);function XC(e){for(let t=0;t<e.length;t++)if(!YL.has(e.charAt(t)))return!1;return!0}function Qm(e){if(e==null)return null;if(XC(e))return e;let r=new TextEncoder().encode(e);return HC.encode(r)}var ji={ImageFormat:"png",toHash(e){return`#@${e.lat.toFixed(7)},${e.lon.toFixed(7)},z${e.zoom}`},parseZoom(e){return e==null||e===""?NaN:e.startsWith("z")?parseFloat(e.slice(1)):e.endsWith("z")?parseFloat(e):NaN},fromHash(e){let t={},r=e.replace("#@",""),[l,u,o]=r.split(","),m=parseFloat(l),v=parseFloat(u);!isNaN(m)&&!isNaN(v)&&(t.lat=m,t.lon=v);let b=ji.parseZoom(o);return isNaN(b)||(t.zoom=b),t},baseUrl(){let e=ze.BaseUrl;if(e==="")return window.location.origin;if(!e.startsWith("http"))throw new Error("BaseURL must start with http(s)://");return e},toBaseWmts(){let e=Jm({api:ze.ApiKey,config:Qm(ze.map.config)});return`${this.baseUrl()}/v1/tiles/aerial/WMTSCapabilities.xml${e}`},toImageryUrl(e,t){return`${this.baseUrl()}/v1/imagery/${e}/${t}`},toTileUrl(e,t,r,l,u){let o=new URLSearchParams;ze.ApiKey!=null&&ze.ApiKey!==""&&o.set("api",ze.ApiKey),u!=null&&o.set("config",Qm(u)),e==="style"&&(t.identifier!==xi.identifier&&o.set("tileMatrix",t.identifier),ji.ImageFormat!==Rd.Webp&&o.set("format",ji.ImageFormat));let m="?"+o.toString(),v=`${this.baseUrl()}/v1/tiles/${r}/${t.identifier}`;if(e==="raster")return`${v}/{z}/{x}/{y}.${ji.ImageFormat}${m}`;if(e==="vector-xyz")return`${v}/{z}/{x}/{y}.pbf${m}`;if(e==="style")return`${this.baseUrl()}/v1/styles/${l??r}.json${m}`;if(e==="wmts")return`${v}/WMTSCapabilities.xml${m}`;if(e==="attribution")return`${v}/attribution.json${m}`;if(e==="tile-wmts")return`${v}/{TileMatrix}/{TileCol}/{TileRow}.${ji.ImageFormat}${m}`;throw new Error("Unknown url type: "+e)},toConfigUrl(e,t=ze.map.config){let r=Jm({api:ze.ApiKey,config:t});return`${this.baseUrl()}/v1/config/${e}.json${r}`},toConfigImageryUrl(e,t,r=ze.map.config){let l=Jm({api:ze.ApiKey,config:r});return`${this.baseUrl()}/v1/config/${e}/${t}.json${l}`}};var Zd=class{constructor(t,r=0){this.tileMatrix=t,this.extraZoomLevels=r}getStyle(t,r,l=ze.map.config){return ji.toTileUrl("style",this.tileMatrix,t,r,l)}},qL=new Zd(Hs,2),JL=new Zd(ls),YC=new Zd(xi),QL=[qL,JL,YC];function Lc(e){for(let t of QL)if(e===t.tileMatrix.identifier)return t;return YC}function $C(e){return e.identifier===xi.identifier}function ps(e,t,r){if(t.identifier===r.identifier)return e;if(!$C(t)&&!$C(r))throw new Error("Either tileMatrix or targetTileMatrix must be GoogleTms");let l=ds.get(t).fromWgs84([e.lon,e.lat]),u=t.sourceToPixels(l[0],l[1],Math.round(e.zoom)),o={x:u.x/t.tileSize,y:u.y/t.tileSize,z:Math.round(e.zoom)},m=r.tileToSource(o),v=ds.get(r).toWgs84([m.x,m.y]);return{lon:Math.round(v[0]*1e8)/1e8,lat:Math.round(v[1]*1e8)/1e8,zoom:e.zoom}}function qC(e,t){for(let r of e.features){if(r.geometry.type!=="Polygon")throw new Error("Only polygons supported");for(let l of r.geometry.coordinates)for(let u of l){let o=ps({lat:u[1],lon:u[0],zoom:t.maxZoom},t,xi);u[0]=o.lon,u[1]=o.lat}}}var JC={[xi.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:5},[Hs.identifier]:{lat:-41.277848,lon:174.6763921,zoom:3},[ls.identifier]:{lat:-41.88999621,lon:174.04924373,zoom:3}},go=class extends QC.Emitter{constructor(){super(...arguments);this.style=null;this.layerId="aerial";this.tileMatrix=xi;this.debug={...vc}}get layers(){return this._layers==null&&(this._layers=KL()),this._layers}get isDebug(){return this.debug.debug}get location(){return this._location==null&&(window.addEventListener("popstate",()=>{let r={...JC[this.tileMatrix.identifier],...ji.fromHash(window.location.hash)};this.setLocation(r)}),this.updateFromUrl(),this._location={...JC[this.tileMatrix.identifier],...ji.fromHash(window.location.hash)}),this._location}get transformedLocation(){return this.transformLocation(this.location.lat,this.location.lon,this.location.zoom)}get isVector(){return this.layerId==="topographic"}get layerKey(){return this.style==null?this.layerId:`${this.layerId}::${this.style}`}get layerKeyTms(){return`${this.layerKey}::${this.tileMatrix.identifier}`}updateFromUrl(r=window.location.search){let l=new URLSearchParams(r),u=l.get("s")??l.get("style"),o=l.get("c")??l.get("config"),m=l.get("i")??"aerial",v=(l.get("p")??l.get("tileMatrix")??xi.identifier).toLowerCase(),b=us.All.find(B=>B.identifier.toLowerCase()===v);b==null&&(b=us.get(oi.parse(v)??oi.Google)),b.identifier===Hs.identifier&&(b=ls),Dd.fromUrl(this.debug,l)&&this.emit("change");let A=go.toUrl(this);this.config=o,this.style=u??null,this.layerId=m.startsWith("im_")?m.slice(3):m,this.tileMatrix=b,this.layerId==="topographic"&&this.style==null&&(this.style="topographic"),this.emit("tileMatrix",this.tileMatrix),this.emit("layer",this.layerId,this.style),A!==go.toUrl(this)&&this.emit("change")}static toUrl(r){let l=new URLSearchParams;return r.style&&l.append("s",r.style),r.config&&l.append("config",Qm(r.config)),r.layerId!=="aerial"&&l.append("i",r.layerId),r.tileMatrix.identifier!==xi.identifier&&l.append("p",r.tileMatrix.identifier),Dd.toUrl(r.debug,l),l.toString()}toTileUrl(r,l=this.tileMatrix,u=this.layerId,o=this.style,m=this.config){return ji.toTileUrl(r,l,u,o,m)}getLocation(r){let l=r.getCenter();if(l==null)throw new Error("Invalid Map location");let u=Math.floor((r.getZoom()??0)*1e4)/1e4;return ze.map.transformLocation(l.lat,l.lng,u)}transformLocation(r,l,u){return ps({lat:r,lon:l,zoom:u},xi,this.tileMatrix)}setLocation(r){r.lat===this.location.lat&&r.lon===this.location.lon&&r.zoom===this.location.zoom||(this.location.lat=r.lat,this.location.lon=r.lon,this.location.zoom=r.zoom,this.emit("location",this.location),this.emit("change"))}setTileMatrix(r){this.tileMatrix.identifier!==r.identifier&&(this.emit("tileMatrix",this.tileMatrix),this.emit("change"))}setLayerId(r,l){this.layerId===r&&this.style===l||(this.layerId=r,this.style=l??null,this.emit("layer",this.layerId,this.style),this.emit("change"))}setDebug(r,l=vc[r]){this.debug[r]!==l&&(this.debug[r]=l,this.emit("change"))}};async function KL(){let e=new Map,t=await fetch(ji.toBaseWmts());if(!t.ok)return e;let u=new DOMParser().parseFromString(await t.text(),"text/xml").getElementsByTagName("Layer"),o=[];for(let m=0;m<u.length;m++){let v=u.item(m);if(v==null)continue;let b=v.getElementsByTagName("ows:Title").item(0)?.textContent,C=v.getElementsByTagName("ows:Identifier").item(0)?.textContent;if(b==null||C==null||b==="aerial")continue;let A=v.getElementsByTagName("ows:Keyword").item(0)?.textContent,B=v.getElementsByTagName("ows:WGS84BoundingBox").item(0),Z=B?.getElementsByTagName("ows:UpperCorner").item(0)?.textContent?.split(" ").map(Number),q=B?.getElementsByTagName("ows:LowerCorner").item(0)?.textContent?.split(" ").map(Number),ee=v.getElementsByTagName("TileMatrixSet"),le=new Set;for(let de=0;de<ee.length;de++){let H=t6(ee.item(de)?.textContent??"");H!=null&&le.add(H.code)}Z==null||q==null||Z.length!==2||o.push({id:C,name:b.replace("aerial ",""),upperLeft:Z,lowerRight:q,projections:le,category:A})}o.sort((m,v)=>m.name.localeCompare(v.name)),e6(e);for(let m of o)e.set(m.id,m);return e}function e6(e){e.set("aerial",{id:"aerial",name:"Aerial Imagery",projections:new Set([fi.Nztm2000,fi.Google]),category:"Basemaps"}),e.set("topographic::topographic",{id:"topographic::topographic",name:"Topographic",projections:new Set([fi.Google]),category:"Basemaps"})}function t6(e){if(e.toLowerCase().startsWith("epsg"))return oi.parse(e);let t=us.find(e);return t==null?null:t.projection}var i6=ZI(),ze={get BaseUrl(){return""},get ApiKey(){return i6},get GoogleAnalytics(){return"UA-23232486-3"},get Version(){return"v6.37.0"},map:new go};if(ze.GoogleAnalytics!==""&&typeof window<"u"){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",`${ze.GoogleAnalytics}`);let e=document.createElement("script");e.setAttribute("async",""),e.setAttribute("src",`https://www.googletagmanager.com/gtag/js?id=${ze.GoogleAnalytics}`),document.head.appendChild(e)}function Xl(e,t,r){ze.GoogleAnalytics!==""&&window.gtag("event",t,{event_category:e,value:r})}var N1=Nt(Pr(),1),tg=Nt(Zr(),1),jd=class extends N1.Component{render(){return(0,tg.jsx)("i",{className:"material-icons-round md-36",children:this.props.name})}},fs=class extends N1.Component{render(){return(0,tg.jsxs)("a",{rel:"noopener",target:"_blank",href:this.props.href,style:{display:"flex"},"aria-label":this.props.ariaLabel,children:[this.props.children,this.props.icon?(0,tg.jsx)(jd,{name:this.props.icon}):void 0]})}};var Un=Nt(Zr(),1),ig=class extends iM.Component{constructor(){super(...arguments);this._events=[]}componentDidMount(){this._events.push(ze.map.on("change",()=>this.forceUpdate()))}componentWillUnmount(){for(let r of this._events)r();this._events=[]}render(){if(!ze.map.isDebug)return(0,Un.jsx)("footer",{className:"lui-footer lui-footer-small lui-hide-sm lui-hide-xs",role:"contentinfo",children:(0,Un.jsxs)("div",{className:"lui-footer-columns",children:[(0,Un.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,Un.jsx)(fs,{href:"http://www.govt.nz/",ariaLabel:"New Zealand Government",children:(0,Un.jsx)("img",{src:"/assets/logo-nz-govt.svg"})})}),(0,Un.jsx)("div",{className:"justify-end",children:(0,Un.jsxs)("ul",{className:"lui-footer-list",children:[(0,Un.jsx)("li",{className:"lui-footer-inline-list-item",children:"\xA9 2021 Land Information New Zealand"}),(0,Un.jsx)("li",{className:"lui-footer-inline-list-item",children:(0,Un.jsx)(fs,{href:"https://www.linz.govt.nz/contact-us",children:"Contact"})}),(0,Un.jsx)("li",{className:"lui-footer-inline-list-item",children:(0,Un.jsx)(fs,{href:"https://www.linz.govt.nz/privacy",children:"Privacy"})}),(0,Un.jsx)("li",{className:"lui-footer-inline-list-item",children:(0,Un.jsx)(fs,{href:"https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution",children:"Data Attribution"})})]})})]})})}};function rM(e){var t,r,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=rM(e[t]))&&(l&&(l+=" "),l+=r);else for(t in e)e[t]&&(l&&(l+=" "),l+=t);return l}function u6(){for(var e,t,r=0,l="";r<arguments.length;)(e=arguments[r++])&&(t=rM(e))&&(l&&(l+=" "),l+=t);return l}var rg=u6;var Ql=Nt(Pr(),1);var oM=Nt(Pr(),1);var $l=Nt(Zr(),1),ia=class extends oM.Component{constructor(){super(...arguments);this._copyTimeout=null;this.copy=()=>{Xl("Ui","copy:"+ze.map.layerKey+":"+this.props.header.replace(/ /g,"").toLowerCase()),navigator.clipboard.writeText(this.props.value),this.setState({copied:!0}),this._copyTimeout!=null&&clearTimeout(this._copyTimeout),this._copyTimeout=setTimeout(()=>this.setState({copied:!1}),1e3)}}render(){return(0,$l.jsxs)("div",{className:"LuiDeprecatedForms",children:[(0,$l.jsx)("label",{children:this.props.header}),(0,$l.jsxs)("div",{className:rg({"lui-menu-label":!0,"menu-copyable":!0,"menu-copyable-copied":this.state?.copied}),children:[(0,$l.jsx)("button",{className:"menu-copyable-icon-button",title:"Copy",onClick:this.copy,children:(0,$l.jsx)("i",{className:"material-icons-round",children:this.state?.copied?"check":"content_copy"})}),(0,$l.jsx)("input",{value:this.props.value,readOnly:!0})]})]})}};var IA=Nt(Pr(),1);function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},kt.apply(this,arguments)}var Dt=Nt(fx());function mx(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gx(e,t){if(e==null)return{};var r={},l=Object.keys(e),u,o;for(o=0;o<l.length;o++)u=l[o],!(t.indexOf(u)>=0)&&(r[u]=e[u]);return r}function ys(e,t){if(e==null)return{};var r=gx(e,t),l,u;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(u=0;u<o.length;u++)l=o[u],!(t.indexOf(l)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,l)||(r[l]=e[l]))}return r}function yx(e){if(Array.isArray(e))return e}function vx(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var l=[],u=!0,o=!1,m,v;try{for(r=r.call(e);!(u=(m=r.next()).done)&&(l.push(m.value),!(t&&l.length===t));u=!0);}catch(b){o=!0,v=b}finally{try{!u&&r.return!=null&&r.return()}finally{if(o)throw v}}return l}}function Dc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,l=new Array(t);r<t;r++)l[r]=e[r];return l}function Yd(e,t){if(!!e){if(typeof e=="string")return Dc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dc(e,t)}}function xx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
558
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ja(e,t){return yx(e)||vx(e,t)||Yd(e,t)||xx()}function qd(e){return qd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qd(e)}function Yl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oE(e,t){for(var r=0;r<t.length;r++){var l=t[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function ql(e,t,r){return t&&oE(e.prototype,t),r&&oE(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jd(e,t){return Jd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,u){return l.__proto__=u,l},Jd(e,t)}function Jl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jd(e,t)}function Jo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Kd=Nt(Pr()),lE=Nt(Am());function TR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),r.push.apply(r,l)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sE(Object(r),!0).forEach(function(l){TR(e,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sE(Object(r)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(r,l))})}return e}function wg(e){return wg=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},wg(e)}function PR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zR(e,t){return t&&(typeof t=="object"||typeof t=="function")?t:kR(e)}function Sg(e){var t=PR();return function(){var l=wg(e),u;if(t){var o=wg(this).constructor;u=Reflect.construct(l,arguments,o)}else u=l.apply(this,arguments);return zR(this,u)}}var LR=["className","clearValue","cx","getStyles","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Qd=function(){};function RR(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function uE(e,t,r){var l=[r];if(t&&e)for(var u in t)t.hasOwnProperty(u)&&t[u]&&l.push("".concat(RR(e,u)));return l.filter(function(o){return o}).map(function(o){return String(o).trim()}).join(" ")}var wx=function(t){return GR(t)?t.filter(Boolean):qd(t)==="object"&&t!==null?[t]:[]},cE=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var r=ys(t,LR);return Hi({},r)};function ep(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function DR(e){return ep(e)?window.innerHeight:e.clientHeight}function hE(e){return ep(e)?window.pageYOffset:e.scrollTop}function Ig(e,t){if(ep(e)){window.scrollTo(0,t);return}e.scrollTop=t}function BR(e){var t=getComputedStyle(e),r=t.position==="absolute",l=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var u=e;u=u.parentElement;)if(t=getComputedStyle(u),!(r&&t.position==="static")&&l.test(t.overflow+t.overflowY+t.overflowX))return u;return document.documentElement}function NR(e,t,r,l){return r*((e=e/l-1)*e*e+1)+t}function _g(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Qd,u=hE(e),o=t-u,m=10,v=0;function b(){v+=m;var C=NR(v,u,o,r);Ig(e,C),v<r?window.requestAnimationFrame(b):l(e)}b()}function dE(e,t){var r=e.getBoundingClientRect(),l=t.getBoundingClientRect(),u=t.offsetHeight/3;l.bottom+u>r.bottom?Ig(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+u,e.scrollHeight)):l.top-u<r.top&&Ig(e,Math.max(t.offsetTop-u,0))}function FR(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Ix(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function pE(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var fE=!1,OR={get passive(){return fE=!0}},bg=typeof window<"u"?window:{};bg.addEventListener&&bg.removeEventListener&&(bg.addEventListener("p",Qd,OR),bg.removeEventListener("p",Qd,!1));var mE=fE;function gE(e){return e!=null}function GR(e){return Array.isArray(e)}function tp(e,t,r){return e?t:r}var yE=function(t){for(var r=arguments.length,l=new Array(r>1?r-1:0),u=1;u<r;u++)l[u-1]=arguments[u];var o=Object.entries(t).filter(function(m){var v=Ja(m,1),b=v[0];return!l.includes(b)});return o.reduce(function(m,v){var b=Ja(v,2),C=b[0],A=b[1];return m[C]=A,m},{})};function VR(e){var t=e.maxHeight,r=e.menuEl,l=e.minHeight,u=e.placement,o=e.shouldScroll,m=e.isFixedPosition,v=e.theme,b=v.spacing,C=BR(r),A={placement:"bottom",maxHeight:t};if(!r||!r.offsetParent)return A;var B=C.getBoundingClientRect(),Z=B.height,q=r.getBoundingClientRect(),ee=q.bottom,le=q.height,de=q.top,H=r.offsetParent.getBoundingClientRect(),Q=H.top,te=m?window.innerHeight:DR(C),ve=hE(C),Ce=parseInt(getComputedStyle(r).marginBottom,10),Se=parseInt(getComputedStyle(r).marginTop,10),Be=Q-Se,Fe=te-de,qe=Be+ve,ht=Z-ve-de,At=ee-te+ve+Ce,Ot=ve+de-Se,Yt=160;switch(u){case"auto":case"bottom":if(Fe>=le)return{placement:"bottom",maxHeight:t};if(ht>=le&&!m)return o&&_g(C,At,Yt),{placement:"bottom",maxHeight:t};if(!m&&ht>=l||m&&Fe>=l){o&&_g(C,At,Yt);var at=m?Fe-Ce:ht-Ce;return{placement:"bottom",maxHeight:at}}if(u==="auto"||m){var Zt=t,zi=m?Be:qe;return zi>=l&&(Zt=Math.min(zi-Ce-b.controlHeight,t)),{placement:"top",maxHeight:Zt}}if(u==="bottom")return o&&Ig(C,At),{placement:"bottom",maxHeight:t};break;case"top":if(Be>=le)return{placement:"top",maxHeight:t};if(qe>=le&&!m)return o&&_g(C,Ot,Yt),{placement:"top",maxHeight:t};if(!m&&qe>=l||m&&Be>=l){var Ii=t;return(!m&&qe>=l||m&&Be>=l)&&(Ii=m?Be-Se:qe-Se),o&&_g(C,Ot,Yt),{placement:"top",maxHeight:Ii}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(u,'".'))}return A}function UR(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var bx=function(t){return t==="auto"?"bottom":t},vE=function(t){var r,l=t.placement,u=t.theme,o=u.borderRadius,m=u.spacing,v=u.colors;return r={label:"menu"},Jo(r,UR(l),"100%"),Jo(r,"backgroundColor",v.neutral0),Jo(r,"borderRadius",o),Jo(r,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Jo(r,"marginBottom",m.menuGutter),Jo(r,"marginTop",m.menuGutter),Jo(r,"position","absolute"),Jo(r,"width","100%"),Jo(r,"zIndex",1),r},xE=(0,Kd.createContext)({getPortalPlacement:null}),Sx=function(e){Jl(r,e);var t=Sg(r);function r(){var l;Yl(this,r);for(var u=arguments.length,o=new Array(u),m=0;m<u;m++)o[m]=arguments[m];return l=t.call.apply(t,[this].concat(o)),l.state={maxHeight:l.props.maxMenuHeight,placement:null},l.context=void 0,l.getPlacement=function(v){var b=l.props,C=b.minMenuHeight,A=b.maxMenuHeight,B=b.menuPlacement,Z=b.menuPosition,q=b.menuShouldScrollIntoView,ee=b.theme;if(!!v){var le=Z==="fixed",de=q&&!le,H=VR({maxHeight:A,menuEl:v,minHeight:C,placement:B,shouldScroll:de,isFixedPosition:le,theme:ee}),Q=l.context.getPortalPlacement;Q&&Q(H),l.setState(H)}},l.getUpdatedProps=function(){var v=l.props.menuPlacement,b=l.state.placement||bx(v);return Hi(Hi({},l.props),{},{placement:b,maxHeight:l.state.maxHeight})},l}return ql(r,[{key:"render",value:function(){var u=this.props.children;return u({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),r}(Kd.Component);Sx.contextType=xE;var WR=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerRef,v=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("menu",t),className:u({menu:!0},l),ref:m},v),r)},_E=function(t){var r=t.maxHeight,l=t.theme.spacing.baseUnit;return{maxHeight:r,overflowY:"auto",paddingBottom:l,paddingTop:l,position:"relative",WebkitOverflowScrolling:"touch"}},ZR=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerProps,v=t.innerRef,b=t.isMulti;return(0,Dt.jsx)("div",kt({css:o("menuList",t),className:u({"menu-list":!0,"menu-list--is-multi":b},l),ref:v},m),r)},bE=function(t){var r=t.theme,l=r.spacing.baseUnit,u=r.colors;return{color:u.neutral40,padding:"".concat(l*2,"px ").concat(l*3,"px"),textAlign:"center"}},wE=bE,IE=bE,SE=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("noOptionsMessage",t),className:u({"menu-notice":!0,"menu-notice--no-options":!0},l)},m),r)};SE.defaultProps={children:"No options"};var CE=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("loadingMessage",t),className:u({"menu-notice":!0,"menu-notice--loading":!0},l)},m),r)};CE.defaultProps={children:"Loading..."};var ME=function(t){var r=t.rect,l=t.offset,u=t.position;return{left:r.left,position:u,top:l,width:r.width,zIndex:1}},jR=function(e){Jl(r,e);var t=Sg(r);function r(){var l;Yl(this,r);for(var u=arguments.length,o=new Array(u),m=0;m<u;m++)o[m]=arguments[m];return l=t.call.apply(t,[this].concat(o)),l.state={placement:null},l.getPortalPlacement=function(v){var b=v.placement,C=bx(l.props.menuPlacement);b!==C&&l.setState({placement:b})},l}return ql(r,[{key:"render",value:function(){var u=this.props,o=u.appendTo,m=u.children,v=u.className,b=u.controlElement,C=u.cx,A=u.innerProps,B=u.menuPlacement,Z=u.menuPosition,q=u.getStyles,ee=Z==="fixed";if(!o&&!ee||!b)return null;var le=this.state.placement||bx(B),de=FR(b),H=ee?0:window.pageYOffset,Q=de[le]+H,te={offset:Q,position:Z,rect:de},ve=(0,Dt.jsx)("div",kt({css:q("menuPortal",te),className:C({"menu-portal":!0},v)},A),m);return(0,Dt.jsx)(xE.Provider,{value:{getPortalPlacement:this.getPortalPlacement}},o?(0,lE.createPortal)(ve,o):ve)}}]),r}(Kd.Component),EE=function(t){var r=t.isDisabled,l=t.isRtl;return{label:"container",direction:l?"rtl":void 0,pointerEvents:r?"none":void 0,position:"relative"}},HR=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerProps,v=t.isDisabled,b=t.isRtl;return(0,Dt.jsx)("div",kt({css:o("container",t),className:u({"--is-disabled":v,"--is-rtl":b},l)},m),r)},AE=function(t){var r=t.theme.spacing,l=t.isMulti,u=t.hasValue,o=t.selectProps.controlShouldRenderValue;return{alignItems:"center",display:l&&u&&o?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}},XR=function(t){var r=t.children,l=t.className,u=t.cx,o=t.innerProps,m=t.isMulti,v=t.getStyles,b=t.hasValue;return(0,Dt.jsx)("div",kt({css:v("valueContainer",t),className:u({"value-container":!0,"value-container--is-multi":m,"value-container--has-value":b},l)},o),r)},TE=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},$R=function(t){var r=t.children,l=t.className,u=t.cx,o=t.innerProps,m=t.getStyles;return(0,Dt.jsx)("div",kt({css:m("indicatorsContainer",t),className:u({indicators:!0},l)},o),r)},aE,YR=["size"];var qR={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},PE=function(t){var r=t.size,l=ys(t,YR);return(0,Dt.jsx)("svg",kt({height:r,width:r,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:qR},l))},Cx=function(t){return(0,Dt.jsx)(PE,kt({size:20},t),(0,Dt.jsx)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},kE=function(t){return(0,Dt.jsx)(PE,kt({size:20},t),(0,Dt.jsx)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},zE=function(t){var r=t.isFocused,l=t.theme,u=l.spacing.baseUnit,o=l.colors;return{label:"indicatorContainer",color:r?o.neutral60:o.neutral20,display:"flex",padding:u*2,transition:"color 150ms",":hover":{color:r?o.neutral80:o.neutral40}}},LE=zE,JR=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("dropdownIndicator",t),className:u({indicator:!0,"dropdown-indicator":!0},l)},m),r||(0,Dt.jsx)(kE,null))},RE=zE,QR=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("clearIndicator",t),className:u({indicator:!0,"clear-indicator":!0},l)},m),r||(0,Dt.jsx)(Cx,null))},DE=function(t){var r=t.isDisabled,l=t.theme,u=l.spacing.baseUnit,o=l.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:r?o.neutral10:o.neutral20,marginBottom:u*2,marginTop:u*2,width:1}},KR=function(t){var r=t.className,l=t.cx,u=t.getStyles,o=t.innerProps;return(0,Dt.jsx)("span",kt({},o,{css:u("indicatorSeparator",t),className:l({"indicator-separator":!0},r)}))},eD=(0,Dt.keyframes)(aE||(aE=mx([`
559
+ 0%, 80%, 100% { opacity: 0; }
560
+ 40% { opacity: 1; }
561
+ `]))),BE=function(t){var r=t.isFocused,l=t.size,u=t.theme,o=u.colors,m=u.spacing.baseUnit;return{label:"loadingIndicator",color:r?o.neutral60:o.neutral20,display:"flex",padding:m*2,transition:"color 150ms",alignSelf:"center",fontSize:l,lineHeight:1,marginRight:l,textAlign:"center",verticalAlign:"middle"}},_x=function(t){var r=t.delay,l=t.offset;return(0,Dt.jsx)("span",{css:(0,Dt.css)({animation:"".concat(eD," 1s ease-in-out ").concat(r,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:l?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},NE=function(t){var r=t.className,l=t.cx,u=t.getStyles,o=t.innerProps,m=t.isRtl;return(0,Dt.jsx)("div",kt({css:u("loadingIndicator",t),className:l({indicator:!0,"loading-indicator":!0},r)},o),(0,Dt.jsx)(_x,{delay:0,offset:m}),(0,Dt.jsx)(_x,{delay:160,offset:!0}),(0,Dt.jsx)(_x,{delay:320,offset:!m}))};NE.defaultProps={size:4};var FE=function(t){var r=t.isDisabled,l=t.isFocused,u=t.theme,o=u.colors,m=u.borderRadius,v=u.spacing;return{label:"control",alignItems:"center",backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:l?o.primary:o.neutral20,borderRadius:m,borderStyle:"solid",borderWidth:1,boxShadow:l?"0 0 0 1px ".concat(o.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:v.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:l?o.primary:o.neutral30}}},tD=function(t){var r=t.children,l=t.cx,u=t.getStyles,o=t.className,m=t.isDisabled,v=t.isFocused,b=t.innerRef,C=t.innerProps,A=t.menuIsOpen;return(0,Dt.jsx)("div",kt({ref:b,css:u("control",t),className:l({control:!0,"control--is-disabled":m,"control--is-focused":v,"control--menu-is-open":A},o)},C),r)},iD=["data"],OE=function(t){var r=t.theme.spacing;return{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},rD=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.Heading,v=t.headingProps,b=t.innerProps,C=t.label,A=t.theme,B=t.selectProps;return(0,Dt.jsx)("div",kt({css:o("group",t),className:u({group:!0},l)},b),(0,Dt.jsx)(m,kt({},v,{selectProps:B,theme:A,getStyles:o,cx:u}),C),(0,Dt.jsx)("div",null,r))},GE=function(t){var r=t.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:r.baseUnit*3,paddingRight:r.baseUnit*3,textTransform:"uppercase"}},nD=function(t){var r=t.getStyles,l=t.cx,u=t.className,o=cE(t);o.data;var m=ys(o,iD);return(0,Dt.jsx)("div",kt({css:r("groupHeading",t),className:l({"group-heading":!0},u)},m))},oD=["innerRef","isDisabled","isHidden","inputClassName"],VE=function(t){var r=t.isDisabled,l=t.value,u=t.theme,o=u.spacing,m=u.colors;return Hi({margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,visibility:r?"hidden":"visible",color:m.neutral80,transform:l?"translateZ(0)":""},sD)},UE={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},sD={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Hi({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},UE)},aD=function(t){return Hi({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},UE)},lD=function(t){var r=t.className,l=t.cx,u=t.getStyles,o=t.value,m=cE(t),v=m.innerRef,b=m.isDisabled,C=m.isHidden,A=m.inputClassName,B=ys(m,oD);return(0,Dt.jsx)("div",{className:l({"input-container":!0},r),css:u("input",t),"data-value":o||""},(0,Dt.jsx)("input",kt({className:l({input:!0},A),ref:v,style:aD(C),disabled:b},B)))},WE=function(t){var r=t.theme,l=r.spacing,u=r.borderRadius,o=r.colors;return{label:"multiValue",backgroundColor:o.neutral10,borderRadius:u/2,display:"flex",margin:l.baseUnit/2,minWidth:0}},ZE=function(t){var r=t.theme,l=r.borderRadius,u=r.colors,o=t.cropWithEllipsis;return{borderRadius:l/2,color:u.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"}},jE=function(t){var r=t.theme,l=r.spacing,u=r.borderRadius,o=r.colors,m=t.isFocused;return{alignItems:"center",borderRadius:u/2,backgroundColor:m?o.dangerLight:void 0,display:"flex",paddingLeft:l.baseUnit,paddingRight:l.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},HE=function(t){var r=t.children,l=t.innerProps;return(0,Dt.jsx)("div",l,r)},uD=HE,cD=HE;function hD(e){var t=e.children,r=e.innerProps;return(0,Dt.jsx)("div",kt({role:"button"},r),t||(0,Dt.jsx)(Cx,{size:14}))}var dD=function(t){var r=t.children,l=t.className,u=t.components,o=t.cx,m=t.data,v=t.getStyles,b=t.innerProps,C=t.isDisabled,A=t.removeProps,B=t.selectProps,Z=u.Container,q=u.Label,ee=u.Remove;return(0,Dt.jsx)(Dt.ClassNames,null,function(le){var de=le.css,H=le.cx;return(0,Dt.jsx)(Z,{data:m,innerProps:Hi({className:H(de(v("multiValue",t)),o({"multi-value":!0,"multi-value--is-disabled":C},l))},b),selectProps:B},(0,Dt.jsx)(q,{data:m,innerProps:{className:H(de(v("multiValueLabel",t)),o({"multi-value__label":!0},l))},selectProps:B},r),(0,Dt.jsx)(ee,{data:m,innerProps:Hi({className:H(de(v("multiValueRemove",t)),o({"multi-value__remove":!0},l)),"aria-label":"Remove ".concat(r||"option")},A),selectProps:B}))})},XE=function(t){var r=t.isDisabled,l=t.isFocused,u=t.isSelected,o=t.theme,m=o.spacing,v=o.colors;return{label:"option",backgroundColor:u?v.primary:l?v.primary25:"transparent",color:r?v.neutral20:u?v.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(m.baseUnit*2,"px ").concat(m.baseUnit*3,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:r?void 0:u?v.primary:v.primary50}}},pD=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.isDisabled,v=t.isFocused,b=t.isSelected,C=t.innerRef,A=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("option",t),className:u({option:!0,"option--is-disabled":m,"option--is-focused":v,"option--is-selected":b},l),ref:C,"aria-disabled":m},A),r)},$E=function(t){var r=t.theme,l=r.spacing,u=r.colors;return{label:"placeholder",color:u.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:l.baseUnit/2,marginRight:l.baseUnit/2}},fD=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("placeholder",t),className:u({placeholder:!0},l)},m),r)},YE=function(t){var r=t.isDisabled,l=t.theme,u=l.spacing,o=l.colors;return{label:"singleValue",color:r?o.neutral40:o.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:u.baseUnit/2,marginRight:u.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},mD=function(t){var r=t.children,l=t.className,u=t.cx,o=t.getStyles,m=t.isDisabled,v=t.innerProps;return(0,Dt.jsx)("div",kt({css:o("singleValue",t),className:u({"single-value":!0,"single-value--is-disabled":m},l)},v),r)},gD={ClearIndicator:QR,Control:tD,DropdownIndicator:JR,DownChevron:kE,CrossIcon:Cx,Group:rD,GroupHeading:nD,IndicatorsContainer:$R,IndicatorSeparator:KR,Input:lD,LoadingIndicator:NE,Menu:WR,MenuList:ZR,MenuPortal:jR,LoadingMessage:CE,NoOptionsMessage:SE,MultiValue:dD,MultiValueContainer:uD,MultiValueLabel:cD,MultiValueRemove:hD,Option:pD,Placeholder:fD,SelectContainer:HR,SingleValue:mD,ValueContainer:XR},qE=function(t){return Hi(Hi({},gD),t.components)};var na=Nt(Pr()),yD=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function JE(e){var t=e.defaultInputValue,r=t===void 0?"":t,l=e.defaultMenuIsOpen,u=l===void 0?!1:l,o=e.defaultValue,m=o===void 0?null:o,v=e.inputValue,b=e.menuIsOpen,C=e.onChange,A=e.onInputChange,B=e.onMenuClose,Z=e.onMenuOpen,q=e.value,ee=ys(e,yD),le=(0,na.useState)(v!==void 0?v:r),de=Ja(le,2),H=de[0],Q=de[1],te=(0,na.useState)(b!==void 0?b:u),ve=Ja(te,2),Ce=ve[0],Se=ve[1],Be=(0,na.useState)(q!==void 0?q:m),Fe=Ja(Be,2),qe=Fe[0],ht=Fe[1],At=(0,na.useCallback)(function(jt,ur){typeof C=="function"&&C(jt,ur),ht(jt)},[C]),Ot=(0,na.useCallback)(function(jt,ur){var Xi;typeof A=="function"&&(Xi=A(jt,ur)),Q(Xi!==void 0?Xi:jt)},[A]),Yt=(0,na.useCallback)(function(){typeof Z=="function"&&Z(),Se(!0)},[Z]),at=(0,na.useCallback)(function(){typeof B=="function"&&B(),Se(!1)},[B]),Zt=v!==void 0?v:H,zi=b!==void 0?b:Ce,Ii=q!==void 0?q:qe;return Hi(Hi({},ee),{},{inputValue:Zt,menuIsOpen:zi,onChange:At,onInputChange:Ot,onMenuClose:at,onMenuOpen:Yt,value:Ii})}var bA=Nt(Pr()),zx=Nt(Pr());function Mx(e){if(Array.isArray(e))return Dc(e)}function Ex(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ax(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
562
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cg(e){return Mx(e)||Ex(e)||Yd(e)||Ax()}var Ni=Nt(Pr()),Mi=Nt(Pr()),vo=Nt(fx());var QE=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function vD(e,t){return!!(e===t||QE(e)&&QE(t))}function xD(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!vD(e[r],t[r]))return!1;return!0}function _D(e,t){t===void 0&&(t=xD);var r,l=[],u,o=!1;function m(){for(var v=[],b=0;b<arguments.length;b++)v[b]=arguments[b];return o&&r===this&&t(v,l)||(u=e.apply(this,v),o=!0,r=this,l=v),u}return m}var KE=_D;var bD={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},eA=function(t){return(0,vo.jsx)("span",kt({css:bD},t))},wD={guidance:function(t){var r=t.isSearchable,l=t.isMulti,u=t.isDisabled,o=t.tabSelectsValue,m=t.context;switch(m){case"menu":return"Use Up and Down to choose options".concat(u?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(o?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(t["aria-label"]||"Select"," is focused ").concat(r?",type to refine list":"",", press Down to open the menu, ").concat(l?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var r=t.action,l=t.label,u=l===void 0?"":l,o=t.labels,m=t.isDisabled;switch(r){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(u,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return m?"option ".concat(u," is disabled. Select another option."):"option ".concat(u,", selected.");default:return""}},onFocus:function(t){var r=t.context,l=t.focused,u=t.options,o=t.label,m=o===void 0?"":o,v=t.selectValue,b=t.isDisabled,C=t.isSelected,A=function(ee,le){return ee&&ee.length?"".concat(ee.indexOf(le)+1," of ").concat(ee.length):""};if(r==="value"&&v)return"value ".concat(m," focused, ").concat(A(v,l),".");if(r==="menu"){var B=b?" disabled":"",Z="".concat(C?"selected":"focused").concat(B);return"option ".concat(m," ").concat(Z,", ").concat(A(u,l),".")}return""},onFilter:function(t){var r=t.inputValue,l=t.resultsMessage;return"".concat(l).concat(r?" for search term "+r:"",".")}},ID=function(t){var r=t.ariaSelection,l=t.focusedOption,u=t.focusedValue,o=t.focusableOptions,m=t.isFocused,v=t.selectValue,b=t.selectProps,C=t.id,A=b.ariaLiveMessages,B=b.getOptionLabel,Z=b.inputValue,q=b.isMulti,ee=b.isOptionDisabled,le=b.isSearchable,de=b.menuIsOpen,H=b.options,Q=b.screenReaderStatus,te=b.tabSelectsValue,ve=b["aria-label"],Ce=b["aria-live"],Se=(0,Mi.useMemo)(function(){return Hi(Hi({},wD),A||{})},[A]),Be=(0,Mi.useMemo)(function(){var at="";if(r&&Se.onChange){var Zt=r.option,zi=r.options,Ii=r.removedValue,jt=r.removedValues,ur=r.value,Xi=function(Ji){return Array.isArray(Ji)?null:Ji},si=Ii||Zt||Xi(ur),ti=si?B(si):"",_i=zi||jt||void 0,Ei=_i?_i.map(B):[],Li=Hi({isDisabled:si&&ee(si,v),label:ti,labels:Ei},r);at=Se.onChange(Li)}return at},[r,Se,ee,v,B]),Fe=(0,Mi.useMemo)(function(){var at="",Zt=l||u,zi=!!(l&&v&&v.includes(l));if(Zt&&Se.onFocus){var Ii={focused:Zt,label:B(Zt),isDisabled:ee(Zt,v),isSelected:zi,options:H,context:Zt===l?"menu":"value",selectValue:v};at=Se.onFocus(Ii)}return at},[l,u,B,ee,Se,H,v]),qe=(0,Mi.useMemo)(function(){var at="";if(de&&H.length&&Se.onFilter){var Zt=Q({count:o.length});at=Se.onFilter({inputValue:Z,resultsMessage:Zt})}return at},[o,Z,de,Se,H,Q]),ht=(0,Mi.useMemo)(function(){var at="";if(Se.guidance){var Zt=u?"value":de?"menu":"input";at=Se.guidance({"aria-label":ve,context:Zt,isDisabled:l&&ee(l,v),isMulti:q,isSearchable:le,tabSelectsValue:te})}return at},[ve,l,u,q,ee,le,de,Se,v,te]),At="".concat(Fe," ").concat(qe," ").concat(ht),Ot=(0,vo.jsx)(Mi.Fragment,null,(0,vo.jsx)("span",{id:"aria-selection"},Be),(0,vo.jsx)("span",{id:"aria-context"},At)),Yt=r?.action==="initial-input-focus";return(0,vo.jsx)(Mi.Fragment,null,(0,vo.jsx)(eA,{id:C},Yt&&Ot),(0,vo.jsx)(eA,{"aria-live":Ce,"aria-atomic":"false","aria-relevant":"additions text"},m&&!Yt&&Ot))},Px=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],SD=new RegExp("["+Px.map(function(e){return e.letters}).join("")+"]","g"),hA={};for(Mg=0;Mg<Px.length;Mg++)for(Eg=Px[Mg],Ag=0;Ag<Eg.letters.length;Ag++)hA[Eg.letters[Ag]]=Eg.base;var Eg,Ag,Mg,dA=function(t){return t.replace(SD,function(r){return hA[r]})},CD=KE(dA),tA=function(t){return t.replace(/^\s+|\s+$/g,"")},MD=function(t){return"".concat(t.label," ").concat(t.value)},ED=function(t){return function(r,l){if(r.data.__isNew__)return!0;var u=Hi({ignoreCase:!0,ignoreAccents:!0,stringify:MD,trim:!0,matchFrom:"any"},t),o=u.ignoreCase,m=u.ignoreAccents,v=u.stringify,b=u.trim,C=u.matchFrom,A=b?tA(l):l,B=b?tA(v(r)):v(r);return o&&(A=A.toLowerCase(),B=B.toLowerCase()),m&&(A=CD(A),B=dA(B)),C==="start"?B.substr(0,A.length)===A:B.indexOf(A)>-1}},AD=["innerRef"];function TD(e){var t=e.innerRef,r=ys(e,AD),l=yE(r,"onExited","in","enter","exit","appear");return(0,vo.jsx)("input",kt({ref:t},l,{css:(0,vo.css)({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var PD=function(t){t.preventDefault(),t.stopPropagation()};function kD(e){var t=e.isEnabled,r=e.onBottomArrive,l=e.onBottomLeave,u=e.onTopArrive,o=e.onTopLeave,m=(0,Mi.useRef)(!1),v=(0,Mi.useRef)(!1),b=(0,Mi.useRef)(0),C=(0,Mi.useRef)(null),A=(0,Mi.useCallback)(function(de,H){if(C.current!==null){var Q=C.current,te=Q.scrollTop,ve=Q.scrollHeight,Ce=Q.clientHeight,Se=C.current,Be=H>0,Fe=ve-Ce-te,qe=!1;Fe>H&&m.current&&(l&&l(de),m.current=!1),Be&&v.current&&(o&&o(de),v.current=!1),Be&&H>Fe?(r&&!m.current&&r(de),Se.scrollTop=ve,qe=!0,m.current=!0):!Be&&-H>te&&(u&&!v.current&&u(de),Se.scrollTop=0,qe=!0,v.current=!0),qe&&PD(de)}},[r,l,u,o]),B=(0,Mi.useCallback)(function(de){A(de,de.deltaY)},[A]),Z=(0,Mi.useCallback)(function(de){b.current=de.changedTouches[0].clientY},[]),q=(0,Mi.useCallback)(function(de){var H=b.current-de.changedTouches[0].clientY;A(de,H)},[A]),ee=(0,Mi.useCallback)(function(de){if(!!de){var H=mE?{passive:!1}:!1;de.addEventListener("wheel",B,H),de.addEventListener("touchstart",Z,H),de.addEventListener("touchmove",q,H)}},[q,Z,B]),le=(0,Mi.useCallback)(function(de){!de||(de.removeEventListener("wheel",B,!1),de.removeEventListener("touchstart",Z,!1),de.removeEventListener("touchmove",q,!1))},[q,Z,B]);return(0,Mi.useEffect)(function(){if(!!t){var de=C.current;return ee(de),function(){le(de)}}},[t,ee,le]),function(de){C.current=de}}var iA=["boxSizing","height","overflow","paddingRight","position"],rA={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function nA(e){e.preventDefault()}function oA(e){e.stopPropagation()}function sA(){var e=this.scrollTop,t=this.scrollHeight,r=e+this.offsetHeight;e===0?this.scrollTop=1:r===t&&(this.scrollTop=e-1)}function aA(){return"ontouchstart"in window||navigator.maxTouchPoints}var lA=!!(typeof window<"u"&&window.document&&window.document.createElement),ip=0,Bc={capture:!1,passive:!1};function zD(e){var t=e.isEnabled,r=e.accountForScrollbars,l=r===void 0?!0:r,u=(0,Mi.useRef)({}),o=(0,Mi.useRef)(null),m=(0,Mi.useCallback)(function(b){if(!!lA){var C=document.body,A=C&&C.style;if(l&&iA.forEach(function(ee){var le=A&&A[ee];u.current[ee]=le}),l&&ip<1){var B=parseInt(u.current.paddingRight,10)||0,Z=document.body?document.body.clientWidth:0,q=window.innerWidth-Z+B||0;Object.keys(rA).forEach(function(ee){var le=rA[ee];A&&(A[ee]=le)}),A&&(A.paddingRight="".concat(q,"px"))}C&&aA()&&(C.addEventListener("touchmove",nA,Bc),b&&(b.addEventListener("touchstart",sA,Bc),b.addEventListener("touchmove",oA,Bc))),ip+=1}},[l]),v=(0,Mi.useCallback)(function(b){if(!!lA){var C=document.body,A=C&&C.style;ip=Math.max(ip-1,0),l&&ip<1&&iA.forEach(function(B){var Z=u.current[B];A&&(A[B]=Z)}),C&&aA()&&(C.removeEventListener("touchmove",nA,Bc),b&&(b.removeEventListener("touchstart",sA,Bc),b.removeEventListener("touchmove",oA,Bc)))}},[l]);return(0,Mi.useEffect)(function(){if(!!t){var b=o.current;return m(b),function(){v(b)}}},[t,m,v]),function(b){o.current=b}}var LD=function(){return document.activeElement&&document.activeElement.blur()},RD={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function DD(e){var t=e.children,r=e.lockEnabled,l=e.captureEnabled,u=l===void 0?!0:l,o=e.onBottomArrive,m=e.onBottomLeave,v=e.onTopArrive,b=e.onTopLeave,C=kD({isEnabled:u,onBottomArrive:o,onBottomLeave:m,onTopArrive:v,onTopLeave:b}),A=zD({isEnabled:r}),B=function(q){C(q),A(q)};return(0,vo.jsx)(Mi.Fragment,null,r&&(0,vo.jsx)("div",{onClick:LD,css:RD}),t(B))}var BD=function(t){return t.label},ND=function(t){return t.label},FD=function(t){return t.value},OD=function(t){return!!t.isDisabled},GD={clearIndicator:RE,container:EE,control:FE,dropdownIndicator:LE,group:OE,groupHeading:GE,indicatorsContainer:TE,indicatorSeparator:DE,input:VE,loadingIndicator:BE,loadingMessage:IE,menu:vE,menuList:_E,menuPortal:ME,multiValue:WE,multiValueLabel:ZE,multiValueRemove:jE,noOptionsMessage:wE,option:XE,placeholder:$E,singleValue:YE,valueContainer:AE};var VD={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},UD=4,pA=4,WD=38,ZD=pA*2,jD={baseUnit:pA,controlHeight:WD,menuGutter:ZD},Tx={borderRadius:UD,colors:VD,spacing:jD},HD={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Ix(),captureMenuScroll:!Ix(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ED(),formatGroupLabel:BD,getOptionLabel:ND,getOptionValue:FD,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:OD,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!pE(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var r=t.count;return"".concat(r," result").concat(r!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function uA(e,t,r,l){var u=yA(e,t,r),o=vA(e,t,r),m=gA(e,t),v=Tg(e,t);return{type:"option",data:t,isDisabled:u,isSelected:o,label:m,value:v,index:l}}function fA(e,t){return e.options.map(function(r,l){if("options"in r){var u=r.options.map(function(m,v){return uA(e,m,t,v)}).filter(function(m){return cA(e,m)});return u.length>0?{type:"group",data:r,options:u,index:l}:void 0}var o=uA(e,r,t,l);return cA(e,o)?o:void 0}).filter(gE)}function mA(e){return e.reduce(function(t,r){return r.type==="group"?t.push.apply(t,Cg(r.options.map(function(l){return l.data}))):t.push(r.data),t},[])}function XD(e,t){return mA(fA(e,t))}function cA(e,t){var r=e.inputValue,l=r===void 0?"":r,u=t.data,o=t.isSelected,m=t.label,v=t.value;return(!_A(e)||!o)&&xA(e,{label:m,value:v,data:u},l)}function $D(e,t){var r=e.focusedValue,l=e.selectValue,u=l.indexOf(r);if(u>-1){var o=t.indexOf(r);if(o>-1)return r;if(u<t.length)return t[u]}return null}function YD(e,t){var r=e.focusedOption;return r&&t.indexOf(r)>-1?r:t[0]}var gA=function(t,r){return t.getOptionLabel(r)},Tg=function(t,r){return t.getOptionValue(r)};function yA(e,t,r){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,r):!1}function vA(e,t,r){if(r.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,r);var l=Tg(e,t);return r.some(function(u){return Tg(e,u)===l})}function xA(e,t,r){return e.filterOption?e.filterOption(t,r):!0}var _A=function(t){var r=t.hideSelectedOptions,l=t.isMulti;return r===void 0?l:r},qD=1,kx=function(e){Jl(r,e);var t=Sg(r);function r(l){var u;return Yl(this,r),u=t.call(this,l),u.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},u.blockOptionHover=!1,u.isComposing=!1,u.commonProps=void 0,u.initialTouchX=0,u.initialTouchY=0,u.instancePrefix="",u.openAfterFocus=!1,u.scrollToFocusedOptionOnUpdate=!1,u.userIsDragging=void 0,u.controlRef=null,u.getControlRef=function(o){u.controlRef=o},u.focusedOptionRef=null,u.getFocusedOptionRef=function(o){u.focusedOptionRef=o},u.menuListRef=null,u.getMenuListRef=function(o){u.menuListRef=o},u.inputRef=null,u.getInputRef=function(o){u.inputRef=o},u.focus=u.focusInput,u.blur=u.blurInput,u.onChange=function(o,m){var v=u.props,b=v.onChange,C=v.name;m.name=C,u.ariaOnChange(o,m),b(o,m)},u.setValue=function(o,m,v){var b=u.props,C=b.closeMenuOnSelect,A=b.isMulti,B=b.inputValue;u.onInputChange("",{action:"set-value",prevInputValue:B}),C&&(u.setState({inputIsHiddenAfterUpdate:!A}),u.onMenuClose()),u.setState({clearFocusValueOnUpdate:!0}),u.onChange(o,{action:m,option:v})},u.selectOption=function(o){var m=u.props,v=m.blurInputOnSelect,b=m.isMulti,C=m.name,A=u.state.selectValue,B=b&&u.isOptionSelected(o,A),Z=u.isOptionDisabled(o,A);if(B){var q=u.getOptionValue(o);u.setValue(A.filter(function(ee){return u.getOptionValue(ee)!==q}),"deselect-option",o)}else if(!Z)b?u.setValue([].concat(Cg(A),[o]),"select-option",o):u.setValue(o,"select-option");else{u.ariaOnChange(o,{action:"select-option",option:o,name:C});return}v&&u.blurInput()},u.removeValue=function(o){var m=u.props.isMulti,v=u.state.selectValue,b=u.getOptionValue(o),C=v.filter(function(B){return u.getOptionValue(B)!==b}),A=tp(m,C,C[0]||null);u.onChange(A,{action:"remove-value",removedValue:o}),u.focusInput()},u.clearValue=function(){var o=u.state.selectValue;u.onChange(tp(u.props.isMulti,[],null),{action:"clear",removedValues:o})},u.popValue=function(){var o=u.props.isMulti,m=u.state.selectValue,v=m[m.length-1],b=m.slice(0,m.length-1),C=tp(o,b,b[0]||null);u.onChange(C,{action:"pop-value",removedValue:v})},u.getValue=function(){return u.state.selectValue},u.cx=function(){for(var o=arguments.length,m=new Array(o),v=0;v<o;v++)m[v]=arguments[v];return uE.apply(void 0,[u.props.classNamePrefix].concat(m))},u.getOptionLabel=function(o){return gA(u.props,o)},u.getOptionValue=function(o){return Tg(u.props,o)},u.getStyles=function(o,m){var v=GD[o](m);v.boxSizing="border-box";var b=u.props.styles[o];return b?b(v,m):v},u.getElementId=function(o){return"".concat(u.instancePrefix,"-").concat(o)},u.getComponents=function(){return qE(u.props)},u.buildCategorizedOptions=function(){return fA(u.props,u.state.selectValue)},u.getCategorizedOptions=function(){return u.props.menuIsOpen?u.buildCategorizedOptions():[]},u.buildFocusableOptions=function(){return mA(u.buildCategorizedOptions())},u.getFocusableOptions=function(){return u.props.menuIsOpen?u.buildFocusableOptions():[]},u.ariaOnChange=function(o,m){u.setState({ariaSelection:Hi({value:o},m)})},u.onMenuMouseDown=function(o){o.button===0&&(o.stopPropagation(),o.preventDefault(),u.focusInput())},u.onMenuMouseMove=function(o){u.blockOptionHover=!1},u.onControlMouseDown=function(o){if(!o.defaultPrevented){var m=u.props.openMenuOnClick;u.state.isFocused?u.props.menuIsOpen?o.target.tagName!=="INPUT"&&o.target.tagName!=="TEXTAREA"&&u.onMenuClose():m&&u.openMenu("first"):(m&&(u.openAfterFocus=!0),u.focusInput()),o.target.tagName!=="INPUT"&&o.target.tagName!=="TEXTAREA"&&o.preventDefault()}},u.onDropdownIndicatorMouseDown=function(o){if(!(o&&o.type==="mousedown"&&o.button!==0)&&!u.props.isDisabled){var m=u.props,v=m.isMulti,b=m.menuIsOpen;u.focusInput(),b?(u.setState({inputIsHiddenAfterUpdate:!v}),u.onMenuClose()):u.openMenu("first"),o.preventDefault()}},u.onClearIndicatorMouseDown=function(o){o&&o.type==="mousedown"&&o.button!==0||(u.clearValue(),o.preventDefault(),u.openAfterFocus=!1,o.type==="touchend"?u.focusInput():setTimeout(function(){return u.focusInput()}))},u.onScroll=function(o){typeof u.props.closeMenuOnScroll=="boolean"?o.target instanceof HTMLElement&&ep(o.target)&&u.props.onMenuClose():typeof u.props.closeMenuOnScroll=="function"&&u.props.closeMenuOnScroll(o)&&u.props.onMenuClose()},u.onCompositionStart=function(){u.isComposing=!0},u.onCompositionEnd=function(){u.isComposing=!1},u.onTouchStart=function(o){var m=o.touches,v=m&&m.item(0);!v||(u.initialTouchX=v.clientX,u.initialTouchY=v.clientY,u.userIsDragging=!1)},u.onTouchMove=function(o){var m=o.touches,v=m&&m.item(0);if(!!v){var b=Math.abs(v.clientX-u.initialTouchX),C=Math.abs(v.clientY-u.initialTouchY),A=5;u.userIsDragging=b>A||C>A}},u.onTouchEnd=function(o){u.userIsDragging||(u.controlRef&&!u.controlRef.contains(o.target)&&u.menuListRef&&!u.menuListRef.contains(o.target)&&u.blurInput(),u.initialTouchX=0,u.initialTouchY=0)},u.onControlTouchEnd=function(o){u.userIsDragging||u.onControlMouseDown(o)},u.onClearIndicatorTouchEnd=function(o){u.userIsDragging||u.onClearIndicatorMouseDown(o)},u.onDropdownIndicatorTouchEnd=function(o){u.userIsDragging||u.onDropdownIndicatorMouseDown(o)},u.handleInputChange=function(o){var m=u.props.inputValue,v=o.currentTarget.value;u.setState({inputIsHiddenAfterUpdate:!1}),u.onInputChange(v,{action:"input-change",prevInputValue:m}),u.props.menuIsOpen||u.onMenuOpen()},u.onInputFocus=function(o){u.props.onFocus&&u.props.onFocus(o),u.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(u.openAfterFocus||u.props.openMenuOnFocus)&&u.openMenu("first"),u.openAfterFocus=!1},u.onInputBlur=function(o){var m=u.props.inputValue;if(u.menuListRef&&u.menuListRef.contains(document.activeElement)){u.inputRef.focus();return}u.props.onBlur&&u.props.onBlur(o),u.onInputChange("",{action:"input-blur",prevInputValue:m}),u.onMenuClose(),u.setState({focusedValue:null,isFocused:!1})},u.onOptionHover=function(o){u.blockOptionHover||u.state.focusedOption===o||u.setState({focusedOption:o})},u.shouldHideSelectedOptions=function(){return _A(u.props)},u.onKeyDown=function(o){var m=u.props,v=m.isMulti,b=m.backspaceRemovesValue,C=m.escapeClearsValue,A=m.inputValue,B=m.isClearable,Z=m.isDisabled,q=m.menuIsOpen,ee=m.onKeyDown,le=m.tabSelectsValue,de=m.openMenuOnFocus,H=u.state,Q=H.focusedOption,te=H.focusedValue,ve=H.selectValue;if(!Z&&!(typeof ee=="function"&&(ee(o),o.defaultPrevented))){switch(u.blockOptionHover=!0,o.key){case"ArrowLeft":if(!v||A)return;u.focusValue("previous");break;case"ArrowRight":if(!v||A)return;u.focusValue("next");break;case"Delete":case"Backspace":if(A)return;if(te)u.removeValue(te);else{if(!b)return;v?u.popValue():B&&u.clearValue()}break;case"Tab":if(u.isComposing||o.shiftKey||!q||!le||!Q||de&&u.isOptionSelected(Q,ve))return;u.selectOption(Q);break;case"Enter":if(o.keyCode===229)break;if(q){if(!Q||u.isComposing)return;u.selectOption(Q);break}return;case"Escape":q?(u.setState({inputIsHiddenAfterUpdate:!1}),u.onInputChange("",{action:"menu-close",prevInputValue:A}),u.onMenuClose()):B&&C&&u.clearValue();break;case" ":if(A)return;if(!q){u.openMenu("first");break}if(!Q)return;u.selectOption(Q);break;case"ArrowUp":q?u.focusOption("up"):u.openMenu("last");break;case"ArrowDown":q?u.focusOption("down"):u.openMenu("first");break;case"PageUp":if(!q)return;u.focusOption("pageup");break;case"PageDown":if(!q)return;u.focusOption("pagedown");break;case"Home":if(!q)return;u.focusOption("first");break;case"End":if(!q)return;u.focusOption("last");break;default:return}o.preventDefault()}},u.instancePrefix="react-select-"+(u.props.instanceId||++qD),u.state.selectValue=wx(l.value),u}return ql(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(u){var o=this.props,m=o.isDisabled,v=o.menuIsOpen,b=this.state.isFocused;(b&&!m&&u.isDisabled||b&&v&&!u.menuIsOpen)&&this.focusInput(),b&&m&&!u.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(dE(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(u,o){this.props.onInputChange(u,o)}},{key:"focusInput",value:function(){!this.inputRef||this.inputRef.focus()}},{key:"blurInput",value:function(){!this.inputRef||this.inputRef.blur()}},{key:"openMenu",value:function(u){var o=this,m=this.state,v=m.selectValue,b=m.isFocused,C=this.buildFocusableOptions(),A=u==="first"?0:C.length-1;if(!this.props.isMulti){var B=C.indexOf(v[0]);B>-1&&(A=B)}this.scrollToFocusedOptionOnUpdate=!(b&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:C[A]},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(u){var o=this.state,m=o.selectValue,v=o.focusedValue;if(!!this.props.isMulti){this.setState({focusedOption:null});var b=m.indexOf(v);v||(b=-1);var C=m.length-1,A=-1;if(!!m.length){switch(u){case"previous":b===0?A=0:b===-1?A=C:A=b-1;break;case"next":b>-1&&b<C&&(A=b+1);break}this.setState({inputIsHidden:A!==-1,focusedValue:m[A]})}}}},{key:"focusOption",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,m=this.state.focusedOption,v=this.getFocusableOptions();if(!!v.length){var b=0,C=v.indexOf(m);m||(C=-1),u==="up"?b=C>0?C-1:v.length-1:u==="down"?b=(C+1)%v.length:u==="pageup"?(b=C-o,b<0&&(b=0)):u==="pagedown"?(b=C+o,b>v.length-1&&(b=v.length-1)):u==="last"&&(b=v.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:v[b],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Tx):Hi(Hi({},Tx),this.props.theme):Tx}},{key:"getCommonProps",value:function(){var u=this.clearValue,o=this.cx,m=this.getStyles,v=this.getValue,b=this.selectOption,C=this.setValue,A=this.props,B=A.isMulti,Z=A.isRtl,q=A.options,ee=this.hasValue();return{clearValue:u,cx:o,getStyles:m,getValue:v,hasValue:ee,isMulti:B,isRtl:Z,options:q,selectOption:b,selectProps:A,setValue:C,theme:this.getTheme()}}},{key:"hasValue",value:function(){var u=this.state.selectValue;return u.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var u=this.props,o=u.isClearable,m=u.isMulti;return o===void 0?m:o}},{key:"isOptionDisabled",value:function(u,o){return yA(this.props,u,o)}},{key:"isOptionSelected",value:function(u,o){return vA(this.props,u,o)}},{key:"filterOption",value:function(u,o){return xA(this.props,u,o)}},{key:"formatOptionLabel",value:function(u,o){if(typeof this.props.formatOptionLabel=="function"){var m=this.props.inputValue,v=this.state.selectValue;return this.props.formatOptionLabel(u,{context:o,inputValue:m,selectValue:v})}else return this.getOptionLabel(u)}},{key:"formatGroupLabel",value:function(u){return this.props.formatGroupLabel(u)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var u=this.props,o=u.isDisabled,m=u.isSearchable,v=u.inputId,b=u.inputValue,C=u.tabIndex,A=u.form,B=u.menuIsOpen,Z=this.getComponents(),q=Z.Input,ee=this.state,le=ee.inputIsHidden,de=ee.ariaSelection,H=this.commonProps,Q=v||this.getElementId("input"),te=Hi(Hi(Hi({"aria-autocomplete":"list","aria-expanded":B,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},B&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!m&&{"aria-readonly":!0}),this.hasValue()?de?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return m?Ni.createElement(q,kt({},H,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:Q,innerRef:this.getInputRef,isDisabled:o,isHidden:le,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:C,form:A,type:"text",value:b},te)):Ni.createElement(TD,kt({id:Q,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Qd,onFocus:this.onInputFocus,disabled:o,tabIndex:C,inputMode:"none",form:A,value:""},te))}},{key:"renderPlaceholderOrValue",value:function(){var u=this,o=this.getComponents(),m=o.MultiValue,v=o.MultiValueContainer,b=o.MultiValueLabel,C=o.MultiValueRemove,A=o.SingleValue,B=o.Placeholder,Z=this.commonProps,q=this.props,ee=q.controlShouldRenderValue,le=q.isDisabled,de=q.isMulti,H=q.inputValue,Q=q.placeholder,te=this.state,ve=te.selectValue,Ce=te.focusedValue,Se=te.isFocused;if(!this.hasValue()||!ee)return H?null:Ni.createElement(B,kt({},Z,{key:"placeholder",isDisabled:le,isFocused:Se,innerProps:{id:this.getElementId("placeholder")}}),Q);if(de)return ve.map(function(Fe,qe){var ht=Fe===Ce,At="".concat(u.getOptionLabel(Fe),"-").concat(u.getOptionValue(Fe));return Ni.createElement(m,kt({},Z,{components:{Container:v,Label:b,Remove:C},isFocused:ht,isDisabled:le,key:At,index:qe,removeProps:{onClick:function(){return u.removeValue(Fe)},onTouchEnd:function(){return u.removeValue(Fe)},onMouseDown:function(Yt){Yt.preventDefault()}},data:Fe}),u.formatOptionLabel(Fe,"value"))});if(H)return null;var Be=ve[0];return Ni.createElement(A,kt({},Z,{data:Be,isDisabled:le}),this.formatOptionLabel(Be,"value"))}},{key:"renderClearIndicator",value:function(){var u=this.getComponents(),o=u.ClearIndicator,m=this.commonProps,v=this.props,b=v.isDisabled,C=v.isLoading,A=this.state.isFocused;if(!this.isClearable()||!o||b||!this.hasValue()||C)return null;var B={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Ni.createElement(o,kt({},m,{innerProps:B,isFocused:A}))}},{key:"renderLoadingIndicator",value:function(){var u=this.getComponents(),o=u.LoadingIndicator,m=this.commonProps,v=this.props,b=v.isDisabled,C=v.isLoading,A=this.state.isFocused;if(!o||!C)return null;var B={"aria-hidden":"true"};return Ni.createElement(o,kt({},m,{innerProps:B,isDisabled:b,isFocused:A}))}},{key:"renderIndicatorSeparator",value:function(){var u=this.getComponents(),o=u.DropdownIndicator,m=u.IndicatorSeparator;if(!o||!m)return null;var v=this.commonProps,b=this.props.isDisabled,C=this.state.isFocused;return Ni.createElement(m,kt({},v,{isDisabled:b,isFocused:C}))}},{key:"renderDropdownIndicator",value:function(){var u=this.getComponents(),o=u.DropdownIndicator;if(!o)return null;var m=this.commonProps,v=this.props.isDisabled,b=this.state.isFocused,C={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Ni.createElement(o,kt({},m,{innerProps:C,isDisabled:v,isFocused:b}))}},{key:"renderMenu",value:function(){var u=this,o=this.getComponents(),m=o.Group,v=o.GroupHeading,b=o.Menu,C=o.MenuList,A=o.MenuPortal,B=o.LoadingMessage,Z=o.NoOptionsMessage,q=o.Option,ee=this.commonProps,le=this.state.focusedOption,de=this.props,H=de.captureMenuScroll,Q=de.inputValue,te=de.isLoading,ve=de.loadingMessage,Ce=de.minMenuHeight,Se=de.maxMenuHeight,Be=de.menuIsOpen,Fe=de.menuPlacement,qe=de.menuPosition,ht=de.menuPortalTarget,At=de.menuShouldBlockScroll,Ot=de.menuShouldScrollIntoView,Yt=de.noOptionsMessage,at=de.onMenuScrollToTop,Zt=de.onMenuScrollToBottom;if(!Be)return null;var zi=function(_i,Ei){var Li=_i.type,Fi=_i.data,Ji=_i.isDisabled,Cr=_i.isSelected,tn=_i.label,no=_i.value,ii=le===Fi,Hr=Ji?void 0:function(){return u.onOptionHover(Fi)},hn=Ji?void 0:function(){return u.selectOption(Fi)},rn="".concat(u.getElementId("option"),"-").concat(Ei),zr={id:rn,onClick:hn,onMouseMove:Hr,onMouseOver:Hr,tabIndex:-1};return Ni.createElement(q,kt({},ee,{innerProps:zr,data:Fi,isDisabled:Ji,isSelected:Cr,key:rn,label:tn,type:Li,value:no,isFocused:ii,innerRef:ii?u.getFocusedOptionRef:void 0}),u.formatOptionLabel(_i.data,"menu"))},Ii;if(this.hasOptions())Ii=this.getCategorizedOptions().map(function(ti){if(ti.type==="group"){var _i=ti.data,Ei=ti.options,Li=ti.index,Fi="".concat(u.getElementId("group"),"-").concat(Li),Ji="".concat(Fi,"-heading");return Ni.createElement(m,kt({},ee,{key:Fi,data:_i,options:Ei,Heading:v,headingProps:{id:Ji,data:ti.data},label:u.formatGroupLabel(ti.data)}),ti.options.map(function(Cr){return zi(Cr,"".concat(Li,"-").concat(Cr.index))}))}else if(ti.type==="option")return zi(ti,"".concat(ti.index))});else if(te){var jt=ve({inputValue:Q});if(jt===null)return null;Ii=Ni.createElement(B,ee,jt)}else{var ur=Yt({inputValue:Q});if(ur===null)return null;Ii=Ni.createElement(Z,ee,ur)}var Xi={minMenuHeight:Ce,maxMenuHeight:Se,menuPlacement:Fe,menuPosition:qe,menuShouldScrollIntoView:Ot},si=Ni.createElement(Sx,kt({},ee,Xi),function(ti){var _i=ti.ref,Ei=ti.placerProps,Li=Ei.placement,Fi=Ei.maxHeight;return Ni.createElement(b,kt({},ee,Xi,{innerRef:_i,innerProps:{onMouseDown:u.onMenuMouseDown,onMouseMove:u.onMenuMouseMove,id:u.getElementId("listbox")},isLoading:te,placement:Li}),Ni.createElement(DD,{captureEnabled:H,onTopArrive:at,onBottomArrive:Zt,lockEnabled:At},function(Ji){return Ni.createElement(C,kt({},ee,{innerRef:function(tn){u.getMenuListRef(tn),Ji(tn)},isLoading:te,maxHeight:Fi,focusedOption:le}),Ii)}))});return ht||qe==="fixed"?Ni.createElement(A,kt({},ee,{appendTo:ht,controlElement:this.controlRef,menuPlacement:Fe,menuPosition:qe}),si):si}},{key:"renderFormField",value:function(){var u=this,o=this.props,m=o.delimiter,v=o.isDisabled,b=o.isMulti,C=o.name,A=this.state.selectValue;if(!(!C||v))if(b)if(m){var B=A.map(function(ee){return u.getOptionValue(ee)}).join(m);return Ni.createElement("input",{name:C,type:"hidden",value:B})}else{var Z=A.length>0?A.map(function(ee,le){return Ni.createElement("input",{key:"i-".concat(le),name:C,type:"hidden",value:u.getOptionValue(ee)})}):Ni.createElement("input",{name:C,type:"hidden"});return Ni.createElement("div",null,Z)}else{var q=A[0]?this.getOptionValue(A[0]):"";return Ni.createElement("input",{name:C,type:"hidden",value:q})}}},{key:"renderLiveRegion",value:function(){var u=this.commonProps,o=this.state,m=o.ariaSelection,v=o.focusedOption,b=o.focusedValue,C=o.isFocused,A=o.selectValue,B=this.getFocusableOptions();return Ni.createElement(ID,kt({},u,{id:this.getElementId("live-region"),ariaSelection:m,focusedOption:v,focusedValue:b,isFocused:C,selectValue:A,focusableOptions:B}))}},{key:"render",value:function(){var u=this.getComponents(),o=u.Control,m=u.IndicatorsContainer,v=u.SelectContainer,b=u.ValueContainer,C=this.props,A=C.className,B=C.id,Z=C.isDisabled,q=C.menuIsOpen,ee=this.state.isFocused,le=this.commonProps=this.getCommonProps();return Ni.createElement(v,kt({},le,{className:A,innerProps:{id:B,onKeyDown:this.onKeyDown},isDisabled:Z,isFocused:ee}),this.renderLiveRegion(),Ni.createElement(o,kt({},le,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:Z,isFocused:ee,menuIsOpen:q}),Ni.createElement(b,kt({},le,{isDisabled:Z}),this.renderPlaceholderOrValue(),this.renderInput()),Ni.createElement(m,kt({},le,{isDisabled:Z}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(u,o){var m=o.prevProps,v=o.clearFocusValueOnUpdate,b=o.inputIsHiddenAfterUpdate,C=o.ariaSelection,A=o.isFocused,B=o.prevWasFocused,Z=u.options,q=u.value,ee=u.menuIsOpen,le=u.inputValue,de=u.isMulti,H=wx(q),Q={};if(m&&(q!==m.value||Z!==m.options||ee!==m.menuIsOpen||le!==m.inputValue)){var te=ee?XD(u,H):[],ve=v?$D(o,H):null,Ce=YD(o,te);Q={selectValue:H,focusedOption:Ce,focusedValue:ve,clearFocusValueOnUpdate:!1}}var Se=b!=null&&u!==m?{inputIsHidden:b,inputIsHiddenAfterUpdate:void 0}:{},Be=C,Fe=A&&B;return A&&!Fe&&(Be={value:tp(de,H,H[0]||null),options:H,action:"initial-input-focus"},Fe=!B),C?.action==="initial-input-focus"&&(Be=null),Hi(Hi(Hi({},Q),Se),{},{prevProps:u,ariaSelection:Be,prevWasFocused:Fe})}}]),r}(Mi.Component);kx.defaultProps=HD;var JD=Nt(ag());var iW=Nt(Am()),QD=(0,zx.forwardRef)(function(e,t){var r=JE(e);return bA.createElement(kx,kt({ref:t},r))});var wA=QD;var Qa=Nt(Zr(),1),Pg=class extends IA.Component{constructor(){super(...arguments);this._events=[];this.state={zoomToExtent:!0,currentLayer:"unknown"};this.onLayerChange=r=>{if(r==null)return;let[l,u]=r.value.split("::");ze.map.setLayerId(l,u),Xl("Ui","layer:"+r.value),this.state.zoomToExtent&&ze.map.layers.then(o=>{let m=o.get(l);m!=null&&ze.map.emit("bounds",[m.upperLeft,m.lowerRight])}),window.history.pushState(null,"",`?${go.toUrl(ze.map)}`)};this.onZoomExtentChange=r=>{let l=r.target;this.setState({zoomToExtent:l.checked})}}componentDidMount(){this.setState({zoomToExtent:!0,currentLayer:ze.map.layerKey}),ze.map.layers.then(r=>this.setState({layers:r})),this._events.push(ze.map.on("layer",()=>this.setState({currentLayer:ze.map.layerKey})),ze.map.on("tileMatrix",()=>this.forceUpdate()))}componentWillUnmount(){for(let r of this._events)r();this._events=[]}render(){let r=this.makeOptions();return(0,Qa.jsxs)("div",{className:"LuiDeprecatedForms",children:[(0,Qa.jsx)("h6",{children:"Layers"}),(0,Qa.jsx)(wA,{options:r.options,onChange:this.onLayerChange,value:r.current}),(0,Qa.jsx)("div",{className:"lui-input-group-wrapper",children:(0,Qa.jsxs)("div",{className:"lui-checkbox-container",children:[(0,Qa.jsx)("input",{type:"checkbox",onChange:this.onZoomExtentChange,checked:this.state.zoomToExtent}),(0,Qa.jsx)("label",{children:"Zoom to Extent"})]})})]})}makeOptions(){if(this.state.layers==null||this.state.layers.size===0)return{options:[],current:null};let r=new Map,l=this.state.currentLayer,u=null;for(let o of this.state.layers.values()){if(!o.projections.has(ze.map.tileMatrix.projection.code))continue;let m=o.category??"Unknown",v=r.get(m)??{label:m,options:[]},b={value:o.id,label:o.name.replace(` ${o.category}`,"")};v.options.push(b),r.set(m,v),o.id===l&&(u=b)}return{options:[...r.values()],current:u}}};var Kt=Nt(Zr(),1),kg=class extends Ql.Component{constructor(){super(...arguments);this._events=[];this.state={isMenuOpen:!1};this.menuToggle=()=>{let r=!this.state.isMenuOpen;Xl("Ui",r?"menu:open":"menu:close"),this.setState({isMenuOpen:r})};this.contactUs=()=>{let r="Request Basemaps Developer Access",l=`
563
+ Give us a few key details to sign up for Developer Access to LINZ Basemaps. We will respond with your Apps' unique API key.
564
+
565
+ Your Name:
566
+
567
+ Your Email:
568
+
569
+ Your Service/App URL:
570
+
571
+ `;Xl("Ui","contact-us:click"),window.location.href=`mailto:basemaps@linz.govt.nz?subject=${encodeURI(r)}&body=${encodeURI(l)}`};this._validProjections=new Set([fi.Google,fi.Nztm2000])}componentDidMount(){this._events.push(ze.map.on("change",()=>this.forceUpdate())),ze.map.layers.then(r=>this.setState({layers:r}))}componentWillUnmount(){for(let r of this._events)r();this._events=[]}render(){if(!ze.map.isDebug)return(0,Kt.jsxs)("header",{className:"lui-header",children:[(0,Kt.jsxs)("div",{className:"lui-header-row",children:[(0,Kt.jsxs)("div",{className:"lui-header-col",children:[(0,Kt.jsx)("div",{className:"lui-header-logo",children:(0,Kt.jsx)("img",{className:"linz-logo",src:"/assets/logo-linz.svg"})}),(0,Kt.jsx)("div",{className:"lui-header-title",children:(0,Kt.jsx)("h1",{children:"Basemaps"})})]}),(0,Kt.jsx)("div",{className:"lui-header-col",children:(0,Kt.jsx)("div",{className:"lui-header-menu-item",children:(0,Kt.jsx)("div",{className:"lui-header-menu-icon",children:(0,Kt.jsx)("i",{className:"material-icons-round md-36",onClick:this.menuToggle,style:{cursor:"pointer"},children:this.state.isMenuOpen?"close":"menu"})})})})]}),(0,Kt.jsxs)("div",{className:rg({"lui-menu-drawer":!0,"lui-menu-drawer-closed":!this.state.isMenuOpen,"lui-menu-drawer-wide":!0}),"aria-hidden":this.state.isMenuOpen,children:[(0,Kt.jsx)(Pg,{}),this.renderLinks(),(0,Kt.jsx)("h6",{children:"Developer API Keys"}),(0,Kt.jsx)("p",{children:"Contact us for free API keys with better support for public web and mobile apps."}),(0,Kt.jsx)("button",{className:"lui-button lui-button-primary contact-us",onClick:this.contactUs,children:"Contact us"}),this.renderAbout()]})]})}renderAboutLi(r,l,u){return(0,Kt.jsx)("li",{children:(0,Kt.jsxs)(fs,{href:l,children:[r,u??(0,Kt.jsx)(jd,{name:"launch"})]})})}renderAbout(){return(0,Kt.jsxs)(Ql.Fragment,{children:[(0,Kt.jsx)("h6",{children:"About Basemaps"}),(0,Kt.jsxs)("ul",{className:"about-links",children:[this.renderAboutLi("Get started","https://www.linz.govt.nz/data/linz-data/linz-basemaps/get-started-linz-basemaps"),this.renderAboutLi("Technical information","https://www.linz.govt.nz/data/linz-data/linz-basemaps/linz-basemaps-documentation"),this.renderAboutLi("How to use our APIs","https://www.linz.govt.nz/data/linz-data/linz-basemaps/how-use-linz-basemaps-apis"),this.renderAboutLi("Github","https://github.com/linz/basemaps",this.renderGithubLogo()),(0,Kt.jsx)("li",{children:(0,Kt.jsxs)(fs,{href:"https://github.com/linz/basemaps/blob/master/CHANGELOG.md",children:["Version ",(0,Kt.jsx)("span",{className:"basemaps-version",children:ze.Version})]})})]})]})}renderGithubLogo(){return(0,Kt.jsx)("svg",{style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",children:(0,Kt.jsx)("path",{fill:"currentColor",d:"M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z"})})}renderLinks(){return(0,Kt.jsxs)(Ql.Fragment,{children:[(0,Kt.jsx)("h6",{children:"90 day API keys"}),(0,Kt.jsx)("p",{children:"API keys expire after 90 days, if a longer duration is needed please request a developer API key"}),(0,Kt.jsx)(ia,{header:"Api Key",value:ze.ApiKey}),this.renderLinksTiles()]})}validProjections(){return this.state.layers==null?this._validProjections:this.state.layers.get(ze.map.layerId)?.projections??this._validProjections}renderLinksTiles(){if(ze.map.isVector)return(0,Kt.jsxs)(Ql.Fragment,{children:[(0,Kt.jsx)(ia,{header:"StyleJSON",value:ze.map.toTileUrl("style")},"StyleJSON"),(0,Kt.jsx)(ia,{header:"XYZ",value:ze.map.toTileUrl("vector-xyz")},"XYZ")]});let r=this.validProjections(),l=[];if(r.has(fi.Nztm2000)){let u=ze.map.toTileUrl("wmts",ls);l.push((0,Kt.jsx)(ia,{header:"WMTS: NZTM2000Quad",value:u},"NZTM2000Quad"))}if(r.has(fi.Google)){let u=ze.map.toTileUrl("wmts",xi),o=ze.map.toTileUrl("raster",xi);l.push((0,Kt.jsx)(ia,{header:"WMTS: WebMercatorQuad",value:u},"WebMercatorQuad")),l.push((0,Kt.jsx)(ia,{header:"XYZ",value:o},"XYZ"))}return(0,Kt.jsx)(Ql.Fragment,{children:l})}};var Fc=Nt(zg(),1),zA=Nt(Pr(),1);function CA(e){let t=document.createElement("span");return t.textContent=e,t.innerHTML}var Dx=class{constructor(t){this.boundaries=[],this.collection=t;let r=t.summaries["linz:zoom"];this.minZoom=r.min,this.maxZoom=r.max,this.bbox=t.extent.spatial.bbox[0]}intersects(t,r){return r>this.maxZoom||r<this.minZoom||!$a.intersects(t,this.bbox)?!1:this.intersection($a.bboxToMultiPolygon(t))}intersection(t){for(let r of this.boundaries)if(_1(r,t).length>0)return!0;return!1}addBoundary(t){KD(t),this.boundaries.push(t)}};function KD(e){for(let t of e)for(let r of t)if(r.length!==2)throw new Error("Invalid ring wrong length")}function eB(e){var t;let r=new Map,l=[];for(let u of e.collections){let o=new Dx(u);l.push(o),r.set(u.id,o)}for(let u of e.features){let o=r.get((t=u.collection)!==null&&t!==void 0?t:"");if(o==null)throw new Error("Could not match feature to collection: "+u.collection);if(u.geometry.type==="Polygon")o.addBoundary(u.geometry.coordinates);else if(u.geometry.type==="MultiPolygon")for(let m of u.geometry.coordinates)o.addBoundary(m)}return l}function MA(e){let{interval:t}=e.extent.temporal;if(t==null||t.length===0)return[-1,-1];let r=t[0],l=new Date(r[0]).getFullYear(),u=(r.length<2?l:new Date(r[1]).getFullYear())-1;return[l,u<l?l:u]}var Ka=class{constructor(t){this.attributions=t}static async load(t){let r=await fetch(t);if(r.ok){let l=await r.json();return Ka.fromStac(l)}throw new Error(`fetch attribution failed [${r.status}] ${r.statusText}`)}static fromStac(t){return new Ka(eB(t).reverse())}filter(t,r){r=Math.round(r);let l=[],{attributions:u}=this;if(u==null)return l;for(let o of u)this.isIgnored!=null&&this.isIgnored(o)||o.intersects(t,r)&&l.push(o.collection);return l}renderList(t){if(t.length===0)return"";let r=CA(t[0].title);if(t.length>1)if(t.length===2)r+=` & ${CA(t[1].title)}`;else{let[l,u]=MA(t[1]);for(let o=1;o<t.length;++o){let[m,v]=MA(t[o]);m!==-1&&(l===-1||m<l)&&(l=m),v!==-1&&(u===-1||v>u)&&(u=v)}l===-1&&(l=u),u!==-1&&(r+=` & others ${l}-${u}`)}return r}};var rp=Nt(zg(),1);var EA=`\xA9 ${HI.License} LINZ`,Lg=new Map,AA=new Map,Rg=class{constructor(t){this._raf=0;this.attributionHtml="";this.bounds=new rp.LngLatBounds([0,0,0,0]);this.zoom=-1;this.filteredRecords=[];this.resetAttribution=()=>{this.attributionHtml="",this.updateAttribution()};this.updateAttribution=()=>{if(ze.map.isVector)return this.vectorAttribution();let t=ze.map.layerKeyTms,r=Lg.get(t);r==null&&(r=Ka.load(ze.map.toTileUrl("attribution")).catch(()=>null),Lg.set(t,r),r.then(l=>{l!=null&&(l.isIgnored=this.isIgnored,AA.set(t,l),this.scheduleRender())})),this.scheduleRender()};this.isIgnored=t=>{let r=t.collection.title.toLowerCase();return r.startsWith("geographx")||r.includes(" dem ")};this.renderAttribution=()=>{this._raf=0;let t=AA.get(ze.map.layerKeyTms);if(t==null)return this.removeAttribution();this.zoom=Math.round(this.map.getZoom()??0),this.bounds=this.map.getBounds(),this.zoom+=1;let r=this.mapboxBoundToBbox(this.bounds,ze.map.tileMatrix),l=t.filter(r,this.zoom),u=t.renderList(l);if(u===""?u=EA:u=EA+" - "+u,u!==this.attributionHtml){let o=this.attributionHtml=u;this.removeAttribution(),this.attributionControl=new rp.default.AttributionControl({compact:!1,customAttribution:o}),this.map.addControl(this.attributionControl,"bottom-right")}this.filteredRecords=l};this.map=t,el(t,this.resetAttribution),t.on("move",this.updateAttribution),ze.map.on("tileMatrix",this.resetAttribution),ze.map.on("layer",this.resetAttribution)}scheduleRender(){this._scheduled!=null||this._raf!==0||this.map.getZoom()===this.zoom&&this.map.getBounds()===this.bounds||(this.zoom=this.map.getZoom()??0,this.bounds=this.map.getBounds(),this._scheduled=setTimeout(()=>{this._scheduled=void 0,this._raf=requestAnimationFrame(this.renderAttribution)},200))}removeAttribution(){this.attributionControl!=null&&(this.map.removeControl(this.attributionControl),this.attributionControl=null)}mapboxBoundToBbox(t,r){let l={lon:t.getWest(),lat:t.getSouth(),zoom:this.zoom},u={lon:t.getEast(),lat:t.getNorth(),zoom:this.zoom},o=ps(l,xi,r),m=ps(u,xi,r);return[o.lon,o.lat,m.lon,m.lat]}vectorAttribution(){this.removeAttribution(),this.attributionControl=new rp.default.AttributionControl({compact:!1}),this.map.addControl(this.attributionControl,"bottom-right")}};var Nc=Nt(Pr(),1);var vs=class{static getTileSet(t){let r=ji.toConfigUrl(t),l=this.tileSets.get(r);return l||(l=fetch(r).then(u=>u.ok?u.json():null),this.tileSets.set(r,l),l)}static getImagery(t,r){let l=ji.toConfigImageryUrl(t,r),u=this.imagery.get(l);return u||(u=fetch(l).then(o=>o.ok?o.json():null),this.imagery.set(l,u),u)}static getGeoJson(t){let r=us.find(t.tileMatrix);if(r==null)return;let l=ds.get(r).toGeoJson(t.files);for(let u of l.features){u.properties=u.properties??{};let o=u.properties.name;u.properties.location=OC(t.uri,u.properties.name),u.properties.epsg=t.projection,u.properties.tileMatrix=t.tileMatrix;let m=t.files.find(v=>v.name===o);m!=null&&(u.properties.x=m.x,u.properties.y=m.y,u.properties.width=m.width,u.properties.height=m.height)}return l}};vs.tileSets=new Map,vs.imagery=new Map;var Dg=class{constructor(){this._layerLoading=new Map;this._source=new Map;this._styleJson=null;this.adjustTopographic=t=>{ze.map.setDebug("debug.layer.linz-topographic",Number(t.target.value))};this.adjustOsm=t=>{ze.map.setDebug("debug.layer.osm",Number(t.target.value))};this.adjustLinzAerial=t=>{ze.map.setDebug("debug.layer.linz-aerial",Number(t.target.value))};this.togglePurple=t=>{let r=t.target;this.setPurple(r.checked)}}loadSourceLayer(t,r,l,u){let o=`${r}-${u}`,m=this._layerLoading.get(o);return m==null&&(m=this._loadSourceLayer(t,r,l,u),this._layerLoading.set(o,m)),m}async _loadSourceLayer(t,r,l,u){let o=`${r}_${u}`,m=`${o}_fill`;if(t.getLayer(m)!=null)return;let v=await this.fetchSourceLayer(l.id,u);if(v==null&&u==="source"&&(v=vs.getGeoJson(l)),v==null)return;ze.map.tileMatrix.projection!==xi.projection&&qC(v,ze.map.tileMatrix);let b=0;for(let C of v.features)C.id=b++;t.addSource(o,{type:"geojson",data:v})}async fetchSourceLayer(t,r){let l=`${t}_${r}`,u=this._source.get(l);if(u==null){let o=ji.toImageryUrl(t,r==="source"?"source.geojson":"covering.geojson");u=fetch(o).then(m=>{if(m.ok)return m.json()}),this._source.set(l,u)}return u}get styleJson(){return this._styleJson==null&&(this._styleJson=fetch(ji.toTileUrl("style",ze.map.tileMatrix,"topographic","topographic",null)).then(t=>t.json())),this._styleJson}async adjustVector(t,r){let l=await this.styleJson;if(t.getSource("LINZ Basemaps")==null){if(r===0)return;let m=l.sources?.["LINZ Basemaps"];if(m==null)return;t.addSource("LINZ Basemaps",m),t.setStyle({...t.getStyle(),glyphs:l.glyphs,sprite:l.sprite}),t.once("style.load",()=>this.adjustVector(t,r));return}let o=l.layers?.filter(m=>m.type!=="background"&&m.source==="LINZ Basemaps")??[];if(ze.map.layerId!=="topographic"){for(let m of o){let v=m.paint??{};m.type==="symbol"?(v["icon-opacity"]=0,v["text-opacity"]=0):v[`${m.type}-opacity`]=0,m.paint=v}if(r===0){for(let m of o)t.getLayer(m.id)!=null&&t.removeLayer(m.id);return}if(t.getLayer(o[0].id)==null){if(r===0)return;for(let m of o)t.addLayer(m)}for(let m of o)t.getLayer(m.id)!=null&&(m.type==="symbol"?(t.setPaintProperty(m.id,"icon-opacity",r),t.setPaintProperty(m.id,"text-opacity",r)):t.setPaintProperty(m.id,`${m.type}-opacity`,r))}}adjustRaster(t,r,l){t.getSource(r)==null&&t.addSource(r,{type:"raster",tiles:[this.getTileServerUrl(r)],tileSize:256});let u=t.getLayer(r)==null;if(l===0){u||t.removeLayer(r);return}if(u){t.addLayer({id:r,type:"raster",source:r,minzoom:0,maxzoom:24,paint:{"raster-opacity":0}});let o=`${ze.map.layerId}_source_fill`;t.getLayer(o)!=null&&t.moveLayer(r,o)}t.setPaintProperty(r,"raster-opacity",l)}setPurple(t){ze.map.setDebug("debug.background",t?"magenta":!1),t?document.body.style.backgroundColor="magenta":document.body.style.backgroundColor=""}getTileServerUrl(t){if(t==="osm")return"https://tile.openstreetmap.org/{z}/{x}/{y}.png";if(t==="linz-aerial")return ji.toTileUrl("raster",ze.map.tileMatrix,"aerial",void 0,null);throw new Error("Unknown tile server")}};var ei=Nt(Zr(),1);function Bg(e,t){return(0,ei.jsx)("input",{className:"debug__slider",type:"range",min:"0",max:"1",step:"0.05",defaultValue:String(ze.map.debug[`debug.layer.${e}`]),onChange:t})}var Ng=class extends Nc.Component{constructor(){super(...arguments);this.debugMap=new Dg;this.state={};this.waitForMap=()=>{let r=this.props.map;if(r==null){setTimeout(this.waitForMap,20);return}window.MaplibreMap=r,r.resize(),el(r,()=>{ze.map.on("change",()=>{if(this.props.map==null)return;let l=ji.toHash(ze.map.getLocation(this.props.map)),u="?"+go.toUrl(ze.map);window.history.replaceState(null,"",u+l),this.updateFromConfig()}),this.updateFromConfig(),ze.map.debug["debug.screenshot"]&&r.once("idle",async()=>{await Promise.all([...Lg.values()]),await new Promise(u=>setTimeout(u,250));let l=document.createElement("div");l.id="map-loaded",l.style.width="1px",l.style.height="1px",document.body.appendChild(l)})})};this.toggleCogs=r=>{let l=r.target;ze.map.setDebug("debug.cog",l.checked),this.setVectorShown(l.checked,"cog")};this.toggleSource=r=>{let l=r.target;ze.map.setDebug("debug.source",l.checked),this.setVectorShown(l.checked,"source")};this._loadingConfig=Promise.resolve();this.downloadSource=async()=>{let r=this.state.imagery;if(r==null)return;let l=vs.getGeoJson(r);if(l==null)return;let u="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(l)),o=document.createElement("a");o.setAttribute("href",u),o.setAttribute("download",r.name+".json"),document.body.appendChild(o),o.click(),o.remove()}}componentDidMount(){this.waitForMap()}updateFromConfig(){(this.state.tileSet?.id!==ze.map.layerId||this.state.config!==ze.map.config)&&(this._loadingConfig=this._loadingConfig.then(()=>this.loadConfig())),this.debugMap.setPurple(ze.map.debug["debug.background"]==="magenta"),this.debugMap.adjustRaster(this.props.map,"osm",ze.map.debug["debug.layer.osm"]),this.debugMap.adjustRaster(this.props.map,"linz-aerial",ze.map.debug["debug.layer.linz-aerial"]),this.debugMap.adjustVector(this.props.map,ze.map.debug["debug.layer.linz-topographic"]),this.setVectorShown(ze.map.debug["debug.source"],"source"),this.setVectorShown(ze.map.debug["debug.cog"],"cog")}async loadConfig(){let r=ze.map.layerId;if(this.state.tileSet?.id!==r)return vs.getTileSet(r).then(l=>{if(this.setState({tileSet:l,config:ze.map.config}),l==null||l.layers.length!==1)return;let u=ze.map.tileMatrix.projection.code,o=l.layers[0][u];if(o!=null)return this.debugMap.fetchSourceLayer(o,"cog").then(m=>{this.setState({isCog:m!=null})}),vs.getImagery(r,o).then(m=>{this.setState({imagery:m,config:ze.map.config})})})}render(){if(ze.map.debug["debug.screenshot"])return null;let r=ji.toTileUrl("wmts",ze.map.tileMatrix,ze.map.layerId,void 0,ze.map.config);return(0,ei.jsxs)("div",{className:"debug",children:[(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:"Id"}),(0,ei.jsx)("div",{className:"debug__value",children:ze.map.layerId})]}),(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label"}),(0,ei.jsxs)("div",{className:"debug__value",children:[ze.map.tileMatrix.projection.toEpsgString()," - ",(0,ei.jsx)("a",{href:r,children:"WMTS"})]})]}),(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:"TileMatrix"}),(0,ei.jsx)("div",{className:"debug__value",children:ze.map.tileMatrix.identifier})]}),this.renderSliders(),this.renderPurple(),this.renderCogToggle(),this.renderSourceToggle()]})}renderPurple(){if(!ze.map.debug["debug.screenshot"])return(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:"Purple"}),(0,ei.jsx)("input",{type:"checkbox",onChange:this.debugMap.togglePurple,checked:ze.map.debug["debug.background"]==="magenta"})]})}renderCogToggle(){if(this.state.imagery==null)return null;let r=ji.toImageryUrl(this.state.imagery.id,"covering.geojson");if(!!this.state.isCog)return(0,ei.jsxs)(Nc.Fragment,{children:[(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:(0,ei.jsx)("a",{href:r,title:"Source geojson",children:"Cogs"})}),(0,ei.jsx)("input",{type:"checkbox",onChange:this.toggleCogs,checked:ze.map.debug["debug.cog"]})]}),this.state.featureCogId==null?null:(0,ei.jsxs)("div",{className:"debug__info",title:String(this.state.featureCogName),children:[(0,ei.jsx)("label",{className:"debug__label",children:"CogId"}),String(this.state.featureCogName).split("/").pop()]})]})}renderSourceToggle(){return this.state.imagery==null?null:(0,ei.jsxs)(Nc.Fragment,{children:[(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:(0,ei.jsx)("a",{onClick:this.downloadSource,href:"#",title:"Source geojson",children:"Source"})}),(0,ei.jsx)("input",{type:"checkbox",onChange:this.toggleSource,checked:ze.map.debug["debug.source"]})]}),this.state.featureSourceId==null?null:(0,ei.jsxs)("div",{className:"debug__info",title:String(this.state.featureSourceName),children:[(0,ei.jsx)("label",{className:"debug__label",children:"SourceId"}),String(this.state.featureSourceName).split("/").pop()]})]})}renderSliders(){if(!ze.map.debug["debug.screenshot"])return ze.map.tileMatrix.identifier!==xi.identifier?(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:"LINZ Aerial"}),Bg("linz-aerial",this.debugMap.adjustLinzAerial)]}):(0,ei.jsxs)(Nc.Fragment,{children:[(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:"OSM"}),Bg("osm",this.debugMap.adjustOsm)]}),(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:"Topographic"}),Bg("linz-topographic",this.debugMap.adjustTopographic)]}),(0,ei.jsxs)("div",{className:"debug__info",children:[(0,ei.jsx)("label",{className:"debug__label",children:"LINZ Aerial"}),Bg("linz-aerial",this.debugMap.adjustLinzAerial)]})]})}trackMouseMove(r,l){let u=`${r}_${l}`,o=`${u}_fill`,m=this.props.map,v,b=l==="source"?"featureSource":"featureCog";m.on("click",o,C=>{let A=C.features;if(A==null||A.length===0)return;let B=A[0],Z=B.properties?.location??B.properties?.name;Z!=null&&navigator.clipboard.writeText(Z).then(()=>{let q=document.createElement("div");q.innerText=`Copied ${Z}`,q.className="toast-message",q.title=Z,document.body.appendChild(q),setTimeout(()=>q.remove(),2500)})}),m.on("mousemove",o,C=>{let A=C.features;if(A==null||A.length===0)return;let B=A[0];B.id!==v&&(v!=null&&m.setFeatureState({source:u,id:v},{hover:!1}),v=B.id,this.setState({[`${b}Id`]:v,[`${b}Name`]:B.properties?.name}),m.setFeatureState({source:u,id:v},{hover:!0}))}),m.on("mouseleave",o,()=>{v!=null&&(m.setFeatureState({source:u,id:v},{hover:!1}),v=void 0,this.setState({[`${b}Id`]:void 0,[`${b}Name`]:void 0}))})}setVectorShown(r,l){let u=this.props.map,o=ze.map.layerId,m=`${o}_${l}`,v=`${m}_fill`,b=`${m}_line`;if(r===!1){if(u.getLayer(v)==null)return;u.removeLayer(v),u.removeLayer(b);return}if(u.getLayer(b)!=null)return;let C=l==="source"?"#ff00ff":"#ff0000";this.state.imagery!=null&&this.debugMap.loadSourceLayer(this.props.map,o,this.state.imagery,l).then(()=>{u.getLayer(b)==null&&(u.addLayer({id:v,type:"fill",source:m,paint:{"fill-opacity":["case",["boolean",["feature-state","hover"],!1],.25,0],"fill-color":C}}),this.trackMouseMove(o,l),u.addLayer({id:b,type:"line",source:m,paint:{"line-color":C,"line-opacity":["case",["boolean",["feature-state","hover"],!1],1,.5],"line-width":["case",["boolean",["feature-state","hover"],!1],2,1]}}))})}};var PA=Nt(zg(),1),kA=Nt(Pr(),1);var TA=Nt(Zr(),1),Fg=class extends kA.Component{constructor(){super(...arguments);this._events=[];this._updateTimer=null;this.update=()=>{this._updateTimer==null&&(this._updateTimer=setTimeout(this.updateMap,1e3))};this.updateMap=()=>{this._updateTimer=null;let r=ze.map.transformedLocation,l=this.getStyleType(),u=`${l.layerId}::${l.style}`;if(this.currentStyle!==u){let m=Lc(ze.map.tileMatrix.identifier).getStyle(l.layerId,l.style);this.currentStyle=u,this.map.setStyle(m)}this.map.setZoom(Math.max(r.zoom-4,0)),this.map.setCenter([r.lon,r.lat]),this.forceUpdate()};this.switchLayer=()=>{let r=this.getStyleType();ze.map.setLayerId(r.layerId,r.style),this.updateMap(),window.history.pushState(null,"",`?${go.toUrl(ze.map)}`)}}componentDidMount(){if(ze.map.updateFromUrl(),this.el=document.getElementById("map-switcher-map"),this.el==null)return;let r=ze.map,l=Lc(r.tileMatrix.identifier),u=this.getStyleType();this.currentStyle=`${u.layerId}::${u.style}`;let o=l.getStyle(u.layerId,u.style),m=r.transformedLocation;this.map=new PA.default.Map({container:this.el,style:o,center:[m.lon,m.lat],zoom:m.zoom,attributionControl:!1}),el(this.map,()=>{this._events.push(ze.map.on("location",this.update),ze.map.on("tileMatrix",this.update),ze.map.on("layer",this.update),ze.map.on("bounds",this.update)),this.updateMap()})}componentWillUnmount(){this.map&&this.map.remove();for(let r of this._events)r()}getStyleType(){return ze.map.layerId!=="aerial"?{layerId:"aerial"}:{layerId:"topographic",style:"topographic"}}render(){let r=`Switch map to ${this.getStyleType().layerId}`;return(0,TA.jsx)("div",{id:"map-switcher",className:"map-switcher",onClick:this.switchLayer,title:r,children:(0,TA.jsx)("div",{id:"map-switcher-map",style:{width:"100%",height:"100%",pointerEvents:"none"}})})}};var np=Nt(Zr(),1);function el(e,t){if(e.loaded())return t();setTimeout(()=>el(e,t),100)}var Og=class extends zA.Component{constructor(){super(...arguments);this.ignoreNextLocationUpdate=!1;this.updateLocation=()=>{if(this.ignoreNextLocationUpdate){this.ignoreNextLocationUpdate=!1;return}let r=ze.map.location;this.map.setZoom(r.zoom),this.map.setCenter([r.lon,r.lat])};this.updateBounds=r=>{if(ze.map.tileMatrix!==xi){let l=Fc.default.LngLatBounds.convert(r),u=l.getNorthEast(),o=l.getSouthWest(),m=this.map.getZoom(),v=ps({lat:u.lat,lon:u.lng,zoom:m},ze.map.tileMatrix,xi),b=ps({lat:o.lat,lon:o.lng,zoom:m},ze.map.tileMatrix,xi);r=[[v.lon,v.lat],[b.lon,b.lat]]}this.map.fitBounds(r)};this.updateStyle=()=>{this.ensureGeoControl();let l=Lc(ze.map.tileMatrix.identifier).getStyle(ze.map.layerId,ze.map.style);this.map.setStyle(l),ze.map.tileMatrix!==xi?this.map.setMaxBounds([-180,-85.06,180,85.06]):this.map.setMaxBounds(),this.forceUpdate()};this._events=[];this.updateUrlTimer=null;this.onRender=()=>{this.updateUrlTimer==null&&(this.updateUrlTimer=setTimeout(()=>this.setLocationUrl(),1e3))}}ensureGeoControl(){if(!ze.map.debug["debug.screenshot"])if(ze.map.tileMatrix===xi){if(this.controlGeo!=null)return;this.controlGeo=new Fc.default.GeolocateControl({}),this.map.addControl(this.controlGeo,"top-left")}else{if(this.controlGeo==null)return;this.map.removeControl(this.controlGeo)}}componentDidMount(){if(ze.map.updateFromUrl(),this.el=document.getElementById("map"),this.el==null)throw new Error("Unable to find #map element");let r=ze.map,u=Lc(r.tileMatrix.identifier).getStyle(r.layerId,r.style),o=ps(r.location,r.tileMatrix,xi);if(this.map=new Fc.default.Map({container:this.el,style:u,center:[o.lon,o.lat],zoom:o.zoom,attributionControl:!1}),this.mapAttr=new Rg(this.map),ze.map.debug["debug.screenshot"]!==!0){let m=new Fc.default.NavigationControl({visualizePitch:!0});this.map.addControl(m,"top-left"),ze.map.isDebug||this.map.addControl(new Fc.default.FullscreenControl({container:this.el}))}this.map.on("render",this.onRender),el(this.map,()=>{this._events.push(ze.map.on("location",this.updateLocation),ze.map.on("tileMatrix",this.updateStyle),ze.map.on("layer",this.updateStyle),ze.map.on("bounds",this.updateBounds)),this.updateStyle(),this.forceUpdate()})}componentWillUnmount(){this.map&&this.map.remove();for(let r of this._events)r();this._events=[]}render(){let r=ze.map.tileMatrix===xi&&!ze.map.isDebug;return(0,np.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,np.jsx)("div",{id:"map",style:{width:"100%",height:"100%"}}),ze.map.isDebug?(0,np.jsx)(Ng,{map:this.map}):void 0,r?(0,np.jsx)(Fg,{}):void 0]})}setLocationUrl(){this.updateUrlTimer=null;let r=ze.map.getLocation(this.map);this.ignoreNextLocationUpdate=!0,ze.map.setLocation(r);let l=ji.toHash(r);window.history.replaceState(null,"",l)}};var tB="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=";function iB(){let e=document.createElement("canvas");return e.getContext&&e.getContext("2d")?e.toDataURL("image/webp").indexOf("data:image/webp")===0:!1}function rB(){let e=new Image,t=new Promise(r=>{e.onload=()=>r(!0),e.onerror=()=>r(!1)});return e.src=tB,t}function LA(){return new Promise(e=>{if(iB())return e(!0);rB().then(e)})}var Oc=Nt(Zr(),1),Bx=class extends Gg.Component{render(){return(0,Oc.jsxs)(Gg.Fragment,{children:[(0,Oc.jsx)(kg,{}),(0,Oc.jsx)(Og,{}),(0,Oc.jsx)(ig,{})]})}};document.addEventListener("DOMContentLoaded",async()=>{await await LA()&&(ji.ImageFormat="webp"),ze.map.updateFromUrl();let t=document.getElementById("main");if(t==null)throw new Error("Missing #main");(0,RA.createRoot)(t).render((0,Oc.jsx)(Bx,{}))});
572
+ /**
573
+ * @license React
574
+ * react-dom.production.min.js
575
+ *
576
+ * Copyright (c) Facebook, Inc. and its affiliates.
577
+ *
578
+ * This source code is licensed under the MIT license found in the
579
+ * LICENSE file in the root directory of this source tree.
580
+ */
581
+ /**
582
+ * @license React
583
+ * react-jsx-runtime.production.min.js
584
+ *
585
+ * Copyright (c) Facebook, Inc. and its affiliates.
586
+ *
587
+ * This source code is licensed under the MIT license found in the
588
+ * LICENSE file in the root directory of this source tree.
589
+ */
590
+ /**
591
+ * @license React
592
+ * react.production.min.js
593
+ *
594
+ * Copyright (c) Facebook, Inc. and its affiliates.
595
+ *
596
+ * This source code is licensed under the MIT license found in the
597
+ * LICENSE file in the root directory of this source tree.
598
+ */
599
+ /**
600
+ * @license React
601
+ * scheduler.production.min.js
602
+ *
603
+ * Copyright (c) Facebook, Inc. and its affiliates.
604
+ *
605
+ * This source code is licensed under the MIT license found in the
606
+ * LICENSE file in the root directory of this source tree.
607
+ */
608
+ /**
609
+ * splaytree v3.1.0
610
+ * Fast Splay tree for Node and browser
611
+ *
612
+ * @author Alexander Milevski <info@w8r.name>
613
+ * @license MIT
614
+ * @preserve
615
+ */
616
+ /** @license React v16.13.1
617
+ * react-is.production.min.js
618
+ *
619
+ * Copyright (c) Facebook, Inc. and its affiliates.
620
+ *
621
+ * This source code is licensed under the MIT license found in the
622
+ * LICENSE file in the root directory of this source tree.
623
+ */