PageSourceSearch

https://karlirrigation.com/static/js/app-bundle.js

js karlirrigation.com collected 2026-10-09 22:40:01 UTC 3,964,480 bytes, 31 lines download raw bytes

1var SiteJS;(()=>{var e,t,r={37:(e,t,r)=>{"use strict";t.sub=function(e,t,r){const{years:a=0,months:s=0,weeks:l=0,days:c=0,hours:u=0,minutes:d=0,seconds:h=0}=t,f=(0,o.subMonths)(e,s+12*a,r),p=(0,i.subDays)(f,c+7*l,r),g=1e3*(h+60*(d+60*u));return(0,n.constructFrom)(r?.in||e,+p-g)};var n=r(2956),i=r(3224),o=r(5112)},64:(e,t,r)=>{"use strict";t.nextDay=function(e,t,r){let o=t-(0,i.getDay)(e,r);o<=0&&(o+=7);return(0,n.addDays)(e,o,r)};var n=r(7591),i=r(1591)},75:(e,t,r)=>{"use strict";var n=r(4256),i=r(7510),o=r(7397),a=r(5452),s=r(8910),l=1;function c(e,t){if(!e)throw new Error("MapiRequest requires a client");if(!t||!t.path||!t.method)throw new Error("MapiRequest requires an options object with path and method properties");var r={};t.body&&(r["content-type"]="application/json");var n=i(r,t.headers),a=Object.keys(n).reduce((function(e,t){return e[t.toLowerCase()]=n[t],e}),{});this.id=l++,this._options=t,this.emitter=new o,this.client=e,this.response=null,this.error=null,this.sent=!1,this.aborted=!1,this.path=t.path,this.method=t.method,this.origin=t.origin||e.origin,this.query=t.query||{},this.params=t.params||{},this.body=t.body||null,this.file=t.file||null,this.encoding=t.encoding||"utf8",this.sendFileAs=t.sendFileAs||null,this.headers=a}c.prototype.url=function(e){var t=a.prependOrigin(this.path,this.origin);t=a.appendQueryObject(t,this.query);var r=this.params,o=null==e?this.client.accessToken:e;if(o){t=a.appendQueryParam(t,"access_token",o);var s=n(o).user;r=i({ownerId:s},r)}return t=a.interpolateRouteParams(t,r),t},c.prototype.send=function(){var e=this;if(e.sent)throw new Error("This request has already been sent. Check the response and error properties. Create a new request with clone().");return e.sent=!0,e.client.sendRequest(e).then((function(t){return e.response=t,e.emitter.emit(s.EVENT_RESPONSE,t),t}),(function(t){throw e.error=t,e.emitter.emit(s.EVENT_ERROR,t),t}))},c.prototype.abort=function(){this._nextPageRequest&&(this._nextPageRequest.abort(),delete this._nextPageRequest),this.response||this.error||this.aborted||(this.aborted=!0,this.client.abortRequest(this))},c.prototype.eachPage=function(e){var t=this;function r(r){e(null,r,(function(){delete t._nextPageRequest;var e=r.nextPage();e&&(t._nextPageRequest=e,i(e))}))}function n(t){e(t,null,(function(){}))}function i(e){e.send().then(r,n)}i(this)},c.prototype.clone=function(){return this._extend()},c.prototype._extend=function(e){var t=i(this._options,e);return new c(this.client,t)},e.exports=c},106:(e,t,r)=>{"use strict";t.lastDayOfDecade=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getFullYear(),o=9+10*Math.floor(i/10);return r.setFullYear(o+1,0,0),r.setHours(0,0,0,0),(0,n.toDate)(r,t?.in)};var n=r(4446)},181:(e,t,r)=>{var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype.toString,h=Math.max,f=Math.min,p=function(){return u.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=o.test(e);return r||a.test(e)?s(e.slice(2),r?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,r){var n,i,o,a,s,l,c=0,u=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var r=n,o=i;return n=i=void 0,c=t,a=e.apply(o,r)}function v(e){var r=e-l;return void 0===l||r>=t||r<0||d&&e-c>=o}function b(){var e=p();if(v(e))return x(e);s=setTimeout(b,function(e){var r=t-(e-l);return d?f(r,o-(e-c)):r}(e))}function x(e){return s=void 0,y&&n?_(e):(n=i=void 0,a)}function w(){var e=p(),r=v(e);if(n=arguments,i=this,l=e,r){if(void 0===s)return function(e){return c=e,s=setTimeout(b,t),u?_(e):a}(l);if(d)return s=setTimeout(b,t),_(l)}return void 0===s&&(s=setTimeout(b,t)),a}return t=m(t)||0,g(r)&&(u=!!r.leading,o=(d="maxWait"in r)?h(m(r.maxWait)||0,t):o,y="trailing"in r?!!r.trailing:y),w.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=i=s=void 0},w.flush=function(){return void 0===s?a:x(p())},w}},192:(e,t,r)=>{"use strict";t.differenceInSeconds=function(e,t,r){const o=(0,i.differenceInMilliseconds)(e,t)/1e3;return(0,n.getRoundingMethod)(r?.roundingMethod)(o)};var n=r(1331),i=r(2495)},220:(e,t,r)=>{"use strict";
1t.subWeeks=function(e,t,r){return(0,n.addWeeks)(e,-t,r)};var n=r(4073)},244:(e,t,r)=>{"use strict";t.quartersToMonths=function(e){return Math.trunc(e*n.monthsInQuarter)};var n=r(8052)},324:(e,t,r)=>{"use strict";t.intlFormatDistance=function(e,t,r){let f,p=0;const[g,m]=(0,n.normalizeDates)(r?.in,e,t);if(r?.unit)f=r?.unit,"second"===f?p=(0,h.differenceInSeconds)(g,m):"minute"===f?p=(0,d.differenceInMinutes)(g,m):"hour"===f?p=(0,u.differenceInHours)(g,m):"day"===f?p=(0,o.differenceInCalendarDays)(g,m):"week"===f?p=(0,l.differenceInCalendarWeeks)(g,m):"month"===f?p=(0,a.differenceInCalendarMonths)(g,m):"quarter"===f?p=(0,s.differenceInCalendarQuarters)(g,m):"year"===f&&(p=(0,c.differenceInCalendarYears)(g,m));else{const e=(0,h.differenceInSeconds)(g,m);Math.abs(e)<i.secondsInMinute?(p=(0,h.differenceInSeconds)(g,m),f="second"):Math.abs(e)<i.secondsInHour?(p=(0,d.differenceInMinutes)(g,m),f="minute"):Math.abs(e)<i.secondsInDay&&Math.abs((0,o.differenceInCalendarDays)(g,m))<1?(p=(0,u.differenceInHours)(g,m),f="hour"):Math.abs(e)<i.secondsInWeek&&(p=(0,o.differenceInCalendarDays)(g,m))&&Math.abs(p)<7?f="day":Math.abs(e)<i.secondsInMonth?(p=(0,l.differenceInCalendarWeeks)(g,m),f="week"):Math.abs(e)<i.secondsInQuarter?(p=(0,a.differenceInCalendarMonths)(g,m),f="month"):Math.abs(e)<i.secondsInYear&&(0,s.differenceInCalendarQuarters)(g,m)<4?(p=(0,s.differenceInCalendarQuarters)(g,m),f="quarter"):(p=(0,c.differenceInCalendarYears)(g,m),f="year")}return new Intl.RelativeTimeFormat(r?.locale,{numeric:"auto",...r}).format(p,f)};var n=r(8256),i=r(8052),o=r(5506),a=r(562),s=r(6024),l=r(4746),c=r(4875),u=r(990),d=r(3072),h=r(192)},364:(e,t,r)=>{"use strict";t.subSeconds=function(e,t,r){return(0,n.addSeconds)(e,-t,r)};var n=r(6689)},411:(e,t,r)=>{"use strict";var n=r(7626);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))}));var i=r(9941);
1Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var o=r(7591);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=r(9463);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var s=r(2945);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var l=r(4280);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var c=r(3937);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var u=r(6379);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var d=r(1149);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}));var h=r(6689);Object.keys(h).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===h[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return h[e]}}))}));var f=r(4073);Object.keys(f).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===f[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return f[e]}}))}));var p=r(1440);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===p[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))}));var g=r(4674);Object.keys(g).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===g[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return g[e]}}))}));var m=r(8214);Object.keys(m).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===m[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return m[e]}}))}));var y=r(8741);Object.keys(y).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===y[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return y[e]}}))}));var _=r(7617);Object.keys(_).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===_[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return _[e]}}))}));var v=r(6789);Object.keys(v).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===v[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return v[e]}}))}));var b=r(7777);Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===b[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return b[e]}}))}));var x=r(2956);Object.keys(x).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===x[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return x[e]}}))}));var w=r(2700);
1Object.keys(w).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===w[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return w[e]}}))}));var S=r(2934);Object.keys(S).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===S[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return S[e]}}))}));var k=r(2110);Object.keys(k).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===k[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return k[e]}}))}));var T=r(5506);Object.keys(T).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===T[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return T[e]}}))}));var I=r(2480);Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===I[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}}))}));var M=r(8813);Object.keys(M).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===M[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return M[e]}}))}));var E=r(562);
1Object.keys(E).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===E[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return E[e]}}))}));var P=r(6024);Object.keys(P).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===P[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return P[e]}}))}));var A=r(4746);Object.keys(A).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===A[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return A[e]}}))}));var C=r(4875);Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===C[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return C[e]}}))}));var R=r(3724);Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===R[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return R[e]}}))}));var L=r(990);Object.keys(L).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===L[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return L[e]}}))}));var O=r(4294);Object.keys(O).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===O[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return O[e]}}))}));var D=r(2495);Object.keys(D).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===D[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return D[e]}}))}));var z=r(3072);Object.keys(z).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===z[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return z[e]}}))}));var F=r(5460);Object.keys(F).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===F[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return F[e]}}))}));var N=r(5442);Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===N[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return N[e]}}))}));var B=r(192);Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===B[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}}))}));var j=r(4184);Object.keys(j).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===j[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return j[e]}}))}));var V=r(6605);Object.keys(V).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===V[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return V[e]}}))}));var G=r(3700);Object.keys(G).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===G[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return G[e]}}))}));var U=r(8996);Object.keys(U).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===U[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return U[e]}}))}));var $=r(666);Object.keys($).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===$[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return $[e]}}))}));var H=r(5824);Object.keys(H).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===H[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return H[e]}}))}));var q=r(7838);Object.keys(q).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===q[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return q[e]}}))}));var W=r(3298);Object.keys(W).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===W[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return W[e]}}))}));var Z=r(9305);Object.keys(Z).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Z[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Z[e]}}))}));var Y=r(5456);Object.keys(Y).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Y[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Y[e]}}))}));var X=r(1441);Object.keys(X).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===X[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return X[e]}}))}));var K=r(6245);
1Object.keys(K).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===K[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return K[e]}}))}));var J=r(1883);Object.keys(J).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===J[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return J[e]}}))}));var Q=r(6903);Object.keys(Q).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Q[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Q[e]}}))}));var ee=r(5881);Object.keys(ee).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ee[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ee[e]}}))}));var te=r(4650);Object.keys(te).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===te[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return te[e]}}))}));var re=r(4729);Object.keys(re).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===re[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return re[e]}}))}));var ne=r(3999);Object.keys(ne).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ne[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ne[e]}}))}));var ie=r(1291);Object.keys(ie).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ie[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ie[e]}}))}));var oe=r(5265);Object.keys(oe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===oe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return oe[e]}}))}));var ae=r(9883);Object.keys(ae).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ae[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ae[e]}}))}));var se=r(2366);Object.keys(se).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===se[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return se[e]}}))}));var le=r(1574);Object.keys(le).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===le[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return le[e]}}))}));var ce=r(1587);Object.keys(ce).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ce[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ce[e]}}))}));var ue=r(7624);Object.keys(ue).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ue[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ue[e]}}))}));var de=r(6601);Object.keys(de).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===de[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return de[e]}}))}));var he=r(9460);Object.keys(he).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===he[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return he[e]}}))}));var fe=r(671);Object.keys(fe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===fe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return fe[e]}}))}));var pe=r(5206);Object.keys(pe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===pe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return pe[e]}}))}));var ge=r(4950);Object.keys(ge).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ge[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ge[e]}}))}));var me=r(977);Object.keys(me).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===me[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return me[e]}}))}));var ye=r(3772);Object.keys(ye).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ye[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ye[e]}}))}));var _e=r(6179);Object.keys(_e).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===_e[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return _e[e]}}))}));var ve=r(9792);Object.keys(ve).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ve[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ve[e]}}))}));var be=r(2067);Object.keys(be).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===be[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return be[e]}}))}));var xe=r(5449);Object.keys(xe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===xe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return xe[e]}}))}));var we=r(2764);Object.keys(we).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===we[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return we[e]}}))}));var Se=r(2292);Object.keys(Se).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Se[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Se[e]}}))}));var ke=r(6808);Object.keys(ke).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ke[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ke[e]}}))}));var Te=r(819);Object.keys(Te).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Te[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Te[e]}}))}));var Ie=r(1591);Object.keys(Ie).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ie[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ie[e]}}))}));var Me=r(659);Object.keys(Me).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Me[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Me[e]}}))}));var Ee=r(2575);Object.keys(Ee).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ee[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ee[e]}}))}));var Pe=r(2396);Object.keys(Pe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Pe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Pe[e]}}))}));var Ae=r(2963);Object.keys(Ae).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ae[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ae[e]}}))}));var Ce=r(6032);Object.keys(Ce).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ce[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ce[e]}}))}));var Re=r(9732);Object.keys(Re).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Re[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Re[e]}}))}));var Le=r(8284);Object.keys(Le).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Le[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Le[e]}}))}));var Oe=r(8926);Object.keys(Oe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Oe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Oe[e]}}))}));var De=r(9957);Object.keys(De).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===De[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return De[e]}}))}));var ze=r(8595);Object.keys(ze).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ze[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ze[e]}}))}));var Fe=r(7633);Object.keys(Fe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Fe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Fe[e]}}))}));var Ne=r(6234);Object.keys(Ne).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ne[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ne[e]}}))}));var Be=r(7519);Object.keys(Be).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Be[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Be[e]}}))}));var je=r(6482);Object.keys(je).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===je[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return je[e]}}))}));var Ve=r(8397);Object.keys(Ve).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ve[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ve[e]}}))}));var Ge=r(1462);Object.keys(Ge).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ge[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ge[e]}}))}));var Ue=r(7044);Object.keys(Ue).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ue[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ue[e]}}))}));var $e=r(9318);Object.keys($e).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===$e[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return $e[e]}}))}));var He=r(9639);Object.keys(He).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===He[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return He[e]}}))}));var qe=r(970);Object.keys(qe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===qe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return qe[e]}}))}));var We=r(6708);Object.keys(We).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===We[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return We[e]}}))}));var Ze=r(6159);Object.keys(Ze).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ze[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ze[e]}}))}));var Ye=r(8684);Object.keys(Ye).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ye[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ye[e]}}))}));var Xe=r(8563);Object.keys(Xe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Xe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Xe[e]}}))}));var Ke=r(5676);Object.keys(Ke).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ke[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ke[e]}}))}));var Je=r(4180);Object.keys(Je).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Je[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Je[e]}}))}));var Qe=r(4702);Object.keys(Qe).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Qe[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Qe[e]}}))}));var et=r(5609);Object.keys(et).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===et[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return et[e]}}))}));var tt=r(881);Object.keys(tt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===tt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return tt[e]}}))}));var rt=r(324);Object.keys(rt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===rt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return rt[e]}}))}));var nt=r(5677);Object.keys(nt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===nt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return nt[e]}}))}));var it=r(8520);Object.keys(it).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===it[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return it[e]}}))}));var ot=r(4337);Object.keys(ot).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ot[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ot[e]}}))}));var at=r(4879);Object.keys(at).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===at[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return at[e]}}))}));var st=r(4437);Object.keys(st).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===st[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return st[e]}}))}));var lt=r(3804);Object.keys(lt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===lt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return lt[e]}}))}));var ct=r(8164);Object.keys(ct).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ct[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ct[e]}}))}));var ut=r(2488);Object.keys(ut).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ut[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ut[e]}}))}));var dt=r(920);Object.keys(dt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===dt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return dt[e]}}))}));var ht=r(3364);Object.keys(ht).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ht[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ht[e]}}))}));var ft=r(7256);Object.keys(ft).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ft[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ft[e]}}))}));var pt=r(4081);Object.keys(pt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===
1pt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return pt[e]}}))}));var gt=r(7865);Object.keys(gt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===gt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return gt[e]}}))}));var mt=r(9691);Object.keys(mt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===mt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return mt[e]}}))}));var yt=r(3833);Object.keys(yt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===yt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return yt[e]}}))}));var _t=r(5626);Object.keys(_t).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===_t[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return _t[e]}}))}));var vt=r(8857);Object.keys(vt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===vt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return vt[e]}}))}));var bt=r(8847);Object.keys(bt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===bt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return bt[e]}}))}));var xt=r(9019);Object.keys(xt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===xt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return xt[e]}}))}));var wt=r(9825);Object.keys(wt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===wt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return wt[e]}}))}));var St=r(9435);Object.keys(St).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===St[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return St[e]}}))}));var kt=r(5897);Object.keys(kt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===kt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return kt[e]}}))}));var Tt=r(1992);Object.keys(Tt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Tt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Tt[e]}}))}));var It=r(2056);Object.keys(It).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===It[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return It[e]}}))}));var Mt=r(3561);Object.keys(Mt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Mt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Mt[e]}}))}));var Et=r(6387);Object.keys(Et).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Et[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Et[e]}}))}));var Pt=r(1464);Object.keys(Pt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Pt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Pt[e]}}))}));var At=r(7909);Object.keys(At).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===At[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return At[e]}}))}));var Ct=r(9105);Object.keys(Ct).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ct[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ct[e]}}))}));var Rt=r(2463);Object.keys(Rt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Rt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Rt[e]}}))}));var Lt=r(6573);Object.keys(Lt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Lt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Lt[e]}}))}));var Ot=r(701);Object.keys(Ot).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ot[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ot[e]}}))}));var Dt=r(9526);Object.keys(Dt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Dt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Dt[e]}}))}));var zt=r(3587);Object.keys(zt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===zt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return zt[e]}}))}));var Ft=r(5800);Object.keys(Ft).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ft[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ft[e]}}))}));var Nt=r(8032);Object.keys(Nt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Nt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Nt[e]}}))}));var Bt=r(3806);Object.keys(Bt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Bt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Bt[e]}}))}));var jt=r(7489);Object.keys(jt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===jt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return jt[e]}}))}));var Vt=r(7851);Object.keys(Vt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Vt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Vt[e]}}))}));var Gt=r(3348);Object.keys(Gt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Gt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Gt[e]}}))}));var Ut=r(3972);Object.keys(Ut).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ut[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ut[e]}}))}));var $t=r(4439);Object.keys($t).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===$t[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return $t[e]}}))}));var Ht=r(106);Object.keys(Ht).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ht[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ht[e]}}))}));var qt=r(6249);Object.keys(qt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===qt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return qt[e]}}))}));var Wt=r(917);Object.keys(Wt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Wt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Wt[e]}}))}));var Zt=r(9404);Object.keys(Zt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Zt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Zt[e]}}))}));var Yt=r(630);Object.keys(Yt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Yt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Yt[e]}}))}));var Xt=r(2994);Object.keys(Xt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Xt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Xt[e]}}))}));var Kt=r(2829);Object.keys(Kt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Kt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Kt[e]}}))}));var Jt=r(6686);Object.keys(Jt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Jt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Jt[e]}}))}));var Qt=r(8873);Object.keys(Qt).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Qt[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Qt[e]}}))}));var er=r(3375);Object.keys(er).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===er[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return er[e]}}))}));var tr=r(449);Object.keys(tr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===tr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return tr[e]}}))}));var rr=r(1647);Object.keys(rr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===rr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return rr[e]}}))}));var nr=r(5635);Object.keys(nr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===nr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return nr[e]}}))}));var ir=r(4855);Object.keys(ir).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ir[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ir[e]}}))}));var or=r(4432);Object.keys(or).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===or[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return or[e]}}))}));var ar=r(5325);Object.keys(ar).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ar[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ar[e]}}))}));var sr=r(3074);Object.keys(sr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===sr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return sr[e]}}))}));var lr=r(6228);Object.keys(lr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===lr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return lr[e]}}))}));var cr=r(623);Object.keys(cr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===cr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return cr[e]}}))}));var ur=r(64);Object.keys(ur).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ur[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ur[e]}}))}));var dr=r(4251);Object.keys(dr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===dr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return dr[e]}}))}));var hr=r(7374);Object.keys(hr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===hr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return hr[e]}}))}));var fr=r(3859);Object.keys(fr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===fr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return fr[e]}}))}));var pr=r(9322);Object.keys(pr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===
1pr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return pr[e]}}))}));var gr=r(7724);Object.keys(gr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===gr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return gr[e]}}))}));var mr=r(5083);Object.keys(mr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===mr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return mr[e]}}))}));var yr=r(5610);Object.keys(yr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===yr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return yr[e]}}))}));var _r=r(4266);Object.keys(_r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===_r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return _r[e]}}))}));var vr=r(9757);Object.keys(vr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===vr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return vr[e]}}))}));var br=r(7144);Object.keys(br).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===br[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return br[e]}}))}));var xr=r(8092);Object.keys(xr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===xr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return xr[e]}}))}));var wr=r(5255);Object.keys(wr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===wr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return wr[e]}}))}));var Sr=r(2650);Object.keys(Sr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Sr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Sr[e]}}))}));var kr=r(3767);Object.keys(kr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===kr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return kr[e]}}))}));var Tr=r(5457);Object.keys(Tr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Tr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Tr[e]}}))}));var Ir=r(9059);Object.keys(Ir).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ir[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ir[e]}}))}));var Mr=r(1743);Object.keys(Mr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Mr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Mr[e]}}))}));var Er=r(9182);Object.keys(Er).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Er[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Er[e]}}))}));var Pr=r(244);Object.keys(Pr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Pr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Pr[e]}}))}));var Ar=r(9629);Object.keys(Ar).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ar[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ar[e]}}))}));var Cr=r(9859);Object.keys(Cr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Cr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Cr[e]}}))}));var Rr=r(7957);Object.keys(Rr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Rr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Rr[e]}}))}));var Lr=r(2944);Object.keys(Lr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Lr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Lr[e]}}))}));var Or=r(4317);Object.keys(Or).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Or[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Or[e]}}))}));var Dr=r(4638);Object.keys(Dr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Dr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Dr[e]}}))}));var zr=r(3635);Object.keys(zr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===zr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return zr[e]}}))}));var Fr=r(1311);Object.keys(Fr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Fr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Fr[e]}}))}));var Nr=r(4395);Object.keys(Nr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Nr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Nr[e]}}))}));var Br=r(3359);Object.keys(Br).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Br[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Br[e]}}))}));var jr=r(2756);Object.keys(jr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===jr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return jr[e]}}))}));
1var Vr=r(9520);Object.keys(Vr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Vr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Vr[e]}}))}));var Gr=r(2240);Object.keys(Gr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Gr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Gr[e]}}))}));var Ur=r(3354);Object.keys(Ur).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Ur[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Ur[e]}}))}));var $r=r(4617);Object.keys($r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===$r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return $r[e]}}))}));var Hr=r(1133);Object.keys(Hr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Hr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Hr[e]}}))}));var qr=r(1982);Object.keys(qr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===qr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return qr[e]}}))}));var Wr=r(7035);Object.keys(Wr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Wr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Wr[e]}}))}));var Zr=r(1201);Object.keys(Zr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Zr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Zr[e]}}))}));var Yr=r(5154);Object.keys(Yr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Yr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Yr[e]}}))}));var Xr=r(1315);Object.keys(Xr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Xr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Xr[e]}}))}));var Kr=r(7816);Object.keys(Kr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Kr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Kr[e]}}))}));var Jr=r(2648);Object.keys(Jr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Jr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Jr[e]}}))}));var Qr=r(8290);Object.keys(Qr).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Qr[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Qr[e]}}))}));var en=r(6660);Object.keys(en).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===en[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return en[e]}}))}));var tn=r(5262);Object.keys(tn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===tn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return tn[e]}}))}));var rn=r(6107);Object.keys(rn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===rn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return rn[e]}}))}));var nn=r(1152);Object.keys(nn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===nn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return nn[e]}}))}));var on=r(1804);Object.keys(on).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===on[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return on[e]}}))}));var an=r(7710);Object.keys(an).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===an[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return an[e]}}))}));var sn=r(6944);Object.keys(sn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===sn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return sn[e]}}))}));var ln=r(6936);Object.keys(ln).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===ln[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return ln[e]}}))}));var cn=r(3975);Object.keys(cn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===cn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return cn[e]}}))}));var un=r(3313);Object.keys(un).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===un[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return un[e]}}))}));var dn=r(5472);
1Object.keys(dn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===dn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return dn[e]}}))}));var hn=r(3040);Object.keys(hn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===hn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return hn[e]}}))}));var fn=r(775);Object.keys(fn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===fn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return fn[e]}}))}));var pn=r(3552);Object.keys(pn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===pn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return pn[e]}}))}));var gn=r(37);Object.keys(gn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===gn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return gn[e]}}))}));var mn=r(3570);Object.keys(mn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===mn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return mn[e]}}))}));var yn=r(3224);Object.keys(yn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===yn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return yn[e]}}))}));var _n=r(1130);Object.keys(_n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===_n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return _n[e]}}))}));var vn=r(6322);Object.keys(vn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===vn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return vn[e]}}))}));var bn=r(1675);Object.keys(bn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===bn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return bn[e]}}))}));var xn=r(3028);Object.keys(xn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===xn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return xn[e]}}))}));var wn=r(5112);Object.keys(wn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===wn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return wn[e]}}))}));var Sn=r(8542);Object.keys(Sn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Sn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Sn[e]}}))}));var kn=r(364);
1Object.keys(kn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===kn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return kn[e]}}))}));var Tn=r(220);Object.keys(Tn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Tn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Tn[e]}}))}));var In=r(8417);Object.keys(In).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===In[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return In[e]}}))}));var Mn=r(4446);Object.keys(Mn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Mn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Mn[e]}}))}));var En=r(4082);Object.keys(En).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===En[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return En[e]}}))}));var Pn=r(8442);Object.keys(Pn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Pn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Pn[e]}}))}));var An=r(5827);Object.keys(An).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===An[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return An[e]}}))}));var Cn=r(5807);
1Object.keys(Cn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Cn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Cn[e]}}))}));var Rn=r(9049);Object.keys(Rn).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===Rn[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return Rn[e]}}))}))},448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToNumber=function(e){const t=e>>10;return f[0]=m[_[t]+(1023&e)]+y[t],h[0]},t.roundToFloat16=u,t.roundToFloat16Bits=function(e){h[0]=u(e);const t=f[0],r=t>>23&511;return p[r]+((8388607&t)>>g[r])};var n=r(2628);const i=1/n.EPSILON;const o=6103515625e-14,a=65504,s=.0009765625,l=s*o,c=s*i;function u(e){const t=+e;if(!(0,n.NumberIsFinite)(t)||0===t)return t;const r=t>0?1:-1,s=(0,n.MathAbs)(t);if(s<o)return r*function(e){return e+i-i}(s/l)*l;const u=(1+c)*s,d=u-(u-s);return d>a||(0,n.NumberIsNaN)(d)?r*(1/0):r*d}const d=new n.NativeArrayBuffer(4),h=new n.NativeFloat32Array(d),f=new n.NativeUint32Array(d),p=new n.NativeUint16Array(512),g=new n.NativeUint8Array(512);for(let e=0;e<256;++e){const t=e-127;t<-24?(p[e]=0,p[256|e]=32768,g[e]=24,g[256|e]=24):t<-14?(p[e]=1024>>-t-14,p[256|e]=1024>>-t-14|32768,g[e]=-t-1,g[256|e]=-t-1):t<=15?(p[e]=t+15<<10,p[256|e]=t+15<<10|32768,g[e]=13,g[256|e]=13):t<128?(p[e]=31744,p[256|e]=64512,g[e]=24,g[256|e]=24):(p[e]=31744,p[256|e]=64512,g[e]=13,g[256|e]=13)}const m=new n.NativeUint32Array(2048);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;!(8388608&t);)t<<=1,r-=8388608;t&=-8388609,r+=947912704,m[e]=t|r}for(let e=1024;e<2048;++e)m[e]=939524096+(e-1024<<13);const y=new n.NativeUint32Array(64);for(let e=1;e<31;++e)y[e]=e<<23;y[31]=1199570944,y[32]=2147483648;for(let e=33;e<63;++e)y[e]=2147483648+(e-32<<23);y[63]=3347054592;const _=new n.NativeUint16Array(64);for(let e=1;e<64;++e)32!==e&&(_[e]=1024)},449:(e,t,r)=>{"use strict";t.millisecondsToHours=function(e){const t=e/n.millisecondsInHour;return Math.trunc(t)};var n=r(8052)},511:(e,t,r)=>{"use strict";var n=r(7857);function i(e,t){this.request=e,this.headers=t.headers,this.rawBody=t.body,this.statusCode=t.statusCode;try{this.body=JSON.parse(t.body||"{}")}catch(e){this.body=t.body}this.links=n(this.headers.link)}i.prototype.hasNextPage=function(){return!!this.links.next},i.prototype.nextPage=function(){return this.hasNextPage()?this.request._extend({path:this.links.next.url}):null},e.exports=i},562:(e,t,r)=>{"use strict";t.differenceInCalendarMonths=function(e,t,r){const[i,o]=(0,n.normalizeDates)(r?.in,e,t),a=i.getFullYear()-o.getFullYear(),s=i.getMonth()-o.getMonth();return 12*a+s};var n=r(8256)},563:(e,t,r)=>{const n=r(8556);function i(e,t,r){const i=[],o=r&&r.debug||!1,a=!r||"boolean"!=typeof r.nested||r.nested;
1let s,l=r&&r.startIndex||0;for(;s=n(e,t,{debug:o,startIndex:l});)l=a?s.start+1+t.length:s.end,i.push(s);return o&&console.log("findTagsByName found",i.length,"tags"),i}e.exports=i,e.exports.default=i},623:(e,t,r)=>{"use strict";t.monthsToYears=function(e){const t=e/n.monthsInYear;return Math.trunc(t)};var n=r(8052)},630:(e,t,r)=>{"use strict";t.lastDayOfQuarter=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getMonth(),o=i-i%3+3;return r.setMonth(o,0),r.setHours(0,0,0,0),r};var n=r(4446)},659:(e,t,r)=>{"use strict";t.getDayOfYear=function(e,t){const r=(0,o.toDate)(e,t?.in),a=(0,n.differenceInCalendarDays)(r,(0,i.startOfYear)(r));return a+1};var n=r(5506),i=r(775),o=r(4446)},666:(e,t,r)=>{"use strict";t.eachMinuteOfInterval=function(e,t){const{start:r,end:a}=(0,n.normalizeInterval)(t?.in,e);r.setSeconds(0,0);let s=+r>+a;const l=s?+r:+a;let c=s?a:r,u=t?.step??1;if(!u)return[];u<0&&(u=-u,s=!s);const d=[];for(;+c<=l;)d.push((0,o.constructFrom)(r,c)),c=(0,i.addMinutes)(c,u);return s?d.reverse():d};var n=r(5909),i=r(3937),o=r(2956)},671:(e,t,r)=>{"use strict";t.formatDistance=function(e,t,r){const d=(0,i.getDefaultOptions)(),h=r?.locale??d.locale??n.defaultLocale,f=(0,s.compareAsc)(e,t);if(isNaN(f))throw new RangeError("Invalid time value");const p=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:f}),[g,m]=(0,a.normalizeDates)(r?.in,...f>0?[t,e]:[e,t]),y=(0,u.differenceInSeconds)(m,g),_=((0,o.getTimezoneOffsetInMilliseconds)(m)-(0,o.getTimezoneOffsetInMilliseconds)(g))/1e3,v=Math.round((y-_)/60);let b;if(v<2)return r?.includeSeconds?y<5?h.formatDistance("lessThanXSeconds",5,p):y<10?h.formatDistance("lessThanXSeconds",10,p):y<20?h.formatDistance("lessThanXSeconds",20,p):y<40?h.formatDistance("halfAMinute",0,p):y<60?h.formatDistance("lessThanXMinutes",1,p):h.formatDistance("xMinutes",1,p):0===v?h.formatDistance("lessThanXMinutes",1,p):h.formatDistance("xMinutes",v,p);if(v<45)return h.formatDistance("xMinutes",v,p);if(v<90)return h.formatDistance("aboutXHours",1,p);if(v<l.minutesInDay){const e=Math.round(v/60);return h.formatDistance("aboutXHours",e,p)}if(v<2520)return h.formatDistance("xDays",1,p);if(v<l.minutesInMonth){const e=Math.round(v/l.minutesInDay);return h.formatDistance("xDays",e,p)}if(v<2*l.minutesInMonth)return b=Math.round(v/l.minutesInMonth),h.formatDistance("aboutXMonths",b,p);if(b=(0,c.differenceInMonths)(m,g),b<12){const e=Math.round(v/l.minutesInMonth);return h.formatDistance("xMonths",e,p)}{const e=b%12,t=Math.trunc(b/12);return e<3?h.formatDistance("aboutXYears",t,p):e<9?h.formatDistance("overXYears",t,p):h.formatDistance("almostXYears",t+1,p)}};var n=r(9577),i=r(6755),o=r(6339),a=r(8256),s=r(6789),l=r(8052),c=r(5460),u=r(192)},701:(e,t,r)=>{"use strict";t.isThisWeek=function(e,t){return(0,o.isSameWeek)((0,n.constructFrom)(t?.in||e,e),(0,i.constructNow)(t?.in||e),t)};var n=r(2956),i=r(2700),o=r(5897)},775:(e,t,r)=>{"use strict";t.startOfYear=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r};var n=r(4446)},819:(e,t,r)=>{"use strict";t.getDate=function(e,t){return(0,n.toDate)(e,t?.in).getDate()};var n=r(4446)},842:function(e){e.exports=function(){"use strict";var e,t,r;function n(n,i){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",a={};e(a),r=i(a),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=i;else e=i}return n(["exports"],(function(e){var t=1e-6,r="undefined"!=typeof Float32Array?Float32Array:Array;function n(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*o-i*n;return a?(e[0]=o*(a=1/a),e[1]=-n*a,e[2]=-i*a,e[3]=r*a,e):null}function i(){var e=new r(9);return r!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function o(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=i*c-n*u,e[2]=n*s-i*a,e[3]=s*l-o*u,e[4]=r*u-i*l,e[5]=i*o-r*s,e[6]=o*c-a*l,e[7]=n*l-r*c,e[8]=r*a-n*o,e}function a(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],f=r[1],p=r[2],g=r[3],m=r[4],y=r[5],_=r[6],v=r[7],b=r[8];return e[0]=h*n+f*a+p*c,e[1]=h*i+f*s+p*u,e[2]=h*o+f*l+p*d,e[3]=g*n+m*a+y*c,e[4]=g*i+m*s+y*u,e[5]=g*o+m*l+y*d,e[6]=_*n+v*a+b*c,e[7]=_*i+v*s+b*u,e[8]=_*o+v*l+b*d,e}function s(){var e=new r(16);return r!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function l(e){var t=new r(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function c(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10
vendor: 7,362 bytes, line 1
1]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function u(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],f=t[11],p=t[12],g=t[13],m=t[14],y=t[15],_=r*s-n*a,v=r*l-i*a,b=r*c-o*a,x=n*l-i*s,w=n*c-o*s,S=i*c-o*l,k=u*g-d*p,T=u*m-h*p,I=u*y-f*p,M=d*m-h*g,E=d*y-f*g,P=h*y-f*m,A=_*P-v*E+b*M+x*I-w*T+S*k;return A?(e[0]=(s*P-l*E+c*M)*(A=1/A),e[1]=(i*E-n*P-o*M)*A,e[2]=(g*S-m*w+y*x)*A,e[3]=(h*w-d*S-f*x)*A,e[4]=(l*I-a*P-c*T)*A,e[5]=(r*P-i*I+o*T)*A,e[6]=(m*b-p*S-y*v)*A,e[7]=(u*S-h*b+f*v)*A,e[8]=(a*E-s*I+c*k)*A,e[9]=(n*I-r*E-o*k)*A,e[10]=(p*w-g*b+y*_)*A,e[11]=(d*b-u*w-f*_)*A,e[12]=(s*T-a*M-l*k)*A,e[13]=(r*M-n*T+i*k)*A,e[14]=(g*v-p*x-m*_)*A,e[15]=(u*x-d*v+h*_)*A,e):null}function d(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],f=t[10],p=t[11],g=t[12],m=t[13],y=t[14],_=t[15],v=r[0],b=r[1],x=r[2],w=r[3];return e[0]=v*n+b*s+x*d+w*g,e[1]=v*i+b*l+x*h+w*m,e[2]=v*o+b*c+x*f+w*y,e[3]=v*a+b*u+x*p+w*_,e[4]=(v=r[4])*n+(b=r[5])*s+(x=r[6])*d+(w=r[7])*g,e[5]=v*i+b*l+x*h+w*m,e[6]=v*o+b*c+x*f+w*y,e[7]=v*a+b*u+x*p+w*_,e[8]=(v=r[8])*n+(b=r[9])*s+(x=r[10])*d+(w=r[11])*g,e[9]=v*i+b*l+x*h+w*m,e[10]=v*o+b*c+x*f+w*y,e[11]=v*a+b*u+x*p+w*_,e[12]=(v=r[12])*n+(b=r[13])*s+(x=r[14])*d+(w=r[15])*g,e[13]=v*i+b*l+x*h+w*m,e[14]=v*o+b*c+x*f+w*y,e[15]=v*a+b*u+x*p+w*_,e}function h(e,t,r){var n,i,o,a,s,l,c,u,d,h,f,p,g=r[0],m=r[1],y=r[2];return t===e?(e[12]=t[0]*g+t[4]*m+t[8]*y+t[12],e[13]=t[1]*g+t[5]*m+t[9]*y+t[13],e[14]=t[2]*g+t[6]*m+t[10]*y+t[14],e[15]=t[3]*g+t[7]*m+t[11]*y+t[15]):(i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],f=t[10],p=t[11],e[0]=n=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=h,e[10]=f,e[11]=p,e[12]=n*g+s*m+d*y+t[12],e[13]=i*g+l*m+h*y+t[13],e[14]=o*g+c*m+f*y+t[14],e[15]=a*g+u*m+p*y+t[15]),e}function f(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function p(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],d=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*n,e[5]=a*i+u*n,e[6]=s*i+d*n,e[7]=l*i+h*n,e[8]=c*i-o*n,e[9]=u*i-a*n,e[10]=d*i-s*n,e[11]=h*i-l*n,e}function g(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],c=t[8],u=t[9],d=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*n,e[1]=a*i-u*n,e[2]=s*i-d*n,e[3]=l*i-h*n,e[8]=o*n+c*i,e[9]=a*n+u*i,e[10]=s*n+d*i,e[11]=l*n+h*i,e}function m(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],d=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*n,e[1]=a*i+u*n,e[2]=s*i+d*n,e[3]=l*i+h*n,e[4]=c*i-o*n,e[5]=u*i-a*n,e[6]=d*i-s*n,e[7]=h*i-l*n,e}function y(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _(e,r,n){var i,o,a,s=n[0],l=n[1],c=n[2],u=Math.sqrt(s*s+l*l+c*c);return u<t?null:(s*=u=1/u,l*=u,c*=u,i=Math.sin(r),o=Math.cos(r),e[0]=s*s*(a=1-o)+o,e[1]=l*s*a+c*i,e[2]=c*s*a-l*i,e[3]=0,e[4]=s*l*a-c*i,e[5]=l*l*a+o,e[6]=c*l*a+s*i,e[7]=0,e[8]=s*c*a+l*i,e[9]=l*c*a-s*i,e[10]=c*c*a+o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function v(e,t){var r=t[0],n=t[1],i=t[2],o=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(o*o+a*a+s*s),e[2]=Math.sqrt(l*l+c*c+u*u),e}function b(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,s=n+n,l=i+i,c=r*a,u=n*a,d=n*s,h=i*a,f=i*s,p=i*l,g=o*a,m=o*s,y=o*l;return e[0]=1-d-p,e[1]=u+y,e[2]=h-m,e[3]=0,e[4]=u-y,e[5]=1-c-p,e[6]=f+g,e[7]=0,e[8]=h+m,e[9]=f-g,e[10]=1-c-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}var x=d;function w(){var e=new r(3);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function S(e){var t=new r(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function k(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function T(e,t,n){var i=new r(3);return i[0]=e,i[1]=t,i[2]=n,i}function I(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function M(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function E(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function P(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function A(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function C(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function R(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function L(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function O(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function D(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function z(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function F(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function N(e,t){var r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function B(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function j(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],s=r[1],l=r[2];return e[0]=i*l-o*s,e[1]=o*a-n*l,e[2]=n*s-i*a,e}function V(e,t,r,n){var i=t[0],o=t[1],a=t[2];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=a+n*(r[2]-a),e}function G(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/(a=a||1),e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,e}function U(e,t,r){var n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function $(e,t,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=t[0],l=t[1],c=t[2],u=i*c-o*l,d=o*s-n*c,h=n*l-i*s;return e[0]=s+a*(u+=u)+i*(h+=h)-o*(d+=d),e[1]=l+a*d+o*u-n*h,e[2]=c+a*h+n*d-i*u,e}function H(e){return e[0]=0,e[1]=0,e[2]=0,e}function q(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}var W=E,Z=P,Y=k;function X(){var e=new r(4);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function K(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function J(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=r*a,e[1]=n*a,e[2]=i*a,e[3]=o*a,e}function Q(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function ee(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e}function te(){var e=new r(4);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function re(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function ne(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=o*l-i*s,e[3]=a*l-n*s,e}function ie(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l-o*s,e[1]=i*l+a*s,e[2]=o*l+n*s,e[3]=a*l-i*s,e}w(),X();var oe,ae,se,le=J,ce=(oe=w(),ae=T(1,0,0),se=T(0,1,0),function(e,t,r){var n=B(t,r);return n<-.999999?(j(oe,ae,t),Y(oe)<1e-6&&j(oe,se,t),N(oe,oe),function(e,t,r){r*=.5;var n=Math.sin(r);e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r)}
1(e,oe,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(j(oe,t,r),e[0]=oe[0],e[1]=oe[1],e[2]=oe[2],e[3]=1+n,le(e,e))});function ue(){var e=new r(2);return r!=Float32Array&&(e[0]=0,e[1]=0),e}function de(e,t){var n=new r(2);return n[0]=e,n[1]=t,n}function he(e,t,r){return e[0]=t,e[1]=r,e}function fe(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function pe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function ge(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function me(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function ye(e,t){var r=t[0],n=t[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function _e(e,t){return e[0]*t[0]+e[1]*t[1]}te(),te(),i();var ve,be,xe=pe;function we(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ue();var Se=function(){if(be)return ve;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return be=1,ve=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=i/o}var a=0,s=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},ve}(),ke=we(Se);function Te(e,t){this.x=e,this.y=t}function Ie(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Ie(e[r],t[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!Ie(e[r],t[r]))return!1;return!0}return e===t}Te.prototype={clone(){return new Te(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),r=Math.sin(e),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround(e,t){const r=Math.cos(e),n=Math.sin(e),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(this.y-t.y),this.y=i,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Te},Te.convert=function(e){if(e instanceof Te)return e;if(Array.isArray(e))return new Te(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new Te(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const Me=Math.PI/180,Ee=180/Math.PI;function Pe(e){return e*Me}function Ae(e){return e*Ee}const Ce=[[0,0],[1,0],[1,1],[0,1]];function Re(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Le(e,t,r,n){const i=new ke(e,t,r,n);return function(e){return i.solve(e)}}const Oe=Le(.25,.1,.25,1);function De(e,t,r){return Math.min(r,Math.max(t,e))}function ze(e,t,r){return(r=De((r-e)/(t-e),0,1))*r*(3-2*r)}function Fe(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function Ne(e,t,r){if(!e.length)return r(null,[]);let n=e.length;const i=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>
1{e&&(o=e),i[a]=t,0==--n&&r(o,i)}))}))}let Be=1;function je(){return Be++}function Ve(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log2(e)))}function Ge(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function Ue(e,t,r){const n={};for(const r in e)n[r]=t.call(this,e[r],r,e);return n}function $e(e,t,r){const n={};for(const r in e)t.call(this,e[r],r,e)&&(n[r]=e[r]);return n}function He(e){return Array.isArray(e)?e.map(He):"object"==typeof e&&e?Ue(e,He):e}function qe(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}const We={};function Ze(e){We[e]||("undefined"!=typeof console&&console.warn(e),We[e]=!0)}function Ye(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Xe(e){let t=0;for(let r,n,i=0,o=e.length,a=o-1;i<o;a=i++)r=e[i],n=e[a],t+=(n.x-r.x)*(r.y+n.y);return t}function Ke([e,t,r]){const n=Pe(t+90),i=Pe(r);return{x:e*Math.cos(n)*Math.sin(i),y:e*Math.sin(n)*Math.sin(i),z:e*Math.cos(i),azimuthal:t,polar:r}}function Je(e){return("undefined"!=typeof self||void 0!==e)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==e?e:self)instanceof WorkerGlobalScope}function Qe(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,n,i)=>{const o=n||i;return t[r]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let et=null;function tt(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function rt(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<n?t=i+1:r=i}return t}function nt(e,t,r,n){for(;t<r;){const i=t+r>>1;e[i]<=n?t=i+1:r=i}return t}function it(e){return e>0?1/(1.001-e):1+e}function ot(e){return e>0?1-1/(1.001-e):-e}function at(e,t,r){return(e-t.min)*(r.max-r.min)/(t.max-t.min)+r.min}const st={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!st.API_URL)return null;try{const e=new URL(st.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"https://api.mapbox.com/mapbox-gl-js/building-gen/building_gen_v1.2.4.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function lt(e){return st.API_URL_REGEX.test(e)}function ct(e){return st.API_SPRITE_REGEX.test(e)}let ut,dt,ht,ft,pt,gt;function mt(){return null==ut&&(ut=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ut}const yt={now:()=>void 0!==ft?ft:performance.now(),setNow(e){ft=e},restoreNow(){ft=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:r,height:n}=e;pt||(pt=document.createElement("canvas"));const i=pt.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return(r>pt.width||n>pt.height)&&(pt.width=r,pt.height=n),i.clearRect(-t,-t,r+2*t,n+2*t),i.drawImage(e,0,0,r,n),i.getImageData(-t,-t,r+2*t,n+2*t)},resolveURL:e=>(dt||(dt=document.createElement("a")),dt.href=e,dt.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==ht&&(ht=window.matchMedia("(prefers-reduced-motion: reduce)")),ht.matches)},hasCanvasFingerprintNoise(){if(void 0!==gt)return gt;if(!mt())return gt=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let r=0;for(let n=0;n<e.width;++n)t.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,t.fillRect(n,0,1,1);const n=t.getImageData(0,0,e.width,e.height);r=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&r++!==n.data[e])return gt=!0,!0;return gt=!1,!1}};function _t(e,t){const r=e.indexOf("?");if(r<0)return`${e}?${new URLSearchParams(t).toString()}`;const n=new URLSearchParams(e.slice(r));for(const e in t)n.set(e,t[e]);return`${e.slice(0,r)}?${n.toString()}`}
1function vt(e,t={persistentParams:[]}){const r=e.indexOf("?");if(r<0)return e;const n=new URLSearchParams,i=new URLSearchParams(e.slice(r));for(const e of t.persistentParams){const t=i.get(e);t&&n.set(e,t)}const o=n.toString();return`${e.slice(0,r)}${o.length>0?`?${o}`:""}`}const bt="mapbox-tiles";let xt=500,wt=50;const St=["language","worldview","jobid"];let kt,Tt;function It(){try{return caches}catch(e){}}function Mt(){const e=It();e&&null==kt&&(kt=e.open(bt))}let Et=1/0;const Pt={supported:!1,testSupport:function(e){!Rt&&Ct&&(Lt?Dt(e):At=e)}};let At,Ct,Rt=!1,Lt=!1;const Ot="undefined"!=typeof self?self:{};function Dt(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Ct),e.isContextLost())return;Pt.supported=!0}catch(e){}e.deleteTexture(t),Rt=!0}Ot.document&&(Ct=Ot.document.createElement("img"),Ct.onload=function(){At&&Dt(At),At=null,Lt=!0},Ct.onerror=function(){Rt=!0,At=null},Ct.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const zt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(zt);class Ft extends Error{constructor(e,t,r){401===t&&lt(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const Nt=Je()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Bt=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Nt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const r=new AbortController,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:Nt(),referrerPolicy:e.referrerPolicy,signal:r.signal});let i=!1,o=!1;const a=(s=n.url).indexOf("sku=")>0&&lt(s);var s;"json"===e.type&&n.headers.set("Accept","application/json");const l=(r,i,s)=>{if(o)return;if(r&&"SecurityError"!==r.message&&Ze(r.toString()),i&&s)return c(i);const l=Date.now();fetch(n).then((r=>{if(r.ok){const e=a?r.clone():null;return c(r,e,l)}return t(new Ft(r.statusText,r.status,e.url))})).catch((r=>{"AbortError"!==r.name&&t(new Error(`${r.message} ${e.url}`))}))},c=(r,a,s)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{o||(a&&s&&function(e,t,r){if(Mt(),null==kt)return;const n=Qe(t.headers.get("Cache-Control")||"");if(n["no-store"])return;const i={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>i.headers.set(t,e))),n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString());const o=i.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-r<42e4)return;
1let a=vt(e.url,{persistentParams:St});if(206===t.status){const t=e.headers.get("Range");if(!t)return;i.status=200,a=_t(a,{range:t})}!function(e,t){if(void 0===Tt)try{new Response(new ReadableStream),Tt=!0}catch(e){Tt=!1}Tt?t(e.body):e.blob().then(t).catch((e=>Ze(e.message)))}(t,(e=>{const r=new Response(200!==(n=t.status)&&404!==n&&[101,103,204,205,304].includes(n)?null:e,i);var n;Mt(),null!=kt&&kt.then((e=>e.put(a,r))).catch((e=>Ze(e.message)))}))}(n,a,s),i=!0,t(null,e,r.headers))})).catch((e=>{o||t(new Error(e.message))}))};return a?function(e,t){if(Mt(),null==kt)return t(null);kt.then((r=>{let n=vt(e.url,{persistentParams:St});const i=e.headers.get("Range");i&&(n=_t(n,{range:i})),r.match(n).then((e=>{const i=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),r=Qe(e.headers.get("Cache-Control")||"");return Number(t)>Date.now()&&!r["no-cache"]}(e);r.delete(n).catch(t),i&&r.put(n,e.clone()).catch(t),t(null,e,i)})).catch(t)})).catch(t)}(n,l):l(null,null),{cancel:()=>{o=!0,i||r.abort()}}}(e,t);if(Je(self)&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){const r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(e){return t(e)}const i=new Headers;r.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{const t=e.split(": "),r=t.shift(),n=t.join(": ");i.append(r,n)})),t(null,n,i)}else t(new Ft(r.statusText,r.status,e.url))},r.send(e.body),{cancel:()=>r.abort()}}(e,t)},jt=function(e,t){return Bt(Object.assign(e,{type:"arrayBuffer"}),t)};function Vt(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const Gt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Ut,$t;Ut=[],$t=0;const Ht=function(e,t){if(Pt.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),$t>=st.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return Ut.push(r),r}$t++;let r=!1;const n=()=>
1{if(!r)for(r=!0,$t--;Ut.length&&$t<st.MAX_PARALLEL_IMAGE_REQUESTS;){const e=Ut.shift(),{requestParameters:t,callback:r,cancelled:n}=e;n||(e.cancel=Ht(t,r).cancel)}},i=jt(e,((e,r,i)=>{n(),e?t(e):r&&(self.createImageBitmap?function(e,t){const r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(r,((e,r)=>t(e,r,i))):function(e,t){const r=new Image;r.onload=()=>{t(null,r),URL.revokeObjectURL(r.src),r.onload=null,requestAnimationFrame((()=>{r.src=Gt}))},r.onerror=()=>t(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."));const n=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(n):Gt}(r,((e,r)=>t(e,r,i))))}));return{cancel:()=>{i.cancel(),n()}}};var qt,Wt,Zt,Yt={exports:{}},Xt={exports:{}},Kt={exports:{}},Jt=function(){if(Zt)return Yt.exports;Zt=1;var e=(qt||(qt=1,Xt.exports=function(e,t){var r,n,i,o,a,s,l,c;for(n=e.length-(r=3&e.length),i=t,a=3432918353,s=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}),Xt.exports),t=(Wt||(Wt=1,Kt.exports=function(e,t){for(var r,n=e.length,i=t^n,o=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}),Kt.exports);return Yt.exports=e,Yt.exports.murmur3=e,Yt.exports.murmur2=t,Yt.exports}(),Qt=we(Jt);class er{constructor(e,...t){Object.assign(this,t[0]||{}),this.type=e}}class tr extends er{constructor(e,t={}){super("error",Object.assign({error:e},t))}}function rr(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function nr(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class ir{on(e,t){return this._listeners=this._listeners||{},rr(e,t,this._listeners),this}off(e,t){return nr(e,t,this._listeners),nr(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},rr(e,t,this._oneTimeListeners),this):new Promise((t=>{this.once(e,t)}))}fire(e,t){const r="string"==typeof e?new er(e,t):e,n=r.type;if(this.listens(n)){r.target=this;const e=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const t of e)t.call(this,r);const t=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const e of t)nr(n,e,this._oneTimeListeners),e.call(this,r);const i=this._eventedParent;if(i){const e="function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData;Object.assign(r,e),i.fire(r)}}else r instanceof tr&&console.error(r.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}class or{constructor(e){"string"==typeof e?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new or(e)}static toString(e){return e.iconsetId?`${e.name}�${e.iconsetId}`:e.name}static parse(e){const[t,r]=e.split("�");
vendor: 6,213 bytes, line 1
1return new or({name:t,iconsetId:r})}static isEqual(e,t){return e.name===t.name&&e.iconsetId===t.iconsetId}toString(){return or.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var ar,sr={},lr=function(){if(ar)return sr;ar=1;var e={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 t(e){return(e=Math.round(e))<0?0:e>255?255:e}function r(e){return t("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function n(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function i(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{sr.parseCSSColor=function(o){var a,s=o.replace(/ /g,"").toLowerCase();if(s in e)return e[s].slice();if("#"===s[0])return 4===s.length?(a=parseInt(s.substr(1),16))>=0&&a<=4095?[(3840&a)>>4|(3840&a)>>8,240&a|(240&a)>>4,15&a|(15&a)<<4,1]:null:7===s.length&&(a=parseInt(s.substr(1),16))>=0&&a<=16777215?[(16711680&a)>>16,(65280&a)>>8,255&a,1]:null;var l=s.indexOf("("),c=s.indexOf(")");if(-1!==l&&c+1===s.length){var u=s.substr(0,l),d=s.substr(l+1,c-(l+1)).split(","),h=1;switch(u){case"rgba":if(4!==d.length)return null;h=n(d.pop());case"rgb":return 3!==d.length?null:[r(d[0]),r(d[1]),r(d[2]),h];case"hsla":if(4!==d.length)return null;h=n(d.pop());case"hsl":if(3!==d.length)return null;var f=(parseFloat(d[0])%360+360)%360/360,p=n(d[1]),g=n(d[2]),m=g<=.5?g*(p+1):g+p-g*p,y=2*g-m;return[t(255*i(y,m,f+1/3)),t(255*i(y,m,f)),t(255*i(y,m,f-1/3)),h];default:return null}}return null}}catch(e){}return sr}();class cr{constructor(e,t,r,n=1){this.r=e,this.g=t,this.b=r,this.a=n}static parse(e){if(!e)return;if(e instanceof cr)return e;if("string"!=typeof e)return;const t=lr.parseCSSColor(e);return t?new cr(t[0]/255,t[1]/255,t[2]/255,t[3]):void 0}toString(){const[e,t,r,n]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*e)},${Math.round(255*t)},${Math.round(255*r)},${n})`}toNonPremultipliedRenderColor(e){const{r:t,g:r,b:n,a:i}=this;return new dr(e,t,r,n,i)}toPremultipliedRenderColor(e){const{r:t,g:r,b:n,a:i}=this;return new hr(e,t*i,r*i,n*i,i)}clone(){return new cr(this.r,this.g,this.b,this.a)}}class ur{constructor(e,t,r,n,i,o=!1){if(this.premultiplied=!1,this.premultiplied=o,e){const o=e.image.height,a=o*o;this.premultiplied?(t=0===i?0:t/i*(o-1),r=0===i?0:r/i*(o-1),n=0===i?0:n/i*(o-1)):(t*=o-1,r*=o-1,n*=o-1);const s=Math.floor(t),l=Math.floor(r),c=Math.floor(n),u=Math.ceil(t),d=Math.ceil(r),h=Math.ceil(n),f=t-s,p=r-l,g=n-c,m=e.image.data,y=4*(s+l*a+c*o),_=4*(s+l*a+h*o),v=4*(s+d*a+c*o),b=4*(s+d*a+h*
vendor: 8,783 bytes, line 1
1o),x=4*(u+l*a+c*o),w=4*(u+l*a+h*o),S=4*(u+d*a+c*o),k=4*(u+d*a+h*o);if(y<0||k>=m.length)throw new Error("out of range");this.r=fr(fr(fr(m[y],m[_],g),fr(m[v],m[b],g),p),fr(fr(m[x],m[w],g),fr(m[S],m[k],g),p),f)/255*(this.premultiplied?i:1),this.g=fr(fr(fr(m[y+1],m[_+1],g),fr(m[v+1],m[b+1],g),p),fr(fr(m[x+1],m[w+1],g),fr(m[S+1],m[k+1],g),p),f)/255*(this.premultiplied?i:1),this.b=fr(fr(fr(m[y+2],m[_+2],g),fr(m[v+2],m[b+2],g),p),fr(fr(m[x+2],m[w+2],g),fr(m[S+2],m[k+2],g),p),f)/255*(this.premultiplied?i:1),this.a=i}else this.r=t,this.g=r,this.b=n,this.a=i}toArray(){const{r:e,g:t,b:r,a:n}=this;return[255*e,255*t,255*r,n]}toHslaArray(){let{r:e,g:t,b:r,a:n}=this;if(this.premultiplied){if(0===n)return[0,0,0,0];const i=1/n;e*=i,t*=i,r*=i}const i=Math.min(Math.max(e,0),1),o=Math.min(Math.max(t,0),1),a=Math.min(Math.max(r,0),1),s=Math.min(i,o,a),l=Math.max(i,o,a),c=l-s,u=.5*(s+l);if(0===c)return[0,0,100*u,n];const d=u>.5?c/(2-l-s):c/(l+s);let h;switch(l){case i:h=60*((o-a)/c+(o<a?6:0));break;case o:h=60*((a-i)/c+2);break;default:h=60*((i-o)/c+4)}return[h,100*d,100*u,n]}toArray01(){const{r:e,g:t,b:r,a:n}=this;return[e,t,r,n]}toArray01Scaled(e){const{r:t,g:r,b:n}=this;return[t*e,r*e,n*e]}toArray01Linear(){const{r:e,g:t,b:r,a:n}=this;return[Math.pow(e,2.2),Math.pow(t,2.2),Math.pow(r,2.2),n]}}class dr extends ur{constructor(e,t,r,n,i){super(e,t,r,n,i,!1)}}class hr extends ur{constructor(e,t,r,n,i){super(e,t,r,n,i,!0)}}function fr(e,t,r){return e*(1-r)+t*r}function pr(e,t,r){return e.map(((e,n)=>fr(e,t[n],r)))}cr.black=new cr(0,0,0,1),cr.white=new cr(1,1,1,1),cr.transparent=new cr(0,0,0,0),cr.red=new cr(1,0,0,1),cr.blue=new cr(0,0,1,1);var gr=Object.freeze({__proto__:null,array:pr,color:function(e,t,r){return new cr(fr(e.r,t.r,r),fr(e.g,t.g,r),fr(e.b,t.b,r),fr(e.a,t.a,r))},number:fr});class mr extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class yr{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new yr(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const _r={kind:"null"},vr={kind:"number"},br={kind:"string"},xr={kind:"boolean"},wr={kind:"color"},Sr={kind:"object"},kr={kind:"value"},Tr={kind:"collator"},Ir={kind:"formatted"},Mr={kind:"resolvedImage"};function Er(e,t){return{kind:"array",itemType:e,N:t}}function Pr(e){if("array"===e.kind){const t=Pr(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Ar=[_r,vr,br,xr,wr,Ir,Sr,Er(kr),Mr];function Cr(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Cr(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Ar)if(!Cr(e,t))return null}return`Expected ${Pr(e)} but found ${Pr(t)} instead.`}function Rr(e,t){return t.some((t=>t.kind===e.kind))}function Lr(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function Or(e,t){return"array"===e.kind&&"array"===t.kind?e.N===t.N&&Or(e.itemType,t.itemType):e.kind===t.kind}class Dr{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class zr{constructor(e,t,r,n,i){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class Fr{constructor(e){this.sections=e}static fromString(e){return new Fr([new zr(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||!!e.image&&e.image.hasPrimary()))}static factory(e){return e instanceof Fr?e:Fr.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){const r=t.image.getPrimary().id.toString();e.push(["image",r]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toNonPremultipliedRenderColor(null).toArray())),e.push(r)}return e}}class Nr{constructor(e,t={}){this.id=or.from(e),this.params=t.params,this.sx=t.sx||1,this.sy=t.sy||1}toString(){return JSON.stringify(this)}static parse(e){let t,r,n,i;try{({id:t,params:r,sx:n,sy:i}=JSON.parse(e)||{})}catch(e){return null}return t?new Nr(t,{params:r,sx:n,sy:i}):null}scaleSelf(e,t=e){return this.sx*=e,this.sy*=t,this}}class Br{constructor(e,t,r,n,i=!1){this.primaryId=or.from(e),this.primaryOptions=t,r&&(this.secondaryId=or.from(r)),this.secondaryOptions=n,this.available=i}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new Nr(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new Nr(this.secondaryId,this.secondaryOptions):null}static from(e){return"string"==typeof e?Br.build({name:e}):e}static build(e,t,r,n){return!e||"object"==typeof e&&!("name"in e)?null:new Br(e,r,t,n)}}function jr(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Vr(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof cr)return!0;if(e instanceof Dr)return!0;if(e instanceof Fr)return!0;if(e instanceof Br)return!0;if(Array.isArray(e)){for(const t of e)if(!Vr(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Vr(e[t]))return!1;return!0}return!1}function Gr(e){if(null===e)return _r;if("string"==typeof e)return br;if("boolean"==typeof e)return xr;if("number"==typeof e)return vr;if(e instanceof cr)return wr;if(e instanceof Dr)return Tr;if(e instanceof Fr)return Ir;if(e instanceof Br)return Mr;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=Gr(t);if(r){if(r===e)continue;r=kr;break}r=e}return Er(r||kr,t)}return Sr}function Ur(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Fr||e instanceof Br||e instanceof cr?e.toString():JSON.stringify(e)}class $r{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Vr(e[1]))return t.error("invalid value");const r=e[1];let n=Gr(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new $r(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof cr?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof Fr?this.value.serialize():this.value}}class Hr{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const qr={string:br,number:vr,boolean:xr,object:Sr};class Wr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in qr)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=qr[r],n++}else i=kr;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=Er(i,o)}else r=qr[i];const o=[];for(;n<e.length;n++){const r=t.parse(e[n],n,kr);if(!r)return null;o.push(r)}return new Wr(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!Cr(this.type,Gr(r)))return r;if(t===this.args.length-1)throw new Hr(`The expression ${JSON.stringify(this.args[t].serialize())} evaluated to ${Pr(Gr(r))} but was expected to be of type ${Pr(this.type)}.`)}return null}
vendor: 4,738 bytes, line 1
1eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((e=>e.serialize())))}}class Zr{constructor(e){this.type=Ir,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let e=null;if(o["font-scale"]&&(e=t.parseObjectValue(o["font-scale"],r,"font-scale",vr),!e))return null;let a=null;if(o["text-font"]&&(a=t.parseObjectValue(o["text-font"],r,"text-font",Er(br)),!a))return null;let s=null;if(o["text-color"]&&(s=t.parseObjectValue(o["text-color"],r,"text-color",wr),!s))return null;const l=n[n.length-1];l.scale=e,l.font=a,l.textColor=s}else{const o=t.parse(e[r],r,kr);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new Zr(n)}evaluate(e){return new Fr(this.sections.map((t=>{const r=t.content.evaluate(e);return Or(Gr(r),Mr)?new zr("",r,null,null,null):new zr(Ur(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class Yr{constructor(e,t,r,n){this._imageWarnHistory={},this.type=Mr,this.namePrimary=e,this.nameSecondary=t,r&&(this.paramsPrimary=r.params,this.iconsetIdPrimary=r.iconset?r.iconset.id:void 0),n&&(this.paramsSecondary=n.params,this.iconsetIdSecondary=n.iconset?n.iconset.id:void 0)}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");let r=1;const n=[];function i(){if(r<e.length){const i=t.parse(e[r],r++,br);return i?(n.push({image:i,options:{}}),!0):(t.error(n.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}function o(){if(r<e.length){const o=e[r];if(null===(i=o)||"object"!=typeof i||Array.isArray(i))return!0;const a=o.params,s=o.iconset,l=t.concat(r);if(!a&&!s)return r++,!0;if(a){if("object"!=typeof a||a.constructor!==Object)return l.error('Image options "params" should be an object'),!1;const e={},t=l.concat(void 0,"params");for(const r in a){if(!r)return t.error("Image parameter name should be non-empty"),!1;const n=t.concat(void 0,r).parse(a[r],void 0,wr,void 0,{typeAnnotation:"coerce"});if(!n)return!1;e[r]=n}n[n.length-1].options.params=e}if(s){if("object"!=typeof s||s.constructor!==Object)return l.error('Image options "iconset" should be an object'),!1;if(!s.id)return l.error('Image options "iconset" should have an "id" property'),!1;n[n.length-1].options.iconset=s}return r++,!0}var i;return!0}for(let e=0;e<2;e++)if(!i()||!o())return;return new Yr(n[0].image,n[1]?n[1].image:void 0,n[0].options,n[1]?n[1].options:void 0)}evaluateParams(e,t){const r={};if(t){for(const n in t)if(t[n])try{r[n]=t[n].evaluate(e)}catch(e){continue}if(0!==Object.keys(r).length)return{params:r}}}evaluate(e){const t={name:this.namePrimary.evaluate(e),iconsetId:this.iconsetIdPrimary},r=this.nameSecondary?{name:this.nameSecondary.evaluate(e),iconsetId:this.iconsetIdSecondary}:void 0,n=Br.build(t,r,this.paramsPrimary?this.evaluateParams(e,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(e,this.paramsSecondary):void 0);if(n&&e.availableImages){const t=n.getPrimary().id;if(n.available=e.availableImages.some((e=>or.isEqual(e,t))),n.available){const t=n.getSecondary()?n.getSecondary().id:null;t&&(n.available=e.availableImages.some((e=>or.isEqual(e,t))))}}return n}eachChild(e){if(e(this.namePrimary),this.paramsPrimary)for(const t in this.paramsPrimary)this.paramsPrimary[t]&&e(this.paramsPrimary[t]);if(this.nameSecondary&&(e(this.nameSecondary),this.paramsSecondary))for(const t in this.paramsSecondary)this.paramsSecondary[t]&&e(this.paramsSecondary[t])}outputDefined(){return!1}serializeOptions(e,t){const r={};if(t&&(r.iconset={id:t}),e){r.params={};
vendor: 1,580 bytes, line 1
1for(const t in e)e[t]&&(r.params[t]=e[t].serialize())}return Object.keys(r).length>0?r:void 0}serialize(){const e=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const t=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);t&&e.push(t)}if(this.nameSecondary&&(e.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const t=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);t&&e.push(t)}return e}}function Xr(e){return Jr(e)?"string":Qr(e)?"number":en(e)?"boolean":Array.isArray(e)?"array":null===e?"null":Kr(e)?"object":typeof e}function Kr(e){return null!=e&&!Array.isArray(e)&&"function"!=typeof e&&!(e instanceof String||e instanceof Number||e instanceof Boolean)&&"object"==typeof e}function Jr(e){return"string"==typeof e||e instanceof String}function Qr(e){return"number"==typeof e||e instanceof Number}function en(e){return"boolean"==typeof e||e instanceof Boolean}const tn={"to-boolean":xr,"to-color":wr,"to-number":vr,"to-string":br};class rn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0],n=[];let i=_r;if("to-array"===r){if(!Array.isArray(e[1]))return null;const r=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);i=Er(t.expectedType.itemType,r)}else{if(!(r>0&&Vr(e[1][0])))return null;i=Er(Gr(e[1][0]),r)}for(let o=0;o<r;o++){const r=e[1][o];let a;if(Array.isArray(r))a=t.parse(r,void 0,i.itemType);
vendor: 11,227 bytes, line 1
1else{const e=Xr(r);if(e!==i.itemType.kind)return t.error(`Expected ${i.itemType.kind} but found ${e}.`);a=t.registry.literal.parse(["literal",void 0===r?null:r],t)}if(!a)return null;n.push(a)}}else{if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");i=tn[r];for(let r=1;r<e.length;r++){const i=t.parse(e[r],r,kr);if(!i)return null;n.push(i)}}return new rn(i,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof cr)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:jr(t[0],t[1],t[2],t[3]),!r))return new cr(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Hr(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Hr(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Fr.fromString(Ur(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Br.build(Ur(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map((t=>t.evaluate(e))):Ur(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Zr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Yr(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}const nn=["Unknown","Point","LineString","Polygon"];class on{constructor(e,t,r){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t,this.iconImageUseTheme=r}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?nn[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*t-e[0])+this.featureDistanceData.bearing[1]*(n*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=cr.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class an{constructor(e,t,r,n,i){this.name=e,this.type=t,this._evaluate=r,this.args=n,this._overloadIndex=i}evaluate(e){if(!this._evaluate){const e=an.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],n=an.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=[];let s=null,l=-1;for(const[n,c]of o){if(Array.isArray(n)&&n.length!==e.length-1)continue;a.push(n),l++,s=new Ti(t.registry,t.path,null,t.scope,void 0,t._scope,t.options,t.iconImageUseTheme);const o=[];let u=!1;for(let t=1;t<e.length;t++){const r=e[t],i=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+o.length,i);if(!a){u=!0;break}o.push(a)}if(!u)if(Array.isArray(n)&&n.length!==o.length)s.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=o[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new an(r,i,c,o,l)}}if(1===a.length)t.errors.push(...s.errors);else{const r=(a.length?a:o.map((([e])=>e))).map(sn).join(" | "),n=[];for(let r=1;r<e.length;r++){const i=t.parse(e[r],1+n.length);if(!i)return null;n.push(Pr(i.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){an.definitions=t;for(const r in t)e[r]=an}}function sn(e){return Array.isArray(e)?`(${e.map(Pr).join(", ")})`:`(${Pr(e.type)}...)`}class ln{constructor(e,t,r){this.type=Tr,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=void 0===r["case-sensitive"]?t.parse(!1,1,xr):t.parseObjectValue(r["case-sensitive"],1,"case-sensitive",xr);if(!n)return null;const i=void 0===r["diacritic-sensitive"]?t.parse(!1,1,xr):t.parseObjectValue(r["diacritic-sensitive"],1,"diacritic-sensitive",xr);if(!i)return null;let o=null;return r.locale&&(o=t.parseObjectValue(r.locale,1,"locale",br),!o)?null:new ln(n,i,o)}evaluate(e){return new Dr(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}function cn(e,t,r=0,n=e.length-1,i=dn){for(;n>r;){if(n-r>600){const o=n-r+1,a=t-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);cn(e,t,Math.max(r,Math.floor(t-a*l/o+c)),Math.min(n,Math.floor(t+(o-a)*l/o+c)),i)}const o=e[t];let a=r,s=n;for(un(e,r,t),i(e[n],o)>0&&un(e,r,n);a<s;){for(un(e,a,s),a++,s--;i(e[a],o)<0;)a++;for(;i(e[s],o)>0;)s--}0===i(e[r],o)?un(e,r,s):(s++,un(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}}function un(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function dn(e,t){return e<t?-1:e>t?1:0}function hn(e){let t=0;for(let r,n,i=0,o=e.length,a=o-1;i<o;a=i++)r=e[i],n=e[a],t+=(n.x-r.x)*(r.y+n.y);return t}function fn(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function pn(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function gn(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],o=e[0]-r[0],a=e[1]-r[1];return n*a-o*i==0&&n*o<=0&&i*a<=0}function mn(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function yn(e,t,r=!1){let n=!1;for(let i=0,o=t.length;i<o;i++){const o=t[i];for(let t=0,i=o.length,a=i-1;t<i;a=t++){const i=o[a],s=o[t];if(gn(e,i,s))return r;mn(e,i,s)&&(n=!n)}}return n}function _n(e,t,r,n){const i=n[0]-r[0],o=n[1]-r[1],a=(e[0]-r[0])*o-i*(e[1]-r[1]),s=(t[0]-r[0])*o-i*(t[1]-r[1]);return a>0&&s<0||a<0&&s>0}function vn(e,t,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*o[0]&&!(!_n(e,t,r,n)||!_n(r,n,e,t));var i,o}function bn(e){const t=new Te(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new Te(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const n of e[0])t.x>n.x&&(t.x=n.x),t.y>n.y&&(t.y=n.y),r.x<n.x&&(r.x=n.x),r.y<n.y&&(r.y=n.y);return{min:t,max:r}}const xn=8192;function wn(e,t){const r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*xn),Math.round(n*i*xn)]}function Sn(e,t){for(let r=0;r<t.length;r++)if(yn(e,t[r]))return!0;return!1}function kn(e,t,r){for(const n of r)for(let r=0,i=n.length,o=i-1;r<i;o=r++)if(vn(e,t,n[o],n[r]))return!0;return!1}function Tn(e,t){for(let r=0;r<e.length;++r)if(!yn(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(kn(e[r],e[r+1],t))return!1;return!0}function In(e,t){for(let r=0;r<t.length;r++)if(Tn(e,t[r]))return!0;return!1}function Mn(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=[];for(let n=0;n<e[i].length;n++){const a=wn(e[i][n],r);fn(t,a),o.push(a)}n.push(o)}return n}function En(e,t,r){const n=[];for(let i=0;i<e.length;i++){const o=Mn(e[i],t,r);n.push(o)}return n}function Pn(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}fn(t,e)}function An(e,t,r,n){const i=Math.pow(2,n.z)*xn,o=[n.x*xn,n.y*xn],a=[];if(!e)return a;for(const n of e)for(const e of n){const n=[e.x+o[0],e.y+o[1]];Pn(n,t,r,i),a.push(n)}return a}function Cn(e,t,r,n){const i=Math.pow(2,n.z)*xn,o=[n.x*xn,n.y*xn],a=[];if(!e)return a;for(const r of e){const e=[];for(const n of r){const r=[n.x+o[0],n.y+o[1]];fn(t,r),e.push(r)}a.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const n of e)Pn(n,t,r,i)}var s;return a}class Rn{constructor(e,t){this.type=xr,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Vr(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Rn(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Rn(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Rn(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=Mn(t.coordinates,n,i),a=An(e.geometry(),r,n,i);if(!pn(r,n))return!1;for(const e of a)if(!yn(e,o))return!1}if("MultiPolygon"===t.type){const o=En(t.coordinates,n,i),a=An(e.geometry(),r,n,i);if(!pn(r,n))return!1;for(const e of a)if(!Sn(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=Mn(t.coordinates,n,i),a=Cn(e.geometry(),r,n,i);if(!pn(r,n))return!1;for(const e of a)if(!Tn(e,o))return!1}if("MultiPolygon"===t.type){const o=En(t.coordinates,n,i),a=Cn(e.geometry(),r,n,i);if(!pn(r,n))return!1;for(const e of a)if(!In(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}const Ln={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},On=1/298.257223563,Dn=On*(2-On),zn=Math.PI/180;class Fn{static fromTile(e,t,r){const n=Math.PI*(1-2*(e+.5)/Math.pow(2,t)),i=Math.atan(.5*(Math.exp(n)-Math.exp(-n)))
1/zn;return new Fn(i,r)}static get units(){return Ln}constructor(e,t){if(void 0===e)throw new Error("No latitude given.");if(t&&!Ln[t])throw new Error(`Unknown unit ${t}. Use one of: ${Object.keys(Ln).join(", ")}`);const r=6378.137*zn*(t?Ln[t]:1),n=Math.cos(e*zn),i=1/(1-Dn*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-Dn)}distance(e,t){const r=jn(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}bearing(e,t){const r=jn(t[0]-e[0])*this.kx;return Math.atan2(r,(t[1]-e[1])*this.ky)/zn}destination(e,t,r){const n=r*zn;return this.offset(e,Math.sin(n)*t,Math.cos(n)*t)}offset(e,t,r){return[e[0]+t/this.kx,e[1]+r/this.ky]}lineDistance(e){let t=0;for(let r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t}area(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];for(let e=0,i=n.length,o=i-1;e<i;o=e++)t+=jn(n[e][0]-n[o][0])*(n[e][1]+n[o][1])*(r?-1:1)}return Math.abs(t)/2*this.kx*this.ky}along(e,t){let r=0;if(t<=0)return e[0];for(let n=0;n<e.length-1;n++){const i=e[n],o=e[n+1],a=this.distance(i,o);if(r+=a,r>t)return Bn(i,o,(t-(r-a))/a)}return e[e.length-1]}pointToSegmentDistance(e,t,r){let[n,i]=t,o=jn(r[0]-n)*this.kx,a=(r[1]-i)*this.ky;if(0!==o||0!==a){const t=(jn(e[0]-n)*this.kx*o+(e[1]-i)*this.ky*a)/(o*o+a*a);t>1?(n=r[0],i=r[1]):t>0&&(n+=o/this.kx*t,i+=a/this.ky*t)}return o=jn(e[0]-n)*this.kx,a=(e[1]-i)*this.ky,Math.sqrt(o*o+a*a)}pointOnLine(e,t){let r=1/0,n=e[0][0],i=e[0][1],o=0,a=0;for(let s=0;s<e.length-1;s++){let l=e[s][0],c=e[s][1],u=jn(e[s+1][0]-l)*this.kx,d=(e[s+1][1]-c)*this.ky,h=0;0===u&&0===d||(h=(jn(t[0]-l)*this.kx*u+(t[1]-c)*this.ky*d)/(u*u+d*d),h>1?(l=e[s+1][0],c=e[s+1][1]):h>0&&(l+=u/this.kx*h,c+=d/this.ky*h)),u=jn(t[0]-l)*this.kx,d=(t[1]-c)*this.ky;const f=u*u+d*d;f<r&&(r=f,n=l,i=c,o=s,a=h)}return{point:[n,i],index:o,t:Math.max(0,Math.min(1,a))}}lineSlice(e,t,r){let n=this.pointOnLine(r,e),i=this.pointOnLine(r,t);if(n.index>i.index||n.index===i.index&&n.t>i.t){const e=n;n=i,i=e}const o=[n.point],a=n.index+1,s=i.index;!Nn(r[a],o[0])&&a<=s&&o.push(r[a]);for(let e=a+1;e<=s;e++)o.push(r[e]);return Nn(r[s],i.point)||o.push(i.point),o}lineSliceAlong(e,t,r){let n=0;const i=[];for(let o=0;o<r.length-1;o++){const a=r[o],s=r[o+1],l=this.distance(a,s);if(n+=l,n>e&&0===i.length&&i.push(Bn(a,s,(e-(n-l))/l)),n>=t)return i.push(Bn(a,s,(t-(n-l))/l)),i;n>e&&i.push(s)}return i}bufferPoint(e,t){const r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[0]+n,e[1]+r]}bufferBBox(e,t){const r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[2]+n,e[3]+r]}insideBBox(e,t){return jn(e[0]-t[0])>=0&&jn(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]}}function Nn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Bn(e,t,r){const n=jn(t[0]-e[0]);return[e[0]+n*r,e[1]+(t[1]-e[1])*r]}function jn(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}class Vn{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=1+(e<<1);const o=n+1;if(o<this.length&&r(t[o],t[n])<0&&(n=o),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}}var Gn=8192;function Un(e,t){return t.dist-e.dist}function $n(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Hn(e){return e[1]-e[0]+1}function qn(e,t){const r=e[1]>=e[0]&&e[1]<t;return r||console.warn("Distance Expression: Index is out of range"),r}function Wn(e,t){if(e[0]>e[1])return[null,null];const r=Hn(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===r)return[e,null];const t=Math.floor(r/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function Zn(e,t){const r=[1/0,1/0,-1/0,-1/0];if(!qn(t,e.length))return r;for(let n=t[0];n<=t[1];++n)fn(r,e[n]);return r}function Yn(e){const t=[1/0,1/0,-1/0,-1/0];for(let r=0;r<e.length;++r)for(let n=0;n<e[r].length;++n)fn(t,e[r][n]);return t}function Xn(e,t,r){if($n(e)||$n(t))return NaN;let n=0,i=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),r.distance([0,0],[n,i])}function Kn(e){return 360*e-180}function Jn(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180)
1)-90}function Qn(e,t){const r=Math.pow(2,t.z),n=(e.y/Gn+t.y)/r;return[Kn((e.x/Gn+t.x)/r),Jn(n)]}function ei(e,t){const r=[];for(let n=0;n<e.length;++n)r.push(Qn(e[n],t));return r}function ti(e,t,r){const n=r.pointOnLine(t,e).point;return r.distance(e,n)}function ri(e,t,r,n,i){const o=r.slice(n[0],n[1]+1);let a=1/0;for(let r=t[0];r<=t[1];++r)if(0===(a=Math.min(a,ti(e[r],o,i))))return 0;return a}function ni(e,t,r,n,i){const o=Math.min(i.pointToSegmentDistance(e,r,n),i.pointToSegmentDistance(t,r,n)),a=Math.min(i.pointToSegmentDistance(r,e,t),i.pointToSegmentDistance(n,e,t));return Math.min(o,a)}function ii(e,t,r,n,i){if(!qn(t,e.length)||!qn(n,r.length))return NaN;let o=1/0;for(let a=t[0];a<t[1];++a)for(let t=n[0];t<n[1];++t){if(vn(e[a],e[a+1],r[t],r[t+1]))return 0;o=Math.min(o,ni(e[a],e[a+1],r[t],r[t+1],i))}return o}function oi(e,t,r,n,i){if(!qn(t,e.length)||!qn(n,r.length))return NaN;let o=1/0;for(let a=t[0];a<=t[1];++a)for(let t=n[0];t<=n[1];++t)if(0===(o=Math.min(o,i.distance(e[a],r[t]))))return o;return o}function ai(e,t,r){if(yn(e,t,!0))return 0;let n=1/0;for(const i of t){const t=i.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(i[0]!==i[t-1]&&0===(n=Math.min(n,r.pointToSegmentDistance(e,i[t-1],i[0]))))return n;if(0===(n=Math.min(n,ti(e,i,r))))return n}return n}function si(e,t,r,n){if(!qn(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(yn(e[n],r,!0))return 0;let i=1/0;for(let o=t[0];o<t[1];++o)for(const t of r)for(let r=0,a=t.length,s=a-1;r<a;s=r++){if(vn(e[o],e[o+1],t[s],t[r]))return 0;i=Math.min(i,ni(e[o],e[o+1],t[s],t[r],n))}return i}function li(e,t){for(const r of e)for(let e=0;e<=r.length-1;++e)if(yn(r[e],t,!0))return!0;return!1}function ci(e,t,r,n=1/0){const i=Yn(e),o=Yn(t);if(n!==1/0&&Xn(i,o,r)>=n)return n;if(pn(i,o)){if(li(e,t))return 0}else if(li(t,e))return 0;let a=n;for(const n of e)for(let e=0,i=n.length,o=i-1;e<i;o=e++)for(const i of t)for(let t=0,s=i.length,l=s-1;t<s;l=t++){if(vn(n[o],n[e],i[l],i[t]))return 0;a=Math.min(a,ni(n[o],n[e],i[l],i[t],r))}return a}function ui(e,t,r,n,i,o,a){if(null===o||null===a)return;const s=Xn(Zn(n,o),Zn(i,a),r);s<t&&e.push({dist:s,range1:o,range2:a})}function di(e,t,r,n,i=1/0){let o=Math.min(n.distance(e[0],r[0][0]),i);if(0===o)return o;const a=new Vn([{dist:0,range1:[0,e.length-1],range2:[0,0]}],Un),s=t?50:100,l=Yn(r);for(;a.length;){const i=a.pop();if(i.dist>=o)continue;const c=i.range1;if(Hn(c)<=s){if(!qn(c,e.length))return NaN;if(t){const t=si(e,c,r,n);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const i=ai(e[t],r,n);if(0===(o=Math.min(o,i)))return o}}else{const r=Wn(c,t);if(null!==r[0]){const t=Xn(Zn(e,r[0]),l,n);t<o&&a.push({dist:t,range1:r[0],range2:[0,0]})}if(null!==r[1]){const t=Xn(Zn(e,r[1]),l,n);t<o&&a.push({dist:t,range1:r[1],range2:[0,0]})}}}return o}function hi(e,t,r,n,i,o=1/0){let a=Math.min(o,i.distance(e[0],r[0]));if(0===a)return a;const s=new Vn([{dist:0,range1:[0,e.length-1],range2:[0,r.length-1]}],Un),l=t?50:100,c=n?50:100;for(;s.length;){const o=s.pop();if(o.dist>=a)continue;const u=o.range1,d=o.range2;if(Hn(u)<=l&&Hn(d)<=c){if(!qn(u,e.length)||!qn(d,r.length))return NaN;if(t&&n?a=Math.min(a,ii(e,u,r,d,i)):t||n?t&&!n?a=Math.min(a,ri(r,d,e,u,i)):!t&&n&&(a=Math.min(a,ri(e,u,r,d,i))):a=Math.min(a,oi(e,u,r,d,i)),0===a)return a}else{const o=Wn(u,t),l=Wn(d,n);ui(s,a,i,e,r,o[0],l[0]),ui(s,a,i,e,r,o[0],l[1]),ui(s,a,i,e,r,o[1],l[0]),ui(s,a,i,e,r,o[1],l[1])}}return a}function fi(e,t,r,n,i=1/0){let o=i;const a=Zn(e,[0,e.length-1]);for(const i of r)if(!(o!==1/0&&Xn(a,Zn(i,[0,i.length-1]),n)>=o)&&(o=Math.min(o,hi(e,t,i,!0,n,o)),0===o))return o;return o}function pi(e,t,r,n,i=1/0){let o=i;const a=Zn(e,[0,e.length-1]);for(const i of r){if(o!==1/0&&Xn(a,Yn(i),n)>=o)continue;const r=di(e,t,i,n,o);if(isNaN(r))return r;if(0===(o=Math.min(o,r)))return o}return o}function gi(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class mi{constructor(e,t){this.type=vr,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(Vr(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;e<t.features.length;++e)if(gi(t.features[e].geometry.type))return new mi(t,t.features[e].geometry)}else if("Feature"===t.type){if(gi(t.geometry.type))return new mi(t,t.geometry)}else if(gi(t.type))return new mi(t,t)}return t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const t=e.geometry(),r=e.canonicalID();if(null!=t&&null!=r){if("Point"===e.geometryType())return function(e,t,r){const n=[];for(const r of e)for(const e of r)n.push(Qn(e,t));const i=new Fn(n[0][1],"meters");return"Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type?hi(n,!1,"Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i):"MultiLineString"===r.type?fi(n,!1,r.coordinates,i):"Polygon"===r.type||"MultiPolygon"===r.type?pi(n,!1,"Polygon"===r.type?[r.coordinates]:r.coordinates,i):null}(t,r,this.geometries);if("LineString"===e.geometryType())return function(e,t,r){const n=[];for(const r of e){const e=[];for(const n of r)e.push(Qn(n,t));n.push(e)}const i=new Fn(n[0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return fi("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=fi(r.coordinates[t],!0,n,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}if("Polygon"===r.type||"MultiPolygon"===r.type){let e=1/0;for(let t=0;t<n.length;t++){const o=pi(n[t],!0,"Polygon"===r.type?[r.coordinates]:r.coordinates,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return null}(t,r,this.geometries);if("Polygon"===e.geometryType())return function(e,t,r){const n=[];for(const r of function(e){const t=e.length;if(t<=1)return[e];const r=[];let n,i;for(let o=0;o<t;o++){const t=hn(e[o]);0!==t&&(e[o].area=Math.abs(t),void 0===i&&(i=t<0),i===t<0?(n&&r.push(n),n=[e[o]]):n.push(e[o]))}return n&&r.push(n),r}(e)){const e=[];for(let n=0;n<r.length;++n)e.push(ei(r[n],t));n.push(e)}const i=new Fn(n[0][0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return pi("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=pi(r.coordinates[t],!0,n,i,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return"Polygon"===r.type||"MultiPolygon"===r.type?function(e,t,r){let n=1/0;for(const i of e)for(const e of t){const t=ci(i,e,r,n);if(isNaN(t))return t;if(0===(n=Math.min(n,t)))return n}return n}("Polygon"===r.type?[r.coordinates]:r.coordinates,n,i):null}(t,r,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function yi(e){if(e instanceof an){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Rn)return!1;if(e instanceof mi)return!1;if(e instanceof Si)return e.featureConstant;let t=!0;return e.eachChild((e=>{t&&!yi(e)&&(t=!1)})),t}function _i(e){if(e instanceof an&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!_i(e)&&(t=!1)})),t}function vi(e,t){if(e instanceof an&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!vi(e,t)&&(r=!1)})),r}
1function bi(e,t,r){return[e,t,r].filter(Boolean).join("�")}function xi(e,t){switch(e){case"string":return Ur(t);case"number":return+t;case"boolean":return!!t;case"color":return cr.parse(t);case"formatted":return Fr.fromString(Ur(t));case"resolvedImage":return Br.build(Ur(t))}return t}function wi(e,t,r,n){return void 0!==n&&(e=n*Math.round(e/n)),void 0!==t&&e<t&&(e=t),void 0!==r&&e>r&&(e=r),e}class Si{constructor(e,t,r,n=!1){this.type=e,this.key=t,this.scope=r,this.featureConstant=n}static parse(e,t){let r=t.expectedType;if(null==r&&(r=kr),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const n=t.parse(e[1],1);if(!(n instanceof $r))return t.error("Key name of 'config' expression must be a string literal.");let i,o=!0;const a=Ur(n.value);if(e.length>=3){const r=t.parse(e[2],2);if(!(r instanceof $r))return t.error("Scope of 'config' expression must be a string literal.");i=Ur(r.value)}if(t.options){const e=bi(a,i,t._scope),r=t.options.get(e);r&&(o=yi(r.value||r.default))}return new Si(r,a,i,o)}evaluate(e){const t=bi(this.key,this.scope,e.scope),r=e.getConfig(t);if(!r)return null;const{type:n,value:i,values:o,minValue:a,maxValue:s,stepValue:l}=r,c=r.default.evaluate(e);let u=c;if(i){const t=e.scope;e.scope=(t||"").split("�").slice(1).join("�"),u=i.evaluate(e),e.scope=t}return n&&(u=xi(n,u)),void 0===u||void 0===a&&void 0===s&&void 0===l||("number"==typeof u?u=wi(u,a,s,l):Array.isArray(u)&&(u=u.map((e=>"number"==typeof e?wi(e,a,s,l):e)))),void 0!==i&&void 0!==u&&o&&!o.includes(u)&&(u=c,n&&(u=xi(n,u))),(n&&n!==this.type||void 0!==u&&!Or(Gr(u),this.type))&&(u=xi(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.scope),e}}class ki{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new ki(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Ti{constructor(e,t=[],r,n=new yr,i=[],o,a,s){this.registry=e,this.path=t,this.key=t.map((e=>"string"==typeof e?`['${e}']`:`[${e}]`)).join(""),this.scope=n,this.errors=i,this.expectedType=r,this._scope=o,this.options=a,this.iconImageUseTheme=s}parse(e,t,r,n,i={}){return t||r?this.concat(t,null,r,n)._parse(e,i):this._parse(e,i)}parseObjectValue(e,t,r,n,i,o={}){return this.concat(t,r,n,i)._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new Wr(t,[e]):"coerce"===r?new rn(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n="string"==typeof e[0]?this.registry[e[0]]:void 0;if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof $r)&&"resolvedImage"!==i.type.kind&&Ii(i)){const t=new on(this._scope,this.options,this.iconImageUseTheme);try{i=new $r(i.type,i.evaluate(t))}catch(e){return this.error(e.message),null}}return i}return rn.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r,n){let i="number"==typeof e?this.path.concat(e):this.path;i="string"==typeof t?i.concat(t):i;const o=n?this.scope.concat(n):this.scope;return new Ti(this.registry,i,r||null,o,this.errors,this._scope,this.options,this.iconImageUseTheme)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new mr(r,e))}checkSubtype(e,t){const r=Cr(e,t);return r&&this.error(r),r}}function Ii(e){if(e instanceof ki)return Ii(e.boundExpression);if(e instanceof an&&"error"===e.name)return!1;if(e instanceof ln)return!1;if(e instanceof Rn)return!1;if(e instanceof mi)return!1;if(e instanceof Si)return!1;const t=e instanceof rn||e instanceof Wr;let r=!0;return e.eachChild((e=>{r=t?r&&Ii(e):r&&e instanceof $r})),!!r&&yi(e)&&vi(e,["zoom","heatmap-density","worldview","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Mi(e,t){const r=e.length-1;let n,i,o=0,a=r,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),n=e[s],i=e[s+1],n<=t){if(s===r||t<i)return s;o=s+1}else{if(!(n>t))throw new Hr("Input is not a number.");a=s-1}return 0}class Ei{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,vr);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],a=e[r+1],s=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
1omputed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(a,l,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Ei(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Mi(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const Pi=.95047,Ai=1.08883,Ci=4/29,Ri=6/29,Li=3*Ri*Ri,Oi=Ri*Ri*Ri,Di=Math.PI/180,zi=180/Math.PI;function Fi(e){return e>Oi?Math.pow(e,1/3):e/Li+Ci}function Ni(e){return e>Ri?e*e*e:Li*(e-Ci)}function Bi(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ji(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Vi(e){const t=ji(e.r),r=ji(e.g),n=ji(e.b),i=Fi((.4124564*t+.3575761*r+.1804375*n)/Pi),o=Fi((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Fi((.0193339*t+.119192*r+.9503041*n)/Ai)),alpha:e.a}}function Gi(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*Ni(t),r=Pi*Ni(r),n=Ai*Ni(n),new cr(Bi(3.2404542*r-1.5371385*t-.4985314*n),Bi(-.969266*r+1.8760108*t+.041556*n),Bi(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function Ui(e,t,r){const n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const $i={forward:Vi,reverse:Gi,interpolate:function(e,t,r){return{l:fr(e.l,t.l,r),a:fr(e.a,t.a,r),b:fr(e.b,t.b,r),alpha:fr(e.alpha,t.alpha,r)}}},Hi={forward:function(e){const{l:t,a:r,b:n}=Vi(e),i=Math.atan2(n,r)*zi;return{h:i<0?i+360:i,c:Math.sqrt(r*r+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Di,r=e.c;return Gi({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Ui(e.h,t.h,r),c:fr(e.c,t.c,r),l:fr(e.l,t.l,r),alpha:fr(e.alpha,t.alpha,r)}}};var qi=Object.freeze({__proto__:null,hcl:Hi,lab:$i});class Wi{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=Zi(t,e.base,r,n);else if("linear"===e.name)i=Zi(t,1,r,n);else if("cubic-bezier"===e.name){const o=e.controlPoints;i=new ke(o[0],o[1],o[2],o[3]).solve(Zi(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...o]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length-1>3&&(e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,vr),!i)return null;const a=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=wr:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],n=o[e+1],i=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(a.length&&a[a.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=t.parse(n,l,s);if(!c)return null;s=s||c.type,a.push([r,c])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new Wi(s,r,n,i,a):t.error(`Type ${Pr(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const o=Mi(t,n),a=Wi.interpolationFactor(this.interpolation,n,t[o],t[o+1]),s=r[o].evaluate(e),l=r[o+1].evaluate(e);return"interpolate"===this.operator?gr[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?Hi.reverse(Hi.interpolate(Hi.forward(s),Hi.forward(l),a)):$i.reverse($i.interpolate($i.forward(s),$i.forward(l),a))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function Zi(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}class Yi{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of e.slice(1)){const e=t.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}const o=n&&i.some((e=>Cr(n,e.type)));return new Yi(o?kr:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args){if(n++,r=i.evaluate(e),r&&r instanceof Br&&!r.available&&(t||(t=r),r=null,n===this.args.length))return t;if(null!==r)break}return r}
vendor: 11,701 bytes, line 1
1eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class Xi{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const i=e[n];if("string"!=typeof i)return t.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=t.parse(e[n+1],n+1);if(!o)return null;r.push([i,o])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new Xi(r,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,r]of this.bindings)e.push(t,r.serialize());return e.push(this.result.serialize()),e}}class Ki{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,vr),n=t.parse(e[2],2,Er(t.expectedType||kr));return r&&n?new Ki(n.type.itemType,r,n):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Hr("Array index out of bounds: negative index");if(t>=r.length)throw new Hr("Array index out of bounds: index exceeds array size");if(t!==Math.floor(t))throw new Hr("Array index must be an integer. Use at-interpolated for fractional indices");return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Ji{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,vr),n=t.parse(e[2],2,Er(t.expectedType||kr));return r&&n?new Ji(n.type.itemType,r,n):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Hr(`Array index out of bounds: ${t} < 0.`);if(t>r.length-1)throw new Hr(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t===Math.floor(t))return r[t];const n=Math.floor(t),i=Math.ceil(t),o=r[n],a=r[i];if("number"!=typeof o||"number"!=typeof a)throw new Hr(`Cannot interpolate between non-number values at index ${t}.`);const s=t-n;return o*(1-s)+a*s}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class Qi{constructor(e,t){this.type=xr,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,kr),n=t.parse(e[2],2,kr);return r&&n?Rr(r.type,[xr,br,vr,_r,kr])?new Qi(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Pr(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!Lr(t,["boolean","string","number","null"]))throw new Hr(`Expected first argument to be of type boolean, string, number or null, but found ${Pr(Gr(t))} instead.`);if(!Lr(r,["string","array"]))throw new Hr(`Expected second argument to be of type array or string, but found ${Pr(Gr(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class eo{constructor(e,t,r){this.type=vr,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,kr),n=t.parse(e[2],2,kr);if(!r||!n)return null;if(!Rr(r.type,[xr,br,vr,_r,kr]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Pr(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,vr);return i?new eo(r,n,i):null}return new eo(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Lr(t,["boolean","string","number","null"]))throw new Hr(`Expected first argument to be of type boolean, string, number or null, but found ${Pr(Gr(t))} instead.`);if(!Lr(r,["string","array"]))throw new Hr(`Expected second argument to be of type array or string, but found ${Pr(Gr(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class to{constructor(e,t,r,n,i,o){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},o=[];for(let a=2;a<e.length-1;a+=2){let s=e[a];const l=e[a+1];Array.isArray(s)||(s=[s]);const c=t.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,Gr(e)))return null}else r=Gr(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=o.length}const u=t.parse(l,a,n);if(!u)return null;n=n||u.type,o.push(u)}const a=t.parse(e[1],1,kr);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==a.type.kind&&t.concat(1).checkSubtype(r,a.type)?null:new to(r,n,a,i,o,s):null}evaluate(e){const t=this.input.evaluate(e);return(Or(Gr(t),this.inputType)&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const i=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of r)e.push(1===n.length?i(n[0]):n.map(i)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class ro{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let i=1;i<e.length-1;i+=2){const o=t.parse(e[i],i,xr);if(!o)return null;const a=t.parse(e[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}const i=t.parse(e[e.length-1],e.length-1,r);return i?new ro(r,n,i):null}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class no{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,kr),n=t.parse(e[2],2,vr);if(!r||!n)return null;if(!Rr(r.type,[Er(kr),br,kr]))return t.error(`Expected first argument to be of type array or string, but found ${Pr(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,vr);return i?new no(r.type,r,n,i):null}return new no(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Lr(t,["string","array"]))throw new Hr(`Expected first argument to be of type array or string, but found ${Pr(Gr(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}class io{constructor(e,t){this.type=Er(br),this.str=e,this.delimiter=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,br),n=t.parse(e[2],2,br);return r&&n?new io(r,n):void 0}evaluate(e){const t=this.str.evaluate(e),r=this.delimiter.evaluate(e);return t.split(r)}eachChild(e){e(this.str),e(this.delimiter)}outputDefined(){return!1}serialize(){return["split",this.str.serialize(),this.delimiter.serialize()]}}function oo(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ao(e,t,r,n){return 0===n.compare(t,r)}function so(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=xr,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,kr);if(!o)return null;if(!oo(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${Pr(o.type)}'.`);let a=t.parse(e[2],2,kr);if(!a)return null;if(!oo(r,a.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${Pr(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${Pr(o.type)}' and '${Pr(a.type)}'.`);n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Wr(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Wr(o.type,[a])));let s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,Tr),!s)return null}return new i(o,a,s)}evaluate(i){const o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=Gr(o),r=Gr(a);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Hr(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=Gr(o),r=Gr(a);if("string"!==e.kind||"string"!==r.kind)return t(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):t(i,o,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}
1}const lo=so("==",(function(e,t,r){return t===r}),ao),co=so("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!ao(0,t,r,n)})),uo=so("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),ho=so(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),fo=so("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),po=so(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class go{constructor(e,t,r,n,i,o){this.type=br,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,vr);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parseObjectValue(n.locale,2,"locale",br),!i))return null;let o=null;if(n.currency&&(o=t.parseObjectValue(n.currency,2,"currency",br),!o))return null;let a=null;if(n.unit&&(a=t.parseObjectValue(n.unit,2,"unit",br),!a))return null;let s=null;if(n["min-fraction-digits"]&&(s=t.parseObjectValue(n["min-fraction-digits"],2,"min-fraction-digits",vr),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parseObjectValue(n["max-fraction-digits"],2,"max-fraction-digits",vr),!l)?null:new go(r,i,o,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class mo{constructor(e){this.type=vr,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${Pr(r.type)} instead.`):new mo(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Hr(`Expected value to be of type string or array, but found ${Pr(Gr(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}function yo(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const _o={"==":lo,"!=":co,">":ho,"<":uo,">=":po,"<=":fo,array:Wr,at:Ki,"at-interpolated":Ji,boolean:Wr,case:ro,coalesce:Yi,collator:ln,format:Zr,image:Yr,in:Qi,"index-of":eo,interpolate:Wi,"interpolate-hcl":Wi,"interpolate-lab":Wi,length:mo,let:Xi,literal:$r,match:to,number:Wr,"number-format":go,object:Wr,slice:no,step:Ei,string:Wr,"to-boolean":rn,"to-color":rn,"to-number":rn,"to-string":rn,var:ki,within:Rn,distance:mi,config:Si,split:io};function vo(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const o=i?i.evaluate(e):1,a=jr(t,r,n,o);if(a)throw new Hr(a);return new cr(t/255,r/255,n/255,o)}function bo(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const o=i?i.evaluate(e):1,a=function(e,t,r,n){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'h' must be between 0 and 360.`}(t,r,n,o);if(a)throw new Hr(a);const s=`hsla(${t}, ${r}%, ${n}%, ${o})`,l=cr.parse(s);if(!l)throw new Hr(`Failed to parse HSLA color: ${s}`);return l}function xo(e,t){return e in t}function wo(e,t){const r=t[e];return void 0===r?null:r}function So(e){return{type:e}}function ko(e){if(e instanceof Si)return new Set([e.key]);let t=new Set;return e.eachChild((e=>{t=new Set([...t,...ko(e)])}
vendor: 9,626 bytes, line 1
1)),t}function To(e){if(e instanceof an&&"is-active-floor"===e.name)return!0;let t=!1;return e.eachChild((e=>{!t&&To(e)&&(t=!0)})),t}function Io(e){return{result:"success",value:e}}function Mo(e){return{result:"error",value:e}}function Eo(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Po(e){return"data-driven"===e["property-type"]}function Ao(e){return Eo(e.expression,"measure-light")}function Co(e){return Eo(e.expression,"zoom")}function Ro(e){return!!e.expression&&e.expression.interpolated}function Lo(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Oo(e){return e}function Do(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),o=e.type||(Ro(t)?"exponential":"interval");if(r&&((e=Object.assign({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],cr.parse(e[1])]))),e.default=cr.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!qi[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let a,s,l;if("exponential"===o)a=Bo;else if("interval"===o)a=No;else if("categorical"===o){a=Fo,s=Object.create(null);for(const t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=jo}if(n){const r={},n=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],o=i[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},n.push(o)),r[o].stops.push([i[0].value,i[1]])}const i=[];for(const e of n)i.push([r[e].zoom,Do(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:Wi.interpolationFactor.bind(void 0,o),zoomStops:i.map((e=>e[0])),evaluate:({zoom:r},n)=>Bo({stops:i,base:e.base},t,r).evaluate(r,n)}}if(i){const r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Wi.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>a(e,t,r,s,l)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?zo(e.default,t.default):a(e,t,i,s,l)}}}function zo(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Fo(e,t,r,n,i){return zo(typeof r===i?n[r]:void 0,e.default,t.default)}function No(e,t,r){if(!Qr(r))return zo(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Mi(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function Bo(e,t,r){const n=void 0!==e.base?e.base:1;if(!Qr(r))return zo(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const o=Mi(e.stops.map((e=>e[0])),r),a=function(e,t,r,n){const i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1];let c=gr[t.type]||Oo;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=qi[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),a))}return"function"==typeof s.evaluate?{evaluate(...e){const t=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,a)}}:c(s,l,a)}function jo(e,t,r){return"color"===t.type?r=cr.parse(r):"formatted"===t.type?r=Fr.fromString(r.toString()):"resolvedImage"===t.type?r=Br.build(r.toString()):Xr(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),zo(r,e.default,t.default)}an.register(_o,{error:[{kind:"error"},[br],(e,[t])=>{throw new Hr(t.evaluate(e))}],typeof:[br,[kr],(e,[t])=>Pr(Gr(t.evaluate(e)))],"to-rgba":[Er(vr,4),[wr],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toArray()],"to-hsla":[Er(vr,4),[wr],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toHslaArray()],rgb:[wr,[vr,vr,vr],vo],rgba:[wr,[vr,vr,vr,vr],vo],hsl:[wr,[vr,vr,vr],bo],hsla:[wr,[vr,vr,vr,vr],bo],has:{type:xr,overloads:[[[br],(e,[t])=>xo(t.evaluate(e),e.properties())],[[br,Sr],(e,[t,r])=>xo(t.evaluate(e),r.evaluate(e))]]},get:{type:kr,overloads:[[[br],(e,[t])=>wo(t.evaluate(e),e.properties())],[[br,Sr],(e,[t,r])=>wo(t.evaluate(e),r.evaluate(e))]]},"feature-state":[kr,[br],(e,[t])=>wo(t.evaluate(e),e.featureState||{})],properties:[Sr,[],e=>e.properties()],"geometry-type":[br,[],e=>e.geometryType()],worldview:[br,[],e=>e.globals.worldview||""],"is-active-floor":[xr,So(br),(e,t)=>{if(!(e.globals.activeFloors&&e.globals.activeFloors.size>0))return!1;const r=e.globals.activeFloors;return t.some((t=>{const n=t.evaluate(e);return r.has(n)}))}],id:[kr,[],e=>e.id()],zoom:[vr,[],e=>e.globals.zoom],pitch:[vr,[],e=>e.globals.pitch||0],"distance-from-center":[vr,[],e=>e.distanceFromCenter()],"measure-light":[vr,[br],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[vr,[],e=>e.globals.heatmapDensity||0],"line-progress":[vr,[],e=>e.globals.lineProgress||0],"raster-value":[vr,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[vr,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[vr,[],e=>e.globals.skyRadialProgress||0],accumulated:[kr,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[vr,So(vr),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[vr,So(vr),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:vr,overloads:[[[vr,vr],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[vr],(e,[t])=>-t.evaluate(e)]]},"/":[vr,[vr,vr],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[vr,[vr,vr],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[vr,[],()=>Math.LN2],pi:[vr,[],()=>Math.PI],e:[vr,[],()=>Math.E],"^":[vr,[vr,vr],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[vr,[vr],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[vr,[vr],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[vr,[vr],(e,[t])=>Math.log(t.evaluate(e))],log2:[vr,[vr],(e,[t])=>Math.log2(t.evaluate(e))],sin:[vr,[vr],(e,[t])=>Math.sin(t.evaluate(e))],cos:[vr,[vr],(e,[t])=>Math.cos(t.evaluate(e))],tan:[vr,[vr],(e,[t])=>Math.tan(t.evaluate(e))],asin:[vr,[vr],(e,[t])=>Math.asin(t.evaluate(e))],acos:[vr,[vr],(e,[t])=>Math.acos(t.evaluate(e))],atan:[vr,[vr],(e,[t])=>Math.atan(t.evaluate(e))],min:[vr,So(vr),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[vr,So(vr),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[vr,[vr],(e,[t])=>Math.abs(t.evaluate(e))],round:[vr,[vr],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[vr,[vr],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[vr,[vr],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[xr,[br,kr],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[xr,[kr],(e,[t])=>e.id()===t.value],"filter-type-==":[xr,[br],(e,[t])=>e.geometryType()===t.value],"filter-<":[xr,[br,kr],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[xr,[kr],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[xr,[br,kr],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[xr,[kr],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[xr,[br,kr],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[xr,[kr],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[xr,[br,kr],(e,[t,r])=>{const n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[xr,[kr],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[xr,[kr],(e,[t])=>t.value in e.properties()],"filter-has-id":[xr,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[xr,[Er(br)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[xr,[Er(kr)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[xr,[br,Er(kr)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[xr,[br,Er(kr)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:xr,overloads:[[[xr,xr],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[So(xr),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:xr,overloads:[[[xr,xr],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[So(xr),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[xr,[xr],(e,[t])=>!t.evaluate(e)],"is-supported-script":[xr,[br],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[br,[br],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[br,[br],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[br,So(kr),(e,t)=>t.map((t=>Ur(t.evaluate(e)))).join("")],"resolved-locale":[br,[Tr],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[vr,[vr,vr,kr],(e,t)=>{const[r,n,i]=t.map((t=>t.evaluate(e)));if(r>n)return r;if(r===n)return r;let o;if("string"==typeof i)o=function(e){let t=0;if(0===e.length)return t;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}(i);else{if("number"!=typeof i)throw new Hr(`Invalid seed input: ${i}`);o=i}return r+yo(o)()*(n-r)}]});class Vo{constructor(e,t,r,n,i){this.expression=e,this._warningHistory={},this._scope=r,this._options=n,this._iconImageUseTheme=i,this._evaluator=new on(r,n,i),this._defaultValue=t?function(e){return"color"===e.type&&(Lo(e.default)||Array.isArray(e.default))?new cr(0,0,0,0):"color"===e.type?cr.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this.configDependencies=ko(e),this.isIndo
1orDependent=To(e)}evaluateWithoutErrorHandling(e,t,r,n,i,o,a,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,o,a,s,l){this._evaluator||(this._evaluator=new on(this._scope,this._options,this._iconImageUseTheme)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this._evaluator.iconImageUseTheme=l||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Hr(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){const t=e;return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${t.message}`)),this._defaultValue}}}function Go(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in _o}function Uo(e,t,r,n,i){const o=new Ti(_o,[],t?function(e){const t={color:wr,string:br,number:vr,enum:br,boolean:xr,formatted:Ir,resolvedImage:Mr};return"array"===e.type?Er(t[e.value]||kr,e.length):t[e.type]}(t):void 0,void 0,void 0,r,n,i),a=o.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);
1return a?Io(new Vo(a,t,r,n,i)):Mo(o.errors)}class $o{constructor(e,t,r,n){this.kind=e,this._styleExpression=t,this.isLightConstant=r,this.isLineProgressConstant=n,this.isStateDependent="constant"!==e&&!_i(t.expression),this.configDependencies=ko(t.expression),this.isIndoorDependent=To(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o,a){return this._styleExpression.evaluate(e,t,r,n,i,o,void 0,void 0,a)}}class Ho{constructor(e,t,r,n,i,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!_i(t.expression),this.isIndoorDependent=To(t.expression),this.isLightConstant=i,this.isLineProgressConstant=o,this.configDependencies=ko(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)}evaluate(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)}interpolationFactor(e,t,r){return this.interpolationType?Wi.interpolationFactor(this.interpolationType,e,t,r):0}}function qo(e,t,r,n,i){if("error"===(e=Uo(e,t,r,n,i)).result)return e;const o=e.value.expression,a=yi(o);if(!a&&!Po(t))return Mo([new mr("","data expressions not supported")]);const s=vi(o,["zoom","pitch","distance-from-center"]);if(!s&&!Co(t))return Mo([new mr("","zoom expressions not supported")]);const l=vi(o,["measure-light"]);if(!l&&!Ao(t))return Mo([new mr("","measure-light expression not supported")]);const c=vi(o,["line-progress"]);if(!c&&!function(e){return Eo(e.expression,"line-progress")}(t))return Mo([new mr("","line-progress expression not supported")]);const u=t.expression&&t.expression.relaxZoomRestriction,d=Zo(o);return d||s||u?d instanceof mr?Mo([d]):d instanceof Wi&&!Ro(t)?Mo([new mr("",'"interpolate" expressions cannot be used with this property')]):Io(d?new Ho(a&&c?"camera":"composite",e.value,d.labels,d instanceof Wi?d.interpolation:void 0,l,c):new $o(a&&c?"constant":"source",e.value,l,c)):Mo([new mr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class Wo{constructor(e,t){this._parameters=e,this._specification=t,Object.assign(this,Do(this._parameters,this._specification))}static deserialize(e){return new Wo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Zo(e){let t=null;if(e instanceof Xi)t=Zo(e.result);else if(e instanceof Yi){for(const r of e.args)if(t=Zo(r),t)break}else(e instanceof Ei||e instanceof Wi)&&e.input instanceof an&&"zoom"===e.input.name&&(t=e);return t instanceof mr||e.eachChild((e=>{const r=Zo(e);r instanceof mr?t=r:t&&r&&t!==r&&(t=new mr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var Yo,Xo,Ko=function(){if(Xo)return Yo;Xo=1,Yo=t;var e=3;function t(t,r,n){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],this.d=(r=o[1])+2*(n=o[2]);for(var a=0;a<this.d*this.d;a++){var s=o[e+a],l=o[e+a+1];i.push(s===l?null:o.subarray(s,l))}var c=o[e+i.length+1];this.keys=o.subarray(o[e+i.length],c),this.bboxes=o.subarray(c),this.insert=this._insertReadonly}else{this.d=r+2*n;for(var u=0;u<this.d*this.d;u++)i.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=n,this.scale=r/t,this.uid=0;var d=n/r*t;this.min=-d,this.max=t+d}return t.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},t.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},t.prototype._insertCell=function(e,t,r,n,i,o){this.cells[i].push(o)},t.prototype.query=function(e,t,r,n,i){var o=this.min,a=this.max;if(e<=o&&t<=o&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,r,n,this._queryCell,s,{},i),s},t.prototype._queryCell=function(e,t,r,n,i,o,a,s){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,d=0;d<l.length;d++){var h=l[d];if(void 0===a[h]){var f=4*h;(s?s(u[f+0],u[f+1],u[f+2],u[f+3]):e<=u[f+2]&&t<=u[f+3]&&r>=u[f+0]&&n>=u[f+1])?(a[h]=!0,o.push(c[h])):a[h]=!1}}},t.prototype._forEachCell=function(e,t,r,n,i,o,a,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),d=this._convertToCellCoord(n),h=l;h<=u;h++)for(var f=c;f<=d;f++){var p=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,e,t,r,n,p,o,a,s))return}},t.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},t.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},t.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,r=e+this.cells.length+1+1,n=0,i=0;i<this.cells.length;i++)n+=this.cells[i].length;var o=new Int32Array(r+n+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;
1for(var a=r,s=0;s<t.length;s++){var l=t[s];o[e+s]=a,o.set(l,a),a+=l.length}return o[e+t.length]=a,o.set(this.keys,a),o[e+t.length+1]=a+=this.keys.length,o.set(this.bboxes,a),a+=this.bboxes.length,o.buffer},Yo}(),Jo=we(Ko);const Qo={};function ea(e,t,r={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writable:!1}),Qo[t]={klass:e,omit:r.omit||[]}}ea(Object,"Object"),Jo.serialize=function(e,t){const r=e.toArrayBuffer();return t&&t.add(r),{buffer:r}},Jo.deserialize=function(e){return new Jo(e.buffer)},Object.defineProperty(Jo,"name",{value:"Grid"}),ea(Jo,"Grid"),delete Te.prototype.constructor,ea(cr,"Color"),ea(Error,"Error"),ea(Fr,"Formatted"),ea(zr,"FormattedSection"),ea(Ft,"AJAXError"),ea(Br,"ResolvedImage"),ea(Wo,"StylePropertyFunction"),ea(Vo,"StyleExpression",{omit:["_evaluator"]}),ea(or,"ImageId"),ea(Nr,"ImageVariant"),ea(Ho,"ZoomDependentExpression"),ea($o,"ZoomConstantExpression"),ea(an,"CompoundExpression",{omit:["_evaluate"]});for(const e in _o)Qo[_o[e]._classRegistryKey]||ea(_o[e],`Expression${e}`);function ta(e){return e&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function ra(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(ta(e)||e instanceof ImageBitmap)return t&&t.add(e),e;if(ArrayBuffer.isView(e))return t&&t.add(e.buffer),e;if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const n of e)r.push(ra(n,t));return r}if(e instanceof Map){const r={$name:"Map",entries:[]};for(const[n,i]of e.entries())r.entries.push(ra(n),ra(i,t));return r}if(e instanceof Set){const t={$name:"Set"};let r=0;for(const n of e.values())t[++r]=ra(n);return t}if("bigint"==typeof e)return{$name:"BigInt",value:e.toString()};if("object"==typeof e){const r=e.constructor,n=r._classRegistryKey;if(!n)throw new Error(`Can't serialize object of unregistered class "${r.name}".`);const i=r.serialize?r.serialize(e,t):{};if(!r.serialize){for(const r in e)e.hasOwnProperty(r)&&(Qo[n].omit.indexOf(r)>=0||(i[r]=ra(e[r],t)));e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(i.$name=n),i}throw new Error("can't serialize object of type "+typeof e)}function na(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||ta(e)||e instanceof ImageBitmap||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(na);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=e.entries||[],r=new Map;for(let e=0;e<t.length;e+=2)r.set(na(t[e]),na(t[e+1]));return r}if("Set"===t){const t=new Set;for(const r of Object.keys(e))"$name"!==r&&t.add(na(e[r]));return t}if("BigInt"===t)return BigInt(e.value);const{klass:r}=Qo[t];if(!r)throw new Error(`Can't deserialize unregistered class "${t}".`);if(r.deserialize)return r.deserialize(e);const n=Object.create(r.prototype);for(const t of Object.keys(e))"$name"!==t&&(n[t]=na(e[t]));return n}throw new Error("can't deserialize object of type "+typeof e)}const ia=e=>e>=1536&&e<=1791,oa=e=>e>=1872&&e<=1919,aa=e=>e>=2208&&e<=2303,sa=e=>e>=11904&&e<=12031,la=e=>e>=12032&&e<=12255,ca=e=>e>=12272&&e<=12287,ua=e=>e>=12288&&e<=12351,da=e=>e>=12352&&e<=12447,ha=e=>e>=12448&&e<=12543,fa=e=>e>=12544&&e<=12591,pa=e=>e>=12704&&e<=12735,ga=e=>e>=12736&&e<=12783,ma=e=>e>=12784&&e<=12799,ya=e=>e>=12800&&e<=13055,_a=e=>e>=13056&&e<=13311,va=e=>e>=13312&&e<=19903,ba=e=>e>=19968&&e<=40959,xa=e=>e>=40960&&e<=42127,wa=e=>e>=42128&&e<=42191,Sa=e=>e>=44032&&e<=55215,ka=e=>e>=63744&&e<=64255,Ta=e=>e>=64336&&e<=65023,Ia=e=>e>=65040&&e<=65055,Ma=e=>e>=65072&&e<=65103,Ea=e=>e>=65104&&e<=65135,Pa=e=>e>=65136&&e<=65279,Aa=e=>e>=65280&&e<=65519;function Ca(e){for(const t of e)if(Da(t.charCodeAt(0)))return!0;return!1}function Ra(e){for(const t of e)if(!La(t.charCodeAt(0)))return!1;return!0}function La(e){return!(ia(e)||oa(e)||aa(e)||Ta(e)||Pa(e))}function Oa(e){return!(e<11904||!(pa(e)||fa(e)||Ma(e)||ka(e)||_a(e)||sa(e)||ga(e)||ua(e)||va(e)||ba(e)||ya(e)||Aa(e)||da(e)||ca(e)||la(e)||ma(e)||ha(e)||Ia(e)||wa(e)||xa(e)))}function Da(e){return!(746!==e&&747!==e&&(e<4352||!(pa(e)||fa(e)||Ma(e)&&!(e>=65097&&e<=65103)||ka(e)||_a(e)||sa(e)||ga(e)||!(!ua(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||va(e)||ba(e)||ya(e)||(e=>e>=12592&&e<=12687)(e)||(e=>e>=43360&&e<=43391)(e)||(e=>e>=55216&&e<=55295)(e)||(e=>e>
vendor: 7,406 bytes, line 1
1=4352&&e<=4607)(e)||Sa(e)||da(e)||ca(e)||(e=>e>=12688&&e<=12703)(e)||la(e)||ma(e)||ha(e)&&12540!==e||!(!Aa(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!Ea(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||(e=>e>=5120&&e<=5759)(e)||(e=>e>=6320&&e<=6399)(e)||Ia(e)||(e=>e>=19904&&e<=19967)(e)||xa(e)||wa(e))))}function za(e){return 12312===e||12313===e||12316===e||12540===e||12448===e}function Fa(e){return!(Da(e)||function(e){return!!((e=>e>=128&&e<=255)(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(e=>e>=8192&&e<=8303)(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||(e=>e>=8448&&e<=8527)(e)||(e=>e>=8528&&e<=8591)(e)||(e=>e>=8960&&e<=9215)(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||(e=>e>=9216&&e<=9279)(e)&&9251!==e||(e=>e>=9280&&e<=9311)(e)||(e=>e>=9312&&e<=9471)(e)||(e=>e>=9632&&e<=9727)(e)||(e=>e>=9728&&e<=9983)(e)&&!(e>=9754&&e<=9759)||(e=>e>=11008&&e<=11263)(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ua(e)||ha(e)||(e=>e>=57344&&e<=63743)(e)||Ma(e)||Ea(e)||Aa(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Na(e){return ia(e)||oa(e)||aa(e)||Ta(e)||Pa(e)}function Ba(e){return e>=1424&&e<=2303||Ta(e)||Pa(e)}function ja(e,t){return!(!t&&Ba(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||(e=>e>=6016&&e<=6143)(e))}function Va(e){for(const t of e)if(Ba(t.charCodeAt(0)))return!0;return!1}const Ga={unavailable:"unavailable",deferred:"deferred",loading:"loading",parsing:"parsing",parsed:"parsed",loaded:"loaded",error:"error"};let Ua=null,$a=Ga.unavailable,Ha=null;const qa=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&($a=Ga.error),Ua&&Ua(e)};function Wa(){Za.fire(new er("pluginStateChange",{pluginStatus:$a,pluginURL:Ha}))}const Za=new ir,Ya=function(){return $a},Xa=function(){if($a!==Ga.deferred||!Ha)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$a=Ga.loading,Wa(),Ha&&jt({url:Ha},(e=>{e?qa(e):($a=Ga.loaded,Wa())}))},Ka={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>$a===Ga.loaded||null!=Ka.applyArabicShaping,isLoading:()=>$a===Ga.loading,setState(e){$a=e.pluginStatus,Ha=e.pluginURL},isParsing:()=>$a===Ga.parsing,isParsed:()=>$a===Ga.parsed,getPluginURL:()=>Ha};class Ja{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness,this.worldview=t.worldview,this.activeFloors=t.activeFloors):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const r of e)if(!ja(r.charCodeAt(0),t))return!1;return!0}(e,Ka.isLoaded())}}class Qa{constructor(e,t,r,n,i){this.property=e,this.value=t,this.expression=function(e,t,r,n,i){if(Lo(e))return new Wo(e,t);if(Go(e)||Array.isArray(e)&&e.length>0){const o=qo(e,t,r,n,i);if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return o.value}{let r=e;return"string"==typeof e&&"color"===t.type&&(r=cr.parse(e)),{kind:"constant",configDependencies:new Set,isIndoorDependent:!1,evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification,r,n,i)}isIndoorDependent(){return this.expression.isIndoorDependent}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r,n){return this.property.possiblyEvaluate(this,e,t,r,n)}}class es{constructor(e,t,r,n){this.property=e,this.value=new Qa(e,void 0,t,r,n)}transitioned(e,t){return new rs(this.property,this.value,t,Object.assign({},e.transition,this.transition),e.now)}untransitioned(){return new rs(this.property,this.value,null,{},0)}}class ts{constructor(e,t,r,n){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=r,this._iconImageUseTheme=n,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(e){return He(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new es(this._values[e].property,this._scope,this._options,this._iconImageUseTheme)),this._values[e].value=new Qa(this._values[e].property,null===t?void 0:He(t),this._scope,this._options,this._iconImageUseTheme),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[e].value.isIndoorDependent())}setTransitionOrValue(e,t){t&&(this._options=t);const r=this._properties.properties;if(e)for(const t in e){const n=e[t];if(t.endsWith("-transition")){const e=t.slice(0,-11);r[e]&&this.setTransition(e,n)}else r.hasOwnProperty(t)&&this.setValue(t,n)}}getTransition(e){return He(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new es(this._values[e].property)),this._values[e].transition=He(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const r=new ns(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){const e=new ns(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}isIndoorDependent(){return this._isIndoorDependent}}class rs{constructor(e,t,r,n,i){const o=n.delay||0,a=n.duration||0;i=i||0,this.property=e,this.value=t,this.begin=i+o,this.end=this.begin+a,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),o=this.prior;if(o){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return o.possiblyEvaluate(e,t,r);{const a=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,r),i,Re(a))}}return i}}class ns{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const n=new as(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class is{constructor(e,t,r,n){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=r,this._iconImageUseTheme=n,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(e){return He(this._values[e].value)}setValue(e,t){this._values[e]=new Qa(this._values[e].property,null===t?void 0:He(t),this._scope,this._options,this._iconImageUseTheme),this._values[e].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[e].isIndo
vendor: 4,401 bytes, line 1
1orDependent())}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r,n){const i=new as(this._properties);for(const o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,t,r,n);return i}isIndoorDependent(){return this._isIndoorDependent}}class os{constructor(e,t,r,n){this.property=e,this.value=t,this.parameters=r,this.iconImageUseTheme=n}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n,this.iconImageUseTheme)}}class as{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class ss{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,r){const n=gr[this.specification.type];return n?n(e,t,r):e}}class ls{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n,i){return"constant"===e.expression.kind||"camera"===e.expression.kind?new os(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,n,void 0,i)},t):new os(this,e.expression,t,i)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new os(this,{kind:"constant",value:void 0},e.parameters);const n=gr[this.specification.type];return n?new os(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,n,i,o,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,o,void 0,a)}}class cs{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class us{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new Ja(0,{});for(const r in e){const n=e[r];n.specification.overridable&&this.overridableProperties.push(r);const i=this.defaultPropertyValues[r]=new Qa(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new es(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate(t)}}}ea(ls,"DataDrivenProperty"),ea(ss,"DataConstantProperty"),ea(cs,"ColorRampProperty");var ds=JSON.parse('{"$version":8,"$root":{"version":{"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow"},"rain":{"type":"rain"},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor"},"imports":{"type":"array","value":"import"},"iconsets":{"type":"iconsets"},"schema":{"type":"schema"},"sources":{"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"type":"featuresets"}},"featuresets":{"*":{"type":"featureset"}},"featureset":{"metadata":{"type":"*"},"selectors":{"type":"array","value":"selector"}},"selector":{"layer":{"type":"string"},"properties":{"type":"selectorProperty"},"featureNamespace":{"type":"string"},"_uniqueFeatureID":{"type":"boolean"}},"selectorProperty":{"*":{"type":"*"}},"model":{"type":"string"},"import":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","expression":{}},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}}
1,"light-3d":{"id":{"type":"string"},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false},"shadow-quality":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]}},"shadow-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"shadow-draw-before-layer":{"type":"string"}},"properties_light_ambient":{"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"type":"enum","values":{"sprite":1}},"url":{"type":"string"}},"iconset_source":{"type":{"type":"enum","values":{"source":1}},"source":{"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"extra_bounds":{"type":"array","value":{"type":"array","value":"number","length":4}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
1,"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"type":"enum","values":{"video":1}},"urls":{"type":"array","value":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"type":"enum","values":{"image":1}},"url":{"type":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"modelNodeOverride":{"orientation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360}},"modelNodeOverrides":{"*":{"type":"modelNodeOverride"}},"modelMaterialOverride":{"model-color":{"type":"color"},"model-color-mix-intensity":{"type":"number"},"model-opacity":{"type":"number"},"model-emissive-strength":{"type":"number"}},"modelMaterialOverrides":{"*":{"type":"modelMaterialOverride"}},"modelSourceModel":{"uri":{"type":"string"},"position":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[-180,-90],"maximum":[180,90]},"orientation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360},"nodeOverrides":{"type":"modelNodeOverrides"},"materialOverrides":{"type":"modelMaterialOverrides"},"nodeOverrideNames":{"type":"array","value":"string"},"materialOverrideNames":{"type":"array","value":"string"},"featureProperties":{"type":"*"}},"modelSourceModels":{"*":{"type":"modelSourceModel"}},"source_model":{"type":{"type":"enum","values":{"model":1,"batched-model":1}},"url":{"type":"string"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"},"models":{"type":"modelSourceModels"}},"layer":{"id":{"type":"string"},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"building":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{},"clip":{}}},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"},"appearances":{"type":"array","value":"appearance","supported-layer-types":["symbol"]}},"appearance":{"condition":{"type":"boolean","expression":{"interpolated":true,"parameters":["zoom","pitch","feature","feature-state","measure-light","distance-from-center"]},"property-type":"data-driven"},"name":{"type":"string"},"properties":{"type":"*"}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_building","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"model-allow-density-reduction":{"type":"boolean","default":true}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":1,"symbol":1},"default":[],"expression":{}},"clip-layer-scope":{"type":"array","value":"string","default":[],"expression":{}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"default":"none","expression":{}},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-markup":1},"default":"none","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"fill-extrusion-edge-radius":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}}},"layout_building":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"building-facade":{"type":"boolean","default":false,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-floors":{"type":"number","minimum":1,"maximum":200,"default":3,"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-facade-unit-width":{"type":"number","minimum":1,"maximum":20,"default":3.1,"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-facade-window":{"type":"array","length":2,"value":"number","minimum":0.1,"maximum":1,"default":[0.9,0.9],"property-type":"data-driven","expression":{"parameters":["feature"]}},"building-roof-shape":{"type":"enum","values":{"flat":1,"hipped":1,"gabled":1,"parapet":1,"mansard":1,"skillion":1,"pyramidal":1},"default":"flat","expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{},"property-type":"data-driven"},"building-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"building-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"building-flip-roof-orientation":{"property-type":"data-driven","type":"boolean","default":false,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","default":0,"expression":{"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"default":"none","expression":{}},"line-cross-slope":{"type":"number","expression":{}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}},"line-width-unit":{"type":"enum","values":{"pixels":1,"meters":1},"default":"pixels","expression":{"parameters":["zoom"]}}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]}},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]}},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]}},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{"parameters":["zoom"]}},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"icon-size":{"type":"number","default":1,"minimum":0,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"expression":{}},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"appearance":true,"use-theme":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}
1,"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]}},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"expression":{}},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]}},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]}},"text-rotate":{"type":"number","default":0,"period":360,"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"appearance":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{}}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_hillshade":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster-particle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_clip":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_model":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_building":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*"}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"use-theme":true,"transition":true},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective"}},"colorTheme":{"data":{"type":"string","expression":{}}},"indoor_source":{"sourceId":{"type":"string"},"sourceLayers":{"type":"array","value":"string"}},"indoor":{"*":{"type":"indoor_source"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"use-theme":true,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator"},"center":{"type":"array","length":2,"value":"number","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","meas
1ure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"flat"},"fill-extrusion-base-alignment":{"type":"enum","values":{"terrain":1,"flat":1},"default":"terrain"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"parameters":[]},"transition":true},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","use-theme":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-facade-emissive-chance":{"type":"number","default":0.35,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["measure-light","zoom"]}},"building-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"building-flood-light-color":{"type":"color","default":"#ffffff","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"building-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"building-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"}
1,"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-gradient":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["line-progress"]}},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1]},"line-trim-fade-range":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-trim-color":{"type":"color","default":"transparent","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"line-border-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"use-theme":true,"expression":{"interpolated":true,"parameters":["heatmap-density"]}},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{}},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{}},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-value"]}},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","use-theme":true,"expression":{"interpolated":true,"parameters":["raster-particle-speed"]}},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"hillshade-shadow-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-accent-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","use-theme":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"use-theme":true,"expression":{"interpolated":true,"parameters":["sky-radial-progress"]}},"sky-atmosphere-halo-color":{"type":"color","default":"white","use-theme":true},"sky-atmosphere-color":{"type":"color","default":"white","use-theme":true},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"use-theme":true,"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default
1":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d"},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{}},"model-front-cutoff":{"type":"array","value":"number","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]},"model-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","expression":{}}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"promoteId":{"*":{"type":"*"}}}');function hs(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function fs(e){if(Array.isArray(e))return e.map(fs);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=fs(e[r]);return t}return hs(e)}function ps(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!ps(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function gs(e,t="",r=null,n="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ps(e)||(e=ws(e));const i=e;let o=!0;try{o=function(e){if(!_s(e))return e;let t=fs(e);return ys(t),t=ms(t),t}(i)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n        `)}let a=null,s=null;if("background"!==n&&"sky"!==n&&"slot"!==n){s=ds[`filter_${n}`];const e=Uo(o,s,t,r);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(t,r,n)=>e.value.evaluate(t,r,{},n)}let l=null,c=null;if(o!==i){const e=Uo(i,s,t,r);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));l=(t,r,n,i,o)=>e.value.evaluate(t,r,{},n,void 0,void 0,i,o),c=!yi(e.value.expression)}return{filter:a,dynamicFilter:l||void 0,needGeometry:xs(o),needFeature:!!c}}function ms(e){if(!Array.isArray(e))return e;const t=function(e){if(vs.has(e[0]))for(let t=1;t<e.length;t++)if(_s(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>ms(e)))}function ys(e){let t=!1;const r=[];if("case"===e[0]){for(let n=1;n<e.length-1;n+=2)t=t||_s(e[n]),r.push(e[n+1]);r.push(e[e.length-1])}else if("match"===e[0]){t=t||_s(e[1]);for(let t=2;t<e.length-1;t+=2)r.push(e[t+1]);r.push(e[e.length-1])}else if("step"===e[0]){t=t||_s(e[1]);for(let t=1;t<e.length-1;t+=2)r.push(e[t+1])}t&&(e.length=0,e.push("any",...r));for(let t=1;t<e.length;t++)ys(e[t])}function _s(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(_s(e[t]))return!0;return!1}const vs=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function bs(e,t){return e<t?-1:e>t?1:0}function xs(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(xs(e[t]))return!0;return!1}function ws(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?Ss(e[1],e[2],"=="):"!="===t?Is(Ss(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Ss(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(ws))):"all"===t?["all"].concat(e.slice(1).map(ws)):"none"===t?["all"].concat(e.slice(1).map(ws).map(Is)):"in"===t?ks(e[1],e.slice(2)):"!in"===t?Is(ks(e[1],e.slice(2))):"has"===t?Ts(e[1]):"!has"!==t||Is(Ts(e[1]));var r}function Ss(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function ks(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(bs)]]:["filter-in-small",e,["literal",t]]}}function Ts(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Is(e){return["!",e]}const Ms="�";function Es(e,t){return t?`${e}${Ms}${t}`:e}let Ps;const As=()=>Ps||(Ps=new us({"icon-size":new ls(ds.layout_symbol["icon-size"]),"icon-image":new ls(ds.layout_symbol["icon-image"]),"icon-rotate":new ls(ds.layout_symbol["icon-rotate"]),"icon-offset":new ls(ds.layout_symbol["icon-offset"]),"text-size":new ls(ds.layout_symbol["text-size"]),"text-rotate":new ls(ds.layout_symbol["text-rotate"]),"text-offset":new ls(ds.layout_symbol["text-offset"])}));class Cs{constructor(e,t,r,n,i,o){const a=Uo(e,ds.appearance.condition);if("success"===a.result&&(this.condition=a.value),this.name=t,r){this.properties=new as(As()),this.unevaluatedLayout=new is(As(),n,i,o);for(const e in r)this.unevaluatedLayout.setValue(e,r[e])}}
1isActive(e){return!(this.condition||!e.isHidden||"hidden"!==this.name)||this.condition.evaluate(e.globals,e.feature,e.featureState,e.canonical)}getCondition(){return this.condition}getName(){return this.name}getProperty(e){return this.properties.get(e)}getUnevaluatedProperties(){return this.unevaluatedLayout}getUnevaluatedProperty(e){return this.unevaluatedLayout._values[e]}recalculate(e,t,r){this.unevaluatedLayout&&(this.properties=this.unevaluatedLayout.possiblyEvaluate(e,void 0,t,r))}serialize(){const e={};return e.condition=this.condition.expression.serialize(),this.name&&(e.name=this.name),this.unevaluatedLayout&&(e.properties=this.unevaluatedLayout.serialize()),e}hasIconProperties(){const e=this.hasProperty("icon-image"),t=this.hasProperty("icon-size"),r=this.hasProperty("icon-offset"),n=this.hasProperty("icon-rotate");return e||t||r||n}hasTextProperties(){const e=this.hasProperty("text-size"),t=this.hasProperty("text-offset"),r=this.hasProperty("text-rotate");return e||t||r}hasProperty(e){return void 0!==this.getUnevaluatedProperty(e).value}}const Rs="-transition",Ls=new Set(["fill","line","background","hillshade","raster"]);class Os extends ir{constructor(e,t,r,n,i,o){if(super(),this.id=e.id,this.fqid=Es(this.id,r),this.type=e.type,this.scope=r,this.lut=n,this.options=i,this.iconImageUseTheme=o,this.appearances=new Array,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.expressionDependencies={isIndoorDependent:!1,configDependencies:new Set},"custom"!==e.type){if(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type&&"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type){this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter;const t=Uo(this.filter,ds[`filter_${e.type}`]);"error"!==t.result&&(this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...t.value.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||t.value.isIndoorDependent)}if(e.slot&&(this.slot=e.slot),e.appearances&&this.setAppearances(e.appearances),t.layout&&(this._unevaluatedLayout=new is(t.layout,this.scope,i,this.iconImageUseTheme),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._unevaluatedLayout.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._unevaluatedLayout.isIndoorDependent()),t.paint){this._transitionablePaint=new ts(t.paint,this.scope,i);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...this._transitionablePaint.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||this._transitionablePaint.isIndoorDependent(),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new as(t.paint)}}}onAdd(e){}onRemove(e){}isDraped(e){return!this.is3D(!0)&&Ls.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const r=this._unevaluatedLayout;r._properties.properties[e]&&(r.setValue(e,t),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...r.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||r.isIndoorDependent(),"visibility"===e&&this.possiblyEvaluateVisibility())}setAppearances(e){this.appearances=[],e.forEach((e=>{this.appearances.push(new Cs(e.condition,e.name,e.properties,this.scope,this.options,this.iconImageUseTheme))}))}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(e){return e.endsWith(Rs)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}isPaintProperty(e){return!!this._transitionablePaint._properties.properties[e]}setPaintProperty(e,t){const r=this._transitionablePaint,n=r._properties.properties;if(e.endsWith(Rs)){const i=e.slice(0,-11);return n[i]&&r.setTransition(i,t||void 0),!1}if(!n[e])return!1;const i=r._values[e],o=i.value.isDataDriven(),a=i.value;r.setValue(e,t),this.expressionDependencies.configDependencies=new Set([...this.expressionDependencies.configDependencies,...r.configDependencies]),this.expressionDependencies.isIndoorDependent=this.expressionDependencies.isIndoorDependent||r.isIndoorDependent(),this._handleSpecialPaintPropertyUpdate(e);const s=r._values[e].value,l=s.isDataDriven(),c=e.endsWith("pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,a,s)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t,r){return null}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}
vendor: 9,949 bytes, line 1
1isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t,this.iconImageUseTheme)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return 0!==this.appearances.length&&(e.appearances=this.appearances.map((e=>e.serialize()))),$e(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}is3D(e){return!1}hasElevation(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}_clear(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof os&&Po(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}for(const e of this.appearances)if(!_i(e.condition.expression))return!0;return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=gs(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}getAppearances(){return this.appearances}queryRenderedFeatures(e,t,r){return{}}queryRadius(e){}queryIntersectsFeature(e,t,r,n,i,o,a,s,l,c){}}const Ds={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class zs{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}const Fs=new ArrayBuffer(0);class Ns{constructor(){this._reallocCount=0,this.capacity=0,this.length=0}static serialize(e,t){return e._trim(),t&&e.arrayBuffer&&t.add(e.arrayBuffer),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,e.arrayBuffer?t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement:(t.capacity=0,t.arrayBuffer=Fs),t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this._reallocCount++,this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}reserveForAdditional(e){this.reserve(this.length+e)}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function Bs(e,t=1){let r=0,n=0;return{members:e.map((e=>{const i=Ds[e.type].BYTES_PER_ELEMENT,o=r=js(r,Math.max(t,i)),a=e.components||1;return n=Math.max(n,i),r+=i*a,{name:e.name,type:e.type,components:a,offset:o}})),size:js(r,Math.max(n,t)),alignment:t}}function js(e,t){return Math.ceil(e/t)*t}class Vs extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}}Vs.prototype.bytesPerElement=4,ea(Vs,"StructArrayLayout2i4");class Gs extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}Gs.prototype.bytesPerElement=6,ea(Gs,"StructArrayLayout3i6");class Us extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,e}}Us.prototype.bytesPerElement=8,ea(Us,"StructArrayLayout4i8");class $s extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}$s.prototype.bytesPerElement=4,ea($s,"StructArrayLayout1f4");class Hs extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=4*e,o=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.float32[o+1]=n,e}}Hs.prototype.bytesPerElement=8,ea(Hs,"StructArrayLayout2i1f8");class qs extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=4*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}qs.prototype.bytesPerElement=8,ea(qs,"StructArrayLayout3i8");class Ws extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const a=5*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,this.int16[a+4]=o,e}}Ws.prototype.bytesPerElement=10,ea(Ws,"StructArrayLayout5i10");class Zs extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o,a)}emplace(e,t,r,n,i,o,a,s){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.uint8[c+4]=n,this.uint8[c+5]=i,this.uint8[c+6]=o,this.uint8[c+7]=a,this.float32[u+2]=s,e}}Zs.prototype.bytesPerElement=12,ea(Zs,"StructArrayLayout2i4ub1f12");class Ys extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}Ys.prototype.bytesPerElement=12,ea(Ys,"StructArrayLayout3f12");class Xs extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const a=6*e,s=3*e;return this.uint16[a+0]=t,this.uint16[a+1]=r,this.uint16[a+2]=n,this.uint16[a+3]=i,this.float32[s+2]=o,e}}Xs.prototype.bytesPerElement=12,ea(Xs,"StructArrayLayout4ui1f12");class Ks extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=r,this.uint16[o+2]=n,this.uint16[o+3]=i,e}}Ks.prototype.bytesPerElement=8,ea(Ks,"StructArrayLayout4ui8");class Js extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,a){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e}}Js.prototype.bytesPerElement=12,ea(Js,"StructArrayLayout6i12");class Qs extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,d){const h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,n,i,o,a,s,l,c,u,d)}emplace(e,t,r,n,i,o,a,s,l,c,u,d,h){const f=12*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=d,this.int16[f+11]=h,e}}Qs.prototype.bytesPerElement=24,ea(Qs,"StructArrayLayout4i4ui4i24");class el extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)}
vendor: 12,962 bytes, line 1
1emplace(e,t,r,n,i,o,a){const s=10*e,l=5*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=a,e}}el.prototype.bytesPerElement=20,ea(el,"StructArrayLayout3i3f20");class tl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,e}}tl.prototype.bytesPerElement=16,ea(tl,"StructArrayLayout4f16");class rl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}rl.prototype.bytesPerElement=4,ea(rl,"StructArrayLayout1ul4");class nl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}}nl.prototype.bytesPerElement=4,ea(nl,"StructArrayLayout2ui4");class il extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,d,h){const f=this.length;return this.resize(f+1),this.emplace(f,e,t,r,n,i,o,a,s,l,c,u,d,h)}emplace(e,t,r,n,i,o,a,s,l,c,u,d,h,f){const p=20*e,g=10*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.int16[p+4]=o,this.float32[g+3]=a,this.float32[g+4]=s,this.float32[g+5]=l,this.float32[g+6]=c,this.int16[p+14]=u,this.uint32[g+8]=d,this.uint16[p+18]=h,this.uint16[p+19]=f,e}}il.prototype.bytesPerElement=40,ea(il,"StructArrayLayout5i4f1i1ul2ui40");class ol extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o,a)}emplace(e,t,r,n,i,o,a,s){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+4]=i,this.int16[l+5]=o,this.int16[l+6]=a,this.int16[l+7]=s,e}}ol.prototype.bytesPerElement=16,ea(ol,"StructArrayLayout3i2i2i16");class al extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const a=4*e,s=8*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,e}}al.prototype.bytesPerElement=16,ea(al,"StructArrayLayout2f1f2i16");class sl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,a){const s=20*e,l=5*e;return this.uint8[s+0]=t,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=a,e}}sl.prototype.bytesPerElement=20,ea(sl,"StructArrayLayout2ub4f20");class ll extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}}ll.prototype.bytesPerElement=6,ea(ll,"StructArrayLayout3ui6");class cl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b){const x=this.length;return this.resize(x+1),this.emplace(x,e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b)}emplace(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x){const w=30*e,S=15*e,k=60*e;return this.int16[w+0]=t,this.int16[w+1]=r,this.int16[w+2]=n,this.float32[S+2]=i,this.float32[S+3]=o,this.uint16[w+8]=a,this.uint16[w+9]=s,this.uint32[S+5]=l,this.uint32[S+6]=c,this.uint32[S+7]=u,this.uint16[w+16]=d,this.uint16[w+17]=h,this.uint16[w+18]=f,this.float32[S+10]=p,this.float32[S+11]=g,this.uint8[k+48]=m,this.uint8[k+49]=y,this.uint8[k+50]=_,this.uint32[S+13]=v,this.int16[w+28]=b,this.uint8[k+58]=x,e}}cl.prototype.bytesPerElement=60,ea(cl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class ul extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E,P,A,C,R){const L=this.length;return this.resize(L+1),this.emplace(L,e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E,P,A,C,R)}emplace(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E,P,A,C,R,L){const O=20*e,D=40*e,z=80*e;return this.float32[O+0]=t,this.float32[O+1]=r,this.int16[D+4]=n,this.int16[D+5]=i,this.int16[D+6]=o,this.int16[D+7]=a,this.int16[D+8]=s,this.int16[D+9]=l,this.int16[D+10]=c,this.int16[D+11]=u,this.int16[D+12]=d,this.uint16[D+13]=h,this.uint16[D+14]=f,this.uint16[D+15]=p,this.uint16[D+16]=g,this.uint16[D+17]=m,this.uint16[D+18]=y,this.uint16[D+19]=_,this.uint16[D+20]=v,this.uint16[D+21]=b,this.uint16[D+22]=x,this.uint16[D+23]=w,this.uint16[D+24]=S,this.uint16[D+25]=k,this.uint16[D+26]=T,this.uint16[D+27]=I,this.uint32[O+14]=M,this.float32[O+15]=E,this.float32[O+16]=P,this.float32[O+17]=A,this.float32[O+18]=C,this.uint8[z+76]=R,this.uint16[D+39]=L,e}}ul.prototype.bytesPerElement=80,ea(ul,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class dl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)}emplace(e,t,r,n,i,o,a){const s=6*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=n,this.float32[s+3]=i,this.float32[s+4]=o,this.float32[s+5]=a,e}}dl.prototype.bytesPerElement=24,ea(dl,"StructArrayLayout6f24");class hl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)}emplace(e,t,r,n,i,o){const a=5*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,this.float32[a+4]=o,e}}hl.prototype.bytesPerElement=20,ea(hl,"StructArrayLayout5f20");class fl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o,a)}emplace(e,t,r,n,i,o,a,s){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=r,this.float32[l+2]=n,this.float32[l+3]=i,this.float32[l+4]=o,this.float32[l+5]=a,this.float32[l+6]=s,e}}fl.prototype.bytesPerElement=28,ea(fl,"StructArrayLayout7f28");class pl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,n,i,o,a,s,l,c,u)}emplace(e,t,r,n,i,o,a,s,l,c,u,d){const h=11*e;return this.float32[h+0]=t,this.float32[h+1]=r,this.float32[h+2]=n,this.float32[h+3]=i,this.float32[h+4]=o,this.float32[h+5]=a,this.float32[h+6]=s,this.float32[h+7]=l,this.float32[h+8]=c,this.float32[h+9]=u,this.float32[h+10]=d,e}}pl.prototype.bytesPerElement=44,ea(pl,"StructArrayLayout11f44");class gl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,o,a,s,l)}emplace(e,t,r,n,i,o,a,s,l,c){const u=9*e;return this.float32[u+0]=t,this.float32[u+1]=r,this.float32[u+2]=n,this.float32[u+3]=i,this.float32[u+4]=o,this.float32[u+5]=a,this.float32[u+6]=s,this.float32[u+7]=l,this.float32[u+8]=c,e}}gl.prototype.bytesPerElement=36,ea(gl,"StructArrayLayout9f36");class ml extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}}ml.prototype.bytesPerElement=8,ea(ml,"StructArrayLayout2f8");class yl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=r,this.uint16[o+3]=n,this.uint16[o+4]=i,e}}yl.prototype.bytesPerElement=12,ea(yl,"StructArrayLayout1ul3ui12");class _l extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}_l.prototype.bytesPerElement=2,ea(_l,"StructArrayLayout1ui2");class vl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g){const m=this.length;return this.resize(m+1),this.emplace(m,e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g)}emplace(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m){const y=16*e;return this.float32[y+0]=t,this.float32[y+1]=r,this.float32[y+2]=n,this.float32[y+3]=i,this.float32[y+4]=o,this.float32[y+5]=a,this.float32[y+6]=s,this.float32[y+7]=l,this.float32[y+8]=c,this.float32[y+9]=u,this.float32[y+10]=d,this.float32[y+11]=h,this.float32[y+12]=f,this.float32[y+13]=p,this.float32[y+14]=g,this.float32[y+15]=m,e}}vl.prototype.bytesPerElement=64,ea(vl,"StructArrayLayout16f64");class bl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,o,a)}emplace(e,t,r,n,i,o,a,s){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.float32[c+2]=o,this.float32[c+3]=a,this.float32[c+4]=s,e}}bl.prototype.bytesPerElement=20,ea(bl,"StructArrayLayout4ui3f20");class xl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}xl.prototype.bytesPerElement=2,ea(xl,"StructArrayLayout1i2");class wl extends Ns{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}wl.prototype.bytesPerElement=1,ea(wl,"StructArrayLayout1ub1");class Sl extends zs{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Sl.prototype.size=40;class kl extends il{get(e){return new Sl(this,e)}}ea(kl,"CollisionBoxArray");class Tl extends zs{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}
vendor: 21,059 bytes, line 1
1get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Tl.prototype.size=60;class Il extends cl{get(e){return new Tl(this,e)}}ea(Il,"PlacedSymbolArray");class Ml extends zs{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}Ml.prototype.size=80;class El extends ul{get(e){return new Ml(this,e)}}ea(El,"SymbolInstanceArray");class Pl extends $s{getoffsetX(e){return this.float32[1*e+0]}}ea(Pl,"GlyphOffsetArray");class Al extends Vs{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}ea(Al,"SymbolLineVertexArray");class Cl extends zs{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Cl.prototype.size=12;class Rl extends yl{get(e){return new Cl(this,e)}}ea(Rl,"FeatureIndexArray");class Ll extends nl{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}ea(Ll,"FillExtrusionCentroidArray");class Ol extends zs{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}Ol.prototype.size=6;class Dl extends Gs{get(e){return new Ol(this,e)}}ea(Dl,"FillExtrusionWallArray");const zl=Bs([{name:"a_pos",components:2,type:"Int16"}],4),Fl=Bs([{name:"a_circle_z_offset",components:1,type:"Float32"}],4),Nl=Bs([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Bl{constructor(e=[]){this.segments=e}_prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>Bl.MAX_VERTEX_ARRAY_LENGTH&&Ze(`Max vertices per segment is ${Bl.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>Bl.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t,primitiveOffset:r,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}prepareSegment(e,t,r,n){return this._prepareSegment(e,t.length,r.length,n)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,n){return new Bl([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function jl(e,t){return 256*(e=De(Math.floor(e),0,255))+De(Math.floor(t),0,255)}Bl.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ea(Bl,"SegmentVector");const Vl=Bs([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Gl=Bs([{name:"a_pattern_b",components:4,type:"Uint16"}]),Ul=Bs([{name:"a_dash",components:4,type:"Uint16"}]);class $l{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(Hl(e)),this.positions.push(t,r,n)}eachPosition(e,t){const r=Hl(e);let n=0,i=this.ids.length-1;for(;n<i;){const e=n+i>>1;this.ids[e]>=r?i=e:n=e+1}for(;this.ids[n]===r;)t(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(e,t){const r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return ql(r,n,0,r.length-1),t&&(t.add(r.buffer),t.add(n.buffer)),{ids:r,positions:n}}static deserialize(e){const t=new $l;let r;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==r&&t.uniqueIds.push(e),r=e;return t.indexed=!0,t}}function Hl(e){const t=+e;return Number.isSafeInteger(t)?t:Qt(String(e))}function ql(e,t,r,n){for(;r<n;){const i=e[r+n>>1];let o=r-1,a=n+1;for(;;){do{o++}while(e[o]<i);do{a--}while(e[a]>i);if(o>=a)break;Wl(e,o,a),Wl(t,3*o,3*a),Wl(t,3*o+1,3*a+1),Wl(t,3*o+2,3*a+2)}a-r<n-a?(ql(e,t,r,a),r=a+1):(ql(e,t,a+1,n),n=a)}}function Wl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}ea($l,"FeaturePositionMap");class Zl{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,r){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Yl extends Zl{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}}class Xl extends Zl{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class Kl extends Zl{constructor(e){super(e),this.current=[0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])))}}class Jl extends Zl{constructor(e){super(e),this.current=[0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2])))}}class Ql extends Zl{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class ec extends Zl{constructor(e){super(e),this.current=cr.transparent.toPremultipliedRenderColor(null)}set(e,t,r){this.fetchUniformLocation(e,t)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const tc=new Float32Array(16);class rc extends Zl{constructor(e){super(e),this.current=tc}set(e,t,r){if(this.fetchUniformLocation(e,t)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}}const nc=new Float32Array(9),ic=new Float32Array(4);class oc extends Zl{constructor(e){super(e),this.current=ic}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}}function ac(e){return[jl(255*e.r,255*e.g),jl(255*e.b,255*e.a)]}function sc(e,t,r,n,i,o,a,s){return!!e&&("composite"===e.kind||"source"===e.kind?"none"===e.evaluate(new Ja(0,{brightness:o,worldview:s}),t,r,i,n,a):"none"===e.value)}class lc{constructor(e,t,r,n){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r,this.context=n}setUniform(e,t,r,n,i){const o=n.constantOr(this.value);t.set(e,i,o instanceof cr?o.toPremultipliedRenderColor(this.lutExpression&&"constant"===this.lutExpression.kind&&"none"===this.lutExpression.value?null:this.context.lut):o)}getBinding(e,t){return"color"===this.type?new ec(e):new Xl(e)}}class cc{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(e,t){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br),this.patternTransition=t?t.tl.concat(t.br):this.pattern}setUniform(e,t,r,n,i){let o=null;"u_pattern"!==i&&"u_dash"!==i||(o=this.pattern),"u_pattern_b"===i&&(o=this.patternTransition),"u_pixel_ratio"===i&&(o=this.pixelRatio),o&&t.set(e,i,o)}getBinding(e,t){return"u_pattern"===t||"u_pattern_b"===t||"u_dash"===t?new Ql(e):new Xl(e)}}class uc{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,r,n,i,o,a,s){const l=this.paintVertexArray.length,c="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new Ja(0,{brightness:o,worldview:s}),t,{},i,n,a):"constant"===this.expression.kind&&this.expression.value,u=sc(this.lutExpression,t,{},n,i,o,a,s);this.paintVertexArray.resize(e),this._setPaintValue(l,e,c,u?null:this.context.lut)}updatePaintArray(e,t,r,n,i,o,a,s){const l="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:a,worldview:s},r,n,void 0,i):"constant"===this.expression.kind&&this.expression.value,c=sc(this.lutExpression,r,n,i,void 0,a,void 0,s);this._setPaintValue(e,t,l,c?null:this.context.lut)}_setPaintValue(e,t,r,n){if("color"===this.type){const i=ac(r.toPremultipliedRenderColor(n));for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.lutExpression&&"constant"!==this.lutExpression.kind&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||"constant"!==this.expression.kind&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class dc{constructor(e,t,r,n,i,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.context=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,r,n,i,o,a,s){const l=this.expression.evaluate(new Ja(this.context.zoom,{brightness:o,worldview:s}),t,{},i,n,a),c=this.expression.evaluate(new Ja(this.context.zoom+1,{brightness:o,worldview:s}),t,{},i,n,a),u=sc(this.lutExpression,t,{},n,i,o,a,s),d=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(d,e,l,c,u?null:this.context.lut)}updatePaintArray(e,t,r,n,i,o,a,s){const l=this.expression.evaluate({zoom:this.context.zoom,brightness:a,worldview:s},r,n,void 0,i),c=this.expression.evaluate({zoom:this.context.zoom+1,brightness:a,worldview:s},r,n,void 0,i),u=sc(this.lutExpression,r,n,i,void 0,a,void 0,s);this._setPaintValue(e,t,l,c,u?null:this.context.lut)}_setPaintValue(e,t,r,n,i){if("color"===this.type){const o=ac(r.toPremultipliedRenderColor(i)),a=ac(n.toPremultipliedRenderColor(i));for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,o[0],o[1],a[0],a[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,r,n,i){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,a=De(this.expression.interpolationFactor(o,this.context.zoom,this.context.zoom+1),0,1);t.set(e,i,a)}getBinding(e,t){return new Xl(e)}}class hc{constructor(e,t,r,n,i){this.expression=e,this.layerId=i,this.paintVertexAttributes=("array"===r?Ul:Vl).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new n,this.paintTransitionVertexArray=new Ks}populatePaintArray(e,t,r,n){const i=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,n,i,o,a){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],o)}_setPaintValues(e,t,r,n){if(!n||!r)return;const i=n[r[0]],o=n[r[1]];if(i){if(i){const{tl:r,br:n,pixelRatio:o}=i;for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r[0],r[1],n[0],n[1],o)}if(o){this.paintTransitionVertexArray.resize(this.paintVertexArray.length);const{tl:r,br:n}=o;for(let i=e;i<t;i++)this.paintTransitionVertexArray.emplace(i,r[0],r[1],n[0],n[1])}}}upload(e){const t=this.expression.isStateDependent||!this.expression.isLightConstant;this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,t)),this.paintTransitionVertexArray&&this.paintTransitionVertexArray.length&&(this.paintTransitionVertexBuffer=e.createVertexBuffer(this.paintTransitionVertexArray,Gl.members,t))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy(),this.paintTransitionVertexBuffer&&this.paintTransitionVertexBuffer.destroy()}}class fc{constructor(e,t,r=()=>!0){this.binders={},this._buffers=[],this.context=t;const n=[];for(const i in e.paint._values){const o=e.paint.get(i);if(i.endsWith("-use-theme"))continue;if(!r(i))continue;if(!(o instanceof os&&Po(o.property.specification)))continue;const a=mc(i,e.type),s=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===i||i.endsWith("pattern"),d=e.paint.get(`${i}-use-theme`),h="line-dasharray"===i&&"constant"!==e.layout.get("line-cap").value.kind||d&&"constant"!==d.value.kind;if("constant"!==s.kind||h)if("source"===s.kind||h||u){const t=vc(i,l,"source");this.binders[i]=u?new hc(s,a,l,t,e.id):new uc(s,a,l,t),n.push(`/a_${i}`)}else{const e=vc(i,l,"composite");this.binders[i]=new dc(s,a,l,c,t,e),n.push(`/z_${i}`)}else this.binders[i]=u?new cc(s.value,a):new lc(s.value,a,l,t),n.push(`/u_${i}`);d&&(this.binders[i].lutExpression=d.value)}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof uc||t instanceof dc?t.maxValue:0}populatePaintArrays(e,t,r,n,i,o,a,s){for(const l in this.binders){const c=this.binders[l];c.context=this.context,(c instanceof uc||c instanceof dc||c instanceof hc)&&c.populatePaintArray(e,t,r,n,i,o,a,s)}}setConstantPatternPositions(e,t){for(const r in this.binders){const n=this.binders[r];n instanceof cc&&n.setConstantPatternPositions(e,t)}}getPatternTransitionVertexBuffer(e){const t=this.binders[e];return t instanceof hc?t.paintTransitionVertexBuffer:null}updatePaintArrays(e,t,r,n,i,o,a,s,l,c){let u=!1;const d=Object.keys(e),h=0!==d.length&&!s,f=h?d:t.uniqueIds;this.context.lut=i.lut;for(const s in this.binders){const d=this.binders[s];if(d.context=this.context,(d instanceof uc||d instanceof dc||d instanceof hc)&&d.expression&&d.expression.kind&&"constant"!==d.expression.kind&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=i.paint.get(s);d.expression=p.value;for(const r of f){const i=e[r.toString()];t.eachPosition(r,((e,t,r)=>{const s=n.feature(e);d.updatePaintArray(t,r,s,i,o,a,l,c)}))}if(!h)for(const t of r.uniqueIds){const i=e[t.toString()];r.eachPosition(t,((e,t,r)=>{const s=n.feature(e);d.updatePaintArray(t,r,s,i,o,a,l,c)}))}u=!0}}return u}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof lc||r instanceof cc)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof lc||n instanceof cc||n instanceof dc)for(const i of n.uniformNames)t.push({name:i,property:r,binding:n.getBinding(e,i)})}return t}setUniforms(e,t,r,n,i){for(const{name:t,property:o,binding:a}of r)this.binders[o].setUniform(e,a,i,n.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof uc||t instanceof dc||t instanceof hc)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer),t instanceof hc&&t.paintTransitionVertexBuffer&&this._buffers.push(t.paintTransitionVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof uc||r instanceof dc||r instanceof hc)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof uc||t instanceof dc||t instanceof hc)&&t.destroy()}}}class pc{constructor(e,t,r=()=>!0){this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new fc(n,t,r);this.needsUpload=!1,this._featureMap=new $l,this._featureMapWithoutIds=new $l,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,r,n,i,o,a,s,l){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,n,i,o,a,s,l);void 0!==t.id?this._featureMap.add(t.id,r,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,r,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n,i,o,a,s){for(const l of r)this.needsUpload=this.programConfigurations[l.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,l,n,i,o,a||0,s)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const gc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"symbol-z-offset":["z_offset"],"line-gap-width":["ga
1pwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"],"fill-bridge-guard-rail-color":["structure_color"],"fill-tunnel-structure-color":["structure_color"]};function mc(e,t){return gc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const yc={"line-pattern":{source:Xs,composite:Xs},"fill-pattern":{source:Xs,composite:Xs},"fill-extrusion-pattern":{source:Xs,composite:Xs},"line-dasharray":{source:Ks,composite:Ks}},_c={color:{source:ml,composite:tl},number:{source:$s,composite:ml}};function vc(e,t,r){const n=yc[e];return n&&n[r]||_c[t][r]}ea(lc,"ConstantBinder"),ea(cc,"PatternConstantBinder"),ea(uc,"SourceExpressionBinder"),ea(hc,"PatternCompositeBinder"),ea(dc,"CompositeExpressionBinder"),ea(fc,"ProgramConfiguration",{omit:["_buffers"]}),ea(pc,"ProgramConfigurationSet");const bc=Gn/Math.PI/2,xc=64,wc=[xc,32,16],Sc=-bc,kc=bc;function Tc(e,t,r,n=bc){return r=Pe(r),[e*Math.sin(r)*n,-t*n,e*Math.cos(r)*n]}function Ic(e,t,r){return Tc(Math.cos(Pe(e)),Math.sin(Pe(e)),t,r)}const Mc=6371008.8,Ec=2*Math.PI*Mc;class Pc{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Pc(Fe(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return Mc*Math.acos(Math.min(i,1))}toBounds(e=0){const t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Ac({lng:this.lng-r,lat:this.lat-t},{lng:this.lng+r,lat:this.lat+t})}toEcef(e){return Ic(this.lat,this.lng,bc+e*bc/Mc)}static convert(e){if(e instanceof Pc)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Pc(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Pc(Number("lng"in e?e.lng:e.lon),Number(e.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 Ac{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Pc?new Pc(e.lng,e.lat):Pc.convert(e),this}setSouthWest(e){return this._sw=e instanceof Pc?new Pc(e.lng,e.lat):Pc.convert(e),this}extend(e){const t=this._sw,r=this._ne;let n,i;if(e instanceof Pc)n=e,i=e;else{if(!(e instanceof Ac))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Ac.convert(e)):this.extend(Pc.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(Pc.convert(e)):this;if(n=e._sw,i=e._ne,!n||!i)return this}return t||r?(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),r.lng=Math.max(i.lng,r.lng),r.lat=Math.max(i.lat,r.lat)):(this._sw=new Pc(n.lng,n.lat),this._ne=new Pc(i.lng,i.lat)),this}getCenter(){return new Pc((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 Pc(this.getWest(),this.getNorth())}getSouthEast(){return new Pc(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:r}=Pc.convert(e);let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(e){if(e)return e instanceof Ac?e:new Ac(e)}}function Cc(e){return Ec*Math.cos(e*Math.PI/180)}function Rc(e){return(180+e)/360}function Lc(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Oc(e,t){return e/Cc(t)}function Dc(e){return 360*e-180}function zc(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180)
vendor: 4,189 bytes, line 1
1)-90}function Fc(e,t){return e*Cc(zc(t))}const Nc=85.051129;function Bc(e){return Math.cos(Pe(De(e,-85.051129,Nc)))}function jc(e,t){const r=De(t,0,25.5),n=Math.pow(2,r);return Bc(e)*Ec/(512*n)}function Vc(e){return 1/Math.cos(e*Math.PI/180)}function Gc(e,t=0){const r=Math.exp(Math.PI*(1-(e.y+t/Gn)/(1<<e.z)*2));return 80150034*r/(r*r+1)/Gn/(1<<e.z)}class Uc{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){const r=Pc.convert(e);return new Uc(Rc(r.lng),Lc(r.lat),Oc(t,r.lat))}toLngLat(){return new Pc(Dc(this.x),zc(this.y))}toAltitude(){return Fc(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Ec*Vc(zc(this.y))}}function $c(e,t,r,n,i,o,a,s,l){const c=(t+n)/2,u=(r+i)/2,d=new Te(c,u);s(d),function(e,t,r,n,i,o){const a=r-i,s=n-o;return Math.abs((n-t)*a-(r-e)*s)/Math.hypot(a,s)}(d.x,d.y,o.x,o.y,a.x,a.y)>=l?($c(e,t,r,c,u,o,d,s,l),$c(e,c,u,n,i,d,a,s,l)):e.push(a)}function Hc(e,t,r){let n=e[0],i=n.x,o=n.y;t(n);const a=[n];for(let s=1;s<e.length;s++){const l=e[s],{x:c,y:u}=l;t(l),$c(a,i,o,c,u,n,l,t,r),i=c,o=u,n=l}return a}function qc(e,t,r,n){if(n(t,r)){const i=t.add(r)._mult(.5);qc(e,t,i,n),qc(e,i,r,n)}else e.push(r)}function Wc(e,t){let r=e[0];const n=[r];for(let i=1;i<e.length;i++){const o=e[i];qc(n,r,o,t),r=o}return n}const Zc=Math.pow(2,14)-1,Yc=-Zc-1;function Xc(e,t){const r=Math.round(e.x*t),n=Math.round(e.y*t);return e.x=De(r,Yc,Zc),e.y=De(n,Yc,Zc),(r<e.x||r>e.x+1||n<e.y||n>e.y+1)&&Ze("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function Kc(e,t,r){const n=e.loadGeometry(),i=e.extent,o=Gn/i;if(t&&r&&r.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:a,x:s,y:l,projection:c}=r,u=e=>{const r=Dc((t.x+e.x/i)/o),n=zc((t.y+e.y/i)/o),u=c.project(r,n);e.x=(u.x*a-s)*i,e.y=(u.y*a-l)*i};for(let t=0;t<n.length;t++)if(1!==e.type)n[t]=Hc(n[t],u,1);else{const e=[];for(const r of n[t])r.x<0||r.x>=i||r.y<0||r.y>=i||(u(r),e.push(r));n[t]=e}}for(const e of n)for(const t of e)Xc(t,o);return n}function Jc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Kc(e):[]}}class Qc{constructor(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(eu,this,t)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos,r=[];let n,i=1,o=0,a=0,s=0;for(;e.pos<t;){if(o<=0){const t=e.readVarint();i=7&t,o=t>>3}if(o--,1===i||2===i)a+=e.readSVarint(),s+=e.readSVarint(),1===i&&(n&&r.push(n),n=[]),n&&n.push(new Te(a,s));else{if(7!==i)throw new Error(`unknown command ${i}`);n&&n.push(n[0].clone())}}return n&&r.push(n),r}bbox(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let r=1,n=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;for(;e.pos<t;){if(n<=0){const t=e.readVarint();r=7&t,n=t>>3}if(n--,1===r||2===r)i+=e.readSVarint(),o+=e.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<l&&(l=o),o>c&&(c=o);else if(7!==r)throw new Error(`unknown command ${r}`)}return[a,l,s,c]}toGeoJSON(e,t,r){const n=this.extent*Math.pow(2,r),i=this.extent*e,o=this.extent*t,a=this.loadGeometry();function s(e){return[360*(e.x+i)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+o)/n)*Math.PI))-90]}function l(e){return e.map(s)}let c;if(1===this.type){const e=[];for(const t of a)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=a.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const r=[];let n,i;for(let o=0;o<t;o++){const t=tu(e[o]);0!==t&&(void 0===i&&(i=t<0),i===t<0?(n&&r.push(n),n=[e[o]]):n&&n.push(e[o]))}return n&&r.push(n),r}(a),t=[];for(const r of e)t.push(r.map(l));c=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}const u={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(u.id=this.id),u}}function eu(e,t,r){1===e?t.id=r.readVarint():2===e?function(e,t){const r=e.readVarint()+e.pos;for(;e.pos<r;){const r=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[r]=n}}
1(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos)}function tu(e){let t=0;for(let r,n,i=0,o=e.length,a=o-1;i<o;a=i++)r=e[i],n=e[a],t+=(n.x-r.x)*(r.y+n.y);return t}Qc.types=["Unknown","Point","LineString","Polygon"];class ru{constructor(e,t){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(nu,this,t),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new Qc(this._pbf,t,this.extent,this._keys,this._values)}}function nu(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){let t=null;const r=e.readVarint()+e.pos;for(;e.pos<r;){const r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}if(null==t)throw new Error("unknown feature value");return t}(r))}class iu{constructor(e,t){this.layers=e.readFields(ou,{},t)}}function ou(e,t,r){if(3===e){const e=new ru(r,r.readVarint()+r.pos);e.length&&(t[e.name]=e)}}const au="3d_elevation_id",su="level";class lu{constructor(){this._valid=!1}reset(e){return this.feature=e,this._valid=!0,this._geometry=e.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=!1),this}geometry(e,t){return this._valid&&e(t(this._geometry)),this}require(e,t,r){return this.get(e,!0,t,r)}optional(e,t,r){return this.get(e,!1,t,r)}success(){return this._valid}get(e,t,r,n){const i=this.feature.properties.hasOwnProperty(e)?+this.feature.properties[e]:void 0;return this._valid&&void 0!==i&&!Number.isNaN(i)?r(n?n(i):i):t&&(this._valid=!1),this}}class cu{constructor(e,t){this.featureFunc=e,this.vertexFunc=t}parseFeature(e,t,r){return this.featureFunc(e,t,r)}parseVertex(e,t,r){return this.vertexFunc(e,t,r)}}const uu=new cu(((e,t,r)=>e.reset(t).require(au,(e=>{r.id=e})).optional("fixed_height_relative",(e=>{r.constantHeight=e}),hu.decodeRelativeHeight).geometry((e=>{r.bounds=e}),bn).success()),((e,t,r)=>e.reset(t).require(au,(e=>{r.id=e})).require("elevation_idx",(e=>{r.idx=e})).require("extent",(e=>{r.extent=e})).require("height_relative",(e=>{r.height=e}),hu.decodeRelativeHeight).geometry((e=>{r.position=e}),hu.getPoint).success())),du=new cu(((e,t,r)=>e.reset(t).require(au,(e=>{r.id=e})).optional("fixed_height",(e=>{r.constantHeight=e}),hu.decodeMetricHeight).geometry((e=>{r.bounds=e}),bn).success()),((e,t,r)=>e.reset(t).require(au,(e=>{r.id=e})).require("elevation_idx",(e=>{r.idx=e})).require("extent",(e=>{r.extent=e})).require("height",(e=>{r.height=e}),hu.decodeMetricHeight).geometry((e=>{r.position=e}),hu.getPoint).success()));class hu{static getPoint(e){return de(e[0][0].x,e[0][0].y)}static decodeRelativeHeight(e){return 1e-4*e*5}static decodeMetricHeight(e){return 1e-4*e}static getVersionSchema(e){return e?"1.0.1"===e?du:void 0:uu}static parse(e){const t=[],r=[],n=e.length,i=new lu;for(let o=0;o<n;o++){const n=e.feature(o),a=n.properties.version,s=hu.getVersionSchema(a);if(void 0===s){Ze(`Unknown elevation feature version number ${a||"(unknown)"}`);continue}const l=n.properties.type;if(!l)continue;const c=Qc.types[n.type];if("Point"===c&&"curve_point"===l){const e={};s.parseVertex(i,n,e)&&t.push(e)}else if("Polygon"===c&&"curve_meta"===l){const e={};s.parseFeature(i,n,e)&&r.push(e)}}return{vertices:t,features:r}}}class fu{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,r){const n=_e(t,this.dir);if(Math.abs(n)<1e-6)return!1;const i=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1])/n;return r[0]=this.pos[0]+this.dir[0]*i,r[1]=this.pos[1]+this.dir[1]*i,!0}}class pu{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,r){const n=B(t,this.dir);if(Math.abs(n)<1e-6)return!1;const i=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/n;return r[0]=this.pos[0]+this.dir[0]*i,r[1]=this.pos[1]+this.dir[1]*i,r[2]=this.pos[2]+this.dir[2]*i,!0}closestPointOnSphere(e,r,n){if(function(e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2];
1return Math.abs(n-a)<=t*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=t*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-l)<=t*Math.max(1,Math.abs(o),Math.abs(l))}(this.pos,e)||0===r)return n[0]=n[1]=n[2]=0,!1;const[i,o,a]=this.dir,s=this.pos[0]-e[0],l=this.pos[1]-e[1],c=this.pos[2]-e[2],u=i*i+o*o+a*a,d=2*(s*i+l*o+c*a),h=d*d-4*u*(s*s+l*l+c*c-r*r);if(h<0){const e=Math.max(-d/2,0),t=s+i*e,u=l+o*e,h=c+a*e,f=Math.hypot(t,u,h);return n[0]=t*r/f,n[1]=u*r/f,n[2]=h*r/f,!1}{const e=(-d-Math.sqrt(h))/(2*u);if(e<0){const e=Math.hypot(s,l,c);return n[0]=s*r/e,n[1]=l*r/e,n[2]=c*r/e,!1}return n[0]=s+i*e,n[1]=l+o*e,n[2]=c+a*e,!0}}}class gu{constructor(e,t,r,n,i){this.TL=e,this.TR=t,this.BR=r,this.BL=n,this.horizon=i}static fromInvProjectionMatrix(e,t,r){const n=[-1,1,1],i=[1,1,1],o=[1,-1,1],a=[-1,-1,1],s=G(n,n,e),l=G(i,i,e),c=G(o,o,e),u=G(a,a,e);return new gu(s,l,c,u,t/r)}}function mu(e,t,r){let n=1/0,i=-1/0;const o=[];for(const a of e){W(o,a,t);const e=B(o,r);n=Math.min(n,e),i=Math.max(i,e)}return[n,i]}function yu(e,t){let r=!0;for(let n=0;n<e.planes.length;n++){const i=e.planes[n];let o=0;for(let e=0;e<t.length;e++)o+=+(B(i,t[e])+i[3]>=0);if(0===o)return 0;o!==t.length&&(r=!1)}return r?2:1}function _u(e,t){for(const r of e.projections){const n=mu(t,e.points[0],r.axis);if(r.projection[1]<n[0]||r.projection[0]>n[1])return 0}return 1}function vu(e,t){let r=0;const n=[0,0,0,0];for(let i=0;i<e.length;i++)n[0]=e[i][0],n[1]=e[i][1],n[2]=e[i][2],n[3]=1,Q(n,t)>=0&&r++;return r}class bu{constructor(e,t){this.points=e||new Array(8).fill([0,0,0]),this.planes=t||new Array(6).fill([0,0,0,0]),this.bounds=xu.fromPoints(this.points),this.projections=[],this.frustumEdges=[W([],this.points[2],this.points[3]),W([],this.points[0],this.points[3]),W([],this.points[4],this.points[0]),W([],this.points[5],this.points[1]),W([],this.points[6],this.points[2]),W([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],r=[e[2],0,-e[0]];this.projections.push({axis:t,projection:mu(this.points,this.points[0],t)}),this.projections.push({axis:r,projection:mu(this.points,this.points[0],r)})}}static fromInvProjectionMatrix(e,t,r,n){const i=Math.pow(2,r),o=[[-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((r=>{const o=ee([],r,e),a=1/o[3]/t*i;return(s=o)[0]=(l=o)[0]*(c=[a,a,n?1/o[3]:a,a])[0],s[1]=l[1]*c[1],s[2]=l[2]*c[2],s[3]=l[3]*c[3],s;var s,l,c})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=N([],j([],W([],o[e[0]],o[e[1]]),W([],o[e[2]],o[e[1]]))),r=-B(t,o[e[1]]);return t.concat(r)})),s=[];for(let e=0;e<o.length;e++)s.push([o[e][0],o[e][1],o[e][2]]);return new bu(s,a)}intersectsPrecise(e,t,r){for(let r=0;r<t.length;r++)if(!vu(e,t[r]))return 0;for(let t=0;t<this.planes.length;t++)if(!vu(e,this.planes[t]))return 0;for(const t of r)for(const r of this.frustumEdges){const n=j([],t,r),i=k(n);if(0===i)continue;R(n,n,1/i);const o=mu(this.points,this.points[0],n),a=mu(e,this.points[0],n);if(o[0]>a[1]||a[0]>o[1])return 0}return 1}containsPoint(e){for(const t of this.planes){const r=t[3];
vendor: 6,270 bytes, line 1
1if(B([t[0],t[1],t[2]],e)+r<0)return!1}return!0}}class xu{static fromPoints(e){const t=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(const n of e)A(t,t,n),C(r,r,n);return new xu(t,r)}static fromTileIdAndHeight(e,t,r){const n=1<<e.canonical.z,i=e.canonical.x,o=e.canonical.y;return new xu([i/n,o/n,t],[(i+1)/n,(o+1)/n,r])}static applyTransform(e,t){const r=e.getCorners();for(let e=0;e<r.length;++e)G(r[e],r[e],t);return xu.fromPoints(r)}static applyTransformFast(e,t){const r=[t[12],t[13],t[14]],n=[...r];for(let i=0;i<3;i++)for(let o=0;o<3;o++){const a=t[4*o+i],s=a*e.min[o],l=a*e.max[o];r[i]+=Math.min(s,l),n[i]+=Math.max(s,l)}return new xu(r,n)}static projectAabbCorners(e,t){const r=e.getCorners();for(let e=0;e<r.length;++e)G(r[e],r[e],t);return r}constructor(e,t){this.min=e,this.max=t,this.center=R([],M([],this.min,this.max),.5)}quadrant(e){const t=[e%2==0,e<2],r=S(this.min),n=S(this.max);for(let e=0;e<t.length;e++)r[e]=t[e]?this.min[e]:this.center[e],n[e]=t[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new xu(r,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?yu(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?yu(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?_u(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?_u(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}ea(xu,"Aabb");class wu{constructor(e,t){this.feature=e,this.metersToTile=t,this.index=0}get(){const e=this.feature.vertices[this.index],t=this.feature.vertexProps[this.index].dir,r=t[1],n=-t[0],i=(e.extent+1)*this.metersToTile;return[new Te(Math.trunc(e.position[0]+r*i),Math.trunc(e.position[1]+n*i)),new Te(Math.trunc(e.position[0]-r*i),Math.trunc(e.position[1]-n*i))]}next(){this.index++}valid(){return this.index<this.feature.vertices.length}}class Su{constructor(e,t,r,n,i,o){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this._tmpVec2=[ue(),ue(),ue(),ue(),ue(),ue(),ue()],this.id=e,this.heightRange={min:r,max:r},this.safeArea=t,this.constantHeight=r,null==this.constantHeight&&(null!=this.constantHeight||0!==n.length)){this.vertices=n,this.edges=i,this.edges=this.edges.filter((e=>{return e.a<this.vertices.length&&e.b<this.vertices.length&&!((t=this.vertices[e.a].position)[0]===(r=this.vertices[e.b].position)[0]&&t[1]===r[1]);var t,r})),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const e of this.vertices)this.vertexProps.push({dir:de(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,e.height),this.heightRange.max=Math.max(this.heightRange.max,e.height);for(const e of this.edges){const t=this.vertices[e.a].position,r=this.vertices[e.b].position,n=pe(ue(),r,t),i=me(n),o=ge(ue(),n,1/i);this.edgeProps.push({vec:n,dir:o,len:i});const a=this.vertexProps[e.a].dir,s=this.vertexProps[e.b].dir;fe(a,a,o),fe(s,s,o)}for(const e of this.vertexProps)0===e.dir[0]&&0===e.dir[1]||ye(e.dir,e.dir);this.tessellate(o)}}pointElevation(e){if(null!=this.constantHeight)return this.constantHeight;const t=this.getClosestEdge(e);if(null==t)return 0;const[r,n]=t;return fr(this.vertices[this.edges[r].a].height,this.vertices[this.edges[r].b].height,n)}computeSlopeNormal(e,t){const r=this.getClosestEdge(e);if(!r)return T(0,0,1);const n=r[0],i=this.edges[n],o=this.edgeProps[n].vec,a=T(o[0],o[1],(this.vertices[i.b].height-this.vertices[i.a].height)*t),s=T(a[1],-a[0],0);j(s,s,a);const l=k(s);return l>0?R(s,s,1/l):I(s,0,0,1)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(e){if(0===this.edges.length)return;let t=0,r=Number.POSITIVE_INFINITY,n=0;const[i,o,a,s,l,c,u]=this._tmpVec2;he(u,e.x,e.y);const d=new fu(u,null);for(let e=0;e<this.edges.length;e++){const h=this.edges[e],f=this.edgeProps[e].dir;d.dir=f;const p=this.vertices[h.a].position,g=this.vertices[h.b].position,m=d.intersectsPlane(p,this.vertexProps[h.a].dir,i),y=d.intersectsPlane(g,this.vertexProps[h.b].dir,o);if(!m||!y)continue;pe(a,o,i),pe(s,u,i);const _=_e(a,a),v=_>0?_e(s,a)/_:0,b=De(v,0,1),x=Math.abs((v-b)*this.edgeProps[e].len);pe(l,u,p),he(c,f[1],-f[0]);const w=x+Math.abs(_e(l,c));w<r&&(t=e,r=w,n=b)}return[t,n]}tessellate(e){const t=w(),r=w(),n=w(),i=w();for(let o=this.edges.length-1;o>=0;--o){const a=this.edges[o].a,s=this.edges[o].b,{position:l,height:c,extent:u}=this.vertices[a],{position:d,height:h,extent:f}=this.vertices[s],p=this.vertexProps[a].dir,g=this.vertexProps[s].dir;if(I(t,l[0]/e,l[1]/e,c),I(r,d[0]/e,d[1]/e,h),I(n,p[1],-p[0],0),R(n,n,u),I(i,g[1],-g[0],0),R(i,i,f),this.distSqLines(T(t[0]+.5*n[0],t[1]+.5*n[1],t[2]+.5*n[2]),T(r[0]-.5*i[0],r[1]-.5*i[1],r[2]-.5*i[2]),T(t[0]-.5*n[0],t[1]-.5*n[1],t[2]-.5*n[2]),T(r[0]+.5*i[0],r[1]+.5*i[1],r[2]+.5*i[2]))<=.0025000000000000005)continue;const m=this.vertices.length,y=fe(ue(),l,d);this.vertices.push({position:ge(y,y,.5),height:.5*(c+h),extent:.5*(u+f)});const _=fe(ue(),p,g);this.vertexProps.push({dir:ye(_,_)}),this.edges.splice(o,1),this.edgeProps.splice(o,1),this.edges.push({a,b:m}),this.edges.push({a:m,b:s}
1);const v=pe(ue(),this.vertices[m].position,l),b=me(v),x={vec:v,dir:ge(ue(),v,1/b),len:b};this.edgeProps.push(x),this.edgeProps.push(x)}}distSqLines(e,t,r,n){const i=E(w(),t,e),o=E(w(),n,r),a=E(w(),e,r),s=B(i,i),l=B(i,o),c=B(i,a),u=B(o,o),d=B(o,a),h=s*u-l*l;if(0===h)return D(V(i,r,n,B(a,o)/B(o,o)),e);const f=(s*d-l*c)/h;return D(V(i,e,t,(l*d-c*u)/h),V(o,r,n,f))}}class ku{static parseFrom(e,t){const r=hu.parse(e);if(!r)return[];let{vertices:n,features:i}=r;const o=1/Gc(t);i.sort(((e,t)=>e.id-t.id)),n.sort(((e,t)=>e.id-t.id||e.idx-t.idx)),n=n.filter(((e,t,r)=>t===r.findIndex((t=>t.id===e.id&&t.idx===e.idx))));const a=new Array;let s=0;const l=n.length;for(const e of i){if(e.constantHeight){a.push(new Su(e.id,e.bounds,e.constantHeight));continue}for(;s!==l&&n[s].id<e.id;)s++;if(s===l||n[s].id!==e.id)continue;const t=new Array,r=new Array,i=s;for(;s!==l&&n[s].id===e.id;){const e=n[s];if(t.push({position:e.position,height:e.height,extent:e.extent}),s!==i&&n[s-1].idx===e.idx-1){const e=s-i;r.push({a:e-1,b:e})}s++}a.push(new Su(e.id,e.bounds,void 0,t,r,o))}return a}static getElevationFeature(e,t){if(!t)return;const r=+e.properties[au];return Number.isNaN(r)?void 0:t.find((e=>e.id===r))}}class Tu{constructor(e,t){this.zScale=1,this.xOffset=0,this.yOffset=0,e.equals(t)||(this.zScale=Math.pow(2,t.z-e.z),this.xOffset=(e.x*this.zScale-t.x)*Gn,this.yOffset=(e.y*this.zScale-t.y)*Gn)}constantElevation(e,t){if(null!=e.constantHeight)return this.computeBiasedHeight(e.constantHeight,t)}pointElevation(e,t,r){const n=this.constantElevation(t,r);return null!=n?n:(e.x=e.x*this.zScale+this.xOffset,e.y=e.y*this.zScale+this.yOffset,this.computeBiasedHeight(t.pointElevation(e),r))}computeBiasedHeight(e,t){return t<=0?e:e+t*ze(0,t,e>=0?e:Math.abs(.5*e))}}ea(Su,"ElevationFeature");class Iu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Vs,this.indexArray=new ll,this.segments=new Bl,this.programConfigurations=new pc(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.elevationMode=this.layers[0].layout.get("circle-elevation-reference"),this.hasElevation=!1,"none"!==this.elevationMode&&(this.elevatedLayoutVertexArray=new $s),this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,r,n){}populate(e,t,r,n){const i=this.layers[0],o=[];let a=null;"circle"===i.type&&(a=i.layout.get("circle-sort-key"));for(const{feature:i,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Jc(i,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,r))continue;const d=a?a.evaluate(u,{},r):void 0,h={id:s,properties:i.properties,type:i.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Kc(i,r,n),patterns:{},sortKey:d};o.push(h)}a&&o.sort(((e,t)=>
vendor: 6,053 bytes, line 1
1e.sortKey-t.sortKey));let s=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new Js,s=n.projection);for(const n of o){const{geometry:i,index:o,sourceLayerIndex:a}=n,l=e[o].feature;this.addFeature(n,i,o,t.availableImages,r,s,t.brightness,t.elevationFeatures),t.featureIndex.insert(l,i,o,a,this.index)}this.hasElevation||(this.elevatedLayoutVertexArray=void 0)}update(e,t,r,n,i,o,a){this.programConfigurations.updatePaintArrays(e,t,i,r,n,o,a,this.worldview)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zl.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Nl.members)),this.elevatedLayoutVertexArray&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,Fl.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy())}addFeature(e,t,r,n,i,o,a,s){let l;"none"!==this.elevationMode&&(l=ku.getElevationFeature(e,s));for(const r of t)for(const t of r){const r=t.x,n=t.y;if(r<0||r>=Gn||n<0||n>=Gn)continue;if(o){const e=o.projectTilePoint(r,n,i),t=o.upVector(i,r,n);this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t)}const a=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),s=a.vertexLength;if(this.addCircleVertex(r,n,-1,-1),this.addCircleVertex(r,n,1,-1),this.addCircleVertex(r,n,1,1),this.addCircleVertex(r,n,-1,1),"none"!==this.elevationMode){const e=l?l.pointElevation(new Te(r,n)):0;this.hasElevation=this.hasElevation||0!==e;for(let t=0;t<4;t++)this.elevatedLayoutVertexArray.emplaceBack(e)}this.indexArray.emplaceBack(s,s+1,s+2),this.indexArray.emplaceBack(s,s+2,s+3),a.vertexLength+=4,a.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n,i,a,void 0,this.worldview)}addCircleVertex(e,t,r,n){this.layoutVertexArray.emplaceBack(2*e+(r+1)/2,2*t+(n+1)/2)}addGlobeExtVertex(e,t){const r=16384;this.globeExtVertexArray.emplaceBack(e.x,e.y,e.z,t[0]*r,t[1]*r,t[2]*r)}}function Mu(e,t){for(let r=0;r<e.length;r++)if(Nu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Nu(e,t[r]))return!0;return!!Cu(e,t)}function Eu(e,t,r){return!!Nu(e,t)||!!Du(t,e,r)}function Pu(e,t){if(1===e.length)return Fu(t,e[0]);for(let r=0;r<t.length;r++){const n=t[r];for(let t=0;t<n.length;t++)if(Nu(e,n[t]))return!0}for(let r=0;r<e.length;r++)if(Fu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Cu(e,t[r]))return!0;return!1}function Au(e,t,r){if(e.length>1){if(Cu(e,t))return!0;for(let n=0;n<t.length;n++)if(Du(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(Du(e[n],t,r))return!0;return!1}function Cu(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1];for(let e=0;e<t.length-1;e++)if(Ru(n,i,t[e],t[e+1]))return!0}return!1}function Ru(e,t,r,n){return Ye(e,r,n)!==Ye(t,r,n)&&Ye(e,t,r)!==Ye(e,t,n)}function Lu(e,t,r){return(e.x-r.x)*(t.y-r.y)-(e.y-r.y)*(t.x-r.x)}function Ou(e,t,r,n){const i=Lu(e,t,n),o=Lu(e,t,r);if(Math.sign(i)===Math.sign(o))return;const a=Lu(r,n,e),s=a+o-i;return Math.sign(a)!==Math.sign(s)?[a/(a-s),o/(o-i)]:void 0}function Du(e,t,r){const n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let r=1;r<t.length;r++)if(zu(e,t[r-1],t[r])<n)return!0;return!1}function zu(e,t,r){const n=t.distSqr(r);if(0===n)return e.distSqr(t);const i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return e.distSqr(i<0?t:i>1?r:r.sub(t)._mult(i)._add(t))}function Fu(e,t){let r,n,i,o=!1;for(let a=0;a<e.length;a++){r=e[a];for(let e=0,a=r.length-1;e<r.length;a=e++)n=r[e],i=r[a],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function Nu(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){const o=e[n],a=e[i];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Bu(e,t,r,n,i){for(const o of e)if(t<=o.x&&r<=o.y&&n>=o.x&&i>=o.y)return!0;const o=[new Te(t,r),new Te(t,i),new Te(n,i),new Te(n,r)];if(e.length>2)for(const t of o)if(Nu(e,t))return!0;for(let t=0;t<e.length-1;t++)if(ju(e[t],e[t+1],o))return!0;return!1}function ju(e,t,r){const n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;const o=Ye(e,t,r[0]);return o!==Ye(e,t,r[1])||o!==Ye(e,t,r[2])||o!==Ye(e,t,r[3])}function Vu(e,t,r,n,i,o){let a=t.y-e.y,s=e.x-t.x;if(o=o||0){const e=a*a+s*s;if(0===e)return!0;const t=Math.sqrt(e);a/=t,s/=t}return!((r.x-e.x)*a+(r.y-e.y)*s-o<0||(n.x-e.x)*a+(n.y-e.y)*s-o<0||(i.x-e.x)*a+(i.y-e.y)*s-o<0)}function Gu(e,t,r,n,i,o,a){return!(Vu(e,t,n,i,o,a)||Vu(t,r,n,i,o,a)||Vu(r,e,n,i,o,a)||Vu(n,i,e,t,r,a)||Vu(i,o,e,t,r,a)||Vu(o,n,e,t,r,a))}function Uu(e,t,r){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function $u(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Hu(e,t,r,n,i){if(!t[0]&&!t[1])return e;const o=Te.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);const a=[];for(let t=0;t<e.length;t++)a.push(e[t].sub(o));return a}function qu(e,t,r,n){const i=Te.convert(e)._mult(n);return"viewport"===t&&i._rotate(-r),i}let Wu,Zu;function Yu(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}ea(Iu,"CircleBucket",{omit:["layers"]});class Xu{constructor(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Qu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}isChildOf(e){const t=this.z-e.z;return 0===e.z||e.z<this.z&&e.x===this.x>>t&&e.y===this.y>>t}url(e,t){const r=function(e,t,r){var n=Yu(256*e,256*(t=Math.pow(2,r)-t-1),r),i=Yu
vendor: 5,270 bytes, line 1
1(256*(e+1),256*(t+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(e,t,r){let n,i="";for(let o=e;o>0;o--)n=1<<o-1,i+=(t&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Ku{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Qu(e,t.z,t.z,t.x,t.y)}}class Ju{constructor(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new Xu(r,+n,+i),this.key=0===t&&e===r?this.canonical.key:Qu(t,e,r,n,i)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new Ju(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ju(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return Qu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return Qu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new Ju(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Ju(t,this.wrap,t,r,n),new Ju(t,this.wrap,t,r+1,n),new Ju(t,this.wrap,t,r,n+1),new Ju(t,this.wrap,t,r+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Ju(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Ju(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Ku(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function Qu(e,t,r,n,i){const o=1<<Math.min(r,22);let a=o*(i%o)+n%o;return e&&r<22&&(a+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-r)))),16*(32*a+r)+(t-r)}const ed=[e=>{let t=e.canonical.x-1,r=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,r--),new Ju(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,r=e.wrap;return t===1<<e.canonical.z&&(t=0,r++),new Ju(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>new Ju(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new Ju(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];ea(Xu,"CanonicalTileID"),ea(Ju,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const td=Bs([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:rd}=td,nd=Bs([{name:"a_pos_3",components:3,type:"Int16"}]);var id=Bs([{name:"a_pos",type:"Int16",components:2}]);function od(e){return e*bc/Mc}const ad=[new xu([Sc,Sc,Sc],[kc,kc,kc]),new xu([Sc,Sc,Sc],[0,0,kc]),new xu([0,Sc,Sc],[kc,0,kc]),new xu([Sc,0,Sc],[0,kc,kc]),new xu([0,0,Sc],[kc,kc,kc])];function sd(e,t,r,n=!0){const i=R([],e._camera.position,e.worldSize),o=[t,r,1,1];ee(o,o,e.pixelMatrixInverse),K(o,o,1/o[3]);const a=N([],W([],o,i)),s=e.globeMatrix,l=[s[12],s[13],s[14]],c=W([],l,i),u=k(c),d=N([],c),h=e.worldSize/(2*Math.PI),f=B(d,a),p=Math.asin(h/u);if(p<Math.acos(f)){if(!n)return null;const e=[],t=[];R(e,a,u/f),N(t,W(t,e,c)),N(a,M(a,c,R(a,t,Math.tan(p)*u)))}const g=[];new pu(i,a).closestPointOnSphere(l,h,g);const m=N([],tt(s,0)),y=N([],tt(s,1)),_=N([],tt(s,2)),v=B(m,g),b=B(y,g),x=B(_,g),w=Ae(Math.asin(-b/h));let S=Ae(Math.atan2(v,x));S=e.center.lng+function(e,t){const r=(t-e+180)%360-180;return r<-180?r+360:r}(e.center.lng,S);const T=Rc(S),I=De(Lc(w),0,1);return new Uc(T,I)}class ld{constructor(e,t,r){this.a=W([],e,r),this.b=W([],t,r),this.center=r;const n=N([],this.a),i=N([],this.b);this.angle=Math.acos(B(n,i))}}function cd(e,t){if(0===e.angle)return null;let r;return r=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),r<0||r>1?null:function(e,t,r,n){const i=Math.sin(r);return e*(Math.sin((1-n)*r)/i)+t*(Math.sin(n*r)/i)}(e.a[t],e.b[t],e.angle,De(r,0,1))+e.center[t]}function ud(e){if(e.z<=1)return ad[e.z+2*e.y+e.x];const t=gd(pd(e));return xu.fromPoints(t)}function dd(e,t,r){return R(e,e,1-r),L(e,e,t,r)}function hd(e,t,r){for(const n of e)G(n,n,t),R(n,n,r)}function fd(e,t,r,n){const i=t/e.worldSize,o=e.globeMatrix;if(r.z<=1){const e=ud(r).getCorners();return hd(e,o,i),xu.fromPoints(e)}const a=pd(r,n),s=gd(a,bc+od(e._tileCoverLift));hd(s,o,i);const l=Number.MAX_VALUE,c=[-l,-l,-l],u=[l,l,l];
vendor: 4,463 bytes, line 1
1if(a.contains(e.center)){for(const e of s)A(u,u,e),C(c,c,e);c[2]=0;const t=e.point,r=[t.x*i,t.y*i,0];return A(u,u,r),C(c,c,r),new xu(u,c)}if(e._tileCoverLift>0){for(const e of s)A(u,u,e),C(c,c,e);return new xu(u,c)}const d=[o[12]*i,o[13]*i,o[14]*i],h=a.getCenter(),f=De(e.center.lat,-85.051129,Nc),p=De(h.lat,-85.051129,Nc),g=Rc(e.center.lng),m=Lc(f);let y=g-Rc(h.lng);const _=m-Lc(p);y>.5?y-=1:y<-.5&&(y+=1);let v=0;Math.abs(y)>Math.abs(_)?v=y>=0?1:3:(v=_>=0?0:2,L(d,d,[o[4]*i,o[5]*i,o[6]*i],-Math.sin(Pe(_>=0?a.getSouth():a.getNorth()))*bc));const b=s[v],x=s[(v+1)%4],w=new ld(b,x,d),S=[cd(w,0)||b[0],cd(w,1)||b[1],cd(w,2)||b[2]],k=kd(e.zoom);if(k>0){const n=function({x:e,y:t,z:r},n,i,o,a){const s=1/(1<<r);let l=e*s,c=l+s,u=t*s,d=u+s,h=0;const f=(l+c)/2-o;return f>.5?h=-1:f<-.5&&(h=1),l=((l+h)*n-(o*=n))*i+o,c=((c+h)*n-o)*i+o,u=(u*n-(a*=n))*i+a,d=(d*n-a)*i+a,[[l,d,0],[c,d,0],[c,u,0],[l,u,0]]}(r,t,e._pixelsPerMercatorPixel,g,m);for(let e=0;e<s.length;e++)dd(s[e],n[e],k);const i=M([],n[v],n[(v+1)%4]);R(i,i,.5),dd(S,i,k)}for(const e of s)A(u,u,e),C(c,c,e);return u[2]=Math.min(b[2],x[2]),A(u,u,S),C(c,c,S),new xu(u,c)}function pd({x:e,y:t,z:r},n=!1){const i=1/(1<<r),o=new Pc(Dc(e*i),t===(1<<r)-1&&n?-90:zc((t+1)*i)),a=new Pc(Dc((e+1)*i),0===t&&n?90:zc(t*i));return new Ac(o,a)}function gd(e,t=bc){const r=Pe(e.getNorth()),n=Pe(e.getSouth()),i=Math.cos(r),o=Math.cos(n),a=Math.sin(r),s=Math.sin(n),l=e.getWest(),c=e.getEast();return[Tc(o,s,l,t),Tc(o,s,c,t),Tc(i,a,c,t),Tc(i,a,l,t)]}function md(e,t,r,n){const i=1<<r.z,o=(e/Gn+r.x)/i;return Ic(zc((t/Gn+r.y)/i),Dc(o),n)}function yd({min:e,max:t}){return 16383/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const _d=new Float64Array(16);function vd(e){const t=yd(e),r=y(_d,[t,t,t]);return h(r,r,F([],e.min))}function bd(e){const t=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}(_d,e.min),r=1/yd(e);return f(t,t,[r,r,r])}function xd(e){const t=Gn/(2*Math.PI);return e/(2*Math.PI)/t}function wd(e,t){return Gn/(512*Math.pow(2,e))*yd(ud(t))}function Sd(e,t,r,n,i){const o=xd(r),a=[e,t,-r/(2*Math.PI)],s=c(new Float64Array(16));return h(s,s,a),f(s,s,[o,o,o]),p(s,s,Pe(-i)),g(s,s,Pe(-n)),s}function kd(e){return ze(5,6,e)}function Td(e,t){const r=Ic(t.lat,t.lng),n=function(e){const t=Ic(e._center.lat,e._center.lng);let r=j([],T(0,1,0),t);const n=_([],-e.angle,t);r=G(r,r,n),_(n,-e._pitch,r);const i=N([],t);return R(i,i,od(e.cameraToCenterDistance/e.pixelsPerMeter)),G(i,i,n),M([],t,i)}(e);return a=(i=E([],n,r))[0],s=i[1],l=i[2],c=(o=r)[0],u=o[1],d=o[2],f=(h=Math.sqrt((a*a+s*s+l*l)*(c*c+u*u+d*d)))&&B(i,o)/h,Math.acos(Math.min(Math.max(f,-1),1));var i,o,a,s,l,c,u,d,h,f}function Id(e,t){return Td(e,t)>Math.PI/2*1.01}const Md=Pe(85),Ed=Math.cos(Md),Pd=Math.sin(Md),Ad=s(),Cd=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function Rd(e,t,r,n,i,o,a,s,l){if(o&&e.queryGeometry.isAboveHorizon)return!1;o&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,u=r.projection.upVectorScale(c,r.center.lat,r.worldSize).metersToTile;for(const d of t)for(const t of d){const d=t.add(s),h=i&&r.elevation?r.elevation.exaggeration()*i.getElevationAt(d.x,d.y,!0):0,f=r.projection.projectTilePoint(d.x,d.y,c);if(h>0){const e=r.projection.upVector(c,d.x,d.y);f.x+=e[0]*u*h,f.y+=e[1]*u*h,f.z+=e[2]*u*h}const p=o?d:Ld(f.x,f.y,f.z,n),g=o?e.tilespaceRays.map((e=>zd(e,h))):e.queryGeometry.screenGeometry,m=ee([],[f.x,f.y,f.z,1],n);if(!a&&o?l*=m[3]/r.cameraToCenterDistance:a&&!o&&(l*=r.cameraToCenterDistance/m[3]),o){const e=zc((t.y/Gn+c.y)/(1<<c.z));l/=r.projection.pixelsPerMeter(e,1)/Oc(1,e)}if(Eu(g,p,l))return!0}return!1}function Ld(e,t,r,n){const i=ee([],[e,t,r,1],n);return new Te(i[0]/i[3],i[1]/i[3])}const Od=T(0,0,0),Dd=T(0,0,1);function zd(e,t){const r=w();return Od[2]=t,e.intersectsPlane(Od,Dd,r),new Te(r[0],r[1])}class Fd extends Iu{}let Nd,Bd,jd,Vd;function Gd(e,{width:t,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*r*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(t*r*n);return e.width=t,e.height=r,e.data=i,e}function Ud(e,t,r){const{width:n,height:i}=t;n===e.width&&i===e.height||($d(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r,null),e.width=n,e.height=i,e.data=t.data)}
1function $d(e,t,r,n,i,o,a,s){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const l=e.data,c=t.data,u=4===o&&s;for(let s=0;s<i.height;s++){const d=((r.y+s)*e.width+r.x)*o,h=((n.y+s)*t.width+n.x)*o;if(u)for(let e=0;e<i.width;e++){const t=d+e*o+3,r=h+e*o;c[r+0]=255,c[r+1]=255,c[r+2]=255,c[r+3]=l[t]}else if(a)for(let e=0;e<i.width;e++){const t=d+e*o,r=h+e*o,n=new cr(l[t+0]/255,l[t+1]/255,l[t+2]/255,l[t+3]).toNonPremultipliedRenderColor(a).toArray();c[r+0]=n[0],c[r+1]=n[1],c[r+2]=n[2],c[r+3]=n[3]}else for(let e=0;e<i.width*o;e++)c[h+e]=l[d+e]}return t}ea(Fd,"HeatmapBucket",{omit:["layers"]});class Hd{constructor(e,t){Gd(this,e,1,t)}resize(e){Ud(this,new Hd(e),1)}clone(){return new Hd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){$d(e,t,r,n,i,1,null)}}class qd{constructor(e,t){Gd(this,e,4,t)}resize(e){Ud(this,new qd(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new qd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i,o,a){$d(e,t,r,n,i,4,o,a)}}class Wd{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}function Zd(e){const t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new qd({width:r,height:n}),o=(r,n,o)=>{t[e.evaluationKey]=o;const a=e.expression.evaluate(t),s=a?a.toNonPremultipliedRenderColor(null):null;s&&(i.data[r+n+0]=Math.floor(255*s.r),i.data[r+n+1]=Math.floor(255*s.g),i.data[r+n+2]=Math.floor(255*s.b),i.data[r+n+3]=Math.floor(255*s.a))};if(e.clips)for(let t=0,i=0;t<n;++t,i+=4*r)for(let n=0,a=0;n<r;n++,a+=4){const s=n/(r-1),{start:l,end:c}=e.clips[t];o(i,a,l*(1-s)+c*s)}else for(let e=0,t=0;e<r;e++,t+=4)o(0,t,e/(r-1));return i}ea(Hd,"AlphaImage"),ea(qd,"RGBAImage");const Yd=Bs([{name:"a_pos",components:2,type:"Int16"}],4),Xd=Bs([{name:"a_road_z_offset",components:1,type:"Float32"}],4),Kd=Bs([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),Jd=Bs([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);function Qd(e,t,r=2){const n=t&&t.length,i=n?t[0]*r:e.length;let o=eh(e,0,i,r,!0);const a=[];if(!o||o.next===o.prev)return a;let s,l,c;if(n&&(o=function(e,t,r,n){const i=[];for(let r=0,o=t.length;r<o;r++){const a=eh(e,t[r]*n,r<o-1?t[r+1]*n:e.length,n,!1);a===a.next&&(a.steiner=!0),i.push(dh(a))}i.sort(sh);for(let e=0;e<i.length;e++)r=lh(i[e],r);return r}(e,t,o,r)),e.length>80*r){s=e[0],l=e[1];let t=s,n=l;for(let o=r;o<i;o+=r){const r=e[o],i=e[o+1];r<s&&(s=r),i<l&&(l=i),r>t&&(t=r),i>n&&(n=i)}c=Math.max(t-s,n-l),c=0!==c?32767/c:0}return rh(o,a,r,s,l,c,0),a}function eh(e,t,r,n,i){let o;if(i===function(e,t,r,n){let i=0;for(let o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}(e,t,r,n)>0)for(let i=t;i<r;i+=n)o=wh(i/n|0,e[i],e[i+1],o);else for(let i=r-n;i>=t;i-=n)o=wh(i/n|0,e[i],e[i+1],o);return o&&mh(o,o.next)&&(Sh(o),o=o.next),o}function th(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!mh(n,n.next)&&0!==gh(n.prev,n,n.next))n=n.next;else{if(Sh(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function rh(e,t,r,n,i,o,a){if(!e)return;!a&&o&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=uh(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r=1;do{let n,i=e;e=null;let o=null;for(t=0;i;){t++;let a=i,s=0;for(let e=0;e<r&&(s++,a=a.nextZ,a);e++);let l=r;
vendor: 2,243 bytes, line 1
1for(;s>0||l>0&&a;)0!==s&&(0===l||!a||i.z<=a.z)?(n=i,i=i.nextZ,s--):(n=a,a=a.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=a}o.nextZ=null,r*=2}while(t>1)}(i)}(e,n,i,o);let s=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(o?ih(e,n,i,o):nh(e))t.push(l.i,e.i,c.i),Sh(e),e=c.next,s=c.next;else if((e=c)===s){a?1===a?rh(e=oh(th(e),t),t,r,n,i,o,2):2===a&&ah(e,t,r,n,i,o):rh(th(e),t,r,n,i,o,1);break}}}function nh(e){const t=e.prev,r=e,n=e.next;if(gh(t,r,n)>=0)return!1;const i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,c=n.y,u=Math.min(i,o,a),d=Math.min(s,l,c),h=Math.max(i,o,a),f=Math.max(s,l,c);let p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=h&&p.y>=d&&p.y<=f&&fh(i,s,o,l,a,c,p.x,p.y)&&gh(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function ih(e,t,r,n){const i=e.prev,o=e,a=e.next;if(gh(i,o,a)>=0)return!1;const s=i.x,l=o.x,c=a.x,u=i.y,d=o.y,h=a.y,f=Math.min(s,l,c),p=Math.min(u,d,h),g=Math.max(s,l,c),m=Math.max(u,d,h),y=uh(f,p,t,r,n),_=uh(g,m,t,r,n);let v=e.prevZ,b=e.nextZ;for(;v&&v.z>=y&&b&&b.z<=_;){if(v.x>=f&&v.x<=g&&v.y>=p&&v.y<=m&&v!==i&&v!==a&&fh(s,u,l,d,c,h,v.x,v.y)&&gh(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,b.x>=f&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==a&&fh(s,u,l,d,c,h,b.x,b.y)&&gh(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;v&&v.z>=y;){if(v.x>=f&&v.x<=g&&v.y>=p&&v.y<=m&&v!==i&&v!==a&&fh(s,u,l,d,c,h,v.x,v.y)&&gh(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=_;){if(b.x>=f&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==a&&fh(s,u,l,d,c,h,b.x,b.y)&&gh(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function oh(e,t){let r=e;do{const n=r.prev,i=r.next.next;!mh(n,i)&&yh(n,r,r.next,i)&&bh(n,i)&&bh(i,n)&&(t.push(n.i,r.i,i.i),Sh(r),Sh(r.next),r=e=i),r=r.next}while(r!==e);return th(r)}function ah(e,t,r,n,i,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&ph(a,e)){let s=xh(a,e);return a=th(a,a.next),s=th(s,s.next),rh(a,t,r,n,i,o,0),void rh(s,t,r,n,i,o,0)}e=e.next}a=a.next}while(a!==e)}function sh(e,t){let r=e.x-t.x;return 0===r&&(r=e.y-t.y,0===r)&&(r=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),r}function lh(e,t){const r=function(e,t){let r=t;const n=e.x,i=e.y;let o,a=-1/0;if(mh(e,r))return r;do{if(mh(e,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const e=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y
vendor: 1,283 bytes, line 1
1);if(e<=n&&e>a&&(a=e,o=r.x<r.next.x?r:r.next,e===n))return o}r=r.next}while(r!==t);if(!o)return null;const s=o,l=o.x,c=o.y;let u=1/0;r=o;do{if(n>=r.x&&r.x>=l&&n!==r.x&&hh(i<c?n:a,i,l,c,i<c?a:n,i,r.x,r.y)){const t=Math.abs(i-r.y)/(n-r.x);bh(r,e)&&(t<u||t===u&&(r.x>o.x||r.x===o.x&&ch(o,r)))&&(o=r,u=t)}r=r.next}while(r!==s);return o}(e,t);if(!r)return t;const n=xh(r,e);return th(n,n.next),th(r,r.next)}function ch(e,t){return gh(e.prev,e,t.prev)<0&&gh(t.next,e,e.next)<0}function uh(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function dh(e){let t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function hh(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function fh(e,t,r,n,i,o,a,s){return!(e===a&&t===s)&&hh(e,t,r,n,i,o,a,s)}function ph(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&yh(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(bh(e,t)&&bh(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>
1o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(gh(e.prev,e,t.prev)||gh(e,t.prev,t))||mh(e,t)&&gh(e.prev,e,e.next)>0&&gh(t.prev,t,t.next)>0)}function gh(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function mh(e,t){return e.x===t.x&&e.y===t.y}function yh(e,t,r,n){const i=vh(gh(e,t,r)),o=vh(gh(e,t,n)),a=vh(gh(r,n,e)),s=vh(gh(r,n,t));return i!==o&&a!==s||!(0!==i||!_h(e,r,t))||!(0!==o||!_h(e,n,t))||!(0!==a||!_h(r,e,n))||!(0!==s||!_h(r,t,n))}function _h(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function vh(e){return e>0?1:e<0?-1:0}function bh(e,t){return gh(e.prev,e,e.next)<0?gh(e,t,e.next)>=0&&gh(e,e.prev,t)>=0:gh(e,t,e.prev)<0||gh(e,e.next,t)<0}function xh(e,t){const r=kh(e.i,e.x,e.y),n=kh(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function wh(e,t,r,n){const i=kh(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Sh(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function kh(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Th(e,t){const r=e.length;if(r<=1)return[e];const n=[];let i,o;for(let t=0;t<r;t++){const r=Xe(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(i&&n.push(i),i=[e[t]]):i.push(e[t]))}if(i&&n.push(i),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(cn(n[e],t,1,n[e].length-1,Ih),n[e]=n[e].slice(0,t));return n}function Ih(e,t){return t.area-e.area}function Mh(e,t,r=1){if(!e)return null;const n="string"==typeof e?Br.from(e).getPrimary():e.getPrimary(),i="string"==typeof e?null:e.getSecondary();for(const e of[n,i]){if(!e)continue;const n=e.id.toString();t.has(n)||t.set(n,[]),e.scaleSelf(r),t.get(n).push(e)}return{primary:n.toString(),secondary:i?i.toString():null}}function Eh(e,t,r,n){const i=n.patternDependencies;let o=!1;for(const n of t){const t=n.paint.get(`${e}-pattern`);t.isConstant()||(o=!0),Mh(t.constantOr(null),i,r)&&(o=!0)}return o}function Ph(e,t,r,n,i,o){const a=o.patternDependencies;for(const s of t){const t=s.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n},r,{},o.availableImages);e=e&&e.name?e.name:e;const l=Mh(e,a,i);if(!l)continue;const{primary:c,secondary:u}=l;c&&(r.patterns[s.id]=[c,u].filter(Boolean))}}return r}class Ah{constructor(){this.portals=[]}static isOnBorder(e,t){return e<=0&&t<=0||e>=Gn&&t>=Gn}static evaluate(e){if(0===e.length)return new Ah;let t=[];for(const r of e)t.push(...r.portals);if(0===t.length)return new Ah;for(const e of t){const t=e.va,r=e.vb;(Ah.isOnBorder(t.x,r.x)||Ah.isOnBorder(t.y,r.y))&&(e.type="border")}const r=t.filter((e=>"unevaluated"!==e.type)),n=t.filter((e=>"unevaluated"===e.type));if(0===n.length)return new Ah;n.sort(((e,t)=>e.hash===t.hash?e.isTunnel===t.isTunnel?0:e.isTunnel?-1:1:e.hash<t.hash?1:-1)),t=r.concat(n);let i=r.length,o=i,a=i;do{if(o++,o===t.length||t[i].hash!==t[o].hash){if(o-i==2){a<i&&(t[a]=t[i],t[i]=null);const e=t[a],r=t[o-1];e.type=e.isTunnel!==r.isTunnel?"tunnel":"polygon",e.connection={a:e.connection.a,b:r.connection.a},a++}i=o}}while(i!==t.length);return t.splice(a),t.sort(((e,t)=>e.hash<t.hash?1:-1)),{portals:t}}}ea(Ah,"ElevationPortalGraph");class Ch{constructor(e,t,r){this.outPositions=e,this.outNormals=t,this.outIndices=r,this.vertexLookup=new Map}addVertex(e,t,r){let n=e[2];null!=r&&(n*=r);const i=`${e[0]},${e[1]},${e[2]},${t[0]},${t[1]},${t[2]}`,o=this.vertexLookup.get(i);if(null!=o)return o;const a=this.outPositions.length;this.vertexLookup.set(i,a);const s=Math.trunc(16384*t[0]),l=Math.trunc(16384*t[1]),c=Math.trunc(16384*t[2]);return this.outPositions.emplaceBack(e[0],e[1],n),this.outNormals.emplaceBack(s,l,c),a}addTriangle(e,t,r){this.outIndices.emplaceBack(e,t,r)}addTriangles(e,t,r){if(0===e.length)return;const n=1===r.length,i=w(),o=w();for(let a=0;a<e.length;a+=3){const s=t[e[a+0]],l=t[e[a+1]],c=t[e[a+2]],u=n?r[0]:r[e[a+1]],d=n?r[0]:r[e[a+2]];I(i,s.x,s.y,n?r[0]:r[e[a+0]]);const h=this.addVertex(i,o);I(i,l.x,l.y,u);const f=this.addVertex(i,o);I(i,c.x,c.y,d);const p=this.addVertex(i,o);this.outIndices.emplaceBack(h,f,p)}}
vendor: 10,174 bytes, line 1
1addQuad(e,t,r,n,i,o){const a=this.addVertex(e,i,o),s=this.addVertex(t,i,o),l=this.addVertex(r,i,o),c=this.addVertex(n,i,o);this.addTriangle(a,s,l),this.addTriangle(l,c,a)}getVertexCount(){return this.outPositions.length}clearVertexLookup(){this.vertexLookup.clear()}}class Rh{constructor(e,t,r,n){this.unevaluatedPortals=new Ah,this.bridgeFeatureSections=[],this.tunnelFeatureSections=[],this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new Hs,this.vertexNormals=new qs,this.indexArray=new ll,this.tileToMeters=Gc(e),this.bridgeProgramConfigurations=new pc(t,{zoom:r,lut:n},(e=>"fill-tunnel-structure-color"!==e)),this.tunnelProgramConfigurations=new pc(t,{zoom:r,lut:n},(e=>"fill-bridge-guard-rail-color"!==e))}addVertices(e,t){const r=this.unevalVertices.length;for(let r=0;r<e.length;r++)this.unevalVertices.push(e[r]),this.unevalHeights.push(t[r]);return r}addTriangles(e,t,r){const n=r?this.unevalTunnelTriangles:this.unevalTriangles;for(const r of e)n.push(r+t)}addRenderableRing(e,t,r,n,i,o){const a=[new Te(i.min.x,i.min.y),new Te(i.max.x,i.min.y),new Te(i.max.x,i.max.y),new Te(i.min.x,i.max.y)];for(let s=0;s<r-1;s++){const r=t+s,l=r+1,c=this.unevalVertices[r],u=this.unevalVertices[l];if(!(c.x>=i.min.x&&c.x<=i.max.x&&c.y>=i.min.y&&c.y<=i.max.y||u.x>=i.min.x&&u.x<=i.max.x&&u.y>=i.min.y&&u.y<=i.max.y||ju(c,u,a)))continue;if(this.isOnBorder(c.x,u.x)||this.isOnBorder(c.y,u.y))continue;const d=Rh.computeEdgeHash(this.unevalVertices[r],this.unevalVertices[l]);let h,f=this.vertexHashLookup.get(Rh.computePosHash(c));null!=f?h=f.next:(f=this.vertexHashLookup.get(Rh.computePosHash(u)),h=null!=f?f.prev:d),this.unevalEdges.push({polygonIdx:e,a:r,b:l,hash:d,portalHash:h,isTunnel:n,type:"unevaluated",featureInfo:o})}}addPortalCandidates(e,t,r,n,i){if(0!==t.length){this.vertexHashLookup.clear();for(const i of t){if(0===i.length)continue;const t=i[0];let o=Rh.computeEdgeHash(t[t.length-2],t[t.length-1]);for(let i=0;i<t.length-1;i++){const a=t[i+0],s=t[i+1],l=de(s.x-a.x,s.y-a.y),c=me(l);if(0===c)continue;let u="unevaluated";const d=n.pointElevation(a),h=n.pointElevation(s);Math.abs(d)<.01&&Math.abs(h)<.01?u="entrance":(this.isOnBorder(a.x,s.x)||this.isOnBorder(a.y,s.y))&&(u="border");const f=Rh.computeEdgeHash(a,s);this.unevaluatedPortals.portals.push({connection:{a:e,b:void 0},va:a,vb:s,vab:l,length:c,hash:f,isTunnel:r,type:u});const p=Rh.computePosHash(a);this.vertexHashLookup.set(p,{prev:o,next:f}),o=f}}}}construct(e){if(0===this.unevalVertices.length)return;const t=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),r=e=>{e.primitiveLength=this.indexArray.length-e.primitiveOffset},n=new Ch(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(e.portals,this.unevalEdges);const i=t(),o=t(),a=t(),s=(e,t)=>{e.sort(((e,r)=>e.type===t&&r.type!==t?-1:e.type!==t&&r.type===t?1:0));const r=e.findIndex((e=>e.type!==t));return r>=0?r:e.length};let l=0;this.unevalEdges.length>0&&(l=s(this.unevalEdges,"none"),this.constructBridgeStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},this.tileToMeters)),r(a);const c=t(),u=t();if(this.unevalEdges.length>0){const e=this.unevalEdges.splice(l),t=s(e,"tunnel")+l;this.unevalEdges.push(...e),this.constructTunnelStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},{min:l,max:t})}r(c),n.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),r(u),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),r(o),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,[-.1]),r(i),this.maskSegments=Bl.simpleSegment(0,u.primitiveOffset,0,u.primitiveLength),this.depthSegments=Bl.simpleSegment(0,o.primitiveOffset,0,o.primitiveLength),this.renderableBridgeSegments=Bl.simpleSegment(0,a.primitiveOffset,0,a.primitiveLength),this.renderableTunnelSegments=Bl.simpleSegment(0,c.primitiveOffset,0,c.primitiveLength),this.shadowCasterSegments=Bl.simpleSegment(0,i.primitiveOffset,0,i.primitiveLength)}update(e,t,r,n,i,o,a,s){this.bridgeProgramConfigurations.updatePaintArrays(e,t,i,r,n,o,a,s),this.tunnelProgramConfigurations.updatePaintArrays(e,t,i,r,n,o,a,s)}upload(e){this.vertexBuffer||0===this.vertexPositions.length||0===this.vertexNormals.length||0===this.indexArray.length||(this.vertexBuffer=e.createVertexBuffer(this.vertexPositions,Kd.members),this.vertexBufferNormal=e.createVertexBuffer(this.vertexNormals,Jd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.bridgeProgramConfigurations.upload(e),this.tunnelProgramConfigurations.upload(e))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableBridgeSegments.destroy(),this.renderableTunnelSegments.destroy(),this.shadowCasterSegments.destroy()),this.bridgeProgramConfigurations.destroy(),this.tunnelProgramConfigurations.destroy()}populatePaintArrays(e,t,r,n,i){const o=(o,a)=>{for(let s=0;s<a.length-1;s++){const l=a[s].featureIndex,c=a[s+1].vertexStart,u=e.feature(l);o.populatePaintArrays(c,u,l,{},r,t,n,void 0,i)}};o(this.bridgeProgramConfigurations,this.bridgeFeatureSections),o(this.tunnelProgramConfigurations,this.tunnelFeatureSections)}computeVertexConnections(e,t,r,n,i){const o=new Map;for(let a=n;a<i;a++){const n=r[a],i=n.a,s=n.b,l=Rh.computePosHash(e[i]),c=Rh.computePosHash(e[s]);let u=o.get(l);u||(u={},o.set(l,u));let d=o.get(c);d||(d={},o.set(c,d)),t[i]<=0&&t[s]<=0||(u.to=s,d.from=i)}return o}isTerminalVertex(e,t){const r=Rh.computePosHash(this.unevalVertices[e]),n=t.get(r);return!n||!n.from||!n.to}constructBridgeStructures(e,t,r,n,i,o){e.clearVertexLookup();const a=this.computeVertexConnections(t,r,n,i.min,i.max),s=1/o,l=.5*s,c=(e,n)=>I(e,t[n].x,t[n].y,r[n]*s),u=w(),d=w(),h=w(),f=w(),p=w(),g=(e,r)=>{const n=a.get(Rh.computePosHash(t[r])),i=n.from,o=n.to;if(!i||!o)return;c(u,i),c(d,r),c(h,o),H(f),q(u,d)||(W(p,d,u),N(f,p)),q(h,d)||(W(p,h,d),M(f,f,N(p,p)));const s=Y(f);return s>0?R(e,f,1/s):void 0};let m=Number.POSITIVE_INFINITY;this.sortSubarray(n,i.min,i.max,((e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex));const y=w(),_=w(),v=w(),b=w(),x=w(),S=w(),k=w(),T=w(),E=w(),P=[w(),w(),w(),w()],A=[w(),w(),w(),w()],C=[{coord:new Te(0,0),height:0},{coord:new Te(0,0),height:0}],L=(e,t)=>e>t;for(let c=i.min;c<i.max;c++){const i=n[c];if(!i.featureInfo.guardRailEnabled)continue;if(!this.prepareEdgePoints(C,t,r,i,L))continue;const[u,d]=C;if(I(y,u.coord.x,u.coord.y,s*u.height),I(_,d.coord.x,d.coord.y,s*d.height),q(y,_))continue;W(v,_,y),N(v,v);const h=g(T,i.a)||v,f=g(E,i.b)||v;I(b,h[1],-h[0],0),N(b,b),I(x,f[1],-f[0],0),N(x,x),j(T,b,h),N(S,T),j(T,x,f),N(k,T),M(P[0],y,R(T,W(T,b,S),l)),M(P[1],y,R(T,M(T,b,S),l)),M(P[2],y,R(T,S,l)),P[3]=y,M(A[0],_,R(T,W(T,x,k),l)),M(A[1],_,R(T,M(T,x,k),l)),M(A[2],_,R(T,k,l)),A[3]=_,m=this.addFeatureSection(i.featureInfo.featureIndex,m,this.bridgeFeatureSections,e);const p=e.addVertex(P[0],b,o),w=e.addVertex(P[1],b,o),O=e.addVertex(A[0],x,o),D=e.addVertex(A[1],x,o);e.addTriangle(p,w,O),e.addTriangle(w,D,O);const z=e.addVertex(P[1],S,o),B=e.addVertex(P[2],S,o),V=e.addVertex(A[1],k,o),G=e.addVertex(A[2],k,o);e.addTriangle(z,B,V),e.addTriangle(B,G,V),F(b,b),F(x,x);const U=e.addVertex(P[2],b,o),$=e.addVertex(P[3],b,o),H=e.addVertex(A[2],x,o),Z=e.addVertex(A[3],x,o);e.addTriangle(U,$,H),e.addTriangle($,Z,H);const Y=this.isTerminalVertex(i.a,a),X=this.isTerminalVertex(i.b,a);u.height<.01&&Y&&e.addQuad(P[3],P[2],P[1],P[0],F(h,h),o),d.height<.01&&X&&e.addQuad(A[0],A[1],A[2],A[3],f,o)}this.bridgeFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}constructTunnelStructures(e,t,r,n,i,o){e.clearVertexLookup();let a=Number.POSITIVE_INFINITY;const s=(e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex;this.sortSubarray(n,i.min,i.max,s),this.sortSubarray(n,o.min,o.max,s);const l=e=>N(e,e),c=[{coord:new Te(0,0),height:0},{coord:new Te(0,0),height:0}],u=(e,t)=>e<t,d=w(),h=w(),f=w(),p=w(),g=w();for(let o=i.min;o<i.max;o++){if(!this.prepareEdgePoints(c,t,r,n[o],u))continue;const[i,s]=c,m=l(I(g,-(s.coord.y-i.coord.y),s.coord.x-i.coord.x,0));a=this.addFeatureSection(n[o].featureInfo.featureIndex,a,this.tunnelFeatureSections,e),e.addQuad(I(d,i.coord.x,i.coord.y,i.height),I(h,s.coord.x,s.coord.y,s.height),I(f,s.coord.x,s.coord.y,n[o].isTunnel?-.1:0),I(p,i.coord.x,i.coord.y,n[o].isTunnel?-.1:0),m)}for(let i=o.min;i<o.max;i++){const o=n[i];o.isTunnel&&([o.a,o.b]=[o.b,o.a]);const s=t[o.a],c=t[o.b],u=l(I(g,-(c.y-s.y),c.x-s.x,0));a=this.addFeatureSection(o.featureInfo.featureIndex,a,this.tunnelFeatureSections,e),e.addQuad(I(d,c.x,c.y,0),I(h,s.x,s.y,0),I(f,s.x,s.y,r[o.a]+4),I(p,c.x,c.y,r[o.b]+4),u),e.addQuad(I(d,s.x,s.y,0),I(h,c.x,c.y,0),I(f,c.x,c.y,r[o.b]+4),I(p,s.x,s.y,r[o.a]+4),u)}this.tunnelFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}setElevatedPoint(e,t,r,n){e.coord.x=t,e.coord.y=r,e.height=n}prepareEdgePoints(e,t,r,n,i){let o=t[n.a].x,a=t[n.a].y,s=t[n.b].x,l=t[n.b].y,c=r[n.a],u=r[n.b];const d=i(c,0),h=i(u,0);if(d&&h)return this.setElevatedPoint(e[0],o,a,c),this.setElevatedPoint(e[1],s,l,u),!0;if(!d&&!h)return!1;if(d){if(!h){const e=u/(u-c);s=fr(s,o,e),l=fr(l,a,e),u=fr(u,c,e)}}else{const e=c/(c-u);o=fr(o,s,e),a=fr(a,l,e),c=fr(c,u,e)}return this.setElevatedPoint(e[0],o,a,c),this.setElevatedPoint(e[1],s,l,u),!0}prepareEdges(e,t){if(0===t.length)return;t.sort(((e,t)=>e.hash===t.hash?t.polygonIdx-e.polygonIdx:t.hash>e.hash?1:-1));let r=0,n=0,i=0,o=t[r].polygonIdx;do{n++,(n===t.length||t[r].hash!==t[n].hash)&&((1==n-r||t[n-1].polygonIdx!==o)&&(i<r&&(t[i]=t[r],t[r]=null),t[i].type="none",i++),r=n,r!==t.length&&(o=t[r].polygonIdx))}while(r!==t.length);if(t.splice(i),0!==t.length&&0!==e.length){t.sort(((e,t)=>e.portalHash<t.portalHash?1:-1));let r=0,n=0;for(;r!==t.length&&n!==e.length;){const i=t[r],o=e[n];i.portalHash>o.hash?r++:o.hash>i.portalHash?n++:(i.type=o.type,r++)}}}isOnBorder(e,t){return e<=0&&t<=0||e>=Gn&&t>=Gn}
vendor: 13,190 bytes, line 1
1addFeatureSection(e,t,r,n){return e!==t&&(t=e,r.push({featureIndex:e,vertexStart:n.getVertexCount()}),n.clearVertexLookup()),t}sortSubarray(e,t,r,n){const i=e.slice(t,r);i.sort(n),e.splice(t,i.length,...i)}static computeEdgeHash(e,t){return(e.y===t.y&&e.x>t.x||e.y>t.y)&&([e,t]=[t,e]),BigInt(Rh.computePosHash(e))<<32n|BigInt(Rh.computePosHash(t))}static computePosHash(e){return((65535&e.x)<<16|65535&e.y)>>>0}}function Lh(e,t){return e>t?1:e<t?-1:0}class Oh{constructor(e=Lh,t=!1){this._compare=e,this._root=null,this._size=0,this._noDuplicates=!!t}rotateLeft(e){var t=e.right;t&&(e.right=t.left,t.left&&(t.left.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.left=e),e.parent=t}rotateRight(e){var t=e.left;t&&(e.left=t.right,t.right&&(t.right.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.right=e),e.parent=t}_splay(e){for(;e.parent;){var t=e.parent;t.parent?t.left===e&&t.parent.left===t?(this.rotateRight(t.parent),this.rotateRight(t)):t.right===e&&t.parent.right===t?(this.rotateLeft(t.parent),this.rotateLeft(t)):t.left===e&&t.parent.right===t?(this.rotateRight(t),this.rotateLeft(t)):(this.rotateLeft(t),this.rotateRight(t)):t.left===e?this.rotateRight(t):this.rotateLeft(t)}}splay(e){for(var t,r,n,i,o;e.parent;)(r=(t=e.parent).parent)&&r.parent?((n=r.parent).left===r?n.left=e:n.right=e,e.parent=n):(e.parent=null,this._root=e),i=e.left,o=e.right,e===t.left?(r&&(r.left===t?(t.right?(r.left=t.right,r.left.parent=r):r.left=null,t.right=r,r.parent=t):(i?(r.right=i,i.parent=r):r.right=null,e.left=r,r.parent=e)),o?(t.left=o,o.parent=t):t.left=null,e.right=t,t.parent=e):(r&&(r.right===t?(t.left?(r.right=t.left,r.right.parent=r):r.right=null,t.left=r,r.parent=t):(o?(r.left=o,o.parent=r):r.left=null,e.right=r,r.parent=e)),i?(t.right=i,i.parent=t):t.right=null,e.left=t,t.parent=e)}replace(e,t){e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.parent=e.parent)}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}insert(e,t){var r=this._root,n=null,i=this._compare;if(this._noDuplicates)for(;r;){if(n=r,0===i(r.key,e))return;r=i(r.key,e)<0?r.right:r.left}else for(;r;)n=r,r=i(r.key,e)<0?r.right:r.left;return r={key:e,data:t,left:null,right:null,parent:n},n?i(n.key,r.key)<0?n.right=r:n.left=r:this._root=r,this.splay(r),this._size++,r}find(e){for(var t=this._root,r=this._compare;t;){var n=r(t.key,e);if(n<0)t=t.right;else{if(!(n>0))return t;t=t.left}}return null}contains(e){for(var t=this._root,r=this._compare;t;){var n=r(e,t.key);if(0===n)return!0;t=n<0?t.left:t.right}return!1}remove(e){var t=this.find(e);if(!t)return!1;if(this.splay(t),t.left)if(t.right){var r=this.minNode(t.right);r.parent!==t&&(this.replace(r,r.right),r.right=t.right,r.right.parent=r),this.replace(t,r),r.left=t.left,r.left.parent=r}else this.replace(t,t.left);else this.replace(t,t.right);return this._size--,!0}removeNode(e){if(!e)return!1;if(this.splay(e),e.left)if(e.right){var t=this.minNode(e.right);t.parent!==e&&(this.replace(t,t.right),t.right=e.right,t.right.parent=t),this.replace(e,t),t.left=e.left,t.left.parent=t}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0}erase(e){var t=this.find(e);if(t){this.splay(t);var r=t.left,n=t.right,i=null;r&&(r.parent=null,i=this.maxNode(r),this.splay(i),this._root=i),n&&(r?i.right=n:this._root=n,n.parent=i),this._size--}}pop(){var e=this._root,t=null;if(e){for(;e.left;)e=e.left;t={key:e.key,data:e.data},this.remove(e.key)}return t}next(e){var t=e;if(t)if(t.right)for(t=t.right;t&&t.left;)t=t.left;else for(t=e.parent;t&&t.right===e;)e=t,t=t.parent;return t}prev(e){var t=e;if(t)if(t.left)for(t=t.left;t&&t.right;)t=t.right;else for(t=e.parent;t&&t.left===e;)e=t,t=t.parent;return t}forEach(e){for(var t=this._root,r=[],n=!1,i=0;!n;)t?(r.push(t),t=t.left):r.length>0?(e(t=r.pop(),i++),t=t.right):n=!0;return this}range(e,t,r,n){const i=[],o=this._compare;let a,s=this._root;for(;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(s=i.pop(),a=o(s.key,t),a>0)break;if(o(s.key,e)>=0&&r.call(n,s))return this;s=s.right}return this}keys(){for(var e=this._root,t=[],r=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),r.push(e.key),e=e.right):n=!0;return r}values(){for(var e=this._root,t=[],r=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),r.push(e.data),e=e.right):n=!0;return r}at(e){for(var t=this._root,r=[],n=!1,i=0;!n;)if(t)r.push(t),t=t.left;else if(r.length>0){if(t=r.pop(),i===e)return t;i++,t=t.right}else n=!0;return null}load(e=[],t=[],r=!1){if(0!==this._size)throw new Error("bulk-load: tree is not empty");const n=e.length;return r&&zh(e,t,0,n-1,this._compare),this._root=Dh(null,e,t,0,n),this._size=n,this}min(){var e=this.minNode(this._root);return e?e.key:null}max(){var e=this.maxNode(this._root);return e?e.key:null}isEmpty(){return null===this._root}get size(){return this._size}static createTree(e,t,r,n,i){return new Oh(r,i).load(e,t,n)}}function Dh(e,t,r,n,i){const o=i-n;if(o>0){const a=n+Math.floor(o/2),s={key:t[a],data:r[a],parent:e};return s.left=Dh(s,t,r,n,a),s.right=Dh(s,t,r,a+1,i),s}return null}function zh(e,t,r,n,i){if(r>=n)return;const o=e[r+n>>1];let a=r-1,s=n+1;for(;;){do{a++}while(i(e[a],o)<0);do{s--}while(i(e[s],o)>0);if(a>=s)break;let r=e[a];e[a]=e[s],e[s]=r,r=t[a],t[a]=t[s],t[s]=r}zh(e,t,r,s,i),zh(e,t,s+1,n,i)}const Fh=11102230246251565e-32,Nh=134217729,Bh=(3+8*Fh)*Fh;function jh(e,t,r,n,i){let o,a,s,l,c=t[0],u=n[0],d=0,h=0;u>c==u>-c?(o=c,c=t[++d]):(o=u,u=n[++h]);let f=0;if(d<e&&h<r)for(u>c==u>-c?(a=c+o,s=o-(a-c),c=t[++d]):(a=u+o,s=o-(a-u),u=n[++h]),o=a,0!==s&&(i[f++]=s);d<e&&h<r;)u>c==u>-c?(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++d]):(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=n[++h]),o=a,0!==s&&(i[f++]=s);for(;d<e;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++d],o=a,0!==s&&(i[f++]=s);for(;h<r;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=n[++h],o=a,0!==s&&(i[f++]=s);return 0===o&&0!==f||(i[f++]=o),f}function Vh(e){return new Float64Array(e)}const Gh=Vh(4),Uh=Vh(8),$h=Vh(12),Hh=Vh(16),qh=Vh(4);function Wh(e,t,r){null===t?(e.inOut=!1,e.otherInOut=!0):(e.isSubject===t.isSubject?(e.inOut=!t.inOut,e.otherInOut=t.otherInOut):(e.inOut=!t.otherInOut,e.otherInOut=t.isVertical()?!t.inOut:t.inOut),t&&(e.prevInResult=!Zh(t,r)||t.isVertical()?t.prevInResult:t)),e.resultTransition=Zh(e,r)?function(e,t){let r,n=!e.inOut,i=!e.otherInOut;switch(t){case 0:r=n&&i;break;case 1:r=n||i;break;case 3:r=n!==i;break;case 2:r=e.isSubject?n&&!i:i&&!n}return r?1:-1}(e,r):0}function Zh(e,t){switch(e.type){case 0:switch(t){case 0:return!e.otherInOut;case 1:return e.otherInOut;case 2:return e.isSubject&&e.otherInOut||!e.isSubject&&!e.otherInOut;case 3:return!0}break;case 2:return 0===t||1===t;case 3:return 2===t;case 1:return!1}return!1}class Yh{constructor(e,t,r,n,i){this.left=t,this.point=e,this.otherEvent=r,this.isSubject=n??!1,this.type=i||0,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0}isBelow(e){const t=this.point,r=this.otherEvent.point;return this.left?(t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1])>0:(r[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(r[1]-e[1])>0}isAbove(e){return!this.isBelow(e)}isVertical(){return this.point[0]===this.otherEvent.point[0]}get inResult(){return 0!==this.resultTransition}clone(){const e=new Yh(this.point,this.left,this.otherEvent,this.isSubject,this.type);return e.contourId=this.contourId,e.resultTransition=this.resultTransition,e.prevInResult=this.prevInResult,e.isExteriorRing=this.isExteriorRing,e.inOut=this.inOut,e.otherInOut=this.otherInOut,e}}function Xh(e,t){return e[0]===t[0]&&e[1]===t[1]}function Kh(e,t,r){const n=function(e,t,r,n,i,o){const a=(t-o)*(r-i),s=(e-i)*(n-o),l=a-s;if(0===a||0===s||a>0!=s>0)return l;const c=Math.abs(a+s);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,r,n,i,o,a){let s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k;const T=e-i,I=r-i,M=t-o,E=n-o;b=T*E,h=Nh*T,f=h-(h-T),p=T-f,h=Nh*E,g=h-(h-E),m=E-g,x=p*m-(b-f*g-p*g-f*m),w=M*I,h=Nh*M,f=h-(h-M),p=M-f,h=Nh*I,g=h-(h-I),m=I-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,Gh[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,Gh[1]=v-(y+d)+(d-w),k=_+y,d=k-_,Gh[2]=_-(k-d)+(y-d),Gh[3]=k;let P=function(e,t){let r=t[0];for(let e=1;e<4;e++)r+=t[e];return r}(0,Gh),A=22204460492503146e-32*a;if(P>=A||-P>=A)return P;if(d=e-T,s=e-(T+d)+(d-i),d=r-I,c=r-(I+d)+(d-i),d=t-M,l=t-(M+d)+(d-o),d=n-E,u=n-(E+d)+(d-o),0===s&&0===l&&0===c&&0===u)return P;if(A=11093356479670487e-47*a+Bh*Math.abs(P),P+=T*u+E*s-(M*c+I*l),P>=A||-P>=A)return P;b=s*E,h=Nh*s,f=h-(h-s),p=s-f,h=Nh*E,g=h-(h-E),m=E-g,x=p*m-(b-f*g-p*g-f*m),w=l*I,h=Nh*l,f=h-(h-l),p=l-f,h=Nh*I,g=h-(h-I),m=I-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,qh[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,qh[1]=v-(y+d)+(d-w),k=_+y,d=k-_,qh[2]=_-(k-d)+(y-d),qh[3]=k;const C=jh(4,Gh,4,qh,Uh);b=T*u,h=Nh*T,f=h-(h-T),p=T-f,h=Nh*u,g=h-(h-u),m=u-g,x=p*m-(b-f*g-p*g-f*m),w=M*c,h=Nh*M,f=h-(h-M),p=M-f,h=Nh*c,g=h-(h-c),m=c-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,qh[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,qh[1]=v-(y+d)+(d-w),k=_+y,d=k-_,qh[2]=_-(k-d)+(y-d),qh[3]=k;const R=jh(C,Uh,4,qh,$h);b=s*u,h=Nh*s,f=h-(h-s),p=s-f,h=Nh*u,g=h-(h-u),m=u-g,x=p*m-(b-f*g-p*g-f*m),w=l*c,h=Nh*l,f=h-(h-l),p=l-f,h=Nh*c,g=h-(h-c),m=c-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,qh[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,qh[1]=v-(y+d)+(d-w),k=_+y,d=k-_,qh[2]=_-(k-d)+(y-d),qh[3]=k;const L=jh(R,$h,4,qh,Hh);return Hh[L-1]}(e,t,r,n,i,o,c)}(e[0],e[1],t[0],t[1],r[0],r[1]);return n>0?-1:n<0?1:0}function Jh(e,t){const r=e.point,n=t.point;return r[0]>n[0]?1:r[0]<n[0]?-1:r[1]!==n[1]?r[1]>n[1]?1:-1:function(e,t,r){return e.left!==t.left?e.left?1:-1:0!==Kh(r,e.otherEvent.point,t.otherEvent.point)?e.isBelow(t.otherEvent.point)?-1:1:!e.isSubject&&t.isSubject?1:-1}(e,t,r)}function Qh(e,t,r){const n=new Yh(t,!1,e,e.isSubject),i=new Yh(t,!0,e.otherEvent,e.isSubject);return Xh(e.point,e.otherEvent.point)&&console.warn("what is that, a collapsed segment?",e),n.contourId=i.contourId=e.contourId,Jh(i,e.otherEvent)>0&&(e.otherEvent.left=!0,i.left=!1),e.otherEvent.otherEvent=i,e.otherEvent=n,r.push(i),r.push(n),r}function ef(e,t){return e[0]*t[1]-e[1]*t[0]}function tf(e,t){return e[0]*t[0]+e[1]*t[1]}function rf(e,t,r){const n=function(e,t,r,n){const i=[t[0]-e[0],t[1]-e[1]],o=[n[0]-r[0],n[1]-r[1]];function a(e,t,r){return[e[0]+t*r[0],e[1]+t*r[1]]}const s=[r[0]-e[0],r[1]-e[1]];let l=ef(i,o),c=l*l;const u=tf(i,i);if(c>0){const t=ef(s,o)/l;if(t<0||t>1)return null;const n=ef(s,i)/l;return n<0||n>1?null:0===t||1===t?[a(e,t,i)]:0===n||1===n?[a(r,n,o)]:[a(e,t,i)]}if(l=ef(s,i),c=l*l,c>0)return null;const d=tf(i,s)/u,h=d+tf(i,o)/u,f=Math.min(d,h),p=Math.max(d,h);return f<=1&&p>=0?1===f?[a(e,f>0?f:0,i)]:0===p?[a(e,p<1?p:1,i)]:[a(e,f>0?f:0,i),a(e,p<1?p:1,i)]:null}(e.point,e.otherEvent.point,t.point,t.otherEvent.point),i=n?n.length:0;if(0===i||1===i&&(Xh(e.point,t.point)||Xh(e.otherEvent.point,t.otherEvent.point))||2===i&&e.isSubject===t.isSubject)return 0;if(1===i)return!Xh(e.point,n[0])&&!Xh(e.otherEvent.point,n[0])&&Qh(e,n[0],r),!Xh(t.point,n[0])&&!Xh(t.otherEvent.point,n[0])&&Qh(t,n[0],r),1;const o=[];let a=!1,s=!1;return Xh(e.point,t.point)?a=!0:1===Jh(e,t)?o.push(t,e):o.push(e,t),Xh(e.otherEvent.point,t.otherEvent.point)?s=!0:1===Jh(e.otherEvent,t.otherEvent)?o.push(t.otherEvent,e.otherEvent):o.push(e.otherEvent,t.otherEvent),a&&s||a?(t.type=1,e.type=t.inOut===e.inOut?2:3,a&&!s&&Qh(o[1].otherEvent,o[0].point,r),2):s?(Qh(o[0],o[1].point,r),3):o[0]!==o[3].otherEvent?(Qh(o[0],o[1].point,r),Qh(o[1],o[2].point,r),3):(Qh(o[0],o[1].point,r),Qh(o[3].otherEvent,o[2].point,r),3)}function nf(e,t){if(e===t)return 0;if(0!==Kh(e.point,e.otherEvent.point,t.point)||0!==Kh(e.point,e.otherEvent.point,t.otherEvent.point))return Xh(e.point,t.point)?e.isBelow(t.otherEvent.point)?-1:1:e.point[0]===t.point[0]?e.point[1]<t.point[1]?-1:1:1===Jh(e,t)?t.isAbove(e.point)?-1:1:e.isBelow(t.point)?-1:1;if(e.isSubject!==t.isSubject)return e.isSubject?-1:1;{let r=e.point,n=t.point;if(r[0]===n[0]&&r[1]===n[1])return r=e.otherEvent.point,n=t.otherEvent.point,r[0]===n[0]&&r[1]===n[1]?0:(e.contourId??0)>(t.contourId??0)?1:-1}return 1===Jh(e,t)?1:-1}class of{constructor(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null}isExterior(){return null==this.holeOf}}function af(e,t,r,n){let i,o=e+1,a=t[e].point;const s=t.length;for(o<s&&(i=t[o].point);o<s&&i[0]===a[0]&&i[1]===a[1];){if(!r[o])return o;o++,o<s&&(i=t[o].point)}for(o=e-1;r[o]&&o>n;)o--;return o}function sf(e,t,r){const n=new of;if(null!=e.prevInResult){const i=e.prevInResult,o=i.outputContourId;if(i.resultTransition>0){const e=t[o];if(null!=e.holeOf){const i=e.holeOf;t[i].holeIds.push(r),n.holeOf=i,n.depth=t[o].depth}else t[o].holeIds.push(r),n.holeOf=o,n.depth=t[o].depth+1}else n.holeOf=null,n.depth=t[o].depth}else n.holeOf=null,n.depth=0;return n}const lf=Math.max,cf=Math.min;let uf=0;function df(e,t,r,n,i,o){let a,s,l,c,u,d;for(a=0,s=e.length-1;a<s;a++){if(l=e[a],c=e[a+1],u=new Yh(l,!1,void 0,t),d=new Yh(c,!1,u,t),u.otherEvent=d,l[0]===c[0]&&l[1]===c[1])continue;
1u.contourId=d.contourId=r,o||(u.isExteriorRing=!1,d.isExteriorRing=!1),Jh(u,d)>0?d.left=!0:u.left=!0;const s=l[0],h=l[1];i[0]=cf(i[0],s),i[1]=cf(i[1],h),i[2]=lf(i[2],s),i[3]=lf(i[3],h),n.push(u),n.push(d)}}const hf=[];function ff(e,t,r){let n=e,i=t;"number"==typeof e[0][0][0]&&(n=[e]),"number"==typeof t[0][0][0]&&(i=[t]);let o=function(e,t,r){let n=null;return e.length*t.length==0&&(0===r?n=hf:2===r?n=e:(1===r||3===r)&&(n=0===e.length?t:e)),n}(n,i,r);if(o)return o===hf?null:o;const a=[1/0,1/0,-1/0,-1/0],s=[1/0,1/0,-1/0,-1/0],l=function(e,t,r,n,i){const o=new Vn(void 0,Jh);let a,s,l,c,u,d;for(l=0,c=e.length;l<c;l++)for(a=e[l],u=0,d=a.length;u<d;u++)s=0===u,s&&uf++,df(a[u],!0,uf,o,r,s);for(l=0,c=t.length;l<c;l++)for(a=t[l],u=0,d=a.length;u<d;u++)s=0===u,2===i&&(s=!1),s&&uf++,df(a[u],!1,uf,o,n,s);return o}(n,i,a,s,r);if(o=function(e,t,r,n,i){let o=null;return(r[0]>n[2]||n[0]>r[2]||r[1]>n[3]||n[1]>r[3])&&(0===i?o=hf:2===i?o=e:(1===i||3===i)&&(o=e.concat(t))),o}(n,i,a,s,r),o)return o===hf?null:o;const c=function(e,t,r,n,i,o){const a=new Oh(nf),s=[],l=Math.min(n[2],i[2]);let c,u,d;for(;0!==e.length;){let t=e.pop();if(s.push(t),0===o&&t.point[0]>l||2===o&&t.point[0]>n[2])break;if(t.left){u=c=a.insert(t),d=a.minNode(),c=c!==d?a.prev(c):null,u=a.next(u);const r=c?c.key:null;let n;if(Wh(t,r,o),u&&2===rf(t,u.key,e)&&(Wh(t,r,o),Wh(u.key,t,o)),c&&2===rf(c.key,t,e)){let e=c;e=e!==d?a.prev(e):null,n=e?e.key:null,Wh(r,n,o),Wh(t,r,o)}}else t=t.otherEvent,u=c=a.find(t),c&&u&&(c=c!==d?a.prev(c):null,u=a.next(u),a.remove(t),u&&c&&rf(c.key,u.key,e))}return s}(l,0,0,a,s,r),u=function(e){let t,r;const n=function(e){let t,r,n,i,o;const a=[];for(r=0,n=e.length;r<n;r++)t=e[r],(t.left&&t.inResult||!t.left&&t.otherEvent.inResult)&&a.push(t);let s=!1;for(;!s;)for(s=!0,r=0,n=a.length;r<n;r++)r+1<n&&1===Jh(a[r],a[r+1])&&(i=a[r],a[r]=a[r+1],a[r+1]=i,s=!1);for(r=0,n=a.length;r<n;r++)t=a[r],t.otherPos=r;for(r=0,n=a.length;r<n;r++)t=a[r],t.left||(o=t.otherPos,t.otherPos=t.otherEvent.otherPos,t.otherEvent.otherPos=o);return a}(e),i={},o=[];for(t=0,r=n.length;t<r;t++){if(i[t])continue;const e=o.length,r=sf(n[t],o,e),a=t=>{i[t]=!0,t<n.length&&n[t]&&(n[t].outputContourId=e)};let s=t,l=t;for(r.points.push(n[t].point);a(s),s=n[s].otherPos,a(s),r.points.push(n[s].point),s=af(s,n,i,l),!(s==l||s>=n.length)&&n[s];);o.push(r)}return o}(c),d=[];for(let e=0;e<u.length;e++){let t=u[e];if(t.isExterior()){let e=[t.points];for(let r=0;r<t.holeIds.length;r++)e.push(u[t.holeIds[r]].points);d.push(e)}}return d}function pf(e,t,r,n){const i=[],o=0===n?(e,t,r,n,i,o)=>{e.push(new Te(o,r+(o-t)/(n-t)*(i-r)))}:(e,t,r,n,i,o)=>{e.push(new Te(t+(o-r)/(i-r)*(n-t),o))};for(const a of e){const e=[];for(const i of a){if(i.length<=2)continue;const a=[];for(let e=0;e<i.length-1;e++){const s=i[e].x,l=i[e].y,c=i[e+1].x,u=i[e+1].y,d=0===n?s:l,h=0===n?c:u;d<t?h>t&&o(a,s,l,c,u,t):d>r?h<r&&o(a,s,l,c,u,r):a.push(i[e]),h<t&&d>=t&&o(a,s,l,c,u,t),h>r&&d<=r&&o(a,s,l,c,u,r)}let s=i[i.length-1];const l=0===n?s.x:s.y;l>=t&&l<=r&&a.push(s),a.length&&(s=a[a.length-1],a[0].x===s.x&&a[0].y===s.y||a.push(a[0]),e.push(a))}e.length&&i.push(e)}return i}function gf(e,t){const r=ff(yf(e),yf([t]),0);return null==r?[]:_f(r)}function mf(e,t){const r=65536;let n=yf(e,r);const i=[];for(;t.valid();t.next()){const[e,n]=t.get(),o=e.x*r,a=e.y*r,s=n.x*r,l=n.y*r,c=s-o,u=l-a,d=Math.hypot(c,u);if(0===d)continue;const h=Math.trunc(u/d*3),f=-Math.trunc(c/d*3);i.push([[[o,a],[s,l],[s+h,l+f],[o+h,a+f],[o,a]]])}return i.length>0&&(n=ff(n,i,2)),_f(n,1/r,128)}function yf(e,t=1){return[e.map((e=>e.map((e=>[e.x*t,e.y*t]))))]}function _f(e,t=1,r){return e.map((e=>e.map(((e,n)=>{const i=e.map((e=>{let n=e[0],i=e[1];return r&&(n=Math.round(n/r)*r,i=Math.round(i/r)*r),new Te(n*t,i*t)._round()}));return n>0&&i.reverse(),i}))))}class vf{constructor(e,t){this.layoutVertexArray=new Vs,this.indexArray=new ll,this.lineIndexArray=new nl,this.triangleSegments=new Bl,this.lineSegments=new Bl,this.programConfigurations=new pc(e.layers,{zoom:e.zoom,lut:e.lut}),this.uploaded=!1,t&&(this.elevatedLayoutVertexArray=new $s)}update(e,t,r,n,i,o,a,s){this.programConfigurations.updatePaintArrays(e,t,i,r,n,o,a,s)}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.lineIndexBuffer=e.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,Xd.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(e,t,r,n,i,o,a){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,r,n,i,o,void 0,a)}}class bf{constructor(e){this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lut=e.lut,this.bufferData=new vf(e,!1),this.elevationBufferData=new vf(e,!0),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference"),this.sourceLayerIndex=e.s
vendor: 26,864 bytes, line 1
1ourceLayerIndex,this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,r,n){}populate(e,t,r,n){this.hasPattern=Eh("fill",this.layers,this.pixelRatio,t);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Jc(a,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,r))continue;const d=i?i.evaluate(u,{},r,t.availableImages):void 0,h={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Kc(a,r,n),patterns:{},sortKey:d};o.push(h)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const n of o){const{geometry:i,index:o,sourceLayerIndex:a}=n;if(this.hasPattern){const e=Ph("fill",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,{},t.availableImages,t.brightness,t.elevationFeatures);t.featureIndex.insert(e[o].feature,i,o,a,this.index)}}update(e,t,r,n,i,o,a){this.bufferData.update(e,t,r,n,i,o,a,this.worldview),this.elevationBufferData.update(e,t,r,n,i,o,a,this.worldview),this.elevatedStructures&&this.elevatedStructures.update(e,t,r,n,i,o,a,this.worldview)}addFeatures(e,t,r,n,i,o){for(const i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,r,n,o,e.elevationFeatures)}isEmpty(){return this.bufferData.isEmpty()&&this.elevationBufferData.isEmpty()}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||this.elevationBufferData.needsUpload()}upload(e){this.bufferData.upload(e),this.elevationBufferData.upload(e),this.elevatedStructures&&this.elevatedStructures.upload(e)}destroy(){this.bufferData.destroy(),this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}addFeature(e,t,r,n,i,o=[],a,s){const l=Th(t,500);"none"!==this.elevationMode?this.addElevatedRoadFeature(e,l,n,r,s):this.addGeometry(l,this.bufferData),this.bufferData.populatePaintArrays(e,r,i,o,n,a,this.worldview),this.elevationBufferData.populatePaintArrays(e,r,i,o,n,a,this.worldview)}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}setEvaluatedPortalGraph(e,t,r,n,i){this.elevatedStructures&&(this.elevatedStructures.construct(e),this.elevatedStructures.populatePaintArrays(t,r,n,i,this.worldview))}addElevatedRoadFeature(e,t,r,n,i){const o=new Array,a=ku.getElevationFeature(e,i);if(!a)return void this.addGeometry(t,this.bufferData);{const e=this.clipPolygonsToTile(t,1);e.length>0&&o.push({polygons:e,elevationFeature:a,elevationTileID:r})}const s={guardRailEnabled:this.layers[0].layout.get("fill-construct-bridge-guard-rail").evaluate(e,{},r),featureIndex:n};for(const t of o)if(t.elevationFeature){if("hd-road-base"===this.elevationMode){this.elevatedStructures||(this.elevatedStructures=new Rh(t.elevationTileID,this.layers,this.zoom,this.lut));const r=t.elevationFeature.isTunnel();let n=0;e.properties.hasOwnProperty(su)&&(n=+e.properties[su]),this.elevatedStructures.addPortalCandidates(t.elevationFeature.id,t.polygons,r,t.elevationFeature,n)}null==t.elevationFeature.constantHeight&&(t.polygons=this.prepareElevatedPolygons(t.polygons,t.elevationFeature,t.elevationTileID));const i=new Tu(r,t.elevationTileID);this.addElevatedGeometry(t.polygons,i,t.elevationFeature,"hd-road-base"===this.elevationMode?0:.05,n,s)}}addElevatedGeometry(e,t,r,n,i,o){const a={elevation:r,elevationSampler:t,bias:n,index:i,featureInfo:o},[s,l]=this.addGeometry(e,this.elevationBufferData,a);null==this.elevationBufferData.heightRange?this.elevationBufferData.heightRange={min:s,max:l}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,s),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,l))}addGeometry(e,t,r){let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=null;r&&(o=r.elevationSampler.constantElevation(r.elevation,r.bias),null!=o&&(n=o,i=o));const a=(e,a,s)=>{if(null!=r)if(a.push(e),null!=o)t.elevatedLayoutVertexArray.emplaceBack(o),s.push(o);else{const o=r.elevationSampler.pointElevation(e,r.elevation,r.bias);t.elevatedLayoutVertexArray.emplaceBack(o),s.push(o),n=Math.min(n,o),i=Math.max(i,o)}};for(const n of e){let e=0;for(const t of n)e+=t.length;const i=t.triangleSegments.prepareSegment(e,t.layoutVertexArray,t.indexArray),o=i.vertexLength,s=[],l=[],c=[],u=[],d=[],h=t.layoutVertexArray.length;for(const e of n){if(0===e.length)continue;e!==n[0]&&l.push(s.length/2);const i=t.lineSegments.prepareSegment(e.length,t.layoutVertexArray,t.lineIndexArray),o=i.vertexLength;r&&d.push(t.layoutVertexArray.length-h),a(e[0],c,u),t.layoutVertexArray.emplaceBack(e[0].x,e[0].y),t.lineIndexArray.emplaceBack(o+e.length-1,o),s.push(e[0].x),s.push(e[0].y);for(let r=1;r<e.length;r++)a(e[r],c,u),t.layoutVertexArray.emplaceBack(e[r].x,e[r].y),t.lineIndexArray.emplaceBack(o+r-1,o+r),s.push(e[r].x),s.push(e[r].y);i.vertexLength+=e.length,i.primitiveLength+=e.length}const f=Qd(s,l);for(let e=0;e<f.length;e+=3)t.indexArray.emplaceBack(o+f[e],o+f[e+1],o+f[e+2]);if(f.length>0&&r&&"hd-road-base"===this.elevationMode){const e=r.elevation.isTunnel(),t=r.elevation.safeArea,n=this.elevatedStructures.addVertices(c,u);this.elevatedStructures.addTriangles(f,n,e);const i=d.length;if(i>0){for(let o=0;o<i-1;o++)this.elevatedStructures.addRenderableRing(r.index,d[o]+n,d[o+1]-d[o],e,t,r.featureInfo);this.elevatedStructures.addRenderableRing(r.index,d[i-1]+n,c.length-d[i-1],e,t,r.featureInfo)}}i.vertexLength+=e,i.primitiveLength+=f.length/3}return[n,i]}prepareElevatedPolygons(e,t,r){const n=1/Gc(r),i=[];for(const r of e){const e=mf(r,new wu(t,n));i.push(...e)}return i}clipPolygonsToTile(e,t){const r=-t,n=-t,i=Gn+t,o=Gn+t;let a=0;const s=[],l=[];for(;a<e.length;a++){const t=e[a],c=bn(t);(c.min.x>=r&&c.max.x<=i&&c.min.y>=n&&c.max.y<=o?s:l).push(t)}if(s.length===e.length)return e;const c=[new Te(r,n),new Te(i,n),new Te(i,o),new Te(r,o),new Te(r,n)],u=s;for(const e of l)u.push(...gf(e,c));return u}}let xf,wf,Sf,kf;ea(bf,"FillBucket",{omit:["layers","patternFeatures"]}),ea(vf,"FillBufferData"),ea(Rh,"ElevatedStructures");class Tf{constructor(e,t,r,n){if(this.triangleCount=t.length/3,this.min=new Te(0,0),this.max=new Te(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===e.length)return;const[i,o]=[e[0].clone(),e[0].clone()];for(let t=1;t<e.length;++t){const r=e[t];i.x=Math.min(i.x,r.x),i.y=Math.min(i.y,r.y),o.x=Math.max(o.x,r.x),o.y=Math.max(o.y,r.y)}if(n){const e=Math.ceil(Math.max(o.x-i.x,o.y-i.y)/n);r=Math.max(r,e)}if(0===r)return;this.min=i,this.max=o;const a=this.max.sub(this.min);a.x=Math.max(a.x,1),a.y=Math.max(a.y,1);const s=Math.max(a.x,a.y)/r;this.cellsX=Math.max(1,Math.ceil(a.x/s)),this.cellsY=Math.max(1,Math.ceil(a.y/s)),this.xScale=1/s,this.yScale=1/s;const l=[];for(let r=0;r<this.triangleCount;r++){const n=e[t[3*r+0]].sub(this.min),i=e[t[3*r+1]].sub(this.min),o=e[t[3*r+2]].sub(this.min),a=If(Math.floor(Math.min(n.x,i.x,o.x)),this.xScale,this.cellsX),c=If(Math.floor(Math.max(n.x,i.x,o.x)),this.xScale,this.cellsX),u=If(Math.floor(Math.min(n.y,i.y,o.y)),this.yScale,this.cellsY),d=If(Math.floor(Math.max(n.y,i.y,o.y)),this.yScale,this.cellsY),h=new Te(0,0),f=new Te(0,0),p=new Te(0,0),g=new Te(0,0);for(let e=u;e<=d;++e){h.y=f.y=e*s,p.y=g.y=(e+1)*s;for(let t=a;t<=c;++t)h.x=p.x=t*s,f.x=g.x=(t+1)*s,(Gu(n,i,o,h,f,g)||Gu(n,i,o,h,g,p))&&l.push({cellIdx:e*this.cellsX+t,triIdx:r})}}if(0===l.length)return;l.sort(((e,t)=>e.cellIdx-t.cellIdx||e.triIdx-t.triIdx));let c=0;for(;c<l.length;){const e=l[c].cellIdx,t={start:this.payload.length,len:0};for(;c<l.length&&l[c].cellIdx===e;)++t.len,this.payload.push(l[c++].triIdx);this.cells[e]=t}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(e,t){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const r=If(e.x-this.min.x,this.xScale,this.cellsX),n=If(e.y-this.min.y,this.yScale,this.cellsY),i=this.cells[n*this.cellsX+r];if(i){this._lazyInitLookup();for(let e=0;e<i.len;e++){const r=this.payload[i.start+e],n=Math.floor(r/8),o=1<<r%8;if(!(this.lookup[n]&o)&&(this.lookup[n]|=o,t.push(r),t.length===this.triangleCount))return}}}query(e,t,r){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this._lazyInitLookup();const n=If(e.x-this.min.x,this.xScale,this.cellsX),i=If(t.x-this.min.x,this.xScale,this.cellsX),o=If(e.y-this.min.y,this.yScale,this.cellsY),a=If(t.y-this.min.y,this.yScale,this.cellsY);for(let e=o;e<=a;e++)for(let t=n;t<=i;t++){const n=this.cells[e*this.cellsX+t];if(n)for(let e=0;e<n.len;e++){const t=this.payload[n.start+e],i=Math.floor(t/8),o=1<<t%8;if(!(this.lookup[i]&o)&&(this.lookup[i]|=o,r.push(t),r.length===this.triangleCount))return}}}}function If(e,t,r){return Math.max(0,Math.min(r-1,Math.floor(e*t)))}ea(Tf,"TriangleGridIndex");class Mf{constructor(e){this.zoom=e.zoom,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.footprints=[],this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){for(const r of this.footprints)t.push({footprint:r,id:e})}updateAppearances(e,t,r,n){}populate(e,t,r,n){const i=[];for(const{feature:o,id:a,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Jc(o,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),c,r))continue;const u={id:a,properties:o.properties,type:o.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:Kc(o,r,n),patterns:{}};i.push(u)}for(const n of i){const{geometry:i,index:o,sourceLayerIndex:a}=n;this.addFeature(n,i,o,r,{},t.availableImages,t.brightness),t.featureIndex.insert(e[o].feature,i,o,a,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(e){}update(e,t,r,n,i,o,a){}destroy(){}addFeature(e,t,r,n,i,o=[],a){for(const e of Th(t,2)){const t=[],r=[],n=[],i=new Te(1/0,1/0),o=new Te(-1/0,-1/0);for(const a of e)if(0!==a.length){a!==e[0]&&n.push(r.length/2);for(let e=0;e<a.length;e++)r.push(a[e].x),r.push(a[e].y),t.push(a[e]),i.x=Math.min(i.x,a[e].x),i.y=Math.min(i.y,a[e].y),o.x=Math.max(o.x,a[e].x),o.y=Math.max(o.y,a[e].y)}const a=Qd(r,n),s=new Tf(t,a,8,256);this.footprints.push({vertices:t,indices:a,grid:s,min:i,max:o})}}}ea(Mf,"ClipBucket",{omit:["layers"]});const Ef=Bs([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Pf=Bs([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Af=Bs([{name:"a_flood_light_ground_radius",components:1,type:"Float32"}]),Cf=Bs([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Rf=Bs([{name:"a_join_normal_inside",components:3,type:"Int16"}]),Lf=Bs([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),Of=Bs([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Df}=Ef,zf=Number.MAX_SAFE_INTEGER,Ff=zf-1;function Nf(e,t,r,n){return e.order<t||e.order===zf||!(e.clipMask&r)||function(e,t){return 0!==t.length&&void 0===t.find((t=>t===e))}(n,e.clipScope)}function Bf(e,t){return e.x-t.x||e.y-t.y}function jf(e,t){return 0===Bf(e.min,t.min)&&0===Bf(e.max,t.max)}function Vf(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function Gf(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].sourceId!==t[r].sourceId||!jf(e[r],t[r])||e[r].order!==t[r].order||e[r].clipMask!==t[r].clipMask||!Ie(e[r].clipScope,t[r].clipScope))return!1;return!0}function Uf(e,t,r){const n=1/Gn,i=1/(1<<r.canonical.z),o=(t.x*n+r.canonical.x)*i+r.wrap,a=(t.y*n+r.canonical.y)*i;return{min:new Te((e.x*n+r.canonical.x)*i+r.wrap,(e.y*n+r.canonical.y)*i),max:new Te(o,a)}}function $f(e,t,r){const n=1<<r.canonical.z,i=((t.x-r.wrap)*n-r.canonical.x)*Gn,o=(t.y*n-r.canonical.y)*Gn;return{min:new Te(((e.x-r.wrap)*n-r.canonical.x)*Gn,(e.y*n-r.canonical.y)*Gn),max:new Te(i,o)}}function Hf(e,t,r,n,i,o,a){const s=e.indices,l=e.vertices,c=[];for(let u=n;u<n+i;u+=3){const n=t[r[u+0]+o],i=t[r[u+1]+o],d=t[r[u+2]+o],h=Math.min(n.x,i.x,d.x),f=Math.max(n.x,i.x,d.x),p=Math.min(n.y,i.y,d.y),g=Math.max(n.y,i.y,d.y);c.length=0,e.grid.query(new Te(h,p),new Te(f,g),c);for(let e=0;e<c.length;e++){const t=c[e];if(Gu(l[s[3*t+0]],l[s[3*t+1]],l[s[3*t+2]],n,i,d,a))return!0}}return!1}function qf(e,t,r,n){if(!e||!r)return!1;let i=e.vertices;if(!t.canonical.equals(n.canonical)||t.wrap!==n.wrap){if(r.vertices.length<e.vertices.length)return qf(r,n,e,t);const o=t.canonical,a=n.canonical,s=Math.pow(2,a.z-o.z);i=e.vertices.map((e=>new Te((e.x+o.x*Gn)*s-a.x*Gn,(e.y+o.y*Gn)*s-a.y*Gn)))}return Hf(r,i,e.indices,0,e.indices.length,0,0)}function Wf(e,t,r,n){const i=Math.pow(2,n.z-r.z);return new Te((e+r.x*Gn)*i-n.x*Gn,(t+r.y*Gn)*i-n.y*Gn)}function Zf(e,t){const r=[];t.grid.queryPoint(e,r);const n=t.indices,i=t.vertices;for(let t=0;t<r.length;t++){const o=r[t];if(Nu([i[n[3*o+0]],i[n[3*o+1]],i[n[3*o+2]]],e))return!0}return!1}const Yf=[new Te(0,0),new Te(Gn,0),new Te(Gn,Gn),new Te(0,Gn)];function Xf(e,t){const r=[];let n=[];if(!t||e.length<2)return[e];if(2===e.length)return ju(e[0],e[1],Yf)?[e]:[];for(let t=0;t<e.length+2;t++){const i=e[t%e.length],o=e[(t+1)%e.length],a=ju(0===t?e[e.length-1]:e[(t-1)%e.length],i,Yf),s=ju(i,o,Yf),l=a||s;l&&n.push(i),l&&s||n.length>0&&(n.length>1&&r.push(n),n=[])}return n.length>1&&r.push(n),r}const Kf=Qc.types,Jf=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],Qf=["fill-extrusion-flood-light-ground-radius"],ep=Math.pow(2,13),tp=Math.pow(2,15)-1,rp=new Te(0,1),np=2147483648;function ip(e,t,r,n,i,o,a,s){e.emplaceBack((t<<1)+a,(r<<1)+o,(Math.floor(n*ep)<<1)+i,Math.round(s))}function op(e,t,r){e.emplaceBack(t.x*Gn,t.y*Gn,r?1:0)}function ap(e,t,r,n,i,o){e.emplaceBack(t.x,t.y,(r.x<<1)+n,(r.y<<1)+i,o)}function sp(e,t,r){const n=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*n,r[1]*n,r[2]*n)}class lp{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class cp{constructor(){this.centroidXY=new Te(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Te(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Te(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0,this.buildingId=0}span(){return new Te(this.max.x-this.min.x,this.max.y-this.min.y)}}class up{constructor(){this.acc=new Te(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,r){this.accCount++,this.acc._add(t);let n=!!this.borders;t.x<e.min.x?(e.min.x=t.x,n=!0):t.x>e.max.x&&(e.max.x=t.x,n=!0),t.y<e.min.y?(e.min.y=t.y,n=!0):t.y>e.max.y&&(e.max.y=t.y,n=!0),((0===t.x||t.x===Gn)&&t.x===r.x)!=((0===t.y||t.y===Gn)&&t.y===r.y)&&this.processBorderOverlap(t,r),n&&this.checkBorderIntersection(t,r)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,fr(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>Gn!=e.x>Gn&&this.addBorderIntersection(1,fr(t.y,e.y,(Gn-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,fr(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>Gn!=e.y>Gn&&this.addBorderIntersection(3,fr(t.x,e.x,(Gn-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const r=this.borders[e];t<r[0]&&(r[0]=t),t>r[1]&&(r[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const r=0===e.x?0:1;this.addBorderIntersection(r,t.y),this.addBorderIntersection(r,e.y)}else{const r=0===e.y?2:3;this.addBorderIntersection(r,t.x),this.addBorderIntersection(r,e.x)}}centroid(){return 0===this.accCount?new Te(0,0):new Te(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0):0}}function dp(e,t){const r=e.add(t)._unit(),n=De(e.x*r.x+e.y*r.y,-1,1);var i,o,a;return a=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(a)))/4*tp*((i=e).x*(o=t).y-i.y*o.x<0?-1:1)}const hp=[e=>e.x<0,e=>e.x>Gn,e=>e.y<0,e=>e.y>Gn];function fp(e,t,r,n){const i=[4];if(0===n)return i;r._mult(n);const o=e.sub(r),a=t.sub(r),s=[e,t,o,a];for(let e=0;e<4;e++)for(const t of s)if(hp[e](t)){i.push(e);break}return i}class pp{constructor(e){this.groundRadiusArray=null,this.groundRadiusBuffer=null,this.vertexArray=new Ws,this.indexArray=new ll,this.programConfigurations=new pc(e.layers,{zoom:e.zoom,lut:e.lut},(e=>Qf.includes(e))),this._segments=new Bl,this.hiddenByLandmarkVertexArray=new wl,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Bl}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,r,n=!1){const i=e.length;if(i>2){let o=Math.max(0,this._segments.get().length-1);const a=this._segments._prepareSegment(4*i,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let s;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],r=e[1];s=dp(t.sub(e[i-1])._perp()._unit(),r.sub(t)._perp()._unit())}for(let l=0;l<i;l++){const c=l===i-1?0:l+1,u=e[l],d=e[c],h=e[c===i-1?0:c+1],f=d.sub(u)._perp()._unit(),p=dp(f,h.sub(d)._perp()._unit()),g=s,m=p;if(vp(u,d,t)||n&&bp(u,t)&&bp(d,t)){s=p;continue}const y=a.vertexLength;ap(this.vertexArray,u,d,1,1,g),ap(this.vertexArray,u,d,1,0,g),ap(this.vertexArray,u,d,0,1,m),ap(this.vertexArray,u,d,0,0,m),a.vertexLength+=4;const _=fp(u,d,f,r);for(const e of _)this._segmentToGroundQuads[o].push({id:y,region:e}),this._segmentToRegionTriCounts[o][e]+=2,a.primitiveLength+=2;s=p}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort(((e,t)=>e.region-t.region));for(let r=0;r<t;r++){const t=this._segmentToGroundQuads[r],n=e[r],i=this._segmentToRegionTriCounts[r];i.reduce(((e,t)=>e+t),0);let o=0;for(let e=0;e<=4;e++){const t=i[e];if(0!==t){let r=this.regionSegments[e];r||(r=this.regionSegments[e]=new Bl);const i={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+o,vertexLength:n.vertexLength,primitiveLength:t};r.get().push(i)}o+=t}for(let e=0;e<t.length;e++){const r=t[e].id;this.indexArray.emplaceBack(r,r+1,r+3),this.indexArray.emplaceBack(r,r+3,r+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,r,n,i,o,a){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,r,n,i,o,void 0,a)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,Pf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),null!=this.groundRadiusArray&&(this.groundRadiusBuffer=e.createVertexBuffer(this.groundRadiusArray,Af.members)))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,r,n,i,o,a,s){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,r,n,i,o,a,s)}updateHiddenByLandmark(e){this.updateHiddenByLandmarkRange(e.groundVertexArrayOffset,e.groundVertexCount,!!(e.flags&np))}updateHiddenByLandmarkRange(e,t,r){if(!this.hasData())return;const n=t+e;if(0!==t){for(let t=e;t<n;++t)this.hiddenByLandmarkVertexArray.emplace(t,r?1:0);this._needsHiddenByLandmarkUpdate=!0}}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,Lf.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this.groundRadiusBuffer&&this.groundRadiusBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class gp{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.pixelRatio=e.pixelRatio,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new ll,this.footprintVertices=new Vs,this.footprintSegments=[],this.layoutVertexArray=new Us,this.centroidVertexArray=new Ll,this.wallVertexArray=new Dl,this.indexArray=new ll,this.programConfigurations=new pc(e.layers,{zoom:e.zoom,lut:e.lut},(e=>Jf.includes(e))),this.segments=new Bl,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.groundEffect=new pp(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[],this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,r,n){}populate(e,t,r,n){this.features=[],this.hasPattern=Eh("fill-extrusion",this.layers,this.pixelRatio,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=Gc(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:i,id:o,index:a,sourceLayerIndex:s}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Jc(i,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),l,r))continue;const c={id:o,sourceLayerIndex:s,index:a,geometry:e?l.geometry:Kc(i,r,n),properties:i.properties,type:i.type,patterns:{}},u=this.layoutVertexArray.length,d="Polygon"===Kf[c.type];if(this.hasPattern)this.features.push({featureId:i.id,feature:Ph("fill-extrusion",this.layers,c,this.zoom,this.pixelRatio,t)});else if(this.wallMode)for(const e of c.geometry)for(const o of Xf(e,d))this.addFeature(i.id,c,[o],a,r,{},t.availableImages,n,t.brightness);else this.addFeature(i.id,c,c.geometry,a,r,{},t.availableImages,n,t.brightness);t.featureIndex.insert(i,c.geometry,a,s,this.index,u)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,r,n,i,o){for(const{featureId:e,feature:a}of this.features){const s="Polygon"===Kf[a.type],{geometry:l}=a;if(this.wallMode)for(const c of l)for(const l of Xf(c,s))this.addFeature(e,a,[l],a.index,t,r,n,i,o);else this.addFeature(e,a,l,a.index,t,r,n,i,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,r,n,i,o,a){this.programConfigurations.updatePaintArrays(e,t,i,r,n,o,a,this.worldview),this.groundEffect.update(e,t,i,r,n,o,a,this.worldview)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Df),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,Rf.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,Of.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Cf.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n,i,o,a,s,l){const c=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(t,{})/this.tileToMeter,u=[new Te(0,0),new Te(Gn,Gn)],d=s.projection,h="globe"===d.name,f=this.wallMode||"Polygon"===Kf[t.type],p=new up;p.centroidDataIndex=this.centroidData.length;const g=new cp;g.buildingId=e,t.properties&&t.properties.hasOwnProperty("building_id")&&(g.buildingId=Number(t.properties.building_id));const m=this.layers[0].paint.get("fill-extrusion-base").evaluate(t,{},i)<=0,y=this.layers[0].paint.get("fill-extrusion-height").evaluate(t,{},i);let _;if(g.height=y,g.vertexArrayOffset=this.layoutVertexArray.length,g.groundVertexArrayOffset=this.groundEffect.vertexArray.length,h&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Js),this.wallMode){if(h)return void Ze("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==r.length)return;_=function(e){const t=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,r=function(e){let t=0;const r=e.length;for(let n=0;n<r;n++)t+=(e[(n+1)%r].x-e[n].x)*(e[(n+1)%r].y+e[n].y);return t>=0}(e);r||(e=e.reverse());const n={geometry:[],joinNormals:[],indices:[]},i=[],o=[],a=[];let s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;if(s<(t?3:2))return n;let l,c,u,d,h,f=0;for(;f<s-1&&e[f].equals(e[f+1]);)f++;t&&(l=e[s-2],h=e[f].sub(l)._unit()._perp());for(let r=f;r<s;r++){if(u=r===s-1?t?e[f+1]:void 0:e[r+1],u&&e[r].equals(u))continue;h&&(d=h),l&&(c=l),l=e[r],h=u?u.sub(l)._unit()._perp():d,d=d||h;let n=d.add(h);0===n.x&&0===n.y||n._unit();const p=n.x*h.x+n.y*h.y,g=0!==p?1/p:1/0,m=d.x*h.y-d.y*h.x>0;let y="miter";const _=2;
vendor: 4,763 bytes, line 1
1"miter"===y&&g>_&&(y="bevel"),"bevel"===y&&(g>100&&(y="flipbevel"),g<_&&(y="miter"));const v=(e,t,r,n)=>{const s=new Te(e.x,e.y),l=new Te(e.x,e.y);s.x+=t.x*n,s.y+=t.y*n,l.x-=t.x*Math.max(r,1),l.y-=t.y*Math.max(r,1),a.push(t),i.push(s),o.push(l)};if("miter"===y)n._mult(g),v(l,n,0,0);else if("flipbevel"===y)n=h.mult(-1),v(l,n,0,0),v(l,n.mult(-1),0,0);else{const e=-Math.sqrt(g*g-1),t=m?e:0,r=m?0:e;c&&v(l,d,t,r),u&&v(l,h,t,r)}}n.geometry=[...i,...o.reverse(),i[0]],n.joinNormals=[...a,...a.reverse(),a[a.length-1]];const p=n.geometry.length-1;for(let e=0;e<p/2;e++)if(e+1<p/2){let t=e,r=e+1,i=p-1-e,o=p-2-e;t=0===t?p-1:t-1,r=0===r?p-1:r-1,i=0===i?p-1:i-1,o=0===o?p-1:o-1,n.indices.push(i),n.indices.push(r),n.indices.push(t),n.indices.push(i),n.indices.push(o),n.indices.push(r)}return n}(r[0]),r=[_.geometry]}const v=(e,t)=>e<(t.length-1)/2||e===t.length-1,b=this.wallMode?[r]:Th(r,500);for(let e=b.length-1;e>=0;e--){const t=b[e];(0===t.length||xp(t[0]))&&b.splice(e,1)}let x;if(h)x=Tp(b,u,i);else{x=[];for(const e of b)x.push({polygon:e,bounds:u})}const w=f?this.edgeRadius:0,S=w>0&&this.zoom<17,k=(e,t)=>{if(0===e.length)return!1;const r=e[e.length-1];return t.x===r.x&&t.y===r.y};for(const{polygon:e,bounds:t}of x){let r=0,n=0;for(const t of e)f&&!t[0].equals(t[t.length-1])&&t.push(t[0]),n+=f?t.length-1:t.length;const o=this.segments.prepareSegment((f?5:4)*n,this.layoutVertexArray,this.indexArray);g.footprintSegIdx<0&&(g.footprintSegIdx=this.footprintSegments.length),g.polygonSegIdx<0&&(g.polygonSegIdx=this.polygonSegments.length);const a={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},s=new lp;if(s.vertexOffset=this.footprintVertices.length,s.indexOffset=3*this.footprintIndices.length,s.ringIndices=[],f){const n=[],a=[];r=o.vertexLength;for(let r=0;r<e.length;r++){const l=e[r];l.length&&0!==r&&a.push(n.length/2);const u=[];let f,p;f=l[1].sub(l[0])._perp()._unit(),s.ringIndices.push(l.length-1);for(let e=1;e<l.length;e++){const t=l[e],r=l[e===l.length-1?1:e+1],a=t.clone();if(w){p=r.sub(t)._perp()._unit();const e=f.add(p)._unit(),n=w*Math.min(4,1/(f.x*e.x+f.y*e.y));a.x+=n*e.x,a.y+=n*e.y,a.x=Math.round(a.x),a.y=Math.round(a.y),f=p}if(!m||0!==w&&!S||k(u,a)||u.push(a),ip(this.layoutVertexArray,a.x,a.y,0,0,1,1,0),this.wallMode){const t=v(e,l);op(this.wallVertexArray,_.joinNormals[e],!t)}o.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),n.push(t.x,t.y),h&&sp(this.layoutVertexExtArray,d.projectTilePoint(a.x,a.y,i),d.upVector(i,a.x,a.y))}m&&(0===w||S)&&(0!==u.length&&k(u,u[0])&&u.pop(),this.groundEffect.addData(u,t,c))}const l=this.wallMode?_.indices:Qd(n,a);for(let e=0;e<l.length;e+=3)this.footprintIndices.emplaceBack(s.vertexOffset+l[e+0],s.vertexOffset+l[e+1],s.vertexOffset+l[e+2]),this.indexArray.emplaceBack(r+l[e],r+l[e+2],r+l[e+1]),o.primitiveLength++;s.indexCount+=l.length,s.vertexCount+=this.footprintVertices.length-s.vertexOffset}for(let n=0;n<e.length;n++){const a=e[n];p.startRing(g,a[0]);let s=a.length>4&&wp(a[a.length-2],a[0],a[1]),l=w?yp(a[a.length-2],a[0],a[1],w):0;const u=[];let y,b,x;b=a[1].sub(a[0])._perp()._unit();let S=!0;for(let e=1,n=0;e<a.length;e++){let c=a[e-1],f=a[e];const T=a[e===a.length-1?1:e+1];if(p.appendEdge(g,f,c),vp(f,c,t)){w&&(b=T.sub(f)._perp()._unit(),S=!S);continue}const I=f.sub(c)._perp(),M=I.x/(Math.abs(I.x)+Math.abs(I.y)),E=I.y>0?1:0,P=c.dist(f);if(n+P>32768&&(n=0),w){x=T.sub(f)._perp()._unit();let e=_p(c,f,T,mp(b,x),w);isNaN(e)&&(e=0);const t=f.sub(c)._unit();c=c.add(t.mult(l))._round(),f=f.add(t.mult(-e))._round(),l=e,b=x,m&&this.zoom>=17&&(k(u,c)||u.push(c),k(u,f)||u.push(f))}const A=o.vertexLength,C=a.length>4&&wp(c,f,T);let R=Sp(n,s,S);if(ip(this.layoutVertexArray,c.x,c.y,M,E,0,0,R),ip(this.layoutVertexArray,c.x,c.y,M,E,0,1,R),this.wallMode){const t=v(e-1,a),r=_.joinNormals[e-1];op(this.wallVertexArray,r,t),op(this.wallVertexArray,r,t)}if(n+=P,R=Sp(n,C,!S),s=C,ip(this.layoutVertexArray,f.x,f.y,M,E,0,0,R),ip(this.layoutVertexArray,f.x,f.y,M,E,0,1,R),this.wallMode){const t=v(e,a),r=_.joinNormals[e];op(this.wallVertexArray,r,t),op(this.wallVertexArray,r,t)}if(o.vertexLength+=4,this.indexArray.emplaceBack(A+0,A+1,A+2),this.indexArray.emplaceBack(A+1,A+3,A+2),o.primitiveLength+=2,w){const n=r+(1===e?a.length-2:e-2),i=1===e?r:n+1;if(this.indexArray.emplaceBack(A+1,n,A+3),this.indexArray.emplaceBack(n,i,A+3),o.primitiveLength+=2,void 0===y&&(y=A),!vp(T,a[e],t)){const t=e===a.length-1?y:o.vertexLength;this.indexArray.emplaceBack(A+2,A+3,t),this.indexArray.emplaceBack(A+3,t+1,t),this.indexArray.emplaceBack(A+3,i,t+1),o.primitiveLength+=3}S=!S}if(h){const e=this.layoutVertexExtArray,t=d.projectTilePoint(c.x,c.y,i),r=d.projectTilePoint(f.x,f.y,i),n=d.upVector(i,c.x,c.y),o=d.upVector(i,f.x,f.y);
vendor: 10,338 bytes, line 1
1sp(e,t,n),sp(e,t,n),sp(e,r,o),sp(e,r,o)}}f&&(r+=a.length-1),m&&w&&this.zoom>=17&&(0!==u.length&&k(u,u[0])&&u.pop(),this.groundEffect.addData(u,t,c,w>0))}this.footprintSegments.push(s),a.triangleCount=this.indexArray.length-a.triangleArrayOffset,this.polygonSegments.push(a),++g.footprintSegLen,++g.polygonSegLen}if(g.vertexCount=this.layoutVertexArray.length-g.vertexArrayOffset,g.groundVertexCount=this.groundEffect.vertexArray.length-g.groundVertexArrayOffset,0!==g.vertexCount){if(g.centroidXY=p.borders?rp:this.encodeCentroid(p,g),this.centroidData.push(g),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,o,a,i,l,void 0,this.worldview),this.groundEffect.addPaintPropertiesData(t,n,o,a,i,l,this.worldview),this.maxHeight=Math.max(this.maxHeight,y)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort(((t,r)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[r].borders[e][0]))}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const r=this.centroidData[t],n=+(r.min.y+r.max.y>Gn),i=2*n+(+(r.min.x+r.max.x>Gn)^n);for(let n=0;n<r.polygonSegLen;n++){const o=r.polygonSegIdx+n;e.push({centroidIdx:t,subtile:i,polygonSegmentIdx:o,triangleSegmentIdx:this.polygonSegments[o].triangleSegIdx})}}const t=new ll;e.sort(((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx));let r=0,n=0,i=0;for(const t of e){if(t.triangleSegmentIdx!==r)break;i++}const o=e.length;for(;n!==e.length;){r=e[n].triangleSegmentIdx;let a=0,s=n,l=n;for(let t=s;t<i&&e[t].subtile===a;t++)l++;for(;s!==i;){const n=e[s];a=n.subtile;const o=this.centroidData[n.centroidIdx].min.clone(),c=this.centroidData[n.centroidIdx].max.clone(),u={vertexOffset:this.segments.segments[r].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[r].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let r=s;r<l;r++){const n=e[r],i=this.polygonSegments[n.polygonSegmentIdx],a=this.centroidData[n.centroidIdx].min,s=this.centroidData[n.centroidIdx].max,l=this.indexArray.uint16;for(let e=i.triangleArrayOffset;e<i.triangleArrayOffset+i.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);u.primitiveLength+=i.triangleCount,o.x=Math.min(o.x,a.x),o.y=Math.min(o.y,a.y),c.x=Math.max(c.x,s.x),c.y=Math.max(c.y,s.y)}u.primitiveLength>0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),s=l;for(let t=s;t<i&&e[t].subtile===e[s].subtile;t++)l++}n=i;for(let t=n;t<o&&e[t].triangleSegmentIdx===e[n].triangleSegmentIdx;t++)i++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,r){const n=new Bl;if(this.wallMode){for(const e of this.triangleSubSegments)n.segments.push(e.segment);return n}let i=0,o=0;const a=1<<e.canonical.z;if(t){const r=t.getMinMaxForTile(e);r&&(i=r.min,o=r.max)}o+=this.maxHeight;const s=e.toUnwrapped();let l;const c=[s.canonical.x/a+s.wrap,s.canonical.y/a],u=[(s.canonical.x+1)/a+s.wrap,(s.canonical.y+1)/a],d=(e,t,r)=>[e[0]*(1-r[0])+t[0]*r[0],e[1]*(1-r[1])+t[1]*r[1]],h=[],f=[];for(const e of this.triangleSubSegments){h[0]=e.min.x/Gn,h[1]=e.min.y/Gn,f[0]=e.max.x/Gn,f[1]=e.max.y/Gn;const t=d(c,u,h),a=d(c,u,f);if(0===new xu([t[0],t[1],i],[a[0],a[1],o]).intersectsPrecise(r)){l&&(n.segments.push(l),l=void 0);continue}const s=e.segment;l&&l.vertexOffset!==s.vertexOffset&&(n.segments.push(l),l=void 0),l?(l.vertexLength+=s.vertexLength,l.primitiveLength+=s.primitiveLength):l={vertexOffset:s.vertexOffset,primitiveLength:s.primitiveLength,vertexLength:s.vertexLength,primitiveOffset:s.primitiveOffset,sortKey:void 0,vaos:{}}}return l&&n.segments.push(l),n}encodeCentroid(e,t){const r=e.centroid(),n=t.span(),i=Math.min(7,Math.round(n.x*this.tileToMeter/10)),o=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new Te(De(r.x,1,8191)<<3|i,De(r.y,1,8191)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Te(0,0);const t=e.borders,r=Number.MAX_VALUE;if(t[0][0]!==r||t[1][0]!==r){const e=t[0][0]!==r?0:1;return new Te(6|(t[0][0]!==r?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==r?2:3;return new Te((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==r?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=2147483647,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,r=e.vertexCount+e.vertexArrayOffset,n=e.flags&np?rp:e.centroidXY,i=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==n.y||i!==n.x){for(let e=t;e<r;++e)this.centroidVertexArray.emplace(e,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t,r){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(Gf(this.activeReplacements,n))return;if(this.activeReplacements=n,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=2147483647;const i=[];for(const t of this.activeReplacements){if(t.order<r)continue;const n=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));if(t.footprint.buildingIds)for(const e of this.centroidData)e.flags&np||t.min.x>e.max.x||e.min.x>t.max.x||t.min.y>e.max.y||e.min.y>t.max.y||t.footprint.buildingIds.has(e.buildingId)&&(e.flags|=np);else for(const r of this.centroidData)if(!(r.flags&np||t.min.x>r.max.x||r.min.x>t.max.x||t.min.y>r.max.y||r.min.y>t.max.y))for(let o=0;o<r.footprintSegLen;o++){const a=this.footprintSegments[r.footprintSegIdx+o];if(i.length=0,Ip(this.footprintVertices,a.vertexOffset,a.vertexCount,t.footprintTileId.canonical,e.canonical,i),Hf(t.footprint,i,this.footprintIndices.uint16,a.indexOffset,a.indexCount,-a.vertexOffset,-n)){r.flags|=np;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,r){let n=!1;for(let i=0;i<r.footprintSegLen;i++){const o=this.footprintSegments[r.footprintSegIdx+i];let a=0;for(const r of o.ringIndices){for(let i=a,s=r+a-1;i<r+a;s=i++){const r=this.footprintVertices.int16[2*(i+o.vertexOffset)+0],a=this.footprintVertices.int16[2*(i+o.vertexOffset)+1],l=this.footprintVertices.int16[2*(s+o.vertexOffset)+1];a>t!=l>t&&e<(this.footprintVertices.int16[2*(s+o.vertexOffset)+0]-r)*(t-a)/(l-a)+r&&(n=!n)}a=r}}return n}getHeightAtTileCoord(e,t){let r=Number.NEGATIVE_INFINITY,n=!0;const i=4*(e+Gn)*Gn+(t+Gn);if(this.partLookup.hasOwnProperty(i)){const e=this.partLookup[i];return e?{height:e.height,hidden:!!(e.flags&np)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||o.height<=r||this.footprintContainsPoint(e,t,o)&&(r=o.height,this.partLookup[i]=o,n=!!(o.flags&np));if(r!==Number.NEGATIVE_INFINITY)return{height:r,hidden:n};this.partLookup[i]=void 0}}function mp(e,t){const r=e.add(t)._unit();return e.x*r.x+e.y*r.y}function yp(e,t,r,n){const i=t.sub(e)._perp()._unit(),o=r.sub(t)._perp()._unit();return _p(e,t,r,mp(i,o),n)}function _p(e,t,r,n,i){const o=Math.sqrt(1-n*n);return Math.min(e.dist(t)/3,t.dist(r)/3,i*o/n)}function vp(e,t,r){return e.x<r[0].x&&t.x<r[0].x||e.x>r[1].x&&t.x>r[1].x||e.y<r[0].y&&t.y<r[0].y||e.y>r[1].y&&t.y>r[1].y}function bp(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function xp(e){return e.every((e=>e.x<=0))||e.every((e=>e.x>=Gn))||e.every((e=>e.y<=0))||e.every((e=>e.y>=Gn))}function wp(e,t,r){if(e.x<0||e.x>=Gn||t.x<0||t.x>=Gn||r.x<0||r.x>=Gn)return!1;const n=r.sub(t),i=n.perp(),o=e.sub(t);return(n.x*o.x+n.y*o.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(o.x*o.x+o.y*o.y))>-.866&&i.x*o.x+i.y*o.y<0}function Sp(e,t,r){const n=t?2|e:-3&e;return r?1|n:-2&n}function kp(){const e=Math.PI/32,t=Math.tan(e),r=Mc;return r*Math.sqrt(1+2*t*t)-r}function Tp(e,t,r){const n=1<<r.z,i=Dc(r.x/n),o=Dc((r.x+1)/n),a=zc(r.y/n),s=zc((r.y+1)/n);return function(e,t,r,n,i=0,o){const a=[];if(!e.length||!r||!n)return a;const s=(e,t)=>{for(const r of e)a.push({polygon:r,bounds:t})},l=Math.ceil(Math.log2(r)),c=Math.ceil(Math.log2(n)),u=l-c,d=[];for(let e=0;e<Math.abs(u);e++)d.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)d.push(0),d.push(1);let h=e;if(h=pf(h,t[0].y-i,t[1].y+i,1),h=pf(h,t[0].x-i,t[1].x+i,0),!h.length)return a;const f=[];for(d.length?f.push({polygons:h,bounds:t,depth:0}):s(h,t);f.length;){const e=f.pop(),t=e.depth,r=d[t],n=e.bounds[0],a=e.bounds[1],l=0===r?n.x:n.y,c=0===r?a.x:a.y,u=o?o(r,l,c):.5*(l+c),h=pf(e.polygons,l-i,u+i,r),p=pf(e.polygons,u-i,c+i,r);if(h.length){const e=[n,new Te(0===r?u:a.x,1===r?u:a.y)];d.length>t+1?f.push({polygons:h,bounds:e,depth:t+1}):s(h,e)}if(p.length){const e=[new Te(0===r?u:n.x,1===r?u:n.y),a];d.length>t+1?f.push({polygons:p,bounds:e,depth:t+1}):s(p,e)}}return a}(e,t,Math.ceil((o-i)/11.25),Math.ceil((a-s)/11.25),1,((e,t,i)=>{if(0===e)return.5*(t+i);{const e=zc((r.y+t/Gn)/n);return(Lc(.5*(zc((r.y+i/Gn)/n)+e))*n-r.y)*Gn}}))}function Ip(e,t,r,n,i,o){const a=Math.pow(2,n.z-i.z);for(let s=0;s<r;s++){let r=e.int16[2*(s+t)+0],l=e.int16[2*(s+t)+1];r=(r+i.x*Gn)*a-n.x*Gn,l=(l+i.y*Gn)*a-n.y*Gn,o.push(new Te(r,l))}}let Mp,Ep;ea(gp,"FillExtrusionBucket",{omit:["layers","features"]}),ea(cp,"PartData"),ea(lp,"FootprintSegment"),ea(up,"BorderCentroidData"),ea(pp,"GroundEffect");class Pp extends Te{constructor(e,t,r){super(e,t),this.z=r}}class Ap extends Pp{constructor(e,t,r,n){super(e,t,r),this.w=n}}function Cp(e,t,r,n){const i="x"===r?"y":"x",o=(n-e[r])/(t[r]-e[r]);e[i]=Math.round(e[i]+(t[i]-e[i])*o),e[r]=n,e.hasOwnProperty("z")&&(e.z=fr(e.z,t.z,o)),e.hasOwnProperty("w")&&(e.w=fr(e.w,t.w,o))}function Rp(e,t,r,n){const i=r,o=n;for(const r of["x","y"]){let n=e,a=t;n[r]>=a[r]&&(n=t,a=e),n[r]<i&&a[r]>i&&Cp(n,a,r,i),n[r]<o&&a[r]>o&&Cp(a,n,r,o)}}function Lp(e,t,r,n,i,o){const a=[];for(let s=0;s<e.length;s++){const l=e[s];let c;const u=a.length;let d=0;for(let e=0;e<l.length-1;e++){let u=l[e],h=l[e+1],f=0;const p=d;let g,m;
1o&&(f=Math.hypot(h.x-u.x,h.y-u.y),d+=f,g=u,m=h),u.x<t&&h.x<t||(u.x<t?u=new Te(t,u.y+(t-u.x)/(h.x-u.x)*(h.y-u.y))._round():h.x<t&&(h=new Te(t,u.y+(t-u.x)/(h.x-u.x)*(h.y-u.y))._round()),u.y<r&&h.y<r||(u.y<r?u=new Te(u.x+(r-u.y)/(h.y-u.y)*(h.x-u.x),r)._round():h.y<r&&(h=new Te(u.x+(r-u.y)/(h.y-u.y)*(h.x-u.x),r)._round()),u.x>=n&&h.x>=n||(u.x>=n?u=new Te(n,u.y+(n-u.x)/(h.x-u.x)*(h.y-u.y))._round():h.x>=n&&(h=new Te(n,u.y+(n-u.x)/(h.x-u.x)*(h.y-u.y))._round()),u.y>=i&&h.y>=i||(u.y>=i?u=new Te(u.x+(i-u.y)/(h.y-u.y)*(h.x-u.x),i)._round():h.y>=i&&(h=new Te(u.x+(i-u.y)/(h.y-u.y)*(h.x-u.x),i)._round()),c&&u.equals(c[c.length-1])||(c=[u],a.push(c),o&&o.push({progress:{min:p+Dp(g,m,u)*f,max:1},parentIndex:s,prevPoint:g,nextPoint:m})),c.push(h),o&&(o[o.length-1].progress.max=p+Dp(g,m,h)*f,o[o.length-1].nextPoint=m)))))}if(o&&d>0)for(let e=u;e<a.length;e++)o[e].progress.min/=d,o[e].progress.max/=d}return a}function Op(e,t,r,n,i){if(e.length<2)return void n.push(e);const o=[];for(;t.valid();){const[r,n]=t.get();for(let t=0;t<e.length-1;t++){const i=e[t],a=e[t+1],s=Ou(i,a,r,n);if(s){const[e]=s,r=new Te(fr(i.x,a.x,e),fr(i.y,a.y,e));o.push({t:t+e,distance:0,point:r})}}t.next()}if(0===o.length)return void n.push(e);o.sort(((e,t)=>e.t-t.t));let a=0,s=0,l=[];for(n.push(l);a!==e.length;){if(s===o.length){for(;a!==e.length;)0!==l.length&&l[l.length-1].equals(e[a])||l.push(e[a]),a++;break}o[s].t<=a?(0!==l.length&&l[l.length-1].equals(o[s].point)||l.push(o[s].point),Math.trunc(o[s].t),s++):(0!==l.length&&l[l.length-1].equals(e[a])||l.push(e[a]),a++)}}function Dp(e,t,r){return e.x!==t.x?(r.x-e.x)/(t.x-e.x):e.y!==t.y?(r.y-e.y)/(t.y-e.y):0}function zp(e,t){return e.x*t.x+e.y*t.y}function Fp(e,t){if(1===e.length){let r=0;const n=t[r++];let i;for(;!i||n.equals(i);)if(i=t[r++],!i)return 1/0;for(;r<t.length;r++){const o=t[r],a=e[0],s=i.sub(n),l=o.sub(n),c=a.sub(n),u=zp(s,s),d=zp(s,l),h=zp(l,l),f=zp(c,s),p=zp(c,l),g=u*h-d*d,m=(h*f-d*p)/g,y=(u*p-d*f)/g,_=n.z*(1-m-y)+i.z*m+o.z*y;if(isFinite(_))return _}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}function Np(e,t,r){let n=1/0;Pu(r,t)&&(n=Fp(r,t[0]));for(let i=0;i<t.length;i++){const o=t[i],a=e[i];for(let e=0;e<o.length-1;e++){const t=o[e],i=[t,o[e+1],a[e+1],a[e],t];Mu(r,i)&&(n=Math.min(n,Fp(r,i)))}}return n!==1/0&&n}function Bp(e,t,r,n,i,o,a,s,l,c,u){return"globe"===e.projection.name?function(e,t,r,n,i,o,a,s,l,c,u){const d=[],h=[],f=e.projection.upVectorScale(u,e.center.lat,e.worldSize).metersToTile,p=[0,0,0,1],g=[0,0,0,1],m=(e,t,r,n)=>{e[0]=t,e[1]=r,e[2]=n,e[3]=1},y=kp();r>0&&(r+=y),n+=y;for(const y of t){const t=[],_=[];for(const d of y){const h=d.x+i.x,y=d.y+i.y,v=e.projection.projectTilePoint(h,y,u),b=e.projection.upVector(u,d.x,d.y);let x=r,w=n;if(a){const e=jp(h,y,r,n,a,s,l,c);x+=e.base,w+=e.top}0!==r?m(p,v.x+b[0]*f*x,v.y+b[1]*f*x,v.z+b[2]*f*x):m(p,v.x,v.y,v.z),m(g,v.x+b[0]*f*w,v.y+b[1]*f*w,v.z+b[2]*f*w),G(p,p,o),G(g,g,o),t.push(new Pp(p[0],p[1],p[2])),_.push(new Pp(g[0],g[1],g[2]))}d.push(t),h.push(_)}return[d,h]}(e,t,r,n,i,o,a,s,l,c,u):a?function(e,t,r,n,i,o,a,s,l){const c=[],u=[],d=[0,0,0,1];for(const h of e){const e=[],f=[];for(const c of h){const u=c.x+n.x,h=c.y+n.y,p=jp(u,h,t,r,o,a,s,l);d[0]=u,d[1]=h,d[2]=p.base,d[3]=1,ee(d,d,i),d[3]=Math.max(d[3],1e-5);const g=new Pp(d[0]/d[3],d[1]/d[3],d[2]/d[3]);d[0]=u,d[1]=h,d[2]=p.top,d[3]=1,ee(d,d,i),d[3]=Math.max(d[3],1e-5);const m=new Pp(d[0]/d[3],d[1]/d[3],d[2]/d[3]);e.push(g),f.push(m)}c.push(e),u.push(f)}return[c,u]}(t,r,n,i,o,a,s,l,c):function(e,t,r,n,i){const o=[],a=[],s=i[8]*t,l=i[9]*t,c=i[10]*t,u=i[11]*t,d=i[8]*r,h=i[9]*r,f=i[10]*r,p=i[11]*r;for(const t of e){const e=[],r=[];for(const o of t){const t=o.x+n.x,a=o.y+n.y,g=i[0]*t+i[4]*a+i[12],m=i[1]*t+i[5]*a+i[13],y=i[2]*t+i[6]*a+i[14],_=i[3]*t+i[7]*a+i[15],v=g+s,b=m+l,x=y+c,w=Math.max(_+u,1e-5),S=g+d,k=m+h,T=y+f,I=Math.max(_+p,1e-5);e.push(new Pp(v/w,b/w,x/w)),r.push(new Pp(S/I,k/I,T/I))}o.push(e),a.push(r)}return[o,a]}(t,r,n,i,o)}function jp(e,t,r,n,i,o,a,s){const l=a*i.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?a*(o[0]/7-450):a*function(e,t,r){const n=Math.floor(t[0]/8),i=Math.floor(t[1]/8),o=10*(t[0]-8*n),a=10*(t[1]-8*i),s=e.getElevationAt(n,i,!0,!0),l=e.getMeterToDEM(r),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(a*l-1)),d=e.tileCoordToPixel(n,i),h=2*c+1,f=2*u+1,p=function(e,t,r,n,i){return[e.getElevationAtPixel(t,r,!0),e.getElevationAtPixel(t+i,r,!0),e.getElevationAtPixel(t,r+i,!0),e.getElevationAtPixel(t+n,r+i,!0)]}(e,d.x-c,d.y-u,h,f),g=Math.abs(p[0]-p[1]),m=Math.abs(p[2]-p[3]),y=Math.abs(p[0]-p[2])+Math.abs(p[1]-p[3]),_=Math.min(.25,.5*l*(g+m)/h),v=Math.min(.25,.5*l*y/f);return s+Math.max(_*o,v*a)}(i,o,s):l;return{base:l+(0===r?-1:r),top:c?Math.max(u+n,l+r+2):l+n}}class Vp{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class Gp{constructor(){this.tasks={},this.taskQueue=[],Ge(["process"],this),this.invoker=new Vp(this.process),this.nextId=0}add(e,t){const r=this.nextId++,n=function({type:e,isSymbolTile:t,zoom:r}){return r=r||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-r:"maybePrepare"===e&&t?400-r:500:200-r:100-r}(t);if(0===n){try{e()}finally{}return null}return this.tasks[r]={fn:e,metadata:t,priority:n,id:r},this.taskQueue.push(r),this.invoker.trigger(),{cancel:()=>{delete this.tasks[r]}}}process(){try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let r=0;r<this.taskQueue.length;r++){const n=this.tasks[this.taskQueue[r]];n.priority<t&&(t=n.priority,e=r)}if(null===e)return null;const r=this.taskQueue[e];return this.taskQueue.splice(e,1),r}remove(){this.invoker.remove()}}class Up{constructor(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.cancelCallbacks={},Ge(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler
1=new Gp}send(e,t,r,n,i=!1,o){const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(r.metadata=o,this.callbacks[a]=r);const s=new Set;return this.target.postMessage({id:a,type:e,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:ra(t,s)},s),{cancel:()=>{r&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(e){const t=e.data;if(!t)return;const r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[r];delete this.cancelCallbacks[r],e&&e.cancel()}else if(t.mustQueue||Je(self)){const e=this.callbacks[r],n=this.scheduler.add((()=>this.processTask(r,t)),e&&e.metadata||{type:"message"});n&&(this.cancelCallbacks[r]=n)}else this.processTask(r,t)}processTask(e,t){if(delete this.cancelCallbacks[e],"<response>"===t.type){const r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(na(t.error)):r(null,na(t.data)))}else{const r=new Set,n=t.hasCallback?(t,n)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?ra(t):null,data:ra(n,r)},r)}:()=>{},i=na(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,i,n);else if(this.parent.getWorkerSource){const e=t.type.split("."),{source:r,scope:o}=i;this.parent.getWorkerSource(t.sourceMapId,e[0],r,o)[e[1]](i,n)}else n(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}var $p={workerUrl:"",workerClass:null,workerParams:void 0};function Hp(e){return null!=$p.workerClass?new $p.workerClass:new self.Worker($p.workerUrl,Object.assign({name:e},$p.workerParams))}const qp="mapboxgl_preloaded_worker_pool";class Wp{constructor(e){this.active={},this.name=e}acquire(e,t=Wp.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<t;){const t=Hp(`${this.name||""}WorkerPool: ${e}-${this.workers.length}`);this.workers.push(t)}return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[qp]}numActive(){return Object.keys(this.active).length}}Wp.workerCount=2;class Zp{constructor(e,t,r="Worker",n=Wp.workerCount){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=je();const i=this.workerPool.acquire(this.id,n);for(let e=0;e<i.length;e++){const n=new Zp.Actor(i[e],t,this.id);n.name=`${r} ${e}`,this.actors.push(n)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(e,t,r){Ne(this.actors,((r,n)=>{r.send(e,t,n)}),r=r||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}let Yp,Xp;function Kp(){return Yp||(Yp=new Wp),Yp}Zp.Actor=Up;const Jp=4096;class Qp{constructor(e){this.module=e,this.memoryStack=this.module.malloc(Jp),this.memoryStackNextFree=this.memoryStack}createIntArray(e){const t=this.memoryStackNextFree;return this.memoryStackNextFree+=e.length*Int32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>Jp?-1:(new Int32Array(this.module.heap32.buffer,t,e.length).set(e),t)}createFloatArray(e){const t=this.memoryStackNextFree;return this.memoryStackNextFree+=e.length*Float32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>Jp?-1:(new Float32Array(this.module.heapF32.buffer,t,e.length).set(e),t)}readStringBuffer(e){let t="";for(;0!==this.module.heapU8[e];)t+=String.fromCharCode(this.module.heapU8[e]),++e;return t}setStyle(e){const t=e.normalScale;this.module.setStyle(t[0],t[1],t[2],e.tileToMeters)}setAOOptions(e,t){this.module.setAOOptions(e?1:0,t)}setMetricOptions(e,t){this.module.setMetricOptions(e?1:0,t)}setStructuralOptions(e){this.module.setStructuralOptions(e?1:0)}setFacadeOptions(e,t){this.module.setFacadeOptions(e,t?1:0)}setFauxFacadeOptions(e,t,r){this.module.setFauxFacadeOptions(e?1:0,t?1:0,r)}setFacadeClassifierOptions(e){this.module.setFacadeClassifierOptions(e)}generateMesh(e,t){this.memoryStackNextFree=this.memoryStack;for(const t of e){const e=this.createIntArray(t.ringIndices),r=this.createFloatArray(t.coordinates);if(-1===e||-1===r)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFeature(t.id,t.sourceId,t.minHeight,t.height,t.roofType,r,e,t.ringIndices.length-1)}for(const e of t){let t;t=e.entrances?JSON.parse(e.entrances):[];const r=this.createFloatArray(t),n=this.createFloatArray(e.coordinates);if(-1===r||-1===n)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFacade(e.sourceId,e.crossPerc,e.distanceToRoad,r,t.length,n,e.coordinates.length)}if(!this.module.generateMesh()){const e=this.module.getLastError();return this.readStringBuffer(e)}
1const r=this.module.getMeshCount(),n=new Array(r);for(let e=0;e<r;e++){const t=this.module.getPositionsPtr(e),r=this.module.getPositionsLength(e),i=new Float32Array(this.module.heapF32.buffer,t,r),o=this.module.getNormalsPtr(e),a=this.module.getNormalsLength(e),s=new Float32Array(this.module.heapF32.buffer,o,a),l=this.module.getAOPtr(e),c=this.module.getAOLength(e),u=new Float32Array(this.module.heapF32.buffer,l,c),d=this.module.getUVPtr(e),h=this.module.getUVLength(e),f=new Float32Array(this.module.heapF32.buffer,d,h),p=this.module.getFauxFacadePtr(e),g=this.module.getFauxFacadeLength(e),m=new Uint8Array(this.module.heapU8.buffer,p,g),y=this.module.getIndicesPtr(e),_=this.module.getIndicesLength(e),v=new Int16Array(this.module.heap16.buffer,y,_),b=this.module.getBuildingPart(e);n[e]={positions:i,normals:s,ao:u,uv:f,isFauxFacade:m,indices:v,buildingPart:b}}const i=this.module.getRingCount(),o=[];for(let e=0;e<i;e++){const t=this.module.getRingPtr(e),r=this.module.getRingLength(e),n=new Float32Array(this.module.heapF32.buffer,t,r);o.push(n)}return{meshes:n,outerRingLength:this.module.getOuterRingLength(),modifiedPolygonRings:o}}}let eg,tg,rg,ng,ig,og=null,ag=null,sg=null,lg=null;function cg(){return Je(self)&&self.worker.dracoUrl?self.worker.dracoUrl:tg||st.DRACO_URL}function ug(){if(Je(self)&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(ng)return ng;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return ng=WebAssembly.validate(e)?st.MESHOPT_SIMD_URL:st.MESHOPT_URL,ng}function dg(){return lg}const hg=5120,fg=5121,pg=5122,gg=5123,mg=5125,yg=5126,_g={[hg]:Int8Array,[fg]:Uint8Array,[pg]:Int16Array,[gg]:Uint16Array,[mg]:Uint32Array,[yg]:Float32Array},vg={[hg]:"DT_INT8",[fg]:"DT_UINT8",[pg]:"DT_INT16",[gg]:"DT_UINT16",[mg]:"DT_UINT32",[yg]:"DT_FLOAT32"},bg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function xg(e,t,r){const n=r.json.bufferViews.length,i=r.buffers.length;t.bufferView=n,r.json.bufferViews[n]={buffer:i,byteLength:e.byteLength},r.buffers[i]=e}const wg="KHR_draco_mesh_compression";function Sg(e,t){const r=e.extensions&&e.extensions[wg];if(!r)return;const n=new rg.Decoder,i=Ag(t,r.bufferView),o=new rg.Mesh;if(!n.DecodeArrayToMesh(i,i.byteLength,o))throw new Error("Failed to decode Draco mesh");const a=t.json.accessors[e.indices],s=_g[a.componentType],l=a.count*s.BYTES_PER_ELEMENT,c=rg._malloc(l);s===Uint16Array?n.GetTrianglesUInt16Array(o,l,c):n.GetTrianglesUInt32Array(o,l,c),xg(rg.memory.buffer.slice(c,c+l),a,t),rg._free(c);for(const i of Object.keys(r.attributes)){const a=n.GetAttributeByUniqueId(o,r.attributes[i]),s=t.json.accessors[e.attributes[i]],l=vg[s.componentType],c=s.count*bg[s.type]*_g[s.componentType].BYTES_PER_ELEMENT,u=rg._malloc(c);n.GetAttributeDataArrayForAllPoints(o,a,rg[l],c,u),xg(rg.memory.buffer.slice(u,u+c),s,t),rg._free(u)}n.destroy(),o.destroy(),delete e.extensions[wg]}const kg="EXT_meshopt_compression";function Tg(e,t){if(!e.extensions||!e.extensions[kg])return;const r=e.extensions[kg],n=new Uint8Array(t.buffers[r.buffer],r.byteOffset||0,r.byteLength||0),i=new Uint8Array(r.count*r.byteStride);ig.decodeGltfBuffer(i,r.count,r.byteStride,n,r.mode,r.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=i.buffer,delete e.extensions[kg]}const Ig=1179937895,Mg=new TextDecoder("utf8");function Eg(e,t){return new URL(e,t).href}function Pg(e,t,r,n){return fetch(Eg(e.uri,n)).then((e=>e.arrayBuffer())).then((e=>{t.buffers[r]=e}))}function Ag(e,t){const r=e.json.bufferViews[t];return new Uint8Array(e.buffers[r.buffer],r.byteOffset||0,r.byteLength)}function Cg(e,t,r,n){if(e.uri){const i=Eg(e.uri,n);return fetch(i).then((e=>e.blob())).then((e=>createImageBitmap(e))).then((e=>{t.images[r]=e}))}if(void 0!==e.bufferView){const n=Ag(t,e.bufferView),i=new Blob([n],{type:e.mimeType});return createImageBitmap(i).then((e=>{t.images[r]=e}))}}function Rg(e,t=0,r){const n={json:null,images:[],buffers:[]};
1if(new Uint32Array(e,t,1)[0]===Ig){const r=new Uint32Array(e,t);let i=2;const o=(r[i++]>>2)-3,a=r[i++]>>2;if(i++,n.json=JSON.parse(Mg.decode(r.subarray(i,i+a))),i+=a,i<o){const o=r[i++];i++;const a=t+(i<<2);n.buffers[0]=e.slice(a,a+o)}}else n.json=JSON.parse(Mg.decode(new Uint8Array(e,t)));const{buffers:i,images:o,meshes:a,extensionsUsed:s,bufferViews:l}=n.json;let c=Promise.resolve();if(i){const e=[];for(let t=0;t<i.length;t++){const o=i[t];o.uri?e.push(Pg(o,n,t,r)):n.buffers[t]||(n.buffers[t]=null)}c=Promise.all(e)}return c.then((()=>{const e=[],t=s&&s.includes(wg),i=s&&s.includes(kg);if(t&&e.push(function(){if(!rg)return null!=eg?eg:(eg=function(e){let t,r=null;function n(){t=new Uint8Array(r.buffer)}function i(){throw new Error("Unexpected Draco error.")}const o={a:{a:i,d:function(e,r,n){return t.copyWithin(e,r,r+n)},c:function(e){const i=t.length,o=Math.max(e>>>0,Math.ceil(1.2*i)),a=Math.ceil((o-i)/65536);try{return r.grow(a),n(),!0}catch(e){return!1}},b:i}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,o):e.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,o)))).then((e=>{const{Rb:i,Qb:o,P:a,T:s,X:l,Ja:c,La:u,Qa:d,Va:h,Wa:f,eb:p,jb:g,f:m,e:y,yb:_,zb:v,Ab:b,Bb:x,Db:w,Gb:S}=e.instance.exports;r=y;const k=(()=>{let e=0,r=0,n=0,a=0;return s=>{n&&(i(a),i(e),r+=n,n=e=0),e||(r+=128,e=o(r));const l=s.length+7&-8;let c=e;l>=r&&(n=l,c=a=o(l));for(let e=0;e<s.length;e++)t[c+e]=s[e];return c}})();return n(),m(),{memory:y,_free:i,_malloc:o,Mesh:class{constructor(){this.ptr=a()}destroy(){s(this.ptr)}},Decoder:class{constructor(){this.ptr=c()}destroy(){g(this.ptr)}DecodeArrayToMesh(e,t,r){const n=k(e),i=u(this.ptr,n,t,r.ptr);return!!l(i)}GetAttributeByUniqueId(e,t){return{ptr:d(this.ptr,e.ptr,t)}}GetTrianglesUInt16Array(e,t,r){h(this.ptr,e.ptr,t,r)}GetTrianglesUInt32Array(e,t,r){f(this.ptr,e.ptr,t,r)}GetAttributeDataArrayForAllPoints(e,t,r,n,i){p(this.ptr,e.ptr,t.ptr,r,n,i)}},DT_INT8:_(),DT_UINT8:v(),DT_INT16:b(),DT_UINT16:x(),DT_UINT32:w(),DT_FLOAT32:S()}}))}(fetch(cg())),eg.then((e=>{rg=e,eg=void 0})))}()),i&&e.push(function(){if(ig)return;const e=function(e){let t;const r=WebAssembly.instantiateStreaming(e,{}).then((e=>{t=e.instance,t.exports.__wasm_call_ctors()})),n={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},i={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:r,supported:!0,decodeGltfBuffer(e,r,o,a,s,l){!function(e,t,r,n,i,o,a){const s=e.exports.sbrk,l=n+3&-4,c=s(l*i),u=s(o.length),d=new Uint8Array(e.exports.memory.buffer);d.set(o,u);const h=t(c,n,i,u,o.length);if(0===h&&a&&a(c,l,i),r.set(d.subarray(c,c+n*i)),s(c-s(0)),0!==h)throw new Error(`Malformed buffer data: ${h}`)}(t,t.exports[i[s]],e,r,o,a,t.exports[n[l]])}}}(fetch(ug()));return e.ready.then((()=>{ig=e}))}()),o)for(let t=0;t<o.length;t++)e.push(Cg(o[t],n,t,r));return(e.length?Promise.all(e):Promise.resolve()).then((()=>
1{if(t&&a)for(const{primitives:e}of a)for(const t of e)Sg(t,n);if(i&&a&&l)for(const e of l)Tg(e,n);return n}))}))}function Lg(e){return fetch(e).then((e=>e.arrayBuffer())).then((t=>Rg(t,0,e)))}function Og(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function Dg(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class zg{constructor(e,t,r,n){this.context=e,this.format=r,this.useMipmap=n&&n.useMipmap,this.texture=e.gl.createTexture(),this.update(t,{premultiply:n&&n.premultiply})}update(e,t){const r=e&&e instanceof HTMLVideoElement&&0===e.width?e.videoWidth:e.width,n=e&&e instanceof HTMLVideoElement&&0===e.height?e.videoHeight:e.height,{context:i}=this,{gl:o}=i,{x:a,y:s}=t&&t.position?t.position:{x:0,y:0},l=a+r,c=s+n;!this.size||this.size[0]===l&&this.size[1]===c||(o.bindTexture(o.TEXTURE_2D,null),o.deleteTexture(this.texture),this.texture=o.createTexture(),this.size=null),o.bindTexture(o.TEXTURE_2D,this.texture),i.pixelStoreUnpackFlipY.set(!1),i.pixelStoreUnpack.set(1),i.pixelStoreUnpackPremultiplyAlpha.set(this.format===o.RGBA8&&(!t||!1!==t.premultiply));const u=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&l>0&&c>0){const e=this.useMipmap?Math.floor(Math.log2(Math.max(l,c)))+1:1;o.texStorage2D(o.TEXTURE_2D,e,this.format,l,c),this.size=[l,c]}this.size&&(u?o.texSubImage2D(o.TEXTURE_2D,0,a,s,Og(this.format),Dg(this.format),e):"data"in e&&e.data&&o.texSubImage2D(o.TEXTURE_2D,0,a,s,r,n,Og(this.format),Dg(this.format),e.data)),this.useMipmap&&o.generateMipmap(o.TEXTURE_2D)}bind(e,t,r=!1){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),e!==this.minFilter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,this.useMipmap&&!r?e===i.NEAREST?i.NEAREST_MIPMAP_NEAREST:i.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,r,n,i){const{context:o}=this,{gl:a}=o;a.bindTexture(a.TEXTURE_2D,this.texture),t!==this.magFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.useMipmap?e===a.NEAREST?a.NEAREST_MIPMAP_NEAREST:a.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),r!==this.wrapS&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,r),this.wrapS=r),n!==this.wrapT&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,n),this.wrapT=n),i!==this.compareMode&&(i?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_COMPARE_MODE,a.COMPARE_REF_TO_TEXTURE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_COMPARE_FUNC,i)):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_COMPARE_MODE,a.NONE),this.compareMode=i)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class Fg{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}}const Ng=Bs([{name:"a_pos_3f",components:3,type:"Float32"}]),Bg=Bs([{name:"a_color_3f",components:3,type:"Float32"}]),jg=Bs([{name:"a_color_4f",components:4,type:"Float32"}]),Vg=Bs([{name:"a_uv_2f",components:2,type:"Float32"}]),Gg=Bs([{name:"a_normal_3f",components:3,type:"Float32"}]),Ug=Bs([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),$g=Bs([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);function Hg(e,t){const r=Wg(e.projection,e.zoom,e.width,e.height),n=function(e,t,r,n,i){const o=new Pc(r.lng-180*Zg,r.lat),a=new Pc(r.lng+180*Zg,r.lat),s=e.project(o.lng,o.lat),l=e.project(a.lng,a.lat),u=-Math.atan2(l.y-s.y,l.x-s.x),h=Uc.fromLngLat(r);h.y=De(h.y,-1+Zg,1-Zg);const p=h.toLngLat(),g=e.project(p.lng,p.lat),y=Uc.fromLngLat(p);y.x+=Zg;const _=y.toLngLat(),v=e.project(_.lng,_.lat),b=Xg(v.x-g.x,v.y-g.y,u),x=Uc.fromLngLat(p);x.y+=Zg;const w=x.toLngLat(),S=e.project(w.lng,w.lat),k=Xg(S.x-g.x,S.y-g.y,u),T=Math.abs(b.x)/Math.abs(k.y),I=c([]);m(I,I,-u*(1-(i?0:n)));const M=c([]);
vendor: 5,232 bytes, line 1
1return f(M,M,[1,1-(1-T)*n,1]),M[4]=-k.x/k.y*n,m(M,M,u),d(M,I,M),M}(e.projection,0,e.center,r,t),i=qg(e);return f(n,n,[i,i,1]),n}function qg(e){const t=e.projection,r=Wg(e.projection,e.zoom,e.width,e.height),n=Yg(t,e.center),i=Yg(t,Pc.convert(t.center));return Math.pow(2,n*r+(1-r)*i)}function Wg(e,t,r,n,i=1/0){const o=e.range;if(!o)return 0;const a=Math.min(i,Math.max(r,n)),s=Math.log2(a/1024);return ze(o[0]+s,o[1]+s,t)}const Zg=1/4e4;function Yg(e,t){const r=De(t.lat,-85.051129,Nc),n=new Pc(t.lng-180*Zg,r),i=new Pc(t.lng+180*Zg,r),o=e.project(n.lng,r),a=e.project(i.lng,r),s=Uc.fromLngLat(n),l=Uc.fromLngLat(i),c=a.x-o.x,u=a.y-o.y,d=l.x-s.x,h=l.y-s.y,f=Math.sqrt((d*d+h*h)/(c*c+u*u));return Math.log2(f)}function Xg(e,t,r){const n=Math.cos(r),i=Math.sin(r);return{x:e*n-t*i,y:e*i+t*n}}function Kg(e,t,r){c(e),m(e,e,Pe(t[2])),p(e,e,Pe(t[0])),g(e,e,Pe(t[1])),f(e,e,r),d(e,e,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function Jg(e,t,r,n,i,o,a,s){const l=[r[0]-t[0],r[1]-t[1],0],c=[n[0]-t[0],n[1]-t[1],0];if(k(l)<1e-12||k(c)<1e-12)return re(e);const u=j([],l,c);N(u,u),E(c,n,t),l[2]=(o-i)*s,c[2]=(a-i)*s;const d=l;return j(d,l,c),N(d,d),ce(e,u,d)}function Qg(e,t,r=!1){const n=kd(t.zoom),i=function(e,t,r){const n=t.worldSize,i=[e[12],e[13],e[14]],o=zc(i[1]/n),a=Dc(i[0]/n),s=c([]),l=Oc(1,o)*n,u=Oc(1,0)*n*jc(o,t.zoom),p=1/xd(n);let g=u*p;if(r){const e=Wg(t.projection,t.zoom,t.width,t.height,1024);g=p*t.projection.pixelSpaceConversion(t.center.lat,n,e)}const m=Ic(o,a);M(m,m,R([],N([],m),l*g*i[2]));const y=function(e){const t=[e[0],e[1],e[2]];let r=[0,1,0];const n=j([],r,t);return j(r,t,n),0===z(r)&&(r=[0,1,0],j(n,t,r)),N(n,n),N(r,r),N(t,t),[n[0],n[1],n[2],0,r[0],r[1],r[2],0,t[0],t[1],t[2],0,e[0],e[1],e[2],1]}(m);f(s,s,[g,g,g*l]),h(s,s,[-i[0],-i[1],-i[2]]);const _=d([],t.globeMatrix,y);return d(_,_,s),d(_,_,e),_}(e,t,r);if(n>0){const r=function(e,t){const r=t.worldSize,n=Oc(1,0)*r*jc(t.center.lat,t.zoom)/xd(r),i=Oc(1,t.center.lat)*r,o=c([]);g(o,o,Pe(t.center.lng)),p(o,o,Pe(t.center.lat)),h(o,o,[0,0,bc]),f(o,o,[n,n,n*i]);const a=t.point;return h(o,o,[-a.x,-a.y,0]),d(o,o,e),d(o,t.globeMatrix,o)}(e,t);return function(e,t,r){const n=(e,t,r)=>{const n=k(e),i=k(t),o=dd(e,t,r);return R(o,o,1/k(o)*fr(n,i,r))},i=n([e[0],e[1],e[2]],[t[0],t[1],t[2]],r),o=n([e[4],e[5],e[6]],[t[4],t[5],t[6]],r),a=n([e[8],e[9],e[10]],[t[8],t[9],t[10]],r),s=dd([e[12],e[13],e[14]],[t[12],t[13],t[14]],r);return[i[0],i[1],i[2],0,o[0],o[1],o[2],0,a[0],a[1],a[2],0,s[0],s[1],s[2],1]}(i,r,n)}return i}function em(e,t,r,n){const i=xu.projectAabbCorners(n,r);let o=Number.MAX_VALUE;for(let e=0;e<i.length;++e){const r=i[e];r[0]=(.5*r[0]+.5)*t.width,r[1]=(.5-.5*r[1])*t.height,r[2]<o&&(o=r[2])}const a=function(e){const t=[];let r=0;for(let t=1;t<e.length;t++)(e[t][0]<e[r][0]||e[t][0]===e[r][0]&&e[t][1]<e[r][1])&&(r=t);let n,i=r;const o=new Uint8Array(e.length);do{if(o[i])break;t.push(new Te(e[i][0],e[i][1])),o[i]=1,n=(i+1)%e.length;for(let t=0;t<e.length;t++){if(e[t][0]===e[n][0]&&e[t][1]===e[n][1]||e[t][0]===e[i][0]&&e[t][1]===e[i][1])continue;const r=[e[t][0]-e[i][0],e[t][1]-e[i][1]],o=[e[n][0]-e[i][0],e[n][1]-e[i][1]],a=r[0]*o[1]-r[1]*o[0];(a>0||0===a&&r[0]*o[0]+r[1]*o[1]>=0&&r[0]*r[0]+r[1]*r[1]>o[0]*o[0]+o[1]*o[1])&&(n=t)}i=n}while(i!==r);return t.length>0&&t.push(t[0]),t}(i);if(Mu(e,a))return o}const tm=64,rm={CoordinateSpaceTile:1,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function nm(e,t,r,n,i,o,a,s,l,u=!1){const p=r.zoom,g=r.project(n),m=jc(n.lat,p),y=1/m;c(e),h(e,e,[g.x+a[0]*y,g.y+a[1]*y,a[2]]);let _=1,v=1;const x=r.worldSize;if(u){if("mercator"===r.projection.name){let e=0;r.elevation&&(e=r.elevation.getAtPointOrZero(new Uc(g.x/x,g.y/x),0));const t=ee([],[g.x,g.y,e,1],r.projMatrix)[3]/r.cameraToCenterDistance;_=t,v=t*jc(r.center.lat,p)}else if("globe"===r.projection.name){const t=Qg(e,r),i=[0,0,0,1];ee(i,i,d([],r.projMatrix,t));const o=i[3]/r.cameraToCenterDistance,a=kd(p),s=r.projection.pixelsPerMeter(n.lat,x)*jc(n.lat,p),l=r.projection.pixelsPerMeter(r.center.lat,x)*jc(r.center.lat,p);_=o/fr(s,Bc(r.center.lat),a),v=o*m/s,_*=l,v*=l}}else _=y;f(e,e,[_,_,v]);const w=[...e],S=t.orientation,k=[];if(Kg(k,[S[0]+(i?i[0]:0),S[1]+(i?i[1]:0),S[2]+(i?i[2]:0)],o),d(e,w,k),s&&r.elevation){let i=0;const o=[];if(l&&r.elevation){i=function(e,t,r,n,i){const o=t.elevation;if(!o)return 0;const a=xu.projectAabbCorners(r,n),s=Oc(1,i.lat)*t.worldSize,l=function(e,t){const r=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const i of n){const n=e[i.corners[0]],o=e[i.corners[1]],a=e[i.corners[2]],s=[o[0]-n[0],o[1]-n[1],t*(o[2]-n[2])],l=j(s,s,[a[0]-n[0],a[1]-n[1],t*(a[2]-n[2])]);N(l,l),i.dotProductWithUp=B(l,r)}return n.sort(((e,t)=>e.dotProductWithUp-t.dotProductWithUp)),n[0].corners}(a,s),c=a[l[0]],u=a[l[1]],d=a[l[2]],h=a[l[3]],f=o.getAtPointOrZero(new Uc(c[0]/t.worldSize,c[1]/t.worldSize),0),p=o.getAtPointOrZero(new Uc(u[0]/t.worldSize,u[1]/t.worldSize),0),g=o.getAtPointOrZero(new Uc(d[0]/t.worldSize,d[1]/t.worldSize),0),m=o.getAtPointOrZero(new Uc(h[0]/t.worldSize,h[1]/t.worldSize),0),y=(f+m)/2,_=(p+g)/2;return y>
1_?p<g?Jg(e,u,h,c,p,m,f,s):Jg(e,d,c,h,g,f,m,s):f<m?Jg(e,c,u,d,f,p,g,s):Jg(e,h,d,u,m,g,p,s),Math.max(y,_)}(o,r,t.aabb,e,n);const a=d([],b([],o),k);d(e,w,a)}else i=r.elevation.getAtPointOrZero(new Uc(g.x/x,g.y/x),0);0!==i&&(e[14]+=i)}}class im{constructor(e,t,r,n,i){this.materialOverrides=new Map,this.nodeOverrides=new Map,this.materialOverrideNames=[],this.nodeOverrideNames=[],this.featureProperties={},this.id=e,this.uri=t,this.position=null!=r?new Pc(r[0],r[1]):new Pc(0,0),this.orientation=null!=n?n:[0,0,0],this.nodes=i,this.uploaded=!1,this.aabb=new xu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(e,t){d(e.globalMatrix,t,e.localMatrix);const r=this.nodeOverrides.get(e.name);if(void 0!==r){const t=[];i=r.orientation,c(n=t),g(n,n,Pe(i[1])),m(n,n,Pe(i[2])),p(n,n,Pe(i[0])),d(e.globalMatrix,e.globalMatrix,t)}var n,i;if(e.meshes)for(const t of e.meshes){const r=xu.applyTransformFast(t.aabb,e.globalMatrix);this.aabb.encapsulate(r)}if(e.children)for(const t of e.children)this._applyTransformations(t,e.globalMatrix)}computeBoundsAndApplyParent(){const e=c([]);this.aabb=new xu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const t of this.nodes)this._applyTransformations(t,e)}computeModelMatrix(e,t,r,n,i,o,a=!1){nm(this.matrix,this,e.transform,this.position,t,r,n,i,o,a)}upload(e){if(!this.uploaded){for(const t of this.nodes)sm(t,e);for(const e of this.nodes)lm(e);this.uploaded=!0}}destroy(){for(const e of this.nodes)um(e)}}function om(e,t,r=!1){e.uploaded||(e.gfxTexture=new zg(t,e.image,r?t.gl.R8:t.gl.RGBA8,{useMipmap:e.sampler.minFilter>=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function am(e,t,r){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,Ng.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,Gg.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,Vg.members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?Bg:jg).members,!1,!0)),e.featureArray&&(e.pbrBuffer=t.createVertexBuffer(e.featureArray,$g.members,!0)),e.segments=Bl.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const n=e.material;n.pbrMetallicRoughness.baseColorTexture&&om(n.pbrMetallicRoughness.baseColorTexture,t),n.pbrMetallicRoughness.metallicRoughnessTexture&&om(n.pbrMetallicRoughness.metallicRoughnessTexture,t),n.normalTexture&&om(n.normalTexture,t),n.occlusionTexture&&om(n.occlusionTexture,t,r),n.emissionTexture&&om(n.emissionTexture,t)}function sm(e,t,r){if(e.meshes)for(const n of e.meshes)am(n,t,r);if(e.children)for(const n of e.children)sm(n,t,r)}function lm(e){if(e.meshes)for(const t of e.meshes)t.indexArray.destroy(),t.vertexArray.destroy(),t.colorArray&&t.colorArray.destroy(),t.normalArray&&t.normalArray.destroy(),t.texcoordArray&&t.texcoordArray.destroy(),t.featureArray&&t.featureArray.destroy();if(e.children)for(const t of e.children)lm(t)}function cm(e){e.pbrMetallicRoughness.baseColorTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),e.pbrMetallicRoughness.metallicRoughnessTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),e.normalTexture&&e.normalTexture.gfxTexture&&e.normalTexture.gfxTexture.destroy(),e.emissionTexture&&e.emissionTexture.gfxTexture&&e.emissionTexture.gfxTexture.destroy(),e.occlusionTexture&&e.occlusionTexture.gfxTexture&&e.occlusionTexture.gfxTexture.destroy()}function um(e){if(e.meshes)for(const t of e.meshes)t.vertexBuffer&&(t.vertexBuffer.destroy(),t.indexBuffer.destroy(),t.normalBuffer&&t.normalBuffer.destroy(),t.texcoordBuffer&&t.texcoordBuffer.destroy(),t.colorBuffer&&t.colorBuffer.destroy(),t.pbrBuffer&&t.pbrBuffer.destroy(),t.segments.destroy(),t.material&&cm(t.material));if(e.children)for(const t of e.children)um(t)}function dm(e,t){const r=e.json.bufferViews[t.bufferView],n=_g[t.componentType];return new n(e.buffers[r.buffer],(t.byteOffset||0)+(r.byteOffset||0),t.count*(r.byteStride&&r.byteStride!==bg[t.type]*n.BYTES_PER_ELEMENT?r.byteStride/n.BYTES_PER_ELEMENT:bg[t.type]))}function hm(e,t,r,n){const i=_g[t.componentType],o=function(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(i),a=e.json.bufferViews[t.bufferView],s=a.byteStride?a.byteStride/i.BYTES_PER_ELEMENT:bg[t.type],l=r.float32,c=l.length/r.capacity;for(let e=0,r=0;e<t.count*s;e+=s,r+=c)for(let t=0;t<c;t++)l[r+t]=n[e+t]*o;r._trim()}function fm(e,t,r){const n=e.indices,i=e.attributes,o={};o.indexArray=new ll;const a=t.json.accessors[n],s=a.count/3;o.indexArray.reserve(s);const l=dm(t,a);for(let e=0;e<s;e++)o.indexArray.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);o.indexArray._trim(),o.vertexArray=new Ys;const c=t.json.accessors[i.POSITION];o.vertexArray.reserve(c.count);const u=dm(t,c);for(let e=0;e<c.count;e++)o.vertexArray.emplaceBack(u[3*e],u[3*e+1],u[3*e+2]);if(o.vertexArray._trim(),o.aabb=new xu(c.min,c.max),o.centroid=function(e,t){const r=[0,0,0],n=e.length;if(n>0){for(let i=0;i<n;i++){const n=3*e[i];r[0]+=t[n],r[1]+=t[n+1],r[2]+=t[n+2]}r[0]/=n,r[1]/=n,r[2]/=n}return r}(l,u),void 0!==i.COLOR_0){const e=t.json.accessors[i.COLOR_0],r=bg[e.type],n=dm(t,e);o.colorArray=3===r?new Ys:new tl,o.colorArray.resize(e.count),hm(t,e,o.colorArray,n)}if(void 0!==i.NORMAL){o.normalArray=new Ys;const e=t.json.accessors[i.NORMAL];o.normalArray.resize(e.count);const r=dm(t,e);hm(t,e,o.normalArray,r)}if(void 0!==i.TEXCOORD_0&&r.length>0){o.texcoordArray=new ml;const e=t.json.accessors[i.TEXCOORD_0];o.texcoordArray.resize(e.count);const r=dm(t,e);hm(t,e,o.texcoordArray,r)}if(void 0!==i._FEATURE_ID_RGBA4444){const e=t.json.accessors[i._FEATURE_ID_RGBA4444];t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression")&&(o.featureData=dm(t,e))}void 0!==i._FEATURE_RGBA4444&&(o.featureData=new Uint32Array(dm(t,t.json.accessors[i._FEATURE_RGBA4444]).buffer));const d=e.material;return o.material=function(e,t){const{emissiveFactor:r=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:i=.5,normalTexture:o,occlusionTexture:a,emissiveTexture:s,doubleSided:l,name:c}=e,{baseColorFactor:u=[1,1,1,1],metallicFactor:d=1,roughnessFactor:h=1,baseColorTexture:f,metallicRoughnessTexture:p}=e.pbrMetallicRoughness||{},g=a?t[a.index]:void 0;if(a&&a.extensions&&a.extensions.KHR_texture_transform&&g){const e=a.extensions.KHR_texture_transform;g.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{name:c,pbrMetallicRoughness:{baseColorFactor:new cr(...u),metallicFactor:d,roughnessFactor:h,baseColorTexture:f?t[f.index]:void 0,metallicRoughnessTexture:p?t[p.index]:void 0},doubleSided:l,emissiveFactor:new cr(...r),alphaMode:n,alphaCutoff:i,normalTexture:o?t[o.index]:void 0,occlusionTexture:g,emissionTexture:s?t[s.index]:void 0,defined:void 0===e.defined}}(void 0!==d?t.json.materials[d]:{defined:!1},r),o}function pm(e,t,r){const{matrix:n,rotation:i,translation:o,scale:a,mesh:s,extras:c,children:u,name:d}=e,h={};if(h.name=d,h.localMatrix=n||function(e,t,r,n){var i=t[0],o=t[1],a=t[2],s=t[3],l=i+i,c=o+o,u=a+a,d=i*l,h=i*c,f=i*u,p=o*c,g=o*u,m=a*u,y=s*l,_=s*c,v=s*u,b=n[0],x=n[1],w=n[2];return e[0]=(1-(p+m))*b,e[1]=(h+v)*b,e[2]=(f-_)*b,e[3]=0,e[4]=(h-v)*x,e[5]=(1-(d+m))*x,e[6]=(g+y)*x,e[7]=0,e[8]=(f+_)*w,e[9]=(g-y)*w,e[10]=(1-(d+p))*w,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}([],i||[0,0,0,1],o||[0,0,0],a||[1,1,1]),h.globalMatrix=l(h.localMatrix),void 0!==s){h.meshes=r[s];const e=h.anchor=[0,0];for(const t of h.meshes){const{min:r,max:n}=t.aabb;e[0]+=r[0]+n[0],e[1]+=r[1]+n[1]}e[0]=Math.floor(e[0]/h.meshes.length/2),e[1]=Math.floor(e[1]/h.meshes.length/2)}if(c&&(c.id&&(h.id=c.id),c.lights&&(h.lights=function(e){if(!e.length)return[];const t=function(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.codePointAt(e);return r}(e),r=[],n=t.length/24,i=new Uint16Array(t.buffer),o=new Float32Array(t.buffer);for(let e=0;e<n;e++){const t=i[2*e*6]/30,n=i[2*e*6+1]/30,a=i[2*e*6+10]/100,s=o[6*e+1],l=o[6*e+2],c=o[6*e+3],u=o[6*e+4],d=c-s,h=u-l,f=Math.hypot(d,h);r.push({pos:[s+.5*d,l+.5*h,n],normal:[h/f,-d/f,0],width:f,height:t,depth:a,points:[s,l,c,u]})}return r}(c.lights)),c.MAPBOX_geometry_bloom&&(h.isGeometryBloom=c.MAPBOX_geometry_bloom)),u){const e=[];for(const n of u)e.push(pm(t.json.nodes[n],t,r));h.children=e}return h}function gm(e){if(0===e.vertices.length||0===e.indices.length)return null;const t=new Tf(e.vertices,e.indices,8,256),[r,n]=[t.min.clone(),t.max.clone()];return{vertices:e.vertices,indices:e.indices,grid:t,min:r,max:n}}function mm(e){if(!e.extras||!e.extras.ground)return null;const t=e.extras.ground;if(!t||!Array.isArray(t)||0===t.length)return null;const r=t[0];if(!r||!Array.isArray(r)||0===r.length)return null;const n=[];for(const e of r){if(!Array.isArray(e)||2!==e.length)continue;const t=e[0],r=e[1];"number"==typeof t&&"number"==typeof r&&n.push(new Te(t,r))}if(n.length<3)return null;n.length>1&&n[n.length-1].equals(n[0])&&n.pop();let i=0;for(let e=0;e<n.length;e++){const t=n[e],r=n[(e+1)%n.length],o=n[(e+2)%n.length];
vendor: 4,352 bytes, line 1
1i+=(t.x-r.x)*(o.y-r.y)-(o.x-r.x)*(t.y-r.y)}i>0&&n.reverse();const o=Qd(n.flatMap((e=>[e.x,e.y])),[]);return 0===o.length?null:{vertices:n,indices:o}}function ym(e,t){const r=[],n=[];let i=0;const o=[];for(const a of e){i=r.length;const e=a.vertexArray.float32,s=a.indexArray.uint16;for(let n=0;n<a.vertexArray.length;n++)o[0]=e[3*n+0],o[1]=e[3*n+1],o[2]=e[3*n+2],G(o,o,t),r.push(new Te(o[0],o[1]));for(let e=0;e<3*a.indexArray.length;e++)n.push(s[e]+i)}if(n.length%3!=0)return null;for(let e=0;e<n.length;e+=3){const t=r[n[e+0]],i=r[n[e+1]],o=r[n[e+2]];(t.x-i.x)*(o.y-i.y)-(o.x-i.x)*(t.y-i.y)>0&&([n[e+1],n[e+2]]=[n[e+2],n[e+1]])}return{vertices:r,indices:n}}function _m(e){const t=function(e,t){const r=[],n=WebGL2RenderingContext;if(e.json.textures)for(const i of e.json.textures){const o={magFilter:n.LINEAR,minFilter:n.NEAREST,wrapS:n.REPEAT,wrapT:n.REPEAT};void 0!==i.sampler&&Object.assign(o,e.json.samplers[i.sampler]),r.push({image:t[i.source],sampler:o,uploaded:!1})}return r}(e,e.images),r=function(e,t){const r=[];for(const n of e.json.meshes){const i=[];for(const r of n.primitives)i.push(fm(r,e,t));r.push(i)}return r}(e,t),{scenes:n,scene:i,nodes:o}=e.json,a=n?n[i||0].nodes:[...o.keys()],s=[];for(const t of a)s.push(pm(o[t],e,r));return function(e,t,r){const n={},i=new Set;for(let o=0;o<e.length;o++){const e=r[t[o]];if(!e.extras)continue;const a=e.extras["mapbox:footprint:version"],s=e.extras["mapbox:footprint:id"];(a||s)&&i.add(o),"1.0.0"===a&&s&&(n[s]=o)}for(let o=0;o<e.length;o++){if(i.has(o))continue;const a=e[o],s=r[t[o]];if(!s.extras)continue;let l=null;a.id in n&&(l=ym(e[n[a.id]].meshes,a.localMatrix)),l||(l=mm(s)),l&&(a.footprint=gm(l))}if(i.size>0){const t=Array.from(i.values()).sort(((e,t)=>e-t));for(let r=t.length-1;r>=0;r--)e.splice(t[r],1)}}(s,a,e.json.nodes),s}function vm(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,r=e.aabb.min[0]-1,n=e.aabb.min[1]-1,i=tm/(e.aabb.max[0]-r+2),o=tm/(e.aabb.max[1]-n+2);for(let a=0;a<t.length;a+=3){const s=t[a+2],l=(t[a+0]-r)*i|0,c=(t[a+1]-n)*o|0;s>e.heightmap[c*tm+l]&&(e.heightmap[c*tm+l]=s)}}function bm(e,t,r,n,i){r.reserve(r.length+4*e.length),n.reserve(n.length+10*e.length),i.reserve(i.length+10*e.length);let o=n.length;for(const a of e){const e=Math.min(10,Math.max(4,1.3*a.height))*t,s=[-a.normal[1],a.normal[0],0],l=Math.min(.29,.1*a.width/a.depth),c=a.width-2*a.depth*t*(l+.01),u=L([],a.pos,s,c/2),d=L([],a.pos,s,-c/2),h=[u[0],u[1],u[2]+a.height],f=[d[0],d[1],d[2]+a.height],p=L([],a.normal,s,l);R(p,p,e);const g=L([],a.normal,s,-l);R(g,g,e),M(p,u,p),M(g,d,g),u[2]+=.1,d[2]+=.1,n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(g[0],g[1],g[2]),n.emplaceBack(u[0],u[1],u[2]),n.emplaceBack(d[0],d[1],d[2]),n.emplaceBack(h[0],h[1],h[2]),n.emplaceBack(f[0],f[1],f[2]),n.emplaceBack(u[0],u[1],u[2]),n.emplaceBack(d[0],d[1],d[2]),n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(g[0],g[1],g[2]);const m=c/e/2;i.emplaceBack(-m-l,-1,m,.8),i.emplaceBack(m+l,-1,m,.8),i.emplaceBack(-m,0,m,1.3),i.emplaceBack(m,0,m,1.3),i.emplaceBack(m+l,-.8,m,.7),i.emplaceBack(m+l,-.8,m,.7),i.emplaceBack(0,0,m,1.3),i.emplaceBack(0,0,m,1.3),i.emplaceBack(m+l,-1.2,m,.8),i.emplaceBack(m+l,-1.2,m,.8),r.emplaceBack(6+o,4+o,8+o),r.emplaceBack(7+o,9+o,5+o),r.emplaceBack(0+o,1+o,2+o),r.emplaceBack(1+o,3+o,2+o),o+=10}}function xm(e,t){const r={};r.indexArray=new ll,r.vertexArray=new Ys,r.colorArray=new tl,bm(e,t,r.indexArray,r.vertexArray,r.colorArray);const n={defined:!0};n.emissiveFactor=cr.black;const i={};return i.baseColorFactor=cr.white,n.pbrMetallicRoughness=i,r.material=n,r.aabb=new xu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),r}const wm=Bs([{name:"a_pos_3f",components:3,type:"Float32"}]),Sm=Bs([{name:"a_normal_3",components:3,type:"Int16"}]),km=Bs([{name:"a_centroid_3",components:3,type:"Int16"}]),Tm=Bs([{name:"a_part_color_emissive",components:2,type:"Uint16"}]),Im=Bs([{name:"a_faux_facade_color_emissive",components:2,type:"Uint16"}]),Mm=Bs([{name:"a_faux_facade_data",components:4,type:"Uint16"}]),Em=Bs([{name:"a_faux_facade_vertical_range",components:2,type:"Uint16"}]),Pm=Bs([{name:"a_bloom_attenuation",components:4,type:"Float32"}]),Am=Bs([{name:"a_flood_light_wall_radius_1i16",components:1,type:"Uint16"}]),Cm=Qc.types,Rm=32767;function Lm(e,t){const r=Gn+t;for(const n of e)for(const e of n)if(e.x<-t||e.x>r||e.y<-t||e.y>r)return!1;return!0}
vendor: 11,195 bytes, line 1
1function Om(e){switch(e){case"flat":return 3;case"hipped":return 1;case"gabled":return 2;case"parapet":return 0;case"mansard":return 4;case"skillion":return 5;case"pyramidal":return 6;default:throw new Error(`Unknown roof shape: ${e}`)}}class Dm{constructor(){this.layoutVertexArray=new Ys,this.layoutAttenuationArray=new tl,this.layoutColorArray=new nl,this.indexArray=new ll,this.indexArrayForConflation=new ll,this.segmentsBucket=new Bl}}class zm{constructor(e){this.layoutFacadePaintArray=null,this.layoutFacadeDataArray=null,this.layoutFacadeVerticalRangeArray=null,this.segmentsBucket=new Bl,this.entranceBloom=new Dm;const t=66560;this.layoutVertexArray=new Ys,this.layoutVertexArray.reserve(t),this.layoutNormalArray=new Gs,this.layoutNormalArray.reserve(t),this.layoutCentroidArray=new Gs,this.layoutCentroidArray.reserve(t),this.layoutColorArray=new nl,this.layoutColorArray.reserve(t),this.layoutFloodLightDataArray=new _l,this.layoutFloodLightDataArray.reserve(t),this.layoutAOArray=new wl,this.layoutAOArray.reserve(t),this.indexArray=new ll,this.indexArray.reserve(66560),this.indexArrayForConflation=new ll,this.segmentsBucket=new Bl,this.entranceBloom=new Dm,e&&(this.layoutFacadePaintArray=new nl,this.layoutFacadeDataArray=new Ks,this.layoutFacadeVerticalRangeArray=new nl)}reserve(e,t,r){this.layoutVertexArray.reserveForAdditional(e),this.layoutCentroidArray.reserveForAdditional(e),this.layoutFloodLightDataArray.reserveForAdditional(e),this.layoutNormalArray.reserveForAdditional(e),this.layoutAOArray.reserveForAdditional(e),this.layoutColorArray.reserveForAdditional(e),this.indexArray.reserveForAdditional(t),r&&(this.layoutFacadePaintArray.reserveForAdditional(e),this.layoutFacadeDataArray.reserveForAdditional(e),this.layoutFacadeVerticalRangeArray.reserveForAdditional(e))}}class Fm{constructor(e){this.colorBufferUploaded=!1,this.maxHeight=0,this.replacementUpdateTime=0,this.activeReplacements=[],this.footprints=[],this.footprintsVertices=new ml,this.footprintsIndices=new _l,this.footprintsMin=new Te(1/0,1/0),this.footprintsMax=new Te(-1/0,-1/0),this.featuresOnBorder=[],this.buildingWithoutFacade=new zm(!1),this.buildingWithFacade=new zm(!0),this.indexArrayForConflationUploaded=!1,this.featureFootprintLookup=new Map,this.buildingIds=new Set,this.footprintLookup={},this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.worldview=e.worldview,this.lut=e.lut,this.programConfigurations=new pc(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection,this.groundEffect=new pp(e),this.groundEffect.groundRadiusArray=new $s,this.hasAppearances=null}updateFootprints(e,t){const r=new Tf([],[],1),n={vertices:[],indices:new Uint32Array(0),grid:r,min:this.footprintsMin,max:this.footprintsMax,buildingIds:this.buildingIds};t.push({footprint:n,id:e})}updateAppearances(e,t,r,n){}prepare(){return function(){if(null!=lg||null!=sg)return null;if(null!=ag)return ag;const e=fetch(st.BUILDING_GEN_URL);return ag=function(e){let t,r,n,i,o;function a(){t=new Uint8Array(o.buffer),r=new Int16Array(o.buffer),n=new Int32Array(o.buffer),i=new Float32Array(o.buffer)}function s(){throw new Error("Unexpected BuildingGen error.")}const l=()=>{},c={a:{a:s,f:function(e){const r=t.length,n=Math.max(e>>>0,Math.ceil(1.2*r)),i=Math.ceil((n-r)/65536);try{return o.grow(i),a(),!0}catch(e){return!1}},g:s,b:l,c:l,d:l,e:l}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,c):e.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,c)))).then((e=>{const s=e.instance.exports;return(0,s.g)(),o=s.f,a(),new Qp({setStyle:s.h,setAOOptions:s.i,setMetricOptions:s.j,setStructuralOptions:s.k,setFacadeOptions:s.l,setFauxFacadeOptions:s.m,setFacadeClassifierOptions:s.n,addFeature:s.o,addFacade:s.p,generateMesh:s.q,getLastError:s.r,getOuterRingLength:s.s,getMeshCount:s.t,getPositionsPtr:s.u,getPositionsLength:s.v,getNormalsPtr:s.w,getNormalsLength:s.x,getAOPtr:s.y,getAOLength:s.z,getUVPtr:s.A,getUVLength:s.B,getFauxFacadePtr:s.C,getFauxFacadeLength:s.D,getIndicesPtr:s.E,getIndicesLength:s.F,getBuildingPart:s.G,getRingCount:s.H,getRingPtr:s.I,getRingLength:s.J,malloc:s.K,free:s.L,heapU8:t,heap16:r,heap32:n,heapF32:i})}))}(e).then((e=>(ag=null,lg=e,lg))).catch((e=>{Ze("Could not load building-gen"),ag=null,sg=e})),ag}()}populate(e,t,r,n){const i=dg();if(!i)return;const o=Gc(r);this.tileToMeter=o,this.brightness=t.brightness,i.setStyle({normalScale:[1,-1,o],tileToMeters:o}),i.setAOOptions(!1,.3),i.setMetricOptions(!1,16),i.setStructuralOptions(!0),i.setFacadeClassifierOptions(3);const a=new Map,s=new Map;let l=0;for(const{feature:t}of e){if("LineString"!==Cm[t.type]){a.set(t.id,t.properties.source_id);continue}const e=this.layers[0]._featureFilter.needGeometry;if(e&&!this.layers[0]._featureFilter.filter(new Ja(this.zoom),t,r))continue;const i=Jc(t,e);if(!e&&!this.layers[0]._featureFilter.filter(new Ja(this.zoom),i,r))continue;const o=e?i.geometry:Kc(t,r,n),c=[];for(const e of o)for(const t of e)c.push(t.x),c.push(t.y);const u={coordinates:c,crossPerc:t.properties.cross_perc,distanceToRoad:t.properties.distance_to_road,entrances:t.properties.entrances,sourceId:0},d=t.properties.source_id;let h=s.get(d);h||(h=[],s.set(d,h)),h.push(u),++l}this.maxHeight=0;const c=new Array,u=new Set,d=e=>{null!=e&&u.add(e)},h=(e,t)=>{null!=e&&c.push({buildingId:e,footprintIndex:t})},f=64*(e.length-l),p=f/2;this.buildingWithFacade.reserve(f,p,!0),this.buildingWithoutFacade.reserve(2*f,2*p,!1),this.footprintsIndices.reserve(16*(e.length-l)),this.footprintsVertices.reserve(8*(e.length-l));for(const{feature:l,id:c,index:f,sourceLayerIndex:p}of e){if("LineString"===Cm[l.type])continue;const e=this.layers[0]._featureFilter.needGeometry;if(e&&!this.layers[0]._featureFilter.filter(new Ja(this.zoom),l,r))continue;let g=null;if(l.properties&&l.properties.hasOwnProperty("building_id")&&(g=Number(l.properties.building_id),u.has(g)))continue;const m=Jc(l,e);if(!e&&!this.layers[0]._featureFilter.filter(new Ja(this.zoom),m,r))continue;const y=e?m.geometry:Kc(l,r,n),_=Th(y,500);let v=!1;for(const e of _)if(1!==e.length){v=!0;break}if(v){d(g);continue}if(!Lm(y,163)){d(g);continue}const b=this.layers[0],x=Om(b.layout.get("building-roof-shape").evaluate(l,{},r)),w=b.layout.get("building-base").evaluate(l,{},r),S=b.layout.get("building-height").evaluate(l,{},r),k=b.layout.get("building-flood-light-ground-radius").evaluate(l,{},r),T=b.paint.get("building-ambient-occlusion-intensity"),I=k/this.tileToMeter;l.properties["building-part"]="roof";const M=b.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),E=b.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);l.properties["building-part"]="wall";const P=b.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),A=b.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);l.properties["building-part"]="window";const C=b.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),R=b.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);l.properties["building-part"]="door";const L=b.paint.get("building-color").evaluate(l,{},this.canonical).toPremultipliedRenderColor(this.lut),O=b.paint.get("building-emissive-strength").evaluate(l,{},this.canonical);let D=b.layout.get("building-flood-light-wall-radius").evaluate(l,{},r);D=De(D,0,2048);const z=D/2048*Rm,F=a.get(c),N=s.get(F)||[],B=0!==N.length&&b.layout.get("building-facade").evaluate(l,{},r);i.setFacadeOptions(4,!0),i.setFauxFacadeOptions(B,!1,1);let j=0,V=0,G=0,U=0,$=0,H=0,q=0,W=0,Z=0,Y=0,X=0;if(B){let e=Math.round(b.layout.get("building-facade-floors").evaluate(l,{},r));if(0===w){e=Math.max(1,e-(N.length>0?1:0));let t=4;if(S>100){const e=[10,13,15];t=e[l.id?l.id%e.length:0]}else S<=10&&(t=3);i.setFacadeOptions(t,!0),$=(S<15?1.3:1.61803)*t/o}else $=w/o;H=S/o,$=Math.min($,H),G=b.layout.get("building-facade-unit-width").evaluate(l,{},r)/o,U=(H-$)/e,i.setFauxFacadeOptions(!0,!0,G);const t=b.layout.get("building-facade-window").evaluate(l,{},r);j=t[0],V=t[1],q=Math.floor(65535*Math.min(1,$/Gn)),W=Math.floor(65535*Math.min(1,H/Gn)),Z=Math.floor(255*j)<<8|Math.floor(255*V),Y=Math.floor(65535*Math.min(1,G/Gn)),X=Math.floor(65535*Math.min(1,U/Gn))}const K=Array(_.length),J={x:1/0,y:1/0},Q={x:-1/0,y:-1/0},ee={x:0,y:0};let te=0;for(let e=0;e<_.length;e++){const t=_[e];if(t.length>0){const r=[],n=Array(t.length+1);n[0]=0;for(let e=0;e<t.length;e++){const i=t[e];for(let e=0;e<i.length;e++){const t=i[i.length-e-1];J.x=Math.min(J.x,t.x),J.y=Math.min(J.y,t.y),Q.x=Math.max(Q.x,t.x),Q.y=Math.max(Q.y,t.y),ee.x+=t.x,ee.y+=t.y,te++,r.push(t.x),r.push(t.y)}n[e+1]=r.length}K[e]={id:l.id?l.id:0,height:S,minHeight:w,sourceId:0,roofType:x,coordinates:r,ringIndices:n}}}ee.x/=te||1,ee.y/=te||1;const re=i.generateMesh(K,N);if("string"==typeof re){Ze(`Unable to generate building ${l.id}: ${re}`),d(g);continue}if(0===re.meshes.length||0===re.modifiedPolygonRings.length){d(g);continue}const ne=B?this.buildingWithFacade:this.buildingWithoutFacade;let ie=0;for(const e of re.meshes)ie+=e.positions.length/3;const oe=ne.segmentsBucket.prepareSegment(ie,ne.layoutVertexArray,ne.indexArray),ae=[];let se=null,le=0,ce=-1;const ue=ne.layoutVertexArray.length,de=ue+ie;ne.layoutVertexArray.resize(de),ne.layoutCentroidArray.resize(de),ne.layoutNormalArray.resize(de),ne.layoutAOArray.resize(de),ne.layoutColorArray.resize(de),ne.layoutFloodLightDataArray.resize(de),B&&(ne.layoutFacadePaintArray.resize(de),ne.layoutFacadeDataArray.resize(de),ne.layoutFacadeVerticalRangeArray.resize(de));const he=ne.indexArray.length;let fe=0,pe=ue;for(const e of re.meshes){let t,r;if(1===e.buildingPart)t=M,r=E;else if(0===e.buildingPart)t=P,r=A;else if(2===e.buildingPart)t=C,r=R;else{if(3!==e.buildingPart)continue;t=L,r=O}if(r=De(r,0,1),3===e.buildingPart){const t=new Array;for(let r=0;r<e.positions.length;r+=12){const n=e.positions[r+0],i=e.positions[r+1],o=e.positions[r+3],a=e.positions[r+4],s=e.positions[r+2],l=e.positions[r+8]-s,c=1,u=o-n,d=a-i,h=Math.hypot(u,d);t.push({pos:[n+.5*u,i+.5*d,s],normal:[d/h,-u/h,0],width:h,height:l,depth:c,points:[n,i,o,a]})}const r=ne.entranceBloom.segmentsBucket.prepareSegment(10*t.length,ne.entranceBloom.layoutVertexArray,ne.entranceBloom.indexArray),n=ne.entranceBloom.layoutVertexArray.length;le=ne.entranceBloom.indexArray.length,bm(t,.5/this.tileToMeter,ne.entranceBloom.indexArray,ne.entranceBloom.layoutVertexArray,ne.entranceBloom.layoutAttenuationArray);const i=ne.entranceBloom.layoutVertexArray.length-n;ce=ne.entranceBloom.indexArray.length-le;for(let e=0;e<i;e++)ne.entranceBloom.layoutColorArray.emplaceBack(255*L.r<<8|255*L.g,255*L.b<<8|51*O);r.vertexLength+=i,r.primitiveLength+=ce,se={part:e.buildingPart,vertexOffset:n,vertexLength:i}}ne.layoutVertexArray.float32.set(e.positions,3*pe);const n=e.positions.length/3;for(let i=0;i<n;++i){const n=3*i;fe=Math.max(fe,e.positions[n+2]);const o=e.normals[n+1]*Rm,a=e.normals[n+2]*Rm,s=3*(pe+i);
vendor: 14,159 bytes, line 1
1ne.layoutNormalArray.int16[s]=e.normals[n]*Rm,ne.layoutNormalArray.int16[s+1]=o,ne.layoutNormalArray.int16[s+2]=a;const l=e.ao[i];ne.layoutAOArray.uint8[pe+i]=255*l;const c=1+(l-1)*T,u=255*t.b*c<<8|255*r;ne.layoutColorArray.uint16[2*(pe+i)]=255*t.r*c<<8|255*t.g*c,ne.layoutColorArray.uint16[2*(pe+i)+1]=u}const i=Math.floor(ee.x),o=Math.floor(ee.y),a=Math.floor(S);for(let e=0;e<n;++e){const t=3*(pe+e);ne.layoutCentroidArray.int16[t]=i,ne.layoutCentroidArray.int16[t+1]=o,ne.layoutCentroidArray.int16[t+2]=a}if(ne.layoutFloodLightDataArray.uint16.fill(0===e.buildingPart?z:0,pe,pe+n),B){const t=255*C.r<<8|255*C.g,r=255*C.b<<8|255*R;for(let e=0;e<n;++e){const n=2*(pe+e);ne.layoutFacadePaintArray.uint16[n]=t,ne.layoutFacadePaintArray.uint16[n+1]=r}for(let t=0;t<n;++t)if(e.isFauxFacade[t]){const r=Math.min(65535,Math.floor(e.uv[2*t]*re.outerRingLength));ne.layoutFacadeDataArray.emplace(pe+t,1|r,Z,Y,X),ne.layoutFacadeVerticalRangeArray.emplace(pe+t,q,W)}else ne.layoutFacadeDataArray.emplace(pe+t,0,0,0,0),ne.layoutFacadeVerticalRangeArray.emplace(pe+t,0,0)}const s=oe.vertexLength,l=e.indices.length/3,c=ne.indexArray.length;ne.indexArray.resize(c+l);for(let t=0;t<l;++t){const r=3*t,n=3*c+r;ne.indexArray.uint16[n]=s+e.indices[r],ne.indexArray.uint16[n+1]=s+e.indices[r+1],ne.indexArray.uint16[n+2]=s+e.indices[r+2]}1!==e.buildingPart&&0!==e.buildingPart&&2!==e.buildingPart&&3!==e.buildingPart||ae.push({part:e.buildingPart,vertexOffset:pe,vertexLength:e.positions.length/3}),pe+=n,oe.vertexLength+=n,oe.primitiveLength+=e.indices.length/3}this.maxHeight=Math.max(this.maxHeight,fe);const ge=ne.indexArray.length-he,me=this.footprintsIndices.length,ye=this.footprintsVertices.length,_e=[],ve=new Te(1/0,1/0),be=new Te(-1/0,-1/0),xe=this.groundEffect.vertexArray.length;for(const e of re.modifiedPolygonRings){const t=[],r=new Te(1/0,1/0),n=new Te(-1/0,-1/0);for(let i=0;i<e.length;i+=2){const o=e.length-i-2;r.x=Math.min(r.x,e[o]),r.y=Math.min(r.y,e[o+1]),n.x=Math.max(n.x,e[o]),n.y=Math.max(n.y,e[o+1]);const a=new Te(e[o],e[o+1]);t.push(a),_e.push(a.x,a.y),this.footprintsVertices.emplaceBack(a.x,a.y)}ve.x=Math.min(ve.x,r.x),ve.y=Math.min(ve.y,r.y),be.x=Math.max(be.x,n.x),be.y=Math.max(be.y,n.y),this.groundEffect.addData(t,[r,n],I)}const we=this.groundEffect.vertexArray.length-xe;this.groundEffect.groundRadiusArray.reserveForAdditional(we);for(let e=0;e<we;e++)this.groundEffect.groundRadiusArray.emplaceBack(k);(J.x<0||Q.x>Gn||J.y<0||Q.y>Gn)&&this.featuresOnBorder.push({featureId:l.id,footprintIndex:this.footprints.length});{const e=Qd(_e,null,2);this.footprintsIndices.resize(this.footprintsIndices.length+e.length),this.footprintsIndices.uint16.set(e,me),this.buildingIds.add(null!=g?g:l.id),this.footprintsMin.x=Math.min(this.footprintsMin.x,ve.x),this.footprintsMin.y=Math.min(this.footprintsMin.y,ve.y),this.footprintsMax.x=Math.max(this.footprintsMax.x,be.x),this.footprintsMax.y=Math.max(this.footprintsMax.y,be.y);const t={footprintVertexOffset:ye,footprintVertexLength:this.footprintsVertices.length-ye,footprintIndexOffset:me,footprintIndexLength:this.footprintsIndices.length-me,min:ve,max:be,hiddenFlags:0,indicesOffset:he,indicesLength:ge,bloomIndicesOffset:le,bloomIndicesLength:ce,groundEffectVertexOffset:xe,groundEffectVertexLength:we,hasFauxFacade:B,height:fe,promoteId:c,feature:m,parts:ae,buildingBloom:se},r=this.footprints.length;void 0!==l.id&&this.featureFootprintLookup.set(l.id,r),h(g,r),this.footprints.push(t)}this.programConfigurations.populatePaintArrays(ne.layoutVertexArray.length,l,f,{},t.availableImages,r,t.brightness),this.groundEffect.addPaintPropertiesData(l,f,{},t.availableImages,r,t.brightness),t.featureIndex.insert(l,y,f,p,this.index,ue)}c.forEach((({buildingId:e,footprintIndex:t})=>{u.has(e)&&(this.footprints[t].hiddenFlags|=4)}));const g=new Set;this.buildingIds.forEach(((e,t,r)=>{u.has(e)||g.add(e)})),this.buildingIds=g,this.groundEffect.prepareBorderSegments()}update(e,t,r,n,i,o,a){this.programConfigurations.updatePaintArrays(e,t,i,r,n,o,a),this.groundEffect.update(e,t,i,r,n,o,a),this.evaluate(this.layers[0],e),this.colorBufferUploaded=!1}isEmpty(){return 0===this.buildingWithoutFacade.layoutVertexArray.length&&0===this.buildingWithFacade.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){const t=t=>{t.layoutVertexBuffer=e.createVertexBuffer(t.layoutVertexArray,wm.members),t.layoutNormalBuffer=e.createVertexBuffer(t.layoutNormalArray,Sm.members),t.layoutCentroidBuffer=e.createVertexBuffer(t.layoutCentroidArray,km.members),t.layoutFloodLightDataBuffer=e.createVertexBuffer(t.layoutFloodLightDataArray,Am.members),t.layoutFacadeDataArray&&t.layoutFacadeDataArray.length&&(t.layoutFacadeDataBuffer=e.createVertexBuffer(t.layoutFacadeDataArray,Mm.members)),t.layoutFacadeVerticalRangeArray&&t.layoutFacadeVerticalRangeArray.length&&(t.layoutFacadeVerticalRangeBuffer=e.createVertexBuffer(t.layoutFacadeVerticalRangeArray,Em.members)),t.entranceBloom.layoutVertexArray.length&&(t.entranceBloom.layoutVertexBuffer=e.createVertexBuffer(t.entranceBloom.layoutVertexArray,wm.members),t.entranceBloom.layoutAttenuationBuffer=e.createVertexBuffer(t.entranceBloom.layoutAttenuationArray,Pm.members)),this.uploadUpdatedColorBuffer(e),this.uploadUpdatedIndexBuffer(e)};this.uploaded||(t(this.buildingWithoutFacade),t(this.buildingWithFacade),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){const e=e=>{e.layoutVertexBuffer&&(e.layoutVertexBuffer.destroy(),e.layoutNormalBuffer.destroy(),e.layoutColorBuffer.destroy(),e.segmentsBucket.destroy(),e.indexBuffer&&e.indexBuffer.destroy(),e.entranceBloom.layoutVertexBuffer&&(e.entranceBloom.layoutVertexBuffer.destroy(),e.entranceBloom.layoutColorBuffer.destroy(),e.entranceBloom.layoutAttenuationBuffer.destroy(),e.entranceBloom.indexBuffer.destroy(),e.entranceBloom.segmentsBucket.destroy()))};e(this.buildingWithoutFacade),e(this.buildingWithFacade),this.groundEffect.destroy(),this.programConfigurations.destroy()}updateFootprintHiddenFlags(e,t,r=!0){let n=!1;const i=r?t:0,o=0|(r?-1:~t);0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const t of e){const e=this.footprints[t],r=e.hiddenFlags&o|i;e.hiddenFlags!==r&&(e.hiddenFlags=r,n=!0,this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags))}return n&&(this.indexArrayForConflationUploaded=!1),n}uploadUpdatedIndexBuffer(e){if(this.groundEffect.uploadHiddenByLandmark(e),this.indexArrayForConflationUploaded)return;const t=e=>{0!==e.indexArray.length&&(e.indexArrayForConflation.resize(e.indexArray.length),e.indexArrayForConflation.uint16.set(e.indexArray.uint16),e.entranceBloom.indexArrayForConflation.resize(e.entranceBloom.indexArray.length),e.entranceBloom.indexArrayForConflation.uint16.set(e.entranceBloom.indexArray.uint16))};t(this.buildingWithoutFacade),t(this.buildingWithFacade);for(const e of this.footprints){const t=e.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade,r=e.indicesOffset+e.indicesLength;if(0!==e.hiddenFlags){for(let n=e.indicesOffset;n<r;n++)t.indexArrayForConflation.uint16[3*n+0]=0,t.indexArrayForConflation.uint16[3*n+1]=0,t.indexArrayForConflation.uint16[3*n+2]=0;const n=e.bloomIndicesOffset+e.bloomIndicesLength;for(let r=e.bloomIndicesOffset;r<n;r++)t.entranceBloom.indexArrayForConflation.uint16[3*r+0]=0,t.entranceBloom.indexArrayForConflation.uint16[3*r+1]=0,t.entranceBloom.indexArrayForConflation.uint16[3*r+2]=0}}const r=t=>{0!==t.indexArray.length&&(t.indexBuffer?t.indexBuffer.updateData(t.indexArrayForConflation):t.indexBuffer=e.createIndexBuffer(t.indexArrayForConflation,!0),t.entranceBloom.indexBuffer?t.entranceBloom.indexBuffer.updateData(t.entranceBloom.indexArrayForConflation):t.entranceBloom.indexBuffer=e.createIndexBuffer(t.entranceBloom.indexArrayForConflation,!0))};r(this.buildingWithoutFacade),r(this.buildingWithFacade),this.indexArrayForConflationUploaded=!0}uploadUpdatedColorBuffer(e){const t=t=>{t.layoutColorBuffer?t.layoutColorBuffer.updateData(t.layoutColorArray):t.layoutColorBuffer=e.createVertexBuffer(t.layoutColorArray,Tm.members,!0),t.layoutFacadePaintArray&&(t.layoutFacadePaintBuffer?t.layoutFacadePaintBuffer.updateData(t.layoutFacadePaintArray):t.layoutFacadePaintBuffer=e.createVertexBuffer(t.layoutFacadePaintArray,Im.members,!0)),t.entranceBloom.layoutColorBuffer?t.entranceBloom.layoutColorBuffer.updateData(t.entranceBloom.layoutColorArray):t.entranceBloom.layoutColorBuffer=e.createVertexBuffer(t.entranceBloom.layoutColorArray,Tm.members,!0)};t(this.buildingWithoutFacade),t(this.buildingWithFacade),this.colorBufferUploaded=!0}evaluate(e,t){const r=e.paint.get("building-ambient-occlusion-intensity");for(const n of this.footprints){if(4&n.hiddenFlags)continue;const i=t[n.promoteId],o=n.feature;o.properties["building-part"]="roof";const a=e.paint.get("building-color").evaluate(o,i,this.canonical).toPremultipliedRenderColor(this.lut),s=e.paint.get("building-emissive-strength").evaluate(o,i,this.canonical);o.properties["building-part"]="wall";const l=e.paint.get("building-color").evaluate(o,i,this.canonical).toPremultipliedRenderColor(this.lut),c=e.paint.get("building-emissive-strength").evaluate(o,i,this.canonical);o.properties["building-part"]="window";const u=e.paint.get("building-color").evaluate(o,i,this.canonical).toPremultipliedRenderColor(this.lut),d=e.paint.get("building-emissive-strength").evaluate(o,i,this.canonical);o.properties["building-part"]="door";const h=e.paint.get("building-color").evaluate(o,i,this.canonical).toPremultipliedRenderColor(this.lut),f=e.paint.get("building-emissive-strength").evaluate(o,i,this.canonical),p=n.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade;for(const e of n.parts){let t,i=a;1===e.part?(i=a,t=s):0===e.part?(i=l,t=c):2===e.part?(i=u,t=d):3===e.part&&(i=h,t=f),t=De(t,0,1);for(let o=0;o<e.vertexLength;o++){const a=e.vertexOffset+o,s=1+(p.layoutAOArray.uint8[a]/255-1)*r;p.layoutColorArray.emplace(a,i.r*s*255<<8|i.g*s*255,i.b*s*255<<8|255*t),n.hasFauxFacade&&p.layoutFacadePaintArray.emplace(a,255*u.r<<8|255*u.g,255*u.b<<8|255*d)}}const g=n.buildingBloom;if(g)for(let e=0;e<g.vertexLength;e++)p.entranceBloom.layoutColorArray.emplace(g.vertexOffset+e,255*h.r<<8|255*h.g,255*h.b<<8|51*f)}}needsEvaluation(){return!this.colorBufferUploaded}updateReplacement(e,t,r){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(Gf(this.activeReplacements,n))return;this.activeReplacements=n;for(const e of this.footprints)e.hiddenFlags&=-2;const i=[];for(const t of this.activeReplacements){if(t.order<r)continue;const n=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));for(const r of this.footprints)r.min.x>t.max.x||r.max.x<t.min.x||r.min.y>t.max.y||r.max.y<t.min.y||(i.length=0,Bm(this.footprintsVertices,r.footprintVertexOffset,r.footprintVertexLength,t.footprintTileId.canonical,e.canonical,i),Hf(t.footprint,i,this.footprintsIndices.uint16,r.footprintIndexOffset,r.footprintIndexLength,0,-n)&&(r.hiddenFlags|=1))}0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.footprints)this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags);this.indexArrayForConflationUploaded=!1}getFootprint(e){if(void 0!==e.id){const t=this.featureFootprintLookup.get(e.id);return this.footprints[t]}return null}getHeightAtTileCoord(e,t){let r=Number.NEGATIVE_INFINITY,n=!0;const i=4*(e+Gn)*Gn+(t+Gn);if(this.footprintLookup.hasOwnProperty(i)){const e=this.footprintLookup[i];return e?{height:e.height,hidden:0!==e.hiddenFlags}:void 0}const o=new Te(e,t);for(const a of this.footprints)e>a.max.x||a.min.x>e||t>a.max.y||a.min.y>t||a.height<=r||Nm(o,this.footprintsVertices.float32.subarray(2*a.footprintVertexOffset,2*(a.footprintVertexOffset+a.footprintVertexLength)),this.footprintsIndices.uint16.subarray(a.footprintIndexOffset,a.footprintIndexOffset+a.footprintIndexLength))&&(r=a.height,this.footprintLookup[i]=a,n=0!==a.hiddenFlags);if(r!==Number.NEGATIVE_INFINITY)return{height:r,hidden:n};this.footprintLookup[i]=void 0}}function Nm(e,t,r){for(let n=0;n<r.length;n+=3){const i=r[n],o=r[n+1],a=r[n+2],s=t[2*i+0],l=t[2*i+1],c=t[2*o+0],u=t[2*o+1],d=t[2*a+0],h=t[2*a+1],f=(s-d)*(e.y-h)-(l-h)*(e.x-d),p=(c-s)*(e.y-l)-(u-l)*(e.x-s);if(f<0!=p<0&&0!==f&&0!==p)continue;const g=(d-c)*(e.y-u)-(h-u)*(e.x-c);if(0===g||g<0==f+p<=0)return!0}return!1}function Bm(e,t,r,n,i,o){const a=Math.pow(2,n.z-i.z);for(let s=0;s<r;s++){let r=e.float32[2*(s+t)+0],l=e.float32[2*(s+t)+1];r=(r+i.x*Gn)*a-n.x*Gn,l=(l+i.y*Gn)*a-n.y*Gn,o.push(new Te(r,l))}}let jm,Vm;ea(Fm,"BuildingBucket",{omit:["layers"]}),ea(zm,"BuildingGeometry"),ea(Dm,"BuildingBloomGeometry");const Gm=Bs([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),Um=Bs([{name:"a_z_offset_width",components:3,type:"Float32"}],4),{members:$m}=Gm,Hm=Bs([{name:"a_packed",components:3,type:"Float32"}]),{members:qm}=Hm,Wm=Bs([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:Zm}=Wm;class Ym{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new Hd({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const r=this.getKey(e,t);return this.positions[r]}trim(){const e=this.width,t=this.height=Ve(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,r){const n=[];let i=e.length%2==1?-e[e.length-1]*r:0,o=e[0]*r,a=!0;n.push({left:i,right:o,isDash:a,zeroLength:0===e[0]});let s=e[0];for(let t=1;t<e.length;t++){a=!a;const l=e[t];i=s*r,s+=l,o=s*r,n.push({left:i,right:o,isDash:a,zeroLength:0===l})}return n}addRoundDash(e,t,r){const n=t/2;
1for(let t=-r;t<=r;t++){const i=this.width*(this.nextRow+r+t);let o=0,a=e[o];for(let s=0;s<this.width;s++){s/a.right>1&&(a=e[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let d;const h=t/r*(n+1);if(a.isDash){const e=n-Math.abs(h);d=Math.sqrt(u*u+e*e)}else d=n-Math.sqrt(u*u+h*h);this.image.data[i+s]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}const r=e[0],n=e[e.length-1];r.isDash===n.isDash&&(r.left=n.left-this.width,n.right=r.right+this.width);const i=this.width*this.nextRow;let o=0,a=e[o];for(let r=0;r<this.width;r++){r/a.right>1&&(a=e[++o]);const n=Math.abs(r-a.left),s=Math.abs(r-a.right),l=Math.min(n,s);this.image.data[i+r]=Math.max(0,Math.min(255,(a.isDash?l:-l)+t+128))}}addDash(e,t){const r=this.getKey(e,t);if(this.positions[r])return this.positions[r];const n="round"===t,i=n?7:0,o=2*i+1;if(this.nextRow+o>this.height)return Ze("LineAtlas out of space"),null;0===e.length&&e.push(1);let a=0;for(let t=0;t<e.length;t++)e[t]<0&&(Ze("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),a+=e[t];if(0!==a){const r=this.width/a,o=this.getDashRanges(e,this.width,r);n?this.addRoundDash(o,r,i):this.addRegularDash(o,"square"===t?.5*r:0)}const s=this.nextRow+i;this.nextRow+=o;const l={tl:[s,i],br:[a,0]};return this.positions[r]=l,l}}ea(Ym,"LineAtlas");const Xm=Qc.types,Km=Math.cos(Math.PI/180*37.5),Jm=Math.cos(Math.PI/180*5);class Qm{constructor(e){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.elevationType="none",this.zoom=e.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=e.overscaling,this.pixelRatio=e.pixelRatio,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Zs,this.layoutVertexArray2=new Ys,this.patternVertexArray=new Ys,this.indexArray=new ll,this.programConfigurations=new pc(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new Bl,this.maxLineLength=0,this.zOffsetVertexArray=new Ys,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.tessellationStep=e.tessellationStep?e.tessellationStep:128,this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,r,n){}populate(e,t,r,n){this.hasPattern=Eh("line",this.layers,this.pixelRatio,t);const i=this.layers[0].layout.get("line-sort-key");this.tileToMeter=Gc(r);const o=this.layers[0].layout.get("line-elevation-reference");if("hd-road-markup"===o)this.elevationType="road";else{const e=this.layers[0].layout.get("line-z-offset"),t=e.isConstant()&&!e.constantOr(0);this.elevationType="sea"!==o&&"ground"!==o&&t?"none":"offset","offset"===this.elevationType&&"none"===o&&Ze(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`)}const a=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope="offset"===this.elevationType&&void 0!==a;const s=[];for(const{feature:o,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Jc(o,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,r))continue;const d=i?i.evaluate(u,{},r):void 0,h={id:a,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Kc(o,r,n),patterns:{},sortKey:d};s.push(h)}i&&s.sort(((e,t)=>
1e.sortKey-t.sortKey));const{lineAtlas:l,featureIndex:c}=t,u=this.addConstantDashes(l);for(const n of s){const{geometry:i,index:o,sourceLayerIndex:a}=n;if(u&&this.addFeatureDashes(n,l),this.hasPattern){const e=Ph("line",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,i,o,r,l.positions,t.availableImages,t.brightness,t.elevationFeatures);c.insert(e[o].feature,i,o,a,this.index)}}addConstantDashes(e){let t=!1;for(const r of this.layers){const n=r.paint.get("line-dasharray").value,i=r.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==i.kind)t=!0;else{const t=i.value,r=n.value;if(!r)continue;e.addDash(r,t)}}return t}addFeatureDashes(e,t){const r=this.zoom;for(const n of this.layers){const i=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===o.kind)continue;let a,s;if("constant"===i.kind){if(a=i.value,!a)continue}else a=i.evaluate({zoom:r},e);s="constant"===o.kind?o.value:o.evaluate({zoom:r},e),t.addDash(a,s),e.patterns[n.id]=[t.getKey(a,s)]}}update(e,t,r,n,i,o,a,s){this.programConfigurations.updatePaintArrays(e,t,i,r,n,o,a,s)}addFeatures(e,t,r,n,i,o){for(const i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,r,n,o,e.elevationFeatures)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,qm)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,Zm)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Um.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$m),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e,t){let r,n;if(t&&t>0?(r=`mapbox_clip_start_${t}`,n=`mapbox_clip_end_${t}`):(r="mapbox_clip_start",n="mapbox_clip_end"),e.properties&&e.properties.hasOwnProperty(r)&&e.properties.hasOwnProperty(n))return{start:+e.properties[r],end:+e.properties[n]}}addFeature(e,t,r,n,i,o,a,s){const l=this.layers[0].layout,c=l.get("line-join").evaluate(e,{}),u=l.get("line-cap").evaluate(e,{}),d=l.get("line-miter-limit"),h=l.get("line-round-limit");this.lineClips=this.lineFeatureClips(e),this.lineFeature=e;const f=!(!e.properties||!e.properties.hasOwnProperty("mapbox_line_metrics"))&&e.properties.mapbox_line_metrics;this.zOffsetValue=l.get("line-z-offset").value;const p=this.layers[0].paint.get("line-width").value;if("constant"!==p.kind&&!1===p.isLineProgressConstant&&(this.variableWidthValue=p),"road"===this.elevationType){const r=this.layoutVertexArray.length;if(!this.addElevatedRoadFeature(e,t,n,s,c,u,d,h)){const[i,o]=this.clipRuntimeLinesToTile(t,1);for(let t=0;t<i.length;t++){const r=i[t],a=o[t],s={progress:{min:a.progress.min,max:a.progress.max},nextDir:this.computeSegNextDir(a,r),prevDir:this.computeSegPrevDir(a,r)};this.addLine(r,e,n,c,u,d,h,s,f&&a.parentIndex>0?a.parentIndex:null)}this.fillNonElevatedRoadSegment(r)}}else for(let r=0;r<t.length;r++)this.addLine(t[r],e,n,c,u,d,h,void 0,f&&r>0?r:null);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,o,n,a,void 0,this.worldview)}computeSegNextDir(e,t){return e.nextPoint.sub(t.at(-2)).unit()}computeSegPrevDir(e,t){return t[1].sub(e.prevPoint).unit()}
1clipLinesToTile(e,t){return Lp(e,-t,-t,Gn+t,Gn+t)}clipRuntimeLinesToTile(e,t){const r=[];return[Lp(e,-t,-t,Gn+t,Gn+t,r),r]}addElevatedRoadFeature(e,t,r,n,i,o,a,s){const l=[],c=ku.getElevationFeature(e,n);if(c){const e=this.clipLinesToTile(t,1),n=this.prepareElevatedLines(e,c,r);for(const e of n)l.push({geometry:e,elevation:c,elevationTileID:r,segment:{progress:{min:0,max:1},nextDir:void 0,prevDir:void 0}})}if(0===l.length)return!1;for(const t of l){const n=this.layoutVertexArray.length;this.addLine(t.geometry,e,r,i,o,a,s);const l=new Tu(r,t.elevationTileID);if(t.elevation)for(let e=n;e<this.layoutVertexArray.length;e++){const r=new Te(this.layoutVertexArray.int16[6*e]>>1,this.layoutVertexArray.int16[6*e+1]>>1),n=l.pointElevation(r,t.elevation,.05);this.updateHeightRange(n),this.zOffsetVertexArray.emplaceBack(n,0,0)}else this.fillNonElevatedRoadSegment(n)}return!0}prepareElevatedLines(e,t,r){if(null!=t.constantHeight)return e;const n=[],i=1/Gc(r);for(const r of e)Op(r,new wu(t,i),0,n);return n}fillNonElevatedRoadSegment(e){for(let t=e;t<this.layoutVertexArray.length;t++)this.zOffsetVertexArray.emplaceBack(0,0,0)}updateHeightRange(e){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,e),this.heightRange.max=Math.max(this.heightRange.max,e)):this.heightRange={min:e,max:e}}addLine(e,t,r,n,i,o,a,s,l){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0,this.lineClips=l?this.lineFeatureClips(t,l):this.lineClips;const c="none"===n;this.patternJoinNone=this.hasPattern&&c,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[];const u=s&&s.progress.min>0,d=s&&s.progress.max<1;if(this.lineClips){let r={min:this.lineClips.start,max:this.lineClips.end},n=1;if(s){const e=this.lineClips.end-this.lineClips.start;r=function(e,t,r){return{min:at(e.min,t,r),max:at(e.max,t,r)}}(s.progress,{min:0,max:1},r),e>0&&(n=(r.max-r.min)/e)}const i=+t.properties.mapbox_clip_feature_len,o=+t.properties.mapbox_clip_seg_len;if(Number.isNaN(i)||Number.isNaN(o)){for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);const t=this.totalDistance/(r.max-r.min);this.totalFeatureLength=Number.isFinite(t)?t:0,this.lineClips.start=r.min,this.lineClips.end=r.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}else this.totalFeatureLength=i,this.distance=o*n,this.lineClips.start=r.min,this.lineClips.end=r.max,this.maxLineLength=Math.max(this.maxLineLength,this.distance);this.lineClipsArray.push(this.lineClips),this.updateScaledDistance()}const h="Polygon"===Xm[t.type];let f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let p=0;for(;p<f-1&&e[p].equals(e[p+1]);)p++;if(f<(h?3:2))return;"bevel"===n&&(o=1.05);const g=this.segments.prepareSegment(10*f,this.layoutVertexArray,this.indexArray);let m,y,_,v,b,x,w,S;s&&s.prevDir&&(x=s.prevDir.perp()),s&&s.nextDir&&(w=s.nextDir.perp()),this.e1=this.e2=-1,h&&(m=e[f-2],b=e[p].sub(m)._unit()._perp());for(let t=p;t<f;t++){if(_=t===f-1?h?e[p+1]:void 0:e[t+1],_&&e[t].equals(_))continue;b&&(v=b),m&&(y=m),m=e[t],S=this.evaluateLineProgressFeatures(y?y.dist(m):0),b=_?_.sub(m)._unit()._perp():v,v=v||b;const r=y&&_;let s=r?n:h||c?"butt":i;const l=v.x*b.x+v.y*b.y;if(c){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,r=e.lineSoFar-e.segmentStart;for(let n=0;n<t;++n){const t=e.segmentPoints[2*n+1],i=Math.round(e.segmentPoints[2*n])+.5+.25*t;e.patternVertexArray.emplaceBack(i,r,e.segmentStart),e.patternVertexArray.emplaceBack(i,r,e.segmentStart)}e.segmentPoints.length=0}e.e1=e.e2=-1};if(r&&l<Jm){this.updateDistance(y,m),this.addCurrentVertex(m,v,1,1,g,S),e(this),this.addCurrentVertex(m,b,-1,-1,g,S);continue}if(y){if(!_){this.updateDistance(y,m),this.addCurrentVertex(m,v,1,1,g,S),e(this);continue}s="miter"}}let k=v.add(b);0===k.x&&0===k.y||k._unit();const T=k.x*b.x+k.y*b.y,I=0!==T?1/T:1/0,M=2*Math.sqrt(2-2*T),E=T<Km&&y&&_,P=v.x*b.y-v.y*b.x>0,A=this.overscaling<=16?122880/(512*this.overscaling):0;if(r&&"round"===s)if(I<a)s="miter";else if(I<=2){const e=ey(m,-10,8202);s="offset"===this.elevationType&&(e||this.hasCrossSlope)?"miter":"fakeround"}if("miter"===s&&I>o&&(s="bevel"),"bevel"===s&&(I>2&&(s="flipbevel"),I<o&&(s="miter")),y&&!("miter"===s&&E)&&this.updateDistance(y,m),"miter"
vendor: 4,399 bytes, line 1
1===s)if(E){const e=m.dist(y);if(e>2*A){const t=m.sub(m.sub(y)._mult(A/e)._round());this.updateDistance(y,t),this.addCurrentVertex(t,v,0,0,g,S),y=t}this.updateDistance(y,m),k._mult(I),this.addCurrentVertex(m,k,0,0,g,S);const t=m.dist(_);if(t>2*A){const e=m.add(_.sub(m)._mult(A/t)._round());this.updateDistance(m,e),this.addCurrentVertex(e,b,0,0,g,S),m=e}}else k._mult(I),this.addCurrentVertex(m,k,0,0,g,S);else if("flipbevel"===s){if(I>100)k=b.mult(-1);else{const e=I*v.add(b).mag()/v.sub(b).mag();k._perp()._mult(e*(P?-1:1))}this.addCurrentVertex(m,k,0,0,g,S),this.addCurrentVertex(m,k.mult(-1),0,0,g,S)}else if("bevel"===s||"fakeround"===s){null!=S&&y&&this.addCurrentVertex(m,w||v,-1,-1,g,S);const e=m.dist(y)<=2*A&&"bevel"!==s,t=k.mult(P?1:-1);t._mult(I);const r=b.mult(P?-1:1),n=v.mult(P?-1:1),i=this.evaluateLineProgressFeatures(this.distance);if(null==S&&(this.addHalfVertex(m,t.x,t.y,!1,!P,0,g,i),e||this.addHalfVertex(m,t.x+2*n.x,t.y+2*n.y,!1,P,0,g,i)),"fakeround"===s){const e=Math.round(180*M/Math.PI/20);this.addHalfVertex(m,n.x,n.y,!1,P,0,g,i);for(let t=0;t<e;t++){let o=t/e;if(.5!==o){const e=o-.5;o+=o*e*(o-1)*((1.0904+l*(l*(3.55645-1.43519*l)-3.2452))*e*e+(.848013+l*(.215638*l-1.06021)))}const a=r.sub(n)._mult(o)._add(n)._unit();this.addHalfVertex(m,a.x,a.y,!1,P,0,g,i)}this.addHalfVertex(m,r.x,r.y,!1,P,0,g,i)}e||null!=S||this.addHalfVertex(m,t.x+2*r.x,t.y+2*r.y,!1,P,0,g,i),null!=S&&_&&this.addCurrentVertex(m,x||b,1,1,g,S)}else if("butt"===s)this.addCurrentVertex(m,k,0,0,g,S);else if("square"===s){if(!y){const e=u?0:-1;this.addCurrentVertex(m,k,e,e,g,S)}if(this.addCurrentVertex(m,k,0,0,g,S),y){const e=d?0:1;this.addCurrentVertex(m,k,e,e,g,S)}}else if("round"===s){if(y){const e=!r&&w?w:v;this.addCurrentVertex(m,e,0,0,g,S),!r&&d||this.addCurrentVertex(m,e,1,1,g,S,!0)}if(_){const e=!r&&x?x:b;!r&&u||this.addCurrentVertex(m,e,-1,-1,g,S,!0),this.addCurrentVertex(m,e,0,0,g,S)}}}}addVerticesTo(e,t,r,n,i,o,a,s,l,c){const u=(t.w-e.w)/this.tessellationStep|0;let d=0;const h=this.scaledDistance;if(u>1){this.lineSoFar=e.w;const h=(t.x-e.x)/u,f=(t.y-e.y)/u,p=(t.z-e.z)/u,g=(t.w-e.w)/u;for(let t=1;t<u;++t){e.x+=h,e.y+=f,e.z+=p,this.lineSoFar+=g,d+=g;const t=this.evaluateLineProgressFeatures(this.prevDistance+d);this.scaledDistance=(this.prevDistance+d)/this.totalDistance,this.addHalfVertex(e,r,n,c,!1,a,l,t),this.addHalfVertex(e,i,o,c,!0,-s,l,t)}}this.lineSoFar=t.w,this.scaledDistance=h;const f=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(t,r,n,c,!1,a,l,f),this.addHalfVertex(t,i,o,c,!0,-s,l,f)}evaluateLineProgressFeatures(e){if(!this.variableWidthValue&&"offset"!==this.elevationType)return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+e)/this.totalFeatureLength):Ze(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let t=0;return this.variableWidthValue&&"constant"!==this.variableWidthValue.kind&&(t=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0),"offset"!==this.elevationType?{zOffset:0,variableWidth:t}:"constant"===this.zOffsetValue.kind?{zOffset:this.zOffsetValue.value,variableWidth:t}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:t}}addCurrentVertex(e,t,r,n,i,o,a=!1){const s=t.x+t.y*r,l=t.y-t.x*r,c=t.y*n-t.x,u=-t.y-t.x*n;if(null!=o){const t="offset"===this.elevationType,d=-10,h=8202,f=o.zOffset,p=new Ap(e.x,e.y,f,this.lineSoFar),g=!!t&&ey(e,d,h),m=this.lineSoFar,y=this.distance;if(this.currentVertex)if(g){const t=this.currentVertexIsOutside,o=this.currentVertex,g=new Ap(e.x,e.y,f,this.lineSoFar);if(Rp(o,g,d,h),!ey(g,d,h)){if(t){this.e1=this.e2=-1,this.distance-=o.dist(p),this.lineSoFar=o.w;const e=this.evaluateLineProgressFeatures(o.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(o,s,l,a,!1,r,i,e),this.addHalfVertex(o,c,u,a,!0,-n,i,e),this.prevDistance=this.distance}this.distance=this.prevDistance+o.dist(g),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(o,g,s,l,c,u,r,n,i,a),this.distance=y,this.scaledDistance=this.distance/this.totalDistance}}else{const e=this.currentVertex;if(this.currentVertexIsOutside){Rp(e,p,d,h),this.e1=this.e2=-1,this.distance-=e.dist(p),this.scaledDistance=this.distance/this.totalDistance,this.lineS
1oFar=e.w;const t=this.evaluateLineProgressFeatures(e.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(e,s,l,a,!1,r,i,t),this.addHalfVertex(e,c,u,a,!0,-n,i,t),this.prevDistance=this.distance,this.distance=y,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(e,p,s,l,c,u,r,n,i,a)}else g||(this.addHalfVertex(e,s,l,a,!1,r,i,o),this.addHalfVertex(e,c,u,a,!0,-n,i,o));this.currentVertex=p,this.currentVertexIsOutside=g,this.lineSoFar=m}else this.addHalfVertex(e,s,l,a,!1,r,i,o),this.addHalfVertex(e,c,u,a,!0,-n,i,o)}addHalfVertex({x:e,y:t},r,n,i,o,a,s,l){if(this.patternJoinNone&&(0===this.segmentPoints.length&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),o||this.segmentPoints.push(this.lineSoFar-this.segmentStart,a)),this.layoutVertexArray.emplaceBack((e<<1)+(i?1:0),(t<<1)+(o?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){const e=fr(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,e)}const c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),o?this.e2=c:this.e1=c,null!=l&&this.zOffsetVertexArray.emplaceBack(l.zOffset,l.variableWidth,l.variableWidth)}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(e,t){this.prevDistance=this.distance,this.distance+=e.dist(t),this.updateScaledDistance()}}function ey(e,t,r){return e.x<t||e.x>r||e.y<t||e.y>r}let ty,ry;function ny(e,t,r){return t*(Gn/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}ea(Qm,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const iy=(e,t,r)=>(1-r)*e+r*t;function oy(e,t){return 1/ny(e,1,t.tileZoom)}function ay(e,t,r,n){return e.translatePosMatrix(n||t.tileID.projMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const sy=e=>{const t=[];ly(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const r=e.paint.get("line-trim-offset");0===r[0]&&0===r[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const n="none"===e.layout.get("line-join").constantOr("miter"),i=!!e.paint.get("line-pattern").constantOr(1);return n&&i&&t.push("LINE_JOIN_NONE"),t};function ly(e){const t=e.paint.get("line-dasharray").value;return"constant"!==t.kind||t.value}let cy;const uy=()=>cy||(cy={layout:ty||(ty=new us({"line-cap":new ls(ds.layout_line["line-cap"]),"line-join":new ls(ds.layout_line["line-join"]),"line-miter-limit":new ss(ds.layout_line["line-miter-limit"]),"line-round-limit":new ss(ds.layout_line["line-round-limit"]),"line-sort-key":new ls(ds.layout_line["line-sort-key"]),"line-z-offset":new ls(ds.layout_line["line-z-offset"]),"line-elevation-reference":new ss(ds.layout_line["line-elevation-reference"]),"line-cross-slope":new ss(ds.layout_line["line-cross-slope"]),visibility:new ss(ds.layout_line.visibility),"line-width-unit":new ss(ds.layout_line["line-width-unit"])})),paint:ry||(ry=new us({"line-opacity":new ls(ds.paint_line["line-opacity"]),"line-color":new ls(ds.paint_line["line-color"]),"line-translate":new ss(ds.paint_line["line-translate"]),"line-translate-anchor":new ss(ds.paint_line["line-translate-anchor"]),"line-width":new ls(ds.paint_line["line-width"]),"line-gap-width":new ls(ds.paint_line["line-gap-width"]),"line-offset":new ls(ds.paint_line["line-offset"]),"line-blur":new ls(ds.paint_line["line-blur"]),"line-dasharray":new ls(ds.paint_line["line-dasharray"]),"line-pattern":new ls(ds.paint_line["line-pattern"]),"line-pattern-cross-fade":new ss(ds.paint_line["line-pattern-cross-fade"]),"line-gradient":new cs(ds.paint_line["line-gradient"]),"line-trim-offset":new ss(ds.paint_line["line-trim-offset"]),"line-trim-fade-range":new ss(ds.paint_line["line-trim-fade-range"]),"line-trim-color":new ss(ds.paint_line["line-trim-color"]),"line-emissive-strength":new ls(ds.paint_line["line-emissive-strength"]),"line-border-width":new ls(ds.paint_line["line-border-width"]),"line-border-color":new ls(ds.paint_line["line-border-color"]),"line-occlusion-opacity":new ss(ds.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}
vendor: 4,516 bytes, line 1
1),"line-gradient-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},cy);class dy extends ls{possiblyEvaluate(e,t){return t=new Ja(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition,worldview:t.worldview}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=Object.assign({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}let hy;function fy(e,t){return t>0?t+2*e:e}const py=Bs([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),gy=Bs([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),my=Bs([{name:"a_projected_pos",components:4,type:"Float32"}],4);Bs([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const yy=Bs([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),_y=Bs([{name:"a_x_axis",components:3,type:"Float32"},{name:"a_y_axis",components:3,type:"Float32"}]),vy=Bs([{name:"a_texb",components:2,type:"Uint16"}]),by=Bs([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),xy=Bs([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);Bs([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const wy=Bs([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Sy=Bs([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Bs([{name:"triangle",components:3,type:"Uint16"}]),Bs([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),Bs([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}
1]),Bs([{type:"Float32",name:"offsetX"}]),Bs([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var ky=24;function Ty(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),Ka.applyArabicShaping&&(e=Ka.applyArabicShaping(e)),e}(e.text,t,r)})),e}const Iy={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function My(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function Ey(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}const Py=4294967296,Ay=1/Py,Cy="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");let Ry=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,r=this.length){for(;this.pos<r;){const r=this.readVarint(),n=r>>3,i=this.pos;this.type=7&r,e(n,t,this),this.pos===i&&this.skip(r)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Py;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Py;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let r,n;return n=t[this.pos++],r=127&n,n<128?r:(n=t[this.pos++],r|=(127&n)<<7,n<128?r:(n=t[this.pos++],r|=(127&n)<<14,n<128?r:(n=t[this.pos++],r|=(127&n)<<21,n<128?r:(n=t[this.pos],r|=(15&n)<<28,function(e,t,r){const n=r.buf;let i,o;if(o=n[r.pos++],i=(112&o)>>4,o<128)return Ly(e,i,t);if(o=n[r.pos++],i|=(127&o)<<3,o<128)return Ly(e,i,t);if(o=n[r.pos++],i|=(127&o)<<10,o<128)return Ly(e,i,t);if(o=n[r.pos++],i|=(127&o)<<17,o<128)return Ly(e,i,t);if(o=n[r.pos++],i|=(127&o)<<24,o<128)return Ly(e,i,t);if(o=n[r.pos++],i|=(1&o)<<31,o<128)return Ly(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(r,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Cy?Cy.decode(this.buf.subarray(t,e)):function(e,t,r){let n="",i=t;for(;i<r;){const t=e[i];let o,a,s,l=null,c=t>239?4:t>223?3:t>191?2:1;if(i+c>r)break;1===c?t<128&&(l=t):2===c?(o=e[i+1],128==(192&o)&&(l=(31&t)<<6|63&o,l<=127&&(l=null))):3===c?(o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&t)<<12|(63&o)<<6|63&a,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&t)<<18|(63&o)<<12|(63&a)<<6|63&s,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(e){const t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}
vendor: 4,417 bytes, line 1
1writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Ay),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Ay),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?function(e,t){let r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),4294967295^r?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,r.buf[r.pos]=127&(e>>>=7)}(r,0,t),function(e,t){const r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const t=this.pos;this.pos=function(e,t,r){for(let n,i,o=0;o<t.length;o++){if(n=t.charCodeAt(o),n>55295&&n<57344){if(!i){n>56319||o+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);const r=this.pos-t;r>=128&&Oy(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let r=0;r<t;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,t){this.pos++;const r=this.pos;e(t,this);const n=this.pos-r;n>=128&&Oy(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,r){this.writeTag(e,2),this.writeRawMessage(t,r)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Dy,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,zy,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,By,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Fy,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Ny,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,jy,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Vy,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Gy,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Uy,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}};function Ly(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Oy(e,t,r){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(let t=r.pos-1;t>=e;t--)r.buf[t+n]=r.buf[t]}function Dy(e,t){for(let r=0;r<e.length;r++)t.writeVarint(e[r])}function zy(e,t){for(let r=0;r<e.length;r++)t.writeSVarint(e[r])}function Fy(e,t){for(let r=0;r<e.length;r++)t.writeFloat(e[r])}function Ny(e,t){for(let r=0;r<e.length;r++)t.writeDouble(e[r])}function By(e,t){for(let r=0;r<e.length;r++)t.writeBoolean(e[r])}function jy(e,t){for(let r=0;r<e.length;r++)t.writeFixed32(e[r])}function Vy(e,t){for(let r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Gy(e,t){for(let r=0;r<e.length;
1r++)t.writeFixed64(e[r])}function Uy(e,t){for(let r=0;r<e.length;r++)t.writeSFixed64(e[r])}function $y(e,t,r){t.glyphs=[],1===e&&r.readMessage(Hy,t)}function Hy(e,t,r){if(3===e){const{id:e,bitmap:n,width:i,height:o,left:a,top:s,advance:l}=r.readMessage(qy,{});t.glyphs.push({id:e,bitmap:new Hd({width:i+6,height:o+6},n),metrics:{width:i,height:o,left:a,top:s,advance:l}})}else 4===e?t.ascender=r.readSVarint():5===e&&(t.descender=r.readSVarint())}function qy(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}const Wy={horizontal:1,vertical:2,horizontalOnly:3};class Zy{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(e,t){const r=new Zy;return r.scale=e||1,r.fontStack=t,r}static forImage(e){const t=new Zy;return t.image=e,t}}class Yy{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t,r){const n=new Yy;for(let i=0;i<e.sections.length;i++){const o=e.sections[i];o.image?n.addImageSection(o,r):n.addTextSection(o,t)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=function(e,t){let r="";for(let n=0;n<e.length;n++){const i=e.charCodeAt(n+1)||null,o=e.charCodeAt(n-1)||null;r+=!t&&(i&&Fa(i)&&!Iy[e[n+1]]||o&&Fa(o)&&!Iy[e[n-1]])||!Iy[e[n]]?e[n]:Iy[e[n]]}return r}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&Ky[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Ky[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const r=new Yy;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Zy.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e,t){const r=e.image?e.image.getPrimary():null;if(!r)return void Ze("Can't add FormattedSection with an empty image.");r.scaleSelf(t);const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCodePoint(n),this.sections.push(Zy.forImage(r)),this.sectionIndex.push(this.sections.length-1)):Ze("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Xy(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g=1){const m=Yy.fromFeature(e,i,g);d===Wy.vertical&&m.verticalizePunctuation(h);let y=[];const _=function(e,t,r,n,i,o){if(!e)return[];const a=[],s=function(e,t,r,n,i,o){let a=0;for(let r=0;r<e.length();r++){const s=e.getSection(r);a+=Qy(e.getCodePoint(r),s,n,i,t,o)}return a/Math.max(1,Math.ceil(a/r))}(e,t,r,n,i,o),l=e.text.indexOf("​")>=0;let c=0;for(let r=0;r<e.length();r++){const u=e.getSection(r),d=e.getCodePoint(r);if(Ky[d]||(c+=Qy(d,u,n,i,t,o)),r<e.length()-1){const t=Oa(d);(Jy[d]||t||u.image)&&a.push(r_(r+1,c,s,a,t_(d,e.getCodePoint(r+1),t&&l),!1))}}return n_(r_(e.length(),c,s,a,0,!0))}(m,c,o,t,n,f),{processBidirectionalText:v,processStyledBidirectionalText:b}=Ka;if(v&&1===m.sections.length){const e=v(m.toString(),_);for(const t of e){const e=new Yy;e.text=t,e.sections=m.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);y.push(e)}}else if(b){const e=b(m.text,m.sectionIndex,_);for(const t of e){const e=new Yy;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,y.push(e)}}else y=function(e,t){const r=[],n=e.text;let i=0;for(const n of t)r.push(e.substring(i,n)),i=n;return i<n.length&&r.push(e.substring(i,n.length)),r}(m,_);const x=[],w={positionedLines:x,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:d,iconsInText:!1,verticalizable:!1,hasBaseline:!1};if(function(e,t,r,n,i,o,a,s,l,c,u,d){let h=0,f=0,p=0;const g="right"===s?1:"left"===s?0:.5;let m=!1;for(const e of i){const r=e.getSections();for(const e of r){if(e.image)continue;const r=t[e.fontStack];if(r&&(m=void 0!==r.ascender&&void 0!==r.descender,!m))break}if(!m)break}let y=0;for(const a of i){a.trim();const i=a.getMaxScale(),s=(i-1)*ky,_={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=_;const v=_.positionedGlyphs;let b=0;if(!a.length()){f+=o,++y;continue}let x=0,w=0;for(let o=0;o<a.length();o++){const s=a.getSection(o),p=a.getSectionIndex(o),g=a.getCodePoint(o);let y=s.scale,_=null,S=null,k=null,T=ky,I=0,M=l;M===Wy.vertical&&za(g)&&(M=Wy.horizontal);const E=!(M===Wy.horizontal||!u&&!Da(g)||u&&(Ky[g]||Na(g)));if(s.image){const t=n.get(s.image.toString());if(!t)continue;k=s.image,e.iconsInText=e.iconsInText||!0,S=t.paddedRect;const r=t.displaySize;y=y*ky/d,_={width:r[0],height:r[1],left:0,top:-3,advance:E?r[1]:r[0],localGlyph:!1},I=m?-_.height*y:i*ky-17-r[1]*y,T=_.advance;const o=(E?r[0]:r[1])*y-ky*i;o>0&&o>b&&(b=o)}else{const e=r[s.fontStack];if(!e)continue;e[g]&&(S=e[g]);const n=t[s.fontStack];if(!n)continue;const o=n.glyphs[g];
vendor: 6,279 bytes, line 1
1if(!o)continue;if(_=o.metrics,T=8203!==g?ky:0,m){const e=void 0!==n.ascender?Math.abs(n.ascender):0,t=void 0!==n.descender?Math.abs(n.descender):0,r=(e+t)*y;x<r&&(x=r,w=(e-t)/2*y),I=-e*y}else I=(i-y)*ky-17}E?(e.verticalizable=!0,v.push({glyph:g,image:k,x:h,y:f+I,vertical:E,scale:y,localGlyph:_.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:_,rect:S}),h+=T*y+c):(v.push({glyph:g,image:k,x:h,y:f+I,vertical:E,scale:y,localGlyph:_.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:_,rect:S}),h+=_.advance*y+c)}0!==v.length&&(p=Math.max(h-c,p),m?o_(v,g,b,w,o*i/2):o_(v,g,b,0,o/2)),h=0;const S=o*i+b;_.lineOffset=Math.max(b,s),f+=S,++y}const _=f,{horizontalAlign:v,verticalAlign:b}=i_(a);(function(e,t,r,n,i,o){const a=(t-r)*i,s=-o*n;for(const t of e)for(const e of t.positionedGlyphs)e.x+=a,e.y+=s})(e.positionedLines,g,v,b,p,_),e.top+=-b*_,e.bottom=e.top+_,e.left+=-v*p,e.right=e.left+p,e.hasBaseline=m}(w,t,r,n,y,a,s,l,d,c,h,p),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(x))return w}const Ky={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Jy={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 Qy(e,t,r,n,i,o){if(t.image){const e=n.get(t.image.toString());return e?e.displaySize[0]*t.scale*ky/o+i:0}{const n=r[t.fontStack],o=n&&n.glyphs[e];return o?o.metrics.advance*t.scale+i:0}}function e_(e,t,r,n){const i=Math.pow(e-t,2);return n?e<t?i/2:2*i:i+Math.abs(r)*r}function t_(e,t,r){let n=0;return 10===e&&(n-=1e4),r&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function r_(e,t,r,n,i,o){let a=null,s=e_(t,r,i,o);for(const e of n){const n=e_(t-e.x,r,i,o)+e.badness;n<=s&&(a=e,s=n)}return{index:e,x:t,priorBreak:a,badness:s}}function n_(e){return e?n_(e.priorBreak).concat(e.index):[]}function i_(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function o_(e,t,r,n,i){if(!(t||r||n||i))return;const o=e.length-1,a=e[o],s=(a.x+a.metrics.advance*a.scale)*t;for(let t=0;t<=o;t++)e[t].x-=s,e[t].y+=r+n+i}function a_(e){return void 0!==e.imagePrimary&&void 0!==e.top&&void 0!==e.bottom&&void 0!==e.left&&void 0!==e.right}function s_(e,t,r,n){const{horizontalAlign:i,verticalAlign:o}=i_(n),a=r[0]-e.displaySize[0]*i,s=r[1]-e.displaySize[1]*o;return{imagePrimary:e,imageSecondary:t,top:s,bottom:s+e.displaySize[1],left:a,right:a+e.displaySize[0]}}function l_(e,t,r,n,i,o){const a=e.imagePrimary;let s;if(a.content){const e=a.content,t=a.pixelRatio||1;s=[e[0]/t,e[1]/t,a.displaySize[0]-e[2]/t,a.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,d,h,f;"width"===r||"both"===r?(f=i[0]+l-n[3],d=i[0]+c+n[1]):(f=i[0]+(l+c-a.displaySize[0])/2,d=f+a.displaySize[0]);const p=t.top*o,g=t.bottom*o;return"height"===r||"both"===r?(u=i[1]+p-n[0],h=i[1]+g+n[2]):(u=i[1]+(p+g-a.displaySize[1])/2,h=u+a.displaySize[1]),{imagePrimary:a,imageSecondary:void 0,top:u,right:d,bottom:h,left:f,collisionPadding:s}}function c_(e){return!e.imagePrimary.stretchX}function u_(e){return!e.imagePrimary.stretchY}function d_(e){return{width:e.right-e.left,height:e.bottom-e.top}}const h_=128;function f_(e,t,r,n){const{expression:i}=t;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Ja(e+1,{worldview:r}),void 0,void 0,void 0,n)};if("source"===i.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:o}=i;let a=0;for(;a<t.length&&t[a]<=e;)a++;a=Math.max(0,a-1);let s=a;for(;s<t.length&&t[s]<e+1;)s++;s=Math.min(t.length-1,s);const l=t[a],c=t[s];return"composite"===i.kind?{kind:"composite",minZoom:l,maxZoom:c,interpolationType:o}:{kind:"camera",minZoom:l,maxZoom:c,minSize:i.evaluate(new Ja(l,{worldview:r}),void 0,void 0,void 0,n),maxSize:i.evaluate(new Ja(c,{worldview:r}),void 0,void 0,void 0,n),interpolationType:o}}}function p_(e,{uSize:t,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===e.kind?n/h_:"composite"===e.kind?fr(n/h_,i/h_,r):t}function g_(e,t,r=1){let n=0,i=0;if("constant"===e.kind)i=e.layoutSize*r;else if("source"!==e.kind){const{interpolationType:o,minZoom:a,maxZoom:s}=e,l=o?De(Wi.interpolationFactor(o,t,a,s),0,1):0;"camera"===e.kind?i=fr(e.minSize,e.maxSize,l)*r:n=l*r}return{uSizeT:n,uSize:i}}class m_ extends Te{constructor(e,t,r,n,i){super(e,t),this.angle=n,this.z=r,void 0!==i&&(this.segment=i)}clone(){return new m_(this.x,this.y,this.z,this.angle,this.segment)}}function y_(e,t,r,n,i){if(void 0===t.segment)return!0;let o=t,a=t.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;const l=[];let c=0;for(;s<r/2;){const t=e[a],r=e[a+1];if(!r)return!1;let o=e[a-1].angleTo(t)-t.angleTo(r);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:o}),c+=o;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;a++,s+=t.dist(r)}return!0}function __(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function v_(e,t,r){return e?.6*t*r:0}function b_(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function x_(e,t,r,n,i,o){const a=v_(r,i,o),s=b_(r,n)*o;let l=0;const c=__(e)/2;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1],o=n.dist(i);if(l+o>c){const u=(c-l)/o,d=fr(n.x,i.x,u),h=fr(n.y,i.y,u),f=new m_(d,h,0,i.angleTo(n),r);return!a||y_(e,f,s,a,t)?f:void 0}l+=o}}function w_(e,t,r,n,i,o,a,s,l){const c=v_(n,o,a),u=b_(n,i),d=u*a,h=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-d<t/4&&(t=d+t/4),S_(e,h?t/2*s%t:(u/2+2*o)*a*s%t,t,c,r,d,h,!1,l)}function S_(e,t,r,n,i,o,a,s,l){const c=o/2,u=__(e);let d=0,h=t-r,f=[];for(let t=0;t<e.length-1;t++){const a=e[t],s=e[t+1],p=a.dist(s),g=s.angleTo(a);for(;h+r<d+p;){h+=r;const m=(h-d)/p,y=fr(a.x,s.x,m),_=fr(a.y,s.y,m);if(y>=0&&y<l&&_>=0&&_<l&&h-c>=0&&h+c<=u){const r=new m_(y,_,0,g,t);n&&!y_(e,r,o,n,i)||f.push(r)}}d+=p}return s||f.length||a||(f=S_(e,d/2,r,n,i,o,a,!0,l)),f}function k_(e){let t=0,r=0;for(const n of e)t+=n.w*n.h,r=Math.max(r,n.w);e.sort(((e,t)=>t.h-e.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let i=0,o=0;for(const t of e)for(let e=n.length-1;e>=0;e--){const r=n[e];if(!(t.w>r.w||t.h>
vendor: 9,076 bytes, line 1
1r.h)){if(t.x=r.x,t.y=r.y,o=Math.max(o,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===r.w&&t.h===r.h){const t=n.pop();t&&e<n.length&&(n[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(n.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:i,h:o,fill:t/(i*o)||0}}ea(m_,"Anchor");class T_{static getImagePositionScale(e,t,r){if(t&&e){const{sx:t,sy:r}=e;return{x:t,y:r}}return{x:r,y:r}}constructor(e,t,r,n){this.paddedRect=e;const{pixelRatio:i,version:o,stretchX:a,stretchY:s,content:l,sdf:c,usvg:u}=t;this.pixelRatio=i,this.stretchX=a,this.stretchY=s,this.content=l,this.version=o,this.padding=r,this.sdf=c,this.usvg=u,this.scale=T_.getImagePositionScale(n,u,i)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function I_(e,t,r){const n=Nr.parse(e),i=function(e,t,r=[1,1]){return{x:0,y:0,w:(e.data?e.data.width:e.width*r[0])+2*t,h:(e.data?e.data.height:e.height*r[1])+2*t}}(t,r,[n.sx,n.sy]);return{bin:i,imagePosition:new T_(i,t,r,n),imageVariant:n}}class M_{constructor(e,t,r){const n=new Map,i=new Map;this.haveRenderCallbacks=[];const o=[];this.addImages(e,n,1,o),this.addImages(t,i,2,o);const{w:a,h:s}=k_(o),l=new qd({width:a||1,height:s||1});for(const[t,r]of e.entries()){const e=n.get(t).paddedRect;qd.copy(r.data,l,{x:0,y:0},{x:e.x+1,y:e.y+1},r.data,null,r.sdf)}for(const[e,n]of t.entries()){const t=i.get(e),o=t.paddedRect;let a=t.padding;const s=o.x+a,c=o.y+a,u=n.data.width,d=n.data.height;a=a>1?a-1:a,qd.copy(n.data,l,{x:0,y:0},{x:s,y:c},n.data,r),qd.copy(n.data,l,{x:0,y:d-a},{x:s,y:c-a},{width:u,height:a},r),qd.copy(n.data,l,{x:0,y:0},{x:s,y:c+d},{width:u,height:a},r),qd.copy(n.data,l,{x:u-a,y:0},{x:s-a,y:c},{width:a,height:d},r),qd.copy(n.data,l,{x:0,y:0},{x:s+u,y:c},{width:a,height:d},r),qd.copy(n.data,l,{x:u-a,y:d-a},{x:s-a,y:c-a},{width:a,height:a},r),qd.copy(n.data,l,{x:0,y:d-a},{x:s+u,y:c-a},{width:a,height:a},r),qd.copy(n.data,l,{x:0,y:0},{x:s+u,y:c+d},{width:a,height:a},r),qd.copy(n.data,l,{x:u-a,y:0},{x:s-a,y:c+d},{width:a,height:a},r)}this.lut=r,this.image=l,this.iconPositions=n,this.patternPositions=i}addImages(e,t,r,n){for(const[i,o]of e.entries()){const{bin:e,imagePosition:a,imageVariant:s}=I_(i,o,r);t.set(i,a),n.push(e),o.hasRenderCallback&&this.haveRenderCallbacks.push(s.id)}}patchUpdatedImages(e,t,r){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((t=>e.hasImage(t,r))),e.dispatchRenderCallbacks(this.haveRenderCallbacks,r);for(const n of e.getUpdatedImages(r)){for(const i of this.iconPositions.keys()){const o=Nr.parse(i);if(or.isEqual(o.id,n)){const o=e.getImage(n,r);this.patchUpdatedImage(this.iconPositions.get(i),o,t,null)}}for(const i of this.patternPositions.keys()){const o=Nr.parse(i);if(or.isEqual(o.id,n)){const o=e.getImage(n,r);this.patchUpdatedImage(this.patternPositions.get(i),o,t,this.lut)}}}}patchUpdatedImage(e,t,r,n=null){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[i,o]=e.tl,a=e.sdf;if(this.lut||a){const e={width:t.data.width,height:t.data.height},s=new qd(e);qd.copy(t.data,s,{x:0,y:0},{x:0,y:0},e,n,a),r.update(s,{position:{x:i,y:o}})}else r.update(t.data,{position:{x:i,y:o}})}}ea(T_,"ImagePosition"),ea(M_,"ImageAtlas");const E_=1e20;function P_(e,t,r,n,i,o,a,s,l){for(let c=t;c<t+n;c++)A_(e,r*o+c,o,i,a,s,l);for(let c=r;c<r+i;c++)A_(e,c*o+t,1,n,a,s,l)}function A_(e,t,r,n,i,o,a){o[0]=0,a[0]=-E_,a[1]=E_,i[0]=e[t];for(let s=1,l=0,c=0;s<n;s++){i[s]=e[t+s*r];const n=s*s;do{const e=o[l];c=(i[s]-i[e]+n-e*e)/(s-e)/2}while(c<=a[l]&&--l>-1);l++,o[l]=s,a[l]=c,a[l+1]=E_}for(let s=0,l=0;s<n;s++){for(;a[l+1]<s;)l++;const n=o[l],c=s-n;e[t+s*r]=i[n]+c*c}}const C_={none:0,ideographs:1,all:2};class R_{constructor(e,t,r){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=r,this.url="",this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,t){const r=[],n=this.url||st.GLYPHS_URL;for(const t in e)for(const n of e[t])r.push({stack:t,id:n});Ne(r,(({stack:e,id:t},r)=>{let i=this.entries[e];i||(i=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let o=i.glyphs[t];if(void 0!==o)return void r(null,{stack:e,id:t,glyph:o});if(o=this._tinySDF(i,e,t),o)return i.glyphs[t]=o,void r(null,{stack:e,id:t,glyph:o});const a=Math.floor(t/256);if(256*a>65535)return Ze("glyphs > 65535 not supported"),void r(null,{stack:e,id:t,glyph:o});if(i.ranges[a])return void r(null,{stack:e,id:t,glyph:o});let s=i.requests[a];s||(s=i.requests[a]=[],R_.loadGlyphRange(e,a,n,this.requestManager,((e,t)=>{if(t){i.ascender=t.ascender,i.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(i.glyphs[+e]=t.glyphs[+e]);i.ranges[a]=!0}for(const r of s)r(e,t);delete i.requests[a]}))),s.push(((n,i)=>{n?r(n):i&&r(null,{stack:e,id:t,glyph:i.glyphs[t]||null})}))}),((e,r)=>{if(e)t(e);else if(r){const e={};for(const{stack:t,id:n,glyph:i}of r)void 0===e[t]&&(e[t]={}),void 0===e[t].glyphs&&(e[t].glyphs={}),e[t].glyphs[n]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics},e[t].ascender=this.entries[t].ascender,e[t].descender=this.entries[t].descender;t(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==C_.none&&(this.localGlyphMode===C_.all?!!this.localFontFamily:!!this.localFontFamily&&(ba(e)||Sa(e)||da(e)||ha(e)||ua(e)||va(e)||(t=e)>=131072&&t<=173791||(e=>e>=66736&&e<=66815)(e)));var t}_tinySDF(e,t,r){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(r))return;let i=e.tinySDF;if(!i){let r="400";/bold/i.test(t)?r="900":/medium/i.test(t)?r="500":/light/i.test(t)&&(r="200"),i=e.tinySDF=new R_.TinySDF({fontFamily:n,fontWeight:r,fontSize:48,buffer:6,radius:16}),i.fontWeight=r}if(this.localGlyphs[i.fontWeight][r])return this.localGlyphs[i.fontWeight][r];const o=String.fromCodePoint(r),{data:a,width:s,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:d,glyphTop:h,glyphAdvance:f}=i.draw(o);return this.localGlyphs[i.fontWeight][r]={id:r,bitmap:new Hd({width:s,height:l},a),metrics:{width:c/2,height:u/2,left:d/2,top:h/2-27,advance:f/2,localGlyph:!0}}}}function L_(e,t){return e+t[1]-t[0]}function O_(e,t,r,n,i=1){const o=[],a=e.imagePrimary,s=a.pixelRatio,l=a.paddedRect.w-2,c=a.paddedRect.h-2,u=(e.right-e.left)*i,d=(e.bottom-e.top)*i,h=a.stretchX||[[0,l]],f=a.stretchY||[[0,c]],p=h.reduce(L_,0),g=f.reduce(L_,0),m=l-p,y=c-g;let _=0,v=p,b=0,x=g,w=0,S=m,k=0,T=y;if(a.content&&n){const e=a.content;_=z_(h,0,e[0]),b=z_(f,0,e[1]),v=z_(h,e[0],e[2]),x=z_(f,e[1],e[3]),w=e[0]-_,k=e[1]-b,S=e[2]-e[0]-v,T=e[3]-e[1]-x}const I=(n,o,l,c)=>{const h=B_(n.stretch-_,v,u,e.left*i),f=j_(n.fixed-w,S,n.stretch,p),m=B_(o.stretch-b,x,d,e.top*i),y=j_(o.fixed-k,T,o.stretch,g),I=B_(l.stretch-_,v,u,e.left*i),M=j_(l.fixed-w,S,l.stretch,p),E=B_(c.stretch-b,x,d,e.top*i),P=j_(c.fixed-k,T,c.stretch,g),A=new Te(h,m),C=new Te(I,m),R=new Te(I,E),L=new Te(h,E),O=new Te(f/s,y/s),D=new Te(M/s,P/s),z=t*Math.PI/180;if(z){const e=Math.sin(z),t=Math.cos(z),r=[t,-e,e,t];A._matMult(r),C._matMult(r),L._matMult(r),R._matMult(r)}const F=n.stretch+n.fixed,N=l.stretch+l.fixed,B=o.stretch+o.fixed,j=c.stretch+c.fixed,V=e.imageSecondary;return{tl:A,tr:C,bl:L,br:R,texPrimary:{x:a.paddedRect.x+1+F,y:a.paddedRect.y+1+B,w:N-F,h:j-B},texSecondary:V?{x:V.paddedRect.x+1+F,y:V.paddedRect.y+1+B,w:N-F,h:j-B}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:D,minFontScaleX:S/s/u,minFontScaleY:T/s/d,isSDF:r}};if(a.stretchX||a.stretchY){const e=F_(h,m,p),t=F_(f,y,g);for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1];for(let e=0;e<t.length-1;e++)o.push(I(n,t[e],i,t[e+1]))}}else o.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function D_(e,t){const r=e.stretchY||[[0,e.paddedRect.h-2]];return e.stretchX||e.stretchY?N_(e.stretchX||[[0,e.paddedRect.w-2]])*N_(r):1}function z_(e,t,r){let n=0;for(const i of e)n+=Math.max(t,Math.min(r,i[1]))-Math.max(t,Math.min(r,i[0]));return n}function F_(e,t,r){const n=[{fixed:-1,stretch:0}];for(const[t,r]of e){const e=n[n.length-1];n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return n.push({fixed:t+1,stretch:r}),n}function N_(e){return 2*e.length+1}function B_(e,t,r,n){return e/t*r+n}function j_(e,t,r,n){return e-t*r/n}function V_(e,t,r,n){const i=t+e.positionedLines[n].lineOffset;return 0===n?r+i/2:r+(i+(t+e.positionedLines[n-1].lineOffset))/2}function G_(e,t,r,n,i,o,a,s,l){const c=[];if(0===t.positionedLines.length)return c;const u=(void 0!==l?l:n.layout.get("text-rotate").evaluate(o,{}))*Math.PI/180,d=function(e){const t=e[0],r=e[1],n=t*r;return n>0?[t,-r]:n<0?[-t,r]:0===t?[r,t]:[r,-t]}(r);let h=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)h-=e.lineOffset;const f=t.positionedLines.length,p=h/f;let g=t.top-r[1];for(let e=0;e<f;++e){const n=t.positionedLines[e];
vendor: 4,096 bytes, line 1
1g=V_(t,p,g,e);for(const e of n.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let o=4,l=!0,h=1,f=0;if(e.image){const t=a.get(e.image.toString());if(!t)continue;if(t.sdf){Ze("SDF images are not supported in formatted text and will be ignored.");continue}l=!1,h=t.pixelRatio,o=1/h}const p=(i||s)&&e.vertical,m=e.metrics.advance*e.scale/2,y=e.metrics,_=e.rect;if(null===_)continue;s&&t.verticalizable&&(f=e.image?m-e.metrics.width*e.scale/2:0);const v=i?[e.x+m,e.y]:[0,0];let b=[0,0],x=[0,0],w=!1;i||(p?(x=[e.x+m+d[0],e.y+d[1]-f],w=!0):b=[e.x+m+r[0],e.y+r[1]-f]);const S=_.w*e.scale/(h*(e.localGlyph?2:1)),k=_.h*e.scale/(h*(e.localGlyph?2:1));let T,I,M,E;if(p){const t=e.y-g,r=new Te(-m,m-t),n=-Math.PI/2,i=new Te(...x);T=new Te(-m+b[0],b[1]),T._rotateAround(n,r)._add(i),T.x+=-t+m,T.y-=(y.left-o)*e.scale;const a=e.image?y.advance*e.scale:ky*e.scale,s=String.fromCodePoint(e.glyph);My(s)?T.x+=(1-o)*e.scale:Ey(s)?T.x+=a-y.height*e.scale+(-o-1)*e.scale:T.x+=e.image||y.width+2*o===_.w&&y.height+2*o===_.h?(a-k)/2:(a-(y.height+2*o)*e.scale)/2,I=new Te(T.x,T.y-S),M=new Te(T.x+k,T.y),E=new Te(T.x+k,T.y-S)}else{const t=(y.left-o)*e.scale-m+b[0],r=(-y.top-o)*e.scale+b[1],n=t+S,i=r+k;T=new Te(t,r),I=new Te(n,r),M=new Te(t,i),E=new Te(n,i)}if(u){let e;e=i?new Te(0,0):w?new Te(d[0],d[1]):new Te(r[0],r[1]),T._rotateAround(u,e),I._rotateAround(u,e),M._rotateAround(u,e),E._rotateAround(u,e)}const P=new Te(0,0),A=new Te(0,0);c.push({tl:T,tr:I,bl:M,br:E,texPrimary:n,texSecondary:void 0,writingMode:t.writingMode,glyphOffset:v,sectionIndex:e.sectionIndex,isSDF:l,pixelOffsetTL:P,pixelOffsetBR:A,minFontScaleX:0,minFontScaleY:0})}}return c}function U_(e,t=1,r=!1){let n=1/0,i=1/0,o=-1/0,a=-1/0;const s=e[0];for(let e=0;e<s.length;e++){const t=s[e];(!e||t.x<n)&&(n=t.x),(!e||t.y<i)&&(i=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>a)&&(a=t.y)}const l=Math.min(o-n,a-i);let c=l/2;const u=new Vn([],$_);if(0===l)return new Te(n,i);for(let t=n;t<o;t+=l)for(let r=i;r<a;r+=l)u.push(new H_(t+c,r+c,c,e));let d=function(e){let t=0,r=0,n=0;const i=e[0];for(let e=0,o=i.length,a=o-1;e<o;a=e++){const o=i[e],s=i[a],l=o.x*s.y-s.x*o.y;r+=(o.x+s.x)*l,n+=(o.y+s.y)*l,t+=3*l}return new H_(r/t,n/t,0,e)}(e),h=u.length;for(;u.length;){const n=u.pop();(n.d>d.d||!d.d)&&(d=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,h)),n.max-d.d<=t||(c=n.h/2,u.push(new H_(n.p.x-c,n.p.y-c,c,e)),u.push(new H_(n.p.x+c,n.p.y-c,c,e)),u.push(new H_(n.p.x-c,n.p.y+c,c,e)),u.push(new H_(n.p.x+c,n.p.y+c,c,e)),h+=4)}return r&&(console.log(`num probes: ${h}`),console.log(`best distance: ${d.d}`)),d.p}function $_(e,t){return t.max-e.max}R_.loadGlyphRange=function(e,t,r,n,i){const o=256*t,a=o+255,s=n.transformRequest(n.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",`${o}-${a}`),zt.Glyphs);jt(s,((e,t)=>{if(e)i(e);else if(t){const e={},r=function(e){return new Ry(e).readFields($y,{})}(t);for(const t of r.glyphs)e[t.id]=t;i(null,{glyphs:e,ascender:r.ascender,descender:r.descender})}}))},R_.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:o="normal",fontStyle:a="normal",lang:s=null}={}){this.buffer=t,this.cutoff=n,this.radius=r,this.lang=s;const l=this.size=e+4*t,c=this._createCanvas(l),u=this.ctx=c.getContext("2d",{willReadFrequently:!0});u.font=`${a} ${o} ${e}px ${i}`,u.textBaseline="alphabetic",u.textAlign="left",u.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:o}=this.ctx.measureText(e),a=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-i))),l=Math.min(this.size-this.buffer,a+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,d=Math.max(c*u,0),h=new Uint8ClampedArray(d),f={data:h,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:t};
1if(0===s||0===l)return f;const{ctx:p,buffer:g,gridInner:m,gridOuter:y}=this;this.lang&&(p.lang=this.lang),p.clearRect(g,g,s,l),p.fillText(e,g,g+a);const _=p.getImageData(g,g,s,l);y.fill(E_,0,d),m.fill(0,0,d);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const r=_.data[4*(e*s+t)+3]/255;if(0===r)continue;const n=(e+g)*c+t+g;if(1===r)y[n]=0,m[n]=E_;else{const e=.5-r;y[n]=e>0?e*e:0,m[n]=e<0?e*e:0}}P_(y,0,0,c,u,c,this.f,this.v,this.z),P_(m,g,g,s,l,c,this.f,this.v,this.z);for(let e=0;e<d;e++){const t=Math.sqrt(y[e])-Math.sqrt(m[e]);h[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return f}};class H_{constructor(e,t,r,n){this.p=new Te(e,t),this.h=r,this.d=function(e,t){let r=!1,n=1/0;for(let i=0;i<t.length;i++){const o=t[i];for(let t=0,i=o.length,a=i-1;t<i;a=t++){const i=o[t],s=o[a];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,zu(e,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}const q_=Object.keys,W_=Number.POSITIVE_INFINITY,Z_=Math.sqrt(2);function Y_(e,t,r,n,i){const o=a_(e)&&e.collisionPadding?e.collisionPadding:[0,0,0,0],a={top:e.top-o[1],bottom:e.bottom+o[3],left:e.left-o[0],right:e.right+o[2],scaled:!1};return void 0!==n&&function(e,t){e.top*=t,e.bottom*=t,e.left*=t,e.right*=t,e.scaled=!0}(a,n),r&&function(e,t){if(!t)return;const r=Pe(t),n=new Te(e.left,e.top),i=new Te(e.right,e.top),o=new Te(e.left,e.bottom),a=new Te(e.right,e.bottom),s=new Te(0,0);n._rotateAround(r,s),i._rotateAround(r,s),o._rotateAround(r,s),a._rotateAround(r,s),e.left=Math.min(n.x,i.x,o.x,a.x),e.right=Math.max(n.x,i.x,o.x,a.x),e.top=Math.min(n.y,i.y,o.y,a.y),e.bottom=Math.max(n.y,i.y,o.y,a.y)}(a,r),i&&(a.left+=i[0],a.right+=i[0],a.top+=i[1],a.bottom+=i[1]),t?{top:Math.min(t.top,a.top),bottom:Math.max(t.bottom,a.bottom),left:Math.min(t.left,a.left),right:Math.max(t.right,a.right),scaled:t.scaled||a.scaled}:a}function X_(e,[t,r]){let n=0,i=0;if(r===W_){t<0&&(t=0);const r=t/Z_;switch(e){case"top-right":case"top-left":i=r-7;break;case"bottom-right":case"bottom-left":i=7-r;break;case"bottom":i=7-t;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":n=-r;break;case"top-left":case"bottom-left":n=r;break;case"left":n=t;break;case"right":n=-t}}else{switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}}return[n,i]}function K_(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p){const g=e.layers[0],m=g.appearances;if(0===m.length)return{iconBBox:null,iconVerticalBBox:null,textBBox:null,textVerticalBBox:null};const y={iconBBox:null,iconVerticalBBox:null},_={textBBox:null,textVerticalBBox:null},{baseIconRotate:v,baseTextRotate:b,iconScaleFactor:x}=function(e,t,r){const n=e.get("icon-rotate").evaluate(t,{},r),i=e.get("text-rotate").evaluate(t,{},r),[o,a]=e.get("icon-size-scale-range");return{baseIconRotate:n,baseTextRotate:i,iconScaleFactor:De(1,o,a)}}(n,i,o);t&&(y.iconBBox=Y_(t,y.iconBBox,v,a),r)&&(y.iconVerticalBBox=Y_(r,y.iconVerticalBBox,v+90,a));const w=yv(d.horizontal);w&&(_.textBBox=Y_(w,_.textBBox,b,1,f)),d.vertical&&(_.textVerticalBBox=Y_(d.vertical,_.textVerticalBBox,b+90,1,f));for(const r of m)r.hasIconProperties()&&J_(y,e,g,r,i,o,s,v,a,l,t,c,x,u,p),r.hasTextProperties()&&ev(_,g,r,i,o,f,b,h,w,d.vertical);return{iconBBox:y.iconBBox,iconVerticalBBox:y.iconVerticalBBox,textBBox:_.textBBox,textVerticalBBox:_.textVerticalBBox}}function J_(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p){const{appearanceIconOffset:g,appearanceIconRotate:m,appearanceIconSize:y}=Q_(n,r,i,o,a,s,l,c.iconScaleFactor);let _=null,v=null,b=null;n.hasProperty("icon-image")?b=function(e,t,r,n,i,o,a,s){let l=null;const c=t.getAppearanceValueAndResolveTokens(r,"icon-image",n,i,s);if(c){const t=e.getResolvedImageFromTokens(c),u=r.getUnevaluatedProperty("icon-size"),d=iv(t,f_(e.zoom,u,e.worldview,s),u,i,e.zoom,n,e.pixelRatio,a,e.worldview,s);l=o.get(d.iconPrimary.toString())}return l}(t,r,n,i,o,d,h,p):u&&(b=u.imagePrimary),b&&(_=s_(b,null,g,f),t.allowVerticalPlacement&&(v=s_(b,null,g,f))),_&&(e.iconBBox=Y_(_,e.iconBBox,m,y)),v&&(e.iconVerticalBBox=Y_(v,e.iconVerticalBBox,m+90,y))}function Q_(e,t,r,n,i,o,a,s){const l=e.hasProperty("icon-offset")?t.getAppearanceValueAndResolveTokens(e,"icon-offset",r,n,[]):null,c=l&&Array.isArray(l)?l:i,u=e.hasProperty("icon-rotate")?t.getAppearanceValueAndResolveTokens(e,"icon-rotate",r,n,[]):null,d="number"==typeof u?u:o,h=e.hasProperty("icon-size")?t.getAppearanceValueAndResolveTokens(e,"icon-size",r,n,[]):null;return{appearanceIconOffset:c,appearanceIconRotate:d,appearanceIconSize:"number"==typeof h?h*s:a}}function ev(e,t,r,n,i,o,a,s,l,c){const{appearanceTextOffset:u,appearanceTextRotate:d,appearanceTextSize:h}=tv(r,t,n,i,o,a,s),f=h/s;l&&(e.textBBox=Y_(l,e.textBBox,d,f,u)),c&&(e.textVerticalBBox=Y_(c,e.textVerticalBBox,d+90,f,u))}function tv(e,t,r,n,i,o,a){const s=e.hasProperty("text-offset")?t.getAppearanceValueAndResolveTokens(e,"text-offset",r,n,[]):null,l=s&&Array.isArray(s)?[s[0]*ky,s[1]*ky]:i,c=e.hasProperty("text-rotate")?t.getAppearanceValueAndResolveTokens(e,"text-rotate",r,n,[]):null,u="number"==typeof c?c:o,d=e.hasProperty("text-size")?t.getAppearanceValueAndResolveTokens(e,"text-size",r,n,[]):null;return{appearanceTextOffset:l,appearanceTextRotate:u,appearanceTextSize:"number"==typeof d?d:a}}function rv(e,t,r,n,i,o,a,s,l){if(!t||!t.usvg)return;
vendor: 1,791 bytes, line 1
1const c=d_(n),u=d_(i),d="both"!==o&&"width"!==o||!c_(n)?1:u.width/c.width,h="both"!==o&&"height"!==o||!u_(n)?1:u.height/c.height;r.scaleSelf(d,h);const f=r.toString();a.set(f,r),s.set(f,t);const{imagePosition:p}=I_(f,t,1);l.set(f,p)}function nv(e,t,r,n,i,o,a,s,l,c){if(!e)return;const u=function(e,t,r,n,i,o,a){if("camera"===e.kind)return e.maxSize;if("composite"===e.kind){const n=t.possiblyEvaluate(new Ja(e.maxZoom,{worldview:o}),r,a).evaluate(i,{},r,a),s=t.possiblyEvaluate(new Ja(e.minZoom,{worldview:o}),r,a).evaluate(i,{},r,a);return Math.max(n,s)}return t.possiblyEvaluate(new Ja(n,{worldview:o}),r,a).evaluate(i,{},r,a)}(t,r,n,i,o,l,c);return e.scaleSelf(u*s*a)}function iv(e,t,r,n,i,o,a,s,l,c){return{iconPrimary:nv(e.getPrimary(),t,r,n,i,o,a,s,l,c),iconSecondary:nv(e.getSecondary(),t,r,n,i,o,a,s,l,c)}}function ov(e,t,r){if(!t)return;const n=r.get(e.toString()),i=r.get(t.toString());n&&i&&(n.paddedRect.w===i.paddedRect.w&&n.paddedRect.h===i.paddedRect.h||Ze(`Mismatch in icon variant sizes: ${e.toString()} and ${t.toString()}`),n.usvg!==i.usvg&&Ze(`Mismatch in icon variant image types: ${e.id} and ${t.id}`))}function av(e,t,r,n){if(!e)return;const i=t.get(r.toString());if(e.imagePrimary=i,n){const r=t.get(n.toString());e.imageSecondary=r}}function sv(e,t){for(const r in e.horizontal)lv(e.horizontal[r],t);lv(e.vertical,t)}function lv(e,t){if(e)for(const r of e.positionedLines)for(const e of r.positionedGlyphs)if(null!==e.image){const r=e.image.toString();e.rect=t.get(r).paddedRect}}function cv(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function uv(e,t,r,n,i,o,a,s,l){const c=yv(o.horizontal)||o.vertical,u=r.get("icon-text-fit-padding").evaluate(n,{},i);let d,h=t;
1return t&&"none"!==l&&(e.allowVerticalPlacement&&o.vertical&&(d=l_(t,o.vertical,l,u,s,a)),c&&(h=l_(t,c,l,u,s,a))),{defaultShapedIcon:h,verticallyShapedIcon:d}}function dv(e,t){return e*t/24}function hv(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S){let k=a.textMaxSize.evaluate(t,{},h);void 0===k?k=s*a.textScaleFactor:k*=a.textScaleFactor;const T=e.layers[0].layout,I=dv(s,a.textScaleFactor),M=yv(r.horizontal)||r.vertical,E=e.hasAnyAppearanceProperty(["text-size","text-offset","text-rotate"]);if(("none"!==m||E)&&e.appearanceFeatureData&&e.featureToAppearanceIndex[t.index]<e.appearanceFeatureData.length){const r=e.appearanceFeatureData[e.featureToAppearanceIndex[t.index]];r&&(r.textShaping=M,r.iconTextFitPadding=T.get("icon-text-fit-padding").evaluate(t,{},h),r.fontScale=I,r.textScaleFactor=a.textScaleFactor)}const P="globe"===f.name,A=e.tilePixelRatio*k/24,C=(F=e.overscaling,e.zoom>18&&F>2&&(F>>=1),Math.max(Gn/(512*F),1)*T.get("symbol-spacing")),R=T.get("text-padding")*e.tilePixelRatio,L=T.get("icon-padding")*e.tilePixelRatio,O=Pe(T.get("text-max-angle")),D="map"===T.get("icon-rotation-alignment")&&"point"!==v,z=C/2;var F;!1===e.hasAnyIconTextFit&&"none"!==m&&(e.hasAnyIconTextFit=!0);const N=t.properties?+t.properties[au]:null,B=N&&e.elevationFeatureIdToIndex?e.elevationFeatureIdToIndex.get(N):65535,j=(s,l,v)=>{if(l.x<0||l.x>=Gn||l.y<0||l.y>=Gn)return;let S=null;if(P){const{x:e,y:t,z:r}=f.projectTilePoint(l.x,l.y,v);S={anchor:new m_(e,t,r,0,void 0),up:f.upVector(v,l.x,l.y)}}!function(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E,P,A,C){const R=e.addToLineVertexArray(t,n);let L,O,D,z,F,N,B,j=0,V=0,G=0,U=0,$=-1,H=-1;const q={};let W=Qt("");const Z=r?r.anchor:t,Y="none"!==M;let X=0,K=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")){const e=l.layout.get("text-offset").evaluate(b,{},k);X=e[0]*ky,K=e[1]*ky}else X=l.layout.get("text-radial-offset").evaluate(b,{},k)*ky,K=W_;if(e.allowVerticalPlacement&&i.vertical){const e=i.vertical;if(p)N=vv(e),s&&(B=vv(s));else{const r=l.layout.get("text-rotate").evaluate(b,{},k)+90;D=_v(c,Z,t,u,d,h,e,f,r,g,C),s&&(z=_v(c,Z,t,u,d,h,s,y,r,null,A))}}if(o){const n=l.layout.get("icon-rotate").evaluate(b,{},k),i=O_(o,n,w,Y,x.iconScaleFactor),a=s?O_(s,n,w,Y,x.iconScaleFactor):void 0;O=_v(c,Z,t,u,d,h,o,y,n,null,P);const f=function(e,t,r,n,i,o,a,s,l){const c=e.layers[0],u=c.appearances;let d=t.length;if(r&&(d=Math.max(d,r.length)),0===u.length)return d;const[h,f]=n.get("icon-size-scale-range"),p=De(1,h,f);for(const t of u){const r=t.getUnevaluatedProperties();if(void 0!==r._values["icon-image"].value){const n=c.getAppearanceValueAndResolveTokens(t,"icon-image",i,o,l);if(n){const t=e.getResolvedImageFromTokens(n);if(t){const n=r._values["icon-size"],s=iv(t,f_(e.zoom,n,e.worldview,l),n,o,e.zoom,i,e.pixelRatio,p,e.worldview,l),c=a.get(s.iconPrimary.toString());d=Math.max(d,D_(c))}}}}return d}(e,i,a,l.layout,b,k,e.iconAtlasPositions,0,S);j=4*f;const p=l.layout.get("icon-size").evaluate(b,{},k,S),g=x.compositeIconSizes?x.compositeIconSizes[0].evaluate(b,{},k,S):0,m=x.compositeIconSizes?x.compositeIconSizes[1].evaluate(b,{},k,S):0,M=mv(e.layerIds[0],e.iconSizeData,p,x.iconScaleFactor,g,m);e.addSymbols(e.icon,i,M,v,_,b,void 0,r,t,R.lineStartIndex,R.lineLength,-1,S,k,T,I,e.symbolInstances.length,f),$=e.icon.placedSymbolArray.length-1,a&&(V=4*f,e.addSymbols(e.icon,a,M,v,_,b,Wy.vertical,r,t,R.lineStartIndex,R.lineLength,-1,S,k,T,I,e.symbolInstances.length,f),H=e.icon.placedSymbolArray.length-1)}for(const n in i.horizontal){const o=n,s=i.horizontal[o];L||(W=Qt(s.text),p?F=vv(s):L=_v(c,Z,t,u,d,h,s,f,l.layout.get("text-rotate").evaluate(b,{},k),g,C));const m=1===s.positionedLines.length;if(G+=gv(e,r,t,s,a,l,p,b,g,R,i.vertical?Wy.horizontal:Wy.horizontalOnly,m?q_(i.horizontal):[o],q,$,x,S,k,e.symbolInstances.length,T),m)break}i.vertical&&(U+=gv(e,r,t,i.vertical,a,l,p,b,g,R,Wy.vertical,["vertical"],q,H,x,S,k,e.symbolInstances.length,T));let J=-1;const Q=(e,t)=>e?Math.max(e,t):t;J=Q(F,J),J=Q(N,J),J=Q(B,J);const ee=J>-1?1:0;e.glyphOffsetArray.length>=65535&&Ze("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKey
vendor: 5,203 bytes, line 1
1Ranges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,Z.x,Z.y,Z.z,q.right>=0?q.right:-1,q.center>=0?q.center:-1,q.left>=0?q.left:-1,q.vertical>=0?q.vertical:-1,$,H,W,void 0!==L?L:e.collisionBoxArray.length,void 0!==L?L+1:e.collisionBoxArray.length,void 0!==D?D:e.collisionBoxArray.length,void 0!==D?D+1:e.collisionBoxArray.length,void 0!==O?O:e.collisionBoxArray.length,void 0!==O?O+1:e.collisionBoxArray.length,z||e.collisionBoxArray.length,z?z+1:e.collisionBoxArray.length,u,G,U,j,V,ee,0,X,K,J,0,Y?1:0,E)}(e,l,S,s,r,n,o,i,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,R,_,c,0,L,D,y,t,a,u,d,h,p,g,m,B,b,x,w)};if("line"===v)for(const i of Lp(t.geometry,0,0,Gn,Gn)){const t=w_(i,C,O,r.vertical||M,n,24,A,e.overscaling,Gn);for(const r of t)M&&bv(e,M.text,z,r)||j(i,r,h)}else if("line-center"===v){for(const e of t.geometry)if(e.length>1){const t=x_(e,O,r.vertical||M,n,24,A);t&&j(e,t,h)}}else if("Polygon"===t.type)for(const e of Th(t.geometry,0)){const t=U_(e,16);j(e[0],new m_(t.x,t.y,0,0,void 0),h)}else if("LineString"===t.type)for(const e of t.geometry)j(e,new m_(e[0].x,e[0].y,0,0,void 0),h);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)j([t],new m_(t.x,t.y,0,0,void 0),h)}const fv=255,pv=fv*h_;function gv(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_){const v=G_(0,n,l,o,a,s,i,e.allowVerticalPlacement,void 0),b=o.layout.get("text-size").evaluate(s,{},m),x=p.compositeTextSizes?p.compositeTextSizes[0].evaluate(s,{},m):0,w=p.compositeTextSizes?p.compositeTextSizes[1].evaluate(s,{},m):0,S=mv(e.layerIds[0],e.textSizeData,b,p.textScaleFactor,x,w);e.addSymbols(e.text,v,S,l,a,s,u,t,r,c.lineStartIndex,c.lineLength,f,g,m,_,!1,y,v.length);for(const t of d)h[t]=e.text.placedSymbolArray.length-1;return 4*v.length}function mv(e,t,r,n,i,o){const a=t;let s=null;return"source"===a.kind?(s=[h_*r*n],s[0]>pv&&Ze(`${e}: Value for "text-size" is >= ${fv}. Reduce your "text-size".`)):"composite"===a.kind&&(s=[h_*i*n,h_*o*n],(s[0]>pv||s[1]>pv)&&Ze(`${e}: Value for "text-size" is >= ${fv}. Reduce your "text-size".`)),s}function yv(e){for(const t in e)return e[t];return null}function _v(e,t,r,n,i,o,a,s,l,c,u){let d,h,f,p;if(d=u?u.top:a.top,h=u?u.bottom:a.bottom,f=u?u.left:a.left,p=u?u.right:a.right,a_(a)&&a.collisionPadding){const e=a.collisionPadding;f-=e[0],d-=e[1],p+=e[2],h+=e[3]}if(l){const e=new Te(f,d),t=new Te(p,d),r=new Te(f,h),n=new Te(p,h),i=Pe(l);let o=new Te(0,0);c&&(o=new Te(c[0],c[1])),e._rotateAround(i,o),t._rotateAround(i,o),r._rotateAround(i,o),n._rotateAround(i,o),f=Math.min(e.x,t.x,r.x,n.x),p=Math.max(e.x,t.x,r.x,n.x),d=Math.min(e.y,t.y,r.y,n.y),h=Math.max(e.y,t.y,r.y,n.y)}return e.emplaceBack(t.x,t.y,t.z,r.x,r.y,f,d,p,h,s,n,i,o),e.length-1}function vv(e){a_(e)&&e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function bv(e,t,r,n){const i=e.compareText;if(t in i){const e=i[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<r)return!0}else i[t]=[];return i[t].push(n),!1}function xv(e,t){const r=e.fovAboveCenter,n=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,i=(e._camera.position[2]*e.worldSize-n)/Math.cos(e._pitch),o=Math.sin(r)*i/Math.sin(Math.max(Math.PI/2-e._pitch-r,.01));let a=Math.sin(e._pitch)*o+i;const s=i*(1/e._horizonShift);if(!e.elevation||0===e.elevation.exaggeration()){let t=Math.max(e.zoom-17,0);e.isOrthographic&&(t/=10),a*=1+t}return Math.min(1.01*a,s)}function wv(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const r=Math.pow(2,-e.z),n=e.x*r,i=(e.x+1)*r,o=e.y*r,a=(e.y+1)*r,s=Dc(n),l=Dc(i),c=zc(o),u=zc(a),d=t.project(s,c),h=t.project(l,c),f=t.project(l,u),p=t.project(s,u);let g=Math.min(d.x,h.x,f.x,p.x),m=Math.min(d.y,h.y,f.y,p.y),y=Math.max(d.x,h.x,f.x,p.x),_=Math.max(d.y,h.y,f.y,p.y);const v=r/16;function b(e,r,n,i,o,a){const s=(n+o)/2,l=(i+a)/2,c=t.project(Dc(s),zc(l)),u=Math.max(0,g-c.x,m-c.y,c.x-y,c.y-_);g=Math.min(g,c.x),y=Math.max(y,c.x),m=Math.min(m,c.y),_=Math.max(_,c.y),u>v&&(b(e,c,n,i,s,l),b(c,r,s,l,o,a))}b(d,h,n,o,i,o),b(h,f,i,o,i,a),b(f,p,i,a,n,a),b(p,d,n,a,n,o),g-=v,m-=v,y+=v,_+=v;const x=1/Math.max(y-g,_-m);return{scale:x,x:g*x,y:m*x,x2:y*x,y2:_*x,projection:t}}function Sv(e,{x:t,y:r},n=0){return new Te(((t-n)*e.scale-e.x)*Gn,(r*e.scale-e.y)*Gn)}const kv=c(new Float32Array(16));class Tv{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new Pc(0,0)}projectTilePoint(e,t,r){return{x:e,y:t,z:0}}locationPoint(e,t,r,n=!0){return e._coordinatePoint(e.locationCoordinate(t,r),n)}pixelsPerMeter(e,t){return Oc(1,e)*t}pixelSpaceConversion(e,t,r){return 1}farthestPixelDistance(e){return xv(e,e.pixelsPerMeter)}pointCoordinate(e,t,r,n){const i=e.horizonLineFromTop(!1),o=new Te(t,Math.max(i,r));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,n))}pointCoordinate3D(e,t,r){const n=new Te(t,r);
vendor: 7,219 bytes, line 1
1if(e.elevation)return e.elevation.pointCoordinate(n);{const t=this.pointCoordinate(e,n.x,n.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,t.x,t.y);const r=e.horizonLineFromTop();return t.y<r}createInversionMatrix(e,t){return kv}createTileMatrix(e,t,r){let n,i,o;const a=r.canonical,s=c(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=wv(a,this);n=1,i=l.x+r.wrap*l.scale,o=l.y,f(s,s,[n/l.scale,n/l.scale,e.pixelsPerMeter/t])}else n=t/e.zoomScale(a.z),i=(a.x+Math.pow(2,a.z)*r.wrap)*n,o=a.y*n;return h(s,s,[i,o,0]),f(s,s,[n/Gn,n/Gn,1]),s}upVector(e,t,r){return[0,0,1]}upVectorScale(e,t,r){return{metersToTile:1}}}class Iv extends Tv{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,r]=this.parallels=e.parallels||[29.5,45.5],n=Math.sin(Pe(t));this.n=(n+Math.sin(Pe(r)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:r,c:n,r0:i}=this,o=Pe(e-this.center[0]),a=Pe(t),s=Math.sqrt(n-2*r*Math.sin(a))/r;return{x:s*Math.sin(o*r),y:s*Math.cos(o*r)-i,z:0}}unproject(e,t){const{n:r,c:n,r0:i}=this,o=i+t;let a=Math.atan2(e,Math.abs(o))*Math.sign(o);o*r<0&&(a-=Math.PI*Math.sign(e)*Math.sign(o));const s=Pe(this.center[0])*r;a=Fe(a,-Math.PI-s,Math.PI-s);const l=De(Ae(a/r)+this.center[0],-180,180),c=Math.asin(De((n-(e*e+o*o)*r*r)/(2*r),-1,1)),u=De(Ae(c),-85.051129,Nc);return new Pc(l,u)}}const Mv=1.340264,Ev=-.081106,Pv=893e-6,Av=.003796,Cv=Math.sqrt(3)/2;class Rv extends Tv{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const r=Math.asin(Cv*Math.sin(t)),n=r*r,i=n*n*n;return{x:.5*(e*Math.cos(r)/(Cv*(Mv+3*Ev*n+i*(7*Pv+9*Av*n)))/Math.PI+.5),y:1-.5*(r*(Mv+Ev*n+i*(Pv+Av*n))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,n=r*r,i=n*n*n;for(let e,o,a,s=0;s<12&&(o=r*(Mv+Ev*n+i*(Pv+Av*n))-t,a=Mv+3*Ev*n+i*(7*Pv+9*Av*n),e=o/a,r=De(r-e,-Math.PI/3,Math.PI/3),n=r*r,i=n*n*n,!(Math.abs(e)<1e-12));++s);const o=Cv*e*(Mv+3*Ev*n+i*(7*Pv+9*Av*n))/Math.cos(r),a=Math.asin(Math.sin(r)/Cv),s=De(180*o/Math.PI,-180,180),l=De(180*a/Math.PI,-85.051129,Nc);return new Pc(s,l)}}class Lv extends Tv{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const r=360*(e-.5),n=De(360*(.5-t),-85.051129,Nc);return new Pc(r,n)}}const Ov=Math.PI/2;function Dv(e){return Math.tan((Ov+e)/2)}class zv extends Tv{constructor(e){super(e),this.center=e.center||[0,30];const[t,r]=this.parallels=e.parallels||[30,30];let n=Pe(t),i=Pe(r);this.southernCenter=n+i<0,this.southernCenter&&(n=-n,i=-i);const o=Math.cos(n),a=Dv(n);this.n=n===i?Math.sin(n):Math.log(o/Math.cos(i))/Math.log(Dv(i)/a),this.f=o*Math.pow(Dv(n),this.n)/this.n}project(e,t){t=Pe(t),this.southernCenter&&(t=-t),e=Pe(e-this.center[0]);const r=1e-6,{n,f:i}=this;i>0?t<-Ov+r&&(t=-Ov+r):t>Ov-r&&(t=Ov-r);const o=i/Math.pow(Dv(t),n);let a=o*Math.sin(n*e),s=i-o*Math.cos(n*e);return a=.5*(a/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:a,y:this.southernCenter?s:1-s,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:r,f:n}=this,i=n-t,o=Math.sign(i),a=Math.sign(r)*Math.sqrt(e*e+i*i);let s=Math.atan2(e,Math.abs(i))*o;i*r<0&&(s-=Math.PI*Math.sign(e)*o);const l=De(Ae(s/r)+this.center[0],-180,180),c=De(Ae(2*Math.atan(Math.pow(n/a,1/r))-Ov),-85.051129,Nc);return new Pc(l,this.southernCenter?-c:c)}}class Fv extends Tv{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:Rc(e),y:Lc(t),z:0}}unproject(e,t){const r=Dc(e),n=zc(t);return new Pc(r,n)}}const Nv=Pe(Nc);class Bv extends Tv{project(e,t){const r=(t=Pe(t))*t,n=r*r;return{x:.5*((e=Pe(e))*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,n=25,i=0,o=r*r;do{o=r*r;const e=o*o;i=(r*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),r=De(r-i,-Nv,Nv)}while(Math.abs(i)>1e-6&&--n>0);o=r*r;const a=De(Ae(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),s=Ae(r);return new Pc(a,s)}}const jv=Pe(Nc);class Vv extends Tv{project(e,t){t=Pe(t),e=Pe(e);const r=Math.cos(t),n=2/Math.PI,i=Math.acos(r*Math.cos(e/2)),o=Math.sin(i)/i,a=.5*(e*n+2*r*Math.sin(e/2)/o)||0,s=.5*(t+Math.sin(t)/o)||0;return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}}unproject(e,t){let r=e=(2*e-.5)*Math.PI,n=t=(2*(1-t)-1)*Math.PI,i=25;const o=1e-6;let a=0,s=0;do{const i=Math.cos(n),o=Math.sin(n),l=2*o*i,c=o*o,u=i*i,d=Math.cos(r/2),h=Math.sin(r/2),f=2*d*h,p=h*h,g=1-u*d*d,m=g?1/g:0,y=g?Math.acos(i*d)*Math.sqrt(1/g):0,_=.5*(2*y*i*h+2*r/Math.PI)-e,v=.5*(y*o+n)-t,b=.5*m*(u*p+y*i*d*c)+1/Math.PI,x=m*(f*l/4-y*o*h),w=.125*m*(l*h-y*o*u*f),S=.5*m*(c*d+y*p*i)+.5,k=x*w-S*b;a=(v*x-_*S)/k,s=(_*w-v*b)/k,r=De(r-a,-Math.PI,Math.PI),n=De(n-s,-jv,jv)}while((Math.abs(a)>o||Math.abs(s)>o)&&--i>0);return new Pc(Ae(r),Ae(n))}}class Gv extends Tv{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Pe(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:r,cosPhi:n}=this;return{x:Pe(e)*n*r+.5,y:-Math.sin(Pe(t))/n*r+.5,z:0}}unproject(e,t){const{scale:r,cosPhi:n}=this,i=-(t-.5)/r,o=De(Ae((e-.5)/r)/n,-180,180),a=Math.asin(De(i*n,-1,1)),s=De(Ae(a),-85.051129,Nc);return new Pc(o,s)}}class Uv extends Fv{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,t,r){const n=md(e,t,r);return G(n,n,vd(ud(r))),{x:n[0],y:n[1],z:n[2]}}locationPoint(e,t,r){const n=Ic(t.lat,t.lng),i=N([],n),o=r?e._centerAltitude+r:e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;L(n,n,i,Oc(1,0)*Gn*o);const a=c(new Float64Array(16));return d(a,e.pixelMatrix,e.globeMatrix),G(n,n,a),new Te(n[0],n[1])}pixelsPerMeter(e,t){return Oc(1,0)*t}pixelSpaceConversion(e,t,r){const n=Oc(1,e)*t,i=fr(Oc(1,45)*t,n,r);return this.pixelsPerMeter(e,t)/i}createTileMatrix(e,t,r){const n=bd(ud(r.canonical));return d(new Float64Array(16),e.globeMatrix,n)}createInversionMatrix(e,t){const{center:r}=e,n=vd(ud(t));return g(n,n,Pe(r.lng)),p(n,n,Pe(r.lat)),f(n,n,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(e,t,r,n){return sd(e,t,r,!0)||new Uc(0,0)}pointCoordinate3D(e,t,r){const n=this.pointCoordinate(e,t,r,0);return[n.x,n.y,n.z]}isPointAboveHorizon(e,t){return!sd(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const r=e.cameraToCenterDistance,n=e._centerAltitude*t,i=e._camera,o=e._camera.forward(),a=M([],R([],o,-r),[0,0,n]),s=e.worldSize/(2*Math.PI),l=[0,0,-s],c=e.width/e.height,u=Math.tan(e.fovAboveCenter),d=R([],i.up(),u),h=R([],i.right(),u*c),f=N([],M([],M([],o,d),h)),p=[];let g;
1if(new pu(a,f).closestPointOnSphere(l,s,p)){const t=M([],p,l),r=W([],t,a);g=Math.cos(e.fovAboveCenter)*k(r)}else{const e=W([],a,l),t=W([],l,a);N(t,t);const r=k(e)-s;g=Math.sqrt(r*(r+2*s));const n=Math.acos(g/(s+r))-Math.acos(B(o,t));g*=Math.cos(n)}return 1.01*g}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),r=kd(e.zoom);if(r>0){const n=xv(e,Oc(1,e.center.lat)*e.worldSize),i=e.worldSize/(2*Math.PI),o=Math.max(e.width,e.height)/e.worldSize*Math.PI;return fr(t,n+i*(1-Math.cos(o)),Math.pow(r,10))}return t}upVector(e,t,r){return md(t,r,e,1)}upVectorScale(e){return{metersToTile:od(yd(ud(e)))}}}function $v(e){const t=e.parallels,r=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new Fv(e);case"equirectangular":return new Lv(e);case"naturalEarth":return new Bv(e);case"equalEarth":return new Rv(e);case"winkelTripel":return new Vv(e);case"albers":return r?new Gv(e):new Iv(e);case"lambertConformalConic":return r?new Gv(e):new zv(e);case"globe":return new Uv(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Hv=Qc.types,qv=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Wv(e,t,r,n,i,o,a,s,l,c,u,d,h){const f=s?Math.min(pv,Math.round(s[0])):0,p=s?Math.min(pv,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),o,a,(f<<1)+(l?1:0),0+(p<<1),16*c,16*u,256*d,256*h)}function Zv(e,t,r){e.emplaceBack(t,r)}function Yv(e,t,r,n,i,o,a){e.emplaceBack(t,r,n,i,o,a)}const Xv=(e,t,r,n)=>{for(let i=0;i<t;i++)e.emplaceBack(r[0],r[1],r[2],n[0],n[1],n[2])};function Kv(e,t,r,n,i){e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i),e.emplaceBack(t,r,n,i)}function Jv(e){for(const t of e.sections)if(Va(t.text))return!0;return!1}class Qv{constructor(e){this.layoutVertexArray=new Qs,this.indexArray=new ll,this.programConfigurations=e,this.segments=new Bl,this.dynamicLayoutVertexArray=new tl,this.opacityVertexArray=new rl,this.placedSymbolArray=new Il,this.iconTransitioningVertexArray=new nl,this.globeExtVertexArray=new el,this.zOffsetVertexArray=new $s,this.orientationVertexArray=new dl,this.symbolInstanceIndices=[]}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}getSymbolVertexData(e,t){const r=[],n=this.layoutVertexArray.uint16;for(let i=0;i<t;++i){const t=12*(e+i);r.push(...n.slice(t,t+12))}return r}updateSymbolVertexData(e,t,r,n,i,o,a,s,l,c,u,d,h){const f=this.layoutVertexArray.uint16,p=12*e;f[p]=t,f[p+1]=r,f[p+2]=n,f[p+3]=i,f[p+4]=o,f[p+5]=a,f[p+6]=s,f[p+7]=l,f[p+8]=c,f[p+9]=u,f[p+10]=d,f[p+11]=h}upload(e,t,r,n,i,o){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,py.members,!!o),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,my.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,qv,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,vy.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,gy.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||i)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,yy.members,!0)),!this.orientationVertexBuffer&&this.orientationVertexArray&&this.orientationVertexArray.length>0&&(this.orientationVertexBuffer=e.createVertexBuffer(this.orientationVertexArray,_y.members,!0)),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.orientationVertexBuffer&&this.orientationVertexBuffer.destroy())}}ea(Qv,"SymbolBuffers");class eb{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new Bl,this.collisionVertexArray=new sl,this.collisionVertexArrayExt=new tl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,by.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,xy.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
1stroy())}}ea(eb,"CollisionBuffers");class tb{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=c([]),this.placementViewportMatrix=c([]);const t=this.layers[0]._unevaluatedLayout._values;this.worldview=e.worldview,this.localizable=e.localizable,this.textSizeData=f_(this.zoom,t["text-size"],this.worldview,e.availableImages),this.iconSizeData=f_(this.zoom,t["icon-size"],this.worldview,e.availableImages);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.lut=e.lut,this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=r.get("text-writing-mode").map((e=>Wy[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.elevationStateComplete=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.hasAnySecondaryIcon=!1,this.hasAppearances=null,this.lastActiveApperance=null,this.featureToAppearanceIndex={}}hasAnyAppearanceProperty(e){const t=this.layers[0].getAppearances();if(!t||0===t.length)return!1;const r=Array.isArray(e)?e:[e];return t.some((e=>r.some((t=>null!=e.getProperty(t)))))}createArrays(){this.text=new Qv(new pc(this.layers,{zoom:this.zoom,lut:this.lut},(e=>e.startsWith("text")||e.startsWith("symbol")))),this.icon=new Qv(new pc(this.layers,{zoom:this.zoom,lut:this.lut},(e=>e.startsWith("icon")||e.startsWith("symbol")))),this.glyphOffsetArray=new Pl,this.lineVertexArray=new Al,this.symbolInstances=new El}calculateGlyphDependencies(e,t,r,n,i){for(const r of e){const e=r.codePointAt(0);if(void 0===e)break;if(t[e]=!0,n&&i&&e<=65535){const e=Iy[r];e&&(t[e.charCodeAt(0)]=!0)}}}calculateEffectiveAppearanceIconSize(e,t,r,n,i,o,a){if(!e.hasProperty("icon-size"))return a*o;let s=1;const l=e.getUnevaluatedProperties()._values["icon-size"],c=f_(this.zoom,l,this.worldview,i),u=g_(c,t);if("constant"!==c.kind&&"camera"!==c.kind||(s=u.uSize),"composite"===c.kind){const{minZoom:e,maxZoom:t}=c,o=l.possiblyEvaluate(new Ja(e,{worldview:this.worldview}),n),a=l.possiblyEvaluate(new Ja(t,{worldview:this.worldview}),n),d=o.evaluate(r,{},n,i);s=d+(a.evaluate(r,{},n,i)-d)*u.uSizeT}return"source"===c.kind&&(s=l.possiblyEvaluate(new Ja(this.zoom,{worldview:this.worldview}),n).evaluate(r,{},n,i)),s*o}updateFootprints(e,t){}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);return!Gf(this.activeReplacements,r)&&(this.activeReplacements=r,!0)}getResolvedImageFromTokens(e){return"string"==typeof e?Br.build(e):e}populate(e,t,r,n){const i=this.layers[0],o=i.layout,a="globe"===this.projection.name,s=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),[u,d]=o.get("icon-size-scale-range"),h=De(t.scaleFactor||1,u,d),f=("constant"!==l.value.kind||l.value.value instanceof Fr&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==s.value.kind||s.value.value.length>0),p="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,g=this.hasAnyAppearanceProperty("icon-image"),m=o.get("symbol-sort-key");if(this.features=[],this.appearanceFeatureData=[],!f&&!p&&!g)return;const y=t.iconDependencies,_=t.glyphDependencies,v=t.availableImages,b=new Ja(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),x=e=>{const t=e.id.toString();y.has(t)?y.get(t).push(e):y.set(t,[e])};for(const t of e){const{feature:e,id:l,index:c,sourceLayerIndex:u}=t,d=i._featureFilter.needGeometry,w=Jc(e,d);if(!i._featureFilter.filter(b,w,r))continue;if(d||(w.geometry=Kc(e,r,n)),a&&1!==e.type&&r.z<=5){const e=w.geometry,t=.98078528056,n=(e,n)=>B(md(e.x,e.y,r,1),md(n.x,n.y,r,1))<t;for(let t=0;t<e.length;t++)e[t]=Wc(e[t],n)}let S,k;if(f){const e=i.getValueAndResolveTokens("text-field",w,r,v),t=Fr.factory(e);Jv(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ya()||this.hasRTLText&&Ka.isParsed())&&(S=Ty(t,i,w))}if(p){const e=i.getValueAndResolveTokens("icon-image",w,r,v);k=this.getResolvedImageFromTokens(e)}const T=this.layers[0];let I=!1;if(!k&&g){const e=T.getAppearances();for(const t of e)if(t.getProperty("icon-image")){const e=T.getAppearanceValueAndResolveTokens(t,"icon-image",w,r,v);if(e){k=this.getResolvedImageFromTokens(e),I=!0;break}}}if(!S&&!k)continue;const M=this.sortFeaturesByKey?m.evaluate(w,{},r):void 0,E={id:l,text:S,icon:k,index:c,sourceLayerIndex:u,geometry:w.geometry,properties:e.properties,type:Hv[e.type],sortKey:M};if(this.features.push(E),this.featureToAppearanceIndex[c]=this.appearanceFeatureData.length,this.appearanceFeatureData.push({id:l,properties:e.properties,usesAppearanceIconAsPlaceholder:I,isUsingAppearanceIconVertexData:!1,isUsingAppearanceTextVertexData:!1,layoutBasedIconVertexData:[],layoutBasedTextVertexData:[],activeAppearance:null}),k){const e=T._unevaluatedLayout._values,{iconPrimary:t,iconSecondary:n}=iv(k,this.iconSizeData,e["icon-size"],r,this.zoom,E,this.pixelRatio,h,this.worldview,v);x(t),n&&(this.hasAnySecondaryIcon=!0,x(n))}const P=T.getAppearances();if(0!==P.length&&P.forEach((e=>{if(!e.getProperty("icon-image"))return;
1const t=this.getCombinedIconPrimary(e,T,w,r,v,E,h);t&&x(t)})),S){const e=s.evaluate(w,{},r).join(","),t="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Wy.vertical)>=0;for(const r of S.sections)if(r.image){const e=r.image.getPrimary().scaleSelf(this.pixelRatio),t=e.id.toString(),n=y.get(t)||[];n.push(e),y.set(t,n)}else{const n=Ca(S.toString()),i=r.fontStack||e,o=_[i]=_[i]||{};this.calculateGlyphDependencies(r.text,o,t,this.allowVerticalPlacement,n)}}}if("line"===o.get("symbol-placement")&&(this.features=function(e){const t={},r={},n=[];let i=0;function o(t){n.push(e[t]),i++}function a(e,t,i){const o=r[e];return delete r[e],r[t]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function s(e,r,i){const o=t[r];return delete t[r],t[e]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function l(e,t,r){const n=r?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){const u=e[c],d=u.geometry,h=u.text?u.text.toString():null;if(!h){o(c);continue}const f=l(h,d),p=l(h,d,!0);if(f in r&&p in t&&r[f]!==t[p]){const e=s(f,p,d),i=a(f,p,n[e].geometry);delete t[f],delete r[p],r[l(h,n[i].geometry,!0)]=i,n[e].geometry=null}else f in r?a(f,p,d):p in t?s(f,p,d):(o(c),t[f]=i-1,r[p]=i-1)}return n.filter((e=>e.geometry))}(this.features)),"hd-road-markup"===o.get("symbol-elevation-reference")){if(this.elevationType="road",t.elevationFeatures){!this.elevationFeatures&&t.elevationFeatures.length>0&&(this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map);for(const e of t.elevationFeatures)this.elevationFeatureIdToIndex.set(e.id,this.elevationFeatures.length),this.elevationFeatures.push(e)}}else o.get("symbol-z-elevate")&&(this.elevationType="offset");"none"!==this.elevationType&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort(((e,t)=>
1e.sortKey-t.sortKey))}getCombinedIconPrimary(e,t,r,n,i,o,a){let s,l;const c=e.getUnevaluatedProperties();if(void 0!==c._values["icon-image"].value){const o=t.getAppearanceValueAndResolveTokens(e,"icon-image",r,n,i);s=this.getResolvedImageFromTokens(o)}else{const e=t.getValueAndResolveTokens("icon-image",r,n,i);s=this.getResolvedImageFromTokens(e)}if(s){const r=e.hasProperty("icon-size")?c._values["icon-size"]:t._unevaluatedLayout._values["icon-size"];l=iv(s,f_(this.zoom,r,this.worldview,i),r,n,this.zoom,o,this.pixelRatio,a,this.worldview,i).iconPrimary}return l}updateSymbolInstanceIconVertices(e,t,r,n,i,o,a,s,l,c,u,d,h,f){if(e.placedIconSymbolIndex<0)return{vertexOffsetDelta:0,hasChanges:!1};if(t.activeAppearance===r)return{vertexOffsetDelta:e.numIconVertices,hasChanges:!1};if(r){const p=this.getCombinedIconPrimary(r,l,n,o,a,{sortKey:void 0,text:void 0,icon:null,index:e.featureIndex,sourceLayerIndex:e.featureIndex,geometry:[],properties:t.properties,type:"Point",id:t.id},c);if(!p)return{vertexOffsetDelta:0,hasChanges:!1};const g=p.toString(),m=this.iconAtlasPositions&&this.iconAtlasPositions.get(g);if(m){const{appearanceIconOffset:p,appearanceIconRotate:g}=Q_(r,l,n,o,d,f,h,c);let y=s_(m,void 0,p,l.layout.get("icon-anchor").evaluate(n,u,o));const _=m.sdf,v=l.layout.get("icon-text-fit").constantOr("none");"none"!==v&&t.textShaping&&t.iconTextFitPadding&&t.fontScale&&(y=l_(y,t.textShaping,v,t.iconTextFitPadding,p,t.fontScale));const b=this.calculateEffectiveAppearanceIconSize(r,s.zoom,n,o,a,c,h),x=0,w=1+(Math.min(pv,Math.round(b*h_))<<1),S=O_(y,g,_,"none"!==v,c);t.isUsingAppearanceIconVertexData||(t.isUsingAppearanceIconVertexData=!0,t.layoutBasedIconVertexData=this.icon.getSymbolVertexData(i,e.numIconVertices));let k=i;for(let r=0;r<S.length;++r){const n=S[r],i=t.layoutBasedIconVertexData[0]||e.tileAnchorX,o=t.layoutBasedIconVertexData[1]||e.tileAnchorY,a=16*n.pixelOffsetTL.x,s=16*n.pixelOffsetTL.y,l=16*n.pixelOffsetBR.x,c=16*n.pixelOffsetBR.y,u=16*n.minFontScaleX,d=16*n.minFontScaleY;this.icon.updateSymbolVertexData(k,i,o,Math.round(32*n.tl.x),Math.round(32*n.tl.y),n.texPrimary.x,n.texPrimary.y,x,w,a,s,u,d),this.icon.updateSymbolVertexData(k+1,i,o,Math.round(32*n.tr.x),Math.round(32*n.tr.y),n.texPrimary.x+n.texPrimary.w,n.texPrimary.y,x,w,l,s,u,d),this.icon.updateSymbolVertexData(k+2,i,o,Math.round(32*n.bl.x),Math.round(32*n.bl.y),n.texPrimary.x,n.texPrimary.y+n.texPrimary.h,x,w,a,c,u,d),this.icon.updateSymbolVertexData(k+3,i,o,Math.round(32*n.br.x),Math.round(32*n.br.y),n.texPrimary.x+n.texPrimary.w,n.texPrimary.y+n.texPrimary.h,x,w,l,c,u,d),k+=4}const T=e.numIconVertices-4*S.length;for(let e=0;e<T;++e)this.icon.updateSymbolVertexData(k+e,0,0,0,0,0,0,0,0,0,0,0,0);return{vertexOffsetDelta:e.numIconVertices,hasChanges:!0}}}else if(t.usesAppearanceIconAsPlaceholder){if(this.layers[0].appearances&&this.layers[0].appearances.length>0)return this.icon.updateSymbolVertexData(i,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(i+1,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(i+2,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(i+3,0,0,0,0,0,0,0,0,0,0,0,0),{vertexOffsetDelta:e.numIconVertices,hasChanges:!0}}else if(t.isUsingAppearanceIconVertexData){const e=12,r=t.layoutBasedIconVertexData.length/e;for(let n=0;n<r;++n){const r=n*e;this.icon.updateSymbolVertexData(i+n,t.layoutBasedIconVertexData[r+0],t.layoutBasedIconVertexData[r+1],t.layoutBasedIconVertexData[r+2],t.layoutBasedIconVertexData[r+3],t.layoutBasedIconVertexData[r+4],t.layoutBasedIconVertexData[r+5],t.layoutBasedIconVertexData[r+6],t.layoutBasedIconVertexData[r+7],t.layoutBasedIconVertexData[r+8],t.layoutBasedIconVertexData[r+9],t.layoutBasedIconVertexData[r+10],t.layoutBasedIconVertexData[r+11])}return t.isUsingAppearanceIconVertexData=!1,{vertexOffsetDelta:r,hasChanges:!0}}return{vertexOffsetDelta:e.numIconVertices,hasChanges:!1}}updateSymbolInstanceTextVertices(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y){const _=e.numHorizontalGlyphVertices>0||e.numVerticalGlyphVertices>0;if(!_)return{vertexOffsetDelta:_?e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices:0,hasChanges:!1};if(t.activeAppearance===r)return{vertexOffsetDelta:e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices,hasChanges:!1};if(r&&t.textShaping){const{appearanceTextOffset:_,appearanceTextRotate:v,appearanceTextSize:b}=tv(r,a,n,o,u,h,d);t.fontScale=dv(b,t.textScaleFactor);const x=r.getUnevaluatedProperty("text-size");let w=this.textSizeData,S=g,k=m;r.hasProperty("text-size")&&(w=f_(this.zoom,x,this.worldview,y),S="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,k="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0);const T=t.textShaping.bottom-u[1],I=t.textShaping.left-u[0],M=t.textShaping.right-u[0];t.textShaping.top=_[1]+(t.textShaping.top-u[1]),t.textShaping.bottom=_[1]+T,t.textShaping.left=_[0]+I,t.textShaping.right=_[0]+M;const E=G_(0,t.textShaping,_,a,!1,n,l,this.allowVerticalPlacement,v),P=b&&"composite"===w.kind?x.possiblyEvaluate(new Ja(S,{}),o).evaluate(n,c,o):f,A=b&&"composite"===w.kind?x.possiblyEvaluate(new Ja(k,{}),o).evaluate(n,c,o):p,C=mv(r.name,w,b,s,P,A),R=Array.isArray(C)?C[1]:b,L=0,O=1+(Math.min(pv,Math.round(R*h_))<<1);t.isUsingAppearanceTextVertexData||(t.isUsingAppearanceTextVertexData=!0,t.layoutBasedTextVertexData=this.text.getSymbolVertexData(i,e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices));for(let t=0;t<E.length&&t<(e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices)/4;++t){const r=E[t],n=r.glyphOffset[1],o=e.tileAnchorX,a=e.tileAnchorY,s=i+4*t;this.text.updateSymbolVertexData(s,o,a,Math.round(32*r.tl.x),Math.round(32*(n+r.tl.y)),r.texPrimary.x,r.texPrimary.y,L,O,r.pixelOffsetTL.x,r.pixelOffsetTL.y,r.minFontScaleX,r.minFontScaleY),this.text.updateSymbolVertexData(s+1,o,a,Math.round(32*r.tr.x),Math.round(32*(n+r.tr.y)),r.texPrimary.x+r.texPrimary.w,r.texPrimary.y,L,O,r.pixelOffsetBR.x,r.pixelOffsetTL.y,r.minFontScaleX,r.minFontScaleY),this.text.updateSymbolVertexData(s+2,o,a,Math.round(32*r.bl.x),Math.round(32*(n+r.bl.y)),r.texPrimary.x,r.texPrimary.y+r.texPrimary.h,L,O,r.pixelOffsetTL.x,r.pixelOffsetBR.y,r.minFontScaleX,r.minFontScaleY),this.text.updateSymbolVertexData(s+3,o,a,Math.round(32*r.br.x),Math.round(32*(n+r.br.y)),r.texPrimary.x+r.texPrimary.w,r.texPrimary.y+r.texPrimary.h,L,O,r.pixelOffsetBR.x,r.pixelOffsetBR.y,r.minFontScaleX,r.minFontScaleY)}return{vertexOffsetDelta:e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices,hasChanges:!0}}if(t.isUsingAppearanceTextVertexData){const e=12,r=t.layoutBasedTextVertexData.length/e;for(let n=0;n<r;++n){const r=n*e;this.text.updateSymbolVertexData(i+n,t.layoutBasedTextVertexData[r+0],t.layoutBasedTextVertexData[r+1],t.layoutBasedTextVertexData[r+2],t.layoutBasedTextVertexData[r+3],t.layoutBasedTextVertexData[r+4],t.layoutBasedTextVertexData[r+5],t.layoutBasedTextVertexData[r+6],t.layoutBasedTextVertexData[r+7],t.layoutBasedTextVertexData[r+8],t.layoutBasedTextVertexData[r+9],t.layoutBasedTextVertexData[r+10],t.layoutBasedTextVertexData[r+11])}return t.isUsingAppearanceTextVertexData=!1,{vertexOffsetDelta:r,hasChanges:!0}}return{vertexOffsetDelta:e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices,hasChanges:!1}}update(e,t,r,n,i,o,a){this.text.programConfigurations.updatePaintArrays(e,t,i,r,n,o,a,this.worldview),this.icon.programConfigurations.updatePaintArrays(e,t,i,r,n,o,a,this.worldview)}updateRoadElevation(e){if("road"!==this.elevationType||!this.elevationFeatures)return;if(this.elevationStateComplete)return;this.elevationStateComplete=!0,this.hasAnyZOffset=!1;let t=!1;const r=Gc(e),n=1/r;let i=!1,o=!1;for(let e=0;e<this.symbolInstances.length;e++){const a=this.symbolInstances.get(e),s=T(1,0,0),l=T(0,1,0),{numHorizontalGlyphVertices:c,numVerticalGlyphVertices:u,numIconVertices:d,numVerticalIconVertices:h}=a,f=c>0||u>0,p=d>0,g=this.elevationFeatures[a.elevationFeatureIndex];if(g){const e=new Te(a.tileAnchorX,a.tileAnchorY),c=.075+g.pointElevation(e);a.zOffset!==c&&(t=!0,a.zOffset=c),0!==c&&(this.hasAnyZOffset=!0);const u=g.computeSlopeNormal(e,n),d=ce(te(),T(0,0,1),u);$(s,s,d),$(l,l,d),s[2]*=r,l[2]*=r,1===s[0]&&0===s[1]&&0===s[2]&&0===l[0]&&1===l[1]&&0===l[2]||(i=i||f,o=o||p)}if(f&&(Xv(this.text.orientationVertexArray,c,s,l),Xv(this.text.orientationVertexArray,u,s,l)),p){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:t}=a;e>=0&&Xv(this.icon.orientationVertexArray,d,s,l),t>=0&&Xv(this.icon.orientationVertexArray,h,s,l)}}i||(this.text.orientationVertexArray=void 0),o||(this.icon.orientationVertexArray=void 0),t&&(this.zOffsetBuffersNeedUpload=!0,this.zOffsetSortDirty=!0)}
1updateZOffset(){const e=(e,t,n)=>{r+=t,r>e.length&&e.resize(r);for(let i=-t;i<0;i++)e.emplace(i+r,n)},t=(e,t,r)=>{n+=t,n>e.length&&e.resize(n);for(let i=-t;i<0;i++)e.emplace(i+n,r)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let r=0,n=0;for(let r=0;r<this.symbolInstances.length;r++){const n=this.symbolInstances.get(r),{numHorizontalGlyphVertices:i,numVerticalGlyphVertices:o,numIconVertices:a}=n,s=n.zOffset,l=a>0;if((i>0||o>0)&&(e(this.text.zOffsetVertexArray,i,s),e(this.text.zOffsetVertexArray,o,s)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:r}=n;e>=0&&t(this.icon.zOffsetVertexArray,a,s),r>=0&&t(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,s)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e,t,r,n,i){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),null===this.hasAppearances&&(this.hasAppearances=this.layers.some((e=>e.appearances&&e.appearances.length>0))),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),this.uploaded=!0}updateAppearances(e,t,r,n,i){if(!(e&&t&&r&&this.appearanceFeatureData))return!1;const o=this.icon.layoutVertexArray&&this.icon.layoutVertexArray.length>0&&this.icon.layoutVertexArray.arrayBuffer,a=this.text.layoutVertexArray&&this.text.layoutVertexArray.length>0&&this.text.layoutVertexArray.arrayBuffer;if(!o&&!a)return!1;const s=this.layers[0],l=s.layout;let c=1,u=0,d=!1;if(o){const[e,t]=l.get("icon-size-scale-range");c=De(1,e,t)}let h=1,f=0,p=!1;if(a){const[e,t]=l.get("text-size-scale-range");h=De(1,e,t)}const g=new Map;if(i&&r)for(const e of r){const t=i.getImage(e,s.scope);if(t){const r=new Nr(e.toString());g.set(r.toString(),t)}}for(let i=0;i<this.symbolInstances.length;i++){const m=this.symbolInstances.get(i),y=this.featureToAppearanceIndex[m.featureIndex],_=void 0!==y?this.appearanceFeatureData[y]:void 0;if(!_)continue;const v=_.id,b=t&&void 0!==v?t[String(v)]:void 0,x={type:"Point",id:_.id,properties:_.properties,geometry:[]},w=s.appearances&&s.appearances.find((t=>t.isActive({globals:n,feature:x,canonical:e,featureState:b})));if(a){const t=l.get("text-size"),n=l.get("text-offset").evaluate(x,b,e),i=t.evaluate(x,b,e),o=l.get("text-rotate").evaluate(x,b,e),a="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,c="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0,u=t.evaluate(x,{zoom:a},e),d=t.evaluate(x,{zoom:c},e),y=this.updateSymbolInstanceTextVertices(m,_,w,x,f,e,s,h,g,b,n,i,o,u,d,a,c,r);f+=y.vertexOffsetDelta,p=p||y.hasChanges}if(o){const t=l.get("icon-offset").evaluate(x,b,e),i=l.get("icon-size").evaluate(x,b,e,r),o=l.get("icon-rotate").evaluate(x,b,e),a=this.updateSymbolInstanceIconVertices(m,_,w,x,u,e,r,n,s,c,b,t,i,o);u+=a.vertexOffsetDelta,d=d||a.hasChanges}_.activeAppearance=w}return d&&this.icon.layoutVertexBuffer&&null!==this.icon.layoutVertexArray.arrayBuffer&&this.icon.layoutVertexArray.length===this.icon.layoutVertexBuffer.length&&this.icon.layoutVertexBuffer.updateData(this.icon.layoutVertexArray),p&&this.text.layoutVertexBuffer&&null!==this.text.layoutVertexArray.arrayBuffer&&this.text.layoutVertexArray.length===this.text.layoutVertexBuffer.length&&this.text.layoutVertexBuffer.updateData(this.text.layoutVertexArray),d||p}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=$v(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:r}of t)this.lineVertexArray.emplaceBack(e,r);return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y){const _=e.indexArray,v=e.layoutVertexArray,b=e.globeExtVertexArray,x=e.segments.prepareSegment(4*y,v,_,this.canOverlap?o.sortKey:void 0),w=this.glyphOffsetArray.length,S=x.vertexLength,k=this.allowVerticalPlacement&&a===Wy.vertical?Math.PI/2:0,T=o.text&&o.text.sections;for(let n=0;n<t.length;n++){const{tl:i,tr:a,bl:c,br:u,texPrimary:d,texSecondary:m,pixelOffsetTL:y,pixelOffsetBR:w,minFontScaleX:S,minFontScaleY:I,glyphOffset:M,isSDF:E,sectionIndex:P}=t[n],A=x.vertexLength,C=M[1];if(Wv(v,l.x,l.y,i.x,C+i.y,d.x,d.y,r,E,y.x,y.y,S,I),Wv(v,l.x,l.y,a.x,C+a.y,d.x+d.w,d.y,r,E,w.x,y.y,S,I),Wv(v,l.x,l.y,c.x,C+c.y,d.x,d.y+d.h,r,E,y.x,w.y,S,I),Wv(v,l.x,l.y,u.x,C+u.y,d.x+d.w,d.y+d.h,r,E,w.x,w.y,S,I),s){const{x:t,y:r,z:n}=s.anchor,[i,o,a]=s.up;Yv(b,t,r,n,i,o,a),Yv(b,t,r,n,i,o,a),Yv(b,t,r,n,i,o,a),Yv(b,t,r,n,i,o,a),Kv(e.dynamicLayoutVertexArray,t,r,n,k)}else Kv(e.dynamicLayoutVertexArray,l.x,l.y,l.z,k);if(g){const t=m||d;Zv(e.iconTransitioningVertexArray,t.x,t.y),Zv(e.iconTransitioningVertexArray,t.x+t.w,t.y),Zv(e.iconTransitioningVertexArray,t.x,t.y+t.h),Zv(e.iconTransitioningVertexArray,t.x+t.w,t.y+t.h)}_.emplaceBack(A,A+1,A+2),_.emplaceBack(A+1,A+2,A+3),x.vertexLength+=4,x.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(M[0]),n!==t.length-1&&P===t[n+1].sectionIndex||e.programConfigurations.populatePaintArrays(v.length,o,o.index,{},h,f,p,T&&T[P],this.worldview)}const I=y-t.length;0!==I&&this._addNullVertices(I,v,r,s,b,e,g,x,_);const M=s?s.anchor:l;e.placedSymbolArray.emplaceBack(M.x,M.y,M.z,l.x,l.y,w,this.glyphOffsetArray.length-w,S,c,u,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,0,0,d,0),e.symbolInstanceIndices.push(m)}_addNullVertices(e,t,r,n,i,o,a,s,l){for(let c=0;c<e;c++){for(let e=0;e<4;e++)Wv(t,0,0,0,0,0,0,r,!1,0,0,0,0),n?(Yv(i,0,0,0,0,0,0),Kv(o.dynamicLayoutVertexArray,0,0,0,0)):Kv(o.dynamicLayoutVertexArray,0,0,0,0),a&&Zv(o.iconTransitioningVertexArray,0,0);const e=s.vertexLength;l.emplaceBack(e,e+1,e+2),l.emplaceBack(e+1,e+2,e+3),s.vertexLength+=4,s.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(0)}}_commitLayoutVertex(e,t,r,n,i,o,a){e.emplaceBack(t,r,n,i,o,Math.round(a.x),Math.round(a.y))}_addCollisionDebugVertices(e,t,r,n,i,o,a){const s=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),l=s.vertexLength,c=a.tileAnchorX,u=a.tileAnchorY;for(let e=0;e<4;e++)r.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(r.collisionVertexArrayExt,t,e.padding,a.zOffset),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Te(e.x1,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Te(e.x2,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Te(e.x2,e.y2)),this._commitLayoutVertex(r.layoutVertexArray,n,i,o,c,u,new Te(e.x1,e.y2)),s.vertexLength+=4;const d=r.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),s.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,r,n,i,o){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceTextSize(e,o,t,a);this._addCollisionDebugVertices(n,i,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,r,n,i,o){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(n,i,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t,r){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new eb(ol,wy.members,nl),this.iconCollisionBox=new eb(ol,wy.members,nl);const n=g_(this.iconSizeData,e),i=g_(this.textSizeData,e,r);for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this._addTextDebugCollisionBoxes(i,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(i,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(e,t,r,n){const i=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:n),o=p_(this.textSizeData,e,i)/ky;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,r){const n=this.icon.placedSymbolArray.get(r),i=p_(this.iconSizeData,e,n);return this.tilePixelRatio*i}
vendor: 4,100 bytes, line 1
1_commitDebugCollisionVertexUpdate(e,t,r,n){e.emplaceBack(t,-r,-r,n),e.emplaceBack(t,r,-r,n),e.emplaceBack(t,r,r,n),e.emplaceBack(t,-r,r,n)}_updateTextDebugCollisionBoxes(e,t,r,n,i,o,a){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceTextSize(e,o,t,a);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,i,n.padding,o.zOffset)}}_updateIconDebugCollisionBoxes(e,t,r,n,i,o,a){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,i,n.padding,o.zOffset)}}updateCollisionDebugBuffers(e,t,r,n){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const i=g_(this.iconSizeData,e,n),o=g_(this.textSizeData,e,r);for(let a=0;a<this.symbolInstances.length;a++){const s=this.symbolInstances.get(a);this._updateTextDebugCollisionBoxes(o,e,t,s.textBoxStartIndex,s.textBoxEndIndex,s,r),this._updateTextDebugCollisionBoxes(o,e,t,s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s,r),this._updateIconDebugCollisionBoxes(i,e,t,s.iconBoxStartIndex,s.iconBoxEndIndex,s,n),this._updateIconDebugCollisionBoxes(i,e,t,s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s,n)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,r,n,i,o,a,s,l){const c={};if(t<r){const{x1:r,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h,featureIndex:f}=e.get(t);c.textBox={x1:r,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h},c.textFeatureIndex=f}if(n<i){const{x1:t,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h,featureIndex:f}=e.get(n);c.verticalTextBox={x1:t,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h},c.verticalTextFeatureIndex=f}if(o<a){const{x1:t,y1:r,x2:n,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h,featureIndex:f}=e.get(o);c.iconBox={x1:t,y1:r,x2:n,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h},c.iconFeatureIndex=f}if(s<l){const{x1:t,y1:r,x2:n,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h,featureIndex:f}=e.get(s);c.verticalIconBox={x1:t,y1:r,x2:n,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:d,tileAnchorY:h},c.verticalIconFeatureIndex=f}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<n;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}
1getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),r=Math.cos(e),n=[],i=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const a=this.symbolInstances.get(e);n.push(0|Math.round(t*a.tileAnchorX+r*a.tileAnchorY)),i.push(a.featureIndex)}return o.sort(((e,t)=>n[e]-n[t]||i[t]-i[e])),o}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort(((e,t)=>this.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset))}addToSortKeyRanges(e,t){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:i,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:a,verticalPlacedIconSymbolIndex:s}=t;r>=0&&this.addIndicesForPlacedSymbol(this.text,r),n>=0&&n!==r&&this.addIndicesForPlacedSymbol(this.text,n),i>=0&&i!==n&&i!==r&&this.addIndicesForPlacedSymbol(this.text,i),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}getElevationFeatureForText(e){const t=this.symbolInstances.get(this.text.symbolInstanceIndices[e]).elevationFeatureIndex;let r;return this.elevationFeatures&&t<this.elevationFeatures.length&&(r=this.elevationFeatures[t]),r}}function rb(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>r in e?String(e[r]):""))}let nb,ib,ob;ea(tb,"SymbolBucket",{omit:["layers","collisionBoxArray","compareText","features"]}),tb.addDynamicAttributes=Kv;class ab{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:_r,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ea(ab,"FormatSectionOverride",{omit:["defaultValue"]});const sb=()=>ob||(ob={layout:nb||(nb=new us({"symbol-placement":new ss(ds.layout_symbol["symbol-placement"]),"symbol-spacing":new ss(ds.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ss(ds.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ls(ds.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ss(ds.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new ss(ds.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new ss(ds.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new ss(ds.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ss(ds.layout_symbol["icon-ignore-placement"]),"icon-optional":new ss(ds.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ss(ds.layout_symbol["icon-rotation-alignment"]),"icon-size":new ls(ds.layout_symbol["icon-size"]),"icon-size-scale-range":new ss(ds.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new ls(ds.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ls(ds.layout_symbol["icon-text-fit-padding"]),"icon-image":new ls(ds.layout_symbol["icon-image"]),"icon-image-use-theme":new ss({type:"string",default:"default","property-type":"data-constant"}),"icon-rotate":new ls(ds.layout_symbol["icon-rotate"]),"icon-padding":new ss(ds.layout_symbol["icon-padding"]),"icon-keep-upright":new ss(ds.layout_symbol["icon-keep-upright"]),"icon-offset":new ls(ds.layout_symbol["icon-offset"]),"icon-anchor":new ls(ds.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ss(ds.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ss(ds.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ss(ds.layout_symbol["text-rotation-alignment"]),"text-field":new ls(ds.layout_symbol["text-field"]),"text-font":new ls(ds.layout_symbol["text-font"]),"text-size":new ls(ds.layout_symbol["text-size"]),"text-size-scale-range":new ss(ds.layout_symbol["text-size-scale-range"]),"text-max-width":new ls(ds.layout_symbol["text-max-width"]),"text-line-height":new ls(ds.layout_symbol["text-line-height"]),"text-letter-spacing":new ls(ds.layout_symbol["text-letter-spacing"]),"text-justify":new ls(ds.layout_symbol["text-justify"]),"text-radial-offset":new ls(ds.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ss(ds.layout_symbol["text-variable-anchor"]),"text-anchor":new ls(ds.layout_symbol["text-anchor"]),"text-max-angle":new ss(ds.layout_symbol["text-max-angle"]),"text-writing-mode":new ss(ds.layout_symbol["text-writing-mode"]),"text-rotate":new ls(ds.layout_symbol["text-rotate"]),"text-padding":new ss(ds.layout_symbol["text-padding"]),"text-keep-upright":new ss(ds.layout_symbol["text-keep-upright"]),"text-transform":new ls(ds.layout_symbol["text-transform"]),"text-offset":new ls(ds.layout_symbol["text-offset"]),"text-allow-overlap":new ss(ds.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ss(ds.layout_symbol["text-ignore-placement"]),"text-optional":new ss(ds.layout_symbol["text-optional"]),visibility:new ss(ds.layout_symbol.visibility)})),paint:ib||(ib=new us({"icon-opacity":new ls(ds.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new ls(ds.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new ls(ds.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new ls(ds.paint_symbol["text-emissive-strength"]),"icon-color":new ls(ds.paint_symbol["icon-color"]),"icon-halo-color":new ls(ds.paint_symbol["icon-halo-color"]),"icon-halo-width":new ls(ds.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ls(ds.paint_symbol["icon-halo-blur"]),"icon-translate":new ss(ds.paint_symbol["icon-translate"]),"icon-translate-anchor":new ss(ds.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new ss(ds.paint_symbol["icon-image-cross-fade"]),"text-opacity":new ls(ds.paint_symbol["text-opacity"]),"text-occlusion-opacity":new ls(ds.paint_symbol["text-occlusion-opacity"]),"text-color":new ls(ds.paint_symbol["text-color"],{runtimeType:wr,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new ls(ds.paint_symbol["text-halo-color"]),"text-halo-width":new ls(ds.paint_symbol["text-halo-width"]),"text-halo-blur":new ls(ds.paint_symbol["text-halo-blur"]),"text-translate":new ss(ds.paint_symbol["text-translate"]),"text-translate-anchor":new ss(ds.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new ss(ds.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new ss(ds.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new ss(ds.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new ss(ds.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new ls(ds.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},ob);class lb extends Os{constructor(e,t,r,n){super(e,sb(),t,r,n,e.layout?e.layout["icon-image-use-theme"]:null),this._colorAdjustmentMatrix=c([]),this.hasOcclusionOpacityProperties=void 0!==e.paint&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}_handleSpecialPaintPropertyUpdate(e){"icon-occlusion-opacity"!==e&&"text-occlusion-opacity"!==e||(this.hasOcclusionOpacityProperties=!0)}recalculate(e,t){super.recalculate(e,t),this.appearances&&this.appearances.forEac
vendor: 11,942 bytes, line 1
1h((r=>{r.recalculate(e,t,this.iconImageUseTheme)})),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const r=this.layout.get("text-writing-mode");if(r){const e=[];for(const t of r)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,t,r,n){return this._saturation===e&&this._contrast===t&&this._brightnessMin===r&&this._brightnessMax===n||(this._colorAdjustmentMatrix=function(e,t,r,n){e=ot(e),t=it(t);const i=s(),o=e/3,a=1-2*o,l=[a,o,o,0,o,a,o,0,o,o,a,0,0,0,0,1],c=.5-.5*t,u=n-r;return d(i,[u,0,0,0,0,u,0,0,0,0,u,0,r,r,r,1],[t,0,0,0,0,t,0,0,0,0,t,0,c,c,c,1]),d(i,i,l),i}(e,t,r,n),this._saturation=e,this._contrast=t,this._brightnessMin=r,this._brightnessMax=n),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,r,n){const i=this.layout.get(e).evaluate(t,{},r,n),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||Go(o.value)||!i?i:rb(t.properties,i)}getAppearanceValueAndResolveTokens(e,t,r,n,i){const o=e.getProperty(t);if(!o)return;const a=o.evaluate(r,{},n,i),s=e.getUnevaluatedProperties()._values[t];return s.isDataDriven()||Go(s.value)||!a||"string"!=typeof a?a:rb(r.properties,a)}createBucket(e){return new tb(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of sb().paint.overridableProperties){if(!lb.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new ab(t),n=new Vo(r,t.property.specification,this.scope,this.options,this.layout.get("icon-image-use-theme"));let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new $o("source",n):new Ho("composite",n,t.value.zoomStops,t.value.interpolationType),this.paint._values[e]=new os(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&lb.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),n=sb().paint.properties[t];let i=!1;const o=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof Fr)o(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{i||(t instanceof $r&&Gr(t.value)===Ir?o(t.value.sections):t instanceof Zr?o(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,t,r){return{config:new fc(this,{zoom:t,lut:r}),overrideFog:!1}}hasElevation(){return this.layout&&"hd-road-markup"===this.layout.get("symbol-elevation-reference")}}let cb,ub,db,hb;var fb=Bs([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function pb(e,t,r,n,i,s,l,c){const u=[e,t,1,r,n,1,i,s,1],d=[l,c,1],h=o([],u),[f,p,g]=U(d,d,h);return a(u,u,[f,0,0,0,p,0,0,0,g])}function gb(e,t,r,n,i,s,l,c){const u=function(e,t,r,n,i,s,l,c){const u=pb(0,0,1,0,1,1,0,1),d=pb(e,t,r,n,i,s,l,c);return a(d,d,o([],u))}(e,t,r,n,i,s,l,c);return[u[2]/u[8]/Gn,u[5]/u[8]/Gn]}function mb(e){return[e[0],Math.min(Math.max(e[1],-85.051129),Nc)]}class yb extends ir{constructor(e,t,r,n){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=t,this._dirty=!1}load(e,t){if(this._loaded=t||!1,this.fire(new er("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=Ht(this.map._requestManager.transformRequest(this.url,zt.Image),((t,r)=>{this._imageRequest=null,this._loaded=!0,t?this.fire(new tr(t)):r&&(this.image=r instanceof HTMLImageElement?yt.getImageData(r):r,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new Fg(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new er("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof Fg||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let t=e[0][1],r=e[0][1];for(const n of e)n[1]>r&&(r=n[1]),n[1]<t&&(t=n[1]);const n=(r+t)/2;if(n>Nc?this.onNorthPole=!0:n<-85.051129&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const t=e.map(Uc.fromLngLat);this.tileID=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const o of e)t=Math.min(t,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);const o=Math.max(n-t,i-r),a=Math.max(0,Math.floor(-Math.log2(o))),s=Math.pow(2,a);let l=Math.floor((t+n)/2*s);return l>1&&(l-=1),new Xu(a,l,Math.floor((r+i)/2*s))}(t),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new er("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){!this.texture||this.texture instanceof Fg||(this.texture.destroy(),this._dirty=!0),this.texture=null,this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(e){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const t=wv(new Xu(0,0,0),this.map.transform.projection),r=[t.projection.project(this.coordinates[0][0],this.coordinates[0][1]),t.projection.project(this.coordinates[1][0],this.coordinates[1][1]),t.projection.project(this.coordinates[2][0],this.coordinates[2][1]),t.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(e){const t=e[1].x-e[0].x,r=e[1].y-e[0].y,n=e[2].x-e[1].x,i=e[2].y-e[1].y,o=e[3].x-e[2].x,a=e[3].y-e[2].y,s=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*i-n*r,u=n*a-o*i,d=o*l-s*a,h=s*r-t*l;return c>0&&u>0&&d>0&&h>0||c<0&&u<0&&d<0&&h<0}(r))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const n=wv(this.tileID,this.map.transform.projection),[i,s,l,c]=this.coordinates.map((e=>{const t=n.projection.project(e[0],e[1]);return Sv(n,t)._round()}));this.perspectiveTransform=gb(i.x,i.y,s.x,s.y,l.x,l.y,c.x,c.y);const u=this._boundsArray=new Us;u.emplaceBack(i.x,i.y,0,0),u.emplaceBack(s.x,s.y,Gn,0),u.emplaceBack(c.x,c.y,0,Gn),u.emplaceBack(l.x,l.y,Gn,Gn),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=e.createVertexBuffer(u,fb.members),this.boundsSegments=Bl.simpleSegment(0,0,4,2);const d=[],h=[mb((f=this.coordinates)[0]),mb(f[1]),mb(f[2]),mb(f[3])];var f;const[p,g,m,y]=function(e){let t=e[0][0],r=t,n=e[0][1],i=n;for(let o=1;o<e.length;o++)e[o][0]<t?t=e[o][0]:e[o][0]>r&&(r=e[o][0]),e[o][1]<n?n=e[o][1]:e[o][1]>i&&(i=e[o][1]);return[t,n,r-t,i-n]}(h);{const n=new Us,[i,s,l,c]=function(e){let t=e[0].x,r=t,n=e[0].y,i=n;for(let o=1;o<e.length;o++)e[o].x<t?t=e[o].x:e[o].x>r&&(r=e[o].x),e[o].y<n?n=e[o].y:e[o].y>i&&(i=e[o].y);return[t,n,r-t,i-n]}(r),u=e=>[(e.x-i)/l,(e.y-s)/c],[h,f,_,v]=r.map(u),b=function(e,t,r,n,i,s,l,c){const u=pb(0,0,1,0,1,1,0,1);return a(u,u,o([],pb(e,t,r,n,i,s,l,c)))}(h[0],h[1],f[0],f[1],_[0],_[1],v[0],v[1]);this.elevatedGlobePerspectiveTransform=gb(h[0],h[1],f[0],f[1],_[0],_[1],v[0],v[1]);const x=(e,t)=>{d.push(e.lng);const r=Math.round((e.lng-p)/m*Gn),i=Math.round((e.lat-g)/y*Gn),o=u(t),a=U([],[o[0],o[1],1],b),s=Math.round(a[0]/a[2]*Gn),l=Math.round(a[1]/a[2]*Gn);n.emplaceBack(r,i,s,l)},w=r[3].x-r[0].x,S=r[3].y-r[0].y,k=r[2].x-r[1].x,T=r[2].y-r[1].y;for(let e=0;e<65;e++){const n=e/64,i=[r[0].x+n*w,r[0].y+n*S],o=[r[1].x+n*k,r[1].y+n*T],a=o[0]-i[0],s=o[1]-i[1];for(let e=0;e<65;e++){const r=e/64,n={x:i[0]+a*r,y:i[1]+s*r};x(t.projection.unproject(n.x,n.y),n)}}this.elevatedGlobeVertexBuffer=e.createVertexBuffer(n,fb.members)}{this.maxLongitudeTriangleSize=0;let t=[],r=new ll;const n=(e,n,i)=>{r.emplaceBack(e,n,i);const o=d[e],a=d[n],s=d[i],l=Math.min(Math.min(o,a),s),c=Math.max(Math.max(o,a),s)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),t.push(l+c/2)};for(let e=0;e<64;e++)for(let t=0;t<64;t++){const r=65*e+t,i=r+1,o=r+65,a=o+1;n(r,o,i),n(i,o,a)}[t,r]=function(e,t){const r=Array.from({length:e.length},((e,t)=>t));r.sort(((t,r)=>e[t]-e[r]));const n=[],i=new ll;for(let o=0;o<r.length;o++){const a=r[o];n.push(e[a]);const s=3*a,l=s+1;i.emplaceBack(t.uint16[s],t.uint16[l],t.uint16[l+1])}return[n,i]}(t,r),this.elevatedGlobeTrianglesCenterLongitudes=t,this.elevatedGlobeIndexBuffer=e.createIndexBuffer(r)}this.elevatedGlobeSegments=Bl.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,m/Gn,0,y/Gn,0,0,g,p,0])}prepare(){const e=0!==Object.keys(this.tiles).length;if(this.tileID&&!e)return;const t=this.map.painter.context,r=t.gl;!this._dirty||this.texture instanceof Fg||(this.texture?this.texture.update(this.image):(this.texture=new zg(t,this.image,r.RGBA8),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){const t=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!t)return null;const r=this.elevatedGlobeTrianglesCenterLongitudes;let n=(i=e+180)+360*Math.round((r[0]-i)/360);var i;const o=new Bl,a=(e,r)=>{o.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:t.segments[0].vertexLength,primitiveLength:r,sortKey:void 0,vaos:{}})},s=.51*this.maxLongitudeTriangleSize;if(Math.abs(r[0]-n)<=s){const e=nt(r,0,r.length,n+s);return e===r.length||a(e,rt(r,e+1,r.length,n+360-s)-e),o}n<r[0]&&(n+=360);const l=rt(r,0,r.length,n-s);if(l===r.length)return a(0,r.length),o;a(0,l-0);const c=nt(r,l+1,r.length,n+s);return c!==r.length&&a(c,r.length-c),o}}const _b=(Math.pow(256,2)-1)/16907520;class vb extends Os{constructor(e,t,r,n){super(e,{layout:db||(db=new us({visibility:new ss(ds.layout_raster.visibility)})),paint:hb||(hb=new us({"raster-opacity":new ss(ds.paint_raster["raster-opacity"]),"raster-color":new cs(ds.paint_raster["raster-color"]),"raster-color-mix":ne
1w ss(ds.paint_raster["raster-color-mix"]),"raster-color-range":new ss(ds.paint_raster["raster-color-range"]),"raster-hue-rotate":new ss(ds.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ss(ds.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ss(ds.paint_raster["raster-brightness-max"]),"raster-saturation":new ss(ds.paint_raster["raster-saturation"]),"raster-contrast":new ss(ds.paint_raster["raster-contrast"]),"raster-resampling":new ss(ds.paint_raster["raster-resampling"]),"raster-fade-duration":new ss(ds.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new ss(ds.paint_raster["raster-emissive-strength"]),"raster-array-band":new ss(ds.paint_raster["raster-array-band"]),"raster-elevation":new ss(ds.paint_raster["raster-elevation"]),"raster-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){return!(e&&e._source instanceof yb&&(e._source.onNorthPole||e._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(e){"raster-color"!==e&&"raster-color-range"!==e||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}updateColorRamp(e){if(!this.hasColorMap())return;if(!this._curRampRange)return;const t=this._transitionablePaint._values["raster-color"].value.expression,[r,n]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(r)&&isNaN(n)||r===this._curRampRange[0]&&n===this._curRampRange[1]||(this.colorRamp=Zd({expression:t,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:r,end:n}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[r,n])}}let bb,xb,wb,Sb,kb;class Tb extends Os{constructor(e,t,r,n){super(e,{layout:bb||(bb=new us({visibility:new ss(ds["layout_raster-particle"].visibility)})),paint:xb||(xb=new us({"raster-particle-array-band":new ss(ds["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new ss(ds["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new cs(ds["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new ss(ds["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new ss(ds["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new ss(ds["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new ss(ds["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new ss(ds["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n),this._updateColorRamp(),this.lastInvalidatedAt=yt.now()}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this.tileFramebuffer&&(this.tileFramebuffer.destroy(),this.tileFramebuffer=null),this.particleFramebuffer&&(this.particleFramebuffer.destroy(),this.particleFramebuffer=null)}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){"raster-particle-color"!==e&&"raster-particle-max-speed"!==e||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===e&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,t=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=Zd({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:t}],resolution:256}),this.colorRampTexture=null}
vendor: 6,343 bytes, line 1
1_invalidateAnimationState(){this.lastInvalidatedAt=yt.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class Ib extends Os{constructor(e,t){super(e,{},t,null),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(e){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(e){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}function Mb(e,t,r){const n=[0,0,1],i=re([]);return ie(i,i,r?-Pe(e)+Math.PI:Pe(e)),ne(i,i,-Pe(t)),$(n,n,i),N(n,n)}const Eb={None:0,Model:1,Symbol:2,FillExtrusion:4};class Pb{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function Ab(e,t){const r=-1===e.indexOf("://");try{return new URL(e,r&&t?"http://example.com":void 0),!0}catch(e){return!1}}class Cb{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class Rb{constructor(){this.maxScale=1,this.maxXYTranslationDistance=0,this.instancedDataArray=new vl,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}colorForInstance(e){const t=16*e,r=this.instancedDataArray.float32;let n=Math.floor(r[t+2]);const i=1.05*(r[t+2]-n);return n/=100,[r[t]%1*1.05,r[t+1]%1*1.05,i,n]}tileCoordinatesForInstance(e){const t=16*e,r=this.instancedDataArray.float32;let n=r[t+0];return n=n>Gn?n-Gn:n,new Te(Math.trunc(n),Math.trunc(r[t+1]))}translationForInstance(e){const t=16*e,r=this.instancedDataArray.float32;return[r[t+4],r[t+5],r[t+6]]}rotationScaleForInstance(e){const t=16*e,r=this.instancedDataArray.float32;return[r[t+7],r[t+8],r[t+9],r[t+10],r[t+11],r[t+12],r[t+13],r[t+14],r[t+15]]}transformForInstance(e){const t=16*e,r=this.instancedDataArray.float32;return[r[t+7],r[t+8],r[t+9],r[t+4],r[t+10],r[t+11],r[t+12],r[t+5],r[t+13],r[t+14],r[t+15],r[t+6],0,0,0,1]}}class Lb{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaledZ=this.canonical.z+Math.log2(e.overscaling),this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.projection=e.projection,this.index=e.index,this.worldview=e.worldview,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z+1?0:this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=e.styleDefinedModelURLs,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,r,n){}populate(e,t,r,n){this.tileToMeter=Gc(r);const i=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:o,id:a,index:s,sourceLayerIndex:l}of e){const e=null!=a?a:o.properties&&o.properties.hasOwnProperty("id")?o.properties.id:void 0,c=Jc(o,i);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),c,r))continue;const u={id:e,sourceLayerIndex:l,index:s,geometry:i?c.geometry:Kc(o,r,n),properties:o.properties,type:o.type,patterns:{}},d=this.addFeature(u,u.geometry,c);d&&t.featureIndex.insert(o,u.geometry,s,l,this.index,this.instancesPerModel[d].instancedDataArray.length,256)}this.lookup=null}evaluateQueryRenderedFeaturePadding(){const e=this.layers[0].modelManager,t=this.layers[0].scope;let r=0;for(const n of this.modelUris){const i=e.getModel(n,t);if(!i)continue;const o=this.instancesPerModel[n];if(o){const e=.5*O(i.aabb.max,i.aabb.min)*o.maxScale+o.maxXYTranslationDistance,t=Math.min(Gn,Math.max(e/this.tileToMeter,256));r=Math.max(t,r)}}return r}update(e,t,r,n){for(const t in this.instancesPerModel){const r=this.instancesPerModel[t];for(const t in e)r.idToFeaturesIndex.hasOwnProperty(t)&&(this.evaluate(r.features[r.idToFeaturesIndex[t]],e[t],r,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const t in this.instancesPerModel){const r=this.instancesPerModel[t];for(const t of r.features){const n=this.layers[0],i=t.feature,o=this.canonical,a=n.paint.get("model-rotation").evaluate(i,{},o),s=n.paint.get("model-scale").evaluate(i,{},o),l=n.paint.get("model-translation").evaluate(i,{},o);q(t.rotation,a)&&q(t.scale,s)&&q(t.translation,l)||(this.evaluate(t,t.featureStates,r,!0),e=!0)}}return e}updateReplacement(e,t,r,n){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(Gf(this.activeReplacements,i))return!1;this.activeReplacements=i;let o=!1;for(const t in this.instancesPerModel){const i=this.instancesPerModel[t],a=i.instancedDataArray;for(const t of i.features){const i=t.instancedDataOffset,s=t.instancedDataCount;for(let t=0;t<s;t++){const s=16*(t+i);let l=a.float32[s+0];const c=l>Gn;l=c?l-Gn:l;const u=Math.floor(l),d=Math.floor(a.float32[s+1]);let h=!1;for(const t of this.activeReplacements)if(!Nf(t,r,Eb.Model,n)&&!(t.min.x>u||u>t.max.x||t.min.y>d||d>t.max.y)&&(h=Zf(Wf(u,d,e.canonical,t.footprintTileId.canonical),t.footprint),h))break;a.float32[s]=h?l+Gn:l,o=o||h!==c}}}return o}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const r=this.instancesPerModel[t];r.instancedDataArray.length<0||0===r.instancedDataArray.length||(r.instancedDataBuffer?r.instancedDataBuffer.updateData(r.instancedDataArray):r.instancedDataBuffer=e.createVertexBuffer(r.
1instancedDataArray,Ug.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(e){for(const e in this.instancesPerModel){const t=this.instancesPerModel[e];0!==t.instancedDataArray.length&&t.instancedDataBuffer&&t.instancedDataBuffer.destroy()}const t=this.layers[0].modelManager;if(e&&t&&this.modelUris&&this.modelsRequested)for(const e of this.modelUris)t.removeModel(e,"",!0)}addFeature(e,t,r){const n=this.layers[0],i=n.layout.get("model-id"),o=n.layout.get("model-allow-density-reduction"),a=i.evaluate(r,{},this.canonical);if(!a)return Ze(`modelId is not evaluated for layer ${n.id} and it is not going to get rendered.`),a;(Ab(a,!1)||void 0!==this.styleDefinedModelURLs[a])&&(this.modelUris.includes(a)||this.modelUris.push(a)),this.instancesPerModel[a]||(this.instancesPerModel[a]=new Rb);const s=this.instancesPerModel[a],l=s.instancedDataArray,c=new Cb(r,l.length);for(const e of t)for(const t of e){if(t.x<0||t.x>=Gn||t.y<0||t.y>=Gn)continue;if(0!==this.lookupDim&&o){const e=(this.lookupDim-1)/Gn,r=this.lookupDim*(t.y*e|0)+t.x*e|0;if(this.lookup){if(0!==this.lookup[r])continue;this.lookup[r]=1}}this.instanceCount++;const e=l.length;l.resize(e+1),s.instancesEvaluatedElevation.push(0),l.float32[16*e]=t.x,l.float32[16*e+1]=t.y}return c.instancedDataCount=s.instancedDataArray.length-c.instancedDataOffset,c.instancedDataCount>0&&(e.id&&(s.idToFeaturesIndex[e.id]=s.features.length),s.features.push(c),this.evaluate(c,{},s,!1)),a}getModelUris(){return this.modelUris}evaluate(e,t,r,n){const i=this.layers[0],o=e.feature,a=this.canonical,s=e.rotation=i.paint.get("model-rotation").evaluate(o,t,a),l=e.scale=i.paint.get("model-scale").evaluate(o,t,a),c=e.translation=i.paint.get("model-translation").evaluate(o,t,a),u=Object.assign({},i.paint.get("model-color").evaluate(o,t,a));u.a=i.paint.get("model-color-mix-intensity").evaluate(o,t,a);const d=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]);const h=c[0]*c[0]+c[1]*c[1],f=h>0?Math.sqrt(h):0;r.maxScale=Math.max(Math.max(r.maxScale,l[0]),Math.max(l[1],l[2])),r.maxXYTranslationDistance=Math.max(r.maxXYTranslationDistance,f),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),Kg(d,s,l);const p=Math.round(100*u.a)+u.b/1.05;for(let t=0;t<e.instancedDataCount;++t){const i=e.instancedDataOffset+t,o=16*i,s=r.instancedDataArray.float32;let l=0;n&&(l=s[o+6]-r.instancesEvaluatedElevation[i]);const h=0|s[o+1];s[o]=(0|s[o])+u.r/1.05,s[o+1]=h+u.g/1.05,s[o+2]=p,s[o+3]=1/(a.z>10?this.tileToMeter:Gc(a,h)),s[o+4]=c[0],s[o+5]=c[1],s[o+6]=c[2]+l,s[o+7]=d[0],s[o+8]=d[1],s[o+9]=d[2],s[o+10]=d[4],s[o+11]=d[5],s[o+12]=d[6],s[o+13]=d[8],s[o+14]=d[9],s[o+15]=d[10],r.instancesEvaluatedElevation[i]=c[2]}}}let Ob,Db;ea(Lb,"ModelBucket",{omit:["layers"]}),ea(Rb,"PerModelAttributes"),ea(Cb,"ModelFeature");class zb{constructor(e,t,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=r}static create(e,t,r){const n=r||e.findDEMTileFor(t);if(!n||!n.dem)return;const i=n.dem,o=n.tileID,a=1<<t.canonical.z-o.canonical.z;return new zb(n,i.dim/Gn/a,[(t.canonical.x/a-o.canonical.x)*i.dim,(t.canonical.y/a-o.canonical.y)*i.dim])}tileCoordToPixel(e,t){const r=t*this._scale+this._offset[1];return new Te(Math.floor(e*this._scale+this._offset[0]),Math.floor(r))}getElevationAt(e,t,r,n){const i=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],a=Math.floor(i),s=Math.floor(o),l=this._dem;return n=!!n,r?fr(fr(l.get(a,s,n),l.get(a,s+1,n),o-s),fr(l.get(a+1,s,n),l.get(a+1,s+1,n),o-s),i-a):l.get(a,s,n)}getElevationAtPixel(e,t,r){return this._dem.get(e,t,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Oc(1,e)*this._dem.stride}}const Fb=new Float32Array(262144),Nb=new Uint8Array(262144);function Bb(e){let t=0;if(e.meshes)for(const r of e.meshes)t=Math.max(t,r.aabb.max[2]);if(e.children)for(const r of e.children)t=Math.max(t,Bb(r));return t}function jb(e,t,r){if(e.meshes)for(const n of e.meshes){if(n.aabb.min[0]===1/0)continue;const i=xu.applyTransform(n.aabb,e.globalMatrix);r.insert(t,i.min[0],i.min[1],i.max[0],i.max[1])}if(e.children)for(const n of e.children)jb(n,t,r)}const Vb=["","wall","door","roof","window","lamp","logo"];class Gb{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedTranslation=[0,0,0],this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.feature={type:"Point",id:e.id,geometry:[],properties:{height:Bb(e)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new xu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const t=new xu([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const r of this.node.meshes)this.node.lightMeshIndex!==e&&(r.transformedAabb=xu.applyTransformFast(r.aabb,this.node.globalMatrix),t.encapsulate(r.transformedAabb)),e++;this.aabb=t}return this.aabb}}class Ub{constructor(e,t,r,n,i,o,a,s){this.id=r,this.layers=e,this.layerIds=this.layers.map((e=>e.fqid)),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.modelTraits|=rm.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,n&&(this.modelTraits|=rm.HasMapbox
1MeshFeatures),i&&(this.modelTraits|=rm.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=o,this.worldview=s,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[];for(const e of t)this.nodesInfo.push(new Gb(e)),jb(e,a.featureIndexArray.length,a.grid),a.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,a.bucketLayerIDs.length-1,0);this.states={},this.hasAppearances=null}updateFootprints(e,t){for(const r of this.getNodesInfo()){const n=r.node;n.footprint&&t.push({footprint:n.footprint,id:e})}}updateAppearances(e,t,r,n){}update(e){const t=0!==Object.keys(e).length;if(t&&!this.stateDependentLayers.length)return;const r=t?this.stateDependentLayers:this.layers;if(!Ie(e,this.states))for(const t of r)this.evaluate(t,e);this.states=structuredClone(e)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const t=this.getNodesInfo();for(const r of t){const t=r.node;this.uploaded?this.updatePbrBuffer(t):sm(t,e,!0)}for(const e of t)lm(e.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let t=!1;if(!e.meshes)return t;for(const r of e.meshes)r.pbrBuffer&&(r.pbrBuffer.updateData(r.featureArray),t=!0);return t}needsReEvaluation(e,t,r){const n=e.transform.projectionOptions,i=e.style.getBrightness(),o=this.brightness!==i;if(!this.uploaded||this.dirty||n.name!==this.projection.name||$b(r.paint.get("model-color").value,o)||$b(r.paint.get("model-color-mix-intensity").value,o)||$b(r.paint.get("model-roughness").value,o)||$b(r.paint.get("model-emissive-strength").value,o)||$b(r.paint.get("model-height-based-emissive-strength-multiplier").value,o)){this.projection=n,this.brightness=i;const e=this.getNodesInfo();for(const t of e)t.state=null;return!0}return!1}evaluateTransform(e,t){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const r=this.getNodesInfo(),n=this.id.canonical;for(const e of r){const r=e.feature;e.evaluatedTranslation=t.paint.get("model-translation").evaluate(r,{},n),e.evaluatedScale=t.paint.get("model-scale").evaluate(r,{},n)}}evaluate(e,t){const r=this.getNodesInfo();for(const n of r){if(!n.node.meshes)continue;const r=n.feature,i=t&&t[r.id];if(Ie(i,n.state))continue;n.state=structuredClone(i);const o=n.node.meshes&&n.node.meshes[0].featureData,a=n.evaluatedColor[2],s=n.evaluatedRMEA[2],l=this.id.canonical;if(n.hasTranslucentParts=!1,o){for(let t=0;t<Vb.length;t++){const o=Vb[t];o.length&&(r.properties.part=o);const a=e.paint.get("model-color").evaluate(r,i,l).toPremultipliedRenderColor(null),s=e.paint.get("model-color-mix-intensity").evaluate(r,i,l);n.evaluatedColor[t]=[a.r,a.g,a.b,s],n.evaluatedRMEA[t][0]=e.paint.get("model-roughness").evaluate(r,i,l),n.evaluatedRMEA[t][2]=e.paint.get("model-emissive-strength").evaluate(r,i,l),n.evaluatedRMEA[t][3]=a.a,n.emissionHeightBasedParams[t]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(r,i,l),!n.hasTranslucentParts&&a.a<1&&(n.hasTranslucentParts=!0)}delete r.properties.part,qb(n,a!==n.evaluatedColor[2]||s!==n.evaluatedRMEA[2],this.modelTraits)}else n.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(r,i,l);n.evaluatedTranslation=e.paint.get("model-translation").evaluate(r,i,l),n.evaluatedScale=e.paint.get("model-scale").evaluate(r,i,l),this.updatePbrBuffer(n.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,t,r,n){const i=e.findDEMTileFor(r);if(i&&(i.tileID.canonical!==this.terrainTile||t!==this.terrainExaggeration)){if(i.dem&&i.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=i.tileID.overscaledZ;const t=zb.create(e,r,i);if(!t)return;
1this.modelTraits&rm.HasMapboxMeshFeatures&&this.updateDEM(e,t,r,n);for(const e of this.getNodesInfo()){const r=e.node;if(!r.footprint||!r.footprint.vertices||!r.footprint.vertices.length)continue;const n=r.footprint.vertices;let i=t.getElevationAt(n[0].x,n[0].y,!0,!0);for(let e=1;e<n.length;e++)i=Math.min(i,t.getElevationAt(n[e].x,n[e].y,!0,!0));r.elevation=i}}this.terrainTile=i.tileID.canonical,this.terrainExaggeration=t}}updateDEM(e,t,r,n){let i=t._dem._modifiedForSources[n];if(void 0===i&&(t._dem._modifiedForSources[n]=[],i=t._dem._modifiedForSources[n]),i.includes(r.canonical))return;const o=t._dem.dim;i.push(r.canonical);let a=!1;for(const e of this.getNodesInfo()){const r=e.node;if(!r.footprint||!r.footprint.grid)continue;const n=r.footprint.grid,i=t.tileCoordToPixel(n.min.x,n.min.y),s=t.tileCoordToPixel(n.max.x,n.max.y),l=Math.min(Math.min(o-s.y,i.x),Math.min(i.y,o-s.x));if(l<0)continue;const c=De(l,2,5);let u=Math.max(0,i.x-c),d=Math.max(0,i.y-c),h=Math.min(s.x+c,o-1),f=Math.min(s.y+c,o-1);for(let e=d;e<=f;++e)for(let t=u;t<=h;++t)Nb[e*o+t]=255;let p=0,g=0;for(let e=0;e<n.cellsY;++e)for(let r=0;r<n.cellsX;++r){if(!n.cells[e*n.cellsX+r])continue;const i=t.tileCoordToPixel(n.min.x+r/n.xScale,n.min.y+e/n.yScale),a=t.tileCoordToPixel(n.min.x+(r+1)/n.xScale,n.min.y+(e+1)/n.yScale);for(let e=i.y;e<=Math.min(a.y+1,o-1);++e)for(let r=i.x;r<=Math.min(a.x+1,o-1);++r)255===Nb[e*o+r]&&(Nb[e*o+r]=0,p+=t.getElevationAtPixel(r,e),g++)}const m=p/g;u=Math.max(1,i.x-c),d=Math.max(1,i.y-c),h=Math.min(s.x+c,o-2),f=Math.min(s.y+c,o-2),a=!0;for(let e=d;e<=f;++e)for(let r=u;r<=h;++r)0===Nb[e*o+r]&&(Fb[e*o+r]=t._dem.set(r,e,m));for(let e=1;e<c;++e){u=Math.max(1,i.x-e),d=Math.max(1,i.y-e),h=Math.min(s.x+e,o-2),f=Math.min(s.y+e,o-2);for(let r=d;r<=f;++r)for(let n=u;n<=h;++n){const i=r*o+n;if(255===Nb[i]){let a=0,s=0,l=-1,u=-1;for(let t=-1;t<=1;++t)for(let i=-1;i<=1;++i){const c=(r+t)*o+n+i;if(Nb[c]>=e)continue;const d=Fb[c],h=Math.abs(d);h>s&&(a=d,s=h,l=i,u=t)}if(s>.1){const o=1-(e+.5*Math.abs(l*u))/c;let s=t._dem.get(n,r)+a*o;const d=t._dem.get(n+l,r+u),h=t._dem.get(n-l,r-u,!0);(s-d)*(s-h)>0&&(s=(d+h)/2),Fb[i]=t._dem.set(n,r,s),Nb[i]=e}}}}}a&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=yt.now())}setFilter(e){this.filter=e?gs(e):null}getNodesInfo(){return this.filter?this.nodesInfo.filter((e=>this.filter.filter(new Ja(this.id.overscaledZ,{worldview:this.worldview}),e.feature,this.id.canonical))):this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)lm(t.node),um(t.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped());for(const e of this.getNodesInfo()){const t=e.node.footprint;e.hiddenByReplacement=!!t&&!r.find((e=>e.footprint===t))}}getHeightAtTileCoord(e,t){const r=[],n=[0,0,0],i=c([]);for(const o of this.getNodesInfo()){const a=o.node.meshes[0],s=a.transformedAabb;if(e<s.min[0]||t<s.min[1]||e>s.max[0]||t>s.max[1])continue;if(!0===o.node.hidden)return{height:1/0,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]};u(i,o.node.globalMatrix),n[0]=e,n[1]=t,G(n,n,i);const l=(n[0]-a.aabb.min[0])/(a.aabb.max[0]-a.aabb.min[0])*tm|0,c=Math.min(63,(n[1]-a.aabb.min[1])/(a.aabb.max[1]-a.aabb.min[1])*tm|0)*tm+Math.min(63,l),d=a.heightmap[c];if(!(d<0&&o.node.footprint)){if(o.hiddenByReplacement)return;return{height:d,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]}}if(o.node.footprint.grid.query(new Te(e,t),new Te(e,t),r),r.length>0)return{height:void 0,maxHeight:o.feature.properties.height,hidden:o.hiddenByReplacement,verticalScale:o.evaluatedScale[2]}}}}function $b(e,t){return e instanceof $o&&!e.isLightConstant&&t}function Hb(e,t,r,n,i,o,a,s){let l=(61440&t|(61440&t)>>4)>>8,c=(3840&t|(3840&t)>>4)>>4,u=240&t|(240&t)>>4;r[3]>0&&(l=fr(l,255*r[0],r[3]),c=fr(c,255*r[1],r[3]),u=fr(u,255*r[2],r[3]));const d=l<<8|c,h=u<<8|Math.floor(255*n[3]),f=function(e){const t=De(e,0,2);return Math.min(Math.round(.5*t*255),255)}(n[2])<<8|15*n[0]<<4|15*n[1],p=De(i[0],0,1),g=De(i[1],0,1),m=De(i[2],0,1),y=De(i[3],0,1);let _,v,b,x;if(p!==g&&a!==o&&g!==p){const e=a-o;v=1/(e*(g-p)),b=-(o+e*p)/(e*(g-p));const t=De(i[4],-1,1);x=Math.pow(10,t),_=255*m<<8|255*y}else _=65535,v=0,b=1,x=1;if(e.emplaceBack(d,h,f,_,v,b,x),s){const e=s.length;s.clear();for(let t=0;t<e;t++)s.emplaceBack(d,h,f,_,v,b,x)}}function qb(e,t,r){const n=e.node;let i=0;const o=r&rm.HasMeshoptCompression;for(const r of n.meshes){if(n.lights&&n.lightMeshIndex===i)continue;if(!r.featureData)continue;r.featureArray=new bl,r.featureArray.reserve(r.featureData.length);let a=t;for(const t of r.featureData){const i=o?65535&t:t>>16&65535,s=o?t>>16&65535:65535&t,l=(15&s)<8?15&s:0,c=e.evaluatedRMEA[l],u=e.evaluatedColor[l],d=e.emissionHeightBasedParams[l];let h;if(a&&2===l&&n.lights&&(h=new bl,h.resize(10*n.lights.length)),Hb(r.featureArray,i,u,c,d,r.aabb.min[2],r.aabb.max[2],h),h&&a){a=!1;const e=n.meshes[n.lightMeshIndex];e.featureArray=h,e.featureArray._trim()}}r.featureArray._trim(),i++}}ea(Ub,"Tiled3dModelBucket",{omit:["layers"]}),ea(Gb,"Tiled3dModelFeature");const Wb=["id","tile","layer","source","sourceLayer","state"];class Zb{constructor(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=r,this._y=n,this.properties=e?e.properties:{},this.id=i}clone(){const e=new Zb(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(e.state=Object.assign({},this.state)),this.layer&&(e.layer=Object.assign({},this.layer)),this.source&&(e.source=this.source),this.sourceLayer&&(e.sourceLayer=this.sourceLayer),e}get geometry(){return void 0===this._geometry&&this._vectorTileFeature&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const t of Wb)void 0!==this[t]&&(e[t]=this[t]);return e}}class Yb extends ir{constructor(e,t,r,n){super(),this.id=e,this.type="model",this.models=[],this._options=t,this._modelsInfo=new Map}loadGLTFFromURI(e){return Lg(this.map._requestManager.transformRequest(e,zt.Model).url)}load(){for(const e in this._options.models){const t=this._options.models[e],r=this._modelsInfo.get(e);if(r){r.modelSpec=t;const e=r.model;e&&(e.position=null!=t.position?new Pc(t.position[0],t.position[1]):new Pc(0,0),e.orientation=null!=t.orientation?t.orientation:[0,0,0],Yb.applyModelSpecification(e,t),e.computeBoundsAndApplyParent(),this.models.push(e))}else this._modelsInfo.set(e,{modelSpec:t,model:null}),this.loadGLTFFromURI(t.uri).then((t=>{if(!t)return;const r=this._modelsInfo.get(e);if(!r)return;const n=_m(t),i=r.modelSpec,o=new im(e,i.uri,i.position,i.orientation,n);Yb.applyModelSpecification(o,i),o.computeBoundsAndApplyParent(),this.models.push(o),r.model=o,this.loaded()&&this.fire(new er("data",{dataType:"source",sourceDataType:"metadata"}))})).catch((r=>{this.fire(new tr(new Error(`Could not load model ${e} from ${t.uri}: ${r.message}`)))}))}this.loaded()&&this.fire(new er("data",{dataType:"source",sourceDataType:"metadata"}))}static applyModelSpecification(e,t){t.nodeOverrides&&Yb.convertNodeOverrides(e,t.n
1odeOverrides),t.materialOverrides&&Yb.convertMaterialOverrides(e,t.materialOverrides),t.nodeOverrideNames&&(e.nodeOverrideNames=[...t.nodeOverrideNames]),t.materialOverrideNames&&(e.materialOverrideNames=[...t.materialOverrideNames]),t.featureProperties&&(e.featureProperties=t.featureProperties)}static convertNodeOverrides(e,t){if(Array.isArray(t)&&t.every((e=>"string"==typeof e))){e.nodeOverrideNames=[];for(const r of t)e.nodeOverrideNames.push(r)}else Object.entries(t).forEach((([t,r])=>{const n={orientation:[0,0,0]};if(r.hasOwnProperty("orientation")){const e=r.orientation;e&&(n.orientation=e)}e.nodeOverrides.set(t,n)}))}static convertMaterialOverrides(e,t){if(Array.isArray(t)&&t.every((e=>"string"==typeof e))){e.materialOverrideNames=[];for(const r of t)e.materialOverrideNames.push(r)}else Object.entries(t).forEach((([t,r])=>{const n={color:new cr(1,1,1),colorMix:0,emissionStrength:0,opacity:1},i=r["model-color"];void 0!==i&&(n.color.r=i[0],n.color.g=i[1],n.color.b=i[2]);const o=r["model-color-mix-intensity"];void 0!==o&&(n.colorMix=o);const a=r["model-emissive-strength"];void 0!==a&&(n.emissionStrength=a);const s=r["model-opacity"];void 0!==s&&(n.opacity=s),e.materialOverrides.set(t,n)}))}onAdd(e){this.map=e,this.load()}hasTransition(){return!1}loaded(){if(0===this._modelsInfo.size)return!0;for(const e of this._modelsInfo.values())if(null==e.model)return!1;return!0}getModels(){return this.models}loadTile(e,t){}serialize(){return this._options}setProperty(e,t){return!1}reload(){const e=Es(this.id,this.scope);this.map.style.clearSource(e),this.models=[],this._modelsInfo.clear(),this.load()}setModels(e){this.models=[];const t=new Map;for(const r in e){const n=e[r];if(this._modelsInfo.has(r)){const e=this._modelsInfo.get(r);e&&e.modelSpec.uri===n.uri&&t.set(r,e)}}this._modelsInfo=t,this._options.models=e,this.load()}}function Xb(e,t,r,n){const i=1<<e.z;t.lat=zc((n/Gn+e.y)/i),t.lng=Dc((r/Gn+e.x)/i)}function Kb(e,t,r,n){const i=e.getNodesInfo()[t];if(!i||i.hiddenByReplacement||!i.node.meshes)return;let o=Number.MAX_VALUE;const a=i.node,s=r.tile,l=n.calculatePosMatrix(s.tileID.toUnwrapped(),n.worldSize),c=i.evaluatedScale;let u=0;n.elevation&&a.elevation&&(u=a.elevation*n.elevation.exaggeration()),h(l,l,[(a.anchor?a.anchor[0]:0)*(c[0]-1),(a.anchor?a.anchor[1]:0)*(c[1]-1),u]),f(l,l,c);const p=r.queryGeometry,g=p.isPointQuery()?p.screenBounds:p.screenGeometry,m=function(e){const t=d([],l,e.globalMatrix);d(t,n.expandedFarZProjMatrix,t);for(let r=0;r<e.meshes.length;++r){const i=e.meshes[r];if(r===e.lightMeshIndex)continue;const a=em(g,n,t,i.aabb);null!=a&&(o=Math.min(a,o))}if(e.children)for(const t of e.children)m(t)};if(m(a),o===Number.MAX_VALUE)return;const y=new Pc(0,0);return Xb(s.tileID.canonical,y,i.node.anchor[0],i.node.anchor[1]),{intersectionZ:o,position:y,feature:i.feature}}const Jb={circle:class extends Os{constructor(e,t,r,n){super(e,{layout:Wu||(Wu=new us({"circle-sort-key":new ls(ds.layout_circle["circle-sort-key"]),"circle-elevation-reference":new ss(ds.layout_circle["circle-elevation-reference"]),visibility:new ss(ds.layout_circle.visibility)})),paint:Zu||(Zu=new us({"circle-radius":new ls(ds.paint_circle["circle-radius"]),"circle-color":new ls(ds.paint_circle["circle-color"]),"circle-blur":new ls(ds.paint_circle["circle-blur"]),"circle-opacity":new ls(ds.paint_circle["circle-opacity"]),"circle-translate":new ss(ds.paint_circle["circle-translate"]),"circle-translate-anchor":new ss(ds.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ss(ds.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ss(ds.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ls(ds.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ls(ds.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ls(ds.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new ss(ds.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n)}createBucket(e){return new Iu(e)}queryRadius(e){const t=e;return Uu("circle-radius",this,t)+Uu("circle-stroke-width",this,t)+$u(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,n,i,o,a,s){const l=qu(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r);return Rd(e,n,o,a,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(e,t,r){const n=Cd(this);return{config:new fc(this,{zoom:t,lut:r}),defines:n,overrideFog:!1}}
vendor: 18,924 bytes, line 1
1is3D(e){return!e&&!!this.layout&&"none"!==this.layout.get("circle-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("circle-elevation-reference")}},heatmap:class extends Os{createBucket(e){return new Fd(e)}constructor(e,t,r,n){super(e,{layout:Nd||(Nd=new us({visibility:new ss(ds.layout_heatmap.visibility)})),paint:Bd||(Bd=new us({"heatmap-radius":new ls(ds.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ls(ds.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ss(ds.paint_heatmap["heatmap-intensity"]),"heatmap-color":new cs(ds.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ss(ds.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Zd({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)}_clear(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}queryRadius(e){return Uu("heatmap-radius",this,e)}queryIntersectsFeature(e,t,r,n,i,o,a,s){const l=this.paint.get("heatmap-radius").evaluate(t,r);return Rd(e,n,o,a,s,!0,!0,new Te(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(e,t,r){return"heatmap"===e?{config:new fc(this,{zoom:t,lut:r}),overrideFog:!1}:{}}},hillshade:class extends Os{constructor(e,t,r,n){super(e,{layout:jd||(jd=new us({visibility:new ss(ds.layout_hillshade.visibility)})),paint:Vd||(Vd=new us({"hillshade-illumination-direction":new ss(ds.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ss(ds.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ss(ds.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ss(ds.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ss(ds.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ss(ds.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new ss(ds.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n)}shouldRedrape(){return this.hasOffscreenPass()&&"viewport"===this.paint.get("hillshade-illumination-anchor")}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(e,t,r){return{overrideFog:!1}}},fill:class extends Os{constructor(e,t,r,n){super(e,{layout:xf||(xf=new us({"fill-sort-key":new ls(ds.layout_fill["fill-sort-key"]),visibility:new ss(ds.layout_fill.visibility),"fill-elevation-reference":new ss(ds.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new ls(ds.layout_fill["fill-construct-bridge-guard-rail"])})),paint:wf||(wf=new us({"fill-antialias":new ss(ds.paint_fill["fill-antialias"]),"fill-opacity":new ls(ds.paint_fill["fill-opacity"]),"fill-color":new ls(ds.paint_fill["fill-color"]),"fill-outline-color":new ls(ds.paint_fill["fill-outline-color"]),"fill-translate":new ss(ds.paint_fill["fill-translate"]),"fill-translate-anchor":new ss(ds.paint_fill["fill-translate-anchor"]),"fill-pattern":new ls(ds.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new ss(ds.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new ss(ds.paint_fill["fill-emissive-strength"]),"fill-z-offset":new ls(ds.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new ls(ds.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new ls(ds.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),r=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getDefaultProgramParams(e,t,r){return{config:new fc(this,{zoom:t,lut:r}),overrideFog:!1}}recalculate(e,t){super.recalculate(e,t);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new bf(e)}queryRadius(){return $u(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,n,i,o){return!e.queryGeometry.isAboveHorizon&&Pu(Hu(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),n)}isTileClipped(){return 0===this.paint.get("fill-z-offset").constantOr(1)}is3D(e){if(0!==this.paint.get("fill-z-offset").constantOr(1))return!0;const t=this.layout&&"none"!==this.layout.get("fill-elevation-reference");return null!=e?t&&!e:t}hasElevation(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}hasShadowPass(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}},"fill-extrusion":class extends Os{constructor(e,t,r,n){super(e,{layout:Mp||(Mp=new us({visibility:new ss(ds["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new ss(ds["layout_fill-extrusion"]["fill-extrusion-edge-radius"])})),paint:Ep||(Ep=new us({"fill-extrusion-opacity":new ss(ds["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ls(ds["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ss(ds["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ss(ds["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ls(ds["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new ss(ds["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new ls(ds["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ls(ds["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new ss(ds["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new ss(ds["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new ss(ds["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new ss(ds["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new ss(ds["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new ss(ds["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new ss(ds["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new ss(ds["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new ss(ds["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new ss(ds["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new ls(ds["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new ls(ds["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new ss(ds["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new ss(ds["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new ss(ds["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new ss(ds["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new ls(ds["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new ls(ds["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new ss(ds["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new gp(e)}queryRadius(){return $u(this.paint.get("fill-extrusion-translate"))}is3D(e){return!0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(e,t,r,n,i,o,a,s,l){const c=qu(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(t,r),d=this.paint.get("fill-extrusion-base").evaluate(t,r),h=[0,0],f=s&&o.elevation,p=o.elevation?o.elevation.exaggeration():1,g=e.tile.getBucket(this);if(f&&g instanceof gp){const e=g.centroidVertexArray,t=l+1;t<e.length&&(h[0]=e.geta_centroid_pos0(t),h[1]=e.geta_centroid_pos1(t))}if(0===h[0]&&1===h[1])return!1;"globe"===o.projection.name&&(n=Tp([n],[new Te(0,0),new Te(Gn,Gn)],e.tileID.canonical).map((e=>e.polygon)).flat());const m=f?s:null,[y,_]=Bp(o,n,d,u,c,a,m,h,p,o.center.lat,e.tileID.canonical),v=e.queryGeometry;return Np(y,_,v.isPointQuery()?v.screenBounds:v.screenGeometry)}},building:class extends Os{constructor(e,t,r,n){super(e,{layout:jm||(jm=new us({visibility:new ss(ds.layout_building.visibility),"building-facade":new ls(ds.layout_building["building-facade"]),"building-facade-floors":new ls(ds.layout_building["building-facade-floors"]),"building-facade-unit-width":new ls(ds.layout_building["building-facade-unit-width"]),"building-facade-window":new ls(ds.layout_building["building-facade-window"]),"building-roof-shape":new ls(ds.layout_building["building-roof-shape"]),"building-height":new ls(ds.layout_building["building-height"]),"building-base":new ls(ds.layout_building["building-base"]),"building-flood-light-wall-radius":new ls(ds.layout_building["building-flood-light-wall-radius"]),"building-flood-light-ground-radius":new ls(ds.layout_building["building-flood-light-ground-radius"]),"building-flip-roof-orientation":new ls(ds.layout_building["building-flip-roof-orientation"])})),paint:Vm||(Vm=new us({"building-opacity":new ss(ds.paint_building["building-opacity"]),"building-ambient-occlusion-intensity":new ss(ds.paint_building["building-ambient-occlusion-intensity"]),"building-ambient-occlusion-ground-intensity":new ss(ds.paint_building["building-ambient-occlusion-ground-intensity"]),"building-ambient-occlusion-ground-radius":new ss(ds.paint_building["building-ambient-occlusion-ground-radius"]),"building-ambient-occlusion-ground-attenuation":new ss(ds.paint_building["building-ambient-occlusion-ground-attenuation"]),"building-vertical-scale":new ss(ds.paint_building["building-vertical-scale"]),"building-cast-shadows":new ss(ds.paint_building["building-cast-shadows"]),"building-color":new ls(ds.paint_building["building-color"]),"building-emissive-strength":new ls(ds.paint_building["building-emissive-strength"]),"building-facade-emissive-chance":new ss(ds.paint_building["building-facade-emissive-chance"]),"building-cutoff-fade-range":new ss(ds.paint_building["building-cutoff-fade-range"]),"building-flood-light-color":new ss(ds.paint_building["building-flood-light-color"]),"building-flood-light-intensity":new ss(ds.paint_building["building-flood-light-intensity"]),"building-flood-light-ground-attenuation":new ss(ds.paint_building["building-flood-light-ground-attenuation"]),"building-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"building-flood-light-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new Fm(e)}cutoffRange(){return this.paint.get("building-cutoff-fade-range")}hasShadowPass(){return this.paint.get("building-cast-shadows")}hasLightBeamPass(){return!0}canCastShadows(){return!0}is3D(e){return!0}queryRadius(e){return 0}queryIntersectsFeature(e,t,r,n,i,o,a,s,l,c){let u=this.layout.get("building-height").evaluate(t,r);const d=this.layout.get("building-base").evaluate(t,r),h=e.tile.getBucket(this).getFootprint(t);if(h){if(0!==h.hiddenFlags)return!1;u=h.height}const[f,p]=Bp(o,n,d,u,new Te(0,0),a,null,[0,0],1,o.center.lat,e.tileID.canonical),g=e.queryGeometry;return Np(f,p,g.isPointQuery()?g.screenBounds:g.screenGeometry)}},line:class extends Os{constructor(e,t,r,n){const i=uy();super(e,i,t,r,n),i.layout&&(this.layout=new as(i.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Ei,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}emissiveStrengthExpression(){return this._transitionablePaint._values["line-emissive-strength"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=(()=>{if(hy)return hy;const e=uy();return hy=new dy(e.paint.properties["line-width"].specification),hy.useIntegerZoom=!0,hy})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Qm(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,t,r){const n=sy(this);return{config:new fc(this,{zoom:t,lut:r}),defines:n,overrideFog:!1}}queryRadius(e){const t=e,r=fy(Uu("line-width",this,t),Uu("line-gap-width",this,t)),n=Uu("line-offset",this,t);return r/2+Math.abs(n)+$u(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,n,i,o){if(e.queryGeometry.isAboveHorizon)return!1;const a=Hu(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),s=e.pixelToTileUnitsFactor/2*fy(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),l=this.paint.get("line-offset").evaluate(t,r);return l&&(n=function(e,t){const r=[],n=new Te(0,0);for(let i=0;i<e.length;i++){const o=e[i],a=[];for(let e=0;e<o.length;e++){const r=o[e],i=o[e+1],s=0===e?n:r.sub(o[e-1])._unit()._perp(),l=e===o.length-1?n:i.sub(r)._unit()._perp(),c=s._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),a.push(c._mult(t)._add(r))}r.push(a)}return r}(n,l*e.pixelToTileUnitsFactor)),function(e,t,r){for(let n=0;n<t.length;n++){const i=t[n];if(e.length>=3)for(let t=0;t<i.length;t++)if(Nu(e,i[t]))return!0;if(Au(e,i,r))return!0}return!1}(a,n,s)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(e){return!this.hasElevatedBuckets||this.layout&&"hd-road-markup"===this.layout.get("line-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("line-elevation-reference")}},symbol:lb,background:class extends Os{constructor(e,t,r,n){super(e,{layout:cb||(cb=new us({visibility:new ss(ds.layout_background.visibility)})),paint:ub||(ub=new us({"background-pitch-alignment":new ss(ds.paint_background["background-pitch-alignment"]),"background-color":new ss(ds.paint_background["background-color"]),"background-pattern":new ss(ds.paint_background["background-pattern"]),"background-opacity":new ss(ds.paint_background["background-opacity"]),"background-emissive-strength":new ss(ds.paint_background["background-emissive-strength"]),"background-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(e,t,r){return{overrideFog:!1}}is3D(e){return"viewport"===this.paint.get("background-pitch-alignment")}},raster:vb,"raster-particle":Tb,sky:class extends Os{constructor(e,t,r,n){super(e,{layout:wb||(wb=new us({visibility:new ss(ds.layout_sky.visibility)})),paint:Sb||(Sb=new us({"sky-type":new ss(ds.paint_sky["sky-type"]),"sky-atmosphere-sun":new ss(ds.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new ss(ds.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new ss(ds.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new ss(ds.paint_sky["sky-gradient-radius"]),"sky-gradient":new cs(ds.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new ss(ds.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new ss(ds.paint_sky["sky-atmosphere-color"]),"sky-opacity":new ss(ds.paint_sky["sky-opacity"]),"sky-gradient-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n),this._updateColorRamp()}_clear(){this.skyboxFbo&&(this.skyboxFbo.destroy(),this.skyboxFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this._skyboxInvalidated=!0}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvali
1dated=!0)}_updateColorRamp(){this.colorRamp=Zd({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const r=this.paint.get("sky-atmosphere-sun"),n=!r,i=e.style.light,o=i.properties.get("position");return n&&"viewport"===i.properties.get("anchor")&&Ze("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?Mb(o.azimuthal,90-o.polar,t):Mb(r[0],90-r[1],t)}const r=this.paint.get("sky-gradient-center");return Mb(r[0],90-r[1],t)}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}},slot:class extends Os{constructor(e,t,r,n){super(e,{paint:kb||(kb=new us({}))},t,null)}},model:class extends Os{constructor(e,t,r,n){super(e,{layout:Ob||(Ob=new us({visibility:new ss(ds.layout_model.visibility),"model-id":new ls(ds.layout_model["model-id"]),"model-allow-density-reduction":new ss(ds.layout_model["model-allow-density-reduction"])})),paint:Db||(Db=new us({"model-opacity":new ls(ds.paint_model["model-opacity"]),"model-rotation":new ls(ds.paint_model["model-rotation"]),"model-scale":new ls(ds.paint_model["model-scale"]),"model-translation":new ls(ds.paint_model["model-translation"]),"model-color":new ls(ds.paint_model["model-color"]),"model-color-mix-intensity":new ls(ds.paint_model["model-color-mix-intensity"]),"model-type":new ss(ds.paint_model["model-type"]),"model-cast-shadows":new ss(ds.paint_model["model-cast-shadows"]),"model-receive-shadows":new ss(ds.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new ss(ds.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new ls(ds.paint_model["model-emissive-strength"]),"model-roughness":new ls(ds.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new ls(ds.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new ss(ds.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new ss(ds.paint_model["model-front-cutoff"]),"model-elevation-reference":new ss(ds.paint_model["model-elevation-reference"]),"model-color-use-theme":new ls({type:"string",default:"default","property-type":"data-driven"})}))},t,r,n),this.layer=e,this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new Lb(e)}getProgramIds(){return["model"]}is3D(e){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(e){return e instanceof Ub?8191:0}queryRenderedFeatures(e,t,r){const n=t.getSource();if(!(n&&n instanceof Yb))return{};const i=n,o={};o[this.id]=[];const a=o[this.id];let s=0;for(const n of i.models){const i=t.getFeatureState(this.sourceLayer,n.id),o={type:"Unknown",id:n.id,properties:n.featureProperties},l=this.paint.get("model-rotation").evaluate(o,i),c=this.paint.get("model-scale").evaluate(o,i),u=this.paint.get("model-translation").evaluate(o,i),h=this.paint.get("model-elevation-reference");let f=[];nm(f,n,r,n.position,l,c,u,"ground"===h,"ground"===h,!1),"globe"===r.projection.name&&(f=Qg(f,r));const p=d([],r.projMatrix,f),g=em(e.isPointQuery()?e.screenBounds:e.screenGeometry,r,p,n.aabb);if(null!=g){const e=new Zb(void 0,0,0,0,n.id);e.layer=this.layer,e.properties=structuredClone(n.featureProperties),e.properties.layer=this.id,e.properties.uri=n.uri,e.properties.orientation=n.orientation,e.sourceLayer=this.sourceLayer,e.geometry={type:"Point",coordinates:[n.position.lng,n.position.lat]},e.state=i,e.source=this.source,a.push({featureIndex:s,feature:e,intersectionZ:g})}++s}return o}queryIntersectsFeature(e,t,r,n,i,o,a,s,l,c){if(!this.modelManager)return!1;const u=this.modelManager,h=e.tile.getBucket(this);if(!(h&&h instanceof Lb))return!1;for(const r in h.instancesPerModel){const n=h.instancesPerModel[r],i=void 0!==t.id?t.id:t.properties&&t.properties.hasOwnProperty("id")?t.properties.id:void 0;if(n.idToFeaturesIndex.hasOwnProperty(i)){const t=n.features[n.idToFeaturesIndex[i]],a=u.getModel(r,c||this.scope);if(!a)return!1;let s=[];const l=new Pc(0,0),f=h.canonical;let p=Number.MAX_VALUE;for(let r=0;r<t.instancedDataCount;++r){const i=16*(t.instancedDataOffset+r),c=n.instancedDataArray.float32,u=[c[i+4],c[i+5],c[i+6]];Xb(f,l,Math.floor(c[i]),Math.floor(c[i+1])),nm(s,a,o,l,t.rotation,t.scale,u,!1,!1,!1),"globe"===o.projection.name&&(s=Qg(s,o));const h=d([],o.projMatrix,s),g=e.queryGeometry,m=em(g.isPointQuery()?g.screenBounds:g.screenGeometry,o,h,a.aabb);null!=m&&(p=Math.min(m,p))}return p!==Number.MAX_VALUE&&p}}return!1}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven()||"model-color"!==e&&"model-color-mix-intensity"!==e&&"model-rotation"!==e&&"model-scale"!==e&&"model-translation"!==e&&"model-emissive-strength"!==e)}_isPropertyZoomDependent(e){const t=this._transitionablePaint._values[e];return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof Ho}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends Os{constructor(e,t,r,n){super(e,{layout:Sf||(Sf=new us({"clip-layer-types":ne
1w ss(ds.layout_clip["clip-layer-types"]),"clip-layer-scope":new ss(ds.layout_clip["clip-layer-scope"])})),paint:kf||(kf=new us({}))},t,r,n)}recalculate(e,t){super.recalculate(e,t)}createBucket(e){return new Mf(e)}is3D(e){return!0}}},Qb=new cr(0,0,0);function ex(e,t,r){1===e&&t.icons.push(function(e,t){return function(e){if(e.usvg_tree.height||(e.usvg_tree.height=e.usvg_tree.width),!e.metadata)return e;const{metadata:t}=e;if(t.content_area){const{content_area:r}=t;null==r.left&&(r.left=0),null==r.top&&(r.top=r.left),null==r.width&&(r.width=e.usvg_tree.width),null==r.height&&(r.height=r.width)}if(t.text_placeholder){const{text_placeholder:e}=t;null==e.top&&(e.top=e.left),null==e.height&&(e.height=e.width)}return t.stretch_x&&t.stretch_x.length&&tx(t,"x"),t.stretch_y&&t.stretch_y.length&&tx(t,"y"),e}(e.readFields(rx,{name:void 0},t))}(r,r.readVarint()+r.pos))}function tx(e,t){const r=[],n=e[`stretch_${t}`];let i=null;for(let e=0;e<n.length;e++)null===i?i=0===r.length?n[0]:r[r.length-1][1]+n[e]:(r.push([i,i+n[e]]),i=null);e[`stretch_${t}_areas`]=r}function rx(e,t,r){1===e?t.name=r.readString():2===e?t.metadata=function(e,t){return e.readFields(nx,{stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]},t)}(r,r.readVarint()+r.pos):3===e&&(t.usvg_tree=function(e,t){return e.readFields(sx,{width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[]},t)}(r,r.readVarint()+r.pos),t.data="usvg_tree")}function nx(e,t,r){1===e?t.stretch_x=r.readPackedVarint():2===e?t.stretch_y=r.readPackedVarint():3===e?t.content_area=ix(r,r.readVarint()+r.pos):4===e?t.variables.push(function(e,t){return e.readFields(ax,{name:void 0},t)}(r,r.readVarint()+r.pos)):5===e&&(t.text_placeholder=ix(r,r.readVarint()+r.pos))}function ix(e,t){return e.readFields(ox,{},t)}function ox(e,t,r){1===e?t.left=r.readVarint():2===e?t.width=r.readVarint():3===e?t.top=r.readVarint():4===e&&(t.height=r.readVarint())}function ax(e,t,r){1===e?t.name=r.readString():2===e&&(t.rgb_color=gx(r.readVarint()),t.value="rgb_color")}function sx(e,t,r){1===e?t.width=t.height=r.readVarint():2===e?t.height=r.readVarint():3===e?t.children.push(lx(r,r.readVarint()+r.pos)):4===e?t.linear_gradients.push(function(e,t){return e.readFields(yx,{spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0},t)}(r,r.readVarint()+r.pos)):5===e?t.radial_gradients.push(function(e,t){return e.readFields(bx,{spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0},t)}(r,r.readVarint()+r.pos)):7===e?t.clip_paths.push(function(e,t){return e.readFields(xx,{children:[]},t)}(r,r.readVarint()+r.pos)):8===e&&t.masks.push(function(e,t){const r=e.readFields(wx,{left:0,width:20,mask_type:1,children:[]},t);return null==r.height&&(r.height=r.width),null==r.top&&(r.top=r.left),r}(r,r.readVarint()+r.pos))}function lx(e,t){return e.readFields(cx,{},t)}function cx(e,t,r){1===e?(t.group=function(e,t){return e.readFields(ux,{opacity:255,children:[]},t)}(r,r.readVarint()+r.pos),t.node="group"):2===e&&(t.path=function(e,t){return e.readFields(fx,{paint_order:1,commands:[],step:1,diffs:[],rule:1},t)}(r,r.readVarint()+r.pos),t.node="path")}function ux(e,t,r){1===e?t.transform=dx(r,r.readVarint()+r.pos):2===e?t.opacity=r.readVarint():5===e?t.clip_path_idx=r.readVarint():6===e?t.mask_idx=r.readVarint():7===e&&t.children.push(lx(r,r.readVarint()+r.pos))}function dx(e,t){return e.readFields(hx,{sx:1,ky:0,kx:0,sy:1,tx:0,ty:0},t)}function hx(e,t,r){1===e?t.sx=r.readFloat():2===e?t.ky=r.readFloat():3===e?t.kx=r.readFloat():4===e?t.sy=r.readFloat():5===e?t.tx=r.readFloat():6===e&&(t.ty=r.readFloat())}function fx(e,t,r){1===e?t.fill=function(e,t){return e.readFields(px,{rgb_color:Qb,paint:"rgb_color",opacity:255},t)}(r,r.readVarint()+r.pos):2===e?t.stroke=function(e,t){return e.readFields(mx,{rgb_color:Qb,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1},t)}(r,r.readVarint()+r.pos):3===e?t.paint_order=r.readVarint():5===e?r.readPackedVarint(t.commands):6===e?t.step=r.readFloat():7===e?r.readPackedSVarint(t.diffs):8===e&&(t.rule=r.readVarint())}function px(e,t,r){1===e?(t.rgb_color=gx(r.readVarint()),t.paint="rgb_color"):2===e?(t.linear_gradient_idx=r.readVarint(),t.paint="linear_gradient_idx"):3===e?(t.radial_gradient_idx=r.readVarint(),t.paint="radial_gradient_idx"):5===e&&(t.opacity=r.readVarint())}function gx(e){return new cr((e>>16&255)/255,(e>>8&255)/255,(255&e)/255,1)}function mx(e,t,r){1===e?(t.rgb_color=gx(r.readVarint()),t.paint="rgb_color"):2===e?(t.linear_gradient_idx=r.readVarint(),t.paint="linear_gradient_idx"):3===e?(t.radial_gradient_idx=r.readVarint(),t.paint="radial_gradient_idx"):5===e?r.readPackedFloat(t.dasharray):6===e?t.dash
1offset=r.readFloat():7===e?t.miterlimit=r.readFloat():8===e?t.opacity=r.readVarint():9===e?t.width=r.readFloat():10===e?t.linecap=r.readVarint():11===e&&(t.linejoin=r.readVarint())}function yx(e,t,r){1===e?t.transform=dx(r,r.readVarint()+r.pos):2===e?t.spread_method=r.readVarint():3===e?t.stops.push(_x(r,r.readVarint()+r.pos)):4===e?t.x1=r.readFloat():5===e?t.y1=r.readFloat():6===e?t.x2=r.readFloat():7===e&&(t.y2=r.readFloat())}function _x(e,t){return e.readFields(vx,{offset:0,opacity:255,rgb_color:Qb},t)}function vx(e,t,r){1===e?t.offset=r.readFloat():2===e?t.opacity=r.readVarint():3===e&&(t.rgb_color=gx(r.readVarint()))}function bx(e,t,r){1===e?t.transform=dx(r,r.readVarint()+r.pos):2===e?t.spread_method=r.readVarint():3===e?t.stops.push(_x(r,r.readVarint()+r.pos)):4===e?t.cx=r.readFloat():5===e?t.cy=r.readFloat():6===e?t.r=r.readFloat():7===e?t.fx=r.readFloat():8===e?t.fy=r.readFloat():9===e&&(t.fr=r.readFloat())}function xx(e,t,r){1===e?t.transform=dx(r,r.readVarint()+r.pos):2===e?t.clip_path_idx=r.readVarint():3===e&&t.children.push(lx(r,r.readVarint()+r.pos))}function wx(e,t,r){1===e?t.left=t.top=r.readFloat():2===e?t.width=t.height=r.readFloat():3===e?t.top=r.readFloat():4===e?t.height=r.readFloat():5===e?t.mask_type=r.readVarint():6===e?t.mask_idx=r.readVarint():7===e&&t.children.push(lx(r,r.readVarint()+r.pos))}class Sx{static calculate(e={},t=[]){const r=new Map,n=new Map;if(0===Object.keys(e).length)return r;t.forEach((e=>{n.set(e.name,e.rgb_color||new cr(0,0,0))}));for(const[t,i]of Object.entries(e))n.has(t)?r.set(n.get(t).toString(),i):console.warn(`Ignoring unknown image variable "${t}"`);return r}}function kx(e,t=255,r){const n=t/255,i=e.toString(),o=r.has(i)?r.get(i).clone():e.clone();return o.a*=n,o.toString()}function Tx(e,t){if(!mt()){const r=document.createElement("canvas");return r.width=e,r.height=t,r}return new OffscreenCanvas(e,t)}let Ix,Mx=null;function Ex(e,t,r,n,i){for(const o of n.children)Px(e,t,r,o,i)}function Px(e,t,r,n,i){n.group?(e.save(),function(e,t,r,n,i){const o=null!=n.mask_idx?r.masks[n.mask_idx]:null,a=null!=n.clip_path_idx?r.clip_paths[n.clip_path_idx]:null;if(n.transform&&(t=Nx(n.transform).preMultiplySelf(t)),!function(e,t,r){return 255!==e.opacity||t||r}(n,null!=a,null!=o))return void Ex(e,t,r,n,i);const s=Tx(e.canvas.width,e.canvas.height),l=s.getContext("2d");Ex(l,t,r,n,i),a&&zx(l,t,r,a),o&&Fx(l,t,r,o,i),e.globalAlpha=n.opacity/255,e.drawImage(s,0,0)}(e,t,r,n.group,i),e.restore()):n.path&&(e.save(),function(e,t,r,n,i){e.setTransform(t),1===n.paint_order?(Ax(e,r,n,i),Rx(e,r,n,i)):(Rx(e,r,n,i),Ax(e,r,n,i))}(e,t,r,n.path,i),e.restore())}function Ax(e,t,r,n){const i=r.fill;if(!i)return;const o=i.opacity/255;switch(e.save(),e.beginPath(),Bx(r,e),i.paint){case"rgb_color":e.fillStyle=kx(i.rgb_color,i.opacity,n);break;case"linear_gradient_idx":{const r=t.linear_gradients[i.linear_gradient_idx];r.transform&&e.setTransform(Nx(r.transform).preMultiplySelf(e.getTransform())),e.fillStyle=Lx(e,r,o,n);break}case"radial_gradient_idx":{const r=t.radial_gradients[i.radial_gradient_idx];r.transform&&e.setTransform(Nx(r.transform).preMultiplySelf(e.getTransform())),e.fillStyle=Ox(e,r,o,n)}}e.fill(Cx(r)),e.restore()}function Cx(e){return 1===e.rule?"nonzero":2===e.rule?"evenodd":void 0}function Rx(e,t,r,n){const i=r.stroke;if(!i)return;const o=jx(r);e.lineWidth=i.width,e.miterLimit=i.miterlimit,e.setLineDash(i.dasharray),e.lineDashOffset=i.dashoffset;const a=i.opacity/255;switch(i.paint){case"rgb_color":e.strokeStyle=kx(i.rgb_color,i.opacity,n);break;case"linear_gradient_idx":e.strokeStyle=Lx(e,t.linear_gradients[i.linear_gradient_idx],a,n,!0);break;case"radial_gradient_idx":e.strokeStyle=Ox(e,t.radial_gradients[i.radial_gradient_idx],a,n,!0)}switch(i.linejoin){case 2:case 1:e.lineJoin="miter";break;case 3:e.lineJoin="round";break;case 4:e.lineJoin="bevel"}switch(i.linecap){case 1:e.lineCap="butt";break;case 2:e.lineCap="round";break;case 3:e.lineCap="square"}e.stroke(o)}function Lx(e,t,r,n,i=!1){if(1===t.stops.length){const e=t.stops[0];return kx(e.rgb_color,e.opacity*r,n)}const{x1:o,y1:a,x2:s,y2:l}=t;
vendor: 15,562 bytes, line 1
1let c=new DOMPoint(o,a),u=new DOMPoint(s,l);if(i){const e=Nx(t.transform);c=e.transformPoint(c),u=e.transformPoint(u)}const d=e.createLinearGradient(c.x,c.y,u.x,u.y);for(const e of t.stops)d.addColorStop(e.offset,kx(e.rgb_color,e.opacity*r,n));return d}function Ox(e,t,r,n,i=!1){if(1===t.stops.length){const e=t.stops[0];return kx(e.rgb_color,e.opacity*r,n)}const o=Nx(t.transform),{fx:a,fy:s,fr:l,cx:c,cy:u,r:d}=t;let h=new DOMPoint(a,s),f=new DOMPoint(c,u),p=l,g=d;if(i){h=o.transformPoint(h),f=o.transformPoint(f);const e=(o.a+o.d)/2;p=l*e,g=t.r*e}const m=e.createRadialGradient(h.x,h.y,p,f.x,f.y,g);for(const e of t.stops)m.addColorStop(e.offset,kx(e.rgb_color,e.opacity*r,n));return m}function Dx(e,t,r,n){const i=n.transform?Nx(n.transform).preMultiplySelf(t):t,o=Tx(e.canvas.width,e.canvas.height),a=o.getContext("2d");for(const e of n.children)if(e.group)Dx(a,i,r,e.group);else if(e.path){const t=e.path,r=new Path2D;r.addPath(jx(t),i),a.fill(r,Cx(t))}const s=null!=n.clip_path_idx?r.clip_paths[n.clip_path_idx]:null;s&&zx(a,i,r,s),e.globalCompositeOperation="source-over",e.drawImage(o,0,0)}function zx(e,t,r,n){const i=Tx(e.canvas.width,e.canvas.height);Dx(i.getContext("2d"),t,r,n),e.globalCompositeOperation="destination-in",e.drawImage(i,0,0)}function Fx(e,t,r,n,i){if(0===n.children.length)return;const o=null!=n.mask_idx?r.masks[n.mask_idx]:null;o&&Fx(e,t,r,o,i);const a=e.canvas.width,s=e.canvas.height,l=Tx(a,s),c=l.getContext("2d"),u=n.width,d=n.height,h=n.left,f=n.top,p=new Path2D,g=new Path2D;g.rect(h,f,u,d),p.addPath(g,t),c.clip(p);for(const e of n.children)Px(c,t,r,e,i);const m=c.getImageData(0,0,a,s),y=m.data;if(1===n.mask_type)for(let e=0;e<y.length;e+=4)y[e+3]=y[e+3]/255*(.2126*y[e]+.7152*y[e+1]+.0722*y[e+2]);c.putImageData(m,0,0),e.globalCompositeOperation="destination-in",e.drawImage(l,0,0)}function Nx(e){return e?new DOMMatrix([e.sx,e.ky,e.kx,e.sy,e.tx,e.ty]):new DOMMatrix}function Bx(e,t){const r=e.step;let n=e.diffs[0]*r,i=e.diffs[1]*r;t.moveTo(n,i);for(let o=0,a=2;o<e.commands.length;o++)switch(e.commands[o]){case 1:n+=e.diffs[a++]*r,i+=e.diffs[a++]*r,t.moveTo(n,i);break;case 2:n+=e.diffs[a++]*r,i+=e.diffs[a++]*r,t.lineTo(n,i);break;case 3:{const o=n+e.diffs[a++]*r,s=i+e.diffs[a++]*r;n=o+e.diffs[a++]*r,i=s+e.diffs[a++]*r,t.quadraticCurveTo(o,s,n,i);break}case 4:{const o=n+e.diffs[a++]*r,s=i+e.diffs[a++]*r,l=o+e.diffs[a++]*r,c=s+e.diffs[a++]*r;n=l+e.diffs[a++]*r,i=c+e.diffs[a++]*r,t.bezierCurveTo(o,s,l,c,n,i);break}case 5:t.closePath();break;default:Vx()}return t}function jx(e){return Bx(e,new Path2D)}function Vx(e,t){}class Gx{constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}put(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}delete(e){this.cache.delete(e)}}ea(Gx,"LRUCache");class Ux{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(e){return new qd(e,e.data)}getFromCache(e,t,r){return this.cacheMap.has(r)||this.cacheMap.set(r,new Gx(150)),this.cacheMap.get(r).get(Es(e.toString(),t))}setInCache(e,t,r,n){this.cacheDependenciesMap.has(n)||this.cacheDependenciesMap.set(n,new Map),this.cacheMap.has(n)||this.cacheMap.set(n,new Gx(150));const i=this.cacheDependenciesMap.get(n),o=Es(e.id.toString(),r);i.get(o)||i.set(o,new Set);const a=this.cacheMap.get(n),s=e.toString();i.get(o).add(s),a.put(Es(e.toString(),r),t)}removeImagesFromCacheByIds(e,t,r=0){if(!this.cacheMap.has(r)||!this.cacheDependenciesMap.has(r))return;const n=this.cacheMap.get(r),i=this.cacheDependenciesMap.get(r);for(const r of e){const e=Es(r.toString(),t);if(i.has(e)){for(const t of i.get(e))n.delete(t);i.delete(e)}}}rasterize(e,t,r,n){const i=this.getFromCache(e,r,n);if(i)return i.clone();const o=function(e,t){const r=Sx.calculate(t.params,e.metadata?e.metadata.variables:[]),n=e.usvg_tree,i=n.width,o=n.height,a=Math.max(1,Math.round(i*t.sx)),s=Math.max(1,Math.round(o*t.sy)),l=new DOMMatrix([a/i,0,0,s/o,0,0]);return null===Mx&&(Mx=Tx(10,10),Ix=Mx.getContext("2d",{willReadFrequently:!0})),Mx.width=a,Mx.height=s,Ex(Ix,l,n,n,r),Ix.getImageData(0,0,a,s)}(t.icon,e),a=Ux._getImage(o);return this.setInCache(e,a,r,n),a.clone()}}class $x{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const r=this.toIdx(e,t);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function Hx(e,t,r,n){let i=0,o=Number.MAX_VALUE;for(let a=0;a<3;a++)if(Math.abs(n[a])<1e-15){if(r[a]<e[a]||r[a]>t[a])return null}else{const s=1/n[a];let l=(e[a]-r[a])*s,c=(t[a]-r[a])*s;if(l>c){const e=l;l=c,c=e}if(l>i&&(i=l),c<o&&(o=c),i>o)return null}return i}function qx(e,t,r,n,i,o,a,s,l,c,u){const d=n-e,h=i-t,f=o-r,p=a-e,g=s-t,m=l-r,y=u[1]*m-u[2]*g,_=u[2]*p-u[0]*m,v=u[0]*g-u[1]*p,b=d*y+h*_+f*v;if(Math.abs(b)<1e-15)return null;const x=1/b,w=c[0]-e,S=c[1]-t,k=c[2]-r,T=(w*y+S*_+k*v)*x;if(T<0||T>1)return null;const I=S*f-k*h,M=k*d-w*f,E=w*h-S*d,P=(u[0]*I+u[1]*M+u[2]*E)*x;return P<0||T+P>1?null:(p*I+g*M+m*E)*x}function Wx(e,t,r){return(e-t)/(r-t)}function Zx(e,t,r,n,i,o,a,s,l){const c=1<<r,u=o-n,d=a-i,h=(e+1)/c*u+n,f=(t+0)/c*d+i,p=(t+1)/c*d+i;s[0]=(e+0)/c*u+n,s[1]=f,l[0]=h,l[1]=p}class Yx{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),r=[];let n=Math.ceil(Math.pow(2,t));const i=1/n,o=(e,t,r,n,i)=>{const o=n?1:0,a=(e+1)*r-o,s=t*r,l=(t+1)*r-o;i[0]=e*r,i[1]=s,i[2]=a,i[3]=l};let a=new $x(n);const s=[];for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),i,!1,s);const r=Kx(s[0],s[1],e),l=Kx(s[2],s[1],e),c=Kx(s[2],s[3],e),u=Kx(s[0],s[3],e);a.minimums.push(Math.min(r,l,c,u)),a.maximums.push(Math.max(r,l,c,u)),a.leaves.push(1)}for(r.push(a),n/=2;n>=1;n/=2){const e=r[r.length-1];a=new $x(n);for(let t=0;t<n*n;t++){o(t%n,Math.floor(t/n),2,!0,s);const r=e.getElevation(s[0],s[1]),i=e.getElevation(s[2],s[1]),l=e.getElevation(s[2],s[3]),c=e.getElevation(s[0],s[3]),u=e.isLeaf(s[0],s[1]),d=e.isLeaf(s[2],s[1]),h=e.isLeaf(s[2],s[3]),f=e.isLeaf(s[0],s[3]),p=Math.min(r.min,i.min,l.min,c.min),g=Math.max(r.max,i.max,l.max,c.max),m=u&&d&&h&&f;a.maximums.push(g),a.minimums.push(p),a.leaves.push(g-p<=5&&m?1:0)}r.push(a)}return r}(this.dem),r=t.length-1,n=t[r];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(t,0,0,r,0)}raycastRoot(e,t,r,n,i,o,a=1){return Hx([e,t,-100],[r,n,this.maximums[0]*a],i,o)}raycast(e,t,r,n,i,o,a=1){if(!this.nodeCount)return null;const s=this.raycastRoot(e,t,r,n,i,o,a);if(null==s)return null;const l=[],c=[],u=[],d=[],h=[{idx:0,t:s,nodex:0,nodey:0,depth:0}];for(;h.length>0;){const{idx:s,t:f,nodex:p,nodey:g,depth:m}=h.pop();if(this.leaves[s]){Zx(p,g,m,e,t,r,n,u,d);const s=1<<m,l=(p+0)/s,c=(p+1)/s,h=(g+0)/s,y=(g+1)/s,_=Kx(l,h,this.dem)*a,v=Kx(c,h,this.dem)*a,b=Kx(c,y,this.dem)*a,x=Kx(l,y,this.dem)*a,w=qx(u[0],u[1],_,d[0],u[1],v,d[0],d[1],b,i,o),S=qx(d[0],d[1],b,u[0],d[1],x,u[0],u[1],_,i,o),k=Math.min(null!==w?w:Number.MAX_VALUE,null!==S?S:Number.MAX_VALUE);if(k!==Number.MAX_VALUE)return k;{const e=L([],i,o,f);if(Xx(_,v,x,b,Wx(e[0],u[0],d[0]),Wx(e[1],u[1],d[1]))>=e[2])return f}continue}let y=0;for(let h=0;h<this._siblingOffset.length;h++){Zx((p<<1)+this._siblingOffset[h][0],(g<<1)+this._siblingOffset[h][1],m+1,e,t,r,n,u,d),u[2]=-100,d[2]=this.maximums[this.childOffsets[s]+h]*a;const f=Hx(u,d,i,o);if(null!=f){const e=f;l[h]=e;let t=!1;for(let r=0;r<y&&!t;r++)e>=l[c[r]]&&(c.splice(r,0,h),t=!0);t||(c[y]=h),y++}}for(let e=0;e<y;e++){const t=c[e];h.push({idx:this.childOffsets[s]+t,t:l[t],nodex:(p<<1)+this._siblingOffset[t][0],nodey:(g<<1)+this._siblingOffset[t][1],depth:m+1})}}return null}_addNode(e,t,r){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,r,n,i){if(1===e[n].isLeaf(t,r))return;this.childOffsets[i]||(this.childOffsets[i]=this.nodeCount);const o=n-1,a=e[o];let s=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const n=2*t+this._siblingOffset[e][0],i=2*r+this._siblingOffset[e][1],o=a.getElevation(n,i),c=a.isLeaf(n,i),u=this._addNode(o.min,o.max,c);c&&(s|=1<<e),l||(l=u)}for(let n=0;n<this._siblingOffset.length;n++)s&1<<n||this._construct(e,2*t+this._siblingOffset[n][0],2*r+this._siblingOffset[n][1],o,l+n)}}function Xx(e,t,r,n,i,o){return fr(fr(e,r,o),fr(t,n,o),i)}function Kx(e,t,r){const n=r.dim,i=De(e*n-.5,0,n-1),o=De(t*n-.5,0,n-1),a=Math.floor(i),s=Math.floor(o),l=Math.min(a+1,n-1),c=Math.min(s+1,n-1);return Xx(r.get(a,s),r.get(l,s),r.get(a,c),r.get(l,c),i-a,o-s)}const Jx={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Qx(e,t,r){return(256*e*256+256*t+r)/10-1e4}function ew(e,t,r){return 256*e+t+r/256-32768}class tw{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,r,n=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return void Ze(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const i=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let e=0;e<i;e++)o[this._idx(-1,e)]=o[this._idx(0,e)],o[this._idx(i,e)]=o[this._idx(i-1,e)],o[this._idx(e,-1)]=o[this._idx(e,0)],o[this._idx(e,i)]=o[this._idx(e,i-1)];o[this._idx(-1,-1)]=o[this._idx(0,0)],o[this._idx(i,-1)]=o[this._idx(i-1,0)],o[this._idx(-1,i)]=o[this._idx(0,i-1)],o[this._idx(i,i)]=o[this._idx(i-1,i-1)]}const a="terrarium"===r?ew:Qx;for(let e=0;e<o.length;++e){const t=4*e;this.floatView[e]=a(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=yt.now()}_buildQuadTree(){this._tree=new Yx(this)}get(e,t,r=!1){r&&(e=De(e,-1,this.dim),t=De(t,-1,this.dim));const n=this._idx(e,t);return this.floatView[n]}set(e,t,r){const n=this._idx(e,t),i=this.floatView[n];return this.floatView[n]=r,r-i}static getUnpackVector(e){return Jx[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const r=[0,0,0,0],n=tw.getUnpackVector(t);let i=Math.floor((e+n[3])/n[2]);return r[2]=i%256,i=Math.floor(i/256),r[1]=i%256,i=Math.floor(i/256),r[0]=i,r}getPixels(){return new Wd({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}const s=-t*this.dim,l=-r*this.dim;for(let t=o;t<a;t++)for(let r=n;r<i;r++){const n=4*this._idx(r,t),i=4*this._idx(r+s,t+l);this.pixels[n+0]=e.pixels[i+0],this.pixels[n+1]=e.pixels[i+1],this.pixels[n+2]=e.pixels[i+2],this.pixels[n+3]=e.pixels[i+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}function rw(e,t,r){1===e?t.headerLength=r.readFixed32():2===e?t.x=r.readVarint():3===e?t.y=r.readVarint():4===e?t.z=r.readVarint():5===e&&t.layers.push(function(e,t){return e.readFields(sw,{version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]},t)}(r,r.readVarint()+r.pos))}function nw(e,t,r){1===e?(t.delta_filter=function(e,t){return e.readFields(iw,{blockSize:0},t)}(r,r.readVarint()+r.pos),t.filter="delta_filter"):2===e?(r.readVarint(),t.filter="zigzag_filter"):3===e?(r.readVarint(),t.filter="bitshuffle_filter"):4===e&&(r.readVarint(),t.filter="byteshuffle_filter")}function iw(e,t,r){1===e&&(t.blockSize=r.readVarint())}function ow(e,t,r){1===e?(r.readVarint(),t.codec="gzip_data"):2===e?(r.readVarint(),t.codec="jpeg_image"):3===e?(r.readVarint(),t.codec="webp_image"):4===e&&(r.readVarint(),t.codec="png_image")}function aw(e,t,r){let n=0,i=0;1===e?t.firstByte=r.readFixed64():2===e?t.lastByte=r.readFixed64():3===e?t.filters.push(function(e,t){return e.readFields(nw,{},t)}(r,r.readVarint()+r.pos)):4===e?t.codec=function(e,t){return e.readFields(ow,{},t)}(r,r.readVarint()+r.pos):5===e?i=r.readFloat():6===e?n=r.readFloat():7===e?t.bands.push(r.readString()):8===e?t.offset=r.readDouble():9===e&&(t.scale=r.readDouble()),0===t.offset&&(t.offset=i),0===t.scale&&(t.scale=n)}function sw(e,t,r){1===e?t.version=r.readVarint():2===e?t.name=r.readString():3===e?t.units=r.readString():4===e?t.tileSize=r.readVarint():5===e?t.buffer=r.readVarint():6===e?t.pixelFormat=r.readVarint():7===e&&t.dataIndex.push(function(e,t){return e.readFields(aw,{firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},t)}(r,r.readVarint()+r.pos))}function lw(e,t,r){if(2===e)!function(e,t,r){e.readFields(cw,r,t)}(r,r.readVarint()+r.pos,t);else if(3===e)throw new Error("Not implemented")}function cw(e,t,r){if(1===e){let e=0;const n=r.readVarint()+r.pos;for(;r.pos<n;)t[e++]=r.readVarint()}}function uw(e,t){if(4!==t.length)throw new Error(`Expected data of dimension 4 but got ${t.length}.`);let r=t[3];for(let n=2;n>=1;n--){const i=1===n?1:0,o=2===n?1:0;for(let n=0;n<t[0];n++){const a=t[1]*n;for(let n=i;n<t[1];n++){const i=t[2]*(n+a);for(let n=o;n<t[2];n++){const o=t[3]*(n+i);for(let n=0;n<t[3];n++){const t=o+n;e[t]+=e[t-r]}}}}r*=t[n]}return e}function dw(e){for(let t=0,r=e.length;t<r;t++)e[t]=e[t]>>>1^-(1&e[t]);return e}function hw(e,t){switch(t){case"uint32":return e;case"uint16":for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];e[t]=(240&r)>>4|(61440&r)>>8|(240&n)<<4|61440&n,e[t+1]=15&r|(3840&r)>>4|(15&n)<<8|(3840&n)<<4}return e;case"uint8":for(let t=0;t<e.length;t+=4){const r=e[t],n=e[t+1],i=e[t+2],o=e[t+3];e[t+0]=(192&r)>>6|(192&n)>>4|(192&i)>>2|192&o,e[t+1]=(48&r)>>4|(48&n)>>2|48&i|(48&o)<<2,e[t+2]=(12&r)>>2|12&n|(12&i)<<2|(12&o)<<4,e[t+3]=3&r|(3&n)<<2|(3&i)<<4|(3&o)<<6}return e;default:throw new Error(`Invalid pixel format, "${t}"`)}}ea(tw,"DEMData"),ea(Yx,"DemMinMaxQuadTree",{omit:["dem"]});var fw=Uint8Array,pw=Uint16Array,gw=Int32Array,mw=new fw([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),yw=new fw([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_w=new fw([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vw=function(e,t){for(var r=new pw(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new gw(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},bw=vw(mw,2),xw=bw.b,ww=bw.r;xw[28]=258,ww[258]=28;for(var Sw=vw(yw,0).b,kw=new pw(32768),Tw=0;Tw<32768;++Tw){var Iw=(43690&Tw)>>1|(21845&Tw)<<1;kw[Tw]=((65280&(Iw=(61680&(Iw=(52428&Iw)>>2|(13107&Iw)<<2))>>4|(3855&Iw)<<4))>>8|(255&Iw)<<8)>>1}var Mw=function(e,t,r){for(var n=e.length,i=0,o=new pw(t);i<n;++i)e[i]&&++o[e[i]-1];var a,s=new pw(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;a=new pw(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)a[kw[d]>>l]=c;return a},Ew=new fw(288);for(Tw=0;Tw<144;++Tw)Ew[Tw]=8;for(Tw=144;Tw<256;++Tw)Ew[Tw]=9;for(Tw=256;Tw<280;++Tw)Ew[Tw]=7;for(Tw=280;Tw<288;++Tw)Ew[Tw]=8;var Pw=new fw(32);for(Tw=0;Tw<32;++Tw)Pw[Tw]=5;var Aw=Mw(Ew,9),Cw=Mw(Pw,5),Rw=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Lw=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},Ow=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},Dw=function(e){return(e+7)/8|0}
1,zw=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Fw=function(e,t,r){var n=new Error(t||zw[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Fw),!r)throw n;return n},Nw=new fw(0),Bw="undefined"!=typeof TextDecoder&&new TextDecoder;try{Bw.decode(Nw,{stream:!0})}catch(e){}const jw={gzip_data:"gzip"};class Vw extends Error{constructor(e){super(e),this.name="MRTError"}}const Gw={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},Uw={uint32:1,uint16:2,uint8:4},$w={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let Hw;class qw{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const t=this.layers[e];if(!t)throw new Vw(`Layer '${e}' not found`);return t}getHeaderLength(e){const t=new Uint8Array(e),r=new DataView(e);if(13!==t[0])throw new Vw("File is not a valid MRT.");return r.getUint32(1,!0)}parseHeader(e){const t=new Uint8Array(e),r=this.getHeaderLength(e);if(t.length<r)throw new Vw(`Expected header with length >= ${r} but got buffer of length ${t.length}`);const n=new Hw(t.subarray(0,r)).readFields(rw,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0);if(!isNaN(this.x)&&(this.x!==n.x||this.y!==n.y||this.z!==n.z))throw new Vw(`Invalid attempt to parse header ${n.z}/${n.x}/${n.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=n.x,this.y=n.y,this.z=n.z;for(const e of n.layers)this.layers[e.name]=new Ww(e,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const t=[],r=this.getLayer(e.layerName);for(let n of e.blockIndices){const i=r.dataIndex[n],o=i.firstByte-e.firstByte,a=i.lastByte-e.firstByte;if(r._blocksInProgress.has(n))continue;const s={layerName:r.name,firstByte:o,lastByte:a,pixelFormat:r.pixelFormat,blockIndex:n,blockShape:[i.bands.length].concat(r.bandShape),buffer:r.buffer,codec:i.codec.codec,filters:i.filters.map((e=>e.filter))};r._blocksInProgress.add(n),t.push(s)}return new Zw(t,(()=>{t.forEach((e=>r._blocksInProgress.delete(e.blockIndex)))}),((e,n)=>{if(t.forEach((e=>r._blocksInProgress.delete(e.blockIndex))),e)throw e;n.forEach((e=>{this.getLayer(e.layerName).processDecodedData(e)}))}))}}class Ww{constructor({version:e,name:t,units:r,tileSize:n,pixelFormat:i,buffer:o,dataIndex:a},s){if(this.version=e,1!==this.version)throw new Vw(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=t,this.units=r,this.tileSize=n,this.buffer=o,this.pixelFormat=Gw[i],this.dataIndex=a,this.bandShape=[n+2*o,n+2*o,Uw[this.pixelFormat]],this._decodedBlocks=new Gx(s?s.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return Uw[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map((({bands:e})=>e)).flat()}processDecodedData(e){const t=e.blockIndex.toString();this._decodedBlocks.get(t)||this._decodedBlocks.put(t,e.data)}getBlockForBand(e){let t=0;switch(typeof e){case"string":for(const[r,n]of this.dataIndex.entries()){for(const[i,o]of n.bands.entries())if(o===e)return{bandIndex:t+i,blockIndex:r,blockBandIndex:i};t+=n.bands.length}break;case"number":for(const[r,n]of this.dataIndex.entries()){if(e>=t&&e<t+n.bands.length)return{bandIndex:e,blockIndex:r,blockBandIndex:e-t};t+=n.bands.length}break;default:throw new Vw(`Invalid band \`${JSON.stringify(e)}\`. Expected string or integer.`)}return{blockIndex:-1,blockBandIndex:-1}}getDataRange(e){let t=1/0,r=-1/0;const n=[],i=new Set;for(const o of e){const{blockIndex:e}=this.getBlockForBand(o);if(e<0)throw new Vw(`Invalid band: ${JSON.stringify(o)}`);const a=this.dataIndex[e];n.includes(e)||n.push(e),i.add(e),t=Math.min(t,a.firstByte),r=Math.max(r,a.lastByte)}if(i.size>this.cacheSize)throw new Vw(`Number of blocks to decode (${i.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:t,lastByte:r,blockIndices:n}}hasBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0}hasDataForBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0&&!!this._decodedBlocks.get(t.toString())}getBandView(e){const{blockIndex:t,blockBandIndex:r}=this.getBlockForBand(e);if(t<0)throw new Vw(`Band not found: ${JSON.stringify(e)}`);const n=this._decodedBlocks.get(t.toString());if(!n)throw new Vw(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const i=this.dataIndex[t],o=this.bandShape.reduce(((e,t)=>e*t),1),a=r*o,s=n.subarray(a,a+o);return{data:s,bytes:new Uint8Array(s.buffer).subarray(s.byteOffset,s.byteOffset+s.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:i.offset,scale:i.scale}}}qw.setPbf=function(e){Hw=e};class Zw{constructor(e,t,r){this.tasks=e,this._onCancel=t,this._onComplete=r,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,t){this._finalized||(this._onComplete(e,t),this._finalized=!0)}}
vendor: 3,967 bytes, line 1
1qw.performDecoding=function(e,t){const r=new Uint8Array(e);return Promise.all(t.tasks.map((e=>{const{layerName:t,firstByte:n,lastByte:i,pixelFormat:o,blockShape:a,blockIndex:s,filters:l,codec:c}=e,u=r.subarray(n,i+1),d=new Uint32Array(a[0]*a[1]*a[2]);let h;if("gzip_data"!==c)throw new Vw(`Unhandled codec: ${c}`);return h=function(e,t){if(!globalThis.DecompressionStream&&"gzip_data"===t)return Promise.resolve((a=function(e){31==e[0]&&139==e[1]&&8==e[2]||Fw(6,"invalid gzip data");var t=e[3],r=10;4&t&&(r+=2+(e[10]|e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(2&t)}(r=e),a+8>r.length&&Fw(6,"invalid gzip data"),function(e,t,r,n){var i=e.length;if(!i||t.f&&!t.l)return r||new fw(0);var o=!r,a=o||2!=t.i,s=t.i;o&&(r=new fw(3*i));var l=function(e){var t=r.length;if(e>t){var n=new fw(Math.max(2*t,e));n.set(r),r=n}},c=t.f||0,u=t.p||0,d=t.b||0,h=t.l,f=t.d,p=t.m,g=t.n,m=8*i;do{if(!h){c=Lw(e,u,1);var y=Lw(e,u+1,3);if(u+=3,!y){var _=e[(P=Dw(u)+4)-4]|e[P-3]<<8,v=P+_;if(v>i){s&&Fw(0);break}a&&l(d+_),r.set(e.subarray(P,v),d),t.b=d+=_,t.p=u=8*v,t.f=c;continue}if(1==y)h=Aw,f=Cw,p=9,g=5;else if(2==y){var b=Lw(e,u,31)+257,x=Lw(e,u+10,15)+4,w=b+Lw(e,u+5,31)+1;u+=14;for(var S=new fw(w),k=new fw(19),T=0;T<x;++T)k[_w[T]]=Lw(e,u+3*T,7);u+=3*x;var I=Rw(k),M=(1<<I)-1,E=Mw(k,I);for(T=0;T<w;){var P,A=E[Lw(e,u,M)];if(u+=15&A,(P=A>>4)<16)S[T++]=P;else{var C=0,R=0;for(16==P?(R=3+Lw(e,u,3),u+=2,C=S[T-1]):17==P?(R=3+Lw(e,u,7),u+=3):18==P&&(R=11+Lw(e,u,127),u+=7);R--;)S[T++]=C}}var L=S.subarray(0,b),O=S.subarray(b);p=Rw(L),g=Rw(O),h=Mw(L,p),f=Mw(O,g)}else Fw(1);if(u>m){s&&Fw(0);break}}a&&l(d+131072);for(var D=(1<<p)-1,z=(1<<g)-1,F=u;;F=u){var N=(C=h[Ow(e,u)&D])>>4;if((u+=15&C)>m){s&&Fw(0);break}if(C||Fw(2),N<256)r[d++]=N;else{if(256==N){F=u,h=null;break}var B=N-254;N>264&&(B=Lw(e,u,(1<<(G=mw[T=N-257]))-1)+xw[T],u+=G);var j=f[Ow(e,u)&z],V=j>>4;if(j||Fw(3),u+=15&j,O=Sw[V],V>3){var G=yw[V];O+=Ow(e,u)&(1<<G)-1,u+=G}if(u>m){s&&Fw(0);break}a&&l(d+131072);var U=d+B;if(d<O){var $=0-O,H=Math.min(O,U);for($+d<0&&Fw(3);d<H;++d)r[d]=n[$+d]}for(;d<U;++d)r[d]=r[d-O]}}t.l=h,t.p=F,t.b=d,t.f=c,h&&(c=1,t.m=p,t.d=f,t.n=g)}while(!c);return d!=r.length&&o?function(e,t,r){return(null==r||r>e.length)&&(r=e.length),new fw(e.subarray(0,r))}(r,0,d):r.subarray(0,d)}(r.subarray(a,-8),{i:2},new fw(((i=r)[(o=i.length)-4]|i[o-3]<<8|i[o-2]<<16|i[o-1]<<24)>>>0),n)));var r,n,i,o,a;const s=jw[t];if(!s)throw new Error(`Unhandled codec: ${t}`);const l=new globalThis.DecompressionStream(s);return new Response(new Blob([e]).stream().pipeThrough(l)).arrayBuffer().then((e=>new Uint8Array(e)))}(u,c).then((e=>(function(e,t){e.readFields(lw,t)}(new Hw(e),d),new(0,$w[o])(d.buffer)))),h.then((e=>{for(let t=l.length-1;t>=0;t--)switch(l[t]){case"delta_filter":uw(e,a);break;case"zigzag_filter":dw(e);break;case"bitshuffle_filter":hw(e,o);break;default:throw new Vw(`Unhandled filter "${l[t]}"`)}return{layerName:t,blockIndex:s,data:e}})).catch((e=>{throw e}))})))},ea(Zw,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),ea(qw,"MapboxRasterTile"),ea(Ww,"MapboxRasterLayer",{omit:["_blocksInProgress"]});class Yw{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}class Xw{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Jo(Gn,16,0),this.featureIndexArray=new Rl,this.promoteId=t,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(e,t,r,n,i,o=0,a=0){const s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i,o);const l=this.grid;for(let e=0;e<t.length;e++){const r=t[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){const t=r[e];n[0]=Math.min(n[0],t.x),n[1]=Math.min(n[1],t.y),n[2]=Math.max(n[2],t.x),n[3]=Math.max(n[3],t.y)}0!==a&&(n[0]-=a,n[1]-=a,n[2]+=a,n[3]+=a),n[0]<Gn&&n[1]<Gn&&n[2]>=0&&n[3]>
vendor: 4,181 bytes, line 1
1=0&&l.insert(s,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new iu(new Ry(this.rawTileData)).layers,this.sourceLayerCoder=new Yw(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t){const{tilespaceGeometry:r,transform:n,tileTransform:i,pixelPosMatrix:o,availableImages:a,worldview:s}=t;this.loadVTLayers(),this.serializedLayersCache.clear();const l=t.queryRadius?t.queryRadius:0,c=r.bufferedTilespaceBounds,u=this.grid.query(c.min.x,c.min.y,c.max.x,c.max.y,((e,t,n,i)=>Bu(r.bufferedTilespaceGeometry,e-l,t-l,n+l,i+l)));u.sort(Jw);let d=null;n.elevation&&u.length>0&&(d=zb.create(n.elevation,this.tileID));const h={};let f;for(let l=0;l<u.length;l++){const c=u[l];if(c===f)continue;f=c;const p=this.featureIndexArray.get(c);let g=null;this.is3DTile?this.loadMatchingModelFeature(h,p,e,r,n,s):this.loadMatchingFeature(h,p,e,a,s,((e,a,s,l=0)=>(g||(g=Kc(e,this.tileID.canonical,i)),a.queryIntersectsFeature(r,e,s,g,this.z,n,o,d,l,t.scope))))}return h}loadMatchingFeature(e,t,r,n,i,o){const{featureIndex:a,bucketIndex:s,sourceLayerIndex:l,layoutVertexArrayOffset:c}=t,u=this.bucketLayerIDs[s],d=r.layers,h=Object.keys(d);if(h.length&&!qe(h,u))return;const f=r.sourceCache,p=this.sourceLayerCoder.decode(l),g=this.vtLayers[p].feature(a),m=this.getId(g,p);for(let t=0;t<u.length;t++){const r=u[t];if(!d[r])continue;const{styleLayer:s,targets:l}=d[r];let h={};void 0!==m&&(h=f.getFeatureState(s.sourceLayer,m));const p=!o||o(g,s,h,c);if(!p)continue;const y=new Zb(g,this.z,this.x,this.y,m);y.tile=this.tileID.canonical,y.state=h;let _=this.serializedLayersCache.get(r);_||(_=s.serialize(),_.id=r,this.serializedLayersCache.set(r,_)),y.source=_.source,y.sourceLayer=_["source-layer"],y.layer=Object.assign({},_),y.layer.paint=Kw(_.paint,s.paint,g,h,n),y.layer.layout=Kw(_.layout,s.layout,g,h,n);let v=!1;for(const e of l){this.updateFeatureProperties(y,e);const{filter:t}=e;if(t)if(g.properties=y.properties,t.needGeometry){const e=Jc(g,!0);if(!t.filter(new Ja(this.tileID.overscaledZ,{worldview:i}),e,this.tileID.canonical))continue}else if(!t.filter(new Ja(this.tileID.overscaledZ,{worldview:i}),g))continue;v=!0,e.targetId&&this.addFeatureVariant(y,e)}v&&this.appendToResult(e,r,a,y,p)}}loadMatchingModelFeature(e,t,r,n,i,o){const{featureIndex:a,bucketIndex:s}=t,l=this.bucketLayerIDs[s],c=r.layers,u=Object.keys(c);if(!u.length||qe(u,l))for(let t=0;t<l.length;t++){const s=l[t],{styleLayer:u,targets:d}=c[s];if("model"!==u.type)continue;const h=n.tile,f=h.getBucket(u);if(!(f&&f instanceof Ub))continue;const p=Kb(f,a,n,i);if(!p)continue;const{z:g,x:m,y}=h.tileID.canonical,{feature:_,intersectionZ:v,position:b}=p;let x={};void 0!==_.id&&(x=r.sourceCache.getFeatureState(u.sourceLayer,_.id));const w=new Zb({},g,m,y,_.id);w.tile=this.tileID.canonical,w.state=x,w.properties=_.properties,w.geometry={type:"Point",coordinates:[b.lng,b.lat]};let S=this.serializedLayersCache.get(s);S||(S=u.serialize(),S.id=s,this.serializedLayersCache.set(s,S)),w.source=S.source,w.sourceLayer=S["source-layer"],w.layer=Object.assign({},S);let k=!1;for(const e of d){this.updateFeatureProperties(w,e);const{filter:t}=e;if(t)if(_.properties=w.properties,t.needGeometry){if(!t.filter(new Ja(this.tileID.overscaledZ,{worldview:o}),_,this.tileID.canonical))continue}else if(!t.filter(new Ja(this.tileID.overscaledZ,{worldview:o}),_))continue;k=!0,e.targetId&&this.addFeatureVariant(w,e)}k&&this.appendToResult(e,s,a,w,v)}}updateFeatureProperties(e,t,r){if(t.properties){const n={};for(const i in t.properties){const o=t.properties[i].evaluate({zoom:this.z},e._vectorTileFeature,e.state,e.tile,r);null!=o&&(n[i]=o)}e.properties=n}}addFeatureVariant(e,t,r){const n={target:t.target,namespace:t.namespace,uniqueFeatureID:t.uniqueFeatureID};t.properties&&(n.properties=e.properties),e.variants=e.variants||{},e.variants[t.targetId]=e.variants[t.targetId]||[],e.variants[t.targetId].push(n)}appendToResult(e,t,r,n,i){let o=e[t];void 0===o&&(o=e[t]=[]),o.push({featureIndex:r,feature:n,intersectionZ:i})}lookupSymbolFeatures(e,t,r,n,i,o){const a={};this.loadVTLayers();
1for(const s of e)this.loadMatchingFeature(a,{bucketIndex:t,sourceLayerIndex:r,featureIndex:s,layoutVertexArrayOffset:0},n,i,o);return a}loadFeature(e){const{featureIndex:t,sourceLayerIndex:r}=e;this.loadVTLayers();const n=this.sourceLayerCoder.decode(r),i=this.vtFeatures[n];if(i[t])return i[t];const o=this.vtLayers[n].feature(t);return i[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){const n=Array.isArray(this.promoteId)||"object"!=typeof this.promoteId?this.promoteId:this.promoteId[t];if(null!=n)if(Array.isArray(n)){if(!this.promoteIdExpression){const e=Uo(n);if("success"!==e.result)return void Ze(`Failed to create expression for promoteId: ${e.value.map((e=>`${e.key}: ${e.message}`)).join(", ")}`);this.promoteIdExpression=e.value}r=this.promoteIdExpression.evaluate({zoom:0},e)}else r=e.properties[n];"boolean"==typeof r&&(r=Number(r))}return r}}function Kw(e,t,r,n,i){return Ue(e,((e,o)=>{const a=t instanceof as?t.get(o):null;return a&&a.evaluate?a.evaluate(r,n,void 0,i):a}))}function Jw(e,t){return t-e}ea(Xw,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const Qw=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class eS{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const n=r>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=Qw[15&r];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new eS(a,o,i,e)}constructor(e,t=64,r=Float64Array,n){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=Qw.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return tS(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=a){for(let a=d;a<=u;a++){const s=o[2*a],c=o[2*a+1];s>=e&&s<=r&&c>=t&&c<=n&&l.push(i[a])}continue}const h=d+u>>1,f=o[2*h],p=o[2*h+1];f>=e&&f<=r&&p>=t&&p<=n&&l.push(i[h]),(0===c?e<=f:t<=p)&&(s.push(d),s.push(h-1),s.push(1-c)),(0===c?r>=f:n>=p)&&(s.push(h+1),s.push(u),s.push(1-c))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:o}=this,a=[0,n.length-1,0],s=[],l=r*r;for(;a.length;){const c=a.pop()||0,u=a.pop()||0,d=a.pop()||0;if(u-d<=o){for(let r=d;r<=u;r++)oS(i[2*r],i[2*r+1],e,t)<=l&&s.push(n[r]);continue}const h=d+u>>1,f=i[2*h],p=i[2*h+1];oS(f,p,e,t)<=l&&s.push(n[h]),(0===c?e-r<=f:t-r<=p)&&(a.push(d),a.push(h-1),a.push(1-c)),(0===c?e+r>=f:t+r>=p)&&(a.push(h+1),a.push(u),a.push(1-c))}return s}}function tS(e,t,r,n,i,o){if(i-n<=r)return;const a=n+i>>1;rS(e,t,a,n,i,o),tS(e,t,r,n,a-1,1-o),tS(e,t,r,a+1,i,1-o)}function rS(e,t,r,n,i,o){for(;i>n;){if(i-n>600){const a=i-n+1,s=r-n+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/
1a)*(s-a/2<0?-1:1);rS(e,t,r,Math.max(n,Math.floor(r-s*c/a+u)),Math.min(i,Math.floor(r+(a-s)*c/a+u)),o)}const a=t[2*r+o];let s=n,l=i;for(nS(e,t,n,r),t[2*i+o]>a&&nS(e,t,n,i);s<l;){for(nS(e,t,s,l),s++,l--;t[2*s+o]<a;)s++;for(;t[2*l+o]>a;)l--}t[2*n+o]===a?nS(e,t,n,l):(l++,nS(e,t,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function nS(e,t,r,n){iS(e,r,n),iS(t,2*r,2*n),iS(t,2*r+1,2*n+1)}function iS(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function oS(e,t,r,n){const i=e-r,o=t-n;return i*i+o*o}e.$=en,e.A=Nr,e.B=Es,e.C=2,e.D=Zp,e.E=ir,e.F=T_,e.G=k_,e.H=Kr,e.I=or,e.J=hs,e.K=Xr,e.L=Qr,e.M=Ro,e.N=Po,e.O=Co,e.P=Te,e.Q=Go,e.R=zt,e.S=fs,e.T=zg,e.U=Uo,e.V=Pb,e.W=qo,e.X=vi,e.Y=yi,e.Z=_i,e._=an,e.a=function(e){return st.API_CDN_URL_REGEX.test(e)},e.a$=zc,e.a0=Jr,e.a1=lr,e.a2=ps,e.a3=class extends Pb{},e.a4=Lo,e.a5=Ao,e.a6=ds,e.a7=function(e){const t=e.value;return t?Jr(t)?Ab(t,!0)?[]:[new Pb(e.key,t,`invalid url "${t}"`)]:[new Pb(e.key,t,`string expected, "${Xr(t)}" found`)]:[]},e.a8=ts,e.a9=us,e.aA=De,e.aB=d,e.aC=ee,e.aD=bc,e.aE=Nu,e.aF=Rc,e.aG=Hc,e.aH=function(e,t){const r={};for(let n=0;n<t.length;n++){const i=t[n];i in e&&(r[i]=e[i])}return r},e.aI=Ac,e.aJ=Lc,e.aK=class{constructor(e){this.entries={},this.scheduler=e}request(e,t,r,n){const i=this.entries[e]=this.entries[e]||{callbacks:[]};if(i.result){const[e,r]=i.result;return this.scheduler?this.scheduler.add((()=>{n(e,r)}),t):n(e,r),()=>{}}return i.callbacks.push(n),i.cancel||(i.cancel=r(((r,n)=>{i.result=[r,n];for(const e of i.callbacks)this.scheduler?this.scheduler.add((()=>{e(r,n)}),t):e(r,n);setTimeout((()=>delete this.entries[e]),3e3)}))),()=>{i.result||(i.callbacks=i.callbacks.filter((e=>e!==n)),i.callbacks.length||(i.cancel(),delete this.entries[e]))}}},e.aL=function(e,t,r){const n=JSON.stringify(e.request);return e.data&&(this.deduped.entries[n]={result:[null,e.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},(t=>{const n=jt(e.request,((e,n,i)=>{e?t(e):n&&t(null,{rawData:n,vectorTile:r?void 0:new iu(new Ry(n)),responseHeaders:new Map(i.entries())})}));return()=>{n.cancel(),t()}}),t)}
1,e.aM=function(e){return e?{cacheControl:e.get("Cache-Control"),expires:e.get("Expires")}:{cacheControl:void 0,expires:void 0}},e.aN=Ft,e.aO=function(e){Et++,Et>wt&&(e.getActor().send("enforceCacheSizeLimit",xt),Et=0)},e.aP=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log2(e)))},e.aQ=Ju,e.aR=vb,e.aS=Tb,e.aT=Pc,e.aU=yb,e.aV=function(e,t){const r=document.createElement("video");r.muted=!0,r.onloadstart=function(){t(null,r)};for(let t=0;t<e.length;t++){const n=document.createElement("source");Vt(e[t])||(r.crossOrigin="Anonymous"),n.src=e[t],r.appendChild(n)}return{cancel:()=>{}}},e.aW=Fg,e.aX=Yb,e.aY=Ge,e.aZ=wv,e.a_=Dc,e.aa=ss,e.ab=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return Ke(e.expression.evaluate(t))}interpolate(e,t,r){return{x:fr(e.x,t.x,r),y:fr(e.y,t.y,r),z:fr(e.z,t.z,r),azimuthal:fr(e.azimuthal,t.azimuthal,r),polar:fr(e.polar,t.polar,r)}}},e.ac=Ja,e.ad=Ho,e.ae=Uc,e.af=G,e.ag=k,e.ah=ze,e.ai=as,e.aj=kd,e.ak=fr,e.al=Gn,e.am=pr,e.an=Pe,e.ao=cr,e.ap=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return function([e,t]){const r=Ke([1,e,t]);return{x:r.x,y:r.y,z:r.z}}(e.expression.evaluate(t))}interpolate(e,t,r){return{x:fr(e.x,t.x,r),y:fr(e.y,t.y,r),z:fr(e.z,t.z,r)}}},e.aq=function(e,t,r=0,n=!0){const i=new Te(r,r),o=e.sub(i),a=t.add(i),s=[o,new Te(a.x,o.y),a,new Te(o.x,a.y)];return n&&s.push(o.clone()),s},e.ar=function(e,t){const r=[];for(let n=0;n<e.length;n++){const i=Fe(n-1,-1,e.length-1),o=Fe(n+1,-1,e.length-1),a=e[n],s=e[o],l=e[i].sub(a).unit(),c=s.sub(a).unit(),u=c.angleWithSep(l.x,l.y),d=l.add(c).unit().mult(-1*t/Math.sin(u/2));
1r.push(a.add(d))}return r},e.as=Sv,e.at=Bu,e.au=function(e,t,r=0){return T(((t.x-r)*e.scale-e.x)*Gn,(t.y*e.scale-e.y)*Gn,Fc(t.z,t.y))},e.av=W,e.aw=N,e.ax=pu,e.ay=ny,e.az=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const o of e)t=Math.min(t,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);return{min:new Te(t,r),max:new Te(n,i)}},e.b=function(e){return st.API_FONTS_REGEX.test(e)},e.b$=Wf,e.b0=ll,e.b1=Us,e.b2=je,e.b3=kl,e.b4=tb,e.b5=function(){Ka.isLoading()||Ka.isLoaded()||"deferred"!==Ya()||Xa()},e.b6=gs,e.b7=Jc,e.b8=Zb,e.b9=Qe,e.bA=c,e.bB=m,e.bC=s,e.bD=function(e,t){const{x:r,y:n}=e.point,i=Sd(r,n,e.worldSize/e._pixelsPerMercatorPixel,0,0);return d(i,i,bd(ud(t)))},e.bE=n,e.bF=H,e.bG=O,e.bH=L,e.bI=j,e.bJ=B,e.bK=g_,e.bL=Wy,e.bM=p_,e.bN=function(e,t,r,n,i){const o=5*t+2;e.float32[o+0]=r,e.float32[o+1]=n,e.float32[o+2]=i},e.bO=Kv,e.bP=de,e.bQ=ge,e.bR=fe,e.bS=xe,e.bT=Fe,e.bU=function(e,t,n,i){var o=new r(4);return o[0]=e,o[1]=t,o[2]=n,o[3]=i,o},e.bV=class{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const r=t.getSource().maxzoom,n=1<<r,i=Math.floor(e.x),o=Math.floor((e.x-i)*n),a=Math.floor(e.y*n),s=this.findDEMTileFor(new Ju(r,i,r,o,a));return!(!s||!s.dem)}getAtPointOrZero(e,t=0){return this.getAtPoint(e,t)||0}getAtPoint(e,t,r=!0){if(this.isUsingMockSource())return null;null==t&&(t=null);const n=this._source();if(!n)return t;if(e.y<0||e.y>1)return t;const i=n.getSource().maxzoom,o=1<<i,a=Math.floor(e.x),s=e.x-a,l=new Ju(i,a,i,Math.floor(s*o),Math.floor(e.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return t;const u=c.dem,d=1<<c.tileID.canonical.z,h=(s*d-c.tileID.canonical.x)*u.dim,f=(e.y*d-c.tileID.canonical.y)*u.dim,p=Math.floor(h),g=Math.floor(f);return(r?this.exaggeration():1)*fr(fr(u.get(p,g),u.get(p,g+1),f-g),fr(u.get(p+1,g),u.get(p+1,g+1),f-g),h-p)}static getAtTileOffset(e,t,r,n){const i=1<<e.canonical.z;return n?n.pointElevation(t):r?r.getAtPointOrZero(new Uc(e.wrap+(e.canonical.x+t.x/Gn)/i,(e.canonical.y+t.y/Gn)/i)):0}static getAtTileOffsetFunc(e,t,r,n){return(i,o,a)=>{const s=this.getAtTileOffset(e,i,o,a),l=n.upVector(e.canonical,i.x,i.y);return R(l,l,s*n.upVectorScale(e.canonical,t,r).metersToTile),l}}getForTilePoints(e,t,r,n){if(this.isUsingMockSource())return!1;const i=zb.create(this,e,n);return!!i&&(t.forEach((e=>{e[2]=this.exaggeration()*i.getElevationAt(e[0],e[1],r)})),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const r=t.dem.tree,n=t.tileID,i=1<<e.canonical.z-n.canonical.z;let o=e.canonical.x/i-n.canonical.x,a=e.canonical.y/i-n.canonical.y,s=0;for(let t=0;t<e.canonical.z-n.canonical.z&&!r.leaves[s];t++){o*=2,a*=2;const e=2*Math.floor(a)+Math.floor(o);s=r.childOffsets[s]+e,o%=1,a%=1}return{min:this.exaggeration()*r.minimums[s],max:this.exaggeration()*r.maximums[s]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(e,t,r){throw new Error("Pure virtual method called.")}pointCoordinate(e){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(e){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const e=this.visibleDemTiles;if(0===e.length)return null;let t=!1,r=Number.MAX_VALUE,n=Number.MIN_VALUE;for(const i of e){const e=this.getMinMaxForTile(i.tileID);e&&(r=Math.min(r,e.min),n=Math.max(n,e.max),t=!0)}return t?{min:r,max:n}:null}},e.bW=Lp,e.bX=Mu,e.bY=ky,e.bZ=Nf,e.b_=Eb,e.ba=Qm,e.bb=bf,e.bc=Kc,e.bd=Vs,e.be=_l,e.bf=id,e.bg=Bl,e.bh=Qd,e.bi=fb,e.bj=function(e,t){const r=kd(t.zoom);if(0===r)return ud(e);const n=pd(e),i=gd(n),o=Rc(n.getWest())*t.worldSize,a=Rc(n.getEast())*t.worldSize,s=Lc(n.getNorth())*t.worldSize,l=Lc(n.getSouth())*t.worldSize,c=[o,s,0],d=[a,s,0],h=[o,l,0],f=[a,l,0],p=u([],t.globeMatrix);return G(c,c,p),G(d,d,p),G(h,h,p),G(f,f,p),i[0]=dd(i[0],h,r),i[1]=dd(i[1],f,r),i[2]=dd(i[2],d,r),i[3]=dd(i[3],c,r),xu.fromPoints(i)},e.bk=vd,e.bl=u,e.bm=md,e.bn=dd,e.bo=Gs,e.bp=nd,e.bq=y,e.br=h,e.bs=qw,e.bt=Ry,e.bu=jt,e.bv=function(e,t){const r=[];for(const n in e)n in t||r.push(n);return r},e.bw=Ne,e.bx=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.by=Ie,e.bz=l,e.c=ct,e.c$=function(e,t,r){let n=0;for(let r=0;r<2;++r){const i=0;e[r]>i&&(n+=(e[r]-i)*(e[r]-i)),t[r]<i&&(n+=(i-t[r])*(i-t[r]))}return n},e.c0=Zf,e.c1=i_,e.c2=X_,e.c3=cv,e.c4=eS,e.c5=R,e.c6=Y,e.c7=re,e.c8=function(e,t,r){r*=.5;var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+i*s,e[1]=i*l-n*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},e.c9=ne,e.cA=w,e.cB=bu,e.cC=qg,e.cD=Xu,e.cE=fd,e.cF=function(e,t,r,n,i,o,a,s,l){if("globe"===l.name)return fd(e,t,new Xu(r,n,i),!1);const c=wv({z:r,x:n,y:i},l);return new xu([(o+c.x/c.scale)*t,t*(c.y/c.scale),a],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),s])},e.cG=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},e.cH=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},e.cI=function(e){const t=Math.round((e+45+360)%360/90)%4;return Ce[t]},e.cJ=Nc,e.cK=K,e.cL=6,e.cM=function(e){const t=c(new Float64Array(16));d(t,e.pixelMatrix,e.globeMatrix);const r=[0,Sc,0],n=[0,kc,0];return G(r,r,t),G(n,n,t),[r[0]>0&&r[0]<=e.width&&r[1]>0&&r[1]<=e.height&&!Id(e,new Pc(e.center.lat,90)),n[0]>0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Id(e,new Pc(e.center.lat,-90))]},e.cN=function(e,t){const{scale:r}=e.tileTransform,n=r*Gn/(e.tileSize*Math.pow(2,t.zoom-e.tileID.overscaledZ+e.tileID.canonical.z));return function(e,t,r){var n=t[1],i=t[2],o=t[3],a=r[0],s=r[1];return e[0]=t[0]*a,e[1]=n*a,e[2]=i*s,e[3]=o*s,e}(new Float32Array(4),t.inverseAdjustmentMatrix,[n,n])},e.cO=Wg,e.cP=x,e.cQ=Hg,e.cR=function(e){const t=Hg(e,!0);return n([],[t[0],t[1],t[4],t[5]])},e.cS=f,e.cT=gu,e.cU=p,e.cV=function(e){const{x:t,y:r}=e.point,{lng:n,lat:i}=e._center;return Sd(t,r,e.worldSize,n,i)},e.cW=P,e.cX=Ae,e.cY=Qu,e.cZ=ju,e.c_=5,e.ca=tt,e.cb=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},e.cc=b,e.cd=function(e,t,r,n,i){var o=1/Math.tan(t/2);
1if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0){var a=1/(n-i);e[10]=(i+n)*a,e[14]=2*i*n*a}else e[10]=-1,e[14]=-2*n;return e},e.ce=function(e,t,r,n,i,o,a){var s=1/(t-r),l=1/(n-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(a+o)*c,e[15]=1,e},e.cf=Oc,e.cg=function(e,t,r){e[4*t+0]=r[0],e[4*t+1]=r[1],e[4*t+2]=r[2],e[4*t+3]=r[3]},e.ch=Yl,e.ci=Jl,e.cj=Xl,e.ck=Kl,e.cl=rc,e.cm=$v,e.cn=function(){var e=new r(4);return r!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.co=function(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+o*s,e[1]=i*l+a*s,e[2]=n*-s+o*l,e[3]=i*-s+a*l,e},e.cp=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},e.cq=q,e.cr=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)},e.cs=le,e.ct=$,e.cu=Ku,e.cv=3,e.cw=2,e.cx=7,e.cy=6,e.cz=V,e.d=function(e){return st.API_TILEJSON_REGEX.test(e)},e.d$=class{constructor(e,t,r,n){this.context=e,this.format=n,this.size=r,this.texture=e.gl.createTexture();const[i,o,a]=this.size,{gl:s}=e;s.bindTexture(s.TEXTURE_3D,this.texture),e.pixelStoreUnpackFlipY.set(!1),e.pixelStoreUnpack.set(1),e.pixelStoreUnpackPremultiplyAlpha.set(!1),"data"in t&&t.data&&s.texImage3D(s.TEXTURE_3D,0,this.format,i,o,a,0,Og(this.format),Dg(this.format),t.data)}bind(e,t){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_3D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}},e.d0=function(e){return e*e*e*e*e},e.d1=Cc,e.d2=45,e.d3=Ql,e.d4=function(e,t,r){const n=Math.sqrt(e*e+t*t+r*r),i=n>0?Math.acos(r/n)*Ee:0;let o=0!==e||0!==t?Math.atan2(-t,-e)*Ee+90:0;return o<0&&(o+=360),[n,o,i]},e.d5=T,e.d6=Ke,e.d7=Gc,e.d8=M,e.d9=xu,e.dA=function(e){return e({pluginStatus:$a,pluginURL:Ha}),Za.on("pluginStateChange",e),e},e.dB=ec,e.dC=class extends Zl{constructor(e){super(e),this.current=nc}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<9;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix3fv(this.location,!1,r);break}}},e.dD=Re,e.dE=function(e,t,r){const n=kd(r.zoom),i=e.style.map._antialias,o=e.terrain&&e.terrain.exaggeration()>0;return 0===n&&!i&&!o},e.dF=function(e){const t=e.pixelsPerMeter,r=t/Oc(1,e.center.lat),n=c(new Float64Array(16));return h(n,n,[e.point.x,e.point.y,0]),f(n,n,[r,r,t]),Float32Array.from(n)},e.dG=pd,e.dH=function(e){const t=80.051129;e=De(e,-80.051129,t)/t*90;const r=Math.pow(Math.abs(Math.sin(Pe(e))),3);return Math.round(r*(wc.length-1))},e.dI=function(e,t,r,n){const i=t.getNorth(),o=t.getSouth(),s=t.getWest(),l=t.getEast(),c=1<<e.z,u=l-s,d=i-o,h=u/xc,f=-d/wc[r],p=[0,h,0,f,0,0,i,s,0];if(e.z>0){const e=180/n;a(p,p,[e/u+1,0,0,0,e/d+1,0,-.5*e/h,.5*e/f,1])}return p[2]=c,p[5]=e.x,p[8]=e.y,p},e.dJ=ud,e.dK=function(e,t,r){const n=c(new Float64Array(16)),i=(t/(1<<e)-.5)*Math.PI*2;return g(n,r.globeMatrix,i),Float32Array.from(n)},e.dL=Wd,e.dM=od,e.dN=function(e,t){return[Math.pow(e[0],2.2)*t,Math.pow(e[1],2.2)*t,Math.pow(e[2],2.2)*t]},e.dO=i,e.dP=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.dQ=U,e.dR=wd,e.dS=it,e.dT=ot,e.dU=256,e.dV=function(e,t){const r=[0,0,0];return G(r,r,vd(ud(t.canonical))),G(r,r,e),r},e.dW=e=>({u_matrix:new rc(e),u_texsize:new Kl(e),u_pixels_to_tile_units:new oc(e),u_device_pixel_ratio:new Xl(e),u_width_scale:new Xl(e),u_floor_width_scale:new Xl(e),u_image:new Yl(e),u_units_to_pixels:new Kl(e),u_tile_units_to_pixels:new Xl(e),u_alpha_discard_threshold:new Xl(e),u_trim_offset:new Kl(e),u_trim_fade_range:new Kl(e),u_trim_gradient_mix_range:new Kl(e),u_trim_color:new Ql(e),u_zbias_factor:new Xl(e),u_tile_to_meter:new Xl(e),u_ground_shadow_factor:new Jl(e),u_pattern_transition:new Xl(e)}),e.dX=e=>({u_matrix:new rc(e),u_pixels_to_tile_units:new oc(e),u_device_pixel_ratio:new Xl(e),u_width_scale:new Xl(e),u_floor_width_scale:new Xl(e),u_units_to_pixels:new Kl(e),u_dash_image:new Yl(e),u_gradient_image:new Yl(e),u_image_height:new Xl(e),u_texsize:new Kl(e),u_tile_units_to_pixels:new Xl(e),u_alpha_discard_threshold:new Xl(e),u_trim_offset:new Kl(e),u_trim_fade_range:new Kl(e),u_trim_gradient_mix_range:new Kl(e),u_trim_color:new Ql(e),u_zbias_factor:new Xl(e),u_tile_to_meter:new Xl(e),u_ground_shadow_factor:new Jl(e)}),e.dY=e=>({u_camera_to_center_distance:new Xl(e),u_extrude_scale:new oc(e),u_device_pixel_ratio:new Xl(e),u_matrix:new rc(e),u_inv_rot_matrix:new rc(e),u_merc_center:new Kl(e),u_tile_id:new Jl(e),u_zoom_transition:new Xl(e),u_up_dir:new Jl(e),u_emissive_strength:new Xl(e)}),e.dZ=al,e.d_=Sy,e.da=E,e.db=function(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]},e.dc=Lg,e.dd=_m,e.de=im,e.df=Ab,e.dg=function(e,t){return e.readFields(ex,{icons:[]},t)},e.dh=Kp,e.di=R_,e.dj=C_,e.dk=Nt,e.dl=qa,e.dm=vt,e.dn=Qt,e.dp=He,e.dq=function(e){const t=e.indexOf(Ms);return t>=0?e.slice(0,t):e},e.dr=function(e){return e.indexOf(Ms)>=0},e.ds=function(e){const t=e.lastIndexOf(Ms);return t>=0?e.slice(t+1):""},e.dt=function(e){const t=[],r=e.id;return void 0===r&&t.push({message:`layers.${r}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${r}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},e.du=function(e,t,r,n){return"custom"===e.type?new Ib(e,t):new Jb[e.type](e,t,r,n)},e.dv=$e,e.dw=function(e){const t=e.indexOf(Ms);return t>=0?e.slice(t+1):""},e.dx=class extends Zb{constructor(e,t){super(e._vectorTileFeature,e._z,e._x,e._y,e.id),e.state&&(this.state=Object.assign({},e.state)),this.target=t.target,this.namespace=t.namespace,t.properties&&(this.properties=t.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=e.source,this.sourceLayer=e.sourceLayer,this.layer=e.layer)}toJSON(){const e=super.toJSON();return e.target=this.target,e.namespace=this.namespace,e}},e.dy=Za,e.dz=Bt,e.e=st,e.e$=I,e.e0=Cd,e.e1=(e,t,r,n,i,o)=>{const a=e.transform,s="globe"===a.projection.name;let l;if("map"===o.paint.get("circle-pitch-alignment"))if(s){const e=wd(a.zoom,t.canonical)*a._pixelsPerMercatorPixel;l=Float32Array.from([e,0,0,e])}else l=a.calculatePixelsToTileUnitsMatrix(r);else l=new Float32Array([a.pixelsToGLUnits[0],0,0,a.pixelsToGLUnits[1]]);const c={u_camera_to_center_distance:e.transform.getCameraToCenterDistance(a.projection),u_matrix:e.translatePosMatrix(t.projMatrix,r,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_device_pixel_ratio:yt.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:Ad,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:o.paint.get("circle-emissive-strength")};if(s){c.u_inv_rot_matrix=n,c.u_merc_center=i,c.u_tile_id=[t.canonical.x,t.canonical.y,1<<t.canonical.z],c.u_zoom_transition=kd(a.zoom);const e=i[0]*Gn,r=i[1]*Gn;c.u_up_dir=a.projection.upVector(new Xu(0,0,0),e,r)}return c},e.e2=sy,e.e3=Br,e.e4=(e,t,r,n,i,o,a,s,l,c)=>{const u=e.transform,d=u.pitch<15?iy(.07,.7,De((14-u.zoom)/5,0,1)):.07,h="none"===r.paint.get("line-trim-color-use-theme").
vendor: 7,577 bytes, line 1
1constantOr("default");return{u_matrix:ay(e,t,r,n),u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:u.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:i,u_width_scale:o,u_floor_width_scale:a,u_image:0,u_tile_units_to_pixels:oy(t,u),u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:s,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:r.paint.get("line-trim-color").toPremultipliedRenderColor(h?null:r.lut).toArray01(),u_zbias_factor:d,u_tile_to_meter:Gc(t.tileID.canonical,0),u_ground_shadow_factor:l,u_pattern_transition:c}},e.e5=(e,t,r,n,i,o,a,s,l,c)=>{const u=e.transform,d=u.calculatePixelsToTileUnitsMatrix(t),h="none"===r.paint.get("line-trim-color-use-theme").constantOr("default"),f=u.pitch<15?iy(.07,.7,De((14-u.zoom)/5,0,1)):.07;return{u_matrix:ay(e,t,r,n),u_pixels_to_tile_units:d,u_device_pixel_ratio:o,u_width_scale:a,u_floor_width_scale:s,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:i,u_texsize:ly(r)&&t.lineAtlasTexture?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:oy(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:l,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:r.paint.get("line-trim-color").toPremultipliedRenderColor(h?null:r.lut).toArray01(),u_zbias_factor:f,u_tile_to_meter:Gc(t.tileID.canonical,0),u_ground_shadow_factor:c}},e.e6=Ve,e.e7=Zd,e.e8=Fc,e.e9=ed,e.eA=function(e,r){var n=2*Math.acos(r[3]),i=Math.sin(n/2);return i>t?(e[0]=r[0]/i,e[1]=r[1]/i,e[2]=r[2]/i):(e[0]=1,e[1]=0,e[2]=0),n},e.eB=Xb,e.eC=nm,e.eD=Qg,e.eE=[1,1,1],e.eF=zb,e.eG=X,e.eH=function(e,t,r,n){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=a+n*(r[2]-a),e[3]=s+n*(r[3]-s),e},e.eI=rm,e.eJ=nl,e.eK=ml,e.eL=function(e,t,n,i,o,a,s,l,c,u,d,h,f,p,g,m){var y=new r(16);return y[0]=e,y[1]=t,y[2]=n,y[3]=i,y[4]=o,y[5]=a,y[6]=s,y[7]=l,y[8]=c,y[9]=u,y[10]=d,y[11]=h,y[12]=f,y[13]=p,y[14]=g,y[15]=m,y},e.eM=Mc,e.eN=gl,e.eO=pl,e.eP=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new Te(1/0,1/0),max:new Te(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(e,t=!1){const r=Uf(new Te(0,0),new Te(Gn,Gn),e),n=[];if(t&&!Vf(r,this._globalClipBounds))return n;for(const t of this._activeRegions){if(t.hiddenByOverlap)continue;if(!Vf(r,t))continue;const i=$f(t.min,t.max,e);n.push({min:i.min,max:i.max,sourceId:this._sourceIds[t.priority],footprint:t.footprint,footprintTileId:t.tileId,order:t.order,clipMask:t.clipMask,clipScope:t.clipScope})}return n}setSources(e){this._setSources(e.map((e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const t=[];for(const r of e.cache.getVisibleCoordinates()){const n=e.cache.getTile(r).buckets[e.layer];n&&n.updateFootprints(r.toUnwrapped(),t)}return t},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope}))))}_addSource(e){const t=e.getFootprints();if(0===t.length)return;const r=e.getOrder(),n=e.getClipMask(),i=e.getClipScope();for(const e of t){if(!e.footprint)continue;const t=Uf(e.footprint.min,e.footprint.max,e.id);this._activeRegions.push({min:t.min,max:t.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:e.id,footprint:e.footprint,order:r,clipMask:n,clipScope:i})}this._sourceIds.push(e.getSourceId())}_computeReplacement(){this._activeRegions.sort(((e,t)=>e.priority-t.priority||Bf(e.min,t.min)||Bf(e.max,t.max)||e.order-t.order||e.clipMask-t.clipMask||function(e,t){const r=(e,t)=>e+t;return e.length-t.length||e.reduce(r,"").localeCompare(t.reduce(r,""))}(e.clipScope,t.clipScope)));let e=this._activeRegions.length!==this._prevRegions.length;if(!e){let t=0;for(;!e&&t!==this._activeRegions.length;){const r=this._activeRegions[t],n=this._prevRegions[t];e=r.priority!==n.priority||!jf(r,n)||r.order!==n.order||r.clipMask!==n.clipMask||!Ie(r.clipScope,n.clipScope),this._activeRegions[t].hiddenByOverlap=n.hiddenByOverlap,++t}}if(e){++this._updateTime;for(const e of this._activeRegions)e.order!==zf&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,e.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,e.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,e.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,e.max.y));const e=e=>{const t=this._activeRegions;if(e>=t.length)return e;const r=t[e].priority;for(;e<t.length&&t[e].priority===r;)++e;return e};if(this._sourceIds.length>1){let t=0,r=e(t);for(;t!==r;){let n=t;const i=t;for(;n!==r;){const e=this._activeRegions[n];e.hiddenByOverlap=!1;for(let t=0;t<i;t++){const r=this._activeRegions[t];if(!r.hiddenByOverlap&&e.order===zf&&Vf(e,r)&&(e.hiddenByOverlap=qf(e.footprint,e.tileId,r.footprint,r.tileId),e.hiddenByOverlap))break}++n}t=r,r=e(t)}}}}_setSources(e){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let t=e.length-1;t>=0;t--)this._addSource(e[t]);this._computeReplacement()}},e.eQ=zf,e.eR=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy()}_fillGridMeshWithLods(e,t){const r=new Vs,n=new ll,i=[],o=e+1+2,a=t[0]+1,s=t[0]+1+(1+t.length),l=(e,t,r)=>{let n=e===o-1?e-2:0===e?e:e-1;return n+=r?24575:0,[n,t]};for(let e=0;e<o;++e)r.emplaceBack(...l(e,0,!0));for(let e=0;e<a;++e)for(let t=0;t<o;++t)r.emplaceBack(...l(t,e,(0===t||t===o-1)&&!0));for(let e=0;e<t.length;++e){const n=t[e];for(let e=0;e<o;++e)r.emplaceBack(...l(e,n,!0))}for(let e=0;e<t.length;++e){const a=n.length,l=t[e]+1+2,c=new ll;for(let r=0;r<l-1;r++){const i=r===l-2,a=i?o*(s-t.length+e-r):o;for(let e=0;e<o-1;e++){const t=r*o+e;0===r||i||0===e||e===o-2?(c.emplaceBack(t+1,t,t+a),c.emplaceBack(t+a,t+a+1,t+1)):(n.emplaceBack(t+1,t,t+a),n.emplaceBack(t+a,t+a+1,t+1))}}const u=Bl.simpleSegment(0,a,r.length,n.length-a);for(let e=0;e<c.uint16.length;e+=3)n.emplaceBack(c.uint16[e],c.uint16[e+1],c.uint16[e+2]);const d=Bl.simpleSegment(0,a,r.length,n.length-a);i.push({withoutSkirts:u,withSkirts:d})}return{vertices:r,indices:n,segments:i}}_createGrid(e){const t=this._fillGridMeshWithLods(xc,wc);this._gridSegments=t.segments,this._gridBuffer=e.createVertexBuffer(t.vertices,id.members),this._gridIndexBuffer=e.createIndexBuffer(t.indices,!0)}_createPoles(e){const t=new ll;for(let e=0;e<=xc;e++)t.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(t,!0);const r=new hl,n=new hl,i=new hl,o=new hl;this._poleSegments=[];for(let e=0,t=0;e<5;e++){const a=360/(1<<e);r.emplaceBack(0,-bc,0,.5,0),n.emplaceBack(0,-bc,0,.5,1),i.emplaceBack(0,-bc,0,.5,.5),o.emplaceBack(0,-bc,0,.5,.5);for(let e=0;e<=xc;e++){let t=e/xc,s=0;const l=fr(0,a,t),[c,u,d]=Tc(Ed,Pd,l,bc);r.emplaceBack(c,u,d,t,s),n.emplaceBack(c,u,d,t,1-s);const h=Pe(l);t=.5+.5*Math.sin(h),s=.5+.5*Math.cos(h),i.emplaceBack(c,u,d,t,s),o.emplaceBack(c,u,d,t,1-s)}this._poleSegments.push(Bl.simpleSegment(t,0,66,64)),t+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(r,rd,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(n,rd,
1!1),this._texturedPoleNorthVertexBuffer=e.createVertexBuffer(i,rd,!1),this._texturedPoleSouthVertexBuffer=e.createVertexBuffer(o,rd,!1)}getGridBuffers(e,t){return[this._gridBuffer,this._gridIndexBuffer,t?this._gridSegments[e].withSkirts:this._gridSegments[e].withoutSkirts]}getPoleBuffers(e,t){return[t?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,t?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}},e.eS=Ff,e.eT=Le,e.eU=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},e.eV=Oe,e.eW=Vc,e.eX=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e},e.eY=Z,e.eZ=Ic,e.e_=z,e.ea=gp,e.eb=kp,e.ec=np,e.ed=450,e.ee=7,e.ef=jc,e.eg=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},e.eh=_b,e.ei=Bs,e.ej=xl,e.ek=256,e.el=bd,e.em=Ys,e.en=g,e.eo=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},e.ep=hl,e.eq=yo,e.er=fl,e.es=function(e,t,r,n,i){return De((e-t)/(r-t)*(i-n)+n,n,i)},e.et=ie,e.eu=function(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*o+s*l,f=c*o-a*l,p=r*d+n*h+i*f;return p?(e[0]=d*(p=1/p),e[1]=(-u*n+i*c)*p,e[2]=(s*n-i*a)*p,e[3]=h*p,e[4]=(u*r-i*l)*p,e[5]=(-s*r+i*o)*p,e[6]=f*p,e[7]=(-c*r+n*l)*p,e[8]=(a*r-n*o)*p,e):null},e.ev=2,e.ew=F,e.ex=te,e.ey=v,e.ez=function(e,t){var n=new r(3);v(n,t);var i=1/n[0],o=1/n[1],a=1/n[2],s=t[0]*i,l=t[1]*o,c=t[2]*a,u=t[4]*i,d=t[5]*o,h=t[6]*a,f=t[8]*i,p=t[9]*o,g=t[10]*a,m=s+d+g,y=0;return m>0?(y=2*Math.sqrt(m+1),e[3]=.25*y,e[0]=(h-p)/y,e[1]=(f-c)/y,e[2]=(l-u)/y):s>d&&s>g?(y=2*Math.sqrt(1+s-d-g),e[3]=(h-p)/y,e[0]=.25*y,e[1]=(l+u)/y,e[2]=(f+c)/y):d>g?(y=2*Math.sqrt(1+d-s-g),e[3]=(f-c)/y,e[0]=(l+u)/y,e[1]=.25*y,e[2]=(h+p)/y):(y=2*Math.sqrt(1+g-s-d),e[3]=(l-u)/y,e[0]=(f+c)/y,e[1]=(h+p)/y,e[2]=.25*y),e},e.f=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t)))))},e.f0=function([e,t,r]){const n=Math.hypot(e,t,r),i=Math.atan2(e,r),o=.5*Math.PI-Math.acos(-t/n);return new Pc(Ae(i),Ae(o))},e.f1=J,e.f2=Yg,e.f3=function(e){const t=e.navigator?e.navigator.userAgent:null;return!!function(e){if(null==et){const t=e.navigator?e.navigator.userAgent:null;et=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return et}(e)&&!(!t||!(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/)))},e.f4=function(e,t){xt=e,wt=t},e.f5=Id,e.f6=Td,e.f7=function(e){const t=[0,0,0],r=c(new Float64Array(16));return d(r,e.pixelMatrix,e.globeMatrix),G(t,t,r),new Te(t[0],t[1])},e.f8=function(){const e=Yp;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(qp),Yp=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.f9=function(){Kp().acquire(qp)},e.fA=tw,e.fB=Qc,e.fC=function(e){let t=0;if(new Uint32Array(e,0,1)[0]!==Ig){const r=new Uint32Array(e,0,7),[,,n,i,o,a]=r;t=r.byteLength+i+o+a+o,(n!==e.byteLength||t>=e.byteLength)&&Ze("Invalid b3dm header information.")}return Rg(e,t)},e.fD=function(e,t){const r=_m(e);for(const e of r){for(const t of e.meshes)vm(t);e.lights&&(e.lightMeshIndex=e.meshes.length,e.meshes.push(xm(e.lights,t)))}return r},e.fE=Ub,e.fF=Je,e.fG=Up,e.fH=Ka,e.fI=Ga,e.fJ=function(e){Mt(),null!=kt&&kt.then((t=>{t.keys().then((r=>{for(let n=0;n<r.length-e;n++)t.delete(r[n]).catch((e=>Ze(e.message)))})).catch((e=>Ze(e.message)))})).catch((e=>Ze(e.message)))},e.fa=Ya,e.fb=function(e,t,r=!1){if($a===Ga.deferred||$a===Ga.loading||$a===Ga.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ha=yt.resolveURL(e),$a=Ga.deferred,Ua=t,Wa(),r||Xa()},e.fc=function(e){ng=yt.resolveURL(e),og||(og=new Zp(Kp(),new ir)),og.broadcast("setMeshoptUrl",ng)},e.fd=ug,e.fe=function(e){tg=yt.resolveURL(e),og||(og=new Zp(Kp(),new ir)),og.broadcast("setDracoUrl",tg)},e.ff=cg,e.fg=$p,e.fh=function(e){const t=It();if(!t)return;const r=t.delete(bt);e&&r.then((()=>e())).catch(e)},e.fi=Wp,e.fj=ea,e.fk=Hd,e.fl=2,e.fm=Yw,e.fn=Xw,e.fo=Ym,e.fp=au,e.fq="hd_road_elevation",e.fr=ku,e.fs=Ue,e.ft=Ah,e.fu=I_,e.fv=1,e.fw=function(e,t,r,n,i,o,a,s=1,l,c,u,d){e.createArrays(),e.tilePixelRatio=Gn/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const h=e.layers[0].layout,f=e.layers[0]._unevaluatedLayout._values,p={};p.scaleFactor=s,p.textSizeScaleRange=h.get("text-size-scale-range"),p.iconSizeScaleRange=h.get("icon-size-scale-range");const[g,m]=p.textSizeScaleRange,[y,_]=p.iconSizeScaleRange;p.textScaleFactor=De(p.scaleFactor,g,m),p.iconScaleFactor=De(p.scaleFactor,y,_);const v=f["text-size"],b=f["icon-size"];if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:r}=e.textSizeData;p.compositeTextSizes=[v.possiblyEvaluate(new Ja(t,{worldview:u}),o),v.possiblyEvaluate(new Ja(r,{worldview:u}),o)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:r}=e.iconSizeData;p.compositeIconSizes=[b.possiblyEvaluate(new Ja(t,{worldview:u}),o,d),b.possiblyEvaluate(new Ja(r,{worldview:u}),o,d)]}p.layoutTextSize=v.possiblyEvaluate(new Ja(a+1,{worldview:u}),o),p.layoutIconSize=b.possiblyEvaluate(new Ja(a+1,{worldview:u}),o,d),p.textMaxSize=v.possiblyEvaluate(new Ja(18,{worldview:u}),o);const x=h.get("symbol-placement"),w="map"===h.get("text-rotation-alignment")&&"point"!==x,S=h.get("text-size");let k=!1;const T=[];for(const a of e.features){const s=h.get("text-font").evaluate(a,{},o).join(","),g=S.evaluate(a,{},o)*p.textScaleFactor,m=p.layoutTextSize.evaluate(a,{},o)*p.textScaleFactor,y=p.layoutIconSize.evaluate(a,{},o,d)*p.iconScaleFactor,_={horizontal:{},vertical:void 0},v=a.text;let b,I=[0,0];if(v){const n=v.toString(),c=h.get("text-letter-spacing").evaluate(a,{},o)*ky,u=h.get("text-line-height").evaluate(a,{},o)*ky,d=Ra(n)?c:0,f=h.get("text-anchor").evaluate(a,{},o),p=h.get("text-variable-anchor");if(!p){const e=h.get("text-radial-offset").evaluate(a,{},o);if(e)I=X_(f,[e*ky,W_]);else{const e=h.get("text-offset").evaluate(a,{},o);I=[e[0]*ky,e[1]*ky]}}
1let y=w?"center":h.get("text-justify").evaluate(a,{},o);const b="point"===x,S=b?h.get("text-max-width").evaluate(a,{},o)*ky:1/0,k=o=>{e.allowVerticalPlacement&&Ca(n)&&(_.vertical=Xy(v,t,r,i,s,S,u,f,o,d,I,Wy.vertical,!0,m,g,l))};if(!w&&p){const e="auto"===y?p.map((e=>cv(e))):[y];let n=!1;for(let o=0;o<e.length;o++){const a=e[o];if(!_.horizontal[a])if(n)_.horizontal[a]=_.horizontal[0];else{const e=Xy(v,t,r,i,s,S,u,"center",a,d,I,Wy.horizontal,!1,m,g,l);e&&(_.horizontal[a]=e,n=1===e.positionedLines.length)}}k("left")}else{if("auto"===y&&(y=cv(f)),b||h.get("text-writing-mode").indexOf("horizontal")>=0||!Ca(n)){const e=Xy(v,t,r,i,s,S,u,f,y,d,I,Wy.horizontal,!1,m,g,l);e&&(_.horizontal[y]=e)}k(b?"left":y)}}let M,E,P,A,C,R,L=!1;const O=h.get("icon-text-fit").evaluate(a,{},o);if(a.icon&&a.icon.hasPrimary()){const t=iv(a.icon,e.iconSizeData,f["icon-size"],o,e.zoom,a,l,p.iconScaleFactor,u,d);M=t.iconPrimary,P=t.iconSecondary;const r=M.toString();if(E=n.get(r),E&&(C=h.get("icon-offset").evaluate(a,{},o),R=h.get("icon-anchor").evaluate(a,{},o),b=s_(i.get(r),P?i.get(P.toString()):void 0,C,R),L=E.sdf,void 0===e.sdfIcons?e.sdfIcons=E.sdf:e.sdfIcons!==E.sdf&&Ze("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(E.pixelRatio!==e.pixelRatio||0!==h.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0)),P){const e=P.toString();A=n.get(e)}}k=k||!(!a.icon||!a.icon.hasSecondary());const D=yv(_.horizontal)||_.vertical;e.iconsInText||(e.iconsInText=!!D&&D.iconsInText);const z=m*p.textScaleFactor/ky,{defaultShapedIcon:F,verticallyShapedIcon:N}=uv(e,b,h,a,o,_,z,C,O);"none"!==O&&b&&(c_(b)||u_(b))&&(rv(0,E,M,b,F,O,c,n,i),rv(0,A,P,b,F,O,c,n,i),N&&(rv(0,E,M,b,N,O,c,n,i),rv(0,A,P,b,N,O,c,n,i))),b=F;const{iconBBox:B,iconVerticalBBox:j,textBBox:V,textVerticalBBox:G}=K_(e,b,N,h,a,o,y,C,p,i,R,_,m,I,d);T.push({feature:a,shapedTextOrientations:_,shapedText:D,shapedIcon:b,iconPrimary:M,iconSecondary:P,iconOffset:C,iconAnchor:R,verticallyShapedIcon:N,layoutTextSize:m,layoutIconSize:y,textOffset:I,isSDFIcon:L,iconTextFit:O,iconCollisionBounds:B,iconVerticalCollisionBounds:j,textCollisionBounds:V,textVerticalCollisionBounds:G})}return{featureData:T,sizes:p,hasAnySecondaryIcon:k,textAlongLine:w,symbolPlacement:x}},e.fx=M_,e.fy=function(e,t,r,n,i,o,a,s,l,c){e.iconAtlasPositions=c.iconPositions;const{featureData:u,hasAnySecondaryIcon:d,sizes:h,textAlongLine:f,symbolPlacement:p}=t;for(const t of u){const{shapedIcon:r,verticallyShapedIcon:o,feature:u,shapedTextOrientations:g,shapedText:m,layoutTextSize:y,textOffset:_,isSDFIcon:v,iconPrimary:b,iconSecondary:x,iconTextFit:w,iconOffset:S,iconCollisionBounds:k,iconVerticalCollisionBounds:T,textCollisionBounds:I}=t;av(r,c.iconPositions,b,x),av(o,c.iconPositions,b,x),sv(g,c.iconPositions),ov(b,x,c.iconPositions),(m||r)&&hv(e,u,g,r,o,l,h,y,0,_,v,n,i,a,s,d,w,S,f,p,k,T,I)}r&&e.generateCollisionDebugBuffers(o,e.collisionBoxArray,h.textScaleFactor)},e.fz=iu,e.g=function(e,t){return Bt(Object.assign(e,{method:"GET"}),t)},e.h=function(e){return 0===e.indexOf("mapbox:")},e.i=function(e){return st.API_STYLE_REGEX.test(e)&&!ct(e)},e.j=lt,e.k=Pt,e.l=function(e){return decodeURIComponent(atob(e).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""))},e.m=function(e,t){return Bt(Object.assign(e,{type:"json"}),t)},e.n=Ht,e.o=yt,e.p=function(e,t){return Bt(Object.assign(e,{method:"POST"}),t)},e.q=qd,e.r=mt,e.s=function(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}},e.t=function(){return Xp||(Xp=new Wp("ImageRasterizer")),Xp},e.u=function(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()},e.v=function(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e.w=Ze,e.x=Ux,e.y=tr,e.z=er})),n(["./shared"],(function(e){function t(e){const t=e?e.url.toString():void 0;return t?performance.getEntriesByName(t):[]}function r(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const n of e)t+=`${r(n)},`;return`${t}]`}let t="{";for(const n of Object.keys(e).sort())t+=`${n}:${r(e[n])},`;return`${t}}`}function n(t){let n="";for(const i of e.bx)n+=`/${r(t[i])}`;return n}function i(e,t){return function e(r){return"string"==typeof r&&r===t||(Array.isArray(r)?r.some(e):!(!r||"object"!=typeof r)&&Object.values(r).some(e))}(e)}class o{constructor(e){this.keyCache={},this._layers={},this._layerConfigs={},e&&this.replace(e)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(t,o,a){this._options=a;for(const r of t)this._layerConfigs[r.id]=r,(this._layers[r.id]=e.du(r,this.scope,null,this._options)).compileFilter(a),this.keyCache[r.id]&&delete this.keyCache[r.id];for(const e of o)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const s=function(e,t){const o={};for(let a=0;a<e.length;a++){const s=e[a];let l=t&&t[s.id];l||("symbol"===s.type?l=s.id:(l=n(s),"line"===s.type&&s.paint&&i(s.paint["line-width"],"line-progress")&&(l+=`/${r(s.paint["line-width"])}`))),t&&(t[s.id]=l);let c=o[l];c||(c=o[l]=[]),c.push(s)}const a=[];for(const e in o)a.push(o[e]);return a}(Object.values(this._layerConfigs),this.keyCache);for(const e of s){const t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;const n=r.source||"";let i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});const o=r.sourceLayer||"_geojsonTileLayer";let a=i[o];a||(a=i[o]=[]),a.push(t)}}}const a=1*e.fl;class s{constructor(t){const r={},n=[];for(const e in t){const i=t[e],o=r[e]={};for(const e in i.glyphs){const t=i.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const r=t.metrics.localGlyph?a:1,s={x:0,y:0,w:t.bitmap.width+2*r,h:t.bitmap.height+2*r};n.push(s),o[e]=s}}const{w:i,h:o}=e.G(n),s=new e.fk({width:i||1,height:o||1});for(const n in t){const i=t[n];for(const t in i.glyphs){const o=i.glyphs[+t];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const l=r[n][t],c=o.metrics.localGlyph?a:1;e.fk.copy(o.bitmap,s,{x:0,y:0},{x:l.x+c,y:l.y+c},o.bitmap)}}this.image=s,this.positions=r}}function l(e,t,r){e[t]?r&&(e[t].center=r):e[t]={floorIds:new Set,center:r||[0,0],floors:{}}}function c(e,t,r,n){for(const i of t)l(e,i),e[i].floors[r]=n,e[i].floorIds.add(r)}function u(e){return{id:e.properties.id.toString(),center:e.properties.center.toString().split(";").map(Number)}}function d(e){return{id:e.properties.id.toString(),isDefault:!!e.properties.is_default&&e.properties.is_default,connections:e.properties.connected_floor_ids?new Set(e.properties.connected_floor_ids.toString().split(";")):new Set,conflicts:e.properties.conflicted_floor_ids?new Set(e.properties.conflicted_floor_ids.toString().split(";")):new Set,buildings:e.properties.building_ids?new Set(e.properties.building_ids.toString().split(";")):new Set,name:e.properties.name.toString(),zIndex:e.properties.z_index}}function h(e,t){return t.every((t=>e.properties&&null!=e.properties[t]))}function f(e){return h(e,["type","id","name"])&&"building"===e.properties.type}function p(e){return h(e,["type","id","name","z_index"])&&"floor"===e.properties.type}e.fj(s,"GlyphAtlas");class g{constructor(t){this.tileID=new e.aQ(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.lut=t.lut,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.scope=t.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.request&&t.request.collectResourceTiming,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile,this.tileTransform=e.aZ(t.tileID.canonical,t.projection),this.projection=t.projection,this.worldview=t.worldview,this.localizableLayerIds=t.localizableLayerIds,this.brightness=t.brightness,this.extraShadowCaster=!!t.extraShadowCaster,this.tessellationStep=t.tessellationStep,this.scaleFactor=t.
1scaleFactor,this.worldview=t.worldview,this.indoor=t.indoor}parse(t,r,n,i,o,a){this.status="parsing",this.data=t,this.collisionBoxArray=new e.b3;const h=new e.fm(Object.keys(t.layers).sort()),g=new e.fn(this.tileID,this.promoteId);g.bucketLayerIDs=[];const y={},_=new e.fo(256,256),v={featureIndex:g,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:_,availableImages:n,brightness:this.brightness,scaleFactor:this.scaleFactor,elevationFeatures:void 0,activeFloors:void 0};if(this.indoor){const r=this.indoor.indoorState.activeFloorsVisible,n=function(t,r,n){const i=function(t,r){if(!t)return e.w("No source layers defined in indoor specification"),r;if(0===t.size)return r;const n=t.difference(r);for(const t of n)e.w(`Missing source layer required in indoor specification: ${t}`);return r.intersection(r)}(r.sourceLayers,new Set(Object.keys(t.layers))),o=r.indoorState,a=function(t,r,n,i){const o=new Set,a=new Set,s=new Set,h=new Map,g={},m=e=>{const t=h.get(e)||new Set;for(const r of o)if((h.get(r)||new Set).has(e)||t.has(r))return!0;return!1};for(const n of r){const r=t.layers[n];if(r)for(let e=0;e<r.length;e++){const t=r.feature(e);if(f(t)){const{id:e,center:r}=u(t);l(g,e,r),o.add(e)}else if(p(t)){const{id:e,isDefault:r,connections:n,conflicts:l,buildings:u,name:f,zIndex:p}=d(t);c(g,u,e,{name:f,zIndex:p}),h.set(e,l),(e===i||n.has(i))&&o.add(e),a.add(e),r&&s.add(e)}}else e.w(`indoor source layer not found: ${n}`)}if(n)for(const e of n)a.has(e)&&(m(e)||o.add(e));for(const e of s)o.has(e)||m(e)||o.add(e);return{buildings:g,activeFloors:o}}(t,i,o.lastActiveFloors,o.selectedFloorId);return n.send("setIndoorData",a),a}(t,this.indoor,o);v.activeFloors=r?n.activeFloors:void 0}const b=[],x=r.familiesBySource[this.source];for(const r in x){const o=t.layers[r];if(!o)continue;let a=!1,s=!1,l=!1;for(const e of x[r])"symbol"===e[0].type?a=!0:s=!0,e[0].is3D()&&"model"!==e[0].type&&(l=!0);if(this.extraShadowCaster&&!l)continue;if(!0===this.isSymbolTile&&!a)continue;if(!1===this.isSymbolTile&&!s)continue;1===o.version&&e.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const c=h.encode(r),u=[],d=this.localizableLayerIds&&this.localizableLayerIds.has(r);let f=!1;for(let t=0,n=0;t<o.length;t++){const i=o.feature(t),a=g.getId(i,r),s=i.properties?i.properties.worldview:null;if(d&&this.worldview&&"string"==typeof s)if("all"===s)i.properties.$localized=!0;else{if(!s.split(",").includes(this.worldview))continue;i.properties.$localized=!0,i.properties.worldview=this.worldview}!f&&i.properties&&i.properties.hasOwnProperty(e.fp)&&(f=!0),u.push({feature:i,id:a,index:n,sourceLayerIndex:c}),n++}f&&!v.elevationFeatures&&t.layers.hasOwnProperty(e.fq)&&(v.elevationFeatures=e.fr.parseFrom(t.layers[e.fq],this.canonical));for(const t of x[r]){const r=t[0];if(this.extraShadowCaster&&(!r.is3D()||"model"===r.type))continue;if(void 0!==this.isSymbolTile&&"symbol"===r.type!==this.isSymbolTile)continue;if(r.minzoom&&this.zoom<Math.floor(r.minzoom))continue;if(r.maxzoom&&this.zoom>=r.maxzoom)continue;if("none"===r.visibility)continue;m(t,this.zoom,v.brightness,n,this.worldview);const o=y[r.id]=r.createBucket({index:g.bucketLayerIDs.length,layers:t,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:c,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:i,worldview:this.worldview,localizable:d,availableImages:n});g.bucketLayerIDs.push(t.map((t=>e.B(t.id,t.scope))));let a=o.prepare?o.prepare():null;null!=a?(a=a.then((()=>o.populate(u,v,this.tileID.canonical,this.tileTransform))),b.push(a)):o.populate(u,v,this.tileID.canonical,this.tileTransform)}}const w=()=>{let r,i,l,c,u,d;_.trim();const f={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},p=()=>{if(r)return this.status="done",a(r);if(this.extraShadowCaster)this.status="done",a(null,{buckets:Object.values(y).filter((e=>!e.isEmpty())),featureIndex:g,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:v.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(i&&l&&c){const t=new s(i),r=new Map;for(const[t,n]of l.entries()){const{imagePosition:i}=e.fu(t,n,e.fv);r.set(t,i)}const a={};for(const o in y){const s=y[o];s instanceof e.b4&&(m(s.layers,this.zoom,v.brightness,n,this.worldview),a[o]=e.fw(s,i,t.positions,l,r,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,u,this.worldview,n))}const h={iconsPending:!0,patternsPending:!0};this.rasterizeIfNeeded(o,l,u,(()=>{h.iconsPending=!1,b(a,t,h)})),this.rasterizeIfNeeded(o,c,d,(()=>{h.patternsPending=!1,b(a,t,h)}))}},b=(t,r,i,o)=>
1{if(i.iconsPending||i.patternsPending)return;const s=new e.fx(l,c,this.lut);for(const r in y){const i=y[r];if(r in t)e.fy(i,t[r],this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,l,s);else if(i.hasPattern&&(i instanceof e.ba||i instanceof e.bb||i instanceof e.ea)){m(i.layers,this.zoom,v.brightness,n,this.worldview);const e=Object.fromEntries(s.patternPositions);i.addFeatures(v,this.tileID.canonical,e,n,this.tileTransform,this.brightness)}}this.status="done",a(null,{buckets:Object.values(y).filter((e=>!e.isEmpty())),featureIndex:g,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:r.image,lineAtlas:_,imageAtlas:s,brightness:v.brightness})};if(!this.extraShadowCaster){const t=e.fs(v.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(t).length?o.send("getGlyphs",{uid:this.uid,stacks:t},((e,t)=>{r||(r=e,i=t,p())}),void 0,!1,f):i={};const n=Array.from(v.iconDependencies.keys()).map((t=>e.I.parse(t)));n.length?o.send("getImages",{images:n,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},((e,t)=>{r||(r=e,l=new Map,u=this.updateImageMapAndGetImageTaskQueue(l,t,v.iconDependencies),p())}),void 0,!1,f):(l=new Map,u=new Map);const a=Array.from(v.patternDependencies.keys()).map((t=>e.I.parse(t)));a.length?o.send("getImages",{images:a,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},((e,t)=>{r||(r=e,c=new Map,d=this.updateImageMapAndGetImageTaskQueue(c,t,v.patternDependencies),p())}),void 0,!1,f):(c=new Map,d=new Map)}if(v.elevationFeatures&&v.elevationFeatures.length>0){const r=[];for(const t of Object.values(y))if(t instanceof e.bb){const e=t.getUnevaluatedPortalGraph();e&&r.push(e)}const n=e.ft.evaluate(r);for(const r of Object.values(y))if(r instanceof e.bb){const e=t.layers[h.decode(r.sourceLayerIndex)];r.setEvaluatedPortalGraph(n,e,this.tileID.canonical,v.availableImages,v.brightness)}}p()};b.length>0?Promise.allSettled(b).then(w).catch(a):w()}updateParameters(t){this.scaleFactor=t.scaleFactor,this.showCollisionBoxes=t.showCollisionBoxes,this.projection=t.projection,this.brightness=t.brightness,this.tileTransform=e.aZ(t.tileID.canonical,t.projection),this.extraShadowCaster=t.extraShadowCaster,this.lut=t.lut,this.worldview=t.worldview,this.indoor=t.indoor}rasterizeIfNeeded(e,t,r,n){Array.from(t.values()).some((e=>e.usvg))?this.rasterize(e,t,r,n):n()}updateImageMapAndGetImageTaskQueue(e,t,r){const n=new Map;for(const i of t.keys()){const o=r.get(i)||[];for(const r of o){const i=r.toString(),o=t.get(r.id.toString());o.usvg?n.has(i)||(n.set(i,r),e.set(i,Object.assign({},o))):e.set(i,o)}}return n}rasterize(e,t,r,n){this.rasterizeTask=e.send("rasterizeImages",{scope:this.scope,tasks:r},((e,r)=>{if(!e)for(const[e,n]of r.entries()){const r=Object.assign(t.get(e),{data:n});t.set(e,r)}n()}))}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function m(t,r,n,i,o){const a=new e.ac(r,{brightness:n,worldview:o});for(const e of t)e.recalculate(a,i)}class y extends e.E{constructor(t,r,n,i,o,a,s){super(),this.actor=t,this.layerIndex=r,this.availableImages=n,this.availableModels=i,this.loadVectorData=a||e.aL,this.loading={},this.loaded={},this.deduped=new e.aK(t.scheduler),this.isSpriteLoaded=o,this.scheduler=t.scheduler,this.brightness=s}loadTile(r,n){const i=r.uid,o=r&&r.request,a=o&&o.collectResourceTiming,s=this.loading[i]=new g(r);s.abort=this.loadVectorData(r,((l,c)=>{const u=!this.loading[i];if(delete this.loading[i],s.cancelRasterize(),u||l||!c)return s.status="done",u||(this.loaded[i]=s),n(l);const d=c.rawData,h={},f=e.aM(c.responseHeaders);f&&f.expires&&(h.expires=f.expires),f&&f.cacheControl&&(h.cacheControl=f.cacheControl),s.vectorTile=c.vectorTile||new e.fz(new e.bt(d));const p=()=>{s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,((e,r)=>{if(e||!r)return n(e);const i={};if(a){const e=t(o);e.length>0&&(i.resourceTiming=JSON.parse(JSON.stringify(e)))}n(null,Object.assign({rawTileData:d.slice(0),responseHeaders:c.responseHeaders},r,h,i))}))};this.isSpriteLoaded?p():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(p,{type:"parseTile",isSymbolTile:r.isSymbolTile,zoom:r.tileZoom}):p()})),this.loaded=this.loaded||{},this.loaded[i]=s}))}reloadTile(e,t){const r=this.loaded,n=e.uid;if(r&&r[n]){const i=r[n];i.updateParameters(e);const o=(e,r)=>{const n=i.reloadCallback;n&&(delete i.reloadCallback,i.parse(i.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,n)),t(e,r)};"parsing"===i.status?i.reloadCallback=o:"done"===i.status&&(i.vectorTile?i.parse(i.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,o):o())}else t(null,void 0)}abortTile(e,t){const r=e.uid,n=this.loading[r];
1n&&(n.abort&&n.abort(),delete this.loading[r]),t()}removeTile(e,t){const r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()}}class _{loadTile(t,r){const{uid:n,encoding:i,rawImageData:o,padding:a}=t,s=ImageBitmap&&o instanceof ImageBitmap?this.getImageData(o,a):o;r(null,new e.fA(n,s,i,a<1))}reloadTile(e,t){t(null,null)}abortTile(e,t){t()}removeTile(e,t){t()}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const r=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),r}}e.bs.setPbf(e.bt);class v{constructor(t){this._mrt=new e.bs(t.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=t.uid,this.tileID=t.tileID,this.source=t.source}parse(t,r){const n=this._mrt;this.status="parsing",this._entireBuffer=t;try{n.parseHeader(t),this._isHeaderLoaded=!0;const i=[];for(const r in n.layers){const o=n.getLayer(r),a=o.getDataRange(o.getBandList()),s=n.createDecodingTask(a),l=t.slice(a.firstByte,a.lastByte+1),c=e.bs.performDecoding(l,s).then((e=>s.complete(null,e))).catch((e=>s.complete(e,null)));i.push(c)}Promise.allSettled(i).then((()=>r(null,n))).catch((e=>r(e)))}catch(e){r(e)}}}class b{constructor(e){this.actor=e,this.loading={},this.loaded={}}loadTile(t,r){const n=t.uid,i=t.request,o=this.loading[n]=new v(t),{cancel:a}=e.bu(i,((e,t,i)=>{const a=!this.loading[n];if(delete this.loading[n],a||e||!t)return o.status="done",a||(this.loaded[n]=o),r(e);o.parse(t,((e,t)=>{if(e||!t)return r(e);r(null,t,i)})),this.loaded[n]=o}));o.abort=a}reloadTile(e,t){t(null,void 0)}abortTile(e,t){const r=e.uid,n=this.loading[r];n&&(n.abort&&n.abort(),delete this.loading[r]),t()}removeTile(e,t){const r=e.uid;this.loaded[r]&&delete this.loaded[r],t()}decodeRasterArray(t,r){e.bs.performDecoding(t.buffer,t.task).then((e=>r(null,e))).catch((e=>r(e)))}}const x=e.fB.prototype.toGeoJSON;class w{constructor(t){this._feature=t,this.extent=e.al,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const r of this._feature.geometry)t.push([new e.P(r[0],r[1])]);return t}{const t=[];for(const r of this._feature.geometry){const n=[];for(const t of r)n.push(new e.P(t[0],t[1]));t.push(n)}return t}}toGeoJSON(e,t,r){return x.call(this,e,t,r)}}class S{constructor(t,r){this.name=t,this.extent=e.al,this.length=r.length,this._jsonFeatures=r}feature(e){return new w(this._jsonFeatures[e])}}class k{constructor(t){this.layers={},this.extent=e.al;for(const e of Object.keys(t))this.layers[e]=new S(e,t[e])}}const T=64/4096;class I{constructor(){this.features=new Map}clear(){this.features.clear()}load(e=[],t){for(const r of e){const e=r.id;if(null==e)continue;let n=this.features.get(e);n&&this.updateCache(n,t),r.geometry?(n=E(r),this.updateCache(n,t),this.features.set(e,n)):this.features.delete(e),this.updateCache(n,t)}}updateCache(e,t){for(const{canonical:r,uid:n}of Object.values(t)){const{z:i,x:o,y:a}=r;M(e,Math.pow(2,i),o,a)&&delete t[n]}}getTile(e,t,r){const n=Math.pow(2,e),i=[];for(const e of this.features.values())M(e,n,t,r)&&i.push(R(e,n,t,r));return{features:i}}getFeatures(){return[...this.features.values()]}}function M({minX:e,minY:t,maxX:r,maxY:n},i,o,a){return e<(o+1+T)/i&&t<(a+1+T)/i&&r>(o-T)/i&&n>(a-T)/i}function E(e){const{id:t,geometry:r,properties:n}=e;if(!r)return;if("GeometryCollection"===r.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:i,coordinates:o}=r,a={id:t,type:1,geometry:[],tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},s=a.geometry;if("Point"===i)P(o,s,a);else if("MultiPoint"===i)for(const e of o)P(e,s,a);else if("LineString"===i)a.type=2,A(o,s,a);else if("MultiLineString"===i)a.type=2,C(o,s,a);else if("Polygon"===i)a.type=3,C(o,s,a,!0);else{if("MultiPolygon"!==i)throw new Error("Input data is not a valid GeoJSON object.");a.type=3;for(const e of o)C(e,s,a,!0)}return a}function P([t,r],n,i){const o=e.aF(t);let a=e.aJ(r);a=a<0?0:a>1?1:a,n.push(o,a),i.minX=Math.min(i.minX,o),i.minY=Math.min(i.minY,a),i.maxX=Math.max(i.maxX,o),i.maxY=M
1ath.max(i.maxY,a)}function A(e,t,r,n=!1,i=!1){const o=[];for(const t of e)P(t,o,r);t.push(o),n&&function(e,t){let r=0;for(let t=0,n=e.length,i=n-2;t<n;i=t,t+=2)r+=(e[t]-e[i])*(e[t+1]+e[i+1]);if(r>0===t)for(let t=0,r=e.length;t<r/2;t+=2){const n=e[t],i=e[t+1];e[t]=e[r-2-t],e[t+1]=e[r-1-t],e[r-2-t]=n,e[r-1-t]=i}}(o,i)}function C(e,t,r,n=!1){for(let i=0;i<e.length;i++)A(e[i],t,r,n,0===i)}function R(t,r,n,i){const{id:o,type:a,geometry:s,tags:l}=t,c=[];if(1===a)!function(t,r,n,i,o){for(let a=0;a<t.length;a+=2){const s=Math.round(e.al*(t[a+0]*r-n)),l=Math.round(e.al*(t[a+1]*r-i));o.push([s,l])}}(s,r,n,i,c);else if(2===a)for(const e of s)L(e,r,n,i,c);else if(3===a)for(const e of s)O(e,r,n,i,c);return{id:o,type:a,geometry:c,tags:l}}function L(t,r,n,i,o){const a=-128,s=e.al+128;let l;for(let c=0;c<t.length-2;c+=2){let u=Math.round(e.al*(t[c+0]*r-n)),d=Math.round(e.al*(t[c+1]*r-i)),h=Math.round(e.al*(t[c+2]*r-n)),f=Math.round(e.al*(t[c+3]*r-i));const p=h-u,g=f-d;u<a&&h<a||(u<a?(d+=Math.round(g*((a-u)/p)),u=a):h<a&&(f=d+Math.round(g*((a-u)/p)),h=a),d<a&&f<a||
1(d<a?(u+=Math.round(p*((a-d)/g)),d=a):f<a&&(h=u+Math.round(p*((a-d)/g)),f=a),u>=s&&h>=s||(u>=s?(d+=Math.round(g*((s-u)/p)),u=s):h>=s&&(f=d+Math.round(g*((s-u)/p)),h=s),d>=s&&f>=s||(d>=s?(u+=Math.round(p*((s-d)/g)),d=s):f>=s&&(h=u+Math.round(p*((s-d)/g)),f=s),l&&u===l[l.length-1][0]&&d===l[l.length-1][1]||(l=[[u,d]],o.push(l)),l.push([h,f])))))}}function O(t,r,n,i,o){const a=(n-T)/r,s=(i-T)/r,l=(n+1+T)/r,c=(i+1+T)/r;function u(e,t){let r=0;return e<a?r|=1:e>l&&(r|=2),t<s?r|=4:t>c&&(r|=8),r}let d=[];for(let e=1;e<=8;e*=2){let r=t[t.length-2],n=t[t.length-1],i=!(u(r,n)&e);for(let o=0;o<t.length;o+=2){const h=t[o],f=t[o+1],p=!(u(h,f)&e);p!==i&&(8&e?d.push(r+(h-r)*(c-n)/(f-n),c):4&e?d.push(r+(h-r)*(s-n)/(f-n),s):2&e?d.push(l,n+(f-n)*(l-r)/(h-r)):1&e&&d.push(a,n+(f-n)*(a-r)/(h-r))),p&&d.push(h,f),r=h,n=f,i=p}if(!(t=d).length||8===e)break;d=[]}const h=[];for(let t=0;t<d.length;t+=2)h.push([Math.round(e.al*(d[t]*r-n)),Math.round(e.al*(d[t+1]*r-i))]);h.length&&o.push(h)}function D({name:t,features:r},n){n.writeStringField(1,t),n.writeVarintField(5,e.al);const i=new Map,o=new Map,a={keys:i,values:o,feature:null};for(const e of r)a.feature=e,n.writeMessage(2,z,a);for(const e of i.keys())n.writeStringField(3,e);for(const e of o.keys())n.writeMessage(4,V,e)}function z(e,t){const r=e.feature;void 0!==r.id&&Number.isSafeInteger(+r.id)&&t.writeVarintField(1,+r.id),r.tags&&t.writeMessage(2,F,e),t.writeVarintField(3,r.type),t.writeMessage(4,j,r)}function F({keys:e,values:t,feature:r},n){for(const i of Object.keys(r.tags)){let o=r.tags[i];if(null===o)continue;let a=e.get(i);void 0===a&&(a=e.size,e.set(i,a)),n.writeVarint(a);const s=typeof o;"string"!==s&&"boolean"!==s&&"number"!==s&&(o=JSON.stringify(o));let l=t.get(o);void 0===l&&(l=t.size,t.set(o,l)),n.writeVarint(l)}}function N(e,t){return(t<<3)+(7&e)}function B(e){return e<<1^e>>31}function j(e,t){const{geometry:r,type:n}=e;let i=0,o=0;if(1===n){t.writeVarint(N(1,r.length));for(const e of r){const r=e[0]-i,n=e[1]-o;t.writeVarint(B(r)),t.writeVarint(B(n)),i+=r,o+=n}}else for(const e of r){if(0===e.length)continue;t.writeVarint(N(1,1));const r=e.length-(3===n?1:0);for(let n=0;n<r;n++){1===n&&t.writeVarint(N(2,r-1));const a=e[n][0]-i,s=e[n][1]-o;t.writeVarint(B(a)),t.writeVarint(B(s)),i+=a,o+=s}3===n&&t.writeVarint(N(7,1))}}function V(e,t){const r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}const G={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},U=Math.fround||($=new Float32Array(1),e=>($[0]=+e,$[0]));var $;class H{constructor(e){this.options=Object.assign(Object.create(G),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:n}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;const o=[];for(let t=0;t<e.length;t++){const r=e[t];if(!r.geometry)continue;const[n,i]=r.geometry.coordinates,a=U(Z(n)),s=U(Y(i));o.push(a,s,1/0,t,-1,1),this.options.reduce&&o.push(0)}let a=this.trees[n+1]=this._createTree(o);t&&console.timeEnd(i);for(let e=n;e>=r;e--){const r=+Date.now();a=this.trees[e]=this._createTree(this._cluster(a,e)),t&&console.log("z%d: %d clusters in %dms",e,a.numItems,+Date.now()-r)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let i=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){const e=this.getClusters([r,n,180,o],t),a=this.getClusters([-180,n,i,o],t);return e.concat(a)}const a=this.trees[this._limitZoom(t)],s=a.range(Z(r),Y(o),Z(i),Y(n)),l=a.data,c=[];for(const e of s){const t=this.stride*e;c.push(l[t+5]>1?q(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);const o=i.data;if(t*this.stride>=o.length)throw new Error(n);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(o[t*this.stride],o[t*this.stride+1],a),l=[];for(const t of s){const r=t*this.stride;o[r+4]===e&&l.push(o[r+5]>1?q(o,r,this.clusterProps):this.points[o[r+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,r){const n=[];return this._appendLeaves(n,e,t=t||10,r=r||0,0),n}getTile(e,t,r){const n=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:o,radius:a}=this.options,s=a/o,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((t-s)/i,l,(t+1+s)/i,c),n.data,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,n,i){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?i+o.point_count<=n?i+=o.point_count:i=this._appendLeaves(e,o.cluster_id,r,n,i):i<n?i++:e.push(t),e.length===r)break}return i}_createTree(t){const r=new e.c4(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)r.add(t[e],t[e+1]);return r.finish(),r.data=t,r}_addTileFeatures(e,t,r,n,i,o){for(const a of e){const e=a*this.stride,s=t[e+5]>1;let l,c,u;if(s)l=W(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const r=this.points[t[e+3]];l=r.properties;const[n,i]=r.geometry.coordinates;c=Z(n),u=Y(i)}const d={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(u*i-n))]],tags:l};let h;h=s||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==h&&(d.id=h),o.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:n,reduce:i,minPoints:o}=this.options,a=r/(n*Math.pow(2,t)),s=e.data,l=[],c=this.stride;for(let r=0;r<s.length;r+=c){if(s[r+2]<=t)continue;s[r+2]=t;
vendor: 5,147 bytes, line 1
1const n=s[r],u=s[r+1],d=e.within(s[r],s[r+1],a),h=s[r+5];let f=h;for(const e of d){const r=e*c;s[r+2]>t&&(f+=s[r+5])}if(f>h&&f>=o){let e,o=n*h,a=u*h,p=-1;const g=(r/c<<5)+(t+1)+this.points.length;for(const n of d){const l=n*c;if(s[l+2]<=t)continue;s[l+2]=t;const u=s[l+5];o+=s[l]*u,a+=s[l+1]*u,s[l+4]=g,i&&(e||(e=this._map(s,r,!0),p=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,l)))}s[r+4]=g,l.push(o/f,a/f,1/0,g,-1,f),i&&l.push(p)}else{for(let e=0;e<c;e++)l.push(s[r+e]);if(f>1)for(const e of d){const r=e*c;if(!(s[r+2]<=t)){s[r+2]=t;for(let e=0;e<c;e++)l.push(s[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return r?Object.assign({},n):n}const n=this.points[e[t+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function q(e,t,r){return{type:"Feature",id:e[t+3],properties:W(e,t,r),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),X(e[t+1])]}};var n}function W(e,t,r){const n=e[t+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=e[t+6],a=-1===o?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:i})}function Z(e){return e/360+.5}function Y(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function X(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function K(e,t,r,n){let i=n;const o=t+(r-t>>1);let a,s=r-t;const l=e[t],c=e[t+1],u=e[r],d=e[r+1];for(let n=t+3;n<r;n+=3){const t=J(e[n],e[n+1],l,c,u,d);if(t>i)a=n,i=t;else if(t===i){const e=Math.abs(n-o);e<s&&(a=n,s=e)}}i>n&&(a-t>3&&K(e,t,a,n),e[a+2]=i,r-a>3&&K(e,a,r,n))}function J(e,t,r,n,i,o){let a=i-r,s=o-n;if(0!==a||0!==s){const l=((e-r)*a+(t-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return a=e-r,s=t-n,a*a+s*s}function Q(e,t,r,n){const i={id:e??null,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)ee(i,r);else if("Polygon"===t)ee(i,r[0]);else if("MultiLineString"===t)for(const e of r)ee(i,e);else if("MultiPolygon"===t)for(const e of r)ee(i,e[0]);return i}function ee(e,t){for(let r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function te(e,t,r,n){if(!t.geometry)return;const i=t.geometry.coordinates;if(i&&0===i.length)return;const o=t.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2);let s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===o)re(i,s);else if("MultiPoint"===o)for(const e of i)re(e,s);else if("LineString"===o)ne(i,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(const r of i)s=[],ne(r,s,a,!1),e.push(Q(l,"LineString",s,t.properties));return}ie(i,s,a,!1)}else if("Polygon"===o)ie(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const i of t.geometry.geometries)te(e,{id:l,geometry:i,properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const e of i){const t=[];ie(e,t,a,!0),s.push(t)}}e.push(Q(l,o,s,t.properties))}function re(e,t){t.push(oe(e[0]),ae(e[1]),0)}function ne(e,t,r,n){let i,o,a=0;for(let r=0;r<e.length;r++){const s=oe(e[r][0]),l=ae(e[r][1]);t.push(s,l,0),r>0&&(a+=n?(i*l-s*o)/2:Math.sqrt(Math.pow(s-i,2)+Math.pow(l-o,2))),i=s,o=l}const s=t.length-3;t[2]=1,K(t,0,s,r),t[s+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function ie(e,t,r,n){for(let i=0;i<e.length;i++){const o=[];ne(e[i],o,r,n),t.push(o)}}function oe(e){return e/360+.5}function ae(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function se(e,t,r,n,i,o,a,s){if(n/=t,o>=(r/=t)&&a<n)return e;if(a<r||o>=n)return null;const l=[];for(const t of e){const e=t.geometry;let o=t.type;const a=0===i?t.minX:t.minY,c=0===i?t.maxX:t.maxY;if(a>=r&&c<n){l.push(t);continue}if(c<r||a>=n)continue;let u=[];if("Point"===o||"MultiPoint"===o)le(e,u,r,n,i);else if("LineString"===o)ce(e,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===o)de(e,u,r,n,i,!1);else if("Polygon"===o)de(e,u,r,n,i,!0);else if("MultiPolygon"===o)for(const t of e){const e=[];de(t,e,r,n,i,!0),e.length&&u.push(e)}if(u.length){if(s.lineMetrics&&"LineString"===o){for(const e of u)l.push(Q(t.id,o,e,t.tags));continue}"LineString"!==o&&"MultiLineString"!==o||(1===u.length?(o="LineString",u=u[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===u.length?"Point":"MultiPoint"),l.push(Q(t.id,o,u,t.tags))}}return l.length?l:null}function le(e,t,r,n,i){for(let o=0;o<e.length;o+=3){const a=e[o+i];a>=r&&a<=n&&he(t,e[o],e[o+1],e[o+2])}}function ce(e,t,r,n,i,o,a){let s=ue(e);const l=0===i?fe:pe;let c,u,d=e.start;for(let h=0;h<e.length-3;h+=3){const f=e[h],p=e[h+1],g=e[h+2],m=e[h+3],y=e[h+4],_=0===i?f:p,v=0===i?m:y;let b=!1;a&&(c=Math.sqrt(Math.pow(f-m,2)+Math.pow(p-y,2))),_<r?v>r&&(u=l(s,f,p,m,y,r),a&&(s.start=d+c*u)):_>n?v<n&&(u=l(s,f,p,m,y,n),a&&(s.start=d+c*u)):he(s,f,p,g),v<r&&_>=r&&(u=l(s,f,p,m,y,r),b=!0),v>
vendor: 5,807 bytes, line 1
1n&&_<=n&&(u=l(s,f,p,m,y,n),b=!0),!o&&b&&(a&&(s.end=d+c*u),t.push(s),s=ue(e)),a&&(d+=c)}let h=e.length-3;const f=e[h],p=e[h+1],g=0===i?f:p;g>=r&&g<=n&&he(s,f,p,e[h+2]),h=s.length-3,o&&h>=3&&(s[h]!==s[0]||s[h+1]!==s[1])&&he(s,s[0],s[1],s[2]),s.length&&t.push(s)}function ue(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function de(e,t,r,n,i,o){for(const a of e)ce(a,t,r,n,i,o,!1)}function he(e,t,r,n){e.push(t,r,n)}function fe(e,t,r,n,i,o){const a=(o-t)/(n-t);return he(e,o,r+(i-r)*a,1),a}function pe(e,t,r,n,i,o){const a=(o-r)/(i-r);return he(e,t+(n-t)*a,o,1),a}function ge(e,t){const r=[];for(let n=0;n<e.length;n++){const i=e[n],o=i.type;let a;if("Point"===o||"MultiPoint"===o||"LineString"===o)a=me(i.geometry,t);else if("MultiLineString"===o||"Polygon"===o){a=[];for(const e of i.geometry)a.push(me(e,t))}else if("MultiPolygon"===o){a=[];for(const e of i.geometry){const r=[];for(const n of e)r.push(me(n,t));a.push(r)}}r.push(Q(i.id,o,a,i.tags))}return r}function me(e,t){const r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(let n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function ye(e,t){if(e.transformed)return e;const r=1<<e.z,n=e.x,i=e.y;for(const o of e.features){const e=o.geometry,a=o.type;if(o.geometry=[],1===a)for(let a=0;a<e.length;a+=2)o.geometry.push(_e(e[a],e[a+1],t,r,n,i));else for(let a=0;a<e.length;a++){const s=[];for(let o=0;o<e[a].length;o+=2)s.push(_e(e[a][o],e[a][o+1],t,r,n,i));o.geometry.push(s)}}return e.transformed=!0,e}function _e(e,t,r,n,i,o){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-o))]}function ve(e,t,r,n,i){const o=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const t of e)be(a,t,o,i);return a}function be(e,t,r,n){const i=t.geometry,o=t.type,a=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===o||"MultiPoint"===o)for(let t=0;t<i.length;t+=3)a.push(i[t],i[t+1]),e.numPoints++,e.numSimplified++;else if("LineString"===o)xe(a,i,e,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(let t=0;t<i.length;t++)xe(a,i[t],e,r,"Polygon"===o,0===t);else if("MultiPolygon"===o)for(let t=0;t<i.length;t++){const n=i[t];for(let t=0;t<n.length;t++)xe(a,n[t],e,r,!0,0===t)}if(a.length){let r=t.tags||null;if("LineString"===o&&n.lineMetrics){r={};for(const e in t.tags)r[e]=t.tags[e];r.mapbox_clip_start=i.start/i.size,r.mapbox_clip_end=i.end/i.size}const s={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:r};null!==t.id&&(s.id=t.id),e.features.push(s)}}function xe(e,t,r,n,i,o){const a=n*n;if(n>0&&t.size<(i?a:n))return void(r.numPoints+=t.length/3);const s=[];for(let e=0;e<t.length;e+=3)(0===n||t[e+2]>a)&&(r.numSimplified++,s.push(t[e],t[e+1])),r.numPoints++;i&&function(e,t){let r=0;for(let t=0,n=e.length,i=n-2;t<n;i=t,t+=2)r+=(e[t]-e[i])*(e[t+1]+e[i+1]);if(r>0===t)for(let t=0,r=e.length;t<r/2;t+=2){const n=e[t],i=e[t+1];e[t]=e[r-2-t],e[t+1]=e[r-1-t],e[r-2-t]=n,e[r-1-t]=i}}(s,o),e.push(s)}const we={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Se{constructor(e,t){const r=(t=this.options=function(e,t){for(const r in t)e[r]=t[r];return e}(Object.create(we),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(e,t){const r=[];if("FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)te(r,e.features[n],t,n);else te(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){const r=t.buffer/t.extent;let n=e;const i=se(e,1,-1-r,r,0,-1,2,t),o=se(e,1,1-r,2+r,0,-1,2,t);return(i||o)&&(n=se(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=ge(i,1).concat(n)),o&&(n=n.concat(ge(o,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),r&&(n.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)))}splitTile(e,t,r,n,i,o,a){const s=[e,t,r,n],l=this.options,c=l.debug;for(;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();const u=1<<t,d=ke(t,r,n);let h=this.tiles[d];if(!h&&(c>1&&console.time("creation"),h=this.tiles[d]=ve(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(h.source=e,null==i){if(t===l.indexMaxZoom||h.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===i)continue;if(null!=i){const e=i-t;if(r!==o>>e||n!==a>>e)continue}}if(h.source=null,0===e.length)continue;c>1&&console.time("clipping");const f=.5*l.buffer/l.extent,p=.5-f,g=.5+f,m=1+f;let y=null,_=null,v=null,b=null,x=se(e,u,r-f,r+g,0,h.minX,h.maxX,l),w=se(e,u,r+p,r+m,0,h.minX,h.maxX,l);e=null,x&&(y=se(x,u,n-f,n+g,1,h.minY,h.maxY,l),_=se(x,u,n+p,n+m,1,h.minY,h.maxY,l),x=null),w&&(v=se(w,u,n-f,n+g,1,h.minY,h.maxY,l),b=se(w,u,n+p,n+m,1,h.minY,h.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],t+1,2*r,2*n),s.push(_||[],t+1,2*r,2*n+1),s.push(v||[],t+1,2*r+1,2*n),s.push(b||[],t+1,2*r+1,2*n+1)}}getTile(e,t,r){e=+e,t=+t,r=+r;const n=this.options,{extent:i,debug:o}=n;
1if(e<0||e>24)return null;const a=1<<e,s=ke(e,t=t+a&a-1,r);if(this.tiles[s])return ye(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",e,t,r);let l,c=e,u=t,d=r;for(;!l&&c>0;)c--,u>>=1,d>>=1,l=this.tiles[ke(c,u,d)];return l&&l.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,u,d),console.time("drilling down")),this.splitTile(l.source,c,u,d,e,t,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ye(this.tiles[s],i):null):null}}function ke(e,t,r){return 32*((1<<e)*r+t)+e}function Te(t,r){const n=t.tileID.canonical;if(!this._geoJSONIndex)return void r(null,null);const i=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!i)return void r(null,null);const o=e=>e.tags&&"3d_elevation_id"in e.tags&&"source"in e.tags&&"elevation"===e.tags.source,a=i.features.filter((e=>o(e)));let s={_geojsonTileLayer:i.features};a.length>0&&(s={_geojsonTileLayer:i.features.filter((e=>!o(e))),hd_road_elevation:a});const l=new k(s),c=function(t){const r=new e.bt;for(const e of Object.keys(t))r.writeMessage(3,D,{name:e,features:t[e]});return r.finish()}(s).buffer;r(null,{vectorTile:l,rawData:c})}class Ie extends y{constructor(e,t,r,n,i,o,a){super(e,t,r,n,i,Te,a),o&&(this.loadGeoJSON=o),this._dynamicIndex=new I}loadData(r,n){const i=r&&r.request,o=i&&i.collectResourceTiming;this._geoJSONIndex=null,this.loadGeoJSON(r,((a,s)=>{if(a||!s)return n(a);if("object"!=typeof s)return n(new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`));{try{if(r.filter){const t=e.U(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s.features=s.features.filter((e=>t.value.evaluate({zoom:0},e)))}r.dynamic?("Feature"===s.type&&(s={type:"FeatureCollection",features:[s]}),r.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(s.features,this.loaded),r.cluster&&(s.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=r.cluster?new H(function({superclusterOptions:t,clusterProperties:r}){if(!r||!t)return t;const n={},i={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(r);for(const t of s){const[o,a]=r[t],s=e.U(a),l=e.U("string"==typeof o?[o,["accumulated"],["get",t]]:o);n[t]=s.value,i[t]=l.value}return t.map=e=>{a.properties=e;const t={};for(const e of s)t[e]=n[e].evaluate(o,a);return t},t.reduce=(e,t)=>{a.properties=t;for(const t of s)o.accumulated=e[t],e[t]=i[t].evaluate(o,a)},t}(r)).load(s.features):r.dynamic?this._dynamicIndex:function(e,t){return new Se(e,t)}(s,r.geojsonVtOptions)}catch(e){return n(e)}const a={};if(o){const e=t(i);e&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(e)))}n(null,a)}}))}reloadTile(e,t){const r=this.loaded;return r&&r[e.uid]?e.partial?t(null,void 0):super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,r){if(t.request)e.m(t.request,r);else{if("string"!=typeof t.data)return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));setTimeout((()=>{try{return r(null,JSON.parse(t.data))}catch(e){return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}}),0)}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class Me{constructor(t,r,n){this.tileID=new e.aQ(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=t.projection,this.brightness=r,this.worldview=n}parse(t,r,n,i){this.status="parsing";const o=new e.aQ(n.tileID.overscaledZ,n.tileID.wrap,n.tileID.canonical.z,n.tileID.canonical.x,n.tileID.canonical.y),a=[],s=r.familiesBySource[n.source],l=new e.fn(o,n.promoteId);l.bucketLayerIDs=[],l.is3DTile=!0,e.fC(t).then((t=>{if(!t)return i(new Error("Could not parse tile"));const r=t.json.extensionsUsed&&t.json.extensionsUsed.includes("MAPBOX_mesh_features")||t.json.asset.extras&&t.json.asset.extras.MAPBOX_mesh_features,c=t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression"),u=new e.ac(this.zoom,{brightness:this.brightness,worldview:this.worldview});for(const i in s)for(const d of s[i]){const i=d[0];
1l.bucketLayerIDs.push(d.map((t=>e.B(t.id,t.scope)))),i.recalculate(u,[]);const s=e.fD(t,1/e.d7(n.tileID.canonical)),h=new e.fE(d,s,o,r,c,this.brightness,l,this.worldview);r||(h.needsUpload=!0),a.push(h),h.evaluate(i)}this.status="done",i(null,{buckets:a,featureIndex:l,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})})).catch((e=>i(new Error(e.message))))}}class Ee{constructor(e,t,r,n,i,o,a,s){this.actor=e,this.layerIndex=t,this.availableImages=r,this.availableModels=n,this.brightness=a,this.loading={},this.loaded={},this.worldview=s}loadTile(t,r){const n=t.uid,i=this.loading[n]=new Me(t,this.brightness,this.worldview);e.bu(t.request,((e,o)=>{const a=!this.loading[n];return delete this.loading[n],a||e?(i.status="done",a||(this.loaded[n]=i),r(e)):o&&0!==o.byteLength?void i.parse(o,this.layerIndex,t,((e,t)=>{i.status="done",this.loaded=this.loaded||{},this.loaded[n]=i,e||!t?r(e):r(null,t)})):(i.status="done",this.loaded[n]=i,r())}))}reloadTile(e,t){const r=this.loaded,n=e.uid;if(r&&r[n]){const i=r[n];i.projection=e.projection,i.brightness=e.brightness;const o=(r,n)=>{i.reloadCallback&&(delete i.reloadCallback,this.loadTile(e,t)),t(r,n)};"parsing"===i.status?i.reloadCallback=o:"done"===i.status&&this.loadTile(e,t)}}abortTile(e,t){const r=e.uid;this.loading[r]&&delete this.loading[r],t()}removeTile(e,t){const r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()}}class Pe{constructor(t){this.self=t,this.actor=new e.fG(t,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.imageRasterizer=new e.x,this.rtlPluginParsingListeners=[],this.projections={},this.defaultProjection=e.cm({name:"mercator"}),this.workerSourceTypes={vector:y,geojson:Ie,"raster-dem":_,"raster-array":b,"batched-model":Ee},this.workerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.fH.isParsed())throw new Error("RTL text plugin already registered.");e.fH.setState({pluginStatus:e.fI.parsed,pluginURL:e.fH.getPluginURL()}),e.fH.applyArabicShaping=t.applyArabicShaping,e.fH.processBidirectionalText=t.processBidirectionalText,e.fH.processStyledBidirectionalText=t.processStyledBidirectionalText;for(const e of this.rtlPluginParsingListeners)e(null,!0);this.rtlPluginParsingListeners=[]}}clearCaches(e,t,r){delete this.layerIndexes[e],delete this.availableImages[e],delete this.availableModels[e],delete this.workerSources[e],r()}checkIfReady(e,t,r){r()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,r){this.isSpriteLoaded[t]||(this.isSpriteLoaded[t]={});const{scope:n,isLoaded:i}=r;if(this.isSpriteLoaded[t][n]=i,this.workerSources[t]&&this.workerSources[t][n])for(const r in this.workerSources[t][n]){const o=this.workerSources[t][n][r];for(const t in o){const r=o[t];r instanceof y&&(r.isSpriteLoaded=i,r.fire(new e.z("isSpriteLoaded")))}}}setImages(e,t,r){this.availableImages[e]||(this.availableImages[e]={});const{scope:n,images:i}=t;if(this.availableImages[e][n]=i,this.workerSources[e]&&this.workerSources[e][n]){for(const t in this.workerSources[e][n]){const r=this.workerSources[e][n][t];for(const e in r)r[e].availableImages=i}r()}else r()}setModels(e,{scope:t,models:r},n){if(this.availableModels[e]||(this.availableModels[e]={}),this.availableModels[e][t]=r,this.workerSources[e]&&this.workerSources[e][t]){for(const n in this.workerSources[e][t]){const i=this.workerSources[e][t][n];for(const e in i)i[e].availableModels=r}n()}else n()}setProjection(t,r){this.projections[t]=e.cm(r)}setBrightness(e,t,r){this.brightness=t,r()}setWorldview(e,t,r){this.worldview=t,r()}setLayers(e,t,r){this.getLayerIndex(e,t.scope).replace(t.layers,t.options),r()}updateLayers(e,t,r){this.getLayerIndex(e,t.scope).update(t.layers,t.removedIds,t.options),r()}loadTile(e,t,r){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).loadTile(t,r)}decodeRasterArray(e,t,r){this.getWorkerSource(e,t.type,t.source,t.scope).decodeRasterArray(t,r)}reloadTile(e,t,r){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).reloadTile(t,r)}
1abortTile(e,t,r){this.getWorkerSource(e,t.type,t.source,t.scope).abortTile(t,r)}removeTile(e,t,r){this.getWorkerSource(e,t.type,t.source,t.scope).removeTile(t,r)}removeSource(e,t,r){if(!(this.workerSources[e]&&this.workerSources[e][t.scope]&&this.workerSources[e][t.scope][t.type]&&this.workerSources[e][t.scope][t.type][t.source]))return;const n=this.workerSources[e][t.scope][t.type][t.source];delete this.workerSources[e][t.scope][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,r):r()}loadWorkerSource(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e)}}syncRTLPluginState(t,r,n){if(e.fH.isParsed())n(null,!0);else if(e.fH.isParsing())this.rtlPluginParsingListeners.push(n);else try{e.fH.setState(r);const t=e.fH.getPluginURL();!e.fH.isLoaded()||e.fH.isParsed()||e.fH.isParsing()||null==t||(e.fH.setState({pluginStatus:e.fI.parsing,pluginURL:e.fH.getPluginURL()}),this.self.importScripts(t),e.fH.isParsed()?n(null,!0):this.rtlPluginParsingListeners.push(n))}catch(e){n(e)}}setDracoUrl(e,t){this.dracoUrl=t}getAvailableImages(e,t){this.availableImages[e]||(this.availableImages[e]={});let r=this.availableImages[e][t];return r||(r=[]),r}getAvailableModels(e,t){this.availableModels[e]||(this.availableModels[e]={});let r=this.availableModels[e][t];return r||(r={}),r}getLayerIndex(e,t){this.layerIndexes[e]||(this.layerIndexes[e]={});let r=this.layerIndexes[e][t];return r||(r=this.layerIndexes[e][t]=new o,r.scope=t),r}getWorkerSource(e,t,r,n){const i=this.workerSources;return i[e]||(i[e]={}),i[e][n]||(i[e][n]={}),i[e][n][t]||(i[e][n][t]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),i[e][n][t][r]||(i[e][n][t][r]=new this.workerSourceTypes[t]({send:(t,r,n,i,o,a)=>this.actor.send(t,r,n,e,o,a),scheduler:this.actor.scheduler},this.getLayerIndex(e,n),this.getAvailableImages(e,n),this.getAvailableModels(e,n),this.isSpriteLoaded[e][n],void 0,this.brightness,this.worldview)),i[e][n][t][r]}rasterizeImagesWorker(e,t,r){const n=new Map;for(const[r,{image:i,imageVariant:o}]of t.tasks.entries()){const a=this.imageRasterizer.rasterize(o,i,t.scope,e);n.set(r,a)}r(void 0,n)}removeRasterizedImages(e,t,r){this.imageRasterizer.removeImagesFromCacheByIds(t.imageIds,t.scope,e),r()}enforceCacheSizeLimit(t,r){e.fJ(r)}getWorkerPerformanceMetrics(e,t,r){r(void 0,void 0)}}return e.fF(self)&&(self.worker=new Pe(self)),Pe})),n(["./shared"],(function(e){var t="3.18.0";const r={create:"create",load:"load",fullLoad:"fullLoad"},n={mark(e){performance.mark(e)},measure(e,t,r){performance.measure(e,t,r)}};function i(t){const r=t.name.split("?")[0];return e.a(r)&&r.includes("mapbox-gl.js")?"javascript":e.a(r)&&r.includes("mapbox-gl.css")?"css":e.b(r)?"fontRange":e.c(r)?"sprite":e.i(r)?"style":e.d(r)?"tilejson":"other"}var o,a={},s=function(){if(o)return a;function e(e){return!t(e)}function t(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{t=new Worker(n),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var r=t.getImageData(0,0,1,1);return r&&r.width===e.width}()?(void 0===r[n=t&&t.failIfMajorPerformanceCaveat]&&(r[n]=function(t){var r,n=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.getContext("webgl2",n)}(t);if(!n)return!1;try{r=n.createShader(n.VERTEX_SHADER)}catch(e){return!1}return!(!r||n.isContextLost())&&(n.shaderSource(r,"void main() {}"),n.compileShader(r),!0===n.getShaderParameter(r,n.COMPILE_STATUS))}(n)),r[n]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var n}o=1,a.supported=e,a.notSupportedReason=t;var r={};return e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},a}();function l(e,t,r){const n=document.createElement(e);return null!=t&&(n.className=t),r&&r.appendChild(n),n}function c(e,t,r){const n=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e of Object.keys(t))n.setAttributeNS(null,e,String(t[e]));return r&&r.appendChild(n),n}const u="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,d=u&&void 0!==u.userSelect?"userSelect":"WebkitUserSelect";let h;function f(){u&&d&&(h=u[d],u[d]="none")}function p(){u&&d&&(u[d]=h)}function g(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",g,!0)}function m(){window.addEventListener("click",g,!0),window.setTimeout((()=>{window.removeEventListener("click",g,!0)}),0)}function y(e,t){const r=e.getBoundingClientRect();return b(e,r,t)}function _(e,t){const r=e.getBoundingClientRect(),n=[];for(let i=0;i<t.length;i++)n.push(b(e,r,t[i]));return n}function v(e){return/firefox/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)&&2===e.button&&e.ctrlKey?0:e.button}function b(t,r,n){const i=t.offsetWidth===r.width?1:t.offsetWidth/r.width;return new e.P((n.clientX-r.left)*i,(n.clientY-r.top)*i)}const x="01",w="NO_ACCESS_TOKEN";class S{constructor(e,t,r){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!r,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",x,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(r,n){if(!e.h(r))return r;const i=T(r);return i.params.push(`sdk=js-${t}`),i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||n)}normalizeGlyphsURL(t,r){if(!e.h(t))return t;const n=T(t);return n.path=`/fonts/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||r)}normalizeModelURL(t,r){if(!e.h(t))return t;const n=T(t);return n.path=`/models/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||r)}normalizeSourceURL(t,r,n,i){if(!e.h(t))return t;const o=T(t);return o.path=`/v4/${o.authority}.json`,o.params.push("secure"),n&&o.params.push(`language=${n}`),i&&o.params.push(`worldview=${i}`),this._makeAPIURL(o,this._customAccessToken||r)}normalizeIconsetURL(t,r){const n=T(t);return e.h(t)?(n.path=`/styles/v1${n.path}/iconset.pbf`,this._makeAPIURL(n,this._customAccessToken||r)):I(n)}normalizeSpriteURL(t,r,n,i){const o=T(t);return e.h(t)?(o.path=`/styles/v1${o.path}/sprite${r}${n}`,this._makeAPIURL(o,this._customAccessToken||i)):(o.path+=`${r}${n}`,I(o))}normalizeTileURL(t,r,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!e.h(t))return t;const i=T(t);i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${r||n&&"raster"!==i.authority&&512===n?"@2x":""}${e.k.supported?".webp":"$1"}`),"raster"===i.authority?i.path=`/${e.e.RASTER_URL_PREFIX}${i.path}`:"rasterarrays"===i.authority?i.path=`/${e.e.RASTERARRAYS_URL_PREFIX}${i.path}`:"3dtiles"===i.authority?i.path=`/${e.e.TILES3D_URL_PREFIX}${i.path}`:(i.path=i.path.replace(/^.+\/v4\//,"/"),i.path=`/${e.e.TILE_URL_VERSION}${i.path}`);const o=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(i.params)||e.e.ACCESS_TOKEN;return e.e.REQUIRE_ACCESS_TOKEN&&o&&this._skuToken&&i.params.push(`sku=${this._skuToken}`),this._makeAPIURL(i,o)}canonicalizeTileURL(t,r){const n=T(t);if(!n.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!n.path.match(/\.[\w]+$/))return t;let i="mapbox://";n.path.match(/^\/raster\/v1\//)?i+=`raster/${n.path.replace(`/${e.e.RASTER_URL_PREFIX}/`,"")}`:n.path.match(/^\/rasterarrays\/v1\//)?i+=`rasterarrays/${n.path.replace(`/${e.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:i+=`tiles/${n.path.replace(`/${e.e.TILE_URL_VERSION}/`,"")}`;let o=n.params;return r&&(o=o.filter((e=>!e.match(/^access_token=/)))),o.length&&(i+=`?${o.join("&")}`),i}canonicalizeTileset(t,r){const n=!!r&&e.h(r),i=[];for(const r of t.tiles||[])e.j(r)?i.push(this.canonicalizeTileURL(r,n)):i.push(r);return i}_makeAPIURL(t,r){const n="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",i=T(e.e.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==i.path&&(t.path=`${i.path}${t.path}`),!e.e.REQUIRE_ACCESS_TOKEN)return I(t);if(r=r||e.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!r)throw new Error(`An API access token is required to use Mapbox GL. ${n}`);if("s"===r[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${n}`)}return t.params=t.params.filter((e=>-1===e.indexOf("access_token"))),t.params.push(`access_token=${r||""}`),I(t)}}const k=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function T(e){const t=e.match(k);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function I(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const M="mapbox.eventData";function E(t){if(!t)return null;const r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse(e.l(r[1]))}catch(e){return null}}class P{constructor(e){this.type=e,this.anonId=null,this.anonIdTimestamp=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const r=E(e.e.ACCESS_TOKEN);let n="";return n=r&&r.u?e.f(r.u):e.e.ACCESS_TOKEN||"",t?`${M}.${t}:${n}`:`${M}:${n}`}fetchEventData(){const t=e.s("localStorage"),r=this.getStorageKey(),n=this.getStorageKey("uuid"),i=this.getStorageKey("uuidTimestamp");if(t)try{const e=localStorage.getItem(r);e&&(this.eventData=JSON.parse(e));const t=localStorage.getItem(n);t&&(this.anonId=t);const o=localStorage.getItem(i);o&&(this.anonIdTimestamp=Number(o));const a=Date.now()-864e5;(!this.anonIdTimestamp||this.anonIdTimestamp<a)&&this.refreshUUID()}catch(t){e.w("Unable to read from LocalStorage")}}refreshUUID(){this.anonId=e.u(),this.anonIdTimestamp=Date.now()}saveEventData(){const t=e.s("localStorage"),r=this.getStorageKey(),n=this.getStorageKey("uuid"),i=this.getStorageKey("uuidTimestamp"),o=this.anonId,a=this.anonIdTimestamp;if(t&&o)try{localStorage.setItem(n,o),Object.keys(this.eventData).length>=1&&localStorage.setItem(r,JSON.stringify(this.eventData)),a&&localStorage.setItem(i,a.toString())}catch(t){e.w("Unable to write to LocalStorage")}}processRequests(e){}postEvent(t,r,n,i){if(!e.e.EVENTS_URL)return;const o=T(e.e.EVENTS_URL);o.params.push(`access_token=${i||e.e.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(t).toISOString()},s=r?Object.assign(a,r):a,l={url:I(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=e.p(l,(e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(i)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}class A extends P{constructor(e){super("metrics"),e&&(this.data=e)}postMetricsEvent(t){if(!e.e.EVENTS_URL||!t&&!e.e.ACCESS_TOKEN)return;this.anonId||this.fetchEventData(),e.v(this.anonId)||this.refreshUUID();const r=Object.assign({},this.data,{sessionId:this.anonId});this.queueRequest({timestamp:Date.now(),payload:r},t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:r}=this.queue.shift();this.postEvent(t,r,(()=>{}),e)}}const C=new class extends P{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(t,r){e.e.EVENTS_URL&&e.e.ACCESS_TOKEN&&Array.isArray(t)&&t.some((t=>e.h(t)||e.j(t)))&&this.queueRequest(Date.now(),r)}processRequests(r){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.anonIdTimestamp&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const n=E(e.e.ACCESS_TOKEN),i=n?n.u:e.e.ACCESS_TOKEN;let o=i!==this.eventData.tokenU;e.v(this.anonId)||(this.refreshUUID(),o=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(a),r=(a-this.eventData.lastSuccess)/864e5;o=o||r>=1||r<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:x,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=a,this.eventData.tokenU=i)}),r):this.processRequests()}},R=C.postTurnstileEvent.bind(C),L=new class extends P{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,r,n,i){this.skuToken=r,this.errorCb=i,e.e.EVENTS_URL&&(n||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},n):this.errorCb(new Error(w)))}processRequests(r){if(this.pendingRequest||0===this.queue.length)return;const{id:n,timestamp:i}=this.queue.shift();n&&this.success[n]||(this.anonId&&this.anonIdTimestamp||this.fetchEventData(),e.v(this.anonId)||this.refreshUUID(),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:x,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):n&&(this.success[n]=!0)}),r))}remove(){this.errorCb=null}},O=L.postMapLoadEvent.bind(L),D=new class extends P{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(t){let r=this.mapInstanceIdMap.get(t);return r||(r=e.u(),this.mapInstanceIdMap.set(t,r)),r}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(t,r){const{map:n,style:i,importedStyles:o}=r;if(!e.e.EVENTS_URL||!t&&!e.e.ACCESS_TOKEN)return;const a=this.getMapInstanceId(n),s={mapInstanceId:a,eventId:this.getEventId(a),style:i};o.length&&(s.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:s},t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:r}=this.queue.shift();this.postEvent(t,r,(()=>{}),e)}},z=D.postStyleLoadEvent.bind(D),F=new A({attributes:[{name:"maps/js/layer
1-animations/style-with-appearances"}]}),N=F.postMetricsEvent.bind(F),B=new A({attributes:[{name:"maps/js/layer-animations/runtime-appearances"}]}),j=B.postMetricsEvent.bind(B),V=new class extends P{constructor(){super("gljs.performance")}postPerformanceEvent(t,r){e.e.EVENTS_URL&&(t||e.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:r},t)}processRequests(n){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:o,performanceData:a}=this.queue.shift(),s=function(n){const o=performance.getEntriesByType("resource"),a=performance.getEntriesByType("mark"),s=function(e){const t={};if(e)for(const r in e)if("other"!==r)for(const n of e[r]){const e=`${r}ResolveRangeMin`,i=`${r}ResolveRangeMax`,o=`${r}RequestCount`,a=`${r}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,n.startTime),t[i]=Math.max(t[i]||-1/0,n.responseEnd);const s=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==n.transferSize&&0===n.transferSize&&s(a),s(o)}return t}(function(e,t){const r={};if(e)for(const n of e){const e=t(n);void 0===r[e]&&(r[e]=[]),r[e].push(n)}return r}(o,i)),l=window.devicePixelRatio,c=navigator.connection||navigator.mozConnection||navigator.webkitConnection,u=c?c.effectiveType:void 0,d={counters:[],metadata:[],attributes:[]},h=(e,t,r)=>{null!=r&&e.push({name:t,value:r.toString()})};for(const e in s)h(d.counters,e,s[e]);if(n.interactionRange[0]!==1/0&&n.interactionRange[1]!==-1/0&&(h(d.counters,"interactionRangeMin",n.interactionRange[0]),h(d.counters,"interactionRangeMax",n.interactionRange[1])),a)for(const e of Object.values(r)){const t=a.find((t=>t.name===e));t&&h(d.counters,e,t.startTime)}return h(d.counters,"visibilityHidden",n.visibilityHidden),h(d.attributes,"style",function(t){if(t)for(const r of t){const t=r.name.split("?")[0];if(e.i(t)){const e=t.split("/").slice(-2);if(2===e.length)return`mapbox://styles/${e[0]}/${e[1]}`}}}(o)),h(d.attributes,"terrainEnabled",n.terrainEnabled?"true":"false"),h(d.attributes,"fogEnabled",n.fogEnabled?"true":"false"),h(d.attributes,"projection",n.projection),h(d.attributes,"zoom",n.zoom),h(d.metadata,"devicePixelRatio",l),h(d.metadata,"connectionEffectiveType",u),h(d.metadata,"navigatorUserAgent",navigator.userAgent),h(d.metadata,"screenWidth",window.screen.width),h(d.metadata,"screenHeight",window.screen.height),h(d.metadata,"windowWidth",window.innerWidth),h(d.metadata,"windowHeight",window.innerHeight),h(d.metadata,"mapWidth",n.width/l),h(d.metadata,"mapHeight",n.height/l),h(d.metadata,"webglRenderer",n.renderer),h(d.metadata,"webglVendor",n.vendor),h(d.metadata,"sdkVersion",t),h(d.metadata,"sdkIdentifier","mapbox-gl-js"),d}(a);for(const e of s.metadata);for(const e of s.counters);for(const e of s.attributes);this.postEvent(o,s,(()=>{}),n)}},G=V.postPerformanceEvent.bind(V),U=new class extends P{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,r,n,i){if(!e.e.API_URL||!e.e.SESSION_PATH)return;const o=T(e.e.API_URL+e.e.SESSION_PATH);o.params.push(`sku=${r||""}`),o.params.push(`access_token=${i||e.e.ACCESS_TOKEN||""}`);const a={url:I(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=e.g(a,(e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(i)}))}getSessionAPI(t,r,n,i){this.skuToken=r,this.errorCb=i,e.e.SESSION_PATH&&e.e.API_URL&&(n||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},n):this.errorCb(new Error(w)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||this.getSession(r,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},$=U.getSessionAPI.bind(U),H=new Set;function q(e,t){t?H.add(e):H.delete(e)}class W{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty()}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(e){return this._updatedImages[e]?Array.from(this._updatedImages[e].values()):[]}updateImage(t,r){this._updatedImages[r]=this._updatedImages[r]||new Set,this._updatedImages[r].add(e.I.toString(t)),this.setDirty()}resetUpdatedImages(e){this._updatedImages[e]&&this._updatedImages[e].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}function Z(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class Y extends e.E{constructor(t){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.dirty=!0,this.spriteFormat=t,"raster"!==t&&e.r()&&(this.imageRasterizerDispatcher=new e.D(e.t(),this,"Image Rasterizer Worker",1))}addScope(t){this.loaded.set(t,!1),this.imageProviders.set(t,new Map),this.images.set(t,new Map),this.updatedImages.set(t,new Set),this.callbackDispatchedThisFrame.set(t,new Set),this.patterns.set(t,new Map),this.atlasImage.set(t,new e.q({width:1,height:1}))}removeScope(e){this.loaded.delete(e),this.imageProviders.delete(e),this.images.delete(e),this.updatedImages.delete(e),this.callbackDispatchedThisFrame.delete(e),this.patterns.delete(e),this.atlasImage.delete(e);const t=this.atlasTexture.get(e);t&&(t.destroy(),this.atlasTexture.delete(e))}addImageProvider(e,t){this.imageProviders.has(t)||this.imageProviders.set(t,new Map),this.imageProviders.get(t).set(e.id,e)}removeImageProvider(e,t){this.imageProviders.has(t)&&this.imageProviders.get(t).delete(e)}getPendingImageProviders(){const e=[];for(const t of this.imageProviders.values())for(const r of t.values())r.hasPendingRequests()&&e.push(r);return e}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new e.x),this._imageRasterizer}isLoaded(){for(const e of this.loaded.keys())if(!this.loaded.get(e))return!1;return!0}setLoaded(e,t){if(this.loaded.get(t)!==e&&(this.loaded.set(t,e),e)){for(const{ids:e,callback:r}of this.requestors)this._notify(e,t,r);this.requestors=[]}}hasImage(e,t){return!!this.getImage(e,t)}getImage(e,t){return this.images.get(t).get(e.toString())}
1addImage(e,t,r){this._validate(e,r)&&this.images.get(t).set(e.toString(),r)}_validate(t,r){let n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new e.y(new Error(`Image "${t.name}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new e.y(new Error(`Image "${t.name}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.y(new Error(`Image "${t.name}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let r=0;for(const n of e){if(n[0]<r||n[1]<n[0]||t<n[1])return!1;r=n[1]}return!0}_validateContent(e,t){if(!e)return!0;if(4!==e.length)return!1;if(!t.usvg){if(e[0]<0||t.data.width<e[0])return!1;if(e[1]<0||t.data.height<e[1])return!1;if(e[2]<0||t.data.width<e[2])return!1;if(e[3]<0||t.data.height<e[3])return!1}return!(e[2]<e[0]||e[3]<e[1])}updateImage(e,t,r){const n=this.images.get(t).get(e.toString());r.version=n.version+1,this.images.get(t).set(e.toString(),r),this.updatedImages.get(t).add(e),this.removeFromImageRasterizerCache(e,t)}clearUpdatedImages(e){this.updatedImages.get(e).clear()}removeFromImageRasterizerCache(t,r){"raster"!==this.spriteFormat&&(e.r()?this.imageRasterizerDispatcher.getActor().send("removeRasterizedImages",{imageIds:[t],scope:r}):this.imageRasterizer.removeImagesFromCacheByIds([t],r))}removeImage(e,t){const r=this.images.get(t),n=r.get(e.toString());r.delete(e.toString()),this.patterns.get(t).delete(e.toString()),this.removeFromImageRasterizerCache(e,t),n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(t){return Array.from(this.images.get(t).keys()).map((t=>e.I.from(t)))}getImages(e,t,r){const n=[],i=[],o=this.imageProviders.get(t);for(const r of e){if(!r.iconsetId){n.push(r);continue}const e=o.get(r.iconsetId);e&&(this.getImage(r,t)?i.push(r):e.addPendingRequest(r))}if(0===n.length)return void this._notify(i,t,r);let a=!0;const s=!!this.loaded.get(t),l=this.images.get(t);if(!s)for(const e of n)l.has(e.toString())||(a=!1);s||a?this._notify(n,t,r):this.requestors.push({ids:n,scope:t,callback:r})}rasterizeImages(e,t){const r=new Map,{tasks:n,scope:i}=e;for(const[e,t]of n.entries()){const n=this.getImage(t.id,i);n&&r.set(e,{image:n,imageVariant:t})}this._rasterizeImages(i,r,t)}_rasterizeImages(t,r,n){if(e.r())this.imageRasterizerDispatcher.getActor().send("rasterizeImagesWorker",{tasks:r,scope:t},n);else{const e=new Map;for(const[n,{image:i,imageVariant:o}]of r.entries())e.set(n,this.imageRasterizer.rasterize(o,i,t,0));n(void 0,e)}}getUpdatedImages(e){return this.updatedImages.get(e)||new Set}_notify(t,r,n){const i=this.images.get(r),o=new Map;for(const r of t){if(!i.get(r.toString())){if(r.iconsetId)continue;this.fire(new e.z("styleimagemissing",{id:r.name}))}const t=i.get(r.toString());if(!t){e.w(`Image "${r.name}" 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.`);continue}const n={data:t.usvg?null:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,usvg:t.usvg,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)};t.usvg&&Object.assign(n,{width:t.icon.usvg_tree.width,height:t.icon.usvg_tree.height}),o.set(e.I.toString(r),n)}n(null,o)}getPixelSize(e){const{width:t,height:r}=this.atlasImage.get(e);return{width:t,height:r}}getPattern(t,r,n){const i=t.toString(),o=this.patterns.get(r),a=o.get(i),s=this.getImage(t,r);if(!s)return null;if(a){if(a.position.version===s.version)return a.position;a.position.version=s.version}else{if(s.usvg&&!s.data){const o=this.getPatternInFlightId(i,r);if(this.patternsInFlight.has(o))return null;this.patternsInFlight.add(o);const a=new e.A(t).scaleSelf(e.o.devicePixelRatio),l=new Map([[a.toString(),{image:s,imageVariant:a}]]);return this._rasterizeImages(r,l,((e,t)=>this.storePatternImage(a,r,s,n,t))),null}this.storePattern(t,r,s)}return this._updatePatternAtlas(r,n),o.get(i).position}getPatternInFlightId(t,r){return e.B(t,r)}hasPatternsInFlight(){return 0!==this.patternsInFlight.size}storePatternImage(e,t,r,n,i){const o=e.toString(),a=i?i.get(o):void 0;a&&(r.data=a,this.storePattern(e.id,t,r),this._updatePatternAtlas(t,n),this.patternsInFlight.delete(this.getPatternInFlightId(e.id.toString(),t)))}storePattern(t,r,n){const i={w:n.data.width+2*e.C,h:n.data.height+2*e.C,x:0,y:0},o=new e.F(i,n,e.C);this.patterns.get(r).set(t.toString(),{bin:i,position:o})}destroyAtlasTextures(){for(const e of this.atlasTexture.values())e&&e.destroy();this.atlasTexture.clear()}bind(t,r){const n=t.gl;let i=this.atlasTexture.get(r);i?this.dirty&&(i.update(this.atlasImage.get(r)),this.dirty=!1):(i=new e.T(t,this.atlasImage.get(r),n.RGBA8),this.atlasTexture.set(r,i)),i.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(t,r){const n=this.patterns.get(t),i=Array.from(n.values()).map((({bin:e})=>e)),{w:o,h:a}=e.G(i),s=this.atlasImage.get(t);s.resize({width:o||1,height:a||1});const l=this.images.get(t);for(const[t,{bin:i,position:o}]of n.entries()){let n=o.padding;const a=i.x+n,c=i.y+n,u=l.get(t).data,d=u.width,h=u.height;n=n>
11?n-1:n,e.q.copy(u,s,{x:0,y:0},{x:a,y:c},{width:d,height:h},r),e.q.copy(u,s,{x:0,y:h-n},{x:a,y:c-n},{width:d,height:n},r),e.q.copy(u,s,{x:0,y:0},{x:a,y:c+h},{width:d,height:n},r),e.q.copy(u,s,{x:d-n,y:0},{x:a-n,y:c},{width:n,height:h},r),e.q.copy(u,s,{x:0,y:0},{x:a+d,y:c},{width:n,height:h},r),e.q.copy(u,s,{x:d-n,y:h-n},{x:a-n,y:c-n},{width:n,height:n},r),e.q.copy(u,s,{x:0,y:h-n},{x:a+d,y:c-n},{width:n,height:n},r),e.q.copy(u,s,{x:0,y:0},{x:a+d,y:c+h},{width:n,height:n},r),e.q.copy(u,s,{x:d-n,y:0},{x:a-n,y:c+h},{width:n,height:n},r)}this.dirty=!0}beginFrame(){for(const e of this.images.keys())this.callbackDispatchedThisFrame.set(e,new Set)}dispatchRenderCallbacks(e,t){const r=this.images.get(t);for(const n of e){if(this.callbackDispatchedThisFrame.get(t).has(n.toString()))continue;this.callbackDispatchedThisFrame.get(t).add(n.toString());const e=r.get(n.toString());Z(e)&&this.updateImage(n,t,e)}}destroy(){this.imageRasterizerDispatcher&&this.imageRasterizerDispatcher.remove()}}function X(t){const r=t.value,n=t.valueSpec,i=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||_e;if(!Array.isArray(r))return[new e.V(a,r,`array expected, ${e.K(r)} found`)];if(n.length&&r.length!==n.length)return[new e.V(a,r,`array length ${n.length} expected, length ${r.length} found`)];if(n["min-length"]&&r.length<n["min-length"])return[new e.V(a,r,`array length at least ${n["min-length"]} expected, length ${r.length} found`)];let l={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum,function:void 0};o.$version<7&&(l.function=n.function),e.H(n.value)&&(l=n.value);let c=[];for(let e=0;e<r.length;e++)c=c.concat(s({array:r,arrayIndex:e,value:r[e],valueSpec:l,style:i,styleSpec:o,key:`${a}[${e}]`},!0));return c}function K(t){const r=t.key,n=t.value,i=t.valueSpec;if(!e.L(n))return[new e.V(r,n,`number expected, ${e.K(n)} found`)];if(n!=n)return[new e.V(r,n,"number expected, NaN found")];if("minimum"in i){let o=i.minimum;if(Array.isArray(i.minimum)&&(o=i.minimum[t.arrayIndex]),n<o)return[new e.V(r,n,`${n} is less than the minimum value ${o}`)]}if("maximum"in i){let o=i.maximum;if(Array.isArray(i.maximum)&&(o=i.maximum[t.arrayIndex]),n>o)return[new e.V(r,n,`${n} is greater than the maximum value ${o}`)]}return[]}function J(t){const r=t.key,n=t.value;if(!e.H(n))return[new e.V(r,n,`object expected, ${e.K(n)} found`)];const i=t.valueSpec,o=e.J(n.type);let a,s,l,c={};const u="categorical"!==o&&void 0===n.property,d=!u,h=function(t){const r=t.stops;return Array.isArray(r)&&Array.isArray(r[0])&&e.H(r[0][0])}(n),f=ve({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new e.V(t.key,t.value,'identity function may not have a "stops" property')];let r=[];const n=t.value;return r=r.concat(X({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),Array.isArray(n)&&0===n.length&&r.push(new e.V(t.key,n,"array must have at least one stop")),r},default:function(e){return _e({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===o&&u&&f.push(new e.V(t.key,t.value,'missing required property "property"')),"identity"===o||n.stops||f.push(new e.V(t.key,t.value,'missing required property "stops"')),"exponential"===o&&i.expression&&!e.M(i)&&f.push(new e.V(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(d&&!e.N(i)?f.push(new e.V(t.key,t.value,"property functions not supported")):u&&!e.O(i)&&f.push(new e.V(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!h||void 0!==n.property||f.push(new e.V(t.key,t.value,'"property" property is required')),f;function p(t){let r=[];const n=t.value,o=t.key;if(!Array.isArray(n))return[new e.V(o,n,`array expected, ${e.K(n)} found`)];if(2!==n.length)return[new e.V(o,n,`array length 2 expected, length ${n.length} found`)];if(h){if(!e.H(n[0]))return[new e.V(o,n,`object expected, ${e.K(n[0])} found`)];const i=n[0];if(void 0===i.zoom)return[new e.V(o,n,"object stop key must have zoom")];if(void 0===i.value)return[new e.V(o,n,"object stop key must have value")];const a=e.J(i.zoom);if("number"!=typeof a)return[new e.V(o,i.zoom,"stop zoom values must be numbers")];if(l&&l>a)return[new e.V(o,i.zoom,"stop zoom values must appear in ascending order")];
1a!==l&&(l=a,s=void 0,c={}),r=r.concat(ve({key:`${o}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:K,value:g}}))}else r=r.concat(g({key:`${o}[0]`,value:n[0],style:t.style,styleSpec:t.styleSpec},n));return e.Q(e.S(n[1]))?r.concat([new e.V(`${o}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(_e({key:`${o}[1]`,value:n[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function g(t,r){const n=e.K(t.value),l=e.J(t.value),u=null!==t.value?t.value:r;if(a){if(n!==a)return[new e.V(t.key,u,`${n} stop domain type must match previous stop domain type ${a}`)]}else a=n;if("number"!==n&&"string"!==n&&"boolean"!==n&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new e.V(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==n&&"categorical"!==o){let r=`number expected, ${n} found`;return e.N(i)&&void 0===o&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e.V(t.key,u,r)]}return"categorical"!==o||"number"!==n||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===n&&"number"==typeof l&&"number"==typeof s&&void 0!==s&&l<s?[new e.V(t.key,u,"stop domain values must appear in ascending order")]:(s=l,"categorical"===o&&l in c?[new e.V(t.key,u,"stop domain values must be unique")]:(c[l]=!0,[])):[new e.V(t.key,u,`integer expected, found ${String(l)}`)]}}function Q(t){const r=("property"===t.expressionContext?e.W:e.U)(e.S(t.value),t.valueSpec);if("error"===r.result)return r.value.map((r=>new e.V(`${t.key}${r.key}`,t.value,r.message)));const n=r.value.expression||r.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new e.V(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!e.Z(n))return[new e.V(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return ee(n,t);if("appearance"===t.expressionContext)return te(n,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!e.X(n,["zoom","feature-state"]))return[new e.V(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!e.Y(n))return[new e.V(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ee(t,r){const n=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(r.valueSpec&&r.valueSpec.expression)for(const e of r.valueSpec.expression.parameters)n.delete(e);if(0===n.size)return[];const i=[];return t instanceof e._&&n.has(t.name)?[new e.V(r.key,r.value,`["${t.name}"] expression is not supported in a filter for a ${r.object.type} layer with id: ${r.object.id}`)]:(t.eachChild((e=>{i.push(...ee(e,r))})),i)}function te(t,r){const n=new Set;if(r.valueSpec&&r.valueSpec.expression)for(const e of r.valueSpec.expression.parameters)n.add(e);if(0===n.size)return[];const i=[];return t instanceof e._&&!n.has(t.name)?[new e.V(r.key,r.value,`["${t.name}"] is not an allowed parameter`)]:(t.eachChild((e=>{i.push(...te(e,r))})),i)}function re(t){const r=t.key,n=t.value,i=t.valueSpec,o=[];return Array.isArray(i.values)?-1===i.values.indexOf(e.J(n))&&o.push(new e.V(r,n,`expected one of [${i.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(i.values).indexOf(e.J(n))&&o.push(new e.V(r,n,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(n)} found`)),o}function ne(t){return e.a2(e.S(t.value))?Q(Object.assign({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):ie(t)}function ie(t){const r=t.value,n=t.key;if(!Array.isArray(r))return[new e.V(n,r,`array expected, ${e.K(r)} found`)];if(r.length<1)return[new e.V(n,r,"filter array must have at least 1 element")];const i=t.styleSpec;let o=re({key:`${n}[0]`,value:r[0],valueSpec:i.filter_operator});const a=()=>{r.length>=2&&(e.a0(r[1])||o.push(new e.V(`${n}[1]`,r[1],`string expected, ${e.K(r[1])} found`)));for(let t=2;t<r.length;t++)"$type"===e.J(r[1])?o=o.concat(re({key:`${n}[${t}]`,value:r[t],valueSpec:i.geometry_type})):e.a0(r[t])||e.L(r[t])||e.$(r[t])||o.push(new e.V(`${n}[${t}]`,r[t],`string, number, or boolean expected, ${e.K(r[t])} found.`))};switch(e.J(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===e.J(r[1])&&o.push(new e.V(n,r,`"$type" cannot be use with operator "${r[0]}"`)),3!==r.length&&o.push(new e.V(n,r,`filter array for operator "${r[0]}" must have 3 elements`)),a();break;case"==":case"!=":3!==r.length&&o.push(new e.V(n,r,`filter array for operator "${r[0]}" must have 3 elements`)),a();break;case"in":case"!in":a();break;case"any":case"all":case"none":for(let e=1;e<r.length;e++)o=o.concat(ie({key:`${n}[${e}]`,value:r[e],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":2!==r.length?o.push(new e.V(n,r,`filter array for "${r[0]}" operator must have 2 elements`)):e.a0(r[1])||o.push(new e.V(`${n}[1]`,r[1],`string expected, ${e.K(r[1])} found`))}return o}function oe(t,r){const n=t.key,i=t.style,o=t.layer,a=t.styleSpec,s=t.value,l=t.objectKey,c=a[`${r}_${t.layerType}`];if(!c)return[];const u=l.match(/^(.*)-use-theme$/);if(u&&c[u[1]])return e.Q(e.S(s))?[].concat(_e({key:n,value:s,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:i,styleSpec:a,expressionContext:"property",propertyType:r,propertyKey:l})):_e({key:n,value:s,valueSpec:{type:"string"},style:i,styleSpec:a});const d=l.match(/^(.*)-transition$/);if("paint"===r&&d&&c[d[1]]&&c[d[1]].transition)return _e({key:n,value:s,valueSpec:a.transition,style:i,styleSpec:a});const h=t.valueSpec||c[l];if(!h)return[new e.a3(n,s,`unknown property "${l}"`)];let f;if(e.a0(s)&&e.N(h)&&!h.tokens&&(f=/^{([^}]+)}$/.exec(s))){const t=`\`{ "type": "identity", "property": ${f?JSON.stringify(f[1]):'"_"'} }\``;return[new e.V(n,s,`"${l}" does not support interpolation syntax\nUse an identity property function instead: ${t}.`)]}const p=[];if("symbol"===t.layerType)"text-field"!==l||!i||i.glyphs||i.imports||p.push(new e.V(n,s,'use of "text-field" requires a style "glyphs" property')),"text-font"===l&&e.a4(e.S(s))&&"identity"===e.J(s.type)&&p.push(new e.V(n,s,'"text-font" does not support identity functions'));else if("model"===t.layerType&&"paint"===r&&o&&o.layout&&o.layout.hasOwnProperty("model-id")&&e.N(h)&&(e.a5(h)||e.O(h))){const t=e.W(e.S(s),h).value,r="expression"in t&&t.expression||"_styleExpression"in t&&t._styleExpression&&t._styleExpression.expression;r&&!e.X(r,["measure-light"])&&("model-emissive-strength"===l&&e.Y(r)&&e.Z(r)||p.push(new e.V(n,s,`${l} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return p.concat(_e({key:t.key,value:s,valueSpec:h,style:i,styleSpec:a,expressionContext:"property",propertyType:r,propertyKey:l}))}function ae(e){return oe(e,"paint")}function se(e){return oe(e,"layout")}function le(t){let r=[];const n=t.value,i=t.key,o=t.style,a=t.styleSpec;if(!e.H(n))return[new e.V(i,n,"object expected")];n.type||n.ref||r.push(new e.V(i,n,'either "type" or "ref" is required'));let s=e.J(n.type);
1const l=e.J(n.ref);if(n.id){const a=e.J(n.id);for(let s=0;s<t.arrayIndex;s++){const t=o.layers[s];e.J(t.id)===a&&r.push(new e.V(i,n.id,`duplicate layer id "${a}", previously used at line ${t.id.__line__}`))}}if("ref"in n){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in n&&r.push(new e.V(i,n[t],`"${t}" is prohibited for ref layers`))})),o.layers.forEach((r=>{e.J(r.id)===l&&(t=r)})),t?t.ref?r.push(new e.V(i,n.ref,"ref cannot reference another ref layer")):s=e.J(t.type):"string"==typeof l&&r.push(new e.V(i,n.ref,`ref layer "${l}" not found`))}else if("background"!==s&&"sky"!==s&&"slot"!==s)if(n.source)if(e.a0(n.source)){const t=o.sources&&o.sources[n.source],a=t&&e.J(t.type);t?"vector"===a&&"raster"===s?r.push(new e.V(i,n.source,`layer "${n.id}" requires a raster source`)):"raster"===a&&"raster"!==s?r.push(new e.V(i,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==a||n["source-layer"]?"raster-dem"===a&&"hillshade"!==s?r.push(new e.V(i,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==a||["raster","raster-particle"].includes(s)?"line"===s&&n.paint&&(n.paint["line-gradient"]||n.paint["line-trim-offset"])&&"geojson"===a&&!t.lineMetrics?r.push(new e.V(i,n,`layer "${n.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"raster-particle"===s&&"raster-array"!==a&&r.push(new e.V(i,n.source,`layer "${n.id}" requires a 'raster-array' source.`)):r.push(new e.V(i,n.source,"raster-array source can only be used with layer type 'raster'.")):r.push(new e.V(i,n,`layer "${n.id}" must specify a "source-layer"`)):r.push(new e.V(i,n.source,`source "${n.source}" not found`))}else r.push(new e.V(`${i}.source`,n.source,'"source" must be a string'));else r.push(new e.V(i,n,'missing required property "source"'));return r=r.concat(ve({key:i,value:n,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>_e({key:`${i}.type`,value:n.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"}),filter:e=>ne(Object.assign({layerType:s},e)),layout:e=>ve({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>se(Object.assign({layerType:s},e))}}),paint:e=>ve({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>ae(Object.assign({layerType:s,layer:n},e))}}),appearances(t){const r=X({key:t.key,value:t.value,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:t=>function(t){const{key:r,layer:n,layerType:i}=t,o=e.J(t.value),a=e.J(o.name),s=e.J(o.condition),l=ve({key:r,value:o,valueSpec:t.styleSpec.appearance,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{condition:t=>function(t){const r=[];return r.push(...Q({key:t.key,value:t.object.condition,valueSpec:e.a6.appearance.condition,expressionContext:"appearance"})),r}(Object.assign({layer:n,layerType:i},t)),properties:t=>function(t){const r=[],{styleSpec:n,layer:i,layerType:o}=t,a=n[`paint_${o}`],s=n[`layout_${o}`],l=t.object[t.objectKey];for(const n in l){const c=n in a?"paint":n in s?"layout":void 0;if(!c){r.push(new e.V(t.key,n,`unknown property "${n}" for layer type "${o}"`));continue}const u=Object.assign({},t,{key:`${t.key}.${n}`,object:l,objectKey:n,layer:i,layerType:o,value:l[n],valueSpec:"paint"===c?a[n]:s[n]});r.push(...oe(u,c))}return r}(Object.assign({layer:n,layerType:i},t))}});return"hidden"!==a&&void 0===s&&l.push(new e.V(t.key,"name",'Appearance with name different than "hidden" must have a condition')),l}(Object.assign({layerType:s,layer:n},t))}),i=Array.isArray(t.value)?t.value:[],o=new Set;return i.forEach(((i,a)=>{const s=e.J(i.name);if(s)if(o.has(s)){const i=e.J(n.id);r.push(new e.V(t.key,s,`Duplicated appearance name "${s}" for layer "${i}"`))}else o.add(s)})),r}}})),r}function ce({key:t,value:r}){return e.a0(r)?[]:[new e.V(t,r,`string expected, ${e.K(r)} found`)]}const ue={promoteId:function t({key:r,value:n}){if(e.a0(n))return ce({key:r,value:n});if(Array.isArray(n)){const t=[],i=e.S(n),o=e.U(i);return"error"===o.result&&o.value.forEach((n=>{t.push(new e.V(`${r}${n.key}`,null,`${n.message}`))})),e.X(o.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||t.push(new e.V(`${r}`,null,"promoteId expression should be only feature dependent")),t}
1if(!e.H(n))return[new e.V(r,n,`string, expression or object expected, "${e.K(n)}" found`)];const i=[];for(const e in n)i.push(...t({key:`${r}.${e}`,value:n[e]}));return i}};function de(t){const r=t.value,n=t.key,i=t.styleSpec,o=t.style;if(!e.H(r))return[new e.V(n,r,`object expected, ${e.K(r)} found`)];if(!("type"in r))return[new e.V(n,r,'"type" is required')];const a=e.J(r.type);let s=[];switch(["vector","raster","raster-dem","raster-array"].includes(a)&&("url"in r||"tiles"in r||s.push(new e.a3(n,r,'Either "url" or "tiles" is required.'))),a){case"vector":case"raster":case"raster-dem":case"raster-array":return s=s.concat(ve({key:n,value:r,valueSpec:i[`source_${a.replace("-","_")}`],style:t.style,styleSpec:i,objectElementValidators:ue})),s;case"geojson":if(s=ve({key:n,value:r,valueSpec:i.source_geojson,style:o,styleSpec:i,objectElementValidators:ue}),"cluster"in r&&"clusterProperties"in r){if(!e.H(r.clusterProperties))return[new e.V(`${n}.clusterProperties`,r,`object expected, ${e.K(r)} found`)];for(const t in r.clusterProperties){const i=r.clusterProperties[t];if(!Array.isArray(i))return[new e.V(`${n}.clusterProperties.${t}`,i,"array expected")];const[o,a]=i,l="string"==typeof o?[o,["accumulated"],["get",t]]:o;s.push(...Q({key:`${n}.${t}.map`,value:a,expressionContext:"cluster-map"})),s.push(...Q({key:`${n}.${t}.reduce`,value:l,expressionContext:"cluster-reduce"}))}}return s;case"video":return ve({key:n,value:r,valueSpec:i.source_video,style:o,styleSpec:i});case"image":return ve({key:n,value:r,valueSpec:i.source_image,style:o,styleSpec:i});case"canvas":return[new e.V(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return re({key:`${n}.type`,value:r.type,valueSpec:{values:he(i)}})}}function he(e){return e.source.reduce(((t,r)=>{const n=e[r];return"enum"===n.type.type&&(t=t.concat(Object.keys(n.type.values||{}))),t}),[])}function fe(t){const r=t.value,n=t.styleSpec,i=n.light,o=t.style;if(void 0===r)return[];if(!e.H(r))return[new e.V("light",r,`object expected, ${e.K(r)} found`)];let a=[];for(const t in r){const s=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);a=a.concat(l&&i[l[1]]?_e({key:t,value:r[t],valueSpec:{type:"string"},style:o,styleSpec:n}):s&&i[s[1]]&&i[s[1]].transition?_e({key:t,value:r[t],valueSpec:n.transition,style:o,styleSpec:n}):i[t]?_e({key:t,value:r[t],valueSpec:i[t],style:o,styleSpec:n}):[new e.V(t,r[t],`unknown property "${t}"`)])}return a}function pe(t){const r=t.value;if(!r)return[];const n=t.key;if(!e.H(r))return[new e.V(n,r,`object expected, ${e.K(r)} found`)];let i=[];const o=t.styleSpec,a=o["light-3d"],s=t.style,l=t.style.lights;for(const t of["type","id"])if(!(t in r))return i=i.concat([new e.V(n,r,`missing property "${t}"`)]),i;if(!e.a0(r.type))return i=i.concat([new e.V(`${n}.type`,r.type,"string expected")]),i;if(l)for(let o=0;o<t.arrayIndex;o++){const t=e.J(r.type),a=l[o];e.J(a.type)===t&&i.push(new e.V(n,r.id,`duplicate light type "${r.type}", previously defined at line ${a.id.__line__}`))}const c=`properties_light_${r.type}`;if(!(c in o))return i=i.concat([new e.V(`${n}.type`,r,`Invalid light type ${r.type}`)]),i;const u=o[c];for(const n in r)if("properties"===n){const a=r[n];if(!e.H(a))return i=i.concat([new e.V("properties",a,`object expected, ${e.K(a)} found`)]),i;for(const l in a){const c=l.match(/^(.*)-transition$/),d=l.match(/^(.*)-use-theme$/);i=i.concat(d&&u[d[1]]?_e({key:n,value:a[l],valueSpec:{type:"string"},style:s,styleSpec:o}):c&&u[c[1]]&&u[c[1]].transition?_e({key:n,value:r[n],valueSpec:o.transition,style:s,styleSpec:o}):u[l]?_e({key:l,value:a[l],valueSpec:u[l],style:s,styleSpec:o}):[new e.a3(t.key,a[l],`unknown property "${l}"`)])}}else i=i.concat(a[n]?_e({key:n,value:r[n],valueSpec:a[n],style:s,styleSpec:o}):[new e.a3(n,r[n],`unknown property "${n}"`)]);return i}function ge(t){const r=t.value,n=t.key,i=t.style,o=t.styleSpec,a=o.terrain;if(null==r)return[];if(!e.H(r))return[new e.V("terrain",r,`object expected, ${e.K(r)} found`)];let s=[];for(const t in r){const n=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);s=s.concat(l&&a[l[1]]?_e({key:t,value:r[t],valueSpec:{type:"string"},style:i,styleSpec:o}):n&&a[n[1]]&&a[n[1]].transition?_e({key:t,value:r[t],valueSpec:o.transition,style:i,styleSpec:o}):a[t]?_e({key:t,value:r[t],valueSpec:a[t],style:i,styleSpec:o}):[new e.a3(t,r[t],`unknown property "${t}"`)])}if(r.source)if(e.a0(r.source)){const t=i.sources&&i.sources[r.source],o=t&&e.J(t.type);t?"raster-dem"!==o&&s.push(new e.V(`${n}.source`,r.source,`terrain cannot be used with a source of type ${o}, it only be used with a "raster-dem" source type`)):s.push(new e.V(`${n}.source`,r.source,`source "${r.source}" not found`))}else s.push(new e.V(`${n}.source`,r.source,"source must be a string"));else s.push(new e.V(n,r,'terrain is missing required property "source"'));return s}function me(t){const r=t.value,n=t.style,i=t.styleSpec,o=i.fog;if(void 0===r)return[];if(!e.H(r))return[new e.V("fog",r,`object expected, ${e.K(r)} found`)];let a=[];for(const t in r){const s=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);a=a.concat(l&&o[l[1]]?_e({key:t,value:r[t],valueSpec:{type:"string"},style:n,styleSpec:i}):s&&o[s[1]]&&o[s[1]].transition?_e({key:t,value:r[t],valueSpec:i.transition,style:n,styleSpec:i}):o[t]?_e({key:t,value:r[t],valueSpec:o[t],style:n,styleSpec:i}):[new e.a3(t,r[t],`unknown property "${t}"`)])}return a}const ye={"*":()=>[],array:X,boolean:function(t){const r=t.value,n=t.key;return e.$(r)?[]:[new e.V(n,r,`boolean expected, ${e.K(r)} found`)]},number:K,color:function({key:t,value:r}){return e.a0(r)?null===e.a1.parseCSSColor(r)?[new e.V(t,r,`color expected, "${r}" found`)]:[]:[new e.V(t,r,`color expected, ${e.K(r)} found`)]},enum:re,filter:ne,function:J,layer:le,object:ve,source:de,model:e.a7,light:fe,"light-3d":pe,terrain:ge,fog:me,string:ce,formatted:function(e){return 0===ce(e).length?[]:Q(e)},resolvedImage:function(e){return 0===ce(e).length?[]:Q(e)},projection:function(t){const r=t.value,n=t.styleSpec,i=n.projection,o=t.style;if(e.H(r)){let e=[];for(const t in r)e=e.concat(_e({key:t,value:r[t],valueSpec:i[t],style:o,styleSpec:n}));return e}return e.a0(r)?[]:[new e.V("projection",r,`object or string expected, ${e.K(r)} found`)]},import:function(t){const r=t.key,{value:n,styleSpec:i}=t;if(!e.H(n))return[new e.V(r,n,"import must be an object")];const{data:o,...a}=n;Object.defineProperty(a,"__line__",{value:n.__line__,enumerable:!1});let s=ve(Object.assign({},t,{value:a,valueSpec:i.import}));return""===e.J(a.id)&&s.push(new e.V(`${t.key}.id`,a,"import id can't be an empty string")),o&&(s=s.concat(xe(o,i,{key:`${t.key}.data`}))),s},iconset:function(t){const r=t.value,n=t.key,i=t.styleSpec,o=t.style;if(!e.H(r))return[new e.V(n,r,"object expected")];if(!r.type)return[new e.V(n,r,'"type" is required')];const a=e.J(r.type);let s=[];if(s=s.concat(ve({key:n,value:r,valueSpec:i[`iconset_${a}`],style:o,styleSpec:i})),function(e,t){return!("source"!==e||!t.source)}(a,r)){const t=o.sources&&o.sources[r.source],i=t&&e.J(t.type);t?"raster-array"!==i&&s.push(new e.V(n,r.source,`iconset cannot be used with a source of type ${String(i)}, it only be used with a "raster-array" source type`)):s.push(new e.V(n,r.source,`source "${r.source}" not found`))}return s}};function _e(t,r=!1){const n=t.value,i=t.valueSpec,o=t.styleSpec;if(i.expression){if(e.a4(e.J(n)))return J(t);if(e.Q(e.S(n)))return Q(t)}if(i.type&&ye[i.type]){const e=ye[i.type](t);return!0===r&&e.length>0&&Array.isArray(t.value)?Q(t):e}return ve(Object.assign({},t,{valueSpec:i.type?o[i.type]:i}))}function ve(t){const r=t.key,n=t.value,i=t.valueSpec||{},o=t.objectElementValidators||{},a=t.style,s=t.styleSpec;if(!e.H(n))return[new e.V(r,n,`object expected, ${e.K(n)} found`)];let l=[];for(const t in n){const c=t.split(".")[0];let u;o[c]?u=o[c]:i[c]?u=_e:o["*"]?u=o["*"]:i["*"]&&(u=_e),u?l=l.concat(u({key:(r?`${r}.`:r)+t,value:n[t],valueSpec:i[c]||i["*"],style:a,styleSpec:s,object:n,objectKey:t},n)):l.push(new e.a3(r,n[t],`unknown property "${t}"`))}for(const t in i){if(o[t])continue;const a=i[t];a.required&&void 0===a.default&&void 0===n[t]&&l.push(new e.V(r,n,`missing required property "${t}"`))}return l}function be({key:t,value:r}){const n=ce({key:t,value:r});if(n.length)return n;const i=r;return-1===i.indexOf("{fontstack}")&&n.push(new e.V(t,r,'"glyphs" url must include a "{fontstack}" token')),-1===i.indexOf("{range}")&&n.push(new e.V(t,r,'"glyphs" url must include a "{range}" token')),n}function xe(t,r=e.a6,n={}){return ve({key:n.key||"",value:t,valueSpec:Object.assign(r.$root,{"*":{type:"*"}}),styleSpec:r,style:t,objectElementValidators:{glyphs:be}})}function we(t,r=e.a6){return De(xe(t,r))}const Se=e=>De(de(e)),ke=e=>De(fe(e)),Te=e=>De(pe(e)),Ie=e=>De(ge(e)),Me=e=>De(me(e)),Ee=t=>De(function(t){const r=t.value,n=t.style,i=t.styleSpec,o=i.snow;if(void 0===r)return[];if(!e.H(r))return[new e.V("snow",r,`object expected, ${e.K(r)} found`)];let a=[];for(const t in r){const s=t.match(/^(.*)-transition$/);a=a.concat(s&&o[s[1]]&&o[s[1]].transition?_e({key:t,value:r[t],valueSpec:i.transition,style:n,styleSpec:i}):o[t]?_e({key:t,value:r[t],valueSpec:o[t],style:n,styleSpec:i}):[new e.a3(t,r[t],`unknown property "${t}"`)])}return a}(t)),Pe=t=>De(function(t){const r=t.value,n=t.style,i=t.styleSpec,o=i.rain;if(void 0===r)return[];if(!e.H(r))return[new e.V("rain",r,`object expected, ${e.K(r)} found`)];let a=[];for(const t in r){const s=t.match(/^(.*)-transition$/);a=a.concat(s&&o[s[1]]&&o[s[1]].transition?_e({key:t,value:r[t],valueSpec:i.transition,style:n,styleSpec:i}):o[t]?_e({key:t,value:r[t],valueSpec:o[t],style:n,styleSpec:i}):[new e.a3(t,r[t],`unknown property "${t}"`)])}return a}(t)),Ae=e=>De(le(e)),Ce=e=>De(ne(e)),Re=e=>De(ae(e)),Le=e=>De(se(e)),Oe=t=>De(e.a7(t));function De(e){return e.slice().sort(((e,t)=>e.line&&t.line?e.line-t.line:0))}function ze(t,r){let n=!1;if(r&&r.length)for(const i of r)i instanceof e.a3?e.w(i.message):(t.fire(new e.y(new Error(i.message))),n=!0);return n}const Fe=e.a6.light;let Ne;class Be extends e.E{constructor(t,r="flat"){super(),this._transitionable=new e.a8(Ne||(Ne=new e.a9({anchor:new e.aa(Fe.anchor),position:new e.ab(Fe.position),color:new e.aa(Fe.color),intensity:new e.aa(Fe.intensity)}))),this.setLight(t,r),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,t,r={}
1){this._validate(ke,e,r)||(this._transitionable.setTransitionOrValue(e),this.id=t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,r,n){return(!n||!1!==n.validate)&&ze(this,t.call(we,Object.assign({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}}const je=e.a6.terrain;let Ve=class extends e.E{constructor(t,r,n,i,o){super(),this.scope=n,this._transitionable=new e.a8(new e.a9({source:new e.aa(je.source),exaggeration:new e.aa(je.exaggeration)}),n,i),this._transitionable.setTransitionOrValue(t,i),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=r,this.worldview=o}get(){return this._transitionable.serialize()}set(e,t){this._transitionable.setTransitionOrValue(e,t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}getExaggeration(t){return this._transitioning.possiblyEvaluate(new e.ac(t,{worldview:this.worldview})).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const t=this._transitionable._values.exaggeration;if(!t)return null;const r=t.value.expression;if(!r)return null;let n=-1,i=-1,o=1;for(const t of r.zoomStops)o=r.evaluate(new e.ac(t,{worldview:this.worldview})),o>.01?(n=t,i=-1):i=t;return o<.01&&n>0&&i>n?[n,i]:null}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof e.ad}};const Ge=.05;function Ue(t,r,n,i){const o=e.ah(45,65,n),[a,s]=$e(t,i);let l=1-Math.min(1,Math.exp((r-a)/(s-a)*-6));return l*=l*l,l=Math.min(1,1.00747*l),l*o*t.alpha}function $e(e,t){const r=.5/Math.tan(.5*t);return[e.range[0]+r,e.range[1]+r]}function He(t,r,n,i,o){const a=e.af([],[r,n,i],o.mercatorFogMatrix);return Ue(t,e.ag(a),o.pitch,o._fov)}function qe(t,r,n,i,o,a,s){const l=[[n,i,0],[o,i,0],[o,a,0],[n,a,0]];let c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(const t of l){const n=e.af([],t,r),i=e.ag(n);c=Math.min(c,i),u=Math.max(u,i)}return[Ue(t,c,s.pitch,s._fov),Ue(t,u,s.pitch,s._fov)]}const We=e.a6.fog;class Ze extends e.E{constructor(t,r,n,i){super();const o=new e.a9({range:new e.aa(We.range),color:new e.aa(We.color),"color-use-theme":new e.aa({type:"string","property-type":"data-constant",default:"default"}),"high-color":new e.aa(We["high-color"]),"high-color-use-theme":new e.aa({type:"string","property-type":"data-constant",default:"default"}),"space-color":new e.aa(We["space-color"]),"space-color-use-theme":new e.aa({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new e.aa(We["horizon-blend"]),"star-intensity":new e.aa(We["star-intensity"]),"vertical-range":new e.aa(We["vertical-range"])});this._transitionable=new e.a8(o,n,new Map(i)),this.set(t,i),this._transitioning=this._transitionable.untransitioned(),this._transform=r,this.properties=new e.ai(o),this.scope=n}get state(){const t=this._transform,r="globe"===t.projection.name,n=e.aj(t.zoom),i=this.properties.get("range"),o=[.5,3];return{range:r?[e.ak(o[0],i[0],n),e.ak(o[1],i[1],n)]:i,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(e,t,r={}){if(this._validate(Me,e,r))return;const n=Object.assign({},e);for(const e of Object.keys(We))void 0===n[e]&&(n[e]=We[e].default);this._options=n,this._transitionable.setTransitionOrValue(this._options,t)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const r=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.ah(45,65,t))*r.a}getOpacityAtLatLng(t,r){return this._transform.projection.supportsFog?function(t,r,n){const i=e.ae.fromLngLat(r),o=n.elevation?n.elevation.getAtPointOrZero(i):0;return He(t,i.x,i.y,o,n)}(this.state,t,r):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const r=this._transform.calculateFogTileMatrix(t.toUnwrapped());return qe(this.state,r,0,0,e.al,e.al,this._transform)}getOpacityForBounds(e,t,r,n,i){return this._transform.projection.supportsFog?qe(this.state,e,t,r,n,i,this._transform):[1,1]}getFovAdjustedRange(e){return this._transform.projection.supportsFog?$e(this.state,e):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const r=[4,5,6,7];for(const n of r){const r=t.points[n];let i;if(r[2]>=0)i=r;else{const o=t.points[n-4];i=e.am(o,r,o[2]/(o[2]-r[2]))}if(He(this.state,i[0],i[1],0,this._transform)>=Ge)return!0}return!1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,r,n){return(!n||!1!==n.validate)&&ze(this,t.call(we,Object.assign({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}}let Ye,Xe,Ke,Je=class extends e.E{constructor(t,r,n,i){super();const o=Ye||(Ye=new e.a9({density:new e.aa(e.a6.snow.density),intensity:new e.aa(e.a6.snow.intensity),color:new e.aa(e.a6.snow.color),opacity:new e.aa(e.a6.snow.opacity),vignette:new e.aa(e.a6.snow.vignette),"vignette-color":new e.aa(e.a6.snow["vignette-color"]),"center-thinning":new e.aa(e.a6.snow["center-thinning"]),direction:new e.aa(e.a6.snow.direction),"flake-size":new e.aa(e.a6.snow["flake-size"])}));this._transitionable=new e.a8(o,n,new Map(i)),this.set(t,i),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.ai(o),this.scope=n}get state(){const t=this.properties.get("opacity"),r=this.properties.get("color"),n=this.properties.get("direction"),i=e.an(n[0]),o=-Math.max(e.an(n[1]),.01),a=[Math.cos(i)*Math.cos(o),Math.sin(i)*Math.cos(o),Math.sin(o)],s=this.properties.get("vignette"),l=this.properties.get("vignette-color");return l.a=s,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.ao(r.r,r.g,r.b,r.a*t),direction:a,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:l}}get(){return this._transitionable.serialize()}set(t,r,n={}
1){if(this._validate(Ee,t,n))return;const i=Object.assign({},t),o=e.a6.snow;for(const e of Object.keys(o))void 0===i[e]&&(i[e]=o[e].default);this._options=i,this._transitionable.setTransitionOrValue(this._options,r)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,r,n){return(!n||!1!==n.validate)&&ze(this,t.call(we,Object.assign({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}},Qe=class extends e.E{constructor(t,r,n,i){super();const o=Xe||(Xe=new e.a9({density:new e.aa(e.a6.rain.density),intensity:new e.aa(e.a6.rain.intensity),color:new e.aa(e.a6.rain.color),opacity:new e.aa(e.a6.rain.opacity),vignette:new e.aa(e.a6.rain.vignette),"vignette-color":new e.aa(e.a6.rain["vignette-color"]),"center-thinning":new e.aa(e.a6.rain["center-thinning"]),direction:new e.aa(e.a6.rain.direction),"droplet-size":new e.aa(e.a6.rain["droplet-size"]),"distortion-strength":new e.aa(e.a6.rain["distortion-strength"])}));this._transitionable=new e.a8(o,n,new Map(i)),this.set(t,i),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.ai(o),this.scope=n}get state(){const t=this.properties.get("opacity"),r=this.properties.get("color"),n=this.properties.get("direction"),i=e.an(n[0]),o=-Math.max(e.an(n[1]),.01),a=[Math.cos(i)*Math.cos(o),Math.sin(i)*Math.cos(o),Math.sin(o)],s=this.properties.get("vignette-color");return s.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.ao(r.r,r.g,r.b,r.a*t),direction:a,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:s}}get(){return this._transitionable.serialize()}set(t,r,n={}){if(this._validate(Pe,t,n))return;const i=Object.assign({},t),o=e.a6.rain;for(const e of Object.keys(o))void 0===i[e]&&(i[e]=o[e].default);this._options=i,this._transitionable.setTransitionOrValue(this._options,r)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,r,n){return(!n||!1!==n.validate)&&ze(this,t.call(we,Object.assign({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.a6})))}};class et extends e.E{constructor(t,r,n,i){super(),this.scope=n,this._options=t,this.properties=new e.ai(r),this._transitionable=new e.a8(r,n,new Map(i)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,t){this._options=e,this._transitionable.setTransitionOrValue(e.properties,t)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}const tt=()=>Ke||(Ke=new e.a9({color:new e.aa(e.a6.properties_light_ambient.color),"color-use-theme":new e.aa({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.aa(e.a6.properties_light_ambient.intensity)}));let rt;const nt=()=>rt||(rt=new e.a9({direction:new e.ap(e.a6.properties_light_directional.direction),color:new e.aa(e.a6.properties_light_directional.color),"color-use-theme":new e.aa({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.aa(e.a6.properties_light_directional.intensity),"cast-shadows":new e.aa(e.a6.properties_light_directional["cast-shadows"]),"shadow-quality":new e.aa(e.a6.properties_light_directional["shadow-quality"]),"shadow-intensity":new e.aa(e.a6.properties_light_directional["shadow-intensity"]),"shadow-draw-before-layer":new e.aa(e.a6.properties_light_directional["shadow-draw-before-layer"])}));class it{constructor(e,t,r){this.screenBounds=e,this.cameraPoint=r.getCameraPoint(),this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=t,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,r)}static createFromScreenPoints(t,r){let n,i;if(t instanceof e.P||"number"==typeof t[0]){const o=e.P.convert(t);n=[o],i=r.isPointAboveHorizon(o)}else{const o=e.P.convert(t[0]),a=e.P.convert(t[1]),s=o.add(a)._div(2);n=[o,a],i=e.aq(o,a).every((e=>r.isPointAboveHorizon(e)))&&r.isPointAboveHorizon(s)}return new it(n,i,r)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.aq(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const r=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],i=e.aq(r,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>r.x&&this.cameraPoint.x<n.x?i.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?i[2]=this.cameraPoint:this.cameraPoint.x<=r.x&&(i[3]=this.cameraPoint)),e.ar(i,t)}bufferedCameraGeometryGlobe(t){const r=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],i=e.aq(r,n,t),o=this.cameraPoint.clone();switch(3*((o.y>r.y)+(o.y>n.y))+((o.x>r.x)+(o.x>n.x))){case 0:i[0]=o,i[4]=o.clone();break;case 1:i.splice(1,0,o);break;case 2:i[1]=o;break;case 3:i.splice(4,0,o);break;case 5:i.splice(2,0,o);break;case 6:i[3]=o;break;case 7:i.splice(3,0,o);break;case 8:i[2]=o}return i}containsTile(t,r,n,i=0){const o=Math.max(t.queryPadding,t.evaluateQueryRenderedFeaturePadding())/r._pixelsPerMercatorPixel+1,a=n?this._bufferedCameraMercator(o,r):this._bufferedScreenMercator(o,r);let s=t.tileID.wrap+(a.unwrapped?i:0);const l=a.polygon.map((r=>e.as(t.tileTransform,r,s)));if(!e.at(l,0,0,e.al,e.al))return;s=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?i:0);const c=this.screenGeometryMercator.polygon.map((r=>e.au(t.tileTransform,r,s))),u=c.map((t=>new e.P(t[0],t[1]))),d=r.getFreeCameraOptions().position||new e.ae(0,0,0),h=e.au(t.tileTransform,d,s),f=c.map((t=>{const r=e.av(t,t,h);return e.aw(r,r),new e.ax(h,r)})),p=e.ay(t,1,r.zoom)*r._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:u,tilespaceRays:f,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(g=e.az(l),g.min.x=e.aA(g.min.x,0,e.al),g.min.y=e.aA(g.min.y,0,e.al),g.max.x=e.aA(g.max.x,0,e.al),g.max.y=e.aA(g.max.y,0,e.al),g),tile:t,t
1ileID:t.tileID,pixelToTileUnitsFactor:p};var g}_bufferedScreenMercator(e,t){const r=st(e);if(this._screenRaycastCache[r])return this._screenRaycastCache[r];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._screenRaycastCache[r]=n,n}}_bufferedCameraMercator(e,t){const r=st(e);if(this._cameraRaycastCache[r])return this._cameraRaycastCache[r];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._cameraRaycastCache[r]=n,n}}_projectAndResample(t,r){const n=function(t,r){const n=e.aB([],r.pixelMatrix,r.globeMatrix),i=[0,-e.aD,0,1],o=[0,e.aD,0,1],a=[0,0,0,1];e.aC(i,i,n),e.aC(o,o,n),e.aC(a,a,n);const s=new e.P(i[0]/i[3],i[1]/i[3]),l=new e.P(o[0]/o[3],o[1]/o[3]),c=e.aE(t,s)&&i[3]<a[3],u=e.aE(t,l)&&o[3]<a[3];if(!c&&!u)return null;const d=function(e,t,r){for(let n=1;n<e.length;n++){const i=at(t.pointCoordinate3D(e[n-1]).x),o=at(t.pointCoordinate3D(e[n]).x);if(r<0){if(i<o)return{idx:n,t:-i/(o-1-i)}}else if(o<i)return{idx:n,t:(1-i)/(o+1-i)}}return null}(t,r,c?-1:1);if(!d)return null;const{idx:h,t:f}=d;let p=h>1?ot(t.slice(0,h),r):[],g=h<t.length?ot(t.slice(h),r):[];p=p.map((t=>new e.P(at(t.x),t.y))),g=g.map((t=>new e.P(at(t.x),t.y)));const m=[...p];0===m.length&&m.push(g[g.length-1]);const y=e.ak(m[m.length-1].y,(0===g.length?p[0]:g[0]).y,f);let _;return _=c?[new e.P(0,y),new e.P(0,0),new e.P(1,0),new e.P(1,y)]:[new e.P(1,y),new e.P(1,1),new e.P(0,1),new e.P(0,y)],m.push(..._),0===g.length?m.push(p[0]):m.push(...g),{polygon:m.map((t=>new e.ae(t.x,t.y))),unwrapped:!1}}(t,r);if(n)return n;const i=function(t,r){let n=!1,i=-1/0,o=0;for(let e=0;e<t.length-1;e++)t[e].x>i&&(i=t[e].x,o=e);for(let e=0;e<t.length-1;e++){const r=(o+e)%(t.length-1),i=t[r],a=t[r+1];Math.abs(i.x-a.x)>.5&&(i.x<a.x?(i.x+=1,0===r&&(t[t.length-1].x+=1)):(a.x+=1,r+1===t.length-1&&(t[0].x+=1)),n=!0)}const a=e.aF(r.center.lng);return n&&a<Math.abs(a-1)&&t.forEach((e=>{e.x-=1})),{polygon:t,unwrapped:n}}(ot(t,r).map((t=>new e.P(at(t.x),t.y))),r);return{polygon:i.polygon.map((t=>new e.ae(t.x,t.y))),unwrapped:i.unwrapped}}}function ot(t,r){return e.aG(t,(e=>{const t=r.pointCoordinate3D(e);e.x=t.x,e.y=t.y}),1/256)}function at(e){return e<0?1+e%1:e%1}function st(e){return 100*e|0}function lt(t,r,n,i,o){const a=function(n,i){if(n)return o(n);if(i){if(t.url&&i.tiles&&t.tiles&&delete t.tiles,i.variants){if(!Array.isArray(i.variants))return o(new Error("variants must be an array"));for(const e of i.variants){if(null==e||"object"!=typeof e||e.constructor!==Object)return o(new Error("variant must be an object"));if(!Array.isArray(e.capabilities))return o(new Error("capabilities must be an array"));if(1===e.capabilities.length&&"meshopt"===e.capabilities[0]){i=Object.assign(i,e);break}}}const n=e.aH(Object.assign({},i,t),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);n.tiles=r.canonicalizeTileset(n,t.url),o(null,n)}},s=function(e,t,r){if(!e)return null;if(!t&&!r)return e;r=r||e.worldview_default;const n=Object.values(e.language||{});if(0===n.length)return null;const i=Object.values(e.worldview||{});if(0===i.length)return null;const o=n.every((e=>e===t)),a=i.every((e=>e===r));return o&&a?e:t in(e.language_options||{})||r in(e.worldview_options||{})?null:e.language_options&&e.worldview_options?e:null}(t.data,n,i);return s?e.o.frame((()=>a(null,s))):t.url?e.m(r.transformRequest(r.normalizeSourceURL(t.url,null,n,i),e.R.Source),a):e.o.frame((()=>{const{data:e,...r}=t;a(null,r)}))}function ct(t,r){const n=Math.pow(2,r.z),i=Math.floor(e.aF(t.getWest())*n),o=Math.floor(e.aJ(t.getNorth())*n),a=Math.ceil(e.aF(t.getEast())*n),s=Math.ceil(e.aJ(t.getSouth())*n);return r.x>=i&&r.x<a&&r.y>=o&&r.y<s}class ut{constructor(t,r,n){this.bounds=t?e.aI.convert(this.validateBounds(t)):null,this.minzoom=r||0,this.maxzoom=n||24}
1validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}addExtraBounds(t){if(t){this.extraBounds||(this.extraBounds=[]);for(const r of t)this.extraBounds.push(e.aI.convert(this.validateBounds(r)))}}contains(e){if(e.z>this.maxzoom||e.z<this.minzoom)return!1;if(this.bounds&&!ct(this.bounds,e))return!1;if(!this.extraBounds)return!0;for(const t of this.extraBounds)if(ct(t,e))return!0;return!1}static fromTileJSON(e){if(!e.bounds&&!e.extra_bounds)return null;const t=new ut(e.bounds,e.minzoom,e.maxzoom);return t.addExtraBounds(e.extra_bounds),t}}class dt extends e.E{constructor(t,r,n,i){if(super(),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,Object.assign(this,e.aH(r,["url","scheme","tileSize","promoteId"])),this._options=Object.assign({type:"vector"},r),this._collectResourceTiming=!!r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i),this._tileWorkers={},this._deduped=new e.aK}load(t){this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"}));const r=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map.getWorldview();this._tileJSONRequest=lt(this._options,this.map._requestManager,r,n,((i,o)=>{if(this._tileJSONRequest=null,this._loaded=!0,i)r&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${r}`),n&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.y(i));else if(o){if(Object.assign(this,o),this.hasWorldviews=!!o.worldview_options,o.worldview_default&&(this.worldviewDefault=o.worldview_default),o.vector_layers){this.vectorLayers=o.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const e of o.vector_layers)this.vectorLayerIds.push(e.id),o.worldview&&o.worldview[e.source]&&this.localizableLayerIds.add(e.id)}this.tileBounds=ut.fromTileJSON(o),R(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))}t&&t(i)}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.B(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}loadTile(t,r){const n=t.tileID.canonical.url(this.tiles,this.scheme),i=this.map._requestManager.normalizeTileURL(n),o=this.map._requestManager.transformRequest(i,e.R.Tile),a=this.map.style?this.map.style.getLut(this.scope):null,s=a?{image:a.image.clone()}:null,l={request:o,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,lut:s,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
1ype,source:this.id,scope:this.scope,pixelRatio:e.o.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor(),worldview:this.map.getWorldview()||this.worldviewDefault,indoor:this.map.getIndoorTileOptions(this.id,this.scope)};if(this.hasWorldviews&&e.h(n)&&(l.localizableLayerIds=this.localizableLayerIds),l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=r:t.request=t.actor.send("reloadTile",l,c.bind(this));else if(t.actor=this._tileWorkers[i]=this._tileWorkers[i]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",l,c.bind(this),void 0,!0);else{const r=e.aL.call({deduped:this._deduped},l,((r,n)=>{if(r||!n)c.call(this,r);else{const r=e.aM(n.responseHeaders);l.data={rawData:n.rawData.slice(0),expires:r.expires,cacheControl:r.cacheControl},t.actor&&t.actor.send("loadTile",l,c.bind(this),void 0,!0)}}),!0);t.request={cancel:r}}function c(n,i){return delete t.request,t.aborted?r(null):n&&n instanceof e.aN&&404!==n.status?r(n):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.aO(this.dispatcher),r(null,i),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.t
1ype,source:this.id,scope:this.scope})}unloadTile(e,t){e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class ht extends e.E{constructor(t,r,n,i){super(),this.id=t,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=Object.assign({type:"raster"},r),Object.assign(this,e.aH(r,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"}));const r=this.map.getWorldview();this._tileJSONRequest=lt(this._options,this.map._requestManager,null,r,((r,n)=>{this._tileJSONRequest=null,this._loaded=!0,r?this.fire(new e.y(r)):n&&(Object.assign(this,n),n.raster_layers&&(this.rasterLayers=n.raster_layers,this.rasterLayerIds=this.rasterLayers.map((e=>e.id))),this.tileBounds=ut.fromTileJSON(n),R(n.tiles),this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.B(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return Object.assign({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,r){const n=e.o.devicePixelRatio>=2,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize);t.request=e.n(this.map._requestManager.transformRequest(i,e.R.Tile),((n,i,o)=>{if(delete t.request,t.aborted)return t.state="unloaded",r(null);if(n)return t.state="errored",r(n);if(!i)return r(null);const a=e.aM(o);this.map._refreshExpiredTiles&&t.setExpiryData(a),t.setTexture(i,this.map.painter),t.state="loaded",e.aO(this.dispatcher),r(null)}))}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t&&t()}unloadTile(t,r){t.texture&&t.texture instanceof e.T?(t.destroy(!1),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),r&&r()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function ft([t,r],n,i,{scaled:o=!0}={}){const{tileSize:a,buffer:s}=i,{x:l,y:c,z:u}=n;if(!isFinite(l)||!isFinite(c)||!isFinite(u))throw new Error("Invalid MRT header");const d=2**u,h=d*e.aF(t),f=d*e.aJ(r);return function([e,t],r,{scaled:n=!0}={}){if(!r)throw new Error("bandView is undefined");const{data:i,tileSize:o,buffer:a,offset:s,scale:l,dimension:c}=r;if(e<-a||e>o+a||t<-a||t>o+a)throw new Error(`Point (${e}, ${t}) out of bounds for tileSize=${o}, buffer=${a}`);const u=(t+a)*(o+2*a)+(e+a);if(4294967295===new Uint32Array(i.buffer)[u])return null;let d=[];d=n?[]:new(0,r.data.constructor)(c);for(let e=0;e<c;e++)d[e]=Math.round(1e12*(i[c*u+e]*l+s))/1e12;return d}([Math.min(Math.max(-s,Math.floor((h-l)*a)),a-1+s),Math.min(Math.max(-s,Math.floor((f-c)*a)),a-1+s)],i,{scaled:o})}class pt extends ht{constructor(e,t,r,n){super(e,t,r,n),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._loadTilePending={},this._loadTileLoaded={},this._options=Object.assign({type:"raster-array"},t)}triggerRepaint(e){const t=this.map.painter._terrain,r=this.map.style.getSourceCache(this.id);t&&t.enabled&&r&&t._clearRenderCacheForTile(r.id,e.tileID),this.map.triggerRepaint()}loadTile(t,r){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),i=this.map._requestManager.transformRequest(n,e.R.Tile),o={request:i,uid:t.uid,tileID:t.tileID,type:this.t
1ype,source:this.id,scope:this.scope,partial:this.partial};t.source=this.id,t.scope=this.scope,t.requestParams=i,t.actor||(t.actor=this.dispatcher.getActor());const a=(n,i,o)=>{if(delete t.request,t.aborted)return t.state="unloaded",r(null);if(n){if("AbortError"===n.name)return;return t.state="errored",r(n)}if(this.map._refreshExpiredTiles&&i){const r=e.aM(o);t.setExpiryData(r)}if(this.partial&&"expired"!==t.state)t.state="empty";else if(!this.partial){if(!i)return r(null);t.state="loaded",t._isHeaderLoaded=!0,t._mrt=i}r(null)};t.request=this.partial?t.fetchHeader(void 0,a.bind(this)):t.actor.send("loadTile",o,a.bind(this),void 0,!0)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(e,t){const r=e.texturePerLayer;if(e.flushAllQueues(),r.size){e.destroy(!1);for(const e of r.values())this.map.painter.saveTileTexture(e)}else e.destroy()}prepareTile(t,r,n,i){t._isHeaderLoaded&&("empty"!==t.state&&(t.state="reloading"),t.fetchBandForRender(r,n,i,((r,i)=>{if(r)return t.state="errored",this.fire(new e.y(r)),void this.triggerRepaint(t);i&&(t._isHeaderLoaded=!0,t.setTexturePerLayer(n,i,this.map.painter),t.state="loaded",this.triggerRepaint(t))})))}getInitialBand(e){if(!this.rasterLayers)return 0;const t=this.rasterLayers.find((({id:t})=>t===e)),r=t&&t.fields,n=r&&r.bands&&r.bands;return n?n[0]:0}getTextureDescriptor(t,r,n){if(!t)return;const i=r.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!i)return;let o=null;r instanceof e.aR?o=r.paint.get("raster-array-band"):r instanceof e.aS&&(o=r.paint.get("raster-particle-array-band"));const a=o||this.getInitialBand(i);if(null==a)return;if(!t.textureDescriptorPerLayer.get(r.id))return void this.prepareTile(t,i,r.id,a);if(t.updateNeeded(r.id,a)&&!n)return;const s=t.textureDescriptorPerLayer.get(r.id);return Object.assign({},s,{texture:t.texturePerLayer.get(r.id)})}getImages(t,r){const n=new Map;for(const i of t)for(const t of r){const[r,o]=t.split("/"),a=i.getLayer(r);if(!a)continue;if(!a.hasBand(o)||!a.hasDataForBand(o))continue;const{bytes:s,tileSize:l,buffer:c}=a.getBandView(o),u=l+2*c,d={data:new e.q({width:u,height:u},s),pixelRatio:2,sdf:!1,usvg:!1,version:0};n.set(t,d)}return n}queryRasterArrayValueByBandId(t,r,n){const i=r._mrt;return new Promise((o=>{const a={},s=new Set;for(const[l,c]of Object.entries(i.layers)){if(n.layerName&&l!==n.layerName)continue;const u={};a[l]=u;for(const{bands:d}of c.dataIndex)for(const h of d)n.bands&&!n.bands.includes(h)||(s.add(e.B(l,h)),r.fetchBand(l,null,h,(r=>{e.o.frame((()=>{u[h]=r?null:ft([t.lng,t.lat],i,c.getBandView(h)),s.delete(e.B(l,h)),0===s.size&&o(a)}))}),!1))}0===s.size&&o(a)}))}_loadTileForQuery(t,r){if(this._loadTileLoaded[t.uid])return void r(null,t._mrt);if(this._loadTilePending[t.uid])return void this._loadTilePending[t.uid].push(r);this._loadTilePending[t.uid]=[r];const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),i=this.map._requestManager.transformRequest(n,e.R.Tile);t.actor.send("loadTile",{request:i,uid:t.uid,tileID:t.tileID,type:this.t
1ype,source:this.id,scope:this.scope,partial:!1},((r,n,i)=>{if(r)return this._loadTilePending[t.uid].forEach((e=>e(r,null))),void delete this._loadTilePending[t.uid];if(!n)return this._loadTilePending[t.uid].forEach((e=>e(null,null))),void delete this._loadTilePending[t.uid];if(this.map._refreshExpiredTiles&&n){const r=e.aM(i);t.setExpiryData(r)}t._mrt=n,t._isHeaderLoaded=!0,t.state="loaded",this._loadTilePending[t.uid].forEach((e=>e(null,n))),this._loadTileLoaded[t.uid]=!0,delete this._loadTilePending[t.uid]}),void 0,!0)}queryRasterArrayValueByAllBands(e,t,r){return new Promise(((n,i)=>{this._loadTileForQuery(t,((o,a)=>{o?i(o):n(a?this.queryRasterArrayValueByBandId(e,t,r):null)}))}))}queryRasterArrayValue(t,r){const n=e.aT.convert(t),i=this.findLoadedParent(n);return i&&i._mrt?r.bands||!this.partial?this.queryRasterArrayValueByBandId(n,i,r):this.queryRasterArrayValueByAllBands(n,i,r):Promise.resolve(null)}findLoadedParent(t){const r=e.ae.fromLngLat(t,this.map.transform.tileSize),n=this.maxzoom+1,i=1<<n,o=Math.floor(r.x),a=Math.floor((r.x-o)*i),s=Math.floor(r.y*i),l=this.map.style.getSourceCache(this.id),c=new e.aQ(n,o,n,a,s);return l.findLoadedParent(c,this.minzoom)}}const gt={vector:dt,raster:ht,"raster-dem":class extends ht{constructor(e,t,r,n){super(e,t,r,n),this.type="raster-dem",this.maxzoom=22,this._options=Object.assign({type:"raster-dem"},t),this.encoding=t.encoding||"mapbox"}loadTile(t,r){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function i(e,n){e&&(t.state="errored",r(e)),n&&(t.dem=n,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",r(null))}t.request=e.n(this.map._requestManager.transformRequest(n,e.R.Tile),function(n,o,a){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(n)t.state="errored",r(n);else if(o){const r=e.aM(a);this.map._refreshExpiredTiles&&t.setExpiryData(r);const n=ImageBitmap&&o instanceof ImageBitmap&&e.r(),s=1-(o.width-e.aP(o.width))/2;s<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=n?o:e.o.getImageData(o,s),c={uid:t.uid,tileID:t.tileID,source:this.id,type:this.t
1ype,scope:this.scope,rawImageData:l,encoding:this.encoding,padding:s};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadTile",c,i.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,o=0===r.x?t.wrap-1:t.wrap,a=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.aQ(t.overscaledZ,o,r.z,i,r.y).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new e.aQ(t.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new e.aQ(t.overscaledZ,o,r.z,i,r.y+1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),l}},"raster-array":pt,geojson:class extends e.E{constructor(t,r,n,i){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=Object.assign({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),void 0!==r.minzoom&&(this.minzoom=r.minzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;const o=e.al/this.tileSize;this.workerOptions=Object.assign({source:this.id,scope:this.scope,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*o,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*o,extent:e.al,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:e.al,radius:(void 0!==r.clusterRadius?r.clusterRadius:50)*o,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter,dynamic:r.dynamic},r.workerOptions)}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(t){if(!this._options.dynamic)return this.fire(new e.y(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if("string"!=typeof t&&("Feature"===t.type&&(t={type:"FeatureCollection",features:[t]}),"FeatureCollection"!==t.type))return this.fire(new e.y(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&"string"!=typeof t&&"string"!=typeof this._data&&"FeatureCollection"===this._data.type){const e=new Map;
1for(const t of this._data.features)e.set(t.id,t);for(const r of t.features)e.set(r.id,r);this._data.features=[...e.values()]}else this._data=t;return this._updateWorkerData(!0),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterLeaves(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:e,limit:t,offset:r},n),this}_updateWorkerData(t=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.z("dataloading",{dataType:"source"})),this._loaded=!1;const r=Object.assign({append:t},this.workerOptions);r.scope=this.scope;const n=this._data;"string"==typeof n?(r.request=this.map._requestManager.transformRequest(e.o.resolveURL(n),e.R.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,r,((r,n)=>{if(this._loaded=!0,this._pendingLoad=null,r)this.fire(new e.y(r));else{const r={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&n&&n.resourceTiming&&n.resourceTiming[this.id]&&(r.resourceTiming=n.resourceTiming[this.id]),t&&(this._partialReload=!0),this.fire(new e.z("data",r)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(t),this._coalesce=!1)}))}loaded(){return this._loaded}reload(){const t=e.B(this.id,this.scope);this.map.style.clearSource(t),this._updateWorkerData()}loadTile(t,r){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const i=this.map.style?this.map.style.getLut(this.scope):null,o=i?{image:i.image.clone()}:null,a=this._partialReload,s={type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:o,scope:this.scope,pixelRatio:e.o.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:a,worldview:this.map.getWorldview(),indoor:this.map.getIndoorTileOptions(this.id,this.scope)};t.request=this.actor.send(n,s,((e,i)=>a&&!i?(t.state="loaded",r(null)):(delete t.request,t.destroy(!1),t.aborted?r(null):e?r(e):(t.loadVectorData(i,this.map.painter,"reloadTile"===n),r(null)))),void 0,"loadTile"===n)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e,t){this.actor.send("removeTile",{uid:e.uid,type:this.t
1ype,source:this.id,scope:this.scope}),e.destroy()}onRemove(e){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return Object.assign({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends e.aU{constructor(e,t,r,n){super(e,t,r,n),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const r of t.urls)this.urls.push(this.map._requestManager.transformRequest(r,e.R.Source).url);e.aV(this.urls,((t,r)=>{this._loaded=!0,t?this.fire(new e.y(t)):r&&(this.video=r,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.y(new e.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,r=t.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,r.RGBA8),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:e.aU,model:e.aX,"batched-model":class extends e.E{constructor(e,t,r,n){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=r,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(n)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.B(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(t){this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"}));const r=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map.getWorldview();this._tileJSONRequest=lt(this._options,this.map._requestManager,r,n,((i,o)=>{this._tileJSONRequest=null,this._loaded=!0,i?(r&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${r}`),n&&2!==n.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.y(i))):o&&(Object.assign(this,o),o.bounds&&(this.tileBounds=new ut(o.bounds,this.minzoom,this.maxzoom)),R(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)}))}hasTransition(){return!1}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}loadTile(t,r){const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,e.R.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
1ype,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:e.o.devicePixelRatio,promoteId:this.promoteId};if(t.actor&&"expired"!==t.state)if("loading"===t.state)t.reloadCallback=r;else{if(t.buckets){const e=Object.values(t.buckets);for(const t of e)t.dirty=!0;return void(t.state="loaded")}t.request=t.actor.send("reloadTile",i,o.bind(this))}else t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",i,o.bind(this),void 0,!0);function o(e,n){return t.aborted?r(null):e&&404!==e.status?r(e):(this.map._refreshExpiredTiles&&n&&t.setExpiryData(n),t.loadModelData(n,this.map.painter),t.state="loaded",void r(null))}}serialize(){return Object.assign({},this._options)}},canvas:class extends e.aU{constructor(t,r,n,i){super(t,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.y(new e.V(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.y(new e.V(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.y(new e.V(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new e.y(new e.V(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.y(new e.V(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.y(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(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(e){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof e.aW||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(r,this.canvas,r.gl.RGBA8,{premultiply:!0}),this._prepareData(r)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.E{constructor(t,r,n,i){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=r,this.setEventedParent(i),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.y(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.y(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new ut(this._implementation.bounds,this.minzoom,this.maxzoom)),r.update=this._update.bind(this),r.clearTiles=this._clearTiles.bind(this),r.coveringTiles=this._coveringTiles.bind(this),Object.assign(this,e.aH(r,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.aH(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this.map=t,this._loaded=!1,this.fire(new e.z("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:r,z:n}=e.canonical;return this._implementation.hasTile({x:t,y:r,z:n})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,t){const{x:r,y:n,z:i}=e.tileID.canonical,o=new AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:r,y:n,z:i},{signal:o.signal})).then(function(r){return delete e.request,e.aborted?(e.state="unloaded",t(null)):void 0===r?(e.state="errored",t(null)):null===r?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",t(null)):function(e){return e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof ImageBitmap||e instanceof HTMLImageElement}(r)?(this.loadTileData(e,r),e.state="loaded",void t(null)):(e.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((r=>{"AbortError"!==r.name&&(e.state="errored",t(r))})),e.request.cancel=()=>o.abort()}loadTileData(e,t){e.setTexture(t,this.map.painter)}
1unloadTile(t,r){if(t.texture&&t.texture instanceof e.T?(t.destroy(!1),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:r,z:n}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:r,z:n})}r&&r()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t&&t()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z})))}_clearTiles(){const t=e.B(this.id,this.scope);this.map.style.clearSource(t)}_update(){this.fire(new e.z("data",{dataType:"source",sourceDataType:"content"}))}}},mt=function(t,r,n,i){const o=new gt[r.type](t,r,n,i);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.aY(["load","abort","unload","serialize","prepare"],o),o};function yt(e,t,r=""){return`${r}:${t.id||""}:${t.layer.id}:${function(e){if("layerId"in e)return`layer:${e.layerId}`;{const{featuresetId:t,importId:r}=e;return`featureset:${t}${r?`:import:${r}`:""}`}}(e.target)}`}function _t(e,t,r,n=""){if(e.uniqueFeatureID){const i=yt(e,t,n);if(r.has(i))return!0;r.add(i)}return!1}function vt(e,t,r,n,i=!1,o=void 0){const a=t.sourceCache.transform,s=t.sourceCache.tilesIn(e,t.has3DLayers,i);s.sort(wt);const l=[];for(const e of s){const s=e.tile.queryRenderedFeatures(t,e,r,n,a,i,o);Object.keys(s).length&&l.push({wrappedTileID:e.tile.tileID.wrapped().key,queryResults:s})}for(const r in t.layers){const i=t.layers[r];if(i.styleLayer){const r=i.styleLayer.queryRenderedFeatures(e,t.sourceCache,n);Object.keys(r).length&&l.push({wrappedTileID:0,queryResults:r})}}return 0===l.length?{}:function(e){const t={},r={};for(const n of e){const e=n.queryResults,i=n.wrappedTileID,o=r[i]=r[i]||{};for(const r in e){const n=e[r],i=o[r]=o[r]||{},a=t[r]=t[r]||[];for(const e of n)i[e.featureIndex]||(i[e.featureIndex]=!0,a.push(e))}}return t}(l)}function bt(e,t,r,n,i,o){const a={},s=n.queryRenderedSymbols(e),l=[];for(const e of Object.keys(s).map(Number))l.push(i[e]);l.sort(wt);for(const e of l){const n=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,t,r,o);for(const t in n){const r=a[t]=a[t]||[],i=n[t];i.sort(((t,r)=>{const n=e.featureSortOrder;if(n){const e=n.indexOf(t.featureIndex);return n.indexOf(r.featureIndex)-e}return r.featureIndex-t.featureIndex}));for(const e of i)r.push(e)}}return a}function xt(e,t){const r=e.getRenderableIds().map((t=>e.getTileByID(t))),n=[],i={};for(let e=0;e<r.length;e++){const o=r[e],a=o.tileID.canonical.key;i[a]||(i[a]=!0,o.querySourceFeatures(n,t))}return n}function wt(e,t){const r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function St(e,t){const r={};if(!t)return r;for(const n of e){const e=n.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)r[t.fqid]=n}}return r}const kt=32,Tt=33,It=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,r=0,n=0,i=0,o=0,a=0,s=0;for(1&t?i=o=a=kt:r=n=s=kt;(t>>=1)>1;){const e=r+i>>1,l=n+o>>1;1&t?(i=r,o=n,r=a,n=s):(r=i,n=o,i=a,o=s),a=e,s=l}const l=4*e;It[l+0]=r,It[l+1]=n,It[l+2]=i,It[l+3]=o}const Mt=new Uint16Array(2178),Et=new Uint8Array(1089),Pt=new Uint16Array(1089);function At(e){return 0===e?-.03125:32===e?.03125:0}const Ct={type:2,extent:e.al,loadGeometry:()=>[[new e.P(0,0),new e.P(e.al+1,0),new e.P(e.al+1,e.al+1),new e.P(0,e.al+1),new e.P(0,0)]]};class Rt{constructor(t,r,n,i,o,a){this.tileID=t,this.uid=e.b2(),this.uses=0,this.tileSize=r,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=o,i&&i.style&&(this._lastUpdatedBrightness=i.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",i&&i.transform&&(this.projection=i.transform.projection),this.worldview=a,this._hasAppearances=null}registerFadeDuration(t){const r=t+this.timeAdded;r<e.o.now()||this.fadeEndTime&&r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=e.aZ(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,r,n){if(this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=St(t.buckets,r.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.b4){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.b4&&r.hasRTLText){this.hasRTLText=!0,e.b5();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e],n=r.style.getOwnLayer(e);if(!n)continue;const i=n.queryRadius(t);this.queryPadding=Math.max(this.queryPadding,i)}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness}else this.collisionBoxArray=new e.b3}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(e,t,r){e&&(e.resourceTiming&&(this.resourceTiming=e.resourceTiming),this.buckets=Object.assign({},this.buckets,St(e.buckets,t.style)),e.featureIndex&&(this.latestFeatureIndex=e.featureIndex))}getBucket(e){return this.buckets[e.fqid]}upload(t,r){for(const e in this.buckets){const n=this.buckets[e];if(n.uploadPending()){let e={},i=[],o={zoom:0,pitch:0,brightness:0,worldview:""};if(r){if(r.style){i=r.style.listImages();const t=n.layers[0],o=t.sourceLayer||"_geojsonTileLayer",a=r.style.getLayerSourceCache(t);a&&(e=a._state.getState(o,void 0))}o={zoom:r.transform.zoom||0,pitch:r.transform.pitch||0,brightness:r.style.getBrightness()||0,worldview:r.worldview||""}}n.upload(t,this.tileID.canonical,e,i,o)}}const n=t.gl,i=this.imageAtlas;i&&!i.uploaded&&(this.imageAtlasTexture=new e.T(t,i.image,n.RGBA8,{useMipmap:!!i.patternPositions.size}),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,n.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new e.T(t,this.lineAtlas.image,n.R8),this.lineAtlas.uploaded=!0)}prepare(e,t,r){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,r),!t||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const n=t.style.getBrightness();null===this._hasAppearances&&(this._hasAppearances=this.hasAppearances(t)),(this._lastUpdatedBrightness||n||this._hasAppearances)&&(!this._hasAppearances&&this._lastUpdatedBrightness&&n&&Math.abs(this._lastUpdatedBrightness-n)<.001||(this.updateBuckets(t,this._lastUpdatedBrightness!==n),this._lastUpdatedBrightness=n))}evaluateQueryRenderedFeaturePadding(){let e=0;for(const t in this.buckets){const r=this.buckets[t];r.evaluateQueryRenderedFeaturePadding&&(e=Math.max(e,r.evaluateQueryRenderedFeaturePadding()))}return e}
1queryRenderedFeatures(t,r,n,i,o,a,s){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const l=this.evaluateQueryRenderedFeaturePadding(),c=function(t,r){const n=e.bq([],[.5*t.width,.5*-t.height,1]);return e.br(n,n,[1,-1,0]),e.aB(n,n,t.calculateProjMatrix(r.toUnwrapped())),Float32Array.from(n)}(o,this.tileID);return this.latestFeatureIndex.query(t,{tilespaceGeometry:r,pixelPosMatrix:c,transform:i,availableImages:n,tileTransform:this.tileTransform,worldview:this.worldview,queryRadius:l,scope:s})}querySourceFeatures(t,r){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),o=r?r.sourceLayer:"",a=i._geojsonTileLayer||i[o];if(!a)return;const s=e.b6(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,d={z:l,x:c,y:u};for(let r=0;r<a.length;r++){const i=a.feature(r);if(s.needGeometry){const t=e.b7(i,!0);if(!s.filter(new e.ac(this.tileID.overscaledZ,{worldview:this.worldview}),t,this.tileID.canonical))continue}else if(!s.filter(new e.ac(this.tileID.overscaledZ,{worldview:this.worldview}),i))continue;const h=n.getId(i,o),f=new e.b8(i,l,c,u,h);f.tile=d,t.push(f)}}loaded(){return"loaded"===this.state||"errored"===this.state}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(t){const r=this.expirationTime;if(t.cacheControl){const r=e.b9(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const e=Date.now();let t=!1;if(this.expirationTime>e)t=!1;else if(r)if(this.expirationTime<r)t=!0;else{const n=this.expirationTime-r;n?this.expirationTime=e+Math.max(n,3e4):t=!0}else t=!0;t?(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)}refreshFeatureState(e){this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)&&e&&this.updateBuckets(e)}hasAppearances(e){for(const t in this.buckets)if(e.style.hasLayer(t)&&this.buckets[t].layers.some((e=>e.appearances&&e.appearances.length>0)))return!0;return!1}updateBuckets(t,r){if(!this.latestFeatureIndex)return;if(!t.style)return;const n=t.style.listImages(),i=t.style.getBrightness();for(const o in this.buckets){if(!t.style.hasLayer(o))continue;const a=this.buckets[o],s=a.layers[0],l=s.sourceLayer||"_geojsonTileLayer",c=t.style.getLayerSourceCache(s);let u={};c&&(u=c._state.getState(l,void 0));const d=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},h=Object.keys(u).length>0&&!r;a.hasAppearances=a.layers.some((e=>e.appearances&&e.appearances.length>0));const f=h?a.stateDependentLayers:a.layers;if(h&&0!==a.stateDependentLayers.length||r){const e=this.latestFeatureIndex.loadVTLayers();a.update(u,e[l],n,d,f,r,i)}if(h&&0!==a.stateDependentLayers.length||r||a.hasAppearances){const e={zoom:t.transform.zoom,pitch:t.transform.pitch,brightness:t.style.getBrightness()||0,worldview:t.worldview};a.updateAppearances(this.tileID.canonical,u,n,e,t.imageManager)}(a instanceof e.ba||a instanceof e.bb)&&t._terrain&&t._terrain.enabled&&c&&a.uploadPending()&&t._terrain._clearRenderCacheForTile(c.id,this.tileID);const p=t&&t.style&&t.style.getOwnLayer(o);p&&(this.queryPadding=Math.max(this.queryPadding,p.queryRadius(a)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.o.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=e.o.now()+t}setTexture(t,r){const n=r.context,i=n.gl;this.texture=this.texture||r.getTileTexture(t.width),this.texture&&this.texture instanceof e.T?this.texture.update(t):(this.texture=new e.T(n,t,i.RGBA8,{useMipmap:!0}),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE))}
vendor: 6,303 bytes, line 1
1setDependencies(e,t){const r={};for(const e of t)r[e]=!0;this.dependencies[e]=r}hasDependency(e,t){for(const r of e){const e=this.dependencies[r];if(e)for(const r of t)if(e[r])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,r){if(!r||"mercator"===r.name||this._tileDebugBuffer)return;const n=e.bc(Ct,this.tileID.canonical,this.tileTransform)[0],i=new e.bd,o=new e.be;for(let e=0;e<n.length;e++){const{x:t,y:r}=n[e];i.emplaceBack(t,r),o.emplaceBack(e)}o.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(o),this._tileDebugBuffer=t.createVertexBuffer(i,e.bf.members),this._tileDebugSegments=e.bg.simpleSegment(0,0,i.length,o.length)}_makeTileBoundsBuffers(t,r){if(this._tileBoundsBuffer||!r||"mercator"===r.name)return;const n=e.bc(Ct,this.tileID.canonical,this.tileTransform)[0];let i,o;if(this.isRaster){const t=function(t,r){const n=e.aZ(t,r),i=Math.pow(2,t.z);for(let o=0;o<Tt;o++)for(let a=0;a<Tt;a++){const s=e.a_((t.x+(a+At(a))/kt)/i),l=e.a$((t.y+(o+At(o))/kt)/i),c=r.project(s,l),u=o*Tt+a;Mt[2*u+0]=Math.round((c.x*n.scale-n.x)*e.al),Mt[2*u+1]=Math.round((c.y*n.scale-n.y)*e.al)}Et.fill(0),Pt.fill(0);for(let e=2045;e>=0;e--){const t=4*e,r=It[t+0],n=It[t+1],i=It[t+2],o=It[t+3],a=r+i>>1,s=n+o>>1,l=a+s-n,c=s+r-a,u=n*Tt+r,d=o*Tt+i,h=s*Tt+a,f=Math.hypot((Mt[2*u+0]+Mt[2*d+0])/2-Mt[2*h+0],(Mt[2*u+1]+Mt[2*d+1])/2-Mt[2*h+1])>=16;Et[h]=Et[h]||(f?1:0),e<1022&&(Et[h]=Et[h]||Et[(n+c>>1)*Tt+(r+l>>1)]||Et[(o+c>>1)*Tt+(i+l>>1)])}const o=new e.b1,a=new e.b0;let s=0;function l(t,r){const n=r*Tt+t;return 0===Pt[n]&&(o.emplaceBack(Mt[2*n+0],Mt[2*n+1],t*e.al/kt,r*e.al/kt),Pt[n]=++s),Pt[n]-1}function c(e,t,r,n,i,o){const s=e+r>>1,u=t+n>>1;if(Math.abs(e-i)+Math.abs(t-o)>1&&Et[u*Tt+s])c(i,o,e,t,s,u),c(r,n,i,o,s,u);else{const s=l(e,t),c=l(r,n),u=l(i,o);a.emplaceBack(s,c,u)}}return c(0,0,kt,kt,kt,0),c(kt,kt,0,0,0,kt),{vertices:o,indices:a}}(this.tileID.canonical,r);i=t.vertices,o=t.indices}else{i=new e.b1,o=new e.b0;for(const{x:e,y:t}of n)i.emplaceBack(e,t,0,0);const t=e.bh(i.int16.subarray(0,4*i.length),void 0,4);for(let e=0;e<t.length;e+=3)o.emplaceBack(t[e],t[e+1],t[e+2])}this._tileBoundsBuffer=t.createVertexBuffer(i,e.bi.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(o),this._tileBoundsSegments=e.bg.simpleSegment(0,0,i.length,o.length)}_makeGlobeTileDebugBuffers(t,r){const n=r.projection;if(!n||"globe"!==n.name||r.freezeTileCoverage)return;const i=this.tileID.canonical,o=e.bj(i,r),a=e.bk(o),s=e.aj(r.zoom);let l;s>0&&(l=e.bl(new Float64Array(16),r.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,i,r,a,l,s),this._makeGlobeTileDebugTextBuffer(t,i,r,a,l,s)}_globePoint(t,r,n,i,o,a,s){let l=e.bm(t,r,n);if(a){const o=1<<n.z,c=e.aF(i.center.lng),u=e.aJ(i.center.lat),d=(n.x+.5)/o-c;let h=0;d>.5?h=-1:d<-.5&&(h=1);let f=(t/e.al+n.x)/o+h,p=(r/e.al+n.y)/o;f=(f-c)*i._pixelsPerMercatorPixel+c,p=(p-u)*i._pixelsPerMercatorPixel+u;const g=[f*i.worldSize,p*i.worldSize,0];e.af(g,g,a),l=e.bn(l,g,s)}return e.af(l,l,o)}_makeGlobeTileDebugBorderBuffer(t,r,n,i,o,a){const s=new e.bd,l=new e.be,c=new e.bo,u=(e,t,u,d,h)=>{const f=(u-e)/(h-1),p=(d-t)/(h-1),g=s.length;for(let u=0;u<h;u++){const d=e+u*f,h=t+u*p;s.emplaceBack(d,h);const m=this._globePoint(d,h,r,n,i,o,a);c.emplaceBack(m[0],m[1],m[2]),l.emplaceBack(g+u)}},d=e.al;u(0,0,d,0,16),u(d,0,d,d,16),u(d,d,0,d,16),u(0,d,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(l),this._tileDebugBuffer=t.createVertexBuffer(s,e.bf.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(c,e.bp.members),this._tileDebugSegments=e.bg.simpleSegment(0,0,s.length,l.length)}_makeGlobeTileDebugTextBuffer(t,r,n,i,o,a){const s=e.al/4,l=new e.bd,c=new e.b0,u=new e.bo,d=25;c.reserve(32),l.reserve(d),u.reserve(d);const h=(e,t)=>d*e+t;for(let e=0;e<d;e++){const t=e*s;for(let e=0;e<d;e++){const c=e*s;l.emplaceBack(c,t);const d=this._globePoint(c,t,r,n,i,o,a);u.emplaceBack(d[0],d[1],d[2])}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const r=h(e,t),n=h(e,t+1),i=h(e+1,t),o=h(e+1,t+1);c.emplaceBack(r,n,i),c.emplaceBack(i,n,o)}this._tileDebugTextIndexBuffer=t.createIndexBuffer(c),this._tileDebugTextBuffer=t.createVertexBuffer(l,e.bf.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(u,e.bp.members),this._tileDebugTextSegments=e.bg.simpleSegment(0,0,d,32)}destroy(t=!0){for(const e in this.buckets)this.buckets[e].destroy(t);this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),t&&this.texture&&this.texture instanceof e.T&&(this.texture.destroy(),delete this.texture),this.emissiveTexture&&this.emissiveTexture instanceof e.T&&(this.emissiveTexture.destroy(),delete this.emissiveTexture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}}e.bs.setPbf(e.bt);class Lt extends Rt{constructor(e,t,r,n,i){super(e,t,r,n,i),this._workQueuePerLayer=new Map,this._fetchQueuePerLayer=new Map,this._taskQueue=new Map,this._isHeaderLoaded=!1,this.textureDescriptorPerLayer=new Map,this.texturePerLayer=new Map}
1getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(e){return this._mrt&&this._mrt.getLayer(e)}setTexturePerLayer(t,r,n){const i=n.context,o=i.gl;let a=this.texturePerLayer.get(t)||n.getTileTexture(r.width);a&&a instanceof e.T?a.update(r,{premultiply:!1}):a=new e.T(i,r,o.RGBA8,{premultiply:!1}),this.texturePerLayer.has(t)||this.texturePerLayer.set(t,a)}flushQueues(e){const t=this._workQueuePerLayer.get(e)||[],r=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()();for(;r.length;)r.pop()()}flushAllQueues(){for(const e of this._workQueuePerLayer.keys()){const t=this._workQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}for(const e of this._fetchQueuePerLayer.keys()){const t=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}}fetchHeader(t=16384,r){const n=this._mrt=new e.bs(30),i=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(t-1)}});return this.entireBuffer=null,this.request=e.bu(i,((e,i,o)=>{if(e)r(e);else try{const e=n.getHeaderLength(i);if(e>t)return void(this.request=this.fetchHeader(e,r));n.parseHeader(i),this._isHeaderLoaded=!0;let a=0;for(const e of Object.values(n.layers))a=Math.max(a,e.dataIndex[e.dataIndex.length-1].lastByte);i.byteLength>=a&&(this.entireBuffer=i),r(null,this.entireBuffer||i,o)}catch(e){r(e)}})),this.request}fetchBandForRender(e,t,r,n){this.fetchBand(e,t,r,(i=>{if(i)return void n(i);this.updateTextureDescriptor(e,t,r);const o=this.textureDescriptorPerLayer.get(t);n(null,o?o.img:null)}))}fetchBand(t,r,n,i,o=!0){const a=this._mrt;if(!this._isHeaderLoaded||!a)return void i(new Error("Tile header is not ready"));const s=this.actor;if(!s)return void i(new Error("Can't fetch tile band without an actor"));let l;const c=e.B(String(n),e.B(this.tileID.key,t));let u=this._taskQueue.get(c);u?u.add(i):(u=new Set,u.add(i),this._taskQueue.set(c,u));const d=(e,t)=>{l.complete(e,t),e?i(e):(u.forEach((e=>e(null,t))),this._taskQueue.delete(c))},h=(e,t)=>{if(e)return i(e);const n=s.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:t,task:l},d,void 0,!0);if(null!==r){const e=this._workQueuePerLayer.get(r)||[];e.push((()=>{n&&n.cancel(),l.cancel()})),this._workQueuePerLayer.has(r)||this._workQueuePerLayer.set(r,e)}};let f;try{f=a.getLayer(t)}catch(e){if("reloading"===this.state)return;throw e}if(!f)return void i(new Error(`Unknown sourceLayer "${t}"`));if(f.hasDataForBand(n))return u.forEach((e=>e(null,null))),void this._taskQueue.delete(c);const p=f.getDataRange([n]);if(l=a.createDecodingTask(p),!l||l.tasks.length)if(null!==r&&this.flushQueues(r),this.entireBuffer)h(null,this.entireBuffer.slice(p.firstByte,p.lastByte+1));else{const t=Object.assign({},this.requestParams,{headers:{Range:`bytes=${p.firstByte}-${p.lastByte}`}}),n=e.bu(t,h);if(null!==r){const e=this._fetchQueuePerLayer.get(r)||[];e.push((()=>{n.cancel(),l.cancel()})),this._fetchQueuePerLayer.has(r)||this._fetchQueuePerLayer.set(r,e)}}}updateNeeded(e,t){return(!this.textureDescriptorPerLayer.get(e)||this.textureDescriptorPerLayer.get(e).band!==t||this.refreshedUponExpiration)&&"errored"!==this.state}updateTextureDescriptor(t,r,n){if(!this._mrt)return;const i=this._mrt.getLayer(t);if(!i||!i.hasBand(n)||!i.hasDataForBand(n))return;const{bytes:o,tileSize:a,buffer:s,offset:l,scale:c}=i.getBandView(n),u=a+2*s,d=new e.q({width:u,height:u},o),h=this.texturePerLayer.get(r);h&&h instanceof e.T&&h.update(d,{premultiply:!1}),this.textureDescriptorPerLayer.set(r,{layer:t,band:n,img:d,buffer:s,offset:l,tileSize:a,format:i.pixelFormat,mix:[c,256*c,65536*c,16777216*c]})}destroy(t=!1){if(super.destroy(t),delete this._mrt,!t)for(const t of this.texturePerLayer.values())t&&t instanceof e.T&&t.destroy();this.texturePerLayer.clear(),this.textureDescriptorPerLayer.clear(),this.fbo&&(this.fbo.destroy(),delete this.fbo),delete this.request,delete this.requestParams,this._isHeaderLoaded=!1}}class Ot{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){const n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const i={value:t,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout((()=>{this.remove(e,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}
1get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const r in this.data)for(const n of this.data[r])e(n.value)||t.push(n);for(const e of t)this.remove(e.value.tileID,e)}}class Dt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,t,r){const n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},Object.assign(this.stateChanges[e][n],r),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==n&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][n]){this.deletedStates[e][n]={};for(const t in this.state[e][n])r[t]||(this.deletedStates[e][n][t]=null)}else for(const t in r)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][t]&&delete this.deletedStates[e][n][t]}removeFeatureState(e,t,r){if(null===this.deletedStates[e])return;const n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(e,t){const r=this.state[e]||{},n=this.stateChanges[e]||{},i=this.deletedStates[e];if(null===i)return{};if(void 0!==t){const e=String(t),o=Object.assign({},r[e],n[e]);if(i){const e=i[t];if(null===e)return{};for(const t in e)delete o[t]}return o}const o=Object.assign({},r,n);if(i)for(const e in i)delete o[e];return o}initializeTileState(e,t){e.refreshFeatureState(t)}coalesceChanges(e,t){const r={};for(const e in this.stateChanges){this.state[e]=this.state[e]||{};const t={};for(const r in this.stateChanges[e])this.state[e][r]||(this.state[e][r]={}),Object.assign(this.state[e][r],this.stateChanges[e][r]),t[r]=this.state[e][r];r[e]=t}for(const e in this.deletedStates){this.state[e]=this.state[e]||{};const t={};if(null===this.deletedStates[e])for(const r in this.state[e])t[r]={},this.state[e][r]={};else for(const r in this.deletedStates[e]){if(null===this.deletedStates[e][r])this.state[e][r]={};else if(this.state[e][r])for(const t of Object.keys(this.deletedStates[e][r]))delete this.state[e][r][t];t[r]=this.state[e][r]}r[e]=r[e]||{},Object.assign(r[e],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const r in e)e[r].refreshFeatureState(t)}}class zt extends e.E{constructor(e,t,r){super(),this.id=e,this._onlySymbols=r,t.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),t.on("error",(()=>{this._sourceErrored=!0})),this._source=t,this._tiles={},this._cache=new Ot(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Dt,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileC
1acheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles)if(!this._tiles[e].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e)}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e)}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const r=this._tiles[t];r.upload(e,this.map?this.map.painter:void 0),r.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(Ft).map((e=>e.key))}getRenderableIds(t,r){const n=[];for(const e in this._tiles)this._isIdRenderable(+e,t,r)&&n.push(this._tiles[e]);return t?n.sort(((t,r)=>{const n=t.tileID,i=r.tileID,o=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),a=new e.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||a.y-o.y||a.x-o.x})).map((e=>e.tileID.key)):n.map((e=>e.tileID)).sort(Ft).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t,r){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())&&(r||!this._shadowCasterTiles[e])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const r=this._tiles[e];r&&("loading"!==r.state&&(r.state=t),this._loadTile(r,this._tileLoaded.bind(this,r,e,t)))}_tileLoaded(t,r,n,i,o){if(i){if(t.state="errored",404!==i.status)this._source.fire(new e.y(i,{tile:t}));else{if(this._source.fire(new e.z("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform)}return}t.timeAdded=e.o.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null);let a=new Map;o&&o.responseHeaders&&(a=o.responseHeaders),this._source.fire(new e.z("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id,responseHeaders:a}))}_backfillDEM(e){const t=this.getRenderableIds();for(let n=0;n<t.length;n++){const i=t[n];if(e.neighboringTiles&&e.neighboringTiles[i]){const t=this.getTileByID(i);r(e,t),r(t,e)}}function r(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x;const n=t.tileID.canonical.y-e.tileID.canonical.y,i=Math.pow(2,e.tileID.canonical.z),o=t.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,r,n){for(const i in this._tiles){let o=this._tiles[i];if(n[i]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>r)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(a=e)}let s=a;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){n[a.key]=a;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(let r=e.overscaledZ-1;r>=t;r--){const t=e.scaledTo(r),n=this._getLoadedTile(t);if(n)return n}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const r=Math.ceil(e.width/t)+1,n=Math.ceil(e.height/t)+1,i=Math.floor(r*n*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,i):i,a="number"==typeof this._maxTileC
1acheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(a)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const r in this._tiles){const n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(t,r,n,i,o){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!n)return;this.updateCacheSize(t,r),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const a="batched-model"===this._source.type;let s,l=this._source.maxzoom;const c=this.map&&this.map.painter?this.map.painter._terrain:null;if(c&&c.sourceCache===this&&c.attenuationRange()){const e=c.attenuationRange()[0],t=Math.floor(e)-Math.log2(c.getDemUpscale());l>t&&(l=t)}if(this.used||this.usedForTerrain){if(this._source.tileID)s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.aQ(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)));else if(0!==this.tileCoverLift){const i=t.clone();i.tileCoverLift=this.tileCoverLift,s=i.coveringTiles({tileSize:r||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:a}),this._source.minzoom<=1&&"globe"===t.projection.name&&(s.push(new e.aQ(1,0,1,0,0)),s.push(new e.aQ(1,0,1,1,0)),s.push(new e.aQ(1,0,1,0,1)),s.push(new e.aQ(1,0,1,1,1)))}else if(s=t.coveringTiles({tileSize:r||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:a}),this._source.hasTile){const e=this._source.hasTile.bind(this._source);s=s.filter((t=>e(t)))}}else s=[];if(s.length>0&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!Nt(this._source.type)){const e=t.coveringZoomLevel({tileSize:r||this._source.tileSize,roundZoom:this._source.roundZoom&&!n}),l=Math.min(e,this._source.maxzoom);if(a){const e=t.extendTileCover(s,l);for(const t of e)s.push(t)}else if(o){const e=t.extendTileCoverToNearPlane(s,this.transform.getFrustum(l),l);for(const t of e)s.push(t)}else if(this.castsShadows&&i){const e=t.extendTileCover(s,l,i,16);for(const t of e)this._shadowCasterTiles[t.key]=!0,s.push(t)}}const u=this._updateRetainedTiles(s);if(Nt(this._source.type)&&0!==s.length){const t={},r={},n=Object.keys(u);for(const i of n){const n=u[i],o=this._tiles[i];if(!o||o.fadeEndTime&&o.fadeEndTime<=e.o.now())continue;const a=this.findLoadedParent(n,Math.max(n.overscaledZ-zt.maxOverzooming,this._source.minzoom));a&&(this._addTile(a.tileID),t[a.tileID.key]=a.tileID),r[i]=n}const i=s[s.length-1].overscaledZ;for(const e in this._tiles){const t=this._tiles[e];if(u[e]||!t.hasData())continue;let n=t.tileID;for(;n.overscaledZ>i;){n=n.scaledTo(n.overscaledZ-1);const i=this._tiles[n.key];if(i&&i.hasData()&&r[n.key]){u[e]=t.tileID;break}}}for(const e in t)u[e]||(this._coveredTiles[e]=!0,u[e]=t[e])}for(const e in u)this._tiles[e].clearFadeHold();const d=e.bv(this._tiles,u);for(const e of d){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const r={},n=e.reduce(((e,t)=>Math.min(e,t.overscaledZ)),1/0),i=e[0].overscaledZ,o=Math.max(i-zt.maxOverzooming,this._source.minzoom),a=Math.max(i+zt.maxUnderzooming,this._source.minzoom),s={};for(const r of e){const e=this._addTile(r);t[r.key]=r,e.hasData()||n<this._source.maxzoom&&(s[r.key]=r)}this._retainLoadedChildren(s,n,a,t);for(const n of e){let e=this._tiles[n.key];if(e.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const e=n.children(this._source.maxzoom)[0],r=this.getTile(e);
1if(r&&r.hasData()){t[e.key]=e;continue}}else{const e=n.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let i=e.wasRequested();for(let a=n.overscaledZ-1;a>=o;--a){const o=n.scaledTo(a);if(r[o.key])break;if(r[o.key]=!0,e=this.getTile(o),!e&&i&&(e=this._addTile(o)),e&&(t[o.key]=o,i=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let r,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);const e=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(e),r)break;n=e}for(const e of t)this._loadedParentTiles[e]=r}}_addTile(t){let r=this._tiles[t.key];if(r)return!0!==r.isExtraShadowCaster||!!this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));const n=Boolean(r);if(!n){const e=this.map?this.map.painter:null,n=this._source.tileSize*t.overscaleFactor();r="raster-array"===this._source.type?new Lt(t,n,this.transform.tileZoom,e,this._isRaster):new Rt(t,n,this.transform.tileZoom,e,this._isRaster,this._source.worldview),this._loadTile(r,this._tileLoaded.bind(this,r,t.key,r.state))}return r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.z("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),r))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state||"empty"===t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,r,n){const i=[],o=this.transform;if(!o)return i;const a="globe"===o.projection.name,s=e.aF(o.center.lng);for(const l in this._tiles){const c=this._tiles[l];if(n&&c.clearQueryDebugViz(),c.holdingForFade())continue;let u;if(a){const t=c.tileID.canonical;if(0===t.z){const r=[Math.abs(e.aA(s,...Bt(t,-1))-s),Math.abs(e.aA(s,...Bt(t,1))-s)];u=[0,2*r.indexOf(Math.min(...r))-1]}else{const r=[Math.abs(e.aA(s,...Bt(t,-1))-s),Math.abs(e.aA(s,...Bt(t,0))-s),Math.abs(e.aA(s,...Bt(t,1))-s)];u=[r.indexOf(Math.min(...r))-1]}}else u=[0];for(const e of u){const n=t.containsTile(c,o,r,e);n&&i.push(n)}}return i}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,t){const r=this.getRenderableIds(e,t).map((e=>this._tiles[e].tileID)),n="globe"===this.transform.projection.name;for(const e of r)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped()),e.expandedProjMatrix=n?this.transform.calculateProjMatrix(e.toUnwrapped(),!1,!0):e.projMatrix;return r}sortCoordinatesByDistance(e){const t=e.slice(),r=this.transform._camera.position,n=this.transform._camera.forward(),i={};for(const e of t){const t=1/(1<<e.canonical.z);i[e.key]=((e.canonical.x+.5)*t+e.wrap-r[0])*n[0]+((e.canonical.y+.5)*t-r[1])*n[1]-r[2]*n[2]}return t.sort(((e,t)=>i[e.key]-i[t.key])),t}hasTransition(){if(this._source.hasTransition())return!0;if(Nt(this._source.type))for(const t in this._tiles){const r=this._tiles[t];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=e.o.now())return!0}return!1}setFeatureState(e,t,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}removeFeatureState(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}
1setDependencies(e,t,r){const n=this._tiles[e];n&&n.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(const r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(+r,"reloading");this._cache.filter((r=>!r.hasDependency(e,t)))}_preloadTiles(t,r){if(!this._sourceLoaded){const e=()=>{this._sourceLoaded&&(this._source.off("data",e),this._preloadTiles(t,r))};return void this._source.on("data",e)}const n=new Map,i=Array.isArray(t)?t:[t],o=this.map.painter.terrain,a=this.usedForTerrain&&o?o.getScaledDemTileSize():this._source.tileSize;for(const e of i){const t=e.coveringTiles({tileSize:a,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)n.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}const s=Array.from(n.values());e.bw(s,((e,t)=>{const r=new Rt(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster,this._source.worldview);this._loadTile(r,(e=>{"raster-dem"===this._source.type&&r.dem&&this._backfillDEM(r),t(e,r)}))}),r)}}function Ft(e,t){const r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Nt(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function Bt(e,t){const r=1<<e.z;return[e.x/r+t,(e.x+1)/r+t]}zt.maxOverzooming=10,zt.maxUnderzooming=3;class jt{constructor(e){this.style=e,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){this.layers=[];const e=!1,t=!1;for(const r in this.style._mergedLayers){const n=this.style._mergedLayers[r];if("fill-extrusion"===n.type||"building"===n.type)this.layers.push({layer:n,visible:e,visibilityChanged:t});else if("model"===n.type){const r=this.style.getLayerSource(n);r&&"batched-model"===r.type&&this.layers.push({layer:n,visible:e,visibilityChanged:t})}}}onNewFrame(e){this.layersGotHidden=!1;for(const t of this.layers){const r=t.layer;let n=!1;"fill-extrusion"===r.type?n=!r.isHidden(e)&&r.paint.get("fill-extrusion-opacity")>0:"building"===r.type?n=!r.isHidden(e)&&r.paint.get("building-opacity")>0:"model"===r.type&&(n=!r.isHidden(e)&&r.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!n&&t.visible,t.visible=n}}updateZOffset(e,t){this.currentBuildingBuckets=[];for(const e of this.layers){const r=e.layer,n=this.style.getLayerSourceCache(r);let i=1;"fill-extrusion"===r.type?i=e.visible?r.paint.get("fill-extrusion-vertical-scale"):0:"building"===r.type&&(i=e.visible?r.paint.get("building-vertical-scale"):0);let o=n?n.getTile(t):null;if(!o&&n)for(const e in n._tiles){const r=n._tiles[e];if(t.canonical.isChildOf(r.tileID.canonical)){o=r;break}}this.currentBuildingBuckets.push({bucket:o?o.getBucket(r):null,tileID:o?o.tileID:t,verticalScale:i})}e.hasAnyZOffset=!1;let r=!1;for(let n=0;n<e.symbolInstances.length;n++){const i=e.symbolInstances.get(n),o=i.zOffset,a=this._getHeightAtTileOffset(t,i.tileAnchorX,i.tileAnchorY);i.zOffset=a!==Number.NEGATIVE_INFINITY?a:o,r||o===i.zOffset||(r=!0),e.hasAnyZOffset||0===i.zOffset||(e.hasAnyZOffset=!0)}r&&(e.zOffsetBuffersNeedUpload=!0,e.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(t,r,n,i){let o=r,a=n;if(t.canonical.z!==i.canonical.z){const s=i.canonical,l=1/(1<<t.canonical.z-s.z);o=(r+t.canonical.x*e.al)*l-s.x*e.al|0,a=(n+t.canonical.y*e.al)*l-s.y*e.al|0}return{tileX:o,tileY:a}}_getHeightAtTileOffset(e,t,r){let n,i;for(let o=0;o<this.layers.length;++o){const a=this.layers[o].layer;if("fill-extrusion"!==a.type&&"building"!==a.type)continue;const{bucket:s,tileID:l,verticalScale:c}=this.currentBuildingBuckets[o];if(!s)continue;const{tileX:u,tileY:d}=this._mapCoordToOverlappingTile(e,t,r,l),h=s.getHeightAtTileCoord(u,d);h&&void 0!==h.height&&(h.hidden?n=h.height:i=Math.max(h.height*c,i||0))}if(void 0!==i)return i;for(let i=0;i<this.layers.length;++i){const o=this.layers[i];if("model"!==o.layer.type||!o.visible)continue;const{bucket:a,tileID:s}=this.currentBuildingBuckets[i];if(!a)continue;const{tileX:l,tileY:c}=this._mapCoordToOverlappingTile(e,t,r,s),u=a.getHeightAtTileCoord(l,c);if(u&&!u.hidden)return void 0===u.height&&void 0!==n?Math.min(u.maxHeight,n)*u.verticalScale:u.height?u.height*u.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}function Vt(t,r){const n={};for(const e in t)"ref"!==e&&(n[e]=t[e]);return e.bx.forEach((e=>{e in r&&(n[e]=r[e])})),n}function Gt(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=Vt(e[r],t[e[r].ref]));return e}const Ut={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport",addIconset:"addIconset",removeIconset:"removeIconset"};
vendor: 4,762 bytes, line 1
1function $t(e,t,r){r.push({command:Ut.addSource,args:[e,t[e]]})}function Ht(e,t,r){t.push({command:Ut.removeSource,args:[e]}),r[e]=!0}function qt(e,t,r,n){Ht(e,r,n),$t(e,t,r)}function Wt(t,r,n){let i;for(i in t[n])if(t[n].hasOwnProperty(i)&&"data"!==i&&!e.by(t[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!e.by(t[n][i],r[n][i]))return!1;return!0}function Zt(t,r,n,i,o,a){let s;for(s in r=r||{},t=t||{})t.hasOwnProperty(s)&&(e.by(t[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!t.hasOwnProperty(s)&&(e.by(t[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}))}function Yt(e){return e.id}function Xt(e,t){return e[t.id]=t,e}function Kt(t,r,n){const i=r.createTileMatrix(t,t.worldSize,n.toUnwrapped());return e.aB(new Float32Array(16),t.projMatrix,i)}function Jt(e,t,r){if(t.projection.name===r.projection.name)return e.projMatrix;const n=r.clone();return n.setProjection(t.projection),Kt(n,t.getProjection(),e)}function Qt(e,t,r){return t.name===r.projection.name?e.projMatrix:Kt(r,t,e)}class er{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.aA(t,0,1);let r=1,n=this._distances[r];const i=t*this.paddedLength+this.padding;for(;n<i&&r<this._distances.length;)n=this._distances[++r];const o=r-1,a=this._distances[o],s=n-a,l=s>0?(i-a)/s:0;return this.points[o].mult(1-l).add(this.points[r].mult(l))}}class tr{constructor(e,t,r){const n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let e=0;e<this.xCellCount*this.yCellCount;e++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}insertCircle(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)}_insertBoxCell(e,t,r,n,i,o){this.boxCells[i].push(o)}_insertCircleCell(e,t,r,n,i,o){this.circleCells[i].push(o)}_query(e,t,r,n,i,o){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];const a=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(let e=0;e<this.boxKeys.length;e++)a.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],r=this.circles[3*e+1],n=this.circles[3*e+2];a.push({key:this.circleKeys[e],x1:t-n,y1:r-n,x2:t+n,y2:r+n})}return o?a.filter(o):a}return this._forEachCell(e,t,r,n,this._queryCell,a,{hitTest:i,seenUids:{box:{},circle:{}}},o),i?a.length>0:a}_queryCircle(e,t,r,n,i){const o=e-r,a=e+r,s=t-r,l=t+r;if(a<0||o>this.width||l<0||s>this.height)return!n&&[];const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},i),n?c.length>0:c}query(e,t,r,n,i){return this._query(e,t,r,n,!1,i)}hitTest(e,t,r,n,i){return this._query(e,t,r,n,!0,i)}hitTestCircle(e,t,r,n){return this._queryCircle(e,t,r,!0,n)}_queryCell(e,t,r,n,i,o,a,s){const l=a.seenUids,c=this.boxCells[i];if(null!==c){const i=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(e<=i[c+2]&&t<=i[c+3]&&r>=i[c+0]&&n>=i[c+1]&&(!s||s(this.boxKeys[u]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:i[c],y1:i[c+1],x2:i[c+2],y2:i[c+3]})}}}const u=this.circleCells[i];if(null!==u){const i=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(i[u],i[u+1],i[u+2],e,t,r,n)&&(!s||s(this.circleKeys[c]))){if(a.hitTest)return o.push(!0),!0;{const e=i[u],t=i[u+1],r=i[u+2];o.push({key:this.circleKeys[c],x1:e-r,y1:t-r,x2:e+r,y2:t+r})}}}}}_queryCellCircle(e,t,r,n,i,o,a,s){const l=a.circle,c=a.seenUids,u=this.boxCells[i];if(null!==u){const e=this.bboxes;for(const t of u)if(!c.box[t]){c.box[t]=!0;const r=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!s||s(this.boxKeys[t])))return o.push(!0),!0}}const d=this.circleCells[i];if(null!==d){const e=this.circles;for(const t of d)if(!c.circle[t]){c.circle[t]=!0;const r=3*t;
1if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,r,n,i,o,a,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),d=this._convertToYCellCoord(n);for(let h=l;h<=u;h++)for(let l=c;l<=d;l++)if(i.call(this,e,t,r,n,this.xCellCount*l+h,o,a,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,r,n,i,o){const a=n-e,s=i-t,l=r+o;return l*l>a*a+s*s}_circleAndRectCollide(e,t,r,n,i,o,a){const s=(o-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;const c=(a-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const d=l-s,h=u-c;return d*d+h*h<=r*r}}const rr=Math.tan(85*Math.PI/180);function nr(t,r,n,i,o,a,s){const l=e.bC();if(n)if("globe"===a.name){const t=e.bD(o,r);e.aB(l,l,t)}else{const t=e.bE([],s);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],i||e.bB(l,l,o.angle)}else e.aB(l,o.labelPlaneMatrix,t);return l}function ir(e,t,r,n,i,o,a){const s=nr(e,t,r,n,i,o,a);return"globe"===o.name&&r||(s[2]=s[6]=s[10]=s[14]=0),s}function or(t,r,n,i,o,a,s){if(n){if("globe"===a.name){const l=nr(t,r,n,i,o,a,s);return e.bl(l,l),e.aB(l,t,l),l}{const r=e.bz(t),n=e.bA([]);return n[0]=s[0],n[1]=s[1],n[4]=s[2],n[5]=s[3],e.aB(r,r,n),i||e.bB(r,r,-o.angle),r}}return o.glCoordMatrix}function ar(t,r,n,i){const o=[t,r,n,1];n?e.aC(o,o,i):yr(o,o,i);const a=o[3];return o[0]/=a,o[1]/=a,o[2]/=a,o}function sr(e,t){return Math.min(.5+e/t*.5,1.5)}function lr(e,t){const r=e[0]/e[3],n=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function cr(t,r,n,i,o,a,s,l,c,u,d=1){const h=n.transform,f=i?t.textSizeData:t.iconSizeData,p=e.bK(f,n.transform.zoom,d),g="globe"===h.projection.name,m=[256/n.width*2+1,256/n.height*2+1],y=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;y.clear();let _=null;g&&(_=i?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const v=t.lineVertexArray,b=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=n.transform.width/n.transform.height;let w,S=!1;for(let i=0;i<b.length;i++){const d=b.get(i),{numGlyphs:g,writingMode:k}=d;if(k!==e.bL.vertical||S||w===e.bL.horizontal||(S=!0),w=k,(d.hidden||k===e.bL.vertical)&&!S){mr(g,y);continue}S=!1;const T=new e.P(d.tileAnchorX,d.tileAnchorY),I="road"===t.elevationType,M=!!h.elevation||I;let{x:E,y:P,z:A}=h.projection.projectTilePoint(T.x,T.y,u.canonical),C=null;if(M){const e=I?t.getElevationFeatureForText(i):null;C={getElevation:c,elevation:h.elevation,elevationFeature:e};const[r,n,o]=c(T,h.elevation,e);E+=r,P+=n,A+=o}const R=[E,P,A,1];if(e.aC(R,R,r),!lr(R,m)){mr(g,y);continue}const L=R[3],O=sr(n.transform.getCameraToCenterDistance(h.projection),L),D=e.bM(f,p,d),z=s?D/O:D*O,F=ar(E,P,A,o);if(F[3]<=0){mr(g,y);continue}let N={};const B=e.an(t.layers[0].layout.get("text-max-angle")),j=Math.cos(B),V=s?null:C,G=hr(d,z,!1,l,r,o,a,t.glyphOffsetArray,v,y,_,F,T,N,x,V,h.projection,u,s,j);S=G.useVertical,V&&G.needsFlipping&&(N={}),(G.notEnoughRoom||S||G.needsFlipping&&hr(d,z,!0,l,r,o,a,t.glyphOffsetArray,v,y,_,F,T,N,x,V,h.projection,u,s,j).notEnoughRoom)&&mr(g,y)}i?(t.text.dynamicLayoutVertexBuffer.updateData(y),_&&t.text.globeExtVertexBuffer&&t.text.globeExtVertexBuffer.updateData(_)):(t.icon.dynamicLayoutVertexBuffer.updateData(y),_&&t.icon.globeExtVertexBuffer&&t.icon.globeExtVertexBuffer.updateData(_))}function ur(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m){const{lineStartIndex:y,glyphStartIndex:_,segment:v}=s,b=_+s.numGlyphs,x=y+s.lineLength,w=t.getoffsetX(_),S=t.getoffsetX(b-1),k=gr(e*w,r,n,i,o,a,v,y,x,l,c,u,d,h,!0,f,p,g,m);if(!k)return null;const T=gr(e*S,r,n,i,o,a,v,y,x,l,c,u,d,h,!0,f,p,g,m);return T?{first:k,last:T}:null}function dr(t,r,n,i){return t===e.bL.horizontal&&Math.abs(i)>Math.abs(n)?{useVertical:!0}:t===e.bL.vertical?i>0?{needsFlipping:!0}:null:0!==r&&function(e,t){return 0===e||Math.abs(t/e)>rr}(n,i)?1===r?{needsFlipping:!0}:null:n<0?{needsFlipping:!0}:null}function hr(t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b){const x=r/24,w=t.lineOffsetX*x,S=t.lineOffsetY*x,{lineStartIndex:k,glyphStartIndex:T,numGlyphs:I,segment:M,writingMode:E,flipState:P}=t,A=k+t.lineLength,C=t=>{if(d){const[r,n,i]=t.up,o=u.length;e.bN(d,o+0,r,n,i),e.bN(d,o+1,r,n,i),e.bN(d,o+2,r,n,i),e.bN(d,o+3,r,n,i)}const[r,n,i]=t.point;e.bO(u,r,n,i,t.angle)};if(I>1){const e=ur(x,l,w,S,n,h,f,t,c,a,p,m,!1,y,_,v,b);if(!e)return{notEnoughRoom:!0};if(i&&!n){let[r,n,i]=e.first.point,[o,a,l]=e.last.point;
1[r,n]=ar(r,n,i,s),[o,a]=ar(o,a,l,s);const c=dr(E,P,(o-r)*g,a-n);if(t.flipState=c&&c.needsFlipping?1:2,c)return c}C(e.first);for(let e=T+1;e<T+I-1;e++){const t=gr(x*l.getoffsetX(e),w,S,n,h,f,M,k,A,c,a,p,m,!1,!1,y,_,v,b);if(!t)return u.length-=4*(e-T),{notEnoughRoom:!0};C(t)}C(e.last)}else{if(i&&!n){const r=ar(f.x,f.y,0,o),n=k+M+1,i=new e.P(c.getx(n),c.gety(n)),a=ar(i.x,i.y,0,o),s=a[3]>0?a:pr(f,i,r,1,o,void 0,y,_.canonical),l=dr(E,P,(s[0]-r[0])*g,s[1]-r[1]);if(t.flipState=l&&l.needsFlipping?1:2,l)return l}const r=gr(x*l.getoffsetX(T),w,S,n,h,f,M,k,A,c,a,p,m,!1,!1,y,_,v,b);if(!r)return{notEnoughRoom:!0};C(r)}return{}}function fr(e,t,r,n,i){const{x:o,y:a,z:s}=n.projectTilePoint(e.x,e.y,t);if(!i)return ar(o,a,s,r);const[l,c,u]=i.getElevation(e,i.elevation,i.elevationFeature);return ar(o+l,a+c,s+u,r)}function pr(t,r,n,i,o,a,s,l){const c=fr(t.sub(r)._unit()._add(t),l,o,s,a);return e.av(c,n,c),e.aw(c,c),e.bH(c,n,c,i)}function gr(t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v){const b=i?t-r:t+r;let x=b>0?1:-1,w=0;i&&(x*=-1,w=Math.PI),x<0&&(w+=Math.PI);let S=l+s+(x>0?0:1)|0,k=o,T=o,I=0,M=0;const E=Math.abs(b),P=[],A=[];let C=a,R=C,L=e.bF([]);const O=()=>pr(R,C,T,E-I+1,d,f,m,y.canonical);for(;I+M<=E;){if(S+=x,S<l||S>=c)return null;
1if(T=k,R=C,P.push(T),p&&A.push(R),C=new e.P(u.getx(S),u.gety(S)),k=h[S],!k){const e=fr(C,y.canonical,d,m,f);k=e[3]>0?h[S]=e:O()}I+=M;const t=e.av([],k,T),r=e.bG(T,k);if(n&&r>0&&M>0&&e.bJ(L,t)/(M*r)<v)return null;M=r,L=t}g&&f&&(h[S]&&(k=O(),M=e.bG(T,k),L=e.av([],k,T)),h[S]=k);const D=(E-I)/M,z=C.sub(R)._mult(D)._add(R),F=e.bH([],T,L,D);let N=[0,0,1],B=L[0],j=L[1];if(_&&(N=m.upVector(y.canonical,z.x,z.y),0!==N[0]||0!==N[1]||1!==N[2])){const t=[N[2],0,-N[0]],r=e.bI([],N,t);e.aw(t,t),e.aw(r,r),B=e.bJ(L,t),j=e.bJ(L,r)}if(n){const t=e.bI([],N,L);e.aw(t,t),e.bH(F,F,t,n*x)}const V=w+Math.atan2(j,B);return P.push(F),p&&A.push(z),{point:F,angle:V,path:P,tilePath:A,up:N}}function mr(e,t){const r=t.length,n=r+4*e;t.resize(n),t.float32.fill(-1/0,4*r,4*n)}function yr(e,t,r){const n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e[3]=r[3]*n+r[7]*i+r[15],e}const _r=100;class vr{constructor(e,t,r=new tr(e.width+200,e.height+200,25),n=new tr(e.width+200,e.height+200,25)){this.transform=e,this.grid=r,this.ignoredGrid=n,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+_r,this.screenBottomBoundary=e.height+_r,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(t,r,n,i,o,a,s,l,c,u,d){let h=n.projectedAnchorX,f=n.projectedAnchorY,p=n.projectedAnchorZ;const g=n.tileAnchorX,m=n.tileAnchorY,y=n.elevation,_=n.tileID,v=t.getProjection();if(y&&_){const[e,t,r]=v.upVector(_.canonical,n.tileAnchorX,n.tileAnchorY),i=v.upVectorScale(_.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;h+=e*y*i,f+=t*y*i,p+=r*y*i}const b="globe"===t.projection.name,x="globe"===t.projection.name?e.aj(this.transform.zoom):0;if(_&&b&&x<1&&!a){const t=1<<_.canonical.z,r=e.bP(g,m);e.bQ(r,r,1/e.al),e.bR(r,r,e.bP(_.canonical.x,_.canonical.y)),e.bQ(r,r,1/t),e.bS(r,r,e.bP(i[0],i[1])),r[0]=e.bT(r[0],-.5,.5),e.bQ(r,r,e.al);const n=e.bU(r[0],r[1],e.al/(2*Math.PI),1);e.aC(n,n,o),h=e.ak(h,n[0],x),f=e.ak(f,n[1],x),p=e.ak(p,n[2],x)}const w=this.projectAndGetPerspectiveRatio(u,h,f,p,n.tileID,"globe"===v.name||!!y||this.transform.pitch>0,v),S=c*w.perspectiveRatio,k=(n.x1*r+s.x-n.padding)*S+w.point.x,T=(n.y1*r+s.y-n.padding)*S+w.point.y,I=(n.x2*r+s.x+n.padding)*S+w.point.x,M=(n.y2*r+s.y+n.padding)*S+w.point.y,E=w.perspectiveRatio<=.55||w.occluded;return!this.isInsideGrid(k,T,I,M)||!l&&this.grid.hitTest(k,T,I,M,d)||E?{box:[],offscreen:!1,occluded:w.occluded}:{box:[k,T,I,M],offscreen:this.isOffscreen(k,T,I,M),occluded:!1}}placeCollisionCircles(t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m){const y=[],_=this.transform.elevation,v=t.getProjection(),b="road"===t.elevationType,x=!!_||b,w=e.bV.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,v),S=new e.P(n.tileAnchorX,n.tileAnchorY),k=new e.P(n.tileAnchorX,n.tileAnchorY);let{x:T,y:I,z:M}=v.projectTilePoint(k.x,k.y,m.canonical),E=null;if(x){const e=b?t.getElevationFeatureForText(i):null;E={getElevation:w,elevation:_,elevationFeature:e};const[r,n,o]=w(S,_,e);T+=r,I+=n,M+=o}const P="globe"===v.name,A=this.projectAndGetPerspectiveRatio(l,T,I,M,m,P||!!_||this.transform.pitch>0,v),{perspectiveRatio:C}=A,R=(h?s/C:s*C)/e.bY,L=ar(T,I,M,c),O=n.lineOffsetX*R,D=n.lineOffsetY*R,z=e.an(t.layers[0].layout.get("text-max-angle")),F=Math.cos(z),N=A.signedDistanceFromCamera>0?ur(R,a,O,D,b&&1===n.flipState,L,k,n,o,c,{},x&&!h?E:null,h&&x,v,m,h,F):null;let B=!1,j=!1,V=!0;if(N&&!A.occluded){const t=.5*p*C+g,n=new e.P(-100,-100),i=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new er,{first:a,last:s}=N,l=a.path.length;let c=[];for(let e=l-1;e>=1;e--)c.push(a.path[e]);for(let e=1;e<s.path.length;e++)c.push(s.path[e]);const h=2.5*t;u&&(c=c.map((([e,t,r],n)=>(x&&!P&&(r=w(n<l-1?a.tilePath[l-1-n]:s.tilePath[n-l+2],_,E.elevationFeature)[2]),ar(e,t,r,u)))),c.some((e=>e[3]<=0))&&(c=[]));let m=[];if(c.length>0){let t=1/0,r=-1/0,o=1/0,a=-1/0;for(const e of c)t=Math.min(t,e[0]),o=Math.min(o,e[1]),r=Math.max(r,e[0]),a=Math.max(a,e[1]);r>=n.x&&t<=i.x&&a>=n.y&&o<=i.y&&(m=[c.map((t=>new e.P(t[0],t[1])))],(t<n.x||r>i.x||o<n.y||a>i.y)&&(m=e.bW(m,n.x,n.y,i.x,i.y)))}for(const e of m){o.reset(e,.25*t);let n=0;n=o.length<=.5*t?1:Math.ceil(o.paddedLength/h)+1;for(let e=0;e<n;e++){const i=e/Math.max(n-1,1),a=o.lerp(i),s=a.x+_r,l=a.y+_r;y.push(s,l,t,0);const c=s-t,u=l-t,h=s+t,p=l+t;if(V=V&&this.isOffscreen(c,u,h,p),j=j||this.isInsideGrid(c,u,h,p),!r&&this.grid.hitTestCircle(s,l,t,f)&&(B=!0,!d))return{circles:[],offscreen:!1,collisionDetected:B,occluded:!1}}}}return{circles:!d&&B||!j?[]:y,offscreen:V,collisionDetected:B,occluded:A.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,o=-1/0,a=-1/0;for(const s of t){const t=new e.P(s.x+_r,s.y+_r);n=Math.min(n,t.x),i=Math.min(i,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y),r.push(t)}const s=this.grid.query(n,i,o,a).concat(this.ignoredGrid.query(n,i,o,a)),l={},c={};for(const t of s){const n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const i=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];
1e.bX(r,i)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(e,t,r,n,i){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:i},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,n,i){const o=t?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};for(let t=0;t<e.length;t+=4)o.insertCircle(a,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,r,n,i,o,a,s){const l=[r,n,i,1];let c=!1;if(i||this.transform.pitch>0){if(e.aC(l,l,t),this.fogState&&o&&"globe"!==s.name){const t=function(t,r,n,i,o,a){const s=a.calculateFogTileMatrix(o),l=[r,n,i];return e.af(l,l,s),Ue(t,e.ag(l),a.pitch,a._fov)}(this.fogState,r,n,i,o.toUnwrapped(),this.transform);c=t>.9}}else yr(l,l,t);const u=l[3];return{point:new e.P((l[0]/u+1)/2*this.transform.width+_r,(-l[1]/u+1)/2*this.transform.height+_r),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(s)/u*.5,1.5),signedDistanceFromCamera:u,occluded:a&&l[2]>u||c}}isOffscreen(e,t,r,n){return r<_r||e>=this.screenRightBoundary||n<_r||t>this.screenBottomBoundary}isInsideGrid(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.bA([]);return e.br(t,t,[-100,-100,0]),t}}class br{constructor(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class xr{constructor(e,t,r,n,i,o=!1){this.text=new br(e?e.text:null,t,r,i),this.icon=new br(e?e.icon:null,t,n,i),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class wr{constructor(e,t,r,n=!1){this.text=e,this.icon=t,this.skipFade=r,this.clipped=n}}class Sr{constructor(){this.invProjMatrix=e.bC(),this.viewportMatrix=e.bC(),this.circles=[]}}class kr{constructor(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class Tr{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function Ir(t,r,n,i,o){const{horizontalAlign:a,verticalAlign:s}=e.c1(t),l=-(a-.5)*r,c=-(s-.5)*n,u=e.c2(t,i);return new e.P(l+u[0]*o,c+u[1]*o)}function Mr(t,r,n,i,o){const a=new e.P(t,r);return n&&a._rotate(i?o:-o),a}class Er{constructor(e,t,r,n,i,o){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new vr(this.transform,i),this.buildingIndex=o,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new Tr(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={},this.lastReplacementSourceUpdateTime=0}getBucketParts(t,r,n,i,o=1){const a=n.getBucket(r),s=n.latestFeatureIndex;if(!a||!s||r.fqid!==a.layerIds[0])return;const l=a.layers[0].layout,c=a.layers[0].paint,u=n.collisionBoxArray,d=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/e.al,f=n.tileID.toUnwrapped();this.transform.setProjection(a.projection);const p=(g=n.tileID,m=a.getProjection(),y=this.transform,m.name===this.projection?y.calculateProjMatrix(g.toUnwrapped()):Kt(y,m,g));var g,m,y;const _="map"===l.get("text-pitch-alignment"),v="map"===l.get("text-rotation-alignment");r.compileFilter(r.options);const b=r.dynamicFilter(),x=r.dynamicFilterNeedsFeature(),w=this.transform.calculatePixelsToTileUnitsMatrix(n),S=ir(p,n.tileID.canonical,_,v,this.transform,a.getProjection(),w);let k=null;const T=a.getProjection().createInversionMatrix(this.transform,n.tileID.canonical);if(_){const t=or(p,n.tileID.canonical,_,v,this.transform,a.getProjection(),w);k=e.aB([],this.transform.labelPlaneMatrix,t)}let I=null;b&&n.latestFeatureIndex&&(I={unwrappedTileID:f,dynamicFilter:b,dynamicFilterNeedsFeature:x}),this.retainedQueryData[a.bucketInstanceId]=new kr(a.bucketInstanceId,s,a.sourceLayerIndex,a.index,n.tileID);const[M,E]=a.layers[0].layout.get("text-size-scale-range"),P=e.aA(o,M,E),[A,C]=l.get("icon-size-scale-range"),R=e.aA(o,A,C),L={bucket:a,layout:l,paint:c,posMatrix:p,invMatrix:T,mercatorCenter:[e.aF(this.transform.center.lng),e.aJ(this.transform.center.lat)],textLabelPlaneMatr
1ix:S,labelToScreenMatrix:k,clippingData:I,scale:d,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:u,partiallyEvaluatedTextSize:e.bK(a.textSizeData,this.transform.zoom,P),partiallyEvaluatedIconSize:e.bK(a.iconSizeData,this.transform.zoom,R),collisionGroup:this.collisionGroups.get(a.sourceID),latestFeatureIndex:n.latestFeatureIndex};if(i)for(const e of a.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=e;t.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:L})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:L})}attemptAnchorPlacement(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b){const{textOffset0:x,textOffset1:w,crossTileID:S}=p,k=[x,w],T=Ir(e,o,a,k,s),I=this.collisionIndex.placeCollisionBox(m,s,t,r,n,i,Mr(T.x,T.y,l,c,this.transform.angle),f,u,d,h.predicate);if(_){const e=m.getSymbolInstanceIconSize(b,this.transform.zoom,p.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(m,e,_,r,n,i,Mr(T.x,T.y,l,c,this.transform.angle),f,u,d,h.predicate).box.length)return}if(I.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[S]&&this.prevPlacement.placements[S]&&this.prevPlacement.placements[S].text&&(t=this.prevPlacement.variableOffsets[S].anchor),this.variableOffsets[S]={textOffset:k,width:o,height:a,anchor:e,textScale:s,prevAnchor:t},this.markUsedJustification(m,e,p,y),m.allowVerticalPlacement&&(this.markUsedOrientation(m,y,p),this.placedOrientations[S]=y),{shift:T,placedGlyphBoxes:I}}}placeLayerBucketPart(t,r,n,i,o=1){const{bucket:a,layout:s,paint:l,posMatrix:c,textLabelPlaneMatrix:u,labelToScreenMatrix:d,clippingData:h,textPixelRatio:f,mercatorCenter:p,invMatrix:g,holdingForFade:m,collisionBoxArray:y,partiallyEvaluatedTextSize:_,partiallyEvaluatedIconSize:v,collisionGroup:b,latestFeatureIndex:x}=t.parameters,w=s.get("text-optional"),S=s.get("icon-optional"),k=s.get("text-allow-overlap"),T=s.get("icon-allow-overlap"),I="map"===s.get("text-rotation-alignment"),M="map"===s.get("icon-rotation-alignment"),E="map"===s.get("text-pitch-alignment"),P=l.get("symbol-z-offset"),A="sea"===s.get("symbol-elevation-reference"),C=s.get("symbol-placement"),[R,L]=s.get("text-size-scale-range"),[O,D]=s.get("icon-size-scale-range"),z=e.aA(o,R,L),F=e.aA(o,O,D),N=s.get("text-variable-anchor"),B=I&&"point"!==C,j=M&&"point"!==C,V=N&&a.hasTextData(),G=a.hasIconTextFit()&&V&&a.hasIconData();this.transform.setProjection(a.projection);const U=V||B,$=j||G;let H=k&&(T||!a.hasIconData()||S),q=T&&(k||!a.hasTextData()||w);const W=!P.isConstant();!a.collisionArrays&&y&&a.deserializeCollisionBoxes(y),n&&i&&a.updateCollisionDebugBuffers(this.transform.zoom,y,z,F);const Z=(t,i,o)=>{const{crossTileID:l,numVerticalGlyphVertices:y}=t;let M=null;if(h&&h.dynamicFilterNeedsFeature||W){const e=this.retainedQueryData[a.bucketInstanceId];M=x.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.s
1ourceLayerIndex,layoutVertexArrayOffset:0});const r=M.properties?M.properties.worldview:null;if(a.localizable&&a.worldview&&"string"==typeof r)if("all"===r)M.properties.$localized=!0;else{if(!r.split(",").includes(a.worldview))return;M.properties.$localized=!0,M.properties.worldview=a.worldview}}if(h&&!(0,h.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch,worldview:a.worldview},M,this.retainedQueryData[a.bucketInstanceId].tileID.canonical,new e.P(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(h.unwrappedTileID)))return this.placements[l]=new wr(!1,!1,!1,!0),void r.add(l);const C=P.evaluate(M,{});if(r.has(l))return;if(m)return void(this.placements[l]=new wr(!1,!1,!1));let R=!1,L=!1,O=!0,D=!1,z=!1,F=null,B={box:null,offscreen:null,occluded:null},j={box:null},V=null,G=null,Z=null,Y=0,X=0,K=0;o.textFeatureIndex?Y=o.textFeatureIndex:t.useRuntimeCollisionCircles&&(Y=t.featureIndex),o.verticalTextFeatureIndex&&(X=o.verticalTextFeatureIndex);const J=a.elevationFeatures?a.elevationFeatures[t.elevationFeatureIndex]:void 0,Q=r=>{r.tileID=this.retainedQueryData[a.bucketInstanceId].tileID;const n=this.transform.elevation;r.elevation=A?C:C+e.bV.getAtTileOffset(r.tileID,new e.P(r.tileAnchorX,r.tileAnchorY),n,J),r.elevation+=t.zOffset},ee=o.textBox;if(ee){Q(ee);const r=r=>{let n=e.bL.horizontal;if(a.allowVerticalPlacement&&!r&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[l];e&&(this.placedOrientations[l]=e,n=e,this.markUsedOrientation(a,n,t))}return n},n=(t,r)=>{if(a.allowVerticalPlacement&&y>0&&o.verticalTextBox){for(const n of a.writingModes)if(n===e.bL.vertical?(B=r(),j=B):B=t(),B&&B.box&&B.box.length)break}else B=t()};if(N){let s=N;if(this.prevPlacement&&this.prevPlacement.variableOffsets[l]){const e=this.prevPlacement.variableOffsets[l];s.indexOf(e.anchor)>0&&(s=s.filter((t=>t!==e.anchor)),s.unshift(e.anchor))}const u=(e,r,n)=>{const o=a.getSymbolInstanceTextSize(_,t,this.transform.zoom,i),l=(e.x2-e.x1)*o+2*e.padding,u=(e.y2-e.y1)*o+2*e.padding,d=t.hasIconTextFit&&!T?r:null;d&&Q(d);let h={box:[],offscreen:!1,occluded:!1};const m=k?2*s.length:s.length;for(let r=0;r<m;++r){const m=this.attemptAnchorPlacement(s[r%s.length],e,p,g,U,l,u,o,I,E,f,c,b,r>=s.length,t,i,a,n,d,_,v);if(m&&(h=m.placedGlyphBoxes,h&&h.box&&h.box.length)){R=!0,F=m.shift;break}}return h};n((()=>u(ee,o.iconBox,e.bL.horizontal)),(()=>{const t=o.verticalTextBox;return t&&Q(t),a.allowVerticalPlacement&&!(B&&B.box&&B.box.length)&&y>0&&t?u(t,o.verticalIconBox,e.bL.vertical):{box:null,offscreen:null,occluded:null}})),B&&(R=B.box,O=B.offscreen,D=B.occluded);const d=r(!(!B||!B.box));if(!R&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[l];e&&(this.variableOffsets[l]=e,this.markUsedJustification(a,e.anchor,t,d))}}else{const s=(r,n)=>{const o=a.getSymbolInstanceTextSize(_,t,this.transform.zoom,i),s=this.collisionIndex.placeCollisionBox(a,o,r,p,g,U,new e.P(0,0),k,f,c,b.predicate);return s&&s.box&&s.box.length&&(this.markUsedOrientation(a,n,t),this.placedOrientations[l]=n),s};n((()=>s(ee,e.bL.horizontal)),(()=>{const t=o.verticalTextBox;return a.allowVerticalPlacement&&y>0&&t?(Q(t),s(t,e.bL.vertical)):{box:null,offscreen:null,occluded:null}})),r(!!(B&&B.box&&B.box.length))}}if(V=B,R=V&&V.box&&V.box.length>0,O=V&&V.offscreen,D=V&&V.occluded,t.useRuntimeCollisionCircles){const r=t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex,i=a.text.placedSymbolArray.get(r),o=e.bM(a.textSizeData,_,i),l=s.get("text-padding");G=this.collisionIndex.placeCollisionCircles(a,k,i,r,a.lineVertexArray,a.glyphOffsetArray,o,c,u,d,n,E,b.predicate,t.collisionCircleDiameter*o/e.bY,l,this.retainedQueryData[a.bucketInstanceId].tileID),R=k||G.circles.length>0&&!G.collisionDetected,O=O&&G.offscreen,D=G.occluded}if(o.iconFeatureIndex&&(K=o.iconFeatureIndex),o.iconBox){const r=r=>{Q(r);const n=t.hasIconTextFit&&F?Mr(F.x,F.y,I,E,this.transform.angle):new e.P(0,0),i=a.getSymbolInstanceIconSize(v,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(a,i,r,p,g,$,n,T,f,c,b.predicate)};j&&j.box&&j.box.length&&o.verticalIconBox?(Z=r(o.verticalIconBox),L=Z.box.length>0):(Z=r(o.iconBox),L=Z.box.length>0),O=O&&Z.offscreen,z=Z.occluded}const te=w||0===t.numHorizontalGlyphVertices&&0===y,re=S||0===t.numIconVertices;if(te||re?re?te||(L=L&&R):R=L&&R:L=R=L&&R,R&&V&&V.box&&this.collisionIndex.insertCollisionBox(V.box,s.get("text-ignore-placement"),a.bucketInstanceId,j&&j.box&&X?X:Y,b.ID),L&&Z&&this.collisionIndex.insertCollisionBox(Z.box,s.get("icon-ignore-placement"),a.bucketInstanceId,K,b.ID),G&&(R&&this.collisionIndex.insertCollisionCircles(G.circles,s.get("text-ignore-placement"),a.bucketInstanceId,Y,b.ID),n)){const e=a.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Sr);for(let e=0;e<G.circles.length;
vendor: 9,872 bytes, line 1
1e+=4)t.circles.push(G.circles[e+0]),t.circles.push(G.circles[e+1]),t.circles.push(G.circles[e+2]),t.circles.push(G.collisionDetected?1:0)}const ne="globe"!==a.projection.name;H=H&&(ne||!D),q=q&&(ne||!z),this.placements[l]=new wr(R||H,L||q,O||a.justReloaded),r.add(l)},Y=this.retainedQueryData[a.bucketInstanceId].tileID;if("offset"===a.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(a,Y),"road"===a.elevationType&&a.updateRoadElevation(Y.canonical),a.updateZOffset(),a.sortFeaturesByY){const t=a.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const r=t[e];Z(a.symbolInstances.get(r),r,a.collisionArrays[r])}a.hasAnyZOffset&&e.w(`${a.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(a.hasAnyZOffset){const e=a.getSortedIndexesByZOffset();for(let t=0;t<e.length;++t){const r=e[t];Z(a.symbolInstances.get(r),r,a.collisionArrays[r])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)Z(a.symbolInstances.get(e),e,a.collisionArrays[e]);if(n&&a.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[a.bucketInstanceId];e.bl(t.invProjMatrix,c),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}a.justReloaded=!1}markUsedJustification(t,r,n,i){const{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:l,crossTileID:c}=n,u=e.c3(r),d=i===e.bL.vertical?l:"left"===u?o:"center"===u?a:"right"===u?s:-1;o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=d>=0&&o!==d?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=d>=0&&a!==d?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=d>=0&&s!==d?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=d>=0&&l!==d?0:c)}markUsedOrientation(t,r,n){const i=r===e.bL.horizontal||r===e.bL.horizontalOnly?r:0,o=r===e.bL.vertical?r:0,{leftJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=n,u=t.text.placedSymbolArray;a>=0&&(u.get(a).placedOrientation=i),s>=0&&(u.get(s).placedOrientation=i),l>=0&&(u.get(l).placedOrientation=i),c>=0&&(u.get(c).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const n=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},o=t?t.variableOffsets:{},a=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=i[e];o?(this.opacities[e]=new xr(o,n,t.text,t.icon,null,t.clipped),r=r||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new xr(null,n,t.text,t.icon,t.skipFade,t.clipped),r=r||t.text||t.icon)}for(const e in i){const t=i[e];if(!this.opacities[e]){const i=new xr(t,n,!1,!1);i.isHidden()||(this.opacities[e]=i,r=r||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in a)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=a[e]);r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t,r,n){n&&(this.lastReplacementSourceUpdateTime=n.updateTime);const i=new Set;for(const o of t){const t=o.getBucket(e);t&&o.latestFeatureIndex&&e.fqid===t.layerIds[0]&&(this.updateBucketOpacities(t,i,o,o.collisionBoxArray,r,n,o.tileID,e.scope),"offset"===t.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(t,o.tileID),"road"===t.elevationType&&t.updateRoadElevation(o.tileID.canonical),t.updateZOffset())}}updateBucketOpacities(t,r,n,i,o,a,s,l){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,u=t.layers[0].paint,d=!!t.layers[0].dynamicFilter(),h=new xr(null,0,!1,!1,!0),f=c.get("text-allow-overlap"),p=c.get("icon-allow-overlap"),g=c.get("text-variable-anchor"),m="map"===c.get("text-rotation-alignment"),y="map"===c.get("text-pitch-alignment"),_=u.get("symbol-z-offset"),v="sea"===c.get("symbol-elevation-reference"),b=!_.isConstant(),x=new xr(null,0,f&&(p||!t.hasIconData()||c.get("icon-optional")),p&&(f||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const w=(e,t,r)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r)};let S=0;a&&t.updateReplacement(s,a);for(let i=0;i<t.symbolInstances.length;i++){const c=t.symbolInstances.get(i),{numHorizontalGlyphVertices:u,numVerticalGlyphVertices:f,crossTileID:p,numIconVertices:k,tileAnchorX:T,tileAnchorY:I}=c;let M=null;const E=this.retainedQueryData[t.bucketInstanceId];b&&c&&E&&(M=n.latestFeatureIndex.loadFeature({featureIndex:c.featureIndex,bucketIndex:E.bucketIndex,sourceLayerIndex:E.sourceLayerIndex,layoutVertexArrayOffset:0}));const P=_.evaluate(M,{}),A=r.has(p);let C=this.opacities[p];A?C=h:C||(C=x,this.opacities[p]=C),r.add(p);const R=u>0||f>0,L=k>0,O=this.placedOrientations[p],D=O===e.bL.vertical,z=O===e.bL.horizontal||O===e.bL.horizontalOnly;!R&&!L||C.isHidden()||S++;let F=!1;if((R||L)&&a)for(const r of t.activeReplacements){if(e.bZ(r,o,e.b_.Symbol,l))continue;if(r.min.x>T||T>r.max.x||r.min.y>I||I>r.max.y)continue;const t=e.b$(T,I,s.canonical,r.footprintTileId.canonical);if(F=e.c0(t,r.footprint),F)break}if(R){const e=F?Nr:Fr(C.text);w(t.text,u,D?Nr:e),w(t.text,f,z?Nr:e);const r=C.text.isHidden(),{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:i,rightJustifiedTextSymbolIndex:o,verticalPlacedTextSymbolIndex:a}=c,s=t.text.placedSymbolArray,l=r||D?1:0;n>=0&&(s.get(n).hidden=l),i>=0&&(s.get(i).hidden=l),o>=0&&(s.get(o).hidden=l),a>=0&&(s.get(a).hidden=r||z?1:0);const d=this.variableOffsets[p];d&&this.markUsedJustification(t,d.anchor,c,O);const h=this.placedOrientations[p];h&&(this.markUsedJustification(t,"left",c,h),this.markUsedOrientation(t,h,c))}if(L){const e=F?Nr:Fr(C.icon),{placedIconSymbolIndex:r,verticalPlacedIconSymbolIndex:n}=c,i=t.icon.placedSymbolArray,o=C.icon.isHidden()?1:0;r>=0&&(w(t.icon,k,D?Nr:e),i.get(r).hidden=o),n>=0&&(w(t.icon,c.numVerticalIconVertices,z?Nr:e),i.get(n).hidden=o)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const r=t.collisionArrays[i];if(r){let n=new e.P(0,0),i=!0;if(r.textBox||r.verticalTextBox){if(g){const e=this.variableOffsets[p];e?(n=Ir(e.anchor,e.width,e.height,e.textOffset,e.textScale),m&&n._rotate(y?this.transform.angle:-this.transform.angle)):i=!1}d&&(i=!C.clipped),r.textBox&&Pr(t.textCollisionBox.collisionVertexArray,C.text.placed,!i||D,P,v,n.x,n.y),r.verticalTextBox&&Pr(t.textCollisionBox.collisionVertexArray,C.text.placed,!i||z,P,v,n.x,n.y)}const o=i&&Boolean(!z&&r.verticalIconBox);r.iconBox&&Pr(t.iconCollisionBox.collisionVertexArray,C.icon.placed,o,P,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0),r.verticalIconBox&&Pr(t.iconCollisionBox.collisionVertexArray,C.icon.placed,!o,P,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0)}}}if(t.fullyClipped=0===S,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}isStale(){return this.stale}setStale(){this.stale=!0}}function Pr(e,t,r,n,i,o,a){e.emplaceBack(t?1:0,r?1:0,o||0,a||0,n,i?1:0),e.emplaceBack(t?1:0,r?1:0,o||0,a||0,n,i?1:0),e.emplaceBack(t?1:0,r?1:0,o||0,a||0,n,i?1:0),e.emplaceBack(t?1:0,r?1:0,o||0,a||0,n,i?1:0)}const Ar=Math.pow(2,25),Cr=Math.pow(2,24),Rr=Math.pow(2,17),Lr=Math.pow(2,16),Or=Math.pow(2,9),Dr=Math.pow(2,8),zr=Math.pow(2,1);function Fr(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Ar+t*Cr+r*Rr+t*Lr+r*Or+t*Dr+r*zr+t}const Nr=0;class Br{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,r,n,i,o){const a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(a,n,e[this._currentTileIndex],this._sortAcrossTiles,o),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(((e,t)=>
1e.sortKey-t.sortKey)));this._currentPartIndex<a.length;){const e=a[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,r,0===e.symbolInstanceStart,o),this._currentPartIndex++,i())return!0}return!1}}class jr{startNewPlacement(e,t,r,n,i,o,a,s){return this.placement=new Er(e,n,i,o,a,s),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=!1,this._showCollisionBoxes=r,this._fadeDuration=n,this._done=!1,this._inProgressLayer=null,this}requestFullPlacement(){this._forceFullPlacement=!0}isFullPlacementRequested(){return this._forceFullPlacement}setStale(){this.placement&&(this.placement.stale=!0)}isStale(){return!!this.placement&&this.placement.stale}isDone(){return this._done}continuePlacement(t,r,n,i,o){const a=e.o.now(),s=()=>{const t=e.o.now()-a;return!this.isFullPlacementRequested()&&0!==this._fadeDuration&&t>2};for(;this._currentPlacementIndex>=0;){const a=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&"none"!==a.visibility&&(!a.minzoom||a.minzoom<=l)&&(!a.maxzoom||a.maxzoom>l)){const t=a,r=t.layout.get("symbol-z-elevate"),l=void 0!==t.layout.get("symbol-sort-key").constantOr(1),c=t.layout.get("symbol-z-order"),u="viewport-y"===c||"auto"===c&&!("viewport-y"!==c&&l),d=t.layout.get("text-allow-overlap")||t.layout.get("icon-allow-overlap")||t.layout.get("text-ignore-placement")||t.layout.get("icon-ignore-placement"),h=u&&d,f=this._inProgressLayer=this._inProgressLayer||new Br(t),p=e.B(a.source,a.scope);if(f.continuePlacement(r||h?i[p]:n[p],this.placement,this._showCollisionBoxes,a,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._forceFullPlacement=!1,this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Vr=512/e.al/2;class Gr{constructor(t,r,n){this.tileID=t,this.bucketInstanceId=n,this.index=new e.c4(r.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const i=t.canonical.x*e.al,o=t.canonical.y*e.al;for(let e=0;e<r.length;e++){const{key:t,crossTileID:n,tileAnchorX:a,tileAnchorY:s}=r.get(e),l=Math.floor((i+a)*Vr),c=Math.floor((o+s)*Vr);this.index.add(l,c),this.keys.push(t),this.crossTileIDs.push(n)}this.index.finish()}findMatches(t,r,n){const i=this.tileID.canonical.z<r.canonical.z?1:Math.pow(2,this.tileID.canonical.z-r.canonical.z),o=Vr/Math.pow(2,r.canonical.z-this.tileID.canonical.z),a=r.canonical.x*e.al,s=r.canonical.y*e.al;for(let e=0;e<t.length;e++){const r=t.get(e);if(r.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:u}=r,d=Math.floor((a+c)*o),h=Math.floor((s+u)*o),f=this.index.range(d-i,h-i,d+i,h+i).sort(((e,t)=>e-t));for(const e of f){const t=this.crossTileIDs[e];if(this.keys[e]===l&&!n.has(t)){n.add(t),r.crossTileID=t;break}}}}}class Ur{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class $r{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const r=this.indexes[e],n={};for(const e in r){const i=r[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}this.indexes[e]=n}this.lng=e}addBucket(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]=new Set);const n=this.usedCrossTileIDs[e.overscaledZ];for(const r in this.indexes){const i=this.indexes[r];if(Number(r)>e.overscaledZ)for(const r in i){const o=i[r];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,n)}else{const o=i[e.scaledTo(Number(r)).key];o&&o.findMatches(t.symbolInstances,e,n)}}for(let e=0;e<t.symbolInstances.length;e++){const i=t.symbolInstances.get(e);i.crossTileID||(i.crossTileID=r.generate(),n.add(i.crossTileID))}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Gr(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const r of t.crossTileIDs)this.usedCrossTileIDs[e].delete(r)}removeStaleBuckets(e){let t=!1;for(const r in this.indexes){const n=this.indexes[r];for(const i in n)e[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],t=!0)}return t}}class Hr{constructor(){this.layerIndexes={},this.crossTileIDs=new Ur,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r,n){let i=this.layerIndexes[e.fqid];void 0===i&&(i=this.layerIndexes[e.fqid]=new $r);let o=!1;const a={};"globe"!==n.name&&i.handleWrapJump(r);for(const r of t){const t=r.getBucket(e);t&&e.fqid===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(r.tileID,t,this.crossTileIDs)&&(o=!0),a[t.bucketInstanceId]=!0)}return i.removeStaleBuckets(a)&&(o=!0),o}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0}));for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}const qr=771;
1class Wr{constructor(e,t,r,n){this.blendFunction=e,this.blendColor=t.toNonPremultipliedRenderColor(null),this.mask=r,this.blendEquation=n}}Wr.Replace=[1,0,1,0],Wr.disabled=new Wr(Wr.Replace,e.ao.transparent,[!1,!1,!1,!1]),Wr.unblended=new Wr(Wr.Replace,e.ao.transparent,[!0,!0,!0,!0]),Wr.alphaBlended=new Wr([1,qr,1,qr],e.ao.transparent,[!0,!0,!0,!0]),Wr.alphaBlendedNonPremultiplied=new Wr([770,qr,770,qr],e.ao.transparent,[!0,!0,!0,!0]),Wr.multiply=new Wr([774,0,774,0],e.ao.transparent,[!0,!0,!0,!0]),Wr.additive=new Wr([1,1,1,1],e.ao.transparent,[!0,!0,!0,!0]);class Zr{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}Zr.ReadOnly=!1,Zr.ReadWrite=!0,Zr.disabled=new Zr(519,Zr.ReadOnly,[0,1]);const Yr=7680;class Xr{constructor(e,t,r,n,i,o){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=i,this.pass=o}}Xr.disabled=new Xr({func:519,mask:0},0,0,Yr,Yr,Yr);const Kr=1029,Jr=2305;class Qr{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}function en(t,r){const n=e.ca(t,3);e.cc(t,r),e.cg(t,3,n)}function tn(t,r){const n=e.c7([]);return e.c8(n,n,-r),e.c9(n,n,-t),n}function rn(t,r){const n=[t[0],t[1],0],i=[r[0],r[1],0];if(e.ag(n)>=1e-15){const t=e.aw([],n);e.c5(i,t,e.bJ(i,t)),r[0]=i[0],r[1]=i[1]}const o=e.bI([],r,t);if(e.c6(o)<1e-15)return null;const a=Math.atan2(-o[1],o[0]);return tn(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),a)}Qr.disabled=new Qr(!1,Kr,Jr),Qr.backCCW=new Qr(!0,Kr,Jr),Qr.backCW=new Qr(!0,Kr,2304),Qr.frontCW=new Qr(!0,1028,2304),Qr.frontCCW=new Qr(!0,1028,Jr);class nn{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const r=t instanceof e.ae?t:new e.ae(t[0],t[1],t[2]);
1this._renderWorldCopies&&(r.x=e.bT(r.x,0,1)),this._position=r}else this._position=null}lookAtPoint(t,r,n){if(this.orientation=null,!this.position)return;const i=this.position,o=n||(this._elevation?this._elevation.getAtPointOrZero(e.ae.fromLngLat(t)):0),a=e.ae.fromLngLat(t,o),s=[a.x-i.x,a.y-i.y,a.z-i.z];r||(r=[0,0,1]),r[2]=Math.abs(r[2]),this.orientation=rn(s,r)}setPitchBearing(t,r){this.orientation=tn(e.an(t),e.an(-r))}}class on{constructor(t,r){this._transform=e.bA([]),this.orientation=r,this.position=t}get mercatorPosition(){const t=this.position;return new e.ae(t[0],t[1],t[2])}get position(){const t=e.ca(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var r;t&&e.cg(this._transform,3,[(r=t)[0],r[1],r[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.c7([]),t&&en(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=tn(e,t),en(this._transform,this._orientation)}forward(){const t=e.ca(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.ca(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.ca(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,r){const n=new Float64Array(16);return e.bl(n,this.getWorldToCamera(t,r)),n}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,r,n){const i=this.position;e.c5(i,i,-t);const o=new Float64Array(16);return e.bq(o,[n,n,n]),e.br(o,o,i),o[10]*=r,o}getWorldToCamera(t,r){const n=new Float64Array(16),i=new Float64Array(4),o=this.position;return e.cb(i,this._orientation),e.c5(o,o,-t),e.cc(n,i),e.br(n,n,o),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=r,n[9]*=r,n[10]*=r,n[11]*=r,n}getCameraToClipPerspective(t,r,n,i){const o=new Float64Array(16);return e.cd(o,t,r,n,i),o}getCameraToClipOrthographic(t,r,n,i,o,a){const s=new Float64Array(16);return e.ce(s,t,r,n,i,o,a),s}getDistanceToElevation(t,r=!1){const n=0===t?0:e.cf(t,r?e.a$(this.position[1]):this.position[1]),i=this.forward();return(n-this.position[2])/i[2]}clone(){return new on([...this.position],[...this.orientation])}}const an=(e,t)=>({u_matrix:e,u_ground_shadow_factor:t});class sn{constructor(e=0,t=0,r=0,n=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n}interpolate(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.ak(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.ak(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.ak(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.ak(t.right,r.right,n)),this}getCenter(t,r){const n=e.aA((this.left+t-this.right)/2,0,t),i=e.aA((this.top+r-this.bottom)/2,0,r);return new e.P(n,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new sn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const ln=15;class cn{constructor(t,r,n,i,o,a,s){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=n??0,this._maxPitch=i??60,this.setProjection(a),this.setMaxBounds(s),this.width=0,this.height=0,this._center=new e.aT(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new sn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new on,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1}clone(){const e=new cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForE
vendor: 1,247 bytes, line 1
1xaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e._allowWorldUnderZoom=this._allowWorldUnderZoom,e}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<ln}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e,t=!1){const r=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForE
1xaggeration;(null==this._seaLevelZoom||r)&&this._updateCameraOnTerrain(),(e||r)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.aH(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const r=this.projection?this.getProjection():void 0;this.projection=e.cm(this.projectionOptions);const n=this.getProjection(),i=!e.by(r,n);return i&&this._calcMatrices(),this.mercatorFromTransition=!1,i}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.cm({name:"mercator"});const r=t!==this.projection.name;return r&&this._calcMatrices(),r}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.cf(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return e.bT(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const r=-t*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.cn(),e.co(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const r=e.aA(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.an(t),this._calcMatrices())}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e)}_updateCameraOnTerrain(){const e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,t=this.elevation&&e===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>
10&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===Number.NEGATIVE_INFINITY&&(!t||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const r=this._elevation;t||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&r.exaggeration()&&this._centerAltitudeValidForExaggeration!==r.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*r.exaggeration(),this._centerAltitudeValidForExaggeration=r.exaggeration()):(this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=r.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){if(void 0===this._centerAltitudeValidForExaggeration)return;const e=Math.max(0,(this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize);this._seaLevelZoom=this._zoomFromMercatorZ(e)}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,r=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop();let i=0,o=0;for(let a=0;a<r.length;a++){const s=new e.P(r[a][0]*this.width,n+r[a][1]*(this.height-n)),l=t.pointCoordinate(s);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);i+=l[3]*c,o+=c}return 0===o?NaN:i/o}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const e=this._seaLevelZoom,t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),r=this.pixelsPerMeter/this.worldSize*t,n=this._mercatorZfromZoom(e),i=this._mercatorZfromZoom(this._maxZoom),o=Math.max(n-r,i);this._setZoom(this._zoomFromMercatorZ(o))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}equals(e){const t=this.elevation,r=e.elevation,n=null!=t!=(null!=r)||t&&r&&t.exaggeration()!==r.exaggeration();return this.width===e.width&&this.height===e.height&&this.center.lng===e.center.lng&&this.center.lat===e.center.lat&&this.zoom===e.zoom&&this.bearing===e.bearing&&this.pitch===e.pitch&&this.fov===e.fov&&this.projection.name===e.projection.name&&this._edgeInsets.equals(e.padding)&&!n}computeZoomRelativeTo(t){const r=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let n;n=t.z<this._camera.position[2]?[r.x,r.y,r.z]:[t.x,t.y,t.z];const i=e.ag(e.av([],this._camera.position,n));return e.aA(this._zoomFromMercatorZ(i),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let r=!1;if(t.orientation&&!e.cp(t.orientation,this._camera.orientation)&&(r=this._setCameraOrientation(t.orientation)),t.position){const n=[t.position.x,t.position.y,t.position.z];e.cq(n,this._camera.position)||(this._setCameraPosition(n),r=!0)}r&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,r=new nn;return r.position=new e.ae(t[0],t[1],t[2]),r.orientation=this._camera.orientation,r._elevation=this.elevation,r._renderWorldCopies=this.renderWorldCopies,r}_setCameraOrientation(t){if(!e.cr(t))return!1;e.cs(t,t);const r=e.ct([],[0,0,-1],t),n=e.ct([],[0,-1,0],t);if(n[2]<0)return!1;const i=rn(r,n);return!!i&&(this._camera.orientation=i,!0)}_setCameraPosition(t){const r=this.zoomScale(this.minZoom)*this.tileSize,n=this.zoomScale(this.maxZoom)*this.tileSize,i=this.cameraToCenterDistance;t[2]=e.aA(t[2],i/n,i/r),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(t){const r=[new e.cu(0,t)];if(this.renderWorldCopies){const n=this.pointCoordinate(new e.P(0,0)),i=this.pointCoordinate(new e.P(this.width,0)),o=this.pointCoordinate(new e.P(this.width,this.height)),a=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),l=Math.floor(Math.max(n.x,i.x,o.x,a.x)),c=1;for(let n=s-c;n<=l+c;n++)0!==n&&r.push(new e.cu(n,t))}return r}isLODDisabled(e){return(!e||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(t,r,n,i){let o=[];const a=null!=n,s=!a;if(s&&this.zoom<r)return o;if(a&&0===n[0]&&0===n[1])return o;const l=new Set,c=(t,r,n,i,a)=>{const s=e.cY(r,t,n,i,a);l.has(s)||(o.push(new e.aQ(t,r,n,i,a)),l.add(s))};for(let e=0;e<t.length;e++){const o=t[e];if(s&&o.canonical.z!==r)continue;if(a&&void 0!==i&&i>o.canonical.z)continue;const l=o.canonical,u=o.overscaledZ,d=o.wrap,h=1<<l.z,f=l.x+1<h,p=l.x>0,g=l.y+1<h,m=l.y>0,y=o.wrap-(p?0:1),_=o.wrap+(f?0:1),v=p?l.x-1:h-1,b=f?l.x+1:0;if(a)n[0]<0?(c(u,_,l.z,b,l.y),n[1]<0&&g&&(c(u,d,l.z,l.x,l.y+1),c(u,_,l.z,b,l.y+1)),n[1]>0&&m&&(c(u,d,l.z,l.x,l.y-1),c(u,_,l.z,b,l.y-1))):n[0]>0?(c(u,y,l.z,v,l.y),n[1]<0&&g&&(c(u,d,l.z,l.x,l.y+1),c(u,y,l.z,v,l.y+1)),n[1]>0&&m&&(c(u,d,l.z,l.x,l.y-1),c(u,y,l.z,v,l.y-1))):n[1]<0&&g?c(u,d,l.z,l.x,l.y+1):m&&c(u,d,l.z,l.x,l.y-1);else{const e=o.visibleQuadrants;1&e&&(c(u,y,l.z,v,l.y),m&&(c(u,d,l.z,l.x,l.y-1),c(u,y,l.z,v,l.y-1))),2&e&&(c(u,_,l.z,b,l.y),m&&(c(u,d,l.z,l.x,l.y-1),c(u,_,l.z,b,l.y-1))),4&e&&(c(u,y,l.z,v,l.y),g&&(c(u,d,l.z,l.x,l.y+1),c(u,y,l.z,v,l.y+1))),8&e&&(c(u,_,l.z,b,l.y),g&&(c(u,d,l.z,l.x,l.y+1),c(u,_,l.z,b,l.y+1)))}}const u=[];for(const e of o)o.some((t=>e.isChildOf(t)))||u.push(e);if(o=u.filter((e=>!t.some((t=>!!(e.overscaledZ<r&&t.isChildOf(e))||e.equals(t)||e.isChildOf(t))))),s){const e=1<<r,t="globe"===this.projection.name?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),n=[e*t.x,e*t.y],i=4,a=i*i;o=o.filter((e=>{const t=e.canonical.x+.5-n[0],r=e.canonical.y+.5-n[1];return t*t+r*r<a}))}return o}extendTileCoverToNearPlane(t,r,n){const i=[],o=new Set;for(const e of t)o.add(e.key);const a=(t,r,n,a,s)=>{const l=e.cY(r,t,n,a,s);o.has(l)||(i.push(new e.aQ(t,r,n,a,s)),o.add(l))},s=t.reduce(((e,t)=>
1Math.max(e,t.overscaledZ)),n),l=1<<n,c=[new e.P(0,0),new e.P(e.al,0),new e.P(e.al,e.al),new e.P(0,e.al)],u=new e.P(0,0),d=new e.P(0,0),h=(t,r)=>{const i=Math.floor(t[0]),o=Math.floor(t[1]),h=(t[0]-i)*e.al,f=(t[1]-o)*e.al,p=Math.floor(r[0]),g=Math.floor(r[1]),m=(r[0]-p)*e.al,y=(r[1]-g)*e.al;for(let t=-1;t<=1;t++){const r=i+t;if(!(r<0||r>=l)){u.x=h-t*e.al,d.x=m-(r-p)*e.al;for(let t=-1;t<=1;t++){const i=o+t;u.y=f-t*e.al,d.y=y-(i-g)*e.al,e.cZ(u,d,c)&&a(s,0,n,r,i)}}}},f=r.points,p=f[e.cv],g=f[e.cw],m=this._projectToGround(p,f[e.cx]),y=this._projectToGround(g,f[e.cy]);return h(p,m),h(g,y),i}_projectToGround(t,r){return e.cz(e.cA(),t,r,t[2]/(t[2]-r[2]))}coveringTiles(t){let r=this.coveringZoomLevel(t);const n=r,i=this.elevation&&this.elevation.exaggeration(),o=i&&!t.isTerrainDEM,a="mercator"===this.projection.name;if(void 0!==t.minzoom&&r<t.minzoom)return[];void 0!==t.maxzoom&&r>t.maxzoom&&(r=t.maxzoom);const s=this.locationCoordinate(this.center),l=this.center.lat,c=1<<r,u=[c*s.x,c*s.y,0],d="globe"===this.projection.name,h=!d,f=e.cB.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r,h),p=d?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),g=c*e.cf(1,this.center.lat),m=this._camera.position[2]/e.cf(1,this.center.lat),y=[c*p.x,c*p.y,m*(h?1:g)],_=d||i,v=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),b=this.isLODDisabled(!0)?r:0;let x;if(this._elevation&&t.isTerrainDEM)x=1e4*this._elevation.exaggeration();else if(this._elevation){const e=this._elevation.getMinMaxForVisibleTiles();x=e?e.max:this._centerAltitude}else x=this._centerAltitude;const w=t.isTerrainDEM?-x:this._elevation?this._elevation.getMinElevationBelowMSL():0,S=this.projection.isReprojectedInTileSpace?e.cC(this):1,k=t=>{const r=1/4e4,n=new e.ae(t.x+r,t.y,t.z),i=new e.ae(t.x,t.y+r,t.z),o=t.toLngLat(),a=n.toLngLat(),s=i.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(a),u=this.locationCoordinate(s),d=Math.hypot(c.x-l.x,c.y-l.y),h=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(d*h)*S/r},T=t=>{const r=x,n=w;return{aabb:e.cF(this,c,0,0,0,t,n,r,this.projection),zoom:0,x:0,y:0,minZ:n,maxZ:r,wrap:t,fullyVisible:!1}},I=[];let M=[];const E=r,P=t.reparseOverscaled?n:r,A=(m-this._centerAltitude)*g,C=e=>{if(!this._elevation||!e.tileID||!a)return;const t=this._elevation.getMinMaxForTile(e.tileID),r=e.aabb;t?(r.min[2]=t.min,r.max[2]=t.max,r.center[2]=(r.min[2]+r.max[2])/2):(e.shouldSplit=L(e),e.shouldSplit||(r.min[2]=r.max[2]=r.center[2]=this._centerAltitude))},R=(e,t)=>{if(.707*t<e)return 1;const r=t/e;return r/(1.4144271570014144+(Math.pow(1.1,r-1.4144271570014144+1)-1)/(1.1-1)-1)},L=t=>{if(t.zoom<b)return!0;if(t.zoom===E)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const r=t.aabb.distanceX(y),i=t.aabb.distanceY(y);let s=A,c=1;if(d){s=t.aabb.distanceZ(y);const r=Math.pow(2,t.zoom),n=e.a$((t.y+1)/r),i=e.a$(t.y/r),o=Math.min(Math.max(l,n),i),a=e.d1(o)/e.d1(l);if(c=o===l?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,a/this._mercatorScaleRatio),this.zoom<=e.c_&&t.zoom===E-1&&a>=.9)return!0}else if(o&&(s=t.aabb.distanceZ(y)*g),this.projection.isReprojectedInTileSpace&&n<=5){const r=Math.pow(2,t.zoom),n=k(new e.ae((t.x+.5)/r,(t.y+.5)/r));c=n>.85?1:n}if(!a&&!d){const e=Math.sqrt(r*r+i*i+s*s);let n=(1<<E-t.zoom)*v*c;return n*=R(Math.max(s,A),e),e<n}let h=Number.MAX_VALUE,f=0;const p=t.aabb.getCorners(),m=[];for(const t of p){e.av(m,t,y),d||(o?m[2]*=g:m[2]=A);const r=e.bJ(m,this._camera.forward());r<h&&(h=r,f=Math.abs(m[2]))}let _=(1<<E-t.zoom)*v*c;if(_*=R(Math.max(f,A),h),h<_)return!0;const x=t.aabb.closestPoint(u);return x[0]===u[0]&&x[1]===u[1]};if(this.renderWorldCopies)for(let e=1;e<=3;e++)I.push(T(-e)),I.push(T(e));for(I.push(T(0));I.length>0;){const n=I.pop(),i=n.x,s=n.y;let l=n.fullyVisible;const h=()=>"globe"===this.projection.name&&(0===n.y||n.y===(1<<n.zoom)-1);if(!l){let t=_?n.aabb.intersects(f):n.aabb.intersectsFlat(f);if(0===t&&h()){const r=new e.cD(n.zoom,i,s);t=e.cE(this,c,r,!0).intersects(f)}if(0===t)continue;l=2===t}if(n.zoom!==E&&L(n))for(let t=0;t<4;t++){const r=(i<<1)+t%2,u=(s<<1)+(t>>
11),h={aabb:a?n.aabb.quadrant(t):e.cF(this,c,n.zoom+1,r,u,n.wrap,n.minZ,n.maxZ,this.projection),zoom:n.zoom+1,x:r,y:u,wrap:n.wrap,fullyVisible:l,tileID:void 0,shouldSplit:void 0,minZ:n.minZ,maxZ:n.maxZ};o&&!d&&(h.tileID=new e.aQ(n.zoom+1===E?P:n.zoom+1,n.wrap,n.zoom+1,r,u),C(h)),I.push(h)}else{const o=n.zoom===E?P:n.zoom;if(t.minzoom&&t.minzoom>o)continue;let a=0;if(!l){let r=_?n.aabb.intersectsPrecise(f):n.aabb.intersectsPreciseFlat(f);if(0===r&&h()){const t=new e.cD(n.zoom,i,s);r=e.cE(this,c,t,!0).intersectsPrecise(f)}if(0===r)continue;if(t.calculateQuadrantVisibility)if(f.containsPoint(n.aabb.center))a=15;else for(let e=0;e<4;e++)0!==n.aabb.quadrant(e).intersects(f)&&(a|=1<<e)}const d=u[0]-(.5+i+(n.wrap<<n.zoom))*(1<<r-n.zoom),p=u[1]-.5-s,g=n.tileID?n.tileID:new e.aQ(o,n.wrap,n.zoom,i,s);t.calculateQuadrantVisibility&&(g.visibleQuadrants=a),M.push({tileID:g,distanceSq:d*d+p*p})}}if(this.fogCullDistSq){const r=this.fogCullDistSq,n=this.horizonLineFromTop();M=M.filter((i=>{const o=[0,0,0,1],a=[e.al,e.al,0,1],s=this.calculateFogTileMatrix(i.tileID.toUnwrapped());e.aC(o,o,s),e.aC(a,a,s);const l=e.cG([],o,a),c=e.cH([],o,a),u=e.c$(l,c);if(0===u)return!0;let d=!1;const h=this._elevation;if(h&&u>r&&0!==n){const r=this.calculateProjMatrix(i.tileID.toUnwrapped());let o;t.isTerrainDEM||(o=h.getMinMaxForTile(i.tileID)),o||(o={min:w,max:x});const a=e.cI(this.rotation),s=[a[0]*e.al,a[1]*e.al,o.max];e.af(s,s,r),d=(1-s[1])*this.height*.5<n}return u<r||d}))}return M.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log2(e)}project(t){const r=e.aA(t.lat,-e.cJ,e.cJ),n=this.projection.project(t.lng,r);return new e.P(n.x*this.worldSize,n.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.cf(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,r){let n,i;const o=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;n=(r.x-o.x)/e,i=(r.y-o.y)/e}else{const e=this.pointCoordinate(r),t=this.pointCoordinate(o);n=e.x-t.x,i=e.y-t.y}const a=this.locationCoordinate(t);this.setLocation(new e.ae(a.x-n,a.y-i))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e,t){return this.projection.locationPoint(this,e,t)}locationPoint3D(e,t){return this.projection.locationPoint(this,e,t,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e,t){return this.coordinateLocation(this.pointCoordinate3D(e,t))}locationCoordinate(t,r){const n=r?e.cf(r,t.lat):void 0,i=this.projection.project(t.lng,t.lat);return new e.ae(i.x,i.y,n)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,r){const n=null!=r?r:this._centerAltitude,i=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.aC(i,i,this.pixelMatrixInverse),e.aC(o,o,this.pixelMatrixInverse);const a=o[3];e.cK(i,i,1/i[3]),e.cK(o,o,1/a);const s=i[2],l=o[2];return{p0:i,p1:o,t:s===l?0:(n-s)/(l-s)}}screenPointToMercatorRay(t){const r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];return e.aC(r,r,this.pixelMatrixInverse),e.aC(n,n,this.pixelMatrixInverse),e.cK(r,r,1/r[3]),e.cK(n,n,1/n[3]),r[2]=e.cf(r[2],this._center.lat)*this.worldSize,n[2]=e.cf(n[2],this._center.lat)*this.worldSize,e.cK(r,r,1/this.worldSize),e.cK(n,n,1/this.worldSize),new e.ax([r[0],r[1],r[2]],e.aw([],e.av([],n,r)))}rayIntersectionCoordinate(t){const{p0:r,p1:n,t:i}=t,o=e.cf(r[2],this._center.lat),a=e.cf(n[2],this._center.lat);return new e.ae(e.ak(r[0],n[0],i)/this.worldSize,e.ak(r[1],n[1],i)/this.worldSize,e.ak(o,a,i))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t,r){if(!this.elevation)return this.pointCoordinate(t,r);let n=this.projection.pointCoordinate3D(this,t.x,t.y);if(n)return new e.ae(n[0],n[1],n[2]);let i=0,o=this.horizonLineFromTop();if(t.y>o)return this.pointCoordinate(t,r);const a=.02*o,s=t.clone();for(let t=0;t<10&&o-i>a;t++){s.y=e.ak(i,o,.66);const t=this.projection.pointCoordinate3D(this,s.x,s.y);t?(o=s.y,n=t):i=s.y}return n?new e.ae(n[0],n[1],n[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.cL)return!this.isPointAboveHorizon(t);const r=this.pointCoordinate(t);return r.y>=0&&r.y<=1}_coordinatePoint(t,r){const n=r&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,i=[t.x*this.worldSize,t.y*this.worldSize,n+t.toAltitude(),1];return e.aC(i,i,this.pixelMatrix),i[3]>
10?new e.P(i[0]/i[3],i[1]/i[3]):new e.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:r}=this._edgeInsets,n=this.height-this._edgeInsets.bottom,i=this.width-this._edgeInsets.right,o=this.pointLocation3D(new e.P(r,t)),a=this.pointLocation3D(new e.P(i,t)),s=this.pointLocation3D(new e.P(i,n)),l=this.pointLocation3D(new e.P(r,n));let c=Math.min(o.lng,a.lng,s.lng,l.lng),u=Math.max(o.lng,a.lng,s.lng,l.lng),d=Math.min(o.lat,a.lat,s.lat,l.lat),h=Math.max(o.lat,a.lat,s.lat,l.lat);const f=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,g=(t,r,n,i,o)=>{const a=(t+n)/2,s=(r+i)/2,l=new e.P(a,s),{lng:m,lat:y}=this.pointLocation3D(l),_=Math.max(0,c-m,d-y,m-u,y-h);c=Math.min(c,m),u=Math.max(u,m),d=Math.min(d,y),h=Math.max(h,y),(o<p||_>f)&&(g(t,r,a,s,o+1),g(a,s,n,i,o+1))};if(g(r,t,i,t,1),g(i,t,i,n,1),g(i,n,r,n,1),g(r,n,r,t,1),"globe"===this.projection.name){const[t,r]=e.cM(this);t?(h=90,u=180,c=-180):r&&(d=-90,u=180,c=-180)}return new e.aI(new e.aT(c,d),new e.aT(u,h))}_getBoundsRectangular(t,r){const{top:n,left:i}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,a=this.width-this._edgeInsets.right,s=new e.P(i,n),l=new e.P(a,n),c=new e.P(a,o),u=new e.P(i,o);let d=this.pointCoordinate(s,t),h=this.pointCoordinate(l,t);const f=this.pointCoordinate(c,r),p=this.pointCoordinate(u,r),g=(e,t)=>(t.y-e.y)/(t.x-e.x);return d.y>1&&h.y>=0?d=new e.ae((1-p.y)/g(p,d)+p.x,1):d.y<0&&h.y<=1&&(d=new e.ae(-p.y/g(p,d)+p.x,0)),h.y>1&&d.y>=0?h=new e.ae((1-f.y)/g(f,h)+f.x,1):h.y<0&&d.y<=1&&(h=new e.ae(-f.y/g(f,h)+f.x,0)),(new e.aI).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(f))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce(((e,t)=>{if(t.dem){const r=t.dem.tree;e.min=Math.min(e.min,r.minimums[0]),e.max=Math.max(e.max,r.maximums[0])}return e}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,r=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,r):r}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.cJ,this.maxLat=e.cJ,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=e.aF(this.minLng)*this.tileSize,this.worldMaxX=e.aF(this.maxLng)*this.tileSize,this.worldMinY=e.aJ(this.maxLat)*this.tileSize,this.worldMaxY=e.aJ(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(t){const r=t.key,n=this._distanceTileDataCache;if(n[r])return n[r];const i=t.canonical,o=1/this.height,a=this.cameraWorldSize,s=a/this.zoomScale(i.z),l=(i.x+Math.pow(2,i.z)*t.wrap)*s,c=i.y*s,u=this.point;u.x*=a/this.worldSize,u.y*=a/this.worldSize;const d=this.angle,h=Math.sin(-d),f=-Math.cos(-d);return n[r]={bearing:[h,f],center:[(u.x-l)*o,(u.y-c)*o],scale:s/e.al*o},n[r]}calculateFogTileMatrix(t){const r=t.key,n=this._fogTileMatrixCache;if(n[r])return n[r];const i=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return e.aB(i,this.worldToFogMatrix,i),n[r]=new Float32Array(i),n[r]}calculateProjMatrix(t,r=!1,n=!1){const i=t.key;let o;if(o=n?this._expandedProjMatrixCache:r?this._alignedProjMatrixCache:this._projMatrixCache,o[i])return o[i];const a=this.calculatePosMatrix(t,this.worldSize);let s;return s=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.expandedFarZProjMatrix:r?this.alignedProjMatrix:this.projMatrix,e.aB(a,s,a),o[i]=new Float32Array(a),o[i]}calculatePixelsToTileUnitsMatrix(t){const r=t.tileID.key,n=this._pixelsToTileUnitsCache;if(n[r])return n[r];const i=e.cN(t,this);return n[r]=i,n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,r=e.bq([],[t,t,t]);return e.aB(r,r,this.globeMatrix),r}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const r=e.cf(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(r),i=this._camera.forward(),o=e.cf(1,this._center.lat);n[2]/=o,i[2]/=o,e.aw(i,i);const a=t.raycast(n,i,t.exaggeration());if(a){const t=e.bH([],n,i,a),r=new e.ae(t[0],t[1],e.cf(t[2],e.a$(t[1]))),s=(r.z+e.ag([r.x-n[0],r.y-n[1],r.z-n[2]*o]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(s),this._centerAltitude=r.toAltitude(),this._center=this.coordinateLocation(r),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const r=this._elevation,n=e.cf(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(n),o=r.getAtPointOrZero(new e.ae(...i)),a=this.pixelsPerMeter/this.worldSize*o,s=this._minimumHeightOverTerrain(),l=i[2]-a;if(l<=s)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),r=[i[0],i[1],t.z-i[2]],n=e.ag(r);r[2]-=(s-l)/this._pixelsPerMercatorPixel;const o=e.ag(r);if(0===o)return;e.c5(r,r,n/o*this._pixelsPerMercatorPixel),this._camera.position=[i[0],i[1],t.z*this._pixelsPerMercatorPixel-r[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const r=this.center;return r.lat=e.aA(r.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(r.lng=e.aA(r.lng,this.minLng,this.maxLng)),this.center=r,void(this._constraining=!1)}const r=this._unmodified,{x:n,y:i}=this.point;let o=0,a=n,s=i;const l=this.width/2,c=this.height/2,u=this.worldMinY*this.scale,d=this.worldMaxY*this.scale;if(i-c<u&&(s=u+c),i+c>d&&(s=d-c),d-u<this.height&&(o=Math.max(o,this.height/(d-u)),s=(d+u)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,r=this.worldSize/2-(e+t)/2;a=(n+r+this.worldSize)%this.worldSize-r,a-l<e&&(a=e+l),a+l>t&&(a=t-l),t-e<this.width&&(o=Math.max(o,this.width/(t-e)),a=(t+e)/2)}a===n&&s===i||this._allowWorldUnderZoom||(this.center=this.unproject(new e.P(a,s))),o&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(o)),this._constrainCamera(),this._unmodified=r,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(Math.max(0,this.height)/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}
1_calcMatrices(){if(!this.height)return;const t=this.centerOffset,r="globe"===this.projection.name,n=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.cf(1,this.center.lat)/e.cf(1,e.d2));const i=e.cO(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,i),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const o="meters"===this.projection.zAxisUnit?n:1,a=this._camera.getWorldToCamera(this.worldSize,o);let s;const l=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,this.isOrthographic){let r=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),n=r*this.aspect,i=-n,o=-r;n-=t.x,i-=t.x,r+=t.y,o+=t.y,s=this._camera.getCameraToClipOrthographic(i,n,o,r,this._nearZ,this._farZ),((t,r,n,i)=>{for(let o=0;o<16;o++)t[o]=e.ak(r[o],n[o],i)})(s,s,l,e.d0(this.pitch>=ln?1:this.pitch/ln))}else s=l;const c=e.cP([],l,a);let u=e.cP([],s,a);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),r=e.bA([]);e.br(r,r,[t.x*this.worldSize,t.y*this.worldSize,0]),e.aB(r,r,e.cQ(this)),e.br(r,r,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.aB(u,u,r),e.aB(c,c,r),this.inverseAdjustmentMatrix=e.cR(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=e.cS([],u,[this.worldSize,this.worldSize,this.worldSize/o,1]),this.projMatrix=u,this.invProjMatrix=e.bl(new Float64Array(16),this.projMatrix),r){const r=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);r[8]=2*-t.x/this.width,r[9]=2*t.y/this.height,this.expandedFarZProjMatrix=e.cP([],r,a)}else this.expandedFarZProjMatrix=this.projMatrix;const d=e.bl([],s);this.frustumCorners=e.cT.fromInvProjectionMatrix(d,this.horizonLineFromTop(),this.height),this.cameraFrustum=e.cB.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!r);const h=new Float32Array(16);e.bA(h),e.cS(h,h,[1,-1,1]),e.cU(h,h,this._pitch),e.bB(h,h,this.angle);const f=e.cd(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=e.bz(f);const p=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;f[8]=2*-t.x/this.width,f[9]=2*(t.y+p)/this.height,this.skyboxMatrix=e.aB(h,f,h);const g=this.point,m=g.x,y=g.y,_=this.width%2/2,v=this.height%2/2,b=Math.cos(this.angle),x=Math.sin(this.angle),w=m-Math.round(m)+b*_+x*v,S=y-Math.round(y)+b*v+x*_,k=new Float64Array(u);if(e.br(k,k,[w>.5?w-1:w,S>.5?S-1:S,0]),this.alignedProjMatrix=k,u=e.bC(),e.cS(u,u,[this.width/2,-this.height/2,1]),e.br(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=e.bC(),e.cS(u,u,[1,-1,1]),e.br(u,u,[-1,-1,0]),e.cS(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=e.aB(new Float64Array(16),this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},u=e.bl(new Float64Array(16),this.pixelMatrix),!u)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=u,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.cV(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.af(t,t,a),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=u;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,r=this.cameraPixelsPerMeter,n=this._camera.position,i=1/this.height/this._pixelsPerMercatorPixel,o=[t,t,r];e.c5(o,o,i),e.c5(n,n,-1),e.cW(n,n,o);const a=e.bC();e.br(a,a,n),e.cS(a,a,o),this.mercatorFogMatrix=a,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,r,i)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,r=this._camera.forward(),n=this.point,i=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-r[0]*i,n.y/this.worldSize-r[1]*i,e/this.worldSize*this._centerAltitude-r[2]*i]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const r=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=this._camera.position[2],i=t[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),i>0&&(o=Math.min((r-n)/i,1)),this._camera.position=e.bH([],this._camera.position,t,o),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,r=this._camera.forward(),{pitch:n,bearing:i}=this._camera.getPitchBearing(),o=e.cf(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,a=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.an(this._maxPitch)),s=Math.max((t[2]-o)/Math.cos(n),a),l=this._zoomFromMercatorZ(s);e.bH(t,t,r,s),this._pitch=e.aA(n,e.an(this.minPitch),e.an(this.maxPitch)),this.angle=e.bT(i,-Math.PI,Math.PI),this._setZoom(e.aA(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.ae(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(Math.max(0,e)*this.tileSize))}zoomFromMercatorZAdjusted(t){let r=0,n=e.cL,i=0,o=1/0;for(;n-r>1e-6&&n>r;){const e=r+.5*(n-r),a=this.tileSize*Math.pow(2,e),s=this.getCameraToCenterDistance(this.projection,e,a),l=this.scaleZoom(s/(Math.max(0,t)*this.tileSize)),c=Math.abs(e-l);c<o&&(o=c,i=e),e<l?r=e:n=e}return i}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(e.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,r){const n=Math.min(t.x,r.x),i=Math.max(t.x,r.x),o=Math.min(t.y,r.y),a=Math.max(t.y,r.y);if(o<this.horizonLineFromTop(!1))return!0;
1if("mercator"!==this.projection.name)return!1;const s=[new e.P(n,o),new e.P(i,a),new e.P(n,a),new e.P(i,o)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const e of s){const t=this.pointRayIntersection(e);if(t.t<0)return!0;const r=this.rayIntersectionCoordinate(t);if(r.x<l||r.y<0||r.x>c||r.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.cX(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.P(0,0),new e.P(this.width,this.height))}zoomDeltaToMovement(t,r){const n=e.ag(e.av([],this._camera.position,t)),i=this._zoomFromMercatorZ(n)+r;return n-this._mercatorZfromZoom(i)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,r,n],i){const o=[t,r,n,1];e.aC(o,o,i);const a=o[3]=Math.max(o[3],1e-6);return o[0]/=a,o[1]/=a,o[2]/=a,o}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}}getCameraToCenterDistance(t,r=this.zoom,n=this.worldSize){const i=e.cO(t,r,this.width,this.height,1024),o=t.pixelSpaceConversion(this.center.lat,n,i);let a=.5/Math.tan(.5*this._fov)*this.height*o;return this.isOrthographic&&(a=e.ak(1,a,e.d0(this.pitch>=ln?1:this.pitch/ln))),a}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.aB(t,t,this.globeMatrix),t}getFrustum(t){return e.cB.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,"meters"===this.projection.zAxisUnit)}}const un=(t,r)=>{if(r>0&&t.terrain&&e.w("Cutoff is currently disabled on terrain"),r<=0||t.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const n=t.transform,i=Math.max(Math.abs(n._zoom-(t.minCutoffZoom-1)),1),o=n.isLODDisabled(!1)?e.ah(60,45,n.pitch):e.ah(30,15,n.pitch),a=n._farZ-n._nearZ,s=r*n.height,l=((1-(c=o))*n.cameraToCenterDistance+c*(n._farZ+s))*i;var c;return{shouldRenderCutoff:o<1,uniformValues:{u_cutoff_params:[n._nearZ,n._farZ,(l-n._nearZ)/a,(l-s-n._nearZ)/a]}}},dn=2048;class hn{constructor(e,t){this.aabb=e,this.lastCascade=t}}class fn{add(e,t){const r=this.receivers[e.key];void 0!==r?(r.aabb.min[0]=Math.min(r.aabb.min[0],t.min[0]),r.aabb.min[1]=Math.min(r.aabb.min[1],t.min[1]),r.aabb.min[2]=Math.min(r.aabb.min[2],t.min[2]),r.aabb.max[0]=Math.max(r.aabb.max[0],t.max[0]),r.aabb.max[1]=Math.max(r.aabb.max[1],t.max[1]),r.aabb.max[2]=Math.max(r.aabb.max[2],t.max[2])):this.receivers[e.key]=new hn(t,null)}clear(){this.receivers={}}get(e){return this.receivers[e.key]}computeRequiredCascades(t,r,n){const i=e.d9.fromPoints(t.points);let o=0;for(const t in this.receivers){const a=this.receivers[t];if(!a)continue;if(!i.intersectsAabb(a.aabb))continue;a.aabb.min=i.closestPoint(a.aabb.min),a.aabb.max=i.closestPoint(a.aabb.max);const s=a.aabb.getCorners();for(let t=0;t<n.length;t++){let i=!0;for(const o of s){const a=[o[0]*r,o[1]*r,o[2]];if(e.af(a,a,n[t].matrix),a[0]<-1||a[0]>1||a[1]<-1||a[1]>1){i=!1;break}}if(a.lastCascade=t,o=Math.max(o,t),i)break}}return o+1}}class pn{constructor(e){this.painter=e,this._enabled=!1,this._drawShadowAfterLayer=-1,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new fn,this._depthMode=new Zr(e.context.gl.LEQUAL,Zr.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1}destroy(){for(const e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,r){const n=this.painter;if(this._enabled=!1,this._drawShadowAfterLayer=-1,this._receivers.clear(),!r||!r.properties)return;const i=r.properties.get("shadow-intensity"),o=r.properties.get("shadow-draw-before-layer");if(!r.shadowsEnabled()||i<=0)return;let a=-1,s=0;for(const e of n.style.order){const r=n.style._mergedLayers[e];r.hasShadowPass()&&!r.isHidden(t.zoom)&&(a=s),o&&o===e&&(this._drawShadowAfterLayer=s>0?s-1:0),s+=1}if(this._enabled=a>=0,!this.enabled)return;this._drawShadowAfterLayer<0&&(this._drawShadowAfterLayer=a);const l=n.context,c=dn,u=dn;if(0===this._cascades.length||dn!==this._cascades[0].texture.size[0]){this._cascades=[];for(let t=0;t<2;++t){const t=n._shadowMapDebug,r=l.gl,i=l.createFramebuffer(c,u,t?1:0,"texture"),o=new e.T(l,{width:c,height:u,data:null},r.DEPTH_COMPONENT16);if(i.depthAttachment.set(o.texture),t){const t=new e.T(l,{width:c,height:u,data:null},r.RGBA8);i.colorAttachment0.set(t.texture)}this._cascades.push({framebuffer:i,texture:o,matrix:[],far:0,boundingSphereRadius:0,frustum:new e.cB,scale:0})}}this.shadowDirection=mn(r);let d=0;if(t.elevation){const e=t.elevation,r=[1e4,-1e4];e.visibleDemTiles.filter((e=>
1e.dem)).forEach((e=>{const t=e.dem.tree;r[0]=Math.min(r[0],t.minimums[0]),r[1]=Math.max(r[1],t.maximums[0])})),1e4!==r[0]&&(d=(r[1]-r[0])*e.exaggeration())}const h=1.5*t.cameraToCenterDistance,f=3*h,p=new Float64Array(16);for(let r=0;r<this._cascades.length;++r){const n=this._cascades[r];let i=t.height/50,o=1;0===r?o=h:(i=h,o=f);const[a,s]=_n(t,this.shadowDirection,i,o,dn,d);n.scale=t.scale,n.matrix=a,n.boundingSphereRadius=s,e.bl(p,n.matrix),n.frustum=e.cB.fromInvProjectionMatrix(p,1,0,!0),n.far=o}const g=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[g].far,this._cascades[g].far],this._uniformValues.u_shadow_intensity=i,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=.00048828125,this._uniformValues.u_shadow_map_resolution=dn,this._uniformValues.u_shadowmap_0=11,this._uniformValues.u_shadowmap_1=12,this._groundShadowTiles=n.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const m=n.transform.elevation;for(const e of this._groundShadowTiles){let t={min:0,max:0};if(m){const r=m.getMinMaxForTile(e);r&&(t=r)}this.addShadowReceiver(e.toUnwrapped(),t.min,t.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(e){this._enabled=e}drawShadowPass(t,r){if(!this.enabled)return;const n=this.painter,i=n.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(n.transform.getFrustum(0),n.transform.worldSize,this._cascades),i.viewport.set([0,0,dn,dn]);for(let o=0;o<this._numCascadesToRender;++o){n.currentShadowCascade=o,i.bindFramebuffer.set(this._cascades[o].framebuffer.framebuffer),i.clear({color:e.ao.white,depth:1});for(const e of t.order){const i=t._mergedLayers[e];if(!i.hasShadowPass()||i.isHidden(n.transform.zoom))continue;const o=t.getLayerSourceCache(i),a=o?r[o.id]:void 0;("model"===i.type||a&&a.length)&&n.renderLayer(n,o,i,a)}}n.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;const e=this.painter,t=e.style,r=e.context,n=r.gl,i=t.directionalLight,o=t.ambientLight;if(!i||!o)return;const a=[],s=un(e,e.longestCutoffRange);s.shouldRenderCutoff&&a.push("RENDER_CUTOFF"),a.push("RENDER_SHADOWS","DEPTH_TEXTURE"),this.useNormalOffset&&a.push("NORMAL_OFFSET");const l=yn(t,i,o),c=new Zr(n.LEQUAL,Zr.ReadOnly,e.depthRangeFor3D),u=new Xr({func:n.EQUAL,mask:255},0,255,n.KEEP,n.KEEP,n.KEEP);for(const t of this._groundShadowTiles){const i=t.toUnwrapped(),o=e.isTileAffectedByFog(t),d=e.getOrCreateProgram("groundShadow",{defines:a,overrideFog:o});this.setupShadows(i,d),e.uploadCommonUniforms(r,d,i,null,s);const h=an(e.transform.calculateProjMatrix(i),l);d.draw(e,n.TRIANGLES,c,u,Wr.multiply,Qr.disabled,h,"ground_shadow",e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments,null,e.transform.zoom,null,null)}}getShadowPassColorMode(){return this.painter._shadowMapDebug?Wr.unblended:Wr.disabled}getShadowPassDepthMode(){return this._depthMode}getGroundShadowLayerIndex(){return this._drawShadowAfterLayer}calculateShadowPassMatrixFromTile(t){const r=this.painter.transform,n=r.calculatePosMatrix(t,r.worldSize);return e.aB(n,this._cascades[this.painter.currentShadowCascade].matrix,n),Float32Array.from(n)}calculateShadowPassMatrixFromMatrix(t){const r=e.bz(t);return e.aB(r,this._cascades[this.painter.currentShadowCascade].matrix,t),r}setupShadows(t,r,n){if(!this.enabled)return;const i=this.painter.transform,o=this.painter.context,a=o.gl,s=this._uniformValues,l=new Float64Array(16),c=i.calculatePosMatrix(t,i.worldSize);for(let t=0;t<this._cascades.length;t++)e.aB(l,this._cascades[t].matrix,c),s[0===t?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(l),o.activeTexture.set(a.TEXTURE0+11+t),this._cascades[t].texture.bindExtraParam(a.LINEAR,a.LINEAR,a.CLAMP_TO_EDGE,a.CLAMP_TO_EDGE,a.GREATER);if(this.useNormalOffset=!!n,this.useNormalOffset){const r=e.d7(t.canonical),o=2/i.tileSize*e.al/dn,a=o*this._cascades[0].boundingSphereRadius,l=o*this._cascades[this._cascades.length-1].boundingSphereRadius,c=("vector-tile"===n?1:3)*function(t){const r=e.aA((t-22)/-22,0,1
1);return.125*(1-r)+4*r}(i.zoom);s.u_shadow_normal_offset=[r,a*c,l*c],s.u_shadow_bias=[1e-4,.0012,.012]}else s.u_shadow_bias=[36e-5,.0012,.012];r.setShadowUniformValues(o,s)}setupShadowsFromMatrix(t,r,n=!1){if(!this.enabled)return;const i=this.painter.context,o=i.gl,a=this._uniformValues,s=new Float64Array(16);for(let r=0;r<2;r++)e.aB(s,this._cascades[r].matrix,t),a[0===r?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(s),i.activeTexture.set(o.TEXTURE0+11+r),this._cascades[r].texture.bindExtraParam(o.LINEAR,o.LINEAR,o.CLAMP_TO_EDGE,o.CLAMP_TO_EDGE,o.GREATER);this.useNormalOffset=n,n?(a.u_shadow_normal_offset=[1,3,3],a.u_shadow_bias=[6e-5,.0012,.012]):a.u_shadow_bias=[36e-5,.0012,.012],r.setShadowUniformValues(i,a)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(t,r,n,i){if(i[2]>=0)return{};const o=function(t,r,n){const i=n/(1<<t.canonical.z);return new e.d9([t.canonical.x*i+t.wrap*n,t.canonical.y*i+t.wrap*n,0],[(t.canonical.x+1)*i+t.wrap*n,(t.canonical.y+1)*i+t.wrap*n,r])}(t,r,n).getCorners(),a=r/-i[2];i[0]<0?(e.d8(o[0],o[0],[i[0]*a,0,0]),e.d8(o[3],o[3],[i[0]*a,0,0])):i[0]>0&&(e.d8(o[1],o[1],[i[0]*a,0,0]),e.d8(o[2],o[2],[i[0]*a,0,0])),i[1]<0?(e.d8(o[0],o[0],[0,i[1]*a,0]),e.d8(o[1],o[1],[0,i[1]*a,0])):i[1]>0&&(e.d8(o[2],o[2],[0,i[1]*a,0]),e.d8(o[3],o[3],[0,i[1]*a,0]));const s={};return s.vertices=o,s.planes=[gn(o[1],o[0],o[4]),gn(o[2],o[1],o[5]),gn(o[3],o[2],o[6]),gn(o[0],o[3],o[7])],s}addShadowReceiver(t,r,n){this._receivers.add(t,e.d9.fromTileIdAndHeight(t,r,n))}getMaxCascadeForTile(e){const t=this._receivers.get(e);return t&&t.lastCascade?t.lastCascade:0}}function gn(t,r,n){const i=e.av([],n,r),o=e.av([],t,r),a=e.bI([],i,o),s=e.ag(a);return 0===s?[0,0,1,0]:(e.c5(a,a,1/s),[a[0],a[1],a[2],-e.bJ(a,r)])}function mn(t){const r=t.properties.get("direction"),n=e.d4(r.x,r.y,r.z);
1n[2]=e.aA(n[2],0,75);const i=e.d6([n[0],n[1],n[2]]);return e.d5(i.x,i.y,i.z)}function yn(t,r,n){const i="none"===r.properties.get("color-use-theme"),o=r.properties.get("color"),a=r.properties.get("intensity"),s=r.properties.get("direction"),l=[s.x,s.y,s.z],c="none"===n.properties.get("color-use-theme"),u=n.properties.get("color"),d=n.properties.get("intensity"),h=Math.max(e.bJ([0,0,1],l),0),f=[0,0,0];e.c5(f,u.toPremultipliedRenderColor(c?null:t.getLut(r.scope)).toArray01Linear().slice(0,3),d);const p=[0,0,0];return e.c5(p,o.toPremultipliedRenderColor(i?null:t.getLut(n.scope)).toArray01Linear().slice(0,3),h*a),e.db([f[0]>0?f[0]/(f[0]+p[0]):0,f[1]>0?f[1]/(f[1]+p[1]):0,f[2]>0?f[2]/(f[2]+p[2]):0])}function _n(t,r,n,i,o,a){const s=t.zoom,l=t.scale,c=t.worldSize,u=1/c,d=t.aspect,h=Math.sqrt(1+d*d)*Math.tan(.5*t.fovX),f=h*h,p=i-n,g=i+n;let m,y;f>p/g?(m=i,y=i*h):(m=.5*g*(1+f),y=.5*Math.sqrt(p*p+2*(i*i+n*n)*f+g*g*f*f));const _=t.projection.pixelsPerMeter(t.center.lat,c),v=t._camera.getCameraToWorldMercator(),b=[0,0,-m*u];e.af(b,b,v);let x=y*u;const w=function(r){return r[0]/=l,r[1]/=l,r[2]=e.cf(r[2],t._center.lat),r},S=t._edgeInsets;if(!(0===S.left&&0===S.top&&0===S.right&&0===S.bottom||S.left===S.right&&S.top===S.bottom)){const r=t._camera.getWorldToCamera(t.worldSize,"meters"===t.projection.zAxisUnit?_:1),o=t._camera.getCameraToClipPerspective(t._fov,t.width/t.height,n,i);o[8]=2*-t.centerOffset.x/t.width,o[9]=2*t.centerOffset.y/t.height;const a=new Float64Array(16);e.cP(a,o,r);const l=new Float64Array(16);e.bl(l,a);const u=e.cB.fromInvProjectionMatrix(l,c,s,!0);for(const t of u.points){const r=w(t);x=Math.max(x,e.c6(e.da([],b,r)))}}x*=o/(o-1);const k=Math.acos(r[2]),T=Math.atan2(-r[0],-r[1]),I=new on;I.position=b,I.setPitchBearing(k,T);const M=I.getWorldToCamera(c,_),E=x*c,P=Math.min(t._mercatorZfromZoom(17)*c*-2,-2*E),A=I.getCameraToClipOrthographic(-E,E,-E,E,P,(E+a*_)/r[2]),C=new Float64Array(16);e.aB(C,A,M);const R=e.d5(Math.floor(1e6*b[0])/1e6*c,Math.floor(1e6*b[1])/1e6*c,0),L=.5*o,O=[0,0,0];e.af(O,R,C),e.c5(O,O,L);const D=[Math.floor(O[0]),Math.floor(O[1]),Math.floor(O[2])],z=[0,0,0];e.av(z,O,D),e.c5(z,z,-1/L);const F=new Float64Array(16);return e.bA(F),e.br(F,F,z),e.aB(C,F,C),[C,E]}class vn extends e.E{constructor(e){super(),this.requestManager=e,this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}loadModel(t,r){return e.dc(this.requestManager.transformRequest(r,e.R.Model).url).then((n=>{if(!n)return;const i=e.dd(n),o=new e.de(t,r,void 0,void 0,i);return o.computeBoundsAndApplyParent(),o})).catch((n=>{if(n&&404===n.status)return null;this.fire(new e.y(new Error(`Could not load model ${t} from ${r}: ${n.message}`)))}))}load(t,r,n={forceReload:!1}){this.models[r]||(this.models[r]={});const i=Object.keys(t),o=[],a=[];for(const e of i){const i=t[e];this.hasURLBeenRequested(i)&&!n.forceReload||(this.modelByURL[i]={modelId:e,scope:r},o.push(this.loadModel(e,i)),a.push(e)),this.models[r][e]||(this.models[r][e]={model:null,numReferences:1})}this.numModelsLoading[r]=(this.numModelsLoading[r]||0)+a.length,Promise.allSettled(o).then((t=>{for(let e=0;e<t.length;e++){const{status:n}=t[e];if("rejected"===n)continue;const{value:i}=t[e];this.models[r][a[e]]||(this.models[r][a[e]]={model:null,numReferences:1}),this.models[r][a[e]].model=i}this.numModelsLoading[r]-=a.length,this.fire(new e.z("data",{dataType:"style"}))})).catch((t=>{this.fire(new e.y(new Error(`Could not load models: ${t.message}`)))}))}isLoaded(){for(const e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return!1;return!0}hasModel(e,t,r={exactIdMatch:!1}){return!!(r.exactIdMatch?this.getModel(e,t):this.getModelByURL(this.modelUris[t][e]))}getModel(e,t){return this.models[t]||(this.models[t]={}),this.models[t][e]?this.models[t][e].model:void 0}getModelByURL(e){if(!e)return null;const t=this.modelByURL[e];return t?this.models[t.scope][t.modelId].model:null}hasModelBeenAdded(e,t){return this.models[t]&&void 0!==this.models[t][e]}getModelURIs(e){return this.modelUris[e]||{}}addModel(e,t,r){this.models[r]||(this.models[r]={}),this.modelUris[r]||(this.modelUris[r]={});const n=this.requestManager.normalizeModelURL(t);
1if((this.hasModel(e,r,{exactIdMatch:!0})||this.hasModelBeenAdded(e,r))&&this.modelUris[r][e]===n)this.models[r][e].numReferences++;else if(this.hasURLBeenRequested(n)){const{scope:e,modelId:t}=this.modelByURL[n];this.models[e][t].numReferences++}else this.modelUris[r][e]=n,this.load({[e]:this.modelUris[r][e]},r)}addModelURLs(e,t){this.models[t]||(this.models[t]={}),this.modelUris[t]||(this.modelUris[t]={});const r=this.modelUris[t];for(const t in e)r[t]=this.requestManager.normalizeModelURL(e[t])}reloadModels(e){this.load(this.modelUris[e],e,{forceReload:!0})}addModelsFromBucket(t,r){this.models[r]||(this.models[r]={}),this.modelUris[r]||(this.modelUris[r]={});const n={};for(const i of t)this.hasModel(i,r,{exactIdMatch:!0})||this.hasURLBeenRequested(i)?this.models[r][i].numReferences++:this.modelUris[r][i]&&!this.hasURLBeenRequested(i)?n[i]=this.modelUris[r][i]:!this.hasURLBeenRequested(i)&&e.df(i,!1)&&(this.modelUris[r][i]=this.requestManager.normalizeModelURL(i),n[i]=this.modelUris[r][i]);this.load(n,r)}hasURLBeenRequested(e){return void 0!==this.modelByURL[e]}removeModel(e,t,r=!1,n=!1){if(this.models[t]&&this.models[t][e]&&(this.models[t][e].numReferences--,0===this.models[t][e].numReferences||n)){const n=this.modelUris[t][e];r||delete this.modelUris[t][e],delete this.modelByURL[n];const i=this.models[t][e].model;if(!i)return;delete this.models[t][e],i.destroy()}}destroy(){for(const e of Object.keys(this.models))for(const t of Object.keys(this.models[e])){const r=this.models[e][t].model;delete this.models[e][t],r&&r.destroy()}this.models={"":{}},this.modelUris={"":{}},this.modelByURL={},this.numModelsLoading={}}listModels(e){return this.models[e]||(this.models[e]={}),Object.keys(this.models[e])}upload(e,t){this.models[t]||(this.models[t]={});for(const r in this.models[t])this.models[t][r].model&&this.models[t][r].model.upload(e.context)}}const bn=e.a6.colorTheme,xn=new e.a9({data:new e.aa(bn.data)});function wn(t){if(!t.metadata||!t.metadata.content_area)return;const r=e.o.devicePixelRatio,{left:n,top:i,width:o,height:a}=t.metadata.content_area,s=n*r,l=i*r;return[s,l,s+o*r,l+a*r]}function Sn(t){if(t)return t.map((([t,r])=>[t*e.o.devicePixelRatio,r*e.o.devicePixelRatio]))}class kn{constructor(e,t,r){this.id=e,this.scope=t,this.sourceCache=r,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(e){this.missingRequests.has(e.name)||this.pendingRequests.has(e.name)||this.pendingRequests.add(e.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const t=new Map;if(!this.sourceCache.loaded())return t;const r=this.sourceCache.getVisibleCoordinates();if(0===r.length)return t;const n=this.sourceCache.getSource();if(!(n instanceof pt))return t;const i=r.map((e=>this.sourceCache.getTile(e))),o=n.getImages(i,Array.from(this.pendingRequests));for(const[r,n]of o)t.set(e.I.from({name:r,iconsetId:this.id}),n),this.pendingRequests.delete(r);for(const e of this.pendingRequests)this.missingRequests.add(e);return this.pendingRequests.clear(),t}}class Tn{constructor(){e.aY(["_onIndoorUpdate"],this)}onAdd(e){return this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._map.style&&this._map.style.indoorManager.on("selector-update",(e=>this._onIndoorUpdate(e))),this._container}_createButton(e,t){const r=l("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}_createSeparator(){return l("div","mapboxgl-ctrl-separator",this._container)}_setButtonTitle(e,t){this._map&&(e.setAttribute("aria-label",t),e.textContent=t)}onRemove(){this._container&&this._container.remove(),this._map&&this._map.style&&(this._map.style.indoorManager.off("selector-update",this._onIndoorUpdate),this._map=null)}getDefaultPosition(){return"right"}_onIndoorUpdate(e){if(!e||!e.floors)return this._model=e,void(this._container.style.display="none");const t=this._model;this._model=e,this._container.style.display="inline-block",this._container.style.borderRadius="8px",t&&Array.from(this._container.children).forEach((e=>e.remove())),e.floors.length>0&&(this.addBuildingsToggleButton(),this.addCurrentFloors(e.floors,e.activeFloorsVisible),this._updateBuildingsButtonState())}addBuildingsToggleButton(){const e=this._createButton("mapboxgl-ctrl-buildings-toggle",(()=>{const e=this._map;this._model&&e&&e._setIndoorActiveFloorsVisibility(!this._model.activeFloorsVisible)}));l("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.classList.add("mapboxgl-ctrl-level-button","mapboxgl-ctrl-buildings-toggle"),this._model&&!this._model.activeFloorsVisible&&e.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.append(e),this._createSeparator()}_updateBuildingsButtonState(){const e=this._container.querySelector(".mapboxgl-ctrl-buildings-toggle");e&&this._model&&(this._model.activeFloorsVisible?e.classList.remove("mapboxgl-ctrl-level-button-selected"):e.classList.add("mapboxgl-ctrl-level-button-selected"))}addCurrentFloors(e,t){for(let r=0;r<e.length;r++){const n=e[r],i=this._createButton("mapboxgl-ctrl-level-button",(()=>{this._map._selectIndoorFloor(n.id)}));this._setButtonTitle(i,n.zIndex.toString()),this._model&&n.id===this._model.selectedFloorId&&t&&i.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.append(i),r<e.length-1&&this._createSeparator()}}}class In extends e.E{constructor(t){super(),this._style=t,this._buildings={}
1,this._indoorControl=null,this._activeFloors=new Set,this._activeFloorsVisible=!0,this._indoorState={selectedFloorId:null,lastActiveFloors:null,activeFloorsVisible:!0},e.aY(["_updateUI"],this),this._style.on("style.load",(()=>{this._style.isIndoorEnabled()&&(this._style.map.on("load",this._updateUI),this._style.map.on("move",this._updateUI),this._style.map.on("idle",this._updateUI),this._updateUI())}))}destroy(){this._buildings={},this._activeFloors=new Set,this._indoorState=null,this._removeIndoorControl()}selectFloor(e){e===this._selectedFloorId&&this._activeFloorsVisible||(this._selectedFloorId=e,this._activeFloorsVisible=!0,this._updateActiveFloors())}setActiveFloorsVisibility(e){this._activeFloorsVisible=e,this._updateActiveFloors(),this._updateIndoorSelector()}setIndoorData(e){for(const[t,r]of Object.entries(e.buildings))if(this._buildings[t])for(const e of r.floorIds)this._buildings[t].floors[e]||(this._buildings[t].floors[e]=r.floors[e]);else this._buildings[t]=r;for(const t of e.activeFloors)this._activeFloors.add(t);this._updateIndoorSelector()}getIndoorTileOptions(e,t){const r=this._style.getIndoorSourceLayers(e,t);return r&&this._indoorState?{sourceLayers:r,indoorState:this._indoorState}:null}_addIndoorControl(){this._indoorControl||(this._indoorControl=new Tn,this._style.map.addControl(this._indoorControl,"right"))}_removeIndoorControl(){this._indoorControl&&(this._indoorControl.onRemove(),this._indoorControl=null)}_updateUI(){const t=this._style.map.transform,r=function(t,r,n,i){let o=null,a=Number.MAX_SAFE_INTEGER;if(i<16)return null;for(const[i,s]of Object.entries(t)){const t=s.center;if(t){const s=r.distanceTo(e.aT.convert(t));s<a&&n.contains(t)&&(a=s,o=i)}}return o}(this._buildings,t.center,t.getBounds(),t.zoom);r!==this._closestBuildingId&&(this._closestBuildingId=r,this._updateIndoorSelector())}_updateIndoorSelector(){const t=this._buildings,r=this._closestBuildingId,n=r&&t?t[r]:void 0;if(!n)return this._removeIndoorControl(),void this.fire(new e.z("selector-update",{selectedFloorId:null,activeFloorsVisible:this._activeFloorsVisible,floors:[]}));this._addIndoorControl();let i=null;for(const e of n.floorIds)if(this._activeFloors&&this._activeFloors.has(e)){i=e;break}const o=Array.from(n.floorIds).map((e=>({id:e,name:n.floors[e].name,zIndex:n.floors[e].zIndex}))).sort(((e,t)=>t.zIndex-e.zIndex));this.fire(new e.z("selector-update",{selectedFloorId:i,activeFloorsVisible:this._activeFloorsVisible,floors:o}))}_updateActiveFloors(){const e=this._activeFloors;this._activeFloors=new Set,this._indoorState={selectedFloorId:this._selectedFloorId,lastActiveFloors:e,activeFloorsVisible:this._activeFloorsVisible},this._style.updateIndoorDependentLayers()}}const Mn=(e,t)=>ze(e,t&&t.filter((e=>"source.canvas"!==e.identifier))),En=e.aH(Ut,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setLayerProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),Pn=e.aH(Ut,["setCenter","setZoom","setBearing","setPitch"]),An=new Set(["background","sky","slot","custom"]),Cn={version:8,layers:[],sources:{}},Rn={duration:300,delay:0};class Ln extends e.E{constructor(t,r={}){super(),this.map=t,this.scope=r.scope||"",this.globalId=null,this.fragments=[],this.importDepth=r.importDepth||0,this.importsCache=r.importsCache||new Map,this.resolvedImports=r.resolvedImports||new Set,this.transition=Object.assign({},Rn),this._buildingIndex=new jt(this),this.crossTileSymbolIndex=new Hr,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedIndoor={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._hasAppearances=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._importedAsBasemap=!1,this._changes=r.styleChanges||new W,this._hasDataDrivenEmissive=!1,this.indoorManager=new In(this),this.dispatcher=r.dispatcher?r.dispatcher:new e.D(e.dh(),this),r.imageManager?this.imageManager=r.imageManager:(this.imageManager=new Y(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=r.glyphManager?r.glyphManager:new e.di(t._requestManager,r.localFontFamily?e.dj.all:r.localIdeographFontFamily?e.dj.ideographs:e.dj.none,r.localFontFamily||r.localIdeographFontFamily),r.modelManager?this.modelManager=r.modelManager:(this.modelManager=new vn(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._availableModels={}
1,this._order=[],this._markersNeedUpdate=!1,this.options=r.configOptions?r.configOptions:new Map,this._configDependentLayers=r.configDependentLayers?r.configDependentLayers:new Set,this._indoorDependentLayers=r.indoorDependentLayers?r.indoorDependentLayers:new Set,this._config=r.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:r.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=r.initialConfig,this.dispatcher.broadcast("setReferrer",e.dk());const n=this;this._rtlTextPluginCallback=Ln.registerForPluginStateChange((t=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,r)=>{if(e.dl(t),r&&r.every((e=>e)))for(const e in n._sourceCaches){const t=n._sourceCaches[e],r=t.getSource().type;"vector"!==r&&"geojson"!==r||t.reload()}}))})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getOwnSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const r=this._layers[e];r.source===t.id&&this._validateLayer(r)}}
1))}load(e){return e?("string"==typeof e?this.loadURL(e):this.loadJSON(e),this):this}_getGlobalId(t){if(!t)return null;if("string"==typeof t){if(e.h(t))return t;const r=e.dm(t);if(!r.startsWith("http"))try{return new URL(r,location.href).toString()}catch(e){return r}return r}return`json://${e.dn(JSON.stringify(t))}`}_diffStyle(t,r,n){this.globalId=this._getGlobalId(t);const i=(e,t)=>{try{t(null,this.setState(e,n))}catch(e){t(e,!1)}};if("string"==typeof t){const n=this.map._requestManager.normalizeStyleURL(t),o=this.map._requestManager.transformRequest(n,e.R.Style);e.m(o,((t,n)=>{t?this.fire(new e.y(t)):n&&i(n,r)}))}else"object"==typeof t&&i(t,r)}loadURL(t,r={}){this.fire(new e.z("dataloading",{dataType:"style"}));const n="boolean"==typeof r.validate?r.validate:!e.h(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,r.accessToken),this.resolvedImports.add(t);const i=this.importsCache.get(t);if(i)return this._load(i,n);const o=this.map._requestManager.transformRequest(t,e.R.Style);this._request=e.m(o,((r,i)=>{if(this._request=null,r)this.fire(new e.y(r));else if(i)return this.importsCache.set(t,i),this._load(i,n)}))}loadJSON(t,r={}){this.fire(new e.z("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=e.o.frame((()=>{this._request=null,this._load(t,!1!==r.validate)}))}loadEmpty(){this.fire(new e.z("dataloading",{dataType:"style"})),this._load(Cn,!1)}_loadImports(t,r,n){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const i=[];for(const e of t){const t=this._createFragmentStyle(e),o=new Promise((e=>{t.once("style.import.load",e),t.once("error",e)})).then((()=>this.mergeAll()));if(i.push(o),this.resolvedImports.has(e.url)){t.loadEmpty();continue}const a=e.data||this.importsCache.get(e.url);a?(t.loadJSON(a,{validate:r}),this._isInternalStyle(a)&&(t.globalId=null)):e.url?t.loadURL(e.url,{validate:r}):t.loadEmpty();const s={style:t,id:e.id,config:e.config};if(n){const e=this.fragments.findIndex((({id:e})=>e===n));this.fragments=this.fragments.slice(0,e).concat(s).concat(this.fragments.slice(e))}else this.fragments.push(s)}return Promise.allSettled(i)}getImportGlobalIds(e=this,t=new Set){for(const r of e.fragments)r.style.globalId&&t.add(r.style.globalId),this.getImportGlobalIds(r.style,t);return[...t.values()]}_createFragmentStyle(t){const r=this.scope?e.B(t.id,this.scope):t.id;let n;const i=this._initialConfig&&this._initialConfig[r];(t.config||i)&&(n=Object.assign({},t.config,i));const o=new Ln(this.map,{scope:r,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:n,configOptions:this.options,colorThemeOverride:t["color-theme"],configDependentLayers:this._configDependentLayers,indoorDependentLayers:this._indoorDependentLayers});return o.setEventedParent(this.map,{style:o}),o}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this._updateLayers(this._indoorDependentLayers),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}_load(t,r){if(this._isInternalStyle(t)){const e=Object.assign({},Cn,{imports:[{id:"basemap",data:t,url:""}]},t.center?{center:t.center}:{},t.bearing?{bearing:t.bearing}:{},t.pitch?{pitch:t.pitch}:{},t.zoom?{zoom:t.zoom}:{},t.light?{light:t.light}:{});return this._importedAsBasemap=!0,void this._load(e,r)}if(this.updateConfig(this._config,t.schema),r&&Mn(this,we(t)))return;this._loaded=!0,this.stylesheet=e.dp(t);const n=()=>{for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});if(t.iconsets)for(const e in t.iconsets)this.addIconset(e,t.iconsets[e]);t.sprite?this._loadIconset(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),!this.glyphManager.url&&t.glyphs&&this.glyphManager.setURL(t.glyphs);
1const n=Gt(this.stylesheet.layers);if(this._order=n.map((e=>e.id)),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const e=this.stylesheet.lights[0];this.light=new Be(e.properties,e.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Be(this.stylesheet.light)),this._layers={};for(const t of n){const r=e.du(t,this.scope,this._styleColorTheme.lut,this.options);0!==r.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(r.fqid),r.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(r.fqid),this._hasAppearances=this._hasAppearances||0!==r.getAppearances().length,r.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=r;const n=this.getOwnLayerSourceCache(r),i=!!this.directionalLight&&this.directionalLight.shadowsEnabled();n&&r.canCastShadows()&&i&&(n.castsShadows=!0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);const i=this.stylesheet.terrain;i&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(i,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.z("data",{dataType:"style"}));const o=this.isRootStyle();t.imports?this._loadImports(t.imports,r).then((()=>{this._reloadImports(),this.fire(new e.z(o?"style.load":"style.import.load"))})).catch((t=>{this.fire(new e.y(new Error("Failed to load imports",t))),this.fire(new e.z(o?"style.load":"style.import.load"))})):(this._reloadImports(),this.fire(new e.z(o?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const i=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(i){const t=this._evaluateColorThemeData(i);this._loadColorTheme(t).then((()=>{n()})).catch((t=>{e.w(`Couldn't load color theme from the stylesheet: ${t}`),n()}))}else this._styleColorTheme.lut=null,n()}isRootStyle(){return 0===this.importDepth}hasAppearances(){return this._hasAppearances||this.fragments.some((e=>e.style.hasAppearances()))}mergeAll(){let e,t,r,n,i,o,a,s,l,c;const u={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((d=>{if(d.stylesheet){if(null!=d.light&&(e=d.light),d.stylesheet.lights)for(const e of d.stylesheet.lights)"ambient"===e.type&&null!=d.ambientLight&&(t=d.ambientLight),"directional"===e.type&&null!=d.directionalLight&&(r=d.directionalLight);n=this._prioritizeTerrain(n,d.terrain,d.stylesheet.terrain),d.stylesheet.fog&&null!=d.fog&&(i=d.fog),d.stylesheet.snow&&null!=d.snow&&(o=d.snow),d.stylesheet.rain&&null!=d.rain&&(a=d.rain),null!=d.stylesheet.camera&&(c=d.stylesheet.camera),null!=d.stylesheet.projection&&(s=d.stylesheet.projection),null!=d.stylesheet.transition&&(l=d.stylesheet.transition),u[d.scope]=d._styleColorTheme}})),this.light=e,this.ambientLight=t,this.directionalLight=r,this.fog=i,this.snow=o,this.rain=a,this._styleColorThemeForScope=u,null===n?delete this.terrain:this.terrain=n,this.camera=c||{"camera-projection":"perspective"},this.projection=s||{name:"mercator"},this.transition=Object.assign({},Rn,l),this.mergeSources(),this.mergeLayers(),this.mergeIndoor()}forEachFragmentStyle(e){const t=r=>{for(const e of r.fragments)t(e.style);e(r)};t(this)}_prioritizeTerrain(e,t,r){const n=e&&0===e.drapeRenderMode;return null===r?t&&0===t.drapeRenderMode?t:n?e:null:null!=t&&(!e||n||t&&1===t.drapeRenderMode)?t:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((t=>{e=this._prioritizeTerrain(e,t.terrain,t.stylesheet.terrain)})),null===e?delete this.terrain:this.terrain=e}mergeProjection(){let e;this.forEachFragmentStyle((t=>{null!=t.stylesheet.projection&&(e=t.stylesheet.projection)})),this.projection=e||{name:"mercator"}}mergeSources(){const t={},r={},n={};this.forEachFragmentStyle((i=>{for(const r in i._sourceCaches){const n=e.B(r,i.scope);t[n]=i._sourceCaches[r]}for(const t in i._otherSourceCaches){const n=e.B(t,i.scope);
1r[n]=i._otherSourceCaches[t]}for(const t in i._symbolSourceCaches){const r=e.B(t,i.scope);n[r]=i._symbolSourceCaches[t]}})),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=r,this._mergedSymbolSourceCaches=n}mergeIndoor(){this.forEachFragmentStyle((t=>{if(t.stylesheet&&t.stylesheet.indoor)for(const r of Object.values(t.stylesheet.indoor)){const n=r,i=e.B(n.sourceId,t.scope);this._mergedIndoor[i]=new Set(n.sourceLayers||[])}}))}mergeLayers(){const t={},r=[],n={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle((n=>{for(const i of n._order){const o=n._layers[i];if("slot"===o.type){const r=e.dq(i);if(t[r])continue;t[r]=[]}o.slot&&t[o.slot]?t[o.slot].push(o):r.push(o)}})),this._mergedOrder=[];let i=-1;const o=(r=[])=>{for(const a of r)if("slot"===a.type){const r=e.dq(a.id);t[r]&&o(t[r]),this._mergedSlots.push(r)}else{const t=e.B(a.id,a.scope);this._mergedOrder.push(t),n[t]=a,a.is3D(!!this.terrain)&&(this._has3DLayers=!0,i=this._mergedOrder.length-1),"circle"===a.type&&(this._hasCircleLayers=!0),"symbol"===a.type&&(this._hasSymbolLayers=!0),"clip"===a.type&&(this._clipLayerPresent=!0)}};if(o(r),this._has3DLayers){const e={};for(let t=0;t<this._mergedOrder.length;++t){const r=this._mergedOrder[t];e[r]=t===i?1:t<i?n[r].hasOcclusionOpacityProperties?2:0:4}this._mergedOrder.sort(((t,r)=>e[t]-e[r]))}this._mergedLayers=n,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged(),this._updateDataDrivenEmissiveStrength()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(e){return this.stylesheet.camera=Object.assign({},this.stylesheet.camera,e),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(t,r,n){const i=Object.assign({},r);for(const e of Object.keys(bn))void 0===i[e]&&(i[e]=bn[e].default);const o=new e.a8(xn,t,new Map(n));return o.setTransitionOrValue(i,n),o.untransitioned().possiblyEvaluate(new e.ac(0,{worldview:void 0}))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const r=this._styleColorTheme.lutLoadingCorrelationID;return new Promise(((n,i)=>{const o="data:image/png;base64,";if(!t||0===t.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void n();let a=t;a.startsWith(o)||(a=o+a);const s=e.I.from("mapbox-reserved-lut"),l=new Image;l.src=a,l.onerror=()=>{this._styleColorTheme.lutLoading=!1,i(new Error("Failed to load image data"))},l.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==r)return void n();this._styleColorTheme.lutLoading=!1;const{width:o,height:a,data:c}=e.o.getImageData(l);if(a>32)return void i(new Error("The height of the image must be less than or equal to 32 pixels."));if(o!==a*a)return void i(new Error("The width of the image must be equal to the height squared."));this.getImage(s)&&this.removeImage(s),this.addImage(s,{data:new e.q({width:o,height:a},c),pixelRatio:1,sdf:!1,usvg:!1,version:0});const u=this.imageManager.getImage(s,this.scope);u?(this._styleColorTheme.lut={image:u.data,data:t},n()):i(new Error("Missing LUT image."))}}))}getLut(e){const t=this._styleColorThemeForScope[e];return t?t.lut:null}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){this._spriteRequest=function(t,r,n){let i,o,a;const s=e.o.devicePixelRatio>1?"@2x":"";let l=e.m(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.R.SpriteJSON),((e,t)=>{l=null,a||(a=e,i=t,u())})),c=e.n(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.R.SpriteImage),((e,t)=>{c=null,a||(a=e,o=t,u())}));function u(){if(a)n(a);
1else if(i&&o){const t=e.o.getImageData(o),r={};for(const n in i){const{width:o,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:d,stretchY:h,content:f}=i[n],p=new e.q({width:o,height:a});e.q.copy(t,p,{x:s,y:l},{x:0,y:0},{width:o,height:a},null),r[n]={data:p,pixelRatio:void 0!==u?u:1,sdf:void 0!==c&&c,stretchX:d,stretchY:h,content:f,usvg:!1,version:0}}n(null,r)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,((t,r)=>{if(this._spriteRequest=null,t)this.fire(new e.y(t));else if(r){const t=new Map;for(const n in r)t.set(e.I.from(n),r[n]);this.addImages(t)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.z("data",{dataType:"style"}))}))}addIconset(t,r){if("sprite"===r.type)return void this._loadSprite(r.url);const n=this.getOwnSourceCache(r.source);if(!n)return void this.fire(new e.y(new Error(`Source "${r.source}" as specified by iconset "${t}" does not exist and cannot be used as an iconset source`)));const i=n.getSource();if("raster-array"!==i.type)return void this.fire(new e.y(new Error(`Source "${r.source}" as specified by iconset "${t}" is not a "raster-array" source and cannot be used as an iconset source`)));i.partial=!1;const o=new kn(t,this.scope,n);this.imageManager.addImageProvider(o,this.scope)}removeIconset(e){this.imageManager.removeImageProvider(e,this.scope)}_loadIconset(t){if(!e.h(t)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(t);const r="auto"===this.map._spriteFormat;var n,i;this._spriteRequest=(i=(n,i)=>{if(this._spriteRequest=null,n)r?this._loadSprite(t):this.fire(new e.y(n));else if(i){const t=new Map;for(const r in i)t.set(e.I.from(r),i[r]);this.addImages(t)}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.z("data",{dataType:"style"}))},e.bu((n=this.map._requestManager).transformRequest(n.normalizeIconsetURL(t),e.R.Iconset),((t,r)=>{if(t)return void i(t);const n={},o=e.dg(new e.bt(r));for(const t of o.icons){const r={version:1,pixelRatio:e.o.devicePixelRatio,content:wn(t),stretchX:t.metadata?Sn(t.metadata.stretch_x_areas):void 0,stretchY:t.metadata?Sn(t.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:t};n[t.name]=r}i(null,n)})))}_validateLayer(t){const r=this.getOwnSource(t.source);if(!r)return;const n=t.sourceLayer;n&&("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(n))&&this.fire(new e.y(new Error(`Source layer "${n}" does not exist on source "${r.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;if(!this.imageManager.isLoaded())return!1;if(this.imageManager.hasPatternsInFlight())return!1;if(!this.modelManager.isLoaded())return!1;if(this._styleColorTheme.lutLoading)return!1;for(const{style:e}of this.fragments)if(!e.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map(((e,t)=>{const r=this.fragments[t];return r&&r.style&&(e.data=r.style.serialize()),e}))}_serializeSources(){const e={};for(const t in this._sourceCaches){const r=this._sourceCaches[t].getSource();e[r.id]||(e[r.id]=r.serialize())}return e}_serializeLayers(e){const t=[];for(const r of e){const e=this._layers[r];e&&"custom"!==e.type&&t.push(e.serialize())}return t}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return!0;if(this.hasFogTransition())return!0;if(this.hasSnowTransition())return!0;if(this.hasRainTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_updateDataDrivenEmissiveStrength(){for(const e in this._mergedLayers){const t=this._mergedLayers[e];if(t._transitionablePaint&&t._transitionablePaint._values){const e=t._transitionablePaint._values["line-emissive-strength"];if(e&&e.value&&e.value.isDataDriven())return void(this._hasDataDrivenEmissive=!0)}}this._hasDataDrivenEmissive=!1}hasDataDrivenEmissiveStrength(){return this._hasDataDrivenEmissive}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(e){return e?this.order:this._mergedOrder}isLayerDraped(e){return!!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const r=this.getOwnLayer(t);if(r)return r;this.fire(new e.y(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const r=this.getOwnSource(t);if(r)return r;this.fire(new e.y(new Error(`The source '${t}' does not exist in the map's style.`)))}precompilePrograms(e,t){const r=this.map.painter;if(r)for(let n=e.minzoom||0;n<(e.maxzoom||25.5);n++){const n=e.getProgramIds();if(n)for(const i of n){const n=e.getDefaultProgramParams(i,t.zoom,this._styleColorTheme.lut);n&&(r.style=this,this.fog&&(r._fogVisible=!0,n.overrideFog=!0,r.getOrCreateProgram(i,n)),r._fogVisible=!1,n.overrideFog=!1,r.getOrCreateProgram(i,n),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(n.overrideRtt=!0,r.getOrCreateProgram(i,n)))}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const r=this.calculateLightsBrightness();t.brightness=r||0,r!==this._brightness&&(this._brightness=r,this.dispatcher.broadcast("setBrightness",r)),t.worldview!==this._worldview&&(this._worldview=t.worldview,this.dispatcher.broadcast("setWorldview",this._worldview));const n=this._changes.isDirty();let i=!1;if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:r,removedIds:n}=e[t];(r||n)&&(this._updateWorkerLayers(t,r,n),i=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this.snow&&this.snow.updateTransitions(t),this.rain&&this.rain.updateTransitions(t),this._changes.reset()}const o={};for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];o[e]=t.used,t.used=!1,t.tileCoverLift=0}for(const e of this._mergedOrder){const r=this._mergedLayers[e];if("none"!==r.visibility&&r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)){const e=this.getLayerSourceCache(r);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,r.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback((()=>
1{this.precompilePrograms(r,t)})):this.precompilePrograms(r,t))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&i&&this.mergeLayers();const a=this.imageManager.getPendingImageProviders();for(const e of a)e.sourceCache.used=!0;for(const t in o){const r=this._mergedSourceCaches[t];o[t]!==r.used&&r.getSource().fire(new e.z("data",{sourceDataType:"visibility",dataType:"source",sourceId:r.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.snow&&this.snow.recalculate(t),this.rain&&this.rain.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),n&&this.fire(new e.z("data",{dataType:"style"}))}updateImageProviders(){const e=this.imageManager.getPendingImageProviders();for(const t of e){const e=t.resolvePendingRequests(),r=this.getFragmentStyle(t.scope);r&&r.addImages(e)}}_updateTilesForChangedImages(){const e={};for(const t in this._mergedSourceCaches){const r=this._mergedSourceCaches[t].getSource().scope;e[r]=e[r]||this._changes.getUpdatedImages(r),0!==e[r].length&&this._mergedSourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e[r])}for(const t in e)this._changes.resetUpdatedImages(t)}_updateWorkerLayers(e,t,r){const n=this.getFragmentStyle(e);n&&this.dispatcher.broadcast("updateLayers",{layers:t?n._serializeLayers(t):[],scope:e,removedIds:r||[],options:n.options})}setState(t,r){if(this._checkLoaded(),Mn(this,we(t)))return!1;(t=e.dp(t)).layers=Gt(t.layers);const n=function(t,r){if(!t)return[{command:Ut.setStyle,args:[r]}];let n=[];try{if(!e.by(t.version,r.version))return[{command:Ut.setStyle,args:[r]}];if(e.by(t.center,r.center)||n.push({command:Ut.setCenter,args:[r.center]}),e.by(t.zoom,r.zoom)||n.push({command:Ut.setZoom,args:[r.zoom]}),e.by(t.bearing,r.bearing)||n.push({command:Ut.setBearing,args:[r.bearing]}),e.by(t.pitch,r.pitch)||n.push({command:Ut.setPitch,args:[r.pitch]}),e.by(t.sprite,r.sprite)||n.push({command:Ut.setSprite,args:[r.sprite]}),e.by(t.glyphs,r.glyphs)||n.push({command:Ut.setGlyphs,args:[r.glyphs]}),e.by(t.imports,r.imports)||function(t=[],r=[],n){r=r||[];const i=(t=t||[]).map(Yt),o=r.map(Yt),a=t.reduce(Xt,{}),s=r.reduce(Xt,{}),l=i.slice();let c,u,d,h;for(c=0,u=0;c<i.length;c++)d=i[c],s.hasOwnProperty(d)?u++:(n.push({command:Ut.removeImport,args:[d]}),l.splice(l.indexOf(d,u),1));for(c=0,u=0;c<o.length;c++)d=o[o.length-1-c],l[l.length-1-c]!==d&&(a.hasOwnProperty(d)?(n.push({command:Ut.removeImport,args:[d]}),l.splice(l.lastIndexOf(d,l.length-u),1)):u++,h=l[l.length-c],n.push({command:Ut.addImport,args:[s[d],h]}),l.splice(l.length-c,0,d));for(const t of r){const r=a[t.id];r&&(delete r.data,e.by(r,t)||n.push({command:Ut.updateImport,args:[t.id,t]}))}}(t.imports,r.imports,n),e.by(t.transition,r.transition)||n.push({command:Ut.setTransition,args:[r.transition]}),e.by(t.light,r.light)||n.push({command:Ut.setLight,args:[r.light]}),e.by(t.fog,r.fog)||n.push({command:Ut.setFog,args:[r.fog]}),e.by(t.snow,r.snow)||n.push({command:Ut.setSnow,args:[r.snow]}),e.by(t.rain,r.rain)||n.push({command:Ut.setRain,args:[r.rain]}),e.by(t.projection,r.projection)||n.push({command:Ut.setProjection,args:[r.projection]}),e.by(t.lights,r.lights)||n.push({command:Ut.setLights,args:[r.lights]}),e.by(t.camera,r.camera)||n.push({command:Ut.setCamera,args:[r.camera]}),e.by(t.iconsets,r.iconsets)||function(t,r,n){let i;for(i in r=r||{},t=t||{})t.hasOwnProperty(i)&&(r.hasOwnProperty(i)||n.push({command:Ut.removeIconset,args:[i]}));for(i in r){if(!r.hasOwnProperty(i))continue;const o=r[i];t.hasOwnProperty(i)?e.by(t[i],o)||(n.push({command:Ut.removeIconset,args:[i]}),n.push({command:Ut.addIconset,args:[i,o]})):n.push({command:Ut.addIconset,args:[i,o]})}}(t.iconsets,r.iconsets,n),!e.by(t["color-theme"],r["color-theme"]))return[{command:Ut.setStyle,args:[r]}];const i={},o=[];!function(t,r,n,i){let o;for(o in r=r||{},t=t||{})t.hasOwnProperty(o)&&(r.hasOwnProperty(o)||Ht(o,n,i));for(o in r){if(!r.hasOwnProperty(o))continue;const a=r[o];t.hasOwnProperty(o)?e.by(t[o],a)||("geojson"===t[o].type&&"geojson"===a.type&&Wt(t,r,o)?n.push({command:Ut.setGeoJSONSourceData,args:[o,a.data]}):qt(o,r,n,i)):$t(o,r,n)}}
1(t.sources,r.sources,o,i);const a=[];t.layers&&t.layers.forEach((e=>{e.source&&i[e.source]?n.push({command:Ut.removeLayer,args:[e.id]}):a.push(e)}));let s=t.terrain;s&&i[s.source]&&(n.push({command:Ut.setTerrain,args:[void 0]}),s=void 0),n=n.concat(o),e.by(s,r.terrain)||n.push({command:Ut.setTerrain,args:[r.terrain]}),function(t,r,n){r=r||[];const i=(t=t||[]).map(Yt),o=r.map(Yt),a=t.reduce(Xt,{}),s=r.reduce(Xt,{}),l=i.slice(),c=Object.create(null);let u,d,h,f,p,g,m;for(u=0,d=0;u<i.length;u++)h=i[u],s.hasOwnProperty(h)?d++:(n.push({command:Ut.removeLayer,args:[h]}),l.splice(l.indexOf(h,d),1));for(u=0,d=0;u<o.length;u++)h=o[o.length-1-u],l[l.length-1-u]!==h&&(a.hasOwnProperty(h)?(n.push({command:Ut.removeLayer,args:[h]}),l.splice(l.lastIndexOf(h,l.length-d),1)):d++,g=l[l.length-u],n.push({command:Ut.addLayer,args:[s[h],g]}),l.splice(l.length-u,0,h),c[h]=!0);for(u=0;u<o.length;u++)if(h=o[u],f=a[h],p=s[h],!c[h]&&!e.by(f,p))if(e.by(f.source,p.source)&&e.by(f["source-layer"],p["source-layer"])&&e.by(f.type,p.type)){for(m in Zt(f.layout,p.layout,n,h,null,Ut.setLayoutProperty),Zt(f.paint,p.paint,n,h,null,Ut.setPaintProperty),e.by(f.slot,p.slot)||n.push({command:Ut.setSlot,args:[h,p.slot]}),e.by(f.filter,p.filter)||n.push({command:Ut.setFilter,args:[h,p.filter]}),e.by(f.minzoom,p.minzoom)&&e.by(f.maxzoom,p.maxzoom)||n.push({command:Ut.setLayerZoomRange,args:[h,p.minzoom,p.maxzoom]}),f)f.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&"slot"!==m&&(0===m.indexOf("paint.")?Zt(f[m],p[m],n,h,m.slice(6),Ut.setPaintProperty):e.by(f[m],p[m])||n.push({command:Ut.setLayerProperty,args:[h,m,p[m]]}
1));for(m in p)p.hasOwnProperty(m)&&!f.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&"slot"!==m&&(0===m.indexOf("paint.")?Zt(f[m],p[m],n,h,m.slice(6),Ut.setPaintProperty):e.by(f[m],p[m])||n.push({command:Ut.setLayerProperty,args:[h,m,p[m]]}))}else n.push({command:Ut.removeLayer,args:[h]}),g=l[l.lastIndexOf(h)+1],n.push({command:Ut.addLayer,args:[p,g]})}(a,r.layers,n)}catch(e){console.warn("Unable to compute style diff:",e),n=[{command:Ut.setStyle,args:[r]}]}return n}(this.serialize(),t).filter((e=>!(e.command in Pn)));if(0===n.length)return!1;const i=n.filter((e=>!(e.command in En)));if(i.length>0)throw new Error(`Unimplemented: ${i.map((e=>e.command)).join(", ")}.`);const o=[];return n.forEach((e=>{o.push(this[e.command](...e.args))})),r&&Promise.all(o).then(r).catch(r),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(){this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages})}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(t){if(0===t.size)return this;for(const[r,n]of t.entries()){if(this.getImage(r))return this.fire(new e.y(new Error(`An image with the name "${r.name}" already exists.`)));this.imageManager.addImage(r,this.scope,n),this._changes.updateImage(r,this.scope)}return this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})),this}addImage(t,r){return this.getImage(t)?this.fire(new e.y(new Error(`An image with the name "${t.name}" already exists.`))):(this.imageManager.addImage(t,this.scope,r),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})),this)}updateImage(t,r,n=!1){this.imageManager.updateImage(t,this.scope,r),n&&(this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})))}getImage(e){return this.imageManager.getImage(e,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.z("data",{dataType:"style"})),this):this.fire(new e.y(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}getActualScope(){return this._importedAsBasemap?"basemap":this.scope}addModelURLs(t){return this.modelManager.addModelURLs(t,this.getActualScope()),this._updateWorkerModels(),this.fire(new e.z("data",{dataType:"style"})),this}addModel(t,r,n={}){return this._checkLoaded(),this._validate(Oe,`models.${t}`,r,null,n)||(this.modelManager.addModel(t,r,this.getActualScope()),this.fire(new e.z("data",{dataType:"style"}))),this}hasModel(e){return this.modelManager.hasModel(e,this.getActualScope())}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.getActualScope(),!1,!0),this.fire(new e.z("data",{dataType:"style"})),this):this.fire(new e.y(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.getActualScope())}addSource(t,r,n={}){if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(Se,`sources.${t}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=mt(t,r,this.dispatcher,this);i.scope=this.scope,i.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(i.id),source:i.serialize(),sourceId:i.id})));const o=t=>{const r=(t?"symbol:":"other:")+i.id,n=e.B(r,this.scope),o=this._sourceCaches[r]=new zt(n,i,t);(t?this._symbolSourceCaches:this._otherSourceCaches)[i.id]=o,o.onAdd(this.map)};o(!1),"vector"!==r.type&&"geojson"!==r.type||o(!0),i.onAdd&&i.onAdd(this.map),n.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const r=this.getOwnSource(t);if(!r)throw new Error("There is no source with this ID");for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.y(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new e.y(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const r=Object.entries(this.stylesheet.iconsets).find((([e,r])=>"source"===r.type&&r.source===t));if(r)return this.fire(new e.y(new Error(`Source "${t}" cannot be removed while iconset "${r[0]}" is using it.`)))}const n=this.getOwnSourceCaches(t);for(const t of n){const r=e.dq(t.id);delete this._sourceCaches[r],this._changes.discardSourceCacheUpdate(t.id),t.fire(new e.z("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),r.setEventedParent(null),r.onRemove&&r.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getOwnSource(e).setData(t),this._changes.setDirty()}getOwnSource(e){const t=this.getOwnSourceCache(e);return t&&t.getSource()}getOwnSources(){const e=[];for(const t in this._otherSourceCaches){const r=this.getOwnSourceCache(t);r&&e.push(r.getSource())}return e}areTilesLoaded(){const e=this._mergedSourceCaches;for(const t in e){const r=e[t]._tiles;for(const e in r){const t=r[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const r=this._getTransitionParameters();
vendor: 1,306 bytes, line 1
1for(const e of t){if(this._validate(Te,"lights",e))return;switch(e.type){case"ambient":if(this.ambientLight){const t=this.ambientLight;t.set(e),t.updateTransitions(r)}else this.ambientLight=new et(e,tt(),this.scope,this.options);break;case"directional":if(this.directionalLight){const t=this.directionalLight;t.set(e),t.updateTransitions(r)}else this.directionalLight=new et(e,nt(),this.scope,this.options)}}const n=Object.assign(r,{worldview:this.map.getWorldview()}),i=new e.ac(this.z||0,n);this.ambientLight&&this.ambientLight.recalculate(i),this.directionalLight&&this.directionalLight.recalculate(i),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,r=this.ambientLight;if(!t||!r)return;const n=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),i=t.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),o=t.properties.get("intensity"),a=t.properties.get("direction"),s=1-e.d4(a.x,a.y,a.z)[2]/90,l=n(i)*o*s,c=r.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),u=r.properties.get("intensity"),d=n(c)
1*u;return Number(((l+d)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(null==t||""===t&&this.isRootStyle())return this;if(e.dr(t)){const r=e.ds(t),n=this.fragments.find((({id:e})=>e===r));if(!n)return;const i=e.dq(t);return n.style.getFragmentStyle(i)}{const e=this.fragments.find((({id:e})=>e===t));return e?e.style:void 0}}setFeaturesetSelectors(t){if(!t)return;const r={},n=(e,t="")=>`${e}::${t}`;this._featuresetSelectors={};for(const i in t){const o=this._featuresetSelectors[i]=[];for(const a of t[i].selectors){if(a.featureNamespace){const t=this.getOwnLayer(a.layer);if(!t){e.w(`Layer is undefined for selector: ${a.layer}`);continue}const o=n(t.source,t.sourceLayer);if(o in r&&r[o]!==a.featureNamespace){e.w(`"featureNamespace ${a.featureNamespace} of featureset ${i}'s selector is not associated to the same source, skip this selector`);continue}r[o]=a.featureNamespace}let t;if(a.properties)for(const r in a.properties){const n=e.U(a.properties[r]);"success"===n.result&&(t=t||{},t[r]=n.value)}o.push({layerId:a.layer,namespace:a.featureNamespace,properties:t,uniqueFeatureID:a._uniqueFeatureID})}}}getFeaturesetDescriptors(e){const t=this.getFragmentStyle(e);if(!t||!t.stylesheet.featuresets)return[];const r=[];for(const e in t.stylesheet.featuresets)r.push({featuresetId:e,importId:t.scope?t.scope:void 0});return r}getFeaturesetLayers(t,r){const n=this.getFragmentStyle(r),i=n.stylesheet.featuresets;if(!i||!i[t])return this.fire(new e.y(new Error(`The featureset '${t}' does not exist in the map's style and cannot be queried.`))),[];const o=[];for(const e of i[t].selectors){const t=n.getOwnLayer(e.layer);t&&o.push(t)}return o}getConfigProperty(t,r){const n=this.getFragmentStyle(t);if(!n)return null;const i=e.B(r,n.scope),o=n.options.get(i),a=o?o.value||o.default:null;return a?a.serialize():null}isIndoorEnabled(){return Object.keys(this._mergedIndoor).length>0}getIndoorSourceLayers(t,r){const n=e.B(t,r);return this._mergedIndoor[n]}setIndoorData(e,t){this.indoorManager.setIndoorData(t)}updateIndoorDependentLayers(){this._updateLayers(this._indoorDependentLayers),this.map._styleDirty=!0,this.map.triggerRepaint()}setConfigProperty(t,r,n){const i=this.getFragmentStyle(t);if(!i)return;const o=i.stylesheet.schema;if(!o||!o[r])return;const a=e.U(n);if("success"!==a.result)return void Mn(this,a.value);const s=a.value.expression,l=e.B(r,i.scope),c=i.options.get(l);if(!c)return;let u;const{minValue:d,maxValue:h,stepValue:f,type:p,values:g}=o[r],m=e.U(o[r].default);"success"===m.result&&(u=m.value.expression),u?(this.options.set(l,Object.assign({},c,{value:s,default:u,minValue:d,maxValue:h,stepValue:f,type:p,values:g})),this.updateConfigDependencies(r)):this.fire(new e.y(new Error(`No schema defined for the config option "${r}" in the "${t}" fragment.`)))}getConfig(t){const r=this.getFragmentStyle(t);if(!r)return null;const n=r.stylesheet.schema;if(!n)return null;const i={};for(const t in n){const n=e.B(t,r.scope),o=r.options.get(n),a=o?o.value||o.default:null;i[t]=a?a.serialize():null}return i}setConfig(e,t){const r=this.getFragmentStyle(e);r&&(r.updateConfig(t,r.stylesheet.schema),this.updateConfigDependencies())}getSchema(e){const t=this.getFragmentStyle(e);return t?t.stylesheet.schema:null}setSchema(e,t){const r=this.getFragmentStyle(e);r&&(r.stylesheet.schema=t,r.updateConfig(r._config,t),this.updateConfigDependencies())}updateConfig(t,r){if(this._config=t,t||r)if(r)for(const n in r){let i,o;const a=e.U(r[n].default);if("success"===a.result&&(i=a.value.expression),t&&void 0!==t[n]){const r=e.U(t[n]);"success"===r.result&&(o=r.value.expression)}const{minValue:s,maxValue:l,stepValue:c,type:u,values:d}=r[n];if(i){const t=e.B(n,this.scope);this.options.set(t,{default:i,value:o,minValue:s,maxValue:l,stepValue:c,type:u,values:d})}
1else this.fire(new e.y(new Error(`No schema defined for config option "${n}".`)))}else this.fire(new e.y(new Error("Attempting to set config for a style without schema.")))}_updateLayers(e,t=()=>!0){for(const r of e){const e=this.getLayer(r);e&&t(e)&&(e.possiblyEvaluateVisibility(),this._updateLayer(e),this._changes.setDirty())}}updateConfigDependencies(e){this._updateLayers(this._configDependentLayers,(t=>!e||t.expressionDependencies.configDependencies.has(e))),this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle((e=>{const t=e._styleColorTheme.colorThemeOverride?e._styleColorTheme.colorThemeOverride:e._styleColorTheme.colorTheme;if(t){const r=e._evaluateColorThemeData(t);(!e._styleColorTheme.lut&&""!==r||e._styleColorTheme.lut&&r!==e._styleColorTheme.lut.data)&&e.setColorTheme(t)}})),this._changes.setDirty()}addLayer(t,r,n={}){this._checkLoaded();const i=t.id;if(this._layers[i])return void this.fire(new e.y(new Error(`Layer with i
1d "${i}" already exists on this map`)));let o;if("custom"===t.type){if(Mn(this,e.dt(t)))return;o=e.du(t,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=e.dp(t),t=Object.assign(t,{source:i})),this._validate(Ae,`layers.${i}`,t,{arrayIndex:-1},n))return;o=e.du(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}})}const a=e.B(o.source,o.scope);0!==o.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(a),o.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(a);let s=this._order.length;if(r){const t=this._order.indexOf(r);if(-1===t)return void this.fire(new e.y(new Error(`Layer with id "${r}" does not exist on this map.`)));o.slot&&o.slot!==this._layers[r].slot?e.w(`Layer with id "${r}" has a different slot. Layers can only be rearranged within the same slot.`):s=t}this._order.splice(s,0,i),this._handleLayerOrderChange(),this._layers[i]=o;const l=this.getOwnLayerSourceCache(o),c=!!this.directionalLight&&this.directionalLight.shadowsEnabled();l&&o.canCastShadows()&&c&&(l.castsShadows=!0);const u=this._changes.getRemovedLayer(o);if(u&&o.source&&l&&"custom"!==o.type){this._changes.discardLayerRemoval(o);const t=e.B(o.source,o.scope);u.type!==o.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),l.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),o.scope=this.scope,this.mergeLayers()}moveLayer(t,r){this._checkLoaded();const n=this._checkLayer(t);if(!n)return;if(t===r)return;const i=this._order.indexOf(t);this._order.splice(i,1);let o=this._order.length;if(r){const t=this._order.indexOf(r);
1if(-1===t)return void this.fire(new e.y(new Error(`Layer with id "${r}" does not exist on this map.`)));n.slot&&n.slot!==this._layers[r].slot?e.w(`Layer with id "${r}" has a different slot. Layers can only be rearranged within the same slot.`):o=t}this._order.splice(o,0,t),this._changes.setDirty(),this._handleLayerOrderChange(),this.mergeLayers()}removeLayer(e){this._checkLoaded();const t=this._checkLayer(e);if(!t)return;t.setEventedParent(null);const r=this._order.indexOf(e);this._order.splice(r,1),delete this._layers[e],this._changes.setDirty(),this._handleLayerOrderChange(),this._configDependentLayers.delete(t.fqid),this._indoorDependentLayers.delete(t.fqid),this._changes.removeLayer(t);const n=this.getOwnLayerSourceCache(t);if(n&&n.castsShadows){let e=!1;for(const r in this._layers)if(this._layers[r].source===t.source&&this._layers[r].canCastShadows()){e=!0;break}n.castsShadows=e}t.onRemove&&t.onRemove(this.map),this.mergeLayers()}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(e,t,r){this._checkLoaded();const n=this._checkLayer(e);n&&(n.minzoom===t&&n.maxzoom===r||(null!=t&&(n.minzoom=t),null!=r&&(n.maxzoom=r),this._updateLayer(n)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(e,t){this._checkLoaded();const r=this._checkLayer(e);r&&r.slot!==t&&(r.slot=t,this._updateLayer(r))}setFilter(t,r,n={}){this._checkLoaded();const i=this._checkLayer(t);if(i&&!e.by(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(Ce,`layers.${i.id}.filter`,r,{layerType:i.type},n)||(i.filter=e.dp(r),this._updateLayer(i)))}getFilter(t){const r=this._checkLayer(t);if(r)return e.dp(r.filter)}setLayoutProperty(t,r,n,i={}){this._checkLoaded();const o=this._checkLayer(t);if(o&&!e.by(o.getLayoutProperty(r),n)){if(null!=n&&(!i||!1!==i.validate)&&Mn(o,Le.call(we,{key:`layers.${t}.layout.${r}`,layerType:o.type,objectKey:r,value:n,styleSpec:e.a6,style:{glyphs:!0,sprite:!0}})))return;o.setLayoutProperty(r,n),0!==o.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(o.fqid),o.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(o.fqid),this._updateLayer(o)}}setLayerProperty(e,t,r,n={}){this._checkLoaded();const i=this._checkLayer(e);i&&("appearances"===t?(i.setAppearances(r),this._changes.setDirty()):i.isPaintProperty(t)?this.setPaintProperty(e,t,r,n):this.setLayoutProperty(e,t,r,n))}getLayoutProperty(e,t){const r=this._checkLayer(e);if(r)return r.getLayoutProperty(t)}setPaintProperty(t,r,n,i={}){this._checkLoaded();const o=this._checkLayer(t);if(!o)return;if(e.by(o.getPaintProperty(r),n))return;if(null!=n&&(!i||!1!==i.validate)&&Mn(o,Re.call(we,{key:`layers.${t}.paint.${r}`,layerType:o.type,objectKey:r,value:n,styleSpec:e.a6})))return;const a=o.setPaintProperty(r,n);0!==o.expressionDependencies.configDependencies.size&&this._configDependentLayers.add(o.fqid),o.expressionDependencies.isIndoorDependent&&this._indoorDependentLayers.add(o.fqid),a&&this._updateLayer(o),this._changes.updatePaintProperties(o)}getPaintProperty(e,t){const r=this._checkLayer(e);if(r)return r.getPaintProperty(t)}setFeatureState(t,r){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,i=this.getFragmentStyle(n),o=i.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of o)i.setFeatureState({id:t.id,source:e,sourceLayer:n},r)}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);this.setFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer},r)}return}const n=t.source,i=t.sourceLayer,o=this._checkSource(n);if(!o)return;const a=o.type;if("geojson"===a&&i)return void this.fire(new e.y(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===a&&!i)return void this.fire(new e.y(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.y(new Error("The feature id parameter must be provided.")));const s=this.getOwnSourceCaches(n);for(const e of s)e.setFeatureState(i,t.id,r)}removeFeatureState(t,r){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,i=this.getFragmentStyle(n),o=i.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of o)i.removeFeatureState({id:t.id,source:e,sourceLayer:n},r)}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);this.removeFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer},r)}return}const n=t.source,i=this._checkSource(n);if(!i)return;
1const o=i.type,a="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!a)return void this.fire(new e.y(new Error("The sourceLayer parameter must be provided for vector source types.")));if(r&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.y(new Error("A feature id is required to remove its specific state property.")));const s=this.getOwnSourceCaches(n);for(const e of s)e.removeFeatureState(a,t.id,r)}getFeatureState(t){if(this._checkLoaded(),"target"in t){let r;if("featuresetId"in t.target){const{featuresetId:n,importId:i}=t.target,o=this.getFragmentStyle(i),a=o.getFeaturesetLayers(n);for(const{source:n,sourceLayer:i}of a){const a=o.getFeatureState({id:t.id,source:n,sourceLayer:i});if(a&&!r)r=a;else if(!e.by(r,a))return void this.fire(new e.y(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in t.target){const{layerId:e}=t.target,n=this.getLayer(e);r=this.getFeatureState({id:t.id,source:n.source,sourceLayer:n.sourceLayer})}return r}const r=t.source,n=t.sourceLayer,i=this._checkSource(r);if(i){if("vector"!==i.type||n)return void 0===t.id&&this.fire(new e.y(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(r)[0].getFeatureState(n,t.id);this.fire(new e.y(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(e){return this.stylesheet.transition=Object.assign({},this.stylesheet.transition,e),this.transition=this.stylesheet.transition,this}getTransition(){return Object.assign({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),r=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return e.dv({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,featuresets:this.stylesheet.featuresets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:r,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,indoor:this.stylesheet.indoor,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateFilteredLayers(e){for(const t of Object.values(this._mergedLayers))e(t)&&this._updateLayer(t)}_updateLayer(t){this._changes.updateLayer(t);const r=this.getLayerSourceCache(t),n=e.B(t.source,t.scope),i=this._changes.getUpdatedSourceCaches();t.source&&!i[n]&&r&&"raster"!==r.getSource().type&&(this._changes.updateSourceCache(n,"reload"),r.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>this._mergedLayers[e].is3D(!!this.terrain),r=this.order,n={},i=[];for(let o=r.length-1;o>=0;o--){const a=r[o];if(t(a)){n[a]=o;for(const t of e){const e=t[a];if(e)for(const t of e)i.push(t)}}}i.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const o=[];for(let a=r.length-1;a>=0;a--){const s=r[a];if(t(s))for(let e=i.length-1;e>=0;e--){const t=i[e].feature;if(t.layer&&n[t.layer.id]<a)break;o.push(t),i.pop()}else for(const t of e){const e=t[s];if(e)for(const t of e)o.push(t.feature)}}return o}queryRasterValue(t,r,n){const i=this.getOwnSource(t);return i?"raster-array"!==i.type?(this.fire(new e.y(new Error('queryRasterValue support only "raster-array" sources.'))),Promise.resolve(null)):i.queryRasterArrayValue(r,n):(this.fire(new e.y(new Error(`Source with id "${t}" does not exist in the style.`))),Promise.resolve(null))}queryRenderedFeatures(t,r,n){let i;r&&!Array.isArray(r)&&r.filter&&(this._validate(Ce,"queryRenderedFeatures.filter",r.filter,null,r),i=e.b6(r.filter));const o={},a=e=>{if(An.has(e.type))return;const t=this.getOwnLayerSourceCache(e),r=o[t.id]=o[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};e.is3D(!!this.terrain)&&(r.has3DLayers=!0),r.layers[e.fqid]=r.layers[e.fqid]||{styleLayer:e,targets:[]}
1,r.layers[e.fqid].targets.push({filter:i})};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.y(new Error("parameters.layers must be an Array."))),[];for(const t of r.layers){const r=this._layers[t];if(!r)return this.fire(new e.y(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];a(r)}}else for(const e in this._layers)a(this._layers[e]);const s=this._queryRenderedFeatures(t,o,n),l=this._flattenAndSortRenderedFeatures(s),c=[];for(const t of l)e.dw(t.layer.id)===this.scope&&c.push(t);return c}queryRenderedFeatureset(t,r,n){let i;r&&!Array.isArray(r)&&r.filter&&(this._validate(Ce,"queryRenderedFeatures.filter",r.filter,null,r),i=e.b6(r.filter));const o="mock",a=[];if(r&&r.target)a.push(Object.assign({},r,{targetId:o,filter:i}));else{const e=this.getFeaturesetDescriptors();for(const t of e)a.push({targetId:o,filter:i,target:t});for(const{style:e}of this.fragments){const t=e.getFeaturesetDescriptors();for(const e of t)a.push({targetId:o,filter:i,target:e})}}const s=this.queryRenderedTargets(t,a,n),l=[],c=new Set;for(const t of s)for(const r of t.variants[o])_t(r,t,c)||l.push(new e.dx(t,r));return l}queryRenderedTargets(t,r,n){const i={},o=(e,t,r,n)=>{const o=i[t.id]=i[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};if(o.layers[e.fqid]=o.layers[e.fqid]||{styleLayer:e,targets:[]},e.is3D(!!this.terrain)&&(o.has3DLayers=!0),!n)return r.uniqueFeatureID=!1,void o.layers[e.fqid].targets.push(r);o.layers[e.fqid].targets.push(Object.assign({},r,{namespace:n.namespace,properties:n.properties,uniqueFeatureID:n.uniqueFeatureID}))};for(const t of r)if("featuresetId"in t.target){const{featuresetId:r,importId:n}=t.target,i=this.getFragmentStyle(n);if(!i||!i._featuresetSelectors)continue;const a=i._featuresetSelectors[r];if(!a){this.fire(new e.y(new Error(`The featureset '${r}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const e of a){const r=i.getOwnLayer(e.layerId);r&&!An.has(r.type)&&o(r,i.getOwnLayerSourceCache(r),t,e)}}else if("layerId"in t.target){const{layerId:e}=t.target,r=this.getLayer(e);if(!r||An.has(r.type))continue;o(r,this.getLayerSourceCache(r),t)}const a=this._queryRenderedFeatures(t,i,n);return this._flattenAndSortRenderedFeatures(a)}_queryRenderedFeatures(e,t,r){const n=[],i=!!this.map._showQueryGeometry,o=it.createFromScreenPoints(e,r);for(const e in t){const a=vt(o,t[e],this._availableImages,r,i,this.getActualScope());Object.keys(a).length&&n.push(a)}if(this.placement)for(const e in t){if(!t[e].sourceCache._onlySymbols)continue;const r=bt(o.screenGeometry,t[e],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData,this.map.getWorldview());Object.keys(r).length&&n.push(r)}return n}querySourceFeatures(e,t){const r=t&&t.filter;r&&this._validate(Ce,"querySourceFeatures.filter",r,null,t);let n=[];const i=this.getOwnSourceCaches(e);for(const e of i)n=n.concat(xt(e,t));return n}addSourceType(e,t,r){return Ln.getSourceType(e)?r(new Error(`A source type called "${e}" already exists.`)):(Ln.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},r):r(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,r,n={}){this._checkLoaded();const i=this.light.getLight();let o=!1;for(const r in t)if(!e.by(t[r],i[r])){o=!0;break}if(!o)return;const a=this._getTransitionParameters();this.light.setLight(t,r,n),this.light.updateTransitions(a)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.o.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t,r=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===r&&delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedU
1pdate=!0);this.checkCanvasFingerprintNoise();let n=t;const i=!("source"in t)||null==t.source;if(1===r){if(this.disableElevatedTerrain)return;if("source"in n&&"object"==typeof n.source){const t="terrain-dem-src";this.addSource(t,n.source),n=e.dp(n),n=Object.assign(n,{source:t})}const t=Object.assign({},n),r={};if(this.terrain&&i){t.source=this.terrain.get().source;const e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(r.style=e.serialize())}if(this._validate(Ie,"terrain",t,r))return}if(!this.terrain||this.terrain.scope!==this.scope&&!i||this.terrain&&r!==this.terrain.drapeRenderMode){if(!n)return;this._createTerrain(n,r),this.fire(new e.z("data",{dataType:"style"}))}else{const r=this.terrain,i=r.get();for(const t of Object.keys(e.a6.terrain))!n.hasOwnProperty(t)&&e.a6.terrain[t].default&&(n[t]=e.a6.terrain[t].default);for(const n in t)if(!e.by(t[n],i[n])){r.set(t,this.options),this.stylesheet.terrain=t;const n=this._getTransitionParameters({duration:0});r.updateTransitions(n),this.fire(new e.z("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new Ze(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=t.get();const r=this._getTransitionParameters({duration:0});t.updateTransitions(r)}_createSnow(e){const t=this.snow=new Je(e,this.map.transform,this.scope,this.options);this.stylesheet.snow=t.get();const r=this._getTransitionParameters({duration:0});t.updateTransitions(r)}_createRain(e){const t=this.rain=new Qe(e,this.map.transform,this.scope,this.options);this.stylesheet.rain=t.get();const r=this._getTransitionParameters({duration:0});t.updateTransitions(r)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const e of this.map._markers)e._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const r=this.fog;if(!e.by(r.get(),t)){r.set(t,this.options),this.stylesheet.fog=r.get();const e=this._getTransitionParameters({duration:0});r.updateTransitions(e)}}else this._createFog(t);this._markersNeedUpdate=!0}getSnow(){return this.snow?this.snow.get():null}setSnow(t){if(this._checkLoaded(),!t)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const r=this.snow;if(!e.by(r.get(),t)){r.set(t,this.options),this.stylesheet.snow=r.get();const e=this._getTransitionParameters({duration:0});r.updateTransitions(e)}}else this._createSnow(t);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(t){if(this._checkLoaded(),!t)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const r=this.rain;if(!e.by(r.get(),t)){r.set(t,this.options),this.stylesheet.rain=r.get();const e=this._getTransitionParameters({duration:0});r.updateTransitions(e)}}else this._createRain(t);this._markersNeedUpdate=!0}_reloadColorTheme(){const t=()=>{for(const e in this._layers)this._layers[e].lut=this._styleColorTheme.lut;for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles()},r=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!r)return this._styleColorTheme.lut=null,void t();const n=this._evaluateColorThemeData(r);this._loadColorTheme(n).then((()=>{this.fire(new e.z("colorthemeset")),t()})).catch((t=>{e.w(`Couldn't set color theme: ${t}`)}))}setColorTheme(t){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&e.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=t,this._reloadColorTheme()}setImportColorTheme(e,t){const r=this.getFragmentStyle(e);r&&(r._styleColorTheme.colorThemeOverride=t,r._reloadColorTheme())}_getTransitionParameters(t){return{now:e.o.now(),transition:Object.assign(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const e=[],t=[];for(const r of this._mergedOrder)this.isLayerDraped(this._mergedLayers[r])?e.push(r):t.push(r);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const r=this.terrain=new Ve(e,t,this.scope,this.options,this.map.getWorldview());1===t&&(this.stylesheet.terrain=e),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const n=this._getTransitionParameters({duration:0});r.updateTransitions(n)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}
1_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,r,n,i,o={}){if(o&&!1===o.validate)return!1;const a=Object.assign({},this.serialize());return Mn(this,t.call(we,Object.assign({key:r,style:a,value:n,styleSpec:e.a6},i)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.dy.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._mergedLayers)this._mergedLayers[e].setEventedParent(null);for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles(),this._mergedSourceCaches[e].setEventedParent(null);this.imageManager.removeScope(this.scope),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.indoorManager.destroy(),this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(e){const t=this.getSourceCaches(e);for(const e of t)e.clearTiles()}clearSources(){for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles()}clearLayers(){for(const e in this._mergedLayers){const t=this._mergedLayers[e];t._clear&&t._clear()}}reloadSource(e){const t=this.getSourceCaches(e);for(const e of t)e.resume(),e.reload()}reloadSources(){for(const e of this.getSources())e.reload&&e.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle((e=>{e.modelManager.reloadModels(e.scope)}))}updateSources(e){let t;this.directionalLight&&(t=mn(this.directionalLight));const r=new Set,n=new Set;for(const e in this._mergedLayers){const t=this._mergedLayers[e];
1"building"===t.type&&r.add(t.source),t.hasElevation()&&!n.has(t.source)&&n.add(t.source)}for(const i in this._mergedSourceCaches){const o=this._mergedSourceCaches[i],a=n.has(o._source.id);r.has(o._source.id)&&(o._source.reparseOverscaled=!1),o.update(e,void 0,void 0,t,a)}}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_handleLayerOrderChange(){this._requestFullLabelPlacement(),this.fire(new e.z("neworder"))}_requestFullLabelPlacement(){this.pauseablePlacement||(this.pauseablePlacement=new jr),this.pauseablePlacement.requestFullPlacement()}_setLabelPlacementStale(){this.placement&&this.placement.setStale()}_updatePlacement(t,r,n,i,o){this.pauseablePlacement||(this.pauseablePlacement=new jr);let a=!1,s=!1;const l={},c={};for(const r of this._mergedOrder){const n=this._mergedLayers[r];if("symbol"!==n.type)continue;const i=e.B(n.source,n.scope);let o=l[i];if(!o){const e=this.getLayerSourceCache(n);if(!e)continue;const t=e.getRenderableIds(!0).map((t=>e.getTileByID(t)));c[i]=t.slice(),o=l[i]=t.sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const s=this.crossTileSymbolIndex.addLayer(n,o,t.center.lng,t.projection);a=a||s}this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder);const u=Boolean(this.placement&&!t.equals(this.placement.transform)),d=Boolean(this.placement&&(0!==this.placement.lastReplacementSourceUpdateTime&&!o||this.placement.lastReplacementSourceUpdateTime!==o.updateTime)),h=u||d||a,f=(h||this.pauseablePlacement.isStale())&&0===n,p=this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.o.now(),t.zoom)&&0!==n;if((this.pauseablePlacement.isFullPlacementRequested()||!this.pauseablePlacement.placement||f||p)&&(this.pauseablePlacement=this.pauseablePlacement.startNewPlacement(t,this._mergedOrder,r,n,i,this.placement,this.fog&&t.projection.supportsFog?this.fog.state:null,this._buildingIndex)),this.pauseablePlacement.isDone()?h&&0!==n&&this.pauseablePlacement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,l,c,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.o.now()),s=!0),a&&this.pauseablePlacement.setStale()),s||a){this._buildingIndex.onNewFrame(t.zoom);for(let t=0;t<this._mergedOrder.length;t++){const r=this._mergedLayers[this._mergedOrder[t]];if("symbol"!==r.type)continue;if("none"===r.visibility)continue;const n=this.isLayerClipped(r);this.placement.updateLayerOpacities(r,l[e.B(r.source,r.scope)],t,n?o:null)}}return!this.pauseablePlacement.isDone()||this.placement.isStale()||this.placement.hasTransitions(e.o.now())}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}addImport(t,r){this._checkLoaded();const n=this.stylesheet.imports=this.stylesheet.imports||[];if(-1!==n.findIndex((({id:e})=>e===t.id)))return void this.fire(new e.y(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!r)return n.push(t),this._loadImports([t],!0);const i=n.findIndex((({id:e})=>e===r));return-1===i&&this.fire(new e.y(new Error(`Import with id "${r}" does not exist on this map.`))),this.stylesheet.imports=n.slice(0,i).concat(t).concat(n.slice(i)),this._loadImports([t],!0,r)}updateImport(t,r){this._checkLoaded();const n=this.stylesheet.imports||[],i=this.getImportIndex(t);return-1===i?this:"string"==typeof r?(this.setImportUrl(t,r),this):(r.url&&r.url!==n[i].url&&this.setImportUrl(t,r.url),e.by(r.config,n[i].config)||this.setImportConfig(t,r.config,r.data.schema),e.by(r.data,n[i].data)||this.setImportData(t,r.data),this)}moveImport(e,t){this._checkLoaded();let r=this.stylesheet.imports||[];const n=this.getImportIndex(e);if(-1===n)return this;const i=this.getImportIndex(t);if(-1===i)return this;const o=r[n],a=this.fragments[n];return r=r.filter((({id:t})=>t!==e)),this.fragments=this.fragments.filter((({id:t})=>t!==e)),this.stylesheet.imports=r.slice(0,i).concat(o).concat(r.slice(i)),this.fragments=this.fragments.slice(0,i).concat(a).concat(this.fragments.slice(i)),this.mergeLayers(),this}setImportUrl(e,t){this._checkLoaded();const r=this.stylesheet.imports||[],n=this.getImportIndex(e);if(-1===n)return this;r[n].url=t;
1const i=this.fragments[n];return i.style=this._createFragmentStyle(r[n]),i.style.on("style.import.load",(()=>this.mergeAll())),i.style.loadURL(t),this}setImportData(e,t){this._checkLoaded();const r=this.getImportIndex(e),n=this.stylesheet.imports||[];return-1===r?this:t?(this.fragments[r].style.setState(t),this._reloadImports(),this):(delete n[r].data,this.setImportUrl(e,n[r].url))}setImportConfig(e,t,r){this._checkLoaded();const n=this.getImportIndex(e),i=this.stylesheet.imports||[];if(-1===n)return this;t?i[n].config=t:delete i[n].config;const o=this.fragments[n];r&&o.style.stylesheet&&(o.style.stylesheet.schema=r);const a=o.style.stylesheet&&o.style.stylesheet.schema;return o.config=t,o.style.updateConfig(t,a),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();const t=this.stylesheet.imports||[],r=this.getImportIndex(e);-1!==r&&(t.splice(r,1),this.fragments[r].style._remove(),this.fragments.splice(r,1),this._reloadImports())}getImportIndex(t){const r=(this.stylesheet.imports||[]).findIndex((e=>e.id===t));return-1===r&&this.fire(new e.y(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),r}getLayer(e){return this._mergedLayers[e]}getSources(){const e=[];for(const t in this._mergedOtherSourceCaches){const r=this._mergedOtherSourceCaches[t];r&&e.push(r.getSource())}return e}getSource(e,t){const r=this.getSourceCache(e,t);return r&&r.getSource()}getLayerSource(e){const t=this.getLayerSourceCache(e);return t&&t.getSource()}getSourceCache(t,r){const n=e.B(t,r);return this._mergedOtherSourceCaches[n]}getLayerSourceCache(t){const r=e.B(t.source,t.scope);return"symbol"===t.type?this._mergedSymbolSourceCaches[r]:this._mergedOtherSourceCaches[r]}getSourceCaches(e){if(null==e)return Object.values(this._mergedSourceCaches);const t=[];return this._mergedOtherSourceCaches[e]&&t.push(this._mergedOtherSourceCaches[e]),this._mergedSymbolSourceCaches[e]&&t.push(this._mergedSymbolSourceCaches[e]),t}updateSourceCaches(){const e=this._changes.getUpdatedSourceCaches();for(const t in e){const r=e[t];"reload"===r?this.reloadSource(t):"clear"===r&&this.clearSource(t)}}updateLayers(e){const t=this._changes.getUpdatedPaintProperties();for(const r of t){const t=this.getLayer(r);t&&t.updateTransitions(e)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(e){this.stylesheet.glyphs=e,this.glyphManager.setURL(e)}getImages(t,r,n){this.imageManager.getImages(r.images,r.scope,n),this._updateTilesForChangedImages();const i=t=>{if(t){const n=r.images.map((t=>e.I.toString(t)));t.setDependencies(r.tileID.key,r.type,n)}},o=e.B(r.source,r.scope);i(this._mergedOtherSourceCaches[o]),i(this._mergedSymbolSourceCaches[o]),r.images.some((e=>e.iconsetId))&&this.fire(new e.z("data",{dataType:"style"}))}rasterizeImages(e,t,r){this.imageManager.rasterizeImages(t,r)}getGlyphs(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)}getResource(t,r,n){return e.dz(r,n)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}getOwnSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const r=this.getOwnSourceCaches(t);return 0===r.length?(this.fire(new e.y(new Error(`There is no source with ID '${t}'`))),!1):r.every((e=>e.loaded()))}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(e,t){if(!this._clipLayerPresent&&"fill-extrusion"!==e.type&&"building"!==e.type)return!1;const r="fill-extrusion"===e.type&&("building"===e.sourceLayer||"procedural_buildings"===e.sourceLayer),n="building"===e.type;if(e.is3D(!!this.terrain)){if(r||n||t&&"batched-model"===t.type)return!0;if("model"===e.type)return!0}else if("symbol"===e.type)return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach((e=>{e.style._remove()})),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Ln.getSourceType=function(e){return gt[e]},Ln.setSourceType=function(e,t){gt[e]=t},Ln.registerForPluginStateChange=e.dA;var On="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",Dn="\n#ifdef DUAL_SOURCE_BLENDING\nlayout(location=0,index=0) out vec4 glFragColor;layout(location=0,index=1) out vec4 glFragColorSrc1;\n#else\nlayout(location=0) out vec4 glFragColor;\n#endif\n#ifdef USE_MRT1\nlayout(location=1) out vec4 out_Target1;\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color,float height) {\n#ifdef INDICATOR_CUTOUT\nfloat verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;
1float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb*col.a,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}",zn="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const vec2 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 (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifndef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_id) attrib\n#define DECLARE_MATERIAL_TABLE_INFO\n#endif",Fn="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;
1void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",Nn="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_
1size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nint NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nhighp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif",Bn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",jn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}
1vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",Vn="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",Gn="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",Un="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif",$n="#ifdef RENDER_SHADOWS\nprecision highp sampler2DShadow;uniform sampler2DShadow u_shadowmap_0;uniform sampler2DShadow u_shadowmap_1;uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;float shadow_sample(sampler2DShadow shadowmap,highp vec3 pos,high
1p float bias) {\n#ifdef CLIP_ZERO_TO_ONE\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z-bias);\n#else\nhighp vec3 coord=vec3(pos.xy*0.5+0.5,pos.z*0.5+0.5-bias);\n#endif\nreturn texture(shadowmap,coord);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {light_view_pos0.xyz/=light_view_pos0.w;\n#ifdef SHADOWS_SINGLE_CASCADE\nvec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);\n#else\nlight_view_pos1.xyz/=light_view_pos1.w;vec4 abs_bounds=abs(vec4(light_view_pos0.xy,light_view_pos1.xy));if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}float occlusion1=shadow_sample(u_shadowmap_1,light_view_pos1.xyz,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0);\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const Hn=/#include\s+"([^"]+)"/g,qn=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g,Wn=/\b[A-Za-z_][A-Za-z0-9_]*\b/g,Zn=new Set(["ifdef","ifndef","elif","if","defined"]),Yn=new Set;ni(On,Yn),ni(zn,Yn),ni(Dn,Yn);const Xn={"_prelude_fog.vertex.glsl":Bn,"_prelude_terrain.vertex.glsl":Nn,"_prelude_shadow.vertex.glsl":Un,"_prelude_material_table.vertex.glsl":"#ifdef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define MATERIAL_TABLE_DEBUG 0\nuniform int u_material_offset;uniform int u_vertex_offset;layout(std140,binding=0)readonly buffer material_buffer{uvec4 material_data[];};struct MaterialInfo{uint dataOffset;\n#if MATERIAL_TABLE_DEBUG\nvec4 colorDebug;\n#endif\n};uint read_buf_no_offset(uint iDword) {return material_data[iDword/4u][iDword % 4u];}uint read_buf(uint iDword) {iDword+=uint(u_material_offset/4);return read_buf_no_offset(iDword);}
1float read_buf_float(uint iDword){return uintBitsToFloat(read_buf(iDword));}uint read_buf_uint8(uint iDword,uint iUint8){uint dwordOffset=iDword+(iUint8/4u);uint byteOffset=iUint8 & 3u;uint bitOffset=8u*byteOffset;uint mask=0xffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint read_buf_uint16(uint iDword,uint iUint16){uint dwordOffset=iDword+(iUint16 >> 1u);uint bitOffset=(iUint16 & 1u)*16u;uint mask=0xffffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint nrDwordsForVertexIdEntries(uint nrMaterialLookupEntries) {return nrMaterialLookupEntries;}uint nrDwordsForMaterialIdEntries(uint nrMaterialLookupEntries) {return (nrMaterialLookupEntries*2u+3u)/4u;}uint findRangeBinarySearch(uint vertexId,uint numRanges,uint dwordOffset) {uint left=0u;uint right=numRanges-1u;for (uint i=0u; i < 16u; i++) { \nif (left > right) {break;}uint mid=(left+right)/2u;uint start=read_buf(dwordOffset+mid);uint nextStart=(mid+1u < numRanges) ? read_buf(dwordOffset+mid+1u) : 0xffffffffu;if (vertexId >=start && vertexId < nextStart) {return mid;} else if (vertexId < start) {if (mid==0u) {break;}right=mid-1u;} else {left=mid+1u;}}return 0u; \n}uint readVertexId(uint dwordOffset,uint iMaterialLookupEntry) {return read_buf(dwordOffset+iMaterialLookupEntry);}uint findRange(uint vertexId,uint numRanges,uint dwordOffset) {uint iRange;if(numRanges <=64u){uint vertexBegin;for(iRange=0u; iRange < numRanges;++iRange) {vertexBegin=readVertexId(dwordOffset,iRange);if(vertexBegin > vertexId) {break;}}iRange=iRange==0u? 0u : iRange-1u;} else { \niRange=findRangeBinarySearch(vertexId,numRanges,dwordOffset);}return iRange;}MaterialInfo read_material_info(uint vertex_id) {MaterialInfo info;\n#if MATERIAL_TABLE_DEBUG\nconst vec4 red=vec4(1.0,0.0,0.0,1.0);const vec4 orange=vec4(1.0,0.5,0.0,1.0);const vec4 yellow=vec4(1.0,1.0,0.0,1.0);const vec4 green=vec4(0.0,1.0,0.0,1.0);const vec4 indigo=vec4(0.294,0.0,0.510,1.0);const vec4 blue=vec4(0.0,0.0,1.0,1.0);const vec4 purple=vec4(0.5,0.0,0.5,1.0);const vec4 pink=vec4(1.0,0.0,1.0,1.0);info.colorDebug=green;\n#endif\nuint offset=0u;\n#if MATERIAL_TABLE_DEBUG\nbool keepFinding=true;uint magic=read_buf(offset);if(magic !=0xCAFEBABEu) {info.colorDebug=red;keepFinding=false;return info;}\n#endif\noffset++;\n#if MATERIAL_TABLE_DEBUG\nuint nrMaterials=read_buf(offset);uint nrVertices=read_buf(offset+1u);if(keepFinding && vertex_id >=nrVertices) {info.colorDebug=red;keepFinding=false;}\n#endif\noffset+=2u;uint nrMaterialLookupEntries=read_buf(offset++);uint perMaterialEntrySizeDwords=read_buf(offset++);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding && perMaterialEntrySizeDwords !=1u) {info.colorDebug=red;keepFinding=false;}\n#endif\nuint iMaterialLookup=findRange(vertex_id,nrMaterialLookupEntries,offset);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding)\n{uint vertexBeginCheck=readVertexId(offset,iMaterialLookup);if(vertexBeginCheck > vertex_id) {info.colorDebug=red;keepFinding=false;}if(iMaterialLookup < nrMaterialLookupEntries-1u) {uint vertexEndCheck=readVertexId(offset,iMaterialLookup+1u);if(vertexEndCheck <=vertex_id) {info.colorDebug=red;keepFinding=false;}}}\n#endif\noffset+=nrDwordsForVertexIdEntries(nrMaterialLookupEntries);uint materialId=iMaterialLookup;\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding) {if(materialId >=nrMaterialLookupEntries) {info.colorDebug=red;}}\n#endif\ninfo.dataOffset=offset+materialId*perMaterialEntrySizeDwords;return info;}uint get_data_location(const MaterialInfo matInfo,uint attribOffsetBytes)\n{uint attribFieldOffsetDwords=attribOffsetBytes/4u;return matInfo.dataOffset+attribFieldOffsetDwords;}vec4 read_material_vec4(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec4(read_buf_float(loc),read_buf_float(loc+1u),read_buf_float(loc+2u),read_buf_float(loc+3u));}vec2 read_material_vec2(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec2(read_buf_float(loc),read_buf_float(loc+1u));}float read_material_float(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return read_buf_float(loc);}\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_offset) read_material_float(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_offset) read_material_vec4(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_offset) read_material_vec2(matInfo,attrib_offset)\n#define DECLARE_MATERIAL_TABLE_INFO MaterialInfo materialInfo=read_material_info(uint(gl_VertexID));\n#define DECLARE_MATERIAL_TABLE_INFO_DEBUG(dbgColor) MaterialInfo materialInfo=read_material_info(uint(gl_VertexID)); dbgColor=materialInfo.colorDebug;\n#endif","_prelude_fog.fragment.glsl":jn,"_prelude_shadow.fragment.glsl":$n,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0
1));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif","_prelude_raster_array.glsl":Vn,"_prelude_raster_particle.glsl":Gn},Kn={};ii("",Nn),ii(jn,Bn),ii($n,Un),ii(Vn,""),ii(Gn,"");const Jn=ii(Dn,zn),Qn=On,ei=["\n#if defined(GL_EXT_blend_func_extended) && defined(DUAL_SOURCE_BLENDING)\n#extension GL_EXT_blend_func_extended : require\n#endif","precision mediump float;",Qn,Jn.fragmentSource].join("\n"),ti=["precision highp float;",Qn,Jn.vertexSource].join("\n");var ri={background:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),building:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nconst float window_depth=0.5;const float ao_radius=0.2;in vec4 v_color;in highp vec3 v_normal;in highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nin lowp float v_faux_facade;in highp float v_faux_facade_ed;in highp vec2 v_faux_facade_window;in highp vec2 v_faux_facade_floor;in highp vec2 v_faux_facade_range;in highp float v_aspect;in highp vec3 v_tbn_0;in highp vec3 v_tbn_1;in highp vec3 v_tbn_2;in highp vec4 v_faux_color_emissive;uniform float u_faux_facade_ao_intensity;\n#endif\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nin highp float v_flood_radius;in float v_has_flood_light;\n#endif\nuniform lowp float u_opacity;uniform vec3 u_camera_pos;uniform highp float u_tile_to_meter;uniform float u_facade_emissive_chance;uniform vec3 u_flood_light_color;uniform float u_flood_light_intensity;vec3 linearTosRGB(in vec3 color) {return pow(color,vec3(1./2.2));}\n#ifdef BUILDING_FAUX_FACADE\nfloat hash12(in vec2 p) {vec3 p3 =fract(vec3(p.xyx)*0.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}float min3(in vec3 v) {return min(min(v.x,v.y),v.z);}vec2 get_uv_mask_id(in vec2 q,out float mask,out vec2 id) {vec2 p=q;mask=step(v_faux_facade_range.x,p.y)*step(p.y,v_faux_facade_range.y);p.y=p.y-v_faux_facade_range.x;vec2 uv=modf(p/v_faux_facade_floor,id);vec4 d=(v_faux_facade_floor.xyxy+vec4(-v_faux_facade_window,v_faux_facade_window))*0.5;vec4 edge=d/v_faux_facade_floor.xyxy;vec2 m=step(edge.xy,uv)*step(uv,edge.zw);mask*=m.x*m.y;uv-=vec2(0.5);uv*=vec2(0.5)/(vec2(0.5)-edge.xy);uv+=vec2(0.5);return uv;}float ray_unit_box(in vec3 ray_o,in vec3 ray_d,in vec3 bmin,in vec3 bmax) {vec3 planes=mix(bmin,bmax,step(0.0,ray_d));vec3 t=(planes-ray_o)/ray_d;return min3(t);}float get_emissive(in vec2 id) {if (u_facade_emissive_chance > 0.0) {return (step(hash12(id),u_facade_emissive_chance)+0.05)*v_faux_color_emissive.a;}return 0.0;}vec3 get_shade_info(in vec3 v,in vec3 v_normalized,in vec3 color,in vec2 id,in mat3 tbn,inout vec3 out_normal,inout float out_emissive) {vec3 out_color=color;vec3 abs_v=abs(v_normalized);bool x_major=abs_v.x >=abs_v.y && abs_v.x >=abs_v.z;bool y_major=abs_v.y >=abs_v.x && abs_v.y >=abs_v.z;bool z_major=abs_v.z >=abs_v.x && abs_v.z >=abs_v.y;\n#if 0\nif (x_major) {out_color=v.x > 0.0 ? vec3(1.0,0.0,0.0) : vec3(0.0,1.0,1.0);} else if (y_major) {out_color=v.y > 0.0 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,1.0);} else if (z_major) {out_color=v.z > 0.0 ? vec3(0.0,0.0,1.0) : vec3(1.0,1.0,0.0);}out_emissive=1.0;\n#else\nif (x_major) {out_normal=sign(v.x)*tbn[0];} else if (y_major) {out_normal=vec3(0.0,0.0,-sign(v.y));} else if (z_major) {out_color=v_faux_color_emissive.rgb;out_emissive=v.z <=0.0 ? get_emissive(id) : out_emissive;}float ao=1.0;if (u_faux_facade_ao_intensity > 0.0) {vec4 ao_range=v_faux_facade_window.xxyy*0.5-vec4(0,ao_radius,0,ao_radius);vec2 ao_range_z=vec2(window_depth*0.5)-vec2(0.0,ao_radius);if (x_major || y_major) {ao*=smoothstep(-ao_range_z.x,-ao_range_z.y,v.z);} else if (z_major) {ao*=smoothstep(-ao_range.x,-ao_range.y,v.x)*(1.0-smoothstep(ao_range.y,ao_range.x,v.x));ao*=smoothstep(-ao_range.z,-ao_range.w,v.y)*(1.0-smoothstep(ao_range.w,ao_range.z,v.y));}ao=mix(1.0,min(1.0,ao+0.25),u_faux_facade_ao_intensity);}out_color*=ao;\n#endif\nreturn out_color;}\n#endif\nvec3 apply_lighting_linear(in vec3 color,in vec3 normal,in float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec3 normal=normalize(v_normal);vec3 base_color=v_color.rgb;float emissive=v_color.a;\n#ifdef BUILDING_FAUX_FACADE\nif (v_faux_facade > 0.0) {mat3 tbn=mat3(v_tbn_0,v_tbn_1,v_tbn_2);vec3 v=vec3(v_pos.xy,v_pos.z/u_tile_to_meter)-u_camera_pos;vec3 view_tangent=transpose(tbn)*v;vec2 q=vec2(v_faux_facade_ed,v_pos.z);float mask=0.0;vec2 id=vec2(0.0);vec2 uv=get_uv_mask_id(q,mask,id);uv*=v_faux_facade_window;vec3 bmin=vec3(0.0,0.0,-window_depth);vec3 bmax=bmin+vec3(v_faux_facade_window,window_depth);vec3 ray_o=vec3(uv,0.0);vec3 ray_d=normalize(view_tangent);float t_min=ray_unit_box(ray_o,ray_d,bmin,bmax);vec3 hit=ray_o+t_min*ray_d;vec3 r=vec3(v_faux_facade_window,-window_depth);hit-=r*0.5;vec3 normalized=hit/r;vec3 out_normal=normal;float out_emissive=emissive;vec3 room_color=get_shade_info(hit,normalized,base_color,id,tbn,out_normal,out_emissive);base_color=mix(base_color,room_color,mask);normal=mix(normal,out_normal,mask);emissive=mix(emissive,out_emissive,mask);}\n#endif\nvec4 color=vec4(base_color,1.0);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0;\n#ifdef RENDER_SHADOWS\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\n#else\nshadowed_lighting_factor=dot(xy_flipped_normal,u_lighting_directional_dir);\n#endif\ncolor.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=linearTosRGB(color.rgb);\n#ifdef FLOOD_LIGHT\nfloat flood_radiance=(1.0-min(v_pos.z/v_flood_radiu
1s,1.0))*u_flood_light_intensity*v_has_flood_light;color.rgb=mix(color.rgb,u_flood_light_color,flood_radiance);\n#endif\ncolor.rgb=mix(color.rgb,linearTosRGB(base_color.rgb),emissive);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_pos.z));\n#endif\ncolor*=u_opacity;\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_pos.z);\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord);\n#endif\nglFragColor=color; \n#ifdef DEBUG_SHOW_NORMALS\ncolor.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color;\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;in vec3 a_normal_3;in vec3 a_centroid_3;in float a_flood_light_wall_radius_1i16;in vec4 a_faux_facade_data;in vec2 a_faux_facade_vertical_range;uniform mat4 u_matrix;uniform mat4 u_normal_matrix;uniform highp float u_tile_to_meter;out vec4 v_color;out vec3 v_normal;out highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nout lowp float v_faux_facade;out highp float v_faux_facade_ed;out highp vec2 v_faux_facade_window;out highp vec2 v_faux_facade_floor;out highp vec2 v_faux_facade_range;out highp float v_aspect;out highp vec3 v_tbn_0;out highp vec3 v_tbn_1;out highp vec3 v_tbn_2;out highp vec4 v_faux_color_emissive;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nout highp float v_flood_radius;out float v_has_flood_light;\n#endif\nconst float MAX_UINT_16=65535.0;const float MAX_INT_16=32767.0;const float MAX_UINT_8=255.0;const float TWO_POW_8=256.0;const float FLOOD_LIGHT_MAX_RADIUS_METER=2048.0;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#ifdef BUILDING_FAUX_FACADE\nmat3 get_tbn(in vec3 normal) {const vec3 bitangent=vec3(0.0,0.0,1.0);vec3 tangent=normalize(vec3(normal.y,-normal.x,0.0));return mat3(tangent,bitangent,normal);}\n#endif\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 part_color_emissive\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 faux_facade_color_emissive\nvoid main() {\n#pragma mapbox: initialize-attribute-custom highp vec2 part_color_emissive\n#pragma mapbox: initialize-attribute-custom highp vec2 faux_facade_color_emissive\n#ifdef FLOOD_LIGHT\nv_flood_radius=(a_flood_light_wall_radius_1i16/MAX_INT_16*FLOOD_LIGHT_MAX_RADIUS_METER);v_has_flood_light=step(0.0,v_flood_radius);\n#endif\nvec4 color_emissive=decode_color(part_color_emissive);v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);vec3 a_normal_3f=a_normal_3/MAX_INT_16;v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));float hidden=0.0;float depth_offset=0.0;\n#ifdef BUILDING_FAUX_FACADE\nv_faux_facade=a_faux_facade_data.x;if (v_faux_facade > 0.0) {v_faux_facade_ed=a_faux_facade_data.x *u_tile_to_meter;float window_x_perc=floor(a_faux_facade_data.y/TWO_POW_8);float window_y_perc=a_faux_facade_data.y-TWO_POW_8*window_x_perc;vec2 window_perc=vec2(window_x_perc,window_y_perc)/MAX_UINT_8;v_faux_facade_floor=(a_faux_facade_data.zw/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_faux_facade_window=window_perc*v_faux_facade_floor;v_faux_facade_range=(a_faux_facade_vertical_range/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_aspect=v_faux_facade_window.x/v_faux_facade_window.y;mat3 tbn=get_tbn(normalize(v_normal));v_tbn_0=tbn[0];v_tbn_1=tbn[1];v_tbn_2=tbn[2];v_faux_color_emissive=decode_color(faux_facade_color_emissive);v_faux_color_emissive.rgb=sRGBToLinear(v_faux_color_emissive.rgb);float height=a_centroid_3.z;depth_offset=min(1000.0,height)*0.0000002;}\n#endif\nv_pos=a_pos_3f;\n#ifdef RENDER_CUTOFF\nvec4 ground=u_matrix*vec4(a_centroid_3,1.0);v_cutoff_opacity=cutoff_opacity(u_cutoff_params,ground.z);hidden=float(v_cutoff_opacity==0.0);v_pos.z*=v_cutoff_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shadow_pos=v_pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(v_pos);\n#endif\ngl_Position=mix(u_matrix*vec4(v_pos,1),AWAY,hidden);gl_Position.z-=depth_offset*gl_Position.w;}'),buildingBloom:ii("in vec4 v_color_emissive;\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\nfloat saturate(float val) {return clamp(val,0.0,1.0);}void main() {float emission=v_color_emissive.a;float opacity=1.0;\n#ifdef HAS_ATTRIBUTE_a_bloom_attenuation\nfloat distance=length(vec2(1.3*max(0.0,abs(bloom_attenuation.x)-bloom_attenuation.z),bloom_attenuation.y));distance+= mix(0.5,0.0,clamp(emission-1.0,0.0,1.0));
1opacity*=saturate(1.0-distance*distance);\n#endif\n#ifdef RENDER_CUTOFF\nopacity*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(v_color_emissive.rgb,1.0)*opacity;}","in vec3 a_pos_3f;\n#pragma mapbox: define-attribute-vertex-shader-only highp vec2 part_color_emissive\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nout vec4 v_color_emissive;uniform mat4 u_matrix;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute-custom highp vec2 part_color_emissive\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\n#ifdef HAS_ATTRIBUTE_a_part_color_emissive\nvec4 color_emissive=decode_color(part_color_emissive);float part_emissive=color_emissive.a*5.0;v_color_emissive=vec4(sRGBToLinear(color_emissive.rgb),part_emissive);\n#else\nv_color_emissive=vec4(1.0);\n#endif\ngl_Position=u_matrix*vec4(a_pos_3f,1.0);\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}"),buildingDepth:ii("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);v_depth=gl_Position.z/gl_Position.w;}"),circle:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*v
1iew_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:ii("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ii('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:ii("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:ii("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform float u_zoom_transition;\n#endif\nout float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec3 proj_pos=a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation);\n#ifdef PROJECTION_GLOBE_VIEW\n#ifndef PROJECTED_POS_ON_VIEWPORT\nvec3 globe_pos=proj_pos;vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,a_anchor_pos,u_tile_id,u_merc_center);proj_pos=mix_globe_mercator(globe_pos,mercator_pos,u_zoom_transition);\n#endif\n#endif\nvec4 projectedPoint=u_matrix*vec4(proj_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:ii("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:ii("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1
1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),elevatedStructuresDepth:ii("void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=vec4(0.);\n#endif\n}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructuresDepthReconstruct:ii("#ifdef DEPTH_RECONSTRUCTION\nin float v_height;\n#endif\nvoid main() {\n#ifdef DEPTH_RECONSTRUCTION\nif (v_height >=0.0)\ndiscard;\n#else\n#ifdef FEATURE_CUTOUT\napply_feature_cutout(vec4(0.0,0.0,0.0,1.0),gl_FragCoord);\n#endif\n#endif\nglFragColor=vec4(1.0,0.0,0.0,1.0);}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth;\n#ifdef DEPTH_RECONSTRUCTION\nout float v_height;\n#endif\nvoid main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale);\n#ifdef DEPTH_RECONSTRUCTION\nif (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height;\n#endif\ngl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}"),elevatedStructures:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin vec3 v_normal;in float v_height;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}
1vec3 compute_view_dependent_emissive_color(float ndotl,float emissive_strength,vec3 color)\n{color=sRGBToLinear(color);color=color*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);color=linearTosRGB(color.rgb);return color;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nvec3 color=structure_color.xyz;\n#ifdef LIGHTING_3D_MODE\nvec3 normal=normalize(v_normal);vec3 transformed_normal=vec3(-normal.xy,normal.z);float ndotl=calculate_NdotL(transformed_normal);float emissive_strength=u_emissive_strength;emissive_strength=0.0;vec3 emissive_color=compute_view_dependent_emissive_color(ndotl,emissive_strength,color.xyz);\n#ifdef RENDER_SHADOWS\nfloat shadowed_lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color.rgb=apply_lighting(color.rgb,transformed_normal,shadowed_lighting_factor);\n#else\ncolor=apply_lighting(color,transformed_normal);\n#endif\ncolor=mix(color,emissive_color,emissive_strength);if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);}\n#endif\n#ifdef FOG\ncolor=fog_apply(color,v_fog_pos);\n#endif\nvec4 out_color=vec4(color,1.0);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_height);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;in float a_height;in vec3 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nv_normal=a_pos_normal_3/16384.0;v_height=a_height;vec3 pos=vec3(a_pos,a_height);gl_Position=u_matrix*vec4(pos,1);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(-v_normal.xy,v_normal.z));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fill:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=opacity;\n#ifdef INDICATOR_CUTOUT\nif (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=z_offset;\n#endif\n}'),fillOutline:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef FLIP_Y\nv_pos=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nuniform float u_emissive_strength;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nin highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FLIP_Y\nv_pos_world=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;
1\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,h);\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;
1float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);\n#ifdef CLIP_ZERO_TO_ONE\ncutoff=cutoff_opacity(u_cutoff_params,ground.z*2.0-ground.w);\n#else\ncutoff=cutoff_opacity(u_cutoff_params,ground.z);\n#endif\nif (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
1ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:ii("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nout highp float v_depth;void main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
1),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,height);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);
1\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:ii('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:ii("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(1.0-texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)).a,0.0,0.0,0.0);\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;
1\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:ii("precision highp float;uniform highp sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform highp vec2 u_trim_gradient_mix_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nin float stub_side;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nfloat linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\nfloat dist=length(v_normal)*v_width2.s;\n#ifdef VARIABLE_LINE_WIDTH\nblur=mix(blur,0.0,stub_side);\n#endif\nfloat blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef VARIABLE_LINE_WIDTH\nalpha=mix(alpha,1.0,stub_side);\n#endif\nalpha=side_z_offset > 0.0 ? 1.0-alpha : alpha;\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;
1float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);highp float gradient_trim_color_mix_factor=0.0;\n#ifdef RENDER_LINE_GRADIENT\ngradient_trim_color_mix_factor=smoothstep(u_trim_gradient_mix_range.x,u_trim_gradient_mix_range.y,line_progress);\n#endif\nhighp vec4 trim_color=mix(u_trim_color,out_color,gradient_trim_color_mix_factor);out_color=mix(u_trim_gradient_mix_range.x < 1.0 ? color : out_color,trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nfloat edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}}\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH)\nin vec3 a_z_offset_width;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform highp float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nout float stub_side;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;offset=-1.0*offset*u_width_scale;gapwidth=gapwidth/2.0;float halfwidth;\n#ifdef VARIABLE_LINE_WIDTH\nbool left=normal.y==1.0;float left_width=a_z_offset_width.y;float right_width=a_z_offset_width.z;halfwidth=(u_width_scale*(left ? left_width : right_width))/2.0;a_z_offset+=left ? side_z_offset : 0.0;v_normal=side_z_offset > 0.0 && left ? vec2(0.0) : v_normal;offset=border_width >
1 0.0 ? (left_width+right_width)*u_width_scale*0.5 : offset;halfwidth=border_width > 0.0 ? border_width*u_width_scale*0.5 : halfwidth;bool zero_right_width=border_width==0.0 && right_width==0.0;stub_side=zero_right_width ?-normal.y : 0.0;v_normal=!left && zero_right_width ? vec2(0.0) : v_normal;ANTIALIASING=!left && zero_right_width ? 0.0 : ANTIALIASING;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),linePattern:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;
1uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nvec2 pattern_b_tl=pattern_b.xy;vec2 pattern_b_br=pattern_b.zw;highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_z_offset);\n#endif\nglFragColor=color;\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec3 a_z_offset_width;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump vec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump vec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize lowp float emissive_strength\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);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=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),raster:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos   ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);    \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];
1if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),1.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:ii("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:ii("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:ii('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;
1vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return  clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:ii('#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nin highp float v_z_offset;\n#endif\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\n#ifdef RENDER_SDF\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;\n#else\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n#endif\nout_color*=opacity*fade_opacity;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef TERRAIN\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#else\nout_color.rgb*=mix(v_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#define USING_APPEARANCE 1.0\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef ELEVATED_ROADS\nin vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nout highp float v_z_offset;\n#endif\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\n#pragma mapbox: define lowp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\n#pragma mapbox: initialize lowp float z_offset\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float a_size_max= floor(a_size[1]*0.5);float a_apperance=a_size[1]-2.0*a_size_max;vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (a_apperance==USING_APPEARANCE) {size=a_size_max/128.0;} else if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size_max,u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);    \n#endif\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0;\n#else\nz+=u_pitch_with_map ? z_offset : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\n#ifdef Z_TEST_OCCLUSION\nout_fade_opacity*=occlusion_opacity;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\n#ifdef ELEVATED_ROADS\nvec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\npos=vec3(projected_pos.xy/projected_pos.w+offset,z);\n#endif\n#endif\ngl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden);float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=e;\n#else\n#ifdef RENDER_SHADOWS\nv_z_offset=e;\n#endif\n#endif\n}'),terrainRaster:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nin vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;vec3 unlit_base=image_color.rgb*(1.0-emissive_strength);vec3 emissive_base=image_color.rgb*emissive_strength;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;color.rgb=mix(color.rgb,image_color.rgb,emissive_strength);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
1\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:ii("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:ii('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
1nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Fn),skyboxGradient:ii('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Fn),skyboxCapture:ii
vendor: 3,689 bytes, line 1
1("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;
1v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nuniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nhighp vec2 uv=gl_FragCoord.xy/u_viewport;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : raster.a;raster=apply_lighting_with_emission_ground(raster,emissive_strength);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : color.a;color=apply_lighting_with_emission_ground(color,emissive_strength);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:ii('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_atmosphere_fog_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_atmosphere_fog_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_atmosphere_fog_color.rgb;vec3 color_stop_1=u_high_color.rgb;
1vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:ii('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;\n#ifdef DITHERED_DISCARD\nuniform float u_dithered_discard_threshold;\n#endif\nuniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return  depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef FLIP_Y\ncoord.y=1.0-coord.y;\n#endif\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-light
1Color),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;\n#ifdef FLIP_Y\nT=-T;B=-B;\n#endif\nhighp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));\n#ifdef FLIP_Y\nn=normalize(cross(fdx,fdy));\n#else\nn=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*light
1Color;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.
1y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef DITHERED_DISCARD\nif (abs(u_dithered_discard_threshold) < 1.0) {float ditherValue=fract(52.9829189*fract(0.06711056*gl_FragCoord.x+0.00583715*gl_FragCoord.y));float compareValue=mix(1.0-ditherValue,ditherValue,step(0.0,u_dithered_discard_threshold));if (abs(u_dithered_discard_threshold) < compareValue) {discard;}}\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor,v_position_height.w);\n#endif\n#ifdef FEATURE_CUTOUT\nfinalColor=apply_feature_cutout(finalColor,gl_FragCoord);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#ifdef CLIP_ZERO_TO_ONE\nv_depth=-1.0+2.0*v_depth; \n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);
1\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:ii("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;
1rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:ii("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),snowParticle:ii("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:ii("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;
1pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:ii("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),occlusion:ii("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function ni(e,t){const r=e.split("\n");for(let e of r){if(e=e.trimStart(),"#"!==e[0])continue;if(!e.includes("if"))continue;if(e.startsWith("#endif"))continue;const r=e.match(Wn);if(r)for(const e of r)Zn.has(e)||t.add(e)}}function ii(e,t){const r=new Set,n=[],i=[];e=e.replace(Hn,((e,t)=>(i.push(t),""))),t=t.replace(Hn,((e,t)=>(n.push(t),"")));let o=new Set(Yn);ni(e,o),ni(t,o);for(const e of[...n,...i])Kn[e]||(Kn[e]=new Set,ni(Xn[e],Kn[e])),o=new Set([...o,...Kn[e]]);return{fragmentSource:e=e.replace(qn,((e,t,n,i,o)=>(r.add(o),"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nin ${n} ${i} ${o};\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:"initialize"===t?`\n#ifdef HAS_UNIFORM_u_${o}\n    ${n} ${i} ${o} = u_${o};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    in ${n} ${i} ${o};\n#endif\n`:"initialize-attribute"===t?"":void 0))),vertexSource:t=t.replace(qn,((e,t,n,i,o)=>{const a=`MATERIAL_ATTRIBUTE_OFFSET_${o}`,s="float"===i?"vec2":i,l=`GET_ATTRIBUTE_${s}(a_${o}, materialInfo, ${a})`,c=o.match(/color/)?"color":s;return"define-attribute-vertex-shader-only"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\nin ${n} ${i} a_${o};\n#endif\n`:r.has(o)?"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\n    #if !defined(${a})\n        in ${n} ${s} a_${o};\n    #endif\nout ${n} ${i} ${o};\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:"initialize"===t?"vec4"===c?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${o} = a_${o};\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`:`\n#if !defined(HAS_UNIFORM_u_${o})\n    #ifdef ${a}\n        ${o} = unpack_mix_${c}(${l}, u_${o}_t);\n    #else\n        ${o} = unpack_mix_${c}(a_${o}, u_${o}_t);\n    #endif\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    in ${n} ${i} a_${o};\n    out ${n} ${i} ${o};\n#endif\n`:"initialize-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    ${o} = a_${o};\n#endif\n`:void 0:"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\n    #if !defined(${a})\n        in ${n} ${s} a_${o};\n    #endif\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:"define-instanced"===t?"mat4"===c?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${o}0;\nin vec4 a_${o}1;\nin vec4 a_${o}2;\nin vec4 a_${o}3;\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${n} ${s} a_${o};\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:"initialize-attribute-custom"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n    ${n} ${i} ${o} = a_${o};\n#endif\n`:"vec4"===c?`\n#ifndef HAS_UNIFORM_u_${o}\n    #ifdef ${a}\n        ${n} ${i} ${o} = ${l};\n    #else\n        ${n} ${i} ${o} = a_${o};\n    #endif\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n    #ifdef ${a}\n        ${n} ${i} ${o} = unpack_mix_${c}(${l}, u_${o}_t);\n    #else\n        ${n} ${i} ${o} = unpack_mix_${c}(a_${o}, u_${o}_t);\n    #endif\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`})),usedDefines:o,vertexIncludes:n,fragmentIncludes:i}}class oi{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,r,n,i,o,a,s){this.context=e;let l=this.boundPaintVertexBuffers.length!==n.length;for(let e=0;!l&&e<n.length;e++)this.boundPaintVertexBuffers[e]!==n[e]&&(l=!0);let c=this.boundDynamicVertexBuffers.length!==a.length;for(let e=0;!c&&e<a.length;e++)this.boundDynamicVertexBuffers[e]!==a[e]&&(c=!0);if(!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||l||c||this.boundIndexBuffer!==i||this.boundVertexOffset!==o)this.freshBind(t,r,n,i,o,a,s);else{e.bindVertexArrayOES.set(this.vao);for(const r of a)r&&(r.bind(),s&&r.instanceCount&&r.setVertexAttribDivisor(e.gl,t,s));i&&i.dynamicDraw&&i.bind()}}freshBind(e,t,r,n,i,o,a){const s=this.context,l=s.gl;this.vao&&this.destroy(),this.vao=s.gl.createVertexArray(),s.bindVertexArrayOES.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffers=o,t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,i);for(const t of r)t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,i);for(const t of o)t&&(t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,i),a&&t.instanceCount&&t.setVertexAttribDivisor(l,e,a));n&&n.bind()}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function ai(t,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.ae(0,i/n).toLngLat().lat,new e.ae(0,(i+1)/n).toLngLat().lat]}function si(t,r,n,i,o,a,s){const l=t.context,c=l.gl,u=n.hillshadeFBO;if(!u)return;t.prepareDrawTile();const d=t.isTileAffectedByFog(r),h=[];t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode&&h.push("USE_MRT1");const f=t.getOrCreateProgram("hillshade",{overrideFog:d,defines:h});l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment0.get());const p=((t,r,n,i)=>{const o=n.paint.get("hillshade-shadow-color"),a="none"===n.paint.get("hillshade-shadow-color-use-theme").
vendor: 5,660 bytes, line 1
1constantOr("default"),s=n.paint.get("hillshade-highlight-color"),l="none"===n.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),c=n.paint.get("hillshade-accent-color"),u="none"===n.paint.get("hillshade-accent-color-use-theme").constantOr("default"),d=n.paint.get("hillshade-emissive-strength");let h=e.an(n.paint.get("hillshade-illumination-direction"));if("viewport"===n.paint.get("hillshade-illumination-anchor"))h-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const r=t.style.directionalLight.properties.get("direction"),n=e.d4(r.x,r.y,r.z);h=e.an(n[1])}const f=!t.options.moving;return{u_matrix:i||t.transform.calculateProjMatrix(r.tileID.toUnwrapped(),f),u_image:0,u_latrange:ai(0,r.tileID),u_light:[n.paint.get("hillshade-exaggeration"),h],u_shadow:o.toPremultipliedRenderColor(a?null:n.lut),u_highlight:s.toPremultipliedRenderColor(l?null:n.lut),u_emissive_strength:d,u_accent:c.toPremultipliedRenderColor(u?null:n.lut)}})(t,n,i,t.terrain?r.projMatrix:null);t.uploadCommonUniforms(l,f,r.toUnwrapped());const{tileBoundsBuffer:g,tileBoundsIndexBuffer:m,tileBoundsSegments:y}=t.getTileBoundsBuffers(n);f.draw(t,c.TRIANGLES,o,a,s,Qr.disabled,p,i.id,g,m,y)}function li(t,r,n){if(!r.needsDEMTextureUpload)return;const i=t.context,o=i.gl;i.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(n.stride);const a=n.getPixels();r.demTexture?r.demTexture.update(a,{premultiply:!1}):r.demTexture=new e.T(i,a,o.R32F,{premultiply:!1}),r.needsDEMTextureUpload=!1}function ci(t,r,n){const i=t.context,o=i.gl;if(!r.dem)return;const a=r.dem;if(i.activeTexture.set(o.TEXTURE1),li(t,r,a),!r.demTexture)return;r.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE);const s=a.dim;i.activeTexture.set(o.TEXTURE0);let l=r.hillshadeFBO;if(!l){const t=new e.T(i,{width:s,height:s,data:null},o.RGBA8);t.bind(o.LINEAR,o.CLAMP_TO_EDGE),l=r.hillshadeFBO=i.createFramebuffer(s,s,1,"renderbuffer"),l.colorAttachment0.set(t.texture)}i.bindFramebuffer.set(l.framebuffer),i.viewport.set([0,0,s,s]);const{tileBoundsBuffer:c,tileBoundsIndexBuffer:u,tileBoundsSegments:d}=t.getMercatorTileBoundsBuffers(),h=[];t.linearFloatFilteringSupported()&&h.push("TERRAIN_DEM_FLOAT_FORMAT"),t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode&&h.push("USE_MRT1"),t.getOrCreateProgram("hillshadePrepare",{defines:h}).draw(t,o.TRIANGLES,Zr.disabled,Xr.disabled,Wr.unblended,Qr.disabled,((t,r)=>{const n=r.stride,i=e.bC();return e.ce(i,0,e.al,-e.al,0,0,1),e.br(i,i,[0,-e.al,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ}})(r.tileID,a),n.id,c,u,d),r.needsHillshadePrepare=!1}class ui{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class di extends ui{getDefault(){return e.ao.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class hi extends ui{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class fi extends ui{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class pi extends ui{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class gi extends ui{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class mi extends ui{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class yi extends ui{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class _i extends ui{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class vi extends ui{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class bi extends ui{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class xi extends ui{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class wi extends ui{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Si extends ui{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class ki extends ui{getDefault(){const e=this.gl;return[e.ONE,e.ZERO,e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ti extends ui{getDefault(){return e.ao.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor
vendor: 5,030 bytes, line 1
1(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Ii extends ui{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1)}}class Mi extends ui{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class Ei extends ui{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class Pi extends ui{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let Ai=class extends ui{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class Ci extends ui{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class Ri extends ui{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Li extends ui{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Oi extends ui{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Di extends ui{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class zi extends ui{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Fi extends ui{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Ni extends ui{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}}class Bi extends ui{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class ji extends ui{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Vi extends ui{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Gi extends ui{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class Ui extends Gi{constructor(e,t,r=0){super(e,t),this.attachmentPoint=e.gl.COLOR_ATTACHMENT0+r}setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachmentPoint,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class $i extends Gi{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Hi extends Gi{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachment(),t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class qi extends $i{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const Wi=(e,t,r,n)=>({u_matrix:e,u_image0:0,u_image1:1,u_skirt_height:t,u_ground_shadow_factor:r,u_emissive_texture_available:n}),Zi=(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:r,u_zoom_transition:i,u_merc_center:o,u_image0:0,u_image1:1,u_frustum_tl:a,u_frustum_tr:s,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:d,u_viewport:h,u_grid_matrix:m?Float32Array.from(m):new Float32Array(9),u_skirt_height:f,u_far_z_cutoff:p,u_emissive_texture_available:g});function Yi(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const Xi=new class{constructor(){this.operations={}}newMorphing(e,t,r,n,i){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==r.tileID.key&&(t.queued=r)}else this.operations[e]={startTime:n,phase:0,duration:i,from:t,to:r,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const r=this.operations[t];for(r.phase=(e-r.startTime)/r.duration;r.phase>
1=1||!this._validOp(r);)if(!this._nextOp(r,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},Ki={0:null,1:"TERRAIN_VERTEX_MORPHING"};function Ji(e,t,r){if(0===t)return 0;const n=t<1&&514===r?.25/t:1;return 6*Math.pow(1.5,22-e)*Math.max(t,1)*n}function Qi(e,t){const r=1<<e.z;return!t&&(0===e.x||e.x===r-1)||0===e.y||e.y===r-1}function eo(e,t){if(!e.style||!e.style.enable3dLights())return;const r=e.context,n=r.gl;r.activeTexture.set(n.TEXTURE1),t?t.bind(n.LINEAR,n.CLAMP_TO_EDGE):e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}const to=e=>({u_matrix:e});function ro(t,r,n,i,o){if(o>0){const a=e.o.now(),s=(a-t.timeAdded)/o,l=r?(a-r.timeAdded)/o:-1,c=n.getSource(),u=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),d=!r||Math.abs(r.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),h=d&&t.refreshedUponExpiration?1:e.aA(d?s:1-l,0,1);return r?{opacity:1,mix:1-h,isFading:s<1}:{opacity:h,mix:0,isFading:s<1}}return{opacity:1,mix:0,isFading:!1}}class no extends zt{constructor(e){const t=mt("mock-dem",{type:"raster-dem",maxzoom:e.transform.maxZoom},e.style.dispatcher,e.style);super("mock-dem",t,!1),t.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class io extends zt{constructor(e){const t=mt("proxy",{type:"geojson",maxzoom:e.transform.maxZoom},e.style.dispatcher,e.style);super("proxy",t,!1),t.setEventedParent(this),this.map=this.getSource().map=e,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,t,r){if(e.freezeTileCoverage)return;this.transform=e;const n=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((t,r)=>{if(t[r.key]="",!this._tiles[r.key]){const t=new Rt(r,this._source.tileSize*r.overscaleFactor(),e.tileZoom,void 0,void 0,this._source.worldview);t.state="loaded",this._tiles[r.key]=t}return t}),{});for(const e in this._tiles)e in n||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const r=Object.values(t);this.renderCachePool.push(...r),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach((e=>e.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class oo extends e.aQ{constructor(e,t,r){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=r}}class ao extends e.bV{constructor(t,r){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,i,o]=function(){const t=new e.bd,r=new e.b0,n=131;t.reserve(17161),r.reserve(33800);const i=e.al/128,o=e.al+i/2,a=o+i;for(let r=-i;r<a;r+=i)for(let n=-i;n<a;n+=i){const i=n<0||n>o||r<0||r>o?24575:0,a=e.aA(Math.round(n),0,e.al),s=e.aA(Math.round(r),0,e.al);t.emplaceBack(a+i,s)}const s=(e,t)=>{const i=t*n+e;r.emplaceBack(i+1,i,i+n),r.emplaceBack(i+n,i+n+1,i+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)s(t,e);return[0,129].forEach((e=>{for(let t=0;t<130;t++)s(t,e),s(e,t)})),[t,r,32768]}(),a=t.context;this.gridBuffer=a.createVertexBuffer(n,e.bf.members),this.gridIndexBuffer=a.createIndexBuffer(i),this.gridSegments=e.bg.simpleSegment(0,0,n.length,i.length),this.gridNoSkirtSegments=e.bg.simpleSegment(0,0,n.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new io(r.map),this.orthoMatrix=e.bC(),e.ce(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.al,0,e.al,0,1);const s=a.gl;this._overlapStencilMode=new Xr({func:s.GEQUAL,mask:255},0,255,s.KEEP,s.KEEP,s.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=r,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new no(r.map),this._pendingGroundEffectLayers=[],this._emissiveTexture=!1}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache()}))}update(t,r,n){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const i=t.terrain.properties,o=0===t.terrain.drapeRenderMode,a=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.o.now();const s=t.terrain&&t.terrain.scope,l=i.get("source"),c=o?this._mockSourceCache:t.getSourceCache(l,s);if(!c)return void e.w(`Couldn't find terrain source "${l}".`);if(this.sourceCache=c,this._attenuationRange=t.terrain.getAttenuationRange(),this._exaggeration=a?this.calculateExaggeration(r):i.get("exaggeration"),!r.projection.requiresDraping&&a&&0===this._exaggeration)return void this._disable();this.enabled=!0;const u=()=>{this.sourceCache.used&&e.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(r,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,u(),this._initializing=!0),u(),r.updateElevation(!0,n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(r),this._emptyDEMTextureDirty=!0,this._previousZoom=r.zoom}else this._disable()}calculateExaggeration(t){if(this._attenuationRange&&t.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(t.zoom);const r=this._previousCameraAltitude,n=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=n;const i=null!=r?n-r:Number.MAX_VALUE;if(Math.abs(i)<2)return this._exaggeration;const o=t.zoom,a=this._style.terrain;if(!this._previousUpdateTimestamp)return a.getExaggeration(o);let s=o-this._previousZoom;const l=this._previousUpdateTimestamp;let c=o;null!=this._evaluationZoom&&(c=this._evaluationZoom,Math.abs(o-c)>.5&&(s=.5*(o-c+s)),s*i<0&&(c+=s)),this._evaluationZoom=c;const u=a.getExaggeration(c),d=u===a.getExaggeration(Math.max(0,c-.1));if(d&&Math.abs(u-this._exaggeration)<.01)return u;let h=Math.min(.1,.00375*(this._updateTimestamp-l));return(d||u<.1||Math.abs(s)<1e-4)&&(h=Math.min(.2,4*h)),e.ak(this._exaggeration,u,h)}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){"source"===e.dataType&&e.coord?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach((e=>e.fb.destroy())),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const r=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(e.ae.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const i=this.proxyCoords=r.getIds().map((e=>{const t=r.getTileByID(e).tileID;return t.projMatrix=n.calculateProjMatrix(t.toUnwrapped()),t}));!function(t,r){const n=r.transform.pointCoordinate(r.transform.getCameraPoint()),i=new e.P(n.x,n.y);t.sort(((t,r)=>
1{if(r.overscaledZ-t.overscaledZ)return r.overscaledZ-t.overscaledZ;const n=new e.P(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),o=new e.P(r.canonical.x+(1<<r.canonical.z)*r.wrap,r.canonical.y),a=i.mult(1<<t.canonical.z);return a.x-=.5,a.y-=.5,a.distSqr(n)-a.distSqr(o)}))}(i,this.painter);const o=this.proxyToSource||{};this.proxyToSource={},i.forEach((e=>{this.proxyToSource[e.key]={}})),this.terrainTileForTile={};const a=this._style._mergedSourceCaches;for(const e in a){const r=a[e];if(!r.used)continue;if(r!==this.sourceCache&&this.resetTileLookupCache(r.id),this._setupProxiedCoordsForOrtho(r,t[e],o),r.usedForTerrain)continue;const n=t[e];r.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[r.id]=i.map((e=>new oo(e,e.key,this.orthoMatrix))),this._assignTerrainTiles(i),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1;const s={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const r=t.tileID.key;r in s||(this._visibleDemTiles.push(t),s[r]=r)}}_assignTerrainTiles(e){this._initializing||e.forEach((e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)}))}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const r in this.terrainTileForTile){const n=this.terrainTileForTile[r],i=n.dem;!i||n.demTexture&&!n.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),li(this.painter,n,i))}}_prepareDemTileUniforms(e,t,r,n){if(!t||null==t.demTexture)return!1;const i=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-i.z),a=n||"";return r[`u_dem_tl${a}`]=[i.x*o%1,i.y*o%1],r[`u_dem_scale${a}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let e=0;const t=this._visibleDemTiles.reduce(((t,r)=>{if(!r.dem)return t;const n=r.dem.tree.minimums[0];return n>0&&e++,t+n}),0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,r=t.gl;t.activeTexture.set(r.TEXTURE2);const n=this._getLoadedAreaMinimum(),i=new e.dL({width:1,height:1},new Float32Array([n]));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(i,{premultiply:!1}):o=this._emptyDEMTexture=new e.T(t,i,r.R32F,{premultiply:!1}),o}setupElevationDraw(t,r,n){const i=this.painter.context,o=i.gl,a={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};a.u_exaggeration=this.exaggeration();let s=null,l=null,c=1;if(n&&n.morphing&&this._useVertexMorphing){const e=n.morphing.srcDemTile,r=n.morphing.dstDemTile;c=n.morphing.phase,e&&r&&(this._prepareDemTileUniforms(t,e,a,"_prev")&&(l=e),this._prepareDemTileUniforms(t,r,a)&&(s=r))}const u=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?o.LINEAR:o.NEAREST;let d=null;var h;if(this.enabled?l&&s?(d=s.demTexture,i.activeTexture.set(o.TEXTURE4),l.demTexture.bind(u(l),o.CLAMP_TO_EDGE),a.u_dem_lerp=c):(s=this.terrainTileForTile[t.tileID.key],d=this._prepareDemTileUniforms(t,s,a)?s.demTexture:this.emptyDEMTexture):d=this.emptyDEMTexture,i.activeTexture.set(o.TEXTURE2),d&&(a.u_dem_size=1===(h=d).size[0]?1:h.size[0]-2,d.bind(u(s),o.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(n&&n.useDepthForOcclusion,r,a),n&&n.useMeterToDem&&s){const t=(1<<s.tileID.canonical.z)*e.cf(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;a.u_meter_to_dem=t}if(n&&n.labelPlaneMatrixInv&&(a.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),r.setTerrainUniformValues(i,a),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,n&&n.useDenormalizedUpVectorScale);r.setGlobeUniformValues(i,e)}}globeUniformValues(t,r,n){const i=t.projection;return{u_tile_tl_up:i.upVector(r,0,0),u_tile_tr_up:i.upVector(r,e.al,0),u_tile_br_up:i.upVector(r,e.al,e.al),u_tile_bl_up:i.upVector(r,0,e.al),u_tile_up_scale:n?e.dM(1):i.upVectorScale(r,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const r=this.painter,n=this.painter.context;0!==t.length&&(n.bindFramebuffer.set(null),n.viewport.set([0,0,r.width,r.height]),r.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,r,n,i,o){if("globe"===t.transform.projection.name)!function(t,r,n,i,o){const a=t.context,s=a.gl;let l,c;const u=t.transform,d=e.dE(t,a,u),h=(e,r)=>{if(c===r)return;const n=[Ki[r],"PROJECTION_GLOBE_VIEW"];d&&n.push("CUSTOM_ANTIALIASING");const i=t.isTileAffectedByFog(e);l=t.getOrCreateProgram("globeRaster",{defines:n,overrideFog:i}),c=r},f=t.colorModeForRenderPass(),p=new Zr(s.LEQUAL,Zr.ReadWrite,t.depthRangeFor3D);Xi.update(o);const g=e.dF(u),m=[e.aF(u.center.lng),e.aJ(u.center.lat)],y=t.globeSharedBuffers,_=[u.width*e.o.devicePixelRatio,u.height*e.o.devicePixelRatio],v=Float32Array.from(u.globeMatrix),b={useDenormalizedUpVectorScale:!0};{const u=t.transform,d=Ji(u.zoom,r.exaggeration(),r.sourceCache._source.tileSize);c=-1;const x=s.TRIANGLES;for(const c of i){const i=n.getTile(c),w=Xr.disabled,S=r.prevTerrainTileForTile[c.key],k=r.terrainTileForTile[c.key];
1Yi(S,k)&&Xi.newMorphing(c.key,S,k,o,250),eo(t,i.emissiveTexture),a.activeTexture.set(s.TEXTURE0),i.texture&&i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const T=Xi.getMorphValuesForProxy(c.key),I=T?1:0;T&&Object.assign(b,{morphing:{srcDemTile:T.from,dstDemTile:T.to,phase:e.dD(T.phase)}});const M=e.dG(c.canonical),E=e.dH(M.getCenter().lat),P=e.dI(c.canonical,M,E,u.worldSize/u._pixelsPerMercatorPixel),A=e.bk(e.dJ(c.canonical)),C="mrt-fallback"===t.emissiveMode?1:0,R=Zi(u.expandedFarZProjMatrix,v,g,A,e.aj(u.zoom),m,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,_,d,u._farZ,C,P);if(h(c,I),l&&(r.setupElevationDraw(i,l,b),t.uploadCommonUniforms(a,l,c.toUnwrapped()),y)){const[e,r,n]=y.getGridBuffers(E,0!==d);l.draw(t,x,p,w,f,Qr.backCCW,R,"globe_raster",e,r,n)}}}if(y&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];d&&o.push("CUSTOM_ANTIALIASING"),l=t.getOrCreateProgram("globeRaster",{defines:o});for(const o of i){const{x:i,y:c,z:d}=o.canonical,h=0===c,g=c===(1<<d)-1,[v,x,w,S]=y.getPoleBuffers(d,!1);if(S&&(h||g)){const c=n.getTile(o);eo(t,c.emissiveTexture),a.activeTexture.set(s.TEXTURE0),c.texture&&c.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);let y=e.dK(d,i,u);const k=e.bk(e.dJ(o.canonical)),T="mrt-fallback"===t.emissiveMode?1:0,I=(e,r)=>e.draw(t,s.TRIANGLES,p,Xr.disabled,f,Qr.disabled,Zi(u.expandedFarZProjMatrix,y,y,k,0,m,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,_,0,u._farZ,T),"globe_pole_raster",r,w,S);r.setupElevationDraw(c,l,b),t.uploadCommonUniforms(a,l,o.toUnwrapped()),h&&t.renderDefaultNorthPole&&I(l,v),g&&t.renderDefaultSouthPole&&(y=e.cS(e.bC(),y,[1,-1,1]),I(l,x))}}}}(t,r,n,i,o);else{const a=t.context,s=a.gl;let l,c;const u=t.shadowRenderer,d=un(t,t.longestCutoffRange),h=e=>{if(c===e)return;const r=[];r.push(Ki[e]),d.shouldRenderCutoff&&r.push("RENDER_CUTOFF"),u&&(r.push("RENDER_SHADOWS","DEPTH_TEXTURE"),u.useNormalOffset&&r.push("NORMAL_OFFSET")),l=t.getOrCreateProgram("terrainRaster",{defines:r}),c=e},f=t.colorModeForRenderPass(),p=new Zr(s.LEQUAL,Zr.ReadWrite,t.depthRangeFor3D);Xi.update(o);const g=t.transform,m=Ji(g.zoom,r.exaggeration(),r.sourceCache._source.tileSize);let y=[0,0,0];if(u){const e=t.style.directionalLight,r=t.style.ambientLight;e&&r&&(y=yn(t.style,e,r))}{c=-1;const _=s.TRIANGLES,[v,b]=[r.gridIndexBuffer,r.gridSegments];for(const c of i){const i=n.getTile(c),x=Xr.disabled,w=r.prevTerrainTileForTile[c.key],S=r.terrainTileForTile[c.key];Yi(w,S)&&Xi.newMorphing(c.key,w,S,o,250),eo(t,i.emissiveTexture),a.activeTexture.set(s.TEXTURE0),i.texture&&i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const k=Xi.getMorphValuesForProxy(c.key),T=k?1:0;let I;k&&(I={morphing:{srcDemTile:k.from,dstDemTile:k.to,phase:e.dD(k.phase)}});const M="mrt-fallback"===t.emissiveMode?1:0,E=Wi(c.projMatrix,Qi(c.canonical,g.renderWorldCopies)?m/10:m,y,M);if(h(T),!l)continue;r.setupElevationDraw(i,l,I);const P=c.toUnwrapped();u&&u.setupShadows(P,l),t.uploadCommonUniforms(a,l,P,null,d),l.draw(t,_,p,x,f,Qr.backCCW,E,"terrain_raster",r.gridBuffer,v,b)}}}}(r,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,r.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const r=this.painter,n=this.painter.context,i=this.proxySourceCache,o=this.proxiedCoords[i.id],a=this._drapedRenderBatches.shift(),s=r.style.order,l=[];this._updateFBOs("mrt-fallback"===r.emissiveMode);let c=0;for(const u of o){const o=i.getTileByID(u.proxyTileKey),d=i.proxyCachedFBO[u.key]?i.proxyCachedFBO[u.key][t]:void 0,h=void 0!==d?i.renderCache[d]:this.pool[c++],f=void 0!==d;if(o.texture=h.tex,o.emissiveTexture=h.emissiveTex,f&&!h.dirty){l.push(o.tileID);continue}n.bindFramebuffer.set(h.fb.framebuffer);const p=n.gl;let g;p.drawBuffers("mrt-fallback"===r.emissiveMode?[p.COLOR_ATTACHMENT0,p.COLOR_ATTACHMENT1]:[p.COLOR_ATTACHMENT0]),this.renderedToTile=!1,h.dirty&&(n.clear({color:e.ao.transparent,stencil:0}),h.dirty=!1);for(let e=a.start;e<=a.end;++e){const t=r.style._mergedLayers[s[e]];if(t.isHidden(r.transform.zoom))continue;const i=r.style.getLayerSourceCache(t),o=i?this.proxyToSource[u.key][i.id]:[u];if(!o)continue;const a=o;n.viewport.set([0,0,h.fb.width,h.fb.height]),g!==(i?i.id:null)&&(this._setupStencil(h,o,t,i
1),g=i?i.id:null),r.renderLayer(r,i,t,a)}if(p.drawBuffers([p.COLOR_ATTACHMENT0]),0===this._drapedRenderBatches.length)for(const e of this._pendingGroundEffectLayers){const t=r.style._mergedLayers[s[e]];if(t.isHidden(r.transform.zoom))continue;const i=r.style.getLayerSourceCache(t),o=i?this.proxyToSource[u.key][i.id]:[u];if(!o)continue;const a=o;n.viewport.set([0,0,h.fb.width,h.fb.height]),g!==(i?i.id:null)&&(this._setupStencil(h,o,t,i),g=i?i.id:null),r.renderLayer(r,i,t,a)}this.renderedToTile?(h.dirty=!0,l.push(o.tileID)):f||--c,5===c&&(c=0,this.renderToBackBuffer(l))}return this.renderToBackBuffer(l),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,r.width,r.height]),a.end+1}postRender(){}isLayerOrderingCorrect(e){const t=e.order.length;let r=-1,n=t;for(let i=0;i<t;++i)this._style.isLayerDraped(e._mergedLayers[e.order[i]])?r=Math.max(r,i):n=Math.min(n,i);return n>r}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter((e=>e.dem)).forEach((t=>{e=Math.min(e,t.dem.tree.minimums[0])})),0===e?e:(e-30)*this._exaggeration}raycast(e,t,r){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter((e=>e.dem)).map((n=>{const i=n.tileID,o=1<<i.overscaledZ,{x:a,y:s}=i.canonical,l=a/o,c=(a+1)/o,u=s/o,d=(s+1)/o;return{minx:l,miny:u,maxx:c,maxy:d,t:n.dem.tree.raycastRoot(l,u,c,d,e,t,r),tile:n}}));n.sort(((e,t)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE)));for(const i of n){if(null==i.t)return null;const n=i.tile.dem.tree.raycast(i.minx,i.miny,i.maxx,i.maxy,e,t,r);if(null!=n)return n}return null}_createFBO(){const t=this.painter.context,r=t.gl,n=this.drapeBufferSize;t.activeTexture.set(r.TEXTURE0);const i=new e.T(t,{width:n[0],height:n[1],data:null},r.RGBA8);i.bind(r.LINEAR,r.CLAMP_TO_EDGE);const o=t.createFramebuffer(n[0],n[1],1,null);let a;return o.colorAttachment0.set(i.texture),this._emissiveTexture&&(a=new e.T(t,{width:n[0],height:n[1],data:null},r.R8),a.bind(r.LINEAR,r.CLAMP_TO_EDGE),o.createColorAttachment(t,1),o.colorAttachment1.set(a.texture)),o.depthAttachment=new qi(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:i,emissiveTex:a,dirty:!1}}_updateFBOs(e){if(this._emissiveTexture!==e){for(const t of this.pool)this._updateFBO(t,e);for(const t of this.proxySourceCache.renderCache)this._updateFBO(t,e);this._emissiveTexture=e}}_updateFBO(t,r){const n=t.fb,i=this.painter.context,o=i.gl,a=this.drapeBufferSize;if(r){const r=new e.T(i,{width:a[0],height:a[1],data:null},o.R8);r.bind(o.LINEAR,o.CLAMP_TO_EDGE),t.emissiveTex=r,n.createColorAttachment(i,1),n.colorAttachment1.set(r.texture)}else t.emissiveTex=void 0,n.removeColorAttachment(i,1);t.dirty=!0}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._debugParams.disableRenderCache)return!0;if(this._style.hasLightTransitions())return!0;for(const e in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[e].hasTransition())return!0;return this._style.order.some((e=>{const t=this._style._mergedLayers[e],r=t.isHidden(this.painter.transform.zoom);return"hillshade"===t.type||"custom"===t.type?!r&&t.shouldRedrape():!r&&t.hasTransition()}))}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if(e instanceof dt){t=!0;break}if(!t)return;const r={};for(let t=0;t<this._style.order.length;++t){const n=this._style._mergedLayers[this._style.order[t]],i=this._style.getLayerSourceCache(n);if(!i||r[i.id])continue;if(n.isHidden(this.painter.transform.zoom)||"line"!==n.type)continue;const o=n.widthExpression(),a=n.emissiveStrengthExpression();if(o instanceof e.ad||a instanceof e.ad){r[i.id]=!0;for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][i.id];if(t)for(const e of t)this._clearRenderCacheForTile(i.id,e)}}}}_clearRasterLayersFromRenderCache(){let e=!1;for(const t in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[t]._source instanceof ht){e=!0;break}if(!e)return;const t={};for(let e=0;e<this._style.order.length;++e){const r=this._style._mergedLayers[this._style.order[e]],n=this._style.getLayerSourceCache(r);if(!n||t[n.id])continue;if(r.isHidden(this.painter.transform.zoom)||"raster"!==r.type)continue;const i=r.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][n.id];if(t)for(const e of t){const t=ro(n.getTile(e),n.findLoadedParent(e,0),n,this.painter.transform,i);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(n.id,e)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const t=this._style.order,r=t.length;if(0===r)return;const n=[];this._pendingGroundEffectLayers=[];let i,o=0,a=this._style._mergedLayers[t[o]];for(;!this._style.isLayerDraped(a)&&a.isHidden(this.painter.transform.zoom)&&++o<r;)a=this._style._mergedLayers[t[o]];for(;o<r;++o){const e=this._style._mergedLayers[t[o]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===i&&(i=o):("fill-extrusion"===e.type&&this._pendingGroundEffectLayers.push(o),void 0!==i&&(n.push({start:i,end:o-1}),i=void 0)))}if(void 0!==i&&n.push({start:i,end:o-1}),0!==n.length){const t=n[n.length-1];this._pendingGroundEffectLayers.every((e=>e>t.end))||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=n}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let r=0;r<e.length;++r){const n=Object.values(e[r]);t.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();const r=this.proxyCoords,n=this._tilesDirty;for(let i=r.length-1;i>=0;i--){const o=r[i];if(t.getTileByID(o.key),void 0!==t.proxyCachedFBO[o.key]){const r=e[o.key],i=this.proxyToSource[o.key];let a=0;for(const e in i){const t=i[e],o=r[e];if(!o||o.length!==t.length||t.some(((t,r)=>t!==o[r]||n[e]&&n[e].hasOwnProperty(t.key)))){a=-1;break}++a}for(const e in t.proxyCachedFBO[o.key])t.renderCache[t.proxyCachedFBO[o.key][e]].dirty=a<0||a!==Object.values(r).length}}const i=[...this._drapedRenderBatches];i.sort(((e,t)=>t.end-t.start-(e.end-e.start)));for(const e of i)for(const n of r){if(t.proxyCachedFBO[n.key])continue;let r=t.renderCachePool.pop();void 0===r&&t.renderCache.length<50&&(r=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==r&&(t.proxyCachedFBO[n.key]={},t.proxyCachedFBO[n.key][e.start]=r,t.renderCache[r].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,r,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const i=this.painter.context,o=i.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let a;if(r.isTileClipped())a=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>
vendor: 4,479 bytes, line 1
1t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);a=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+a>255&&(i.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=a,this._overlapStencilMode.ref=this._stencilRef,r.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):Xr.disabled}_renderTileClippingMasks(e,t){const r=this.painter,n=this.painter.context,i=n.gl;r._tileClippingMaskIDs={},n.setColorMode(Wr.disabled),n.setDepthMode(Zr.disabled);const o=r.getOrCreateProgram("clippingMask");for(const n of e){const e=r._tileClippingMaskIDs[n.key]=--t;o.draw(r,i.TRIANGLES,Zr.disabled,new Xr({func:i.ALWAYS,mask:0},e,255,i.KEEP,i.KEEP,i.REPLACE),Wr.disabled,Qr.disabled,to(n.projMatrix),"$clipping",r.tileExtentBuffer,r.quadTriangleIndexBuffer,r.tileExtentSegments)}}pointCoordinate(t){const r=this.painter.transform;if(t.x<0||t.x>r.width||t.y<0||t.y>r.height)return null;const n=[t.x,t.y,1,1];e.aC(n,n,r.pixelMatrixInverse),e.cK(n,n,1/n[3]),n[0]/=r.worldSize,n[1]/=r.worldSize;const i=r._camera.position,o=e.cf(1,r.center.lat),a=[i[0],i[1],i[2]/o,0],s=e.da([],n.slice(0,3),a);e.aw(s,s);const l=this.raycast(a,s,this._exaggeration);return null!==l&&l?(e.bH(a,a,s,l),a[3]=a[2],a[2]*=o,a):null}_setupProxiedCoordsForOrtho(t,r,n){if(t.getSource()instanceof e.aU)return this._setupProxiedCoordsForImageSource(t,r,n);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const i=this.proxiedCoords[t.id]=[],o=this.proxyCoords;for(let e=0;e<o.length;e++){const r=o[e],a=this._findTileCoveringTileID(r,t);if(a){const e=this._createProxiedId(r,a,n[r.key]&&n[r.key][t.id]);i.push(e),this.proxyToSource[r.key][t.id]=[e]}}let a=!1;const s=new Set;for(let e=0;e<r.length;e++){const o=t.getTile(r[e]);if(!o||!o.hasData())continue;const l=this._findTileCoveringTileID(o.tileID,this.proxySourceCache);if(l&&l.tileID.canonical.z!==o.tileID.canonical.z){const e=this.proxyToSource[l.tileID.key][t.id],r=this._createProxiedId(l.tileID,o,n[l.tileID.key]&&n[l.tileID.key][t.id]);e?e.splice(e.length-1,0,r):this.proxyToSource[l.tileID.key][t.id]=[r];const c=this.proxyToSource[l.tileID.key][t.id];s.has(c)||s.add(c),i.push(r),a=!0}}if(this._sourceTilesOverlap[t.id]=a,a&&this._debugParams.sortTilesHiZFirst)for(const e of s)e.sort(((e,t)=>t.overscaledZ-e.overscaledZ))}_setupProxiedCoordsForImageSource(t,r,n){if(!t.getSource().loaded())return;const i=this.proxiedCoords[t.id]=[],o=this.proxyCoords,a=t.getSource(),s=a.tileID;if(!s)return;const l=new e.P(s.x,s.y)._div(1<<s.z),c=a.coordinates.map(e.ae.fromLngLat).reduce(((e,t)=>(e.min.x=Math.min(e.min.x,t.x-l.x),e.min.y=Math.min(e.min.y,t.y-l.y),e.max.x=Math.max(e.max.x,t.x-l.x),e.max.y=Math.max(e.max.y,t.y-l.y),e)),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),u=(t,r)=>{const n=t.wrap+t.canonical.x/(1<<t.canonical.z),i=t.canonical.y/(1<<t.canonical.z),o=e.al/(1<<t.canonical.z),a=r.wrap+r.canonical.x/(1<<r.canonical.z),s=r.canonical.y/(1<<r.canonical.z);return n+o<a+c.min.x||n>a+c.max.x||i+o<s+c.min.y||i>s+c.max.y};for(let e=0;e<o.length;e++){const a=o[e];for(let e=0;e<r.length;e++){const o=t.getTile(r[e]);if(!o||!o.hasData())continue;if(u(a,o.tileID))continue;const s=this._createProxiedId(a,o,n[a.key]&&n[a.key][t.id]),l=this.proxyToSource[a.key][t.id];l?l.push(s):this.proxyToSource[a.key][t.id]=[s],i.push(s)}}}_createProxiedId(t,r,n){let i=this.orthoMatrix;if(n){const e=n.find((e=>e.key===r.tileID.key));if(e)return e}if(r.tileID.key!==t.key){const n=t.canonical.z-r.tileID.canonical.z;let o,a,s;i=e.bC();const l=r.tileID.wrap-t.wrap<<t.overscaledZ;n>0?(o=e.al>>n,a=o*((r.tileID.canonical.x<<n)-t.canonical.x+l),s=o*((r.tileID.canonical.y<<n)-t.canonical.y)):(o=e.al<<-n,a=e.al*(r.tileID.canonical.x-(t.canonical.x+l<<-n)),s=e.al*(r.tileID.canonical.y-(t.canonical.y<<-n))),e.ce(i,0,o,0,o,0,1),e.br(i,i,[a,s,0])}return new oo(r.tileID,t.key,i)}_findTileCoveringTileID(t,r){let n=r.getTile(t);if(n&&n.hasData())return n;const i=this._findCoveringTileCache[r.id],o=i[t.key];if(n=o?r.getTileByID(o):null,n&&n.hasData()||null===o)return n;
1let a=n?n.tileID:t,s=a.overscaledZ;const l=r.getSource().minzoom,c=[];if(!o){const i=r.getSource().maxzoom;if(t.canonical.z>=i){const n=t.canonical.z-i;r.getSource().reparseOverscaled?(s=Math.max(t.canonical.z+2,r.transform.tileZoom),a=new e.aQ(s,t.wrap,i,t.canonical.x>>n,t.canonical.y>>n)):0!==n&&(s=i,a=new e.aQ(s,t.wrap,i,t.canonical.x>>n,t.canonical.y>>n))}a.key!==t.key&&(c.push(a.key),n=r.getTile(a))}const u=e=>{c.forEach((t=>{i[t]=e})),c.length=0};for(s-=1;s>=l&&(!n||!n.hasData());s--){n&&u(n.tileID.key);const e=a.calculateScaledKey(s);if(n=r.getTileByID(e),n&&n.hasData())break;const t=i[e];if(null===t)break;void 0===t?c.push(e):n=r.getTileByID(t)}return u(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let r=this._tilesDirty[e];r||(r=this._tilesDirty[e]={}),r[t.key]=!0}}function so(t,r,n){const i=function(t,r,n){const i=e.bJ(r,t),o=e.bJ(n,[.2126,.7152,.0722]),a=(e,t,r)=>(1-r)*e+r*t,s=a(1-.3*Math.min(o,1),1,Math.min(i+1,1));return a(.92,1,Math.asin(e.aA(r[2],-1,1))/Math.PI+.5)*s}(t,[0,0,1],r),o=[0,0,0];e.c5(o,n.slice(0,3),i);const a=[0,0,0];e.c5(a,r.slice(0,3),t[2]);const s=[0,0,0];return e.d8(s,o,a),e.db(s)}const lo=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],co=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","building","buildingBloom","elevatedStructures","model","symbol"];class uo{static cacheKey(e,t,r,n){const i=[t];n&&i.push(n.cacheKey);for(const t of r)e.usedDefines.has(t)&&i.push(t);return i.join("/")}constructor(t,r,n,i,o,a){const s=t.gl;this.program=s.createProgram(),this.configuration=i,this.name=r,this.fixedDefines=[...a];const l=`#version 300 es\n${(i?i.defines():[]).concat(a.map((e=>`#define ${e}`))).join("\n")}`,c=[l,ei];for(const e of n.fragmentIncludes)c.push(Xn[e]);c.push(n.fragmentSource);const u=c.join("\n"),d=[l,ti];for(const e of n.vertexIncludes)d.push(Xn[e]);this.forceManualRenderingForInstanceIDShaders=t.forceManualRenderingForInstanceIDShaders&&n.vertexSource.includes("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&d.push("uniform int u_instanceID;"),d.push(n.vertexSource);let h=d.join("\n");this.forceManualRenderingForInstanceIDShaders&&(h=h.replaceAll("gl_InstanceID","u_instanceID"));const f=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);s.shaderSource(f,u),s.compileShader(f),s.attachShader(this.program,f);const p=s.createShader(s.VERTEX_SHADER);s.isContextLost()?this.failedToCreate=!0:(s.shaderSource(p,h),s.compileShader(p),s.attachShader(this.program,p),this.attributes={},s.linkProgram(this.program),s.deleteShader(p),s.deleteShader(f),this.fixedUniforms=o(t),this.fixedUniformsEntries=Object.entries(this.fixedUniforms),this.binderUniforms=i?i.getUniforms(t):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(t=>({u_instanceID:new e.ch(t)}))(t)),(a.includes("TERRAIN")||r.includes("symbol")||r.includes("circle"))&&(this.terrainUniforms=(t=>({u_dem:new e.ch(t),u_dem_prev:new e.ch(t),u_dem_tl:new e.ck(t),u_dem_scale:new e.cj(t),u_dem_tl_prev:new e.ck(t),u_dem_scale_prev:new e.cj(t),u_dem_size:new e.cj(t),u_dem_lerp:new e.cj(t),u_exaggeration:new e.cj(t),u_depth:new e.ch(t),u_depth_size_inv:new e.ck(t),u_depth_range_unpack:new e.ck(t),u_occluder_half_size:new e.cj(t),u_occlusion_depth_offset:new e.cj(t),u_meter_to_dem:new e.cj(t),u_label_plane_matrix_inv:new e.cl(t)}))(t)),a.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.ci(t),u_tile_tr_up:new e.ci(t),u_tile_br_up:new e.ci(t),u_tile_bl_up:new e.ci(t),u_tile_up_scale:new e.cj(t)}))(t)),a.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.cl(t),u_fog_range:new e.ck(t),u_fog_color:new e.d3(t),u_fog_horizon_blend:new e.cj(t),u_fog_vertical_limit:new e.ck(t),u_fog_temporal_offset:new e.cj(t),u_frustum_tl:new e.ci(t),u_frustum_tr:new e.ci(t),u_frustum_br:new e.ci(t),u_frustum_bl:new e.ci(t),u_globe_pos:new e.ci(t),u_globe_radius:new e.cj(t),u_globe_transition:new e.cj(t),u_is_globe:new e.ch(t),u_viewport:new e.ck(t)}))(t)),a.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(t=>({u_cutoff_params:new e.d3(t)}))(t)),a.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new e.ci(t),u_lighting_directional_dir:new e.ci(t),u_lighting_directional_color:new e.ci(t),u_ground_radiance:new e.ci(t)}))(t)),a.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(t=>({u_light_matrix_0:new e.cl(t),u_light_matrix_1:new e.cl(t),u_fade_range:new e.ck(t),u_shadow_normal_offset:new e.ci(t),u_shadow_intensity:new e.cj(t),u_shadow_texel_size:new e.cj(t),u_shadow_map_resolution:new e.cj(t),u_shadow_direction:new e.ci(t),u_shadow_bias:new e.ci(t),u_shadowmap_0:new e.ch(t),u_shadowmap_1:new e.ch(t)}))(t)))}getAttributeLocation(e,t){let r=this.attributes[t];return void 0===r&&(r=this.attributes[t]=e.getAttribLocation(this.program,t)),r}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const r=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e]&&r[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const r=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e]&&r[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const r=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e].set(this.program,e,t[e])}}setCutoffUniformValues(e,t){if(!this.cutoffUniforms)return;const r=this.cutoffUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e].set(this.program,e,t[e])}}setLightsUniformValues(e,t){if(!this.lightsUniforms)return;const r=this.lightsUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)r[e].set(this.program,e,t[e])}}setShadowUniformValues(e,t){if(this.failedToCreate||!this.shadowUniforms)return;const r=this.shadowUniforms;e.program.set(this.program);for(const e in t)r[e].set(this.program,e,t[e])}_drawDebugWireframe(t,r,n,i,o,a,s,l,c,u){const d=t.options.wireframe;if(!1===d.terrain&&!1===d.layers2D&&!1===d.layers3D)return;const h=t.context;if(!(()=>!(!d.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!d.layers2D||t._terrain&&t._terrain.renderingToTexture||!lo.includes(this.name))||!(!d.layers3D||!co.includes(this.name)))())return;const f=h.gl,p=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,o,h);if(!p)return;
1const g=[...this.fixedDefines,"DEBUG_WIREFRAME"],m=t.getOrCreateProgram(this.name,{config:this.configuration,defines:g});h.program.set(m.program);const y=(e,t,r)=>{if(t[e]&&r[e])for(const n in t[e])r[e][n]&&r[e][n].set(r.program,n,t[e][n].current)};c&&c.setUniforms(m.program,h,m.binderUniforms,s,{zoom:l}),y("fixedUniforms",this,m),y("terrainUniforms",this,m),y("globeUniforms",this,m),y("fogUniforms",this,m),y("lightsUniforms",this,m),y("shadowUniforms",this,m),p.bind(),h.setColorMode(new Wr([f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ZERO,f.ONE],e.ao.transparent,[!0,!0,!0,!1])),h.setDepthMode(new Zr(r.func===f.LESS?f.LEQUAL:r.func,Zr.ReadOnly,r.range)),h.setStencilMode(Xr.disabled);const _=3*a.primitiveLength*2,v=3*a.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const e=u||1;for(let t=0;t<e;++t)m.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",t),f.drawElements(f.LINES,_,f.UNSIGNED_SHORT,v)}else u&&u>1?f.drawElementsInstanced(f.LINES,_,f.UNSIGNED_SHORT,v,u):f.drawElements(f.LINES,_,f.UNSIGNED_SHORT,v);o.bind(),h.program.set(this.program),h.setDepthMode(r),h.setStencilMode(n),h.setColorMode(i)}checkUniforms(e,t,r){if(this.fixedDefines.includes(t))for(const n of Object.keys(r))if(!r[n].initialized)throw new Error(`Program '${this.name}', from draw '${e}': uniform ${n} not set but required by ${t} being defined`)}draw(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g){const m=e.context,y=m.gl;if(this.failedToCreate)return;m.program.set(this.program),m.setDepthMode(r),m.setStencilMode(n),m.setColorMode(i),m.setCullFace(o);for(const[e,t]of this.fixedUniformsEntries)t.set(this.program,e,a[e]);f&&f.setUniforms(this.program,m,this.binderUniforms,d,{zoom:h});const _={[y.POINTS]:1,[y.LINES]:2,[y.TRIANGLES]:3,[y.LINE_STRIP]:1}[t];this.checkUniforms(s,"RENDER_SHADOWS",this.shadowUniforms);const v=p||[],b=f?f.getPaintVertexBuffers():[],x=t===y.TRIANGLES&&c,w=g&&g>0?1:void 0;for(const o of u.get()){const a=o.vaos||(o.vaos={});if((a[s]||(a[s]=new oi)).bind(m,this,l,b,c,o.vertexOffset,v,w),this.forceManualRenderingForInstanceIDShaders){const e=g||1;for(let r=0;r<e;++r)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",r),c?y.drawElements(t,o.primitiveLength*_,y.UNSIGNED_SHORT,o.primitiveOffset*_*2):y.drawArrays(t,o.vertexOffset,o.vertexLength)}else g&&g>1?y.drawElementsInstanced(t,o.primitiveLength*_,y.UNSIGNED_SHORT,o.primitiveOffset*_*2,g):c?y.drawElements(t,o.primitiveLength*_,y.UNSIGNED_SHORT,o.primitiveOffset*_*2):y.drawArrays(t,o.vertexOffset,o.vertexLength);x&&this._drawDebugWireframe(e,r,n,i,c,o,d,h,f,g)}}}function ho(t,r,n=0){const i=Math.pow(2,r.tileID.overscaledZ),o=r.tileSize*Math.pow(2,t.transform.tileZoom)/i,a=o*(r.tileID.canonical.x+r.tileID.wrap*i),s=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/e.ay(r,1,t.transform.tileZoom),u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s],u_pattern_transition:n}}const fo={terrain:0,flat:1},po=e.bC(),go=(t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_)=>{const v=r.style.light,b=v.properties.get("position"),x=[b.x,b.y,b.z],w=e.dO();"viewport"===v.properties.get("anchor")&&(e.dP(w,-r.transform.angle),e.dQ(x,x,w));const S=v.properties.get("color").toPremultipliedRenderColor(null),k=r.transform,T={u_matrix:t,u_lightpos:x,u_lightintensity:v.properties.get("intensity"),u_lightcolor:[S.r,S.g,S.b],u_vertical_gradient:+n,u_opacity:i,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:po,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:fo[u],u_base_type:fo[d],u_ao:o,u_edge_radius:a,u_width_scale:s,u_flood_light_color:g,u_vertical_scale:m,u_flood_light_intensity:y,u_ground_shadow_factor:_};return"globe"===k.projection.name&&(T.u_tile_id=[l.canonical.x,l.canonical.y,1<<l.canonical.z],T.u_zoom_transition=h,T.u_inv_rot_matrix=p,T.u_merc_center=f,T.u_up_dir=k.projection.upVector(new e.cD(0,0,0),f[0]*e.al,f[1]*e.al),T.u_height_lift=c),T},mo=(e,t,r,n,i,o)=>({u_matrix:e,u_edge_radius:t,u_width_scale:r,u_vertical_scale:n,u_height_type:fo[i],u_base_type:fo[o]}),yo=(e,t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y)=>{const _=go(e,t,r,n,i,o,a,s,c,u,d,h,f,p,g,m,1,[0,0,0]),v={u_height_factor:-Math.pow(2,s.overscaledZ
1)/l.tileSize/8};return Object.assign(_,ho(t,l,y),v)},_o=(e,t,r)=>({u_matrix:e,u_emissive_strength:t,u_ground_shadow_factor:r}),vo=(e,t,r,n,i,o=0)=>Object.assign(_o(e,t,i),ho(r,n,o)),bo=(e,t,r,n)=>({u_matrix:e,u_world:r,u_emissive_strength:t,u_ground_shadow_factor:n}),xo=(e,t,r,n,i,o,a=0)=>Object.assign(vo(e,t,r,n,o,a),{u_world:i}),wo=(e,t)=>({u_matrix:e,u_depth_bias:t}),So=(e,t)=>({u_matrix:e,u_ground_shadow_factor:t}),ko=(e,t,r,n,i)=>({u_matrix:e,u_camera_pos:[t[0],t[1],t[2]],u_depth_bias:r,u_height_scale:n,u_reset_depth:i}),To=(e,t,r,n,i,o,a,s,l)=>({u_matrix:e,u_normal_matrix:t,u_opacity:r,u_faux_facade_ao_intensity:n,u_camera_pos:i,u_tile_to_meter:o,u_facade_emissive_chance:a,u_flood_light_color:s,u_flood_light_intensity:l}),Io=e=>({u_matrix:e}),Mo=e=>({u_matrix:e}),Eo=(t,r,n,i,o,a,s,l)=>{const c=e.al/a.tileSize;return{u_matrix:t,u_inv_rot_matrix:r,u_camera_to_center_distance:n.getCameraToCenterDistance(l),u_extrude_scale:[n.pixelsToGLUnits[0]/c,n.pixelsToGLUnits[1]/c],u_zoom_transition:i,u_tile_id:s,u_merc_center:o}},Po=(e,t,r,n)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.getCameraToCenterDistance(n),u_viewport_size:[r.width,r.height]}),Ao=(e,t,r=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}),Co=e.bC(),Ro=(t,r,n,i,o,a,s)=>{const l=t.transform,c="globe"===l.projection.name,u=c?e.dR(l.zoom,r.canonical)*l._pixelsPerMercatorPixel:e.ay(n,1,a),d={u_matrix:r.projMatrix,u_extrude_scale:u,u_intensity:s,u_inv_rot_matrix:Co,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){d.u_inv_rot_matrix=i,d.u_merc_center=o,d.u_tile_id=[r.canonical.x,r.canonical.y,1<<r.canonical.z],d.u_zoom_transition=e.aj(l.zoom);const t=o[0]*e.al,n=o[1]*e.al;d.u_up_dir=l.projection.upVector(new e.cD(0,0,0),t,n)}return d};function Lo(e,[t,r,n,i],[o,a]){if(o===a)return[0,0,0,0];const s=255*(e-1)/(e*(a-o));return[t*s,r*s,n*s,i*s]}function Oo(e,t,[r,n]){return r===n?0:.5/e+(t-r)*(e-1)/(e*(n-r))}const Do=(t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x)=>({u_matrix:t,u_normalize_matrix:r,u_globe_matrix:n,u_merc_matrix:i,u_grid_matrix:o,u_tl_parent:a,u_scale_parent:u,u_fade_t:d.mix,u_opacity:d.opacity*h.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:h.paint.get("raster-brightness-min"),u_brightness_high:h.paint.get("raster-brightness-max"),u_saturation_factor:e.dT(h.paint.get("raster-saturation")),u_contrast_factor:e.dS(h.paint.get("raster-contrast")),u_spin_weights:zo(h.paint.get("raster-hue-rotate")),u_perspective_transform:f,u_raster_elevation:p,u_zoom_transition:s,u_merc_center:l,u_cutoff_params:c,u_colorization_mix:Lo(e.dU,m,_),u_colorization_offset:Oo(e.dU,y,_),u_color_ramp:g,u_texture_offset:[b/(v+2*b),v/(v+2*b)],u_texture_res:[v+2*b,v+2*b],u_emissive_strength:x});function zo(e){e*=Math.PI/180;const t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}const Fo=.05,No=(e,t,r,n,i,o,a,s,l,c,u,d)=>({u_matrix:e,u_normalize_matrix:t,u_globe_matrix:r,u_merc_matrix:n,u_grid_matrix:i,u_tl_parent:o,u_scale_parent:c,u_fade_t:u.mix,u_opacity:u.opacity,u_image0:0,u_image1:1,u_raster_elevation:d,u_zoom_transition:a,u_merc_center:s,u_cutoff_params:l}),Bo=(e,t,r,n,i,o,a,s,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_tile_offset:r,u_velocity:n,u_color_ramp:o,u_velocity_res:i,u_max_speed:a,u_uv_offset:s,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Fo,Fo]}),jo=(e,t,r,n,i,o,a,s,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_velocity:r,u_velocity_res:n,u_max_speed:i,u_speed_factor:o,u_reset_rate:a,u_rand_seed:Math.random(),u_uv_offset:s,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[Fo,Fo]}),Vo=e.bC(),Go=(t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k)=>{const T=o.transform,I={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:T.getCameraToCenterDistance(v),u_rotate_symbol:+n,u_aspect_ratio:T.width/T.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+u,u_elevation_from_sea:c?1:0,u_pitch_with_map:+i,u_texsize:d,u_texsize_icon:h,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Vo,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Vo,u_up_vector:[0,-1,0],u_color_adj_mat:w,u_icon_transition:S||0,u_gamma_scale:i?o.transform.getCameraToCenterDistance(v)*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:e.o.devicePixelRatio,u_is_halo:1,u_scale_factor:k||1,u_ground_shadow_factor:b,u_inv_matrix:e.bl(e.bC(),s),u_normal_scale:x,u_lutTexture:10};return"globe"===v.name&&(I.u_tile_id=[p.canonical.x,p.canonical.y,1<<p.canonical.z],I.u_zoom_transition=g,I.u_inv_rot_matrix=y,I.u_merc_center=m,I.u_camera_forward=T._camera.forward(),I.u_ecef_origin=e.dV(T.globeMatrix,p.toUnwrapped()),I.u_tile_matrix=Float32Array.from(T.globeMatrix),I.u_up_vector=_),I},Uo=(e,t,r,n)=>({u_matrix:e,u_emissive_strength:t,u_opacity:r,u_color:n}),$o=(t,r,n,i,o,a,s,l,c)=>Object.assign(function(t,r,n,i,o,a){const{width:s,height:l}=i.imageManager.getPixelSize(r),c=Math.pow(2,a.tileID.overscaledZ
1),u=a.tileSize*Math.pow(2,i.transform.tileZoom)/c,d=u*(a.tileID.canonical.x+a.tileID.wrap*c),h=u*a.tileID.canonical.y;return{u_image:0,u_pattern_tl:n.tl,u_pattern_br:n.br,u_texsize:[s,l],u_pattern_size:n.displaySize,u_pattern_units_to_pixels:o?[i.transform.width,-1*i.transform.height]:[1/e.ay(a,1,i.transform.tileZoom),1/e.ay(a,1,i.transform.tileZoom)],u_pixel_coord_upper:[d>>16,h>>16],u_pixel_coord_lower:[65535&d,65535&h]}}(0,a,s,i,l,c),{u_matrix:t,u_emissive_strength:r,u_opacity:n}),Ho=new Float32Array(e.bA([])),qo=(t,r,n,i,o,a,s,l,c,u,d,h,f,p=[0,0,0],g,m,y)=>{const _=o.style.light,v=_.properties.get("position"),b=[-v.x,-v.y,v.z],x=e.dO();"viewport"===_.properties.get("anchor")&&(e.dP(x,-o.transform.angle),e.dQ(b,b,x));const w="MASK"===d.alphaMode,S=_.properties.get("color").toNonPremultipliedRenderColor(null),k=f.paint.get("model-ambient-occlusion-intensity"),T=f.paint.get("model-color").constantOr(e.ao.white).toNonPremultipliedRenderColor(null);return T.a=f.paint.get("model-color-mix-intensity").constantOr(0),y&&(T.r=y[0],T.g=y[1],T.b=y[2],T.a=y[3]),m&&(T.r=m.color.r,T.g=m.color.g,T.b=m.color.b,T.a=m.colorMix,h=m.emissionStrength,a*=m.opacity),{u_matrix:t,u_lighting_matrix:r,u_normal_matrix:n,u_node_matrix:i||Ho,u_lightpos:b,u_lightintensity:_.properties.get("intensity"),u_lightcolor:[S.r,S.g,S.b],u_camera_pos:p,u_opacity:a,u_baseTextureIsAlpha:0,u_alphaMask:+w,u_alphaCutoff:d.alphaCutoff,u_baseColorFactor:s.toNonPremultipliedRenderColor(null).toArray01(),u_emissiveFactor:l.toNonPremultipliedRenderColor(null).toArray01(),u_metallicFactor:c,u_roughnessFactor:u,u_baseColorTexture:5,u_metallicRoughnessTexture:6,u_normalTexture:7,u_occlusionTexture:8,u_emissionTexture:9,u_lutTexture:10,u_color_mix:T.toArray01(),u_aoIntensity:k,u_emissive_strength:h,u_occlusionTextureTransform:g||[0,0,0,0]}},Wo=(e,t=Ho,r=Ho)=>({u_matrix:e,u_instance:t,u_node_matrix:r}),Zo={fillExtrusion:t=>({u_matrix:new e.cl(t),u_lightpos:new e.ci(t),u_lightintensity:new e.cj(t),u_lightcolor:new e.ci(t),u_vertical_gradient:new e.cj(t),u_opacity:new e.cj(t),u_edge_radius:new e.cj(t),u_width_scale:new e.cj(t),u_ao:new e.ck(t),u_height_type:new e.ch(t),u_base_type:new e.ch(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_up_dir:new e.ci(t),u_height_lift:new e.cj(t),u_flood_light_color:new e.ci(t),u_vertical_scale:new e.cj(t),u_flood_light_intensity:new e.cj(t),u_ground_shadow_factor:new e.ci(t)}),fillExtrusionDepth:t=>({u_matrix:new e.cl(t),u_edge_radius:new e.cj(t),u_width_scale:new e.cj(t),u_vertical_scale:new e.cj(t),u_height_type:new e.ch(t),u_base_type:new e.ch(t)}),fillExtrusionPattern:t=>({u_matrix:new e.cl(t),u_lightpos:new e.ci(t),u_lightintensity:new e.cj(t),u_lightcolor:new e.ci(t),u_vertical_gradient:new e.cj(t),u_height_factor:new e.cj(t),u_edge_radius:new e.cj(t),u_width_scale:new e.cj(t),u_ao:new e.ck(t),u_height_type:new e.ch(t),u_base_type:new e.ch(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_up_dir:new e.ci(t),u_height_lift:new e.cj(t),u_image:new e.ch(t),u_texsize:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_tile_units_to_pixels:new e.cj(t),u_opacity:new e.cj(t),u_pattern_transition:new e.cj(t)}),fillExtrusionGroundEffect:t=>({u_matrix:new e.cl(t),u_opacity:new e.cj(t),u_ao_pass:new e.cj(t),u_meter_to_tile:new e.cj(t),u_ao:new e.ck(t),u_flood_light_intensity:new e.cj(t),u_flood_light_color:new e.ci(t),u_attenuation:new e.cj(t),u_edge_radius:new e.cj(t),u_fb:new e.ch(t),u_fb_size:new e.cj(t),u_dynamic_offset:new e.cj(t)}),fill:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_ground_shadow_factor:new e.ci(t)}),fillPattern:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_image:new e.ch(t),u_texsize:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_tile_units_to_pixels:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_pattern_transition:new e.cj(t)}),fillOutline:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_world:new e.ck(t),u_ground_shadow_factor:new e.ci(t)}),fillOutlinePattern:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_world:new e.ck(t),u_image:new e.ch(t),u_texsize:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_tile_units_to_pixels:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_pattern_transition:new e.cj(t)}),building:t=>({u_matrix:new e.cl(t),u_normal_matrix:new e.cl(t),u_opacity:new e.cj(t),u_faux_facade_ao_intensity:new e.cj(t),u_camera_pos:new e.ci(t),u_tile_to_meter:new e.cj(t),u_facade_emissive_chance:new e.cj(t),u_flood_light_color:new e.ci(t),u_flood_light_intensity:new e.cj(t)}),buildingBloom:t=>({u_matrix:new e.cl(t)}),buildingDepth:t=>({u_matrix:new e.cl(t)}),elevatedStructuresDepth:t=>({u_matrix:new e.cl(t),u_depth_bias:new e.cj(t)}),elevatedStructures:t=>({u_matrix:new e.cl(t),u_ground_shadow_factor:new e.ci(t)}),elevatedStructuresDepthReconstruct:t=>({u_matrix:new e.cl(t),u_camera_pos:new e.ci(t),u_depth_bias:new e.cj(t),u_height_scale:new e.cj(t),u_reset_depth:new e.cj(t)}),circle:e.dY,collisionBox:t=>({u_matrix:new e.cl(t),u_inv_rot_matrix:new e.cl(t),u_camera_to_center_distance:new e.cj(t),u_extrude_scale:new e.ck(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_tile_id:new e.ci(t)}),collisionCircle:t=>({u_matrix:new e.cl(t),u_inv_matrix:new e.cl(t),u_camera_to_center_distance:new e.cj(t),u_viewport_size:new e.ck(t)}),debug:t=>
vendor: 9,432 bytes, line 1
1({u_color:new e.dB(t),u_matrix:new e.cl(t),u_overlay:new e.ch(t),u_overlay_scale:new e.cj(t)}),clippingMask:t=>({u_matrix:new e.cl(t)}),heatmap:t=>({u_extrude_scale:new e.cj(t),u_intensity:new e.cj(t),u_matrix:new e.cl(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_up_dir:new e.ci(t)}),heatmapTexture:t=>({u_image:new e.ch(t),u_color_ramp:new e.ch(t),u_opacity:new e.cj(t)}),hillshade:t=>({u_matrix:new e.cl(t),u_image:new e.ch(t),u_latrange:new e.ck(t),u_light:new e.ck(t),u_shadow:new e.dB(t),u_highlight:new e.dB(t),u_emissive_strength:new e.cj(t),u_accent:new e.dB(t)}),hillshadePrepare:t=>({u_matrix:new e.cl(t),u_image:new e.ch(t),u_dimension:new e.ck(t),u_zoom:new e.cj(t)}),line:e.dX,linePattern:e.dW,raster:t=>({u_matrix:new e.cl(t),u_normalize_matrix:new e.cl(t),u_globe_matrix:new e.cl(t),u_merc_matrix:new e.cl(t),u_grid_matrix:new e.dC(t),u_tl_parent:new e.ck(t),u_scale_parent:new e.cj(t),u_fade_t:new e.cj(t),u_opacity:new e.cj(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_brightness_low:new e.cj(t),u_brightness_high:new e.cj(t),u_saturation_factor:new e.cj(t),u_contrast_factor:new e.cj(t),u_spin_weights:new e.ci(t),u_perspective_transform:new e.ck(t),u_raster_elevation:new e.cj(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_cutoff_params:new e.d3(t),u_colorization_mix:new e.d3(t),u_colorization_offset:new e.cj(t),u_color_ramp:new e.ch(t),u_texture_offset:new e.ck(t),u_texture_res:new e.ck(t),u_emissive_strength:new e.cj(t)}),rasterParticle:t=>({u_matrix:new e.cl(t),u_normalize_matrix:new e.cl(t),u_globe_matrix:new e.cl(t),u_merc_matrix:new e.cl(t),u_grid_matrix:new e.dC(t),u_tl_parent:new e.ck(t),u_scale_parent:new e.cj(t),u_fade_t:new e.cj(t),u_opacity:new e.cj(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_raster_elevation:new e.cj(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_cutoff_params:new e.d3(t)}),rasterParticleTexture:t=>({u_texture:new e.ch(t),u_opacity:new e.cj(t)}),rasterParticleDraw:t=>({u_particle_texture:new e.ch(t),u_particle_texture_side_len:new e.cj(t),u_tile_offset:new e.ck(t),u_velocity:new e.ch(t),u_color_ramp:new e.ch(t),u_velocity_res:new e.ck(t),u_max_speed:new e.cj(t),u_uv_offset:new e.ck(t),u_data_scale:new e.ck(t),u_data_offset:new e.cj(t),u_particle_pos_scale:new e.cj(t),u_particle_pos_offset:new e.ck(t)}),rasterParticleUpdate:t=>({u_particle_texture:new e.ch(t),u_particle_texture_side_len:new e.cj(t),u_velocity:new e.ch(t),u_velocity_res:new e.ck(t),u_max_speed:new e.cj(t),u_speed_factor:new e.cj(t),u_reset_rate:new e.cj(t),u_rand_seed:new e.cj(t),u_uv_offset:new e.ck(t),u_data_scale:new e.ck(t),u_data_offset:new e.cj(t),u_particle_pos_scale:new e.cj(t),u_particle_pos_offset:new e.ck(t)}),symbol:t=>({u_is_size_zoom_constant:new e.ch(t),u_is_size_feature_constant:new e.ch(t),u_size_t:new e.cj(t),u_size:new e.cj(t),u_camera_to_center_distance:new e.cj(t),u_rotate_symbol:new e.ch(t),u_aspect_ratio:new e.cj(t),u_fade_change:new e.cj(t),u_matrix:new e.cl(t),u_label_plane_matrix:new e.cl(t),u_coord_matrix:new e.cl(t),u_is_text:new e.ch(t),u_elevation_from_sea:new e.ch(t),u_pitch_with_map:new e.ch(t),u_texsize:new e.ck(t),u_texsize_icon:new e.ck(t),u_texture:new e.ch(t),u_texture_icon:new e.ch(t),u_gamma_scale:new e.cj(t),u_device_pixel_ratio:new e.cj(t),u_tile_id:new e.ci(t),u_zoom_transition:new e.cj(t),u_inv_rot_matrix:new e.cl(t),u_merc_center:new e.ck(t),u_camera_forward:new e.ci(t),u_tile_matrix:new e.cl(t),u_up_vector:new e.ci(t),u_ecef_origin:new e.ci(t),u_is_halo:new e.ch(t),u_icon_transition:new e.cj(t),u_color_adj_mat:new e.cl(t),u_scale_factor:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_inv_matrix:new e.cl(t),u_normal_scale:new e.cj(t),u_lutTexture:new e.ch(t)}),background:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_opacity:new e.cj(t),u_color:new e.dB(t)}),backgroundPattern:t=>({u_matrix:new e.cl(t),u_emissive_strength:new e.cj(t),u_opacity:new e.cj(t),u_image:new e.ch(t),u_pattern_tl:new e.ck(t),u_pattern_br:new e.ck(t),u_texsize:new e.ck(t),u_pattern_size:new e.ck(t),u_pixel_coord_upper:new e.ck(t),u_pixel_coord_lower:new e.ck(t),u_pattern_units_to_pixels:new e.ck(t)}),terrainRaster:t=>({u_matrix:new e.cl(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_skirt_height:new e.cj(t),u_ground_shadow_factor:new e.ci(t),u_emissive_texture_available:new e.cj(t)}),skybox:t=>({u_matrix:new e.cl(t),u_sun_direction:new e.ci(t),u_cubemap:new e.ch(t),u_opacity:new e.cj(t),u_temporal_offset:new e.cj(t)}),skyboxGradient:t=>({u_matrix:new e.cl(t),u_color_ramp:new e.ch(t),u_center_direction:new e.ci(t),u_radius:new e.cj(t),u_opacity:new e.cj(t),u_temporal_offset:new e.cj(t)}),skyboxCapture:t=>({u_matrix_3f:new e.dC(t),u_sun_direction:new e.ci(t),u_sun_intensity:new e.cj(t),u_color_tint_r:new e.d3(t),u_color_tint_m:new e.d3(t),u_luminance:new e.cj(t)}),globeRaster:t=>({u_proj_matrix:new e.cl(t),u_globe_matrix:new e.cl(t),u_normalize_matrix:new e.cl(t),u_merc_matrix:new e.cl(t),u_zoom_transition:new e.cj(t),u_merc_center:new e.ck(t),u_image0:new e.ch(t),u_image1:new e.ch(t),u_grid_matrix:new e.dC(t),u_skirt_height:new e.cj(t),u_far_z_cutoff:new e.cj(t),u_frustum_tl:new e.ci(t),u_frustum_tr:new e.ci(t),u_frustum_br:new e.ci(t),u_frustum_bl:new e.ci(t),u_globe_pos:new e.ci(t),u_globe_radius:new e.cj(t),u_viewport:new e.ck(t),u_emissive_texture_available:new e.cj(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.ci(t),u_frustum_tr:new e.ci(t),u_frustum_br:new e.ci(t),u_frustum_bl:new e.ci(t),u_horizon:new e.cj(t),u_transition:new e.cj(t),u_fadeout_range:new e.cj(t),u_atmosphere_fog_color:new e.d3(t),u_high_color:new e.d3(t),u_space_color:new e.d3(t),u_temporal_offset:new e.cj(t),u_horizon_angle:new e.cj(t)}),model:t=>({u_matrix:new e.cl(t),u_lighting_matrix:new e.cl(t),u_normal_matrix:new e.cl(t),u_node_matrix:new e.cl(t),u_lightpos:new e.ci(t),u_lightintensity:new e.cj(t),u_lightcolor:new e.ci(t),u_camera_pos:new e.ci(t),u_opacity:new e.cj(t),u_baseColorFactor:new e.d3(t),u_emissiveFactor:new e.d3(t),u_metallicFactor:new e.cj(t),u_roughnessFactor:new e.cj(t),u_baseTextureIsAlpha:new e.ch(t),u_alphaMask:new e.ch(t),u_alphaCutoff:new e.cj(t),u_baseColorTexture:new e.ch(t),u_metallicRoughnessTexture:new e.ch(t),u_normalTexture:new e.ch(t),u_occlusionTexture:new e.ch(t),u_emissionTexture:new e.ch(t),u_lutTexture:new e.ch(t),u_color_mix:new e.d3(t),u_aoIntensity:new e.cj(t),u_emissive_strength:new e.cj(t),u_occlusionTextureTransform:new e.d3(t)}),modelDepth:t=>({u_matrix:new e.cl(t),u_instance:new e.cl(t),u_node_matrix:new e.cl(t)}),groundShadow:t=>({u_matrix:new e.cl(t),u_ground_shadow_factor:new e.ci(t)}),stars:t=>({u_matrix:new e.cl(t),u_up:new e.ci(t),u_right:new e.ci(t),u_intensity_multiplier:new e.cj(t)}),snowParticle:t=>({u_modelview:new e.cl(t),u_projection:new e.cl(t),u_time:new e.cj(t),u_cam_pos:new e.ci(t),u_velocityConeAperture:new e.cj(t),u_velocity:new e.cj(t),u_horizontalOscillationRadius:new e.cj(t),u_horizontalOscillationRate:new e.cj(t),u_boxSize:new e.cj(t),u_billboardSize:new e.cj(t),u_simpleShapeParameters:new e.ck(t),u_screenSize:new e.ck(t),u_thinningCenterPos:new e.ck(t),u_thinningShape:new e.ci(t),u_thinningAffectedRatio:new e.cj(t),u_thinningParticleOffset:new e.cj(t),u_particleColor:new e.d3(t),u_direction:new e.ci(t)}),rainParticle:t=>({u_modelview:new e.cl(t),u_projection:new e.cl(t),u_time:new e.cj(t),u_cam_pos:new e.ci(t),u_texScreen:new e.ch(t),u_velocityConeAperture:new e.cj(t),u_velocity:new e.cj(t),u_boxSize:new e.cj(t),u_rainDropletSize:new e.ck(t),u_distortionStrength:new e.cj(t),u_rainDirection:new e.ci(t),u_color:new e.d3(t),u_screenSize:new e.ck(t),u_thinningCenterPos:new e.ck(t),u_thinningShape:new e.ci(t),u_thinningAffectedRatio:new e.cj(t),u_thinningParticleOffset:new e.cj(t),u_shapeDirectionalPower:new e.cj(t),u_shapeNormalPower:new e.cj(t),u_mode:new e.cj(t)}),vignette:t=>({u_vignetteShape:new e.ci(t),u_vignetteColor:new e.d3(t)}),occlusion:t=>({u_matrix:new e.cl(t),u_anchorPos:new e.ci(t),u_screenSizePx:new e.ck(t),u_occluderSizePx:new e.ck(t),u_color:new e.d3(t)})};class Yo{constructor(e,t,r,n){this.id=Yo.uniqueIdxCounter,Yo.uniqueIdxCounter++,this.context=e;const i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||n||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){this.id=Yo.uniqueIdxCounter,Yo.uniqueIdxCounter++;const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Yo.uniqueIdxCounter=0;const Xo={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ko{constructor(e,t,r,n,i,o){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.instanceCount=o,this.context=e;const a=e.gl;this.buffer=a.createBuffer(),e.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||i||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}
vendor: 8,241 bytes, line 1
1enableAttributes(e,t){for(let r=0;r<this.attributes.length;r++){const n=t.getAttributeLocation(e,this.attributes[r].name);-1!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,r){for(let n=0;n<this.attributes.length;n++){const i=this.attributes[n],o=t.getAttributeLocation(e,i.name);-1!==o&&e.vertexAttribPointer(o,i.components,e[Xo[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}}setVertexAttribDivisor(e,t,r){for(let n=0;n<this.attributes.length;n++){const i=t.getAttributeLocation(e,this.attributes[n].name);-1!==i&&this.instanceCount&&this.instanceCount>0&&e.vertexAttribDivisor(i,r)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Jo{constructor(e,t,r,n,i){this.context=e,this.width=t,this.height=r;const o=this.framebuffer=e.gl.createFramebuffer();n>0&&(this.colorAttachment0=new Ui(e,o,0)),n>1&&(this.colorAttachment1=new Ui(e,o,1)),i&&(this.depthAttachmentType=i,this.depthAttachment="renderbuffer"===i?new $i(e,o):new Hi(e,o))}createColorAttachment(e,t){0===t?this.colorAttachment0=new Ui(e,this.framebuffer,0):1===t&&(this.colorAttachment1=new Ui(e,this.framebuffer,1))}removeColorAttachment(e,t){const r=this.context.gl;let n;0===t?(n=this.colorAttachment0.get(),this.colorAttachment0=void 0):1===t&&(n=this.colorAttachment1.get(),this.colorAttachment1=void 0),n&&r.deleteTexture(n)}destroy(){const e=this.context.gl;if(this.colorAttachment0){const t=this.colorAttachment0.get();t&&e.deleteTexture(t)}if(this.colorAttachment1){const t=this.colorAttachment1.get();t&&e.deleteTexture(t)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}else{const t=this.depthAttachment.get();t&&e.deleteTexture(t)}e.deleteFramebuffer(this.framebuffer)}}class Qo{constructor(e,t){this.gl=e,this.clearColor=new di(this),this.clearDepth=new hi(this),this.clearStencil=new fi(this),this.colorMask=new pi(this),this.depthMask=new gi(this),this.stencilMask=new mi(this),this.stencilFunc=new yi(this),this.stencilOp=new _i(this),this.stencilTest=new vi(this),this.depthRange=new bi(this),this.depthTest=new xi(this),this.depthFunc=new wi(this),this.blend=new Si(this),this.blendFunc=new ki(this),this.blendColor=new Ti(this),this.blendEquation=new Ii(this),this.cullFace=new Mi(this),this.cullFaceSide=new Ei(this),this.frontFace=new Pi(this),this.program=new Ai(this),this.activeTexture=new Ci(this),this.viewport=new Ri(this),this.bindFramebuffer=new Li(this),this.bindRenderbuffer=new Oi(this),this.bindTexture=new Di(this),this.bindVertexBuffer=new zi(this),this.bindElementBuffer=new Fi(this),this.bindVertexArrayOES=new Ni(this),this.pixelStoreUnpack=new Bi(this),this.pixelStoreUnpackPremultiplyAlpha=new ji(this),this.pixelStoreUnpackFlipY=new Vi(this),this.options=t?Object.assign({},t):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=t&&!!t.forceManualRenderingForInstanceIDShaders||this.renderer&&-1!==this.renderer.indexOf("PowerVR"),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.extBlendFuncExtended=e.getExtension("WEBGL_blend_func_extended")}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t,r){return new Yo(this,e,t,r)}createVertexBuffer(e,t,r,n,i){return new Ko(this,e,t,r,n,i)}createRenderbuffer(e,t,r){const n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,r,n){return new Jo(this,e,t,r,n)}clear({color:e,depth:t,stencil:r,colorMask:n}){const i=this.gl;let o=0;e&&(o|=i.COLOR_BUFFER_BIT,this.clearColor.set(e.toNonPremultipliedRenderColor(null)),this.colorMask.set(n||[!0,!0,!0,!0])),void 0!==t&&(o|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==r&&(o|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),i.clear(o)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.by(t.blendFunction,Wr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let ea;function ta(t,r,n,i,o,a,s){const l=t.context,c=l.gl,u=t.transform,d=[e.aF(u.center.lng),e.aJ(u.center.lat)],h=n.layout.get("symbol-placement"),f=n.layout.get("text-variable-anchor"),p="map"===n.layout.get("icon-rotation-alignment"),g="map"===n.layout.get("text-rotation-alignment"),m="point"!==h,y=[];let _=0,v=0;for(let l=0;l<i.length;l++){const h=i[l],b=r.getTile(h),x=b.getBucket(n);if(!x)continue;const w=x.getProjection().createInversionMatrix(u,h.canonical),S=[],k=Jt(h,x,u),T=!s&&p&&m,I=s&&g&&m,M=f&&x.hasTextData(),E=x.hasIconTextFit()&&M&&x.hasIconData(),P=T||I||s&&M||E,A="globe"===x.projection.name,C=A?e.aj(u.zoom):0;A&&(S.push("PROJECTION_GLOBE_VIEW"),P&&S.push("PROJECTED_POS_ON_VIEWPORT"));const R=t.getOrCreateProgram("collisionBox",{defines:S});let L=k;0===o[0]&&0===o[1]||(L=t.translatePosMatrix(k,b,o,a));const O=s?x.textCollisionBox:x.iconCollisionBox,D=x.collisionCircleArray;
1if(D.length>0){const t=e.bC(),r=L;e.cP(t,x.placementInvProjMatrix,u.glCoordMatrix),e.cP(t,t,x.placementViewportMatrix),y.push({circleArray:D,circleOffset:v,transform:r,invTransform:t,projection:x.getProjection()}),_+=D.length/4,v=_}if(!O)continue;t.terrain&&t.terrain.setupElevationDraw(b,R);const z=A?[h.canonical.x,h.canonical.y,1<<h.canonical.z]:[0,0,0];R.draw(t,c.LINES,Zr.disabled,Xr.disabled,t.colorModeForRenderPass(),Qr.disabled,Eo(L,w,u,C,d,b,z,x.getProjection()),n.id,O.layoutVertexBuffer,O.indexBuffer,O.segments,null,u.zoom,null,[O.collisionVertexBuffer,O.collisionVertexBufferExt])}if(!s||!y.length)return;const b=t.getOrCreateProgram("collisionCircle"),x=new e.dZ;x.resize(4*_),x._trim();let w=0;for(const e of y)for(let t=0;t<e.circleArray.length/4;t++){const r=4*t,n=e.circleArray[r+0],i=e.circleArray[r+1],o=e.circleArray[r+2],a=e.circleArray[r+3];x.emplace(w++,n,i,o,a,0),x.emplace(w++,n,i,o,a,1),x.emplace(w++,n,i,o,a,2),x.emplace(w++,n,i,o,a,3)}(!ea||ea.length<2*_)&&(ea=function(t){const r=2*t,n=new e.b0;n.resize(r),n._trim();for(let e=0;e<r;e++){const t=6*e;n.uint16[t+0]=4*e+0,n.uint16[t+1]=4*e+1,n.uint16[t+2]=4*e+2,n.uint16[t+3]=4*e+2,n.uint16[t+4]=4*e+3,n.uint16[t+5]=4*e+0}return n}(_));const S=l.createIndexBuffer(ea,!0),k=l.createVertexBuffer(x,e.d_.members,!0);for(const r of y){const i=Po(r.transform,r.invTransform,u,r.projection);b.draw(t,c.TRIANGLES,Zr.disabled,Xr.disabled,t.colorModeForRenderPass(),Qr.disabled,i,n.id,k,S,e.bg.simpleSegment(0,2*r.circleOffset,r.circleArray.length,r.circleArray.length/2),null,u.zoom)}k.destroy(),S.destroy()}const ra=e.bC();function na(t){const r=t._camera.getWorldToCamera(t.worldSize,1),n=e.aB([],r,t.globeMatrix);e.bl(n,n);const i=[0,0,0],o=[0,1,0,0];return e.aC(o,o,n),i[0]=o[0],i[1]=o[1],i[2]=o[2],e.aw(i,i),i}function ia({width:t,height:r,anchor:n,textOffset:i,textScale:o},a){const{horizontalAlign:s,verticalAlign:l}=e.c1(n),c=-(s-.5)*t,u=-(l-.5)*r,d=e.c2(n,i);return new e.P((c/o+d[0])*a,(u/o+d[1])*a)}function oa(t,r,n,i,o,a,s,l,c,u){const d=t.text.placedSymbolArray,h=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,p={},g=t.getProjection(),m=Qt(s,g,o),y=o.elevation,_=g.upVectorScale(s.canonical,o.center.lat,o.worldSize).metersToTile;h.clear();for(let f=0;f<d.length;f++){const v=d.get(f),{tileAnchorX:b,tileAnchorY:x,numGlyphs:w}=v,S=v.hidden||!v.crossTileID||t.allowVerticalPlacement&&!v.placedOrientation?null:i[v.crossTileID];if(S){let i=0,d=0,k=0;const T="road"===t.elevationType;if(y||T){const r=T?t.getElevationFeatureForText(f):null,n=e.bV.getAtTileOffset(s,new e.P(b,x),y,r),[o,a,l]=g.upVector(s.canonical,b,x);i=n*o*_,d=n*a*_,k=n*l*_}let[I,M,E,P]=ar(v.projectedAnchorX+i,v.projectedAnchorY+d,v.projectedAnchorZ+k,n?m:a);const A=sr(o.getCameraToCenterDistance(g),P);let C=e.bM(t.textSizeData,c,v)*A/e.bY;n&&(C*=t.tilePixelRatio/l);const R=ia(S,C);n?(({x:I,y:M,z:E}=g.projectTilePoint(b+R.x,x+R.y,s.canonical)),[I,M,E]=ar(I+i,M+d,E+k,a)):(r&&R._rotate(-o.angle),I+=R.x,M+=R.y,E=0);const L=t.allowVerticalPlacement&&v.placedOrientation===e.bL.vertical?Math.PI/2:0;for(let t=0;t<w;t++)e.bO(h,I,M,E,L);u&&v.associatedIconIndex>=0&&(p[v.associatedIconIndex]={x:I,y:M,z:E,angle:L})}else mr(w,h)}if(u){f.clear();const r=t.icon.placedSymbolArray;for(let t=0;t<r.length;t++){const n=r.get(t),{numGlyphs:i}=n,o=p[t];if(n.hidden||!o)mr(i,f);else{const{x:t,y:r,z:n,angle:a}=o;for(let o=0;o<i;o++)e.bO(f,t,r,n,a)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(h)}function aa(t,r,n,i,o,a,s={}){const l=n.paint.get("icon-translate"),c=n.paint.get("text-translate"),u=n.paint.get("icon-translate-anchor"),d=n.paint.get("text-translate-anchor"),h=n.layout.get("icon-rotation-alignment"),f=n.layout.get("text-rotation-alignment"),p=n.layout.get("icon-pitch-alignment"),g=n.layout.get("text-pitch-alignment"),m=n.layout.get("icon-keep-upright"),y=n.layout.get("text-keep-upright"),_=n.paint.get("icon-color-saturation"),v=n.paint.get("icon-color-contrast"),b=n.paint.get("icon-color-brightness-min"),x=n.paint.get("icon-color-brightness-max"),w="sea"===n.layout.get("symbol-elevation-reference"),S="none"===n.layout.get("icon-image-use-theme"),k=t.context,T=k.gl,I=t.transform,M="map"===h,E="map"===f,P="map"===p,A="map"===g,C=void 0!==n.layout.get("symbol-sort-key").constantOr(1);let R=!1;const L=t.depthModeForSublayer(0,Zr.ReadOnly),O=new Zr(t.context.gl.LEQUAL,Zr.ReadOnly,t.depthRangeFor3D),D=[e.aF(I.center.lng),e.aJ(I.center.lat)],z=n.layout.get("text-variable-anchor"),F="globe"===I.projection.name,N=[],B=[0,-1,0];for(const o of i){const i=r.getTile(o),a=i.getBucket(n);if(!a)continue;if("mercator"===a.projection.name&&F)continue;if(a.fullyClipped)continue;const h="globe"===a.projection.name,f=h?e.aj(I.zoom):0,p=Qt(o,a.getProjection(),I),g=I.calculatePixelsToTileUnitsMatrix(i),j=z&&a.hasTextData(),V=a.hasIconTextFit()&&j&&a.hasIconData(),G=a.getProjection().createInversionMatrix(I,o.canonical),U=(1<<i.tileID.canonical.z)*e.al/t.transform.worldSize,$=e=>
vendor: 4,561 bytes, line 1
1{let r=[0,0,0];if(e){const e=t.style.directionalLight,n=t.style.ambientLight;e&&n&&(r=yn(t.style,e,n))}return r},H=e=>{I.depthOcclusionForSymbolsAndCircles&&(n.hasOcclusionOpacityProperties||t.terrain)&&(e.push("DEPTH_D24"),e.push("DEPTH_OCCLUSION"))},q=r=>{n.lut&&!S&&(n.lut.texture||(n.lut.texture=new e.d$(t.context,n.lut.image,[n.lut.image.height,n.lut.image.height,n.lut.image.height],k.gl.RGBA8)),k.activeTexture.set(k.gl.TEXTURE0+10),n.lut.texture&&n.lut.texture.bind(k.gl.LINEAR,k.gl.CLAMP_TO_EDGE),r.push("APPLY_LUT_ON_GPU"))},W=()=>{const r=M&&"point"!==n.layout.get("symbol-placement"),s=[];H(s),q(s);const c=r||V,d="road"===a.elevationType,y=t.shadowRenderer,S=d&&P&&!!y&&y.enabled,k=$(S),E=d&&P&&!t.terrain?O:L,A=n.paint.get("icon-image-cross-fade");t.terrainRenderModeElevated()&&P&&s.push("PITCH_WITH_MAP_TERRAIN"),h&&(s.push("PROJECTION_GLOBE_VIEW"),c&&s.push("PROJECTED_POS_ON_VIEWPORT")),A>0&&a.hasAnySecondaryIcon&&s.push("ICON_TRANSITION"),!a.icon.zOffsetVertexBuffer||d&&t.terrain||s.push("Z_OFFSET"),0===_&&0===v&&0===b&&1===x||s.push("COLOR_ADJUSTMENT"),a.sdfIcons&&s.push("RENDER_SDF"),S&&s.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),d&&P&&!t.terrain&&a.icon.orientationVertexBuffer&&s.push("ELEVATED_ROADS");const C=a.icon.programConfigurations.get(n.id),R=t.getOrCreateProgram("symbol",{config:C,defines:s}),z=i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],N=a.iconSizeData,j=e.bK(N,I.zoom),W=P||!I.isOrthographic,Z=nr(p,i.tileID.canonical,P,M,I,a.getProjection(),g),Y=or(p,i.tileID.canonical,P,M,I,a.getProjection(),g),X=t.translatePosMatrix(Y,i,l,u,!0),K=t.translatePosMatrix(p,i,l,u),J=c?ra:Z,Q=M&&!P&&!r;let ee=B;!F&&!I.mercatorFromTransition||M||(ee=na(I));const te=h?ee:B,re=n.getColorAdjustmentMatrix(_,v,b,x),ne=Go(N.kind,j,Q,P,t,K,J,X,w,!1,z,[0,0],0,o,f,D,G,te,a.getProjection(),k,U,re,A,null),ie=i.imageAtlasTexture?i.imageAtlasTexture:null,oe=1!==n.layout.get("icon-size").constantOr(0)||a.iconsNeedLinear,ae=a.sdfIcons||t.options.rotating||t.options.zooming||oe||W?T.LINEAR:T.NEAREST,se=a.sdfIcons&&0!==n.paint.get("icon-halo-width").constantOr(1),le=t.terrain&&P&&r?e.bl(e.bC(),Z):ra;if(r&&a.icon){const r=e.bV.getAtTileOffsetFunc(o,I.center.lat,I.worldSize,a.getProjection()),s=ir(p,i.tileID.canonical,P,M,I,a.getProjection(),g),l=n.layout.get("icon-size-scale-range"),c=e.aA(t.scaleFactor,l[0],l[1]);cr(a,p,t,!1,s,Y,P,m,r,o,c)}return{program:R,buffers:a.icon,uniformValues:ne,atlasTexture:ie,atlasTextureIcon:null,atlasInterpolation:ae,atlasInterpolationIcon:null,isSDF:a.sdfIcons,hasHalo:se,depthMode:E,tile:i,renderWithShadows:S,labelPlaneMatrixInv:le}},Z=()=>{const r=E&&"point"!==n.layout.get("symbol-placement"),s=[],l=r||z||V,u="road"===a.elevationType,m=t.shadowRenderer,_=u&&A&&!!m&&m.enabled,v=$(_),b=u&&A&&!t.terrain?O:L;t.terrainRenderModeElevated()&&A&&s.push("PITCH_WITH_MAP_TERRAIN"),h&&(s.push("PROJECTION_GLOBE_VIEW"),l&&s.push("PROJECTED_POS_ON_VIEWPORT")),!a.text.zOffsetVertexBuffer||u&&t.terrain||s.push("Z_OFFSET"),a.iconsInText&&s.push("RENDER_TEXT_AND_SYMBOL"),s.push("RENDER_SDF"),_&&s.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),u&&A&&!t.terrain&&a.text.orientationVertexBuffer&&s.push("ELEVATED_ROADS"),H(s);const x=a.text.programConfigurations.get(n.id),S=t.getOrCreateProgram("symbol",{config:x,defines:s});let k,M=[0,0],P=null;const C=a.textSizeData;a.iconsInText&&(M=i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],P=i.imageAtlasTexture?i.imageAtlasTexture:null,k=A||!I.isOrthographic||t.options.rotating||t.options.zooming||"composite"===C.kind||"camera"===C.kind?T.LINEAR:T.NEAREST);const R=i.glyphAtlasTexture?i.glyphAtlasTexture.size:[0,0],N=n.layout.get("text-size-scale-range"),j=e.aA(t.scaleFactor,N[0],N[1]),q=e.bK(C,I.zoom,j),W=nr(p,i.tileID.canonical,A,E,I,a.getProjection(),g),Z=or(p,i.tileID.canonical,A,E,I,a.getProjection(),g),Y=t.translatePosMatrix(Z,i,c,d,!0),X=t.translatePosMatrix(p,i,c,d),K=l?ra:W,J=E&&!A&&!r;let Q=B;!F&&!I.mercatorFromTransition||E||(Q=na(I));const ee=Go(C.kind,q,J,A,t,X,K,Y,w,!0,R,M,0,o,f,D,G,h?Q:B,a.getProjection(),v,U,null,null,j),te=i.glyphAtlasTexture?i.glyphAtlasTexture:null,re=T.LINEAR,ne=0!==n.paint.get("text-halo-width").constantOr(1),ie=t.terrain&&A&&r?e.bl(e.bC(),W):ra;if(r&&a.text){const r=e.bV.getAtTileOffsetFunc(o,I.center.lat,I.worldSize,a.getProjection()),n=ir(p,i.tileID.canonical,A,E,I,a.getProjection(),g);cr(a,p,t,!0,n,Z,A,y,r,o,j)}return{program:S,buffers:a.text,uniformValues:ee,atlasTexture:te,atlasTextureIcon:P,atlasInterpolation:re,atlasInterpolationIcon:k,isSDF:!0,hasHalo:ne,depthMode:b,t
1ile:i,renderWithShadows:_,labelPlaneMatrixInv:ie}},Y=a.icon.segments.get().length,X=a.text.segments.get().length,K=Y&&!s.onlyText?W():null,J=X&&!s.onlyIcons?Z():null,Q=n.paint.get("icon-opacity").constantOr(1),ee=n.paint.get("text-opacity").constantOr(1);if(C&&a.canOverlap){R=!0;const t=Q&&!s.onlyText?a.icon.segments.get():[],r=ee&&!s.onlyIcons?a.text.segments.get():[];for(const r of t)N.push({segments:new e.bg([r]),sortKey:r.sortKey,state:K});for(const t of r)N.push({segments:new e.bg([t]),sortKey:t.sortKey,state:J})}else s.onlyText||N.push({segments:Q?a.icon.segments:new e.bg([]),sortKey:0,state:K}),s.onlyIcons||N.push({segments:ee?a.text.segments:new e.bg([]),sortKey:0,state:J})}R&&N.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of N){const r=e.state;if(r)if(t.terrain?t.terrain.setupElevationDraw(r.tile,r.program,{useDepthForOcclusion:I.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:r.labelPlaneMatrixInv}):t.setupDepthForOcclusion(I.depthOcclusionForSymbolsAndCircles,r.program),k.activeTexture.set(T.TEXTURE0),r.atlasTexture&&r.atlasTexture.bind(r.atlasInterpolation,T.CLAMP_TO_EDGE,!0),r.atlasTextureIcon&&(k.activeTexture.set(T.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,T.CLAMP_TO_EDGE,!0)),r.renderWithShadows&&t.shadowRenderer.setupShadows(r.tile.tileID.toUnwrapped(),r.program,"vector-tile"),t.uploadCommonLightUniforms(t.context,r.program),r.hasHalo){const i=r.uniformValues;i.u_is_halo=1,sa(r.buffers,e.segments,n,t,r.program,r.depthMode,o,a,i,2),i.u_is_halo=0}else{if(r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,sa(r.buffers,e.segments,n,t,r.program,r.depthMode,o,a,i,1)),i.u_is_halo=0}sa(r.buffers,e.segments,n,t,r.program,r.depthMode,o,a,r.uniformValues,1)}}}function sa(e,t,r,n,i,o,a,s,l,c){const u=[e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer,e.iconTransitioningVertexBuffer,e.globeExtVertexBuffer,e.zOffsetVertexBuffer,e.orientationVertexBuffer];i.draw(n,n.context.gl.TRIANGLES,o,a,s,Qr.disabled,l,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),u,c)}function la(t,r){const n=1<<t.canonical.z,i=(r.x*n-t.canonical.x-t.wrap*n)*e.al,o=(r.y*n-t.canonical.y)*e.al,a=e.e8(r.z,r.y);return e.d5(i,o,a)}function ca(t,r,n,i,o){if(!n.layout||"none"===n.layout.get("fill-elevation-reference")||0===n.paint.get("fill-opacity").constantOr(1))return;const a=t.context.gl,s=new Zr(t.context.gl.LEQUAL,Zr.ReadWrite,t.depthRangeFor3D),l=new Zr(t.context.gl.GREATER,Zr.ReadWrite,t.depthRangeFor3D),c=function(t){let r=.01;return t.isOrthographic&&(r=e.ak(1e-4,r,e.d0(t.pitch>=ln?1:t.pitch/ln))),2*r}(t.transform),u=t.transform.getFreeCameraOptions().position,d="elevatedStructuresDepthReconstruct",h=t.getOrCreateProgram(d,{defines:["DEPTH_RECONSTRUCTION"]}),f=t.getOrCreateProgram(d);for(const e of i){const i=r.getTile(e),d=i.getBucket(n);if(!d)continue;const p=d.elevatedStructures;if(!p)continue;const g=d.elevationBufferData.heightRange,m=la(e.toUnwrapped(),u),y=t.translatePosMatrix(e.projMatrix,i,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));let _,v,b,x;if("initialize"===o){if(!g||g.min>=1||0===p.depthSegments.segments[0].primitiveLength)continue;_=ko(y,m,c,1,0),v=s,b=p.depthSegments,x=h}else if("reset"===o){if(!g||g.min>=0||0===p.maskSegments.segments[0].primitiveLength)continue;_=ko(y,m,0,0,1),v=l,b=p.maskSegments,x=h}else if("geometry"===o){if(0===p.depthSegments.segments[0].primitiveLength)continue;_=ko(y,m,c,1,0),v=s,b=p.depthSegments,x=f}x.draw(t,a.TRIANGLES,v,Xr.disabled,Wr.disabled,Qr.disabled,_,n.id,p.vertexBuffer,p.indexBuffer,b,n.paint,t.transform.zoom)}}function ua(t,r,n,i){const{painter:o,sourceCache:a,layer:s,coords:l,colorMode:c,elevationType:u,terrainEnabled:d,pass:h}=t,f=o.context.gl,p=s.paint.get("fill-pattern"),g=s.paint.get("fill-pattern-cross-fade"),m=p.constantOr(null);let y=u;"road"!==u||r&&!d||(y="none");const _="road"===y,v=t.painter.shadowRenderer,b=_&&!!v&&v.enabled,x=new Zr(o.context.gl.LEQUAL,Zr.ReadOnly,o.depthRangeFor3D);let w=[0,0,0];if(b){const e=o.style.directionalLight,t=o.style.ambientLight;e&&t&&(w=yn(o.style,e,t))}const S=p&&p.constantOr(1),k=o.terrain&&o.terrain.renderingToTexture,T=(t,h)=>{let p,y,T,I,M;h?(p=S&&!s.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",T=f.LINES):(p=S?"fillPattern":"fill",T=f.TRIANGLES);for(const E of l){const l=a.getTile(E);if(S&&!l.patternsLoaded())continue;const P=l.getBucket(s);if(!P)continue;const A=r?P.elevationBufferData:P.bufferData;if(A.isEmpty())continue;o.prepareDrawTile();const C=A.programConfigurations.get(s.id),R=o.isTileAffectedByFog(E),L=[],O=[];_&&(L.push("ELEVATED_ROADS"),O.push(A.elevatedLayoutVertexBuffer)),b&&L.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"),k&&n&&L.push("USE_MRT1"),S&&(o.context.activeTexture.set(f.TEXTURE0),l.imageAtlasTexture&&l.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),C.updatePaintBuffers());let D=!1;if(m&&l.imageAtlas){const t=l.imageAtlas,r=e.e3.from(m),n=r.getPrimary().scaleSelf(e.o.devicePixelRatio).toString(),i=r.getSecondary(),o=t.patternPositions.get(n),a=i?t.patternPositions.get(i.scaleSelf(e.o.devicePixelRatio).toString()):null;
vendor: 6,140 bytes, line 1
1D=!!o&&!!a,o&&C.setConstantPatternPositions(o,a)}g>0&&(D||C.getPatternTransitionVertexBuffer("fill-pattern"))&&L.push("FILL_PATTERN_TRANSITION");const z=o.getOrCreateProgram(p,{config:C,overrideFog:R,defines:L}),F=o.translatePosMatrix(E.projMatrix,l,s.paint.get("fill-translate"),s.paint.get("fill-translate-anchor"));b&&v.setupShadows(l.tileID.toUnwrapped(),z,"vector-tile");const N=s.paint.get("fill-emissive-strength");if(h){I=A.lineIndexBuffer,M=A.lineSegments;const e=o.terrain&&o.terrain.renderingToTexture?o.terrain.drapeBufferSize:[f.drawingBufferWidth,f.drawingBufferHeight];y="fillOutlinePattern"===p&&S?xo(F,N,o,l,e,w,g):bo(F,N,e,w)}else I=A.indexBuffer,M=A.triangleSegments,y=S?vo(F,N,o,l,w,g):_o(F,N,w);o.uploadCommonUniforms(o.context,z,E.toUnwrapped());let B=t;("road"===u&&!d||"offset"===u)&&(B=x),z.draw(o,T,B,i||o.stencilModeForClipping(E),c,Qr.disabled,y,s.id,A.layoutVertexBuffer,I,M,s.paint,o.transform.zoom,C,O)}};o.renderPass===h&&T(o.depthModeForSublayer(1,"opaque"===o.renderPass?Zr.ReadWrite:Zr.ReadOnly),!1),"none"===y&&"translucent"===o.renderPass&&s.paint.get("fill-antialias")&&T(o.depthModeForSublayer(s.getPaintProperty("fill-outline-color")?2:0,Zr.ReadOnly),!0)}function da(t,r,n,i,o,a,s,l){n.resetLayerRenderingStats(t);const c=t.context,u=c.gl,d=t.transform,h=n.paint.get("fill-extrusion-pattern"),f=n.paint.get("fill-extrusion-pattern-cross-fade"),p=h.constantOr(null),g=h.constantOr(1),m=n.paint.get("fill-extrusion-opacity"),y=t.style.enable3dLights(),_=n.paint.get(y&&!g?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),v=[n.paint.get("fill-extrusion-ambient-occlusion-intensity"),_],b=n.layout.get("fill-extrusion-edge-radius"),x=b>0&&!n.paint.get("fill-extrusion-rounded-roof"),w=x?0:b,S="globe"===d.projection.name?e.eb():0,k="globe"===d.projection.name,T=k?e.aj(d.zoom):0,I=[e.aF(d.center.lng),e.aJ(d.center.lat)],M="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),E=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(M?null:n.lut).toArray01().slice(0,3),P=n.paint.get("fill-extrusion-flood-light-intensity"),A=n.paint.get("fill-extrusion-vertical-scale"),C=0!==n.paint.get("fill-extrusion-line-width").constantOr(1),R=n.paint.get("fill-extrusion-height-alignment"),L=n.paint.get("fill-extrusion-base-alignment"),O=un(t,n.paint.get("fill-extrusion-cutoff-fade-range")),D=[];let z;k&&D.push("PROJECTION_GLOBE_VIEW"),v[0]>0&&D.push("FAUX_AO"),x&&D.push("ZERO_ROOF_RADIUS"),l&&D.push("HAS_CENTROID"),P>0&&D.push("FLOOD_LIGHT"),O.shouldRenderCutoff&&D.push("RENDER_CUTOFF"),C&&D.push("RENDER_WALL_MODE");const F="shadow"===t.renderPass,N=t.shadowRenderer,B=F&&!!N,j=F?Qr.disabled:Qr.backCCW;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let V=[0,0,0];if(N){const e=t.style.directionalLight,r=t.style.ambientLight;e&&r&&(V=yn(t.style,e,r)),F||(D.push("RENDER_SHADOWS","DEPTH_TEXTURE"),N.useNormalOffset&&D.push("NORMAL_OFFSET")),z=D.concat(["SHADOWS_SINGLE_CASCADE"])}const G=B?"fillExtrusionDepth":g?"fillExtrusionPattern":"fillExtrusion",U=n.getLayerRenderingStats();for(const h of i){const i=r.getTile(h),y=i.getBucket(n);if(!y||y.projection.name!==d.projection.name)continue;let _=!1;N&&(_=0===N.getMaxCascadeForTile(h.toUnwrapped()));const b=t.isTileAffectedByFog(h),x=y.programConfigurations.get(n.id);let M=!1;if(p&&i.imageAtlas){const t=i.imageAtlas,r=e.e3.from(p),n=r.getPrimary().scaleSelf(e.o.devicePixelRatio).toString(),o=r.getSecondary(),a=t.patternPositions.get(n),s=o?t.patternPositions.get(o.scaleSelf(e.o.devicePixelRatio).toString()):null;M=!!a&&!!s,a&&x.setConstantPatternPositions(a,s)}f>0&&(M||x.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&D.push("FILL_EXTRUSION_PATTERN_TRANSITION");const B=t.getOrCreateProgram(G,{config:x,defines:_?z:D,overrideFog:b});if(t.terrain&&t.terrain.setupElevationDraw(i,B,{useMeterToDem:!0}),!y.centroidVertexBuffer){const e=B.getAttributeLocation(u,"a_centroid_pos");-1!==e&&u.vertexAttrib2f(e,0,0)}!F&&N&&N.setupShadows(i.tileID.toUnwrapped(),B,"vector-tile"),g&&(t.context.activeTexture.set(u.TEXTURE0),i.imageAtlasTexture&&i.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),x.updatePaintBuffers());const $=n.paint.get("fill-extrusion-vertical-gradient"),H=1/y.tileToMeter;let q;if(F&&N){if(_a(i.tileID,y.maxHeight,t))continue;const e=N.calculateShadowPassMatrixFromTile(i.tileID.toUnwrapped());q=mo(e,w,H,A,R,L)}else{const e=t.translatePosMatrix(h.expandedProjMatrix,i,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),r=d.projection.createInversionMatrix(d,h.canonical);q=g?yo(e,t,$,m,v,w,H,h,i,S,R,L,T,I,r,E,A,f):go(e,t,$,m,v,w,H,h,S,R,L,T,I,r,E,A,P,V)}t.uploadCommonUniforms(c,B,h.toUnwrapped(),null,O);let W=y.segments;if("mercator"===d.projection.name&&!F&&(W=y.getVisibleSegments(i.tileID,t.terrain,t.transform.getFrustum(0)),!W.get().length))continue;if(U)if(F)for(const e of W.get())U.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(const e of W.get())U.numRenderedVerticesInTransparentPass+=e.primitiveLength;const Z=[];(t.terrain||l)&&Z.push(y.centroidVertexBuffer),k&&Z.push(y.layoutVertexExtBuffer),C&&Z.push(y.wallVertexBuffer),B.draw(t,c.gl.TRIANGLES,o,a,s,j,q,n.id,y.layoutVertexBuffer,y.indexBuffer,W,n.paint,t.transform.zoom,x,Z)}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1)}class ha{constructor(){this.translate=[0,0],this.translateAnchor="map",this.edgeRadius=0,this.cutoffFadeRange=0}}function fa(t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b){const x=r.context,w=x.gl,S=r.transform,k=r.transform.zoom,T=[],I=t.translate,M=t.translateAnchor,E=t.edgeRadius,P=un(r,t.cutoffFadeRange);"clear"===d?(T.push("CLEAR_SUBPASS"),b&&(T.push("CLEAR_FROM_TEXTURE"),x.activeTexture.set(w.TEXTURE0),b.bind(w.LINEAR,w.CLAMP_TO_EDGE))):"sdf"===d?T.push("SDF_SUBPASS"):"emissive"===d&&(T.push("USE_MRT1"),x.activeTexture.set(w.TEXTURE0),b.bind(w.LINEAR,w.CLAMP_TO_EDGE)),_&&T.push("HAS_CENTROID"),P.shouldRenderCutoff&&T.push("RENDER_CUTOFF");const A=(e,t,n,o,d)=>{let v=T;null!=t.groundRadiusBuffer&&(v=T.concat("HAS_ATTRIBUTE_a_flood_light_ground_radiu
1s"));const w=t.programConfigurations.get(i.id),S=r.isTileAffectedByFog(e),I=r.getOrCreateProgram("fillExtrusionGroundEffect",{config:w,defines:v,overrideFog:S}),M=((e,t,r,n,i,o,a,s,l,c,u)=>({u_matrix:t,u_opacity:r,u_ao_pass:n?1:0,u_meter_to_tile:i,u_ao:o,u_flood_light_intensity:a,u_flood_light_color:s,u_attenuation:l,u_edge_radius:c,u_fb:0,u_fb_size:u,u_dynamic_offset:1}))(0,o,h,u,d,[f,p*d],g,m,y,k>=17?0:E*d,b?b.size[0]:0),A=[];_&&A.push(t.hiddenByLandmarkVertexBuffer),null!=t.groundRadiusBuffer&&A.push(t.groundRadiusBuffer),r.uploadCommonUniforms(x,I,e.toUnwrapped(),null,P),I.draw(r,x.gl.TRIANGLES,a,s,l,c,M,i.id,t.vertexBuffer,t.indexBuffer,n,i.paint,k,w,A)};for(const t of o){const o=n.getTile(t),a=o.getBucket(i);if(!a||a.projection.name!==S.projection.name||!a.groundEffect||a.groundEffect&&!a.groundEffect.hasData())continue;const s=a.groundEffect,l=1/a.tileToMeter;{const e=r.translatePosMatrix(t.projMatrix,o,I,M),n=s.getDefaultSegment();A(t,s,n,e,l)}if(v)for(let a=0;a<4;a++){const s=e.e9[a](t),c=n.getTile(s);if(!c)continue;const u=c.getBucket(i);if(!u||u.projection.name!==S.projection.name||!u.groundEffect||u.groundEffect&&!u.groundEffect.hasData())continue;const d=u.groundEffect;let h,f;0===a?(h=[-e.al,0,0],f=1):1===a?(h=[e.al,0,0],f=0):2===a?(h=[0,-e.al,0],f=3):(h=[0,e.al,0],f=2);const p=d.regionSegments[f];if(!p)continue;const g=new Float32Array(16);e.br(g,t.projMatrix,h),A(t,d,p,r.translatePosMatrix(g,o,I,M),l)}}}function pa(t,r,n,i,o,a,s){0===i.centroidVertexArray.length&&i.createCentroidsBuffer();const l=a?a.findDEMTileFor(n):null;if(!(l&&l.dem||s))return;a&&l&&l.dem&&i.selfDEMTileTimestamp!==l.dem._timestamp&&(i.borderDoneWithNeighborZ=[-1,-1,-1,-1],i.selfDEMTileTimestamp=l.dem._timestamp);const c=(t,r)=>{(t.flags|r.flags)&e.ec?(t.flags|=e.ec,r.flags|=e.ec):(t.flags&=~e.ec,r.flags&=~e.ec)},u=t=>new e.P(Math.ceil((t+e.ed)*e.ee),0),d=e=>{const t=r.getSource().minzoom,n=e=>{const t=r.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},i=[0,-1,1];for(const r of i){if(e.overscaledZ+r<t)continue;const i=n(e.calculateScaledKey(e.overscaledZ+r));if(i)return i}},h=[0,0,0],f=(t,r)=>(h[0]=Math.min(t.min.y,r.min.y),h[1]=Math.max(t.max.y,r.max.y),h[2]=e.al-r.min.x>t.max.x?r.min.x-e.al:t.max.x,h),p=(t,r)=>(h[0]=Math.min(t.min.x,r.min.x),h[1]=Math.max(t.max.x,r.max.x),h[2]=e.al-r.min.y>t.max.y?r.min.y-e.al:t.max.y,h),g=[(e,t)=>f(e,t),(e,t)=>f(t,e),(e,t)=>p(e,t),(e,t)=>p(t,e)],m=(t,r,i,o,s,c,u)=>{if(!a)return 0;const d=[[c?i:t,c?t:i,0],[c?i:r,c?r:i,0]],h=u<0?e.al+u:u,f=[c?h:(t+r)/2,c?(t+r)/2:h,0];return 0===i&&u<0||0!==i&&u>0?a.getForTilePoints(s,[f],!0,o):d.push(f),a.getForTilePoints(n,d,!0,l),Math.max(d[0][2],d[1][2],f[2])/a.exaggeration()};for(let t=0;t<4;t++){const r=i.borderFeatureIndices[t];if(0===r.length)continue;const o=e.e9[t](n),l=d(o);if(!(l&&l instanceof e.ea))continue;const h=a?a.findDEMTileFor(o):null;if(!(h&&h.dem||s))continue;if(a&&h&&h.dem&&i.borderDEMTileTimestamp[t]!==h.dem._timestamp&&(i.borderDoneWithNeighborZ[t]=-1,i.borderDEMTileTimestamp[t]=h.dem._timestamp),i.borderDoneWithNeighborZ[t]===l.canonical.z)continue;0===l.centroidVertexArray.length&&l.createCentroidsBuffer();const f=(t<2?1:5)-t,p=l.borderDoneWithNeighborZ[f]!==i.canonical.z,y=l.borderFeatureIndices[f];let _=0;if(i.canonical.z!==l.canonical.z){for(const e of r)i.showCentroid(i.featuresOnBorder[e]);if(p)for(const e of y)l.showCentroid(l.featuresOnBorder[e]);i.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[f]=i.canonical.z}for(const n of r){const r=i.featuresOnBorder[n],a=i.centroidData[r.centroidDataIndex],d=r.borders[t];let p;for(;_<y.length;){p=l.featuresOnBorder[y[_]];const e=p.borders[f];if(e[1]>d[0]+3||e[0]>d[0]-3)break;l.showCentroid(p),_++}if(p&&_<y.length){const n=_;let v=0;for(;!(p.borders[f][0]>d[1]-3)&&(v++,++_!==y.length);)p=l.featuresOnBorder[y[_]];p=l.featuresOnBorder[y[n]];let b=!1;if(v>=1){const e=p.borders[f];Math.abs(d[0]-e[0])<3&&Math.abs(d[1]-e[1])<3&&(v=1,b=!0,_=n+1)}else if(0===v){i.showCentroid(r);continue}const x=l.centroidData[p.centroidDataIndex];s&&b&&c(a,x);const w=r.intersectsCount()>1||p.intersectsCount()>1;
1if(v>1)_=n,a.centroidXY=x.centroidXY=new e.P(0,0);else if(h&&h.dem&&!w){const r=g[t](a,x),n=t%2?e.al-1:0,i=m(r[0],Math.min(e.al-1,r[1]),n,h,o,t<2,r[2]);a.centroidXY=x.centroidXY=u(i)}else w?a.centroidXY=x.centroidXY=new e.P(0,0):(a.centroidXY=i.encodeBorderCentroid(r),x.centroidXY=l.encodeBorderCentroid(p));i.writeCentroidToBuffer(a),l.writeCentroidToBuffer(x)}else i.showCentroid(r)}i.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[f]=i.canonical.z}(i.needsCentroidUpdate||!i.centroidVertexBuffer&&0!==i.centroidVertexArray.length)&&i.uploadCentroid(t)}const ga=[1,0,0],ma=[0,1,0],ya=[0,0,1];function _a(t,r,n){const i=n.transform,o=n.shadowRenderer;if(!o)return!0;const a=t.toUnwrapped(),s=i.tileSize*o._cascades[n.currentShadowCascade].scale;let l=r;if(i.elevation){const e=i.elevation.getMinMaxForTile(t);e&&(l+=e.max)}const c=[...o.shadowDirection];c[2]=-c[2];const u=o.computeSimplifiedTileShadowVolume(a,l,s,c);if(!u)return!1;const d=[ga,ma,ya,c,[c[0],0,c[2]],[0,c[1],c[2]]],h="globe"===i.projection.name,f=i.scaleZoom(s),p=e.cB.fromInvProjectionMatrix(i.invProjMatrix,i.worldSize,f,!h),g=o.getCurrentCascadeFrustum();return 0===p.intersectsPrecise(u.vertices,u.planes,d)||0===g.intersectsPrecise(u.vertices,u.planes,d)}function va(t){const{painter:r,source:n,layer:i,coords:o}=t;let a=t.defines;const s=r.context,l="shadow"===r.renderPass,c="light-beam"===r.renderPass,u=r.shadowRenderer,d=e.ef(r.transform.center.lat,r.transform.zoom),h=un(r,i.paint.get("building-cutoff-fade-range"));h.shouldRenderCutoff&&(a=a.concat("RENDER_CUTOFF")),t.floodLightIntensity>0&&(a=a.concat("FLOOD_LIGHT"));for(const f of o){const o=n.getTile(f),p=o.getBucket(i);if(!p)continue;u&&0===u.getMaxCascadeForTile(f.toUnwrapped())&&(a=a.concat("SHADOWS_SINGLE_CASCADE"));const g=p.programConfigurations.get(i.id);let m,y,_,v=r.translatePosMatrix(f.expandedProjMatrix,o,[0,0],"map");if(v=e.cS(e.bC(),v,[1,1,t.verticalScale]),l&&u){if(_a(o.tileID,p.maxHeight*d,r))continue;let n=u.calculateShadowPassMatrixFromTile(o.tileID.toUnwrapped());n=e.cS(e.bC(),n,[1,1,t.verticalScale]),_=Mo(n),m=y=r.getOrCreateProgram("buildingDepth",{config:g,defines:a,overrideFog:!1})}else if(c)m=y=r.getOrCreateProgram("buildingBloom",{config:g,defines:a,overrideFog:!1}),_=Io(v);else{const n=r.transform.calculatePosMatrix(f.toUnwrapped(),r.transform.worldSize);e.cS(n,n,[1,1,t.verticalScale]);const i=e.bC();e.cS(i,n,[1,-1,1/d]),e.bl(i,i),e.eg(i,i);const o=r.transform.getFreeCameraOptions().position,s=1<<f.canonical.z;if(_=To(v,i,t.opacity,t.facadeAOIntensity,[((o.x-f.wrap)*s-f.canonical.x)*e.al,(o.y*s-f.canonical.y)*e.al,o.z*s*e.al],p.tileToMeter,t.facadeEmissiveChance,t.floodLightColor,t.floodLightIntensity),y=r.getOrCreateProgram("building",{config:g,defines:a,overrideFog:!1}),!0===t.depthOnly)m=y;else{const e=a.concat(["BUILDING_FAUX_FACADE","HAS_ATTRIBUTE_a_faux_facade_color_emissive"]);m=r.getOrCreateProgram("building",{config:g,defines:e,overrideFog:!1})}u&&(u.setupShadowsFromMatrix(n,y,!0),m!==y&&u.setupShadowsFromMatrix(n,m,!0))}const b=(e,n)=>{if(c){const o=e.entranceBloom;n.draw(r,s.gl.TRIANGLES,t.depthMode,Xr.disabled,t.blendMode,Qr.disabled,_,i.id,o.layoutVertexBuffer,o.indexBuffer,o.segmentsBucket,i.paint,r.transform.zoom,g,[o.layoutAttenuationBuffer,o.layoutColorBuffer])}else{const o=e.segmentsBucket;let a=[e.layoutNormalBuffer,e.layoutCentroidBuffer,e.layoutColorBuffer,e.layoutFloodLightDataBuffer];e.layoutFacadePaintBuffer&&(a=a.concat([e.layoutFacadeDataBuffer,e.layoutFacadeVerticalRangeBuffer,e.layoutFacadePaintBuffer])),n.draw(r,s.gl.TRIANGLES,t.depthMode,Xr.disabled,t.blendMode,l?Qr.disabled:Qr.backCW,_,i.id,e.layoutVertexBuffer,e.indexBuffer,o,i.paint,r.transform.zoom,g,a)}};r.uploadCommonUniforms(s,y,f.toUnwrapped(),null,h),p.buildingWithoutFacade&&b(p.buildingWithoutFacade,y),p.buildingWithFacade&&(m!==y&&r.uploadCommonUniforms(s,m,f.toUnwrapped(),null,h),b(p.buildingWithFacade,m))}}function ba(t,r,n,i,o,a,s,l,c,u,d,h,f){const p=t.context.gl,g=t.depthModeForSublayer(1,Zr.ReadOnly,p.LEQUAL,!0),m=.1*(1-(y=d))+3*y;var y;const _=t._showOverdrawInspector,v=h,b=new ha;_||fa(b,t,r,n,i,g,new Xr({func:p.ALWAYS,mask:255},255,255,p.KEEP,p.KEEP,p.REPLACE),new Wr([p.ONE,p.ONE,p.ONE,p.ONE],e.ao.transparent,[!1,!1,!1,!0],p.MIN),Qr.disabled,o,"sdf",a,s,l,c,u,m,v,!1);{const d=_?Xr.disabled:new Xr({func:p.EQUAL,mask:255},255,255,p.KEEP,p.DECR,p.DECR),h=_?t.colorModeForRenderPass():new Wr([p.ONE_MINUS_DST_ALPHA,p.DST_ALPHA,p.ONE,p.ONE],e.ao.transparent,[!0,!0,!0,!0]);fa(b,t,r,n,i,g,d,h,Qr.disabled,o,"color",a,s,l,c,u,m,v,!1)}}function xa(t){return[t[0]*e.eh,t[1]*e.eh,t[2]*e.eh,0]}function wa(t,r,n,i,o,a,s,l,c){const u=i.getSource(),d=n.globeSharedBuffers;if(!d)return;let h,f,p;if(r&&(h=i.getTile(r)),u instanceof e.aU?(f=u.texture,p=e.dK(0,0,n.transform)):h&&r&&(f=h.texture,p=e.dK(r.canonical.z,r.canonical.x,n.transform)),!f||!p)return;t||(p=e.cS(e.bC(),p,[1,-1,1]));const g=n.context,m=g.gl,y="nearest"===o.paint.get("raster-resampling")?m.NEAREST:m.LINEAR,_=n.colorModeForDrapableLayerRenderPass(a),v=s.defines;v.push("GLOBE_POLES");const b=new Zr(m.LEQUAL,Zr.ReadWrite,n.depthRangeFor3D),x=Float32Array.from(n.transform.expandedFarZProjMatrix),w=Float32Array.from(e.bk(e.dJ(new e.cD(0,0,0))));n.terrain&&n.terrain.prepareDrawTile(),g.activeTexture.set(m.TEXTURE0),f.bind(y,m.CLAMP_TO_EDGE),g.activeTexture.set(m.TEXTURE1),f.bind(y,m.CLAMP_TO_EDGE),"useMipmap"in f&&g.extTextureFilterAnisotropic&&n.transform.pitch>20&&m.texParameterf(m.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax);const[S,k,T,I]=r?d.getPoleBuffers(r.canonical.z,!1):d.getPoleBuffers(0,!0),M=o.paint.get("raster-elevation");let E;t?(E=S,n.renderDefaultNorthPole=0!==M):(E=k,n.renderDefaultSouthPole=0!==M);const P=xa(s.mix),A=((e,t,r,n,i,o,a,s,l,c,u,d,h)=>Do(e,t,r,new Float32Array(16),new Float32Array(9),[0,0],n,[0,0],[0,0,0,0],1,{opacity:1,mix:0},o,[0,0]||0,s,2,c,u,d,1,0,h))(x,w,p,e.aj(n.transform.zoom),0,o,0,M,0,P,s.offset,s.range,a),C=n.getOrCreateProgram("raster",{defines:v});n.uploadCommonUniforms(g,C,null),C.draw(n,m.TRIANGLES,b,c,_,l,A,o.id,E,T,I)}function Sa(e){if(e.isOrthographic)return[0,0,0,0];const t=e._nearZ,r=e.projection.farthestPixelDistance(e),n=r-t,i=.2*e.height,o=t+i;return[t,r,(o-i-t)/n,(o-t)/n]}function ka(e,t,r,n){if(e)return t instanceof pt&&e instanceof Lt?t.getTextureDescriptor(e,r,!0):{texture:e.texture,mix:xa(n.mix),offset:n.offset,buffer:0,tileSize:1}}var Ta=e.ei([{name:"a_index",type:"Int16",components:1}]);class Ia{constructor(t,r,n,i){const o={width:n[0],height:n[1],data:null},a=t.gl;this.targetColorTexture=new e.T(t,o,a.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new e.T(t,o,a.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(r,i),this.lastInvalidatedAt=0}updateParticleTexture(t,r){if(this.particleTextureDimension===r.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const n=this.context.gl,i=r.width*r.height;this.particleTexture0=new e.T(this.context,r,n.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,r,n.RGBA8,{premultiply:!1,useMipmap:!1});const o=new e.ej;o.reserve(i);for(let e=0;e<i;e++)o.emplaceBack(e);this.particleIndexBuffer=this.context.createVertexBuffer(o,Ta.members,!0),this.particleSegment=e.bg.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=r.width}update(t){return!(this.lastInvalidatedAt<t&&(this.lastInvalidatedAt=e.o.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function Ma(t,r,n){if(!t)return null;const i=r.getTextureDescriptor(t,n,!0);if(!i)return null;let{texture:o,mix:a,offset:s,tileSize:l,buffer:c,format:u}=i;if(!o||!u)return null;let d=!1;return"uint32"===u&&(d=!0,a[3]=0,a=Lo(e.ek,a,[0,n.paint.get("raster-particle-max-speed")]),s=Oo(e.ek,s,[0,n.paint.get("raster-particle-max-speed")])),{texture:o,textureOffset:[c/(l+2*c),l/(l+2*c)],tileSize:l,scalarData:d,scale:a,offset:s,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[u]]}}function Ea(e){const t=e._nearZ,r=e.projection.farthestPixelDistance(e),n=r-t,i=.2*e.height,o=t+i;return[t,r,(o-i-t)/n,(o-t)/n]}const Pa=new e.ao(1,0,0,1),Aa=new e.ao(0,1,0,1),Ca=new e.ao(0,0,1,1),Ra=new e.ao(1,0,1,1),La=new e.ao(0,1,1,1);function Oa(t,r,n,i,o,a){for(let s=0;s<n.length;s++)if(o){const o=1,l=.8,c=new e.ao(i.r*l,i.g*l,i.b*l,1);Da(t,r,n[s],i,-o,-o,a),Da(t,r,n[s],i,-o,o,a),Da(t,r,n[s],i,o,o,a),Da(t,r,n[s],i,o,-o,a),Da(t,r,n[s],c,0,0,a)}else Da(t,r,n[s],i,0,0,a)}function Da(t,r,n,i,o,a,s){const l=t.context,c=t.transform,u=l.gl,d="globe"===c.projection.name,h=d?["PROJECTION_GLOBE_VIEW"]:[];let f=e.bz(n.projMatrix);if(d&&e.aj(c.zoom)>0){const t=e.bj(n.canonical,c),r=e.el(t);f=e.aB(new Float32Array(16),c.globeMatrix,r),e.aB(f,c.projMatrix,f)}const p=e.bC();p[12]+=2*o/(e.o.devicePixelRatio*c.width),p[13]+=2*a/(e.o.devicePixelRatio*c.height),e.aB(f,p,f);const g=t.getOrCreateProgram("debug",{defines:h}),m=r.getTileByID(n.key);t.terrain&&t.terrain.setupElevationDraw(m,g);const y=Zr.disabled,_=Xr.disabled,v=t.colorModeForRenderPass(),b="$debug";l.activeTexture.set(u.TEXTURE0),t.emptyTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),d?m._makeGlobeTileDebugBuffers(t.context,c):m._makeDebugTileBoundsBuffers(t.context,c.projection);const x=m._tileDebugBuffer||t.debugBuffer,w=m._tileDebugIndexBuffer||t.debugIndexBuffer,S=m._tileDebugSegments||t.debugSegments;if(g.draw(t,u.LINE_STRIP,y,_,v,Qr.disabled,Ao(f,i.toPremultipliedRenderColor(null)),b,x,w,S,null,null,null,[m._globeTileDebugBorderBuffer]),s){const e=m.latestRawTileData,r=Math.floor((e&&e.byteLength||0)/1024);let i=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(i+=` => ${n.overscaledZ}`),i+=` ${m.state}`,i+=` ${r}kb`,function(e,t){e.initDebugOverlayCanvas();const r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,i)}const k=r.getTile(n).tileSize,T=512/Math.min(k,512)*(n.overscaledZ/c.zoom)*.5,I=m._tileDebugTextBuffer||t.debugBuffer,M=m._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,E=m._tileDebugTextSegments||t.debugSegments;g.draw(t,u.TRIANGLES,y,_,Wr.alphaBlended,Qr.disabled,Ao(f,e.ao.transparent.toPremultipliedRenderColor(null),T),b,I,M,E,null,null,null,[m._globeTileDebugTextBuffer])}function za(e,t,r,n){Na(e,0,t+r/2,e.transform.width,r,n)}function Fa(e,t,r,n){Na(e,t-r/2,0,r,e.transform.height,n)}function Na(t,r,n,i,o,a){const s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.o.devicePixelRatio,n*e.o.devicePixelRatio,i*e.o.devicePixelRatio,o*e.o.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}const Ba=e.ei([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:ja}=Ba;function Va(e,t,r,n){e.emplaceBack(t,r,n)}class Ga{constructor(t){this.vertexArray=new e.em,this.indices=new e.b0,Va(this.vertexArray,-1,-1,1),Va(this.vertexArray,1,-1,1),Va(this.vertexArray,-1,1,1),Va(this.vertexArray,1,1,1),V
vendor: 6,030 bytes, line 1
1a(this.vertexArray,-1,-1,-1),Va(this.vertexArray,1,-1,-1),Va(this.vertexArray,-1,1,-1),Va(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,ja),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.bg.simpleSegment(0,0,36,12)}}function Ua(t,r,n,i,o,a){const s=t.context.gl,l=r.paint.get("sky-atmosphere-color"),c=r.paint.get("sky-atmosphere-halo-color"),u=r.paint.get("sky-atmosphere-sun-intensity"),d=((e,t,r,n,i)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:r,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[i.r,i.g,i.b,i.a],u_luminance:5e-5}))(e.eo(e.dO(),i),o,u,l.toPremultipliedRenderColor(null),c.toPremultipliedRenderColor(null));s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+a,r.skyboxTexture,0),n.draw(t,s.TRIANGLES,Zr.disabled,Xr.disabled,Wr.unblended,Qr.frontCW,d,"skyboxCapture",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}const $a=e.ei([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Ha{constructor(t){const r=new e.ep;r.emplaceBack(-1,1,1,0,0),r.emplaceBack(1,1,1,1,0),r.emplaceBack(1,-1,1,1,1),r.emplaceBack(-1,-1,1,0,1);const n=new e.b0;n.emplaceBack(0,1,2),n.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(r,$a.members),this.indexBuffer=t.createIndexBuffer(n),this.segments=e.bg.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const qa=e.ei([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class Wa{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class Za{constructor(t){this.colorModeAlphaBlendedWriteRGB=new Wr([1,qr,1,qr],e.ao.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new Wr([1,0,1,0],e.ao.transparent,[!1,!1,!1,!0]),this.params=new Wa,this.updateNeeded=!0}update(t){const r=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new Ha(r);const t=this.params.sizeRange,n=this.params.intensityRange,i=function(t){const r=e.eq(30),n=[];for(let i=0;i<t;++i){const t=2*Math.PI*r(),i=Math.acos(1-2*r())-.5*Math.PI;n.push(e.d5(Math.cos(i)*Math.cos(t),Math.cos(i)*Math.sin(t),Math.sin(i)))}return n}(this.params.starsCount),o=e.eq(300),a=new e.er,s=new e.b0;let l=0;for(let r=0;r<i.length;++r){const c=e.c5([],i[r],200),u=Math.max(0,1+.01*t*(1*o()-.5)),d=Math.max(0,1+.01*n*(1*o()-.5));a.emplaceBack(c[0],c[1],c[2],-1,-1,u,d),a.emplaceBack(c[0],c[1],c[2],1,-1,u,d),a.emplaceBack(c[0],c[1],c[2],1,1,u,d),a.emplaceBack(c[0],c[1],c[2],-1,1,u,d),s.emplaceBack(l+0,l+1,l+2),s.emplaceBack(l+0,l+2,l+3),l+=4}this.starsVx=r.createVertexBuffer(a,qa.members),this.starsIdx=r.createIndexBuffer(s),this.starsSegments=e.bg.simpleSegment(0,0,a.length,s.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy()}drawAtmosphereGlow(t,r){const n=t.context,i=n.gl,o=t.transform,a=new Zr(i.LEQUAL,Zr.ReadOnly,[0,1]),s=e.aj(o.zoom),l=t.style.getLut(r.scope),c="none"===r.properties.get("color-use-theme"),u=r.properties.get("color").toNonPremultipliedRenderColor(c?null:l),d="none"===r.properties.get("high-color-use-theme"),h=r.properties.get("high-color").toNonPremultipliedRenderColor(d?null:l),f="none"===r.properties.get("space-color-use-theme"),p=r.properties.get("space-color").toNonPremultipliedRenderColor(f?null:l),g=5e-4,m=e.es(r.properties.get("horizon-blend"),0,1,g,.25),y=e.dE(t,n,o)&&m===g?o.worldSize/(2*Math.PI*1.025)-1:o.globeRadius,_=t.frameCounter/1e3%1,v=e.ag(o.globeCenterInViewSpace),b=Math.sqrt(Math.pow(v,2)-Math.pow(y,2)),x=Math.acos(b/v),w=e=>{const r="globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];e&&r.push("ALPHA_PASS");const l=t.getOrCreateProgram("globeAtmosphere",{defines:r}),c=((e,t,r,n,i,o,a,s,l,c,u,d)=>({u_frustum_tl:e,u_frustum_tr:t,u_frustum_br:r,u_frustum_bl:n,u_horizon:i,u_transition:o,u_fadeout_range:a,u_atmosphere_fog_color:s.toArray01(),u_high_color:l.toArray01(),u_space_color:c.toArray01(),u_temporal_offset:u,u_horizon_angle:d}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,s,m,u,h,p,_,x);t.uploadCommonUniforms(n,l);const d=this.atmosphereBuffer;d&&l.draw(t,i.TRIANGLES,a,Xr.disabled,e?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,Qr.backCW,c,e?"atmosphere_glow_alpha":"atmosphere_glow",d.vertexBuffer,d.indexBuffer,d.segments)};w(!1),w(!0)}drawStars(t,r){const n=e.aA(r.properties.get("star-intensity"),0,1);if(0===n)return;const i=t.context,o=i.gl,a=t.transform,s=t.getOrCreateProgram("stars"),l=e.c7([]);e.c9(l,l,-a._pitch),e.c8(l,l,-a.angle),e.c9(l,l,e.an(a._center.lat)),e.et(l,l,-e.an(a._center.lng));const c=e.cc(new Float32Array(16),l),u=e.aB([],a.starsProjMatrix,c),d=e.eo([],c),h=e.eu([],d),f=[0,1,0];e.dQ(f,f,h),e.c5(f,f,this.params.sizeMultiplier);const p=[1,0,0];e.dQ(p,p,h),e.c5(p,p,this.params.sizeMultiplier);const g=(m=f,y=p,_=n,{u_matrix:Float32Array.from(u),u_up:m,u_right:y,u_intensity_multiplier:_});var m,y,_;t.uploadCommonUniforms(i,s),this.starsVx&&this.starsIdx&&s.draw(t,o.TRIANGLES,Zr.disabled,Xr.disabled,this.colorModeAlphaBlendedWriteRGB,Qr.disabled,g,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}class Ya{constructor(){this.visibleTiles=[]}updateBorders(t,r){const n=[],i=[],o=t._getRenderableCoordinates(!1,!0);for(const e of o){const o=t.getTile(e);
1if(!o.hasData())continue;const a=o.getBucket(r);a&&(a.isEmpty()||(n.push(e.key),i.push({bucket:a,tileID:e.canonical})))}let a=n.length!==this.visibleTiles.length;if(!a){n.sort();for(let e=0;e<n.length;e++)if(n[e]!==this.visibleTiles[e]){a=!0;break}}if(!a)return;const s=new Set;this.visibleTiles=n,i.sort(((e,t)=>e.tileID.z-t.tileID.z||e.tileID.x-t.tileID.x||e.tileID.y-t.tileID.y));for(const t of i){const r=new Array,n=new Array,i=t.bucket;for(const e of i.featuresOnBorder)s.has(e.featureId)?n.push(e.footprintIndex):(s.add(e.featureId),r.push(e.footprintIndex));i.updateFootprintHiddenFlags(r,e.ev,!1),i.updateFootprintHiddenFlags(n,e.ev,!0)}}}function Xa(t,r){const n=[...t],i=r.cameraWorldSizeForFog/r.worldSize,o=e.bA([]);return e.cS(o,o,[i,i,1]),e.aB(n,o,n),e.aB(n,r.worldToFogMatrix,n),n}function Ka(t,r,n,i,o){const a=n.material,s=i.context,{baseColorTexture:l,metallicRoughnessTexture:c}=a.pbrMetallicRoughness,{normalTexture:u,occlusionTexture:d,emissionTexture:h}=a;function f(e,r,n){if(e&&(t.push(r),s.activeTexture.set(s.gl.TEXTURE0+n),e.gfxTexture)){const{minFilter:t,magFilter:r,wrapS:n,wrapT:i}=e.sampler;e.gfxTexture.bindExtraParam(t,r,n,i)}}f(l,"HAS_TEXTURE_u_baseColorTexture",5),f(c,"HAS_TEXTURE_u_metallicRoughnessTexture",6),f(u,"HAS_TEXTURE_u_normalTexture",7),f(d,"HAS_TEXTURE_u_occlusionTexture",8),f(h,"HAS_TEXTURE_u_emissionTexture",9),o&&(o.texture||(o.texture=new e.d$(i.context,o.image,[o.image.height,o.image.height,o.image.height],s.gl.RGBA8)),s.activeTexture.set(s.gl.TEXTURE0+10),o.texture&&o.texture.bind(s.gl.LINEAR,s.gl.CLAMP_TO_EDGE),t.push("APPLY_LUT_ON_GPU")),n.texcoordBuffer&&(t.push("HAS_ATTRIBUTE_a_uv_2f"),r.push(n.texcoordBuffer)),n.colorBuffer&&(t.push(12===n.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),r.push(n.colorBuffer)),n.normalBuffer&&(t.push("HAS_ATTRIBUTE_a_normal_3f"),r.push(n.normalBuffer)),n.pbrBuffer&&(t.push("HAS_ATTRIBUTE_a_pbr"),t.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),r.push(n.pbrBuffer)),"OPAQUE"!==a.alphaMode&&"MASK"!==a.alphaMode||t.push("UNPREMULT_TEXTURE_IN_SHADER"),a.defined||t.push("DIFFUSE_SHADED");const p=i.shadowRenderer;p&&(t.push("RENDER_SHADOWS","DEPTH_TEXTURE"),p.useNormalOffset&&t.push("NORMAL_OFFSET"))}function Ja(t,r,n,i,o,a){const s=t.modelOpacity,l=r.context,c=new Zr(r.context.gl.LEQUAL,t.isLightMesh?Zr.ReadOnly:Zr.ReadWrite,r.depthRangeFor3D),u=r.transform,d=t.mesh,h=d.material,f=h.pbrMetallicRoughness,p=r.style.fog;let g;g="pixels"===r.transform.projection.zAxisUnit?[...t.nodeModelMatrix]:e.aB([],i.zScaleMatrix,t.nodeModelMatrix),e.aB(g,i.negCameraPosMatrix,g);const m=e.bl([],g);e.eg(m,m);const y="none"===n.paint.get("model-color-use-theme").constantOr("default"),_=n.paint.get("model-emissive-strength").constantOr(0),v=qo(new Float32Array(t.worldViewProjection),new Float32Array(g),new Float32Array(m),null,r,s,f.baseColorFactor,h.emissiveFactor,f.metallicFactor,f.roughnessFactor,h,_,n,void 0,void 0,t.materialOverride,t.modelColor),b={defines:[]},x=[],w=r.shadowRenderer;w&&(w.useNormalOffset=!1),Ka(b.defines,x,d,r,y?null:n.lut);let S=null;if(p){const e=Xa(t.nodeModelMatrix,r.transform);if(S=new Float32Array(e),"globe"!==u.projection.name){const t=d.aabb.min,r=d.aabb.max,[n,i]=p.getOpacityForBounds(e,t[0],t[1],r[0],r[1]);b.overrideFog=n>=Ge||i>=Ge}}const k=un(r,n.paint.get("model-cutoff-fade-range"));k.shouldRenderCutoff&&b.defines.push("RENDER_CUTOFF");const T=r.getOrCreateProgram("model",b);r.uploadCommonUniforms(l,T,null,S,k),"shadow"!==r.renderPass&&w&&w.setupShadowsFromMatrix(t.nodeModelMatrix,T),T.draw(r,l.gl.TRIANGLES,c,o,a,d.material.doubleSided?Qr.disabled:Qr.backCCW,v,n.id,d.vertexBuffer,d.indexBuffer,d.segments,n.paint,r.transform.zoom,void 0,x)}function Qa(e,t){return e.style._importedAsBasemap?"basemap":t.scope}function es(t,r,n,i,o,a,s,l,c,u){const d=t.transform,h=!!r.isGeometryBloom&&r.isGeometryBloom;if(h&&"shadow"===t.renderPass)return;const f="globe"===d.projection.name?e.eD(n,d):[...n];e.aB(f,f,r.globalMatrix);const p=e.aB([],i,f);if(r.meshes)for(const t of r.meshes){const r=l.get(t.material.name);if(r&&r.opacity<=0)continue;if("BLEND"!==t.material.alphaMode){s.push({mesh:t,depth:0,modelIndex:o,worldViewProjection:p,nodeModelMatrix:f,isLightMesh:h,materialOverride:r,modelOpacity:c,modelColor:u});continue}const n=e.af([],t.centroid,p);!d.isOrthographic&&n[2]<=0||a.push({mesh:t,depth:n[2],modelIndex:o,worldViewProjection:p,nodeModelMatrix:f,isLightMesh:h,materialOverride:r,modelOpacity:c,modelColor:u})}if(r.children)for(const e of r.children)es(t,e,n,i,o,a,s,l,c,u)}function ts(e,t,r,n){const i=r.shadowRenderer;if(!i)return;const o=i.getShadowPassDepthMode(),a=i.getShadowPassColorMode(),s=i.calculateShadowPassMatrixFromMatr
1ix(t),l=Wo(s);r.getOrCreateProgram("modelDepth",{defines:r._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(r,r.context.gl.TRIANGLES,o,Xr.disabled,a,Qr.disabled,l,n.id,e.vertexBuffer,e.indexBuffer,e.segments,n.paint,r.transform.zoom,void 0,void 0)}function rs(e,t,r,n,i,o){for(const a of i){const i=Object.assign({},n);i.part=a;const s={type:"Unknown",id:t,properties:i},l={orientation:e.paint.get("model-rotation").evaluate(s,r)};o.set(a,l)}}function ns(e,t,r,n,i,o){for(const a of i){const i=Object.assign({},n);i.part=a;const s={type:"Unknown",id:t,properties:i},l={color:e.paint.get("model-color").evaluate(s,r),colorMix:e.paint.get("model-color-mix-intensity").evaluate(s,r),opacity:e.paint.get("model-opacity").evaluate(s,r),emissionStrength:e.paint.get("model-emissive-strength").evaluate(s,r)};o.set(a,l)}}function is(e,t,r,n,i){let o=!1;for(const r of n)1!==r.modelOpacity&&(Ja(r,e,t,i[r.modelIndex],Xr.disabled,Wr.disabled),o=!0);for(const r of n)Ja(r,e,t,i[r.modelIndex],1!==r.modelOpacity?e.stencilModeFor3D():Xr.disabled,e.colorModeForRenderPass());o&&e.resetStencilClippingMasks();const a=Wr.additive;for(const n of r)Ja(n,e,t,i[n.modelIndex],Xr.disabled,n.isLightMesh?a:e.colorModeForRenderPass())}function os(t,r,n){const i=r.updateZoomBasedPaintProperties(),o=function(t,r,n){let i,o,a,s=t.terrain?t.terrain.exaggeration():0;if(t.terrain&&s>0){const r=t.terrain,o=r.findDEMTileFor(n);o&&o.dem?i=e.eF.create(r,n,o):s=0}if(0===s&&(r.terrainElevationMin=0,r.terrainElevationMax=0),s===r.validForExaggeration&&(0===s||i&&i._demTile&&i._demTile.tileID===r.validForDEMTile.id&&i._dem._timestamp===r.validForDEMTile.timestamp))return!1;for(const e in r.instancesPerModel){const t=r.instancesPerModel[e];for(let e=0;e<t.instancedDataArray.length;++e){const n=(i?s*i.getElevationAt(0|t.instancedDataArray.float32[16*e],0|t.instancedDataArray.float32[16*e+1],!0,!0):0)+t.instancesEvaluatedElevation[e];t.instancedDataArray.float32[16*e+6]=n,o=o?Math.min(r.terrainElevationMin,n):n,a=a?Math.max(r.terrainElevationMax,n):n}}return r.terrainElevationMin=o||0,r.terrainElevationMax=a||0,r.validForExaggeration=s,r.validForDEMTile=i&&i._demTile?{id:i._demTile.tileID,timestamp:i._dem._timestamp}:{id:void 0,timestamp:0},!0}(t,r,n);(i||o)&&(r.uploaded=!1,r.upload(t.context))}const as={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new e.d9([0,0,0],[e.al,e.al,0])};function ss(t,r){const n=1<<t.canonical.z,i=r.getFreeCameraOptions().position,o=r.elevation,a=t.canonical.x/n,s=(t.canonical.x+1)/n,l=t.canonical.y/n,c=(t.canonical.y+1)/n;let u=r._centerAltitude;if(o){const e=o.getMinMaxForTile(t);e&&e.max>u&&(u=e.max)}const d=e.aA(i.x,a,s)-i.x,h=e.aA(i.y,l,c)-i.y,f=e.cf(u,r.center.lat)-i.z;return r._zoomFromMercatorZ(Math.sqrt(d*d+h*h+f*f))}function ls(e,t,r,n,i,o,a){const s=e.context,l="shadow"===e.renderPass,c=e.shadowRenderer,u=l&&c?c.getShadowPassDepthMode():new Zr(s.gl.LEQUAL,Zr.ReadWrite,e.depthRangeFor3D),d=e.isTileAffectedByFog(o),h="globe"===e.transform.projection.name;if(r.meshes)for(const f of r.meshes){const p=h?[]:["MODEL_POSITION_ON_GPU"],g=[];let m,y,_;const v=!h&&n.instancedDataArray.length>20;v&&p.push("INSTANCED_ARRAYS");const b=un(e,t.paint.get("model-cutoff-fade-range"));if(b.shouldRenderCutoff&&p.push("RENDER_CUTOFF"),l&&c)m=e.getOrCreateProgram("modelDepth",{defines:p}),y=Wo(a.shadowTileMatrix,a.shadowTileMatrix,Float32Array.from(r.globalMatrix)),_=c.getShadowPassColorMode();else{Ka(p,g,f,e,"none"===t.paint.get("model-color-use-theme").constantOr("default")?null:t.lut),m=e.getOrCreateProgram("model",{defines:p,overrideFog:d});const n=f.material,l=n.pbrMetallicRoughness,u=t.paint.get("model-opacity").constantOr(1),h=t.paint.get("model-emissive-strength").constantOr(0);y=qo(o.expandedProjMatrix,Float32Array.from(r.globalMatrix),new Float32Array(16),null,e,u,l.baseColorFactor,n.emissiveFactor,l.metallicFactor,l.roughnessFactor,n,h,t,i),c&&(a.shadowUniformsInitialized?m.setShadowUniformValues(s,c.getShadowUniformValues()):(c.setupShadows(o.toUnwrapped(),m,"model-tile"),a.shadowUniformsInitialized=!0)),_=b.shouldRenderCutoff||u<1||"OPAQUE"!==n.alphaMode?Wr.alphaBlended:Wr.unblended}e.uploadCommonUniforms(s,m,o.toUnwrapped(),null,b);const x=f.material.doubleSided?Qr.disabled:Qr.backCCW;if(v)g.push(n.instancedDataBuffer),m.draw(e,s.gl.TRIANGLES,u,Xr.disabled,_,x,y,t.id,f.vertexBuffer,f.indexBuffer,f.segments,t.paint,e.transform.zoom,void 0,g,n.instancedDataArray.length);else{const r=l?"u_instance":"u_normal_matrix";for(let i=0;i<n.instancedDataArray.length;++i)y[r]=new Float32Array(n.instancedDataArray.arrayBuffer,64*i,16),m.draw(e,s.gl.TRIANGLES,u,Xr.disabled,_,x,y,t.id,f.vertexBuffer,f.indexBuffer,f.segments,t.paint,e.transform.zoom,void 0,g)}}if(r.children)for(const s of r.children)ls(e,t,s,n,i,o,a)}const cs=[1,-1,1];function us(t,r,n,i){if(!n.modelManager)return!0;const o=n.modelManager;if(!n.shadowRenderer)return!0;const a=n.shadowRenderer,s=r.aabb;let l=!0,c=t.maxHeight;if(0===c){let e=0;for(const r in t.instancesPerModel){const t=o.getModel(r,i);t?e=Math.max(e,Math.max(Math.max(t.aabb.max[0],t.aabb.max[1]),t.aabb.max[2])):l=!1}c=t.maxScale*e*1.41+t.maxVerticalOffset,l&&(t.maxHeight=c)}s.max[2]=c,s.min[2]+=t.terrainElevationMin,s.max[2]+=t.terrainElevationMax,e.af(s.min,s.min,r.tileMatrix),e.af(s.max,s.max,r.tileMatrix);const u=s.intersects(a.getCurrentCascadeFrustum());return 0===n.currentShadowCascade&&(t.isInsideFirstShadowMapFrustum=2===u),0===u}function ds(t,r){const n=t.uniformValues.u_cutoff_params[0],i=t.uniformValues.u_cutoff_params[1],o=t.uniformValues.u_cutoff_params[2],a=t.uniformValues.u_cutoff_params[3];return i===n||a===o?1:e.aA(((r-n)/(i-n)-o)/(a-o),0,1)}function hs(t,r,n,i){if(r.pitch<20)return 1;const o=r.getWorldToCameraMatrix();e.aB(o,o,t);const a=e.bU(n.min[0],n.min[1],n.min[2],1);let s=e.aC(e.eG(),a,o),l=s,c=s;a[1]=n.max[1],s=e.aC(e.eG(),a,o),l=s[1]<l[1]?s:l,c=s[1]>c[1]?s:c,a[0]=n.max[0],s=e.aC(e.eG(),a,o),l=s[1]<l[1]?s:l,c=s[1]>c[1]?s:c,a[1]=n.min[1],s=e.aC(e.eG(),a,o),l=s[1]<l[1]?s:l,c=s[1]>c[1]?s:c;const u=e.aA(i[0],0,1),d=100*r.pixelsPerMeter*e.aA(i[1],0,1),h=e.aA(i[2],0,1),f=e.eH(e.eG(),l,c,u),p=Math.tan(.5*r.fovX),g=-f[2]*p;if(0===d)return f[1]<-Math.abs(g)?h:1;const m=(-Math.abs(g)-f[1])/d,y=(e,t,r)=>(1-r)*e+r*t,_=e.aA(y(1,h,m),h,1);
1return y(1,_,e.aA((r.pitch-20)/20,0,1))}class fs{}class ps{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,r,n){{const e=this._storage.get(r.id);if(e)return e.lastUsedFrameIdx=t,e.buf}const i=n.gl,o=i.getBufferParameter(i.ELEMENT_ARRAY_BUFFER,i.BUFFER_SIZE),a=new ArrayBuffer(o),s=new Int16Array(a);i.getBufferSubData(i.ELEMENT_ARRAY_BUFFER,0,new Int16Array(a));const l=new e.eJ;for(let e=0;e<o/2;e+=3){const t=s[e],r=s[e+1],n=s[e+2];l.emplaceBack(t,r),l.emplaceBack(r,n),l.emplaceBack(n,t)}const c=n.bindVertexArrayOES.current,u=new fs;return u.buf=new Yo(n,l),u.lastUsedFrameIdx=t,this._storage.set(r.id,u),n.bindVertexArrayOES.set(c),u.buf}update(e){for(const[t,r]of this._storage)e-r.lastUsedFrameIdx>30&&(r.buf.destroy(),this._storage.delete(t))}destroy(){for(const[e,t]of this._storage)t.buf.destroy(),this._storage.delete(e)}}class gs{constructor(){this.occluderSize=30,this.depthOffset=-1e-4}}const ms=e.ei([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class ys{constructor(e){this.revealStart=11,this.revealRange=2}}const _s=e.ei([{type:"Float32",name:"a_pos_2f",components:2}]);class vs{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(t,r){const n=t.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const r=new e.eK,n=new e.b0;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1),n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),this.vignetteVx=t.context.createVertexBuffer(r,_s.members),this.vignetteIdx=t.context.createIndexBuffer(n)}const i=e.bg.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){t.uploadCommonUniforms(t.context,n);const e={u_vignetteShape:(o={vignetteShape:[r.start,r.range,Math.pow(10,r.fadePower)],vignetteColor:[r.color.r,r.color.g,r.color.b,r.color.a*r.strength]}).vignetteShape,u_vignetteColor:o.vignetteColor};n.draw(t,t.context.gl.TRIANGLES,Zr.disabled,Xr.disabled,Wr.alphaBlended,Qr.disabled,e,"vignette",this.vignetteVx,this.vignetteIdx,i)}var o}}class bs{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(t,r){const n=t.getFreeCameraOptions().position,i=n.toAltitude(),o=n.toLngLat(),a=e.an(o.lng),s=e.an(o.lat),l=t.pixelsPerMeter/r,c=a*e.eM,u=e.eM*Math.log(Math.tan(Math.PI/4+s/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const e=-this._offsetYPrev+u,t=-this._elevationPrev+i;this._accumulatedOffsetX+=(-this._offsetXPrev+c)*l,this._accumulatedOffsetY+=e*l,this._accumulatedElevation+=t*l,this._offsetXPrev=c,this._offsetYPrev=u,this._elevationPrev=i}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function xs(e,t){return[-(e[0]-Math.floor(e[0]/t)*t),-(e[1]-Math.floor(e[1]/t)*t),-(e[2]-Math.floor(e[2]/t)*t)]}function ws(t){const r=e.eq(1323123451230),n=[];for(let i=0;i<t;++i){const t=2*r()-1,i=2*r()-1,o=2*r()-1;n.push(e.d5(t,i,o))}return n}function Ss(t,r,n,i,o){const a=e.aA((o-n)/(i-n),0,1);return(1-a)*t+a*r}class ks{constructor(e){this._movement=new bs,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new vs,this._ppmScaleFactor=e}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(t,r){const n=t.transform;this._movement.update(n,this._ppmScaleFactor);const i=n.starsProjMatrix,o=e.c7([]);e.c9(o,o,e.an(90)-n._pitch),e.c8(o,o,-n.angle);const a=e.cc(new Float32Array(16),o),s=e.eL(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),l=e.eg([],s),c=e.aB([],l,a),u=Date.now()/1e3;return this._accumulatedTimeFromStart+=(u-this._prevTime)*r,this._prevTime=u,{projectionMatrix:i,modelviewMatrix:c}}}class Ts extends ks{constructor(e){super(4.25),this._params={overrideStyleParameters:!1,intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,droplet
1SizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._revealParams=new ys("Precipitation > Rain"),this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3}update(t){const r=t.context;if(!this.particlesVx){const t=ws(this.particlesCount),n=new e.eN,i=new e.b0;let o=0;const a=e.eq(1323123451230);for(let e=0;e<t.length;++e){const r=t[e],s=[2*a()-1,a(),a(),a()];n.emplaceBack(r[0],r[1],r[2],-1,-1,...s),n.emplaceBack(r[0],r[1],r[2],1,-1,...s),n.emplaceBack(r[0],r[1],r[2],1,1,...s),n.emplaceBack(r[0],r[1],r[2],-1,1,...s),i.emplaceBack(o+0,o+1,o+2),i.emplaceBack(o+0,o+2,o+3),o+=4}this.particlesVx=r.createVertexBuffer(n,ms.members),this.particlesIdx=r.createIndexBuffer(i)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.rain)return;const r=this._params.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},n=t.transform.zoom;if(r.revealStart>n)return;const i=Ss(0,1,r.revealStart,r.revealStart+r.revealRange,n);if(!this.particlesVx||!this.particlesIdx)return;const o=structuredClone(this._params);let a=[-o.direction.x,o.direction.y,-100];e.aw(a,a);const s=structuredClone(this._vignetteParams);s.strength*=i,o.overrideStyleParameters||(o.intensity=t.style.rain.state.density,o.timeFactor=t.style.rain.state.intensity,o.color=structuredClone(t.style.rain.state.color),a=structuredClone(t.style.rain.state.direction),o.screenThinning.intensity=t.style.rain.state.centerThinning,o.dropletSizeX=t.style.rain.state.dropletSize[0],o.droplet
1SizeYScale=t.style.rain.state.dropletSize[1]/t.style.rain.state.dropletSize[0],o.distortionStrength=100*t.style.rain.state.distortionStrength,s.strength=1,s.color=structuredClone(t.style.rain.state.vignetteColor));const l=this.updateOnRender(t,o.timeFactor),c=t.context,u=c.gl,d=t.transform;this.screenTexture&&this.screenTexture.size[0]===t.width&&this.screenTexture.size[1]===t.height||(this.screenTexture=new e.T(c,{width:t.width,height:t.height,data:null},u.RGBA8)),o.distortionStrength>0&&(c.activeTexture.set(u.TEXTURE0),this.screenTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),u.copyTexSubImage2D(u.TEXTURE_2D,0,0,0,0,0,t.width,t.height));const h=t.getOrCreateProgram("rainParticle");t.uploadCommonUniforms(c,h),c.activeTexture.set(u.TEXTURE0),this.screenTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE);const f=[o.color.r,o.color.g,o.color.b,o.color.a],p=(r,n)=>{const i=xs(this._movement.getPosition(),r),s=o.dropletSizeX,c=o.dropletSizeX*o.dropletSizeYScale,p=t.width/2,g=t.height/2,m=Ss(0,o.screenThinning.start,0,1,o.screenThinning.intensity),y=Ss(.001,o.screenThinning.range,0,1,o.screenThinning.intensity),_=Ss(0,o.screenThinning.particleOffset,0,1,o.screenThinning.intensity),v=(b={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:i,velocityConeAperture:o.velocityConeAperture,velocity:o.velocity,boxSize:r,rainDropletSize:[s,c],distortionStrength:o.distortionStrength,rainDirection:a,color:f,screenSize:[d.width,d.height],thinningCenterPos:[p,g],thinningShape:[m,y,Math.pow(10,o.screenThinning.fadePower)],thinningAffectedRatio:o.screenThinning.affectedRatio,thinningParticleOffset:_,shapeDirectionalPower:o.shapeDirPower,shapeNormalPower:o.shapeNormalPower,mode:n?0:1},{u_modelview:Float32Array.from(b.modelview),u_projection:Float32Array.from(b.projection),u_time:b.time,u_cam_pos:b.camPos,u_texScreen:0,u_velocityConeAperture:b.velocityConeAperture,u_velocity:b.velocity,u_boxSize:b.boxSize,u_rainDropletSize:b.rainDropletSize,u_distortionStrength:b.distortionStrength,u_rainDirection:b.rainDirection,u_color:b.color,u_screenSize:b.screenSize,u_thinningCenterPos:b.thinningCenterPos,u_thinningShape:b.thinningShape,u_thinningAffectedRatio:b.thinningAffectedRatio,u_thinningParticleOffset:b.thinningParticleOffset,u_shapeDirectionalPower:b.shapeDirectionalPower,u_shapeNormalPower:b.shapeNormalPower,u_mode:b.mode});var b;const x=Math.round(o.intensity*this.particlesCount),w=e.bg.simpleSegment(0,0,4*x,2*x);h.draw(t,u.TRIANGLES,Zr.disabled,Xr.disabled,Wr.alphaBlended,Qr.disabled,v,"rain_particles",this.particlesVx,this.particlesIdx,w)};o.distortionStrength>0&&p(o.boxSize,!0),p(o.boxSize,!1),this._vignette.draw(t,s)}}const Is=e.ei([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]);class Ms extends ks{constructor(e){super(2.25),this._params={overrideStyleParameters:!1,intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._revealParams=new ys("Precipitation > Snow"),this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3}update(t){const r=t.context;if(!this.particlesVx){const t=ws(this.particlesCount),n=new e.eO,i=new e.b0;let o=0;const a=e.eq(1323123451230);for(let e=0;e<t.length;++e){const r=t[e],s=a(),l=a(),c=a(),u=[e/t.length,s,l,c],d=[a(),a()];n.emplaceBack(r[0],r[1],r[2],-1,-1,...u,...d),n.emplaceBack(r[0],r[1],r[2],1,-1,...u,...d),n.emplaceBack(r[0],r[1],r[2],1,1,...u,...d),n.emplaceBack(r[0],r[1],r[2],-1,1,...u,...d),i.emplaceBack(o+0,o+1,o+2),i.emplaceBack(o+0,o+2,o+3),o+=4}this.particlesVx=r.createVertexBuffer(n,Is.members),this.particlesIdx=r.createIndexBuffer(i)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.snow)return;const r=structuredClone(this._params);let n=[-r.direction.x,r.direction.y,-100];e.aw(n,n);
1const i=structuredClone(this._vignetteParams),o=r.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},a=t.transform.zoom;if(o.revealStart>a)return;const s=Ss(0,1,o.revealStart,o.revealStart+o.revealRange,a);i.strength*=s,r.overrideStyleParameters||(r.intensity=t.style.snow.state.density,r.timeFactor=t.style.snow.state.intensity,r.color=structuredClone(t.style.snow.state.color),n=structuredClone(t.style.snow.state.direction),r.screenThinning.intensity=t.style.snow.state.centerThinning,r.billboardSize=2.79*t.style.snow.state.flakeSize,i.strength=1,i.color=structuredClone(t.style.snow.state.vignetteColor));const l=this.updateOnRender(t,r.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const c=t.context,u=c.gl,d=t.transform,h=t.getOrCreateProgram("snowParticle");t.uploadCommonUniforms(c,h),((r,i,o)=>{const a=xs(this._movement.getPosition(),r),s=d.width/2,c=d.height/2,f=Ss(0,o.screenThinning.start,0,1,o.screenThinning.intensity),p=Ss(.001,o.screenThinning.range,0,1,o.screenThinning.intensity),g=Ss(0,o.screenThinning.particleOffset,0,1,o.screenThinning.intensity),m=(y={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:a,velocityConeAperture:o.velocityConeAperture,velocity:o.velocity,horizontalOscillationRadius:o.horizontalOscillationRadius,horizontalOscillationRate:o.horizontalOscillationRate,boxSize:r,billboardSize:1*o.billboardSize,simpleShapeParameters:[o.shapeFadeStart,o.shapeFadePower],screenSize:[d.width,d.height],thinningCenterPos:[s,c],thinningShape:[f,p,Math.pow(10,o.screenThinning.fadePower)],thinningAffectedRatio:o.screenThinning.affectedRatio,thinningParticleOffset:g,color:[o.color.r,o.color.g,o.color.b,o.color.a],direction:n},{u_modelview:Float32Array.from(y.modelview),u_projection:Float32Array.from(y.projection),u_time:y.time,u_cam_pos:y.camPos,u_velocityConeAperture:y.velocityConeAperture,u_velocity:y.velocity,u_horizontalOscillationRadius:y.horizontalOscillationRadius,u_horizontalOscillationRate:y.horizontalOscillationRate,u_boxSize:y.boxSize,u_billboardSize:y.billboardSize,u_simpleShapeParameters:y.simpleShapeParameters,u_screenSize:y.screenSize,u_thinningCenterPos:y.thinningCenterPos,u_thinningShape:y.thinningShape,u_thinningAffectedRatio:y.thinningAffectedRatio,u_thinningParticleOffset:y.thinningParticleOffset,u_particleColor:y.color,u_direction:y.direction});var y;const _=Math.round(o.intensity*this.particlesCount),v=e.bg.simpleSegment(0,0,4*_,2*_);this.particlesVx&&this.particlesIdx&&h.draw(t,u.TRIANGLES,Zr.disabled,Xr.disabled,Wr.alphaBlended,Qr.disabled,m,"snow_particles",this.particlesVx,this.particlesIdx,v)})(r.boxSize,0,r),this._vignette.draw(t,i)}}const Es={symbol:function(t,r,n,i,o){if("translucent"!==t.renderPass)return;const a=Xr.disabled,s=t.colorModeForRenderPass(),l=n.layout.get("text-variable-anchor"),c=n.layout.get("text-size-scale-range"),u=e.aA(t.scaleFactor,c[0],c[1]);l&&function(t,r,n,i,o,a,s,l){const c=r.transform,u="map"===o,d="map"===a;for(const r of t){const t=i.getTile(r),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;const a=e.bK(o.textSizeData,c.zoom,l),h=Qt(r,o.getProjection(),c),f=c.calculatePixelsToTileUnitsMatrix(t),p=nr(h,t.tileID.canonical,d,u,c,o.getProjection(),f),g=o.hasIconTextFit()&&o.hasIconData();a&&oa(o,u,d,s,c,p,r,Math.pow(2,c.zoom-t.tileID.overscaledZ),a,g)}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o,u);const d=0!==n.paint.get("icon-opacity").constantOr(1),h=0!==n.paint.get("text-opacity").constantOr(1);void 0!==n.layout.get("symbol-sort-key").constantOr(1)&&(d||h)?aa(t,r,n,i,a,s):(d&&aa(t,r,n,i,a,s,{onlyIcons:!0}),h&&aa(t,r,n,i,a,s,{onlyText:!0})),r.map.showCollisionBoxes&&(ta(t,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),ta(t,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(t,r,n,i){if("translucent"!==t.renderPass)return;const o=n.paint.get("circle-opacity"),a=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("
1circle-sort-key").constantOr(1),c=n.paint.get("circle-emissive-strength");if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const u=t.context,d=u.gl,h=t.transform,f=!(!t.terrain||!t.terrain.enabled),p=n.layout.get("circle-elevation-reference"),g=t.depthModeForSublayer(0,Zr.ReadOnly),m=new Zr(t.context.gl.LEQUAL,Zr.ReadOnly,t.depthRangeFor3D),y="none"===p||f?g:m,_=Xr.disabled,v=t.colorModeForDrapableLayerRenderPass(c),b="globe"===h.projection.name,x=[e.aF(h.center.lng),e.aJ(h.center.lat)],w=[];for(let o=0;o<i.length;o++){const a=i[o],s=r.getTile(a),c=s.getBucket(n);if(!c||c.projection.name!==h.projection.name)continue;const u=c.programConfigurations.get(n.id),d=c.layoutVertexBuffer,f=c.globeExtVertexBuffer,p=c.indexBuffer,g=e.e0(n),m=[f],y=t.isTileAffectedByFog(a);b&&g.push("PROJECTION_GLOBE_VIEW"),g.push("DEPTH_D24"),t.terrain&&h.depthOcclusionForSymbolsAndCircles&&g.push("DEPTH_OCCLUSION"),c.hasElevation&&!t.terrain&&(g.push("ELEVATED_ROADS"),m.push(c.elevatedLayoutVertexBuffer));const _=t.getOrCreateProgram("circle",{config:u,defines:g,overrideFog:y}),v=h.projection.createInversionMatrix(h,a.canonical),S={programConfiguration:u,program:_,layoutVertexBuffer:d,dynamicBuffers:m,indexBuffer:p,uniformValues:e.e1(t,a,s,v,x,n),tile:s};if(l){const t=c.segments.get();for(const r of t)w.push({segments:new e.bg([r]),sortKey:r.sortKey,state:S})}else w.push({segments:c.segments,sortKey:0,state:S})}l&&w.sort(((e,t)=>
1e.sortKey-t.sortKey));const S={useDepthForOcclusion:h.depthOcclusionForSymbolsAndCircles};for(const e of w){const{programConfiguration:r,program:i,layoutVertexBuffer:o,dynamicBuffers:a,indexBuffer:s,uniformValues:l,tile:c}=e.state,f=e.segments;t.terrain&&t.terrain.setupElevationDraw(c,i,S),t.uploadCommonUniforms(u,i,c.tileID.toUnwrapped()),i.draw(t,d.TRIANGLES,y,_,v,Qr.disabled,l,n.id,o,s,f,n.paint,h.zoom,r,a)}},heatmap:function(t,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,a=o.gl,s=Xr.disabled,l=new Wr([a.ONE,a.ONE,a.ONE,a.ONE],e.ao.transparent,[!0,!0,!0,!0]);!function(e,t,r,n){const i=e.gl,o=t.width*n,a=t.height*n;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,o,a]);let s=r.heatmapFbo;if(!s||s&&(s.width!==o||s.height!==a)){s&&s.destroy();const t=i.createTexture();i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),s=r.heatmapFbo=e.createFramebuffer(o,a,1,null),function(e,t,r,n,i,o){const a=e.gl;a.texImage2D(a.TEXTURE_2D,0,e.extRenderToTextureHalfFloat?a.RGBA16F:a.RGBA,i,o,0,a.RGBA,e.extRenderToTextureHalfFloat?a.HALF_FLOAT:a.UNSIGNED_BYTE,null),n.colorAttachment0.set(r)}(e,0,t,s,o,a)}else i.bindTexture(i.TEXTURE_2D,s.colorAttachment0.get()),e.bindFramebuffer.set(s.framebuffer)}(o,t,n,"globe"===t.transform.projection.name?.5:.25),o.clear({color:e.ao.transparent});const c=t.transform,u="globe"===c.projection.name,d=u?["PROJECTION_GLOBE_VIEW"]:[],h=u?Qr.frontCCW:Qr.disabled,f=[e.aF(c.center.lng),e.aJ(c.center.lat)];for(let e=0;e<i.length;e++){const p=i[e];if(r.hasRenderableParent(p))continue;const g=r.getTile(p),m=g.getBucket(n);if(!m||m.projection.name!==c.projection.name)continue;const y=t.isTileAffectedByFog(p),_=m.programConfigurations.get(n.id),v=t.getOrCreateProgram("heatmap",{config:_,defines:d,overrideFog:y}),{zoom:b}=t.transform;t.terrain&&t.terrain.setupElevationDraw(g,v),t.uploadCommonUniforms(o,v,p.toUnwrapped());const x=c.projection.createInversionMatrix(c,p.canonical);v.draw(t,a.TRIANGLES,Zr.disabled,s,l,h,Ro(t,p,g,x,f,b,n.paint.get("heatmap-intensity")),n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,n.paint,t.transform.zoom,_,u?[m.globeExtVertexBuffer]:null)}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,r){const n=t.context,i=n.gl,o=r.heatmapFbo;if(!o)return;n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment0.get()),n.activeTexture.set(i.TEXTURE1);let a=r.colorRampTexture;a||(a=r.colorRampTexture=new e.T(n,r.colorRamp,i.RGBA8)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.getOrCreateProgram("heatmapTexture").draw(t,i.TRIANGLES,Zr.disabled,Xr.disabled,t.colorModeForRenderPass(),Qr.disabled,((e,t)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,r),r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)}(t,n))},line:function(t,r,n,i){if("translucent"!==t.renderPass)return;const o=n.paint.get("line-opacity"),a=n.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=n.paint.get("line-emissive-strength").isConstant(),l=n.paint.get("line-emissive-strength").constantOr(0),c=n.paint.get("line-occlusion-opacity"),u=n.layout.get("line-elevation-reference"),d="meters"===n.layout.get("line-width-unit"),h="sea"===u,f=!(!t.terrain||!t.terrain.enabled),p=t.context,g=p.gl;if(n.hasElevatedBuckets&&"globe"===t.transform.projection.name)return;const m=n.layout.get("line-cross-slope"),y=void 0!==m,_=m<1,v=t.colorModeForDrapableLayerRenderPass(s?l:null),b=t.terrain&&t.terrain.renderingToTexture,x=b?1:e.o.devicePixelRatio,w=n.paint.get("line-dasharray"),S=w.constantOr(1),k=n.layout.get("line-cap"),T=w.constantOr(null),I=k.constantOr(null),M=n.paint.get("line-pattern"),E=M.constantOr(1),P=n.paint.get("line-pattern-cross-fade"),A=M.constantOr(null),C=n.paint.get("line-opacity").constantOr(1);let R=!E&&1!==C||t.depthOcclusion&&c>0&&c<1;const L=n.paint.get("line-gradient"),O=E?"linePattern":"line",D=e.e2(n);let z;if(b&&t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(R=!1),0!==c&&t.depthOcclusion){const t=n.paint._values["line-opacity"];t&&t.value&&"constant"===t.value.kind?z=t.value:e.w(`Occlusion opacity for layer ${n.id} is supported only when line-opacity isn't data-driven.`)}"constant"!==a.value.kind&&!1===a.value.isLineProgressConstant&&D.push("VARIABLE_LINE_WIDTH"),b&&("dual-source-blending"!==t.emissiveMode||s?"mrt-fallback"===t.emissiveMode&&D.push("USE_MRT1"):D.push("DUAL_SOURCE_BLENDING"));const F=(i,o,a,s,l,u)=>{for(const f of i){const i=r.getTile(f);if(E&&!i.patternsLoaded())continue;const m=i.getBucket(n);if(!m)continue;if("none"!==m.elevationType&&!l||"none"===m.elevationType&&l)continue;t.prepareDrawTile();const y=[...o],_=t.shadowRenderer,w="road"===m.elevationType&&!!_&&_.enabled;let k=[0,0,0];if(w){const e=t.style.directionalLight,r=t.style.ambientLight;e&&r&&(k=yn(t.style,e,r)),y.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET")}const M=m.programConfigurations.get(n.id);let D=!1;if(A&&i.imageAtlas){const t=e.e3.from(A),r=t.getPrimary().scaleSelf(x).toString(),n=i.imageAtlas.patternPositions.get(r),o=t.getSecondary(),a=o?i.imageAtlas.patternPositions.get(o.scaleSelf(x).toString()):null;D=!!n&&!!a,n&&M.setConstantPatternPositions(n,a)}P>0&&(D||M.getPatternTransitionVertexBuffer("line-pattern"))&&y.push("LINE_PATTERN_TRANSITION");const F=t.isTileAffectedByFog(f),N=t.getOrCreateProgram(O,{config:M,defines:y,overrideFog:F});if(!E&&T&&I&&i.lineAtlas){const e=i.lineAtlas.getDash(T,I);e&&M.setConstantPatternPositions(e)}w&&_.setupShadows(i.tileID.toUnwrapped(),N,"vector-tile");let[B,j]=n.paint.get("line-trim-offset");if("round"===I||"square"===I){const e=1;B!==j&&(0===B&&(B-=e),1===j&&(j+=e))}const V=b?f.projMatrix:null,G=d?1/m.tileToMeter/e.ay(i,1,t.transform.zoom):1,U=d?1/m.tileToMeter/e.ay(i,1,Math.floor(t.transform.zoom)):1,$=E?e.e4(t,i,n,V,x,G,U,[B,j],k,P):e.e5(t,i,n,V,m.lineClipsArray.length,x,G,U,[B,j],k);if(L){const i=m.gradients[n.id];let o=i.texture;if(n.gradientVersion!==i.version){let a=256;if(n.stepInterpolant){const n=r.getSource().maxzoom,i=f.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-f.canonical.z):1;a=e.aA(e.e6(m.maxLineLength/e.al*1024*i),256,p.maxTextureSize)}i.gradient=e.e7({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:a,image:i.gradient||void 0,clips:m.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new e.T(p,i.gradient,g.RGBA8),i.version=n.gradientVersion,o=i.texture}
1p.activeTexture.set(g.TEXTURE1),o.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}S&&(p.activeTexture.set(g.TEXTURE0),i.lineAtlasTexture&&i.lineAtlasTexture.bind(g.LINEAR,g.REPEAT),M.updatePaintBuffers()),E&&(p.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture&&i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),M.updatePaintBuffers()),l&&!h&&t.terrain.setupElevationDraw(i,N),t.uploadCommonUniforms(p,N,f.toUnwrapped());const H=e=>{null!=z&&(z.value=C*c),N.draw(t,g.TRIANGLES,a,e,v,Qr.disabled,$,n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,n.paint,t.transform.zoom,M,[m.layoutVertexBuffer2,m.patternVertexBuffer,m.zOffsetVertexBuffer]),null!=z&&(z.value=C)};if(R&&!l){const e=t.stencilModeForClipping(f).ref;0===e&&b&&p.clear({stencil:0});const r={func:g.EQUAL,mask:255};$.u_alpha_discard_threshold=.8,H(new Xr(r,e,255,g.KEEP,g.KEEP,g.INVERT)),$.u_alpha_discard_threshold=0,H(new Xr(r,e,255,g.KEEP,g.KEEP,g.KEEP))}else $.u_alpha_discard_threshold=R&&l&&u?.8:0,H(l?s:t.stencilModeForClipping(f))}};let N=t.depthModeForSublayer(0,Zr.ReadOnly);const B=new Zr(t.depthOcclusion?g.GREATER:g.LEQUAL,Zr.ReadOnly,t.depthRangeFor3D);if(n.hasNonElevatedBuckets){const r=!b&&t.terrain;0!==c&&r?e.w(`Occlusion opacity for layer ${n.id} is supported on terrain only if the layer has line-z-offset enabled.`):r?e.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${n.id}.`):F(i,D,N,Xr.disabled,!1,!0)}if(n.hasElevatedBuckets){"hd-road-markup"===u?f||(N=B,D.push("ELEVATED_ROADS")):(D.push("ELEVATED"),N=B,y&&D.push(_?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),h&&D.push("ELEVATION_REFERENCE_SEA"));const e=R?t.stencilModeFor3D():Xr.disabled;t.forceTerrainMode=!0,F(i,D,N,e,!0,!0),R&&F(i,D,N,e,!0,!1),t.forceTerrainMode=!1}R&&(t.resetStencilClippingMasks(),b&&p.clear({stencil:0})),0===c||t.depthOcclusion||b||t.layersWithOcclusionOpacity.push(t.currentLayer)},fill:function(t,r,n,i){const o=n.paint.get("fill-color"),a=n.paint.get("fill-opacity");if(0===a.constantOr(1))return;const s=n.paint.get("fill-emissive-strength"),l=t.colorModeForDrapableLayerRenderPass(s),c=n.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===o.constantOr(e.ao.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";let d="none";"none"!==n.layout.get("fill-elevation-reference")?d="road":0!==n.paint.get("fill-z-offset").constantOr(1)&&(d="offset");const h=!(!t.terrain||!t.terrain.enabled),f={painter:t,sourceCache:r,layer:n,coords:i,colorMode:l,elevationType:d,terrainEnabled:h,pass:u};if("shadow"===t.renderPass)return void(t.shadowRenderer&&"road"===d&&!h&&function(e){const{painter:t,sourceCache:r,layer:n,coords:i}=e,o=t.context.gl,a=e.painter.shadowRenderer;for(const e of i){const i=r.getTile(e),s=i.getBucket(n);if(!s)continue;const l=s.elevatedStructures;if(!l)continue;if(!l.shadowCasterSegments||0===l.shadowCasterSegments.segments[0].primitiveLength)continue;t.prepareDrawTile();const c=s.bufferData.programConfigurations.get(n.id),u=t.isTileAffectedByFog(e),d=t.getOrCreateProgram("elevatedStructuresDepth",{config:c,overrideFog:u}),h=a.calculateShadowPassMatrixFromTile(i.tileID.toUnwrapped());t.uploadCommonUniforms(t.context,d,e.toUnwrapped());const f=wo(h,0);d.draw(t,o.TRIANGLES,a.getShadowPassDepthMode(),Xr.disabled,a.getShadowPassColorMode(),Qr.disabled,f,n.id,l.vertexBuffer,l.indexBuffer,l.shadowCasterSegments,n.paint,t.transform.zoom,c)}}(f));const p="mrt-fallback"===t.emissiveMode;if("offset"!==d){if(ua(f,!1,p),"road"===d){const e=!h&&"translucent"===t.renderPass;e&&ca(t,r,n,i,"geometry"),ua(f,!0,p,Xr.disabled),e&&function(e){const{painter:t,sourceCache:r,layer:n,coords:i,colorMode:o}=e,a=t.context.gl,s=e.painter.shadowRenderer,l=!!s&&s.enabled,c=new Zr(t.context.gl.LEQUAL,Zr.ReadOnly,t.depthRangeFor3D);let u=[0,0,0];if(l){const e=t.style.directionalLight,r=t.style.ambientLight;e&&r&&(u=yn(t.style,e,r))}const d=e=>{for(const d of i){const i=r.getTile(d),h=i.getBucket(n);if(!h)continue;const f=h.elevatedStructures;if(!f)continue;let p,g;if(e?(p=f.renderableBridgeSegments,g=f.bridgeProgramConfigurations.get(n.id)):(p=f.renderableTunnelSegments,g=f.tunnelProgramConfigurations.get(n.id)),!p||0===p.segments[0].primitiveLength)continue;g.updatePaintBuffers(),t.prepareDrawTile();const m=t.isTileAffectedByFog(d),y=[];l&&y.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET");const _=t.getOrCreateProgram("elevatedStructures",{config:g,overrideFog:m,defines:y}),v=t.translatePosMatrix(d.projMatrix,i,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));l&&s.setupShadows(i.tileID.toUnwrapped(),_,"vector-tile");const b=So(v,u);t.uploadCommonUniforms(t.context,_,d.toUnwrapped()),_.draw(t,a.TRIANGLES,c,Xr.disabled,o,Qr.backCCW,b,n.id,f.vertexBuffer,f.indexBuffer,p,n.paint,t.transform.zoom,g,[f.vertexBufferNormal])}};d(!0),d(!1)}(f)}}else ua(f,!1,p,t.stencilModeFor3D())},"fill-extrusion":function(t,r,n,i){const o=n.paint.get("fill-extrusion-opacity"),a=t.context,s=a.gl,l=t.terrain,c=l&&l.renderingToTexture;if(0===o)return;const u="mrt-fallback"===t.emissiveMode,d=t.conflationActive&&t.style.isLayerClipped(n,r.getSource()),h=t.style.order.indexOf(n.fqid);if(d&&function(e,t,r,n,i){for(const o of n){const n=t.getTile(o).getBucket(r);
1n&&(n.updateReplacement(o,e.replacementSource,i),n.uploadCentroid(e.context))}}(t,r,n,i,h),l||d)for(const e of i){const i=r.getTile(e).getBucket(n);i&&pa(t.context,r,e,i,n,l,d)}if("shadow"===t.renderPass&&t.shadowRenderer){const a=t.shadowRenderer;if(l&&o<.65&&n._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.ad)return;const s=a.getShadowPassDepthMode(),c=a.getShadowPassColorMode();da(t,r,n,i,s,Xr.disabled,c,d)}else if("translucent"===t.renderPass){const h=!n.paint.get("fill-extrusion-pattern").constantOr(1),f=n.paint.get("fill-extrusion-color").constantOr(e.ao.white);if(!c&&0!==f.a){const e=new Zr(t.context.gl.LEQUAL,Zr.ReadWrite,t.depthRangeFor3D);1===o&&h?da(t,r,n,i,e,Xr.disabled,Wr.unblended,d):(da(t,r,n,i,e,Xr.disabled,Wr.disabled,d),da(t,r,n,i,e,t.stencilModeFor3D(),t.colorModeForRenderPass(),d),t.resetStencilClippingMasks())}if(t.style.enable3dLights()&&h&&(!l&&"globe"!==t.transform.projection.name||c)){const o=n.paint.get("fill-extrusion-opacity"),h=n.paint.get("fill-extrusion-ambient-occlusion-intensity"),f=n.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),p=n.paint.get("fill-extrusion-flood-light-intensity"),g="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),m=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(g?null:n.lut).toArray01().slice(0,3),y=h>0&&f>0,_=p>0,v=(e,t,r)=>(1-r)*e+r*t,b=new ha;b.translate=n.paint.get("fill-extrusion-translate"),b.translateAnchor=n.paint.get("fill-extrusion-translate-anchor"),b.edgeRadius=n.layout.get("fill-extrusion-edge-radius"),b.cutoffFadeRange=n.paint.get("fill-extrusion-cutoff-fade-range");const x=a=>{const l=t.depthModeForSublayer(1,Zr.ReadOnly,s.LEQUAL,!0),c=n.paint.get(a?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),u=v(.1,3,c),g=t._showOverdrawInspector;if(!g){const c=new Xr({func:s.ALWAYS,mask:255},255,255,s.KEEP,s.KEEP,s.REPLACE),g=new Wr([s.ONE,s.ONE,s.ONE,s.ONE],e.ao.transparent,[!1,!1,!1,!0],s.MIN);fa(b,t,r,n,i,l,c,g,Qr.disabled,a,"sdf",o,h,f,p,m,u,d,!1)}{const c=g?Xr.disabled:new Xr({func:s.EQUAL,mask:255},255,255,s.KEEP,s.DECR,s.DECR),y=g?t.colorModeForRenderPass():new Wr([s.ONE_MINUS_DST_ALPHA,s.DST_ALPHA,s.ONE,s.ONE],e.ao.transparent,[!0,!0,!0,!0]);fa(b,t,r,n,i,l,c,y,Qr.disabled,a,"color",o,h,f,p,m,u,d,!1)}};if(c){const c=()=>{const t=l.drapeBufferSize[0],r=l.drapeBufferSize[1];let n=l.framebufferCopyTexture;return n&&(!n||n.size[0]===t&&n.size[1]===r)||(n&&n.destroy(),n=l.framebufferCopyTexture=new e.T(a,new e.q({width:t,height:r}),s.RGBA8)),n.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.copyTexSubImage2D(s.TEXTURE_2D,0,0,0,0,0,t,r),n},g=(a,l,g)=>{const y=t.depthModeForSublayer(1,Zr.ReadOnly,s.LEQUAL,!1),_=n.paint.get(a?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),x=v(.1,3,_);{const c=new Wr([s.ONE,s.ONE,s.ONE,s.ONE],e.ao.transparent,[!1,!1,!1,!0]);fa(b,t,r,n,i,y,Xr.disabled,c,Qr.disabled,a,"clear",o,h,f,p,m,x,d,l)}{const c=new Xr({func:s.ALWAYS,mask:255},255,255,s.KEEP,s.KEEP,s.REPLACE),u=new Wr([s.ONE,s.ONE,s.ONE,s.ONE],e.ao.transparent,[!1,!1,!1,!0],s.MIN);fa(b,t,r,n,i,y,c,u,Qr.disabled,a,"sdf",o,h,f,p,m,x,d,l)}u&&!a&&(g=c());{const c=a?s.ZERO:s.ONE_MINUS_DST_ALPHA,u=new Xr({func:s.EQUAL,mask:255},255,255,s.KEEP,s.DECR,s.DECR),g=new Wr([c,s.DST_ALPHA,s.ONE_MINUS_DST_ALPHA,s.ZERO],e.ao.transparent,[!0,!0,!0,!0]);fa(b,t,r,n,i,y,u,g,Qr.disabled,a,"color",o,h,f,p,m,x,d,l)}if(!u||a){const c=new Wr([s.ONE,s.ONE,s.ONE,a?s.ZERO:s.ONE],e.ao.transparent,[!1,!1,!1,!0],a?s.FUNC_ADD:s.MAX);fa(b,t,r,n,i,y,Xr.disabled,c,Qr.disabled,a,"clear",o,h,f,p,m,x,d,l,g)}else{s.drawBuffers([s.NONE,s.COLOR_ATTACHMENT1]);const c=new Xr({func:s.EQUAL,mask:255},254,255,s.KEEP,s.DECR,s.DECR),u=new Wr([s.ONE,s.ONE,s.ONE,s.ONE],e.ao.transparent,[!0,!1,!1,!1],s.MAX);fa(b,t,r,n,i,y,c,u,Qr.disabled,a,"emissive",o,h,f,p,m,x,d,l,g),s.drawBuffers([s.COLOR_ATTACHMENT0])}};if(y||_){let e;t.prepareDrawTile(),u&&!y||(e=c()),y&&g(!0,!1,e),_&&g(!1,!0,e)}}else y&&x(!0),_&&x(!1),(y||_)&&t.resetStencilClippingMasks()}}},building:function(e,t,r,n){e.currentLayer<e.firstLightBeamLayer&&(e.firstLightBeamLayer=e.currentLayer);const i=r.paint.get("building-ambient-occlusion-ground-intensity"),o=r.paint.get("building-ambient-occlusion-ground-radius"),a=r.paint.get("building-ambient-occlusion-ground-attenuation"),s=r.paint.get("building-opacity");if(s<=0)return;let l=i>0&&o>0,c=!0;const u=r.paint.get("building-vertical-scale");if(u<=0)return;e.shadowRenderer||(c=!1);const d=e.conflationActive&&e.style.isLayerClipped(r,t.getSource()),h=e.style.order.indexOf(r.fqid);if(function(e,t,r,n,i,o){for(const a of o){const o=t.getTile(a).getBucket(r);o&&(i&&o.updateReplacement(a,e.replacementSource,n),o.uploadUpdatedIndexBuffer(e.context))}}(e,t,r,h,d,n),function(e,t,r,n){for(const i of n){const n=t.getTile(i).getBucket(r);n&&n.needsEvaluation()&&n.uploadUpdatedColorBuffer(e.context)}}(e,t,r,n),r.resetLayerRenderingStats(e),e.shadowRenderer&&(e.shadowRenderer.useNormalOffset=!0),"shadow"===e.renderPass&&e.shadowRenderer){const i=e.shadowRenderer,o=[],a=i.getShadowPassDepthMode();va({painter:e,source:t,layer:r,coords:n,defines:o,blendMode:i.getShadowPassColorMode(),depthMode:a,opacity:s,verticalScale:u,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}else if("translucent"===e.renderPass){let h=["HAS_ATTRIBUTE_a_part_color_emissive","LIGHTING_3D_MODE"];c&&(h=h.concat("RENDER_SHADOWS","DEPTH_TEXTURE")),e.shadowRenderer&&e.shadowRenderer.useNormalOffset&&(h=h.concat("NORMAL_OFFSET"));const f=r.paint.get("building-facade-emissive-chance"),p=r.paint.get("building-ambient-occlusion-intensity"),g=r.paint.get("building-flood-light-intensity"),m="none"===r.paint.get("building-flood-light-color-use-theme").
1constantOr("default"),y=r.paint.get("building-flood-light-color").toNonPremultipliedRenderColor(m?null:r.lut).toArray01().slice(0,3),_=r.paint.get("building-flood-light-ground-attenuation"),v=g>0,b=new Zr(e.context.gl.LEQUAL,Zr.ReadWrite,e.depthRangeFor3D);s<1&&va({painter:e,source:t,layer:r,coords:n,defines:h,blendMode:Wr.disabled,depthMode:b,opacity:s,verticalScale:u,facadeEmissiveChance:f,facadeAOIntensity:p,floodLightIntensity:g,floodLightColor:y,depthOnly:!0});const x=e.colorModeForRenderPass();va({painter:e,source:t,layer:r,coords:n,defines:h,blendMode:x,depthMode:b,opacity:s,verticalScale:u,facadeEmissiveChance:f,facadeAOIntensity:p,floodLightIntensity:g,floodLightColor:y}),l&&ba(e,t,r,n,!0,s,i,o,g,y,a,d),v&&ba(e,t,r,n,!1,s,i,o,g,y,_,d)}else if("light-beam"===e.renderPass){const i=["HAS_ATTRIBUTE_a_part_color_emissive","HAS_ATTRIBUTE_a_bloom_attenuation"],o=new Zr(e.context.gl.LEQUAL,Zr.ReadOnly,e.depthRangeFor3D);va({painter:e,source:t,layer:r,coords:n,defines:i,blendMode:Wr.alphaBlended,depthMode:o,opacity:s,verticalScale:u,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}e.shadowRenderer&&(e.shadowRenderer.useNormalOffset=!1),e.resetStencilClippingMasks()},hillshade:function(e,t,r,n){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;if(e.style.disableElevatedTerrain)return;const i=e.context,o=e.terrain&&e.terrain.renderingToTexture,[a,s]="translucent"!==e.renderPass||o?[{},n]:e.stencilConfigForOverlap(n);for(const n of s){const i=t.getTile(n);if(i.needsHillshadePrepare&&"offscreen"===e.renderPass)ci(e,i,r);else if("translucent"===e.renderPass){const t=e.depthModeForSublayer(0,Zr.ReadOnly),s=r.paint.get("hillshade-emissive-strength"),l=e.colorModeForDrapableLayerRenderPass(s),c=o&&e.terrain?e.terrain.stencilModeForRTTOverlap(n):a[n.overscaledZ];si(e,n,i,r,t,c,l)}}i.viewport.set([0,0,e.width,e.height]),e.resetStencilClippingMasks()},raster:function(t,r,n,i,o,a){if("translucent"!==t.renderPass)return;if(0===n.paint.get("raster-opacity"))return;const s="globe"===t.transform.projection.name,l=0!==n.paint.get("raster-elevation"),c=l&&s;if(t.renderElevatedRasterBackface&&!c)return;const u=t.context,d=u.gl,h=r.getSource(),f=function(t,r,n,i,o){const a=r.paint.get("raster-color"),s="raster-array"===t.type,l=[],c=r.paint.get("raster-resampling"),u=r.paint.get("raster-color-mix");let d=r.paint.get("raster-color-range");const h=[u[0],u[1],u[2],0],f=u[3];let p="nearest"===c?i.NEAREST:i.LINEAR;if(s&&(l.push("RASTER_ARRAY"),a||l.push("RASTER_COLOR"),"linear"===c&&l.push("RASTER_ARRAY_LINEAR"),p=i.NEAREST,!d&&t.rasterLayers)){const e=t.rasterLayers.find((({id:e})=>e===r.sourceLayer));e&&e.fields&&e.fields.range&&(d=e.fields.range)}if(d=d||[0,1],a){l.push("RASTER_COLOR"),n.activeTexture.set(i.TEXTURE2),r.updateColorRamp(d);let t=r.colorRampTexture;t||(t=r.colorRampTexture=new e.T(n,r.colorRamp,i.RGBA8)),t.bind(p,i.CLAMP_TO_EDGE)}return o&&l.push("USE_MRT1"),{mix:h,range:d,offset:f,defines:l,resampling:p}}(h,n,u,d,t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode);if(h instanceof e.aU&&!i.length&&!s)return;const p=n.paint.get("raster-emissive-strength"),g=t.colorModeForDrapableLayerRenderPass(p),m=t.terrain&&t.terrain.renderingToTexture,y=!t.options.moving,_="nearest"===n.paint.get("raster-resampling")?d.NEAREST:d.LINEAR;if(h instanceof e.aU&&!i.length&&(h.onNorthPole||h.onSouthPole)){const e=l?t.stencilModeFor3D():Xr.disabled;return void wa(!!h.onNorthPole,null,t,r,n,p,f,Qr.disabled,e)}if(!i.length)return;const[v,b]=h instanceof e.aU||m?[{},i]:t.stencilConfigForOverlap(i),x=b[b.length-1].overscaledZ;c&&f.defines.push("PROJECTION_GLOBE_VIEW"),l&&f.defines.push("RENDER_CUTOFF");const w=(i,o,b)=>{for(const w of i){const i=w.toUnwrapped(),S=r.getTile(w);if(m&&(!S||!S.hasData()))continue;u.activeTexture.set(d.TEXTURE0);const k=ka(S,h,n,f);if(!k||!k.texture)continue;const{texture:T,mix:I,offset:M,tileSize:E,buffer:P}=k;let A,C;m?(A=Zr.disabled,C=w.projMatrix):l?(A=new Zr(d.LEQUAL,Zr.ReadWrite,t.depthRangeFor3D),C=s?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(i,y)):(A=t.depthModeForSublayer(w.overscaledZ-x,1===n.paint.get("raster-opacity")?Zr.ReadWrite:Zr.ReadOnly,d.LESS),C=t.transform.calculateProjMatrix(i,y));const R=t.terrain&&m?t.terrain.stencilModeForRTTOverlap(w):v[w.overscaledZ],L=a?0:n.paint.get("raster-fade-duration");S.registerFadeDuration(L);const O=r.findLoadedParent(w,0),D=ro(S,O,r,t.transform,L);let z,F;!D.isFading&&S.refreshedUponExpiration&&(S.refreshedUponExpiration=!1),t.terrain&&t.terrain.prepareDrawTile(),u.activeTexture.set(d.TEXTURE0),T.bind(_,d.CLAMP_TO_EDGE),u.activeTexture.set(d.TEXTURE1),O?(O.texture&&O.texture.bind(_,d.CLAMP_TO_EDGE),z=Math.pow(2,O.tileID.overscaledZ-S.tileID.overscaledZ
1),F=[S.tileID.canonical.x*z%1,S.tileID.canonical.y*z%1]):T.bind(_,d.CLAMP_TO_EDGE),"useMipmap"in T&&u.extTextureFilterAnisotropic&&t.transform.pitch>20&&d.texParameterf(d.TEXTURE_2D,u.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u.extTextureFilterAnisotropicMax);const N=t.transform;let B;const j=l?Sa(N):[0,0,0,0];let V,G,U,$,H,q=0;if(c&&h instanceof e.aU&&h.coordinates.length>3)V=Float32Array.from(e.bk(e.dJ(new e.cD(0,0,0)))),G=Float32Array.from(N.globeMatrix),U=Float32Array.from(e.dF(N)),$=[e.aF(N.center.lng),e.aJ(N.center.lat)],B=h.elevatedGlobePerspectiveTransform,H=h.elevatedGlobeGridMatrix||new Float32Array(9);else if(c){const t=e.dG(w.canonical);q=e.dH(t.getCenter().lat),V=Float32Array.from(e.bk(e.dJ(w.canonical))),G=Float32Array.from(N.globeMatrix),U=Float32Array.from(e.dF(N)),$=[e.aF(N.center.lng),e.aJ(N.center.lat)],B=[0,0],H=Float32Array.from(e.dI(w.canonical,t,q,N.worldSize/N._pixelsPerMercatorPixel))}else B=h instanceof e.aU?h.perspectiveTransform:[0,0],V=new Float32Array(16),G=new Float32Array(9),U=new Float32Array(16),$=[0,0],H=new Float32Array(9);const W=Do(C,V,G,U,H,F||[0,0],e.aj(t.transform.zoom),$,j,z||1,D,n,B,l?n.paint.get("raster-elevation"):0,2,I,M,f.range,E,P,p),Z=t.isTileAffectedByFog(w),Y=t.getOrCreateProgram("raster",{defines:f.defines,overrideFog:Z});if(t.uploadCommonUniforms(u,Y,i),h instanceof e.aU){const r=h.elevatedGlobeVertexBuffer,i=h.elevatedGlobeIndexBuffer;if(m||!s)h.boundsBuffer&&h.boundsSegments&&Y.draw(t,d.TRIANGLES,A,Xr.disabled,g,Qr.disabled,W,n.id,h.boundsBuffer,t.quadTriangleIndexBuffer,h.boundsSegments);else if(r&&i){const a=N.zoom<=e.c_?h.elevatedGlobeSegments:h.getSegmentsForLongitude(N.center.lng);a&&Y.draw(t,d.TRIANGLES,A,Xr.disabled,g,o,W,n.id,r,i,a)}}else if(c){A=new Zr(d.LEQUAL,Zr.ReadOnly,t.depthRangeFor3D);const e=t.globeSharedBuffers;if(e){const[r,i,a]=e.getGridBuffers(q,!1);Y.draw(t,d.TRIANGLES,A,b||R,t.colorModeForRenderPass(),o,W,n.id,r,i,a)}}else{const{tileBoundsBuffer:e,tileBoundsIndexBuffer:r,tileBoundsSegments:i}=t.getTileBoundsBuffers(S);Y.draw(t,d.TRIANGLES,A,R,g,Qr.disabled,W,n.id,e,r,i)}}if(!(h instanceof e.aU)&&c)for(const e of i){const i=e.canonical.y===(1<<e.canonical.z)-1;0===e.canonical.y&&wa(!0,e,t,r,n,p,f,o,b||Xr.disabled),i&&wa(!1,e,t,r,n,p,f,o===Qr.frontCW?Qr.backCW:Qr.frontCW,b||Xr.disabled)}};c?w(b,t.renderElevatedRasterBackface?Qr.backCW:Qr.frontCW,t.stencilModeFor3D()):w(b,Qr.disabled,void 0),t.resetStencilClippingMasks()},"raster-particle":function(t,r,n,i,o,a){"offscreen"===t.renderPass&&function(t,r,n,i){if(!i.length)return;const o=t.context,a=o.gl,s=r.getSource();if(!(s instanceof pt))return;const l=Math.ceil(Math.sqrt(n.paint.get("raster-particle-count")));let c=n.particlePositionRGBAImage;if(!c||c.width!==l){const t=function(e){const t=e*e,r=new Uint8Array(4*t),n=function(e){return e|=0,e=Math.imul(2747636419^e,2654435769),e=Math.imul(e^e>>>16,2654435769),((e=Math.imul(e^e>>>16,2654435769))>>>0)/4294967296},i=.9090909090909091;for(let e=0;e<t;e++){const t=i*(n(2*e+0)+Fo),o=i*(n(2*e+1)+Fo),a=255*t%1,s=255*o%1,l=a,c=o-s/255,u=s;r[4*e+0]=255*(t-a/255),r[4*e+1]=255*l,r[4*e+2]=255*c,r[4*e+3]=255*u}return r}(l);c=n.particlePositionRGBAImage=new e.q({width:l,height:l},t)}let u=n.particleFramebuffer;u?u.width!==l&&(u.destroy(),u=n.particleFramebuffer=o.createFramebuffer(l,l,1,null)):u=n.particleFramebuffer=o.createFramebuffer(l,l,1,null);const d=[];for(const e of i){const t=r.getTile(e);if(!(t instanceof Lt))continue;const i=Ma(t,s,n);if(!i)continue;const a=[t.tileSize,t.tileSize];let u=n.tileFramebuffer;u||(u=n.tileFramebuffer=o.createFramebuffer(a[0],a[1],1,null));let h=t.rasterParticleState;h||(h=t.rasterParticleState=new Ia(o,e,a,c));const f=h.update(n.lastInvalidatedAt);h.particleTextureDimension!==l&&h.updateParticleTexture(e,c);const p=h.targetColorTexture;h.targetColorTexture=h.backgroundColorTexture,h.backgroundColorTexture=p;const g=h.particleTexture0;h.particleTexture0=h.particleTexture1,h.particleTexture1=g,d.push([e,i,h,f])}if(0===d.length)return;const h=e.o.now(),f=n.previousDrawTimestamp?.001*(h-n.previousDrawTimestamp):.0167;if(n.previousDrawTimestamp=h,n.hasColorMap()){o.activeTexture.set(a.TEXTURE0+2);let t=n.colorRampTexture;t||(t=n.colorRampTexture=new e.T(o,n.colorRamp,a.RGBA8)),t.bind(a.LINEAR,a.CLAMP_TO_EDGE)}o.bindFramebuffer.set(n.tileFramebuffer.framebuffer),function(t,r,n){const i=t.context,o=i.gl,a=r.tileFramebuffer;i.activeTexture.set(o.TEXTURE0);const s={u_texture:0,u_opacity:1.05*(c=r.paint.get("raster-particle-fade-opacity-factor"))/(c+.05)},l=t.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var c;for(const c of n){const[,,n,u]=c;a.colorAttachment0.set(n.targetColorTexture.texture),i.viewport.set([0,0,a.width,a.height]),i.clear({color:e.ao.transparent}),u&&(n.backgroundColorTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),l.draw(t,o.TRIANGLES,Zr.disabled,Xr.disabled,Wr.alphaBlended,Qr.disabled,s,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments))}}(t,n,d),function(t,r,n,i){const o=t.context,a=o.gl,s=n.tileFramebuffer,l="globe"===t.transform.projection.name,c=n.paint.get("raster-particle-max-speed");for(const u of i){const[i,d,h]=u;o.activeTexture.set(a.TEXTURE0+0),d.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.colorAttachment0.set(h.targetColorTexture.texture);const f=t.getOrCreateProgram("rasterParticleDraw",{defines:d.defines,overrideFog:!1});o.activeTexture.set(a.TEXTURE0+1);const p=d.scalarData?[]:[0,1,2,3].map((t=>
vendor: 4,553 bytes, line 1
1e.e9[t](i)));p.push(i);const g=i.canonical.x,m=i.canonical.y;for(const e of p){const o=r.getTile(l?e.wrapped():e);if(!o)continue;const s=o.rasterParticleState;if(!s)continue;const u=e.canonical.x+(1<<e.canonical.z)*(e.wrap-i.wrap),h=e.canonical.y;s.particleTexture0.bind(a.NEAREST,a.CLAMP_TO_EDGE);const p=Bo(1,s.particleTexture0.size[0],[u-g,h-m],0,d.texture.size,2,c,d.textureOffset,d.scale,d.offset);f.draw(t,a.POINTS,Zr.disabled,Xr.disabled,Wr.alphaBlended,Qr.disabled,p,n.id,s.particleIndexBuffer,void 0,s.particleSegment)}}}(t,r,n,d),o.bindFramebuffer.set(n.particleFramebuffer.framebuffer),function(t,r,n,i){const o=t.context,a=o.gl,s=r.paint.get("raster-particle-max-speed"),l=i*r.paint.get("raster-particle-speed-factor")*.15,c=function(e){return Math.pow(e,6)}(.01+1*r.paint.get("raster-particle-reset-rate-factor")),u=r.particleFramebuffer;o.viewport.set([0,0,u.width,u.height]);for(const i of n){const[,n,d]=i;o.activeTexture.set(a.TEXTURE0+0),n.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),o.activeTexture.set(a.TEXTURE0+1);const h=d.particleTexture0;h.bind(a.NEAREST,a.CLAMP_TO_EDGE);const f=jo(1,h.size[0],0,n.texture.size,s,l,c,n.textureOffset,n.scale,n.offset);u.colorAttachment0.set(d.particleTexture1.texture),o.clear({color:e.ao.transparent}),t.getOrCreateProgram("rasterParticleUpdate",{defines:n.defines}).draw(t,a.TRIANGLES,Zr.disabled,Xr.disabled,Wr.unblended,Qr.disabled,f,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}}(t,n,d,f)}(t,r,n,i),"translucent"===t.renderPass&&(function(t,r,n,i){const o=t.context,a=o.gl,s=r.getSource().tileSize,l=5*(1-e.ah(e.cL,e.cL+1,t.transform.zoom))*s+n.paint.get("raster-particle-elevation"),c=!t.options.moving,u="globe"===t.transform.projection.name;if(!i.length)return;const[d,h]=t.stencilConfigForOverlap(i),f=[];u&&f.push("PROJECTION_GLOBE_VIEW");const p=t.stencilModeFor3D();for(const i of h){const s=i.toUnwrapped(),h=r.getTile(i);if(!h.rasterParticleState)continue;const g=h.rasterParticleState,m=100;h.registerFadeDuration(m);const y=r.findLoadedParent(i,0),_=ro(h,y,r,t.transform,m);let v,b;t.terrain&&t.terrain.prepareDrawTile(),o.activeTexture.set(a.TEXTURE0),g.targetColorTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),o.activeTexture.set(a.TEXTURE1),y&&y.rasterParticleState?(y.rasterParticleState.targetColorTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),v=Math.pow(2,y.tileID.overscaledZ-h.tileID.overscaledZ),b=[h.tileID.canonical.x*v%1,h.tileID.canonical.y*v%1]):g.targetColorTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const x=u?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(s,c),w=t.transform,S=Ea(w),k=e.dG(i.canonical),T=e.dH(k.getCenter().lat);let I,M,E,P,A;u?(I=Float32Array.from(e.bk(e.dJ(i.canonical))),M=Float32Array.from(w.globeMatrix),E=Float32Array.from(e.dF(w)),P=[e.aF(w.center.lng),e.aJ(w.center.lat)],A=Float32Array.from(e.dI(i.canonical,k,T,w.worldSize/w._pixelsPerMercatorPixel))):(I=new Float32Array(16),M=new Float32Array(9),E=new Float32Array(16),P=[0,0],A=new Float32Array(9));const C=No(x,I,M,E,A,b||[0,0],e.aj(t.transform.zoom),P,S,v||1,_,l),R=t.isTileAffectedByFog(i),L=t.getOrCreateProgram("rasterParticle",{defines:f,overrideFog:R});if(t.uploadCommonUniforms(o,L,s),u){const e=new Zr(a.LEQUAL,Zr.ReadOnly,t.depthRangeFor3D),r=0,i=t.globeSharedBuffers;if(i){const[o,s,l]=i.getGridBuffers(T,0!==r);L.draw(t,a.TRIANGLES,e,p,Wr.alphaBlended,t.renderElevatedRasterBackface?Qr.frontCCW:Qr.backCCW,C,n.id,o,s,l)}}else{const e=t.depthModeForSublayer(0,Zr.ReadOnly),r=d[i.overscaledZ],{tileBoundsBuffer:o,tileBoundsIndexBuffer:s,tileBoundsSegments:l}=t.getTileBoundsBuffers(h);L.draw(t,a.TRIANGLES,e,r,Wr.alphaBlended,Qr.disabled,C,n.id,o,s,l)}}t.resetStencilClippingMasks()}(t,r,n,i),t.style.map.triggerRepaint())},background:function(t,r,n,i){const o=n.paint.get("background-color"),a="none"===n.paint.get("background-color-use-theme").constantOr("default"),s=n.paint.get("background-opacity"),l=n.paint.get("background-emissive-strength"),c="viewport"===n.paint.get("background-pitch-alignment");if(0===s)return;const u=t.context,d=u.gl,h=t.transform,f=h.tileSize,p=n.paint.get("background-pattern");let g;if(void 0!==p){if(null===p)return;if(g=t.imageManager.getPattern(e.I.from(p.toString()),n.scope,t.style.getLut(n.scope)),!g)return}const m=!p&&1===o.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==m)return;const y=Xr.disabled,_=t.depthModeForSublayer(0,"opaque"===m?Zr.ReadWrite:Zr.ReadOnly),v=t.colorModeForDrapableLayerRenderPass(l),b=p?"backgroundPattern":"background";let x,w=i;
1w||(x=t.getBackgroundTiles(),w=Object.values(x).map((e=>e.tileID))),p&&(u.activeTexture.set(d.TEXTURE0),t.imageManager.bind(t.context,n.scope));const S=[];if(t.terrain&&t.terrain.renderingToTexture&&"mrt-fallback"===t.emissiveMode&&S.push("USE_MRT1"),c){const r=t.getOrCreateProgram(b,{overrideFog:!1,overrideRtt:!0,defines:S}),i=new Float32Array(e.bA([])),u=new e.aQ(0,0,0,0,0),h=p?$o(i,l,s,t,0,n.scope,g,c,{tileID:u,tileSize:f}):Uo(i,l,s,o.toPremultipliedRenderColor(a?null:n.lut));r.draw(t,d.TRIANGLES,_,y,v,Qr.disabled,h,n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}else for(const e of w){const m=t.isTileAffectedByFog(e),w=t.getOrCreateProgram(b,{overrideFog:m,defines:S}),k=e.toUnwrapped(),T=i?e.projMatrix:t.transform.calculateProjMatrix(k);t.prepareDrawTile();const I=r?r.getTile(e):x?x[e.key]:new Rt(e,f,h.zoom,t),M=p?$o(T,l,s,t,0,n.scope,g,c,{tileID:e,tileSize:f}):Uo(T,l,s,o.toPremultipliedRenderColor(a?null:n.lut));t.uploadCommonUniforms(u,w,k);const{tileBoundsBuffer:E,tileBoundsIndexBuffer:P,tileBoundsSegments:A}=t.getTileBoundsBuffers(I);w.draw(t,d.TRIANGLES,_,y,v,Qr.disabled,M,n.id,E,P,A)}},sky:function(t,r,n){const i=t._atmosphere?e.aj(t.transform.zoom):1,o=n.paint.get("sky-opacity")*i;if(0===o)return;const a=t.context,s=n.paint.get("sky-type"),l=new Zr(a.gl.LEQUAL,Zr.ReadOnly,[0,1]),c=t.frameCounter/1e3%1;"atmosphere"===s?"offscreen"===t.renderPass?n.needsSkyboxCapture(t)&&(function(t,r){const n=t.context,i=n.gl;let o=r.skyboxFbo;if(!o){o=r.skyboxFbo=n.createFramebuffer(32,32,1,null),r.skyboxGeometry=new Ga(n),r.skyboxTexture=n.gl.createTexture(),i.bindTexture(i.TEXTURE_CUBE_MAP,r.skyboxTexture),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR);for(let e=0;e<6;++e)i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,i.RGBA,32,32,0,i.RGBA,i.UNSIGNED_BYTE,null)}n.bindFramebuffer.set(o.framebuffer),n.viewport.set([0,0,32,32]);const a=r.getCenter(t,!0),s=t.getOrCreateProgram("skyboxCapture"),l=new Float64Array(16);e.bA(l),e.en(l,l,.5*-Math.PI),Ua(t,r,s,l,a,0),e.bA(l),e.en(l,l,.5*Math.PI),Ua(t,r,s,l,a,1),e.bA(l),e.cU(l,l,.5*-Math.PI),Ua(t,r,s,l,a,2),e.bA(l),e.cU(l,l,.5*Math.PI),Ua(t,r,s,l,a,3),e.bA(l),Ua(t,r,s,l,a,4),e.bA(l),e.en(l,l,Math.PI),Ua(t,r,s,l,a,5),n.viewport.set([0,0,t.width,t.height])}(t,n),n.markSkyboxValid(t)):"sky"===t.renderPass&&function(e,t,r,n,i){const o=e.context,a=o.gl,s=e.transform,l=e.getOrCreateProgram("skybox");o.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_CUBE_MAP,t.skyboxTexture);const c=((e,t,r,n,i)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:n,u_temporal_offset:i}))(s.skyboxMatrix,t.getCenter(e,!1),0,n,i);e.uploadCommonUniforms(o,l),l.draw(e,a.TRIANGLES,r,Xr.disabled,e.colorModeForRenderPass(),Qr.backCW,c,"skybox",t.skyboxGeometry.vertexBuffer,t.skyboxGeometry.indexBuffer,t.skyboxGeometry.segment)}(t,n,l,o,c):"gradient"===s&&"sky"===t.renderPass&&function(t,r,n,i,o){const a=t.context,s=a.gl,l=t.transform,c=t.getOrCreateProgram("skyboxGradient");r.skyboxGeometry||(r.skyboxGeometry=new Ga(a)),a.activeTexture.set(s.TEXTURE0);let u=r.colorRampTexture;u||(u=r.colorRampTexture=new e.T(a,r.colorRamp,s.RGBA8)),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);const d=((t,r,n,i,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:r,u_radius:e.an(n),u_opacity:i,u_temporal_offset:o}))(l.skyboxMatrix,r.getCenter(t,!1),r.paint.get("sky-gradient-radius"),i,o);t.uploadCommonUniforms(a,c),c.draw(t,s.TRIANGLES,n,Xr.disabled,t.colorModeForRenderPass(),Qr.backCW,d,"skyboxGradient",r.skyboxGeometry.vertexBuffer,r.skyboxGeometry.indexBuffer,r.skyboxGeometry.segment)}(t,n,l,o,c)},custom:function(t,r,n,i){const o=t.context,a=n.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&n.isDraped(r)){if("offscreen"===t.renderPass){const r=a.prerender;if(r){if(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const n=t.transform.pointMerc;r.call(a,o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.aj(t.transform.zoom),[n.x,n.y],t.transform.pixelsPerMeterRatio)}else r.call(a,o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState()}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const e=a.renderToTile;if(e){const r=i[0].canonical,n={x:r.x+i[0].wrap*(a.wrapTileId?0:1<<r.z),y:r.y,z:r.z};o.setDepthMode(Zr.disabled),o.setStencilMode(Xr.disabled),o.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults(),e.call(a,o.gl,n),o.setDirty(),t.setBaseState()}return}t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(Xr.disabled);const r="3d"===a.renderingMode?new Zr(t.context.gl.LEQUAL,Zr.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Zr.ReadOnly);if(o.setDepthMode(r),"globe"===t.transform.projection.name){const r=t.transform.pointMerc;a.render(o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.aj(t.transform.zoom),[r.x,r.y],t.transform.pixelsPerMeterRatio)}else a.render(o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}else e.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(t,r,n,i){if("opaque"===t.renderPass)return;const o=n.paint.get("model-opacity").constantOr(1),a=n.paint.get("model-elevation-reference"),s="ground"===a,l="ground"===a;if(0===o)return;const c=n.paint.get("model-cast-shadows");
1if("shadow"===t.renderPass){if(!c)return;if(t.terrain&&o<.65&&n._transitionablePaint._values["model-opacity"].value.expression instanceof e.ad)return}const u=t.shadowRenderer,d=n.paint.get("model-receive-shadows");u&&(u.useNormalOffset=!0,d||(u.enabled=!1));const h=()=>{u&&(u.useNormalOffset=!0,d||(u.enabled=!0))},f=r.getSource();if("light-beam"===t.renderPass&&"batched-model"!==f.type)return;if("vector"===f.type||"geojson"===f.type)return function(t,r,n,i,o){const a=t.transform,s="globe"===a.projection.name,l=a.getFreeCameraOptions().position;if(!t.modelManager)return;const c=t.modelManager;n.modelManager=c;const u=t.shadowRenderer;if(!n._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const d=n._unevaluatedLayout._values["model-id"],h=Object.assign({},n.layout.get("model-id").parameters),f=t.style.order.indexOf(n.fqid),p=n.paint.get("model-opacity").constantOr(1);for(const g of i){const i=r.getTile(g).getBucket(n);if(!i||i.projection.name!==a.projection.name)continue;const m=i.getModelUris();if(m&&!i.modelsRequested&&(c.addModelsFromBucket(m,o),i.modelsRequested=!0),s)h.zoom=g.overscaledZ;else{const e=ss(g,a);h.zoom=e}const y=d.possiblyEvaluate(h);if(os(t,i,g),as.shadowUniformsInitialized=!1,as.useSingleShadowCascade=!!u&&0===u.getMaxCascadeForTile(g.toUnwrapped()),"shadow"===t.renderPass&&u){if(1===t.currentShadowCascade&&i.isInsideFirstShadowMapFrustum)continue;const r=a.calculatePosMatrix(g.toUnwrapped(),a.worldSize);if(as.tileMatrix.set(r),as.shadowTileMatrix=Float32Array.from(u.calculateShadowPassMatrixFromMatrix(r)),as.aabb.min=[0,0,0],as.aabb.max[0]=as.aabb.max[1]=e.al,as.aabb.max[2]=0,us(i,as,t,n.scope))continue}const _=1<<g.canonical.z,v=[((l.x-g.wrap)*_-g.canonical.x)*e.al,(l.y*_-g.canonical.y)*e.al,l.z*_*e.al];t.conflationActive&&Object.keys(i.instancesPerModel).length>0&&t.style.isLayerClipped(n,r.getSource())&&i.updateReplacement(g,t.replacementSource,f,n.scope)&&(i.uploaded=!1,i.upload(t.context));let b=0;const x=new Array,w=new Array,S=new Array;for(let r in i.instancesPerModel){const a=i.instancesPerModel[r];a.features.length>0&&!s&&(r=y.evaluate(a.features[0].feature,{}));const u=c.getModel(r,o);if(u||c.hasURLBeenRequested(r)||i.modelUris.includes(r)||(i.modelUris.push(r),i.modelsRequested=!1),u&&u.uploaded)if(s){const r=e.c5([],[l.x,l.y,l.z],t.transform.worldSize);e.ew(r,r);for(let n=0;n<a.instancedDataArray.length;++n){const o=[0,0,0],s=[1,1,1],l=e.ex(),c=a.tileCoordinatesForInstance(n),d=a.transformForInstance(n);e.ey(s,d),e.ez(l,d),e.eA(o,l);const h=a.translationForInstance(n),f=new e.aT(0,0);e.eB(i.canonical,f,c.x,c.y);const g=e.bC();e.eC(g,u,t.transform,f,o,s,h,!0,!1,!1);const m=a.colorForInstance(n),y=e.bA([]),_=e.ef(f.lat,t.transform.zoom),v=e.bq([],[1,1,1/_]);e.br(y,y,r),S.push({zScaleMatrix:v,negCameraPosMatrix:y});for(const e of u.nodes)es(t,e,g,t.transform.expandedFarZProjMatrix,b,x,w,u.materialOverrides,p,m);++b}}else for(const e of u.nodes)ls(t,n,e,a,v,g,as)}if(s)if("shadow"===t.renderPass){for(const e of w)ts(e.mesh,e.nodeModelMatrix,t,n);for(const e of x)ts(e.mesh,e.nodeModelMatrix,t,n)}else is(t,n,x,w,S)}}(t,r,n,i,Qa(t,n)),void h();if(!f.loaded())return;if("batched-model"===f.type)return function(t,r,n,i){n.resetLayerRenderingStats(t);const o=t.context,a=t.transform,s=t.style.fog,l=t.shadowRenderer;if("mercator"!==a.projection.name)return void e.w(`Drawing 3D landmark models for ${a.projection.name} projection is not yet implemented`);const c=t.transform.getFreeCameraOptions().position,u=e.c5([],[c.x,c.y,c.z],t.transform.worldSize),d=e.ew([],u),h=e.bA([]),f=e.ef(a.center.lat,a.zoom),p=e.bq([],[1,1,1/f]);e.br(h,h,d);const g=n.paint.get("model-opacity").constantOr(1),m=new Zr(o.gl.LEQUAL,Zr.ReadWrite,t.depthRangeFor3D),y=new Zr(o.gl.LEQUAL,Zr.ReadOnly,t.depthRangeFor3D),_=new e.d9([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),v="shadow"===t.renderPass,b=v&&l?l.getCurrentCascadeFrustum():a.getFrustum(a.scaleZoom(a.worldSize)),x=n.paint.get("model-front-cutoff"),w=x[2]<1,S=un(t,n.paint.get("model-cutoff-fade-range")),k=n.getLayerRenderingStats();(function(e,t,r,n){const i=e.terrain?e.terrain.exaggeration():0,o=e.transform.zoom;for(const a of n){const n=t.getTile(a).getBucket(r);
1n&&(n.setFilter(r.filter),e.conflationActive&&n.updateReplacement(a,e.replacementSource),n.evaluateTransform(e,r),e.terrain&&i>0&&n.elevationUpdate(e.terrain,i,a,r.source),n.needsReEvaluation(e,o,r)&&n.evaluate(r))}})(t,r,n,i),function(){let c,d,T;w?(c=i.length-1,d=-1,T=-1):(c=0,d=i.length,T=1);const I=new Float64Array(16),M=e.cA(),E=new e.P(0,0);for(let P=c;P!==d;P+=T){const c=i[P],d=r.getTile(c).getBucket(n);if(!d||!d.uploaded)continue;let T=!1;l&&(T=0===l.getMaxCascadeForTile(c.toUnwrapped()));const A=a.calculatePosMatrix(c.toUnwrapped(),a.worldSize),C=d.modelTraits;!v&&w&&(e.bl(I,A),e.af(M,u,I),E.x=M[0],E.y=M[1]);const R=[];d.setFilter(n.filter);for(const r of d.getNodesInfo()){if(r.hiddenByReplacement)continue;if(!r.node.meshes)continue;const n=r.node;let i=0;t.terrain&&n.elevation&&(i=n.elevation*t.terrain.exaggeration());const o=(()=>{const t=r.aabb;return _.min=[...t.min],_.max=[...t.max],_.min[2]+=i,_.max[2]+=i,e.af(_.min,_.min,A),e.af(_.max,_.max,A),_})(),s=r.evaluatedScale;if(s[0]<=1&&s[1]<=1&&s[2]<=1&&0===o.intersects(b))continue;if(!v&&w){const t=1/6;r.cameraCollisionOpacity=u[0]>o.min[0]&&u[0]<o.max[0]&&u[1]>o.min[1]&&u[1]<o.max[1]&&u[2]*f<o.max[2]&&n.footprint&&e.c0(E,n.footprint)?Math.max(r.cameraCollisionOpacity-t,0):Math.min(1,r.cameraCollisionOpacity+t)}const l=[...A],d=1/e.d7(c.canonical),h=n.anchor?n.anchor[0]:0,p=n.anchor?n.anchor[1]:0;e.br(l,l,[h*(s[0]-1)+r.evaluatedTranslation[0]*d,p*(s[1]-1)+r.evaluatedTranslation[1]*d,i+r.evaluatedTranslation[2]]),e.cq(s,e.eE)||e.cS(l,l,s);const m=e.aB([],l,n.globalMatrix),y=e.aB([],a.expandedFarZProjMatrix,m),k=e.aB([],a.expandedFarZProjMatrix,l),T=e.aC([],[h,p,i,1],y)[2];n.hidden=!1;let I=g;v||(w&&(I*=r.cameraCollisionOpacity,I*=hs(l,a,r.aabb,x)),I*=ds(S,T)),0!==I?R.push({nodeInfo:r,depth:T,opacity:I,wvpForNode:y,wvpForTile:k,nodeModelMatrix:m,tileModelMatrix:l}):n.hidden=!0}v||R.sort(((e,t)=>!w||1===e.opacity&&1===t.opacity?e.depth<t.depth?-1:1:1===e.opacity?-1:1===t.opacity?1:e.depth>t.depth?-1:1));for(const r of R){const i=r.nodeInfo,c=i.node;let u=e.aB([],p,r.tileModelMatrix);e.aB(u,h,u);const d=e.bl([],u);e.eg(d,d),e.cS(d,d,cs),u=e.aB(u,u,c.globalMatrix);const f="light-beam"===t.renderPass,g="none"===n.paint.get("model-color-use-theme").constantOr("default"),_=C&e.eI.HasMapboxMeshFeatures,b=_?0:i.evaluatedRMEA[0][2];for(let e=0;e<c.meshes.length;++e){const h=c.meshes[e],p=e===c.lightMeshIndex;let x=r.wvpForNode;if(p){if(!f&&!t.terrain&&t.shadowRenderer){t.currentLayer<t.firstLightBeamLayer&&(t.firstLightBeamLayer=t.currentLayer);continue}x=r.wvpForTile}else if(f)continue;const w={defines:[]},S=[];if(!v&&l&&(l.useNormalOffset=!!h.normalBuffer),Ka(w.defines,S,h,t,g?null:n.lut),_||w.defines.push("DIFFUSE_SHADED"),T&&w.defines.push("SHADOWS_SINGLE_CASCADE"),k&&(v?k.numRen
1deredVerticesInShadowPass+=h.vertexArray.length:k.numRenderedVerticesInTransparentPass+=h.vertexArray.length),v){ts(h,r.nodeModelMatrix,t,n);continue}let I=null;if(s){const e=Xa(r.nodeModelMatrix,t.transform);if(I=new Float32Array(e),"globe"!==a.projection.name){const t=h.aabb.min,r=h.aabb.max,[n,i]=s.getOpacityForBounds(e,t[0],t[1],r[0],r[1]);w.overrideFog=n>=Ge||i>=Ge}}const M=h.material;let E;M.occlusionTexture&&M.occlusionTexture.offsetScale&&(E=M.occlusionTexture.offsetScale,w.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const P=t.getOrCreateProgram("model",w);!v&&l&&l.setupShadowsFromMatrix(r.tileModelMatrix,P,l.useNormalOffset),t.uploadCommonUniforms(o,P,null,I);const A=M.pbrMetallicRoughness;A.metallicFactor=.9,A.roughnessFactor=.5;const C=qo(new Float32Array(x),new Float32Array(u),new Float32Array(d),new Float32Array(c.globalMatrix),t,r.opacity,A.baseColorFactor,M.emissiveFactor,A.metallicFactor,A.roughnessFactor,M,b,n,[0,0,0],E);!p&&(i.hasTranslucentParts||r.opacity<1)&&P.draw(t,o.gl.TRIANGLES,m,Xr.disabled,Wr.disabled,Qr.backCCW,C,n.id,h.vertexBuffer,h.indexBuffer,h.segments,n.paint,t.transform.zoom,void 0,S),P.draw(t,o.gl.TRIANGLES,p?y:m,Xr.disabled,p||r.opacity<1||i.hasTranslucentParts?Wr.alphaBlended:Wr.unblended,Qr.backCCW,C,n.id,h.vertexBuffer,h.indexBuffer,h.segments,n.paint,t.transform.zoom,void 0,S)}}}}()}(t,r,n,i),void h();if("model"!==f.type)return;const p=f.getModels(),g=[],m=t.transform.getFreeCameraOptions().position,y=e.c5([],[m.x,m.y,m.z],t.transform.worldSize);e.ew(y,y);const _=[],v=[];let b=0;for(const i of p){const o=r.getFeatureState("",i.id),a={type:"Unknown",id:i.id,properties:i.featureProperties},c=n.paint.get("model-rotation").evaluate(a,o),u=n.paint.get("model-scale").evaluate(a,o),d=n.paint.get("model-translation").evaluate(a,o),h=n.paint.get("model-opacity").evaluate(a,o);rs(n,i.id,o,i.featureProperties,i.nodeOverrideNames,i.nodeOverrides),ns(n,i.id,o,i.featureProperties,i.materialOverrideNames,i.materialOverrides),i.nodeOverrides.size>0&&i.computeBoundsAndApplyParent(),i.computeModelMatrix(t,c,u,d,l,s,!1);const f=e.bA([]),p=e.ef(i.position.lat,t.transform.zoom),m=e.bq([],[1,1,1/p]);e.br(f,f,y),g.push({zScaleMatrix:m,negCameraPosMatrix:f});for(const e of i.nodes)es(t,e,i.matrix,t.transform.expandedFarZProjMatrix,b,_,v,i.materialOverrides,h);b++}if(_.sort(((e,t)=>t.depth-e.depth)),"shadow"!==t.renderPass)is(t,n,_,v,g),h();else{for(const e of v)ts(e.mesh,e.nodeModelMatrix,t,n);for(const e of _)ts(e.mesh,e.nodeModelMatrix,t,n);h()}}},Ps={line:function(e,t,r){if(e.hasElevatedBuckets=!1,e.hasNonElevatedBuckets=!1,void 0!==e._unevaluatedLayout.getValue("line-elevation-reference")||void 0!==e._unevaluatedLayout.getValue("line-z-offset")){if(t){const r=t.getVisibleCoordinates();for(const n of r){const r=t.getTile(n).getBucket(e);if(r&&("none"!==r.elevationType?e.hasElevatedBuckets=!0:e.hasNonElevatedBuckets=!0,e.hasElevatedBuckets&&e.hasNonElevatedBuckets))break}}}else e.hasNonElevatedBuckets=!0},model:function(e,t,r){const n=t.getSource();if(!n.loaded())return;if("vector"===n.type||"geojson"===n.type)return void(r.modelManager&&r.modelManager.upload(r,Qa(r,e)));if("batched-model"===n.type)return;if("model"!==n.type)return;const i=n.getModels();for(const e of i)e.upload(r.context)},raster:function(e,t,r){const n=t.getSource();if(!(n instanceof pt&&n.loaded()))return;const i=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!i)return;const o=e.paint.get("raster-array-band")||n.getInitialBand(i);if(null==o)return;const a=t.getIds().map((e=>t.getTileByID(e)));for(const t of a)t.updateNeeded(e.id,o)&&n.prepareTile(t,i,e.id,o)},"raster-particle":function(e,t,r){const n=t.getSource();if(!(n instanceof pt&&n.loaded()))return;const i=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!i)return;const o=e.paint.get("raster-particle-array-band")||n.getInitialBand(i);if(null==o)return;const a=t.getIds().map((e=>t.getTileByID(e)));for(const t of a)t.updateNeeded(e.id,o)&&n.prepareTile(t,i,e.id,o)}},As={fill:ca},Cs={fill:function(e,t,r,n){if(!r.layout||"none"===r.layout.get("fill-elevation-reference")||0===r.paint.get("fill-opacity").constantOr(1))return;const i=e.context.gl,o=new Zr(i.LEQUAL,Zr.ReadOnly,e.depthRangeFor3D),a=new Xr({func:i.ALWAYS,mask:255},255,255,i.KEEP,i.KEEP,i.REPLACE),s=e.transform.getFreeCameraOptions().position,l=e.getOrCreateProgram("elevatedStructuresDepthReconstruct");for(const c of n){const n=t.getTile(c),u=n.getBucket(r);
1if(!u)continue;const d=u.elevatedStructures;if(!d||0===d.depthSegments.segments[0].primitiveLength)continue;const h=la(c.toUnwrapped(),s),f=e.translatePosMatrix(c.projMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor")),p=ko(f,h,0,1,0);l.draw(e,i.TRIANGLES,o,a,Wr.disabled,Qr.disabled,p,r.id,d.vertexBuffer,d.indexBuffer,d.depthSegments,r.paint,e.transform.zoom)}}};class Rs{constructor(t,r,n,i,o){this.context=new Qo(t,r),this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this._timeStamp=e.o.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const a=["fill","line","symbol","circle","heatmap","fill-extrusion","building","raster","raster-particle","hillshade","model","background","sky"];for(const e of a)this._debugParams.enabledLayers[e]=!0;for(const e of a);this.occlusionParams=new gs,this.setup(),this.numSublayers=zt.maxUnderzooming+zt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.eP,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new pn(this),this._wireframeDebugCache=new ps,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const s=new e.q({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new e.T(this.context,s,t.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=i,this.worldview=o,this._forceEmissiveMode=!1,this.emissiveMode="constant"}updateTerrain(e,t){const r=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(r||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new ao(this,e));const n=this._terrain;this.transform.elevation=r?n:null,n.update(e,this.transform,t),this.transform.elevation&&!n.enabled&&(this.transform.elevation=null)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[r,n]=t.getFovAdjustedRange(this.transform._fov);if(r>n)return void(this.transform.fogCullDistSq=null);const i=r+.78*(n-r);this.transform.fogCullDistSq=i*i}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(e){e&&!this._terrain&&(this._terrain=new ao(this,this.style)),this._forceTerrainMode=e}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,r){if(this.width=t*e.o.devicePixelRatio,this.height=r*e.o.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._mergedLayers[e].resize()}setup(){const t=this.context,r=new e.bd;r.emplaceBack(0,0),r.emplaceBack(e.al,0),r.emplaceBack(0,e.al),r.emplaceBack(e.al,e.al),this.tileExtentBuffer=t.createVertexBuffer(r,e.bf.members),this.tileExtentSegments=e.bg.simpleSegment(0,0,4,2);const n=new e.bd;n.emplaceBack(0,0),n.emplaceBack(e.al,0),n.emplaceBack(0,e.al),n.emplaceBack(e.al,e.al),this.debugBuffer=t.createVertexBuffer(n,e.bf.members),this.debugSegments=e.bg.simpleSegment(0,0,4,5);const i=new e.bd;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(-1,1),i.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(i,e.bf.members),this.viewportSegments=e.bg.simpleSegment(0,0,4,2);const o=new e.b1;o.emplaceBack(0,0,0,0),o.emplaceBack(e.al,0,e.al,0),o.emplaceBack(0,e.al,0,e.al),o.emplaceBack(e.al,e.al,e.al,e.al),this.mercatorBoundsBuffer=t.createVertexBuffer(o,e.bi.members),this.mercatorBoundsSegments=e.bg.simpleSegment(0,0,4,2);const a=new e.b0;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a);const s=new e.be;for(const e of[0,1,3,2,0])s.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.T(t,new e.q({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=e.bC();const l=this.context.gl;this.stencilClearMode=new Xr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const e=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,e.TRIANGLES,Zr.disabled,this.stencilClearMode,Wr.disabled,Qr.disabled,to(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(e,t,r){if(!t||this.currentStencilSource===t.id||!e.isTileClipped()||!r||0===r.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of r)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=t.id;const n=this.context,i=n.gl;this.nextStencilID+r.length>256&&this.clearStencil(),n.setColorMode(Wr.disabled),n.setDepthMode(Zr.disabled);const o=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of r){const r=t.getTile(e),n=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,{tileBoundsBuffer:a,tileBoundsIndexBuffer:s,tileBoundsSegments:l}=this.getTileBoundsBuffers(r);o.draw(this,i.TRIANGLES,Zr.disabled,new Xr({func:i.ALWAYS,mask:0},n,255,i.KEEP,i.KEEP,i.REPLACE),Wr.disabled,Qr.disabled,to(e.projMatrix),"$clipping",a,s,l)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Xr({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const t=this.context.gl;return new Xr({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,r=e.sort(((e,t)=>
1t.overscaledZ-e.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();const e={};for(let r=0;r<i;r++)e[r+n]=new Xr({func:t.GEQUAL,mask:255},r+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=i,[e,r]}return[{[n]:Xr.disabled},r]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const r=1/8;return new Wr([t.CONSTANT_COLOR,t.ONE,t.CONSTANT_COLOR,t.ONE],new e.ao(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Wr.unblended:Wr.alphaBlended}colorModeForDrapableLayerRenderPass(t){const r=this.context.gl;return(()=>this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?null!=t&&"mrt-fallback"!==this.emissiveMode||"constant"===this.emissiveMode?new Wr([r.ONE,r.ONE_MINUS_SRC_ALPHA,r.CONSTANT_ALPHA,r.ONE_MINUS_SRC_ALPHA],new e.ao(0,0,0,null!=t?t:0),[!0,!0,!0,!0]):"dual-source-blending"===this.emissiveMode?new Wr([r.ONE,r.ONE_MINUS_SRC_ALPHA,this.context.extBlendFuncExtended.SRC1_ALPHA_WEBGL,r.ONE_MINUS_SRC_ALPHA],e.ao.transparent,[!0,!0,!0,!0]):this.colorModeForRenderPass():this.colorModeForRenderPass()}depthModeForSublayer(e,t,r,n=!1){if(this.depthOcclusion)return new Zr(this.context.gl.GREATER,Zr.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!n)return Zr.disabled;const i=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Zr(r||this.context.gl.LEQUAL,t,[i,i])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const t=this.context.gl,r=Math.ceil(this.width),n=Math.ceil(this.height),i=this.context.bindFramebuffer.get(),o=t.getParameter(t.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===r&&this.depthFBO.height===n||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),0!==r&&0!==n&&(this.depthFBO=new Jo(this.context,r,n,0,"texture"),this.depthTexture=new e.T(this.context,{width:r,height:n,data:null},t.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(i),t.bindTexture(t.TEXTURE_2D,o),this.depthFBO&&(t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),t.blitFramebuffer(0,0,r,n,0,0,r,n,t.DEPTH_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(t.FRAMEBUFFER,this.context.bindFramebuffer.current))}updateAverageFPS(){this._fpsHistory.push(0===this._dt?0:1e3/this._dt),this._fpsHistory.length>this._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce(((e,t)=>e+t/this._fpsHistory.length),0))}render(t,r){const n=e.o.now();this._dt=n-this._timeStamp,this._timeStamp=n,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=r;const i=this.style._mergedLayers,o=!(!this.terrain||!this.terrain.enabled),a=()=>this.style._getOrder(o).filter((e=>{const t=i[e];return!(t.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[t.type]}));let s=a(),l=!1,c=!1,u=null,d=0,h=!1;for(const e of s){const t=i[e];"none"!==t.visibility&&("circle"===t.type?l=!0:"building"===t.type?(u=t,++d):"symbol"===t.type&&(t.hasOcclusionOpacityProperties?c=!0:l=!0))}this.updateEmissiveMode();let f=s.map((e=>i[e]));const p=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.o.now()),this.imageManager.beginFrame();for(const e in p){const t=p[e];t.used&&(t.prepare(this.context),t.getSource().usedInConflation&&++d)}let g=!1;for(const e of f)e.isHidden(this.transform.zoom)||("clip"===e.type&&(g=!0),this.prepareLayer(e));const m={},y={},_={},v={},b={};for(const e in p){const t=p[e];m[e]=t.getVisibleCoordinates(),y[e]=m[e].slice().reverse(),_[e]=t.getVisibleCoordinates(!0).reverse(),v[e]=t.getShadowCasterCoordinates(),b[e]=t.sortCoordinatesByDistance(m[e])}const x=e=>{const t=this.style.getLayerSourceCache(e);return t&&t.used?t.getSource():null};if(d||g||this._clippingActiveLastFrame){const t=[],r=[];let n=0;for(const e of f)this.isSourceForClippingOrConflation(e,x(e))&&(t.push(e),r.push(n)),n++;if(t&&(g||t.length>1)||this._clippingActiveLastFrame){g=!1;const n=[];for(let i=0;i<t.length;i++){const o=t[i],a=r[i],s=this.style.getLayerSourceCache(o);if(!s||!s.used||!s.getSource().usedInConflation&&"clip"!==o.type&&"building"!==o.type)continue;let l=e.eQ,c=e.b_.None;const u=[];let d=!0;if("building"===o.type)l=e.eS;else if("clip"===o.type){l=a;
1for(const t of o.layout.get("clip-layer-types"))c|="model"===t?e.b_.Model:"symbol"===t?e.b_.Symbol:e.b_.FillExtrusion;for(const e of o.layout.get("clip-layer-scope"))u.push(e);o.isHidden(this.transform.zoom)?d=!1:g=!0}d&&n.push({layer:o.fqid,cache:s,order:l,clipMask:c,clipScope:u})}this.replacementSource.setSources(n),h=!0}}this._clippingActiveLastFrame=g,h||this.replacementSource.clear(),this.conflationActive=h,this.minCutoffZoom=0,this.longestCutoffRange=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let e=0;e<f.length;e++){const t=f[e];if("none"===t.visibility)continue;const r=t.cutoffRange();if(this.longestCutoffRange=Math.max(r,this.longestCutoffRange),r>0){const e=x(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom))}t.is3D(o)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=e),this._lastOcclusionLayer=e)}const w=this.style&&this.style.fog;w?(this._fogVisible=0!==w.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=w.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(_),this.opaquePassCutoff=0,s=a(),f=s.map((e=>i[e])));const S=this._shadowRenderer;if(S){S.updateShadowParameters(this.transform,this.style.directionalLight);for(const e in p)for(const t of m[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(t)||e),S.addShadowReceiver(t.toUnwrapped(),e.min,e.max)}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.eR(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new Za(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const k=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),T=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(k&&!this._snow&&(this._snow=new Ms(this)),!k&&this._snow&&(this._snow.destroy(),delete this._snow),T&&!this._rain&&(this._rain=new Ts(this)),!T&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),u){this.buildingTileBorderManager||(this.buildingTileBorderManager=new Ya);const e=this.style.getLayerSourceCache(u);this.buildingTileBorderManager.updateBorders(e,u)}if(!H.has(this.context.gl))return;this.renderPass="offscreen";for(const e of f){const r=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const n=r?y[r.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||n&&n.length)&&this.renderLayer(this,r,e,n)}this.depthRangeFor3D=[0,1-(f.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,v)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const I="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),M=(()=>{if(r.showOverdrawInspector)return e.ao.black;const t=this.style.fog;if(t&&this.transform.projection.supportsFog){const r=this.style.getLut(t.scope);if(!I){const n="none"===t.properties.get("color-use-theme"),i=t.properties.get("color").toNonPremultipliedRenderColor(n?null:r).toArray01();return new e.ao(...i)}if(I){const n="none"===t.properties.get("space-color-use-theme"),i=t.properties.get("space-color").toNonPremultipliedRenderColor(n?null:r).toArray01();return new e.ao(...i)}}return e.ao.transparent})();if(this.context.clear({color:M,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&I&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){const e=f[this.currentLayer],r=t.getLayerSourceCache(e);if(e.isSky())continue;const n=r?(e.is3D(o)?b:y)[r.id]:void 0;this._renderTileClippingMasks(e,r,n),this.renderLayer(this,r,e,n)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&I&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.aj(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isH
1orizonVisible()))for(this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){const e=f[this.currentLayer],r=t.getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,r,e,r?y[r.id]:void 0)}function E(e,t){let r;return t&&(r=("symbol"===e.type?_:e.is3D(o)?b:y)[t.id]),r}if(this.renderPass="translucent","globe"===this.transform.projection.name){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<s.length;){const e=f[this.currentLayer];if("raster"===e.type||"raster-particle"===e.type){const r=t.getLayerSourceCache(e);this.renderLayer(this,r,e,E(e,r))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;const P=S?S.getGroundShadowLayerIndex():-1;let A=!1,C=-1;for(let e=0;e<s.length;++e){const t=f[e];t.isHidden(this.transform.zoom)||t.is3D(o)&&(C=e)}c&&-1===C&&(l=!0);let R=!1;for(;this.currentLayer<s.length;){const e=f[this.currentLayer],r=t.getLayerSourceCache(e);if(e.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(!R&&e.is3D(o)&&!o){const e=this.currentLayer,t=e=>{for(this.currentLayer=0;this.currentLayer<f.length;this.currentLayer++){const t=f[this.currentLayer];if(As[t.type]){const r=this.style.getLayerSourceCache(t);As[t.type](this,r,t,E(t,r),e)}}};t("initialize"),t("reset"),this.currentLayer=e,R=!0}if(l&&!A&&this.terrain&&!this.transform.isOrthographic&&(A=!0,this.blitDepth()),c&&-1!==C&&this.currentLayer===C+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(e,r,r?m[r.id]:void 0),this.renderLayer(this,r,e,E(e,r)),!this.terrain&&S&&this.currentLayer===P){{this.clearStencil(),this.resetStencilClippingMasks();const e=this.currentLayer;for(this.currentLayer=0;this.currentLayer<f.length;this.currentLayer++){const e=f[this.currentLayer];if(Cs[e.type]){const t=this.style.getLayerSourceCache(e);Cs[e.type](this,t,e,E(e,t))}}this.currentLayer=e}if(S.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=f[this.currentLayer];if(!e.hasLightBeamPass())continue;const r=t.getLayerSourceCache(e);this.renderLayer(this,r,e,r?y[r.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const e=this.currentLayer;this.depthOcclusion=!0;for(const e of this.layersWithOcclusionOpacity){this.currentLayer=e;const r=f[this.currentLayer],n=t.getLayerSourceCache(r),i=n?y[n.id]:void 0;this.terrain||this._renderTileClippingMasks(r,n,n?m[n.id]:void 0),this.renderLayer(this,n,r,i)}this.depthOcclusion=!1,this.currentLayer=e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let r=null;f.forEach((e=>{const n=t.getLayerSourceCache(e);n&&!e.isHidden(this.transform.zoom)&&n.getVisibleCoordinates().length&&(!r||r.getSource().maxzoom<n.getSource().maxzoom)&&(r=n)})),r&&this.options.showTileBoundaries&&Oa(this,r,r.getVisibleCoordinates(),e.ao.red,!1,this.options.showParseStatus)}this.terrain&&this._debugParams.showTerrainProxyTiles&&Oa(this,this.terrain.proxySourceCache,this.terrain.proxyCoords,new e.ao(1,.8,.1,1),!0,this.options.showParseStatus),this.options.showPadding&&function(e){const t=e.transform.padding;za(e,e.transform.height-(t.top||0),3,Pa),za(e,t.bottom||0,3,Aa),Fa(e,t.left||0,3,Ca),Fa(e,e.transform.width-(t.right||0),3,Ra);const r=e.transform.centerPoint;!function(e,t,r,n){Na(e,t-1,r-10,2,20,n),Na(e,t-10,r-1,20,2,n)}(e,r.x,e.transform.height-r.y,La)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveC
1anvasCopy()),h||(this.conflationActive=!1)}prepareLayer(e){this.gpuTimingStart(e);const{unsupportedLayers:t}=this.transform.projection,r=!t||!t.includes(e.type);if(Ps[e.type]&&(r||this.terrain&&"custom"===e.type)){const t=this.style.getLayerSourceCache(e);Ps[e.type](e,t,this)}this.gpuTimingEnd()}renderLayer(e,t,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"sky"===r.type||"custom"===r.type||"model"===r.type||"raster"===r.type||"raster-particle"===r.type||n&&n.length)&&(this.id=r.id,this.gpuTimingStart(r),e.transform.projection.unsupportedLayers&&e.transform.projection.unsupportedLayers.includes(r.type)&&(!e.terrain||"custom"!==r.type)||"clip"===r.type||Es[r.type](e,t,r,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery,r=this.context.gl;let n=this.gpuTimers[e.id];n||(n=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:r.createQuery()}),n.calls++,r.beginQuery(t.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=this.context.gl,r=t.createQuery();this.deferredRenderGpuTimeQueries.push(r),t.beginQuery(e.TIME_ELAPSED_EXT,r)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){const e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){const t={};for(const r in e){const n=e[r],i=this.context.extTimerQuery,o=i.getQueryParameter(n.query,this.context.gl.QUERY_RESULT)/1e6;i.deleteQueryEXT(n.query),t[r]=o}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.gl;let r=0;for(const n of e)r+=t.getQueryParameter(n,t.QUERY_RESULT)/1e6,t.deleteQuery(n);return r}translatePosMatrix(t,r,n,i,o){if(!n[0]&&!n[1])return t;const a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const s=[o?n[0]:e.ay(r,n[0],this.transform.zoom),o?n[1]:e.ay(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.br(l,t,s),l}saveTileTexture(e){if(e.context!==this.context)return;const t=e.size[0],r=this._tileTextures[t];r?r.push(e):this._tileTextures[t]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,t,r){const n=void 0===r?this.terrain&&this.terrain.renderingToTexture:r,i=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(i.push("LIGHTING_3D_MODE"),i.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):n||i.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass&&(this._shadowMapDebug||i.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(i.push("TERRAIN"),this.linearFloatFilteringSupported()&&i.push("TERRAIN_DEM_FLOAT_FORMAT")),"globe"===this.transform.projection.name&&i.push("GLOBE"),!this._fogVisible||n||void 0!==t&&!t||i.push("FOG","FOG_DITHERING"),n&&i.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&i.push("OVERDRAW_INSPECTOR"),i}getOrCreateProgram(e,t){this.cache=this.cache||{};const r=t&&t.defines||[],n=t&&t.config,i=this.currentGlobalDefines(e,t&&t.overrideFog,t&&t.overrideRtt).concat(r),o=uo.cacheKey(ri[e],e,i,n);return this.cache[o]||(this.cache[o]=new uo(this.context,e,ri[e],n,Zo[e],i)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.de
vendor: 4,596 bytes, line 1
1stroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,r){if(this.style.enable3dLights()){const n=this.style.directionalLight,i=this.style.ambientLight;if(n&&i){const o=((t,r,n)=>{const i=t.properties.get("direction"),o="none"===t.properties.get("color-use-theme"),a=t.properties.get("color").toNonPremultipliedRenderColor(o?null:n.getLut(t.scope)).toArray01(),s=t.properties.get("intensity"),l="none"===r.properties.get("color-use-theme"),c=r.properties.get("color").toNonPremultipliedRenderColor(l?null:n.getLut(r.scope)).toArray01(),u=r.properties.get("intensity"),d=[i.x,i.y,i.z],h=e.dN(c,u),f=e.dN(a,s);return{u_lighting_ambient_color:h,u_lighting_directional_dir:d,u_lighting_directional_color:f,u_ground_radiance:so(d,f,h)}})(n,i,this.style);r.setLightsUniformValues(t,o)}}}uploadCommonUniforms(t,r,n,i,o){if(this.uploadCommonLightUniforms(t,r),this.terrain&&this.terrain.renderingToTexture)return;const a=this.style.fog;if(a){const o=a.getOpacity(this.transform.pitch),s=((t,r,n,i,o,a,s,l,c,u,d,h)=>{const f=t.transform,p="none"===r.properties.get("color-use-theme"),g=r.properties.get("color").toNonPremultipliedRenderColor(p?null:t.style.getLut(r.scope)).toArray01();g[3]=i;const m=t.frameCounter/1e3%1,[y,_]=r.properties.get("vertical-range");return{u_fog_matrix:n?f.calculateFogTileMatrix(n):h||t.identityMat,u_fog_range:r.getFovAdjustedRange(f._fov),u_fog_color:g,u_fog_horizon_blend:r.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(y,_),_],u_fog_temporal_offset:m,u_frustum_tl:o,u_frustum_tr:a,u_frustum_br:s,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:d,u_globe_transition:e.aj(f.zoom),u_is_globe:+("globe"===f.projection.name)}})(this,a,n,o,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.o.devicePixelRatio,this.transform.height*e.o.devicePixelRatio],i);r.setFogUniformValues(t,s)}o&&r.setCutoffUniformValues(t,o.uniformValues)}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const e=this._backgroundTiles,t=this._backgroundTiles={},r=this.transform.coveringTiles({tileSize:512});for(const n of r)t[n.key]=e[n.key]||new Rt(n,512,this.transform.tileZoom,this,void 0,this.worldview);return t}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(e,t){return!(!e.is3D(!(!this.terrain||!this.terrain.enabled))||"clip"!==e.type&&"building"!==e.type&&(e.minzoom&&e.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==e.sourceLayer&&"procedural_buildings"!==e.sourceLayer)&&(!t||"batched-model"!==t.type)))}isTileAffectedByFog(e){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let t=this._cachedTileFogOpacities[e.key];return t||(this._cachedTileFogOpacities[e.key]=t=this.style.fog.getOpacityForTile(e)),t[0]>=Ge||t[1]>=Ge}setupDepthForOcclusion(e,t,r){const n=this.context,i=n.gl,o=!!r;var a;r||(r={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),n.activeTexture.set(i.TEXTURE3),e&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(i.NEAREST,i.CLAMP_TO_EDGE),r.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],r.u_depth_range_unpack=[2/((a=this.depthRangeFor3D)[1]-a[0]),-1-2*a[0]/(a[1]-a[0])],r.u_occluder_half_size=.5*this.occlusionParams.occluderSize,r.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.empty
vendor: 8,063 bytes, line 1
1DepthTexture.bind(i.NEAREST,i.CLAMP_TO_EDGE),n.activeTexture.set(i.TEXTURE0),o||t.setTerrainUniformValues(n,r)}updateEmissiveMode(){if(this._forceEmissiveMode)return;const e=this.style.hasDataDrivenEmissiveStrength();this.emissiveMode=e?this.context.extBlendFuncExtended?"dual-source-blending":"mrt-fallback":"constant"}}function Ls(e,t){let r=!1,n=null;const i=()=>{n=null,r&&(e(),n=setTimeout(i,t),r=!1)};return()=>(r=!0,n||i(),n)}class Os{constructor(t){this._hashName=t&&encodeURIComponent(t),e.aY(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Ls(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return"";const t=Ds(e);if(this._hashName){const e=this._hashName;let r=!1;const n=location.hash.slice(1).split("&").map((n=>{const i=n.split("=")[0];return i===e?(r=!0,`${i}=${t}`):n})).filter((e=>e));return r||n.push(`${e}=${t}`),`#${n.join("&")}`}return`#${t}`}_getCurrentHash(){const e=location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some((e=>isNaN(Number(e))))){const r=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:r,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function Ds(e,t){const r=e.getCenter(),n=Math.round(100*e.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(r.lng*o)/o,s=Math.round(r.lat*o)/o,l=e.getBearing(),c=e.getPitch();let u=t?`/${a}/${s}/${n}`:`${n}/${s}/${a}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const zs={linearity:.3,easing:e.eT(0,0,.3,1)},Fs=Object.assign({deceleration:2500,maxSpeed:1400},zs),Ns=Object.assign({deceleration:20,maxSpeed:1400},zs),Bs=Object.assign({deceleration:1e3,maxSpeed:360},zs),js=Object.assign({deceleration:1e3,maxSpeed:90},zs);class Vs{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.o.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,r=e.o.now();for(;t.length>0&&r-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)r.zoom+=e.zoomDelta||0,r.bearing+=e.bearingDelta||0,r.pitch+=e.pitchDelta||0,e.panDelta&&r.pan._add(e.panDelta),e.around&&(r.around=e.around),e.pinchAround&&(r.pinchAround=e.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const e=Us(r.pan.mag(),n,Object.assign({},Fs,t||{}));i.offset=r.pan.mult(e.amount/r.pan.mag()),i.center=this._map.transform.center,Gs(i,e)}if(r.zoom){const e=Us(r.zoom,n,Ns);i.zoom=this._map.transform.zoom+e.amount,Gs(i,e)}if(r.bearing){const t=Us(r.bearing,n,Bs);i.bearing=this._map.transform.bearing+e.aA(t.amount,-179,179),Gs(i,t)}if(r.pitch){const e=Us(r.pitch,n,js);i.pitch=this._map.transform.pitch+e.amount,Gs(i,e)}if(i.zoom||i.bearing){const e=void 0===r.pinchAround?r.around:r.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),i.noMoveStart=!0,i}}function Gs(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Us(t,r,n){const{maxSpeed:i,linearity:o,deceleration:a}=n,s=e.aA(t*o/(r/1e3),-i,i),l=Math.abs(s)/(a*o);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}class $s extends e.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r,n={}){const i=y(t.getCanvasContainer(),r),o=t.unproject(i);super(e,Object.assign({point:i,lngLat:o,originalEvent:r},n)),this._defaultPrevented=!1,this.target=t}}class Hs extends e.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,n){const i="touchend"===t?n.changedTouches:n.touches,o=_(r.getCanvasContainer(),i),a=o.map((e=>r.unproject(e))),s=o.reduce(((e,t,r,n)=>e.add(t.div(n.length))),new e.P(0,0));super(t,{points:o,point:s,lngLats:a,lngLat:r.unproject(s),originalEvent:n}),this._defaultPrevented=!1}}class qs extends e.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}}class Ws{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new qs(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new $s(e.type,this._map,e))}mouseup(e){this._map.fire(new $s(e.type,this._map,e))}preclick(e){const t=new MouseEvent("preclick",e);this._map.fire(new $s(t.type,this._map,t))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new $s(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new $s(e.type,this._map,e))}mouseover(e){this._map.fire(new $s(e.type,this._map,e))}mouseout(e){this._map.fire(new $s(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Hs(e.type,this._map,e))}touchmove(e){this._map.fire(new Hs(e.type,this._map,e))}touchend(e){this._map.fire(new Hs(e.type,this._map,e))}touchcancel(e){this._map.fire(new Hs(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Zs{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new $s(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new $s("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new $s(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ys{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(f(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const r=t,n=this._startPos,i=this._lastPos;if(!n||!i||i.equals(r)||!this._box&&r.dist(n)<this._clickTolerance)return;this._lastPos=r,this._box||(this._box=l("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const o=Math.min(n.x,r.x),a=Math.max(n.x,r.x),s=Math.min(n.y,r.y),c=Math.max(n.y,r.y);this._map._requestDomTask((()=>{this._box&&(this._box.style.transform=`translate(${o}px,${s}px)`,this._box.style.width=a-o+"px",this._box.style.height=c-s+"px")}))}mouseupWindow(t,r){if(!this._active)return;const n=this._startPos,i=r;if(n&&0===t.button){if(this.reset(),m(),n.x!==i.x||n.y!==i.y)return this._map.fire(new e.z("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(n,i,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}
vendor: 5,105 bytes, line 1
1keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),p(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.z(t,{originalEvent:r}))}}function Xs(e,t){const r={};for(let n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}class Ks{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const r=new e.P(0,0);for(const e of t)r._add(e);return r.div(t.length)}(r),this.touches=Xs(n,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;const n=Xs(r,t);for(const e in this.touches){const t=n[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Js{constructor(e){this.singleTap=new Ks(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){const n=this.singleTap.touchend(e,t,r);if(n){const t=e.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Qs{constructor(){this._zoomIn=new Js({numTouches:1,numTaps:2}),this._zoomOut=new Js({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){const n=this._zoomIn.touchend(e,t,r),i=this._zoomOut.touchend(e,t,r);return n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(n)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const el=0,tl=2,rl={[el]:1,[tl]:2},nl={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class il{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const r=v(e);this._correctButton(e,r)&&(this._lastPoint=t,this._eventButton=r)}mousemoveWindow(e,t){const r=this._lastPoint;if(r)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const r=rl[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(r,t)}mouseupWindow(e){this._lastPoint&&v(e)===this._eventButton&&(this._moved&&m(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ol extends il{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class al extends il{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?nl[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const r=.8*(t.x-e.x);if(r)return this._active=!0,{bearingDelta:r}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class sl extends il{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?nl[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const r=-.5*(t.y-e.y);if(r)return this._active=!0,{pitchDelta:r}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class ll{constructor(t,r){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=r.clickTolerance||1,this.reset(),e.aY(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(t,r,n){if(this._active&&!(n.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===n.length&&!e.eU())return void this._showTouchPanBlockerAlert();
vendor: 4,240 bytes, line 1
1"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,r,n)}}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&r.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,n){n.length>0&&(this._active=!0);const i=Xs(n,r),o=new e.P(0,0),a=new e.P(0,0);let s=0;for(const e in i){const t=i[e],r=this._touches[e];r&&(o._add(t),a._add(t.sub(r)),s++,i[e]=t)}if(this._touches=i,s<this._minTouches||!a.mag())return;const l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")}),500)}}class cl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,r){return{}}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){const n=this._firstTwoTouches;if(!n)return;e.preventDefault();const[i,o]=n,a=ul(r,t,i),s=ul(r,t,o);if(!a||!s)return;const l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;const[n,i]=this._firstTwoTouches,o=ul(r,t,n),a=ul(r,t,i);o&&a||(this._active&&m(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ul(e,t,r){for(let n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function dl(e,t){return Math.log2(e/t)}class hl extends cl{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(dl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:dl(this._distance,r),pinchAround:t}}}function fl(e,t){return 180*e.angleWith(t)/Math.PI}class pl extends cl{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const r=this._vector;if(this._vector=e[0].sub(e[1]),r&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:fl(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,r=this._startVector;if(!r)return!1;const n=fl(e,r);return Math.abs(n)<t}}function gl(e){return Math.abs(e.y)>Math.abs(e.x)}class ml extends cl{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,gl(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,r,n){const i=this._lastPoints;if(!i)return;const o=t[0].sub(i[0]),a=t[1].sub(i[1]);return this._map._cooperativeGestures&&!e.eU()&&n.touches.length<3||(this._val
vendor: 5,087 bytes, line 1
1id=this.gestureBeginsVertically(o,a,n.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+a.y)/2*-.5})}gestureBeginsVertically(e,t,r){if(void 0!==this._valid)return this._valid;const n=e.mag()>=2,i=t.mag()>=2;if(!n&&!i)return;if(!n||!i)return null==this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return gl(e)&&gl(t)&&o}}const yl={panStep:100,bearingStep:15,pitchStep:10};class _l{constructor(){const e=yl;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,n=0,i=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:a=>{const s=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:vl,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:a.getBearing()+r*this._bearingStep,pitch:a.getPitch()+n*this._pitchStep,offset:[-i*this._panStep,-o*this._panStep],center:a.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function vl(e){return e*(2-e)}const bl=4.000244140625,xl=1/450;class wl{constructor(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=xl,e.aY(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.eU()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let r=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const n=e.o.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%bl==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=y(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const r=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>bl?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==n&&(n=1/n);const i=r(),o=Math.pow(2,i),a="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(a*n))),"wheel"===this._type&&(this._startZoom=i,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:r(),i=this._startZoom,o=this._easing;let a,s=!1;if("wheel"===this._type&&i&&o){const t=Math.min((e.o.now()-this._lastWheelEventTime)/200,1),r=o(t);a=e.ak(i,n,r),t<1?this._frameId||(this._frameId=!0):s=!0}else a=n,s=!0;this._active=!0,s&&(this._active=!1,this._finishTimeout=window.setTimeout((()=>
vendor: 8,973 bytes, line 1
1{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200));let l=a-r();return l*this._lastDelta<0&&(l=0),{noInertia:!0,needsRenderFrame:!s,zoomDelta:l,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.eV;if(this._prevEase){const t=this._prevEase,n=(e.o.now()-t.start)/t.duration,i=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,a=Math.sqrt(.0729-o*o);r=e.eT(o,a,.25,1)}return this._prevEase={start:e.o.now(),duration:t,easing:r},r}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")}),200)}}class Sl{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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 kl{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Tl{constructor(){this._tap=new Js({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Il{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ml{constructor(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r}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 El{constructor(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Pl=e=>e.zoom||e.drag||e.pitch||e.rotate;class Al extends e.z{}class Cl{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,r){const n=e.av([],r,t);this.radius=e.ag(n[2]<0?e.eX([],n,this.constants):[n[0],n[1],0])}projectRay(t){e.eX(t,t,this.constants),e.aw(t,t),e.eY(t,t,this.constants);const r=e.c5([],t,this.radius);if(r[2]>0){const t=e.c5([],[0,0,1],e.bJ(r,[0,0,1])),n=e.c5([],e.aw([],[r[0],r[1],0]),this.radius),i=e.d8([],r,e.c5([],e.av([],e.d8([],n,t),r),2));r[0]=i[0],r[1]=i[1]}return r}}function Rl(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Ll{constructor(t,r){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Vs(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Cl,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(r),e.aY(["handleEvent","handleWindowEvent"],this);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,t,r]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(t,n,r)}}destroy(){for(const[e,t,r]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(t,n,r)}}_addDefaultHandlers(e){const t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new Ws(t,e));const n=t.boxZoom=new Ys(t,e);this._add("boxZoom",n);const i=new Qs,o=new kl;t.doubleClickZoom=new Sl(o,i),this._add("tapZoom",i),this._add("clickZoom",o);const a=new Tl;this._add("tapDragZoom",a);const s=t.touchPitch=new ml(t);this._add("touchPitch",s);const l=new al(e),c=new sl(e);t.dragRotate=new Ml(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new ol(e),d=new ll(t,e);t.dragPan=new Il(r,u,d),this._add("mousePan",u),this._add("touchPan",d,["touchZoom","touchRotate"]);const h=new pl,f=new hl;t.touchZoomRotate=new El(r,f,h,a),this._add("touchRotate",h,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Zs(t));const p=t.scrollZoom=new wl(t,this);this._add("scrollZoom",p,["mousePan"]);const g=t.keyboard=new _l;this._add("keyboard",g);for(const r of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[r]&&t[r].enable(e[r])}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Pl(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,r){for(const n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const r of e)this._el.contains(r.target)&&t.push(r);return t}handleEvent(e,t){this._updatingCamera=!0;const r="renderFrame"===e.type,n=r?void 0:e,i={needsRenderFrame:!1},o={},a={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?_(this._el,s):r?void 0:y(this._el,e);for(const{handlerName:r,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let d;this._blockedByActive(a,u,r)?c.reset():c[t||e.type]&&(d=c[t||e.type](e,l,s),this.mergeHandlerResult(i,o,d,r,n),d&&d.needsRenderFrame&&this._triggerRe
1nderFrame()),(d||c.isActive())&&(a[r]=c)}const c={};for(const e in this._previousActiveHandlers)a[e]||(c[e]=n);this._previousActiveHandlers=a,(Object.keys(c).length||Rl(i))&&(this._changes.push([i,o,c]),this._triggerRenderFrame()),(Object.keys(a).length||Rl(i))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=i;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(e,t,r,n,i){if(!r)return;Object.assign(e,r);const o={handlerName:n,originalEvent:r.originalEvent||i};void 0!==r.zoomDelta&&(t.zoom=o),void 0!==r.panDelta&&(t.drag=o),void 0!==r.pitchDelta&&(t.pitch=o),void 0!==r.bearingDelta&&(t.rotate=o)}_applyChanges(){const t={},r={},n={};for(const[i,o,a]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.aroundCoord&&(t.aroundCoord=i.aroundCoord),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),Object.assign(r,o),Object.assign(n,a);this._updateMapTransform(t,r,n),this._changes=[]}_updateMapTransform(t,r,n){const i=this._map,o=i.transform,a=e=>[e.x,e.y,e.z];if((()=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!Rl(t)){const e=o.zoom;o.cameraElevationReference="sea",null!=this._originalZoom&&o._orthographicProjectionAtLowPitch&&"globe"!==o.projection.name&&0===o.pitch?(o.cameraElevationReference="ground",o.zoom=this._originalZoom):(o.recenterOnTerrain(),o.cameraElevationReference="ground"),e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&i._stop(!0),!Rl(t))return void this._fireEvents(r,n,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:d,aroundCoord:h,pinchAround:f}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==f&&(d=f),(l||(e=>r[e]&&!this._eventsInProgress[e])("drag"))&&d&&(this._dragOrigin=a(o.pointCoordinate3D(d)),this._originalZoom=o.zoom,this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",i._stop(!0),d=d||i.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const p=[0,0,0];if(s)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(d).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(d.sub(s)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1]}else{const t=o.pointCoordinate(d);if("globe"===o.projection.name){s=s.rotate(-o.angle);const r=o._pixelsPerMercatorPixel/o.worldSize;p[0]=-s.x*e.eW(e.a$(t.y))*r,p[1]=-s.y*e.eW(o.center.lat)*r}else{const e=o.pointCoordinate(d.sub(s));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const g=o.zoom,m=[0,0,0];if(l){const t=a(h||o.pointCoordinate3D(d)),r={dir:e.aw([],e.av([],t,o._camera.position))};if(r.dir[2]<0){const n=o.zoomDeltaToMovement(t,l);e.c5(m,r.dir,n)}}const y=e.d8(p,p,m);o._translateCameraConstrained(y),l&&Math.abs(o.zoom-g)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,n,!0)}
vendor: 1,321 bytes, line 1
1_fireEvents(t,r,n){const i=Pl(this._eventsInProgress),o=Pl(t),a={};for(const e in t){const{originalEvent:r}=t[e];this._eventsInProgress[e]||(a[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:r}=t[e];this._fireEvent(e,r)}const s={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:n}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=r[t]||n,s[`${e}end`]=l)}for(const e in s)this._fireEvent(e,s[e]);const c=Pl(this._eventsInProgress);if(n&&(i||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;t?(r(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.z("moveend",{originalEvent:l})),r(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,r){this._map.fire(new e.z(t,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{this._frameId=void 0,this.handleEvent(new Al("renderFrame",{timeStamp:e})),this._applyChanges()}))}
vendor: 9,763 bytes, line 1
1_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Ol="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Dl extends e.E{constructor(t,r){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=r.bearingSnap,this._respectPrefersReducedMotion=!1!==r.respectPrefersReducedMotion,e.aY(["_renderFrameCallback"],this)}getCenter(){return new e.aT(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,r,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,Object.assign({offset:t},r),n)}panTo(e,t,r){return this.easeTo(Object.assign({center:e},t),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,r){return this.easeTo(Object.assign({zoom:e},t),r)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,r){return this.easeTo(Object.assign({bearing:e},t),r)}resetNorth(e,t){return this.rotateTo(0,Object.assign({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(Object.assign({bearing:0,pitch:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(t,r){t=e.aI.convert(t);const n=r&&r.bearing||0,i=r&&r.pitch||0,o=t.getNorthWest(),a=t.getSouthEast();return this._cameraForBounds(this.transform,o,a,n,i,r)}_extendPadding(e){const t={top:0,right:0,bottom:0,left:0};return null==e?Object.assign({},t,this.transform.padding):"number"==typeof e?{top:e,bottom:e,right:e,left:e}:Object.assign({},t,e)}_extendCameraOptions(e){return(e=Object.assign({offset:[0,0],maxZoom:this.transform.maxZoom},e)).padding=this._extendPadding(e.padding),e}_minimumAABBFrustumDistance(e,t){const r=t.max[0]-t.min[0],n=t.max[1]-t.min[1];return r/n>e.aspect?r/(2*Math.tan(.5*e.fovX)*e.aspect):n/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,r,n,i,o,a){const s=t.clone(),l=this._extendCameraOptions(a);s.bearing=i,s.pitch=o;const c=e.aT.convert(r),u=e.aT.convert(n),d=.5*(c.lat+u.lat),h=.5*(c.lng+u.lng),f=e.eZ(d,h),p=e.aw([],f),g=e.aw([],e.bI([],p,[0,1,0])),m=e.bI([],g,p),y=[g[0],g[1],g[2],0,m[0],m[1],m[2],0,p[0],p[1],p[2],0,0,0,0,1],_=[f,e.eZ(c.lat,c.lng),e.eZ(u.lat,c.lng),e.eZ(u.lat,u.lng),e.eZ(c.lat,u.lng),e.eZ(d,c.lng),e.eZ(d,u.lng),e.eZ(c.lat,h),e.eZ(u.lat,h)];let v=e.d9.fromPoints(_.map((t=>[e.bJ(g,t),e.bJ(m,t),e.bJ(p,t)])));const b=e.af([],v.center,y);0===e.e_(b)&&e.e$(b,0,0,1),e.aw(b,b),e.c5(b,b,e.aD),s.center=e.f0(b);const x=s.getWorldToCameraMatrix(),w=e.bl(new Float64Array(16),x);v=e.d9.applyTransform(v,e.aB([],x,y));const S=this._extendAABB(v,s,l,i);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");v=S,e.af(b,b,x);const k=.5*(v.max[2]-v.min[2]),T=this._minimumAABBFrustumDistance(s,v),I=e.c5([],[0,0,1],k),M=e.d8(I,b,I),E=T+(0===s.pitch?0:e.bG(b,M)),P=s.globeCenterInViewSpace,A=e.av([],b,[P[0],P[1],P[2]]);e.aw(A,A),e.c5(A,A,E);const C=e.d8([],b,A);e.af(C,C,w);const R=e.eM/e.aD,L=e.ag(C),O=e.cf(Math.max(L*R-e.eM,Number.EPSILON),0),D=Math.min(s.zoomFromMercatorZAdjusted(O),l.maxZoom);return D>.5*(e.c_+e.cL)?(s.setProjection({name:"mercator"}),s.zoom=D,this._cameraForBounds(s,r,n,i,o,a)):{center:s.center,zoom:D,bearing:i,pitch:o}}_extendAABB(t,r,n,i){const o=.5*((n.padding.left||0)+(n.padding.right||0)),a=.5*((n.padding.top||0)+(n.padding.bottom||0)),s=a,l=o,c=o,u=a,d=r.width-(l+c),h=r.height-(s+u),f=e.av([],t.max,t.min),p=Math.min(d/f[0],h/f[1]),g=Math.min(r.scaleZoom(r.scale*p),n.maxZoom);if(isNaN(g))return null;const m=r.scale/r.zoomScale(g),y=new e.d9([t.min[0]-l*m,t.min[1]-u*m,t.min[2]],[t.max[0]+c*m,t.max[1]+s*m,t.max[2]]),_=("number"==typeof n.offset.x&&"number"==typeof n.offset.y?new e.P(n.offset.x,n.offset.y):e.P.convert(n.offset)).rotate(-e.an(i));return y.center[0]-=_.x*m,y.center[1]+=_.y*m,y}queryTerrainElevation(t,r){const n=this.transform.elevation;return n?(r=Object.assign({},{exaggerated:!0},r),n.getAtPoint(e.ae.fromLngLat(t),null,r.exaggerated)):null}_cameraForBounds(t,r,n,i,o,a){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,r,n,i,o,a);const s=t.clone(),l=this._extendCameraOptions(a);s.bearing=i,s.pitch=o;const c=e.aT.convert(r),u=e.aT.convert(n),d=new e.aT(c.lng,u.lat),h=new e.aT(u.lng,c.lat),f=s.project(c),p=s.project(u),g=this.queryTerrainElevation(c),m=this.queryTerrainElevation(u),y=this.queryTerrainElevation(d),_=this.queryTerrainElevation(h),v=[[f.x,f.y,Math.min(g||0,m||0,y||0,_||0)],[p.x,p.y,Math.max(g||0,m||0,y||0,_||0)]];let b=e.d9.fromPoints(v);const x=s.getWorldToCameraMatrix(),w=e.bl(new Float64Array(16),x);b=e.d9.applyTransform(b,x);const S=this._extendAABB(b,s,l,i);if(!S)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");b=S;const k=.5*e.av([],b.max,b.min)[2],T=this._minimumAABBFrustumDistance(s,b),I=[0,0,1,0];e.aC(I,I,x),e.f1(I,I);const M=e.c5([],I,T+k),E=e.d8([],b.center,M);e.af(b.center,b.center,w),e.af(E,E,w);const P=s.unproject(new e.P(b.center[0],b.center[1])),A=e.f2(s.projection,P),C=Math.pow(2,A),R=Math.min(s._zoomFromMercatorZ(E[2]*s.pixelsPerMeter*C/s.worldSize),l.maxZoom);return s.mercatorFromTransition&&R<.5*(e.c_+e.cL)?(s.setProjection({name:"globe"}),s.zoom=R,this._cameraForBounds(s,r,n,i,o,a)):{center:P,zoom:R,bearing:i,pitch:o}}fitBounds(e,t,r){const n=this.cameraForBounds(e,t);return this._fitInternal(n,t,r)}fitScreenCoordinates(t,r,n,i,o){const a=e.P.convert(t),s=e.P.convert(r),l=new e.P(Math.min(a.x,s.x),Math.min(a.y,s.y)),c=new e.P(Math.max(a.x,s.x),Math.max(a.y,s.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(a,s))return this;const u=this.transform.pointLocation3D(l),d=this.transform.pointLocation3D(c),h=this.transform.pointLocation3D(new e.P(l.x,c.y)),f=this.transform.pointLocation3D(new e.P(c.x,l.y)),p=[Math.min(u.lng,d.lng,h.lng,f.lng),Math.min(u.lat,d.lat,h.lat,f.lat)],g=[Math.max(u.lng,d.lng,h.lng,f.lng),Math.max(u.lat,d.lat,h.lat,f.lat)],m=i&&i.pitch?i.pitch:this.getPitch(),y=this._cameraForBounds(this.transform,p,g,n,m,i);return this._fitInternal(y,i,o)}_fitInternal(e,t,r){return e?(t=Object.assign(e,t)).linear?this.easeTo(t,r):this.flyTo(t,r):this}jumpTo(t,r){this.stop();const n=t.preloadOnly?this.transform.clone():this.transform;let i=!1,o=!1,a=!1;"zoom"in t&&n.zoom!==+t.zoom&&(i=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.aT.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(o=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(a=!0,n.pitch=+t.pitch);const s="number"==typeof t.padding?this._extendPadding(t.padding):t.padding;if(null!=t.padding&&!n.isPaddingEqual(s))if(!1===t.retainPadding){const e=n.clone();e.padding=s,n.setLocationAtPoint(n.center,e.centerPoint)}else n.padding=s;return t.preloadOnly?(this._preloadTiles(n),this):(this.fire(new e.z("movestart",r)).fire(new e.z("move",r)),i&&this.fire(new e.z("zoomstart",r)).fire(new e.z("zoom",r)).fire(new e.z("zoomend",r)),o&&this.fire(new e.z("rotatestart",r)).fire(new e.z("rotate",r)).fire(new e.z("rotateend",r)),a&&this.fire(new e.z("pitchstart",r)).fire(new e.z("pitch",r)).fire(new e.z("pitchend",r)),this.fire(new e.z("moveend",r)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w(Ol),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,r){const n=this.transform;if(!n.projection.supportsFreeCamera)return e.w(Ol),this;this.stop();const i=n.zoom,o=n.pitch,a=n.bearing;n.setFreeCameraOptions(t);const s=i!==n.zoom,l=o!==n.pitch,c=a!==n.bearing;return this.fire(new e.z("movestart",r)).fire(new e.z("move",r)),s&&this.fire(new e.z("zoomstart",r)).fire(new e.z("zoom",r)).fire(new e.z("zoomend",r)),c&&this.fire(new e.z("rotatestart",r)).fire(new e.z("rotate",r)).fire(new e.z("rotateend",r)),l&&this.fire(new e.z("pitchstart",r)).fire(new e.z("pitch",r)).fire(new e.z("pitchend",r)),this.fire(new e.z("moveend",r)),this}easeTo(t,r){this._stop(!1,t.easeId),(!1===(t=Object.assign({offset:[0,0],duration:500,easing:e.eV},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const n=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?+t.zoom:i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,d=this._extendPadding(t.padding),h=e.P.convert(t.offset);let f,p,g;if("globe"===n.projection.name){const r=e.ae.fromLngLat(n.center),i=h.rotate(-n.angle);r.x+=i.x/n.worldSize,r.y+=i.y/n.worldSize;const o=r.toLngLat(),a=e.aT.convert(t.center||o);this._normalizeCenter(a),f=n.centerPoint.add(i),p=new e.P(r.x,r.y).mult(n.worldSize),g=new e.P(e.aF(a.lng),e.aJ(a.lat)).mult(n.worldSize).sub(p)}else{f=n.centerPoint.add(h);const r=n.pointLocation(f),i=e.aT.convert(t.center||r);this._normalizeCenter(i),p=n.project(r),g=n.project(i).sub(p)}const m=n.zoomScale(l-i);let y,_;t.around&&(y=e.aT.convert(t.around),_=n.locationPoint(y));const v=this._zooming||l!==i,b=this._rotating||o!==c,x=this._pitching||u!==a,w=!n.isPaddingEqual(d),S=!1===t.retainPadding?n.clone():n,k=n=>k=>{if(v&&(n.zoom=e.ak(i,l,k)),b&&(n.bearing=e.ak(o,c,k)),x&&(n.pitch=e.ak(a,u,k)),w&&(S.interpolatePadding(s,d,k),f=S.centerPoint.add(h)),y)n.setLocationAtPoint(y,_);else{const e=n.zoomScale(n.zoom-i),t=l>i?Math.min(2,m):Math.max(.5,m),r=Math.pow(t,1-k),o=n.unproject(p.add(g.mult(k*r)).mult(e));
vendor: 6,804 bytes, line 1
1n.setLocationAtPoint(n.renderWorldCopies?o.wrap():o,f)}return t.preloadOnly||this._fireMoveEvents(r),n};if(t.preloadOnly){const e=this._emulate(k,t.duration,n);return this._preloadTiles(e),this}const T={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=v,this._rotating=b,this._pitching=x,this._padding=w,this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,T),this._ease(k(n),(e=>{"sea"===n.cameraElevationReference&&n.recenterOnTerrain(),this._afterEase(r,e)}),t),this}_prepareEase(t,r,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),r||n.moving||this.fire(new e.z("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.z("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.z("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.z("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.z("move",t)),this._zooming&&this.fire(new e.z("zoom",t)),this._rotating&&this.fire(new e.z("rotate",t)),this._pitching&&this.fire(new e.z("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.z("zoomend",t)),i&&this.fire(new e.z("rotateend",t)),o&&this.fire(new e.z("pitchend",t)),this.fire(new e.z("moveend",t))}flyTo(t,r){if(this._prefersReducedMotion(t)){const n=e.aH(t,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(n,r)}this.stop(),t=Object.assign({offset:[0,0],speed:1.2,curve:1.42,easing:e.eV},t);const n=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?e.aA(+t.zoom,n.minZoom,n.maxZoom):i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,d=this._extendPadding(t.padding),h=n.zoomScale(l-i),f=e.P.convert(t.offset);let p=n.centerPoint.add(f);const g=n.pointLocation(p),m=e.aT.convert(t.center||g);this._normalizeCenter(m);const y=n.project(g),_=n.project(m).sub(y);let v=t.curve;const b=Math.max(n.width,n.height),x=b/h,w=_.mag();if("minZoom"in t){const r=e.aA(Math.min(t.minZoom,i,l),n.minZoom,n.maxZoom),o=b/n.zoomScale(r-i);v=Math.sqrt(o/w*2)}const S=v*v;function k(e){const t=(x*x-b*b+(e?-1:1)*S*S*w*w)/(2*(e?x:b)*S*w);return Math.log(Math.sqrt(t*t+1)-t)}function T(e){return(Math.exp(e)-Math.exp(-e))/2}function I(e){return(Math.exp(e)+Math.exp(-e))/2}const M=k(0);let E=function(e){return I(M)/I(M+v*e)},P=function(e){return b*((I(M)*(T(t=M+v*e)/I(t))-T(M))/S)/w;var t},A=(k(1)-M)/v;if(Math.abs(w)<1e-6||!isFinite(A)){if(Math.abs(b-x)<1e-6)return this.easeTo(t,r);const e=x<b?-1:1;A=Math.abs(Math.log(x/b))/v,P=function(){return 0},E=function(t){return Math.exp(e*v*t)}}t.duration="duration"in t?+t.duration:1e3*A/("screenSpeed"in t?+t.screenSpeed/v:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const C=o!==c,R=u!==a,L=!n.isPaddingEqual(d),O=!1===t.retainPadding?n.clone():n,D=n=>h=>{const g=h*A,v=1/E(g);n.zoom=1===h?l:i+n.scaleZoom(v),C&&(n.bearing=e.ak(o,c,h)),R&&(n.pitch=e.ak(a,u,h)),L&&(O.interpolatePadding(s,d,h),p=O.centerPoint.add(f));const b=1===h?m:n.unproject(y.add(_.mult(P(g))).mult(v));return n.setLocationAtPoint(n.renderWorldCopies?b.wrap():b,p),n._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(r),n};if(t.preloadOnly){const e=this._emulate(D,t.duration,n);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=C,this._pitching=R,this._padding=L,this._prepareEase(r,!1),this._ease(D(n),(()=>this._afterEase(r)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.o.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.o.now()-this._easeStart)/this._easeOptions.duration,1),r=this._onEaseFrame;r&&r(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,r){t=e.bT(t,-180,180);const n=Math.abs(t-r);return Math.abs(t-360-r)<n&&(t-=360),Math.abs(t+360-r)<n&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(t.maxBounds)return;if("globe"!==t.projection.name&&!t.renderWorldCopies)return;const r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.o.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,r){const n=Math.ceil(15*t/1e3),i=[],o=e(r.clone());for(let e=0;e<=n;e++){const t=o(e/n);i.push(t.clone())}return i}_preloadTiles(e,t){}}class zl{constructor(t={}){this.options=t,e.aY(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact,r=e._getUIString("AttributionControl.ToggleAttribution");this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=l("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",r);const n=l("span","mapboxgl-ctrl-icon",this._compactButton);return n.setAttribute("aria-hidden","true"),n.setAttribute("title",r),this._innerContainer=l("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
1se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.e.ACCESS_TOKEN}];if(t){const n=r.reduce(((e,t,n)=>(t.value&&(e+=`${t.key}=${t.value}${n<r.length-1?"&":""}`),e)),"?");t.href=`${e.e.FEEDBACK_URL}/${n}#${Ds(this._map,!0)}`,t.rel="noopener nofollow"}}_updateData(e){!e||("source"!==e.dataType||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType)&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style._mergedSourceCaches;for(const r in t){const n=t[r];if(n.used){const t=n.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,r)=>{for(let n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const r=e.map((e=>function(e){const t=(new DOMParser).parseFromString(e,"text/html");return Array.from(t.body.querySelectorAll("*")).reverse().forEach((e=>{const r=e.textContent||"";if("A"!==e.tagName)return void e.replaceWith(...e.childNodes);const n=e.getAttribute("href");if(!n||!/^(https?:|mailto:)/i.test(n))return void e.replaceWith(t.createTextNode(r));const i=t.createElement("a");i.href=n,i.textContent=r,i.rel="noopener nofollow";const o=e.getAttribute("class");o&&(i.className=o),e.replaceWith(i)})),t.body.innerHTML}(e))).join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Fl{constructor(){e.aY(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=l("div","mapboxgl-ctrl");const t=l("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const r=e[t].getSource();if(r.hasOwnProperty("mapbox_logo")&&!r.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Nl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(const t of r)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const r of t)if(!r.cancelled&&(r.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class Bl{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const r=e.dD((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-r)+this._end*r}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,r){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+r}}const jl={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class Vl extends e.z{constructor(e,t,r,n){const{point:i,lngLat:o,originalEvent:a,target:s}=e;super(e.type,{point:i,lngLat:o,originalEvent:a,target:s}),this.preventDefault=()=>{e.preventDefault()},this.id=t,this.interaction=r,this.feature=n}}class Gl{constructor(e){this.map=e,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}
vendor: 1,682 bytes, line 1
1add(t,r){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const n=r.filter;let i=r.type;n&&this.filters.set(t,e.b6(n)),"mouseover"===i&&(i="mouseenter"),"mouseout"===i&&(i="mouseleave");const o=this.interactionsByType.get(i)||new Map;"mouseenter"===i||"mouseleave"===i?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(t,r)):0===o.size&&this.map.on(i,this.handleType),0===o.size&&this.interactionsByType.set(i,o),o.set(t,r),this.typeById.set(t,i)}get(e){const t=this.typeById.get(e);if(!t)return;const r=this.interactionsByType.get(t);return r?r.get(e):void 0}remove(e){const t=this.typeById.get(e);if(!t)return;this.typeById.delete(e),this.filters.delete(e);const r=this.interactionsByType.get(t);r&&(r.delete(e),"mouseenter"===t||"mouseleave"===t?(this.delegatedInteractions.delete(e),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===r.size&&this.map.off(t,this.handleType))}queryTargets(e,t){const r=[];for(const[e,n]of t)n.target&&r.push({targetId:e,target:n.target,filter:this.filters.get(e)});return this.map.style.queryRenderedTargets(e,r,this.map.transform)}handleMove(e){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const t=this.queryTargets(e.point,Array.from(this.delegatedInteractions).reverse());t.length&&(e.type="mouseenter",this.handleType(e,t));const r=new Map;for(const[e,{feature:t}]of this.prevHoveredFeatures)this.hoveredFeatures.has(e)||r.set(t.id,t);r.size&&(e.type="mouseleave",this.handleType(e,Array.from(r.values())
1))}handleOut(e){const t=Array.from(this.hoveredFeatures.values()).map((({feature:e})=>e));t.length&&(e.type="mouseleave",this.handleType(e,t)),this.hoveredFeatures.clear()}handleType(t,r){const n="mouseenter"===t.type;if(n&&!this.interactionsByType.has(t.type))return void e.w("mouseenter interaction required for mouseleave to work.");const i=Array.from(this.interactionsByType.get(t.type)).reverse(),o=!!r;r=r||this.queryTargets(t.point,i);let a=!1;const s=new Set;for(const l of r){for(const[r,c]of i){if(!c.target)continue;const i=l.variants?l.variants[r]:null;if(i){for(const u of i){if(_t(u,l,s,r))continue;const i=new e.dx(l,u),d=yt(u,l,r);o&&void 0!==i.id&&(i.state=this.map.getFeatureState(i));const h=n?this.prevHoveredFeatures.get(d):null,f=new Vl(t,r,c,i),p=h?h.stop:c.handler(f);if(n&&this.hoveredFeatures.set(d,{feature:l,stop:p}),!1!==p){a=!0;break}}if(a)break}}if(a)break}if(!a)for(const[e,r]of i){const{handler:n,target:i}=r;if(!i&&!1!==n(new Vl(t,e,r,null)))break}}}function Ul(t,r){if(Array.isArray(t)&&Array.isArray(r)){const e=new Set(t),n=new Set(r);return e.size===n.size&&t.every((e=>n.has(e)))}return e.by(t,r)}const $l={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},Hl={showCompass:!0,showZoom:!0,visualizePitch:!1};class ql{constructor(t,r,n=!1){this._clickTolerance=10,this.element=r,this.mouseRotate=new al({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,n&&(this.mousePitch=new sl({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.aY(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener("mousedown",this.mousedown),r.addEventListener("touchstart",this.touchstart,{passive:!1}),r.addEventListener("touchmove",this.touchmove),r.addEventListener("touchend",this.touchend),r.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),f()}move(e,t){const r=this.map,n=this.mouseRotate.mousemoveWindow(e,t),i=n&&n.bearingDelta;if(i&&r.setBearing(r.getBearing()+i),this.mousePitch){const n=this.mousePitch.mousemoveWindow(e,t),i=n&&n.pitchDelta;i&&r.setPitch(r.getPitch()+i)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){p(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(e){this.down(Object.assign({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),y(this.element,e)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,y(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=_(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=_(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function Wl(t,r,n){if(t=new e.aT(t.lng,t.lat),r){const i=new e.aT(t.lng-360,t.lat),o=new e.aT(t.lng+360,t.lat),a=360*Math.ceil(Math.abs(t.lng-n.center.lng)/360),s=n.locationPoint3D(t).distSqr(r),l=r.x<0||r.y<0||r.x>n.width||r.y>n.height;n.locationPoint3D(i).distSqr(r)<s&&(l||Math.abs(i.lng-n.center.lng)<a)?t=i:n.locationPoint3D(o).distSqr(r)<s&&(l||Math.abs(o.lng-n.center.lng)<a)&&(t=o)}for(;Math.abs(t.lng-n.center.lng)>180;){const e=n.locationPoint3D(t);
1if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}const Zl={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%)"},Yl={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class Xl extends e.E{constructor(t,r){super(),(t instanceof HTMLElement||r)&&(t=Object.assign({element:t},r)),e.aY(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:n="center",color:i="#3FB1CE",scale:o=1,draggable:a=!1,clickTolerance:s=0,rotation:l=Yl.rotation,rotationAlignment:c=Yl.rotationAlignment,pitchAlignment:u=Yl.pitchAlignment,occludedOpacity:d=Yl.occludedOpacity,altitude:h=Yl.altitude}=t||{};this._anchor=n,this._color=i,this._scale=o,this._draggable=a,this._clickTolerance=s,this._rotation=l,this._rotationAlignment=c,this._pitchAlignment=u,this._occludedOpacity=d,this._altitude=h,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),t&&t.element?(this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=e.P.convert(t&&t.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()}));const f=this._element.classList;for(const e in Zl)f.remove(`mapboxgl-marker-anchor-${e}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`);const p=t&&t.className?t.className.trim().split(/\s+/):[];f.add(...p),this._popup=null}_createDefaultMarker(){const e=l("div"),t=c("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},e);if(0===this._altitude){const e=c("radialGradient",{id:"shadowGradient"},c("defs",{},t));c("stop",{offset:"10%","stop-opacity":.4},e),c("stop",{offset:"100%","stop-opacity":.05},e),c("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},t)}return c("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},t),c("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},t),c("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},t),e}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.aT.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(e){return e===this._altitude||(this._defaultMarker&&(0===this._altitude&&0!==e||0!==this._altitude&&0===e)&&(this._element=this._createDefaultMarker()),this._altitude=e||Yl.altitude,this._update()),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,r=13.5,n=Math.sqrt(Math.pow(r,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
vendor: 3,227 bytes, line 1
10,-t],"bottom-left":[n,-1*(t-r+n)],"bottom-right":[-n,-1*(t-r+n)],left:[r,-1*(t-r)],right:[-r,-1*(t-r)]}:this._offset}this._popup=e,e._marker=this,e._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const r=e.unproject(t,this._altitude),n=e.getFreeCameraOptions();if(!n.position)return!1;const i=n.position.toLngLat();return i.distanceTo(r)<.9*i.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const r=this._pos;if(!r||r.x<0||r.x>t.transform.width||r.y<0||r.y>t.transform.height)return void this._clearFadeTimer();const n=t.unproject(r,this._altitude);let i;t._showingGlobe()&&e.f5(t.transform,this._lngLat)?i=0:(i=1-t._queryFogOpacity(n),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(i*=this._occludedOpacity)),this._element.style.opacity=`${i}`,this._element.style.pointerEvents=i>0?"auto":"none",this._popup&&this._popup._setOpacity(i),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n            translate(${e.x}px,${e.y}px)\n            ${Zl[this._anchor]}\n            ${this._calculateXYTransform()} ${this._calculateZTransform()}\n            translate(${t.x}px,${t.y}px)\n        `}_calculateXYTransform(){const t=this._pos,r=this._map,n=this.getPitchAlignment();if(!r||!t||"map"!==n)return"";if(!r._showingGlobe()){const e=r.getPitch();return e?`rotateX(${e}deg)`:""}const i=e.cX(e.f6(r.transform,this._lngLat)),o=t.sub(e.f7(r.transform)),a=Math.abs(o.x)+Math.abs(o.y);if(0===a)return"";const s=i/a;return`rotateX(${-o.y*s}deg) rotateY(${o.x*s}deg)`}_calculateZTransform(){const t=this._pos,r=this._map;if(!r||!t)return"";let n=0;const i=this.getRotationAlignment();if("map"===i)if(r._showingGlobe()){const t=r.project(new e.aT(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),i=r.project(new e.aT(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(t);n=e.cX(Math.atan2(i.y,i.x))-90}else n=-r.getBearing();else if("horizon"===i){const i=e.ah(4,6,r.getZoom()),o=e.f7(r.transform);o.y+=i*r.transform.height;const a=t.sub(o),s=e.cX(Math.atan2(a.y,a.x));n=(s>90?s-270:s+90)*(1-i)}return n+=this._rotation,n?`rotateZ(${n}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);const t=this._map;
1t&&(t.transform.renderWorldCopies&&(this._lngLat=Wl(this._lngLat,this._pos,t.transform)),this._pos=t.project(this._lngLat,this._altitude),!0===e?this._updateFrameId=requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),t._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(t._showingGlobe()||t.getTerrain()||t.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(t){const r=this._map;if(!r)return;const n=this._pointerdownPos,i=this._positionDelta;if(n&&i){if(!this._isDragging){const e=this._clickTolerance||r._clickTolerance;if(t.point.dist(n)<e)return;this._isDragging=!0}this._pos=t.point.sub(i),this._lngLat=r.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.z("dragstart"))),this.fire(new e.z("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.z("dragend")),this._state="inactive"}_addDragHandler(e){const t=this._map,r=this._pos;t&&r&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(r),this._pointerdownPos=e.point,this._state="pending",t.on("mousemove",this._onMove),t.on("touchmove",this._onMove),t.once("mouseup",this._onUp),t.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;const t=this._map;return t&&(e?(t.on("mousedown",this._addDragHandler),t.on("touchstart",this._addDragHandler)):(t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||Yl.rotation,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||Yl.rotationAlignment,this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||Yl.pitchAlignment,this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||Yl.occludedOpacity,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const Kl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1,showButton:!0,followUserLocation:!0},Jl={maxWidth:100,unit:"metric"},Ql={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},ec={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0},tc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function rc(t=new e.P(0,0),r="bottom"){if("number"==typeof t){const n=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(r){case"top":return new e.P(0,t);case"top-left":return new e.P(n,n);case"top-right":return new e.P(-n,n);case"bottom":return new e.P(0,-t);case"bottom-left":return new e.P(n,-n);case"bottom-right":return new e.P(-n,-n);case"left":return new e.P(t,0);case"right":return new e.P(-t,0)}return new e.P(0,0)}return t instanceof e.P||Array.isArray(t)?e.P.convert(t):e.P.convert(t[r]||[0,0])}const nc={version:t,supported:s.supported,setRTLTextPlugin:e.fb,getRTLTextPluginStatus:e.fa,Map:class extends Dl{constructor(t){n.mark(r.create);const i=t;if(null!=(t=Object.assign({},$l,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.f3(window)&&(t.antialias=!1,e.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new cn(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies,null,null),t),this._repaint=!!t.repaint,this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileC
1acheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Nl,this._domRenderTaskQueue=new Nl,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.b2(),this._locale=Object.assign({},jl,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._tessellationStep=t.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=t.precompilePrograms,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new Bl(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=t.scaleFactor,this._requestManager=new S(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?Object.assign({},t.contextCreateOptions):{},"string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container '${t.container.toString()}' not found.`);this._container=e}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._spriteFormat=t.spriteFormat,e.aY(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new Ll(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,(t.style||!t.testMode)&&this.setStyle(t.style||e.e.DEFAULT_STYLE,{config:t.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),t.hash&&(this._hash=new Os("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==i.center&&null==i.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const e=t.bounds;e&&(this.resize(),this.fitBounds(e,Object.assign({},t.fitBoundsOptions,{duration:0})))}this.resize(),t.attributionControl&&this.addControl(new zl({customAttribution:t.customAttribution})),this._logoControl=new Fl,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent(),this._postStyleWithAppearanceEvent()})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.z(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.z(`${t.dataType}dataloading`,t))})),this._interactions=new Gl(this)}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.y(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}
vendor: 4,377 bytes, line 1
1removeControl(t){if(!t||!t.onRemove)return this.fire(new e.y(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const r=!this._moving;return r&&this.fire(new e.z("movestart",t)).fire(new e.z("move",t)),this.fire(new e.z("resize",t)),r&&this.fire(new e.z("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.aI.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new e.z("zoomstart")).fire(new e.z("zoom")).fire(new e.z("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=t??22)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.z("zoomstart")).fire(new e.z("zoom")).fire(new e.z("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=t??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t?this.setPitch(t):this.fire(new e.z("pitchstart")).fire(new e.z("pitch")).fire(new e.z("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=t??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.z("pitchstart")).fire(new e.z("pitch")).fire(new e.z("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(e){return this._scaleFactor=e,this.painter.scaleFactor=e,this.style&&this.style._setLabelPlacementStale(),this.style._updateFilteredLayers((e=>"symbol"===e.type)),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map((e=>"auto"===e?navigator.language:e)):e}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this._styleDirty=!0,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,r=t.projection.name;let n;"globe"===r&&t.zoom>=e.cL?(t.setMercatorFromTransition(),n=!0):"mercator"===r&&t.zoom<e.cL&&(t.setProjection({name:"globe"}),n=!0),n&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayer
vendor: 4,134 bytes, line 1
1Update(),this._update(!0))}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let r;const n=this.transform.mercatorFromTransition;r="globe"===t.name&&this.transform.zoom>=e.cL?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate();const i="mercator"===this.transform.getProjection().name&&n!==this.transform.mercatorFromTransition;return(r||i)&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t,r){return this.transform.locationPoint3D(e.aT.convert(t),r)}unproject(t,r){return this.transform.pointLocation3D(e.P.convert(t),r)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,r){const n=e=>{let r=[];if(Array.isArray(t)){const n=t.filter((e=>this.getLayer(e)));r=n.length?this.queryRenderedFeatures(e,{layers:n}):[]}else r=this.queryRenderedFeatures(e,{target:t});return r};if("mouseenter"===e||"mouseover"===e){let i=!1;const o=t=>{const o=n(t.point);o.length?i||(i=!0,r.call(this,new $s(e,this,t.originalEvent,{features:o}))):i=!1};return{listener:r,targets:t,delegates:{mousemove:o,mouseout:()=>{i=!1}}}}if("mouseleave"===e||"mouseout"===e){let i=!1;const o=t=>{n(t.point).length?i=!0:i&&(i=!1,r.call(this,new $s(e,this,t.originalEvent)))},a=t=>{i&&(i=!1,r.call(this,new $s(e,this,t.originalEvent)))};return{listener:r,targets:t,delegates:{mousemove:o,mouseout:a}}}{const i=e=>{const t=n(e.point);t.length&&(e.features=t,r.call(this,e),delete e.features)};return{listener:r,targets:t,delegates:{[e]:i}}}}on(e,t,r){if("function"==typeof t||void 0===r)return super.on(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,r);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n);for(const e in n.delegates)this.on(e,n.delegates[e]);return this}once(e,t,r){if("function"==typeof t||void 0===r)return super.once(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,r);for(const e in n.delegates)this.once(e,n.delegates[e]);return this}off(e,t,r){if("function"==typeof t||void 0===r)return super.off(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._delegatedListeners?this._delegatedListeners[e]:void 0;return n&&(e=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.listener===r&&Ul(i.targets,t)){for(const e in i.delegates)this.off(e,i.delegates[e]);return e.splice(n,1),this}}})(n),this}queryRenderedFeatures(t,r){if(!this.style)return[];if(void 0===t||t instanceof e.P||Array.isArray(t)||void 0!==r||(r=t,t=void 0),t=t||[[0,0],[this.transform.width,this.transform.height]],!r){const e=this.style.queryRenderedFeatures(t,void 0,this.transform),r=this.style.queryRenderedFeatureset(t,void 0,this.transform);return e.concat(r)}let n=!0;if(r.target&&(n=this._isTargetValid(r.target),n&&!r.layers))return this.style.queryRenderedFeatureset(t,r,this.transform);let i=!0;if(r.layers&&Array.isArray(r.layers)){for(const e of r.layers)if(!this._isValidId(e)){i=!1;break}if(i&&!r.target)return this.style.queryRenderedFeatures(t,r,this.transform)}let o=[];return i&&(o=o.concat(this.style.queryRenderedFeatures(t,r,this.transform))),n&&(o=o.concat(this.style.queryRenderedFeatureset(t,r,this.transform))),o}querySourceFeatures(e,t){return!e||"string"==typeof e&&!this._isValidId(e)?[]:this.style.querySourceFeatures(e,t)}queryRasterValue(e,t,r){return this._isValidId(e)?this.style.queryRasterValue(e,t,r):Promise.resolve(null)}isPointOnSurface(t){const{name:r}=this.transform.projection;return"globe"!==r&&"mercator"!==r&&e.w(`${r} projection does not support isPointOnSurface, this API may behave unex
1pectedly.`),this.transform.isPointOnSurface(e.P.convert(t))}addInteraction(e,t){return this._interactions.add(e,t),this}removeInteraction(e){return this._interactions.remove(e),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(e){return this._cooperativeGestures=e,this}setStyle(t,r){return r=Object.assign({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},r),this.style&&t&&!1!==r.diff&&r.localFontFamily===this._localFontFamily&&r.localIdeographFontFamily===this._localIdeographFontFamily&&!r.config?(this.style._diffStyle(t,((n,i)=>{if(n){const i="string"==typeof n?n:n instanceof Error?n.message:n.error;e.w(`Unable to perform style diff: ${i}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}else i&&this._update(!0)}),(()=>this._postStyleLoadEvent())),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._localFontFamily=r.localFontFamily,this._updateStyle(t,r))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),e){const r=Object.assign({},t);t&&t.config&&(r.initialConfig=t.config,delete r.config),this.style=new Ln(this,r).load(e),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Ln(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new e.y(new Error("IDs can't be empty."))),!1):!e.dr(t)||(this.fire(new e.y(new Error(`IDs can't contain special symbols: "${t}".`))),!1)}_isTargetValid(e){return"featuresetId"in e?this._isValidId("importId"in e?e.importId:e.featuresetId):"layerId"in e&&this._isValidId(e.layerId)}_areTargetsValid(e){if(Array.isArray(e)){for(const t of e)if(!this._isValidId(t))return!1;return!0}return this._isTargetValid(e)}addSource(e,t){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)):this}isSourceLoaded(e){return!!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(e,t,r){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,r)}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(t,r,{pixelRatio:n=1,sdf:i=!1,stretchX:o,stretchY:a,content:s}={}){this._lazyInitEmptyStyle();const l=e.I.from(t);if(r instanceof HTMLImageElement||ImageBitmap&&r instanceof ImageBitmap){const{width:t,height:c,data:u}=e.o.getImageData(r);this.style.addImage(l,{data:new e.q({width:t,height:c},u),pixelRatio:n,stretchX:o,stretchY:a,content:s,sdf:i,version:0,usvg:!1})}else if(void 0===r.width||void 0===r.height)this.fire(new e.y(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`")));else{const{width:c,height:u}=r,d=r;this.style.addImage(l,{data:new e.q({width:c,height:u},new Uint8Array(d.data)),pixelRatio:n,stretchX:o,stretchY:a,content:s,sdf:i,usvg:!1,version:0,userImage:d}),d.onAdd&&d.onAdd(this,t)}}updateImage(t,r){this._lazyInitEmptyStyle();const n=e.I.from(t),i=this.style.getImage(n);if(!i)return void this.fire(new e.y(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const o=r instanceof HTMLImageElement||ImageBitmap&&r instanceof ImageBitmap?e.o.getImageData(r):r,{width:a,height:s,data:l}=o;if(void 0===a||void 0===s)return void this.fire(new e.y(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(a!==(i.usvg?i.icon.usvg_tree.width:i.data.width)||s!==(i.usvg?i.icon.usvg_tree.height:i.data.height))return void this.fire(new e.y(new Error(`The width and height of the updated image (${a}, ${s})\n                must be that same as the previous version of the image\n                (${i.data.width}, ${i.data.height})`)));const c=!(r instanceof HTMLImageElement||ImageBitmap&&r instanceof ImageBitmap);let u=!1;i.usvg?(i.data=new e.q({width:a,height:s},new Uint8Array(l)),i.usvg=!1,i.icon=void 0,u=!0):i.data.replace(l,c),this.style.updateImage(n,i,u)}hasImage(t){return t?!!this.style&&!!this.style.getImage(e.I.from(t)):(this.fire(new e.y(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(e.I.from(t))}loadImage(t,r){e.n(this._requestManager.transformRequest(t,e.R.Image),((t,n)=>{r(t,n instanceof HTMLImageElement?e.o.getImageData(n):n)}))}listImages(){return this.style.listImages().map((e=>e.name))}addModel(e,t){this._lazyInitEmptyStyle(),this.style.addModel(e,t)}hasModel(t){return t?this.style.hasModel(t):(this.fire(new e.y(new Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e)}listModels(){return this.style.listModels()}addLayer(e,t){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)):this}getSlot(e){const t=this.getLayer(e);return t&&t.slot||null}setSlot(e,t){return this.style.setSlot(e,t),this.style.mergeLayers(),this._update(!0)}
vendor: 5,649 bytes, line 1
1addImport(t,r){return this.style.addImport(t,r).catch((t=>this.fire(new e.y(new Error("Failed to add import",t))))),this}updateImport(e,t){return"string"!=typeof t&&t.id!==e?(this.removeImport(e),this.addImport(t)):(this.style.updateImport(e,t),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,t){return this.style.moveImport(e,t),this._update(!0)}moveLayer(e,t){return this._isValidId(e)?(this.style.moveLayer(e,t),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){if(!this._isValidId(e))return null;const t=this.style.getOwnLayer(e);return t?"custom"===t.type?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(e,t,r){return this._isValidId(e)?(this.style.setLayerZoomRange(e,t,r),this._update(!0)):this}setFilter(e,t,r={}){return this._isValidId(e)?(this.style.setFilter(e,t,r),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,t,r,n={}){return this._isValidId(e)?(this.style.setPaintProperty(e,t,r,n),this._update(!0)):this}getPaintProperty(e,t){return this._isValidId(e)?this.style.getPaintProperty(e,t):null}setLayoutProperty(e,t,r,n={}){return this._isValidId(e)?(this.style.setLayoutProperty(e,t,r,n),this._update(!0)):this}getLayoutProperty(e,t){return this._isValidId(e)?this.style.getLayoutProperty(e,t):null}setLayerProperty(e,t,r,n={}){return this._isValidId(e)?("appearances"===t&&this._postAddingAppearancesToStyleEvent(),this.style.setLayerProperty(e,t,r,n),this._update(!0)):this}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(e){return this.style.setGlyphsUrl(e),this._update(!0)}getSchema(e){return this.style.getSchema(e)}setSchema(e,t){return this.style.setSchema(e,t),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,t){return this.style.setConfig(e,t),this._update(!0)}getConfigProperty(e,t){return this.style.getConfigProperty(e,t)}setConfigProperty(e,t,r){return this.style.setConfigProperty(e,t,r),this._update(!0)}getFeaturesetDescriptors(e){return this.style.getFeaturesetDescriptors(e)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){const t=e[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e,t={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(e){return this._lazyInitEmptyStyle(),this.style.setSnow(e),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(e){return this._lazyInitEmptyStyle(),this.style.setRain(e),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(e){return this._lazyInitEmptyStyle(),this.style.setColorTheme(e),this._update(!0)}setImportColorTheme(e,t){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(e,t),this._update(!0)}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.aT.convert(t),this.transform):0}setFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.setFeatureState(e,t),this._update())}removeFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.removeFeatureState(e,t),this._update())}getFeatureState(e){return e.source&&!this._isValidId(e.source)?null:this.style.getFeatureState(e)}_selectIndoorFloor(e){this.style.indoorManager.selectFloor(e)}_setIndoorActiveFloorsVisibility(e){this.style.indoorManager.setActiveFloorsVisibility(e)}getIndoorTileOptions(e,t){return this.style.isIndoorEnabled()?this.style.indoorManager.getIndoorTileOptions(e,t):null}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let r,n,i,o=this._container;for(;o&&(!n||!i);){const e=window.getComputedStyle(o).transform;e&&"none"!==e&&(r=e.match(/matrix.*\((.+)\)/)[1].split(", "),r[0]&&"0"!==r[0]&&"1"!==r[0]&&(n=r[0]),r[3]&&"0"!==r[3]&&"1"!==r[3]&&(i=r[3])),o=o.parentElement}this._containerWidth=n?Math.abs(e/n):e,this._containerHeight=i?Math.abs(t/i):t}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described 
1in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=l("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=l("div","mapboxgl-canvas-container",e);this._canvas=l("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const r=this._controlContainer=l("div","mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach((e=>{n[e]=l("div",`mapboxgl-ctrl-${e}`,r)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,r){const n=e.o.devicePixelRatio||1;this._canvas.width=n*Math.ceil(t),this._canvas.height=n*Math.ceil(r),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${r}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const t=Object.assign({},s.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl2",t);r?(q(r,!0),this.painter=new Rs(r,this._contextCreateOptions,this.transform,this._scaleFactor,this._worldview),this.on("data",(e=>{if("source"===e.dataType){const t=this.transform.elevation?this.transform.elevation._source():null;t&&e.sourceCacheId===t.id&&this.style&&this.style._setLabelPlacementStale(),this.painter.setTileLoadedFlag(!0)}})),e.k.testSupport(r)):this.fire(new e.y(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.z("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.clearLayers(),this.style.imageManager.destroyAtlasTextures(),this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new e.z("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let i;this.fire(new e.z("renderstart")),++this._frameId;const o=this.painter.context.extTimerQuery,a=e.o.now(),s=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(i=s.createQuery(),s.beginQuery(o.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const l=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,r=this.transform.pitch,n=e.o.now(),i=new e.ac(t,{now:n,fadeDuration:l,pitch:r,transition:this.style.transition,worldview:this._worldview});this.style.update(i)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedU
1pdate=!0,this._sourcesDirty=!0);let c=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),c=this._updateAverageElevation(a),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):c=this._updateAverageElevation(a),this.style&&(this._placementDirty=this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,this.painter.replacementSource)),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.mark(r.load),this.fire(new e.z("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this.style.modelManager.isLoaded()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const t=e.o.now()-a;s.endQuery(o.TIME_ELAPSED_EXT),setTimeout((()=>{const r=s.getQueryParameter(i,s.QUERY_RESULT)/1e6;s.deleteQuery(i),this.fire(new e.z("gpu-timing-frame",{cpuTime:t,gpuTime:r}))}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const r=this.painter.queryGpuTimers(t);this.fire(new e.z("gpu-timing-layer",{layerTimes:r}))}),50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const r=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.z("gpu-timing-deferred-render",{gpuTime:r}))}),50)}const u=this._sourcesDirty||this._styleDirty||this._placementDirty||c;if(u||this._repaint)this.triggerRepaint();else{const t=this.idle();if(t&&(c=this._updateAverageElevation(a,!0)),c)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.z("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.z("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||u||(this._fullyLoaded=!0,n.mark(r.fullLoad),this._performanceMetricsCollection&&G(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const r=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&r(0);const n=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(n||(t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let i=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(i)?i=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-i);if(o>1){if(this._isInitialLoad||n)return this._averageElevation.jumpTo(i),r(i);this._averageElevation.easeTo(i,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(i),r(i)}return!!this._averageElevation.isEasing(e)&&r(this._averageElevation.getValue(e))}_authenticate(){$(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>
1{if(t&&(t.message===w||401===t.status)){const t=this.painter.context.gl;q(t,!1),this._logoControl instanceof Fl&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.y(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),O(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_postStyleLoadEvent(){this.style.globalId&&z(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_postStyleWithAppearanceEvent(){this.style.globalId&&this.style.hasAppearances()&&N(this._requestManager._customAccessToken)}_postAddingAppearancesToStyleEvent(){j(this._requestManager._customAccessToken)}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const r=this.painter.context.gl,n=r.createFramebuffer();function i(e){r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0);const t=new Uint8Array(r.drawingBufferWidth*r.drawingBufferHeight*4);return r.readPixels(0,0,r.drawingBufferWidth,r.drawingBufferHeight,r.RGBA,r.UNSIGNED_BYTE,t),t}return r.bindFramebuffer(r.FRAMEBUFFER,n),this._canvasPixelComparison(i(e),t.canvasCopies.map(i),t.timeStamps)}_canvasPixelComparison(e,t,r){let n=r[1]-r[0];const i=e.length/4;for(let o=0;o<t.length;o++){const a=t[o];let s=0;for(let t=0;t<a.length;t+=4)a[t]===e[t]&&a[t+1]===e[t+1]&&a[t+2]===e[t+2]&&a[t+3]===e[t+3]&&(s+=1);n+=(r[o+2]-r[o+1])*(1-s/i)}return n}remove(){this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),H.delete(this.painter.context.gl),U.remove(),L.remove(),this._removed=!0,this.fire(new e.z("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=e.o.frame((e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)})))}_preloadTiles(t){const r=this.style?this.style.getSourceCaches():[];return e.bw(r,((e,r)=>e._preloadTiles(t,r)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,this.style&&e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,e&&this._update())}_setCacheLimits(t,r){e.f4(t,r)}get version(){return t}},NavigationControl:class{constructor(t={}){this.options=Object.assign({},Hl,t),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.aY(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(e=>{this._map&&this._map.zoomIn({},{originalEvent:e})})),l("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(e=>{this._map&&this._map.zoomOut({},{originalEvent:e})})),l("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.aY(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))})),this._compassIcon=l("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;
1const t=e.getZoom(),r=t===e.getMaxZoom(),n=t===e.getMinZoom();this._zoomInButton.disabled=r,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ql(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const r=l("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}_setButtonTitle(e,t){if(!this._map)return;const r=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",r),e.firstElementChild&&e.firstElementChild.setAttribute("title",r)}},GeolocateControl:class extends e.E{constructor(t={}){super();const r=navigator.geolocation;this.options=Object.assign({geolocation:r},Kl,t),e.aY(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Ls(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._clearRequestTimeout(),void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(e){const t=(t=!!this.options.geolocation)=>{this._supportsGeolocation=t,e(t)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then((e=>t("denied"!==e.state))).catch((()=>t())):t()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),r=e.coords;return!!t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._clearRequestTimeout(),this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.z("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
1RROR":this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this.options.followUserLocation?(this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active")):(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"));break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.followUserLocation&&(!this.options.trackUserLocation||"ACTIVE_LOCK"===this._watchState)&&this._updateCamera(t),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.z("geolocate",Object.assign({coords:t.coords,timestamp:t.timestamp},t.toJSON?{toJSON:t.toJSON.bind(t)}:{}))),this._finish()}}_updateCamera(t){const r=new e.aT(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),o=Object.assign({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})}_updateMarker(t){if(t){const r=new e.aT(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,r=e.cf(1,t._center.lat)*t.worldSize,n=Math.ceil(2*this._accuracy*r);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this._clearRequestTimeout(),this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.z("error",{code:t.code,message:t.message,PERMISSION_DENIED:t.PERMISSION_DENIED,POSITION_UNAVAILABLE:t.POSITION_UNAVAILABLE,TIMEOUT:t.TIMEOUT})),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_startRequestTimeout(){this._clearRequestTimeout();const e=this.options.positionOptions.timeout;e&&(this._requestTimeoutId=window.setTimeout((()=>{this._onError({code:3,message:"Geolocation request timed out"})}),e))}_clearRequestTimeout(){void 0!==this._requestTimeoutId&&(clearTimeout(this._requestTimeoutId),this._requestTimeoutId=void 0)}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=l("button","mapboxgl-ctrl-geolocate",this._container),l("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
1se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=l("div","mapboxgl-user-location"),this._dotElement.appendChild(l("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(l("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Xl({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=l("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Xl({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.showButton||(this._container.style.display="none"),this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.z("trackuserlocationend")))}))}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.z("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this._startRequestTimeout(),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._startRequestTimeout(),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}setFollowUserLocation(t){return this.options.followUserLocation=null!=t?t:Kl.followUserLocation,this.options.trackUserLocation&&"OFF"!==this._watchState&&(this.options.followUserLocation?"BACKGROUND"!==this._watchState&&"BACKGROUND_ERROR"!==this._watchState||(this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.z("trackuserlocationstart"))):"ACTIVE_LOCK"!==this._watchState&&"ACTIVE_E
1RROR"!==this._watchState||(this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this.fire(new e.z("trackuserlocationend")))),this}_addDeviceOrientationListener(){const e=()=>{const e="ondeviceorientationabsolute"in window?"deviceorientationabsolute":"deviceorientation";window.addEventListener(e,this._onDeviceOrientation)};"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((t=>{"granted"===t&&e()})).catch(console.error):e()}_clearWatch(){this._clearRequestTimeout(),this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:zl,ScaleControl:class{constructor(t={}){this.options=Object.assign({},Jl,t),e.aY(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,r=t._containerHeight/2,n=t._containerWidth/2-e/2,i=t.unproject([n,r]),o=t.unproject([n+e,r]),a=i.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*a;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,a/1852,"nautical-mile"):a>=1e3?this._setScale(e,a/1e3,"kilometer"):this._setScale(e,a,"meter")}_setScale(e,t,r){this._map._requestDomTask((()=>{const n=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(t),i=n/t;this._container.innerHTML="nautical-mile"!==r?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:r}).format(n):`${n}&nbsp;${Ql[r]}`,this._container.style.width=e*i+"px"}))}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t={}){this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),e.aY(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=l("button","mapboxgl-ctrl-fullscreen",this._controlContainer);l("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},IndoorControl:Tn,Popup:class extends e.E{constructor(t){super(),this.options=Object.assign(Object.create(ec),t),this._altitude=this.options.altitude,e.aY(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.z("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.z("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.aT.convert(t),this._pos=null,this._trackPointer=!1,this._update();const r=this._map;return r&&(r.on("move",this._update),r.off("mousemove",this._onMouseEvent),r._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(e){return this._altitude=e,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),r=document.createElement("body");let n;for(r.innerHTML=e;n=r.firstChild,n;)t.appendChild(n);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=l("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=l("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.innerHTML='<span aria-hidden="true">&#215;</span>',e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,r=this._container,n=this._pos;if(!t||!r||!n)return"bottom";const i=r.offsetWidth,o=r.offsetHeight,a=n.x<i/2,s=n.x>t.transform.width-i/2;if(n.y+e<o)return a?"top-left":s?"top-right":"top";if(n.y>t.transform.height-o){if(a)return"bottom-left";if(s)return"bottom-right"}return a?"left":s?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const r=this._map,n=this._content;if(!r||!this._lngLat&&!this._trackPointer||!n)return;let i=this._container;if(i||(i=this._container=l("div","mapboxgl-popup",r.getContainer()),this._tip=l("div","mapboxgl-popup-tip",i),i.appendChild(n)),this.options.maxWidth&&i.style.maxWidth!==this.options.maxWidth&&(i.style.maxWidth=this.options.maxWidth),r.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Wl(this._lngLat,this._pos,r.transform)),!this._trackPointer||t){const n=this._pos=this._trackPointer&&t instanceof e.P?t:r.project(this._lngLat,this._altitude),i=rc(this.options.offset),o=this._anchor=this._getAnchor(i.y),a=rc(this.options.offset,o),s=n.add(a).round();r._requestDomTask((()=>{this._container&&o&&(this._container.style.transform=`${Zl[o]} translate(${s.x}px,${s.y}px)`)}))}if(!this._marker&&r._showingGlobe()){const t=e.f5(r.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(tc);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:Xl,Style:Ln,LngLat:e.aT,LngLatBounds:e.aI,Point:e.P,MercatorCoordinate:e.ae,FreeCameraOptions:nn,Evented:e.E,c
1onfig:e.e,prewarm:e.f9,clearPrewarmedResources:e.f8,get accessToken(){return e.e.ACCESS_TOKEN},set accessToken(t){e.e.ACCESS_TOKEN=t},get baseApiUrl(){return e.e.API_URL},set baseApiUrl(t){e.e.API_URL=t},get workerCount(){return e.fi.workerCount},set workerCount(t){e.fi.workerCount=t},get maxParallelImageRequests(){return e.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.e.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.fh(t)},get workerUrl(){return e.fg.workerUrl},set workerUrl(t){e.fg.workerUrl=t},get workerClass(){return e.fg.workerClass},set workerClass(t){e.fg.workerClass=t},get workerParams(){return e.fg.workerParams},set workerParams(t){e.fg.workerParams=t},get dracoUrl(){return e.ff()},set dracoUrl(t){e.fe(t)},get meshoptUrl(){return e.fd()},set meshoptUrl(t){e.fc(t)},setNow:e.o.setNow,restoreNow:e.o.restoreNow};return nc})),r}()},881:(e,t,r)=>{"use strict";t.intlFormat=function(e,t,r){let i;o=t,void 0===o||"locale"in o?r=t:i=t;var o;return new Intl.DateTimeFormat(r?.locale,i).format((0,n.toDate)(e))};var n=r(4446)},917:(e,t,r)=>{"use strict";t.lastDayOfISOWeekYear=function(e,t){const r=(0,i.getISOWeekYear)(e,t),a=(0,n.constructFrom)(t?.in||e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=(0,o.startOfISOWeek)(a,t);return s.setDate(s.getDate()-1),s};var n=r(2956),i=r(9957),o=r(6107)},920:(e,t,r)=>{"use strict";t.isLastDayOfMonth=function(e,t){const r=(0,o.toDate)(e,t?.in);return+(0,n.endOfDay)(r,t)==+(0,i.endOfMonth)(r,t)};var n=r(1883),i=r(1291),o=r(4446)},970:(e,t,r)=>{"use strict";t.getWeekOfMonth=function(e,t){const r=(0,n.getDefaultOptions)(),l=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=(0,i.getDate)((0,s.toDate)(e,t?.in));if(isNaN(c))return NaN;const u=(0,o.getDay)((0,a.startOfMonth)(e,t));let d=l-u;d<=0&&(d+=7);const h=c-d;return Math.ceil(h/7)+1};var n=r(6755),i=r(819),o=r(1591),a=r(7710),s=r(4446)},977:(e,t,r)=>{"use strict";t.formatDistanceToNowStrict=function(e,t){return(0,i.formatDistanceStrict)(e,(0,n.constructNow)(e),t)};var n=r(2700),i=r(5206)},990:(e,t,r)=>{"use strict";t.differenceInHours=function(e,t,r){const[a,s]=(0,i.normalizeDates)(r?.in,e,t),l=(+a-+s)/o.millisecondsInHour;return(0,n.getRoundingMethod)(r?.roundingMethod)(l)};var n=r(1331),i=r(8256),o=r(8052)},1087:(e,t,r)=>{"use strict";var n=r(4086);e.exports=function(e){return n(e,(function(e,t){return"boolean"==typeof t?JSON.stringify(t):t}))}},1130:(e,t,r)=>{"use strict";t.subHours=function(e,t,r){return(0,n.addHours)(e,-t,r)};var n=r(9463)},1133:(e,t,r)=>{"use strict";t.setMilliseconds=function(e,t,r){const i=(0,n.toDate)(e,r?.in);return i.setMilliseconds(t),i};var n=r(4446)},1149:(e,t,r)=>{"use strict";t.addQuarters=function(e,t,r){return(0,n.addMonths)(e,3*t,r)};var n=r(6379)},1152:(e,t,r)=>{"use strict";t.startOfISOWeekYear=function(e,t){const r=(0,i.getISOWeekYear)(e,t),a=(0,n.constructFrom)(t?.in||e,0);return a.setFullYear(r,0,4),a.setHours(0,0,0,0),(0,o.startOfISOWeek)(a)};var n=r(2956),i=r(9957),o=r(6107)},1201:(e,t,r)=>{"use strict";t.setQuarter=function(e,t,r){const o=(0,i.toDate)(e,r?.in),a=Math.trunc(o.getMonth()/3)+1,s=t-a;return(0,n.setMonth)(o,o.getMonth()+3*s)};var n=r(7035),i=r(4446)},1249:(e,t,r)=>{"use strict";t.match=void 0;var n=r(9038),i=r(7520);t.match={ordinalNumber:(0,i.buildMatchPatternFn)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:(0,n.buildMatchFn)({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:(0,n.buildMatchFn)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:(0,n.buildMatchFn)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,n.buildMatchFn)({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,n.buildMatchFn)({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})}},1291:(e,t,r)=>{"use strict";t.endOfMonth=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getMonth();return r.setFullYear(r.getFullYear(),i+1,0),r.setHours(23,59,59,999),r};var n=r(4446)},1311:(e,t,r)=>{"use strict";t.setDate=function(e,t,r){const i=(0,n.toDate)(e,r?.in);return i.setDate(t),i};var n=r(4446)},1315:(e,t,r)=>{"use strict";t.setWeek=function(e,t,r){const o=(0,i.toDate)(e,r?.in),a=(0,n.getWeek)(o,r)-t;return o.setDate(o.getDate()-7*a),(0,i.toDate)(o,r?.in)};var n=r(9639),i=r(4446)},1331:(e,t)=>{"use strict";t.getRoundingMethod=function(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return 0===r?0:r}}},1343:(e,t,r)=>{"use strict";t.enUS=void 0;var n=r(2914),i=r(7181),o=r(8483),a=r(2371),s=r(1249);t.enUS={code:"en-US",formatDistance:n.formatDistance,formatLong:i.formatLong,formatRelative:o.formatRelative,localize:a.localize,match:s.match,options:{weekStartsOn:0,firstWeekContainsDate:1}}},1404:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.isFloat16Array=d;var n=r(3865),i=r(5395),o=r(448),a=r(7516),s=r(7968),l=r(2628),c=r(2717);const u=new l.NativeWeakMap;function d(e){return(0,l.WeakMapPrototypeHas)(u,e)||!(0,l.ArrayBufferIsView)(e)&&(0,i.hasFloat16ArrayBrand)(e)}function h(e){if(!d(e))throw(0,l.NativeTypeError)(s.THIS_IS_NOT_A_FLOAT16ARRAY_OBJECT)}function f(e,t){const r=d(e),n=(0,a.isNativeTypedArray)(e);if(!r&&!n)throw(0,l.NativeTypeError)(s.SPECIES_CONSTRUCTOR_DIDNT_RETURN_TYPEDARRAY_OBJECT);if("number"==typeof t){let n;if(r){const t=p(e);n=(0,l.TypedArrayPrototypeGetLength)(t)}else n=(0,l.TypedArrayPrototypeGetLength)(e);if(n<t)throw(0,l.NativeTypeError)(s.DERIVED_CONSTRUCTOR_CREATED_TYPEDARRAY_OBJECT_WHICH_WAS_TOO_SMALL_LENGTH)}if((0,a.isNativeBigIntTypedArray)(e))throw(0,l.NativeTypeError)(s.CANNOT_MIX_BIGINT_AND_OTHER_TYPES)}function p(e){const t=(0,l.WeakMapPrototypeGet)(u,e);if(void 0!==t){const e=(0,l.TypedArrayPrototypeGetBuffer)(t);if((0,c.IsDetachedBuffer)(e))throw(0,l.NativeTypeError)(s.ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);return t}const r=e.buffer;if((0,c.IsDetachedBuffer)(r))throw(0,l.NativeTypeError)(s.ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);const n=(0,l.ReflectConstruct)(_,[r,e.byteOffset,e.length],e.constructor);return(0,l.WeakMapPrototypeGet)(u,n)}function g(e){const t=(0,l.TypedArrayPrototypeGetLength)(e),r=[];for(let n=0;n<t;++n)r[n]=(0,o.convertToNumber)(e[n]);return r}const m=new l.NativeWeakSet;for(const e of(0,l.ReflectOwnKeys)(l.TypedArrayPrototype)){if(e===l.SymbolToStringTag)continue;const t=(0,l.ReflectGetOwnPropertyDescriptor)(l.TypedArrayPrototype,e);(0,l.ObjectHasOwn)(t,"get")&&"function"==typeof t.get&&(0,l.WeakSetPrototypeAdd)(m,t.get)}const y=(0,l.ObjectFreeze)({get:(e,t,r)=>(0,a.isCanonicalIntegerIndexString)(t)&&(0,l.ObjectHasOwn)(e,t)?(0,o.convertToNumber)((0,l.ReflectGet)(e,t)):(0,l.WeakSetPrototypeHas)(m,(0,l.ObjectPrototype__lookupGetter__)(e,t))?(0,l.ReflectGet)(e,t):(0,l.ReflectGet)(e,t,r),set:(e,t,r,n)=>(0,a.isCanonicalIntegerIndexString)(t)&&(0,l.ObjectHasOwn)(e,t)?(0,l.ReflectSet)(e,t,(0,o.roundToFloat16Bits)(r)):(0,l.ReflectSet)(e,t,r,n),getOwnPropertyDescriptor(e,t){if((0,a.isCanonicalIntegerIndexString)(t)&&(0,l.ObjectHasOwn)(e,t)){const r=(0,l.ReflectGetOwnPropertyDescriptor)(e,t);return r.value=(0,o.convertToNumber)(r.value),r}return(0,l.ReflectGetOwnPropertyDescriptor)(e,t)},defineProperty:(e,t,r)=>(0,a.isCanonicalIntegerIndexString)(t)&&(0,l.ObjectHasOwn)(e,t)&&(0,l.ObjectHasOwn)(r,"value")?(r.value=(0,o.roundToFloat16Bits)(r.value),(0,l.ReflectDefineProperty)(e,t,r)):(0,l.ReflectDefineProperty)(e,t,r)});class _{constructor(e,t,r){let n;if(d(e))n=(0,l.ReflectConstruct)(l.NativeUint16Array,[p(e)],new.target);else if((0,a.isObject)(e)&&!(0,a.isAnyArrayBuffer)(e)){let t,r;if((0,a.isNativeTypedArray)(e)){t=e,r=(0,l.TypedArrayPrototypeGetLength)(e);const i=(0,l.TypedArrayPrototypeGetBuffer)(e);if((0,c.IsDetachedBuffer)(i))throw(0,l.NativeTypeError)(s.ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);if((0,a.isNativeBigIntTypedArray)(e))throw(0,l.NativeTypeError)(s.CANNOT_MIX_BIGINT_AND_OTHER_TYPES);const o=new l.NativeArrayBuffer(2*r);n=(0,l.ReflectConstruct)(l.NativeUint16Array,[o],new.target)}else{const i=e[l.SymbolIterator];if(null!=i&&"function"!=typeof i)throw(0,l.NativeTypeError)(s.ITERATOR_PROPERTY_IS_NOT_CALLABLE);null!=i?(0,a.isOrdinaryArray)(e)?(t=e,r=e.length):(t=[...e],r=t.length):(t=e,r=(0,c.ToLength)(t.length)),n=(0,l.ReflectConstruct)(l.NativeUint16Array,[r],new.target)}for(let e=0;e<r;++e)n[e]=(0,o.roundToFloat16Bits)(t[e])}else n=(0,l.ReflectConstruct)(l.NativeUint16Array,arguments,new.target);const i=new l.NativeProxy(n,y);return(0,l.WeakMapPrototypeSet)(u,i,n),i}static from(e,...t){const r=this;if(!(0,l.ReflectHas)(r,i.brand))throw(0,l.NativeTypeError)(s.THIS_CONSTRUCTOR_IS_NOT_A_SUBCLASS_OF_FLOAT16ARRAY);if(r===_){if(d(e)&&0===t.length){const t=p(e),r=new l.NativeUint16Array((0,l.TypedArrayPrototypeGetBuffer)(t),(0,l.TypedArrayPrototypeGetByteOffset)(t),(0,l.TypedArrayPrototypeGetLength)(t));return new _((0,l.TypedArrayPrototypeGetBuffer)((0,l.TypedArrayPrototypeSlice)(r)))}if(0===t.length)return new _((0,l.TypedArrayPrototypeGetBuffer)((0,l.Uint16ArrayFrom)(e,o.roundToFloat16Bits)));const r=t[0],i=t[1];return new _((0,l.TypedArrayPrototypeGetBuffer)((0,l.Uint16ArrayFrom)(e,(function(e,...t){return(0,o.roundToFloat16Bits)((0,l.ReflectApply)(r,this,[e,...(0,n.safeIfNeeded)(t)]))}),i)))}let u,h;const f=e[l.SymbolIterator];if(null!=f&&"function"!=typeof f)throw(0,l.NativeTypeError)(s.ITERATOR_PROPERTY_IS_NOT_CALLABLE);if(null!=f)(0,a.isOrdinaryArray)(e)?(u=e,h=e.length):(0,a.isOrdinaryNativeTypedArray)(e)?(u=e,h=(0,l.TypedArrayPrototypeGetLength)(e)):(u=[...e],h=u.length);else{if(null==e)throw(0,l.NativeTypeError)(s.CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT);u=(0,l.NativeObject)(e),h=(0,c.ToLength)(u.length)}const g=new r(h);if(0===t.length)for(let e=0;e<h;++e)g[e]=u[e];else{const e=t[0],r=t[1];for(let t=0;t<h;++t)g[t]=(0,l.ReflectApply)(e,r,[u[t],t])}return g}static of(...e){const t=this;if(!(0,l.ReflectHas)(t,i.brand))throw(0,l.NativeTypeError)(s.THIS_CONSTRUCTOR_IS_NOT_A_SUBCLASS_OF_FLOAT16ARRAY);const r=e.length;if(t===_){const t=new _(r),n=p(t);for(let t=0;t<r;++t)n[t]=(0,o.roundToFloat16Bits)(e[t]);return t}const n=new t(r);for(let t=0;t<r;++t)n[t]=e[t];return n}keys(){h(this);const e=p(this);return(0,l.TypedArrayPrototypeKeys)(e)}values(){h(this);const e=p(this);return(0,n.wrap)(function*(){for(const t of(0,l.TypedArrayPrototypeValues)(e))yield(0,o.convertToNumber)(t)}())}entries(){h(this);const e=p(this);return(0,n.wrap)(function*(){for(const[t,r]of(0,l.TypedArrayPrototypeEntries)(e))yield[t,(0,o.convertToNumber)(r)]}())}at(e){h(this);const t=p(this),r=(0,l.TypedArrayPrototypeGetLength)(t),n=(0,c.ToIntegerOrInfinity)(e),i=n>=0?n:r+n;if(!(i<0||i>=r))return(0,o.convertToNumber)(t[i])}with(e,t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=(0,c.ToIntegerOrInfinity)(e),a=i>=0?i:n+i,u=+t;if(a<0||a>=n)throw(0,l.NativeRangeError)(s.OFFSET_IS_OUT_OF_BOUNDS);const d=new l.NativeUint16Array((0,l.TypedArrayPrototypeGetBuffer)(r),(0,l.TypedArrayPrototypeGetByteOffset)(r),(0,l.TypedArrayPrototypeGetLength)(r)),f=new _((0,l.TypedArrayPrototypeGetBuffer)((0,l.TypedArrayPrototypeSlice)(d)));return p(f)[a]=(0,o.roundToFloat16Bits)(u),f}map(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0],a=(0,c.SpeciesConstructor)(r,_);if(a===_){const t=new _(n),a=p(t);for(let t=0;t<n;++t){const n=(0,o.convertToNumber)(r[t]);a[t]=(0,o.roundToFloat16Bits)((0,l.ReflectApply)(e,i,[n,t,this]))}return t}const s=new a(n);f(s,n);for(let t=0;t<n;++t){const n=(0,o.convertToNumber)(r[t]);s[t]=(0,l.ReflectApply)(e,i,[n,t,this])}return s}filter(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0],a=[];for(let t=0;t<n;++t){const n=(0,o.convertToNumber)(r[t]);(0,l.ReflectApply)(e,i,[n,t,this])&&(0,l.ArrayPrototypePush)(a,n)}const s=new((0,c.SpeciesConstructor)(r,_))(a);return f(s),s}reduce(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r);if(0===n&&0===t.length)throw(0,l.NativeTypeError)(s.REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE);let i,a;0===t.length?(i=(0,o.convertToNumber)(r[0]),a=1):(i=t[0],a=0);for(let t=a;t<n;++t)i=e(i,(0,o.convertToNumber)(r[t]),t,this);return i}reduceRight(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r);if(0===n&&0===t.length)throw(0,l.NativeTypeError)(s.REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE);let i,a;0===t.length?(i=(0,o.convertToNumber)(r[n-1]),a=n-2):(i=t[0],a=n-1);for(let t=a;t>=0;--t)i=e(i,(0,o.convertToNumber)(r[t]),t,this);return i}forEach(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0];for(let t=0;t<n;++t)(0,l.ReflectApply)(e,i,[(0,o.convertToNumber)(r[t]),t,this])}find(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0];for(let t=0;t<n;++t){const n=(0,o.convertToNumber)(r[t]);if((0,l.ReflectApply)(e,i,[n,t,this]))return n}}findIndex(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0];for(let t=0;t<n;++t){const n=(0,o.convertToNumber)(r[t]);if((0,l.ReflectApply)(e,i,[n,t,this]))return t}return-1}findLast(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0];for(let t=n-1;t>=0;--t){const n=(0,o.convertToNumber)(r[t]);if((0,l.ReflectApply)(e,i,[n,t,this]))return n}}findLastIndex(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0];for(let t=n-1;t>=0;--t){const n=(0,o.convertToNumber)(r[t]);if((0,l.ReflectApply)(e,i,[n,t,this]))return t}return-1}every(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0];for(let t=0;t<n;++t)if(!(0,l.ReflectApply)(e,i,[(0,o.convertToNumber)(r[t]),t,this]))return!1;return!0}some(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r),i=t[0];for(let t=0;t<n;++t)if((0,l.ReflectApply)(e,i,[(0,o.convertToNumber)(r[t]),t,this]))return!0;return!1}set(e,...t){h(this);const r=p(this),n=(0,c.ToIntegerOrInfinity)(t[0]);if(n<0)throw(0,l.NativeRangeError)(s.OFFSET_IS_OUT_OF_BOUNDS);if(null==e)throw(0,l.NativeTypeError)(s.CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT);if((0,a.isNativeBigIntTypedArray)(e))throw(0,l.NativeTypeError)(s.CANNOT_MIX_BIGINT_AND_OTHER_TYPES);if(d(e))return(0,l.TypedArrayPrototypeSet)(p(this),p(e),n);if((0,a.isNativeTypedArray)(e)){const t=(0,l.TypedArrayPrototypeGetBuffer)(e);if((0,c.IsDetachedBuffer)(t))throw(0,l.NativeTypeError)(s.ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER)}const i=(0,l.TypedArrayPrototypeGetLength)(r),u=(0,l.NativeObject)(e),f=(0,c.ToLength)(u.length);if(n===1/0||f+n>i)throw(0,l.NativeRangeError)(s.OFFSET_IS_OUT_OF_BOUNDS);for(let e=0;e<f;++e)r[e+n]=(0,o.roundToFloat16Bits)(u[e])}reverse(){h(this);const e=p(this);return(0,l.TypedArrayPrototypeReverse)(e),this}toReversed(){h(this);const e=p(this),t=new l.NativeUint16Array((0,l.TypedArrayPrototypeGetBuffer)(e),(0,l.TypedArrayPrototypeGetByteOffset)(e),(0,l.TypedArrayPrototypeGetLength)(e)),r=new _((0,l.TypedArrayPrototypeGetBuffer)((0,l.TypedArrayPrototypeSlice)(t))),n=p(r);return(0,l.TypedArrayPrototypeReverse)(n),r}fill(e,...t){h(this);const r=p(this);return(0,l.TypedArrayPrototypeFill)(r,(0,o.roundToFloat16Bits)(e),...(0,n.safeIfNeeded)(t)),this}copyWithin(e,t,...r){h(this);const i=p(this);return(0,l.TypedArrayPrototypeCopyWithin)(i,e,t,...(0,n.safeIfNeeded)(r)),this}sort(e){h(this);const t=p(this),r=void 0!==e?e:c.defaultCompare;return(0,l.TypedArrayPrototypeSort)(t,((e,t)=>
1r((0,o.convertToNumber)(e),(0,o.convertToNumber)(t)))),this}toSorted(e){h(this);const t=p(this);if(void 0!==e&&"function"!=typeof e)throw new l.NativeTypeError(s.THE_COMPARISON_FUNCTION_MUST_BE_EITHER_A_FUNCTION_OR_UNDEFINED);const r=void 0!==e?e:c.defaultCompare,n=new l.NativeUint16Array((0,l.TypedArrayPrototypeGetBuffer)(t),(0,l.TypedArrayPrototypeGetByteOffset)(t),(0,l.TypedArrayPrototypeGetLength)(t)),i=new _((0,l.TypedArrayPrototypeGetBuffer)((0,l.TypedArrayPrototypeSlice)(n))),a=p(i);return(0,l.TypedArrayPrototypeSort)(a,((e,t)=>r((0,o.convertToNumber)(e),(0,o.convertToNumber)(t)))),i}slice(e,t){h(this);const r=p(this),n=(0,c.SpeciesConstructor)(r,_);if(n===_){const n=new l.NativeUint16Array((0,l.TypedArrayPrototypeGetBuffer)(r),(0,l.TypedArrayPrototypeGetByteOffset)(r),(0,l.TypedArrayPrototypeGetLength)(r));return new _((0,l.TypedArrayPrototypeGetBuffer)((0,l.TypedArrayPrototypeSlice)(n,e,t)))}const i=(0,l.TypedArrayPrototypeGetLength)(r),a=(0,c.ToIntegerOrInfinity)(e),u=void 0===t?i:(0,c.ToIntegerOrInfinity)(t);let d,g;d=a===-1/0?0:a<0?i+a>0?i+a:0:i<a?i:a,g=u===-1/0?0:u<0?i+u>0?i+u:0:i<u?i:u;const m=g-d>0?g-d:0,y=new n(m);if(f(y,m),0===m)return y;const v=(0,l.TypedArrayPrototypeGetBuffer)(r);if((0,c.IsDetachedBuffer)(v))throw(0,l.NativeTypeError)(s.ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER);let b=0;for(;d<g;)y[b]=(0,o.convertToNumber)(r[d]),++d,++b;return y}subarray(e,t){h(this);const r=p(this),n=(0,c.SpeciesConstructor)(r,_),i=new l.NativeUint16Array((0,l.TypedArrayPrototypeGetBuffer)(r),(0,l.TypedArrayPrototypeGetByteOffset)(r),(0,l.TypedArrayPrototypeGetLength)(r)),o=(0,l.TypedArrayPrototypeSubarray)(i,e,t),a=new n((0,l.TypedArrayPrototypeGetBuffer)(o),(0,l.TypedArrayPrototypeGetByteOffset)(o),(0,l.TypedArrayPrototypeGetLength)(o));return f(a),a}indexOf(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r);let i=(0,c.ToIntegerOrInfinity)(t[0]);if(i===1/0)return-1;i<0&&(i+=n,i<0&&(i=0));for(let t=i;t<n;++t)if((0,l.ObjectHasOwn)(r,t)&&(0,o.convertToNumber)(r[t])===e)return t;return-1}lastIndexOf(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r);let i=t.length>=1?(0,c.ToIntegerOrInfinity)(t[0]):n-1;if(i===-1/0)return-1;i>=0?i=i<n-1?i:n-1:i+=n;for(let t=i;t>=0;--t)if((0,l.ObjectHasOwn)(r,t)&&(0,o.convertToNumber)(r[t])===e)return t;return-1}includes(e,...t){h(this);const r=p(this),n=(0,l.TypedArrayPrototypeGetLength)(r);let i=(0,c.ToIntegerOrInfinity)(t[0]);if(i===1/0)return!1;i<0&&(i+=n,i<0&&(i=0));const a=(0,l.NumberIsNaN)(e);for(let t=i;t<n;++t){const n=(0,o.convertToNumber)(r[t]);if(a&&(0,l.NumberIsNaN)(n))return!0;if(n===e)return!0}return!1}join(e){h(this);const t=g(p(this));return(0,l.ArrayPrototypeJoin)(t,e)}toLocaleString(...e){h(this);const t=g(p(this));return(0,l.ArrayPrototypeToLocaleString)(t,...(0,n.safeIfNeeded)(e))}get[l.SymbolToStringTag](){if(d(this))return"Float16Array"}}t.Float16Array=_,(0,l.ObjectDefineProperty)(_,"BYTES_PER_ELEMENT",{value:2}),(0,l.ObjectDefineProperty)(_,i.brand,{}),(0,l.ReflectSetPrototypeOf)(_,l.TypedArray);const v=_.prototype;(0,l.ObjectDefineProperty)(v,"BYTES_PER_ELEMENT",{value:2}),(0,l.ObjectDefineProperty)(v,l.SymbolIterator,{value:v.values,writable:!0,configurable:!0}),(0,l.ReflectSetPrototypeOf)(v,l.TypedArrayPrototype)},1440:(e,t,r)=>{"use strict";t.addYears=function(e,t,r){return(0,n.addMonths)(e,12*t,r)};var n=r(6379)},1441:(e,t,r)=>{"use strict";t.eachWeekendOfYear=function(e,t){const r=(0,o.startOfYear)(e,t),a=(0,i.endOfYear)(e,t);return(0,n.eachWeekendOfInterval)({start:r,end:a},t)};var n=r(9305),i=r(7624),o=r(775)},1462:(e,t,r)=>{"use strict";t.getSeconds=function(e){return(0,n.toDate)(e).getSeconds()};var n=r(4446)},1464:(e,t,r)=>{"use strict";t.isThisISOWeek=function(e,t){return(0,o.isSameISOWeek)((0,n.constructFrom)(t?.in||e,e),(0,i.constructNow)(t?.in||e))};var n=r(2956),i=r(2700),o=r(5626)},1497:(e,t,r)=>{"use strict";t.YearParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return(0,i.mapValue)((0,i.parseNDigits)(4,e),n);case"yo":return(0,i.mapValue)(r.ordinalNumber(e,{unit:"year"}),n);default:return(0,i.mapValue)((0,i.parseNDigits)(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r){const n=e.getFullYear();if(r.isTwoDigitYear){const t=(0,i.normalizeTwoDigitYear)(r.year,n);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const o="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}t.YearParser=o},1574:(e,t,r)=>{"use strict";
1t.endOfTomorrow=function(e){const t=(0,n.constructNow)(e?.in),r=t.getFullYear(),i=t.getMonth(),o=t.getDate(),a=(0,n.constructNow)(e?.in);return a.setFullYear(r,i,o+1),a.setHours(23,59,59,999),e?.in?e.in(a):a};var n=r(2700)},1587:(e,t,r)=>{"use strict";t.endOfWeek=function(e,t){const r=(0,n.getDefaultOptions)(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=(0,i.toDate)(e,t?.in),s=a.getDay(),l=6+(s<o?-7:0)-(s-o);return a.setDate(a.getDate()+l),a.setHours(23,59,59,999),a};var n=r(6755),i=r(4446)},1591:(e,t,r)=>{"use strict";t.getDay=function(e,t){return(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},1647:(e,t,r)=>{"use strict";t.millisecondsToMinutes=function(e){const t=e/n.millisecondsInMinute;return Math.trunc(t)};var n=r(8052)},1675:(e,t,r)=>{"use strict";t.subMilliseconds=function(e,t,r){return(0,n.addMilliseconds)(e,-t,r)};var n=r(4280)},1683:e=>{"use strict";var t=function(e){return this.component=e,this.items=[],this.active=0,this.wrapper=document.createElement("div"),this.wrapper.className="suggestions-wrapper",this.element=document.createElement("ul"),this.element.className="suggestions",this.wrapper.appendChild(this.element),this.selectingListItem=!1,e.el.parentNode.insertBefore(this.wrapper,e.el.nextSibling),this};t.prototype.show=function(){this.element.style.display="block"},t.prototype.hide=function(){this.element.style.display="none"},t.prototype.add=function(e){this.items.push(e)},t.prototype.clear=function(){this.items=[],this.active=0},t.prototype.isEmpty=function(){return!this.items.length},t.prototype.isVisible=function(){return"block"===this.element.style.display},t.prototype.draw=function(){if(this.element.innerHTML="",0!==this.items.length){for(var e=0;e<this.items.length;e++)this.drawItem(this.items[e],this.active===e);this.show()}else this.hide()},t.prototype.drawItem=function(e,t){var r=document.createElement("li"),n=document.createElement("a");t&&(r.className+=" active"),n.innerHTML=e.string,r.appendChild(n),this.element.appendChild(r),r.addEventListener("mousedown",function(){this.selectingListItem=!0}.bind(this)),r.addEventListener("mouseup",function(){this.handleMouseUp.call(this,e)}.bind(this))},t.prototype.handleMouseUp=function(e){this.selectingListItem=!1,this.component.value(e.original),this.clear(),this.draw()},t.prototype.move=function(e){this.active=e,this.draw()},t.prototype.previous=function(){this.move(0===this.active?this.items.length-1:this.active-1)},t.prototype.next=function(){this.move(this.active===this.items.length-1?0:this.active+1)},t.prototype.drawError=function(e){var t=document.createElement("li");t.innerHTML=e,this.element.appendChild(t),this.show()},e.exports=t},1743:(e,t,r)=>{"use strict";t.previousTuesday=function(e,t){return(0,n.previousDay)(e,2,t)};var n=r(8092)},1804:(e,t,r)=>{"use strict";t.startOfMinute=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setSeconds(0,0),r};var n=r(4446)},1869:(e,t,r)=>{"use strict";t.Hour1to12Parser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=70;parse(e,t,r){switch(t){case"h":return(0,o.parseNumericPattern)(n.numericPatterns.hour12h,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,r){const n=e.getHours()>=12;return n&&r<12?e.setHours(r+12,0,0,0):n||12!==r?e.setHours(r,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}t.Hour1to12Parser=a},1883:(e,t,r)=>{"use strict";t.endOfDay=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setHours(23,59,59,999),r};var n=r(4446)},1929:function(e){var t,r;t=this,r=function(){var e=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function t(t){return t.match(e)||[]}function r(e){return{language:(e=t(e))[1]||"",extlang:e[2]||"",script:e[3]||"",region:e[4]||""}}function n(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0})}function i(e,i,o){function a(r){return t(r)[e]||""}n(a,"pattern",i),n(r,o,a)}return i(1,/^[a-zA-Z]{2,3}$/,"language"),i(2,/^[a-zA-Z]{3}$/,"extlang"),i(3,/^[a-zA-Z]{4}$/,"script"),i(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),n(r,"split",(function(e){return t(e).filter((function(e,t){return e&&t}))})),r},e.exports?e.exports=r():t.subtag=r()},1982:(e,t,r)=>{"use strict";t.setMinutes=function(e,t,r){const i=(0,n.toDate)(e,r?.in);return i.setMinutes(t),i};var n=r(4446)},1992:(e,t,r)=>{"use strict";t.isSameYear=function(e,t,r){const[i,o]=(0,n.normalizeDates)(r?.in,e,t);return i.getFullYear()===o.getFullYear()};var n=r(8256)},2017:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;
1if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},2056:(e,t,r)=>{"use strict";t.isSaturday=function(e,t){return 6===(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},2067:(e,t)=>{"use strict";t.formatISODuration=function(e){const{years:t=0,months:r=0,days:n=0,hours:i=0,minutes:o=0,seconds:a=0}=e;return`P${t}Y${r}M${n}DT${i}H${o}M${a}S`}},2110:(e,t,r)=>{"use strict";t.differenceInBusinessDays=function(e,t,r){const[c,u]=(0,n.normalizeDates)(r?.in,e,t);if(!(0,s.isValid)(c)||!(0,s.isValid)(u))return NaN;const d=(0,o.differenceInCalendarDays)(c,u),h=d<0?-1:1,f=Math.trunc(d/7);let p=5*f,g=(0,i.addDays)(u,7*f);for(;!(0,a.isSameDay)(c,g);)p+=(0,l.isWeekend)(g,r)?0:h,g=(0,i.addDays)(g,h);return 0===p?0:p};var n=r(8256),i=r(7591),o=r(5506),a=r(9691),s=r(7489),l=r(3348)},2167:(e,t,r)=>{"use strict";t.Hour0To11Parser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=70;parse(e,t,r){switch(t){case"K":return(0,o.parseNumericPattern)(n.numericPatterns.hour11h,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}t.Hour0To11Parser=a},2240:(e,t,r)=>{"use strict";t.setISODay=function(e,t,r){const a=(0,o.toDate)(e,r?.in),s=(0,i.getISODay)(a,r),l=t-s;return(0,n.addDays)(a,l,r)};var n=r(7591),i=r(8284),o=r(4446)},2292:(e,t,r)=>{"use strict";t.formatRelative=function(e,t,r){const[l,c]=(0,o.normalizeDates)(r?.in,e,t),u=(0,i.getDefaultOptions)(),d=r?.locale??u.locale??n.defaultLocale,h=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,f=(0,a.differenceInCalendarDays)(l,c);if(isNaN(f))throw new RangeError("Invalid time value");let p;p=f<-6?"other":f<-1?"lastWeek":f<0?"yesterday":f<1?"today":f<2?"tomorrow":f<7?"nextWeek":"other";const g=d.formatRelative(p,l,c,{locale:d,weekStartsOn:h});return(0,s.format)(l,g,{locale:d,weekStartsOn:h})};var n=r(9577),i=r(6755),o=r(8256),a=r(5506),s=r(9460)},2342:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),n="-",i=[],o=e=>{const t=l(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return s(e);const r=e.split(n),i=""===r[0]&&r.length>1?1:0;return a(r,i,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=o[e],n=r[e];return t?n?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(n,t):t:n||i}return r[e]||i}}},a=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const i=e[t],o=r.nextPart.get(i);if(o){const r=a(e,t+1,o);if(r)return r}const s=r.validators;if(null===s)return;const l=0===t?e.join(n):e.slice(t).join(n),c=s.length;for(let e=0;e<c;e++){const t=s[e];if(t.validator(l))return t.classGroupId}},s=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),l=e=>{const{theme:t,classGroups:r}=e;return c(r,t)},c=(e,t)=>{const n=r();for(const r in e){const i=e[r];u(i,n,r,t)}return n},u=(e,t,r,n)=>{const i=e.length;for(let o=0;o<i;o++){const i=e[o];d(i,t,r,n)}},d=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?p(e,t,r,n):f(e,t,r,n):h(e,t,r)},h=(e,t,r)=>{(""===e?t:g(t,e)).classGroupId=r},f=(e,t,r,n)=>{m(e)?u(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},p=(e,t,r,n)=>{const i=Object.entries(e),o=i.length;for(let e=0;e<o;e++){const[o,a]=i[e];u(a,g(t,o),r,n)}},g=(e,t)=>{let i=e;const o=t.split(n),a=o.length;for(let e=0;e<a;e++){const t=o[e];let n=i.nextPart.get(t);n||(n=r(),i.nextPart.set(t,n)),i=n}return i},m=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,y=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(i,o)=>{r[i]=o,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(i(e,t),t):void 0},set(e,t){e in r?r[e]=t:i(e,t)}}},_=[],v=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),b=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,i=0,o=0;const a=e.length;for(let s=0;s<a;s++){const a=e[s];if(0===n&&0===i){if(":"===a){t.push(e.slice(o,s)),o=s+1;continue}if("/"===a){r=s;continue}}"["===a?n++:"]"===a?n--:"("===a?i++:")"===a&&i--}const s=0===t.length?e:e.slice(o);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return v(t,c,l,r&&r>o?r-o:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):v(_,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},x=e=>{const t=new Map;
vendor: 5,078 bytes, line 1
1return e.orderSensitiveModifiers.forEach(((e,r)=>{t.set(e,1e6+r)})),e=>{const r=[];let n=[];for(let i=0;i<e.length;i++){const o=e[i],a="["===o[0],s=t.has(o);a||s?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(o)):n.push(o)}return n.length>0&&(n.sort(),r.push(...n)),r}},w=/\s+/,S=(...e)=>{let t,r,n=0,i="";for(;n<e.length;)(t=e[n++])&&(r=k(t))&&(i&&(i+=" "),i+=r);return i},k=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=k(e[n]))&&(r&&(r+=" "),r+=t);return r},T=(e,...t)=>{let r,n,i,a;const s=e=>{const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],s=e.trim().split(w);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!f,g=n(p?h.substring(0,f):h);if(!g){if(!p){l=t+(l.length>0?" "+l:l);continue}if(g=n(h),!g){l=t+(l.length>0?" "+l:l);continue}p=!1}const m=0===u.length?"":1===u.length?u[0]:o(u).join(":"),y=d?m+"!":m,_=y+g;if(a.indexOf(_)>-1)continue;a.push(_);const v=i(g,p);for(let e=0;e<v.length;++e){const t=v[e];a.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return i(e,o),o};return a=l=>{const c=t.reduce(((e,t)=>t(e)),e());return r=(e=>({cache:y(e.cacheSize),parseClassName:b(e),sortModifiers:x(e),...o(e)}))(c),n=r.cache.get,i=r.cache.set,a=s,s(l)},(...e)=>a(S(...e))},I=[],M=e=>{const t=t=>t[e]||I;return t.isThemeGetter=!0,t},E=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,P=/^\((?:(\w[\w-]*):)?(.+)\)$/i,A=/^\d+\/\d+$/,C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,R=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,L=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,O=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z=e=>A.test(e),F=e=>!!e&&!Number.isNaN(Number(e)),N=e=>!!e&&Number.isInteger(Number(e)),B=e=>e.endsWith("%")&&F(e.slice(0,-1)),j=e=>C.test(e),V=()=>!0,G=e=>R.test(e)&&!L.test(e),U=()=>!1,$=e=>O.test(e),H=e=>D.test(e),q=e=>!Z(e)&&!ee(e),W=e=>se(e,de,U),Z=e=>E.test(e),Y=e=>se(e,he,G),X=e=>se(e,fe,F),K=e=>se(e,ce,U),J=e=>se(e,ue,H),Q=e=>se(e,ge,$),ee=e=>P.test(e),te=e=>le(e,he),re=e=>le(e,pe),ne=e=>le(e,ce),ie=e=>le(e,de),oe=e=>le(e,ue),ae=e=>le(e,ge,!0),se=(e,t,r)=>{const n=E.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},le=(e,t,r=!1)=>{const n=P.exec(e);return!!n&&(n[1]?t(n[1]):r)},ce=e=>"position"===e||"percentage"===e,ue=e=>"image"===e||"url"===e,de=e=>"length"===e||"size"===e||"bg-size"===e,he=e=>"length"===e,fe=e=>"number"===e,pe=e=>"family-name"===e,ge=e=>"shadow"===e,me=Object.defineProperty({__proto__:null,isAny:V,isAnyNonArbitrary:q,isArbitraryImage:J,isArbitraryLength:Y,isArbitraryNumber:X,isArbitraryPosition:K,isArbitraryShadow:Q,isArbitrarySize:W,isArbitraryValue:Z,isArbitraryVariable:ee,isArbitraryVariableFamilyName:re,isArbitraryVariableImage:oe,isArbitraryVariableLength:te,isArbitraryVariablePosition:ne,isArbitraryVariableShadow:ae,isArbitraryVariableSize:ie,isFraction:z,isInteger:N,isNumber:F,isPercent:B,isTshirtSize:j},Symbol.toStringTag,{value:"Module"}),ye=()=>{const e=M("color"),t=M("font"),r=M("text"),n=M("font-weight"),i=M("tracking"),o=M("leading"),a=M("breakpoint"),s=M("container"),l=M("spacing"),c=M("radius"),u=M("shadow"),d=M("inset-shadow"),h=M("text-shadow"),f=M("drop-shadow"),p=M("blur"),g=M("perspective"),m=M("aspect"),y=M("ease"),_=M("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ee,Z],b=()=>[ee,Z,l],x=()=>[z,"full","auto",...b()],w=()=>[N,"none","subgrid",ee,Z],S=()=>["auto",{span:["full",N,ee,Z]},N,ee,Z],k=()=>[N,"auto",ee,Z],T=()=>["auto","min","max","fr",ee,Z],I=()=>["auto",...b()],E=()=>[z,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],P=()=>[e,ee,Z],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ne,K,{position:[ee,Z]}],C=()=>["auto","cover","contain",ie,W,{size:[ee,Z]}],R=()=>[B,te,Y],L=()=>["","none","full",c,ee,Z],O=()=>["",F,te,Y],D=()=>[F,B,ne,K],G=()=>["","none",p,ee,Z],U=()=>["none",F,ee,Z],$=()=>["none",F,ee,Z],H=()=>[F,ee,Z],se=()=>[z,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[j],breakpoint:[j],color:[V],container:[j],"drop-shadow":[j],ease:["in","out","in-out"],font:[q],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[j],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[j],shadow:[j],spacing:["px",F],text:[j],"text-shadow":[j],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",z,Z,ee,m]}
vendor: 5,323 bytes, line 1
1],container:["container"],columns:[{columns:[F,Z,ee,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[N,"auto",ee,Z]}],basis:[{basis:[z,"full","auto",s,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[F,z,"auto","initial","none",Z]}],grow:[{grow:["",F,ee,Z]}],shrink:[{shrink:["",F,ee,Z]}],order:[{order:[N,"first","last","none",ee,Z]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[s,"screen",...E()]}],"min-w":[{"min-w":[s,"screen","none",...E()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",r,te,Y]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ee,X]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",B,Z]}],"font-family":[{font:[re,Z,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ee,Z]}],"line-clamp":[{"line-clamp":[F,"none",ee,X]}],leading:[{leading:[o,...b()]}],"list-image":[{"list-image":["none",ee,Z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","
1wavy"]}],"text-decoration-thickness":[{decoration:[F,"from-font","auto",ee,Y]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[F,"auto",ee,Z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},N,ee,Z],radial:["",ee,Z],conic:[N,ee,Z]},oe,J]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:O()}],"border-w-x":[{"border-x":O()}],"border-w-y":[{"border-y":O()}],"border-w-s":[{"border-s":O()}],"border-w-e":[{"border-e":O()}],"border-w-t":[{"border-t":O()}],"border-w-r":[{"border-r":O()}],"border-w-b":[{"border-b":O()}],"border-w-l":[{"border-l":O()}],"divide-x":[{"divide-x":O()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":O()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[F,ee,Z]}],"outline-w":[{outline:["",F,te,Y]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,ae,Q]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,ae,Q]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[F,Y]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":O()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",h,ae,Q]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[F,ee,Z]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[F]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ee,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[F]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Z]}],filter:[{filter:["","none",ee,Z]}],blur:[{blur:G()}],brightness:[{brightness:[F,ee,Z]}],contrast:[{contrast:[F,ee,Z]}],"drop-shadow":[{"drop-shadow":["","none",f,ae,Q]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",F,ee,Z]}],"hue-rotate":[{"hue-rotate":[F,ee,Z]}],invert:[{invert:["",F,ee,Z]}],saturate:[{saturate:[F,ee,Z]}],sepia:[{sepia:["",F,ee,Z]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Z]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[F,ee,Z]}],"backdrop-contrast":[{"backdrop-contrast":[F,ee,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",F,ee,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[F,ee,Z]}],"backdrop-invert":[{"backdrop-invert":["",F,ee,Z]}],"backdrop-opacity":[{"backdrop-opacity":[F,ee,Z]}],"backdrop-saturate":[{"backdrop-saturate":[F,ee,Z]}],"backdrop-sepia":[{"backdrop-sepia":["",F,ee,Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[F,"initial",ee,Z]}],ease:[{ease:["linear","initial",y,ee,Z]}],delay:[{delay:[F,ee,Z]}],animate:[{animate:["none",_,ee,Z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,ee,Z]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:H()}],"skew-x":[{"skew-x":H()}],"skew-y":[{"skew-y":H()}],transform:[{transform:[ee,Z,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}
vendor: 5,073 bytes, line 1
1],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Z]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Z]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[F,te,Y,X]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},_e=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:i={},override:o={}})=>(ve(e,"cacheSize",t),ve(e,"prefix",r),ve(e,"experimentalParseClassName",n),be(e.theme,o.theme),be(e.classGroups,o.classGroups),be(e.conflictingClassGroups,o.conflictingClassGroups),be(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),ve(e,"orderSensitiveModifiers",o.orderSensitiveModifiers),xe(e.theme,i.theme),xe(e.classGroups,i.classGroups),xe(e.conflictingClassGroups,i.conflictingClassGroups),xe(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),we(e,i,"orderSensitiveModifiers"),e),ve=(e,t,r)=>{void 0!==r&&(e[t]=r)},be=(e,t)=>
1{if(t)for(const r in t)ve(e,r,t[r])},xe=(e,t)=>{if(t)for(const r in t)we(e,t,r)},we=(e,t,r)=>{const n=t[r];void 0!==n&&(e[r]=e[r]?e[r].concat(n):n)},Se=T(ye);t.createTailwindMerge=T,t.extendTailwindMerge=(e,...t)=>"function"==typeof e?T(ye,e,...t):T((()=>_e(ye(),e)),...t),t.fromTheme=M,t.getDefaultConfig=ye,t.mergeConfigs=_e,t.twJoin=S,t.twMerge=Se,t.validators=me},2364:(e,t)=>{"use strict";t.isProtectedDayOfYearToken=function(e){return r.test(e)},t.isProtectedWeekYearToken=function(e){return n.test(e)},t.warnOrThrowProtectedError=function(e,t,r){const n=function(e,t,r){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(console.warn(n),i.includes(e))throw new RangeError(n)};const r=/^D+$/,n=/^Y+$/,i=["D","DD","YY","YYYY"]},2366:(e,t,r)=>{"use strict";t.endOfToday=function(e){return(0,n.endOfDay)(Date.now(),e)};var n=r(1883)},2371:(e,t,r)=>{"use strict";t.localize=void 0;var n=r(5586);t.localize={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:(0,n.buildLocalizeFn)({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:(0,n.buildLocalizeFn)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:(0,n.buildLocalizeFn)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:(0,n.buildLocalizeFn)({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:(0,n.buildLocalizeFn)({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})}},2396:(e,t,r)=>{"use strict";t.getDaysInYear=function(e,t){const r=(0,i.toDate)(e,t?.in);return Number.isNaN(+r)?NaN:(0,n.isLeapYear)(r)?366:365};var n=r(3364),i=r(4446)},2463:(e,t,r)=>{"use strict";t.isThisQuarter=function(e,t){return(0,o.isSameQuarter)((0,n.constructFrom)(t?.in||e,e),(0,i.constructNow)(t?.in||e))};var n=r(2956),i=r(2700),o=r(9825)},2480:(e,t,r)=>{"use strict";t.differenceInCalendarISOWeekYears=function(e,t,r){const[o,a]=(0,n.normalizeDates)(r?.in,e,t);return(0,i.getISOWeekYear)(o,r)-(0,i.getISOWeekYear)(a,r)};var n=r(8256),i=r(9957)},2488:(e,t,r)=>{"use strict";t.isFuture=function(e){return+(0,n.toDate)(e)>Date.now()};var n=r(4446)},2495:(e,t,r)=>{"use strict";t.differenceInMilliseconds=function(e,t){return+(0,n.toDate)(e)-+(0,n.toDate)(t)};var n=r(4446)},2554:(e,t)=>
1{"use strict";t.addLeadingZeros=function(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}},2575:(e,t,r)=>{"use strict";t.getDaysInMonth=function(e,t){const r=(0,i.toDate)(e,t?.in),o=r.getFullYear(),a=r.getMonth(),s=(0,n.constructFrom)(r,0);return s.setFullYear(o,a+1,0),s.setHours(0,0,0,0),s.getDate()};var n=r(2956),i=r(4446)},2577:(e,t,r)=>{"use strict";t.LocalWeekParser=void 0;var n=r(1315),i=r(5472),o=r(7699),a=r(5513),s=r(3771);class l extends a.Parser{priority=100;parse(e,t,r){switch(t){case"w":return(0,s.parseNumericPattern)(o.numericPatterns.week,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return(0,s.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r,o){return(0,i.startOfWeek)((0,n.setWeek)(e,r,o),o)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}t.LocalWeekParser=l},2614:e=>{function t(e){const t=e.address||"",r=e.text||"",n=e.place_name||"",i={address:n.split(",")[0],houseNumber:t,street:r,placeName:n};return e.context.forEach((function(e){const t=e.id.split(".")[0];i[t]=e.text})),i}e.exports={transformFeatureToGeolocationText:function(e,r){const n=t(e),i=["address","street","place","country"];if("function"==typeof r)return r(n);const o=i.indexOf(r);return(-1===o?i:i.slice(o)).reduce((function(e,t){return n[t]?(""!==e&&(e+=", "),e+n[t]):e}),"")},getAddressInfo:t,REVERSE_GEOCODE_COORD_RGX:/^[ ]*(-?\d{1,3}(\.\d{0,256})?)[, ]+(-?\d{1,3}(\.\d{0,256})?)[ ]*$/}},2628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7968);function i(e){return(t,...r)=>a(e,t,r)}function o(e,t){return i(u(e,t).get)}const{apply:a,construct:s,defineProperty:l,get:c,getOwnPropertyDescriptor:u,getPrototypeOf:d,has:h,ownKeys:f,set:p,setPrototypeOf:g}=Reflect;
1t.ReflectSetPrototypeOf=g,t.ReflectSet=p,t.ReflectOwnKeys=f,t.ReflectHas=h,t.ReflectGetPrototypeOf=d,t.ReflectGetOwnPropertyDescriptor=u,t.ReflectGet=c,t.ReflectDefineProperty=l,t.ReflectConstruct=s,t.ReflectApply=a;t.NativeProxy=Proxy;const{EPSILON:m,MAX_SAFE_INTEGER:y,isFinite:_,isNaN:v}=Number;t.NumberIsNaN=v,t.NumberIsFinite=_,t.MAX_SAFE_INTEGER=y,t.EPSILON=m;const{iterator:b,species:x,toStringTag:w,for:S}=Symbol;t.SymbolFor=S,t.SymbolToStringTag=w,t.SymbolSpecies=x,t.SymbolIterator=b;const k=t.NativeObject=Object,{create:T,defineProperty:I,freeze:M,is:E}=k;t.ObjectIs=E,t.ObjectFreeze=M,t.ObjectDefineProperty=I,t.ObjectCreate=T;const P=k.prototype,A=(t.ObjectPrototype__lookupGetter__=P.__lookupGetter__?i(P.__lookupGetter__):(e,t)=>{if(null==e)throw H(n.CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT);let r=k(e);do{const e=u(r,t);if(void 0!==e)return A(e,"get")?e.get:void 0}while(null!==(r=d(r)))},t.ObjectHasOwn=k.hasOwn||i(P.hasOwnProperty)),C=Array,R=(t.ArrayIsArray=C.isArray,C.prototype),L=(t.ArrayPrototypeJoin=i(R.join),t.ArrayPrototypePush=i(R.push),t.ArrayPrototypeToLocaleString=i(R.toLocaleString),t.NativeArrayPrototypeSymbolIterator=R[b]),{abs:O,trunc:D}=(t.ArrayPrototypeSymbolIterator=i(L),Math);t.MathTrunc=D,t.MathAbs=O;const z=t.NativeArrayBuffer=ArrayBuffer,F=(t.ArrayBufferIsView=z.isView,z.prototype),N=(t.ArrayBufferPrototypeSlice=i(F.slice),t.ArrayBufferPrototypeGetByteLength=o(F,"byteLength"),t.NativeSharedArrayBuffer="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null),B=(t.SharedArrayBufferPrototypeGetByteLength=N&&o(N.prototype,"byteLength"),t.TypedArray=d(Uint8Array)),j=B.from,V=t.TypedArrayPrototype=B.prototype,G=(t.NativeTypedArrayPrototypeSymbolIterator=V[b],t.TypedArrayPrototypeKeys=i(V.keys),t.TypedArrayPrototypeValues=i(V.values),t.TypedArrayPrototypeEntries=i(V.entries),t.TypedArrayPrototypeSet=i(V.set),t.TypedArrayPrototypeReverse=i(V.reverse),t.TypedArrayPrototypeFill=i(V.fill),t.TypedArrayPrototypeCopyWithin=i(V.copyWithin),t.TypedArrayPrototypeSort=i(V.sort),t.TypedArrayPrototypeSlice=i(V.slice),t.TypedArrayPrototypeSubarray=i(V.subarray),t.TypedArrayPrototypeGetBuffer=o(V,"buffer"),t.TypedArrayPrototypeGetByteOffset=o(V,"byteOffset"),t.TypedArrayPrototypeGetLength=o(V,"length"),t.TypedArrayPrototypeGetSymbolToStringTag=o(V,w),t.NativeUint8Array=Uint8Array,t.NativeUint16Array=Uint16Array);t.Uint16ArrayFrom=(...e)=>a(j,G,e);t.NativeUint32Array=Uint32Array,t.NativeFloat32Array=Float32Array;const U=t.ArrayIteratorPrototype=d([][b]()),$=(t.ArrayIteratorPrototypeNext=i(U.next),t.GeneratorPrototypeNext=i(function*(){}().next),t.IteratorPrototype=d(U),DataView.prototype),H=(t.DataViewPrototypeGetUint16=i($.getUint16),t.DataViewPrototypeSetUint16=i($.setUint16),t.NativeTypeError=TypeError),q=(t.NativeRangeError=RangeError,(t.NativeWeakSet=WeakSet).prototype),W=(t.WeakSetPrototypeAdd=i(q.add),t.WeakSetPrototypeHas=i(q.has),(t.NativeWeakMap=WeakMap).prototype);t.WeakMapPrototypeGet=i(W.get),t.WeakMapPrototypeHas=i(W.has),t.WeakMapPrototypeSet=i(W.set)},2648:(e,t,r)=>{"use strict";t.setYear=function(e,t,r){const o=(0,i.toDate)(e,r?.in);return isNaN(+o)?(0,n.constructFrom)(r?.in||e,NaN):(o.setFullYear(t),o)};var n=r(2956),i=r(4446)},2650:(e,t,r)=>{"use strict";t.previousMonday=function(e,t){return(0,n.previousDay)(e,1,t)};var n=r(8092)},2700:(e,t,r)=>{"use strict";t.constructNow=function(e){return(0,n.constructFrom)(e,Date.now())};var n=r(2956)},2717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IsDetachedBuffer=function(e){if((0,n.isSharedArrayBuffer)(e))return!1;try{return(0,o.ArrayBufferPrototypeSlice)(e,0,0),!1}catch(e){}return!0},t.SpeciesConstructor=function(e,t){if(!(0,n.isObject)(e))throw(0,o.NativeTypeError)(i.THIS_IS_NOT_AN_OBJECT);const r=e.constructor;if(void 0===r)return t;if(!(0,n.isObject)(r))throw(0,o.NativeTypeError)(i.THE_CONSTRUCTOR_PROPERTY_VALUE_IS_NOT_AN_OBJECT);const a=r[o.SymbolSpecies];if(null==a)return t;return a},t.ToIntegerOrInfinity=a,t.ToLength=function(e){const t=a(e);if(t<0)return 0;return t<o.MAX_SAFE_INTEGER?t:o.MAX_SAFE_INTEGER},t.defaultCompare=function(e,t){const r=(0,o.NumberIsNaN)(e),n=(0,o.NumberIsNaN)(t);if(r&&n)return 0;if(r)return 1;if(n)return-1;if(e<t)return-1;if(e>t)return 1;if(0===e&&0===t){const r=(0,o.ObjectIs)(e,0),n=(0,o.ObjectIs)(t,0);if(!r&&n)return-1;if(r&&!n)return 1}return 0};var n=r(7516),i=r(7968),o=r(2628);function a(e){const t=+e;return(0,o.NumberIsNaN)(t)||0===t?0:(0,o.MathTrunc)(t)}},2737:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.getFloat16=function(e,t,...r){return(0,i.convertToNumber)((0,o.DataViewPrototypeGetUint16)(e,t,...(0,n.safeIfNeeded)(r)))},t.setFloat16=function(e,t,r,...a){return(0,o.DataViewPrototypeSetUint16)(e,t,(0,i.roundToFloat16Bits)(r),...(0,n.safeIfNeeded)(a))};var n=r(3865),i=r(448),o=r(2628)},2756:(e,t,r)=>{"use strict";t.setDefaultOptions=function(e){const t={},r=(0,n.getDefaultOptions)();for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e]);for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(void 0===e[r]?delete t[r]:t[r]=e[r]);(0,n.setDefaultOptions)(t)};var n=r(6755)},2764:(e,t,r)=>{"use strict";t.formatRFC7231=function(e){const t=(0,o.toDate)(e);if(!(0,i.isValid)(t))throw new RangeError("Invalid time value");const r=a[t.getUTCDay()],l=(0,n.addLeadingZeros)(t.getUTCDate(),2),c=s[t.getUTCMonth()],u=t.getUTCFullYear(),d=(0,n.addLeadingZeros)(t.getUTCHours(),2),h=(0,n.addLeadingZeros)(t.getUTCMinutes(),2),f=(0,n.addLeadingZeros)(t.getUTCSeconds(),2);return`${r}, ${l} ${c} ${u} ${d}:${h}:${f} GMT`};var n=r(2554),i=r(7489),o=r(4446);const a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},2829:(e,t,r)=>{"use strict";t.lastDayOfYear=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getFullYear();return r.setFullYear(i+1,0,0),r.setHours(0,0,0,0),r};var n=r(4446)},2914:(e,t)=>{"use strict";t.formatDistance=void 0;const r={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};t.formatDistance=(e,t,n)=>{let i;const o=r[e];return i="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i}},2934:(e,t,r)=>{"use strict";t.daysToWeeks=function(e){const t=Math.trunc(e/n.daysInWeek);return 0===t?0:t};var n=r(8052)},2944:(e,t,r)=>{"use strict";t.secondsToHours=function(e){const t=e/n.secondsInHour;return Math.trunc(t)};var n=r(8052)},2945:(e,t,r)=>{"use strict";t.addISOWeekYears=function(e,t,r){return(0,i.setISOWeekYear)(e,(0,n.getISOWeekYear)(e,r)+t,r)};var n=r(9957),i=r(4617)},2956:(e,t,r)=>{"use strict";t.constructFrom=function(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&n.constructFromSymbol in e?e[n.constructFromSymbol](t):e instanceof Date?new e.constructor(t):new Date(t)};var n=r(8052)},2963:(e,t,r)=>{"use strict";t.getDecade=function(e,t){const r=(0,n.toDate)(e,t?.in).getFullYear();return 10*Math.floor(r/10)};var n=r(4446)},2994:(e,t,r)=>{"use strict";t.lastDayOfWeek=function(e,t){const r=(0,n.getDefaultOptions)(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=(0,i.toDate)(e,t?.in),s=a.getDay(),l=6+(s<o?-7:0)-(s-o);return a.setHours(0,0,0,0),a.setDate(a.getDate()+l),a};var n=r(6755),i=r(4446)},3028:(e,t,r)=>{"use strict";t.subMinutes=function(e,t,r){return(0,n.addMinutes)(e,-t,r)};var n=r(3937)},3040:(e,t,r)=>{"use strict";t.startOfWeekYear=function(e,t){const r=(0,n.getDefaultOptions)(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=(0,o.getWeekYear)(e,t),c=(0,i.constructFrom)(t?.in||e,0);c.setFullYear(l,0,s),c.setHours(0,0,0,0);return(0,a.startOfWeek)(c,t)};var n=r(6755),i=r(2956),o=r(6708),a=r(5472)},3072:(e,t,r)=>{"use strict";t.differenceInMinutes=function(e,t,r){const a=(0,o.differenceInMilliseconds)(e,t)/i.millisecondsInMinute;return(0,n.getRoundingMethod)(r?.roundingMethod)(a)};var n=r(1331),i=r(8052),o=r(2495)},3074:(e,t,r)=>{"use strict";t.minutesToSeconds=function(e){return Math.trunc(e*n.secondsInMinute)};var n=r(8052)},3086:(e,t,r)=>{"use strict";var n=r(9136),i=r(3115);function o(e){i.call(this,e)}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.sendRequest=n.browserSend,o.prototype.abortRequest=n.browserAbort,e.exports=function(e){return new o(e)}},3115:(e,t,r)=>{"use strict";var n=r(4256),i=r(75),o=r(8910);function a(e){if(!e||!e.accessToken)throw new Error("Cannot create a client without an access token");n(e.accessToken),this.accessToken=e.accessToken,this.origin=e.origin||o.API_ORIGIN}a.prototype.createRequest=function(e){return new i(this,e)},e.exports=a},3224:(e,t,r)=>{"use strict";t.subDays=function(e,t,r){return(0,n.addDays)(e,-t,r)};var n=r(7591)},3298:(e,t,r)=>{"use strict";t.eachWeekOfInterval=function(e,t){const{start:r,end:s}=(0,n.normalizeInterval)(t?.in,e);let l=+r>+s;const c=l?(0,a.startOfWeek)(s,t):(0,a.startOfWeek)(r,t),u=l?(0,a.startOfWeek)(r,t):(0,a.startOfWeek)(s,t);c.setHours(15),u.setHours(15);const d=+u.getTime();let h=c,f=t?.step??1;if(!f)return[];f<0&&(f=-f,l=!l);const p=[];for(;+h<=d;
1)h.setHours(0),p.push((0,o.constructFrom)(r,h)),h=(0,i.addWeeks)(h,f),h.setHours(15);return l?p.reverse():p};var n=r(5909),i=r(4073),o=r(2956),a=r(5472)},3306:(e,t,r)=>{"use strict";t.ISOTimezoneWithZParser=void 0;var n=r(2956),i=r(6339),o=r(7699),a=r(5513),s=r(3771);class l extends a.Parser{priority=10;parse(e,t){switch(t){case"X":return(0,s.parseTimezonePattern)(o.timezonePatterns.basicOptionalMinutes,e);case"XX":return(0,s.parseTimezonePattern)(o.timezonePatterns.basic,e);case"XXXX":return(0,s.parseTimezonePattern)(o.timezonePatterns.basicOptionalSeconds,e);case"XXXXX":return(0,s.parseTimezonePattern)(o.timezonePatterns.extendedOptionalSeconds,e);default:return(0,s.parseTimezonePattern)(o.timezonePatterns.extended,e)}}set(e,t,r){return t.timestampIsSet?e:(0,n.constructFrom)(e,e.getTime()-(0,i.getTimezoneOffsetInMilliseconds)(e)-r)}incompatibleTokens=["t","T","x"]}t.ISOTimezoneWithZParser=l},3313:(e,t,r)=>{"use strict";t.startOfTomorrow=function(e){const t=(0,i.constructNow)(e?.in),r=t.getFullYear(),o=t.getMonth(),a=t.getDate(),s=(0,n.constructFrom)(e?.in,0);return s.setFullYear(r,o,a+1),s.setHours(0,0,0,0),s};var n=r(2956),i=r(2700)},3326:(e,t,r)=>{"use strict";var n=r(4866);e.exports=n,"undefined"!=typeof window&&(window.Suggestions=n)},3348:(e,t,r)=>{"use strict";t.isWeekend=function(e,t){const r=(0,n.toDate)(e,t?.in).getDay();return 0===r||6===r};var n=r(4446)},3349:e=>{"use strict";e.exports=function(e){var t={};return e?(e.trim().split(/[\r|\n]+/).forEach((function(e){var r=function(e){var t=e.indexOf(":");return{name:e.substring(0,t).trim().toLowerCase(),value:e.substring(t+1).trim()}}(e);t[r.name]=r.value})),t):t}},3354:(e,t,r)=>{"use strict";t.setISOWeek=function(e,t,r){const o=(0,i.toDate)(e,r?.in),a=(0,n.getISOWeek)(o,r)-t;return o.setDate(o.getDate()-7*a),o};var n=r(8926),i=r(4446)},3359:(e,t,r)=>{"use strict";t.setDayOfYear=function(e,t,r){const i=(0,n.toDate)(e,r?.in);return i.setMonth(0),i.setDate(t),i};var n=r(4446)},3364:(e,t,r)=>{"use strict";t.isLeapYear=function(e,t){const r=(0,n.toDate)(e,t?.in).getFullYear();return r%400==0||r%4==0&&r%100!=0};var n=r(4446)},3375:(e,t,r)=>{"use strict";t.milliseconds=function({years:e,months:t,weeks:r,days:i,hours:o,minutes:a,seconds:s}){let l=0;e&&(l+=e*n.daysInYear);t&&(l+=t*(n.daysInYear/12));r&&(l+=7*r);i&&(l+=i);let c=24*l*60*60;o&&(c+=60*o*60);a&&(c+=60*a);s&&(c+=s);return Math.trunc(1e3*c)};var n=r(8052)},3481:function(e,t){
2/* @preserve
3 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
4 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
5 */
6!function(e){"use strict";var t="1.9.4";function r(e){var t,r,n,i;for(r=1,n=arguments.length;r<n;r++)for(t in i=arguments[r])e[t]=i[t];return e}var n=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}();function i(e,t){var r=Array.prototype.slice;if(e.bind)return e.bind.apply(e,r.call(arguments,1));var n=r.call(arguments,2);return function(){return e.apply(t,n.length?n.concat(r.call(arguments)):arguments)}}var o=0;function a(e){return"_leaflet_id"in e||(e._leaflet_id=++o),e._leaflet_id}function s(e,t,r){var n,i,o,a;return a=function(){n=!1,i&&(o.apply(r,i),i=!1)},o=function(){n?i=arguments:(e.apply(r,arguments),setTimeout(a,t),n=!0)},o}function l(e,t,r){var n=t[1],i=t[0],o=n-i;return e===n&&r?e:((e-i)%o+o)%o+i}function c(){return!1}function u(e,t){if(!1===t)return e;var r=Math.pow(10,void 0===t?6:t);return Math.round(e*r)/r}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function h(e){return d(e).split(/\s+/)}function f(e,t){for(var r in Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?n(e.options):{}),t)e.options[r]=t[r];return e.options}function p(e,t,r){var n=[];for(var i in e)n.push(encodeURIComponent(r?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(t&&-1!==t.indexOf("?")?"&":"?")+n.join("&")}var g=/\{ *([\w_ -]+) *\}/g;function m(e,t){return e.replace(g,(function(e,r){var n=t[r];if(void 0===n)throw new Error("No value provided for variable "+e);return"function"==typeof n&&(n=n(t)),n}))}var y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function _(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var x=0;function w(e){var t=+new Date,r=Math.max(0,16-(t-x));return x=t+r,window.setTimeout(e,r)}var S=window.requestAnimationFrame||b("RequestAnimationFrame")||w,k=window.cancelAnimationFrame||b("C
6ancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function T(e,t,r){if(!r||S!==w)return S.call(window,i(e,t));e.call(t)}function I(e){e&&k.call(window,e)}var M={__proto__:null,extend:r,create:n,bind:i,get lastId(){return o},stamp:a,throttle:s,wrapNum:l,falseFn:c,formatNum:u,trim:d,splitWords:h,setOptions:f,getParamString:p,template:m,isArray:y,indexOf:_,emptyImageUrl:v,requestFn:S,cancelFn:k,requestAnimFrame:T,cancelAnimFrame:I};function E(){}function P(e){if("undefined"!=typeof L&&L&&L.Mixin){e=y(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}E.extend=function(e){var t=function(){f(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=t.__super__=this.prototype,o=n(i);for(var a in o.constructor=t,t.prototype=o,this)Object.prototype.hasOwnProperty.call(this,a)&&"prototype"!==a&&"__super__"!==a&&(t[a]=this[a]);return e.statics&&r(t,e.statics),e.includes&&(P(e.includes),r.apply(null,[o].concat(e.includes))),r(o,e),delete o.statics,delete o.includes,o.options&&(o.options=i.options?n(i.options):{},r(o.options,e.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=o._initHooks.length;e<t;e++)o._initHooks[e].call(this)}},t},E.include=function(e){var t=this.prototype.options;return r(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},E.mergeOptions=function(e){return r(this.prototype.options,e),this},E.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),r="function"==typeof e?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(r),this};var A={on:function(e,t,r){if("object"==typeof e)for(var n in e)this._on(n,e[n],t);else for(var i=0,o=(e=h(e)).length;i<o;i++)this._on(e[i],t,r);return this},off:function(e,t,r){if(arguments.length)if("object"==typeof e)for(var n in e)this._off(n,e[n],t);else{e=h(e);for(var i=1===arguments.length,o=0,a=e.length;o<a;o++)i?this._off(e[o]):this._off(e[o],t,r)}else delete this._events;return this},_on:function(e,t,r,n){if("function"==typeof t){if(!1===this._listens(e,t,r)){r===this&&(r=void 0);var i={fn:t,ctx:r};n&&(i.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(i)}}else console.warn("wrong listener type: "+typeof t)},_off:function(e,t,r){var n,i,o;if(this._events&&(n=this._events[e]))if(1!==arguments.length)if("function"==typeof t){var a=this._listens(e,t,r);if(!1!==a){var s=n[a];this._firingCount&&(s.fn=c,this._events[e]=n=n.slice()),n.splice(a,1)}}else console.warn("wrong listener type: "+typeof t);else{if(this._firingCount)for(i=0,o=n.length;i<o;i++)n[i].fn=c;delete this._events[e]}},fire:function(e,t,n){if(!this.listens(e,n))return this;var i=r({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var o=this._events[e];if(o){this._firingCount=this._firingCount+1||1;for(var a=0,s=o.length;a<s;a++){var l=o[a],c=l.fn;l.once&&this.off(e,c,l.ctx),c.call(l.ctx||this,i)}this._firingCount--}}return n&&this._propagateEvent(i),this},listens:function(e,t,r,n){"string"!=typeof e&&console.warn('"string" type argument expected');var i=t;"function"!=typeof t&&(n=!!t,i=void 0,r=void 0);var o=this._events&&this._events[e];if(o&&o.length&&!1!==this._listens(e,i,r))return!0;if(n)for(var a in this._eventParents)if(this._eventParents[a].listens(e,t,r,n))return!0;return!1},_listens:function(e,t,r){if(!this._events)return!1;var n=this._events[e]||[];if(!t)return!!n.length;r===this&&(r=void 0);for(var i=0,o=n.length;i<o;i++)if(n[i].fn===t&&n[i].ctx===r)return i;return!1},once:function(e,t,r){if("object"==typeof e)for(var n in e)this._on(n,e[n],t,!0);else for(var i=0,o=(e=h(e)).length;i<o;i++)this._on(e[i],t,r,!0);return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[a(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[a(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,r({layer:e.target,propagatedFrom:e.target},e),!0)}};A.addEventListener=A.on,A.removeEventListener=A.clearAllEventListeners=A.off,A.addOneTimeEventListener=A.once,A.fireEvent=A.fire,A.hasEventListeners=A.listens;var C=E.extend(A);function R(e,t,r){this.x=r?Math.round(e):e,this.y=r?Math.round(t):t}var O=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};function D(e,t,r){return e instanceof R?e:y(e)?new R(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new R(e.x,e.y):new R(e,t,r)}function z(e,t){if(e)for(var r=t?[e,t]:e,n=0,i=r.length;n<i;n++)this.extend(r[n])}function F(e,t){return!e||e instanceof z?e:new z(e,t)}function N(e,t){if(e)for(var r=t?[e,t]:e,n=0,i=r.length;n<i;n++)this.extend(r[n])}function B(e,t){return e instanceof N?e:new N(e,t)}function j(e,t,r){if(isNaN(e)||isNaN(t))throw new Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=+e,this.lng=+t,void 0!==r&&(this.alt=+r)}function V(e,t,r){return e instanceof j?e:y(e)&&"object"!=typeof e[0]?3===e.length?new j(e[0],e[1],e[2]):2===e.length?new j(e[0],e[1]):null:null==e?e:"object"==typeof e&&"lat"in e?new j(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new j(e,t,r)}R.prototype={clone:function(){return new R(this.x,this.y)},add:function(e){return this.clone()._add(D(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(D(e))}
vendor: 3,929 bytes, line 6
6,_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new R(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new R(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=O(this.x),this.y=O(this.y),this},distanceTo:function(e){var t=(e=D(e)).x-this.x,r=e.y-this.y;return Math.sqrt(t*t+r*r)},equals:function(e){return(e=D(e)).x===this.x&&e.y===this.y},contains:function(e){return e=D(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},z.prototype={extend:function(e){var t,r;if(!e)return this;if(e instanceof R||"number"==typeof e[0]||"x"in e)t=r=D(e);else if(t=(e=F(e)).min,r=e.max,!t||!r)return this;return this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(r.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(r.y,this.max.y)):(this.min=t.clone(),this.max=r.clone()),this},getCenter:function(e){return D((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return D(this.min.x,this.max.y)},getTopRight:function(){return D(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,r;return(e="number"==typeof e[0]||e instanceof R?D(e):F(e))instanceof z?(t=e.min,r=e.max):t=r=e,t.x>=this.min.x&&r.x<=this.max.x&&t.y>=this.min.y&&r.y<=this.max.y},intersects:function(e){e=F(e);var t=this.min,r=this.max,n=e.min,i=e.max,o=i.x>=t.x&&n.x<=r.x,a=i.y>=t.y&&n.y<=r.y;return o&&a},overlaps:function(e){e=F(e);var t=this.min,r=this.max,n=e.min,i=e.max,o=i.x>t.x&&n.x<r.x,a=i.y>t.y&&n.y<r.y;return o&&a},isValid:function(){return!(!this.min||!this.max)},pad:function(e){var t=this.min,r=this.max,n=Math.abs(t.x-r.x)*e,i=Math.abs(t.y-r.y)*e;return F(D(t.x-n,t.y-i),D(r.x+n,r.y+i))},equals:function(e){return!!e&&(e=F(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight()))}},N.prototype={extend:function(e){var t,r,n=this._southWest,i=this._northEast;if(e instanceof j)t=e,r=e;else{if(!(e instanceof N))return e?this.extend(V(e)||B(e)):this;if(t=e._southWest,r=e._northEast,!t||!r)return this}return n||i?(n.lat=Math.min(t.lat,n.lat),n.lng=Math.min(t.lng,n.lng),i.lat=Math.max(r.lat,i.lat),i.lng=Math.max(r.lng,i.lng)):(this._southWest=new j(t.lat,t.lng),this._northEast=new j(r.lat,r.lng)),this},pad:function(e){var t=this._southWest,r=this._northEast,n=Math.abs(t.lat-r.lat)*e,i=Math.abs(t.lng-r.lng)*e;return new N(new j(t.lat-n,t.lng-i),new j(r.lat+n,r.lng+i))},getCenter:function(){return new j((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"==typeof e[0]||e instanceof j||"lat"in e?V(e):B(e);var t,r,n=this._southWest,i=this._northEast;
vendor: 2,213 bytes, line 6
6return e instanceof N?(t=e.getSouthWest(),r=e.getNorthEast()):t=r=e,t.lat>=n.lat&&r.lat<=i.lat&&t.lng>=n.lng&&r.lng<=i.lng},intersects:function(e){e=B(e);var t=this._southWest,r=this._northEast,n=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>=t.lat&&n.lat<=r.lat,a=i.lng>=t.lng&&n.lng<=r.lng;return o&&a},overlaps:function(e){e=B(e);var t=this._southWest,r=this._northEast,n=e.getSouthWest(),i=e.getNorthEast(),o=i.lat>t.lat&&n.lat<r.lat,a=i.lng>t.lng&&n.lng<r.lng;return o&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,t){return!!e&&(e=B(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t))},isValid:function(){return!(!this._southWest||!this._northEast)}},j.prototype={equals:function(e,t){return!!e&&(e=V(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(void 0===t?1e-9:t))},toString:function(e){return"LatLng("+u(this.lat,e)+", "+u(this.lng,e)+")"},distanceTo:function(e){return $.distance(this,V(e))},wrap:function(){return $.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return B([this.lat-t,this.lng-r],[this.lat+t,this.lng+r])},clone:function(){return new j(this.lat,this.lng,this.alt)}};var G,U={latLngToPoint:function(e,t){var r=this.projection.project(e),n=this.scale(t);return this.transformation._transform(r,n)},pointToLatLng:function(e,t){var r=this.scale(t),n=this.transformation.untransform(e,r);return this.projection.unproject(n)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,r=this.scale(e);return new z(this.transformation.transform(t.min,r),this.transformation.transform(t.max,r))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?l(e.lng,this.wrapLng,!0):e.lng;return new j(this.wrapLat?l(e.lat,this.wrapLat,!0):e.lat,t,e.alt)},wrapLatLngBounds:function(e){var t=e.getCenter(),r=this.wrapLatLng(t),n=t.lat-r.lat,i=t.lng-r.lng;if(0===n&&0===i)return e;
vendor: 28,693 bytes, line 6
6var o=e.getSouthWest(),a=e.getNorthEast();return new N(new j(o.lat-n,o.lng-i),new j(a.lat-n,a.lng-i))}},$=r({},U,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var r=Math.PI/180,n=e.lat*r,i=t.lat*r,o=Math.sin((t.lat-e.lat)*r/2),a=Math.sin((t.lng-e.lng)*r/2),s=o*o+Math.cos(n)*Math.cos(i)*a*a,l=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*l}}),H=6378137,q={R:H,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,r=this.MAX_LATITUDE,n=Math.max(Math.min(r,e.lat),-r),i=Math.sin(n*t);return new R(this.R*e.lng*t,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(e){var t=180/Math.PI;return new j((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(G=H*Math.PI,new z([-G,-G],[G,G]))};function W(e,t,r,n){if(y(e))return this._a=e[0],this._b=e[1],this._c=e[2],void(this._d=e[3]);this._a=e,this._b=t,this._c=r,this._d=n}function Z(e,t,r,n){return new W(e,t,r,n)}W.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new R((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};var Y=r({},$,{code:"EPSG:3857",projection:q,transformation:function(){var e=.5/(Math.PI*q.R);return Z(e,.5,-e,.5)}()}),X=r({},Y,{code:"EPSG:900913"});function K(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function J(e,t){var r,n,i,o,a,s,l="";for(r=0,i=e.length;r<i;r++){for(n=0,o=(a=e[r]).length;n<o;n++)l+=(n?"L":"M")+(s=a[n]).x+" "+s.y;l+=t?Ne.svg?"z":"x":""}return l||"M0 0"}var Q,ee=document.documentElement.style,te="ActiveXObject"in window,re=te&&!document.addEventListener,ne="msLaunchUri"in navigator&&!("documentMode"in document),ie=Fe("webkit"),oe=Fe("android"),ae=Fe("android 2")||Fe("android 3"),se=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),le=oe&&Fe("Google")&&se<537&&!("AudioNode"in window),ce=!!window.opera,ue=!ne&&Fe("chrome"),de=Fe("gecko")&&!ie&&!ce&&!te,he=!ue&&Fe("safari"),fe=Fe("phantom"),pe="OTransition"in ee,ge=0===navigator.platform.indexOf("Win"),me=te&&"transition"in ee,ye="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ae,_e="MozPerspective"in ee,ve=!window.L_DISABLE_3D&&(me||ye||_e)&&!pe&&!fe,be="undefined"!=typeof orientation||Fe("mobile"),xe=be&&ie,we=be&&ye,Se=!window.PointerEvent&&window.MSPointerEvent,ke=!(!window.PointerEvent&&!Se),Te="ontouchstart"in window||!!window.TouchEvent,Ie=!window.L_NO_TOUCH&&(Te||ke),Me=be&&ce,Ee=be&&de,Pe=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ae=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",c,t),window.removeEventListener("testPassiveEventSupport",c,t)}catch(e){}return e}(),Ce=!!document.createElement("canvas").getContext,Re=!(!document.createElementNS||!K("svg").createSVGRect),Le=!!Re&&((Q=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Q.firstChild&&Q.firstChild.namespaceURI)),Oe=!Re&&function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}(),De=0===navigator.platform.indexOf("Mac"),ze=0===navigator.platform.indexOf("Linux");function Fe(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Ne={ie:te,ielt9:re,edge:ne,webkit:ie,android:oe,android23:ae,androidStock:le,opera:ce,chrome:ue,gecko:de,safari:he,phantom:fe,opera12:pe,win:ge,ie3d:me,webkit3d:ye,gecko3d:_e,any3d:ve,mobile:be,mobileWebkit:xe,mobileWebkit3d:we,msPointer:Se,pointer:ke,touch:Ie,touchNative:Te,mobileOpera:Me,mobileGecko:Ee,retina:Pe,passiveEvents:Ae,canvas:Ce,svg:Re,vml:Oe,inlineSvg:Le,mac:De,linux:ze},Be=Ne.msPointer?"MSPointerDown":"pointerdown",je=Ne.msPointer?"MSPointerMove":"pointermove",Ve=Ne.msPointer?"MSPointerUp":"pointerup",Ge=Ne.msPointer?"MSPointerCancel":"pointercancel",Ue={touchstart:Be,touchmove:je,touchend:Ve,touchcancel:Ge},$e={touchstart:et,touchmove:Qe,touchend:Qe,touchcancel:Qe},He={},qe=!1;function We(e,t,r){return"touchstart"===t&&Je(),$e[t]?(r=$e[t].bind(this,r),e.addEventListener(Ue[t],r,!1),r):(console.warn("wrong event specified:",t),c)}function Ze(e,t,r){Ue[t]?e.removeEventListener(Ue[t],r,!1):console.warn("wrong event specified:",t)}function Ye(e){He[e.pointerId]=e}function Xe(e){He[e.pointerId]&&(He[e.pointerId]=e)}function Ke(e){delete He[e.pointerId]}function Je(){qe||(document.addEventListener(Be,Ye,!0),document.addEventListener(je,Xe,!0),document.addEventListener(Ve,Ke,!0),document.addEventListener(Ge,Ke,!0),qe=!0)}function Qe(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var r in t.touches=[],He)t.touches.push(He[r]);t.changedTouches=[t],e(t)}}function et(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Yt(t),Qe(e,t)}function tt(e){var t,r,n={};for(r in e)t=e[r],n[r]=t&&t.bind?t.bind(e):t;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var rt=200;function nt(e,t){e.addEventListener("dblclick",t);var r,n=0;function i(e){if(1===e.detail){if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var i=Kt(e);if(!i.some((function(e){return e instanceof HTMLLabelElement&&e.attributes.for}))||i.some((function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var o=Date.now();o-n<=rt?2==++r&&t(tt(e)):r=1,n=o}}}else r=e.detail}return e.addEventListener("click",i),{dblclick:t,simDblclick:i}}function it(e,t){e.removeEventListener("dblclick",t.dblclick),e.removeEventListener("click",t.simDblclick)}var ot,at,st,lt,ct,ut=Mt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),dt=Mt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ht="webkitTransition"===dt||"OTransition"===dt?dt+"End":"transitionend";function ft(e){return"string"==typeof e?document.getElementById(e):e}function pt(e,t){var r=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!r||"auto"===r)&&document.defaultView){var n=document.defaultView.getComputedStyle(e,null);r=n?n[t]:null}return"auto"===r?null:r}function gt(e,t,r){var n=document.createElement(e);return n.className=t||"",r&&r.appendChild(n),n}function mt(e){var t=e.parentNode;t&&t.removeChild(e)}function yt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function _t(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function vt(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function bt(e,t){if(void 0!==e.classList)return e.classList.contains(t);var r=kt(e);return r.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(r)}function xt(e,t){if(void 0!==e.classList)for(var r=h(t),n=0,i=r.length;n<i;n++)e.classList.add(r[n]);else if(!bt(e,t)){var o=kt(e);St(e,(o?o+" ":"")+t)}}function wt(e,t){void 0!==e.classList?e.classList.remove(t):St(e,d((" "+kt(e)+" ").replace(" "+t+" "," ")))}function St(e,t){void 0===e.className.baseVal?e.className=t:e.className.baseVal=t}function kt(e){return e.correspondingElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function Tt(e,t){"opacity"in e.style?e.style.opacity=t:"filter"in e.style&&It(e,t)}function It(e,t){var r=!1,n="DXImageTransform.Microsoft.Alpha";try{r=e.filters.item(n)}catch(e){if(1===t)return}t=Math.round(100*t),r?(r.Enabled=100!==t,r.Opacity=t):e.style.filter+=" progid:"+n+"(opacity="+t+")"}function Mt(e){for(var t=document.documentElement.style,r=0;r<e.length;r++)if(e[r]in t)return e[r];return!1}function Et(e,t,r){var n=t||new R(0,0);e.style[ut]=(Ne.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(r?" scale("+r+")":"")}function Pt(e,t){e._leaflet_pos=t,Ne.any3d?Et(e,t):(e.style.left=t.x+"px",e.style.top=t.y+"px")}function At(e){return e._leaflet_pos||new R(0,0)}if("onselectstart"in document)ot=function(){Bt(window,"selectstart",Yt)},at=function(){Vt(window,"selectstart",Yt)};else{var Ct=Mt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ot=function(){if(Ct){var e=document.documentElement.style;st=e[Ct],e[Ct]="none"}},at=function(){Ct&&(document.documentElement.style[Ct]=st,st=void 0)}}function Rt(){Bt(window,"dragstart",Yt)}function Lt(){Vt(window,"dragstart",Yt)}function Ot(e){for(;-1===e.tabIndex;)e=e.parentNode;e.style&&(Dt(),lt=e,ct=e.style.outlineStyle,e.style.outlineStyle="none",Bt(window,"keydown",Dt))}function Dt(){lt&&(lt.style.outlineStyle=ct,lt=void 0,ct=void 0,Vt(window,"keydown",Dt))}function zt(e){do{e=e.parentNode}while(!(e.offsetWidth&&e.offsetHeight||e===document.body));return e}function Ft(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var Nt={__proto__:null,TRANSFORM:ut,TRANSITION:dt,TRANSITION_END:ht,get:ft,getStyle:pt,create:gt,remove:mt,empty:yt,toFront:_t,toBack:vt,hasClass:bt,addClass:xt,removeClass:wt,setClass:St,getClass:kt,setOpacity:Tt,testProp:Mt,setTransform:Et,setPosition:Pt,getPosition:At,get disableTextSelection(){return ot},get enableTextSelection(){return at},disableImageDrag:Rt,enableImageDrag:Lt,preventOutline:Ot,restoreOutline:Dt,getSizedParentNode:zt,getScale:Ft};function Bt(e,t,r,n){if(t&&"object"==typeof t)for(var i in t)$t(e,i,t[i],r);else for(var o=0,a=(t=h(t)).length;o<a;o++)$t(e,t[o],r,n);return this}var jt="_leaflet_events";function Vt(e,t,r,n){if(1===arguments.length)Gt(e),delete e[jt];else if(t&&"object"==typeof t)for(var i in t)Ht(e,i,t[i],r);else if(t=h(t),2===arguments.length)Gt(e,(function(e){return-1!==_(t,e)}));else for(var o=0,a=t.length;o<a;o++)Ht(e,t[o],r,n);return this}function Gt(e,t){for(var r in e[jt]){var n=r.split(/\d/)[0];t&&!t(n)||Ht(e,n,null,null,r)}}var Ut={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function $t(e,t,r,n){var i=t+a(r)+(n?"_"+a(n):"");if(e[jt]&&e[jt][i])return this;var o=function(t){return r.call(n||e,t||window.event)},s=o;!Ne.touchNative&&Ne.pointer&&0===t.indexOf("touch")?o=We(e,t,o):Ne.touch&&"dblclick"===t?o=nt(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ut[t]||t,o,!!Ne.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(o=function(t){t=t||window.event,tr(e,t)&&s(t)},e.addEventListener(Ut[t],o,!1)):e.addEventListener(t,s,!1):e.attachEvent("on"+t,o),e[jt]=e[jt]||{},e[jt][i]=o}function Ht(e,t,r,n,i){i=i||t+a(r)+(n?"_"+a(n):"");var o=e[jt]&&e[jt][i];if(!o)return this;!Ne.touchNative&&Ne.pointer&&0===t.indexOf("touch")?Ze(e,t,o):Ne.touch&&"dblclick"===t?it(e,o):"removeEventListener"in e?e.removeEventListener(Ut[t]||t,o,!1):e.detachEvent("on"+t,o),e[jt][i]=null}function qt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function Wt(e){return $t(e,"wheel",qt),this}function Zt(e){return Bt(e,"mousedown touchstart dblclick contextmenu",qt),e._leaflet_disable_click=!0,this}function Yt(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function Xt(e){return Yt(e),qt(e),this}function Kt(e){if(e.composedPath)return e.composedPath();for(var t=[],r=e.target;r;)t.push(r),r=r.parentNode;return t}function Jt(e,t){if(!t)return new R(e.clientX,e.clientY);var r=Ft(t),n=r.boundingClientRect;return new R((e.clientX-n.left)/r.x-t.clientLeft,(e.clientY-n.top)/r.y-t.clientTop)}var Qt=Ne.linux&&Ne.chrome?window.devicePixelRatio:Ne.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function er(e){return Ne.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/Qt:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}function tr(e,t){var r=t.relatedTarget;if(!r)return!0;try{for(;r&&r!==e;)r=r.parentNode}catch(e){return!1}return r!==e}var rr={__proto__:null,on:Bt,off:Vt,stopPropagation:qt,disableScrollPropagation:Wt,disableClickPropagation:Zt,preventDefault:Yt,stop:Xt,getPropagationPath:Kt,getMousePosition:Jt,getWheelDelta:er,isExternalTarget:tr,addListener:Bt,removeListener:Vt},nr=C.extend({run:function(e,t,r,n){this.stop(),this._el=e,this._inProgress=!0,this._duration=r||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=At(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=T(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,r=1e3*this._duration;t<r?this._runFrame(this._easeOut(t/r),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var r=this._startPos.add(this._offset.multiplyBy(e));t&&r._round(),Pt(this._el,r),this.fire("step")},_complete:function(){I(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),ir=C.extend({options:{crs:Y,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=f(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=i(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom)),t.center&&void 0!==t.zoom&&this.setView(V(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=dt&&Ne.any3d&&!Ne.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Bt(this._proxy,ht,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,n){return t=void 0===t?this._zoom:this._limitZoom(t),e=this._limitCenter(V(e),t,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=r({animate:n.animate},n.zoom),n.pan=r({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,n.zoom):this._tryAnimatedPan(e,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,n.pan&&n.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e=e||(Ne.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e=e||(Ne.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,r){var n=this.getZoomScale(t),i=this.getSize().divideBy(2),o=(e instanceof R?e:this.latLngToContainerPoint(e)).subtract(i).multiplyBy(1-1/n),a=this.containerPointToLatLng(i.add(o));return this.setView(a,t,{zoom:r})},_getBoundsCenterZoom:function(e,t){t=t||{},e=e.getBounds?e.getBounds():B(e);var r=D(t.paddingTopLeft||t.padding||[0,0]),n=D(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(e,!1,r.add(n));if((i="number"==typeof t.maxZoom?Math.min(t.maxZoom,i):i)===1/0)return{center:e.getCenter(),zoom:i};var o=n.subtract(r).divideBy(2),a=this.project(e.getSouthWest(),i),s=this.project(e.getNorthEast(),i);return{center:this.unproject(a.add(s).divideBy(2).add(o),i),zoom:i}},fitBounds:function(e,t){if(!(e=B(e)).isValid())throw new Error("Bounds are not valid.");var r=this._getBoundsCenterZoom(e,t);return this.setView(r.center,r.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(t=t||{},!(e=D(e).round()).x&&!e.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new nr,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){xt(this._mapPane,"leaflet-pan-anim");var r=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,r,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,t,r){if(!1===(r=r||{}).animate||!Ne.any3d)return this.setView(e,t,r);this._stop();var n=this.project(this.getCenter()),i=this.project(e),o=this.getSize(),a=this._zoom;e=V(e),t=void 0===t?a:t;var s=Math.max(o.x,o.y),l=s*this.getZoomScale(a,t),c=i.distanceTo(n)||1,u=1.42,d=u*u;function h(e){var t=(l*l-s*s+(e?-1:1)*d*d*c*c)/(2*(e?l:s)*d*c),r=Math.sqrt(t*t+1)-t;return r<1e-9?-18:Math.log(r)}function f(e){return(Math.exp(e)-Math.exp(-e))/2}function p(e){return(Math.exp(e)+Math.exp(-e))/2}function g(e){return f(e)/p(e)}var m=h(0);function y(e){return s*(p(m)/p(m+u*e))}function _(e){return s*(p(m)*g(m+u*e)-f(m))/d}function v(e){return 1-Math.pow(1-e,1.5)}var b=Date.now(),x=(h(1)-m)/u,w=r.duration?1e3*r.duration:1e3*x*.8;function S(){var r=(Date.now()-b)/w,o=v(r)*x;r<=1?(this._flyToFrame=T(S,this),this._move(this.unproject(n.add(i.subtract(n).multiplyBy(_(o)/c)),a),this.getScaleZoom(s/y(o),a),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,r.noMoveStart),S.call(this),this},flyToBounds:function(e,t){var r=this._getBoundsCenterZoom(e,t);return this.flyTo(r.center,r.zoom,t)},setMaxBounds:function(e){return e=B(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var r=this.getCenter(),n=this._limitCenter(r,this._zoom,B(e));return r.equals(n)||this.panTo(n,t),this._enforcingBounds=!1,this},panInside:function(e,t){var r=D((t=t||{}).paddingTopLeft||t.padding||[0,0]),n=D(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),o=this.project(e),a=this.getPixelBounds(),s=F([a.min.add(r),a.max.subtract(n)]),l=s.getSize();if(!s.contains(o)){this._enforcingBounds=!0;var c=o.subtract(s.getCenter()),u=s.extend(o).getSize().subtract(l);i.x+=c.x<0?-u.x:u.x,i.y+=c.y<0?-u.y:u.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=r({animate:!1,pan:!0},!0===e?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),o=t.divideBy(2).round(),a=n.divideBy(2).round(),s=o.subtract(a);return s.x||s.y?(e.animate&&e.pan?this.panBy(s):(e.pan&&this._rawPanBy(s),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:t,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=r({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=i(this._handleGeolocationResponse,this),n=i(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,n,e):navigator.geolocation.getCurrentPosition(t,n,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,r=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+r+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new j(e.coords.latitude,e.coords.longitude),r=t.toBounds(2*e.coords.accuracy),n=this._locateOptions;if(n.setView){var i=this.getBoundsZoom(r);this.setView(t,n.maxZoom?Math.min(i,n.maxZoom):i)}var o={latlng:t,bounds:r,timestamp:e.timestamp};for(var a in e.coords)"number"==typeof e.coords[a]&&(o[a]=e.coords[a]);this.fire("locationfound",o)}},addHandler:function(e,t){if(!t)return this;var r=this[e]=new t(this);return this._handlers.push(r),this.options[e]&&r.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),mt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(I(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)mt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var r=gt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=r),r},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new N(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,r){e=B(e),r=D(r||[0,0]);var n=this.getZoom()||0,i=this.getMinZoom(),o=this.getMaxZoom(),a=e.getNorthWest(),s=e.getSouthEast(),l=this.getSize().subtract(r),c=F(this.project(s,n),this.project(a,n)).getSize(),u=Ne.any3d?this.options.zoomSnap:1,d=l.x/c.x,h=l.y/c.y,f=t?Math.max(d,h):Math.min(d,h);return n=this.getScaleZoom(f,n),u&&(n=Math.round(n/(u/100))*(u/100),n=t?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(i,Math.min(o,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new R(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var r=this._getTopLeftPoint(e,t);return new z(r,r.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var r=this.options.crs;return t=void 0===t?this._zoom:t,r.scale(e)/r.scale(t)},getScaleZoom:function(e,t){var r=this.options.crs;t=void 0===t?this._zoom:t;var n=r.zoom(e*r.scale(t));return isNaN(n)?1/0:n},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(V(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(D(e),t)},layerPointToLatLng:function(e){var t=D(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(V(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(V(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(B(e))},distance:function(e,t){return this.options.crs.distance(V(e),V(t))},containerPointToLayerPoint:function(e){return D(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return D(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(D(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(V(e)))},mouseEventToContainerPoint:function(e){return Jt(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=ft(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");Bt(t,"scroll",this._onScroll,this),this._containerId=a(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ne.any3d,xt(e,"leaflet-container"+(Ne.touch?" leaflet-touch":"")+(Ne.retina?" leaflet-retina":"")+(Ne.ielt9?" leaflet-oldie":"")+(Ne.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=pt(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pt(this._mapPane,new R(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(xt(e.markerPane,"leaflet-zoom-hide"),xt(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,r){Pt(this._mapPane,new R(0,0));var n=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var i=this._zoom!==t;this._moveStart(i,r)._move(e,t)._moveEnd(i),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,r,n){void 0===t&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),n?r&&r.pinch&&this.fire("zoom",r):((i||r&&r.pinch)&&this.fire("zoom",r),this.fire("move",r)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return I(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Pt(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[a(this._container)]=this;var t=e?Vt:Bt;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),Ne.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){I(this._resizeRequest),this._resizeRequest=T((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var r,n=[],i="mouseout"===t||"mouseover"===t,o=e.target||e.srcElement,s=!1;o;){if((r=this._targets[a(o)])&&("click"===t||"preclick"===t)&&this._draggableMoved(r)){s=!0;break}if(r&&r.listens(t,!0)){if(i&&!tr(o,e))break;if(n.push(r),i)break}if(o===this._container)break;o=o.parentNode}return n.length||s||i||!this.listens(t,!0)||(n=[this]),n},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isCl
vendor: 1,885 bytes, line 6
6ickDisabled(t))){var r=e.type;"mousedown"===r&&Ot(t),this._fireDOMEvent(e,r)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,t,n){if("click"===e.type){var i=r({},e);i.type="preclick",this._fireDOMEvent(i,i.type,n)}var o=this._findEventTargets(e,t);if(n){for(var a=[],s=0;s<n.length;s++)n[s].listens(t,!0)&&a.push(n[s]);o=a.concat(o)}if(o.length){"contextmenu"===t&&Yt(e);var l=o[0],c={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var u=l.getLatLng&&(!l._radius||l._radius<=10);c.containerPoint=u?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(e),c.layerPoint=this.containerPointToLayerPoint(c.containerPoint),c.latlng=u?l.getLatLng():this.layerPointToLatLng(c.layerPoint)}for(s=0;s<o.length;s++)if(o[s].fire(t,c,!0),c.originalEvent._stopped||!1===o[s].options.bubblingMouseEvents&&-1!==_(this._mouseEvents,t))return}},_draggableMoved:function(e){return(e=e.dragging&&e.dragging.enabled()?e:this).dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on("load",e,t),this},_getMapPanePos:function(){return At(this._mapPane)||new R(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&void 0!==t?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var r=this.getSize()._divideBy(2);return this.project(e,t)._subtract(r)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,r){var n=this._getNewPixelOrigin(r,t);return this.project(e,t)._subtract(n)},_latLngBoundsToNewLayerBounds:function(e,t,r){var n=this._getNewPixelOrigin(r,t);
vendor: 103,909 bytes, line 6
6return F([this.project(e.getSouthWest(),t)._subtract(n),this.project(e.getNorthWest(),t)._subtract(n),this.project(e.getSouthEast(),t)._subtract(n),this.project(e.getNorthEast(),t)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,r){if(!r)return e;var n=this.project(e,t),i=this.getSize().divideBy(2),o=new z(n.subtract(i),n.add(i)),a=this._getBoundsOffset(o,r,t);return Math.abs(a.x)<=1&&Math.abs(a.y)<=1?e:this.unproject(n.add(a),t)},_limitOffset:function(e,t){if(!t)return e;var r=this.getPixelBounds(),n=new z(r.min.add(e),r.max.add(e));return e.add(this._getBoundsOffset(n,t))},_getBoundsOffset:function(e,t,r){var n=F(this.project(t.getNorthEast(),r),this.project(t.getSouthWest(),r)),i=n.min.subtract(e.min),o=n.max.subtract(e.max);return new R(this._rebound(i.x,-o.x),this._rebound(i.y,-o.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),r=this.getMaxZoom(),n=Ne.any3d?this.options.zoomSnap:1;return n&&(e=Math.round(e/n)*n),Math.max(t,Math.min(r,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){wt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var r=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(r)||(this.panBy(r,t),0))},_createAnimProxy:function(){var e=this._proxy=gt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",(function(e){var t=ut,r=this._proxy.style[t];Et(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),r===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){mt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Et(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,r){if(this._animatingZoom)return!0;if(r=r||{},!this._zoomAnimated||!1===r.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/n);return!(!0!==r.animate&&!this.getSize().contains(i)||(T((function(){this._moveStart(!0,r.noMoveStart||!1)._animateZoom(e,t,!0)}),this),0))},_animateZoom:function(e,t,r,n){this._mapPane&&(r&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,xt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&wt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function or(e,t){return new ir(e,t)}var ar=E.extend({options:{position:"topright"},initialize:function(e){f(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),r=this.getPosition(),n=e._controlCorners[r];return xt(t,"leaflet-control"),-1!==r.indexOf("bottom")?n.insertBefore(t,n.firstChild):n.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(mt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),sr=function(e){return new ar(e)};ir.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",r=this._controlContainer=gt("div",t+"control-container",this._container);function n(n,i){var o=t+n+" "+t+i;e[n+i]=gt("div",o,r)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)mt(this._controlCorners[e]);mt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var lr=ar.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,r,n){return r<n?-1:n<r?1:0}},initialize:function(e,t,r){for(var n in f(this,r),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[n],n);for(n in t)this._addLayer(t[n],n,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return ar.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var t=this._getLayer(a(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){xt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(xt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):wt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return wt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=gt("div",e),r=this.options.collapsed;t.setAttribute("aria-haspopup",!0),Zt(t),Wt(t);var n=this._section=gt("section",e+"-list");r&&(this._map.on("click",this.collapse,this),Bt(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var i=this._layersLink=gt("a",e+"-toggle",t);i.href="#",i.title="Layers",i.setAttribute("role","button"),Bt(i,{keydown:function(e){13===e.keyCode&&this._expandSafely()},click:function(e){Yt(e),this._expandSafely()}},this),r||this.expand(),this._baseLayersList=gt("div",e+"-base",n),this._separator=gt("div",e+"-separator",n),this._overlaysList=gt("div",e+"-overlays",n),t.appendChild(n)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&a(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,r){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:r}),this.options.sortLayers&&this._layers.sort(i((function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)}),this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;yt(this._baseLayersList),yt(this._overlaysList),this._layerControlInputs=[];var e,t,r,n,i=0;for(r=0;r<this._layers.length;r++)n=this._layers[r],this._addItem(n),t=t||n.overlay,e=e||!n.overlay,i+=n.overlay?0:1;return this.options.hideSingleBase&&(e=e&&i>1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(a(e.target)),r=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;r&&this._map.fire(r,t)},_createRadioElement:function(e,t){var r='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=r,n.firstChild},_addItem:function(e){var t,r=document.createElement("label"),n=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=n):t=this._createRadioElement("leaflet-base-layers_"+a(this),n),this._layerControlInputs.push(t),t.layerId=a(e.layer),Bt(t,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+e.name;var o=document.createElement("span");return r.appendChild(o),o.appendChild(t),o.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(r),this._checkDisabledLayers(),r},_onInputClick:function(){if(!this._preventClick){var e,t,r=this._layerControlInputs,n=[],i=[];this._handlingClick=!0;for(var o=r.length-1;o>=0;o--)e=r[o],t=this._getLayer(e.layerId).layer,e.checked?n.push(t):e.checked||i.push(t);for(o=0;o<i.length;o++)this._map.hasLayer(i[o])&&this._map.removeLayer(i[o]);for(o=0;o<n.length;o++)this._map.hasLayer(n[o])||this._map.addLayer(n[o]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e,t,r=this._layerControlInputs,n=this._map.getZoom(),i=r.length-1;i>=0;i--)e=r[i],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&n<t.options.minZoom||void 0!==t.options.maxZoom&&n>t.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Bt(e,"click",Yt),this.expand();var t=this;setTimeout((function(){Vt(e,"click",Yt),t._preventClick=!1}))}}),cr=function(e,t,r){return new lr(e,t,r)},ur=ar.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",r=gt("div",t+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,t+"-in",r,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,t+"-out",r,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),r},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,r,n,i){var o=gt("a",r,n);return o.innerHTML=e,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),Zt(o),Bt(o,"click",Xt),Bt(o,"click",i,this),Bt(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";wt(this._zoomInButton,t),wt(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(xt(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(xt(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});ir.mergeOptions({zoomControl:!0}),ir.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ur,this.addControl(this.zoomControl))}));var dr=function(e){return new ur(e)},hr=ar.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",r=gt("div",t),n=this.options;return this._addScales(n,t+"-line",r),e.on(n.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),r},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,r){e.metric&&(this._mScale=gt("div",t,r)),e.imperial&&(this._iScale=gt("div",t,r))},_update:function(){var e=this._map,t=e.getSize().y/2,r=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(r)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),r=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,r,t/e)},_updateImperial:function(e){var t,r,n,i=3.2808399*e;i>5280?(t=i/5280,r=this._getRoundNum(t),this._updateScale(this._iScale,r+" mi",r/t)):(n=this._getRoundNum(i),this._updateScale(this._iScale,n+" ft",n/i))},_updateScale:function(e,t,r){e.style.width=Math.round(this.options.maxWidth*r)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),r=e/t;return t*(r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1)}}),fr=function(e){return new hr(e)},pr='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',gr=ar.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ne.inlineSvg?pr+" ":"")+"Leaflet</a>"},initialize:function(e){f(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=gt("div","leaflet-control-attribution"),Zt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",(function(){this.removeAttribution(e.layer.getAttribution())}),this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var r=[];this.options.prefix&&r.push(this.options.prefix),e.length&&r.push(e.join(", ")),this._container.innerHTML=r.join(' <span aria-hidden="true">|</span> ')}}});ir.mergeOptions({attributionControl:!0}),ir.addInitHook((function(){this.options.attributionControl&&(new gr).addTo(this)}));var mr=function(e){return new gr(e)};ar.Layers=lr,ar.Zoom=ur,ar.Scale=hr,ar.Attribution=gr,sr.layers=cr,sr.zoom=dr,sr.scale=fr,sr.attribution=mr;var yr=E.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});yr.addTo=function(e,t){return e.addHandler(t,this),this};var _r={Events:A},vr=Ne.touch?"touchstart mousedown":"mousedown",br=C.extend({options:{clickTolerance:3},initialize:function(e,t,r,n){f(this,n),this._element=e,this._dragStartTarget=t||e,this._preventOutline=r},enable:function(){this._enabled||(Bt(this._dragStartTarget,vr,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(br._dragging===this&&this.finishDrag(!0),Vt(this._dragStartTarget,vr,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!bt(this._element,"leaflet-zoom-anim")))if(e.touches&&1!==e.touches.length)br._dragging===this&&this.finishDrag();else if(!(br._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches||(br._dragging=this,this._preventOutline&&Ot(this._element),Rt(),ot(),this._moving))){this.fire("down");var t=e.touches?e.touches[0]:e,r=zt(this._element);this._startPoint=new R(t.clientX,t.clientY),this._startPos=At(this._element),this._parentScale=Ft(r);var n="mousedown"===e.type;Bt(document,n?"mousemove":"touchmove",this._onMove,this),Bt(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(e){if(this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,r=new R(t.clientX,t.clientY)._subtract(this._startPoint);(r.x||r.y)&&(Math.abs(r.x)+Math.abs(r.y)<this.options.clickTolerance||(r.x/=this._parentScale.x,r.y/=this._parentScale.y,Yt(e),this._moved||(this.fire("dragstart"),this._moved=!0,xt(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),xt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(r),this._moving=!0,this._lastEvent=e,this._updatePosition()))}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),Pt(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){wt(document.body,"leaflet-dragging"),this._lastTarget&&(wt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Vt(document,"mousemove touchmove",this._onMove,this),Vt(document,"mouseup touchend touchcancel",this._onUp,this),Lt(),at();var t=this._moved&&this._moving;this._moving=!1,br._dragging=!1,t&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function xr(e,t,r){var n,i,o,a,s,l,c,u,d,h=[1,4,2,8];for(i=0,c=e.length;i<c;i++)e[i]._code=Or(e[i],t);for(a=0;a<4;a++){for(u=h[a],n=[],i=0,o=(c=e.length)-1;i<c;o=i++)s=e[i],l=e[o],s._code&u?l._code&u||((d=Lr(l,s,u,t,r))._code=Or(d,t),n.push(d)):(l._code&u&&((d=Lr(l,s,u,t,r))._code=Or(d,t),n.push(d)),n.push(s));e=n}return e}function wr(e,t){var r,n,i,o,a,s,l,c,u;if(!e||0===e.length)throw new Error("latlngs not passed");Fr(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var d=V([0,0]),h=B(e);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(d=Sr(e));var f=e.length,p=[];for(r=0;r<f;r++){var g=V(e[r]);p.push(t.project(V([g.lat-d.lat,g.lng-d.lng])))}for(s=l=c=0,r=0,n=f-1;r<f;n=r++)i=p[r],o=p[n],a=i.y*o.x-o.y*i.x,l+=(i.x+o.x)*a,c+=(i.y+o.y)*a,s+=3*a;u=0===s?p[0]:[l/s,c/s];var m=t.unproject(D(u));return V([m.lat+d.lat,m.lng+d.lng])}function Sr(e){for(var t=0,r=0,n=0,i=0;i<e.length;i++){var o=V(e[i]);t+=o.lat,r+=o.lng,n++}return V([t/n,r/n])}var kr,Tr={__proto__:null,clipPolygon:xr,polygonCenter:wr,centroid:Sr};function Ir(e,t){if(!t||!e.length)return e.slice();var r=t*t;return e=Pr(e=Cr(e,r),r)}function Mr(e,t,r){return Math.sqrt(zr(e,t,r,!0))}function Er(e,t,r){return zr(e,t,r)}function Pr(e,t){var r=e.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(r);n[0]=n[r-1]=1,Ar(e,n,t,0,r-1);var i,o=[];for(i=0;i<r;i++)n[i]&&o.push(e[i]);return o}function Ar(e,t,r,n,i){var o,a,s,l=0;for(a=n+1;a<=i-1;a++)(s=zr(e[a],e[n],e[i],!0))>l&&(o=a,l=s);l>r&&(t[o]=1,Ar(e,t,r,n,o),Ar(e,t,r,o,i))}function Cr(e,t){for(var r=[e[0]],n=1,i=0,o=e.length;n<o;n++)Dr(e[n],e[i])>t&&(r.push(e[n]),i=n);return i<o-1&&r.push(e[o-1]),r}function Rr(e,t,r,n,i){var o,a,s,l=n?kr:Or(e,r),c=Or(t,r);for(kr=c;;){if(!(l|c))return[e,t];if(l&c)return!1;s=Or(a=Lr(e,t,o=l||c,r,i),r),o===l?(e=a,l=s):(t=a,c=s)}}function Lr(e,t,r,n,i){var o,a,s=t.x-e.x,l=t.y-e.y,c=n.min,u=n.max;return 8&r?(o=e.x+s*(u.y-e.y)/l,a=u.y):4&r?(o=e.x+s*(c.y-e.y)/l,a=c.y):2&r?(o=u.x,a=e.y+l*(u.x-e.x)/s):1&r&&(o=c.x,a=e.y+l*(c.x-e.x)/s),new R(o,a,i)}function Or(e,t){var r=0;return e.x<t.min.x?r|=1:e.x>t.max.x&&(r|=2),e.y<t.min.y?r|=4:e.y>t.max.y&&(r|=8),r}function Dr(e,t){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n}function zr(e,t,r,n){var i,o=t.x,a=t.y,s=r.x-o,l=r.y-a,c=s*s+l*l;return c>0&&((i=((e.x-o)*s+(e.y-a)*l)/c)>1?(o=r.x,a=r.y):i>0&&(o+=s*i,a+=l*i)),s=e.x-o,l=e.y-a,n?s*s+l*l:new R(o,a)}function Fr(e){return!y(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function Nr(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Fr(e)}function Br(e,t){var r,n,i,o,a,s,l,c;if(!e||0===e.length)throw new Error("latlngs not passed");Fr(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var u=V([0,0]),d=B(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(u=Sr(e));var h=e.length,f=[];for(r=0;r<h;r++){var p=V(e[r]);f.push(t.project(V([p.lat-u.lat,p.lng-u.lng])))}for(r=0,n=0;r<h-1;r++)n+=f[r].distanceTo(f[r+1])/2;if(0===n)c=f[0];else for(r=0,o=0;r<h-1;r++)if(a=f[r],s=f[r+1],(o+=i=a.distanceTo(s))>n){l=(o-n)/i,c=[s.x-l*(s.x-a.x),s.y-l*(s.y-a.y)];break}var g=t.unproject(D(c));return V([g.lat+u.lat,g.lng+u.lng])}var jr={__proto__:null,simplify:Ir,pointToSegmentDistance:Mr,closestPointOnSegment:Er,clipSegment:Rr,_getEdgeIntersection:Lr,_getBitCode:Or,_sqClosestPointOnSegment:zr,isFlat:Fr,_flat:Nr,polylineCenter:Br},Vr={project:function(e){return new R(e.lng,e.lat)},unproject:function(e){return new j(e.y,e.x)},bounds:new z([-180,-90],[180,90])},Gr={R:6378137,R_MINOR:6356752.314245179,bounds:new z([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,r=this.R,n=e.lat*t,i=this.R_MINOR/r,o=Math.sqrt(1-i*i),a=o*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-a)/(1+a),o/2);return n=-r*Math.log(Math.max(s,1e-10)),new R(e.lng*t*r,n)},unproject:function(e){for(var t,r=180/Math.PI,n=this.R,i=this.R_MINOR/n,o=Math.sqrt(1-i*i),a=Math.exp(-e.y/n),s=Math.PI/2-2*Math.atan(a),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)t=o*Math.sin(s),t=Math.pow((1-t)/(1+t),o/2),s+=c=Math.PI/2-2*Math.atan(a*t)-s;return new j(s*r,e.x*r/n)}},Ur={__proto__:null,LonLat:Vr,Mercator:Gr,SphericalMercator:q},$r=r({},$,{code:"EPSG:3395",projection:Gr,transformation:function(){var e=.5/(Math.PI*Gr.R);return Z(e,.5,-e,.5)}()}),Hr=r({},$,{code:"EPSG:4326",projection:Vr,transformation:Z(1/180,1,-1/180,.5)}),qr=r({},U,{projection:Vr,transformation:Z(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var r=t.lng-e.lng,n=t.lat-e.lat;return Math.sqrt(r*r+n*n)},infinite:!0});U.Earth=$,U.EPSG3395=$r,U.EPSG3857=Y,U.EPSG900913=X,U.EPSG4326=Hr,U.Simple=qr;var Wr=C.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[a(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[a(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var r=this.getEvents();t.on(r,this),this.once("remove",(function(){t.off(r,this)}),this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});ir.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=a(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=a(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return a(e)in this._layers},eachLayer:function(e,t){for(var r in this._layers)e.call(t,this._layers[r]);return this},_addLayers:function(e){for(var t=0,r=(e=e?y(e)?e:[e]:[]).length;t<r;t++)this.addLayer(e[t])},_addZoomLimit:function(e){isNaN(e.options.maxZoom)&&isNaN(e.options.minZoom)||(this._zoomBoundLayers[a(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=a(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,r=this._getZoomSpan();for(var n in this._zoomBoundLayers){var i=this._zoomBoundLayers[n].options;e=void 0===i.minZoom?e:Math.min(e,i.minZoom),t=void 0===i.maxZoom?t:Math.max(t,i.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,r!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Zr=Wr.extend({initialize:function(e,t){var r,n;if(f(this,t),this._layers={},e)for(r=0,n=e.length;r<n;r++)this.addLayer(e[r])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return("number"==typeof e?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t,r,n=Array.prototype.slice.call(arguments,1);for(t in this._layers)(r=this._layers[t])[e]&&r[e].apply(r,n);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var r in this._layers)e.call(t,this._layers[r]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return a(e)}}),Yr=function(e,t){return new Zr(e,t)},Xr=Zr.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),Zr.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),Zr.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new N;for(var t in this._layers){var r=this._layers[t];e.extend(r.getBounds?r.getBounds():r.getLatLng())}return e}}),Kr=function(e,t){return new Xr(e,t)},Jr=E.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){f(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var r=this._getIconUrl(e);if(!r){if("icon"===e)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(r,t&&"IMG"===t.tagName?t:null);return this._setIconStyles(n,e),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n},_setIconStyles:function(e,t){var r=this.options,n=r[t+"Size"];"number"==typeof n&&(n=[n,n]);var i=D(n),o=D("shadow"===t&&r.shadowAnchor||r.iconAnchor||i&&i.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+(r.className||""),o&&(e.style.marginLeft=-o.x+"px",e.style.marginTop=-o.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e,t){return(t=t||document.createElement("img")).src=e,t},_getIconUrl:function(e){return Ne.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}});function Qr(e){return new Jr(e)}var en=Jr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return"string"!=typeof en.imagePath&&(en.imagePath=this._detectIconPath()),(this.options.imagePath||en.imagePath)+Jr.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,r){var n=t.exec(e);return n&&n[r]};return(e=t(e,/^url\((['"])?(.+)\1\)$/,2))&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=gt("div","leaflet-default-icon-path",document.body),t=pt(e,"background-image")||pt(e,"backgroundImage");if(document.body.removeChild(e),t=this._stripUrl(t))return t;var r=document.querySelector('link[href$="leaflet.css"]');return r?r.href.substring(0,r.href.length-11-1):""}}),tn=yr.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new br(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),xt(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&wt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,r=t._map,n=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,o=At(t._icon),a=r.getPixelBounds(),s=r.getPixelOrigin(),l=F(a.min._subtract(s).add(i),a.max._subtract(s).subtract(i));if(!l.contains(o)){var c=D((Math.max(l.max.x,o.x)-l.max.x)/(a.max.x-l.max.x)-(Math.min(l.min.x,o.x)-l.min.x)/(a.min.x-l.min.x),(Math.max(l.max.y,o.y)-l.max.y)/(a.max.y-l.max.y)-(Math.min(l.min.y,o.y)-l.min.y)/(a.min.y-l.min.y)).multiplyBy(n);r.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),Pt(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=T(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(I(this._panRequest),this._panRequest=T(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,r=t._shadow,n=At(t._icon),i=t._map.layerPointToLatLng(n);r&&Pt(r,n),t._latlng=i,e.latlng=i,e.oldLatLng=this._oldLatLng,t.fire("move",e).fire("drag",e)},_onDragEnd:function(e){I(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),rn=Wr.extend({options:{icon:new en,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){f(this,t),this._latlng=V(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=V(e),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),r=e.icon.createIcon(this._icon),n=!1;r!==this._icon&&(this._icon&&this._removeIcon(),n=!0,e.title&&(r.title=e.title),"IMG"===r.tagName&&(r.alt=e.alt||"")),xt(r,t),e.keyboard&&(r.tabIndex="0",r.setAttribute("role","button")),this._icon=r,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Bt(r,"focus",this._panOnFocus,this);var i=e.icon.createShadow(this._shadow),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(xt(i,t),i.alt=""),this._shadow=i,e.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Vt(this._icon,"focus",this._panOnFocus,this),mt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&mt(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&Pt(this._icon,e),this._shadow&&Pt(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(xt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),tn)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new tn(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&Tt(this._icon,e),this._shadow&&Tt(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,r=t.iconSize?D(t.iconSize):D(0,0),n=t.iconAnchor?D(t.iconAnchor):D(0,0);e.panInside(this._latlng,{paddingTopLeft:n,paddingBottomRight:r.subtract(n)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function nn(e,t){return new rn(e,t)}var on=Wr.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return f(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),an=on.extend({options:{fill:!0,radius:10},initialize:function(e,t){f(this,t),this._latlng=V(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=V(e),this.redraw(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return on.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,r=this._clickTolerance(),n=[e+r,t+r];this._pxBounds=new z(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function sn(e,t){return new an(e,t)}var ln=an.extend({initialize:function(e,t,n){if("number"==typeof t&&(t=r({},n,{radius:t})),f(this,t),this._latlng=V(e),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:on.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,r=this._map,n=r.options.crs;if(n.distance===$.distance){var i=Math.PI/180,o=this._mRadius/$.R/i,a=r.project([t+o,e]),s=r.project([t-o,e]),l=a.add(s).divideBy(2),c=r.unproject(l).lat,u=Math.acos((Math.cos(o*i)-Math.sin(t*i)*Math.sin(c*i))/(Math.cos(t*i)*Math.cos(c*i)))/i;(isNaN(u)||0===u)&&(u=o/Math.cos(Math.PI/180*t)),this._point=l.subtract(r.getPixelOrigin()),this._radius=isNaN(u)?0:l.x-r.project([c,e-u]).x,this._radiusY=l.y-a.y}else{var d=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=r.latLngToLayerPoint(this._latlng),this._radius=this._point.x-r.latLngToLayerPoint(d).x}this._updateBounds()}});function cn(e,t,r){return new ln(e,t,r)}var un=on.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){f(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t,r,n=1/0,i=null,o=zr,a=0,s=this._parts.length;a<s;a++)for(var l=this._parts[a],c=1,u=l.length;c<u;c++){var d=o(e,t=l[c-1],r=l[c],!0);d<n&&(n=d,i=o(e,t,r))}return i&&(i.distance=Math.sqrt(n)),i},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Br(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=V(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new N,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return Fr(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],r=Fr(e),n=0,i=e.length;n<i;n++)r?(t[n]=V(e[n]),this._bounds.extend(t[n])):t[n]=this._convertLatLngs(e[n]);return t},_project:function(){var e=new z;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new R(e,e);this._rawPxBounds&&(this._pxBounds=new z([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,r){var n,i,o=e[0]instanceof j,a=e.length;if(o){for(i=[],n=0;n<a;n++)i[n]=this._map.latLngToLayerPoint(e[n]),r.extend(i[n]);t.push(i)}else for(n=0;n<a;n++)this._projectLatlngs(e[n],t,r)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else{var t,r,n,i,o,a,s,l=this._parts;for(t=0,n=0,i=this._rings.length;t<i;t++)for(r=0,o=(s=this._rings[t]).length;r<o-1;r++)(a=Rr(s[r],s[r+1],e,r,!0))&&(l[n]=l[n]||[],l[n].push(a[0]),a[1]===s[r+1]&&r!==o-2||(l[n].push(a[1]),n++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,r=0,n=e.length;r<n;r++)e[r]=Ir(e[r],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var r,n,i,o,a,s,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(r=0,o=this._parts.length;r<o;r++)for(n=0,i=(a=(s=this._parts[r]).length)-1;n<a;i=n++)if((t||0!==n)&&Mr(e,s[i],s[n])<=l)return!0;return!1}});function dn(e,t){return new un(e,t)}un._flat=Nr;var hn=un.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return wr(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=un.prototype._convertLatLngs.call(this,e),r=t.length;return r>=2&&t[0]instanceof j&&t[0].equals(t[r-1])&&t.pop(),t},_setLatLngs:function(e){un.prototype._setLatLngs.call(this,e),Fr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Fr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,r=new R(t,t);if(e=new z(e.min.subtract(r),e.max.add(r)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var n,i=0,o=this._rings.length;i<o;i++)(n=xr(this._rings[i],e,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t,r,n,i,o,a,s,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(i=0,s=this._parts.length;i<s;i++)for(o=0,a=(l=(t=this._parts[i]).length)-1;o<l;a=o++)r=t[o],n=t[a],r.y>e.y!=n.y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(c=!c);return c||un.prototype._containsPoint.call(this,e,!0)}});function fn(e,t){return new hn(e,t)}var pn=Xr.extend({initialize:function(e,t){f(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,r,n,i=y(e)?e:e.features;if(i){for(t=0,r=i.length;t<r;t++)((n=i[t]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var o=this.options;if(o.filter&&!o.filter(e))return this;var a=gn(e,o);return a?(a.feature=wn(e),a.defaultOptions=a.options,this.resetStyle(a),o.onEachFeature&&o.onEachFeature(e,a),this.addLayer(a)):this},resetStyle:function(e){return void 0===e?this.eachLayer(this.resetStyle,this):(e.options=r({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer((function(t){this._setLayerStyle(t,e)}),this)},_setLayerStyle:function(e,t){e.setStyle&&("function"==typeof t&&(t=t(e.feature)),e.setStyle(t))}});function gn(e,t){var r,n,i,o,a="Feature"===e.type?e.geometry:e,s=a?a.coordinates:null,l=[],c=t&&t.pointToLayer,u=t&&t.coordsToLatLng||yn;if(!s&&!a)return null;switch(a.type){case"Point":return mn(c,e,r=u(s),t);case"MultiPoint":for(i=0,o=s.length;i<o;i++)r=u(s[i]),l.push(mn(c,e,r,t));return new Xr(l);case"LineString":case"MultiLineString":return n=_n(s,"LineString"===a.type?0:1,u),new un(n,t);case"Polygon":case"MultiPolygon":return n=_n(s,"Polygon"===a.type?1:2,u),new hn(n,t);case"GeometryCollection":for(i=0,o=a.geometries.length;i<o;i++){var d=gn({geometry:a.geometries[i],type:"Feature",properties:e.properties},t);d&&l.push(d)}return new Xr(l);case"FeatureCollection":for(i=0,o=a.features.length;i<o;i++){var h=gn(a.features[i],t);h&&l.push(h)}return new Xr(l);default:throw new Error("Invalid GeoJSON object.")}}function mn(e,t,r,n){return e?e(t,r):new rn(r,n&&n.markersInheritOptions&&n)}function yn(e){return new j(e[1],e[0],e[2])}function _n(e,t,r){for(var n,i=[],o=0,a=e.length;o<a;o++)n=t?_n(e[o],t-1,r):(r||yn)(e[o]),i.push(n);return i}function vn(e,t){return void 0!==(e=V(e)).alt?[u(e.lng,t),u(e.lat,t),u(e.alt,t)]:[u(e.lng,t),u(e.lat,t)]}function bn(e,t,r,n){for(var i=[],o=0,a=e.length;o<a;o++)i.push(t?bn(e[o],Fr(e[o])?0:t-1,r,n):vn(e[o],n));return!t&&r&&i.length>0&&i.push(i[0].slice()),i}function xn(e,t){return e.feature?r({},e.feature,{geometry:t}):wn(t)}function wn(e){return"Feature"===e.type||"FeatureCollection"===e.type?e:{type:"Feature",properties:{},geometry:e}}var Sn={toGeoJSON:function(e){return xn(this,{type:"Point",coordinates:vn(this.getLatLng(),e)})}};function kn(e,t){return new pn(e,t)}rn.include(Sn),ln.include(Sn),an.include(Sn),un.include({toGeoJSON:function(e){var t=!Fr(this._latlngs);return xn(this,{type:(t?"Multi":"")+"LineString",coordinates:bn(this._latlngs,t?1:0,!1,e)})}}),hn.include({toGeoJSON:function(e){var t=!Fr(this._latlngs),r=t&&!Fr(this._latlngs[0]),n=bn(this._latlngs,r?2:t?1:0,!0,e);return t||(n=[n]),xn(this,{type:(r?"Multi":"")+"Polygon",coordinates:n})}}),Zr.include({toMultiPoint:function(e){var t=[];return this.eachLayer((function(r){t.push(r.toGeoJSON(e).geometry.coordinates)})),xn(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(e);var r="GeometryCollection"===t,n=[];return this.eachLayer((function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(r)n.push(i.geometry);else{var o=wn(i);"FeatureCollection"===o.type?n.push.apply(n,o.features):n.push(o)}}})),r?xn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Tn=kn,In=Wr.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,t,r){this._url=e,this._bounds=B(t),f(this,r)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(xt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){mt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&_t(this._image),this},bringToBack:function(){return this._map&&vt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=B(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e="IMG"===this._url.tagName,t=this._image=e?this._url:gt("img");xt(t,"leaflet-image-layer"),this._zoomAnimated&&xt(t,"leaflet-zoom-animated"),this.options.className&&xt(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onload=i(this.fire,this,"load"),t.onerror=i(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e?this._url=t.src:(t.src=this._url,t.alt=this.options.alt)},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),r=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Et(this._image,r,t)},_reset:function(){var e=this._image,t=new z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),r=t.getSize();Pt(e,t.min),e.style.width=r.x+"px",e.style.height=r.y+"px"},_updateOpacity:function(){Tt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Mn=function(e,t,r){return new In(e,t,r)},En=In.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e="VIDEO"===this._url.tagName,t=this._image=e?this._url:gt("video");if(xt(t,"leaflet-image-layer"),this._zoomAnimated&&xt(t,"leaflet-zoom-animated"),this.options.className&&xt(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onloadeddata=i(this.fire,this,"load"),e){for(var r=t.getElementsByTagName("source"),n=[],o=0;o<r.length;o++)n.push(r[o].src);this._url=r.length>0?n:[t.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var a=0;a<this._url.length;a++){var s=gt("source");s.src=this._url[a],t.appendChild(s)}}}});function Pn(e,t,r){return new En(e,t,r)}var An=In.extend({_initImage:function(){var e=this._image=this._url;xt(e,"leaflet-image-layer"),this._zoomAnimated&&xt(e,"leaflet-zoom-animated"),this.options.className&&xt(e,this.options.className),e.onselectstart=c,e.onmousemove=c}});function Cn(e,t,r){return new An(e,t,r)}var Rn=Wr.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,t){e&&(e instanceof j||y(e))?(this._latlng=V(e),f(this,t)):(f(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return(e=arguments.length?e:this._source._map).hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&Tt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&Tt(this._container,1),this.bringToFront(),this.options.interactive&&(xt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(Tt(this._container,0),this._removeTimeout=setTimeout(i(mt,void 0,this._container),200)):mt(this._container),this.options.interactive&&(wt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=V(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&_t(this._container),this},bringToBack:function(){return this._map&&vt(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof Xr){t=null;var r=this._source._layers;for(var n in r)if(r[n]._map){t=r[n];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else{if(!t.getBounds)throw new Error("Unable to get source layer LatLng.");e=t.getBounds().getCenter()}return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=D(this.options.offset),r=this._getAnchor();this._zoomAnimated?Pt(this._container,e.add(r)):t=t.add(e).add(r);var n=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=n+"px",this._container.style.left=i+"px"}},_getAnchor:function(){return[0,0]}});ir.include({_initOverlay:function(e,t,r,n){var i=t;return i instanceof e||(i=new e(n).setContent(t)),r&&i.setLatLng(r),i}}),Wr.include({_initOverlay:function(e,t,r,n){var i=r;return i instanceof e?(f(i,n),i._source=this):(i=t&&!n?t:new e(n,this)).setContent(r),i}});var Ln=Rn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return!(e=arguments.length?e:this._source._map).hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,Rn.prototype.openOn.call(this,e)},onAdd:function(e){Rn.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof on||this._source.on("preclick",qt))},onRemove:function(e){Rn.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof on||this._source.off("preclick",qt))},getEvents:function(){var e=Rn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",t=this._container=gt("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),r=this._wrapper=gt("div",e+"-content-wrapper",t);if(this._contentNode=gt("div",e+"-content",r),Zt(t),Wt(this._contentNode),Bt(t,"contextmenu",qt),this._tipContainer=gt("div",e+"-tip-container",t),this._tip=gt("div",e+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=gt("a",e+"-close-button",t);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">&#215;</span>',Bt(n,"click",(function(e){Yt(e),this.close()}),this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var r=e.offsetWidth;r=Math.min(r,this.options.maxWidth),r=Math.max(r,this.options.minWidth),t.width=r+1+"px",t.whiteSpace="",t.height="";var n=e.offsetHeight,i=this.options.maxHeight,o="leaflet-popup-scrolled";i&&n>i?(t.height=i+"px",xt(e,o)):wt(e,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),r=this._getAnchor();Pt(this._container,t.add(r))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var e=this._map,t=parseInt(pt(this._container,"marginBottom"),10)||0,r=this._container.offsetHeight+t,n=this._containerWidth,i=new R(this._containerLeft,-r-this._containerBottom);i._add(At(this._container));var o=e.layerPointToContainerPoint(i),a=D(this.options.autoPanPadding),s=D(this.options.autoPanPaddingTopLeft||a),l=D(this.options.autoPanPaddingBottomRight||a),c=e.getSize(),u=0,d=0;o.x+n+l.x>c.x&&(u=o.x+n-c.x+l.x),o.x-u-s.x<0&&(u=o.x-s.x),o.y+r+l.y>c.y&&(d=o.y+r-c.y+l.y),o.y-d-s.y<0&&(d=o.y-s.y),(u||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([u,d]))}},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),On=function(e,t){return new Ln(e,t)};ir.mergeOptions({closePopupOnClick:!0}),ir.include({openPopup:function(e,t,r){return this._initOverlay(Ln,e,t,r).openOn(this),this},closePopup:function(e){return(e=arguments.length?e:this._popup)&&e.close(),this}}),Wr.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Ln,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Xr||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){Xt(e);var t=e.layer||e.target;this._popup._source!==t||t instanceof on?(this._popup._source=t,this.openPopup(e.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var Dn=Rn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Rn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Rn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Rn.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=gt("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+a(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,r,n=this._map,i=this._container,o=n.latLngToContainerPoint(n.getCenter()),a=n.layerPointToContainerPoint(e),s=this.options.direction,l=i.offsetWidth,c=i.offsetHeight,u=D(this.options.offset),d=this._getAnchor();"top"===s?(t=l/2,r=c):"bottom"===s?(t=l/2,r=0):"center"===s?(t=l/2,r=c/2):"right"===s?(t=0,r=c/2):"left"===s?(t=l,r=c/2):a.x<o.x?(s="right",t=0,r=c/2):(s="left",t=l+2*(u.x+d.x),r=c/2),e=e.subtract(D(t,r,!0)).add(u).add(d),wt(i,"leaflet-tooltip-right"),wt(i,"leaflet-tooltip-left"),wt(i,"leaflet-tooltip-top"),wt(i,"leaflet-tooltip-bottom"),xt(i,"leaflet-tooltip-"+s),Pt(i,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&Tt(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),zn=function(e,t){return new Dn(e,t)};ir.include({openTooltip:function(e,t,r){return this._initOverlay(Dn,e,t,r).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),Wr.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Dn,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(e||!this._tooltipHandlersAdded){var t=e?"off":"on",r={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?r.add=this._openTooltip:(r.mouseover=this._openTooltip,r.mouseout=this.closeTooltip,r.click=this._openTooltip,this._map?this._addFocusListeners():r.add=this._addFocusListeners),this._tooltip.options.sticky&&(r.mousemove=this._moveTooltip),this[t](r),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Xr||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&(Bt(t,"focus",(function(){this._tooltip._source=e,this.openTooltip()}),this),Bt(t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once("moveend",(function(){t._openOnceFlag=!1,t._openTooltip(e)}))}else this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)},_moveTooltip:function(e){var t,r,n=e.latlng;this._tooltip.options.sticky&&e.originalEvent&&(t=this._map.mouseEventToContainerPoint(e.originalEvent),r=this._map.containerPointToLayerPoint(t),n=this._map.layerPointToLatLng(r)),this._tooltip.setLatLng(n)}});var Fn=Jr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var t=e&&"DIV"===e.tagName?e:document.createElement("div"),r=this.options;if(r.html instanceof Element?(yt(t),t.appendChild(r.html)):t.innerHTML=!1!==r.html?r.html:"",r.bgPos){var n=D(r.bgPos);t.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});function Nn(e){return new Fn(e)}Jr.Default=en;var Bn=Wr.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ne.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){f(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),mt(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(_t(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(vt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=s(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof R?e:new R(e,e)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t,r=this.getPane().children,n=-e(-1/0,1/0),i=0,o=r.length;i<o;i++)t=r[i].style.zIndex,r[i]!==this._container&&t&&(n=e(n,+t));isFinite(n)&&(this.options.zIndex=n+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ne.ielt9){Tt(this._container,this.options.opacity);var e=+new Date,t=!1,r=!1;for(var n in this._tiles){var i=this._tiles[n];if(i.current&&i.loaded){var o=Math.min(1,(e-i.loaded)/200);Tt(i.el,o),o<1?t=!0:(i.active?r=!0:this._onOpaqueTile(i),i.active=!0)}}r&&!this._noPrune&&this._pruneTiles(),t&&(I(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=gt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(void 0!==e){for(var r in this._levels)r=Number(r),this._levels[r].el.children.length||r===e?(this._levels[r].el.style.zIndex=t-Math.abs(e-r),this._onUpdateLevel(r)):(mt(this._levels[r].el),this._removeTilesAtZoom(r),this._onRemoveLevel(r),delete this._levels[r]);var n=this._levels[e],i=this._map;return n||((n=this._levels[e]={}).el=gt("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=t,n.origin=i.project(i.unproject(i.getPixelOrigin()),e).round(),n.zoom=e,this._setZoomTransform(n,i.getCenter(),i.getZoom()),c(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var e,t,r=this._map.getZoom();if(r>this.options.maxZoom||r<this.options.minZoom)this._removeAllTiles();else{for(e in this._tiles)(t=this._tiles[e]).retain=t.current;for(e in this._tiles)if((t=this._tiles[e]).current&&!t.active){var n=t.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)mt(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,r,n){var i=Math.floor(e/2),o=Math.floor(t/2),a=r-1,s=new R(+i,+o);s.z=+a;var l=this._tileCoordsToKey(s),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),a>n&&this._retainParent(i,o,a,n))},_retainChildren:function(e,t,r,n){for(var i=2*e;i<2*e+2;i++)for(var o=2*t;o<2*t+2;o++){var a=new R(i,o);a.z=r+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),r+1<n&&this._retainChildren(i,o,r+1,n))}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return void 0!==t.minNativeZoom&&e<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,r,n){var i=Math.round(t);i=void 0!==this.options.maxZoom&&i>this.options.maxZoom||void 0!==this.options.minZoom&&i<this.options.minZoom?void 0:this._clampZoom(i);var o=this.options.updateWhenZooming&&i!==this._tileZoom;n&&!o||(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==i&&this._update(e),r||this._pruneTiles(),this._noPrune=!!r),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var r in this._levels)this._setZoomTransform(this._levels[r],e,t)},_setZoomTransform:function(e,t,r){var n=this._map.getZoomScale(r,e.zoom),i=e.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(t,r)).round();Ne.any3d?Et(e.el,i,n):Pt(e.el,i)},_resetGrid:function(){var e=this._map,t=e.options.crs,r=this._tileSize=this.getTileSize(),n=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],n).x/r.x),Math.ceil(e.project([0,t.wrapLng[1]],n).x/r.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],n).y/r.x),Math.ceil(e.project([t.wrapLat[1],0],n).y/r.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(e){var t=this._map,r=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),n=t.getZoomScale(r,this._tileZoom),i=t.project(e,this._tileZoom).floor(),o=t.getSize().divideBy(2*n);return new z(i.subtract(o),i.add(o))},_update:function(e){var t=this._map;if(t){var r=this._clampZoom(t.getZoom());if(void 0===e&&(e=t.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(e),i=this._pxBoundsToTileRange(n),o=i.getCenter(),a=[],s=this.options.keepBuffer,l=new z(i.getBottomLeft().subtract([s,-s]),i.getTopRight().add([s,-s]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var u=this._tiles[c].coords;u.z===this._tileZoom&&l.contains(new R(u.x,u.y))||(this._tiles[c].current=!1)}if(Math.abs(r-this._tileZoom)>1)this._setView(e,r);else{for(var d=i.min.y;d<=i.max.y;d++)for(var h=i.min.x;h<=i.max.x;h++){var f=new R(h,d);if(f.z=this._tileZoom,this._isValidTile(f)){var p=this._tiles[this._tileCoordsToKey(f)];p?p.current=!0:a.push(f)}}if(a.sort((function(e,t){return e.distanceTo(o)-t.distanceTo(o)})),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(h=0;h<a.length;h++)this._addTile(a[h],g);this._level.el.appendChild(g)}}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var r=this._globalTileRange;if(!t.wrapLng&&(e.x<r.min.x||e.x>r.max.x)||!t.wrapLat&&(e.y<r.min.y||e.y>r.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(e);return B(this.options.bounds).overlaps(n)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,r=this.getTileSize(),n=e.scaleBy(r),i=n.add(r);return[t.unproject(n,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),r=new N(t[0],t[1]);return this.options.noWrap||(r=this._map.wrapLatLngBounds(r)),r},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),r=new R(+t[0],+t[1]);return r.z=+t[2],r},_removeTile:function(e){var t=this._tiles[e];t&&(mt(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){xt(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=c,e.onmousemove=c,Ne.ielt9&&this.options.opacity<1&&Tt(e,this.options.opacity)},_addTile:function(e,t){var r=this._getTilePos(e),n=this._tileCoordsToKey(e),o=this.createTile(this._wrapCoords(e),i(this._tileReady,this,e));this._initTile(o),this.createTile.length<2&&T(i(this._tileReady,this,e,null,o)),Pt(o,r),this._tiles[n]={el:o,coords:e,current:!0},t.appendChild(o),this.fire("tileloadstart",{tile:o,coords:e})},_tileReady:function(e,t,r){t&&this.fire("tileerror",{error:t,tile:r,coords:e});var n=this._tileCoordsToKey(e);(r=this._tiles[n])&&(r.loaded=+new Date,this._map._fadeAnimated?(Tt(r.el,0),I(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this)):(r.active=!0,this._pruneTiles()),t||(xt(r.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:r.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ne.ielt9||!this._map._fadeAnimated?T(this._pruneTiles,this):setTimeout(i(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new R(this._wrapX?l(e.x,this._wrapX):e.x,this._wrapY?l(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new z(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function jn(e){return new Bn(e)}var Vn=Bn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=f(this,t)).detectRetina&&Ne.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var r=document.createElement("img");return Bt(r,"load",i(this._tileOnLoad,this,t,r)),Bt(r,"error",i(this._tileOnError,this,t,r)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(r.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(r.referrerPolicy=this.options.referrerPolicy),r.alt="",r.src=this.getTileUrl(e),r},getTileUrl:function(e){var t={r:Ne.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=n),t["-y"]=n}return m(this._url,r(t,this.options))},_tileOnLoad:function(e,t){Ne.ielt9?setTimeout(i(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,r){var n=this.options.errorTileUrl;n&&t.getAttribute("src")!==n&&(t.src=n),e(r,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=c,t.onerror=c,!t.complete)){t.src=v;var r=this._tiles[e].coords;mt(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:r})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",v),Bn.prototype._removeTile.call(this,e)},_tileReady:function(e,t,r){if(this._map&&(!r||r.getAttribute("src")!==v))return Bn.prototype._tileReady.call(this,e,t,r)}});function Gn(e,t){return new Vn(e,t)}var Un=Vn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var n=r({},this.defaultWmsParams);for(var i in t)i in this.options||(n[i]=t[i]);var o=(t=f(this,t)).detectRetina&&Ne.retina?2:1,a=this.getTileSize();n.width=a.x*o,n.height=a.y*o,this.wmsParams=n},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,Vn.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),r=this._crs,n=F(r.project(t[0]),r.project(t[1])),i=n.min,o=n.max,a=(this._wmsVersion>=1.3&&this._crs===Hr?[i.y,i.x,o.y,o.x]:[i.x,i.y,o.x,o.y]).join(","),s=Vn.prototype.getTileUrl.call(this,e);return s+p(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(e,t){return r(this.wmsParams,e),t||this.redraw(),this}});function $n(e,t){return new Un(e,t)}Vn.WMS=Un,Gn.wms=$n;var Hn=Wr.extend({options:{padding:.1},initialize:function(e){f(this,e),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),xt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var r=this._map.getZoomScale(t,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),o=n.multiplyBy(-r).add(i).subtract(this._map._getNewPixelOrigin(e,t));Ne.any3d?Et(this._container,o,r):Pt(this._container,o)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),r=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new z(r,r.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),qn=Hn.extend({options:{tolerance:0},getEvents:function(){var e=Hn.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Hn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Bt(e,"mousemove",this._onMouseMove,this),Bt(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Bt(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){I(this._redrawRequest),delete this._ctx,mt(this._container),Vt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Hn.prototype._update.call(this);var e=this._bounds,t=this._container,r=e.getSize(),n=Ne.retina?2:1;Pt(t,e.min),t.width=n*r.x,t.height=n*r.y,t.style.width=r.x+"px",t.style.height=r.y+"px",Ne.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){Hn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[a(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,r=t.next,n=t.prev;r?r.prev=n:this._drawLast=n,n?n.next=r:this._drawFirst=r,delete e._order,delete this._layers[a(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,r,n=e.options.dashArray.split(/[, ]+/),i=[];for(r=0;r<n.length;r++){if(t=Number(n[r]),isNaN(t))return;i.push(t)}e.options._dashArray=i}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||T(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new z,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var r=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,r.x,r.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)e=n.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var r,n,i,o,a=e._parts,s=a.length,l=this._ctx;if(s){for(l.beginPath(),r=0;r<s;r++){for(n=0,i=a[r].length;n<i;n++)o=a[r][n],l[n?"lineTo":"moveTo"](o.x,o.y);t&&l.closePath()}this._fillStroke(l,e)}}},_updateCircle:function(e){if(this._drawing&&!e._empty()){var t=e._point,r=this._ctx,n=Math.max(Math.round(e._radius),1),i=(Math.max(Math.round(e._radiusY),1)||n)/n;1!==i&&(r.save(),r.scale(1,i)),r.beginPath(),r.arc(t.x,t.y/i,n,0,2*Math.PI,!1),1!==i&&r.restore(),this._fillStroke(r,e)}},_fillStroke:function(e,t){var r=t.options;r.fill&&(e.globalAlpha=r.fillOpacity,e.fillStyle=r.fillColor||r.color,e.fill(r.fillRule||"evenodd")),r.stroke&&0!==r.weight&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=r.opacity,e.lineWidth=r.weight,e.strokeStyle=r.color,e.lineCap=r.lineCap,e.lineJoin=r.lineJoin,e.stroke())},_onClick:function(e){for(var t,r,n=this._map.mouseEventToLayerPoint(e),i=this._drawFirst;i;i=i.next)(t=i.layer).options.interactive&&t._containsPoint(n)&&("click"!==e.type&&"preclick"!==e.type||!this._map._draggableMoved(t))&&(r=t);this._fireEvent(!!r&&[r],e)},_onMouseMove:function(e){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(wt(this._container,"leaflet-interactive"),this._fireEvent([t],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var r,n,o=this._drawFirst;o;o=o.next)(r=o.layer).options.interactive&&r._containsPoint(t)&&(n=r);n!==this._hoveredLayer&&(this._handleMouseOut(e),n&&(xt(this._container,"leaflet-interactive"),this._fireEvent([n],e,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],e),this._mouseHoverThrottled=!0,setTimeout(i((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(e,t,r){this._map._fireDOMEvent(t,r||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var r=t.next,n=t.prev;r&&(r.prev=n,n?n.next=r:r&&(this._drawFirst=r),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e))}},_bringToBack:function(e){var t=e._order;if(t){var r=t.next,n=t.prev;n&&(n.next=r,r?r.prev=n:n&&(this._drawLast=n),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e))}}});function Wn(e){return Ne.canvas?new qn(e):null}var Zn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Yn={_initContainer:function(){this._container=gt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Hn.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=Zn("shape");xt(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=Zn("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[a(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;mt(t),e.removeInteractiveTarget(t),delete this._layers[a(e)]},_updateStyle:function(e){var t=e._stroke,r=e._fill,n=e.options,i=e._container;i.stroked=!!n.stroke,i.filled=!!n.fill,n.stroke?(t||(t=e._stroke=Zn("stroke")),i.appendChild(t),t.weight=n.weight+"px",t.color=n.color,t.opacity=n.opacity,n.dashArray?t.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=n.lineCap.replace("butt","flat"),t.joinstyle=n.lineJoin):t&&(i.removeChild(t),e._stroke=null),n.fill?(r||(r=e._fill=Zn("fill")),i.appendChild(r),r.color=n.fillColor||n.color,r.opacity=n.fillOpacity):r&&(i.removeChild(r),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),r=Math.round(e._radius),n=Math.round(e._radiusY||r);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+r+","+n+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){_t(e._container)},_bringToBack:function(e){vt(e._container)}},Xn=Ne.vml?Zn:K,Kn=Hn.extend({_initContainer:function(){this._container=Xn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Xn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){mt(this._container),Vt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Hn.prototype._update.call(this);var e=this._bounds,t=e.getSize(),r=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,r.setAttribute("width",t.x),r.setAttribute("height",t.y)),Pt(r,e.min),r.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=Xn("path");e.options.className&&xt(t,e.options.className),e.options.interactive&&xt(t,"leaflet-interactive"),this._updateStyle(e),this._layers[a(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){mt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[a(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,r=e.options;t&&(r.stroke?(t.setAttribute("stroke",r.color),t.setAttribute("stroke-opacity",r.opacity),t.setAttribute("stroke-width",r.weight),t.setAttribute("stroke-linecap",r.lineCap),t.setAttribute("stroke-linejoin",r.lineJoin),r.dashArray?t.setAttribute("stroke-dasharray",r.dashArray):t.removeAttribute("stroke-dasharray"),r.dashOffset?t.setAttribute("stroke-dashoffset",r.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),r.fill?(t.setAttribute("fill",r.fillColor||r.color),t.setAttribute("fill-opacity",r.fillOpacity),t.setAttribute("fill-rule",r.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,J(e._parts,t))},_updateCircle:function(e){var t=e._point,r=Math.max(Math.round(e._radius),1),n="a"+r+","+(Math.max(Math.round(e._radiusY),1)||r)+" 0 1,0 ",i=e._empty()?"M0 0":"M"+(t.x-r)+","+t.y+n+2*r+",0 "+n+2*-r+",0 ";this._setPath(e,i)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){_t(e._path)},_bringToBack:function(e){vt(e._path)}});function Jn(e){return Ne.svg||Ne.vml?new Kn(e):null}Ne.vml&&Kn.include(Yn),ir.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Wn(e)||Jn(e)}});var Qn=hn.extend({initialize:function(e,t){hn.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=B(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function ei(e,t){return new Qn(e,t)}Kn.create=Xn,Kn.pointsToPath=J,pn.geometryToLayer=gn,pn.coordsToLatLng=yn,pn.coordsToLatLngs=_n,pn.latLngToCoords=vn,pn.latLngsToCoords=bn,pn.getFeature=xn,pn.asFeature=wn,ir.mergeOptions({boxZoom:!0});var ti=yr.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Bt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Vt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){mt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),ot(),Rt(),this._startPoint=this._map.mouseEventToContainerPoint(e),Bt(document,{contextmenu:Xt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=gt("div","leaflet-zoom-box",this._container),xt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new z(this._point,this._startPoint),r=t.getSize();Pt(this._box,t.min),this._box.style.width=r.x+"px",this._box.style.height=r.y+"px"},_finish:function(){this._moved&&(mt(this._box),wt(this._container,"leaflet-crosshair")),at(),Lt(),Vt(document,{contextmenu:Xt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(i(this._resetState,this),0);var t=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ir.addInitHook("addHandler","boxZoom",ti),ir.mergeOptions({doubleClickZoom:!0});var ri=yr.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,r=t.getZoom(),n=t.options.zoomDelta,i=e.originalEvent.shiftKey?r-n:r+n;"center"===t.options.doubleClickZoom?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});ir.addInitHook("addHandler","doubleClickZoom",ri),ir.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ni=yr.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new br(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}xt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){wt(this._map._container,"leaflet-grab"),wt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=B(this._map.options.maxBounds);this._offsetLimit=F(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,r=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(r),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),r=this._initialWorldOffset,n=this._draggable._newPos.x,i=(n-t+r)%e+t-r,o=(n+t+r)%e-t-r,a=Math.abs(i+r)<Math.abs(o+r)?i:o;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a},_onDragEnd:function(e){var t=this._map,r=t.options,n=!r.inertia||e.noInertia||this._times.length<2;if(t.fire("dragend",e),n)t.fire("moveend");else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),o=(this._lastTime-this._times[0])/1e3,a=r.easeLinearity,s=i.multiplyBy(a/o),l=s.distanceTo([0,0]),c=Math.min(r.inertiaMaxSpeed,l),u=s.multiplyBy(c/l),d=c/(r.inertiaDeceleration*a),h=u.multiplyBy(-d/2).round();h.x||h.y?(h=t._limitOffset(h,t.options.maxBounds),T((function(){t.panBy(h,{duration:d,easeLinearity:a,noMoveStart:!0,animate:!0})}))):t.fire("moveend")}}});ir.addInitHook("addHandler","dragging",ni),ir.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ii=yr.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),Bt(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Vt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,r=e.scrollTop||t.scrollTop,n=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(n,r)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var t,r,n=this._panKeys={},i=this.keyCodes;for(t=0,r=i.left.length;t<r;t++)n[i.left[t]]=[-1*e,0];for(t=0,r=i.right.length;t<r;t++)n[i.right[t]]=[e,0];for(t=0,r=i.down.length;t<r;t++)n[i.down[t]]=[0,e];for(t=0,r=i.up.length;t<r;t++)n[i.up[t]]=[0,-1*e]},_setZoomDelta:function(e){var t,r,n=this._zoomKeys={},i=this.keyCodes;for(t=0,r=i.zoomIn.length;t<r;t++)n[i.zoomIn[t]]=e;for(t=0,r=i.zoomOut.length;t<r;t++)n[i.zoomOut[t]]=-e},_addHooks:function(){Bt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Vt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t,r=e.keyCode,n=this._map;if(r in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(t=this._panKeys[r],e.shiftKey&&(t=D(t).multiplyBy(3)),n.options.maxBounds&&(t=n._limitOffset(D(t),n.options.maxBounds)),n.options.worldCopyJump){var i=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(t)));n.panTo(i)}else n.panBy(t)}else if(r in this._zoomKeys)n.setZoom(n.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[r]);else{if(27!==r||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Xt(e)}}});ir.addInitHook("addHandler","keyboard",ii),ir.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var oi=yr.extend({addHooks:function(){Bt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Vt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var t=er(e),r=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var n=Math.max(r-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(i(this._performZoom,this),n),Xt(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),r=this._map.options.zoomSnap||0;e._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),i=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,o=r?Math.ceil(i/r)*r:i,a=e._limitZoom(t+(this._delta>0?o:-o))-t;this._delta=0,this._startTime=null,a&&("center"===e.options.scrollWheelZoom?e.setZoom(t+a):e.setZoomAround(this._lastMousePos,t+a))}});ir.addInitHook("addHandler","scrollWheelZoom",oi);var ai=600;ir.mergeOptions({tapHold:Ne.touchNative&&Ne.safari&&Ne.mobile,tapTolerance:15});var si=yr.extend({addHooks:function(){Bt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Vt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new R(t.clientX,t.clientY),this._holdTimeout=setTimeout(i((function(){this._cancel(),this._isTapValid()&&(Bt(document,"touchend",Yt),Bt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))}),this),ai),Bt(document,"touchend touchcancel contextmenu",this._cancel,this),Bt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Vt(document,"touchend",Yt),Vt(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Vt(document,"touchend touchcancel contextmenu",this._cancel,this),Vt(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new R(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var r=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});r._simulated=!0,t.target.dispatchEvent(r)}});ir.addInitHook("addHandler","tapHold",si),ir.mergeOptions({touchZoom:Ne.touch,bounceAtZoomLimits:!0});var li=yr.extend({addHooks:function(){xt(this._map._container,"leaflet-touch-zoom"),Bt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){wt(this._map._container,"leaflet-touch-zoom"),Vt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var r=t.mouseEventToContainerPoint(e.touches[0]),n=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(r.add(n)._divideBy(2))),this._startDist=r.distanceTo(n),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),Bt(document,"touchmove",this._onTouchMove,this),Bt(document,"touchend touchcancel",this._onTouchEnd,this),Yt(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,r=t.mouseEventToContainerPoint(e.touches[0]),n=t.mouseEventToContainerPoint(e.touches[1]),o=r.distanceTo(n)/this._startDist;if(this._zoom=t.getScaleZoom(o,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&o<1||this._zoom>t.getMaxZoom()&&o>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var a=r._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===a.x&&0===a.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),I(this._animRequest);var s=i(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=T(s,this,!0),Yt(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,I(this._animRequest),Vt(document,"touchmove",this._onTouchMove,this),Vt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ir.addInitHook("addHandler","touchZoom",li),ir.BoxZoom=ti,ir.DoubleClickZoom=ri,ir.Drag=ni,ir.Keyboard=ii,ir.ScrollWheelZoom=oi,ir.TapHold=si,ir.TouchZoom=li,e.Bounds=z,e.Browser=Ne,e.CRS=U,e.Canvas=qn,e.Circle=ln,e.CircleMarker=an,e.Class=E,e.Control=ar,e.DivIcon=Fn,e.DivOverlay=Rn,e.DomEvent=rr,e.DomUtil=Nt,e.Draggable=br,e.Evented=C,e.FeatureGroup=Xr,e.GeoJSON=pn,e.GridLayer=Bn,e.Handler=yr,e.Icon=Jr,e.ImageOverlay=In,e.LatLng=j,e.LatLngBounds=N,e.Layer=Wr,e.LayerGroup=Zr,e.LineUtil=jr,e.Map=ir,e.Marker=rn,e.Mixin=_r,e.Path=on,e.Point=R,e.PolyUtil=Tr,e.Polygon=hn,e.Polyline=un,e.Popup=Ln,e.PosAnimation=nr,e.Projection=Ur,e.Rectangle=Qn,e.Re
vendor: 6,046 bytes, line 6
6nderer=Hn,e.SVG=Kn,e.SVGOverlay=An,e.TileLayer=Vn,e.Tooltip=Dn,e.Transformation=W,e.Util=M,e.VideoOverlay=En,e.bind=i,e.bounds=F,e.canvas=Wn,e.circle=cn,e.circleMarker=sn,e.control=sr,e.divIcon=Nn,e.extend=r,e.featureGroup=Kr,e.geoJSON=kn,e.geoJson=Tn,e.gridLayer=jn,e.icon=Qr,e.imageOverlay=Mn,e.latLng=V,e.latLngBounds=B,e.layerGroup=Yr,e.map=or,e.marker=nn,e.point=D,e.polygon=fn,e.polyline=dn,e.popup=On,e.rectangle=ei,e.setOptions=f,e.stamp=a,e.svg=Jn,e.svgOverlay=Cn,e.tileLayer=Gn,e.tooltip=zn,e.transformation=Z,e.version=t,e.videoOverlay=Pn;var ci=window.L;e.noConflict=function(){return window.L=ci,this},window.L=e}(t)},3495:(e,t,r)=>{"use strict";t.FractionOfSecondParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=30;parse(e,t){return(0,i.mapValue)((0,i.parseNDigits)(t.length,e),(e=>Math.trunc(e*Math.pow(10,3-t.length))))}set(e,t,r){return e.setMilliseconds(r),e}incompatibleTokens=["t","T"]}t.FractionOfSecondParser=o},3525:(e,t,r)=>{"use strict";t.formatters=void 0;var n=r(659),i=r(8926),o=r(9957),a=r(9639),s=r(6708),l=r(2554),c=r(8441);const u="midnight",d="noon",h="morning",f="afternoon",p="evening",g="night";t.formatters={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return r.ordinalNumber(n,{unit:"year"})}return c.lightFormatters.y(e,t)},Y:function(e,t,r,n){const i=(0,s.getWeekYear)(e,n),o=i>0?i:1-i;if("YY"===t){const e=o%100;return(0,l.addLeadingZeros)(e,2)}return"Yo"===t?r.ordinalNumber(o,{unit:"year"}):(0,l.addLeadingZeros)(o,t.length)},R:function(e,t){const r=(0,o.getISOWeekYear)(e);return(0,l.addLeadingZeros)(r,t.length)},u:function(e,t){const r=e.getFullYear();return(0,l.addLeadingZeros)(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return(0,l.addLeadingZeros)(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return(0,l.addLeadingZeros)(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return c.lightFormatters.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return(0,l.addLeadingZeros)(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=(0,a.getWeek)(e,n);return"wo"===t?r.ordinalNumber(i,{unit:"week"}):(0,l.addLeadingZeros)(i,t.length)},I:function(e,t,r){const n=(0,i.getISOWeek)(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):(0,l.addLeadingZeros)(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):c.lightFormatters.d(e,t)},D:function(e,t,r){const i=(0,n.getDayOfYear)(e);return"Do"===t?r.ordinalNumber(i,{unit:"dayOfYear"}):(0,l.addLeadingZeros)(i,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return(0,l.addLeadingZeros)(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return(0,l.addLeadingZeros)(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return(0,l.addLeadingZeros)(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(i=12===n?d:0===n?u:n/12>
6=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(i=n>=17?p:n>=12?f:n>=4?h:g,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return c.lightFormatters.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):c.lightFormatters.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):(0,l.addLeadingZeros)(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):(0,l.addLeadingZeros)(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):c.lightFormatters.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):c.lightFormatters.s(e,t)},S:function(e,t){return c.lightFormatters.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return y(n);case"XXXX":case"XX":return _(n);default:return _(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return y(n);case"xxxx":case"xx":return _(n);default:return _(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+m(n,":");default:return"GMT"+_(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+m(n,":");default:return"GMT"+_(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return(0,l.addLeadingZeros)(n,t.length)},T:function(e,t,r){return(0,l.addLeadingZeros)(+e,t.length)}};function m(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return 0===o?r+String(i):r+String(i)+t+(0,l.addLeadingZeros)(o,2)}function y(e,t){if(e%60==0){return(e>0?"-":"+")+(0,l.addLeadingZeros)(Math.abs(e)/60,2)}return _(e,t)}function _(e,t=""){const r=e>0?"-":"+",n=Math.abs(e);return r+(0,l.addLeadingZeros)(Math.trunc(n/60),2)+t+(0,l.addLeadingZeros)(n%60,2)}},3552:(e,t,r)=>{"use strict";t.startOfYesterday=function(e){const t=(0,n.constructNow)(e?.in),r=t.getFullYear(),i=t.getMonth(),o=t.getDate(),a=(0,n.constructNow)(e?.in);return a.setFullYear(r,i,o-1),a.setHours(0,0,0,0),a};var n=r(2700)},3561:(e,t,r)=>{"use strict";t.isSunday=function(e,t){return 0===(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},3570:(e,t,r)=>{"use strict";t.subBusinessDays=function(e,t,r){return(0,n.addBusinessDays)(e,-t,r)};var n=r(9941)},3587:(e,t,r)=>{"use strict";t.isThursday=function(e,t){return 4===(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},3614:e=>{function t(e,t,r){const n=new RegExp(t).exec(e.slice(r));return n?r+n.index:-1}e.exports=t,e.exports.default=t},3635:(e,t,r)=>{"use strict";t.set=function(e,t,r){let a=(0,o.toDate)(e,r?.in);if(isNaN(+a))return(0,n.constructFrom)(r?.in||e,NaN);null!=t.year&&a.setFullYear(t.year);null!=t.month&&(a=(0,i.setMonth)(a,t.month));null!=t.date&&a.setDate(t.date);null!=t.hours&&a.setHours(t.hours);null!=t.minutes&&a.setMinutes(t.minutes);null!=t.seconds&&a.setSeconds(t.seconds);null!=t.milliseconds&&a.setMilliseconds(t.milliseconds);return a};var n=r(2956),i=r(7035),o=r(4446)},3653:(e,t,r)=>{"use strict";t.AMPMMidnightParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=80;parse(e,t,r){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours((0,i.dayPeriodEnumToHours)(r),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}t.AMPMMidnightParser=o},3700:(e,t,r)=>{"use strict";t.eachDayOfInterval=function(e,t){const{start:r,end:o}=(0,n.normalizeInterval)(t?.in,e);let a=+r>+o;const s=a?+r:+o,l=a?o:r;l.setHours(0,0,0,0);let c=t?.step??1;if(!c)return[];c<0&&(c=-c,a=!a);const u=[];for(;+l<=s;)u.push((0,i.constructFrom)(r,l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return a?u.reverse():u};var n=r(5909),i=r(2956)},3724:(e,t,r)=>{"use strict";t.differenceInDays=function(e,t,r){const[a,s]=(0,n.normalizeDates)(r?.in,e,t),l=o(a,s),c=Math.abs((0,i.differenceInCalendarDays)(a,s));a.setDate(a.getDate()-l*c);const u=Number(o(a,s)===-l),d=l*(c-u);return 0===d?0:d};var n=r(8256),i=r(5506);function o(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}},3767:(e,t,r)=>{"use strict";t.previousSaturday=function(e,t){return(0,n.previousDay)(e,6,t)};var n=r(8092)},3771:(e,t,r)=>{"use strict";t.dayPeriodEnumToHours=function(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}},t.isLeapYearIndex=function(e){return e%400==0||e%4==0&&e%100!=0},t.mapValue=function(e,t){if(!e)return e;return{value:t(e.value),rest:e.rest}},t.normalizeTwoDigitYear=function(e,t){const r=t>0,n=r?t:1-t;let i;if(n<=50)i=e||100;else{const t=n+50;i=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return r?i:1-i},t.parseAnyDigitsSigned=function(e){return o(i.numericPatterns.anyDigitsSigned,e)},t.parseNDigits=function(e,t){switch(e){case 1:return o(i.numericPatterns.singleDigit,t);case 2:return o(i.numericPatterns.twoDigits,t);case 3:return o(i.numericPatterns.threeDigits,t);case 4:return o(i.numericPatterns.fourDigits,t);default:return o(new RegExp("^\\d{1,"+e+"}"),t)}},t.parseNDigitsSigned=function(e,t){switch(e){case 1:return o(i.numericPatterns.singleDigitSigned,t);case 2:return o(i.numericPatterns.twoDigitsSigned,t);case 3:return o(i.numericPatterns.threeDigitsSigned,t);case 4:return o(i.numericPatterns.fourDigitsSigned,t);default:return o(new RegExp("^-?\\d{1,"+e+"}"),t)}},t.parseNumericPattern=o,t.parseTimezonePattern=function(e,t){const r=t.match(e);if(!r)return null;if("Z"===r[0])return{value:0,rest:t.slice(1)};const i="+"===r[1]?1:-1,o=r[2]?parseInt(r[2],10):0,a=r[3]?parseInt(r[3],10):0,s=r[5]?parseInt(r[5],10):0;return{value:i*(o*n.millisecondsInHour+a*n.millisecondsInMinute+s*n.millisecondsInSecond),rest:t.slice(r[0].length)}};var n=r(8052),i=r(7699);function o(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}},3772:(e,t,r)=>{"use strict";t.formatDuration=function(e,t){const r=(0,i.getDefaultOptions)(),a=t?.locale??r.locale??n.defaultLocale,s=t?.format??o,l=t?.zero??!1,c=t?.delimiter??" ";if(!a.formatDistance)return"";return s.reduce(((t,r)=>{const n=`x${r.replace(/(^.)/,(e=>e.toUpperCase()))}`,i=e[r];return void 0!==i&&(l||e[r])?t.concat(a.formatDistance(n,i)):t}),[]).join(c)};var n=r(9577),i=r(6755);const o=["years","months","weeks","days","hours","minutes","seconds"]},3804:(e,t,r)=>{"use strict";t.isFirstDayOfMonth=function(e,t){return 1===(0,n.toDate)(e,t?.in).getDate()};var n=r(4446)},3806:(e,t,r)=>{"use strict";t.isTuesday=function(e,t){return 2===(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},3833:(e,t,r)=>{"use strict";t.isSameHour=function(e,t,r){const[o,a]=(0,n.normalizeDates)(r?.in,e,t);return+(0,i.startOfHour)(o)==+(0,i.startOfHour)(a)};var n=r(8256),i=r(5262)},3859:(e,t,r)=>{"use strict";t.nextSaturday=function(e,t){return(0,n.nextDay)(e,6,t)};var n=r(64)},3865:(e,t,r)=>{"use strict";
6Object.defineProperty(t,"__esModule",{value:!0}),t.safeIfNeeded=function(e){if(e[n.SymbolIterator]===n.NativeArrayPrototypeSymbolIterator&&n.ArrayIteratorPrototype.next===n.ArrayIteratorPrototypeNext)return e;const t=(0,n.ObjectCreate)(o);return(0,n.WeakMapPrototypeSet)(i,t,(0,n.ArrayPrototypeSymbolIterator)(e)),t},t.wrap=function(e){const t=(0,n.ObjectCreate)(s);return(0,n.WeakMapPrototypeSet)(a,t,e),t};var n=r(2628);const i=new n.NativeWeakMap,o=(0,n.ObjectCreate)(null,{next:{value:function(){const e=(0,n.WeakMapPrototypeGet)(i,this);return(0,n.ArrayIteratorPrototypeNext)(e)}},[n.SymbolIterator]:{value:function(){return this}}});const a=new n.NativeWeakMap,s=(0,n.ObjectCreate)(n.IteratorPrototype,{next:{value:function(){const e=(0,n.WeakMapPrototypeGet)(a,this);return(0,n.GeneratorPrototypeNext)(e)},writable:!0,configurable:!0}});for(const e of(0,n.ReflectOwnKeys)(n.ArrayIteratorPrototype))"next"!==e&&(0,n.ObjectDefineProperty)(s,e,(0,n.ReflectGetOwnPropertyDescriptor)(n.ArrayIteratorPrototype,e))},3937:(e,t,r)=>{"use strict";t.addMinutes=function(e,t,r){const o=(0,i.toDate)(e,r?.in);return o.setTime(o.getTime()+t*n.millisecondsInMinute),o};var n=r(8052),i=r(4446)},3972:(e,t,r)=>{"use strict";t.isWithinInterval=function(e,t,r){const i=+(0,n.toDate)(e,r?.in),[o,a]=[+(0,n.toDate)(t.start,r?.in),+(0,n.toDate)(t.end,r?.in)].sort(((e,t)=>e-t));return i>=o&&i<=a};var n=r(4446)},3975:(e,t,r)=>{"use strict";t.startOfToday=function(e){return(0,n.startOfDay)(Date.now(),e)};var n=r(8290)},3999:(e,t,r)=>{"use strict";t.endOfMinute=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setSeconds(59,999),r};var n=r(4446)},4042:(e,t,r)=>{"use strict";t.MinuteParser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=60;parse(e,t,r){switch(t){case"m":return(0,o.parseNumericPattern)(n.numericPatterns.minute,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setMinutes(r,0,0),e}incompatibleTokens=["t","T"]}t.MinuteParser=a},4073:(e,t,r)=>{"use strict";t.addWeeks=function(e,t,r){return(0,n.addDays)(e,7*t,r)};var n=r(7591)},4081:(e,t,r)=>{"use strict";t.isMonday=function(e,t){return 1===(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},4082:(e,t,r)=>{"use strict";t.transpose=function(e,t){const r=function(e){return"function"==typeof e&&e.prototype?.constructor===e}(t)?new t(0):(0,n.constructFrom)(t,0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r};var n=r(2956)},4086:e=>{"use strict";e.exports=function(e,t){return Object.keys(e).reduce((function(r,n){return r[n]=t(n,e[n]),r}),{})}},4180:(e,t,r)=>{"use strict";t.hoursToSeconds=function(e){return Math.trunc(e*n.secondsInHour)};var n=r(8052)},4184:(e,t,r)=>{"use strict";t.differenceInWeeks=function(e,t,r){const o=(0,i.differenceInDays)(e,t,r)/7;return(0,n.getRoundingMethod)(r?.roundingMethod)(o)};var n=r(1331),i=r(3724)},4251:(e,t,r)=>{"use strict";t.nextFriday=function(e,t){return(0,n.nextDay)(e,5,t)};var n=r(64)},4256:(e,t,r)=>{"use strict";var n=r(5914),i={};function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e){if(i[e])return i[e];var t=e.split("."),r=t[0],a=t[1];if(!a)throw new Error("Invalid token");var s=function(e){try{return JSON.parse(n.decode(e))}catch(e){throw new Error("Invalid token")}}(a),l={usage:r,user:s.u};return o(s,"a")&&(l.authorization=s.a),o(s,"exp")&&(l.expires=1e3*s.exp),o(s,"iat")&&(l.created=1e3*s.iat),o(s,"scopes")&&(l.scopes=s.scopes),o(s,"client")&&(l.client=s.client),o(s,"ll")&&(l.lastLogin=s.ll),o(s,"iu")&&(l.impersonator=s.iu),i[e]=l,l}},4266:(e,t,r)=>{"use strict";Object.defineProperty(t,"longFormatters",{enumerable:!0,get:function(){return i.longFormatters}}),t.parse=function(e,t,r,y){const _=()=>(0,a.constructFrom)(y?.in||r,NaN),v=(0,s.getDefaultOptions)(),b=y?.locale??v.locale??n.defaultLocale,x=y?.firstWeekContainsDate??y?.locale?.options?.firstWeekContainsDate??v.firstWeekContainsDate??v.locale?.options?.firstWeekContainsDate??1,w=y?.weekStartsOn??y?.locale?.options?.weekStartsOn??v.weekStartsOn??v.locale?.options?.weekStartsOn??0;if(!t)return e?_():(0,l.toDate)(r,y?.in);const S={firstWeekContainsDate:x,weekStartsOn:w,locale:b},k=[new c.DateTimezoneSetter(y?.in,r)],T=t.match(h).map((e=>{const t=e[0];if(t in i.longFormatters){return(0,i.longFormatters[t])(e,b.formatLong)}return e})).join("").match(d),I=[];for(let r of T){!y?.useAdditionalWeekYearTokens&&(0,o.isProtectedWeekYearToken)(r)&&(0,o.warnOrThrowProtectedError)(r,t,e),!y?.useAdditionalDayOfYearTokens&&(0,o.isProtectedDayOfYearToken)(r)&&(0,o.warnOrThrowProtectedError)(r,t,e);const n=r[0],i=u.parsers[n];if(i){const{incompatibleTokens:t}=i;if(Array.isArray(t)){const e=I.find((e=>t.includes(e.token)||e.token===n));
6if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${r}\` at the same time`)}else if("*"===i.incompatibleTokens&&I.length>0)throw new RangeError(`The format string mustn't contain \`${r}\` and any other token at the same time`);I.push({token:n,fullToken:r});const o=i.run(e,r,b.match,S);if(!o)return _();k.push(o.setter),e=o.rest}else{if(n.match(m))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===r?r="'":"'"===n&&(r=r.match(f)[1].replace(p,"'")),0!==e.indexOf(r))return _();e=e.slice(r.length)}}if(e.length>0&&g.test(e))return _();const M=k.map((e=>e.priority)).sort(((e,t)=>t-e)).filter(((e,t,r)=>r.indexOf(e)===t)).map((e=>k.filter((t=>t.priority===e)).sort(((e,t)=>t.subPriority-e.subPriority)))).map((e=>e[0]));let E=(0,l.toDate)(r,y?.in);if(isNaN(+E))return _();const P={};for(const e of M){if(!e.validate(E,S))return _();const t=e.set(E,P,S);Array.isArray(t)?(E=t[0],Object.assign(P,t[1])):E=t}return E},Object.defineProperty(t,"parsers",{enumerable:!0,get:function(){return u.parsers}});var n=r(9577),i=r(7083),o=r(2364),a=r(2956),s=r(6032),l=r(4446),c=r(7861),u=r(7568);const d=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,h=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,f=/^'([^]*?)'?$/,p=/''/g,g=/\S/,m=/[a-zA-Z]/},4280:(e,t,r)=>{"use strict";t.addMilliseconds=function(e,t,r){return(0,n.constructFrom)(r?.in||e,+(0,i.toDate)(e)+t)};var n=r(2956),i=r(4446)},4294:(e,t,r)=>{"use strict";t.differenceInISOWeekYears=function(e,t,r){const[s,l]=(0,n.normalizeDates)(r?.in,e,t),c=(0,i.compareAsc)(s,l),u=Math.abs((0,o.differenceInCalendarISOWeekYears)(s,l,r)),d=(0,a.subISOWeekYears)(s,c*u,r),h=Number((0,i.compareAsc)(d,l)===-c),f=c*(u-h);return 0===f?0:f};var n=r(8256),i=r(6789),o=r(2480),a=r(6322)},4317:(e,t,r)=>{"use strict";t.secondsToMilliseconds=function(e){return e*n.millisecondsInSecond};var n=r(8052)},4329:(e,t,r)=>{"use strict";r.d(t,{Ak:()=>n});let n=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},4337:(e,t)=>{"use strict";t.isDate=function(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}},4395:(e,t,r)=>{"use strict";t.setDay=function(e,t,r){const a=(0,n.getDefaultOptions)(),s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,l=(0,o.toDate)(e,r?.in),c=l.getDay(),u=(t%7+7)%7,d=7-s,h=t<0||t>6?t-(c+d)%7:(u+d)%7-(c+d)%7;return(0,i.addDays)(l,h,r)};var n=r(6755),i=r(7591),o=r(4446)},4400:(e,t,r)=>{"use strict";t.QuarterParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=120;parse(e,t,r){switch(t){case"Q":case"QQ":return(0,i.parseNDigits)(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}t.QuarterParser=o},4432:(e,t,r)=>{"use strict";t.minutesToHours=function(e){const t=e/n.minutesInHour;return Math.trunc(t)};var n=r(8052)},4437:(e,t)=>{"use strict";t.isExists=function(e,t,r){const n=new Date(e,t,r);return n.getFullYear()===e&&n.getMonth()===t&&n.getDate()===r}},4439:(e,t,r)=>{"use strict";t.isYesterday=function(e,t){return(0,o.isSameDay)((0,n.constructFrom)(t?.in||e,e),(0,a.subDays)((0,i.constructNow)(t?.in||e),1))};var n=r(2956),i=r(2700),o=r(9691),a=r(3224)},4446:(e,t,r)=>{"use strict";t.toDate=function(e,t){return(0,n.constructFrom)(t||e,e)};var n=r(2956)},4617:(e,t,r)=>{"use strict";t.setISOWeekYear=function(e,t,r){let s=(0,a.toDate)(e,r?.in);const l=(0,i.differenceInCalendarDays)(s,(0,o.startOfISOWeekYear)(s,r)),c=(0,n.constructFrom)(r?.in||e,0);return c.setFullYear(t,0,4),c.setHours(0,0,0,0),s=(0,o.startOfISOWeekYear)(c),s.setDate(s.getDate()+l),s};
6var n=r(2956),i=r(5506),o=r(1152),a=r(4446)},4638:(e,t,r)=>{"use strict";t.secondsToMinutes=function(e){const t=e/n.secondsInMinute;return Math.trunc(t)};var n=r(8052)},4650:(e,t,r)=>{"use strict";t.endOfISOWeek=function(e,t){return(0,n.endOfWeek)(e,{...t,weekStartsOn:1})};var n=r(1587)},4674:(e,t,r)=>{"use strict";t.areIntervalsOverlapping=function(e,t,r){const[i,o]=[+(0,n.toDate)(e.start,r?.in),+(0,n.toDate)(e.end,r?.in)].sort(((e,t)=>e-t)),[a,s]=[+(0,n.toDate)(t.start,r?.in),+(0,n.toDate)(t.end,r?.in)].sort(((e,t)=>e-t));return r?.inclusive?i<=s&&a<=o:i<s&&a<o};var n=r(4446)},4702:(e,t,r)=>{"use strict";t.interval=function(e,t,r){const[i,o]=(0,n.normalizeDates)(r?.in,e,t);if(isNaN(+i))throw new TypeError("Start date is invalid");if(isNaN(+o))throw new TypeError("End date is invalid");if(r?.assertPositive&&+i>+o)throw new TypeError("End date must be after start date");return{start:i,end:o}};var n=r(8256)},4729:(e,t,r)=>{"use strict";t.endOfISOWeekYear=function(e,t){const r=(0,i.getISOWeekYear)(e,t),a=(0,n.constructFrom)(t?.in||e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=(0,o.startOfISOWeek)(a,t);return s.setMilliseconds(s.getMilliseconds()-1),s};var n=r(2956),i=r(9957),o=r(6107)},4746:(e,t,r)=>{"use strict";t.differenceInCalendarWeeks=function(e,t,r){const[s,l]=(0,i.normalizeDates)(r?.in,e,t),c=(0,a.startOfWeek)(s,r),u=(0,a.startOfWeek)(l,r),d=+c-(0,n.getTimezoneOffsetInMilliseconds)(c),h=+u-(0,n.getTimezoneOffsetInMilliseconds)(u);return Math.round((d-h)/o.millisecondsInWeek)};var n=r(6339),i=r(8256),o=r(8052),a=r(5472)},4751:e=>{var t;t={},e.exports=t,t.simpleFilter=function(e,r){return r.filter((function(r){return t.test(e,r)}))},t.test=function(e,r){return null!==t.match(e,r)},t.match=function(e,t,r){r=r||{};var n,i=0,o=[],a=t.length,s=0,l=0,c=r.pre||"",u=r.post||"",d=r.caseSensitive&&t||t.toLowerCase();e=r.caseSensitive&&e||e.toLowerCase();for(var h=0;h<a;h++)n=t[h],d[h]===e[i]?(n=c+n+u,i+=1,l+=1+l):l=0,s+=l,o[o.length]=n;return i===e.length?(s=d===e?1/0:s,{rendered:o.join(""),score:s}):null},t.filter=function(e,r,n){return r&&0!==r.length?"string"!=typeof e?r:(n=n||{},r.reduce((function(r,i,o,a){var s=i;n.extract&&(s=n.extract(i));var l=t.match(e,s,n);return null!=l&&(r[r.length]={string:l.rendered,score:l.score,index:o,original:i}),r}),[]).sort((function(e,t){var r=t.score-e.score;return r||e.index-t.index}))):[]}},4855:(e,t,r)=>{"use strict";t.min=function(e,t){let r,o=t?.in;return e.forEach((e=>{o||"object"!=typeof e||(o=n.constructFrom.bind(null,e));const t=(0,i.toDate)(e,o);(!r||r>t||isNaN(+t))&&(r=t)})),(0,n.constructFrom)(o,r||NaN)};var n=r(2956),i=r(4446)},4866:(e,t,r)=>{"use strict";var n=r(7510),i=r(4751),o=r(1683),a=function(e,t,r){return r=r||{},this.options=n({minLength:2,limit:5,filter:!0,hideOnBlur:!0},r),this.el=e,this.data=t||[],this.list=new o(this),this.query="",this.selected=null,this.list.draw(),this.el.addEventListener("keyup",function(e){this.handleKeyUp(e.keyCode)}.bind(this),!1),this.el.addEventListener("keydown",function(e){this.handleKeyDown(e)}.bind(this)),this.el.addEventListener("focus",function(){this.handleFocus()}.bind(this)),this.el.addEventListener("blur",function(){this.handleBlur()}.bind(this)),this.el.addEventListener("paste",function(e){this.handlePaste(e)}.bind(this)),this.render=this.options.render?this.options.render.bind(this):this.render.bind(this),this.getItemValue=this.options.getItemValue?this.options.getItemValue.bind(this):this.getItemValue.bind(this),this};a.prototype.handleKeyUp=function(e){40!==e&&38!==e&&27!==e&&13!==e&&9!==e&&this.handleInputChange(this.el.value)},a.prototype.handleKeyDown=function(e){switch(e.keyCode){case 13:case 9:this.list.isEmpty()||(this.list.isVisible()&&e.preventDefault(),this.value(this.list.items[this.list.active].original),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next()}},a.prototype.handleBlur=function(){!this.list.selectingListItem&&this.options.hideOnBlur&&this.list.hide()},a.prototype.handlePaste=function(e){if(e.clipboardData)this.handleInputChange(e.clipboardData.getData("Text"));else{var t=this;setTimeout((function(){t.handleInputChange(e.target.value)}),100)}},a.prototype.handleInputChange=function(e){this.query=this.normalize(e),this.list.clear(),this.query.length<this.options.minLength?this.list.draw():this.getCandidates(function(e){for(var t=0;t<e.length&&(this.list.add(e[t]),t!==this.options.limit-1);t++);this.list.draw()}.bind(this))},a.prototype.handleFocus=function(){this.list.isEmpty()||this.list.show(),this.list.selectingListItem=!1},a.prototype.update=function(e){this.data=e,this.handleKeyUp()},a.prototype.clear=function(){this.data=[],this.list.clear()},a.prototype.normalize=function(e){return e=e.toLowerCase()},a.prototype.match=function(e,t){return e.indexOf(t)>-1},a.prototype.value=function(e){if(this.selected=e,this.el.value=this.getItemV
6alue(e),document.createEvent){var t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1),this.el.dispatchEvent(t)}else this.el.fireEvent("onchange")},a.prototype.getCandidates=function(e){var t={pre:"<strong>",post:"</strong>",extract:function(e){return this.getItemValue(e)}.bind(this)};e(this.options.filter?i.filter(this.query,this.data,t).map(function(e){return{original:e.original,string:this.render(e.original,e.string)}}.bind(this)):this.data.map(function(e){return{original:e,string:this.render(e)}}.bind(this)))},a.prototype.getItemValue=function(e){return e},a.prototype.render=function(e,t){if(t)return t;for(var r=e.original?this.getItemValue(e.original):this.getItemValue(e),n=this.normalize(r),i=n.lastIndexOf(this.query);i>-1;){var o=i+this.query.length;r=r.slice(0,i)+"<strong>"+r.slice(i,o)+"</strong>"+r.slice(o),i=n.slice(0,i).lastIndexOf(this.query)}return r},a.prototype.renderError=function(e){this.list.drawError(e)},e.exports=a},4875:(e,t,r)=>{"use strict";t.differenceInCalendarYears=function(e,t,r){const[i,o]=(0,n.normalizeDates)(r?.in,e,t);return i.getFullYear()-o.getFullYear()};var n=r(8256)},4879:(e,t,r)=>{"use strict";t.isEqual=function(e,t){return+(0,n.toDate)(e)==+(0,n.toDate)(t)};var n=r(4446)},4950:(e,t,r)=>{"use strict";t.formatDistanceToNow=function(e,t){return(0,i.formatDistance)(e,(0,n.constructNow)(e),t)};var n=r(2700),i=r(671)},5078:(e,t,r)=>{"use strict";t.SecondParser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=50;parse(e,t,r){switch(t){case"s":return(0,o.parseNumericPattern)(n.numericPatterns.second,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setSeconds(r,0),e}incompatibleTokens=["t","T"]}t.SecondParser=a},5079:(e,t,r)=>{"use strict";t.ISOWeekParser=void 0;var n=r(3354),i=r(6107),o=r(7699),a=r(5513),s=r(3771);class l extends a.Parser{priority=100;parse(e,t,r){switch(t){case"I":return(0,s.parseNumericPattern)(o.numericPatterns.week,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return(0,s.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r){return(0,i.startOfISOWeek)((0,n.setISOWeek)(e,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}t.ISOWeekParser=l},5083:(e,t,r)=>{"use strict";t.nextTuesday=function(e,t){return(0,n.nextDay)(e,2,t)};var n=r(64)},5112:(e,t,r)=>{"use strict";t.subMonths=function(e,t,r){return(0,n.addMonths)(e,-t,r)};var n=r(6379)},5154:(e,t,r)=>{"use strict";t.setSeconds=function(e,t,r){const i=(0,n.toDate)(e,r?.in);return i.setSeconds(t),i};var n=r(4446)},5206:(e,t,r)=>{"use strict";t.formatDistanceStrict=function(e,t,r){const u=(0,i.getDefaultOptions)(),d=r?.locale??u.locale??n.defaultLocale,h=(0,l.compareAsc)(e,t);if(isNaN(h))throw new RangeError("Invalid time value");const f=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:h}),[p,g]=(0,s.normalizeDates)(r?.in,...h>0?[t,e]:[e,t]),m=(0,o.getRoundingMethod)(r?.roundingMethod??"round"),y=g.getTime()-p.getTime(),_=y/c.millisecondsInMinute,v=(0,a.getTimezoneOffsetInMilliseconds)(g)-(0,a.getTimezoneOffsetInMilliseconds)(p),b=(y-v)/c.millisecondsInMinute,x=r?.unit;let w;w=x||(_<1?"second":_<60?"minute":_<c.minutesInDay?"hour":b<c.minutesInMonth?"day":b<c.minutesInYear?"month":"year");if("second"===w){const e=m(y/1e3);return d.formatDistance("xSeconds",e,f)}if("minute"===w){const e=m(_);return d.formatDistance("xMinutes",e,f)}if("hour"===w){const e=m(_/60);return d.formatDistance("xHours",e,f)}if("day"===w){const e=m(b/c.minutesInDay);return d.formatDistance("xDays",e,f)}if("month"===w){const e=m(b/c.minutesInMonth);return 12===e&&"month"!==x?d.formatDistance("xYears",1,f):d.formatDistance("xMonths",e,f)}{const e=m(b/c.minutesInYear);return d.formatDistance("xYears",e,f)}};var n=r(9577),i=r(6755),o=r(1331),a=r(6339),s=r(8256),l=r(6789),c=r(8052)},5255:(e,t,r)=>{"use strict";t.previousFriday=function(e,t){return(0,n.previousDay)(e,5,t)};var n=r(8092)},5261:(e,t,r)=>{"use strict";t.TimestampSecondsParser=void 0;var n=r(2956),i=r(5513),o=r(3771);class a extends i.Parser{priority=40;parse(e){return(0,o.parseAnyDigitsSigned)(e)}set(e,t,r){return[(0,n.constructFrom)(e,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"}t.TimestampSecondsParser=a},5262:(e,t,r)=>{"use strict";t.startOfHour=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setMinutes(0,0,0),r};var n=r(4446)},5265:(e,t,r)=>{"use strict";t.endOfQuarter=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getMonth(),o=i-i%3+3;return r.setMonth(o,0),r.setHours(23,59,59,999),r};var n=r(4446)},5303:(e,t,r)=>{"use strict";t.LocalDayParser=void 0;var n=r(4395),i=r(5513),o=r(3771);class a extends i.Parser{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return(0,o.mapValue)((0,o.parseNDigits)(t.length,e),i);case"eo":return(0,o.mapValue)(r.ordinalNumber(e,{unit:"day"}),i);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}
6set(e,t,r,i){return(e=(0,n.setDay)(e,r,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}t.LocalDayParser=a},5304:(e,t,r)=>{"use strict";t.ISOWeekYearParser=void 0;var n=r(6107),i=r(2956),o=r(5513),a=r(3771);class s extends o.Parser{priority=130;parse(e,t){return"R"===t?(0,a.parseNDigitsSigned)(4,e):(0,a.parseNDigitsSigned)(t.length,e)}set(e,t,r){const o=(0,i.constructFrom)(e,0);return o.setFullYear(r,0,4),o.setHours(0,0,0,0),(0,n.startOfISOWeek)(o)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}t.ISOWeekYearParser=s},5325:(e,t,r)=>{"use strict";t.minutesToMilliseconds=function(e){return Math.trunc(e*n.millisecondsInMinute)};var n=r(8052)},5395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasFloat16ArrayBrand=function(e){if(!(0,n.isObjectLike)(e))return!1;const t=(0,o.ReflectGetPrototypeOf)(e);if(!(0,n.isObjectLike)(t))return!1;const r=t.constructor;if(void 0===r)return!1;if(!(0,n.isObject)(r))throw(0,o.NativeTypeError)(i.THE_CONSTRUCTOR_PROPERTY_VALUE_IS_NOT_AN_OBJECT);return(0,o.ReflectHas)(r,a)};var n=r(7516),i=r(7968),o=r(2628);const a=t.brand=(0,o.SymbolFor)("__Float16Array__")},5442:(e,t,r)=>{"use strict";t.differenceInQuarters=function(e,t,r){const o=(0,i.differenceInMonths)(e,t,r)/3;return(0,n.getRoundingMethod)(r?.roundingMethod)(o)};var n=r(1331),i=r(5460)},5449:(e,t,r)=>{"use strict";t.formatRFC3339=function(e,t){const r=(0,o.toDate)(e,t?.in);if(!(0,i.isValid)(r))throw new RangeError("Invalid time value");const a=t?.fractionDigits??0,s=(0,n.addLeadingZeros)(r.getDate(),2),l=(0,n.addLeadingZeros)(r.getMonth()+1,2),c=r.getFullYear(),u=(0,n.addLeadingZeros)(r.getHours(),2),d=(0,n.addLeadingZeros)(r.getMinutes(),2),h=(0,n.addLeadingZeros)(r.getSeconds(),2);let f="";if(a>0){const e=r.getMilliseconds(),t=Math.trunc(e*Math.pow(10,a-3));f="."+(0,n.addLeadingZeros)(t,a)}let p="";const g=r.getTimezoneOffset();if(0!==g){const e=Math.abs(g);p=`${g<0?"+":"-"}${(0,n.addLeadingZeros)(Math.trunc(e/60),2)}:${(0,n.addLeadingZeros)(e%60,2)}`}else p="Z";return`${c}-${l}-${s}T${u}:${d}:${h}${f}${p}`};var n=r(2554),i=r(7489),o=r(4446)},5452:e=>{"use strict";function t(e){return Array.isArray(e)?e.map(encodeURIComponent).join(","):encodeURIComponent(String(e))}function r(e,r,n){if(!1===n||null===n)return e;var i=/\?/.test(e)?"&":"?",o=encodeURIComponent(r);return void 0!==n&&""!==n&&!0!==n&&(o+="="+t(n)),""+e+i+o}e.exports={appendQueryObject:function(e,t){if(!t)return e;var n=e;return Object.keys(t).forEach((function(e){var i=t[e];void 0!==i&&(Array.isArray(i)&&(i=i.filter((function(e){return null!=e})).join(",")),n=r(n,e,i))})),n},appendQueryParam:r,prependOrigin:function(e,t){if(!t)return e;if("http"===e.slice(0,4))return e;var r="/"===e[0]?"":"/";return""+t.replace(/\/$/,"")+r+e},interpolateRouteParams:function(e,r){return r?e.replace(/\/:([a-zA-Z0-9]+)/g,(function(e,n){var i=r[n];if(void 0===i)throw new Error("Unspecified route parameter "+n);return"/"+t(i)})):e}}},5456:(e,t,r)=>{"use strict";t.eachWeekendOfMonth=function(e,t){const r=(0,o.startOfMonth)(e,t),a=(0,i.endOfMonth)(e,t);return(0,n.eachWeekendOfInterval)({start:r,end:a},t)};var n=r(9305),i=r(1291),o=r(7710)},5457:(e,t,r)=>{"use strict";t.previousSunday=function(e,t){return(0,n.previousDay)(e,0,t)};var n=r(8092)},5460:(e,t,r)=>{"use strict";t.differenceInMonths=function(e,t,r){const[s,l,c]=(0,n.normalizeDates)(r?.in,e,e,t),u=(0,i.compareAsc)(l,c),d=Math.abs((0,o.differenceInCalendarMonths)(l,c));if(d<1)return 0;1===l.getMonth()&&l.getDate()>27&&l.setDate(30);l.setMonth(l.getMonth()-u*d);let h=(0,i.compareAsc)(l,c)===-u;(0,a.isLastDayOfMonth)(s)&&1===d&&1===(0,i.compareAsc)(s,c)&&(h=!1);const f=u*(d-+h);return 0===f?0:f};var n=r(8256),i=r(6789),o=r(562),a=r(920)},5472:(e,t,r)=>{"use strict";t.startOfWeek=function(e,t){const r=(0,n.getDefaultOptions)(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=(0,i.toDate)(e,t?.in),s=a.getDay(),l=(s<o?7:0)+s-o;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a};var n=r(6755),i=r(4446)},5506:(e,t,r)=>{"use strict";t.differenceInCalendarDays=function(e,t,r){const[s,l]=(0,i.normalizeDates)(r?.in,e,t),c=(0,a.startOfDay)(s),u=(0,a.startOfDay)(l),d=+c-(0,n.getTimezoneOffsetInMilliseconds)(c),h=+u-(0,n.getTimezoneOffsetInMilliseconds)(u);
6return Math.round((d-h)/o.millisecondsInDay)};var n=r(6339),i=r(8256),o=r(8052),a=r(8290)},5513:(e,t,r)=>{"use strict";t.Parser=void 0;var n=r(7861);t.Parser=class{run(e,t,r,i){const o=this.parse(e,t,r,i);return o?{setter:new n.ValueSetter(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,t,r){return!0}}},5573:(e,t,r)=>{"use strict";var n=r(6368),i=r(7510),o="value",a="\n  ",s={};function l(e){var t=Array.isArray(e);return function(r){var n,i=c(s.plainArray,r);if(i)return i;if(t&&r.length!==e.length)return"an array with "+e.length+" items";for(var o=0;o<r.length;o++)if(i=c((n=o,t?e[n]:e),r[o]))return[o].concat(i)}}function c(e,t){if(null!=t||e.hasOwnProperty("__required")){var r=e(t);return r?Array.isArray(r)?r:[r]:void 0}}function u(e,t){var r=e.length,n=e[r-1],a=e.slice(0,r-1);return 0===a.length&&(a=[o]),t=i(t,{path:a}),"function"==typeof n?n(t):d(t,function(e){return"must be "+function(e){if(/^an? /.test(e))return e;if(/^[aeiou]/i.test(e))return"an "+e;if(/^[a-z]/i.test(e))return"a "+e;return e}(e)+"."}(n))}function d(e,t){return(h(e.path)?"Item at position ":"")+(e.path.join(".")+" "+t)}function h(e){return"number"==typeof e[e.length-1]||"number"==typeof e[0]}s.assert=function(e,t){return t=t||{},function(r){var n=c(e,r);if(n){var i=u(n,t);throw t.apiName&&(i=t.apiName+": "+i),new Error(i)}}},s.shape=function(e){var t,r=(t=e,Object.keys(t||{}).map((function(e){return{key:e,value:t[e]}})));return function(e){var t,n=c(s.plainObject,e);if(n)return n;for(var i=[],l=0;l<r.length;l++)t=r[l].key,(n=c(r[l].value,e[t]))&&i.push([t].concat(n));return i.length<2?i[0]:function(e){i=i.map((function(t){return"- "+t[0]+": "+u(t,e).split("\n").join(a)}));var t=e.path.join(".");return"The following properties"+(t===o?"":" of "+t)+" have invalid values:"+a+i.join(a)}}},s.strictShape=function(e){var t=s.shape(e);return function(r){var n=t(r);if(n)return n;var i=Object.keys(r).reduce((function(t,r){return void 0===e[r]&&t.push(r),t}),[]);return 0!==i.length?function(){return"The following keys are invalid: "+i.join(", ")}:void 0}},s.arrayOf=function(e){return l(e)},s.tuple=function(){return l(Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments))},s.required=function(e){function t(t){return null==t?function(e){return d(e,h(e.path)?"cannot be undefined/null.":"is required.")}:e.apply(this,arguments)}return t.__required=!0,t},s.oneOfType=function(){var e=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments);return function(t){var r=e.map((function(e){return c(e,t)})).filter(Boolean);if(r.length===e.length)return r.every((function(e){return 1===e.length&&"string"==typeof e[0]}))?function(e){if(e.length<2)return e[0];if(2===e.length)return e.join(" or ");return e.slice(0,-1).join(", ")+", or "+e.slice(-1)}(r.map((function(e){return e[0]}))):r.reduce((function(e,t){return t.length>e.length?t:e}))}},s.equal=function(e){return function(t){if(t!==e)return JSON.stringify(e)}},s.oneOf=function(){var e=(Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments)).map((function(e){return s.equal(e)}));return s.oneOfType.apply(this,e)},s.range=function(e){var t=e[0],r=e[1];return function(e){if(c(s.number,e)||e<t||e>r)return"number between "+t+" & "+r+" (inclusive)"}},s.any=function(){},s.boolean=function(e){if("boolean"!=typeof e)return"boolean"},s.number=function(e){if("number"!=typeof e)return"number"},s.plainArray=function(e){if(!Array.isArray(e))return"array"},s.plainObject=function(e){if(!n(e))return"object"},s.string=function(e){if("string"!=typeof e)return"string"},s.func=function(e){if("function"!=typeof e)return"function"},s.validate=c,s.processMessage=u,e.exports=s},5586:(e,t)=>{"use strict";t.buildLocalizeFn=function(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,i=r?.width?String(r.width):t;n=e.formattingValues[i]||e.formattingValues[t]}else{const t=e.defaultWidth,i=r?.width?String(r.width):e.defaultWidth;n=e.values[i]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}},5609:(e,t,r)=>{"use strict";t.intervalToDuration=function(e,t){const{start:r,end:d}=(0,n.normalizeInterval)(t?.in,e),h={},f=(0,u.differenceInYears)(d,r);f&&(h.years=f);const p=(0,i.add)(r,{years:h.years}),g=(0,l.differenceInMonths)(d,p);g&&(h.months=g);const m=(0,i.add)(p,{months:h.months}),y=(0,o.differenceInDays)(d,m);y&&(h.days=y);const _=(0,i.add)(m,{days:h.days}),v=(0,a.differenceInHours)(d,_);v&&(h.hours=v);const b=(0,i.add)(_,{hours:h.hours}),x=(0,s.differenceInMinutes)(d,b);x&&(h.minutes=x);const w=(0,i.add)(b,{minutes:h.minutes}),S=(0,c.differenceInSeconds)(d,w);
6S&&(h.seconds=S);return h};var n=r(5909),i=r(7626),o=r(3724),a=r(990),s=r(3072),l=r(5460),c=r(192),u=r(6605)},5610:(e,t,r)=>{"use strict";t.nextWednesday=function(e,t){return(0,n.nextDay)(e,3,t)};var n=r(64)},5624:(e,t)=>{"use strict";t.buildFormatLongFn=function(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}},5626:(e,t,r)=>{"use strict";t.isSameISOWeek=function(e,t,r){return(0,n.isSameWeek)(e,t,{...r,weekStartsOn:1})};var n=r(5897)},5635:(e,t,r)=>{"use strict";t.millisecondsToSeconds=function(e){const t=e/n.millisecondsInSecond;return Math.trunc(t)};var n=r(8052)},5663:(e,t,r)=>{"use strict";var n=r(7510),i=r(9414),o=r(7267),a=r(1087),s=r(7583),l={},c=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];l.forwardGeocode=function(e){i.assertShape({query:i.required(i.string),mode:i.oneOf("mapbox.places","mapbox.places-permanent"),countries:i.arrayOf(i.string),proximity:i.oneOf(i.coordinates,"ip"),types:i.arrayOf(i.oneOf(c)),autocomplete:i.boolean,bbox:i.arrayOf(i.number),limit:i.number,language:i.arrayOf(i.string),routing:i.boolean,fuzzyMatch:i.boolean,worldview:i.string,session_token:i.string})(e),e.mode=e.mode||"mapbox.places";var t=a(n({country:e.countries},o(e,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview","session_token"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(e,["mode","query"]),query:t})},l.reverseGeocode=function(e){i.assertShape({query:i.required(i.coordinates),mode:i.oneOf("mapbox.places","mapbox.places-permanent"),countries:i.arrayOf(i.string),types:i.arrayOf(i.oneOf(c)),bbox:i.arrayOf(i.number),limit:i.number,language:i.arrayOf(i.string),reverseMode:i.oneOf("distance","score"),routing:i.boolean,worldview:i.string,session_token:i.string})(e),e.mode=e.mode||"mapbox.places";var t=a(n({country:e.countries},o(e,["country","types","bbox","limit","language","reverseMode","routing","worldview","session_token"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(e,["mode","query"]),query:t})},e.exports=s(l)},5676:(e,t,r)=>{"use strict";t.hoursToMinutes=function(e){return Math.trunc(e*n.minutesInHour)};var n=r(8052)},5677:(e,t,r)=>{"use strict";t.isAfter=function(e,t){return+(0,n.toDate)(e)>+(0,n.toDate)(t)};var n=r(4446)},5800:(e,t,r)=>{"use strict";t.isToday=function(e,t){return(0,o.isSameDay)((0,n.constructFrom)(t?.in||e,e),(0,i.constructNow)(t?.in||e))};var n=r(2956),i=r(2700),o=r(9691)},5807:(e,t,r)=>{"use strict";t.yearsToMonths=function(e){return Math.trunc(e*n.monthsInYear)};var n=r(8052)},5824:(e,t,r)=>{"use strict";t.eachMonthOfInterval=function(e,t){const{start:r,end:o}=(0,n.normalizeInterval)(t?.in,e);let a=+r>+o;const s=a?+r:+o,l=a?o:r;l.setHours(0,0,0,0),l.setDate(1);let c=t?.step??1;if(!c)return[];c<0&&(c=-c,a=!a);const u=[];for(;+l<=s;)u.push((0,i.constructFrom)(r,l)),l.setMonth(l.getMonth()+c);return a?u.reverse():u};var n=r(5909),i=r(2956)},5827:(e,t,r)=>{"use strict";t.yearsToDays=function(e){return Math.trunc(e*n.daysInYear)};var n=r(8052)},5881:(e,t,r)=>{"use strict";t.endOfHour=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setMinutes(59,59,999),r};var n=r(4446)},5897:(e,t,r)=>{"use strict";t.isSameWeek=function(e,t,r){const[o,a]=(0,n.normalizeDates)(r?.in,e,t);return+(0,i.startOfWeek)(o,r)==+(0,i.startOfWeek)(a,r)};var n=r(8256),i=r(5472)},5909:(e,t,r)=>{"use strict";t.normalizeInterval=function(e,t){const[r,i]=(0,n.normalizeDates)(e,t.start,t.end);return{start:r,end:i}};var n=r(8256)},5914:function(e,t,r){var n;/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */e=r.nmd(e),function(){var i=t,o=(e&&e.exports,"object"==typeof r.g&&r.g);o.global!==o&&o.window;var a=function(e){this.message=e};(a.prototype=new Error).name="InvalidCharacterError";var s=function(e){throw new a(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,u={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var t,r,n,i,o=e.length%3,a="",c=-1,u=e.length-o;++c<u;)t=e.charCodeAt(c)<<16,r=e.charCodeAt(++c)<<8,n=e.charCodeAt(++c),a+=l.charAt((i=t+r+n)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==o?(t=e.charCodeAt(c)<<8,r=e.charCodeAt(++c),a+=l.charAt((i=t+r)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==o&&(i=e.charCodeAt(c),a+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),a},decode:function(e){var t=(e=String(e).replace(c,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,i=0,o="",a=-1;++a<t;)n=l.indexOf(e.charAt(a)),r=i%4?64*r+n:n,i++%4&&(o+=String.fromCharCode(255&r>>(-2*i&6)));return o},version:"0.1.0"};void 0===(n=function(){return u}.call(t,r,t,e))||(e.exports=n)}()},5915:(e,t,r)=>{"use strict";var n=r(3326),i=r(181),o=r(7510),a=r(7007).EventEmitter,s=r(7265),l=r(7995),c=r(5663),u=r(8122),d=r(7906),h=r(1929),f=r(8377),p=r(2614);const g=0,m=1,y=2;function _(e){this._eventEmitter=new a,this.options=o({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null,this.geolocation=new f}_.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,flipCoordinates:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,enableGeolocation:!1,addressAccuracy:"street",useBrowserFocus:!1,getItemV
6alue:function(e){return e.place_name},render:function(e){var t,r=(t=e.place_name,t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):"").split(",");return'<div class="mapboxgl-ctrl-geocoder--suggestion"><div class="mapboxgl-ctrl-geocoder--suggestion-title">'+r[0]+'</div><div class="mapboxgl-ctrl-geocoder--suggestion-address">'+r.splice(1,r.length).join(",")+"</div></div>"}},_headers:{},addTo:function(e){function t(e,t){if(!document.body.contains(t))throw new Error("Element provided to #addTo() exists, but is not in the DOM");const r=e.onAdd();t.appendChild(r)}if(e._controlContainer)e.addControl(this);else if(e instanceof HTMLElement)t(this,e);else{if("string"!=typeof e)throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element");{const r=document.querySelectorAll(e);if(0===r.length)throw new Error("Element ",e,"not found.");if(r.length>1)throw new Error("Geocoder can only be added to a single html element");t(this,r[0])}}},onAdd:function(e){if(e&&"string"!=typeof e&&(this._map=e),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=c(l({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new u(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this),this._geolocateUser=this._geolocateUser.bind(this),this._onSuggestionItemFocus=this._onSuggestionItemFocus.bind(this),this._onSuggestionItemKeyDown=this._onSuggestionItemKeydown.bind(this);var t=this.container=document.createElement("div");t.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var r=this.createIcon("search",'<path d="M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"/>');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",i(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",function(e){this.eventManager.keyevent(e,this)}.bind(this));var o=document.createElement("div");o.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var a=this.createIcon("close",'<path d="M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"/>');if(this._clearEl.appendChild(a),this._loadingEl=this.createIcon("loading",'<path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"/><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.
66 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"/>'),o.appendChild(this._clearEl),o.appendChild(this._loadingEl),t.appendChild(r),t.appendChild(this._inputEl),this.options.enableGeolocation&&this.geolocation.isSupport()){this._geolocateEl=document.createElement("button"),this._geolocateEl.setAttribute("aria-label","Geolocate"),this._geolocateEl.addEventListener("click",this._geolocateUser),this._geolocateEl.className="mapboxgl-ctrl-geocoder--button";var s=this.createIcon("geolocate",'<path d="M12.999 3.677L2.042 8.269c-.962.403-.747 1.823.29 1.912l5.032.431.431 5.033c.089 1.037 1.509 1.252 1.912.29l4.592-10.957c.345-.822-.477-1.644-1.299-1.299z" fill="#4264fb"/>');this._geolocateEl.appendChild(s),o.appendChild(this._geolocateEl),this._showGeolocateButton()}var d=this._typeahead=new n(this._inputEl,[],{hideOnBlur:!this.options.useBrowserFocus,filter:!1,minLength:this.options.minLength,limit:this.options.limit});t.insertBefore(o,d.list.wrapper),this.setRenderFunction(this.options.render),d.getItemValue=this.options.getItemValue;const h=this._typeahead.handleKeyDown.bind(this._typeahead),f=this._typeahead.handleKeyUp.bind(this._typeahead);this._typeahead.handleKeyUp,this.options.useBrowserFocus&&(this._typeahead.handleKeyDown=function(e){if(9!==e.keyCode||d.list.isEmpty())return 40===e.keyCode?(this._typeahead.list.active=0,this._typeahead.list.element.querySelectorAll("li").forEach((function(e){e.classList.remove("active")})),this._typeahead.list.element.querySelectorAll("li")[0].classList.add("active"),void this._typeahead.list.element.querySelectorAll("li")[0].focus()):38===e.keyCode?(this._typeahead.list.active=d.list.items.length-1,this._typeahead.list.element.querySelectorAll("li").forEach((function(e){e.classList.remove("active")})),this._typeahead.list.element.querySelectorAll("li")[this._typeahead.list.active].classList.add("active"),void this._typeahead.list.element.querySelectorAll("li")[this._typeahead.list.active].focus()):void h(e)}.bind(this),this._typeahead.handleKeyUp=function(e){e&&16===e.keyCode?e.preventDefault():f(e)});var p,g=d.list.draw,m=this._footerNode=((p=document.createElement("div")).className="mapboxgl-ctrl-geocoder--powered-by",p.innerHTML='<a href="https://www.mapbox.com/search-service" target="_blank">Powered by Mapbox</a>',p),y=this;return d.list.draw=function(){y.options.useBrowserFocus&&d.list.element.querySelectorAll("li").forEach((function(e){e.removeEventListener("focus",y._onSuggestionItemFocus),e.removeEventListener("keydown",y._onSuggestionItemKeyDown)})),g.call(this),y.options.useBrowserFocus&&d.list.element.querySelectorAll("li").forEach(function(e,t){0===t&&e.focus(),e.setAttribute("data-index",t),e.tabIndex=0,e.addEventListener("focus",this._onSuggestionItemFocus),e.addEventListener("keydown",this._onSuggestionItemKeyDown)}.bind(y)),m.addEventListener("mousedown",function(){this.selectingListItem=!0}.bind(this)),m.addEventListener("mouseup",function(){this.selectingListItem=!1}.bind(this)),this.element.appendChild(m)},this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),t},_onSuggestionItemKeydown(e){const t=e.keyCode;if(9!==t)if(13===t){e.preventDefault();const t=this._typeahead.list.element.querySelector(".active");if(t){const e=t.getAttribute("data-index"),r=this._typeahead.list.items[e];r&&(this._typeahead.value(r.original),this._typeahead.list.hide())}}else if(38===t||40===t){const r=this._typeahead.list.element.querySelectorAll("li");if(r.length>0){if(38===t){if(!(this._typeahead.list.active>0))return void this._typeahead.el.focus();e.preventDefault(),this._typeahead.list.active--}else if(40===t){if(e.preventDefault(),!(this._typeahead.list.active<r.length-1))return;this._typeahead.list.active++}r.forEach((function(e){e.classList.remove("active")}));const n=r[this._typeahead.list.active];n&&(n.classList.add("active"),n.focus())}}},_onSuggestionItemFocus(e){this._typeahead.list.active=e.target.getAttribute("data-index"),this._typeahead.list.element.querySelectorAll("li").forEach((function(e){e.classList.remove("active")})),e.target.classList.add("active")},_geolocateUser:function(){this._hideGeolocateButton(),this._showLoadingIcon(),this.geolocation.getCurrentPosition().then(function(e){this._hideLoadingIcon();const t={geometry:{type:"Point",coordinates:[e.coords.longitude,e.coords.latitude]}};this._handleMarker(t),this._fly(t),this._typeahead.clear(),this._typeahead.selected=!0,this.lastSelected=JSON.stringify(t),this._showClearButton(),this.fresh=!1;const r={limit:1,language:[this.options.language],query:t.geometry.coordinates,types:["address"]};if(this.options.localGeocoderOnly){const e=t.geometry.coordinates[0]+","+t.geometry.coordinates[1];this._setInputValue(e),this._eventEmitter.emit("result",{result:t})}else this.geocoderService.reverseGeocode(r).send().then(function(e){const r=e.body.features[0];if(r){const e=p.transformFeatureToGeolocationText(r,this.options.addressAccuracy);this._setInputValue(e),r.user_coordinates=t.geometry.coordinates,this._eventEmitter.emit("result",{result:r})}else this._eventEmitter.emit("result",{result:{user_coordinates:t.geometry.coordinates}})}.bind(this))}.bind(this)).catch(function(e){1===e.code?this._renderUserDeniedGeolocationError():this._renderLocationError(),this._hideLoadingIcon(),this._showGeolocateButton(),this._hideAttribution()}.bind(this))},createIcon:function(e,t){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+e),r.setAttribute("viewBox","0 0 18 18"),r.setAttribute("xml:space","preserve"),r.setAttribute("width",18),r.setAttribute("height",18),r.innerHTML=t,r},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_setInputValue:function(e){this._inputEl.value=e,setTimeout(function(){this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0)}.bind(this),1)},_onPaste:function(e){var t=(e.clipboardData||window.clipboardData).getData("text");t.length>=this.options.minLength&&this._geocode(t)},_onKeyDown:function(e){var t=27,r=9;if(e.keyCode===t&&this.options.clearAndBlurOnEsc)return this._clear(e),this._inputEl.blur();var n=e.target&&e.target.shadowRoot?e.target.shadowRoot.activeElement:e.target;if(!(n?n.value:""))return this.fresh=!0,e.keyCode!==r&&this.clear(e),this._showGeolocateButton(),this._hideClearButton();this._hideGeolocateButton(),e.metaKey||-1!==[r,t,37,39,13,38,40].indexOf(e.keyCode)||n.value.length>=this.options.minLength&&this._geocode(n.value)},_showButton:function(){this._typeahead.selected&&this._showClearButton()},_hideButton:function(){this._typeahead.selected&&this._hideClearButton()},_showClearButton:function(){this._clearEl.style.display="block"},_hideClearButton:function(){this._clearEl.style.display="none"},_showGeolocateButton:function(){this._geolocateEl&&this.geolocation.isSupport()&&(this._geolocateEl.style.display="block")},_hideGeolocateButton:function(){this._geolocateEl&&(this._geolocateEl.style.display="none")},_showLoadingIcon:function(){this._loadingEl.style.display="block"},_hideLoadingIcon:function(){this._loadingEl.style.display="none"},_showAttribution:function(){this._footerNode.style.display="block"},_hideAttribution:function(){this._footerNode.style.display="none"},_onBlur:function(e){this.options.clearOnBlur&&this._clearOnBlur(e),this.options.collapsed&&this._collapse()},_onChange:function(){var e=this._typeahead.selected;e&&JSON.stringify(e)!==this.lastSelected&&(this._hideClearButton(),this.options.flyTo&&this._fly(e),this.options.marker&&this._mapboxgl&&this._handleMarker(e),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(e),this._eventEmitter.emit("result",{result:e}),this.eventManager.select(e,this))},_fly:function(e){var t;if(e.properties&&s[e.properties.short_code])t=o({},this.options.flyTo),this._map&&this._map.fitBounds(s[e.properties.short_code].bbox,t);else if(e.bbox){var r=e.bbox;t=o({},this.options.flyTo),this._map&&this._map.fitBounds([[r[0],r[1]],[r[2],r[3]
6]],t)}else{var n={zoom:this.options.zoom};t=o({},n,this.options.flyTo),e.center?t.center=e.center:e.geometry&&e.geometry.type&&"Point"===e.geometry.type&&e.geometry.coordinates&&(t.center=e.geometry.coordinates),this._map&&this._map.flyTo(t)}},_requestType:function(e,t){return e.localGeocoderOnly?m:e.reverseGeocode&&p.REVERSE_GEOCODE_COORD_RGX.test(t)?y:g},_setupConfig:function(e,t){const r=/[\s,]+/;var n=this,i=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"].reduce((function(e,t){if(void 0===n.options[t]||null===n.options[t])return e;["countries","types","language"].indexOf(t)>-1?e[t]=n.options[t].split(r):e[t]=n.options[t];const i="number"==typeof n.options[t].longitude&&"number"==typeof n.options[t].latitude;if("proximity"===t&&i){const r=n.options[t].longitude,i=n.options[t].latitude;e[t]=[r,i]}return e}),{});switch(e){case y:var a=t.split(r).map((function(e){return parseFloat(e,10)}));n.options.flipCoordinates||a.reverse(),!i.types||i.types[0],i=o(i,{query:a,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach((function(e){e in i&&delete i[e]}));break;case g:{const e=t.trim();/^(-?\d{1,3}(\.\d{0,256})?)[, ]+(-?\d{1,3}(\.\d{0,256})?)?$/.test(e)&&(t=t.replace(/,/g," ")),i=o(i,{query:t})}}return i.session_token=this.eventManager.getSessionId(),i},_geocode:function(e){this.inputString=e,this._showLoadingIcon(),this._eventEmitter.emit("loading",{query:e});const t=this._requestType(this.options,e),r=this._setupConfig(t,e);var n;switch(t){case m:n=Promise.resolve();break;case g:n=this.geocoderService.forwardGeocode(r).send();break;case y:n=this.geocoderService.reverseGeocode(r).send()}var i=this.options.localGeocoder&&this.options.localGeocoder(e)||[],o=[],a=null;return n.catch(function(e){a=e}.bind(this)).then(function(t){this._hideLoadingIcon();var n={};return t?"200"==t.statusCode&&((n=t.body).request=t.request,n.headers=t.headers,this._headers=t.headers):n={type:"FeatureCollection",features:[]},n.config=r,this.fresh&&(this.eventManager.start(this),this.fresh=!1),n.features&&n.features.length&&n.features.map((function(e){e._source="mapbox"})),n.features=n.features?i.concat(n.features):i,this.options.externalGeocoder?(o=this.options.externalGeocoder(e,n.features)||Promise.resolve([])).then((function(e){return n.features=n.features?e.concat(n.features):e,n}),(function(){return n})):n}.bind(this)).then(function(e){if(a)throw a;this.options.filter&&e.features.length&&(e.features=e.features.filter(this.options.filter)),e.features.length?(this._showClearButton(),this._hideGeolocateButton(),this._showAttribution(),this._eventEmitter.emit("results",e),this._typeahead.update(e.features)):(this._hideClearButton(),this._hideAttribution(),this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",e))}.bind(this)).catch(function(e){this._hideLoadingIcon(),this._hideAttribution(),i.length&&this.options.localGeocoder||o.length&&this.options.externalGeocoder?(this._showClearButton(),this._hideGeolocateButton(),this._typeahead.update(i)):(this._hideClearButton(),this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:i}),this._eventEmitter.emit("error",{error:e})}.bind(this)),n},_clear:function(e){e&&e.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this.eventManager.sessionIncrementer++,this._onChange(),this._hideClearButton(),this._showGeolocateButton(),this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(e){this._clear(e),this._inputEl.focus(),this.options.useBrowserFocus&&this._typeahead.list.hide()},_clearOnBlur:function(e){e.relatedTarget&&this._clear(e)},_onQueryResult:function(e){var t=e.body;if(t.features.length){var r=t.features[0];this._typeahead.selected=r,this._inputEl.value=r.place_name,this._onChange()}},_updateProximity:function(){if(this._map&&this.options.trackProximity)if(this._map.getZoom()>9){var e=this._map.getCenter().wrap();this.setProximity({longitude:e.lng,latitude:e.lat},!1)}else this.setProximity(null,!1)},_collapse:function(){this._inputEl.value||this._inputEl===document.activeElement||this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(e){return this._geocode(e).then(this._onQueryResult),this},_renderError:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error'>There was an error reaching the server</div>")},_renderLocationError:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error'>A location error has occurred</div>")},_renderNoResults:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error mapbox-gl-geocoder--no-results'>No results found</div>")},_renderUserDeniedGeolocationError:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error'>Geolocation permission denied</div>")},_renderMessage:function(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var e=this.options.language.split(",")[0],t=h.language(e),r=d.placeholder[t];if(r)return r}return"Search"},setInput:function(e,t){return void 0===t&&(t=!1),this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&(t?this._geocode(e):this._onChange()),this},setProximity:function(e,t=!0){return this.options.proximity=e,t&&(this.options.trackProximity=!1),this},getProximity:function(){return this.options.proximity},setRenderFunction:function(e){return e&&"function"==typeof e&&(this._typeahead.render=e),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(e){var t=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=e||this.options.language||t,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(e){return this.options.zoom=e,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(e){return this.options.flyTo=e,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(e){return this.options.placeholder=e||this._getPlaceholderText(),this._inputEl.placeholder=this.options.placeholder,this._inputEl.setAttribute("aria-label",this.options.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(e){return this.options.bbox=e,this},getCountries:function(){return this.options.countries},setCountries:function(e){return this.options.countries=e,this},getTypes:function(){return this.options.types},setTypes:function(e){return this.options.types=e,this},getMinLength:function(){return this.options.minLength},setMinLength:function(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this},getLimit:function(){return this.options.limit},setLimit:function(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this},getFilter:function(){return this.options.filter},setFilter:function(e){return this.options.filter=e,this},setOrigin:function(e){return this.options.origin=e,this.geocoderService=c(l({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAccessToken:function(e){return this.options.accessToken=e,this.geocoderService=c(l({accessToken:this.options.accessToken,origin:this.options.origin})),this},setAutocomplete:function(e){return this.options.autocomplete=e,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(e){return this.options.fuzzyMatch=e,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(e){return this.options.routing=e,this},getRouting:function(){return this.options.routing},setWorldview:function(e){return this.options.worldview=e,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(e){if(this._map){this._removeMarker();var t=o({},{color:"#4668F2"},this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(t),e.center?this.mapMarker.setLngLat(e.center).addTo(this._map):e.geometry&&e.geometry.type&&"Point"===e.geometry.type&&e.geometry.coordinates&&this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(e,t){return this._eventEmitter.on(e,t),this},off:function(e,t){return this._eventEmitter.removeListener(e,t),this.eventManager.remove(),this}},e.exports=_}
6,5942:(e,t,r)=>{"use strict";t.TimestampMillisecondsParser=void 0;var n=r(2956),i=r(5513),o=r(3771);class a extends i.Parser{priority=20;parse(e){return(0,o.parseAnyDigitsSigned)(e)}set(e,t,r){return[(0,n.constructFrom)(e,r),{timestampIsSet:!0}]}incompatibleTokens="*"}t.TimestampMillisecondsParser=a},5982:(e,t,r)=>{"use strict";t.ISOTimezoneParser=void 0;var n=r(2956),i=r(6339),o=r(7699),a=r(5513),s=r(3771);class l extends a.Parser{priority=10;parse(e,t){switch(t){case"x":return(0,s.parseTimezonePattern)(o.timezonePatterns.basicOptionalMinutes,e);case"xx":return(0,s.parseTimezonePattern)(o.timezonePatterns.basic,e);case"xxxx":return(0,s.parseTimezonePattern)(o.timezonePatterns.basicOptionalSeconds,e);case"xxxxx":return(0,s.parseTimezonePattern)(o.timezonePatterns.extendedOptionalSeconds,e);default:return(0,s.parseTimezonePattern)(o.timezonePatterns.extended,e)}}set(e,t,r){return t.timestampIsSet?e:(0,n.constructFrom)(e,e.getTime()-(0,i.getTimezoneOffsetInMilliseconds)(e)-r)}incompatibleTokens=["t","T","X"]}t.ISOTimezoneParser=l},6024:(e,t,r)=>{"use strict";t.differenceInCalendarQuarters=function(e,t,r){const[o,a]=(0,n.normalizeDates)(r?.in,e,t),s=o.getFullYear()-a.getFullYear(),l=(0,i.getQuarter)(o)-(0,i.getQuarter)(a);return 4*s+l};var n=r(8256),i=r(8397)},6032:(e,t,r)=>{"use strict";t.getDefaultOptions=function(){return Object.assign({},(0,n.getDefaultOptions)())};var n=r(6755)},6107:(e,t,r)=>{"use strict";t.startOfISOWeek=function(e,t){return(0,n.startOfWeek)(e,{...t,weekStartsOn:1})};var n=r(5472)},6159:(e,t,r)=>{"use strict";t.getWeeksInMonth=function(e,t){const r=(0,a.toDate)(e,t?.in);return(0,n.differenceInCalendarWeeks)((0,i.lastDayOfMonth)(r,t),(0,o.startOfMonth)(r,t),t)+1};var n=r(4746),i=r(9404),o=r(7710),a=r(4446)},6179:(e,t,r)=>{"use strict";t.formatISO=function(e,t){const r=(0,i.toDate)(e,t?.in);if(isNaN(+r))throw new RangeError("Invalid time value");const o=t?.format??"extended",a=t?.representation??"complete";let s="",l="";const c="extended"===o?"-":"",u="extended"===o?":":"";if("time"!==a){const e=(0,n.addLeadingZeros)(r.getDate(),2),t=(0,n.addLeadingZeros)(r.getMonth()+1,2);s=`${(0,n.addLeadingZeros)(r.getFullYear(),4)}${c}${t}${c}${e}`}if("date"!==a){const e=r.getTimezoneOffset();if(0!==e){const t=Math.abs(e);l=`${e<0?"+":"-"}${(0,n.addLeadingZeros)(Math.trunc(t/60),2)}:${(0,n.addLeadingZeros)(t%60,2)}`}else l="Z";s=`${s}${""===s?"":"T"}${[(0,n.addLeadingZeros)(r.getHours(),2),(0,n.addLeadingZeros)(r.getMinutes(),2),(0,n.addLeadingZeros)(r.getSeconds(),2)].join(u)}${l}`}return s};var n=r(2554),i=r(4446)},6228:(e,t,r)=>{"use strict";t.monthsToQuarters=function(e){const t=e/n.monthsInQuarter;return Math.trunc(t)};var n=r(8052)},6234:(e,t,r)=>{"use strict";t.getMinutes=function(e,t){return(0,n.toDate)(e,t?.in).getMinutes()};var n=r(4446)},6245:(e,t,r)=>{"use strict";t.eachYearOfInterval=function(e,t){const{start:r,end:o}=(0,n.normalizeInterval)(t?.in,e);let a=+r>+o;const s=a?+r:+o,l=a?o:r;l.setHours(0,0,0,0),l.setMonth(0,1);let c=t?.step??1;if(!c)return[];c<0&&(c=-c,a=!a);const u=[];for(;+l<=s;)u.push((0,i.constructFrom)(r,l)),l.setFullYear(l.getFullYear()+c);return a?u.reverse():u};var n=r(5909),i=r(2956)},6249:(e,t,r)=>{"use strict";t.lastDayOfISOWeek=function(e,t){return(0,n.lastDayOfWeek)(e,{...t,weekStartsOn:1})};var n=r(2994)},6265:(e,t,r)=>{"use strict";t.DayPeriodParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=80;parse(e,t,r){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours((0,i.dayPeriodEnumToHours)(r),0,0,0),e}incompatibleTokens=["a","b","t","T"]}t.DayPeriodParser=o},6309:(e,t,r)=>{"use strict";t.StandAloneMonthParser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=110;parse(e,t,r){const i=e=>e-1;switch(t){case"L":return(0,o.mapValue)((0,o.parseNumericPattern)(n.numericPatterns.month,e),i);case"LL":return(0,o.mapValue)((0,o.parseNDigits)(2,e),i);case"Lo":return(0,o.mapValue)(r.ordinalNumber(e,{unit:"month"}),i);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}t.StandAloneMonthParser=a},6322:(e,t,r)=>{"use strict";t.subISOWeekYears=function(e,t,r){return(0,n.addISOWeekYears)(e,-t,r)};var n=r(2945)},6339:(e,t,r)=>{"use strict";t.getTimezoneOffsetInMilliseconds=function(e){const t=(0,n.toDate)(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r};var n=r(4446)},6368:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r;return"[object Object]"===t.call(e)&&(null===(r=Object.getPrototypeOf(e))||r===Object.getPrototypeOf({}))}},6379:(e,t,r)=>{"use strict";t.addMonths=function(e,t,r){const o=(0,i.toDate)(e,r?.in);
6if(isNaN(t))return(0,n.constructFrom)(r?.in||e,NaN);if(!t)return o;const a=o.getDate(),s=(0,n.constructFrom)(r?.in||e,o.getTime());s.setMonth(o.getMonth()+t+1,0);const l=s.getDate();return a>=l?s:(o.setFullYear(s.getFullYear(),s.getMonth(),a),o)};var n=r(2956),i=r(4446)},6387:(e,t,r)=>{"use strict";t.isThisHour=function(e,t){return(0,i.isSameHour)((0,o.toDate)(e,t?.in),(0,n.constructNow)(t?.in||e))};var n=r(2700),i=r(3833),o=r(4446)},6482:(e,t,r)=>{"use strict";t.getOverlappingDaysInIntervals=function(e,t){const[r,a]=[+(0,o.toDate)(e.start),+(0,o.toDate)(e.end)].sort(((e,t)=>e-t)),[s,l]=[+(0,o.toDate)(t.start),+(0,o.toDate)(t.end)].sort(((e,t)=>e-t));if(!(r<l&&s<a))return 0;const c=s<r?r:s,u=c-(0,n.getTimezoneOffsetInMilliseconds)(c),d=l>a?a:l,h=d-(0,n.getTimezoneOffsetInMilliseconds)(d);return Math.ceil((h-u)/i.millisecondsInDay)};var n=r(6339),i=r(8052),o=r(4446)},6573:(e,t,r)=>{"use strict";t.isThisSecond=function(e){return(0,i.isSameSecond)(e,(0,n.constructNow)(e))};var n=r(2700),i=r(9435)},6601:(e,t,r)=>{"use strict";t.endOfYesterday=function(e){const t=(0,i.constructNow)(e?.in),r=(0,n.constructFrom)(e?.in,0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()-1),r.setHours(23,59,59,999),r};var n=r(2956),i=r(2700)},6605:(e,t,r)=>{"use strict";t.differenceInYears=function(e,t,r){const[a,s]=(0,n.normalizeDates)(r?.in,e,t),l=(0,i.compareAsc)(a,s),c=Math.abs((0,o.differenceInCalendarYears)(a,s));a.setFullYear(1584),s.setFullYear(1584);const u=(0,i.compareAsc)(a,s)===-l,d=l*(c-+u);return 0===d?0:d};var n=r(8256),i=r(6789),o=r(4875)},6633:(e,t,r)=>{"use strict";t.AMPMParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=80;parse(e,t,r){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours((0,i.dayPeriodEnumToHours)(r),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}t.AMPMParser=o},6638:(e,t,r)=>{"use strict";t.StandAloneLocalDayParser=void 0;var n=r(4395),i=r(5513),o=r(3771);class a extends i.Parser{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return(0,o.mapValue)((0,o.parseNDigits)(t.length,e),i);case"co":return(0,o.mapValue)(r.ordinalNumber(e,{unit:"day"}),i);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,i){return(e=(0,n.setDay)(e,r,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}t.StandAloneLocalDayParser=a},6660:(e,t,r)=>{"use strict";t.startOfDecade=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getFullYear(),o=10*Math.floor(i/10);return r.setFullYear(o,0,1),r.setHours(0,0,0,0),r};var n=r(4446)},6675:e=>{function t(e,t){const r=new RegExp(t,"g"),n=e.match(r);return n?n.length:0}e.exports=t,e.exports.default=t},6686:(e,t,r)=>{"use strict";t.lightFormat=function(e,t){const r=(0,o.toDate)(e);if(!(0,i.isValid)(r))throw new RangeError("Invalid time value");const u=t.match(a);if(!u)return"";return u.map((e=>{if("''"===e)return"'";const t=e[0];if("'"===t)return function(e){const t=e.match(s);return t?t[1].replace(l,"'"):e}(e);const i=n.lightFormatters[t];if(i)return i(r,e);if(t.match(c))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return e})).join("")},Object.defineProperty(t,"lightFormatters",{enumerable:!0,get:function(){return n.lightFormatters}});var n=r(8441),i=r(7489),o=r(4446);const a=/(\w)\1*|''|'(''|[^'])+('|$)|./g,s=/^'([^]*?)'?$/,l=/''/g,c=/[a-zA-Z]/},6689:(e,t,r)=>{"use strict";t.addSeconds=function(e,t,r){return(0,n.addMilliseconds)(e,1e3*t,r)};var n=r(4280)},6708:(e,t,r)=>{"use strict";t.getWeekYear=function(e,t){const r=(0,a.toDate)(e,t?.in),s=r.getFullYear(),l=(0,n.getDefaultOptions)(),c=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,u=(0,i.constructFrom)(t?.in||e,0);u.setFullYear(s+1,0,c),u.setHours(0,0,0,0);const d=(0,o.startOfWeek)(u,t),h=(0,i.constructFrom)(t?.in||e,0);h.setFullYear(s,0,c),h.setHours(0,0,0,0);const f=(0,o.startOfWeek)(h,t);return+r>=+d?s+1:+r>=+f?s:s-1};var n=r(6755),i=r(2956),o=r(5472),a=r(4446)},6755:(e,t)=>{"use strict";t.getDefaultOptions=function(){return r},t.setDefaultOptions=function(e){r=e};let r={}},6789:(e,t,r)=>{"use strict";t.compareAsc=function(e,t){const r=+(0,n.toDate)(e)-+(0,n.toDate)(t);if(r<0)return-1;if(r>0)return 1;return r};var n=r(4446)},6808:(e,t,r)=>{"use strict";t.fromUnixTime=function(e,t){return(0,n.toDate)(1e3*e,t?.in)};var n=r(4446)},6842:(e,t,r)=>{"use strict";t.Hour1To24Parser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=70;parse(e,t,r){switch(t){case"k":return(0,o.parseNumericPattern)(n.numericPatterns.hour24h,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,r){const n=r<=24?r%24:r;return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}t.Hour1To24Parser=a},6862:(e,t,r)=>{"use strict";t.EraParser=void 0;var n=r(5513);class i extends n.Parser{priority=140;parse(e,t,r){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}
6set(e,t,r){return t.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}t.EraParser=i},6903:(e,t,r)=>{"use strict";t.endOfDecade=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getFullYear(),o=9+10*Math.floor(i/10);return r.setFullYear(o,11,31),r.setHours(23,59,59,999),r};var n=r(4446)},6936:(e,t,r)=>{"use strict";t.startOfSecond=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setMilliseconds(0),r};var n=r(4446)},6944:(e,t,r)=>{"use strict";t.startOfQuarter=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getMonth(),o=i-i%3;return r.setMonth(o,1),r.setHours(0,0,0,0),r};var n=r(4446)},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,a,c;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
6,set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7035:(e,t,r)=>{"use strict";t.setMonth=function(e,t,r){const a=(0,o.toDate)(e,r?.in),s=a.getFullYear(),l=a.getDate(),c=(0,n.constructFrom)(r?.in||e,0);c.setFullYear(s,t,15),c.setHours(0,0,0,0);const u=(0,i.getDaysInMonth)(c);return a.setMonth(t,Math.min(l,u)),a};var n=r(2956),i=r(2575),o=r(4446)},7044:(e,t,r)=>{"use strict";t.getTime=function(e){return+(0,n.toDate)(e)};var n=r(4446)},7083:(e,t)=>{"use strict";t.longFormatters=void 0;const r=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},n=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}};t.longFormatters={p:n,P:(e,t)=>{const i=e.match(/(P+)(p+)?/)||[],o=i[1],a=i[2];if(!a)return r(e,t);let s;switch(o){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"})}return s.replace("{{date}}",r(o,t)).replace("{{time}}",n(a,t))}}},7144:(e,t,r)=>{"use strict";t.parseJSON=function(e,t){const r=e.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);return r?(0,n.toDate)(Date.UTC(+r[1],+r[2]-1,+r[3],+r[4]-(+r[9]||0)*("-"==r[8]?-1:1),+r[5]-(+r[10]||0)*("-"==r[8]?-1:1),+r[6],+((r[7]||"0")+"00").substring(0,3)),t?.in):(0,n.toDate)(NaN,t?.in)};var n=r(4446)},7181:(e,t,r)=>{"use strict";t.formatLong=void 0;var n=r(5624);t.formatLong={date:(0,n.buildFormatLongFn)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:(0,n.buildFormatLongFn)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n.buildFormatLongFn)({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})}},7256:(e,t,r)=>{"use strict";t.isMatch=function(e,t,r){return(0,n.isValid)((0,i.parse)(e,t,new Date,r))};var n=r(7489),i=r(4266)},7265:e=>{e.exports={fr:{name:"France",bbox:[[-4.59235,41.380007],[9.560016,51.148506]]},us:{name:"United States",bbox:[[-171.791111,18.91619],[-66.96466,71.357764]]},ru:{name:"Russia",bbox:[[19.66064,41.151416],[190.10042,81.2504]]},ca:{name:"Canada",bbox:[[-140.99778,41.675105],[-52.648099,83.23324]]}}},7267:e=>{"use strict";e.exports=function(e,t){var r=function(e,r){return-1!==t.indexOf(e)&&void 0!==r};return"function"==typeof t&&(r=t),Object.keys(e).filter((function(t){return r(t,e[t])})).reduce((function(t,r){return t[r]=e[r],t}),{})}},7310:(e,t,r)=>{"use strict";t.LocalWeekYearParser=void 0;var n=r(6708),i=r(5472),o=r(5513),a=r(3771);class s extends o.Parser{priority=130;parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return(0,a.mapValue)((0,a.parseNDigits)(4,e),n);case"Yo":return(0,a.mapValue)(r.ordinalNumber(e,{unit:"year"}),n);default:return(0,a.mapValue)((0,a.parseNDigits)(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r,o){const s=(0,n.getWeekYear)(e,o);if(r.isTwoDigitYear){const t=(0,a.normalizeTwoDigitYear)(r.year,s);return e.setFullYear(t,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),(0,i.startOfWeek)(e,o)}const l="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(l,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),(0,i.startOfWeek)(e,o)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}t.LocalWeekYearParser=s},7369:(e,t,r)=>{"use strict";t.ISODayParser=void 0;var n=r(2240),i=r(5513),o=r(3771);class a extends i.Parser{priority=90;parse(e,t,r){const n=e=>0===e?7:e;switch(t){case"i":case"ii":return(0,o.parseNDigits)(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return(0,o.mapValue)(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiii":return(0,o.mapValue)(r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiiii":return(0,o.mapValue)(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);default:return(0,o.mapValue)(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n)}}validate(e,t){return t>=1&&t<=7}set(e,t,r){return(e=(0,n.setISODay)(e,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}t.ISODayParser=a},7374:(e,t,r)=>{"use strict";t.nextMonday=function(e,t){return(0,n.nextDay)(e,1,t)};var n=r(64)},7379:e=>{function t(e,t,r){const n=r&&r.debug||!1;
6n&&console.log("[xml-utils] getting "+t+" in "+e);const i="object"==typeof e?e.outer:e,o=i.slice(0,i.indexOf(">")+1),a=['"',"'"];for(let e=0;e<a.length;e++){const r=a[e],i=t+"\\="+r+"([^"+r+"]*)"+r;n&&console.log("[xml-utils] pattern:",i);const s=new RegExp(i).exec(o);if(n&&console.log("[xml-utils] match:",s),s)return s[1]}}e.exports=t,e.exports.default=t},7397:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,i),!0;case 5:return u.fn.call(u.context,t,n,i,o),!0;case 6:return u.fn.call(u.context,t,n,i,o,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,i);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||i&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s},7489:(e,t,r)=>{"use strict";t.isValid=function(e){return!(!(0,n.isDate)(e)&&"number"!=typeof e||isNaN(+(0,i.toDate)(e)))};var n=r(4337),i=r(4446)},7510:e=>{e.exports=function(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)t.call(n,i)&&(e[i]=n[i])}return e};var t=Object.prototype.hasOwnProperty},7516:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAnyArrayBuffer=function(e){return function(e){try{return!(0,n.ArrayIsArray)(e)&&((0,n.ArrayBufferPrototypeGetByteLength)(e),!0)}catch(e){return!1}}(e)||o(e)},t.isCanonicalIntegerIndexString=function(e){if("string"!=typeof e)return!1;const t=+e;if(e!==t+"")return!1;if(!(0,n.NumberIsFinite)(t))return!1;return t===(0,n.MathTrunc)(t)},t.isNativeBigIntTypedArray=function(e){const t=(0,n.TypedArrayPrototypeGetSymbolToStringTag)(e);return"BigInt64Array"===t||"BigUint64Array"===t},t.isNativeTypedArray=i,t.isObject=function(e){return null!==e&&"object"==typeof e||"function"==typeof e},t.isObjectLike=function(e){return null!==e&&"object"==typeof e},t.isOrdinaryArray=function(e){if(!(0,n.ArrayIsArray)(e))return!1;return e[n.SymbolIterator]===n.NativeArrayPrototypeSymbolIterator&&n.ArrayIteratorPrototype.next===n.ArrayIteratorPrototypeNext},t.isOrdinaryNativeTypedArray=function(e){if(!i(e))return!1;return e[n.SymbolIterator]===n.NativeTypedArrayPrototypeSymbolIterator&&n.ArrayIteratorPrototype.next===n.ArrayIteratorPrototypeNext},t.isSharedArrayBuffer=o;var n=r(2628);function i(e){return void 0!==(0,n.TypedArrayPrototypeGetSymbolToStringTag)(e)}function o(e){if(null===n.NativeSharedArrayBuffer)return!1;try{return(0,n.SharedArrayBufferPrototypeGetByteLength)(e),!0}catch(e){return!1}}},7519:(e,t,r)=>{"use strict";t.getMonth=function(e,t){return(0,n.toDate)(e,t?.in).getMonth()};var n=r(4446)},7520:(e,t)=>{"use strict";t.buildMatchPatternFn=function(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;return{value:a,rest:t.slice(i.length)}}}},7568:(e,t,r)=>{"use strict";t.parsers=void 0;var n=r(6862),i=r(1497),o=r(7310),a=r(5304),s=r(8042),l=r(4400),c=r(8259),u=r(9150),d=r(6309),h=r(2577),f=r(5079),p=r(8589),g=r(8490
6),m=r(7702),y=r(5303),_=r(6638),v=r(7369),b=r(6633),x=r(3653),w=r(6265),S=r(1869),k=r(9612),T=r(2167),I=r(6842),M=r(4042),E=r(5078),P=r(3495),A=r(3306),C=r(5982),R=r(5261),L=r(5942);t.parsers={G:new n.EraParser,y:new i.YearParser,Y:new o.LocalWeekYearParser,R:new a.ISOWeekYearParser,u:new s.ExtendedYearParser,Q:new l.QuarterParser,q:new c.StandAloneQuarterParser,M:new u.MonthParser,L:new d.StandAloneMonthParser,w:new h.LocalWeekParser,I:new f.ISOWeekParser,d:new p.DateParser,D:new g.DayOfYearParser,E:new m.DayParser,e:new y.LocalDayParser,c:new _.StandAloneLocalDayParser,i:new v.ISODayParser,a:new b.AMPMParser,b:new x.AMPMMidnightParser,B:new w.DayPeriodParser,h:new S.Hour1to12Parser,H:new k.Hour0to23Parser,K:new T.Hour0To11Parser,k:new I.Hour1To24Parser,m:new M.MinuteParser,s:new E.SecondParser,S:new P.FractionOfSecondParser,X:new A.ISOTimezoneWithZParser,x:new C.ISOTimezoneParser,t:new R.TimestampSecondsParser,T:new L.TimestampMillisecondsParser}},7583:(e,t,r)=>{"use strict";var n=r(3115),i=r(3086);e.exports=function(e){return function(t){var r;r=n.prototype.isPrototypeOf(t)?t:i(t);var o=Object.create(e);return o.client=r,o}}},7591:(e,t,r)=>{"use strict";t.addDays=function(e,t,r){const o=(0,i.toDate)(e,r?.in);return isNaN(t)?(0,n.constructFrom)(r?.in||e,NaN):t?(o.setDate(o.getDate()+t),o):o};var n=r(2956),i=r(4446)},7617:(e,t,r)=>{"use strict";t.closestTo=function(e,t,r){const[a,...s]=(0,n.normalizeDates)(r?.in,e,...t),l=(0,i.closestIndexTo)(a,s);if("number"==typeof l&&isNaN(l))return(0,o.constructFrom)(a,NaN);if(void 0!==l)return s[l]};var n=r(8256),i=r(8741),o=r(2956)},7624:(e,t,r)=>{"use strict";t.endOfYear=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getFullYear();return r.setFullYear(i+1,0,0),r.setHours(23,59,59,999),r};var n=r(4446)},7626:(e,t,r)=>{"use strict";t.add=function(e,t,r){const{years:s=0,months:l=0,weeks:c=0,days:u=0,hours:d=0,minutes:h=0,seconds:f=0}=t,p=(0,a.toDate)(e,r?.in),g=l||s?(0,i.addMonths)(p,l+12*s):p,m=u||c?(0,n.addDays)(g,u+7*c):g,y=1e3*(f+60*(h+60*d));return(0,o.constructFrom)(r?.in||e,+m+y)};var n=r(7591),i=r(6379),o=r(2956),a=r(4446)},7628:e=>{e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},7633:(e,t,r)=>{"use strict";t.getMilliseconds=function(e){return(0,n.toDate)(e).getMilliseconds()};var n=r(4446)},7699:(e,t)=>{"use strict";t.timezonePatterns=t.numericPatterns=void 0;t.numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},t.timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/}},7702:(e,t,r)=>{"use strict";t.DayParser=void 0;var n=r(4395),i=r(5513);class o extends i.Parser{priority=90;parse(e,t,r){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,i){return(e=(0,n.setDay)(e,r,i)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}t.DayParser=o},7710:(e,t,r)=>{"use strict";t.startOfMonth=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r};var n=r(4446)},7724:(e,t,r)=>{"use strict";t.nextThursday=function(e,t){return(0,n.nextDay)(e,4,t)};var n=r(64)},7777:(e,t,r)=>{"use strict";t.compareDesc=function(e,t){const r=+(0,n.toDate)(e)-+(0,n.toDate)(t);if(r>0)return-1;if(r<0)return 1;return r};var n=r(4446)},7816:(e,t,r)=>{"use strict";t.setWeekYear=function(e,t,r){const l=(0,n.getDefaultOptions)(),c=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,u=(0,o.differenceInCalendarDays)((0,s.toDate)(e,r?.in),(0,a.startOfWeekYear)(e,r),r),d=(0,i.constructFrom)(r?.in||e,0);d.setFullYear(t,0,c),d.setHours(0,0,0,0);const h=(0,a.startOfWeekYear)(d,r);return h.setDate(h.getDate()+u),h};var n=r(6755),i=r(2956),o=r(5506),a=r(3040),s=r(4446)},7838:(e,t,r)=>{"use strict";t.eachQuarterOfInterval=function(e,t){const{start:r,end:s}=(0,n.normalizeInterval)(t?.in,e);let l=+r>+s;const c=l?+(0,a.startOfQuarter)(r):+(0,a.startOfQuarter)(s);let u=l?(0,a.startOfQuarter)(s):(0,a.startOfQuarter)(r),d=t?.step??1;if(!d)return[];d<0&&(d=-d,l=!l);const h=[];for(;+u<=c;)h.push((0,o.constructFrom)(r,u)),u=(0,i.addQuarters)(u,d);return l?h.reverse():h};var n=r(5909),i=r(1149),o=r(2956),a=r(6944)},7851:(e,t,r)=>{"use strict";t.isWednesday=function(e,t){return 3===(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},7857:e=>{"use strict";e.exports=function(e){return e?e.split(/,\s*</).reduce((function(e,t){var r=function(e){var t=e.match(/<?([^>]*)>(.*)/);if(!t)return null;var r=t[1],n=t[2].split(";"),i=null,o=n.reduce((function(e,t){var r=function(e){var t=e.match(/\s*(.+)\s*=\s*"?([^"]+)"?/);return t?{key:t[1],value:t[2]}:null}(t);return r?"rel"===r.key?(i||(i=r.value),e):(e[r.key]=r.value,e):e}),{});return i?{url:r,rel:i,params:o}:null}(t);
6return r?(r.rel.split(/\s+/).forEach((function(t){e[t]||(e[t]={url:r.url,params:r.params})})),e):e}),{}):{}}},7861:(e,t,r)=>{"use strict";t.ValueSetter=t.Setter=t.DateTimezoneSetter=void 0;var n=r(2956),i=r(4082);class o{subPriority=0;validate(e,t){return!0}}t.Setter=o;t.ValueSetter=class extends o{constructor(e,t,r,n,i){super(),this.value=e,this.validateValue=t,this.setValue=r,this.priority=n,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,r){return this.setValue(e,t,this.value,r)}};t.DateTimezoneSetter=class extends o{priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>(0,n.constructFrom)(t,e))}set(e,t){return t.timestampIsSet?e:(0,n.constructFrom)(e,(0,i.transpose)(e,this.context))}}},7865:(e,t,r)=>{"use strict";t.isPast=function(e){return+(0,n.toDate)(e)<Date.now()};var n=r(4446)},7906:e=>{"use strict";e.exports={placeholder:{de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"}}},7909:(e,t,r)=>{"use strict";t.isThisMinute=function(e){return(0,i.isSameMinute)(e,(0,n.constructNow)(e))};var n=r(2700),i=r(8847)},7957:(e,t,r)=>{"use strict";t.roundToNearestMinutes=function(e,t){const r=t?.nearestTo??1;if(r<1||r>30)return(0,i.constructFrom)(e,NaN);const a=(0,o.toDate)(e,t?.in),s=a.getSeconds()/60,l=a.getMilliseconds()/1e3/60,c=a.getMinutes()+s+l,u=t?.roundingMethod??"round",d=(0,n.getRoundingMethod)(u)(c/r)*r;return a.setMinutes(d,0,0),a};var n=r(1331),i=r(2956),o=r(4446)},7968:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.THIS_IS_NOT_AN_OBJECT="This is not an object",t.THIS_IS_NOT_A_FLOAT16ARRAY_OBJECT="This is not a Float16Array object",t.THIS_CONSTRUCTOR_IS_NOT_A_SUBCLASS_OF_FLOAT16ARRAY="This constructor is not a subclass of Float16Array",t.THE_CONSTRUCTOR_PROPERTY_VALUE_IS_NOT_AN_OBJECT="The constructor property value is not an object",t.SPECIES_CONSTRUCTOR_DIDNT_RETURN_TYPEDARRAY_OBJECT="Species constructor didn't return TypedArray object",t.DERIVED_CONSTRUCTOR_CREATED_TYPEDARRAY_OBJECT_WHICH_WAS_TOO_SMALL_LENGTH="Derived constructor created TypedArray object which was too small length",t.ATTEMPTING_TO_ACCESS_DETACHED_ARRAYBUFFER="Attempting to access detached ArrayBuffer",t.CANNOT_CONVERT_UNDEFINED_OR_NULL_TO_OBJECT="Cannot convert undefined or null to object",t.CANNOT_MIX_BIGINT_AND_OTHER_TYPES="Cannot mix BigInt and other types, use explicit conversions",t.ITERATOR_PROPERTY_IS_NOT_CALLABLE="@@iterator property is not callable",t.REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE="Reduce of empty array with no initial value",t.THE_COMPARISON_FUNCTION_MUST_BE_EITHER_A_FUNCTION_OR_UNDEFINED="The comparison function must be either a function or undefined",t.OFFSET_IS_OUT_OF_BOUNDS="Offset is out of bounds"},7995:(e,t,r)=>{"use strict";var n=r(3086);e.exports=n},8032:(e,t,r)=>{"use strict";t.isTomorrow=function(e,t){return(0,o.isSameDay)(e,(0,n.addDays)((0,i.constructNow)(t?.in||e),1),t)};var n=r(7591),i=r(2700),o=r(9691)},8040:(e,t,r)=>{"use strict";var n=r(8910);e.exports=function(e){var t,r=e.type||n.ERROR_HTTP;if(e.body)try{t=JSON.parse(e.body)}catch(r){t=e.body}else t=null;var i=e.message||null;i||("string"==typeof t?i=t:t&&"string"==typeof t.message?i=t.message:r===n.ERROR_REQUEST_ABORTED&&(i="Request aborted")),this.message=i,this.type=r,this.statusCode=e.statusCode||null,this.request=e.request,this.body=t}},8042:(e,t,r)=>{"use strict";t.ExtendedYearParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=130;parse(e,t){return"u"===t?(0,i.parseNDigitsSigned)(4,e):(0,i.parseNDigitsSigned)(t.length,e)}set(e,t,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}t.ExtendedYearParser=o},8052:(e,t)=>{"use strict";t.secondsInYear=t.secondsInWeek=t.secondsInQuarter=t.secondsInMonth=t.secondsInMinute=t.secondsInHour=t.secondsInDay=t.quartersInYear=t.monthsInYear=t.monthsInQuarter=t.minutesInYear=t.minutesInMonth=t.minutesInHour=t.minutesInDay=t.minTime=t.millisecondsInWeek=t.millisecondsInSecond=t.millisecondsInMinute=t.millisecondsInHour=t.millisecondsInDay=t.maxTime=t.daysInYear=t.daysInWeek=t.constructFromSymbol=void 0;t.daysInWeek=7;const r=t.daysInYear=365.2425,n=t.maxTime=24*Math.pow(10,8)*60*60*1e3,i=(t.minTime=-n,t.millisecondsInWeek=6048e5,t.millisecondsInDay=864e5,t.millisecondsInMinute=6e4,t.millisecondsInHour=36e5,t.millisecondsInSecond=1e3,t.minutesInYear=525600,t.minutesInMonth=43200,t.minutesInDay=1440,t.minutesInHour=60,t.monthsInQuarter=3,t.monthsInYear=12,t.quartersInYear=4,t.secondsInHour=3600),o=(t.secondsInMinute=60,t.secondsInDay=24*i),a=(t.secondsInWeek=7*o,t.secondsInYear=o*r),s=t.secondsInMonth=a/12;t.secondsInQuarter=3*s,t.constructFromSymbol=Symbol.for("constructDateFrom")},8092:(e,t,r)=>{"use strict";t.previousDay=function(e,t,r){let o=(0,n.getDay)(e,r)-t;o<=0&&(o+=7);return(0,i.subDays)(e,o,r)};var n=r(1591),i=r(3224)},8122:(e,t,r)=>{"use strict";var n=r(4329).Ak;function i(e){this.origin=e.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=e.accessToken,this.version="0.3.0",this.pluginSessionID=this.generateSessionID(),this.sessionIncrementer=0,this.userAgent=this.getUserAgent(),this.options=e,this.send=this.send.bind(this),this.countries=e.countries?e.countries.split(","):null,this.types=e.types?e.types.split(","):null,this.bbox=e.bbox?e.bbox:null,this.language=e.language?e.language.split(","):null,this.limit=e.limit?+e.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(e),this.eventQueue=new Array,this.flushInterval=e.flushInterval||1e3,this.maxQueueSize=e.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}i.prototype={select:function(e,t){var r=this.getEventPayload("search.select",t,{selectedFeature:e});if(r&&(r.resultIndex!==this.lastSentIndex||r.queryString!==this.lastSentInput)&&-1!=r.resultIndex)return this.lastSentIndex=r.resultIndex,this.lastSentInput=r.queryString,this.push(r)},start:function(e){var t=this.getEventPayload("search.start",e);if(t)return this.push(t)},keyevent:function(e,t){if(e.key&&!e.metaKey&&-1===[9,27,37,39,13,38,40].indexOf(e.keyCode)){var r=this.getEventPayload("search.keystroke",t,{key:e.key});if(r)return this.push(r)}},send:function(e,t){if(!this.enableEventLogging)return t?t():void 0;var r=this.getRequestOptions(e);this.request(r,function(e){return e?this.handleError(e,t):t?t():void 0}.bind(this))},getRequestOptions:function(e){return Array.isArray(e)||(e=[e]),{method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}},getEventPayload:function(e,t,r={}){if("search.select"===e&&!r.selectedFeature||"search.keystroke"===e&&!r.key)return null;var n;if(t.options.proximity)if("object"==typeof t.options.proximity)n=[t.options.proximity.longitude,t.options.proximity.latitude];else if("ip"===t.options.proximity){var i=t._headers?t._headers["ip-proximity"]:null;n=i&&"string"==typeof i?i.split(",").map(parseFloat):[999,999]}else n=t.options.proximity;else n=null;var o=t._map?t._map.getZoom():void 0,a={event:e,version:this.getEventSchemaVersion(e),created:+new Date,sessionIdentifier:this.getSessionId(),country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:t.options.autocomplete,fuzzyMatch:t.options.fuzzyMatch,proximity:n,limit:t.options.limit,routing:t.options.routing,worldview:t.options.worldview,mapZoom:o,keyboardLocale:this.locale};if("search.select"===e?a.queryString=t.inputString:"search.select"!=e&&t._inputEl?a.queryString=t._inputEl.value:a.queryString=t.inputString,["search.keystroke","search.select"].includes(e)&&(a.path="geocoding/v5/mapbox.places"),"search.keystroke"===e&&r.key)a.lastAction=r.key;else if("search.select"===e&&r.selectedFeature){var s=r.selectedFeature,l=this.getSelectedIndex(s,t);
6if(a.resultIndex=l,a.resultPlaceName=s.place_name,a.resultId=s.id,s.properties&&(a.resultMapboxId=s.properties.mapbox_id),t._typeahead){var c=t._typeahead.data;c&&c.length>0&&(a.suggestionIds=this.getSuggestionIds(c),a.suggestionNames=this.getSuggestionNames(c),a.suggestionTypes=this.getSuggestionTypes(c),a.suggestionSources=this.getSuggestionSources(c))}}return this.validatePayload(a)?a:null},request:function(e,t){var r=new XMLHttpRequest;for(var n in r.onreadystatechange=function(){if(4==this.readyState)return 204==this.status?t(null):t(this.statusText)},r.open(e.method,e.host+"/"+e.path,!0),e.headers){var i=e.headers[n];r.setRequestHeader(n,i)}r.send(e.body)},handleError:function(e,t){if(t)return t(e)},generateSessionID:function(){return n()},getSessionId:function(){return this.pluginSessionID+"."+this.sessionIncrementer},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(e,t){if(t._typeahead){var r=t._typeahead.data,n=e.id;return r.map((function(e){return e.id})).indexOf(n)}},getSuggestionIds:function(e){return e.map((function(e){return e.properties?e.properties.mapbox_id||"":e.id||""}))},getSuggestionNames:function(e){return e.map((function(e){return e.place_name||""}))},getSuggestionTypes:function(e){return e.map((function(e){return e.place_type&&Array.isArray(e.place_type)&&e.place_type[0]||""}))},getSuggestionSources:function(e){return e.map((function(e){return e._source||""}))},getEventSchemaVersion:function(e){return["search.keystroke","search.select"].includes(e)?"2.2":"2.0"},validatePayload:function(e){if(!e||!e.event)return!1;var t=e.event;return"search.start"===t?this.objectHasRequiredProps(e,["event","created","sessionIdentifier","queryString"]):"search.keystroke"===t?this.objectHasRequiredProps(e,["event","created","sessionIdentifier","queryString","lastAction"]):"search.select"!==t||this.objectHasRequiredProps(e,["event","created","sessionIdentifier","queryString","resultIndex","path","suggestionIds"])},objectHasRequiredProps:function(e,t){return t.every((function(t){return"queryString"===t?"string"==typeof e[t]&&e[t].length>0:void 0!==e[t]}))},shouldEnableLogging:function(e){return!1!==e.enableEventLogging&&(!e.origin||"https://api.mapbox.com"===e.origin)},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(e,t){this.eventQueue.push(e),(this.eventQueue.length>=this.maxQueueSize||t)&&this.flush()},remove:function(){this.flush()}},e.exports=i},8164:(e,t,r)=>{"use strict";t.isFriday=function(e,t){return 5===(0,n.toDate)(e,t?.in).getDay()};var n=r(4446)},8186:e=>{e.exports=function(e){if(!e||!e.type)return null;var r=t[e.type];if(!r)return null;if("geometry"===r)return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]};if("feature"===r)return{type:"FeatureCollection",features:[e]};if("featurecollection"===r)return e};var t={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},8214:(e,t,r)=>{"use strict";t.clamp=function(e,t,r){const[a,s,l]=(0,n.normalizeDates)(r?.in,e,t.start,t.end);return(0,o.min)([(0,i.max)([a,s],r),l],r)};var n=r(8256),i=r(8873),o=r(4855)},8256:(e,t,r)=>{"use strict";t.normalizeDates=function(e,...t){const r=n.constructFrom.bind(null,e||t.find((e=>"object"==typeof e)));return t.map(r)};var n=r(2956)},8259:(e,t,r)=>{"use strict";t.StandAloneQuarterParser=void 0;var n=r(5513),i=r(3771);class o extends n.Parser{priority=120;parse(e,t,r){switch(t){case"q":case"qq":return(0,i.parseNDigits)(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}t.StandAloneQuarterParser=o},8284:(e,t,r)=>{"use strict";t.getISODay=function(e,t){const r=(0,n.toDate)(e,t?.in).getDay();return 0===r?7:r};var n=r(4446)},8290:(e,t,r)=>{"use strict";t.startOfDay=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setHours(0,0,0,0),r};var n=r(4446)},8377:e=>{function t(){}t.prototype={isSupport:function(){return Boolean(window.navigator.geolocation)},getCurrentPosition:function(){const e={enableHighAccuracy:!0};return new Promise((function(t,r){window.navigator.geolocation.getCurrentPosition(t,r,e)}
vendor: 2,384 bytes, line 6
6))}},e.exports=t},8397:(e,t,r)=>{"use strict";t.getQuarter=function(e,t){const r=(0,n.toDate)(e,t?.in);return Math.trunc(r.getMonth()/3)+1};var n=r(4446)},8417:(e,t,r)=>{"use strict";t.subYears=function(e,t,r){return(0,n.addYears)(e,-t,r)};var n=r(1440)},8441:(e,t,r)=>{"use strict";t.lightFormatters=void 0;var n=r(2554);t.lightFormatters={y(e,t){const r=e.getFullYear(),i=r>0?r:1-r;return(0,n.addLeadingZeros)("yy"===t?i%100:i,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):(0,n.addLeadingZeros)(r+1,2)},d:(e,t)=>(0,n.addLeadingZeros)(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>(0,n.addLeadingZeros)(e.getHours()%12||12,t.length),H:(e,t)=>(0,n.addLeadingZeros)(e.getHours(),t.length),m:(e,t)=>(0,n.addLeadingZeros)(e.getMinutes(),t.length),s:(e,t)=>(0,n.addLeadingZeros)(e.getSeconds(),t.length),S(e,t){const r=t.length,i=e.getMilliseconds(),o=Math.trunc(i*Math.pow(10,r-3));return(0,n.addLeadingZeros)(o,t.length)}}},8442:(e,t,r)=>{"use strict";t.weeksToDays=function(e){return Math.trunc(e*n.daysInWeek)};var n=r(8052)},8483:(e,t)=>{"use strict";t.formatRelative=void 0;const r={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};t.formatRelative=(e,t,n,i)=>r[e]},8490:(e,t,r)=>{"use strict";t.DayOfYearParser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=90;subpriority=1;parse(e,t,r){switch(t){case"D":case"DD":return(0,o.parseNumericPattern)(n.numericPatterns.dayOfYear,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){const r=e.getFullYear();return(0,o.isLeapYearIndex)(r)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}t.DayOfYearParser=a},8520:(e,t,r)=>{"use strict";t.isBefore=function(e,t){return+(0,n.toDate)(e)<+(0,n.toDate)(t)};var n=r(4446)},8542:(e,t,r)=>{"use strict";t.subQuarters=function(e,t,r){return(0,n.addQuarters)(e,-t,r)};var n=r(1149)},8556:(e,t,r)=>{const n=r(3614),i=r(8694),o=r(6675);function a(e,t,r){const a=r&&r.debug||!1,s=!(r&&!1===typeof r.nested),l=r&&r.startIndex||
60;a&&console.log("[xml-utils] starting findTagByName with",t," and ",r);const c=n(e,`<${t}[ \n>/]`,l);if(a&&console.log("[xml-utils] start:",c),-1===c)return;const u=e.slice(c+t.length);let d=i(u,"^[^<]*[ /]>",0);const h=-1!==d&&"/"===u[d-1];if(a&&console.log("[xml-utils] selfClosing:",h),!1===h)if(s){let e=0,r=1,n=0;for(;-1!==(d=i(u,"[ /]"+t+">",e));){const i=u.substring(e,d+1);if(r+=o(i,"<"+t+"[ \n\t>]"),n+=o(i,"</"+t+">"),n>=r)break;e=d}}else d=i(u,"[ /]"+t+">",0);const f=c+t.length+d+1;if(a&&console.log("[xml-utils] end:",f),-1===f)return;const p=e.slice(c,f);let g;return g=h?null:p.slice(p.indexOf(">")+1,p.lastIndexOf("<")),{inner:g,outer:p,start:c,end:f}}e.exports=a,e.exports.default=a},8563:(e,t,r)=>{"use strict";t.hoursToMilliseconds=function(e){return Math.trunc(e*n.millisecondsInHour)};var n=r(8052)},8589:(e,t,r)=>{"use strict";t.DateParser=void 0;var n=r(7699),i=r(5513),o=r(3771);const a=[31,28,31,30,31,30,31,31,30,31,30,31],s=[31,29,31,30,31,30,31,31,30,31,30,31];class l extends i.Parser{priority=90;subPriority=1;parse(e,t,r){switch(t){case"d":return(0,o.parseNumericPattern)(n.numericPatterns.date,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){const r=e.getFullYear(),n=(0,o.isLeapYearIndex)(r),i=e.getMonth();return n?t>=1&&t<=s[i]:t>=1&&t<=a[i]}set(e,t,r){return e.setDate(r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}t.DateParser=l},8595:(e,t,r)=>{"use strict";t.getISOWeeksInYear=function(e,t){const r=(0,o.startOfISOWeekYear)(e,t),a=+(0,o.startOfISOWeekYear)((0,n.addWeeks)(r,60))-+r;return Math.round(a/i.millisecondsInWeek)};var n=r(4073),i=r(8052),o=r(1152)},8613:(e,t)=>{"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=e=>{const t=a(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),n(r,t)||o(e)},getConflictingClassGroupIds:(e,t)=>{const n=r[e]||[];return t&&i[e]?[...n,...i[e]]:n}}},n=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],i=t.nextPart.get(r),o=i?n(e.slice(1),i):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find((({validator:e})=>e(a)))?.classGroupId},i=/^\[(.+)\]$/,o=e=>{if(i.test(e)){const t=i.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},a=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return u(Object.entries(e.classGroups),r).forEach((([e,r])=>{s(r,n,e,t)})),n},s=(e,t,r,n)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return c(e)?void s(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach((([e,i])=>{s(i,l(t,e),r,n)}))}else{(""===e?t:l(t,e)).classGroupId=r}}))},l=(e,t)=>{let r=e;return t.split("-").forEach((e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)})),r},c=e=>e.isThemeGetter,u=(e,t)=>t?e.map((([e,r])=>[e,r.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,r])=>[t+e,r]))):e))])):e,d=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(i(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):i(e,t)}}},h=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,i=t[0],o=t.length,a=e=>{const r=[];let a,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===i&&(n||e.slice(c,c+o)===t)){r.push(e.slice(l,c)),l=c+o;continue}if("/"===u){a=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===r.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:r,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:a&&a>l?a-l:void 0}};return r?e=>r({className:e,parseClassName:a}):a},f=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach((e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)})),t.push(...r.sort()),t},p=/\s+/;function g(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=m(e))&&(n&&(n+=" "),n+=t);return n}const m=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=m(e[n]))&&(r&&(r+=" "),r+=t);return r};function y(e,...t){let n,i,o,a=function(l){const c=t.reduce(((e,t)=>t(e)),e());return n=(e=>({cache:d(e.cacheSize),parseClassName:h(e),...r(e)}))(c),i=n.cache.get,o=n.cache.set,a=s,s(l)};function s(e){const t=i(e);if(t)return t;const r=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(p);let s="";for(let e=a.length-1;e>=0;e-=1){const t=a[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t);let h=Boolean(d),p=n(h?u.substring(0,d):u);if(!p){if(!h){s=t+(s.length>0?" "+s:s);continue}if(p=n(u),!p){s=t+(s.length>0?" "+s:s);continue}h=!1}const g=f(l).join(":"),m=c?g+"!":g,y=m+p;if(o.includes(y))continue;o.push(y);const _=i(p,h);for(let e=0;e<_.length;++e){const t=_[e];o.push(m+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return o(e,r),r}return function(){return a(g.apply(null,arguments))}}const _=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},v=/^\[(?:([a-z-]+):)?(.+)\]$/i,b=/^\d+\/\d+$/,x=new Set(["px","full","screen"]),w=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,S=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,T=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,M=e=>P(e)||x.has(e)||b.test(e),E=e=>G(e,"length",U),P=e=>Boolean(e)&&!Number.isNaN(Number(e)),A=e=>G(e,"number",P),C=e=>Boolean(e)&&Number.isInteger(Number(e)),R=e=>e.endsWith("%")&&P(e.slice(0,-1)),L=e=>v.test(e),O=e=>w.test(e),D=new Set(["length","size","percentage"]),z=e=>
vendor: 8,170 bytes, line 6
6G(e,D,$),F=e=>G(e,"position",$),N=new Set(["image","url"]),B=e=>G(e,N,q),j=e=>G(e,"",H),V=()=>!0,G=(e,t,r)=>{const n=v.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},U=e=>S.test(e)&&!k.test(e),$=()=>!1,H=e=>T.test(e),q=e=>I.test(e),W=Object.defineProperty({__proto__:null,isAny:V,isArbitraryImage:B,isArbitraryLength:E,isArbitraryNumber:A,isArbitraryPosition:F,isArbitraryShadow:j,isArbitrarySize:z,isArbitraryValue:L,isInteger:C,isLength:M,isNumber:P,isPercent:R,isTshirtSize:O},Symbol.toStringTag,{value:"Module"}),Z=()=>{const e=_("colors"),t=_("spacing"),r=_("blur"),n=_("brightness"),i=_("borderColor"),o=_("borderRadius"),a=_("borderSpacing"),s=_("borderWidth"),l=_("contrast"),c=_("grayscale"),u=_("hueRotate"),d=_("invert"),h=_("gap"),f=_("gradientColorStops"),p=_("gradientColorStopPositions"),g=_("inset"),m=_("margin"),y=_("opacity"),v=_("padding"),b=_("saturate"),x=_("scale"),w=_("sepia"),S=_("skew"),k=_("space"),T=_("translate"),I=()=>["auto",L,t],D=()=>[L,t],N=()=>["",M,E],G=()=>["auto",P,L],U=()=>["","0",L],$=()=>[P,L];return{cacheSize:500,separator:":",theme:{colors:[V],spacing:[M,E],blur:["none","",O,L],brightness:$(),borderColor:[e],borderRadius:["none","","full",O,L],borderSpacing:D(),borderWidth:N(),contrast:$(),grayscale:U(),hueRotate:$(),invert:U(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[R,E],inset:I(),margin:I(),opacity:$(),padding:D(),saturate:$(),scale:$(),sepia:U(),skew:$(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[O]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",L]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",C,L]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",C,L]}],"grid-cols":[{"grid-cols":[V]}],"col-start-end":[{col:["auto",{span:["full",C,L]},L]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[V]}],"row-start-end":[{row:["auto",{span:[C,L]},L]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[O]},O]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",O,E]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",A]}],"font-family":[{font:[V]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",P,A]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",M,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",M,E]}],"underline-offset":[{"underline-offset":["auto",M,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",F]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",z]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},B]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}
6],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,401 bytes, line 6
6],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[M,L]}],"outline-w":[{outline:[M,E]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[M,E]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",O,j]}],"shadow-color":[{shadow:[V]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",O,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[C,L]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,761 bytes, line 6
6],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[M,E,A]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Y=(e,{cacheSize:t,prefix:r,separator:n,experimentalParseClassName:i,extend:o={},override:a={}})=>{X(e,"cacheSize",t),X(e,"prefix",r),X(e,"separator",n),X(e,"experimentalParseClassName",i);for(const t in a)K(e[t],a[t]);for(const t in o)J(e[t],o[t]);return e},X=(e,t,r)=>{void 0!==r&&(e[t]=r)},K=(e,t)=>{if(t)for(const r in t)X(e,r,t[r])},J=(e,t)=>{if(t)for(const r in t){const n=t[r];void 0!==n&&(e[r]=(e[r]||[]).concat(n))}},Q=y(Z);t.createTailwindMerge=y,t.extendTailwindMerge=(e,...t)=>"function"==typeof e?y(Z,e,...t):y((()=>Y(Z(),e)),...t),t.fromTheme=_,t.getDefaultConfig=Z,t.mergeConfigs=Y,t.twJoin=g,t.twMerge=Q,t.validators=W},8622:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,AC:()=>c,Hm:()=>h,NZ:()=>o,S3:()=>d,TZ:()=>u,s$:()=>s,ub:()=>l});const n={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378
6:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34412:"CZ_LSMINFO",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},i={};for(const e in n)n.hasOwnProperty(e)&&(i[n[e]]=parseInt(e,10));const o=[i.BitsPerSample,i.ExtraSamples,i.SampleFormat,i.StripByteCounts,i.StripOffsets,i.StripRowCounts,i.TileByteCounts,i.TileOffsets,i.SubIFDs],a={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},s={};for(const e in a)a.hasOwnProperty(e)&&(s[a[e]]=parseInt(e,10));const l={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},c={Unspecified:0,Assocalpha:1,Unassalpha:2},u={Version:0,AddCompression:1},d={None:0,Deflate:1,Zstandard:2},h={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},f={};for(const e in h)h.hasOwnProperty(e)&&(f[h[e]]=parseInt(e,10))},8684:(e,t,r)=>{"use strict";t.getYear=function(e,t){return(0,n.toDate)(e,t?.in).getFullYear()};var n=r(4446)},8694:e=>{function t(e,t,r){const n=new RegExp(t).exec(e.slice(r));return n?r+n.index+n[0].length-1:-1}e.exports=t,e.exports.default=t},8741:(e,t,r)=>{"use strict";t.closestIndexTo=function(e,t){const r=+(0,n.toDate)(e);if(isNaN(r))return NaN;let i,o;return t.forEach(((e,t)=>{const a=(0,n.toDate)(e);if(isNaN(+a))return i=NaN,void(o=NaN);const s=Math.abs(r-+a);(null==i||s<o)&&(i=t,o=s)})),i};var n=r(4446)},8813:(e,t,r)=>{"use strict";t.differenceInCalendarISOWeeks=function(e,t,r){const[s,l]=(0,i.normalizeDates)(r?.in,e,t),c=(0,a.startOfISOWeek)(s),u=(0,a.startOfISOWeek)(l),d=+c-(0,n.getTimezoneOffsetInMilliseconds)(c),h=+u-(0,n.getTimezoneOffsetInMilliseconds)(u);return Math.round((d-h)/o.millisecondsInWeek)};var n=r(6339),i=r(8256),o=r(8052),a=r(6107)},8847:(e,t,r)=>{"use strict";t.isSameMinute=function(e,t){return+(0,n.startOfMinute)(e)==+(0,n.startOfMinute)(t)};var n=r(1804)},8857:(e,t,r)=>{"use strict";t.isSameISOWeekYear=function(e,t,r){const[o,a]=(0,i.normalizeDates)(r?.in,e,t);return+(0,n.startOfISOWeekYear)(o)==+(0,n.startOfISOWeekYear)(a)};var n=r(1152),i=r(8256)},8873:(e,t,r)=>{"use strict";t.max=function(e,t){let r,o=t?.in;return e.forEach((e=>{o||"object"!=typeof e||(o=n.constructFrom.bind(null,e));const t=(0,i.toDate)(e,o);(!r||r<t||isNaN(+t))&&(r=t)})),(0,n.constructFrom)(o,r||NaN)};var n=r(2956),i=r(4446)},8910:e=>{"use strict";e.exports={API_ORIGIN:"https://api.mapbox.com",EVENT_PROGRESS_DOWNLOAD:"downloadProgress",EVENT_PROGRESS_UPLOAD:"uploadProgress",EVENT_ERROR:"error",EVENT_RESPONSE:"response",ERROR_HTTP:"HttpError",ERROR_REQUEST_ABORTED:"RequestAbortedError"}},8926:(e,t,r)=>{"use strict";t.getISOWeek=function(e,t){const r=(0,a.toDate)(e,t?.in),s=+(0,i.startOfISOWeek)(r)-+(0,o.startOfISOWeekYear)(r);return Math.round(s/n.millisecondsInWeek)+1};
6var n=r(8052),i=r(6107),o=r(1152),a=r(4446)},8963:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.f16round=function(e){return(0,n.roundToFloat16)(e)};var n=r(448)},8996:(e,t,r)=>{"use strict";t.eachHourOfInterval=function(e,t){const{start:r,end:o}=(0,n.normalizeInterval)(t?.in,e);let a=+r>+o;const s=a?+r:+o,l=a?o:r;l.setMinutes(0,0,0);let c=t?.step??1;if(!c)return[];c<0&&(c=-c,a=!a);const u=[];for(;+l<=s;)u.push((0,i.constructFrom)(r,l)),l.setHours(l.getHours()+c);return a?u.reverse():u};var n=r(5909),i=r(2956)},9019:(e,t,r)=>{"use strict";t.isSameMonth=function(e,t,r){const[i,o]=(0,n.normalizeDates)(r?.in,e,t);return i.getFullYear()===o.getFullYear()&&i.getMonth()===o.getMonth()};var n=r(8256)},9038:(e,t)=>{"use strict";t.buildMatchFn=function(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}(s,(e=>e.test(a))):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}(s,(e=>e.test(a)));let c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:t.slice(a.length)}}}},9049:(e,t,r)=>{"use strict";t.yearsToQuarters=function(e){return Math.trunc(e*n.quartersInYear)};var n=r(8052)},9059:(e,t,r)=>{"use strict";t.previousThursday=function(e,t){return(0,n.previousDay)(e,4,t)};var n=r(8092)},9105:(e,t,r)=>{"use strict";t.isThisMonth=function(e,t){return(0,o.isSameMonth)((0,n.constructFrom)(t?.in||e,e),(0,i.constructNow)(t?.in||e))};var n=r(2956),i=r(2700),o=r(9019)},9136:(e,t,r)=>{"use strict";var n=r(511),i=r(8040),o=r(8910),a=r(3349),s={};function l(e){var t=e.total,r=e.loaded;return{total:t,transferred:r,percent:100*r/t}}function c(e,t){return new Promise((function(r,n){t.onprogress=function(t){e.emitter.emit(o.EVENT_PROGRESS_DOWNLOAD,l(t))};var a=e.file;a&&(t.upload.onprogress=function(t){e.emitter.emit(o.EVENT_PROGRESS_UPLOAD,l(t))}),t.onerror=function(e){n(e)},t.onabort=function(){var t=new i({request:e,type:o.ERROR_REQUEST_ABORTED});n(t)},t.onload=function(){if(delete s[e.id],t.status<200||t.status>=400){var o=new i({request:e,body:t.response,statusCode:t.status});n(o)}else r(t)};var c=e.body;"string"==typeof c?t.send(c):c?t.send(JSON.stringify(c)):a?t.send(a):t.send(),s[e.id]=t})).then((function(t){return function(e,t){return new n(e,{body:t.response,headers:a(t.getAllResponseHeaders()),statusCode:t.status})}(e,t)}))}function u(e,t){var r=e.url(t),n=new window.XMLHttpRequest;return n.open(e.method,r),Object.keys(e.headers).forEach((function(t){n.setRequestHeader(t,e.headers[t])})),n}e.exports={browserAbort:function(e){var t=s[e.id];t&&(t.abort(),delete s[e.id])},sendRequestXhr:c,browserSend:function(e){return Promise.resolve().then((function(){var t=u(e,e.client.accessToken);return c(e,t)}))},createRequestXhr:u}},9150:(e,t,r)=>{"use strict";t.MonthParser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,r){const i=e=>e-1;switch(t){case"M":return(0,o.mapValue)((0,o.parseNumericPattern)(n.numericPatterns.month,e),i);case"MM":return(0,o.mapValue)((0,o.parseNDigits)(2,e),i);case"Mo":return(0,o.mapValue)(r.ordinalNumber(e,{unit:"month"}),i);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}}t.MonthParser=a},9182:(e,t,r)=>{"use strict";t.previousWednesday=function(e,t){return(0,n.previousDay)(e,3,t)};var n=r(8092)},9305:(e,t,r)=>{"use strict";t.eachWeekendOfInterval=function(e,t){const{start:r,end:s}=(0,n.normalizeInterval)(t?.in,e),l=(0,o.eachDayOfInterval)({start:r,end:s},t),c=[];let u=0;for(;u<l.length;){const e=l[u++];(0,a.isWeekend)(e)&&c.push((0,i.constructFrom)(r,e))}return c};var n=r(5909),i=r(2956),o=r(3700),a=r(3348)},9318:(e,t,r)=>{"use strict";t.getUnixTime=function(e){return Math.trunc(+(0,n.toDate)(e)/1e3)};var n=r(4446)},9322:(e,t,r)=>{"use strict";t.nextSunday=function(e,t){return(0,n.nextDay)(e,0,t)};var n=r(64)},9404:(e,t,r)=>{"use strict";t.lastDayOfMonth=function(e,t){const r=(0,n.toDate)(e,t?.in),i=r.getMonth();return r.setFullYear(r.getFullYear(),i+1,0),r.setHours(0,0,0,0),(0,n.toDate)(r,t?.in)};var n=r(4446)},9414:(e,t,r)=>{"use strict";var n=r(7510),i=r(5573);e.exports=n(i,{file:function(e){if("undefined"!=typeof window){if(e instanceof r.g.Blob||e instanceof r.g.ArrayBuffer)return;return"Blob or ArrayBuffer"}if("string"!=typeof e&&void 0===e.pipe)return"Filename or Readable stream"},date:function(e){var t="date";if("boolean"==typeof e)return t;try{var r=new Date(e);if(r.getTime&&isNaN(r.getTime()))return t}catch(e){return t}},coordinates:function(e){return i.tuple(i.number,i.number)(e)},assertShape:function(e,t){return i.assert(i.strictShape(e),t)}})},9435:(e,t,r)=>{"use strict";t.isSameSecond=function(e,t){return+(0,n.startOfSecond)(e)==+(0,n.startOfSecond)(t)};var n=r(6936)},9460:(e,t,r)=>{"use strict";t.format=t.formatDate=function(e,t,r){const h=(0,i.getDefaultOptions)(),f=r?.locale??h.locale??n.defaultLocale,m=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??h.firstWeekContainsDate??h.locale?.options?.firstWeekContainsDate??1,y=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??h.weekStartsOn??h.locale?.options?.weekStartsOn??0,_=(0,c.toDate)(e,r?.in);if(!(0,l.isValid)(_))throw new RangeError("Invalid time value");let v=t.match(d).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,a.longFormatters[t])(e,f.formatLong)}return e})).join("").match(u).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:g(e)};if(o.formatters[t])return{isToken:!0,value:e};
6if(t.match(p))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));f.localize.preprocessor&&(v=f.localize.preprocessor(_,v));const b={firstWeekContainsDate:m,weekStartsOn:y,locale:f};return v.map((n=>{if(!n.isToken)return n.value;const i=n.value;(!r?.useAdditionalWeekYearTokens&&(0,s.isProtectedWeekYearToken)(i)||!r?.useAdditionalDayOfYearTokens&&(0,s.isProtectedDayOfYearToken)(i))&&(0,s.warnOrThrowProtectedError)(i,t,String(e));return(0,o.formatters[i[0]])(_,i,f.localize,b)})).join("")},Object.defineProperty(t,"formatters",{enumerable:!0,get:function(){return o.formatters}}),Object.defineProperty(t,"longFormatters",{enumerable:!0,get:function(){return a.longFormatters}});var n=r(9577),i=r(6755),o=r(3525),a=r(7083),s=r(2364),l=r(7489),c=r(4446);const u=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,d=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,h=/^'([^]*?)'?$/,f=/''/g,p=/[a-zA-Z]/;function g(e){const t=e.match(h);return t?t[1].replace(f,"'"):e}},9463:(e,t,r)=>{"use strict";t.addHours=function(e,t,r){return(0,n.addMilliseconds)(e,t*i.millisecondsInHour,r)};var n=r(4280),i=r(8052)},9477:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTypedArray=function(e){return(0,i.isNativeTypedArray)(e)||(0,n.isFloat16Array)(e)};var n=r(1404),i=r(7516)},9506:(e,t,r)=>{"use strict";var n=r(1404);n.Float16Array,n.isFloat16Array,r(9477).isTypedArray;var i=r(2737);t.Oe=i.getFloat16,i.setFloat16;var o=r(8963);o.f16round,o.f16round},9520:(e,t,r)=>{"use strict";t.setHours=function(e,t,r){const i=(0,n.toDate)(e,r?.in);return i.setHours(t),i};var n=r(4446)},9526:(e,t,r)=>{"use strict";t.isThisYear=function(e,t){return(0,o.isSameYear)((0,n.constructFrom)(t?.in||e,e),(0,i.constructNow)(t?.in||e))};var n=r(2956),i=r(2700),o=r(1992)},9577:(e,t,r)=>{"use strict";Object.defineProperty(t,"defaultLocale",{enumerable:!0,get:function(){return n.enUS}});var n=r(1343)},9612:(e,t,r)=>{"use strict";t.Hour0to23Parser=void 0;var n=r(7699),i=r(5513),o=r(3771);class a extends i.Parser{priority=70;parse(e,t,r){switch(t){case"H":return(0,o.parseNumericPattern)(n.numericPatterns.hour23h,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return(0,o.parseNDigits)(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,r){return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}t.Hour0to23Parser=a},9629:(e,t,r)=>{"use strict";t.quartersToYears=function(e){const t=e/n.quartersInYear;return Math.trunc(t)};var n=r(8052)},9639:(e,t,r)=>{"use strict";t.getWeek=function(e,t){const r=(0,a.toDate)(e,t?.in),s=+(0,i.startOfWeek)(r,t)-+(0,o.startOfWeekYear)(r,t);return Math.round(s/n.millisecondsInWeek)+1};var n=r(8052),i=r(5472),o=r(3040),a=r(4446)},9691:(e,t,r)=>{"use strict";t.isSameDay=function(e,t,r){const[o,a]=(0,n.normalizeDates)(r?.in,e,t);return+(0,i.startOfDay)(o)==+(0,i.startOfDay)(a)};var n=r(8256),i=r(8290)},9732:(e,t,r)=>{"use strict";t.getHours=function(e,t){return(0,n.toDate)(e,t?.in).getHours()};var n=r(4446)},9757:(e,t,r)=>{"use strict";t.parseISO=function(e,t){const r=()=>(0,i.constructFrom)(t?.in,NaN),p=t?.additionalDigits??2,g=function(e){const t={},r=e.split(a.dateTimeDelimiter);let n;if(r.length>2)return t;/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],a.timeZoneDelimiter.test(t.date)&&(t.date=e.split(a.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length)));if(n){const e=a.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let m;if(g.date){const e=function(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:null===o?i:100*o,restDateString:e.slice((n[1]||n[2]).length)}}(g.date,p);m=function(e,t){if(null===t)return new Date(NaN);const r=e.match(s);if(!r)return new Date(NaN);const n=!!r[4],i=u(r[1]),o=u(r[2])-1,a=u(r[3]),l=u(r[4]),c=u(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,l,c)?function(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=7*(t-1)+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}(t,l,c):new Date(NaN);{const e=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(h[t]||(f(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(f(e)?366:365)}(t,i)?(e.setUTCFullYear(t,o,Math.max(i,a)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!m||isNaN(+m))return r();const y=+m;let _,v=0;if(g.time&&(v=function(e){const t=e.match(l);if(!t)return NaN;const r=d(t[1]),i=d(t[2]),o=d(t[3]);if(!function(e,t,r){if(24===e)return 0===t&&0===r;return r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,i,o))return NaN;return r*n.millisecondsInHour+i*n.millisecondsInMinute+1e3*o}(g.time),isNaN(v)))return r();if(!g.timezone){const e=new Date(y+v),r=(0,o.toDate)(0,t?.in);return r.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),r}if(_=function(e){if("Z"===e)return 0;const t=e.match(c);if(!t)return 0;const r="+"===t[1]?-1:1,i=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return r*(i*n.millisecondsInHour+o*n.millisecondsInMinute)}(g.timezone),isNaN(_))return r();return(0,o.toDate)(y+v+_,t?.in)};var n=r(8052),i=r(2956),o=r(4446);
6const a={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},s=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,l=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,c=/^([+-])(\d{2})(?::?(\d{2}))?$/;function u(e){return e?parseInt(e):1}function d(e){return e&&parseFloat(e.replace(",","."))||0}const h=[31,null,31,30,31,30,31,31,30,31,30,31];function f(e){return e%400==0||e%4==0&&e%100!=0}},9778:(e,t,r)=>{var n=r(7628);function i(e){var t=0;if(e&&e.length>0){t+=Math.abs(o(e[0]));for(var r=1;r<e.length;r++)t-=Math.abs(o(e[r]))}return t}function o(e){var t,r,i,o,s,l,c=0,u=e.length;if(u>2){for(l=0;l<u;l++)l===u-2?(i=u-2,o=u-1,s=0):l===u-1?(i=u-1,o=0,s=1):(i=l,o=l+1,s=l+2),t=e[i],r=e[o],c+=(a(e[s][0])-a(t[0]))*Math.sin(a(r[1]));c=c*n.RADIUS*n.RADIUS/2}return c}function a(e){return e*Math.PI/180}e.exports.geometry=function e(t){var r,n=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(r=0;r<t.coordinates.length;r++)n+=i(t.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<t.geometries.length;r++)n+=e(t.geometries[r]);return n}},e.exports.ring=o},9792:(e,t,r)=>{"use strict";t.formatISO9075=function(e,t){const r=(0,o.toDate)(e,t?.in);if(!(0,i.isValid)(r))throw new RangeError("Invalid time value");const a=t?.format??"extended",s=t?.representation??"complete";let l="";const c="extended"===a?"-":"",u="extended"===a?":":"";if("time"!==s){const e=(0,n.addLeadingZeros)(r.getDate(),2),t=(0,n.addLeadingZeros)(r.getMonth()+1,2);l=`${(0,n.addLeadingZeros)(r.getFullYear(),4)}${c}${t}${c}${e}`}if("date"!==s){l=`${l}${""===l?"":" "}${(0,n.addLeadingZeros)(r.getHours(),2)}${u}${(0,n.addLeadingZeros)(r.getMinutes(),2)}${u}${(0,n.addLeadingZeros)(r.getSeconds(),2)}`}return l};var n=r(2554),i=r(7489),o=r(4446)},9825:(e,t,r)=>{"use strict";t.isSameQuarter=function(e,t,r){const[o,a]=(0,n.normalizeDates)(r?.in,e,t);return+(0,i.startOfQuarter)(o)==+(0,i.startOfQuarter)(a)};var n=r(8256),i=r(6944)},9859:(e,t,r)=>{"use strict";t.roundToNearestHours=function(e,t){const r=t?.nearestTo??1;if(r<1||r>12)return(0,i.constructFrom)(t?.in||e,NaN);const a=(0,o.toDate)(e,t?.in),s=a.getMinutes()/60,l=a.getSeconds()/60/60,c=a.getMilliseconds()/1e3/60/60,u=a.getHours()+s+l+c,d=t?.roundingMethod??"round",h=(0,n.getRoundingMethod)(d)(u/r)*r;return a.setHours(h,0,0,0),a};var n=r(1331),i=r(2956),o=r(4446)},9883:(e,t,r)=>{"use strict";t.endOfSecond=function(e,t){const r=(0,n.toDate)(e,t?.in);return r.setMilliseconds(999),r};var n=r(4446)},9941:(e,t,r)=>{"use strict";t.addBusinessDays=function(e,t,r){const l=(0,s.toDate)(e,r?.in),c=(0,a.isWeekend)(l,r);if(isNaN(t))return(0,n.constructFrom)(r?.in,NaN);const u=l.getHours(),d=t<0?-1:1,h=Math.trunc(t/5);l.setDate(l.getDate()+7*h);let f=Math.abs(t%5);for(;f>0;)l.setDate(l.getDate()+d),(0,a.isWeekend)(l,r)||(f-=1);c&&(0,a.isWeekend)(l,r)&&0!==t&&((0,i.isSaturday)(l,r)&&l.setDate(l.getDate()+(d<0?2:-1)),(0,o.isSunday)(l,r)&&l.setDate(l.getDate()+(d<0?1:-2)));return l.setHours(u),l};var n=r(2956),i=r(2056),o=r(3561),a=r(3348),s=r(4446)},9957:(e,t,r)=>{"use strict";t.getISOWeekYear=function(e,t){const r=(0,o.toDate)(e,t?.in),a=r.getFullYear(),s=(0,n.constructFrom)(r,0);s.setFullYear(a+1,0,4),s.setHours(0,0,0,0);const l=(0,i.startOfISOWeek)(s),c=(0,n.constructFrom)(r,0);c.setFullYear(a,0,4),c.setHours(0,0,0,0);const u=(0,i.startOfISOWeek)(c);return r.getTime()>=l.getTime()?a+1:r.getTime()>=u.getTime()?a:a-1};var n=r(2956),i=r(6107),o=r(4446)}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=r,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>"js/"+e+"-bundle.js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}
vendor: 4,823 bytes, lines 6-8
6}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="SiteJS:",i.l=(r,n,o,a)=>{if(e[r])e[r].push(n);else{var s,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+o){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",t+o),s.src=r),e[r]=[n];var h=(t,n)=>{s.onerror=s.onload=null,clearTimeout(f);var i=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(n))),t)return t(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../"})(),(()=>{var e={524:0};i.f.j=(t,r)=>{var n=i.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,i)=>n=e[t]=[r,i]));r.push(n[2]=o);var a=i.p+i.u(t),s=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[a,s,l]=r,c=0;if(a.some((t=>0!==e[t]))){for(n in s)i.o(s,n)&&(i.m[n]=s[n]);if(l)l(i)}for(t&&t(r);c<a.length;c++)o=a[c],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunkSiteJS=self.webpackChunkSiteJS||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var o={};(()=>{"use strict";i.r(o),i.d(o,{Cookies:()=>aK,DashboardCharts:()=>Fa,Farms:()=>oK});var e={};i.r(e),i.d(e,{LAT_MAX:()=>cC,LAT_MIN:()=>sC,LAT_RENDERED_MAX:()=>uC,LAT_RENDERED_MIN:()=>lC,LNG_MAX:()=>hC,LNG_MIN:()=>dC,activeStates:()=>oC,classes:()=>XA,cursors:()=>JA,events:()=>rC,geojsonTypes:()=>eC,interactions:()=>aC,meta:()=>iC,modes:()=>tC,sources:()=>KA,types:()=>QA,updateActions:()=>nC});var t={};i.r(t),i.d(t,{isActiveFeature:()=>gC,isBackspaceKey:()=>SC,isDeleteKey:()=>kC,isDigit1Key:()=>TC,isDigit2Key:()=>IC,isDigit3Key:()=>MC,isDigitKey:()=>EC,isEnterKey:()=>wC,isEscapeKey:()=>xC,isFeature:()=>_C,isInactiveFeature:()=>mC,isOfMetaType:()=>fC,isShiftDown:()=>bC,isShiftMousedown:()=>pC,isTrue:()=>PC,isVertex:()=>vC,noTarget:()=>yC});var r={};
7/*! js-cookie v3.0.5 | MIT */
8function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}i.r(r),i.d(r,{CommonSelectors:()=>t,ModeHandler:()=>YC,StringSet:()=>zC,constrainFeatureMovement:()=>qR,createMidPoint:()=>FR,createSupplementaryPoints:()=>NR,createVertex:()=>MR,doubleClickZoom:()=>BR,euclideanDistance:()=>VC,featuresAt:()=>NC,getFeatureAtAndSetCursors:()=>jC,isClick:()=>HC,isEventAtCoordinates:()=>rL,isTap:()=>ZC,mapEventToBoundingBox:()=>OC,moveFeatures:()=>WR,sortFeatures:()=>LC,stringSetsAreEqual:()=>fL,theme:()=>kR,toDenseArray:()=>gR});var a=function e(t,r){function i(e,i,o){if("undefined"!=typeof document){"number"==typeof(o=n({},r,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in o)o[s]&&(a+="; "+s,!0!==o[s]&&(a+="="+o[s].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+a}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},i=0;i<r.length;i++){var o=r[i].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(n[s]=t.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){i(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decode
vendor: 4,904 bytes, lines 8-15
8URIComponent)}},{path:"/"});
9/*!
10 * @kurkle/color v0.3.4
11 * https://github.com/kurkle/color#readme
12 * (c) 2024 Jukka Kurkela
13 * Released under the MIT License
14 */
15function s(e){return e+.5|0}const l=(e,t,r)=>Math.max(Math.min(e,r),t);function c(e){return l(s(2.55*e),0,255)}function u(e){return l(s(255*e),0,255)}function d(e){return l(s(e/2.55)/100,0,1)}function h(e){return l(s(100*e),0,100)}const f={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},p=[..."0123456789ABCDEF"],g=e=>p[15&e],m=e=>p[(240&e)>>4]+p[15&e],y=e=>(240&e)>>4==(15&e);function _(e){var t=(e=>y(e.r)&&y(e.g)&&y(e.b)&&y(e.a))(e)?g:m;return e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0}const v=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function b(e,t,r){const n=t*Math.min(r,1-r),i=(t,i=(t+e/30)%12)=>r-n*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function x(e,t,r){const n=(n,i=(n+e/60)%6)=>r-r*t*Math.max(Math.min(i,4-i,1),0);return[n(5),n(3),n(1)]}function w(e,t,r){const n=b(e,1,.5);let i;for(t+r>1&&(i=1/(t+r),t*=i,r*=i),i=0;i<3;i++)n[i]*=1-t-r,n[i]+=t;return n}function S(e){const t=e.r/255,r=e.g/255,n=e.b/255,i=Math.max(t,r,n),o=Math.min(t,r,n),a=(i+o)/2;let s,l,c;return i!==o&&(c=i-o,l=a>.5?c/(2-i-o):c/(i+o),s=function(e,t,r,n,i){return e===i?(t-r)/n+(t<r?6:0):t===i?(r-e)/n+2:(e-t)/n+4}(t,r,n,c,i),s=60*s+.5),[0|s,l||0,a]}function k(e,t,r,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,r,n)).map(u)}function T(e,t,r){return k(b,e,t,r)}function I(e){return(e%360+360)%360}function M(e){const t=v.exec(e);let r,n=255;if(!t)return;t[5]!==r&&(n=t[6]?c(+t[5]):u(+t[5]));const i=I(+t[2]),o=+t[3]/100,a=+t[4]/100;return r="hwb"===t[1]?function(e,t,r){return k(w,e,t,r)}(i,o,a):"hsv"===t[1]?function(e,t,r){return k(x,e,t,r)}(i,o,a):T(i,o,a),{r:r[0],g:r[1],b:r[2],a:n}}const E={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},P={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let A;function C(e){A||(A=function(){const e={},t=Object.keys(P),r=Object.keys(E);let n,i,o,a,s;for(n=0;n<t.length;n++){for(a=s=t[n],i=0;i<r.length;i++)o=r[i],s=s.replace(o,E[o]);o=parseInt(P[a],16),e[s]=[o>>16&255,o>>8&255,255&o]}return e}(),A.transparent=[0,0,0,0]);const t=A[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}const R=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const L=e=>
vendor: 5,046 bytes, lines 15-22
15e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,O=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function D(e,t,r){if(e){let n=S(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*r,0===t?360:1)),n=T(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function z(e,t){return e?Object.assign(t||{},e):e}function F(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=u(e[3]))):(t=z(e,{r:0,g:0,b:0,a:1})).a=u(t.a),t}function N(e){return"r"===e.charAt(0)?function(e){const t=R.exec(e);let r,n,i,o=255;if(t){if(t[7]!==r){const e=+t[7];o=t[8]?c(e):l(255*e,0,255)}return r=+t[1],n=+t[3],i=+t[5],r=255&(t[2]?c(r):l(r,0,255)),n=255&(t[4]?c(n):l(n,0,255)),i=255&(t[6]?c(i):l(i,0,255)),{r,g:n,b:i,a:o}}}(e):M(e)}class B{constructor(e){if(e instanceof B)return e;const t=typeof e;let r;var n,i,o;"object"===t?r=F(e):"string"===t&&(o=(n=e).length,"#"===n[0]&&(4===o||5===o?i={r:255&17*f[n[1]],g:255&17*f[n[2]],b:255&17*f[n[3]],a:5===o?17*f[n[4]]:255}:7!==o&&9!==o||(i={r:f[n[1]]<<4|f[n[2]],g:f[n[3]]<<4|f[n[4]],b:f[n[5]]<<4|f[n[6]],a:9===o?f[n[7]]<<4|f[n[8]]:255})),r=i||C(e)||N(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=z(this._rgb);return e&&(e.a=d(e.a)),e}set rgb(e){this._rgb=F(e)}rgbString(){return this._valid?function(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${d(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}(this._rgb):void 0}hexString(){return this._valid?_(this._rgb):void 0}hslString(){return this._valid?function(e){if(!e)return;const t=S(e),r=t[0],n=h(t[1]),i=h(t[2]);return e.a<255?`hsla(${r}, ${n}%, ${i}%, ${d(e.a)})`:`hsl(${r}, ${n}%, ${i}%)`}(this._rgb):void 0}mix(e,t){if(e){const r=this.rgb,n=e.rgb;let i;const o=t===i?.5:t,a=2*o-1,s=r.a-n.a,l=((a*s==-1?a:(a+s)/(1+a*s))+1)/2;i=1-l,r.r=255&l*r.r+i*n.r+.5,r.g=255&l*r.g+i*n.g+.5,r.b=255&l*r.b+i*n.b+.5,r.a=o*r.a+(1-o)*n.a,this.rgb=r}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,r){const n=O(d(e.r)),i=O(d(e.g)),o=O(d(e.b));return{r:u(L(n+r*(O(d(t.r))-n))),g:u(L(i+r*(O(d(t.g))-i))),b:u(L(o+r*(O(d(t.b))-o))),a:e.a+r*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new B(this.rgb)}alpha(e){return this._rgb.a=u(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=s(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return D(this._rgb,2,e),this}darken(e){return D(this._rgb,2,-e),this}saturate(e){return D(this._rgb,1,e),this}desaturate(e){return D(this._rgb,1,-e),this}rotate(e){return function(e,t){var r=S(e);r[0]=I(r[0]+t),r=T(r),e.r=r[0],e.g=r[1],e.b=r[2]}(this._rgb,e),this}}
16/*!
17 * Chart.js v4.4.9
18 * https://www.chartjs.org
19 * (c) 2025 Chart.js Contributors
20 * Released under the MIT License
21 */
22function j(){}const V=(()=>{let e=0;return()=>e++})();function G(e){return null==e}function U(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function $(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function H(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function q(e,t){return H(e)?e:t}function W(e,t){return void 0===e?t:e}const Z=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Y(e,t,r){if(e&&"function"==typeof e.call)return e.apply(r,t)}function X(e,t,r,n){let i,o,a;if(U(e))if(o=e.length,n)for(i=o-1;i>=0;i--)t.call(r,e[i],i);else for(i=0;i<o;i++)t.call(r,e[i],i);else if($(e))for(a=Object.keys(e),o=a.length,i=0;i<o;i++)t.call(r,e[a[i]],a[i])}function K(e,t){let r,n,i,o;if(!e||!t||e.length!==t.length)return!1;for(r=0,n=e.length;r<n;++r)if(i=e[r],o=t[r],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function J(e){if(U(e))return e.map(J);if($(e)){const t=Object.create(null),r=Object.keys(e),n=r.length;let i=0;for(;i<n;++i)t[r[i]]=J(e[r[i]]);return t}return e}function Q(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function ee(e,t,r,n){if(!Q(e))return;const i=t[e],o=r[e];$(i)&&$(o)?te(i,o,n):t[e]=J(o)}function te(e,t,r){const n=U(t)?t:[t],i=n.length;if(!$(e))return e;const o=(r=r||{}).merger||ee;let a;for(let t=0;t<i;++t){if(a=n[t],!$(a))continue;const i=Object.keys(a);for(let t=0,n=i.length;t<n;++t)o(i[t],e,a,r)}return e}function re(e,t){return te(e,t,{merger:ne})}function ne(e,t,r){if(!Q(e))return;const n=t[e],i=r[e];$(n)&&$(i)?re(n,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=J(i))}const ie={"":e=>e,x:e=>e.x,y:e=>e.y};function oe(e,t){const r=ie[t]||(ie[t]=function(e){const t=function(e){const t=e.split("."),r=[];let n="";for(const e of t)n+=e,n.endsWith("\\")?n=n.slice(0,-1)+".":(r.push(n),n="");return r}(e);return e=>{for(const r of t){if(""===r)break;e=e&&e[r]}return e}}(t));return r(e)}function ae(e){return e.charAt(0).toUpperCase()+e.slice(1)}const se=e=>void 0!==e,le=e=>"function"==typeof e,ce=(e,t)=>{if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0};
vendor: 3,086 bytes, line 22
22const ue=Math.PI,de=2*ue,he=de+ue,fe=Number.POSITIVE_INFINITY,pe=ue/180,ge=ue/2,me=ue/4,ye=2*ue/3,_e=Math.log10,ve=Math.sign;function be(e,t,r){return Math.abs(e-t)<r}function xe(e){const t=Math.round(e);e=be(e,t,e/1e3)?t:e;const r=Math.pow(10,Math.floor(_e(e))),n=e/r;return(n<=1?1:n<=2?2:n<=5?5:10)*r}function we(e){return!function(e){return"symbol"==typeof e||"object"==typeof e&&null!==e&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Se(e,t,r){let n,i,o;for(n=0,i=e.length;n<i;n++)o=e[n][r],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ke(e){return e*(ue/180)}function Te(e){return e*(180/ue)}function Ie(e){if(!H(e))return;let t=1,r=0;for(;Math.round(e*t)/t!==e;)t*=10,r++;return r}function Me(e,t){const r=t.x-e.x,n=t.y-e.y,i=Math.sqrt(r*r+n*n);let o=Math.atan2(n,r);return o<-.5*ue&&(o+=de),{angle:o,distance:i}}function Ee(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Pe(e,t){return(e-t+he)%de-ue}function Ae(e){return(e%de+de)%de}function Ce(e,t,r,n){const i=Ae(e),o=Ae(t),a=Ae(r),s=Ae(o-i),l=Ae(a-i),c=Ae(i-o),u=Ae(i-a);return i===o||i===a||n&&o===a||s>l&&c<u}function Re(e,t,r){return Math.max(t,Math.min(r,e))}function Le(e,t,r,n=1e-6){return e>=Math.min(t,r)-n&&e<=Math.max(t,r)+n}function Oe(e,t,r){r=r||(r=>e[r]<t);let n,i=e.length-1,o=0;for(;i-o>1;)n=o+i>>1,r(n)?o=n:i=n;return{lo:o,hi:i}}const De=(e,t,r,n)=>Oe(e,r,n?n=>{const i=e[n][t];return i<r||i===r&&e[n+1][t]===r}:n=>e[n][t]<r),ze=(e,t,r)=>Oe(e,r,(n=>e[n][t]>=r));const Fe=["push","pop","shift","splice","unshift"];function Ne(e,t){const r=e._chartjs;if(!r)return;const n=r.listeners,i=n.indexOf(t);-1!==i&&n.splice(i,1),n.length>0||(Fe.forEach((t=>{delete e[t]})),delete e._chartjs)}function Be(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const je="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function Ve(e,t){let r=[],n=!1;return function(...i){r=i,n||(n=!0,je.call(window,(()=>{n=!1,e.apply(t,r)})))}}const Ge=e=>"start"===e?"left":"end"===e?"right":"center",Ue=(e,t,r)=>"start"===e?t:"end"===e?r:(t+r)/2;function $e(e,t,r){const n=t.length;let i=0,o=n;if(e._sorted){const{iScale:a,vScale:s,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=a.axis,{min:d,max:h,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(i=Math.min(De(l,u,d).lo,r?n:De(t,u,a.getPixelForValue(d)).lo),c){const e=l.slice(0,i+1).reverse().findIndex((e=>!G(e[s.axis])));i-=Math.max(0,e)}i=Re(i,0,n-1)}if(p){let e=Math.max(De(l,a.axis,h,!0).hi+1,r?0:De(t,u,a.getPixelForValue(h),!0).hi+1);if(c){const t=l.slice(e-1).findIndex((e=>!G(e[s.axis])));e+=Math.max(0,t)}o=Re(e,i,n)-i}else o=n-i}return{start:i,count:o}}function He(e){const{xScale:t,yScale:r,_scaleRanges:n}=e,i={xmin:t.min,xmax:t.max,ymin:r.min,ymax:r.max};if(!n)return e._scaleRanges=i,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==r.min||n.ymax!==r.max;return Object.assign(n,i),o}const qe=e=>0===e||1===e,We=(e,t,r)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*de/r),Ze=(e,t,r)=>
vendor: 3,978 bytes, line 22
22Math.pow(2,-10*e)*Math.sin((e-t)*de/r)+1,Ye={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*ge),easeOutSine:e=>Math.sin(e*ge),easeInOutSine:e=>-.5*(Math.cos(ue*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>qe(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>qe(e)?e:We(e,.075,.3),easeOutElastic:e=>qe(e)?e:Ze(e,.075,.3),easeInOutElastic(e){const t=.1125;return qe(e)?e:e<.5?.5*We(2*e,t,.45):.5+.5*Ze(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-Ye.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,r=2.75;return e<1/r?t*e*e:e<2/r?t*(e-=1.5/r)*e+.75:e<2.5/r?t*(e-=2.25/r)*e+.9375:t*(e-=2.625/r)*e+.984375},easeInOutBounce:e=>e<.5?.5*Ye.easeInBounce(2*e):.5*Ye.easeOutBounce(2*e-1)+.5};function Xe(e){if(e&&"object"==typeof e){const t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function Ke(e){return Xe(e)?e:new B(e)}function Je(e){return Xe(e)?e:new B(e).saturate(.5).darken(.1).hexString()}const Qe=["x","y","borderWidth","radius","tension"],et=["color","borderColor","backgroundColor"];const tt=new Map;function rt(e,t,r){return function(e,t){t=t||{};const r=e+JSON.stringify(t);let n=tt.get(r);return n||(n=new Intl.NumberFormat(e,t),tt.set(r,n)),n}(t,r).format(e)}const nt={values:e=>U(e)?e:""+e,numeric(e,t,r){if(0===e)return"0";const n=this.chart.options.locale;let i,o=e;if(r.length>1){const t=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(t<1e-4||t>1e15)&&(i="scientific"),o=function(e,t){let r=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;Math.abs(r)>=1&&e!==Math.floor(e)&&(r=e-Math.floor(e));return r}(e,r)}const a=_e(Math.abs(o)),s=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),rt(e,n,l)},logarithmic(e,t,r){if(0===e)return"0";const n=r[t].significand||e/Math.pow(10,Math.floor(_e(e)));return[1,2,3,5,10,15].includes(n)||t>.8*r.length?nt.numeric.call(this,e,t,r):""}};var it={formatters:nt};const ot=Object.create(null),at=Object.create(null);function st(e,t){if(!t)return e;const r=t.split(".");for(let t=0,n=r.length;t<n;++t){const n=r[t];e=e[n]||(e[n]=Object.create(null))}return e}function lt(e,t,r){return"string"==typeof t?te(st(e,t),r):te(st(e,""),t)}class ct{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Je(t.backgroundColor),this.hoverBorderColor=(e,t)=>Je(t.borderColor),this.hoverColor=(e,t)=>Je(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={}
vendor: 4,256 bytes, line 22
22,this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return lt(this,e,t)}get(e){return st(this,e)}describe(e,t){return lt(at,e,t)}override(e,t){return lt(ot,e,t)}route(e,t,r,n){const i=st(this,e),o=st(this,r),a="_"+t;Object.defineProperties(i,{[a]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[a],t=o[n];return $(e)?Object.assign({},t,e):W(e,t)},set(e){this[a]=e}}})}apply(e){e.forEach((e=>e(this)))}}var ut=new ct({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:et},numbers:{type:"number",properties:Qe}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:it.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function dt(e,t,r,n,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,r.push(i)),o>n&&(n=o),n}function ht(e,t,r,n){let i=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(i=n.data={},o=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let a=0;const s=r.length;let l,c,u,d,h;for(l=0;l<s;l++)if(d=r[l],null==d||U(d)){if(U(d))for(c=0,u=d.length;c<u;c++)h=d[c],null==h||U(h)||(a=dt(e,i,o,a,h))}else a=dt(e,i,o,a,d);e.restore();const f=o.length/2;if(f>r.length){for(l=0;l<f;l++)delete i[o[l]];o.splice(0,f)}return a}function ft(e,t,r){const n=e.currentDevicePixelRatio,i=0!==r?Math.max(r/2,.5):0;return Math.round((t-i)*n)/n+i}function pt(e,t){(t||e)&&((t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function gt(e,t,r,n){mt(e,t,r,n,null)}function mt(e,t,r,n,i){let o,a,s,l,c,u,d,h;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*pe;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(r,n),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void e.restore();if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:i?e.ellipse(r,n,i/2,g,0,0,de):e.arc(r,n,g,0,de),e.closePath();break;case"triangle":u=i?i/2:g,e.moveTo(r+Math.sin(m)*u,n-Math.cos(m)*g),m+=ye,e.lineTo(r+Math.sin(m)*u,n-Math.cos(m)*g),m+=ye,e.lineTo(r+Math.sin(m)*u,n-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=.516*g,l=g-c,a=Math.cos(m+me)*l,d=Math.cos(m+me)*(i?i/2-c:l),s=Math.sin(m+me)*l,h=Math.sin(m+me)*(i?i/2-c:l),e.arc(r-d,n-s,c,m-ue,m-ge),e.arc(r+h,n-a,c,m-ge,m),e.arc(r+d,n+s,c,m,m+ge),e.arc(r-h,n+a,c,m+ge,m+ue),e.closePath();break;
vendor: 8,388 bytes, line 22
22case"rect":if(!p){l=Math.SQRT1_2*g,u=i?i/2:l,e.rect(r-u,n-l,2*u,2*l);break}m+=me;case"rectRot":d=Math.cos(m)*(i?i/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(r-d,n-s),e.lineTo(r+h,n-a),e.lineTo(r+d,n+s),e.lineTo(r-h,n+a),e.closePath();break;case"crossRot":m+=me;case"cross":d=Math.cos(m)*(i?i/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(r-d,n-s),e.lineTo(r+d,n+s),e.moveTo(r+h,n-a),e.lineTo(r-h,n+a);break;case"star":d=Math.cos(m)*(i?i/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(r-d,n-s),e.lineTo(r+d,n+s),e.moveTo(r+h,n-a),e.lineTo(r-h,n+a),m+=me,d=Math.cos(m)*(i?i/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,h=Math.sin(m)*(i?i/2:g),e.moveTo(r-d,n-s),e.lineTo(r+d,n+s),e.moveTo(r+h,n-a),e.lineTo(r-h,n+a);break;case"line":a=i?i/2:Math.cos(m)*g,s=Math.sin(m)*g,e.moveTo(r-a,n-s),e.lineTo(r+a,n+s);break;case"dash":e.moveTo(r,n),e.lineTo(r+Math.cos(m)*(i?i/2:g),n+Math.sin(m)*g);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function yt(e,t,r){return r=r||.5,!t||e&&e.x>t.left-r&&e.x<t.right+r&&e.y>t.top-r&&e.y<t.bottom+r}function _t(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function vt(e){e.restore()}function bt(e,t,r,n,i){if(!t)return e.lineTo(r.x,r.y);if("middle"===i){const n=(t.x+r.x)/2;e.lineTo(n,t.y),e.lineTo(n,r.y)}else"after"===i!=!!n?e.lineTo(t.x,r.y):e.lineTo(r.x,t.y);e.lineTo(r.x,r.y)}function xt(e,t,r,n){if(!t)return e.lineTo(r.x,r.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?r.cp2x:r.cp1x,n?r.cp2y:r.cp1y,r.x,r.y)}function wt(e,t,r,n,i){if(i.strikethrough||i.underline){const o=e.measureText(n),a=t-o.actualBoundingBoxLeft,s=t+o.actualBoundingBoxRight,l=r-o.actualBoundingBoxAscent,c=r+o.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(a,u),e.lineTo(s,u),e.stroke()}}function St(e,t){const r=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=r}function kt(e,t,r,n,i,o={}){const a=U(t)?t:[t],s=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(e.save(),e.font=i.string,function(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),G(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&St(e,o.backdrop),s&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),G(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,r,n,o.maxWidth)),e.fillText(c,r,n,o.maxWidth),wt(e,r,n,c,o),n+=Number(i.lineHeight);e.restore()}function Tt(e,t){const{x:r,y:n,w:i,h:o,radius:a}=t;e.arc(r+a.topLeft,n+a.topLeft,a.topLeft,1.5*ue,ue,!0),e.lineTo(r,n+o-a.bottomLeft),e.arc(r+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,ue,ge,!0),e.lineTo(r+i-a.bottomRight,n+o),e.arc(r+i-a.bottomRight,n+o-a.bottomRight,a.bottomRight,ge,0,!0),e.lineTo(r+i,n+a.topRight),e.arc(r+i-a.topRight,n+a.topRight,a.topRight,0,-ge,!0),e.lineTo(r+a.topLeft,n)}const It=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Mt=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Et(e,t){const r=(""+e).match(It);if(!r||"normal"===r[1])return 1.2*t;switch(e=+r[2],r[3]){case"px":return e;case"%":e/=100}return t*e}const Pt=e=>+e||0;function At(e,t){const r={},n=$(t),i=n?Object.keys(t):t,o=$(e)?n?r=>W(e[r],e[t[r]]):t=>e[t]:()=>e;for(const e of i)r[e]=Pt(o(e));return r}function Ct(e){return At(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Rt(e){return At(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Lt(e){const t=Ct(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ot(e,t){e=e||{},t=t||ut.font;let r=W(e.size,t.size);"string"==typeof r&&(r=parseInt(r,10));let n=W(e.style,t.style);n&&!(""+n).match(Mt)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const i={family:W(e.family,t.family),lineHeight:Et(W(e.lineHeight,t.lineHeight),r),size:r,style:n,weight:W(e.weight,t.weight),string:""};return i.string=function(e){return!e||G(e.size)||G(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(i),i}function Dt(e,t,r,n){let i,o,a,s=!0;for(i=0,o=e.length;i<o;++i)if(a=e[i],void 0!==a&&(void 0!==t&&"function"==typeof a&&(a=a(t),s=!1),void 0!==r&&U(a)&&(a=a[r%a.length],s=!1),void 0!==a))return n&&!s&&(n.cacheable=!1),a}function zt(e,t){return Object.assign(Object.create(e),t)}function Ft(e,t=[""],r,n,i=()=>e[0]){const o=r||e;void 0===n&&(n=Zt("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:i,override:r=>Ft([r,...e],t,o,n)};return new Proxy(a,{deleteProperty:(t,r)=>(delete t[r],delete t._keys,delete e[0][r],!0),get:(r,n)=>Gt(r,n,(()=>function(e,t,r,n){let i;for(const o of t)if(i=Zt(jt(o,e),r),void 0!==i)return Vt(e,i)?qt(r,n,e,i):i}(n,t,e,r))),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>Yt(e).includes(t),ownKeys:e=>Yt(e),set(e,t,r){const n=e._storage||(e._storage=i());return e[t]=n[t]=r,delete e._keys,!0}})}function Nt(e,t,r,n){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:r,_stack:new Set,_descriptors:Bt(e,n),setContext:t=>Nt(e,t,r,n),override:i=>Nt(e.override(i),t,r,n)};return new Proxy(i,{deleteProperty:(t,r)=>(delete t[r],delete e[r],!0),get:(e,t,r)=>Gt(e,t,(()=>function(e,t,r){const{_proxy:n,_context:i,_subProxy:o,_descriptors:a}=e;let s=n[t];le(s)&&a.isScriptable(t)&&(s=function(e,t,r,n){const{_proxy:i,_context:o,_subProxy:a,_stack:s}=r;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(o,a||n);s.delete(e),Vt(e,l)&&(l=qt(i._scopes,i,e,l));return l}(t,s,e,r));U(s)&&s.length&&(s=function(e,t,r,n){const{_proxy:i,_context:o,_subProxy:a,_descriptors:s}=r;if(void 0!==o.index&&n(e))return t[o.index%t.length];if($(t[0])){const r=t,n=i._scopes.filter((e=>e!==r));t=[];for(const l of r){const r=qt(n,i,e,l);t.push(Nt(r,o,a&&a[e],s))}}return t}(t,s,e,a.isIndexable));Vt(t,s)&&(s=Nt(s,i,o&&o[t],a));return s}(e,t,r))),getOwnPropertyDescriptor:(t,r)=>t._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,r)=>Reflect.has(e,r),ownKeys:()=>Reflect.ownKeys(e),set:(t,r,n)=>(e[r]=n,delete t[r],!0)})}function Bt(e,t={scriptable:!0,indexable:!0}){const{_scriptable:r=t.scriptable,_indexable:n=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:r,indexable:n,isScriptable:le(r)?r:()=>r,isIndexable:le(n)?n:()=>n}}const jt=(e,t)=>e?e+ae(t):t,Vt=(e,t)=>$(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function Gt(e,t,r){if(Object.prototype.hasOwnProperty.call(e,t)||"constructor"===t)return e[t];const n=r();return e[t]=n,n}function Ut(e,t,r){return le(e)?e(t,r):e}const $t=(e,t)=>!0===e?t:"string"==typeof e?oe(t,e):void 0;function Ht(e,t,r,n,i){for(const o of t){const t=$t(r,o);if(t){e.add(t);const o=Ut(t._fallback,r,i);if(void 0!==o&&o!==r&&o!==n)return o}else if(!1===t&&void 0!==n&&r!==n)return null}return!1}function qt(e,t,r,n){const i=t._rootScopes,o=Ut(t._fallback,r,n),a=[...e,...i],s=new Set;s.add(n);let l=Wt(s,a,r,o||r,n);return null!==l&&((void 0===o||o===r||(l=Wt(s,a,o,l,n),null!==l))&&Ft(Array.from(s),[""],i,o,(()=>function(e,t,r){const n=e._getTarget();t in n||(n[t]={});const i=n[t];if(U(i)&&$(r))return r;return i||{}}(t,r,n))))}function Wt(e,t,r,n,i){for(;r;)r=Ht(e,t,r,n,i);return r}function Zt(e,t){for(const r of t){if(!r)continue;const t=r[e];if(void 0!==t)return t}}function Yt(e){let t=e._keys;return t||(t=e._keys=function(e){const t=new Set;for(const r of e)for(const e of Object.keys(r).filter((e=>!e.startsWith("_"))))t.add(e);return Array.from(t)}(e._scopes)),t}function Xt(e,t,r,n){const{iScale:i}=e,{key:o="r"}=this._parsing,a=new Array(n);let s,l,c,u;for(s=0,l=n;s<l;++s)c=s+r,u=t[c],a[s]={r:i.parse(oe(u,o),c)};return a}const Kt=Number.EPSILON||1e-14,Jt=(e,t)=>t<e.length&&!e[t].skip&&e[t],Qt=e=>"x"===e?"y":"x";function er(e,t,r,n){const i=e.skip?t:e,o=t,a=r.skip?t:r,s=Ee(o,i),l=Ee(a,o);let c=s/(s+l),u=l/(s+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=n*c,h=n*u;return{previous:{x:o.x-d*(a.x-i.x),y:o.y-d*(a.y-i.y)},next:{x:o.x+h*(a.x-i.x),y:o.y+h*(a.y-i.y)}}}
vendor: 4,700 bytes, line 22
22function tr(e,t="x"){const r=Qt(t),n=e.length,i=Array(n).fill(0),o=Array(n);let a,s,l,c=Jt(e,0);for(a=0;a<n;++a)if(s=l,l=c,c=Jt(e,a+1),l){if(c){const e=c[t]-l[t];i[a]=0!==e?(c[r]-l[r])/e:0}o[a]=s?c?ve(i[a-1])!==ve(i[a])?0:(i[a-1]+i[a])/2:i[a-1]:i[a]}!function(e,t,r){const n=e.length;let i,o,a,s,l,c=Jt(e,0);for(let u=0;u<n-1;++u)l=c,c=Jt(e,u+1),l&&c&&(be(t[u],0,Kt)?r[u]=r[u+1]=0:(i=r[u]/t[u],o=r[u+1]/t[u],s=Math.pow(i,2)+Math.pow(o,2),s<=9||(a=3/Math.sqrt(s),r[u]=i*a*t[u],r[u+1]=o*a*t[u])))}(e,i,o),function(e,t,r="x"){const n=Qt(r),i=e.length;let o,a,s,l=Jt(e,0);for(let c=0;c<i;++c){if(a=s,s=l,l=Jt(e,c+1),!s)continue;const i=s[r],u=s[n];a&&(o=(i-a[r])/3,s[`cp1${r}`]=i-o,s[`cp1${n}`]=u-o*t[c]),l&&(o=(l[r]-i)/3,s[`cp2${r}`]=i+o,s[`cp2${n}`]=u+o*t[c])}}(e,o,t)}function rr(e,t,r){return Math.max(Math.min(e,r),t)}function nr(e,t,r,n,i){let o,a,s,l;if(t.spanGaps&&(e=e.filter((e=>!e.skip))),"monotone"===t.cubicInterpolationMode)tr(e,i);else{let r=n?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)s=e[o],l=er(r,s,e[Math.min(o+1,a-(n?0:1))%a],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,r=s}t.capBezierPoints&&function(e,t){let r,n,i,o,a,s=yt(e[0],t);for(r=0,n=e.length;r<n;++r)a=o,o=s,s=r<n-1&&yt(e[r+1],t),o&&(i=e[r],a&&(i.cp1x=rr(i.cp1x,t.left,t.right),i.cp1y=rr(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=rr(i.cp2x,t.left,t.right),i.cp2y=rr(i.cp2y,t.top,t.bottom)))}(e,r)}function ir(){return"undefined"!=typeof window&&"undefined"!=typeof document}function or(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function ar(e,t,r){let n;return"string"==typeof e?(n=parseInt(e,10),-1!==e.indexOf("%")&&(n=n/100*t.parentNode[r])):n=e,n}const sr=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);const lr=["top","right","bottom","left"];function cr(e,t,r){const n={};r=r?"-"+r:"";for(let i=0;i<4;i++){const o=lr[i];n[o]=parseFloat(e[t+"-"+o+r])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ur(e,t){if("native"in e)return e;const{canvas:r,currentDevicePixelRatio:n}=t,i=sr(r),o="border-box"===i.boxSizing,a=cr(i,"padding"),s=cr(i,"border","width"),{x:l,y:c,box:u}=function(e,t){const r=e.touches,n=r&&r.length?r[0]:e,{offsetX:i,offsetY:o}=n;let a,s,l=!1;if(((e,t,r)=>(e>0||t>0)&&(!r||!r.shadowRoot))(i,o,e.target))a=i,s=o;else{const e=t.getBoundingClientRect();a=n.clientX-e.left,s=n.clientY-e.top,l=!0}return{x:a,y:s,box:l}}(e,r),d=a.left+(u&&s.left),h=a.top+(u&&s.top);let{width:f,height:p}=t;return o&&(f-=a.width+s.width,p-=a.height+s.height),{x:Math.round((l-d)/f*r.width/n),y:Math.round((c-h)/p*r.height/n)}}const dr=e=>Math.round(10*e)/10;function hr(e,t,r,n){const i=sr(e),o=cr(i,"margin"),a=ar(i.maxWidth,e,"clientWidth")||fe,s=ar(i.maxHeight,e,"clientHeight")||fe,l=function(e,t,r){let n,i;if(void 0===t||void 0===r){const o=e&&or(e);if(o){const e=o.getBoundingClientRect(),a=sr(o),s=cr(a,"border","width"),l=cr(a,"padding");t=e.width-l.width-s.width,r=e.height-l.height-s.height,n=ar(a.maxWidth,o,"clientWidth"),i=ar(a.maxHeight,o,"clientHeight")}else t=e.clientWidth,r=e.clientHeight}return{width:t,height:r,maxWidth:n||fe,maxHeight:i||fe}}(e,t,r);let{width:c,height:u}=l;if("content-box"===i.boxSizing){const e=cr(i,"border","width"),t=cr(i,"padding");c-=t.width+e.width,u-=t.height+e.height}c=Math.max(0,c-o.width),u=Math.max(0,n?c/n:u-o.height),c=dr(Math.min(c,a,l.maxWidth)),u=dr(Math.min(u,s,l.maxHeight)),c&&!u&&(u=dr(c/2));return(void 0!==t||void 0!==r)&&n&&l.height&&u>l.height&&(u=l.height,c=dr(Math.floor(u*n))),{width:c,height:u}}function fr(e,t,r){const n=t||1,i=Math.floor(e.height*n),o=Math.floor(e.width*n);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const a=e.canvas;return a.style&&(r||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==n||a.height!==i||a.width!==o)&&(e.currentDevicePixelRatio=n,a.height=i,a.width=o,e.ctx.setTransform(n,0,0,n,0,0),!0)}const pr=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ir()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(e){}return e}();function gr(e,t){const r=function(e,t){return sr(e).getPropertyValue(t)}(e,t),n=r&&r.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function mr(e,t,r,n){return{x:e.x+r*(t.x-e.x),y:e.y+r*(t.y-e.y)}}function yr(e,t,r,n){return{x:e.x+r*(t.x-e.x),y:"middle"===n?r<.5?e.y:t.y:"after"===n?r<1?e.y:t.y:r>0?t.y:e.y}}function _r(e,t,r,n){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},a=mr(e,i,r),s=mr(i,o,r),l=mr(o,t,r),c=mr(a,s,r),u=mr(s,l,r);return mr(c,u,r)}function vr(e,t,r){return e?function(e,t){return{x:r=>e+e+t-r,setWidth(e){t=e},textAlign:e=>
vendor: 18,268 bytes, lines 22-29
22"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}}(t,r):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function br(e,t){let r,n;"ltr"!==t&&"rtl"!==t||(r=e.canvas.style,n=[r.getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",t,"important"),e.prevTextDirection=n)}function xr(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function wr(e){return"angle"===e?{between:Ce,compare:Pe,normalize:Ae}:{between:Le,compare:(e,t)=>e-t,normalize:e=>e}}function Sr({start:e,end:t,count:r,loop:n,style:i}){return{start:e%r,end:t%r,loop:n&&(t-e+1)%r==0,style:i}}function kr(e,t,r){if(!r)return[e];const{property:n,start:i,end:o}=r,a=t.length,{compare:s,between:l,normalize:c}=wr(n),{start:u,end:d,loop:h,style:f}=function(e,t,r){const{property:n,start:i,end:o}=r,{between:a,normalize:s}=wr(n),l=t.length;let c,u,{start:d,end:h,loop:f}=e;if(f){for(d+=l,h+=l,c=0,u=l;c<u&&a(s(t[d%l][n]),i,o);++c)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:f,style:e.style}}(e,t,r),p=[];let g,m,y,_=!1,v=null;const b=()=>_||l(i,y,g)&&0!==s(i,y),x=()=>!_||0===s(o,g)||l(o,y,g);for(let e=u,r=u;e<=d;++e)m=t[e%a],m.skip||(g=c(m[n]),g!==y&&(_=l(g,i,o),null===v&&b()&&(v=0===s(g,i)?e:r),null!==v&&x()&&(p.push(Sr({start:v,end:e,loop:h,count:a,style:f})),v=null),r=e,y=g));return null!==v&&p.push(Sr({start:v,end:d,loop:h,count:a,style:f})),p}function Tr(e,t){const r=[],n=e.segments;for(let i=0;i<n.length;i++){const o=kr(n[i],e.points,t);o.length&&r.push(...o)}return r}function Ir(e,t,r,n){return n&&n.setContext&&r?function(e,t,r,n){const i=e._chart.getContext(),o=Mr(e.options),{_datasetIndex:a,options:{spanGaps:s}}=e,l=r.length,c=[];let u=o,d=t[0].start,h=d;function f(e,t,n,i){const o=s?-1:1;if(e!==t){for(e+=l;r[e%l].skip;)e-=o;for(;r[t%l].skip;)t+=o;e%l!=t%l&&(c.push({start:e%l,end:t%l,loop:n,style:i}),u=i,d=t%l)}}for(const e of t){d=s?d:e.start;let t,o=r[d%l];for(h=d+1;h<=e.end;h++){const s=r[h%l];t=Mr(n.setContext(zt(i,{type:"segment",p0:o,p1:s,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:a}))),Er(t,u)&&f(d,h-1,e.loop,u),o=s,u=t}d<h-1&&f(d,h-1,e.loop,u)}return c}(e,t,r,n):t}function Mr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Er(e,t){if(!t)return!1;const r=[],n=function(e,t){return Xe(t)?(r.includes(t)||r.push(t),r.indexOf(t)):t};return JSON.stringify(e,n)!==JSON.stringify(t,n)}function Pr(e,t,r){return e.options.clip?e[r]:t[r]}function Ar(e,t){const r=t._clip;if(r.disabled)return!1;const n=function(e,t){const{xScale:r,yScale:n}=e;return r&&n?{left:Pr(r,t,"left"),right:Pr(r,t,"right"),top:Pr(n,t,"top"),bottom:Pr(n,t,"bottom")}:t}(t,e.chartArea);return{left:!1===r.left?0:n.left-(!0===r.left?0:r.left),right:!1===r.right?e.width:n.right+(!0===r.right?0:r.right),top:!1===r.top?0:n.top-(!0===r.top?0:r.top),bottom:!1===r.bottom?e.height:n.bottom+(!0===r.bottom?0:r.bottom)}}
23/*!
24 * Chart.js v4.4.9
25 * https://www.chartjs.org
26 * (c) 2025 Chart.js Contributors
27 * Released under the MIT License
28 */
29class Cr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,r,n){const i=t.listeners[n],o=t.duration;i.forEach((n=>n({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(r-t.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=je.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(e=Date.now()){let t=0;this._charts.forEach(((r,n)=>{if(!r.running||!r.items.length)return;const i=r.items;let o,a=i.length-1,s=!1;for(;a>=0;--a)o=i[a],o._active?(o._total>r.duration&&(r.duration=o._total),o.tick(e),s=!0):(i[a]=i[i.length-1],i.pop());s&&(n.draw(),this._notify(n,r,e,"progress")),i.length||(r.running=!1,this._notify(n,r,e,"complete"),r.initial=!1),t+=i.length})),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let r=t.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,r)),r}listen(e,t,r){this._getAnims(e).listeners[t].push(r)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce(((e,t)=>Math.max(e,t._duration)),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const r=t.items;let n=r.length-1;for(;n>=0;--n)r[n].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Rr=new Cr;const Lr="transparent",Or={boolean:(e,t,r)=>r>.5?t:e,color(e,t,r){const n=Ke(e||Lr),i=n.valid&&Ke(t||Lr);return i&&i.valid?i.mix(n,r).hexString():t},number:(e,t,r)=>e+(t-e)*r};class Dr{constructor(e,t,r,n){const i=t[r];n=Dt([e.to,n,i,e.from]);const o=Dt([e.from,i,n]);this._active=!0,this._fn=e.fn||Or[e.type||typeof o],this._easing=Ye[e.easing]||Ye.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=r,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(e,t,r){if(this._active){this._notify(!1);const n=this._target[this._prop],i=r-this._start,o=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Dt([e.to,t,n,e.from]),this._from=Dt([e.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,r=this._duration,n=this._prop,i=this._from,o=this._loop,a=this._to;let s;if(this._active=i!==a&&(o||t<r),!this._active)return this._target[n]=a,void this._notify(!0);t<0?this._target[n]=i:(s=t/r%2,s=o&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[n]=this._fn(i,a,s))}wait(){const e=this._promises||(this._promises=[]);return new Promise(((t,r)=>{e.push({res:t,rej:r})}))}_notify(e){const t=e?"res":"rej",r=this._promises||[];for(let e=0;e<r.length;e++)r[e][t]()}}class zr{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!$(e))return;const t=Object.keys(ut.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach((n=>{const i=e[n];if(!$(i))return;const o={};for(const e of t)o[e]=i[e];(U(i.properties)&&i.properties||[n]).forEach((e=>{e!==n&&r.has(e)||r.set(e,o)}))}))}_animateOptions(e,t){const r=t.options,n=function(e,t){if(!t)return;let r=e.options;if(!r)return void(e.options=t);r.$shared&&(e.options=r=Object.assign({},r,{$shared:!1,$animations:{}}));return r}(e,r);if(!n)return[];const i=this._createAnimations(n,r);return r.$shared&&function(e,t){const r=[],n=Object.keys(t);for(let t=0;t<n.length;t++){const i=e[n[t]];i&&i.active()&&r.push(i.wait())}return Promise.all(r)}(e.options.$animations,r).then((()=>{e.options=r}),(()=>{})),i}_createAnimations(e,t){const r=this._properties,n=[],i=e.$animations||(e.$animations={}),o=Object.keys(t),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const l=o[s];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(e,t));continue}const c=t[l];let u=i[l];const d=r.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(i[l]=u=new Dr(d,e,l,c),n.push(u)):e[l]=c}return n}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const r=this._createAnimations(e,t);return r.length?(Rr.add(this._chart,r),!0):void 0}}function Fr(e,t){const r=e&&e.options||{},n=r.reverse,i=void 0===r.min?t:0,o=void 0===r.max?t:0;return{start:n?o:i,end:n?i:o}}function Nr(e,t){const r=[],n=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=n.length;i<o;++i)r.push(n[i].index);return r}function Br(e,t,r,n={}){const i=e.keys,o="single"===n.mode;let a,s,l,c;if(null===t)return;let u=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===r){if(u=!0,n.all)continue;break}c=e.values[l],H(c)&&(o||0===t||ve(t)===ve(c))&&(t+=c)}return u||n.all?t:0}function jr(e,t){const r=e&&e.options.stacked;return r||void 0===r&&void 0!==t.stack}function Vr(e,t,r){const n=e[t]||(e[t]={});return n[r]||(n[r]={})}function Gr(e,t,r,n){for(const i of t.getMatchingVisibleMetas(n).reverse()){const t=e[i.index];if(r&&t>0||!r&&t<0)return i.index}return null}function Ur(e,t){const{chart:r,_cachedMeta:n}=e,i=r._stacks||(r._stacks={}),{iScale:o,vScale:a,index:s}=n,l=o.axis,c=a.axis,u=function(e,t,r){return`${e.id}.${t.id}.${r.stack||r.type}`}(o,a,n),d=t.length;let h;for(let e=0;e<d;++e){const r=t[e],{[l]:o,[c]:d}=r;h=(r._stacks||(r._stacks={}))[c]=Vr(i,u,o),h[s]=d,h._top=Gr(h,a,!0,n.type),h._bottom=Gr(h,a,!1,n.type);(h._visualValues||(h._visualValues={}))[s]=d}}function $r(e,t){const r=e.scales;return Object.keys(r).filter((e=>r[e].axis===t)).shift()}function Hr(e,t){const r=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[n]||void 0===t[n][r])return;delete t[n][r],void 0!==t[n]._visualValues&&void 0!==t[n]._visualValues[r]&&delete t[n]._visualValues[r]}}}const qr=e=>"reset"===e||"none"===e,Wr=(e,t)=>t?e:Object.assign({},e);class Zr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=jr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Hr(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,r=this.getDataset(),n=(e,t,r,n)=>"x"===e?t:"r"===e?n:r,i=t.xAxisID=W(r.xAxisID,$r(e,"x")),o=t.yAxisID=W(r.yAxisID,$r(e,"y")),a=t.rAxisID=W(r.rAxisID,$r(e,"r")),s=t.indexAxis,l=t.iAxisID=n(s,i,o,a),c=t.vAxisID=n(s,o,i,a);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Ne(this._data,this),e._stacked&&Hr(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),r=this._data;if($(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:r,vScale:n}=t,i="x"===r.axis?"x":"y",o="x"===n.axis?"x":"y",a=Object.keys(e),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[i]:u,[o]:e[u]};return s}(t,e)}else if(r!==t){if(r){Ne(r,this);const e=this._cachedMeta;Hr(e),e._parsed=[]}t&&Object.isExtensible(t)&&(i=this,(n=t)._chartjs?n._chartjs.listeners.push(i):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[i]}}),Fe.forEach((e=>{const t="_onData"+ae(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...e){const i=r.apply(this,e);return n._chartjs.listeners.forEach((r=>{"function"==typeof r[t]&&r[t](...e)})),i}})})))),this._syncList=[],this._data=t}var n,i}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,r=this.getDataset();let n=!1;this._dataCheck();const i=t._stacked;t._stacked=jr(t.vScale,t),t.stack!==r.stack&&(n=!0,Hr(t),t.stack=r.stack),this._resyncElements(e),(n||i!==t._stacked)&&(Ur(this,t._parsed),t._stacked=jr(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:r,_data:n}=this,{iScale:i,_stacked:o}=r,a=i.axis;let s,l,c,u=0===e&&t===n.length||r._sorted,d=e>0&&r._parsed[e-1];if(!1===this._parsing)r._parsed=n,r._sorted=!0,c=n;else{c=U(n[e])?this.parseArrayData(r,n,e,t):$(n[e])?this.parseObjectData(r,n,e,t):this.parsePrimitiveData(r,n,e,t);const i=()=>null===l[a]||d&&l[a]<d[a];for(s=0;s<t;++s)r._parsed[s+e]=l=c[s],u&&(i()&&(u=!1),d=l);r._sorted=u}o&&Ur(this,c)}parsePrimitiveData(e,t,r,n){const{iScale:i,vScale:o}=e,a=i.axis,s=o.axis,l=i.getLabels(),c=i===o,u=new Array(n);let d,h,f;for(d=0,h=n;d<h;++d)f=d+r,u[d]={[a]:c||i.parse(l[f],f),[s]:o.parse(t[f],f)};return u}parseArrayData(e,t,r,n){const{xScale:i,yScale:o}=e,a=new Array(n);let s,l,c,u;for(s=0,l=n;s<l;++s)c=s+r,u=t[c],a[s]={x:i.parse(u[0],c),y:o.parse(u[1],c)};return a}parseObjectData(e,t,r,n){const{xScale:i,yScale:o}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(n);let c,u,d,h;for(c=0,u=n;c<u;++c)d=c+r,h=t[d],l[c]={x:i.parse(oe(h,a),d),y:o.parse(oe(h,s),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,r){const n=this.chart,i=this._cachedMeta,o=t[e.axis];return Br({keys:Nr(n,!0),values:t._stacks[e.axis]._visualValues},o,i.index,{mode:r})}updateRangeFromParsed(e,t,r,n){const i=r[t.axis];let o=null===i?NaN:i;const a=n&&r._stacks[t.axis];n&&a&&(n.values=a,o=Br(n,i,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const r=this._cachedMeta,n=r._parsed,i=r._sorted&&e===r.iScale,o=n.length,a=this._getOtherScale(e),s=((e,t,r)=>e&&!t.hidden&&t._stacked&&{keys:Nr(r,!0),values:null})(t,r,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(e){const{min:t,max:r,minDefined:n,maxDefined:i}=e.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:i?r:Number.POSITIVE_INFINITY}}(a);let d,h;function f(){h=n[d];const t=h[a.axis];return!H(h[e.axis])||c>t||u<t}for(d=0;d<o&&(f()||(this.updateRangeFromParsed(l,e,h,s),!i));++d);if(i)for(d=o-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(l,e,h,s);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,r=[];let n,i,o;for(n=0,i=t.length;n<i;++n)o=t[n][e.axis],H(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,r=t.iScale,n=t.vScale,i=this.getParsed(e);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:n?""+n.getLabelForValue(i[n.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,r,n,i;return $(e)?(t=e.top,r=e.right,n=e.bottom,i=e.left):t=r=n=i=e,{top:t,right:r,bottom:n,left:i,disabled:!1===e}}(W(this.options.clip,function(e,t,r){if(!1===r)return!1;const n=Fr(e,r),i=Fr(t,r);return{top:i.end,right:n.end,bottom:i.start,left:n.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,r=this._cachedMeta,n=r.data||[],i=t.chartArea,o=[],a=this._drawStart||0,s=this._drawCount||n.length-a,l=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(e,i,a,s),c=a;c<a+s;++c){const t=n[c];t.hidden||(t.active&&l?o.push(t):t.draw(e,i))}for(c=0;c<o.length;++c)o[c].draw(e,i)}getStyle(e,t){const r=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,t,r){const n=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];i=t.$context||(t.$context=function(e,t,r){return zt(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:r,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),i.parsed=this.getParsed(e),i.raw=n.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=function(e,t){return zt(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),i.dataset=n,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=r,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",r){const n="active"===t,i=this._cachedDataOpts,o=e+"-"+t,a=i[o],s=this.enableOptionSharing&&se(r);if(a)return Wr(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),u=n?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),c),h=Object.keys(ut.elements[e]),f=l.resolveNamedOptions(d,h,(()=>this.getContext(r,n,t)),u);return f.$shared&&(f.$shared=s,i[o]=Object.freeze(Wr(f,s))),f}_resolveAnimations(e,t,r){const n=this.chart,i=this._cachedDataOpts,o=`animation-${t}`,a=i[o];if(a)return a;let s;if(!1!==n.options.animation){const n=this.chart.config,i=n.datasetAnimationScopeKeys(this._type,t),o=n.getOptionScopes(this.getDataset(),i);s=n.createResolver(o,this.getContext(e,r,t))}const l=new zr(n,s&&s.animations);return s&&s._cacheable&&(i[o]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||qr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const r=this.resolveDataElementOptions(e,t),n=this._sharedOptions,i=this.getSharedOptions(r),o=this.includeOptions(t,i)||i!==n;return this.updateSharedOptions(i,t,r),{sharedOptions:i,includeOptions:o}}updateElement(e,t,r,n){qr(n)?Object.assign(e,r):this._resolveAnimations(t,n).update(e,r)}updateSharedOptions(e,t,r){e&&!qr(t)&&this._resolveAnimations(void 0,t).update(e,r)}_setStyle(e,t,r,n){e.active=n;const i=this.getStyle(t,n);
vendor: 4,476 bytes, line 29
29this._resolveAnimations(t,r,n).update(e,{options:!n&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,t,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,r=this._cachedMeta.data;for(const[e,t,r]of this._syncList)this[e](t,r);this._syncList=[];const n=r.length,i=t.length,o=Math.min(i,n);o&&this.parse(0,o),i>n?this._insertElements(n,i-n,e):i<n&&this._removeElements(i,n-i)}_insertElements(e,t,r=!0){const n=this._cachedMeta,i=n.data,o=e+t;let a;const s=e=>{for(e.length+=t,a=e.length-1;a>=o;a--)e[a]=e[a-t]};for(s(i),a=e;a<o;++a)i[a]=new this.dataElementType;this._parsing&&s(n._parsed),this.parse(e,t),r&&this.updateElements(i,e,t,"reset")}updateElements(e,t,r,n){}_removeElements(e,t){const r=this._cachedMeta;if(this._parsing){const n=r._parsed.splice(e,t);r._stacked&&Hr(r,n)}r.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,r,n]=e;this[t](r,n)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Yr(e){const t=e.iScale,r=function(e,t){if(!e._cache.$bar){const r=e.getMatchingVisibleMetas(t);let n=[];for(let t=0,i=r.length;t<i;t++)n=n.concat(r[t].controller.getAllParsedValues(e));e._cache.$bar=Be(n.sort(((e,t)=>e-t)))}return e._cache.$bar}(t,e.type);let n,i,o,a,s=t._length;const l=()=>{32767!==o&&-32768!==o&&(se(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(n=0,i=r.length;n<i;++n)o=t.getPixelForValue(r[n]),l();for(a=void 0,n=0,i=t.ticks.length;n<i;++n)o=t.getPixelForTick(n),l();return s}function Xr(e,t,r,n){return U(e)?function(e,t,r,n){const i=r.parse(e[0],n),o=r.parse(e[1],n),a=Math.min(i,o),s=Math.max(i,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[r.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:a,max:s}}(e,t,r,n):t[r.axis]=r.parse(e,n),t}function Kr(e,t,r,n){const i=e.iScale,o=e.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,h;for(c=r,u=r+n;c<u;++c)h=t[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(Xr(h,d,o,c));return l}function Jr(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function Qr(e,t,r,n){let i=t.borderSkipped;const o={};if(!i)return void(e.borderSkipped=o);if(!0===i)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=function(e){let t,r,n,i,o;return e.horizontal?(t=e.base>e.x,r="left",n="right"):(t=e.base<e.y,r="bottom",n="top"),t?(i="end",o="start"):(i="start",o="end"),{start:r,end:n,reverse:t,top:i,bottom:o}}(e);"middle"===i&&r&&(e.enableBorderRadius=!0,(r._top||0)===n?i=c:(r._bottom||0)===n?i=u:(o[en(u,a,s,l)]=!0,i=c)),o[en(i,a,s,l)]=!0,e.borderSkipped=o}function en(e,t,r,n){var i,o,a;return n?(a=r,e=tn(e=(i=e)===(o=t)?a:i===a?o:i,r,t)):e=tn(e,t,r),e}function tn(e,t,r){return"start"===e?t:"end"===e?r:e}function rn(e,{inflateAmount:t},r){e.inflateAmount="auto"===t?1===r?.33:0:t}class nn extends Zr{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:r,color:n}}=e.legend.options;return t.labels.map(((t,i)=>{const o=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(i),index:i}}))}return[]}},onClick(e,t,r){r.chart.toggleDataVisibility(t.index),r.chart.update(
vendor: 3,134 bytes, line 29
29)}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const r=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=r;else{let i,o,a=e=>+r[e];if($(r[e])){const{key:e="value"}=this._parsing;a=t=>+oe(r[t],e)}for(i=e,o=e+t;i<o;++i)n._parsed[i]=a(i)}}_getRotation(){return ke(this.options.rotation-90)}_getCircumference(){return ke(this.options.circumference)}_getRotationExtents(){let e=de,t=-de;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const n=this.chart.getDatasetMeta(r).controller,i=n._getRotation(),o=n._getCircumference();e=Math.min(e,i),t=Math.max(t,i+o)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:r}=t,n=this._cachedMeta,i=n.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),s=Math.min((l=this.options.cutout,c=a,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(e,t,r){let n=1,i=1,o=0,a=0;if(t<de){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),f=(e,t,n)=>Ce(e,s,l,!0)?1:Math.max(t,t*r,n,n*r),p=(e,t,n)=>Ce(e,s,l,!0)?-1:Math.min(t,t*r,n,n*r),g=f(0,c,d),m=f(ge,u,h),y=p(ue,c,d),_=p(ue+ge,u,h);n=(g-y)/2,i=(m-_)/2,o=-(g+y)/2,a=-(m+_)/2}return{ratioX:n,ratioY:i,offsetX:o,offsetY:a}}(h,d,s),y=(r.width-o)/f,_=(r.height-o)/p,v=Math.max(Math.min(y,_)/2,0),b=Z(this.options.radius,v),x=(b-Math.max(b*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*b,this.offsetY=m*b,n.total=this.calculateTotal(),this.outerRadius=b-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*u,0),this.updateElements(i,0,i.length,e)}_circumference(e,t){const r=this.options,n=this._cachedMeta,i=this._getCircumference();return t&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||null===n._parsed[e]||n.data[e].hidden?0:this.calculateCircumference(n._parsed[e]*i/de)}updateElements(e,t,r,n){const i="reset"===n,o=this.chart,a=o.chartArea,s=o.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,h=u?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(t,n);let g,m=this._getRotation();for(g=0;g<t;++g)m+=this._circumference(g,i);for(g=t;g<t+r;++g){const t=this._circumference(g,i),r=e[g],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+t,circumference:t,outerRadius:h,innerRadius:d};p&&(o.options=f||this.resolveDataElementOptions(g,r.active?"active":n)),m+=t,this.updateElement(r,g,o,n)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let r,n=0;for(r=0;r<t.length;r++){const i=e._parsed[r];null===i||isNaN(i)||!this.chart.getDataVisibility(r)||t[r].hidden||(n+=Math.abs(i))}return n}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?de*(Math.abs(e)/t):0}
vendor: 5,981 bytes, line 29
29getLabelAndValue(e){const t=this._cachedMeta,r=this.chart,n=r.data.labels||[],i=rt(t._parsed[e],r.options.locale);return{label:n[e]||"",value:i}}getMaxBorderWidth(e){let t=0;const r=this.chart;let n,i,o,a,s;if(!e)for(n=0,i=r.data.datasets.length;n<i;++n)if(r.isDatasetVisible(n)){o=r.getDatasetMeta(n),e=o.data,a=o.controller;break}if(!e)return 0;for(n=0,i=e.length;n<i;++n)s=a.resolveDataElementOptions(n),"inner"!==s.borderAlign&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let r=0,n=e.length;r<n;++r){const e=this.resolveDataElementOptions(r);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(t+=this._getRingWeight(r));return t}_getRingWeight(e){return Math.max(W(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class on extends Zr{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:r,color:n}}=e.legend.options;return t.labels.map(((t,i)=>{const o=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(i),index:i}}))}return[]}},onClick(e,t,r){r.chart.toggleDataVisibility(t.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,r=this.chart,n=r.data.labels||[],i=rt(t._parsed[e].r,r.options.locale);return{label:n[e]||"",value:i}}parseObjectData(e,t,r,n){return Xt.bind(this)(e,t,r,n)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(((e,r)=>{const n=this.getParsed(r).r;!isNaN(n)&&this.chart.getDataVisibility(r)&&(n<t.min&&(t.min=n),n>t.max&&(t.max=n))})),t}_updateRadius(){const e=this.chart,t=e.chartArea,r=e.options,n=Math.min(t.right-t.left,t.bottom-t.top),i=Math.max(n/2,0),o=(i-Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=i-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(e,t,r,n){const i="reset"===n,o=this.chart,a=o.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,c=s.yCenter,u=s.getIndexAngle(0)-.5*ue;let d,h=u;const f=360/this.countVisibleElements();for(d=0;d<t;++d)h+=this._computeAngle(d,n,f);for(d=t;d<t+r;d++){const t=e[d];let r=h,p=h+this._computeAngle(d,n,f),g=o.getDataVisibility(d)?s.getDistanceFromCenterForValue(this.getParsed(d).r):0;h=p,i&&(a.animateScale&&(g=0),a.animateRotate&&(r=p=u));const m={x:l,y:c,innerRadius:0,outerRadius:g,startAngle:r,endAngle:p,options:this.resolveDataElementOptions(d,t.active?"active":n)};this.updateElement(t,d,m,n)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach(((e,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&t++})),t}_computeAngle(e,t,r){return this.chart.getDataVisibility(e)?ke(this.resolveDataElementOptions(e,t).angle||r):0}}var an=Object.freeze({__proto__:null,BarController:class extends Zr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,r,n){return Kr(e,t,r,n)}parseArrayData(e,t,r,n){return Kr(e,t,r,n)}parseObjectData(e,t,r,n){const{iScale:i,vScale:o}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===i.axis?a:s,c="x"===o.axis?a:s,u=[];let d,h,f,p;for(d=r,h=r+n;d<h;++d)p=t[d],f={},f[i.axis]=i.parse(oe(p,l),d),u.push(Xr(oe(p,c),f,o,d));return u}updateRangeFromParsed(e,t,r,n){super.updateRangeFromParsed(e,t,r,n);const i=r._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:r,vScale:n}=t,i=this.getParsed(e),o=i._custom,a=Jr(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(i[n.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,r,n){const i="reset"===n,{index:o,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,n);for(let h=t;h<t+r;h++){const t=this.getParsed(h),r=i||G(t[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(h),f=this._calculateBarIndexPixels(h,c),p=(t._stacks||{})[a.axis],g={horizontal:l,base:r.base,enableBorderRadius:!p||Jr(t._custom)||o===p._top||o===p._bottom,x:l?r.head:f.center,y:l?f.center:r.head,height:l?f.size:Math.abs(r.size),width:l?Math.abs(r.size):f.size};d&&(g.options=u||this.resolveDataElementOptions(h,e[h].active?"active":n));const m=g.options||e[h].options;Qr(g,m,p,o),rn(g,m,c.ratio),this.updateElement(e[h],h,g,n)}}_getStacks(e,t){const{iScale:r}=this._cachedMeta,n=r.getMatchingVisibleMetas(this._type).filter((e=>e.controller.options.grouped)),i=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(t),s=a&&a[r.axis],l=e=>{const t=e._parsed.find((e=>
vendor: 6,599 bytes, line 29
29e[r.axis]===s)),n=t&&t[e.vScale.axis];if(G(n)||isNaN(n))return!0};for(const r of n)if((void 0===t||!l(r))&&((!1===i||-1===o.indexOf(r.stack)||void 0===i&&void 0===r.stack)&&o.push(r.stack),r.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,r){const n=this._getStacks(e,r),i=void 0!==t?n.indexOf(t):-1;return-1===i?n.length-1:i}_getRuler(){const e=this.options,t=this._cachedMeta,r=t.iScale,n=[];let i,o;for(i=0,o=t.data.length;i<o;++i)n.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=e.barThickness;return{min:a||Yr(t),pixels:n,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:r,index:n},options:{base:i,minBarLength:o}}=this,a=i||0,s=this.getParsed(e),l=s._custom,c=Jr(l);let u,d,h=s[t.axis],f=0,p=r?this.applyStack(t,s,r):h;p!==h&&(f=p-h,p=h),c&&(h=l.barStart,p=l.barEnd-l.barStart,0!==h&&ve(h)!==ve(l.barEnd)&&(f=0),f+=h);const g=G(i)||c?f:i;let m=t.getPixelForValue(g);if(u=this.chart.getDataVisibility(e)?t.getPixelForValue(f+p):m,d=u-m,Math.abs(d)<o){d=function(e,t,r){return 0!==e?ve(e):(t.isHorizontal()?1:-1)*(t.min>=r?1:-1)}(d,t,a)*o,h===a&&(m-=d/2);const e=t.getPixelForDecimal(0),i=t.getPixelForDecimal(1),l=Math.min(e,i),f=Math.max(e,i);m=Math.max(Math.min(m,f),l),u=m+d,r&&!c&&(s._stacks[t.axis]._visualValues[n]=t.getValueForPixel(u)-t.getValueForPixel(m))}if(m===t.getPixelForValue(a)){const e=ve(d)*t.getLineWidthForValue(a)/2;m+=e,d-=e}return{size:d,base:m,head:u,center:u+d/2}}_calculateBarIndexPixels(e,t){const r=t.scale,n=this.options,i=n.skipNull,o=W(n.maxBarThickness,1/0);let a,s;if(t.grouped){const r=i?this._getStackCount(e):t.stackCount,l="flex"===n.barThickness?function(e,t,r,n){const i=t.pixels,o=i[e];let a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=r.categoryPercentage;null===a&&(a=o-(null===s?t.end-t.start:s-o)),null===s&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/n,ratio:r.barPercentage,start:c}}(e,t,n,r):function(e,t,r,n){const i=r.barThickness;let o,a;return G(i)?(o=t.min*r.categoryPercentage,a=r.barPercentage):(o=i*n,a=1),{chunk:o/n,ratio:a,start:t.pixels[e]-o/2}}(e,t,n,r),c=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(o,l.chunk*l.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.axis],e),s=Math.min(o,t.min*t.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const e=this._cachedMeta,t=e.vScale,r=e.data,n=r.length;let i=0;for(;i<n;++i)null===this.getParsed(i)[t.axis]||r[i].hidden||r[i].draw(this._ctx)}},BubbleController:class extends Zr{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,r,n){const i=super.parsePrimitiveData(e,t,r,n);for(let e=0;e<i.length;e++)i[e]._custom=this.resolveDataElementOptions(e+r).radius;return i}parseArrayData(e,t,r,n){const i=super.parseArrayData(e,t,r,n);for(let e=0;e<i.length;e++){const n=t[r+e];i[e]._custom=W(n[2],this.resolveDataElementOptions(e+r).radius)}return i}parseObjectData(e,t,r,n){const i=super.parseObjectData(e,t,r,n);for(let e=0;e<i.length;e++){const n=t[r+e];i[e]._custom=W(n&&n.r&&+n.r,this.resolveDataElementOptions(e+r).radius)}return i}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let r=e.length-1;r>=0;--r)t=Math.max(t,e[r].size(this.resolveDataElementOptions(r))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,r=this.chart.data.labels||[],{xScale:n,yScale:i}=t,o=this.getParsed(e),a=n.getLabelForValue(o.x),s=i.getLabelForValue(o.y),l=o._custom;return{label:r[e]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,r,n){const i="reset"===n,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(t,n),c=o.axis,u=a.axis;for(let d=t;d<t+r;d++){const t=e[d],r=!i&&this.getParsed(d),h={},f=h[c]=i?o.getPixelForDecimal(.5):o.getPixelForValue(r[c]),p=h[u]=i?a.getBasePixel():a.getPixelForValue(r[u]);h.skip=isNaN(f)||isNaN(p),l&&(h.options=s||this.resolveDataElementOptions(d,t.active?"active":n),i&&(h.options.radius=0)),this.updateElement(t,d,h,n)}}resolveDataElementOptions(e,t){const r=this.getParsed(e);let n=super.resolveDataElementOptions(e,t);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const i=n.radius;return"active"!==t&&(n.radius=0),n.radius+=W(r&&r._custom,i),n}},DoughnutController:nn,LineController:class extends Zr{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:r,data:n=[],_dataset:i}=t,o=this.chart._animationsDisabled;let{start:a,count:s}=$e(t,n,o);this._drawStart=a,this._drawCount=s,He(t)&&(a=0,s=n.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=n;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:l},e),this.updateElements(n,a,s,e)}updateElements(e,t,r,n){const i="reset"===n,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,n),d=o.axis,h=a.axis,{spanGaps:f,segment:p}=this.options,g=we(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||i||"none"===n,y=t+r,_=e.length;let v=t>0&&this.getParsed(t-1);for(let r=0;r<_;++r){const f=e[r],_=m?f:{};if(r<t||r>=y){_.skip=!0;continue}const b=this.getParsed(r),x=G(b[h]),w=_[d]=o.getPixelForValue(b[d],r),S=_[h]=i||x?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,b,s):b[h],r);_.skip=isNaN(w)||isNaN(S)||x,_.stop=r>0&&Math.abs(b[d]-v[d])>g,p&&(_.parsed=b,_.raw=l.data[r]),u&&(_.options=c||this.resolveDataElementOptions(r,f.active?"active":n)),m||this.updateElement(f,r,_,n),v=b}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,r=t.options&&t.options.borderWidth||0,n=e.data||[];if(!n.length)return r;const i=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));
vendor: 19,520 bytes, line 29
29return Math.max(r,i,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},PieController:class extends nn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:on,RadarController:class extends Zr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){const t=this._cachedMeta.vScale,r=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(r[t.axis])}}parseObjectData(e,t,r,n){return Xt.bind(this)(e,t,r,n)}update(e){const t=this._cachedMeta,r=t.dataset,n=t.data||[],i=t.iScale.getLabels();if(r.points=n,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const o={_loop:!0,_fullLoop:i.length===n.length,options:t};this.updateElement(r,void 0,o,e)}this.updateElements(n,0,n.length,e)}updateElements(e,t,r,n){const i=this._cachedMeta.rScale,o="reset"===n;for(let a=t;a<t+r;a++){const t=e[a],r=this.resolveDataElementOptions(a,t.active?"active":n),s=i.getPointPositionForValue(a,this.getParsed(a).r),l=o?i.xCenter:s.x,c=o?i.yCenter:s.y,u={x:l,y:c,angle:s.angle,skip:isNaN(l)||isNaN(c),options:r};this.updateElement(t,a,u,n)}}},ScatterController:class extends Zr{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){const t=this._cachedMeta,r=this.chart.data.labels||[],{xScale:n,yScale:i}=t,o=this.getParsed(e),a=n.getLabelForValue(o.x),s=i.getLabelForValue(o.y);return{label:r[e]||"",value:"("+a+", "+s+")"}}update(e){const t=this._cachedMeta,{data:r=[]}=t,n=this.chart._animationsDisabled;let{start:i,count:o}=$e(t,r,n);if(this._drawStart=i,this._drawCount=o,He(t)&&(i=0,o=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:i,_dataset:o}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=r;const a=this.resolveDatasetElementOptions(e);a.segment=this.options.segment,this.updateElement(i,void 0,{animated:!n,options:a},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(r,i,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,r,n){const i="reset"===n,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(t,n),u=this.getSharedOptions(c),d=this.includeOptions(n,u),h=o.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=we(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||"none"===n;let _=t>0&&this.getParsed(t-1);for(let c=t;c<t+r;++c){const t=e[c],r=this.getParsed(c),p=y?t:{},v=G(r[f]),b=p[h]=o.getPixelForValue(r[h],c),x=p[f]=i||v?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,r,s):r[f],c);p.skip=isNaN(b)||isNaN(x)||v,p.stop=c>0&&Math.abs(r[h]-_[h])>m,g&&(p.parsed=r,p.raw=l.data[c]),d&&(p.options=u||this.resolveDataElementOptions(c,t.active?"active":n)),y||this.updateElement(t,c,p,n),_=r}this.updateSharedOptions(u,n,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let r=t.length-1;r>=0;--r)e=Math.max(e,t[r].size(this.resolveDataElementOptions(r))/2);return e>0&&e}const r=e.dataset,n=r.options&&r.options.borderWidth||0;if(!t.length)return n;const i=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(n,i,o)/2}}});function sn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ln{static override(e){Object.assign(ln.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return sn()}parse(){return sn()}format(){return sn()}add(){return sn()}diff(){return sn()}startOf(){return sn()}endOf(){return sn()}}var cn=ln;function un(e,t,r,n){const{controller:i,data:o,_sorted:a}=e,s=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&"r"!==t&&a&&o.length){const a=s._reversePixels?ze:De;if(!n){const n=a(o,t,r);if(l){const{vScale:t}=i._cachedMeta,{_parsed:r}=e,o=r.slice(0,n.lo+1).reverse().findIndex((e=>!G(e[t.axis])));n.lo-=Math.max(0,o);const a=r.slice(n.hi).findIndex((e=>!G(e[t.axis])));n.hi+=Math.max(0,a)}return n}if(i._sharedOptions){const e=o[0],n="function"==typeof e.getRange&&e.getRange(t);if(n){const e=a(o,t,r-n),i=a(o,t,r+n);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:o.length-1}}function dn(e,t,r,n,i){const o=e.getSortedVisibleDatasetMetas(),a=r[t];for(let e=0,r=o.length;e<r;++e){const{index:r,data:s}=o[e],{lo:l,hi:c}=un(o[e],t,a,i);for(let e=l;e<=c;++e){const t=s[e];t.skip||n(t,r,e)}}}function hn(e,t,r,n,i){const o=[];if(!i&&!e.isPointInArea(t))return o;return dn(e,r,t,(function(r,a,s){(i||yt(r,e.chartArea,0))&&r.inRange(t.x,t.y,n)&&o.push({element:r,datasetIndex:a,index:s})}),!0),o}function fn(e,t,r,n,i,o){let a=[];const s=function(e){const t=-1!==e.indexOf("x"),r=-1!==e.indexOf("y");return function(e,n){const i=t?Math.abs(e.x-n.x):0,o=r?Math.abs(e.y-n.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}(r);let l=Number.POSITIVE_INFINITY;return dn(e,r,t,(function(r,c,u){const d=r.inRange(t.x,t.y,i);if(n&&!d)return;const h=r.getCenterPoint(i);if(!(!!o||e.isPointInArea(h))&&!d)return;const f=s(t,h);f<l?(a=[{element:r,datasetIndex:c,index:u}],l=f):f===l&&a.push({element:r,datasetIndex:c,index:u})})),a}function pn(e,t,r,n,i,o){return o||e.isPointInArea(t)?"r"!==r||n?fn(e,t,r,n,i,o):function(e,t,r,n){let i=[];return dn(e,r,t,(function(e,r,o){const{startAngle:a,endAngle:s}=e.getProps(["startAngle","endAngle"],n),{angle:l}=Me(e,{x:t.x,y:t.y});Ce(l,a,s)&&i.push({element:e,datasetIndex:r,index:o})})),i}(e,t,r,i):[]}function gn(e,t,r,n,i){const o=[],a="x"===r?"inXRange":"inYRange";let s=!1;return dn(e,r,t,((e,n,l)=>{e[a]&&e[a](t[r],i)&&(o.push({element:e,datasetIndex:n,index:l}),s=s||e.inRange(t.x,t.y,i))})),n&&!s?[]:o}var mn={evaluateInteractionItems:dn,modes:{index(e,t,r,n){const i=ur(t,e),o=r.axis||"x",a=r.includeInvisible||!1,s=r.intersect?hn(e,i,o,n,a):pn(e,i,o,!1,n,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach((e=>{const t=s[0].index,r=e.data[t];r&&!r.skip&&l.push({element:r,datasetIndex:e.index,index:t})})),l):[]},dataset(e,t,r,n){const i=ur(t,e),o=r.axis||"xy",a=r.includeInvisible||!1;let s=r.intersect?hn(e,i,o,n,a):pn(e,i,o,!1,n,a);if(s.length>0){const t=s[0].datasetIndex,r=e.getDatasetMeta(t).data;s=[];for(let e=0;e<r.length;++e)s.push({element:r[e],datasetIndex:t,index:e})}return s},point:(e,t,r,n)=>hn(e,ur(t,e),r.axis||"xy",n,r.includeInvisible||!1),nearest(e,t,r,n){const i=ur(t,e),o=r.axis||"xy",a=r.includeInvisible||!1;return pn(e,i,o,r.intersect,n,a)},x:(e,t,r,n)=>gn(e,ur(t,e),"x",r.intersect,n),y:(e,t,r,n)=>gn(e,ur(t,e),"y",r.intersect,n)}};const yn=["left","top","right","bottom"];function _n(e,t){return e.filter((e=>e.pos===t))}function vn(e,t){return e.filter((e=>-1===yn.indexOf(e.pos)&&e.box.axis===t))}function bn(e,t){return e.sort(((e,r)=>{const n=t?r:e,i=t?e:r;return n.weight===i.weight?n.index-i.index:n.weight-i.weight}))}function xn(e,t){const r=function(e){const t={};for(const r of e){const{stack:e,pos:n,stackWeight:i}=r;if(!e||!yn.includes(n))continue;const o=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return t}(e),{vBoxMaxWidth:n,hBoxMaxHeight:i}=t;let o,a,s;for(o=0,a=e.length;o<a;++o){s=e[o];const{fullSize:a}=s.box,l=r[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*n:a&&t.availableWidth,s.height=i):(s.width=n,s.height=c?c*i:a&&t.availableHeight)}return r}function wn(e,t,r,n){return Math.max(e[r],t[r])+Math.max(e[n],t[n])}function Sn(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function kn(e,t,r,n){const{pos:i,box:o}=r,a=e.maxPadding;if(!$(i)){r.size&&(e[i]-=r.size);const t=n[r.stack]||{size:0,count:1};t.size=Math.max(t.size,r.horizontal?o.height:o.width),r.size=t.size/t.count,e[i]+=r.size}o.getPadding&&Sn(a,o.getPadding());const s=Math.max(0,t.outerWidth-wn(a,e,"left","right")),l=Math.max(0,t.outerHeight-wn(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,r.horizontal?{same:c,other:u}:{same:u,other:c}}function Tn(e,t){const r=t.maxPadding;function n(e){const n={left:0,top:0,right:0,bottom:0};return e.forEach((e=>{n[e]=Math.max(t[e],r[e])})),n}return n(e?["left","right"]:["top","bottom"])}function In(e,t,r,n){const i=[];let o,a,s,l,c,u;for(o=0,a=e.length,c=0;o<a;++o){s=e[o],l=s.box,l.update(s.width||t.w,s.height||t.h,Tn(s.horizontal,t));const{same:a,other:d}=kn(t,r,s,n);c|=a&&i.length,u=u||d,l.fullSize||i.push(s)}return c&&In(i,t,r,n)||u}function Mn(e,t,r,n,i){e.top=r,e.left=t,e.right=t+n,e.bottom=r+i,e.width=n,e.height=i}function En(e,t,r,n){const i=r.padding;let{x:o,y:a}=t;for(const s of e){const e=s.box,l=n[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const n=t.w*c,o=l.size||e.height;se(l.start)&&(a=l.start),e.fullSize?Mn(e,i.left,a,r.outerWidth-i.right-i.left,o):Mn(e,t.left+l.placed,a,n,o),l.start=a,l.placed+=n,a=e.bottom}else{const n=t.h*c,a=l.size||e.width;se(l.start)&&(o=l.start),e.fullSize?Mn(e,o,i.top,a,r.outerHeight-i.bottom-i.top):Mn(e,o,t.top+l.placed,a,n),l.start=o,l.placed+=n,o=e.right}}t.x=o,t.y=a}var Pn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const r=e.boxes?e.boxes.indexOf(t):-1;-1!==r&&e.boxes.splice(r,1)},configure(e,t,r){t.fullSize=r.fullSize,t.position=r.position,t.weight=r.weight},update(e,t,r,n){if(!e)return;const i=Lt(e.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(r-i.height,0),s=function(e){const t=function(e){const t=[];let r,n,i,o,a,s;for(r=0,n=(e||[]).length;r<n;++r)i=e[r],({position:o,options:{stack:a,stackWeight:s=1}}=i),t.push({index:r,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return t}(e),r=bn(t.filter((e=>e.box.fullSize)),!0),n=bn(_n(t,"left"),!0),i=bn(_n(t,"right")),o=bn(_n(t,"top"),!0),a=bn(_n(t,"bottom")),s=vn(t,"x"),l=vn(t,"y");return{fullSize:r,leftAndTop:n.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:_n(t,"chartArea"),vertical:n.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}(e.boxes),l=s.vertical,c=s.horizontal;X(e.boxes,(e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()}));const u=l.reduce(((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1),0)||1,d=Object.freeze({outerWidth:t,outerHeight:r,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},i);Sn(h,Lt(n));const f=Object.assign({maxPadding:h,w:o,h:a,x:i.left,y:i.top},i),p=xn(l.concat(c),d);In(s.fullSize,f,d,p),In(l,f,d,p),In(c,f,d,p)&&In(l,f,d,p),function(e){const t=e.maxPadding;function r(r){const n=Math.max(t[r]-e[r],0);return e[r]+=n,n}e.y+=r("top"),e.x+=r("left"),r("right"),r("bottom")}(f),En(s.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,En(s.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},X(s.chartArea,(t=>{const r=t.box;Object.assign(r,e.chartArea),r.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class An{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,r){}removeEventListener(e,t,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,r,n){return t=Math.max(0,t||e.width),r=r||e.height,{width:t,height:Math.max(0,n?Math.floor(t/n):r)}}isAttached(e){return!0}updateConfig(e){}}class Cn extends An{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Rn="$chartjs",Ln={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},On=e=>null===e||""===e;const Dn=!!pr&&{passive:!0};function zn(e,t,r){e&&e.canvas&&e.canvas.removeEventListener(t,r,Dn)}function Fn(e,t){for(const r of e)if(r===t||r.contains(t))return!0}function Nn(e,t,r){const n=e.canvas,i=new MutationObserver((e=>{let t=!1;for(const r of e)t=t||Fn(r.addedNodes,n),t=t&&!Fn(r.removedNodes,n);t&&r()}));return i.observe(document,{childList:!0,subtree:!0}),i}function Bn(e,t,r){const n=e.canvas,i=new MutationObserver((e=>{let t=!1;for(const r of e)t=t||Fn(r.removedNodes,n),t=t&&!Fn(r.addedNodes,n);t&&r()}));return i.observe(document,{childList:!0,subtree:!0}),i}const jn=new Map;let Vn=0;function Gn(){const e=window.devicePixelRatio;e!==Vn&&(Vn=e,jn.forEach(((t,r)=>{r.currentDevicePixelRatio!==e&&t()})))}function Un(e,t,r){const n=e.canvas,i=n&&or(n);if(!i)return;const o=Ve(((e,t)=>{const n=i.clientWidth;r(e,t),n<i.clientWidth&&r()}),window),a=new ResizeObserver((e=>{const t=e[0],r=t.contentRect.width,n=t.contentRect.height;0===r&&0===n||o(r,n)}));return a.observe(i),function(e,t){jn.size||window.addEventListener("resize",Gn),jn.set(e,t)}(e,o),a}function $n(e,t,r){r&&r.disconnect(),"resize"===t&&function(e){jn.delete(e),jn.size||window.removeEventListener("resize",Gn)}(e)}function Hn(e,t,r){const n=e.canvas,i=Ve((t=>{null!==e.ctx&&r(function(e,t){const r=Ln[e.type]||e.type,{x:n,y:i}=ur(e,t);return{type:r,chart:t,native:e,x:void 0!==n?n:null,y:void 0!==i?i:null}}(t,e))}),e);return function(e,t,r){e&&e.addEventListener(t,r,Dn)}(n,t,i),i}class qn extends An{acquireContext(e,t){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(function(e,t){const r=e.style,n=e.getAttribute("height"),i=e.getAttribute("width");if(e[Rn]={initial:{height:n,width:i,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",On(i)){const t=gr(e,"width");void 0!==t&&(e.width=t)}if(On(n))if(""===e.style.height)e.height=e.width/(t||2);else{const t=gr(e,"height");void 0!==t&&(e.height=t)}}(e,t),r):null}releaseContext(e){const t=e.canvas;if(!t[Rn])return!1;const r=t[Rn].initial;["height","width"].forEach((e=>{const n=r[e];G(n)?t.removeAttribute(e):t.setAttribute(e,n)}));const n=r.style||{};return Object.keys(n).forEach((e=>{t.style[e]=n[e]})),t.width=t.width,delete t[Rn],!0}addEventListener(e,t,r){this.removeEventListener(e,t);const n=e.$proxies||(e.$proxies={}),i={attach:Nn,detach:Bn,resize:Un}[t]||Hn;n[t]=i(e,t,r)}removeEventListener(e,t){const r=e.$proxies||(e.$proxies={}),n=r[t];if(!n)return;({attach:$n,detach:$n,resize:$n}[t]||zn)(e,t,n),r[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,r,n){return hr(e,t,r,n)}isAttached(e){const t=e&&or(e);return!(!t||!t.isConnected)}}class Wn{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:r}=this.getProps(["x","y"],e);return{x:t,y:r}}hasValue(){return we(this.x)&&we(this.y)}getProps(e,t){const r=this.$animations;if(!t||!r)return this;const n={};return e.forEach((e=>{n[e]=r[e]&&r[e].active()?r[e]._to:this[e]})),n}}function Zn(e,t){const r=e.options.ticks,n=function(e){const t=e.options.offset,r=e._tickSize(),n=e._length/r+(t?0:1),i=e._maxLength/r;return Math.floor(Math.min(n,i))}(e),i=Math.min(r.maxTicksLimit||n,n),o=r.major.enabled?function(e){const t=[];let r,n;for(r=0,n=e.length;r<n;r++)e[r].major&&t.push(r);return t}(t):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return function(e,t,r,n){let i,o=0,a=r[0];for(n=Math.ceil(n),i=0;i<e.length;i++)i===a&&(t.push(e[i]),o++,a=r[o*n])}(t,c,o,a/i),c;const u=function(e,t,r){const n=function(e){const t=e.length;let r,n;if(t<2)return!1;for(n=e[0],r=1;r<t;++r)if(e[r]-e[r-1]!==n)return!1;return n}(e),i=t.length/r;if(!n)return Math.max(i,1);const o=function(e){const t=[],r=Math.sqrt(e);let n;for(n=1;n<r;n++)e%n==0&&(t.push(n),t.push(e/n));return r===(0|r)&&t.push(r),t.sort(((e,t)=>e-t)).pop(),t}(n);for(let e=0,t=o.length-1;e<t;e++){const t=o[e];if(t>i)return t}return Math.max(i,1)}(o,t,i);if(a>0){let e,r;const n=a>1?Math.round((l-s)/(a-1)):null;for(Yn(t,c,u,G(n)?0:s-n,s),e=0,r=a-1;e<r;e++)Yn(t,c,u,o[e],o[e+1]);return Yn(t,c,u,l,G(n)?t.length:l+n),c}return Yn(t,c,u),c}function Yn(e,t,r,n,i){const o=W(n,0),a=Math.min(W(i,e.length),e.length);let s,l,c,u=0;for(r=Math.ceil(r),i&&(s=i-n,r=s/Math.floor(s/r)),c=o;c<0;)u++,c=Math.round(o+u*r);for(l=Math.max(o,0);l<a;l++)l===c&&(t.push(e[l]),u++,c=Math.round(o+u*r))}const Xn=(e,t,r)=>"top"===t||"left"===t?e[t]+r:e[t]-r,Kn=(e,t)=>Math.min(t||e,e);function Jn(e,t){const r=[],n=e.length/t,i=e.length;let o=0;for(;o<i;o+=n)r.push(e[Math.floor(o)]);return r}function Qn(e,t,r){const n=e.ticks.length,i=Math.min(t,n-1),o=e._startPixel,a=e._endPixel,s=1e-6;let l,c=e.getPixelForTick(i);if(!(r&&(l=1===n?Math.max(c-o,a-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<o-s||c>a+s)))return c}function ei(e){return e.drawTicks?e.tickLength:0}function ti(e,t){if(!e.display)return 0;const r=Ot(e.font,t),n=Lt(e.padding);return(U(e.text)?e.text.length:1)*r.lineHeight+n.height}function ri(e,t,r){let n=Ge(e);return(r&&"right"!==t||!r&&"right"===t)&&(n=(e=>"left"===e?"right":"right"===e?"left":e)(n)),n}class ni extends Wn{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:r,_suggestedMax:n}=this;return e=q(e,Number.POSITIVE_INFINITY),t=q(t,Number.NEGATIVE_INFINITY),r=q(r,Number.POSITIVE_INFINITY),n=q(n,Number.NEGATIVE_INFINITY),{min:q(e,r),max:q(t,n),minDefined:H(e),maxDefined:H(t)}}getMinMax(e){let t,{min:r,max:n,minDefined:i,maxDefined:o}=this.getUserBounds();if(i&&o)return{min:r,max:n};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)t=a[s].controller.getMinMax(this,e),i||(r=Math.min(r,t.min)),o||(n=Math.max(n,t.max));return r=o&&r>n?n:r,n=i&&r>n?r:n,{min:q(r,q(n,r)),max:q(n,q(r,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}
vendor: 5,047 bytes, line 29
29getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Y(this.options.beforeUpdate,[this])}update(e,t,r){const{beginAtZero:n,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,r){const{min:n,max:i}=e,o=Z(t,(i-n)/2),a=(e,t)=>r&&0===e?0:e+t;return{min:a(n,-Math.abs(o)),max:a(i,o)}}(this,i,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?Jn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=Zn(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,r=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,r=!r),this._startPixel=e,this._endPixel=t,this._reversePixels=r,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Y(this.options.afterUpdate,[this])}beforeSetDimensions(){Y(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Y(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Y(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Y(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let r,n,i;for(r=0,n=e.length;r<n;r++)i=e[r],i.label=Y(t.callback,[i.value,r,e],this)}afterTickToLabelConversion(){Y(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Y(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,r=Kn(this.ticks.length,e.ticks.maxTicksLimit),n=t.minRotation||0,i=t.maxRotation;let o,a,s,l=n;if(!this._isVisible()||!t.display||n>=i||r<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,h=Re(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/r:h/(r-1),u+6>o&&(o=h/(r-(e.offset?.5:1)),a=this.maxHeight-ei(e.grid)-t.padding-ti(e.title,this.chart.options.font),s=Math.sqrt(u*u+d*d),l=Te(Math.min(Math.asin(Re((c.highest.height+6)/o,-1,1)),Math.asin(Re(a/s,-1,1))-Math.asin(Re(d/s,-1,1)))),l=Math.max(n,Math.min(i,l))),this.labelRotation=l}afterCalculateLabelRotation(){Y(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Y(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:r,title:n,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=ti(n,t.options.font);if(a?(e.width=this.maxWidth,e.height=ei(i)+o):(e.height=this.maxHeight,e.width=ei(i)+o),r.display&&this.ticks.length){const{first:t,last:n,widest:i,highest:o}=this._getLabelSizes(),s=2*r.padding,l=ke(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const t=r.mirror?0:u*i.width+c*o.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{const t=r.mirror?0:c*i.width+u*o.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,n,u,c)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,r,n){const{ticks:{align:i,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;s?l?(u=n*e.width,d=r*t.height):(u=r*e.height,d=n*t.width):"start"===i?d=t.width:"end"===i?u=e.width:"inner"!==i&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let r=t.height/2,n=e.height/2;
vendor: 13,590 bytes, line 29
29"start"===i?(r=0,n=e.height):"end"===i&&(r=t.height,n=0),this.paddingTop=r+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Y(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,r;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,r=e.length;t<r;t++)G(e[t].label)&&(e.splice(t,1),r--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let r=this.ticks;t<r.length&&(r=Jn(r,t)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,r){const{ctx:n,_longestTextCache:i}=this,o=[],a=[],s=Math.floor(t/Kn(t,r));let l,c,u,d,h,f,p,g,m,y,_,v=0,b=0;for(l=0;l<t;l+=s){if(d=e[l].label,h=this._resolveTickFontOptions(l),n.font=f=h.string,p=i[f]=i[f]||{data:{},gc:[]},g=h.lineHeight,m=y=0,G(d)||U(d)){if(U(d))for(c=0,u=d.length;c<u;++c)_=d[c],G(_)||U(_)||(m=dt(n,p.data,p.gc,m,_),y+=g)}else m=dt(n,p.data,p.gc,m,d),y=g;o.push(m),a.push(y),v=Math.max(m,v),b=Math.max(y,b)}!function(e,t){X(e,(e=>{const r=e.gc,n=r.length/2;let i;if(n>t){for(i=0;i<n;++i)delete e.data[r[i]];r.splice(0,n)}}))}(i,t);const x=o.indexOf(v),w=a.indexOf(b),S=e=>({width:o[e]||0,height:a[e]||0});return{first:S(0),last:S(t-1),widest:S(x),highest:S(w),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Re(this._alignToPixels?ft(this.chart,t,0):t,-32768,32767)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const r=t[e];return r.$context||(r.$context=function(e,t,r){return zt(e,{tick:r,index:t,type:"tick"})}(this.getContext(),e,r))}return this.$context||(this.$context=function(e,t){return zt(e,{scale:t,type:"scale"})}(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=ke(this.labelRotation),r=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,a=i?i.widest.width+o:0,s=i?i.highest.height+o:0;return this.isHorizontal()?s*r>a*n?a/r:s/n:s*n<a*r?s/r:a/n}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,r=this.chart,n=this.options,{grid:i,position:o,border:a}=n,s=i.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=ei(i),d=[],h=a.setContext(this.getContext()),f=h.display?h.width:0,p=f/2,g=function(e){return ft(r,e,f)};let m,y,_,v,b,x,w,S,k,T,I,M;if("top"===o)m=g(this.bottom),x=this.bottom-u,S=m-p,T=g(e.top)+p,M=e.bottom;else if("bottom"===o)m=g(this.top),T=e.top,M=g(e.bottom)-p,x=m+p,S=this.top+u;else if("left"===o)m=g(this.right),b=this.right-u,w=m-p,k=g(e.left)+p,I=e.right;else if("right"===o)m=g(this.left),k=e.left,I=g(e.right)-p,b=m+p,w=this.left+u;else if("x"===t){if("center"===o)m=g((e.top+e.bottom)/2+.5);else if($(o)){const e=Object.keys(o)[0],t=o[e];m=g(this.chart.scales[e].getPixelForValue(t))}T=e.top,M=e.bottom,x=m+p,S=x+u}else if("y"===t){if("center"===o)m=g((e.left+e.right)/2);else if($(o)){const e=Object.keys(o)[0],t=o[e];m=g(this.chart.scales[e].getPixelForValue(t))}b=m-p,w=b-u,k=e.left,I=e.right}const E=W(n.ticks.maxTicksLimit,c),P=Math.max(1,Math.ceil(c/E));for(y=0;y<c;y+=P){const e=this.getContext(y),t=i.setContext(e),n=a.setContext(e),o=t.lineWidth,c=t.color,u=n.dash||[],h=n.dashOffset,f=t.tickWidth,p=t.tickColor,g=t.tickBorderDash||[],m=t.tickBorderDashOffset;_=Qn(this,y,s),void 0!==_&&(v=ft(r,_,o),l?b=w=k=I=v:x=S=T=M=v,d.push({tx1:b,ty1:x,tx2:w,ty2:S,x1:k,y1:T,x2:I,y2:M,width:o,color:c,borderDash:u,borderDashOffset:h,tickWidth:f,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,d}_computeLabelItems(e){const t=this.axis,r=this.options,{position:n,ticks:i}=r,o=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=i,d=ei(r.grid),h=d+c,f=u?-c:h,p=-ke(this.labelRotation),g=[];let m,y,_,v,b,x,w,S,k,T,I,M,E="middle";if("top"===n)x=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===n)x=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===n){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,b=e.x}else if("right"===n){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,b=e.x}else if("x"===t){if("center"===n)x=(e.top+e.bottom)/2+h;else if($(n)){const e=Object.keys(n)[0],t=n[e];x=this.chart.scales[e].getPixelForValue(t)+h}w=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===n)b=(e.left+e.right)/2-h;else if($(n)){const e=Object.keys(n)[0],t=n[e];b=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===s?E="top":"end"===s&&(E="bottom"));const P=this._getLabelSizes();for(m=0,y=a.length;m<y;++m){_=a[m],v=_.label;const e=i.setContext(this.getContext(m));S=this.getPixelForTick(m)+i.labelOffset,k=this._resolveTickFontOptions(m),T=k.lineHeight,I=U(v)?v.length:1;const t=I/2,r=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let d,h=w;if(o?(b=S,"inner"===w&&(h=m===y-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),M="top"===n?"near"===l||0!==p?-I*T+T/2:"center"===l?-P.highest.height/2-t*T+T:-P.highest.height+T/2:"near"===l||0!==p?T/2:"center"===l?P.highest.height/2-t*T:P.highest.height-I*T,u&&(M*=-1),0===p||e.showLabelBackdrop||(b+=T/2*Math.sin(p))):(x=S,M=(1-I)*T/2),e.showLabelBackdrop){const t=Lt(e.backdropPadding),r=P.heights[m],n=P.widths[m];let i=M-t.top,o=0-t.left;switch(E){case"middle":i-=r/2;break;case"bottom":i-=r}switch(w){case"center":o-=n/2;break;case"right":o-=n;break;case"inner":m===y-1?o-=n:m>0&&(o-=n/2)}d={left:o,top:i,width:n+t.width,height:r+t.height,color:e.backdropColor}}g.push({label:v,font:k,textOffset:M,options:{rotation:p,color:r,strokeColor:s,strokeWidth:c,textAlign:h,textBaseline:E,translation:[b,x],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-ke(this.labelRotation))return"top"===e?"left":"right";let r="center";return"start"===t.align?r="left":"end"===t.align?r="right":"inner"===t.align&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:r,mirror:n,padding:i}}=this.options,o=e+i,a=this._getLabelSizes().widest.width;let s,l;return"left"===t?n?(l=this.right+i,"near"===r?s="left":"center"===r?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-o,"near"===r?s="right":"center"===r?(s="center",l-=a/2):(s="left",l=this.left)):"right"===t?n?(l=this.left+i,"near"===r?s="right":"center"===r?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+o,"near"===r?s="left":"center"===r?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:r,top:n,width:i,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(r,n,i,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const r=this.ticks.findIndex((t=>t.value===e));if(r>=0){return t.setContext(this.getContext(r)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,r=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,o;const a=(e,t,n)=>{n.width&&n.color&&(r.save(),r.lineWidth=n.width,r.strokeStyle=n.color,r.setLineDash(n.borderDash||[]),r.lineDashOffset=n.borderDashOffset,r.beginPath(),r.moveTo(e.x,e.y),r.lineTo(t.x,t.y),r.stroke(),r.restore())};if(t.display)for(i=0,o=n.length;i<o;++i){const e=n[i];t.drawOnChartArea&&a({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&a({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:r,grid:n}}=this,i=r.setContext(this.getContext()),o=r.display?i.width:0;if(!o)return;const a=n.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,d;this.isHorizontal()?(l=ft(e,this.left,o)-o/2,c=ft(e,this.right,a)+a/2,u=d=s):(u=ft(e,this.top,o)-o/2,d=ft(e,this.bottom,a)+a/2,l=c=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(l,u),t.lineTo(c,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,r=this._computeLabelArea();r&&_t(t,r);const n=this.getLabelItems(e);for(const e of n){const r=e.options,n=e.font;kt(t,e.label,0,e.textOffset,n,r)}r&&vt(t)}drawTitle(){const{ctx:e,options:{position:t,title:r,reverse:n}}=this;if(!r.display)return;const i=Ot(r.font),o=Lt(r.padding),a=r.align;let s=i.lineHeight/2;"bottom"===t||"center"===t||$(t)?(s+=o.bottom,U(r.text)&&(s+=i.lineHeight*(r.text.length-1))):s+=o.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=function(e,t,r,n){const{top:i,left:o,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d,h,f,p=0;const g=a-i,m=s-o;if(e.isHorizontal()){if(h=Ue(n,o,s),$(r)){const e=Object.keys(r)[0],n=r[e];f=u[e].getPixelForValue(n)+g-t}else f="center"===r?(c.bottom+c.top)/2+g-t:Xn(e,r,t);d=s-o}else{if($(r)){const e=Object.keys(r)[0],n=r[e];h=u[e].getPixelForValue(n)-m+t}else h="center"===r?(c.left+c.right)/2-m+t:Xn(e,r,t);f=Ue(n,a,i),p="left"===r?-ge:ge}return{titleX:h,titleY:f,maxWidth:d,rotation:p}}(this,s,t,a);kt(e,r.text,0,0,i,{color:r.color,maxWidth:u,rotation:d,textAlign:ri(a,t,n),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,r=W(e.grid&&e.grid.z,-1),n=W(e.border&&e.border.z,0);return this._isVisible()&&this.draw===ni.prototype.draw?[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",n=[];let i,o;for(i=0,o=t.length;i<o;++i){const o=t[i];o[r]!==this.id||e&&o.type!==e||n.push(o)}return n}_resolveTickFontOptions(e){return Ot(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ii{constructor(e,t,r){this.type=e,this.scope=t,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let r;(function(e){return"id"in e&&"defaults"in e})(t)&&(r=this.register(t));const n=this.items,i=e.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in n||(n[i]=e,function(e,t,r){const n=te(Object.create(null),[r?ut.get(r):{},ut.get(t),e.defaults]);ut.set(t,n),e.defaultRoutes&&function(e,t){Object.keys(t).forEach((r=>{const n=r.split("."),i=n.pop(),o=[e].concat(n).join("."),a=t[r].split("."),s=a.pop(),l=a.join(".");ut.route(o,i,l,s)}))}(t,e.defaultRoutes);e.descriptors&&ut.describe(t,e.descriptors)}(e,o,r),this.override&&ut.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,r=e.id,n=this.scope;r in t&&delete t[r],n&&r in ut[n]&&(delete ut[n][r],this.override&&delete ot[r])}}class oi{constructor(){this.controllers=new ii(Zr,"datasets",!0),this.elements=new ii(Wn,"elements"),this.plugins=new ii(Object,"plugins"),this.scales=new ii(ni,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,r){[...t].forEach((t=>{const n=r||this._getRegistryForType(t);r||n.isForType(t)||n===this.plugins&&t.id?this._exec(e,n,t):X(t,(t=>{const n=r||this._getRegistryForType(t);this._exec(e,n,t)}))}))}_exec(e,t,r){const n=ae(e);Y(r["before"+n],[],r),t[e](r),Y(r["after"+n],[],r)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const r=this._typedRegistries[t];
vendor: 5,590 bytes, line 29
29if(r.isForType(e))return r}return this.plugins}_get(e,t,r){const n=t.get(e);if(void 0===n)throw new Error('"'+e+'" is not a registered '+r+".");return n}}var ai=new oi;class si{constructor(){this._init=[]}notify(e,t,r,n){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const i=n?this._descriptors(e).filter(n):this._descriptors(e),o=this._notify(i,e,t,r);return"afterDestroy"===t&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,r,n){n=n||{};for(const i of e){const e=i.plugin;if(!1===Y(e[r],[t,n,i.options],e)&&n.cancelable)return!1}return!0}invalidate(){G(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const r=e&&e.config,n=W(r.options&&r.options.plugins,{}),i=function(e){const t={},r=[],n=Object.keys(ai.plugins.items);for(let e=0;e<n.length;e++)r.push(ai.getPlugin(n[e]));const i=e.plugins||[];for(let e=0;e<i.length;e++){const n=i[e];-1===r.indexOf(n)&&(r.push(n),t[n.id]=!0)}return{plugins:r,localIds:t}}(r);return!1!==n||t?function(e,{plugins:t,localIds:r},n,i){const o=[],a=e.getContext();for(const s of t){const t=s.id,l=li(n[t],i);null!==l&&o.push({plugin:s,options:ci(e.config,{plugin:s,local:r[t]},l,a)})}return o}(e,i,n,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],r=this._cache,n=(e,t)=>e.filter((e=>!t.some((t=>e.plugin.id===t.plugin.id))));this._notify(n(t,r),e,"stop"),this._notify(n(r,t),e,"start")}}function li(e,t){return t||!1!==e?!0===e?{}:e:null}function ci(e,{plugin:t,local:r},n,i){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(n,o);return r&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ui(e,t){const r=ut.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||r.indexAxis||"x"}function di(e){if("x"===e||"y"===e||"r"===e)return e}function hi(e,...t){if(di(e))return e;for(const n of t){const t=n.axis||("top"===(r=n.position)||"bottom"===r?"x":"left"===r||"right"===r?"y":void 0)||e.length>1&&di(e[0].toLowerCase());if(t)return t}var r;throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fi(e,t,r){if(r[t+"AxisID"]===e)return{axis:t}}function pi(e,t){const r=ot[e.type]||{scales:{}},n=t.scales||{},i=ui(e.type,t),o=Object.create(null);return Object.keys(n).forEach((t=>{const a=n[t];if(!$(a))return console.error(`Invalid scale configuration for scale: ${t}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=hi(t,a,function(e,t){if(t.data&&t.data.datasets){const r=t.data.datasets.filter((t=>t.xAxisID===e||t.yAxisID===e));if(r.length)return fi(e,"x",r[0])||fi(e,"y",r[0])}return{}}(t,e),ut.scales[a.type]),l=function(e,t){return e===t?"_index_":"_value_"}(s,i),c=r.scales||{};o[t]=re(Object.create(null),[{axis:s},a,c[s],c[l]])})),e.data.datasets.forEach((r=>{const i=r.type||e.type,a=r.indexAxis||ui(i,t),s=(ot[i]||{}).scales||{};Object.keys(s).forEach((e=>{const t=function(e,t){let r=e;return"_index_"===e?r=t:"_value_"===e&&(r="x"===t?"y":"x"),r}(e,a),i=r[t+"AxisID"]||t;o[i]=o[i]||Object.create(null),re(o[i],[{axis:t},n[i],s[e]])}))})),Object.keys(o).forEach((e=>{const t=o[e];re(t,[ut.scales[t.type],ut.scale])})),o}function gi(e){const t=e.options||(e.options={});t.plugins=W(t.plugins,{}),t.scales=pi(e,t)}function mi(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const yi=new Map,_i=new Set;function vi(e,t){let r=yi.get(e);return r||(r=t(),yi.set(e,r),_i.add(r)),r}const bi=(e,t,r)=>{const n=oe(t,r);void 0!==n&&e.add(n)};class xi{constructor(e){this._config=function(e){return(e=e||{}).data=mi(e.data),gi(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=mi(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),gi(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return vi(e,(()=>[[`datasets.${e}`,""]]))}datasetAnimationScopeKeys(e,t){return vi(`${e}.transition.${t}`,(()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]]))}datasetElementScopeKeys(e,t){return vi(`${e}-${t}`,(()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]]))}pluginScopeKeys(e){const t=e.id;return vi(`${this.type}-plugin-${t}`,(()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]]))}_cachedScopes(e,t){const r=this._scopeCache;let n=r.get(e);return n&&!t||(n=new Map,r.set(e,n)),n}getOptionScopes(e,t,r){const{options:n,type:i}=this,o=this._cachedScopes(e,r),a=o.get(t);if(a)return a;const s=new Set;t.forEach((t=>{e&&(s.add(e),t.forEach((t=>bi(s,e,t)))),t.forEach((e=>bi(s,n,e))),t.forEach((e=>bi(s,ot[i]||{},e))),t.forEach((e=>bi(s,ut,e))),t.forEach((e=>bi(s,at,e)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),_i.has(t)&&o.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,ot[t]||{},ut.datasets[t]||{},{type:t},ut,at]}resolveNamedOptions(e,t,r,n=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=wi(this._resolverCache,e,n);let s=o;if(function(e,t){const{isScriptable:r,isIndexable:n}=Bt(e);for(const i of t){const t=r(i),o=n(i),a=(o||t)&&e[i];
vendor: 16,883 bytes, line 29
29if(t&&(le(a)||Si(a))||o&&U(a))return!0}return!1}(o,t)){i.$shared=!1;s=Nt(o,r=le(r)?r():r,this.createResolver(e,r,a))}for(const e of t)i[e]=s[e];return i}createResolver(e,t,r=[""],n){const{resolver:i}=wi(this._resolverCache,e,r);return $(t)?Nt(i,t,void 0,n):i}}function wi(e,t,r){let n=e.get(t);n||(n=new Map,e.set(t,n));const i=r.join();let o=n.get(i);if(!o){o={resolver:Ft(t,r),subPrefixes:r.filter((e=>!e.toLowerCase().includes("hover")))},n.set(i,o)}return o}const Si=e=>$(e)&&Object.getOwnPropertyNames(e).some((t=>le(e[t])));const ki=["top","bottom","left","right","chartArea"];function Ti(e,t){return"top"===e||"bottom"===e||-1===ki.indexOf(e)&&"x"===t}function Ii(e,t){return function(r,n){return r[e]===n[e]?r[t]-n[t]:r[e]-n[e]}}function Mi(e){const t=e.chart,r=t.options.animation;t.notifyPlugins("afterRender"),Y(r&&r.onComplete,[e],t)}function Ei(e){const t=e.chart,r=t.options.animation;Y(r&&r.onProgress,[e],t)}function Pi(e){return ir()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ai={},Ci=e=>{const t=Pi(e);return Object.values(Ai).filter((e=>e.canvas===t)).pop()};function Ri(e,t,r){const n=Object.keys(e);for(const i of n){const n=+i;if(n>=t){const o=e[i];delete e[i],(r>0||n>t)&&(e[n+r]=o)}}}class Li{static defaults=ut;static instances=Ai;static overrides=ot;static registry=ai;static version="4.4.9";static getChart=Ci;static register(...e){ai.add(...e),Oi()}static unregister(...e){ai.remove(...e),Oi()}constructor(e,t){const r=this.config=new xi(t),n=Pi(e),i=Ci(n);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||function(e){return!ir()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Cn:qn}(n)),this.platform.updateConfig(r);const a=this.platform.acquireContext(n,o.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=V(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new si,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let r;return function(...n){return t?(clearTimeout(r),r=setTimeout(e,t,n)):e.apply(this,n),t}}((e=>this.update(e)),o.resizeDelay||0),this._dataChanges=[],Ai[this.id]=this,a&&s?(Rr.listen(this,"complete",Mi),Rr.listen(this,"progress",Ei),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:r,height:n,_aspectRatio:i}=this;return G(e)?t&&i?i:n?r/n:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ai}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():fr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return pt(this.canvas,this.ctx),this}stop(){return Rr.stop(this),this}resize(e,t){Rr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const r=this.options,n=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,e,t,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,fr(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Y(r.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){X(this.options.scales||{},((e,t)=>{e.id=t}))}buildOrUpdateScales(){const e=this.options,t=e.scales,r=this.scales,n=Object.keys(r).reduce(((e,t)=>(e[t]=!1,e)),{});let i=[];t&&(i=i.concat(Object.keys(t).map((e=>{const r=t[e],n=hi(e,r),i="r"===n,o="x"===n;return{options:r,dposition:i?"chartArea":o?"bottom":"left",dtype:i?"radialLinear":o?"category":"linear"}})))),X(i,(t=>{const i=t.options,o=i.id,a=hi(o,i),s=W(i.type,t.dtype);void 0!==i.position&&Ti(i.position,a)===Ti(t.dposition)||(i.position=t.dposition),n[o]=!0;let l=null;if(o in r&&r[o].type===s)l=r[o];else{l=new(ai.getScale(s))({id:o,type:s,ctx:this.ctx,chart:this}),r[l.id]=l}l.init(i,e)})),X(n,((e,t)=>{e||delete r[t]})),X(r,(e=>{Pn.configure(this,e,e.options),Pn.addBox(this,e)}))}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,r=e.length;if(e.sort(((e,t)=>e.index-t.index)),r>t){for(let e=t;e<r;++e)this._destroyDatasetMeta(e);e.splice(t,r-t)}this._sortedMetasets=e.slice(0).sort(Ii("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach(((e,r)=>{0===t.filter((t=>t===e._dataset)).length&&this._destroyDatasetMeta(r)}))}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let r,n;for(this._removeUnreferencedMetasets(),r=0,n=t.length;r<n;r++){const n=t[r];let i=this.getDatasetMeta(r);const o=n.type||this.config.type;if(i.type&&i.type!==o&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=o,i.indexAxis=n.indexAxis||ui(o,this.options),i.order=n.order||0,i.index=r,i.label=""+n.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const t=ai.getController(o),{datasetElementType:n,dataElementType:a}=ut.datasets[o];Object.assign(t,{dataElementType:ai.getElement(a),datasetElementType:n&&ai.getElement(n)}),i.controller=new t(this,r),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){X(this.data.datasets,((e,t)=>{this.getDatasetMeta(t).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const r=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let e=0,t=this.data.datasets.length;e<t;e++){const{controller:t}=this.getDatasetMeta(e),r=!n&&-1===i.indexOf(t);t.buildOrUpdateElements(r),o=Math.max(+t.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),n||X(i,(e=>{e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Ii("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){X(this.scales,(e=>{Pn.removeBox(this,e)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),r=new Set(e.events);ce(t,r)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:r,start:n,count:i}of t){Ri(e,n,"_removeElements"===r?-i:i)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,r=t=>new Set(e.filter((e=>e[0]===t)).map(((e,t)=>t+","+e.splice(1).join(",")))),n=r(0);for(let e=1;e<t;e++)if(!ce(n,r(e)))return;return Array.from(n).map((e=>e.split(","))).map((e=>({method:e[1],start:+e[2],count:+e[3]})))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Pn.update(this,this.width,this.height,e);const t=this.chartArea,r=t.width<=0||t.height<=0;this._layers=[],X(this.boxes,(e=>{r&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))}),this),this._layers.forEach(((e,t)=>{e._idx=t})),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,r=this.data.datasets.length;t<r;++t)this._updateDataset(t,le(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const r=this.getDatasetMeta(e),n={meta:r,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(r.controller._update(t),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Rr.has(this)?this.attached&&!Rr.running(this)&&Rr.start(this):(this.draw(),Mi({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,r=[];let n,i;for(n=0,i=t.length;n<i;++n){const i=t[n];e&&!i.visible||r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,r={meta:e,index:e.index,cancelable:!0},n=Ar(this,e);!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&_t(t,n),e.controller.draw(),n&&vt(t),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return yt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,r,n){const i=mn.modes[t];return"function"==typeof i?i(this,e,r,n):[]}getDatasetMeta(e){const t=this.data.datasets[e],r=this._metasets;let n=r.filter((e=>e&&e._dataset===t)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},r.push(n)),n}getContext(){return this.$context||(this.$context=zt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const r=this.getDatasetMeta(e);return"boolean"==typeof r.hidden?!r.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,r){const n=r?"show":"hide",i=this.getDatasetMeta(e),o=i.controller._resolveAnimations(void 0,n);se(t)?(i.data[t].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),o.update(i,{visible:r}),this.update((t=>t.datasetIndex===e?n:void 0)))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Rr.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),pt(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Ai[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,r=(r,n)=>{t.addEventListener(this,r,n),e[r]=n},n=(e,t,r)=>{e.offsetX=t,e.offsetY=r,this._eventHandler(e)};X(this.options.events,(e=>r(e,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,r=(r,n)=>{t.addEventListener(this,r,n),e[r]=n},n=(r,n)=>{e[r]&&(t.removeEventListener(this,r,n),delete e[r])},i=(e,t)=>{this.canvas&&this.resize(e,t)};let o;const a=()=>{n("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",o)};o=()=>{this.attached=!1,n("resize",i),this._stop(),this._resize(0,0),r("attach",a)},t.isAttached(this.canvas)?a():o()}unbindEvents(){X(this._listeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._listeners={},X(this._responsiveListeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._responsiveListeners=void 0}updateHoverStyle(e,t,r){const n=r?"set":"remove";let i,o,a,s;for("dataset"===t&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+n+"DatasetHoverStyle"]()),a=0,s=e.length;a<s;++a){o=e[a];const t=o&&this.getDatasetMeta(o.datasetIndex).controller;t&&t[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],r=e.map((({datasetIndex:e,index:t})=>{const r=this.getDatasetMeta(e);if(!r)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:r.data[t],index:t}}));!K(r,t)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,t))}notifyPlugins(e,t,r){return this._plugins.notify(this,e,t,r)}isPluginEnabled(e){return 1===this._plugins._cache.filter((t=>t.plugin.id===e)).length}_updateHoverStyles(e,t,r){const n=this.options.hover,i=(e,t)=>e.filter((e=>!t.some((t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)))),o=i(t,e),a=r?e:i(e,t);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(e,t){const r={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},n=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",r,n))return;const i=this._handleEvent(e,t,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,n),(i||r.changed)&&this.render(),this}_handleEvent(e,t,r){const{_active:n=[],options:i}=this,o=t,a=this._getActiveElements(e,n,r,o),s=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),l=function(e,t,r,n){return r&&"mouseout"!==e.type?n?t:e:null}(e,this._lastEvent,r,s);r&&(this._lastEvent=null,Y(i.onHover,[e,a,this],this),s&&Y(i.onClick,[e,a,this],this));const c=!K(a,n);return(c||t)&&(this._active=a,this._updateHoverStyles(a,n,t)),this._lastEvent=l,c}_getActiveElements(e,t,r,n){if("mouseout"===e.type)return[];if(!r)return t;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,n)}}function Oi(){return X(Li.instances,(e=>e._plugins.invalidate()))}function Di(e,t,r,n){const i=At(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(r-t)/2,a=Math.min(o,n*t/2),s=e=>{const t=(r-Math.min(o,e))*n/2;return Re(e,0,Math.min(o,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Re(i.innerStart,0,a),innerEnd:Re(i.innerEnd,0,a)}}function zi(e,t,r,n){return{x:r+e*Math.cos(t),y:n+e*Math.sin(t)}}function Fi(e,t,r,n,i,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+n+r-c,0),h=u>0?u+n+r+c:0;let f=0;const p=i-l;if(n){const e=((u>0?u-n:0)+(d>0?d-n:0))/2;f=(p-(0!==e?p*e/(e+n):p))/2}const g=(p-Math.max(.001,p*d-r/ue)/d)/2,m=l+g+f,y=i-g-f,{outerStart:_,outerEnd:v,innerStart:b,innerEnd:x}=Di(t,h,d,y-m),w=d-_,S=d-v,k=m+_/w,T=y-v/S,I=h+b,M=h+x,E=m+b/I,P=y-x/M;if(e.beginPath(),o){const t=(k+T)/2;if(e.arc(a,s,d,k,t),e.arc(a,s,d,t,T),v>0){const t=zi(S,T,a,s);e.arc(t.x,t.y,v,T,y+ge)}const r=zi(M,y,a,s);if(e.lineTo(r.x,r.y),x>0){const t=zi(M,P,a,s);e.arc(t.x,t.y,x,y+ge,P+Math.PI)}const n=(y-x/h+(m+b/h))/2;if(e.arc(a,s,h,y-x/h,n,!0),e.arc(a,s,h,n,m+b/h,!0),b>0){const t=zi(I,E,a,s);e.arc(t.x,t.y,b,E+Math.PI,m-ge)}const i=zi(w,m,a,s);if(e.lineTo(i.x,i.y),_>0){const t=zi(w,k,a,s);e.arc(t.x,t.y,_,m-ge,k)}}else{e.moveTo(a,s);const t=Math.cos(k)*d+a,r=Math.sin(k)*d+s;e.lineTo(t,r);const n=Math.cos(T)*d+a,i=Math.sin(T)*d+s;e.lineTo(n,i)}e.closePath()}function Ni(e,t,r,n,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,f="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,f?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(o){Fi(e,t,r,n,p,i);for(let t=0;t<o;++t)e.stroke();isNaN(s)||(p=a+(s%de||de))}f&&function(e,t,r){const{startAngle:n,pixelMargin:i,x:o,y:a,outerRadius:s,innerRadius:l}=t;
vendor: 4,461 bytes, line 29
29let c=i/s;e.beginPath(),e.arc(o,a,s,n-c,r+c),l>i?(c=i/l,e.arc(o,a,l,r+c,n-c,!0)):e.arc(o,a,i,r+ge,n-ge),e.closePath(),e.clip()}(e,t,p),o||(Fi(e,t,r,n,p,i),e.stroke())}function Bi(e,t,r=t){e.lineCap=W(r.borderCapStyle,t.borderCapStyle),e.setLineDash(W(r.borderDash,t.borderDash)),e.lineDashOffset=W(r.borderDashOffset,t.borderDashOffset),e.lineJoin=W(r.borderJoinStyle,t.borderJoinStyle),e.lineWidth=W(r.borderWidth,t.borderWidth),e.strokeStyle=W(r.borderColor,t.borderColor)}function ji(e,t,r){e.lineTo(r.x,r.y)}function Vi(e,t,r={}){const n=e.length,{start:i=0,end:o=n-1}=r,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(o,s),u=i<a&&o<a||i>s&&o>s;return{count:n,start:l,loop:t.loop,ilen:c<l&&!u?n+c-l:c-l}}function Gi(e,t,r,n){const{points:i,options:o}=t,{count:a,start:s,loop:l,ilen:c}=Vi(i,r,n),u=function(e){return e.stepped?bt:e.tension||"monotone"===e.cubicInterpolationMode?xt:ji}(o);let d,h,f,{move:p=!0,reverse:g}=n||{};for(d=0;d<=c;++d)h=i[(s+(g?c-d:d))%a],h.skip||(p?(e.moveTo(h.x,h.y),p=!1):u(e,f,h,g,o.stepped),f=h);return l&&(h=i[(s+(g?c:0))%a],u(e,f,h,g,o.stepped)),!!l}function Ui(e,t,r,n){const i=t.points,{count:o,start:a,ilen:s}=Vi(i,r,n),{move:l=!0,reverse:c}=n||{};let u,d,h,f,p,g,m=0,y=0;const _=e=>(a+(c?s-e:e))%o,v=()=>{f!==p&&(e.lineTo(m,p),e.lineTo(m,f),e.lineTo(m,g))};for(l&&(d=i[_(0)],e.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=i[_(u)],d.skip)continue;const t=d.x,r=d.y,n=0|t;n===h?(r<f?f=r:r>p&&(p=r),m=(y*m+t)/++y):(v(),e.lineTo(t,r),h=n,y=0,f=p=r),g=r}v()}function $i(e){const t=e.options,r=t.borderDash&&t.borderDash.length;return!(e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||r)?Ui:Gi}const Hi="function"==typeof Path2D;function qi(e,t,r,n){Hi&&!t.options.segment?function(e,t,r,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,r,n)&&i.closePath()),Bi(e,t.options),e.stroke(i)}(e,t,r,n):function(e,t,r,n){const{segments:i,options:o}=t,a=$i(t);for(const s of i)Bi(e,o,s.style),e.beginPath(),a(e,t,s,{start:r,end:r+n-1})&&e.closePath(),e.stroke()}(e,t,r,n)}class Wi extends Wn{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const r=this.options;if((r.tension||"monotone"===r.cubicInterpolationMode)&&!r.stepped&&!this._pointsUpdated){const n=r.spanGaps?this._loop:this._fullLoop;nr(this._points,r,e,n,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){const r=e.points,n=e.options.spanGaps,i=r.length;if(!i)return[];const o=!!e._loop,{start:a,end:s}=function(e,t,r,n){let i=0,o=t-1;if(r&&!n)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,r&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}(r,i,o,n);return Ir(e,!0===n?[{start:a,end:s,loop:o}]:function(e,t,r,n){const i=e.length,o=[];let a,s=t,l=e[t];for(a=t+1;a<=r;++a){const r=e[a%i];r.skip||r.stop?l.skip||(n=!1,o.push({start:t%i,end:(a-1)%i,loop:n}),t=s=r.stop?a:null):(s=a,l.skip&&(t=a)),l=r}return null!==s&&o.push({start:t%i,end:s%i,loop:n}),o}(r,a,s<a?s+i:s,!!e._fullLoop&&0===a&&s===i-1),r,t)}(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,r=e.length;return r&&t[e[r-1].end]}interpolate(e,t){const r=this.options,n=e[t],i=this.points,o=Tr(this,{property:t,start:n,end:n});if(!o.length)return;const a=[],s=function(e){return e.stepped?yr:e.tension||"monotone"===e.cubicInterpolationMode?_r:mr}(r);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:u}=o[l],d=i[c],h=i[u];if(d===h){a.push(d);continue}const f=s(d,h,Math.abs((n-d[t])/(h[t]-d[t])),r.stepped);f[t]=e[t],a.push(f)}return 1===a.length?a[0]:a}pathSegment(e,t,r){return $i(this)(e,this,t,r)}path(e,t,r){const n=this.segments,i=$i(this);let o=this._loop;
vendor: 4,174 bytes, line 29
29t=t||0,r=r||this.points.length-t;for(const a of n)o&=i(e,this,a,{start:t,end:t+r-1});return!!o}draw(e,t,r,n){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),qi(e,this,r,n),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Zi(e,t,r,n){const i=e.options,{[r]:o}=e.getProps([r],n);return Math.abs(t-o)<i.radius+i.hitRadius}function Yi(e,t){const{x:r,y:n,base:i,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(r,i),l=Math.max(r,i),c=n-d,u=n+d):(d=o/2,s=r-d,l=r+d,c=Math.min(n,i),u=Math.max(n,i)),{left:s,top:c,right:l,bottom:u}}function Xi(e,t,r,n){return e?0:Re(t,r,n)}function Ki(e){const t=Yi(e),r=t.right-t.left,n=t.bottom-t.top,i=function(e,t,r){const n=e.options.borderWidth,i=e.borderSkipped,o=Ct(n);return{t:Xi(i.top,o.top,0,r),r:Xi(i.right,o.right,0,t),b:Xi(i.bottom,o.bottom,0,r),l:Xi(i.left,o.left,0,t)}}(e,r/2,n/2),o=function(e,t,r){const{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Rt(i),a=Math.min(t,r),s=e.borderSkipped,l=n||$(i);return{topLeft:Xi(!l||s.top||s.left,o.topLeft,0,a),topRight:Xi(!l||s.top||s.right,o.topRight,0,a),bottomLeft:Xi(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:Xi(!l||s.bottom||s.right,o.bottomRight,0,a)}}(e,r/2,n/2);return{outer:{x:t.left,y:t.top,w:r,h:n,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:r-i.l-i.r,h:n-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Ji(e,t,r,n){const i=null===t,o=null===r,a=e&&!(i&&o)&&Yi(e,n);return a&&(i||Le(t,a.left,a.right))&&(o||Le(r,a.top,a.bottom))}function Qi(e,t){e.rect(t.x,t.y,t.w,t.h)}function eo(e,t,r={}){const n=e.x!==r.x?-t:0,i=e.y!==r.y?-t:0,o=(e.x+e.w!==r.x+r.w?t:0)-n,a=(e.y+e.h!==r.y+r.h?t:0)-i;return{x:e.x+n,y:e.y+i,w:e.w+o,h:e.h+a,radius:e.radius}}var to=Object.freeze({__proto__:null,ArcElement:class extends Wn{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,r){const n=this.getProps(["x","y"],r),{angle:i,distance:o}=Me(n,{x:e,y:t}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),d=(this.options.spacing+this.options.borderWidth)/2,h=W(u,s-a),f=Ce(i,a,s)&&a!==s,p=h>=de||f,g=Le(o,l+d,c+d);return p&&g}getCenterPoint(e){const{x:t,y:r,startAngle:n,endAngle:i,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:s,spacing:l}=this.options,c=(n+i)/2,u=(o+a+l+s)/2;return{x:t+Math.cos(c)*u,y:r+Math.sin(c)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:r}=this,n=(t.offset||0)/4,i=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=r>de?Math.floor(r/de):0,0===r||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*n,Math.sin(a)*n);const s=n*(1-Math.sin(Math.min(ue,r||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,r,n,i){const{fullCircles:o,startAngle:a,circumference:s}=t;let l=t.endAngle;if(o){Fi(e,t,r,n,l,i);for(let t=0;t<o;++t)e.fill();isNaN(s)||(l=a+(s%de||de))}Fi(e,t,r,n,l,i),e.fill()}(e,this,s,i,o),Ni(e,this,s,i,o),e.restore()}},BarElement:class extends Wn{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmou
vendor: 35,048 bytes, line 29
29nt:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:r,backgroundColor:n}}=this,{inner:i,outer:o}=Ki(this),a=(s=o.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?Tt:Qi;var s;e.save(),o.w===i.w&&o.h===i.h||(e.beginPath(),a(e,eo(o,t,i)),e.clip(),a(e,eo(i,-t,o)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,eo(i,t)),e.fillStyle=n,e.fill(),e.restore()}inRange(e,t,r){return Ji(this,e,t,r)}inXRange(e,t){return Ji(this,e,null,t)}inYRange(e,t){return Ji(this,null,e,t)}getCenterPoint(e){const{x:t,y:r,base:n,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(t+n)/2:t,y:i?r:(r+n)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}},LineElement:Wi,PointElement:class extends Wn{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,r){const n=this.options,{x:i,y:o}=this.getProps(["x","y"],r);return Math.pow(e-i,2)+Math.pow(t-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(e,t){return Zi(this,e,"x",t)}inYRange(e,t){return Zi(this,e,"y",t)}getCenterPoint(e){const{x:t,y:r}=this.getProps(["x","y"],e);return{x:t,y:r}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const r=this.options;this.skip||r.radius<.1||!yt(this,t,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,gt(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}});const ro=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],no=ro.map((e=>e.replace("rgb(","rgba(").replace(")",", 0.5)")));function io(e){return ro[e%ro.length]}function oo(e){return no[e%no.length]}function ao(e){let t=0;return(r,n)=>{const i=e.getDatasetMeta(n).controller;i instanceof nn?t=function(e,t){return e.backgroundColor=e.data.map((()=>io(t++))),t}(r,t):i instanceof on?t=function(e,t){return e.backgroundColor=e.data.map((()=>oo(t++))),t}(r,t):i&&(t=function(e,t){return e.borderColor=io(t),e.backgroundColor=oo(t),++t}(r,t))}}function so(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}var lo={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,r){if(!r.enabled)return;const{data:{datasets:n},options:i}=e.config,{elements:o}=i,a=so(n)||(s=i)&&(s.borderColor||s.backgroundColor)||o&&so(o)||"rgba(0,0,0,0.1)"!==ut.borderColor||"rgba(0,0,0,0.1)"!==ut.backgroundColor;var s;if(!r.forceOverride&&a)return;const l=ao(e);n.forEach(l)}};function co(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function uo(e){e.data.datasets.forEach((e=>{co(e)}))}var ho={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,r)=>{if(!r.enabled)return void uo(e);const n=e.width;e.data.datasets.forEach(((t,i)=>{const{_data:o,indexAxis:a}=t,s=e.getDatasetMeta(i),l=o||t.data;if("y"===Dt([a,e.options.indexAxis]))return;if(!s.controller.supportsDecimation)return;const c=e.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(e.options.parsing)return;let{start:u,count:d}=function(e,t){const r=t.length;let n,i=0;const{iScale:o}=e,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Re(De(t,o.axis,a).lo,0,r-1)),n=c?Re(De(t,o.axis,s).hi+1,i,r)-i:r-i,{start:i,count:n}}(s,l);if(d<=(r.threshold||4*n))return void co(t);let h;switch(G(o)&&(t._data=l,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),r.algorithm){case"lttb":h=function(e,t,r,n,i){const o=i.samples||n;if(o>=r)return e.slice(t,t+r);const a=[],s=(r-2)/(o-2);let l=0;const c=t+r-1;let u,d,h,f,p,g=t;for(a[l++]=e[g],u=0;u<o-2;u++){let n,i=0,o=0;const c=Math.floor((u+1)*s)+1+t,m=Math.min(Math.floor((u+2)*s)+1,r)+t,y=m-c;for(n=c;n<m;n++)i+=e[n].x,o+=e[n].y;i/=y,o/=y;const _=Math.floor(u*s)+1+t,v=Math.min(Math.floor((u+1)*s)+1,r)+t,{x:b,y:x}=e[g];for(h=f=-1,n=_;n<v;n++)f=.5*Math.abs((b-i)*(e[n].y-x)-(b-e[n].x)*(o-x)),f>h&&(h=f,d=e[n],p=n);a[l++]=d,g=p}return a[l++]=e[c],a}(l,u,d,n,r);break;case"min-max":h=function(e,t,r,n){let i,o,a,s,l,c,u,d,h,f,p=0,g=0;const m=[],y=t+r-1,_=e[t].x,v=e[y].x-_;for(i=t;i<t+r;++i){o=e[i],a=(o.x-_)/v*n,s=o.y;const t=0|a;if(t===l)s<h?(h=s,c=i):s>f&&(f=s,u=i),p=(g*p+o.x)/++g;else{const r=i-1;if(!G(c)&&!G(u)){const t=Math.min(c,u),n=Math.max(c,u);t!==d&&t!==r&&m.push({...e[t],x:p}),n!==d&&n!==r&&m.push({...e[n],x:p})}i>0&&r!==d&&m.push(e[r]),m.push(o),l=t,g=0,h=f=s,c=u=d=i}}return m}(l,u,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${r.algorithm}'`)}t._decimated=h}))},destroy(e){uo(e)}};function fo(e,t,r,n){if(n)return;let i=t[e],o=r[e];return"angle"===e&&(i=Ae(i),o=Ae(o)),{property:e,start:i,end:o}}function po(e,t,r){for(;t>e;t--){const e=r[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function go(e,t,r,n){return e&&t?n(e[r],t[r]):e?e[r]:t?t[r]:0}function mo(e,t){let r=[],n=!1;return U(e)?(n=!0,r=e):r=function(e,t){const{x:r=null,y:n=null}=e||{},i=t.points,o=[];return t.segments.forEach((({start:e,end:t})=>{t=po(e,t,i);const a=i[e],s=i[t];null!==n?(o.push({x:a.x,y:n}),o.push({x:s.x,y:n})):null!==r&&(o.push({x:r,y:a.y}),o.push({x:r,y:s.y}))})),o}(e,t),r.length?new Wi({points:r,options:{tension:0},_loop:n,_fullLoop:n}):null}function yo(e){return e&&!1!==e.fill}function _o(e,t,r){let n=e[t].fill;const i=[t];let o;if(!r)return n;for(;!1!==n&&-1===i.indexOf(n);){if(!H(n))return n;if(o=e[n],!o)return!1;if(o.visible)return n;i.push(n),n=o.fill}return!1}function vo(e,t,r){const n=function(e){const t=e.options,r=t.fill;let n=W(r&&r.target,r);void 0===n&&(n=!!t.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(e);if($(n))return!isNaN(n.value)&&n;let i=parseFloat(n);return H(i)&&Math.floor(i)===i?function(e,t,r,n){"-"!==e&&"+"!==e||(r=t+r);if(r===t||r<0||r>=n)return!1;return r}(n[0],t,i,r):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function bo(e,t,r){const n=[];for(let i=0;i<r.length;i++){const o=r[i],{first:a,last:s,point:l}=xo(o,t,"x");if(!(!l||a&&s))if(a)n.unshift(l);else if(e.push(l),!s)break}e.push(...n)}function xo(e,t,r){const n=e.interpolate(t,r);if(!n)return{};const i=n[r],o=e.segments,a=e.points;let s=!1,l=!1;for(let e=0;e<o.length;e++){const t=o[e],n=a[t.start][r],c=a[t.end][r];if(Le(i,n,c)){s=i===n,l=i===c;break}}return{first:s,last:l,point:n}}class wo{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,r){const{x:n,y:i,radius:o}=this;return t=t||{start:0,end:de},e.arc(n,i,o,t.end,t.start,!0),!r.bounds}interpolate(e){const{x:t,y:r,radius:n}=this,i=e.angle;return{x:t+Math.cos(i)*n,y:r+Math.sin(i)*n,angle:i}}}function So(e){const{chart:t,fill:r,line:n}=e;if(H(r))return function(e,t){const r=e.getDatasetMeta(t),n=r&&e.isDatasetVisible(t);return n?r.dataset:null}(t,r);if("stack"===r)return function(e){const{scale:t,index:r,line:n}=e,i=[],o=n.segments,a=n.points,s=function(e,t){const r=[],n=e.getMatchingVisibleMetas("line");for(let e=0;e<n.length;e++){const i=n[e];if(i.index===t)break;i.hidden||r.unshift(i.dataset)}return r}(t,r);s.push(mo({x:null,y:t.bottom},n));for(let e=0;e<o.length;e++){const t=o[e];for(let e=t.start;e<=t.end;e++)bo(i,a[e],s)}return new Wi({points:i,options:{}})}(e);if("shape"===r)return!0;const i=function(e){const t=e.scale||{};if(t.getPointPositionForValue)return function(e){const{scale:t,fill:r}=e,n=t.options,i=t.getLabels().length,o=n.reverse?t.max:t.min,a=function(e,t,r){let n;return n="start"===e?r:"end"===e?t.options.reverse?t.min:t.max:$(e)?e.value:t.getBaseValue(),n}(r,t,o),s=[];if(n.grid.circular){const e=t.getPointPositionForValue(0,o);return new wo({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(a)})}for(let e=0;e<i;++e)s.push(t.getPointPositionForValue(e,a));return s}(e);return function(e){const{scale:t={},fill:r}=e,n=function(e,t){let r=null;return"start"===e?r=t.bottom:"end"===e?r=t.top:$(e)?r=t.getPixelForValue(e.value):t.getBasePixel&&(r=t.getBasePixel()),r}(r,t);if(H(n)){const e=t.isHorizontal();return{x:e?n:null,y:e?null:n}}return null}(e)}(e);return i instanceof wo?i:mo(i,n)}function ko(e,t,r){const n=So(t),{chart:i,index:o,line:a,scale:s,axis:l}=t,c=a.options,u=c.fill,d=c.backgroundColor,{above:h=d,below:f=d}=u||{},p=i.getDatasetMeta(o),g=Ar(i,p);n&&a.points.length&&(_t(e,r),function(e,t){const{line:r,target:n,above:i,below:o,area:a,scale:s,clip:l}=t,c=r._loop?"angle":t.axis;e.save(),"x"===c&&o!==i&&(To(e,n,a.top),Io(e,{line:r,target:n,color:i,scale:s,property:c,clip:l}),e.restore(),e.save(),To(e,n,a.bottom));Io(e,{line:r,target:n,color:o,scale:s,property:c,clip:l}),e.restore()}(e,{line:a,target:n,above:h,below:f,area:r,scale:s,axis:l,clip:g}),vt(e))}function To(e,t,r){const{segments:n,points:i}=t;let o=!0,a=!1;e.beginPath();for(const s of n){const{start:n,end:l}=s,c=i[n],u=i[po(n,l,i)];o?(e.moveTo(c.x,c.y),o=!1):(e.lineTo(c.x,r),e.lineTo(c.x,c.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(u.x,r)}e.lineTo(t.first().x,r),e.closePath(),e.clip()}function Io(e,t){const{line:r,target:n,property:i,color:o,scale:a,clip:s}=t,l=function(e,t,r){const n=e.segments,i=e.points,o=t.points,a=[];for(const e of n){let{start:n,end:s}=e;s=po(n,s,i);const l=fo(r,i[n],i[s],e.loop);if(!t.segments){a.push({source:e,target:l,start:i[n],end:i[s]});continue}const c=Tr(t,l);for(const t of c){const n=fo(r,o[t.start],o[t.end],t.loop),s=kr(e,i,n);for(const e of s)a.push({source:e,target:t,start:{[r]:go(l,n,"start",Math.max)},end:{[r]:go(l,n,"end",Math.min)}})}}return a}(r,n,i);for(const{source:t,target:c,start:u,end:d}of l){const{style:{backgroundColor:l=o}={}}=t,h=!0!==n;e.save(),e.fillStyle=l,Mo(e,a,s,h&&fo(i,u,d)),e.beginPath();const f=!!r.pathSegment(e,t);let p;if(h){f?e.closePath():Eo(e,n,d,i);const t=!!n.pathSegment(e,c,{move:f,reverse:!0});p=f&&t,p||Eo(e,n,u,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Mo(e,t,r,n){const i=t.chart.chartArea,{property:o,start:a,end:s}=n||{};if("x"===o||"y"===o){let t,n,l,c;"x"===o?(t=a,n=i.top,l=s,c=i.bottom):(t=i.left,n=a,l=i.right,c=s),e.beginPath(),r&&(t=Math.max(t,r.left),l=Math.min(l,r.right),n=Math.max(n,r.top),c=Math.min(c,r.bottom)),e.rect(t,n,l-t,c-n),e.clip()}}function Eo(e,t,r,n){const i=t.interpolate(r,n);i&&e.lineTo(i.x,i.y)}var Po={id:"filler",afterDatasetsUpdate(e,t,r){const n=(e.data.datasets||[]).length,i=[];let o,a,s,l;for(a=0;a<n;++a)o=e.getDatasetMeta(a),s=o.dataset,l=null,s&&s.options&&s instanceof Wi&&(l={visible:e.isDatasetVisible(a),index:a,fill:vo(s,a,n),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,i.push(l);for(a=0;a<n;++a)l=i[a],l&&!1!==l.fill&&(l.fill=_o(i,a,r.propagate))},beforeDraw(e,t,r){const n="beforeDraw"===r.drawTime,i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let t=i.length-1;t>=0;--t){const r=i[t].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&ko(e.ctx,r,o))}},beforeDatasetsDraw(e,t,r){if("beforeDatasetsDraw"!==r.drawTime)return;const n=e.getSortedVisibleDatasetMetas();for(let t=n.length-1;t>=0;--t){const r=n[t].$filler;yo(r)&&ko(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,r){const n=t.meta.$filler;yo(n)&&"beforeDatasetDraw"===r.drawTime&&ko(e.ctx,n,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ao=(e,t)=>{let{boxHeight:r=t,boxWidth:n=t}=e;return e.usePointStyle&&(r=Math.min(r,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:r,itemHeight:Math.max(t,r)}};class Co extends Wn{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,r){this.maxWidth=e,this.maxHeight=t,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=Y(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter((t=>e.filter(t,this.chart.data)))),e.sort&&(t=t.sort(((t,r)=>e.sort(t,r,this.chart.data)))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const r=e.labels,n=Ot(r.font),i=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=Ao(r,i);let l,c;t.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,i,a,s)+10):(c=this.maxHeight,l=this._fitCols(o,n,a,s)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,r,n){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+a;let u=e;i.textAlign="left",i.textBaseline="middle";let d=-1,h=-c;return this.legendItems.forEach(((e,f)=>{const p=r+t/2+i.measureText(e.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(u+=c,l[l.length-(f>0?0:1)]=0,h+=c,d++),s[f]={left:0,top:h,row:d,width:p,height:n},l[l.length-1]+=p+a})),u}_fitCols(e,t,r,n){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-e;let u=a,d=0,h=0,f=0,p=0;return this.legendItems.forEach(((e,o)=>{const{itemWidth:g,itemHeight:m}=function(e,t,r,n,i){const o=function(e,t,r,n){let i=e.text;i&&"string"!=typeof i&&(i=i.reduce(((e,t)=>e.length>t.length?e:t)));return t+r.size/2+n.measureText(i).width}(n,e,t,r),a=function(e,t,r){let n=e;"string"!=typeof t.text&&(n=Ro(t,r));return n}(i,n,t.lineHeight);return{itemWidth:o,itemHeight:a}}(r,t,i,e,n);o>0&&h+m+2*a>c&&(u+=d+a,l.push({width:d,height:h}),f+=d+a,p++,d=h=0),s[o]={left:f,top:h,col:p,width:g,height:m},d=Math.max(d,g),h+=m+a})),u+=d,l.push({width:d,height:h}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:r,labels:{padding:n},rtl:i}}=this,o=vr(i,this.left,this.width);if(this.isHorizontal()){let i=0,a=Ue(r,this.left+n,this.right-this.lineWidths[i]);for(const s of t)i!==s.row&&(i=s.row,a=Ue(r,this.left+n,this.right-this.lineWidths[i])),s.top+=this.top+e+n,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+n}else{let i=0,a=Ue(r,this.top+e+n,this.bottom-this.columnSizes[i].height);for(const s of t)s.col!==i&&(i=s.col,a=Ue(r,this.top+e+n,this.bottom-this.columnSizes[i].height)),s.top=a,s.left+=this.left+n,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;_t(e,this),this._draw(),vt(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:r,ctx:n}=this,{align:i,labels:o}=e,a=ut.color,s=vr(e.rtl,this.left,this.width),l=Ot(o.font),{padding:c}=o,u=l.size,d=u/2;let h;this.drawTitle(),n.textAlign=s.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=Ao(o,u),m=this.isHorizontal(),y=this._computeTitleHeight();h=m?{x:Ue(i,this.left+c,this.right-r[0]),y:this.top+c+y,line:0}:{x:this.left+c,y:Ue(i,this.top+y+c,this.bottom-t[0].height),line:0},br(this.ctx,e.textDirection);const _=g+c;this.legendItems.forEach(((v,b)=>{n.strokeStyle=v.fontColor,n.fillStyle=v.fontColor;const x=n.measureText(v.text).width,w=s.textAlign(v.textAlign||(v.textAlign=o.textAlign)),S=f+d+x;let k=h.x,T=h.y;s.setWidth(this.width),m?b>0&&k+S+c>this.right&&(T=h.y+=_,h.line++,k=h.x=Ue(i,this.left+c,this.right-r[h.line])):b>0&&T+_>this.bottom&&(k=h.x=k+t[h.line].width+c,h.line++,T=h.y=Ue(i,this.top+y+c,this.bottom-t[h.line].height));if(function(e,t,r){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const i=W(r.lineWidth,1);if(n.fillStyle=W(r.fillStyle,a),n.lineCap=W(r.lineCap,"butt"),n.lineDashOffset=W(r.lineDashOffset,0),n.lineJoin=W(r.lineJoin,"miter"),n.lineWidth=i,n.strokeStyle=W(r.strokeStyle,a),n.setLineDash(W(r.lineDash,[])),o.usePointStyle){const a={radius:p*Math.SQRT2/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:i},l=s.xPlus(e,f/2);mt(n,a,l,t+d,o.pointStyleWidth&&f)}else{const o=t+Math.max((u-p)/2,0),a=s.leftForLtr(e,f),l=Rt(r.borderRadius);n.beginPath(),Object.values(l).some((e=>0!==e))?Tt(n,{x:a,y:o,w:f,h:p,radius:l}):n.rect(a,o,f,p),n.fill(),0!==i&&n.stroke()}n.restore()}(s.x(k),T,v),k=((e,t,r,n)=>e===(n?"left":"right")?r:"center"===e?(t+r)/2:t)(w,k+f+d,m?k+S:this.right,e.rtl),function(e,t,r){kt(n,r.text,e,t+g/2,l,{strikethrough:r.hidden,textAlign:s.textAlign(r.textAlign)})}(s.x(k),T,v),m)h.x+=S+c;else if("string"!=typeof v.text){const e=l.lineHeight;h.y+=Ro(v,e)+c}else h.y+=_})),xr(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,r=Ot(t.font),n=Lt(t.padding);if(!t.display)return;const i=vr(e.rtl,this.left,this.width),o=this.ctx,a=t.position,s=r.size/2,l=n.top+s;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,u=Ue(e.align,u,this.right-d);else{const t=this.columnSizes.reduce(((e,t)=>Math.max(e,t.height)),0);c=l+Ue(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const h=Ue(a,u,u+d);o.textAlign=i.textAlign(Ge(a)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=r.string,kt(o,t.text,h,c,r)}_computeTitleHeight(){const e=this.options.title,t=Ot(e.font),r=Lt(e.padding);return e.display?t.lineHeight+r.height:0}_getLegendItemAt(e,t){let r,n,i;if(Le(e,this.left,this.right)&&Le(t,this.top,this.bottom))for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(n=i[r],Le(e,n.left,n.left+n.width)&&Le(t,n.top,n.top+n.height))return this.legendItems[r];return null}handleEvent(e){const t=this.options;if(!function(e,t){if(("mousemove"===e||"mouseout"===e)&&(t.onHover||t.onLeave))return!0;if(t.onClick&&("click"===e||"mouseup"===e))return!0;return!1}(e.type,t))return;const r=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const o=this._hoveredItem,a=(i=r,null!==(n=o)&&null!==i&&n.datasetIndex===i.datasetIndex&&n.index===i.index);o&&!a&&Y(t.onLeave,[e,o,this],this),this._hoveredItem=r,r&&!a&&Y(t.onHover,[e,r,this],this)}else r&&Y(t.onClick,[e,r,this],this);var n,i}}function Ro(e,t){return t*(e.text?e.text.length:0)}var Lo={id:"legend",_element:Co,start(e,t,r){const n=e.legend=new Co({ctx:e.ctx,options:r,chart:e});Pn.configure(e,n,r),Pn.addBox(e,n)},stop(e){Pn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,r){const n=e.legend;Pn.configure(e,n,r),n.options=r},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,r){const n=t.datasetIndex,i=r.chart;i.isDatasetVisible(n)?(i.hide(n),t.hidden=!0):(i.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:r,pointStyle:n,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map((e=>{const l=e.controller.getStyle(r?0:void 0),c=Lt(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:e.index}}),this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Oo extends Wn{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){const r=this.options;if(this.left=0,this.top=0,!r.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const n=U(r.text)?r.text.length:1;this._padding=Lt(r.padding);const i=n*Ot(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:r,bottom:n,right:i,options:o}=this,a=o.align;let s,l,c,u=0;return this.isHorizontal()?(l=Ue(a,r,i),c=t+e,s=i-r):("left"===o.position?(l=r+e,c=Ue(a,n,t),u=-.5*ue):(l=i-e,c=Ue(a,t,n),u=.5*ue),s=n-t),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const r=Ot(t.font),n=r.lineHeight/2+this._padding.top,{titleX:i,titleY:o,maxWidth:a,rotation:s}=this._drawArgs(n);kt(e,t.text,0,0,r,{color:t.color,maxWidth:a,rotation:s,textAlign:Ge(t.align),textBaseline:"middle",translation:[i,o]})}}var Do={id:"title",_element:Oo,start(e,t,r){!function(e,t){const r=new Oo({ctx:e.ctx,options:t,chart:e});Pn.configure(e,r,t),Pn.addBox(e,r),e.titleBlock=r}(e,r)},stop(e){const t=e.titleBlock;Pn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,r){const n=e.titleBlock;Pn.configure(e,n,r),n.options=r},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const zo=new WeakMap;var Fo={id:"subtitle",start(e,t,r){const n=new Oo({ctx:e.ctx,options:r,chart:e});Pn.configure(e,n,r),Pn.addBox(e,n),zo.set(e,n)},stop(e){Pn.removeBox(e,zo.get(e)),zo.delete(e)},beforeUpdate(e,t,r){const n=zo.get(e);Pn.configure(e,n,r),n.options=r},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const No={average(e){if(!e.length)return!1;let t,r,n=new Set,i=0,o=0;for(t=0,r=e.length;t<r;++t){const r=e[t].element;if(r&&r.hasValue()){const e=r.tooltipPosition();n.add(e.x),i+=e.y,++o}}if(0===o||0===n.size)return!1;return{x:[...n].reduce(((e,t)=>e+t))/n.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let r,n,i,o=t.x,a=t.y,s=Number.POSITIVE_INFINITY;for(r=0,n=e.length;r<n;++r){const n=e[r].element;if(n&&n.hasValue()){const e=Ee(t,n.getCenterPoint());e<s&&(s=e,i=n)}}if(i){const e=i.tooltipPosition();o=e.x,a=e.y}return{x:o,y:a}}};function Bo(e,t){return t&&(U(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function jo(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Vo(e,t){const{element:r,datasetIndex:n,index:i}=t,o=e.getDatasetMeta(n).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[n].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:n,element:r}}function Go(e,t){const r=e.chart.ctx,{body:n,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Ot(t.bodyFont),c=Ot(t.titleFont),u=Ot(t.footerFont),d=o.length,h=i.length,f=n.length,p=Lt(t.padding);let g=p.height,m=0,y=n.reduce(((e,t)=>e+t.before.length+t.lines.length+t.after.length),0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){g+=f*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(g+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let _=0;const v=function(e){m=Math.max(m,r.measureText(e).width+_)};return r.save(),r.font=c.string,X(e.title,v),r.font=l.string,X(e.beforeBody.concat(e.afterBody),v),_=t.displayColors?a+2+t.boxPadding:0,X(n,(e=>{X(e.before,v),X(e.lines,v),X(e.after,v)})),_=0,r.font=u.string,X(e.footer,v),r.restore(),m+=p.width,{width:m,height:g}}function Uo(e,t,r,n){const{x:i,width:o}=r,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return"center"===n?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),function(e,t,r,n){const{x:i,width:o}=n,a=r.caretSize+r.caretPadding;return"left"===e&&i+o+a>t.width||"right"===e&&i-o-a<0||void 0}(c,e,t,r)&&(c="center"),c}function $o(e,t,r){const n=r.yAlign||t.yAlign||function(e,t){const{y:r,height:n}=t;return r<n/2?"top":r>e.height-n/2?"bottom":"center"}(e,r);return{xAlign:r.xAlign||t.xAlign||Uo(e,t,r,n),yAlign:n}}function Ho(e,t,r,n){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=r,c=i+o,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Rt(a);let p=function(e,t){let{x:r,width:n}=e;return"right"===t?r-=n:"center"===t&&(r-=n/2),r}(t,s);const g=function(e,t,r){let{y:n,height:i}=e;return"top"===t?n+=r:n-="bottom"===t?i+r:i/2,n}(t,l,c);return"center"===l?"left"===s?p+=c:"right"===s&&(p-=c):"left"===s?p-=Math.max(u,h)+i:"right"===s&&(p+=Math.max(d,f)+i),{x:Re(p,0,n.width-t.width),y:Re(g,0,n.height-t.height)}}function qo(e,t,r){const n=Lt(r.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-n.right:e.x+n.left}function Wo(e){return Bo([],jo(e))}function Zo(e,t){const r=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return r?e.override(r):e}const Yo={beforeTitle:j,title(e){if(e.length>0){const t=e[0],r=t.chart.data.labels,n=r?r.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return r[t.dataIndex]}return""},afterTitle:j,beforeBody:j,beforeLabel:j,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const r=e.formattedValue;return G(r)||(t+=r),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:j,afterBody:j,beforeFooter:j,footer:j,afterFooter:j};function Xo(e,t,r,n){const i=e[t].call(r,n);return void 0===i?Yo[t].call(r,n):i}class Ko extends Wn{static positioners=No;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,r=this.options.setContext(this.getContext()),n=r.enabled&&t.options.animation&&r.animations,i=new zr(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=function(e,t,r){return zt(e,{tooltip:t,tooltipItems:r,type:"tooltip"})}(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:r}=t,n=Xo(r,"beforeTitle",this,e),i=Xo(r,"title",this,e),o=Xo(r,"afterTitle",this,e);let a=[];return a=Bo(a,jo(n)),a=Bo(a,jo(i)),a=Bo(a,jo(o)),a}getBeforeBody(e,t){return Wo(Xo(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:r}=t,n=[];return X(e,(e=>{const t={before:[],lines:[],after:[]},i=Zo(r,e);Bo(t.before,jo(Xo(i,"beforeLabel",this,e))),Bo(t.lines,Xo(i,"label",this,e)),Bo(t.after,jo(Xo(i,"afterLabel",this,e))),n.push(t)})),n}getAfterBody(e,t){return Wo(Xo(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:r}=t,n=Xo(r,"beforeFooter",this,e),i=Xo(r,"footer",this,e),o=Xo(r,"afterFooter",this,e);let a=[];return a=Bo(a,jo(n)),a=Bo(a,jo(i)),a=Bo(a,jo(o)),a}_createItems(e){const t=this._active,r=this.chart.data,n=[],i=[],o=[];let a,s,l=[];for(a=0,s=t.length;a<s;++a)l.push(Vo(this.chart,t[a]));return e.filter&&(l=l.filter(((t,n,i)=>e.filter(t,n,i,r)))),e.itemSort&&(l=l.sort(((t,n)=>e.itemSort(t,n,r)))),X(l,(t=>{const r=Zo(e.callbacks,t);n.push(Xo(r,"labelColor",this,t)),i.push(Xo(r,"labelPointStyle",this,t)),o.push(Xo(r,"labelTextColor",this,t))})),this.labelColors=n,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=l,l}update(e,t){const r=this.options.setContext(this.getContext()),n=this._active;let i,o=[];if(n.length){const e=No[r.position].call(this,n,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const t=this._size=Go(this,r),a=Object.assign({},e,t),s=$o(this.chart,r,a),l=Ho(r,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,r,n){const i=this.getCaretPosition(e,r,n);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,r){const{xAlign:n,yAlign:i}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=Rt(a),{x:d,y:h}=e,{width:f,height:p}=t;let g,m,y,_,v,b;return"center"===i?(v=h+p/2,"left"===n?(g=d,m=g-o,_=v+o,b=v-o):(g=d+f,m=g+o,_=v-o,b=v+o),y=g):(m="left"===n?d+Math.max(s,c)+o:"right"===n?d+f-Math.max(l,u)-o:this.caretX,"top"===i?(_=h,v=_-o,g=m-o,y=m+o):(_=h+p,v=_+o,g=m+o,y=m-o),b=_),{x1:g,x2:m,x3:y,y1:_,y2:v,y3:b}}drawTitle(e,t,r){const n=this.title,i=n.length;let o,a,s;if(i){const l=vr(r.rtl,this.x,this.width);for(e.x=qo(this,r.titleAlign,r),t.textAlign=l.textAlign(r.titleAlign),t.textBaseline="middle",o=Ot(r.titleFont),a=r.titleSpacing,t.fillStyle=r.titleColor,t.font=o.string,s=0;s<i;++s)t.fillText(n[s],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,s+1===i&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,t,r,n,i){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:s,boxWidth:l}=i,c=Ot(i.bodyFont),u=qo(this,"left",i),d=n.x(u),h=s<c.lineHeight?(c.lineHeight-s)/2:0,f=t.y+h;if(i.usePointStyle){const t={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},r=n.leftForLtr(d,l)+l/2,c=f+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,gt(e,t,r,c),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,gt(e,t,r,c)}else{e.lineWidth=$(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const t=n.leftForLtr(d,l),r=n.leftForLtr(n.xPlus(d,1),l-2),a=Rt(o.borderRadius);Object.values(a).some((e=>0!==e))?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Tt(e,{x:t,y:f,w:l,h:s,radius:a}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Tt(e,{x:r,y:f+1,w:l-2,h:s-2,radius:a}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,f,l,s),e.strokeRect(t,f,l,s),e.fillStyle=o.backgroundColor,e.fillRect(r,f+1,l-2,s-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,t,r){const{body:n}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=r,u=Ot(r.bodyFont);let d=u.lineHeight,h=0;const f=vr(r.rtl,this.x,this.width),p=function(r){t.fillText(r,f.x(e.x+h),e.y+d/2),e.y+=d+i},g=f.textAlign(o);let m,y,_,v,b,x,w;for(t.textAlign=o,t.textBaseline="middle",t.font=u.string,e.x=qo(this,g,r),t.fillStyle=r.bodyColor,X(this.beforeBody,p),h=a&&"right"!==g?"center"===o?l/2+c:l+2+c:0,v=0,x=n.length;v<x;++v){for(m=n[v],y=this.labelTextColors[v],t.fillStyle=y,X(m.before,p),_=m.lines,a&&_.length&&(this._drawColorBox(t,e,v,f,r),d=Math.max(u.lineHeight,s)),b=0,w=_.length;b<w;++b)p(_[b]),d=u.lineHeight;X(m.after,p)}h=0,d=u.lineHeight,X(this.afterBody,p),e.y-=i}drawFooter(e,t,r){const n=this.footer,i=n.length;let o,a;if(i){const s=vr(r.rtl,this.x,this.width);for(e.x=qo(this,r.footerAlign,r),e.y+=r.footerMarginTop,t.textAlign=s.textAlign(r.footerAlign),t.textBaseline="middle",o=Ot(r.footerFont),t.fillStyle=r.footerColor,t.font=o.string,a=0;a<i;++a)t.fillText(n[a],s.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r.footerSpacing}}drawBackground(e,t,r,n){const{xAlign:i,yAlign:o}=this,{x:a,y:s}=e,{width:l,height:c}=r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Rt(n.cornerRadius);t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.beginPath(),t.moveTo(a+u,s),"top"===o&&this.drawCaret(e,t,r,n),t.lineTo(a+l-d,s),t.quadraticCurveTo(a+l,s,a+l,s+d),"center"===o&&"right"===i&&this.drawCaret(e,t,r,n),t.lineTo(a+l,s+c-f),t.quadraticCurveTo(a+l,s+c,a+l-f,s+c),"bottom"===o&&this.drawCaret(e,t,r,n),t.lineTo(a+h,s+c),t.quadraticCurveTo(a,s+c,a,s+c-h),"center"===o&&"left"===i&&this.drawCaret(e,t,r,n),t.lineTo(a,s+u),t.quadraticCurveTo(a,s,a+u,s),t.closePath(),t.fill(),n.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,r=this.$animations,n=r&&r.x,i=r&&r.y;if(n||i){const r=No[e.position].call(this,this._active,this._eventPosition);if(!r)return;const o=this._size=Go(this,e),a=Object.assign({},r,this._size),s=$o(t,e,a),l=Ho(e,a,s,t);n._to===l.x&&i._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(t);const n={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Lt(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;
vendor: 11,693 bytes, line 29
29t.enabled&&a&&(e.save(),e.globalAlpha=r,this.drawBackground(i,e,n,t),br(e,t.textDirection),i.y+=o.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),xr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const r=this._active,n=e.map((({datasetIndex:e,index:t})=>{const r=this.chart.getDatasetMeta(e);if(!r)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:r.data[t],index:t}})),i=!K(r,n),o=this._positionChanged(n,t);(i||o)&&(this._active=n,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,r=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,i=this._active||[],o=this._getActiveElements(e,i,t,r),a=this._positionChanged(o,e),s=t||!K(o,i)||a;return s&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,r,n){const i=this.options;if("mouseout"===e.type)return[];if(!n)return t.filter((e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)));const o=this.chart.getElementsAtEventForMode(e,i.mode,i,r);return i.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:r,caretY:n,options:i}=this,o=No[i.position].call(this,e,t);return!1!==o&&(r!==o.x||n!==o.y)}}var Jo={id:"tooltip",_element:Ko,positioners:No,afterInit(e,t,r){r&&(e.tooltip=new Ko({chart:e,options:r}))},beforeUpdate(e,t,r){e.tooltip&&e.tooltip.initialize(r)},reset(e,t,r){e.tooltip&&e.tooltip.initialize(r)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const r={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...r,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",r)}},afterEvent(e,t){if(e.tooltip){const r=t.replay;e.tooltip.handleEvent(t.event,r,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Yo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Qo=Object.freeze({__proto__:null,Colors:lo,Decimation:ho,Filler:Po,Legend:Lo,SubTitle:Fo,Title:Do,Tooltip:Jo});function ea(e,t,r,n){const i=e.indexOf(t);if(-1===i)return((e,t,r,n)=>("string"==typeof t?(r=e.push(t)-1,n.unshift({index:r,label:t})):isNaN(t)&&(r=null),r))(e,t,r,n);return i!==e.lastIndexOf(t)?r:i}function ta(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function ra(e,t){const r=[],{bounds:n,step:i,min:o,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=e,h=i||1,f=c-1,{min:p,max:g}=t,m=!G(o),y=!G(a),_=!G(l),v=(g-p)/(u+1);let b,x,w,S,k=xe((g-p)/f/h)*h;if(k<1e-14&&!m&&!y)return[{value:p},{value:g}];S=Math.ceil(g/k)-Math.floor(p/k),S>f&&(k=xe(S*k/f/h)*h),G(s)||(b=Math.pow(10,s),k=Math.ceil(k*b)/b),"ticks"===n?(x=Math.floor(p/k)*k,w=Math.ceil(g/k)*k):(x=p,w=g),m&&y&&i&&function(e,t){const r=Math.round(e);return r-t<=e&&r+t>=e}((a-o)/i,k/1e3)?(S=Math.round(Math.min((a-o)/k,c)),k=(a-o)/S,x=o,w=a):_?(x=m?o:x,w=y?a:w,S=l-1,k=(w-x)/S):(S=(w-x)/k,S=be(S,Math.round(S),k/1e3)?Math.round(S):Math.ceil(S));const T=Math.max(Ie(k),Ie(x));b=Math.pow(10,G(s)?T:s),x=Math.round(x*b)/b,w=Math.round(w*b)/b;let I=0;for(m&&(d&&x!==o?(r.push({value:o}),x<o&&I++,be(Math.round((x+I*k)*b)/b,o,na(o,v,e))&&I++):x<o&&I++);I<S;++I){const e=Math.round((x+I*k)*b)/b;if(y&&e>a)break;r.push({value:e})}return y&&d&&w!==a?r.length&&be(r[r.length-1].value,a,na(a,v,e))?r[r.length-1].value=a:r.push({value:a}):y&&w!==a||r.push({value:w}),r}function na(e,t,{horizontal:r,minRotation:n}){const i=ke(n),o=(r?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class ia extends ni{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return G(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:r}=this.getUserBounds();let{min:n,max:i}=this;const o=e=>n=t?n:e,a=e=>i=r?i:e;if(e){const e=ve(n),t=ve(i);e<0&&t<0?a(0):e>0&&t>0&&o(0)}if(n===i){let t=0===i?1:Math.abs(.05*i);a(i+t),e||o(n-t)}this.min=n,this.max=i}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:r,stepSize:n}=e;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),r=r||11),r&&(t=Math.min(r,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const n=ra({maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&Se(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const e=this.ticks;let t=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const n=(r-t)/Math.max(e.length-1,1)/2;t-=n,r+=n}this._startValue=t,this._endValue=r,this._valueRange=r-t}getLabelForValue(e){return rt(e,this.chart.options.locale,this.options.ticks.format)}}class oa extends ia{static id="linear";static defaults={ticks:{callback:it.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=H(e)?e:0,this.max=H(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,r=ke(this.options.ticks.minRotation),n=(e?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/n))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const aa=e=>Math.floor(_e(e)),sa=(e,t)=>Math.pow(10,aa(e)+t);function la(e){return 1===e/Math.pow(10,aa(e))}function ca(e,t,r){const n=Math.pow(10,r),i=Math.floor(e/n);return Math.ceil(t/n)-i}function ua(e,{min:t,max:r}){t=q(e.min,t);const n=[],i=aa(t);let o=function(e,t){let r=aa(t-e);for(;ca(e,t,r)>10;)r++;for(;ca(e,t,r)<10;)r--;return Math.min(r,aa(e))}(t,r),a=o<0?Math.pow(10,Math.abs(o)):1;const s=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,o)),h=q(e.min,Math.round((l+u+d*Math.pow(10,o))*a)/a);for(;h<r;)n.push({value:h,major:la(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),h=Math.round((l+u+d*Math.pow(10,o))*a)/a;const f=q(e.max,h);return n.push({value:f,major:la(f),significand:d}),n}class da extends ni{static id="logarithmic";static defaults={ticks:{callback:it.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const r=ia.prototype.parse.apply(this,[e,t]);if(0!==r)return H(r)&&r>0?r:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=H(e)?Math.max(0,e):null,this.max=H(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!H(this._userMin)&&(this.min=e===sa(this.min,0)?sa(this.min,-1):sa(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let r=this.min,n=this.max;const i=t=>r=e?r:t,o=e=>n=t?n:e;r===n&&(r<=0?(i(1),o(10)):(i(sa(r,-1)),o(sa(n,1)))),r<=0&&i(sa(n,-1)),n<=0&&o(sa(r,1)),this.min=r,this.max=n}buildTicks(){const e=this.options,t=ua({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&Se(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":rt(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=_e(e),this._valueRange=_e(this.max)-_e(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(_e(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function ha(e){const t=e.ticks;if(t.display&&e.display){const e=Lt(t.backdropPadding);return W(t.font&&t.font.size,ut.font.size)+e.height}return 0}function fa(e,t,r){return r=U(r)?r:[r],{w:ht(e,t.string,r),h:r.length*t.lineHeight}}function pa(e,t,r,n,i){return e===n||e===i?{start:t-r/2,end:t+r/2}:e<n||e>i?{start:t-r,end:t}:{start:t,end:t+r}}function ga(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},r=Object.assign({},t),n=[],i=[],o=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?ue/o:0;for(let l=0;l<o;l++){const o=a.setContext(e.getPointLabelContext(l));i[l]=o.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],s),u=Ot(o.font),d=fa(e.ctx,u,e._pointLabels[l]);n[l]=d;const h=Ae(e.getIndexAngle(l)+s),f=Math.round(Te(h));ma(r,t,h,pa(f,c.x,d.w,0,180),pa(f,c.y,d.h,90,270))}e.setCenterPoint(t.l-r.l,r.r-t.r,t.t-r.t,r.b-t.b),e._pointLabelItems=function(e,t,r){const n=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:s}=o.pointLabels,l={extra:ha(o)/2,additionalAngle:a?ue/i:0};let c;for(let o=0;o<i;o++){l.padding=r[o],l.size=t[o];const i=ya(e,o,l);n.push(i),"auto"===s&&(i.visible=_a(i,c),i.visible&&(c=i))}return n}(e,n,i)}function ma(e,t,r,n,i){const o=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));let s=0,l=0;n.start<t.l?(s=(t.l-n.start)/o,e.l=Math.min(e.l,t.l-s)):n.end>t.r&&(s=(n.end-t.r)/o,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(l=(t.t-i.start)/a,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function ya(e,t,r){const n=e.drawingArea,{extra:i,additionalAngle:o,padding:a,size:s}=r,l=e.getPointPosition(t,n+i+a,o),c=Math.round(Te(Ae(l.angle+ge))),u=function(e,t,r){90===r||270===r?e-=t/2:(r>270||r<90)&&(e-=t);return e}(l.y,s.h,c),d=function(e){if(0===e||180===e)return"center";if(e<180)return"left";return"right"}(c),h=function(e,t,r){"right"===r?e-=t:"center"===r&&(e-=t/2);return e}(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function _a(e,t){if(!t)return!0;const{left:r,top:n,right:i,bottom:o}=e;return!(yt({x:r,y:n},t)||yt({x:r,y:o},t)||yt({x:i,y:n},t)||yt({x:i,y:o},t))}function va(e,t,r){const{left:n,top:i,right:o,bottom:a}=r,{backdropColor:s}=t;if(!G(s)){const r=Rt(t.borderRadius),l=Lt(t.backdropPadding);e.fillStyle=s;const c=n-l.left,u=i-l.top,d=o-n+l.width,h=a-i+l.height;
vendor: 10,491 bytes, line 29
29Object.values(r).some((e=>0!==e))?(e.beginPath(),Tt(e,{x:c,y:u,w:d,h,radius:r}),e.fill()):e.fillRect(c,u,d,h)}}function ba(e,t,r,n){const{ctx:i}=e;if(r)i.arc(e.xCenter,e.yCenter,t,0,de);else{let r=e.getPointPosition(0,t);i.moveTo(r.x,r.y);for(let o=1;o<n;o++)r=e.getPointPosition(o,t),i.lineTo(r.x,r.y)}}class xa extends ia{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:it.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Lt(ha(this.options)/2),t=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(t,r)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=H(e)&&!isNaN(e)?e:0,this.max=H(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ha(this.options))}generateTickLabels(e){ia.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map(((e,t)=>{const r=Y(this.options.pointLabels.callback,[e,t],this);return r||0===r?r:""})).filter(((e,t)=>this.chart.getDataVisibility(t)))}fit(){const e=this.options;e.display&&e.pointLabels.display?ga(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,r,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((r-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,r,n))}getIndexAngle(e){return Ae(e*(de/(this._pointLabels.length||1))+ke(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(G(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(G(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const r=t[e];return function(e,t,r){return zt(e,{label:r,index:t,type:"pointLabel"})}(this.getContext(),e,r)}}getPointPosition(e,t,r=0){const n=this.getIndexAngle(e)-ge+r;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:r,right:n,bottom:i}=this._pointLabelItems[e];return{left:t,top:r,right:n,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const r=this.ctx;r.save(),r.beginPath(),ba(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:r,grid:n,border:i}=t,o=this._pointLabels.length;let a,s,l;if(t.pointLabels.display&&function(e,t){const{ctx:r,options:{pointLabels:n}}=e;for(let i=t-1;i>=0;i--){const t=e._pointLabelItems[i];if(!t.visible)continue;const o=n.setContext(e.getPointLabelContext(i));va(r,o,t);const a=Ot(o.font),{x:s,y:l,textAlign:c}=t;kt(r,e._pointLabels[i],s,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach(((e,t)=>{if(0!==t||0===t&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);const r=this.getContext(t),a=n.setContext(r),l=i.setContext(r);!function(e,t,r,n,i){const o=e.ctx,a=t.circular,{color:s,lineWidth:l}=t;!a&&!n||!s||!l||r<0||(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(i.dash||[]),o.lineDashOffset=i.dashOffset,o.beginPath(),ba(e,r,a,n),o.closePath(),o.stroke(),o.restore())}(this,a,s,o,l)}})),r.display){for(e.save(),a=o-1;a>=0;a--){const n=r.setContext(this.getPointLabelContext(a)),{color:i,lineWidth:o}=n;o&&i&&(e.lineWidth=o,e.strokeStyle=i,e.setLineDash(n.borderDash),e.lineDashOffset=n.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(a,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,r=t.ticks;if(!r.display)return;const n=this.getIndexAngle(0);let i,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(((n,a)=>{if(0===a&&this.min>=0&&!t.reverse)return;const s=r.setContext(this.getContext(a)),l=Ot(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){e.font=l.string,o=e.measureText(n.label).width,e.fillStyle=s.backdropColor;const t=Lt(s.backdropPadding);e.fillRect(-o/2-t.left,-i-l.size/2-t.top,o+t.width,l.size+t.height)}kt(e,n.label,0,-i,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})})),e.restore()}drawTitle(){}}const wa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Sa=Object.keys(wa);function ka(e,t){return e-t}function Ta(e,t){if(G(t))return null;const r=e._adapter,{parser:n,round:i,isoWeekday:o}=e._parseOpts;let a=t;return"function"==typeof n&&(a=n(a)),H(a)||(a="string"==typeof n?r.parse(a,n):r.parse(a)),null===a?null:(i&&(a="week"!==i||!we(o)&&!0!==o?r.startOf(a,i):r.startOf(a,"isoWeek",o)),+a)}function Ia(e,t,r,n){const i=Sa.length;for(let o=Sa.indexOf(e);o<i-1;++o){const e=wa[Sa[o]],i=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((r-t)/(i*e.size))<=n)return Sa[o]}return Sa[i-1]}function Ma(e,t,r){if(r){if(r.length){const{lo:n,hi:i}=Oe(r,t);e[r[n]>=t?r[n]:r[i]]=!0}}else e[t]=!0}function Ea(e,t,r){const n=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,n.push({value:s,major:!1});return 0!==o&&r?function(e,t,r,n){const i=e._adapter,o=+i.startOf(t[0].value,n),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,n))l=r[s],l>=0&&(t[l].major=!0);return t}(e,n,i,r):n}class Pa extends ni{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const r=e.time||(e.time={}),n=this._adapter=new cn(e.adapters.date);n.init(t),re(r.displayFormats,n.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:Ta(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,r=e.time.unit||"day";let{min:n,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function s(e){o||isNaN(e.min)||(n=Math.min(n,e.min)),a||isNaN(e.max)||(i=Math.max(i,e.max))}o&&a||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),n=H(n)&&!isNaN(n)?n:+t.startOf(Date.now(),r),i=H(i)&&!isNaN(i)?i:+t.endOf(Date.now(),r)+1,this.min=Math.min(n,i-1),this.max=Math.max(n+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],r=e[e.length-1]),{min:t,max:r}}buildTicks(){const e=this.options,t=e.time,r=e.ticks,n="labels"===r.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const i=this.min,o=function(e,t,r){let n=0,i=e.length;for(;n<i&&e[n]<t;)n++;for(;i>n&&e[i-1]>r;)i--;return n>0||i<e.length?e.slice(n,i):e}(n,i,this.max);return this._unit=t.unit||(r.autoSkip?Ia(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):function(e,t,r,n,i){for(let o=Sa.length-1;o>=Sa.indexOf(r);o--){const r=Sa[o];if(wa[r].common&&e._adapter.diff(i,n,r)>=t-1)return r}return Sa[r?Sa.indexOf(r):0]}(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=r.major.enabled&&"year"!==this._unit?function(e){for(let t=Sa.indexOf(e)+1,r=Sa.length;t<r;++t)if(wa[Sa[t]].common)return Sa[t]}(this._unit):void 0,this.initOffsets(n),e.reverse&&o.reverse(),Ea(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((e=>+e.value)))}initOffsets(e=[]){let t,r,n=0,i=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),n=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,r=this.getDecimalForValue(e[e.length-1]),i=1===e.length?r:(r-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Re(n,0,o),i=Re(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,t=this.min,r=this.max,n=this.options,i=n.time,o=i.unit||Ia(i.minUnit,t,r,this._getLabelCapacity(t)),a=W(n.ticks.stepSize,1),s="week"===o&&i.isoWeekday,l=we(s)||!0===s,c={};let u,d,h=t;if(l&&(h=+e.startOf(h,"isoWeek",s)),h=+e.startOf(h,l?"day":o),e.diff(r,t,o)>1e5*a)throw new Error(t+" and "+r+" are too far apart with stepSize of "+a+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(u=h,d=0;u<r;u=+e.add(u,a,o),d++)Ma(c,u,f);return u!==r&&"ticks"!==n.bounds&&1!==d||Ma(c,u,f),Object.keys(c).sort(ka).map((e=>+e))}getLabelForValue(e){const t=this._adapter,r=this.options.time;return r.tooltipFormat?t.format(e,r.tooltipFormat):t.format(e,r.displayFormats.datetime)}format(e,t){const r=this.options.time.displayFormats,n=this._unit,i=t||r[n];return this._adapter.format(e,i)}_tickFormatFunction(e,t,r,n){const i=this.options,o=i.ticks.callback;if(o)return Y(o,[e,t,r],this);const a=i.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],d=r[t],h=l&&u&&d&&d.major;return this._adapter.format(e,n||(h?u:c))}generateTickLabels(e){let t,r,n;for(t=0,r=e.length;t<r;
vendor: 5,242 bytes, line 29
29++t)n=e[t],n.label=this._tickFormatFunction(n.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+r)*t.factor)}getValueForPixel(e){const t=this._offsets,r=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,r=this.ctx.measureText(e).width,n=ke(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(n),o=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*o,h:r*o+a*i}}_getLabelCapacity(e){const t=this.options.time,r=t.displayFormats,n=r[t.unit]||r.millisecond,i=this._tickFormatFunction(e,0,Ea(this,[e],this._majorUnit),n),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let e,t,r=this._cache.data||[];if(r.length)return r;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,t=n.length;e<t;++e)r=r.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(r)}getLabelTimestamps(){const e=this._cache.labels||[];let t,r;if(e.length)return e;const n=this.getLabels();for(t=0,r=n.length;t<r;++t)e.push(Ta(this,n[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Be(e.sort(ka))}}function Aa(e,t,r){let n,i,o,a,s=0,l=e.length-1;r?(t>=e[s].pos&&t<=e[l].pos&&({lo:s,hi:l}=De(e,"pos",t)),({pos:n,time:o}=e[s]),({pos:i,time:a}=e[l])):(t>=e[s].time&&t<=e[l].time&&({lo:s,hi:l}=De(e,"time",t)),({time:n,pos:o}=e[s]),({time:i,pos:a}=e[l]));const c=i-n;return c?o+(a-o)*(t-n)/c:o}var Ca=Object.freeze({__proto__:null,CategoryScale:class extends ni{static id="category";static defaults={ticks:{callback:ta}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:r,label:n}of t)e[r]===n&&e.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(G(e))return null;const r=this.getLabels();return((e,t)=>null===e?null:Re(Math.round(e),0,t))(t=isFinite(t)&&r[t]===e?t:ea(r,e,W(t,e),this._addedLabels),r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:r,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(r=0),t||(n=this.getLabels().length-1)),this.min=r,this.max=n}buildTicks(){const e=this.min,t=this.max,r=this.options.offset,n=[];let i=this.getLabels();i=0===e&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let r=e;r<=t;r++)n.push({value:r});return n}getLabelForValue(e){return ta.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:oa,LogarithmicScale:da,RadialLinearScale:xa,TimeScale:Pa,TimeSeriesScale:class extends Pa{static id="timeseries";static defaults=Pa.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Aa(t,this.min),this._tableRange=Aa(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:r}=this,n=[],i=[];let o,a,s,l,c;for(o=0,a=e.length;o<a;++o)l=e[o],l>=t&&l<=r&&n.push(l);if(n.length<2)return[{time:t,pos:0},{time:r,pos:1}];for(o=0,a=n.length;o<a;++o)c=n[o+1],s=n[o-1],l=n[o],Math.round((c+s)/2)!==l&&i.push({time:l,pos:o/(a-1)});return i}_generate(){const e=this.min,t=this.max;let r=super.getDataTimestamps();return r.includes(e)&&r.length||r.splice(0,0,e),r.includes(t)&&1!==r.length||r.push(t),r.sort(((e,t)=>e-t))}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),r=this.getLabelTimestamps();return e=t.length&&r.length?this.normalize(t.concat(r)):t.length?t:r,e=this._cache.all=e,e}getDecimalForValue(e){return(Aa(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,r=this.getDecimalForPixel(e)/t.factor-t.end;return Aa(this._table,r*this._tableRange+this._minPos,!0)}}});const Ra=[an,to,Qo,Ca];Li.register(...Ra);const La=Li;function Oa(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Da(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Da(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
29}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Da(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function za(e,t,r){for(var n=function(e){return e.reduce((function(e,t){return e[t.date]=t.count,e}),{})}(r),i=[],o=new Date(e);o<=t;){var a=o.toISOString().split("T")[0];i.push({x:a,y:n[a]||0}),o.setDate(o.getDate()+1)}return i}var Fa={barChartWithDates:function(e,t,r,n,i){var o=za(t,r,n);return new La(e,{type:"bar",data:{datasets:[{label:i,data:o}]},options:{aspectRatio:3,responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!0,text:"Date"}},y:{beginAtZero:!0,title:{display:!0,text:i}}}}})},cumulativeChartWithDates:function(e,t,r,n,i,o){var a,s=za(t,r,n),l=o||0,c=Oa(s);try{for(c.s();!(a=c.n()).done;){var u=a.value;l+=u.y,u.y=l}}catch(e){c.e(e)}finally{c.f()}return new La(e,{type:"line",data:{datasets:[{label:i,fill:!0,data:s}]},options:{aspectRatio:3,responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!0,text:"Date"}},y:{beginAtZero:!0,title:{display:!0,text:i}}}}})}};const Na=!1;var Ba=Array.isArray,ja=Array.prototype.indexOf,Va=Array.from,Ga=Object.keys,Ua=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,Ha=Object.getOwnPropertyDescriptors,qa=Object.prototype,Wa=Array.prototype,Za=Object.getPrototypeOf,Ya=Object.isExtensible;function Xa(e){return"function"==typeof e}const Ka=()=>{};function Ja(e){return e()}function Qa(e){for(var t=0;t<e.length;t++)e[t]()}function es(){var e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}}function ts(e,t){if(Array.isArray(e))return e;if(void 0===t||!(Symbol.iterator in e))return Array.from(e);const r=[];for(const n of e)if(r.push(n),r.length===t)break;return r}const rs=1<<24,ns=16,is=32,os=64,as=128,ss=512,ls=1024,cs=2048,us=4096,ds=8192,hs=16384,fs=32768,ps=65536,gs=1<<17,ms=1<<18,ys=1<<19,_s=32768,vs=1<<21,bs=1<<23,xs=Symbol("$state"),ws=Symbol("legacy props"),Ss=Symbol(""),ks=(Symbol("proxy path"),new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"});const Ts="[!",Is={},Ms=Symbol();Symbol("filename"),Symbol("hmr");function Es(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let Ps,As=!1;function Cs(e){As=e}function Rs(e){if(null===e)throw Es(),Is;return Ps=e}function Ls(){return Rs(cc(Ps))}function Os(e){if(As){if(null!==cc(Ps))throw Es(),Is;Ps=e}}function Ds(e=1){if(As){for(var t=e,r=Ps;t--;)r=cc(r);Ps=r}}function zs(e=!0){for(var t=0,r=Ps;;){if(8===r.nodeType){var n=r.data;if("]"===n){if(0===t)return r;t-=1}else"["!==n&&n!==Ts||(t+=1)}var i=cc(r);e&&r.remove(),r=i}}function Fs(e){if(!e||8!==e.nodeType)throw Es(),Is;return e.data}function Ns(e){return e===this.v}function Bs(e,t){return e!=e?t==t:e!==t||null!==e&&"object"==typeof e||"function"==typeof e}function js(e){return!Bs(e,this.v)}let Vs=!1,Gs=!1;function Us(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let $s=null;function Hs(e){$s=e}function qs(e){return Ks("getContext").get(e)}function Ws(e,t){const r=Ks("setContext");if(Vs){var n=Jc.f;!Yc&&!!(n&is)&&!$s.i||function(){throw new Error("https://svelte.dev/e/set_context_after_init")}()}return r.set(e,t),t}function Zs(e,t=!1,r){$s={p:$s,i:!1,c:null,e:null,s:e,x:null,l:Gs&&!t?{s:null,u:null,$:[]}:null}}function Ys(e){var t=$s,r=t.e;if(null!==r)for(var n of(t.e=null,r))Ic(n);return void 0!==e&&(t.x=e),t.i=!0,$s=t.p,e??{}}function Xs(){return!Gs||null!==$s&&null===$s.l}function Ks(e){return null===$s&&Us(),$s.c??=new Map(function(e){let t=e.p;for(;null!==t;){const e=t.c;if(null!==e)return e;t=t.p}return null}($s)||void 0)}let Js=[];function Qs(){var e=Js;Js=[],Qa(e)}function el(e){if(0===Js.length&&!dl){var t=Js;queueMicrotask((()=>{t===Js&&Qs()}))}Js.push(e)}function tl(){for(;Js.length>0;)Qs()}new WeakMap;function rl(e){var t=Jc;if(null===t)return Yc.f|=bs,e;if(t.f&fs)nl(e,t);else{if(!(t.f&as))throw e;t.b.error(e)}}function nl(e,t){for(;null!==t;){if(t.f&as)try{return void t.b.error(e)}catch(t){e=t}t=t.parent}throw e}const il=new Set;let ol=null,al=null,sl=null,ll=[],cl=null,ul=!1,dl=!1;class hl{committed=!1;
29current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#n=0;#i=null;#o=[];#a=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#n>0}process(e){ll=[],al=null,this.apply();var t={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const r of e)this.#s(r,t);this.is_fork||this.#l(),this.is_deferred()?(this.#c(t.effects),this.#c(t.render_effects),this.#c(t.block_effects)):(al=this,ol=null,yl(t.render_effects),yl(t.effects),al=null,this.#i?.resolve()),sl=null}#s(e,t){e.f^=ls;for(var r=e.first;null!==r;){var n=r.f,i=!!(96&n),o=i&&!!(n&ls)||!!(n&ds)||this.skipped_effects.has(r);if(r.f&as&&r.b?.is_pending()&&(t={parent:t,effect:r,effects:[],render_effects:[],block_effects:[]}),!o&&null!==r.fn){i?r.f^=ls:4&n?t.effects.push(r):Vs&&16777224&n?t.render_effects.push(r):uu(r)&&(r.f&ns&&t.block_effects.push(r),gu(r));var a=r.first;if(null!==a){r=a;continue}}var s=r.parent;for(r=r.next;null===r&&null!==s;)s===t.effect&&(this.#c(t.effects),this.#c(t.render_effects),this.#c(t.block_effects),t=t.parent),r=s.next,s=s.parent}}#c(e){for(const t of e){(t.f&cs?this.#o:this.#a).push(t),this.#u(t.deps),Su(t,ls)}}#u(e){if(null!==e)for(const t of e)2&t.f&&t.f&_s&&(t.f^=_s,this.#u(t.deps))}capture(e,t){this.previous.has(e)||this.previous.set(e,t),e.f&bs||(this.current.set(e,e.v),sl?.set(e,e.v))}activate(){ol=this,this.apply()}deactivate(){ol===this&&(ol=null,sl=null)}flush(){if(this.activate(),ll.length>0){if(pl(),null!==ol&&ol!==this)return}else 0===this.#r&&this.process([]);this.deactivate()}discard(){for(const e of this.#t)e(this);this.#t.clear()}#l(){if(0===this.#n){for(const e of this.#e)e();this.#e.clear()}0===this.#r&&this.#d()}#d(){if(il.size>1){this.previous.clear();var e=sl,t=!0,r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const e of il){if(e===this){t=!1;continue}const i=[];for(const[r,n]of this.current){if(e.current.has(r)){if(!t||n===e.current.get(r))continue;e.current.set(r,n)}i.push(r)}if(0===i.length)continue;const o=[...e.current.keys()].filter((e=>!this.current.has(e)));if(o.length>0){var n=ll;ll=[];const t=new Set,a=new Map;for(const e of i)_l(e,o,t,a);if(ll.length>0){ol=e,e.apply();for(const t of ll)e.#s(t,r);e.deactivate()}ll=n}}ol=null,sl=e}this.committed=!0,il.delete(this)}increment(e){this.#r+=1,e&&(this.#n+=1)}decrement(e){this.#r-=1,e&&(this.#n-=1),this.revive()}revive(){for(const e of this.#o)Su(e,cs),bl(e);for(const e of this.#a)Su(e,us),bl(e);this.#o=[],this.#a=[],this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=es()).promise}static ensure(){if(null===ol){const e=ol=new hl;il.add(ol),dl||hl.enqueue((()=>{ol===e&&e.flush()}))}return ol}static enqueue(e){el(e)}apply(){if(Vs&&(this.is_fork||1!==il.size)){sl=new Map(this.current);for(const e of il)if(e!==this)for(const[t,r]of e.previous)sl.has(t)||sl.set(t,r)}}}function fl(e){var t=dl;dl=!0;try{var r;for(e&&(null!==ol&&pl(),r=e());;){if(tl(),0===ll.length&&(ol?.flush(),0===ll.length))return cl=null,r;pl()}}finally{dl=t}}function pl(){var e=Hc;ul=!0;try{var t=0;for(qc(!0);ll.length>0;){var r=hl.ensure();if(t++>1e3)gl();r.process(ll),Vl.clear()}}finally{ul=!1,qc(e),cl=null}}function gl(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(e){Na,nl(e,cl)}}let ml=null;function yl(e){var t=e.length;if(0!==t){for(var r=0;r<t;){var n=e[r++];if(!(24576&n.f)&&uu(n)&&(ml=new Set,gu(n),null===n.deps&&null===n.first&&null===n.nodes_start&&(null===n.teardown&&null===n.ac?Fc(n):n.fn=null),ml?.size>0)){Vl.clear();for(const e of ml){if(24576&e.f)continue;const t=[e];let r=e.parent;for(;null!==r;)ml.has(r)&&(ml.delete(r),t.push(r)),r=r.parent;for(let e=t.length-1;e>=0;e--){const r=t[e];24576&r.f||gu(r)}}ml.clear()}}ml=null}}function _l(e,t,r,n){if(!r.has(e)&&(r.add(e),null!==e.reactions))for(const i of e.reactions){const e=i.f;2&e?_l(i,t,r,n):4194320&e&&!(e&cs)&&vl(i,t,n)&&(Su(i,cs),bl(i))}}function vl(e,t,r){const n=r.get(e);if(void 0!==n)return n;if(null!==e.deps)for(const n of e.deps){if(t.includes(n))return!0;if(2&n.f&&vl(n,t,r))return r.set(n,!0),!0}return r.set(e,!1),!1}function bl(e){for(var t=cl=e;null!==t.parent;){var r=(t=t.parent).f;if(ul&&t===Jc&&r&ns&&!(r&ms))return;if(96&r){if(!(r&ls))return;t.f^=ls}}ll.push(t)}function xl(e){let t,r=0,n=Ul(0);return()=>{Sc()&&(yu(n),Ec((()=>(0===r&&(t=xu((()=>e((()=>Xl(n)))))),r+=1,()=>{el((()=>{r-=1,0===r&&(t?.(),t=void 0,Xl(n))}))}))))}}class wl{parent;#r=!1;#h;#f=As?Ps:null;#p;#g;#m;#y=null;#_=null;#v=null;#b=null;#x=null;#w=0;#S=0;#k=!1;#T=null;#I=xl((()=>(this.#T=Ul(this.#w),()=>{this.#T=null})));constructor(e,t,r){this.#h=e,this.#p=t,this.#g=r,this.parent=Jc.b,this.#r=!!this.#p.pending,this.#m=Ac((()=>
29{if(Jc.b=this,As){const e=this.#f;Ls();8===e.nodeType&&e.data===Ts?this.#M():this.#E()}else{var e=this.#P();try{this.#y=Rc((()=>r(e)))}catch(e){this.error(e)}this.#S>0?this.#A():this.#r=!1}return()=>{this.#x?.remove()}}),589952),As&&(this.#h=Ps)}#E(){try{this.#y=Rc((()=>this.#g(this.#h)))}catch(e){this.error(e)}this.#r=!1}#M(){const e=this.#p.pending;e&&(this.#_=Rc((()=>e(this.#h))),hl.enqueue((()=>{var e=this.#P();this.#y=this.#C((()=>(hl.ensure(),Rc((()=>this.#g(e)))))),this.#S>0?this.#A():(Nc(this.#_,(()=>{this.#_=null})),this.#r=!1)})))}#P(){var e=this.#h;return this.#r&&(this.#x=sc(),this.#h.before(this.#x),e=this.#x),e}is_pending(){return this.#r||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#p.pending}#C(e){var t=Jc,r=Yc,n=$s;Qc(this.#m),Kc(this.#m),Hs(this.#m.ctx);try{return e()}catch(e){return rl(e),null}finally{Qc(t),Kc(r),Hs(n)}}#A(){const e=this.#p.pending;null!==this.#y&&(this.#b=document.createDocumentFragment(),this.#b.append(this.#x),Uc(this.#y,this.#b)),null===this.#_&&(this.#_=Rc((()=>e(this.#h))))}#R(e){this.has_pending_snippet()?(this.#S+=e,0===this.#S&&(this.#r=!1,this.#_&&Nc(this.#_,(()=>{this.#_=null})),this.#b&&(this.#h.before(this.#b),this.#b=null))):this.parent&&this.parent.#R(e)}update_pending_count(e){this.#R(e),this.#w+=e,this.#T&&Wl(this.#T,this.#w)}get_effect_pending(){return this.#I(),yu(this.#T)}error(e){var t=this.#p.onerror;let r=this.#p.failed;if(this.#k||!t&&!r)throw e;this.#y&&(Dc(this.#y),this.#y=null),this.#_&&(Dc(this.#_),this.#_=null),this.#v&&(Dc(this.#v),this.#v=null),As&&(Rs(this.#f),Ds(),Rs(zs()));var n=!1,i=!1;const o=()=>{n?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(n=!0,i&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),hl.ensure(),this.#w=0,null!==this.#v&&Nc(this.#v,(()=>{this.#v=null})),this.#r=this.has_pending_snippet(),this.#y=this.#C((()=>(this.#k=!1,Rc((()=>this.#g(this.#h)))))),this.#S>0?this.#A():this.#r=!1)};var a=Yc;try{Kc(null),i=!0,t?.(e,o),i=!1}catch(e){nl(e,this.#m&&this.#m.parent)}finally{Kc(a)}r&&el((()=>{this.#v=this.#C((()=>{hl.ensure(),this.#k=!0;try{return Rc((()=>{r(this.#h,(()=>e),(()=>o))}))}catch(e){return nl(e,this.#m.parent),null}finally{this.#k=!1}}))}))}}let Sl=null;function kl(e){Sl=e}function Tl(e,t){return t}function Il(e,t,r,n,i,o=null){var a=e,s=new Map,l=null,c=!!(1&t),u=!!(2&t);if(!!(4&t)){var d=e;a=As?Rs(lc(d)):d.appendChild(sc())}As&&Ls();var h,f=null,p=zl((()=>{var e=r();return Ba(e)?e:null==e?[]:Va(e)})),g=!0;function m(){!function(e,t,r,n,i){var o,a,s,l,c,u=!!(8&n),d=t.length,h=e.items,f=e.first,p=null,g=[],m=[];if(u)for(c=0;c<d;c+=1)s=i(t[c],c),(l=h.get(s)).o&&(l.a?.measure(),(a??=new Set).add(l));for(c=0;c<d;c+=1)if(s=i(t[c],c),l=h.get(s),e.first??=l,l.o){if(l.e.f&ds&&(Vc(l.e),u&&(l.a?.unfix(),(a??=new Set).delete(l))),l!==f){if(void 0!==o&&o.has(l)){if(g.length<m.length){var y,_=m[0];p=_.prev;var v=g[0],b=g[g.length-1];for(y=0;y<g.length;y+=1)El(g[y],_,r);for(y=0;y<m.length;y+=1)o.delete(m[y]);Pl(e,v.prev,b.next),Pl(e,p,v),Pl(e,b,_),f=_,p=b,c-=1,g=[],m=[]}else o.delete(l),El(l,f,r),Pl(e,l.prev,l.next),Pl(e,l,null===p?e.first:p.next),Pl(e,p,l),p=l;continue}for(g=[],m=[];null!==f&&f.k!==s;)f.e.f&ds||(o??=new Set).add(f),m.push(f),f=f.next;if(null===f)continue;l=f}g.push(l),p=l,f=l.next}else{l.o=!0;var x=p?p.next:f;Pl(e,p,l),Pl(e,l,x),El(l,x,r),g=[],m=[],f=(p=l).next}let w=h.size>d;if(null!==f||void 0!==o){for(var S=void 0===o?[]:Va(o);null!==f;)f.e.f&ds||S.push(f),f=f.next;var k=S.length;if(w=h.size-k>d,k>0){var T=4&n&&0===d?r:null;if(u){for(c=0;c<k;c+=1)S[c].a?.measure();for(c=0;c<k;c+=1)S[c].a?.fix()}!function(e,t,r){for(var n=[],i=t.length,o=0;o<i;o++)jc(t[o].e,n,!0);Bc(n,(()=>{var o=0===n.length&&null!==r;if(o){var a=r,s=a.parentNode;fc(s),s.append(a),e.items.clear(),Pl(e,t[0].prev,t[i-1].next)}for(var l=0;l<i;l++){var c=t[l];o||(e.items.delete(c.k),Pl(e,c.prev,c.next)),Dc(c.e,!o)}e.first===t[0]&&(e.first=t[0].prev)}))}(e,S,T)}}if(w)for(const t of h.values())t.o||(Pl(e,p,t),p=t);e.effect.last=p&&p.e,u&&el((()=>{if(void 0!==a)for(l of a)l.a?.apply()}))}(_,h,a,t,n),null!==f&&(0===h.length?(f.fragment?(a.before(f.fragment),f.fragment=null):Vc(f.effect),y.first=f.effect):Nc(f.effect,(()=>{f=null})))}var y=Ac((()=>{var e=(h=yu(p)).length;let d=!1;As&&(Fs(a)===Ts!==(0===e)&&(Rs(a=zs()),Cs(!1),d=!0));for(var y=new Set,_=ol,v=null,b=pc(),x=0;x<e;x+=1){As&&8===Ps.nodeType&&"]"===Ps.data&&(a=Ps,d=!0,Cs(!1));var w=h[x],S=n(w,x),k=g?null:s.get(S);k?(c&&Wl(k.v,w),u?Wl(k.i,x):k.i=x,b&&_.skipped_effects.delete(k.e)):(k=Ml(g?a:null,v,w,S,x,i,t,r),g&&(k.o=!0,null===v?l=k:v.next=k,v=k),s.set(S,k)),y.add(S)}if(0===e&&o&&!f)if(g)f={fragment:null,effect:Rc((()=>o(a)))};else{var T=document.createDocumentFragment(),I=sc();T.append(I),f={fragment:T,effect:Rc((()=>o(I)))}}if(As&&e>0&&Rs(zs()),!g)if(b){for(const[e,t]of s)y.has(e)||_.skipped_effects.add(t.e);_.oncommit(m),_.ondiscard((()=>{}))}else m();d&&Cs(!0),yu(p)})),_={effect:y,flags:t,items:s,first:l};g=!1,As&&(a=Ps)}function Ml(e,t,r,n,i,o,a,s){var l=Sl,c=!!(1&a),u=c?!(16&a)?Hl(r,!1,!1):Ul(r):r,d=2&a?Ul(i):i;var h={i:d,v:u,k:n,a:null,e:null,o:!1,prev:t,next:null};Sl=h;try{if(null===e)document.createDocumentFragment().append(e=sc());return h.e=Rc((()=>o(e,u,d,s))),null!==t&&(t.next=h),h}finally{Sl=l}}function El(e,t,r){for(var n=e.next?e.next.e.nodes_start:r,i=t?t.e.no
29des_start:r,o=e.e.nodes_start;null!==o&&o!==n;){var a=cc(o);i.before(o),o=a}}function Pl(e,t,r){null===t?(e.first=r,e.effect.first=r&&r.e):(t.e.next&&(t.e.next.prev=null),t.next=r,t.e.next=r&&r.e),null!==r&&(r.e.prev&&(r.e.prev.next=null),r.prev=t,r.e.prev=t&&t.e)}function Al(e,t,r,n){const i=Xs()?Ol:zl;if(0!==r.length||0!==e.length){var o=ol,a=Jc,s=Cl();e.length>0?Promise.all(e).then((()=>{s();try{return l()}finally{o?.deactivate(),Rl()}})):l()}else n(t.map(i));function l(){Promise.all(r.map((e=>function(e){let t=Jc;null===t&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var r=t.b,n=void 0,i=Ul(Ms),o=!Yc,a=new Map;(function(e){wc(4718592,e,!0)})((()=>{var t=es();n=t.promise;try{Promise.resolve(e()).then(t.resolve,t.reject).then((()=>{s===ol&&s.committed&&s.deactivate(),Rl()}))}catch(e){t.reject(e),Rl()}var s=ol;if(o){var l=!r.is_pending();r.update_pending_count(1),s.increment(l),a.get(s)?.reject(ks),a.delete(s),a.set(s,t)}const c=(e,t=void 0)=>{if(Ll=null,s.activate(),t)t!==ks&&(i.f|=bs,Wl(i,t));else{i.f&bs&&(i.f^=bs),Wl(i,e);for(const[e,t]of a){if(a.delete(e),e===s)break;t.reject(ks)}Na}o&&(r.update_pending_count(-1),s.decrement(l))};t.promise.then(c,(e=>c(null,e||"unknown")))})),kc((()=>{for(const e of a.values())e.reject(ks)})),Na;return new Promise((e=>{function t(r){function o(){r===n?e(i):t(n)}r.then(o,o)}t(n)}))}(e)))).then((e=>{s();try{n([...t.map(i),...e])}catch(e){a.f&hs||nl(e,a)}o?.deactivate(),Rl()})).catch((e=>{nl(e,a)}))}}function Cl(){var e=Jc,t=Yc,r=$s,n=ol;return function(i=!0){Qc(e),Kc(t),Hs(r),i&&n?.activate()}}function Rl(){Qc(null),Kc(null),Hs(null)}let Ll=null;new Set;function Ol(e){var t=null!==Yc&&2&Yc.f?Yc:null;null!==Jc&&(Jc.f|=ys);const r={ctx:$s,deps:null,effects:null,equals:Ns,f:2050,fn:e,reactions:null,rv:0,v:Ms,wv:0,parent:t??Jc,ac:null};return r}function Dl(e){const t=Ol(e);return Vs||tu(t),t}function zl(e){const t=Ol(e);return t.equals=js,t}function Fl(e){var t=e.effects;if(null!==t){e.effects=null;for(var r=0;r<t.length;r+=1)Dc(t[r])}}function Nl(e){var t,r=Jc;Qc(function(e){for(var t=e.parent;null!==t;){if(!(2&t.f))return t.f&hs?null:t;t=t.parent}return null}(e));try{e.f&=-32769,Fl(e),t=hu(e)}finally{Qc(r)}return t}function Bl(e){var t=Nl(e);(e.equals(t)||(ol?.is_fork||(e.v=t),e.wv=cu()),Wc)||(null!==sl?(Sc()||ol?.is_fork)&&sl.set(e,t):Su(e,e.f&ss?ls:us))}let jl=new Set;const Vl=new Map;let Gl=!1;function Ul(e,t){var r={f:0,v:e,reactions:null,equals:Ns,rv:0,wv:0};return r}function $l(e,t){const r=Ul(e);return tu(r),r}function Hl(e,t=!1,r=!0){const n=Ul(e);return t||(n.equals=js),Gs&&r&&null!==$s&&null!==$s.l&&($s.l.s??=[]).push(n),n}function ql(e,t,r=!1){null!==Yc&&(!Xc||Yc.f&gs)&&Xs()&&4325394&Yc.f&&!eu?.includes(e)&&function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}();let n=r?Jl(t):t;return Wl(e,n)}function Wl(e,t){if(!e.equals(t)){var r=e.v;Wc?Vl.set(e,t):Vl.set(e,r),e.v=t;var n=hl.ensure();n.capture(e,r),2&e.f&&(e.f&cs&&Nl(e),Su(e,e.f&ss?ls:us)),e.wv=cu(),Kl(e,cs),Xs()&&null!==Jc&&Jc.f&ls&&!(96&Jc.f)&&(null===iu?function(e){iu=e}([e]):iu.push(e)),!n.is_fork&&jl.size>0&&!Gl&&Zl()}return t}function Zl(){Gl=!1;var e=Hc;qc(!0);const t=Array.from(jl);try{for(const e of t)e.f&ls&&Su(e,us),uu(e)&&gu(e)}finally{qc(e)}jl.clear()}function Yl(e,t=1){var r=yu(e),n=1===t?r++:r--;return ql(e,r),n}function Xl(e){ql(e,e.v+1)}function Kl(e,t){var r=e.reactions;if(null!==r)for(var n=Xs(),i=r.length,o=0;o<i;o++){var a=r[o],s=a.f;if(n||a!==Jc){Na;var l=!(s&cs);if(l&&Su(a,t),2&s){var c=a;sl?.delete(c),s&_s||(s&ss&&(a.f|=_s),Kl(c,us))}else l&&(s&ns&&null!==ml&&ml.add(a),bl(a))}}}function Jl(e){if("object"!=typeof e||null===e||xs in e)return e;const t=Za(e);if(t!==qa&&t!==Wa)return e;var r=new Map,n=Ba(e),i=$l(0),o=su,a=e=>{if(su===o)return e();var t=Yc,r=su;Kc(null),lu(o);var n=e();return Kc(t),lu(r),n};n&&r.set("length",$l(e.length));return new Proxy(e,{defineProperty(e,t,n){"value"in n&&!1!==n.configurable&&!1!==n.enumerable&&!1!==n.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var i=r.get(t);return void 0===i?i=a((()=>{var e=$l(n.value);return r.set(t,e),e})):ql(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(void 0===n){if(t in e){const e=a((()=>$l(Ms)));r.set(t,e),Xl(i)}}else ql(n,Ms),Xl(i);return!0},get(t,n,i){if(n===xs)return e;var o=r.get(n),s=n in t;if(void 0!==o||s&&!$a(t,n)?.writable||(o=a((()=>{var e=$l(Jl(s?t[n]:Ms));return e})),r.set(n,o)),void 0!==o){var l=yu(o);return l===Ms?void 0:l}return Reflect.get(t,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&"value"in n){var i=r.get(t);i&&(n.value=yu(i))}else if(void 0===n){var o=r.get(t),a=o?.v;if(void 0!==o&&a!==Ms)return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===xs)return!0;var n=r.get(t),i=void 0!==n&&n.v!==Ms||Reflect.has(e,t);if((void 0!==n||null!==Jc&&(!i||$a(e,t)?.writable))&&(void 0===n&&(n=a((()=>{var r=$l(i?Jl(e[t]):Ms);return r})),r.set(t,n)),yu(n)===Ms))return!1;return i},set(e,t,o,s){var l=r.get(t),c=t in e;if(n&&"length"===t)for(var u=o;u<l.v;u+=1){var d=r.get(u+"");void 0!==d?ql(d,Ms):u in e&&(d=a((()=>$l(Ms))),r.set(u+"",d))}void 0===l?c&&!$a(e,t)?.writable||(ql(l=a((()=>$l(void 0))),Jl(o)),r.set(t,l)):(c=l.v!==Ms,ql(l,a((()=>Jl(o)))));var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,o),!c){if(n&&"string"==typeof t){var f=r.get("length"),p=Number(t);Number.isInteger(p)&&p>=f.v&&ql(f,p+1)}Xl(i)}return!0},ownKeys(e){yu(i);var t=Reflect.ownKeys(e).filter((e=>{var t=r.get(e);return void 0===t||t.v!==Ms}));for(var[n,o]of r)o.v===Ms||n in e||t.push(n);return t},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function Ql(e){try{if(null!==e&&"object"==typeof e&&xs in e)return e[xs]}catch{}return e}function ec(e,t){return Object.is(Ql(e),Ql(t))}
29new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);var tc,rc,nc,ic,oc;function ac(){if(void 0===tc){tc=window,rc=document,nc=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;ic=$a(t,"firstChild").get,oc=$a(t,"nextSibling").get,Ya(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Ya(r)&&(r.__t=void 0)}}function sc(e=""){return document.createTextNode(e)}function lc(e){return ic.call(e)}function cc(e){return oc.call(e)}function uc(e,t){if(!As)return lc(e);var r=lc(Ps);if(null===r)r=Ps.appendChild(sc());else if(t&&3!==r.nodeType){var n=sc();return r?.before(n),Rs(n),n}return Rs(r),r}function dc(e,t=!1){if(!As){var r=lc(e);return r instanceof Comment&&""===r.data?cc(r):r}if(t&&3!==Ps?.nodeType){var n=sc();return Ps?.before(n),Rs(n),n}return Ps}function hc(e,t=1,r=!1){let n=As?Ps:e;for(var i;t--;)i=n,n=cc(n);if(!As)return n;if(r&&3!==n?.nodeType){var o=sc();return null===n?i?.after(o):n.before(o),Rs(o),o}return Rs(n),n}function fc(e){e.textContent=""}function pc(){return!!Vs&&(null===ml&&!!(Jc.f&fs))}function gc(e,t){if(t){const t=document.body;e.autofocus=!0,el((()=>{document.activeElement===t&&e.focus()}))}}function mc(e){As&&null!==lc(e)&&fc(e)}let yc=!1;function _c(){yc||(yc=!0,document.addEventListener("reset",(e=>{Promise.resolve().then((()=>
29{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()}))}),{capture:!0}))}function vc(e){var t=Yc,r=Jc;Kc(null),Qc(null);try{return e()}finally{Kc(t),Qc(r)}}function bc(e,t,r,n=r){e.addEventListener(t,(()=>vc(r)));const i=e.__on_r;e.__on_r=i?()=>{i(),n(!0)}:()=>n(!0),_c()}function xc(e){null===Jc&&(null===Yc&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),Wc&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function wc(e,t,r){var n=Jc;null!==n&&n.f&ds&&(e|=ds);var i={ctx:$s,deps:null,nodes_start:null,nodes_end:null,f:e|cs|ss,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{gu(i),i.f|=fs}catch(o){throw Dc(i),o}else null!==t&&bl(i);var o=i;if(!r||null!==o.deps||null!==o.teardown||null!==o.nodes_start||o.first!==o.last||o.f&ys||(o=o.first,e&ns&&e&ps&&null!==o&&(o.f|=ps)),null!==o&&(o.parent=n,null!==n&&function(e,t){var r=t.last;null===r?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}(o,n),null!==Yc&&2&Yc.f&&!(e&os))){var a=Yc;(a.effects??=[]).push(o)}return i}function Sc(){return null!==Yc&&!Xc}function kc(e){const t=wc(8,null,!1);return Su(t,ls),t.teardown=e,t}function Tc(e){xc();var t=Jc.f;if(!!(Yc||!(t&is)||t&fs))return Ic(e);var r=$s;(r.e??=[]).push(e)}function Ic(e){return wc(1048580,e,!1)}function Mc(e){return wc(4,e,!1)}function Ec(e,t=0){return wc(8|t,e,!0)}function Pc(e,t=[],r=[],n=[]){Al(n,t,r,(t=>{wc(8,(()=>e(...t.map(yu))),!0)}))}function Ac(e,t=0){var r=wc(ns|t,e,!0);return r}function Cc(e,t=0){var r=wc(rs|t,e,!0);return r}function Rc(e){return wc(524320,e,!0)}function Lc(e){var t=e.teardown;
29if(null!==t){const e=Wc,r=Yc;Zc(!0),Kc(null);try{t.call(null)}finally{Zc(e),Kc(r)}}}function Oc(e,t=!1){var r=e.first;for(e.first=e.last=null;null!==r;){const e=r.ac;null!==e&&vc((()=>{e.abort(ks)}));var n=r.next;r.f&os?r.parent=null:Dc(r,t),r=n}}function Dc(e,t=!0){var r=!1;(t||e.f&ms)&&null!==e.nodes_start&&null!==e.nodes_end&&(zc(e.nodes_start,e.nodes_end),r=!0),Oc(e,t&&!r),pu(e,0),Su(e,hs);var n=e.transitions;if(null!==n)for(const e of n)e.stop();Lc(e);var i=e.parent;null!==i&&null!==i.first&&Fc(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function zc(e,t){for(;null!==e;){var r=e===t?null:cc(e);e.remove(),e=r}}function Fc(e){var t=e.parent,r=e.prev,n=e.next;null!==r&&(r.next=n),null!==n&&(n.prev=r),null!==t&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Nc(e,t,r=!0){var n=[];jc(e,n,!0),Bc(n,(()=>{r&&Dc(e),t&&t()}))}function Bc(e,t){var r=e.length;if(r>0){var n=()=>--r||t();for(var i of e)i.out(n)}else t()}function jc(e,t,r){if(!(e.f&ds)){if(e.f^=ds,null!==e.transitions)for(const n of e.transitions)(n.is_global||r)&&t.push(n);for(var n=e.first;null!==n;){var i=n.next;jc(n,t,!!(!!(n.f&ps)||!!(n.f&is)&&!!(e.f&ns))&&r),n=i}}}function Vc(e){Gc(e,!0)}function Gc(e,t){if(e.f&ds){e.f^=ds,e.f&ls||(Su(e,cs),bl(e));for(var r=e.first;null!==r;){var n=r.next;Gc(r,!!(!!(r.f&ps)||!!(r.f&is))&&t),r=n}if(null!==e.transitions)for(const r of e.transitions)(r.is_global||t)&&r.in()}}function Uc(e,t){for(var r=e.nodes_start,n=e.nodes_end;null!==r;){var i=r===n?null:cc(r);t.append(r),r=i}}let $c=null;let Hc=!1;function qc(e){Hc=e}let Wc=!1;function Zc(e){Wc=e}let Yc=null,Xc=!1;function Kc(e){Yc=e}let Jc=null;function Qc(e){Jc=e}let eu=null;function tu(e){null!==Yc&&(!Vs||2&Yc.f)&&(null===eu?eu=[e]:eu.push(e))}let ru=null,nu=0,iu=null;let ou=1,au=0,su=au;function lu(e){su=e}function cu(){return++ou}function uu(e){var t=e.f;if(t&cs)return!0;if(2&t&&(e.f&=-32769),t&us){var r=e.deps;if(null!==r)for(var n=r.length,i=0;i<n;i++){var o=r[i];if(uu(o)&&Bl(o),o.wv>e.wv)return!0}t&ss&&null===sl&&Su(e,ls)}return!1}function du(e,t,r=!0){var n=e.reactions;if(null!==n&&(Vs||!eu?.includes(e)))for(var i=0;i<n.length;i++){var o=n[i];2&o.f?du(o,t,!1):t===o&&(r?Su(o,cs):o.f&ls&&Su(o,us),bl(o))}}function hu(e){var t=ru,r=nu,n=iu,i=Yc,o=eu,a=$s,s=Xc,l=su,c=e.f;ru=null,nu=0,iu=null,Yc=96&c?null:e,eu=null,Hs(e.ctx),Xc=!1,su=++au,null!==e.ac&&(vc((()=>{e.ac.abort(ks)})),e.ac=null);try{e.f|=vs;var u=(0,e.fn)(),d=e.deps;if(null!==ru){var h;if(pu(e,nu),null!==d&&nu>0)for(d.length=nu+ru.length,h=0;h<ru.length;h++)d[nu+h]=ru[h];else e.deps=d=ru;if(Hc&&Sc()&&e.f&ss)for(h=nu;h<d.length;h++)(d[h].reactions??=[]).push(e)}else null!==d&&nu<d.length&&(pu(e,nu),d.length=nu);if(Xs()&&null!==iu&&!Xc&&null!==d&&!(6146&e.f))for(h=0;h<iu.length;h++)du(iu[h],e);return null!==i&&i!==e&&(au++,null!==iu&&(null===n?n=iu:n.push(...iu))),e.f&bs&&(e.f^=bs),u}catch(e){return rl(e)}finally{e.f^=vs,ru=t,nu=r,iu=n,Yc=i,eu=o,Hs(a),Xc=s,su=l}}function fu(e,t){let r=t.reactions;if(null!==r){var n=ja.call(r,e);if(-1!==n){var i=r.length-1;0===i?r=t.reactions=null:(r[n]=r[i],r.pop())}}null===r&&2&t.f&&(null===ru||!ru.includes(t))&&(Su(t,us),t.f&ss&&(t.f^=ss,t.f&=-32769),Fl(t),pu(t,0))}function pu(e,t){var r=e.deps;if(null!==r)for(var n=t;n<r.length;n++)fu(e,r[n])}function gu(e){var t=e.f;if(!(t&hs)){Su(e,ls);var r=Jc,n=Hc;Jc=e,Hc=!0;try{16777232&t?function(e){for(var t=e.first;null!==t;){var r=t.next;t.f&is||Dc(t),t=r}}(e):Oc(e),Lc(e);var i=hu(e);e.teardown="function"==typeof i?i:null,e.wv=ou}finally{Hc=n,Jc=r}}}async function mu(){if(Vs)return new Promise((e=>{requestAnimationFrame((()=>e())),setTimeout((()=>e()))}));await Promise.resolve(),fl()}function yu(e){var t=!!(2&e.f);if(($c?.add(e),null!==Yc&&!Xc)&&(!(null!==Jc&&!!(Jc.f&hs))&&!eu?.includes(e))){var r=Yc.deps;if(Yc.f&vs)e.rv<au&&(e.rv=au,null===ru&&null!==r&&r[nu]===e?nu++:null===ru?ru=[e]:ru.includes(e)||ru.push(e));else{(Yc.deps??=[]).push(e);var n=e.reactions;null===n?e.reactions=[Yc]:n.includes(Yc)||n.push(Yc)}}if(Wc){if(Vl.has(e))return Vl.get(e);if(t){var i=e,o=i.v;return(i.f&ls||null===i.reactions)&&!vu(i)||(o=Nl(i)),Vl.set(i,o),o}}else t&&(!sl?.has(e)||ol?.is_fork&&!Sc())&&(uu(i=e)&&Bl(i),!Hc||!Sc()||i.f&ss||_u(i));if(sl?.has(e))return sl.get(e);if(e.f&bs)throw e.v;return e.v}function _u(e){if(null!==e.deps){e.f^=ss;for(const t of e.deps)(t.reactions??=[]).push(e),2&t.f&&!(t.f&ss)&&_u(t)}}function vu(e){if(e.v===Ms)return!0;
29if(null===e.deps)return!1;for(const t of e.deps){if(Vl.has(t))return!0;if(2&t.f&&vu(t))return!0}return!1}function bu(e){return e&&yu(e)}function xu(e){var t=Xc;try{return Xc=!0,e()}finally{Xc=t}}const wu=-7169;function Su(e,t){e.f=e.f&wu|t}function ku(e){if("object"==typeof e&&e&&!(e instanceof EventTarget))if(xs in e)Tu(e);else if(!Array.isArray(e))for(let t in e){const r=e[t];"object"==typeof r&&r&&xs in r&&Tu(r)}}function Tu(e,t=new Set){if(!("object"!=typeof e||null===e||e instanceof EventTarget||t.has(e))){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{Tu(e[r],t)}catch(e){}const r=Za(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const t=Ha(r);for(let r in t){const n=t[r].get;if(n)try{n.call(e)}catch(e){}}}}}function Iu(e){return e.endsWith("capture")&&"gotpointercapture"!==e&&"lostpointercapture"!==e}const Mu=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Eu(e){return Mu.includes(e)}const Pu=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];const Au={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Cu(e){return e=e.toLowerCase(),Au[e]??e}const Ru=["touchstart","touchmove"];const Lu=["$state","$state.raw","$derived","$derived.by"];const Ou=["textarea","script","style","title"];new Map;const Du=new Set,zu=new Set;function Fu(e,t,r,n={}){function i(e){if(n.capture||Vu.call(t,e),!e.cancelBubble)return vc((()=>r?.call(this,e)))}return e.startsWith("pointer")||e.startsWith("touch")||"wheel"===e?el((()=>{t.addEventListener(e,i,n)})):t.addEventListener(e,i,n),i}function Nu(e,t,r,n,i){var o={capture:n,passive:i},a=Fu(e,t,r,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&kc((()=>{t.removeEventListener(e,a,o)}))}function Bu(e){for(var t=0;t<e.length;t++)Du.add(e[t]);for(var r of zu)r(e)}let ju=null;function Vu(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],o=i[0]||e.target;ju=e;var a=0,s=ju===e&&e.__root;if(s){var l=i.indexOf(s);if(-1!==l&&(t===document||t===window))return void(e.__root=t);var c=i.indexOf(t);if(-1===c)return;l<=c&&(a=l)}if((o=i[a]||e.target)!==t){Ua(e,"currentTarget",{configurable:!0,get:()=>o||r});var u=Yc,d=Jc;Kc(null),Qc(null);try{for(var h,f=[];null!==o;){var p=o.assignedSlot||o.parentNode||o.host||null;try{var g=o["__"+n];null==g||o.disabled&&e.target!==o||g.call(o,e)}catch(e){h?f.push(e):h=e}if(e.cancelBubble||p===t||null===p)break;o=p}if(h){for(let e of f)queueMicrotask((()=>{throw e}));throw h}}finally{e.__root=t,delete e.currentTarget,Kc(u),Qc(d)}}}function Gu(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","\x3c!----\x3e"),t.content}function Uu(e,t){var r=Jc;null===r.nodes_start&&(r.nodes_start=e,r.nodes_end=t)}function $u(e,t){var r,n=!!(1&t),i=!!(2&t),o=!e.startsWith("<!>");return()=>{if(As)return Uu(Ps,null),Ps;void 0===r&&(r=Gu(o?e:"<!>"+e),n||(r=lc(r)));var t=i||nc?document.importNode(r,!0):r.cloneNode(!0);n?Uu(lc(t),t.lastChild):Uu(t,t);return t}}function Hu(e,t,r="svg"){var n,i=!e.startsWith("<!>"),o=!!(1&t),a=`<${r}>${i?e:"<!>"+e}</${r}>`;return()=>{if(As)return Uu(Ps,null),Ps;if(!n){var e=lc(Gu(a));if(o)for(n=document.createDocumentFragment();lc(e);)n.appendChild(lc(e));else n=lc(e)}var t=n.cloneNode(!0);o?Uu(lc(t),t.lastChild):Uu(t,t);return t}}function qu(e,t){return Hu(e,t,"svg")}function Wu(e=""){if(!As){var t=sc(e+"");return Uu(t,t),t}var r=Ps;return 3!==r.nodeType&&(r.before(r=sc()),Rs(r)),Uu(r,r),r}function Zu(){if(As)return Uu(Ps,null),Ps;var e=document.createDocumentFragment(),t=document.createComment(""),r=sc();return e.append(t,r),Uu(t,r),e}function Yu(e,t){if(As){var r=Jc;return r.f&fs&&null!==r.nodes_end||(r.nodes_end=Ps),void Ls()}null!==e&&e.before(t)}let Xu=!0;function Ku(e){Xu=e}function Ju(e,t){var r=null==t?"":"object"==typeof t?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function Qu(e,t){return rd(e,t)}function ed(e,t){ac(),t.intro=t.intro??!1;const r=t.target,n=As,i=Ps;try{for(var o=lc(r);o&&(8!==o.nodeType||"["!==o.data);)o=cc(o);if(!o)throw Is;Cs(!0),Rs(o);const n=rd(e,{...t,anchor:o});return Cs(!1),n}catch(n){if(n instanceof Error&&n.message.split("\n").some((e=>e.startsWith("https://svelte.dev/e/"))))throw n;return n!==Is&&console.warn("Failed to hydrate: ",n),!1===t.recover&&function(){throw new Error("https://svelte.dev/e/hydration_failed")}(),ac(),fc(r),Cs(!1),Qu(e,t)}finally{Cs(n),Rs(i)}}const td=new Map;function rd(e,{target:t,anchor:r,props:n={},events:i,context:o,intro:a=!0}){ac();var s=new Set,l=e=>{for(var r=0;r<e.length;r++){var n=e[r];if(!s.has(n)){s.add(n);var i=(a=n,Ru.includes(a));t.addEventListener(n,Vu,{passive:i});var o=td.get(n);void 0===o?(document.addEventListener(n,Vu,{passive:i}),td.set(n,1)):td.set(n,o+1)}}var a};l(Va(Du)),zu.add(l);var c=void 0,u=function(e){hl.ensure();const t=wc(524352,e,!0);return(e={})=>new Promise((r=>{e.outro?Nc(t,(()=>{Dc(t),r(void 0)})):(Dc(t),r(void 0))}))}((()=>{var u=r??t.appendChild(sc());return function(e,t,r){new wl(e,t,r)}(u,{pending:()=>{}},(t=>{o&&(Zs({}),$s.c=o);if(i&&(n.$$events=i),As&&Uu(t,null),Xu=a,c=e(t,n)||{},Xu=!0,As&&(Jc.nodes_end=Ps,null===Ps||8!==Ps.nodeType||"]"!==Ps.data))throw Es(),Is;o&&Ys()}
29)),()=>{for(var e of s){t.removeEventListener(e,Vu);var n=td.get(e);0==--n?(document.removeEventListener(e,Vu),td.delete(e)):td.set(e,n)}zu.delete(l),u!==r&&u.parentNode?.removeChild(u)}}));return nd.set(c,u),c}let nd=new WeakMap;function id(e,t){const r=nd.get(e);return r?(nd.delete(e),r(t)):Promise.resolve()}class od{anchor;#L=new Map;#O=new Map;#D=new Map;#z=new Set;#F=!0;constructor(e,t=!0){this.anchor=e,this.#F=t}#d=()=>{var e=ol;if(this.#L.has(e)){var t=this.#L.get(e),r=this.#O.get(t);if(r)Vc(r),this.#z.delete(t);else{var n=this.#D.get(t);n&&(this.#O.set(t,n.effect),this.#D.delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),r=n.effect)}for(const[t,r]of this.#L){if(this.#L.delete(t),t===e)break;const n=this.#D.get(r);n&&(Dc(n.effect),this.#D.delete(r))}for(const[e,n]of this.#O){if(e===t||this.#z.has(e))continue;const i=()=>{if(Array.from(this.#L.values()).includes(e)){var t=document.createDocumentFragment();Uc(n,t),t.append(sc()),this.#D.set(e,{effect:n,fragment:t})}else Dc(n);this.#z.delete(e),this.#O.delete(e)};this.#F||!r?(this.#z.add(e),Nc(n,i,!1)):i()}}};#N=e=>{this.#L.delete(e);const t=Array.from(this.#L.values());for(const[e,r]of this.#D)t.includes(e)||(Dc(r.effect),this.#D.delete(e))};ensure(e,t){var r=ol,n=pc();if(t&&!this.#O.has(e)&&!this.#D.has(e))if(n){var i=document.createDocumentFragment(),o=sc();i.append(o),this.#D.set(e,{effect:Rc((()=>t(o))),fragment:i})}else this.#O.set(e,Rc((()=>t(this.anchor))));if(this.#L.set(r,e),n){for(const[t,n]of this.#O)t===e?r.skipped_effects.delete(n):r.skipped_effects.add(n);for(const[t,n]of this.#D)t===e?r.skipped_effects.delete(n.effect):r.skipped_effects.add(n.effect);r.oncommit(this.#d),r.ondiscard(this.#N)}else As&&(this.anchor=Ps),this.#d()}}function ad(e,t,r=!1){As&&Ls();var n=new od(e);function i(t,r){if(As){if(t===(Fs(e)===Ts)){var i=zs();return Rs(i),n.anchor=i,Cs(!1),n.ensure(t,r),void Cs(!0)}}n.ensure(t,r)}Ac((()=>{var e=!1;t(((t,r=!0)=>{e=!0,i(r,t)})),e||i(!1,null)}),r?ps:0)}function sd(e,t,r){As&&Ls();var n=new od(e),i=!Xs();Ac((()=>{var e=t();i&&null!==e&&"object"==typeof e&&(e={}),n.ensure(e,r)}))}function ld(e,t,r,n,i){As&&Ls();var o=t.$$slots?.[r],a=!1;!0===o&&(o=t["default"===r?"children":r],a=!0),void 0===o?null!==i&&i(e):o(e,a?()=>n:n)}function cd(e){const t={};e.children&&(t.default=!0);for(const r in e.$$slots)t[r]=!0;return t}function ud(e,t,...r){var n=new od(e);Ac((()=>{const e=t()??null;n.ensure(e,e&&(t=>e(t,...r)))}),ps)}function dd(e,t,r){As&&Ls();var n=new od(e);Ac((()=>{var e=t()??null;n.ensure(e,e&&(t=>r(t,e)))}),ps)}function hd(e,t,r,n,i,o){let a=As;As&&Ls();var s=null;As&&1===Ps.nodeType&&(s=Ps,Ls());var l=As?Ps:e,c=Sl,u=new od(l,!1);Ac((()=>{const e=t()||null;var o=i?i():r||"svg"===e?"http://www.w3.org/2000/svg":null;return null===e?(u.ensure(null,null),void Ku(!0)):(u.ensure(e,(t=>{var r,i=Sl;if(kl(c),e){if(Uu(s=As?s:o?document.createElementNS(o,e):document.createElement(e),s),n){As&&(r=e,Ou.includes(r))&&s.append(document.createComment(""));var a=As?lc(s):s.appendChild(sc());As&&(null===a?Cs(!1):Rs(a)),n(s,a)}Jc.nodes_end=s,t.before(s)}kl(i),As&&Rs(t)})),Ku(!0),()=>{e&&Ku(!1)})}),ps),kc((()=>{Ku(!0)})),a&&(Cs(!0),Rs(l))}function fd(e,t,r){Mc((()=>{var n=xu((()=>t(e,r?.())||{}));if(r&&n?.update){var i=!1,o={};Ec((()=>{var e=r();ku(e),i&&Bs(o,e)&&(o=e,n.update(e))})),i=!0}if(n?.destroy)return()=>n.destroy()}))}function pd(e,t){var r,n=void 0;Cc((()=>{n!==(n=t())&&(r&&(Dc(r),r=null),n&&(r=Rc((()=>{Mc((()=>n(e)))}))))}))}function gd(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=gd(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function md(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=gd(e))&&(n&&(n+=" "),n+=t);return n}const yd=md;new Map([[!0,"yes"],[!1,"no"]]);function _d(e){return"object"==typeof e?md(e):e??""}const vd=[..." \t\n\r\f \v\ufeff"];function bd(e,t=!1){var r=t?" !important;":";",n="";for(var i in e){var o=e[i];null!=o&&""!==o&&(n+=" "+i+": "+o+r)}return n}function xd(e){return"-"!==e[0]||"-"!==e[1]?e.toLowerCase():e}function wd(e,t,r,n,i,o){var a=e.__className;if(As||a!==r||void 0===a){var s=function(e,t,r){var n=null==e?"":""+e;if(t&&(n=n?n+" "+t:t),r)for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var o=i.length,a=0;(a=n.indexOf(i,a))>=0;){var s=a+o;0!==a&&!vd.includes(n[a-1])||s!==n.length&&!vd.includes(n[s])?a=s:n=(0===a?"":n.substring(0,a))+n.substring(s+1)}return""===n?null:n}(r,n,o);As&&s===e.getAttribute("class")||(null==s?e.removeAttribute("class"):t?e.className=s:e.setAttribute("class",s)),e.__className=r}else if(o&&i!==o)for(var l in o){var c=!!o[l];
29null!=i&&c===!!i[l]||e.classList.toggle(l,c)}return o}function Sd(e,t={},r,n){for(var i in r){var o=r[i];t[i]!==o&&(null==r[i]?e.style.removeProperty(i):e.style.setProperty(i,o,n))}}function kd(e,t,r,n){var i=e.__style;if(As||i!==t){var o=function(e,t){if(t){var r,n,i="";if(Array.isArray(t)?(r=t[0],n=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,a=0,s=!1,l=[];r&&l.push(...Object.keys(r).map(xd)),n&&l.push(...Object.keys(n).map(xd));var c=0,u=-1;const t=e.length;for(var d=0;d<t;d++){var h=e[d];if(s?"/"===h&&"*"===e[d-1]&&(s=!1):o?o===h&&(o=!1):"/"===h&&"*"===e[d+1]?s=!0:'"'===h||"'"===h?o=h:"("===h?a++:")"===h&&a--,!s&&!1===o&&0===a)if(":"===h&&-1===u)u=d;else if(";"===h||d===t-1){if(-1!==u){var f=xd(e.substring(c,u).trim());l.includes(f)||(";"!==h&&d++,i+=" "+e.substring(c,d).trim()+";")}c=d+1,u=-1}}}return r&&(i+=bd(r)),n&&(i+=bd(n,!0)),""===(i=i.trim())?null:i}return null==e?null:String(e)}(t,n);As&&o===e.getAttribute("style")||(null==o?e.removeAttribute("style"):e.style.cssText=o),e.__style=t}else n&&(Array.isArray(n)?(Sd(e,r?.[0],n[0]),Sd(e,r?.[1],n[1],"important")):Sd(e,r,n));return n}function Td(e,t,r=!1){if(e.multiple){if(null==t)return;if(!Ba(t))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var n of e.options)n.selected=t.includes(Ed(n))}else{for(n of e.options){if(ec(Ed(n),t))return void(n.selected=!0)}r&&void 0===t||(e.selectedIndex=-1)}}function Id(e){var t=new MutationObserver((()=>{Td(e,e.__value)}));t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),kc((()=>{t.disconnect()}))}function Md(e,t,r=t){var n=new WeakSet,i=!0;bc(e,"change",(t=>{var i,o=t?"[selected]":":checked";if(e.multiple)i=[].map.call(e.querySelectorAll(o),Ed);else{var a=e.querySelector(o)??e.querySelector("option:not([disabled])");i=a&&Ed(a)}r(i),null!==ol&&n.add(ol)})),Mc((()=>{var o=t();if(e===document.activeElement){var a=al??ol;if(n.has(a))return}if(Td(e,o,i),i&&void 0===o){var s=e.querySelector(":checked");null!==s&&(o=Ed(s),r(o))}e.__value=o,i=!1})),Id(e)}function Ed(e){return"__value"in e?e.__value:e.value}const Pd=Symbol("class"),Ad=Symbol("style"),Cd=Symbol("is custom element"),Rd=Symbol("is html");function Ld(e){if(As){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;Fd(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var n=e.checked;Fd(e,"checked",null),e.checked=n}}};e.__on_r=r,el(r),_c()}}function Od(e,t){var r=Bd(e);r.value!==(r.value=t??void 0)&&(e.value!==t||0===t&&"PROGRESS"===e.nodeName)&&(e.value=t??"")}function Dd(e,t){var r=Bd(e);r.checked!==(r.checked=t??void 0)&&(e.checked=t)}function zd(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Fd(e,t,r,n){var i=Bd(e);As&&(i[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&"LINK"===e.nodeName)||i[t]!==(i[t]=r)&&("loading"===t&&(e[Ss]=r),null==r?e.removeAttribute(t):"string"!=typeof r&&Vd(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Nd(e,t,r=[],n=[],i=[],o,a=!1,s=!1){Al(i,r,n,(r=>{var n=void 0,i={},l="SELECT"===e.nodeName,c=!1;if(Cc((()=>{var u=t(...r.map(yu)),d=function(e,t,r,n,i=!1){if(As&&i&&"INPUT"===e.tagName){var o=e;("checkbox"===o.type?"defaultChecked":"defaultValue")in r||Ld(o)}var a=Bd(e),s=a[Cd],l=!a[Rd];let c=As&&s;c&&Cs(!1);var u=t||{},d="OPTION"===e.tagName;for(var h in t)h in r||(r[h]=null);r.class?r.class=_d(r.class):(n||r[Pd])&&(r.class=null),r[Ad]&&(r.style??=null);var f=Vd(e);for(const v in r){let b=r[v];if(d&&"value"===v&&null==b)e.value=e.__value="",u[v]=b;else if("class"!==v)if("style"!==v){var p=u[v];if(b!==p||void 0===b&&e.hasAttribute(v)){u[v]=b;var g=v[0]+v[1];if("$$"!==g)if("on"===g){const x={},w="$$"+v;let S=v.slice(2);var m=Eu(S);if(Iu(S)&&(S=S.slice(0,-7),x.capture=!0),!m&&p){if(null!=b)continue;e.removeEventListener(S,u[w],x),u[w]=null}if(null!=b)if(m)e[`__${S}`]=b,Bu([S]);else{function k(e){u[v].call(this,e)}u[w]=Fu(S,e,k,x)}else m&&(e[`__${S}`]=void 0)}else if("style"===v)Fd(e,v,b);else if("autofocus"===v)gc(e,Boolean(b));else if(s||"__value"!==v&&("value"!==v||null==b))if("selected"===v&&d)zd(e,b);else{var y=v;l||(y=Cu(y));var _="defaultValue"===y||"defaultChecked"===y;
29if(null!=b||s||_)_||f.includes(y)&&(s||"string"!=typeof b)?(e[y]=b,y in a&&(a[y]=Ms)):"function"!=typeof b&&Fd(e,y,b);else if(a[v]=null,"value"===y||"checked"===y){let T=e;const I=void 0===t;if("value"===y){let M=T.defaultValue;T.removeAttribute(y),T.defaultValue=M,T.value=T.__value=I?M:null}else{let E=T.defaultChecked;T.removeAttribute(y),T.defaultChecked=E,T.checked=!!I&&E}}else e.removeAttribute(v)}else e.value=e.__value=b}}else kd(e,b,t?.[Ad],r[Ad]),u[v]=b,u[Ad]=r[Ad];else wd(e,"http://www.w3.org/1999/xhtml"===e.namespaceURI,b,n,t?.[Pd],r[Pd]),u[v]=b,u[Pd]=r[Pd]}return c&&Cs(!0),u}(e,n,u,o,a,s);c&&l&&"value"in u&&Td(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||Dc(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var h=u[t];"@attach"!==t.description||n&&h===n[t]||(i[t]&&Dc(i[t]),i[t]=Rc((()=>pd(e,(()=>h))))),d[t]=h}n=d})),l){var u=e;Mc((()=>{Td(u,n.value,!0),Id(u)}))}c=!0}))}function Bd(e){return e.__attributes??={[Cd]:e.nodeName.includes("-"),[Rd]:"http://www.w3.org/1999/xhtml"===e.namespaceURI}}var jd=new Map;function Vd(e){var t,r=e.getAttribute("is")||e.nodeName,n=jd.get(r);if(n)return n;jd.set(r,n=[]);for(var i=e,o=Element.prototype;o!==i;){for(var a in t=Ha(i))t[a].set&&n.push(a);i=Za(i)}return n}const Gd=()=>performance.now(),Ud={tick:e=>requestAnimationFrame(e),now:()=>Gd(),tasks:new Set};function $d(){const e=Ud.now();Ud.tasks.forEach((t=>{t.c(e)||(Ud.tasks.delete(t),t.f())})),0!==Ud.tasks.size&&Ud.tick($d)}function Hd(e,t){vc((()=>{e.dispatchEvent(new CustomEvent(t))}))}function qd(e){if("float"===e)return"cssFloat";if("offset"===e)return"cssOffset";if(e.startsWith("--"))return e;const t=e.split("-");return 1===t.length?t[0]:t[0]+t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("")}function Wd(e){const t={},r=e.split(";");for(const e of r){const[r,n]=e.split(":");if(!r||void 0===n)break;t[qd(r.trim())]=n.trim()}return t}const Zd=e=>e;function Yd(e,t,r,n){var i,o,a,s=!!(1&e),l=!!(2&e),c=!!(4&e),u=s&&l?"both":s?"in":"out",d=t.inert,h=t.style.overflow;function f(){return vc((()=>i??=r()(t,n?.()??{},{direction:u})))}var p={is_global:c,in(){if(t.inert=d,!s)return a?.abort(),void a?.reset?.();l||o?.abort(),Hd(t,"introstart"),o=Xd(t,f(),a,1,(()=>{Hd(t,"introend"),o?.abort(),o=i=void 0,t.style.overflow=h}))},out(e){if(!l)return e?.(),void(i=void 0);t.inert=!0,Hd(t,"outrostart"),a=Xd(t,f(),o,0,(()=>{Hd(t,"outroend"),e?.()}))},stop:()=>{o?.abort(),a?.abort()}},g=Jc;if((g.transitions??=[]).push(p),s&&Xu){var m=c;if(!m){for(var y=g.parent;y&&y.f&ps;)for(;(y=y.parent)&&!(y.f&ns););m=!y||!!(y.f&fs)}m&&Mc((()=>{xu((()=>p.in()))}))}}function Xd(e,t,r,n,i){var o=1===n;if(Xa(t)){var a,s=!1;return el((()=>{if(!s){var l=t({direction:o?"in":"out"});a=Xd(e,l,r,n,i)}})),{abort:()=>{s=!0,a?.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(r?.deactivate(),!t?.duration)return i(),{abort:Ka,deactivate:Ka,reset:Ka,t:()=>n};const{delay:l=0,css:c,tick:u,easing:d=Zd}=t;var h=[];if(o&&void 0===r&&(u&&u(0,1),c)){var f=Wd(c(0,1));h.push(f,f)}var p=()=>1-n,g=e.animate(h,{duration:l,fill:"forwards"});return g.onfinish=()=>{g.cancel();var o=r?.t()??1-n;r?.abort();var a=n-o,s=t.duration*Math.abs(a),l=[];if(s>0){var h=!1;if(c)for(var f=Math.ceil(s/(1e3/60)),m=0;m<=f;m+=1){var y=o+a*d(m/f),_=Wd(c(y,1-y));l.push(_),h||="hidden"===_.overflow}h&&(e.style.overflow="hidden"),p=()=>{var e=g.currentTime;return o+a*d(e/s)},u&&function(e){let t;0===Ud.tasks.size&&Ud.tick($d),new Promise((r=>{Ud.tasks.add(t={c:e,f:r})}))}((()=>{if("running"!==g.playState)return!1;var e=p();return u(e,1-e),!0}))}(g=e.animate(l,{duration:s,fill:"forwards"})).onfinish=()=>{p=()=>n,u?.(n,1-n),i()}},{abort:()=>{g&&(g.cancel(),g.effect=null,g.onfinish=Ka)},deactivate:()=>{i=Ka},reset:()=>{0===n&&u?.(1,0)},t:()=>p()}}function Kd(e,t,r=t){var n=new WeakSet;bc(e,"input",(async i=>{var o=i?e.defaultValue:e.value;if(o=eh(e)?th(o):o,r(o),null!==ol&&n.add(ol),await mu(),o!==(o=t())){var a=e.selectionStart,s=e.selectionEnd,l=e.value.length;if(e.value=o??"",null!==s){var c=e.value.length;a===s&&s===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=a,e.selectionEnd=Math.min(s,c))}}})),(As&&e.defaultValue!==e.value||null==xu(t)&&e.value)&&(r(eh(e)?th(e.value):e.value),null!==ol&&n.add(ol)),Ec((()=>{var r=t();if(e===document.activeElement){var i=al??ol;if(n.has(i))return}eh(e)&&r===th(e.value)||("date"!==e.type||r||e.value)&&r!==e.value&&(e.value=r??"")}))}const Jd=new Set;function Qd(e,t,r){for(var n=new Set,i=0;i<e.length;i+=1)e[i].checked&&n.add(e[i].__value);return r||n.delete(t),Array.from(n)}function eh(e){var t=e.type;return"number"===t||"range"===t}function th(e){return""===e?null:+e}new WeakMap;function rh(e,t){return e===t||e?.[xs]===t}function nh(e={},t,r,n){return Mc((()=>{var i,o;return Ec((()=>{i=o,o=n?.()||[],xu((()=>{e!==r(...o)&&(t(e,...o),i&&rh(r(...i),e)&&t(null,...i))}))})),()=>{el((()=>{o&&rh(r(...o),e)&&t(null,...o)}))}})),e}function ih(e=!1){const t=$s,r=t.l.u;if(!r)return;let n=()=>ku(t.s);if(e){let e=0,r={};const i=Ol((()=>{let n=!1;const i=t.s;for(const e in i)i[e]!==r[e]&&(r[e]=i[e],n=!0);return n&&e++,e}));n=()=>yu(i)}var i;r.b.length&&(i=()=>{oh(t,n),Qa(r.b)},xc(),wc(1048584,i,!0)),Tc((()=>{const e=xu((()=>r.m.map(Ja)));return()=>{for(const t of e)"function"==typeof t&&t()}})),r.a.length&&Tc((()=>{oh(t,n),Qa(r.a)}))}function oh(e,t){if(e.l.s)for(const t of e.l.s)yu(t);t()}let ah=!1;Symbol();const sh={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set:(e,t)=>!1,getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t))return t in e.props?{enumerable:!0,configurable:!0,value:e.props[t]}:void 0},has:(e,t)=>!e.exclude.includes(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter((t=>!e.exclude.includes(t)))};function lh(e,t,r){return new Proxy({props:e,exclude:t},sh)}const ch={get(e,t){if(!e.exclude.includes(t))return yu(e.version),t in e.special?e.special[t]():e.props[t]}
29,set(e,t,r){if(!(t in e.special)){var n=Jc;try{Qc(e.parent_effect),e.special[t]=fh({get[t](){return e.props[t]}},t,4)}finally{Qc(n)}}return e.special[t](r),Yl(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t))return t in e.props?{enumerable:!0,configurable:!0,value:e.props[t]}:void 0},deleteProperty:(e,t)=>(e.exclude.includes(t)||(e.exclude.push(t),Yl(e.version)),!0),has:(e,t)=>!e.exclude.includes(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter((t=>!e.exclude.includes(t)))};function uh(e,t){return new Proxy({props:e,exclude:t,special:{},version:Ul(0),parent_effect:Jc},ch)}const dh={get(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(Xa(n)&&(n=n()),"object"==typeof n&&null!==n&&t in n)return n[t]}},set(e,t,r){let n=e.props.length;for(;n--;){let i=e.props[n];Xa(i)&&(i=i());const o=$a(i,t);if(o&&o.set)return o.set(r),!0}return!1},getOwnPropertyDescriptor(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(Xa(n)&&(n=n()),"object"==typeof n&&null!==n&&t in n){const e=$a(n,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===xs||t===ws)return!1;for(let r of e.props)if(Xa(r)&&(r=r()),null!=r&&t in r)return!0;return!1},ownKeys(e){const t=[];for(let r of e.props)if(Xa(r)&&(r=r()),r){for(const e in r)t.includes(e)||t.push(e);for(const e of Object.getOwnPropertySymbols(r))t.includes(e)||t.push(e)}return t}};function hh(...e){return new Proxy({props:e},dh)}function fh(e,t,r,n){var i,o,a=!Gs||!!(2&r),s=!!(8&r),l=!!(16&r),c=n,u=!0,d=()=>(u&&(u=!1,c=l?xu(n):n),c);
29if(s){var h=xs in e||ws in e;i=$a(e,t)?.set??(h&&t in e?r=>e[t]=r:void 0)}var f,p=!1;if(s?[o,p]=function(e){var t=ah;try{return ah=!1,[e(),ah]}finally{ah=t}}((()=>e[t])):o=e[t],void 0===o&&void 0!==n&&(o=d(),i&&(a&&function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),i(o))),f=a?()=>{var r=e[t];return void 0===r?d():(u=!0,r)}:()=>{var r=e[t];return void 0!==r&&(c=void 0),void 0===r?c:r},a&&!(4&r))return f;if(i){var g=e.$$legacy;return function(e,t){return arguments.length>0?(a&&t&&!g&&!p||i(t?f():e),e):f()}}var m=!1,y=(1&r?Ol:zl)((()=>(m=!1,f())));s&&yu(y);var _=Jc;return function(e,t){if(arguments.length>0){const r=t?yu(y):a&&s?Jl(e):e;return ql(y,r),m=!0,void 0!==c&&(c=r),e}return Wc&&m||_.f&hs?y.v:yu(y)}}class ph{#B;#j;constructor(e){var t=new Map,r=(e,r)=>{var n=Hl(r,!1,!1);return t.set(e,n),n};const n=new Proxy({...e.props||{},$$events:{}},{get:(e,n)=>yu(t.get(n)??r(n,Reflect.get(e,n))),has:(e,n)=>n===ws||(yu(t.get(n)??r(n,Reflect.get(e,n))),Reflect.has(e,n)),set:(e,n,i)=>(ql(t.get(n)??r(n,i),i),Reflect.set(e,n,i))});this.#j=(e.hydrate?ed:Qu)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:e.intro??!1,recover:e.recover}),Vs||e?.props?.$$host&&!1!==e.sync||fl(),this.#B=n.$$events;for(const e of Object.keys(this.#j))"$set"!==e&&"$destroy"!==e&&"$on"!==e&&Ua(this,e,{get(){return this.#j[e]},set(t){this.#j[e]=t},enumerable:!0});this.#j.$set=e=>{Object.assign(n,e)},this.#j.$destroy=()=>{id(this.#j)}}$set(e){this.#j.$set(e)}$on(e,t){this.#B[e]=this.#B[e]||[];const r=(...e)=>t.call(this,...e);return this.#B[e].push(r),()=>{this.#B[e]=this.#B[e].filter((e=>e!==r))}}$destroy(){this.#j.$destroy()}}let gh;function mh(e,t,r,n){const i=r[e]?.type;if(t="Boolean"===i&&"boolean"!=typeof t?null!=t:t,!n||!r[e])return t;if("toAttribute"===n)switch(i){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return null==t?null:t;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}function yh(e){null===$s&&Us(),Gs&&null!==$s.l?vh($s).m.push(e):Tc((()=>{const t=xu(e);if("function"==typeof t)return t}))}function _h(e){null===$s&&Us(),yh((()=>()=>xu(e)))}function vh(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}"function"==typeof HTMLElement&&(gh=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function t(e){return t=>{const r=document.createElement("slot");"default"!==e&&(r.name=e),Yu(t,r)}}const r={},n=function(e){const t={};return e.childNodes.forEach((e=>{t[e.slot||"default"]=!0})),t}(this);for(const i of this.$$s)i in n&&("default"!==i||this.$$d.children?r[i]=t(i):(this.$$d.children=t(i),r.default=!0));for(const o of this.attributes){const a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=mh(a,o.value,this.$$p_d,"toProp"))}for(const s in this.$$p_d)s in this.$$d||void 0===this[s]||(this.$$d[s]=this[s],delete this[s]);this.$$c=(e={component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}},new ph(e)),this.$$me=function(e){hl.ensure();const t=wc(524352,e,!0);return()=>{Dc(t)}}((()=>{Ec((()=>{this.$$r=!0;for(const e of Ga(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];const t=mh(e,this.$$d[e],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1}))}));for(const l in this.$$l)for(const c of this.$$l[l]){const u=this.$$c.$on(l,c);this.$$l_u.set(c,u)}this.$$l={}}var e}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=mh(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>
vendor: 5,046 bytes, line 29
29{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)}))}$$g_p(e){return Ga(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});var bh={basePath:"",csrfToken:"",satApiUrl:"",teamSlug:"",karl:{apiUrl:"https://karl.atla.ai",apiToken:"karlfarm-api"},atla:{apiToken:"",apiUrlSentinel2:"https://sentinel-2.atla.ai"},leaflet:{defaultLayerParams:{maxZoom:22,updateWhenIdle:!1,updateWhenZooming:!0}}};function xh(e){return xh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xh(e)}function wh(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */wh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==xh(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(xh(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEac
29h(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function Sh(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function kh(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Sh(o,n,i,a,s,"next",e)}function s(e){Sh(o,n,i,a,s,"throw",e)}a(void 0)}))}}"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5");var Th=[{id:"ndvi_custom",name:"NDVI (Custom)",expression:"(nir - red) / (nir + red)",rescale:"0,1",colormap:"rdylgn"},{id:"gndvi_custom",name:"GNDVI (Custom)",expression:"(nir - green) / (nir + green)",rescale:"0,1",colormap:'{"0": [255, 0, 0], "0.5": [255, 255, 0], "1": [0, 255, 0]}'},{id:"ndwi",name:"NDWI (Water Index)",expression:"(green - nir) / (green + nir)",rescale:"-0.5,0.5",colormap:"blues"}];function Ih(e,t){return Mh.apply(this,arguments)}function Mh(){return Mh=kh(wh().mark((function e(t,r){var n,i,o,a,s,l;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={url:"".concat(t,"?token=").concat(bh.atla.apiToken),expression:r.expression,asset_as_band:"true",rescale:r.rescale,reproject:"nearest",resampling:"nearest",token:bh.atla.apiToken},r.colormap&&(n.colormap_name=r.colormap),i=new URLSearchParams(n),o="https://sentinel-2.atla.ai/stactiler/WebMercatorQuad/tilejson.json?".concat(i.toString()),e.next=6,fetch(o);case 6:if((a=e.sent).ok){e.next=13;break}return e.next=10,a.text();case 10:throw s=e.sent,console.error("Custom expression API error (".concat(a.status,"):"),s),new Error("Failed to fetch custom expression tile URL: ".concat(a.status));case 13:return e.next=15,a.json();case 15:return l=e.sent,e.abrupt("return",l.tiles[0]);case 17:case"end":return e.stop()}}),e)}))),Mh.apply(this,arguments)}function Eh(){return(Eh=kh(wh().mark((function e(t,r,n){var i,o,a,s;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(new Date).toISOString().split("T")[0],o="".concat(bh.atla.apiUrlSentinel2,"/search?lat=").concat(t,"&lon=").concat(r,"&start_date=").concat("2024-01-01","&end_date=").concat(i,"&max_cloud_cover=").concat(n,"&token=").concat(bh.atla.apiToken),e.next=5,fetch(o);case 5:if((a=e.sent).ok){e.next=8;break}throw new Error("Network response was not ok");case 8:return e.next=10,a.json();case 10:return s=e.sent,e.abrupt("return",s.sort((function(e,t){return new Date(t.datetime).getTime()-new Date(e.datetime).getTime()})));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ph(){return(Ph=kh(wh().mark((function e(t,r,n){var i,o,a,s;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/environmental/api/satellite-statistics/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:"".concat(t,"?token=").concat(bh.atla.apiToken),expression:n,geojson:r,asset_as_band:!0})});case 3:if((i=e.sent).ok){e.next=7;break}return console.error("Statistics API error (".concat(i.status,")")),e.abrupt("return",null);case 7:return e.next=9,i.json();case 9:return o=e.sent,a=Object.keys(o.statistics)[0],s=o.statistics[a],e.abrupt("return",{min:s.min,max:s.max,mean:s.mean,count:s.count,sum:s.sum,std:s.std,median:s.median,histogram:s.histogram?{bins:s.histogram[0],counts:s.histogram[1]}:void 0});case 15:return e.prev=15,e.t0=e.catch(0),console.error("Failed to fetch field statistics:",e.t0),e.abrupt("return",null);case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))).apply(this,arguments)}var Ah=$u('<div class="fixed inset-0 bg-white/70 flex flex-col justify-center items-center z-[1000]"><div class="w-12 h-12 border-4 border-gray-200 border-t-blue-500 rounded-full animate-spin mb
29-4"></div> <div class="text-base text-gray-700">Loading data...</div></div>'),Ch=$u("<option>No dates available</option>"),Rh=$u("<option> </option>"),Lh=$u('<div class="space-y-7"><!> <div><label for="cloud-cover" class="block mb-1"><strong>Max cloud cover</strong></label> <div class="flex items-center gap-2"><input type="number" id="cloud-cover" min="0" max="100" class="w-16 px-2 py-1 border border-gray-300 rounded"/> <span>%</span> <button class="px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 ml-2">Search</button></div></div> <div><label for="date-select" class="block mb-1"><strong>Select date</strong></label> <select id="date-select" class="w-full px-2 py-1 border border-gray-300 rounded mt-1"><!></select> <div class="flex justify-between gap-2 mt-4"><button class="flex-1 px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed">Previous</button> <button class="flex-1 px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed">Next</button></div></div></div>');function Oh(e,t){Zs(t,!0);let r=fh(t,"searchResults",27,(()=>Jl([]))),n=fh(t,"currentIndex",31,(()=>-1)),i=fh(t,"cloudCover",15,20),o=fh(t,"loading",3,!1),a=fh(t,"onSearch",3,(()=>{})),s=fh(t,"onNavigatePrevious",3,(()=>{})),l=fh(t,"onNavigateNext",3,(()=>{})),c=fh(t,"onIndexChange",3,(e=>{}));var u=Lh(),d=uc(u),h=e=>{Yu(e,Ah())};ad(d,(e=>{o()&&e(h)}));var f=hc(d,2),p=hc(uc(f),2),g=uc(p);Ld(g),hc(g,4).__click=function(...e){a()?.apply(this,e)},Os(p),Os(f);var m=hc(f,2),y=hc(uc(m),2);y.__change=()=>c()(n());var _=uc(y),v=e=>{var t=Ch();t.value=t.__value="",Yu(e,t)},b=e=>{var t=Zu();Il(dc(t),17,r,Tl,((e,t,r)=>{var n=Rh(),i=uc(n,!0);Os(n),n.value=n.__value=r,Pc((e=>Ju(i,e)),[()=>{return e=yu(t).datetime,r=new Date(e),n=r.getDate().toString().padStart(2,"0"),i=r.toLocaleString("en-US",{month:"short"}),o=r.getFullYear(),"".concat(n," ").concat(i," ").concat(o);var e,r,n,i,o}]),Yu(e,n)})),Yu(e,t)};ad(_,(e=>{0===r().length?e(v):e(b,!1)})),Os(y);var x=hc(y,2),w=uc(x);w.__click=function(...e){s()?.apply(this,e)};var S=hc(w,2);S.__click=function(...e){l()?.apply(this,e)},Os(x),Os(m),Os(u),Pc((()=>{y.disabled=0===r().length,w.disabled=n()>=r().length-1||0===r().length,S.disabled=n()<=0||0===r().length})),Kd(g,i),Md(y,n),Yu(e,u),Ys()}Bu(["click","change"]);var Dh=i(3481),zh=i.n(Dh);function Fh(e){try{var t="string"==typeof e?JSON.parse(e):e;return zh().geoJSON(t).getBounds()}catch(e){return void console.error("Error calculating bounds from GeoJSON:",e)}}var Nh=$u('<div class="relative h-full"><div class="absolute inset-0"></div></div>');function Bh(e,t){Zs(t,!0);let r,n,i=fh(t,"farmFieldsGeojson",3,null),o=fh(t,"mapboxPublicToken",3,""),a=fh(t,"currentImage",11,null),s=fh(t,"activeLayerType",15,"none"),l=fh(t,"mapCenter",15,null),c=fh(t,"selectedFieldId",11,null),u=fh(t,"onLoadingChange",3,(e=>{})),d={rgb:null,water:null},h={},f=null;const p=Dl((()=>c()&&i()&&i().features.find((e=>Number(e.id)===c()))||null));function g(){if(Object.values(d).forEach((e=>{e&&e.setOpacity(0)})),Object.values(h).forEach((e=>{e&&e.setOpacity(0)})),"none"!==s())if(s().startsWith("custom_")){const e=s();h[e]&&h[e]?.setOpacity(1)}else d[s()]&&d[s()]?.setOpacity(1)}async function m(e){u()(!0),Object.values(d).forEach((e=>{e&&r.removeLayer(e)})),Object.values(h).forEach((e=>{e&&r.removeLayer(e)})),h={};if(["rgb","water"].forEach((t=>{d[t]=zh().tileLayer(e.tile_urls[t].replace(/@1/g,"@2"),{tileSize:512,zoomOffset:-1,opacity:0,attribution:"Atla.ai, ESA",pane:"satellitePane",...bh.leaflet.defaultLayerParams}),d[t]?.addTo(r)})),e.stac_href)for(const t of Th)try{const n=await Ih(e.stac_href,t),i=`custom_${t.id}`;h[i]=zh().tileLayer(n,{tileSize:512,zoomOffset:-1,opacity:0,attribution:"Atla.ai, ESA",pane:"satellitePane",...bh.leaflet.defaultLayerParams}),h[i]?.addTo(r)}catch(e){console.error(`Failed to load custom expression ${t.name}:`,e)}
29f||(f=new(zh().Control.extend({options:{position:"topright"},onAdd:()=>{const e=zh().DomUtil.create("div","leaflet-bar leaflet-control");e.className+=" bg-white p-2";const t=zh().DomUtil.create("select","",e);return t.className="px-3 py-1 border border-gray-300 rounded cursor-pointer",[{value:"none",label:"Base Map"},{value:"rgb",label:"RGB Visual"},{value:"water",label:"Water"}].forEach((e=>{const r=zh().DomUtil.create("option","",t);r.value=e.value,r.textContent=e.label,e.value===s()&&(r.selected=!0)})),Th.forEach((e=>{const r=zh().DomUtil.create("option","",t);r.value=`custom_${e.id}`,r.textContent=e.name,`custom_${e.id}`===s()&&(r.selected=!0)})),zh().DomEvent.on(t,"change",(()=>{s(t.value),g()})),zh().DomEvent.disableClickPropagation(e),e}})),f.addTo(r)),g(),u()(!1)}Tc((()=>{a()&&r&&m(a())})),Tc((()=>{r&&(Object.values(d).some((e=>null!==e))||Object.values(h).some((e=>null!==e)))&&g()})),Tc((()=>{console.log("[BiomassMap] selectedFieldId changed to:",c())})),Tc((()=>{if(console.log("[BiomassMap] fitBoundsTarget effect running, target:",yu(p)?.id,"map ready:",!!r),r&&yu(p)){console.log("[BiomassMap] Zooming to field:",yu(p).id);const e=zh().geoJSON(yu(p)).getBounds();console.log("[BiomassMap] Bounds:",e),r.fitBounds(e,{padding:[50,50],maxZoom:17})}})),yh((()=>{if(!n)return;let e=zh().latLngBounds(zh().latLng(54.5,8),zh().latLng(57.8,15.2));i()&&(e=Fh(i())),l(e.getCenter()),r=zh().map(n,{maxZoom:bh.leaflet.defaultLayerParams.maxZoom}).fitBounds(e),r.on("moveend",(()=>{l(r.getCenter())}));const t=zh().tileLayer("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",...bh.leaflet.defaultLayerParams}),a=zh().tileLayer(`https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.webp?access_token=${o()}`,{attribution:"© Mapbox",...bh.leaflet.defaultLayerParams}),s={OpenStreetMap:t,"Mapbox Satellite":a};a.addTo(r),zh().control.layers(s,{}).addTo(r),r.createPane("satellitePane");const c=r.getPane("satellitePane");c&&(c.style.zIndex="400"),r.createPane("maskPane");const u=r.getPane("maskPane");u&&(u.style.zIndex="450",u.style.pointerEvents="none");let d=null;i()&&function(){if(!i()?.features?.length)return void console.log("[BiomassMap] No fields to create mask for");console.log("[BiomassMap] Creating mask layer for",i().features.length,"fields"),d&&r.removeLayer(d);const e=[];i().features.forEach((t=>{if("Polygon"===t.geometry.type){const r=t.geometry.coordinates[0];e.push(r)}else"MultiPolygon"===t.geometry.type&&t.geometry.coordinates.forEach((t=>{e.push(t[0])}))})),console.log("[BiomassMap] Created",e.length,"holes in mask");const t={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[-180,-85],[-180,85],[180,85],[180,-85],[-180,-85]],...e]}};d=zh().geoJSON(t,{pane:"maskPane",style:{fillColor:"#e5e7eb",fillOpacity:1,stroke:!1,weight:0}}).addTo(r),console.log("[BiomassMap] Mask layer added to map")}(),zh().geoJSON(i(),{style:{color:"orange",weight:2,opacity:1,fillOpacity:0},onEachFeature:(e,t)=>{t.bindPopup((()=>JSON.stringify(e.properties,null,2)))}}).addTo(r)})),_h((()=>{r&&(Object.values(d).forEach((e=>{e&&r.removeLayer(e)})),Object.values(h).forEach((e=>{e&&r.removeLayer(e)})),f&&r.removeControl(f),r.remove())}));var y=Nh();nh(uc(y),(e=>n=e),(()=>n)),Os(y),Yu(e,y),Ys()}var jh=$u("<option> </option>"),Vh=$u('<div><label for="farm-select" class="block text-sm font-medium mb-1">Select Farm</label> <select id="farm-select" class="w-full px-3 py-2 border border-gray-300 rounded"></select></div>'),Gh=$u('<div class="p-3 bg-yellow-50 border border-yellow-200 rounded text-sm">No farms available. Please create a farm first.</div>'),Uh=$u("<option> </option>"),$h=$u('<div><label for="field-select" class="block text-sm font-medium mb-1">Select Field</label> <select id="field-select" class="w-full px-3 py-2 border border-gray-300 rounded"><option>All Fields</option><!></select></div>'),Hh=$u('<div class="flex items-center justify-center py-4"><svg class="w-5 h-5 animate-spin text-blue-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="ml-2 text-sm text-gray-600">Loading...</span></div>'),qh=$u('<div class="space-y-1 text-sm"><div class="flex justify-between"><span class="text-gray-600">Mean:</span> <span class="font-medium"> </span></div> <div class="flex justify-between"><span class="text-gray-600">Median:</span> <span class="font-medium"> </span></div> <div class="flex justify-between"><span class="text-gray-600">Min:</span> <span class="font-medium"> </span></div> <div class="flex justify-between"><span class="text-gray-600">Max:</span> <span class="font-medium"> </span></div> <div class="flex justify-between"><span class="text-gray-600">Std Dev:</span> <span class="font-medium"> </span></div> <div class="flex justify-between"><span class="text-gray-600">Pixel Count:</span> <span class="font-medium"> </span></div></div>'),Wh=$u('<p class="text-sm text-gray-500">No satellite data available</p>'),Zh=$u('<p class="text-sm text-gray-500">Statistics not available for this layer</p>'),Yh=$u('<p class="text-sm text-gray-500">Unable to load statistics</p>
29'),Xh=$u('<div class="border border-gray-300 rounded p-3"><h3 class="text-sm font-semibold mb-2">Field Statistics</h3> <!></div>'),Kh=$u('<div class="flex h-full"><div class="w-80 bg-white border-r border-gray-200 overflow-y-auto flex-shrink-0"><div class="p-4 space-y-4"><h1 class="text-2xl font-bold">Satellite Data Viewer</h1> <!> <!> <!> <button disabled class="w-full flex items-center justify-center gap-2 px-4 py-2 bg-gray-300 text-gray-500 rounded cursor-not-allowed"><svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"></path></svg> <span>Download Field Image (Coming Soon)</span></button> <!></div></div> <div class="flex-1 relative"><!></div></div>');function Jh(e,t){Zs(t,!0);let r=fh(t,"farmFieldsGeojson",3,null),n=fh(t,"mapboxPublicToken",3,""),i=fh(t,"teamSlug",3,""),o=fh(t,"farms",19,(()=>[])),a=fh(t,"selectedFarmId",3,null),s=$l(Jl([])),l=$l(-1),c=$l(20),u=$l(null),d=$l("none"),h=$l(!1),f=$l(null),p=$l(null),g=$l(!1),m=Dl((()=>r()?.features.map((e=>({id:Number(e.id),name:e.properties?.name||`Field ${e.id}`})))||[])),y=Dl((()=>yu(l)>=0&&yu(l)<yu(s).length?yu(s)[yu(l)]:null)),_=Dl((()=>yu(f)&&r()&&r().features.find((e=>Number(e.id)===yu(f)))||null)),v=Dl((()=>{if("none"===yu(d)||!yu(d))return null;if(yu(d).startsWith("custom_")){const e=yu(d).replace("custom_",""),t=Th.find((t=>t.id===e));return t?.expression||null}return{ndvi:"(nir - red) / (nir + red)",gndvi:"(nir - green) / (nir + green)",water:"(green - nir) / (green + nir)"}[yu(d)]||null}));async function b(){if(yu(u)){ql(h,!0);try{ql(s,await function(e,t,r){return Eh.apply(this,arguments)}(yu(u).lat,yu(u).lng,yu(c)),!0),yu(s).length>0&&ql(l,0)}catch(e){console.error("Error fetching search results:",e)}finally{ql(h,!1)}}}Tc((()=>{!async function(){yu(_)&&yu(y)?.stac_href&&yu(v)?(ql(g,!0),ql(p,await function(e,t,r){return Ph.apply(this,arguments)}(yu(y).stac_href,yu(_),yu(v)),!0),ql(g,!1)):ql(p,null)}()})),yh((()=>{setTimeout((()=>{yu(u)&&b()}),500)}));var x=Kh(),w=uc(x),S=uc(w),k=hc(uc(S),2),T=e=>{var t,r=Vh(),n=hc(uc(r),2);n.__change=e=>{window.location.href=`/a/${i()}/farms/biomass?farm_id=${e.currentTarget.value}`},Il(n,21,o,Tl,((e,t)=>{var r=jh(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t).name),i!==(i=yu(t).id)&&(r.value=(r.__value=yu(t).id)??"")})),Yu(e,r)})),Os(n),Id(n),Os(r),Pc((()=>{t!==(t=a())&&(n.value=(n.__value=a())??"",Td(n,a()))})),Yu(e,r)},I=e=>{Yu(e,Gh())};ad(k,(e=>{o().length>0?e(T):e(I,!1)}));var M=hc(k,2),E=e=>{var t=$h(),r=hc(uc(t),2);r.__change=e=>{const t=e.currentTarget.value,r=""===t?null:Number(t);console.log("[App] Field selected:",t,"-> parsed:",r),ql(f,r,!0)};var n=uc(r);n.value=n.__value="",Il(hc(n),17,(()=>yu(m)),Tl,((e,t)=>
29{var r=Uh(),n=uc(r,!0);Os(r);var i={};Pc((()=>{zd(r,yu(f)===yu(t).id),Ju(n,yu(t).name),i!==(i=yu(t).id)&&(r.value=(r.__value=yu(t).id)??"")})),Yu(e,r)})),Os(r),Os(t),Yu(e,t)};ad(M,(e=>{yu(m).length>0&&e(E)}));var P=hc(M,2);Oh(P,{get loading(){return yu(h)},onSearch:b,onNavigatePrevious:function(){yu(l)<yu(s).length-1&&Yl(l)},onNavigateNext:function(){yu(l)>0&&Yl(l,-1)},onIndexChange:e=>ql(l,e,!0),get searchResults(){return yu(s)},set searchResults(e){ql(s,e,!0)},get currentIndex(){return yu(l)},set currentIndex(e){ql(l,e,!0)},get cloudCover(){return yu(c)},set cloudCover(e){ql(c,e,!0)}});var A=hc(P,4),C=e=>{var t=Xh(),r=hc(uc(t),2),n=e=>{Yu(e,Hh())},i=e=>{var t=Zu(),r=dc(t),n=e=>{var t=qh(),r=uc(t),n=hc(uc(r),2),i=uc(n,!0);Os(n),Os(r);var o=hc(r,2),a=hc(uc(o),2),s=uc(a,!0);Os(a),Os(o);var l=hc(o,2),c=hc(uc(l),2),u=uc(c,!0);Os(c),Os(l);var d=hc(l,2),h=hc(uc(d),2),f=uc(h,!0);Os(h),Os(d);var g=hc(d,2),m=hc(uc(g),2),y=uc(m,!0);Os(m),Os(g);var _=hc(g,2),v=hc(uc(_),2),b=uc(v,!0);Os(v),Os(_),Os(t),Pc(((e,t,r,n,o,a)=>{Ju(i,e),Ju(s,t),Ju(u,r),Ju(f,n),Ju(y,o),Ju(b,a)}),[()=>yu(p).mean.toFixed(3),()=>yu(p).median.toFixed(3),()=>yu(p).min.toFixed(3),()=>yu(p).max.toFixed(3),()=>yu(p).std.toFixed(3),()=>yu(p).count.toLocaleString()]),Yu(e,t)},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Wh())},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Zh())},i=e=>{Yu(e,Yh())};ad(r,(e=>{yu(v)?e(i,!1):e(n)}),!0),Yu(e,t)};ad(r,(e=>{yu(y)?.stac_href?e(i,!1):e(n)}),!0),Yu(e,t)};ad(r,(e=>{yu(p)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(r,(e=>{yu(g)?e(n):e(i,!1)})),Os(t),Yu(e,t)};ad(A,(e=>{yu(f)&&"none"!==yu(d)&&e(C)})),Os(S),Os(w);var R=hc(w,2);Bh(uc(R),{get farmFieldsGeojson(){return r()},get mapboxPublicToken(){return n()},onLoadingChange:e=>ql(h,e,!0),get currentImage(){return yu(y)},set currentImage(e){ql(y,e)},get activeLayerType(){return yu(d)},set activeLayerType(e){ql(d,e,!0)},get mapCenter(){return yu(u)},set mapCenter(e){ql(u,e,!0)},get selectedFieldId(){return yu(f)},set selectedFieldId(e){ql(f,e,!0)}}),Os(R),Os(x),Yu(e,x),Ys()}Bu(["change"]);const{min:Qh,max:ef}=Math,tf=(e,t=0,r=1)=>Qh(ef(t,e),r),rf=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=tf(e[t],0,255)):3===t&&(e[t]=tf(e[t],0,1));return e},nf={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])nf[`[object ${e}]`]=e.toLowerCase();function of(e){return nf[Object.prototype.toString.call(e)]||"object"}const af=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):"object"==of(e[0])&&t?t.split("").filter((t=>void 0!==e[0][t])).map((t=>e[0][t])):e[0].slice(0),sf=e=>{if(e.length<2)return null;const t=e.length-1;return"string"==of(e[t])?e[t].toLowerCase():null},{PI:lf,min:cf,max:uf}=Math,df=e=>Math.round(100*e)/100,hf=e=>Math.round(100*e)/100,ff=2*lf,pf=lf/3,gf=lf/180,mf=180/lf;function yf(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const _f={format:{},autodetect:[]};const vf=class{constructor(...e){const t=this;if("object"===of(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=sf(e),n=!1;if(!r){n=!0,_f.sorted||(_f.autodetect=_f.autodetect.sort(((e,t)=>t.p-e.p)),_f.sorted=!0);for(let t of _f.autodetect)if(r=t.test(...e),r)break}if(!_f.format[r])throw new Error("unknown format: "+e);{const i=_f.format[r].apply(null,n?e:e.slice(0,-1));t._rgb=rf(i)}3===t._rgb.length&&t._rgb.push(1)}toString(){return"function"==of(this.hex)?this.hex():`[${this._rgb.join(",")}]`}},bf=(...e)=>new vf(...e);bf.version="3.1.2";const xf=bf,wf={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",s
vendor: 5,588 bytes, line 29
29almon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Sf=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,kf=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Tf=e=>{if(e.match(Sf)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(kf)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((255&t)/255*100)/100]}throw new Error(`unknown hex color: ${e}`)},{round:If}=Math,Mf=(...e)=>{let[t,r,n,i]=af(e,"rgba"),o=sf(e)||"auto";void 0===i&&(i=1),"auto"===o&&(o=i<1?"rgba":"rgb"),t=If(t),r=If(r),n=If(n);let a="000000"+(t<<16|r<<8|n).toString(16);a=a.substr(a.length-6);let s="0"+If(255*i).toString(16);switch(s=s.substr(s.length-2),o.toLowerCase()){case"rgba":return`#${a}${s}`;case"argb":return`#${s}${a}`;default:return`#${a}`}};vf.prototype.name=function(){const e=Mf(this._rgb,"rgb");for(let t of Object.keys(wf))if(wf[t]===e)return t.toLowerCase();return e},_f.format.named=e=>{if(e=e.toLowerCase(),wf[e])return Tf(wf[e]);throw new Error("unknown color name: "+e)},_f.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&"string"===of(e)&&wf[e.toLowerCase()])return"named"}}),vf.prototype.alpha=function(e,t=!1){return void 0!==e&&"number"===of(e)?t?(this._rgb[3]=e,this):new vf([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},vf.prototype.clipped=function(){return this._rgb._clipped||!1};const Ef={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},Pf=Ef,Af=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Cf(e){const t=Af.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);Ef.labWhitePoint=e,Ef.Xn=t[0],Ef.Zn=t[1]}function Rf(){return Ef.labWhitePoint}const Lf=(e,t,r)=>{const{kE:n,kK:i,kKE:o,Xn:a,Yn:s,Zn:l}=Pf,c=(e+16)/116,u=.002*t+c,d=c-.005*r,h=u*u*u,f=d*d*d;return[(h>n?h:(116*u-16)/i)*a,(e>o?Math.pow((e+16)/116,3):e/i)*s,(f>n?f:(116*d-16)/i)*l]},Of=e=>{const t=Math.sign(e);return((e=Math.abs(e))<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)*t},Df=(e,t,r)=>{const{MtxAdaptMa:n,MtxAdaptMaI:i,MtxXYZ2RGB:o,RefWhiteRGB:a,Xn:s,Yn:l,Zn:c}=Pf,u=s*n.m00+l*n.m10+c*n.m20,d=s*n.m01+l*n.m11+c*n.m21,h=s*n.m02+l*n.m12+c*n.m22,f=a.X*n.m00+a.Y*n.m10+a.Z*n.m20,p=a.X*n.m01+a.Y*n.m11+a.Z*n.m21,g=a.X*n.m02+a.Y*n.m12+a.Z*n.m22,m=(e*n.m00+t*n.m10+r*n.m20)*(f/u),y=(e*n.m01+t*n.m11+r*n.m21)*(p/d),_=(e*n.m02+t*n.m12+r*n.m22)*(g/h),v=m*i.m00+y*i.m10+_*i.m20,b=m*i.m01+y*i.m11+_*i.m21,x=m*i.m02+y*i.m12+_*i.m22;return[255*Of(v*o.m00+b*o.m10+x*o.m20),255*Of(v*o.m01+b*o.m11+x*o.m21),255*Of(v*o.m02+b*o.m12+x*o.m22)]},zf=(...e)=>{e=af(e,"lab");const[t,r,n]=e,[i,o,a]=Lf(t,r,n),[s,l,c]=Df(i,o,a);return[s,l,c,e.length>3?e[3]:1]};function Ff(e){const t=Math.sign(e);return((e=Math.abs(e))<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*t}const Nf=(e,t,r)=>{e=Ff(e/255),t=Ff(t/255),r=Ff(r/255);const{MtxRGB2XYZ:n,MtxAdaptMa:i,MtxAdaptMaI:o,Xn:a,Yn:s,Zn:l,As:c,Bs:u,Cs:d}=Pf;let h=e*n.m00+t*n.m10+r*n.m20,f=e*n.m01+t*n.m11+r*n.m21,p=e*n.m02+t*n.m12+r*n.m22;const g=a*i.m00+s*i.m10+l*i.m20,m=a*i.m01+s*i.m11+l*i.m21,y=a*i.m02+s*i.m12+l*i.m22;let _=h*i.m00+f*i.m10+p*i.m20,v=h*i.m01+f*i.m11+p*i.m21,b=h*i.m02+f*i.m12+p*i.m22;return _*=g/c,v*=m/u,b*=y/d,h=_*o.m00+v*o.m10+b*o.m20,f=_*o.m01+v*o.m11+b*o.m21,p=_*o.m02+v*o.m12+b*o.m22,[h,f,p]},Bf=(...e)=>{const[t,r,n,...i]=af(e,"rgb"),[o,a,s]=Nf(t,r,n),[l,c,u]=function(e,t,r){const{Xn:n,Yn:i,Zn:o,kE:a,kK:s}=Pf,l=e/n,c=t/i,u=r/o,d=l>a?Math.pow(l,1/3):(s*l+16)/116,h=c>a?Math.pow(c,1/3):(s*c+16)/116,f=u>a?Math.pow(u,1/3):(s*u+16)/116;return[116*h-16,500*(d-h),200*(h-f)]}(o,a,s);return[l,c,u,...i.length>0&&i[0]<1?[i[0]]:[]]};vf.prototype.lab=function(){return Bf(this._rgb)};Object.assign(xf,{lab:(...e)=>new vf(...e,"lab"),getLabWhitePoint:Rf,setLabWhitePoint:Cf}),_f.format.lab=zf,_f.autodetect.push({p:2,test:(...e)=>{if("array"===of(e=af(e,"lab"))&&3===e.length)return"lab"}}),vf.prototype.darken=function(e=1){const t=this.lab();
29return t[0]-=Pf.Kn*e,new vf(t,"lab").alpha(this.alpha(),!0)},vf.prototype.brighten=function(e=1){return this.darken(-e)},vf.prototype.darker=vf.prototype.darken,vf.prototype.brighter=vf.prototype.brighten,vf.prototype.get=function(e){const[t,r]=e.split("."),n=this[t]();if(r){const e=t.indexOf(r)-("ok"===t.substr(0,2)?2:0);if(e>-1)return n[e];throw new Error(`unknown channel ${r} in mode ${t}`)}return n};const{pow:jf}=Math;vf.prototype.luminance=function(e,t="rgb"){if(void 0!==e&&"number"===of(e)){if(0===e)return new vf([0,0,0,this._rgb[3]],"rgb");if(1===e)return new vf([255,255,255,this._rgb[3]],"rgb");let r=this.luminance(),n=20;const i=(r,o)=>{const a=r.interpolate(o,.5,t),s=a.luminance();return Math.abs(e-s)<1e-7||!n--?a:s>e?i(r,a):i(a,o)},o=(r>e?i(new vf([0,0,0]),this):i(this,new vf([255,255,255]))).rgb();return new vf([...o,this._rgb[3]])}return Vf(...this._rgb.slice(0,3))};const Vf=(e,t,r)=>.2126*(e=Gf(e))+.7152*(t=Gf(t))+.0722*(r=Gf(r)),Gf=e=>(e/=255)<=.03928?e/12.92:jf((e+.055)/1.055,2.4),Uf={},$f=(e,t,r=.5,...n)=>{let i=n[0]||"lrgb";if(Uf[i]||n.length||(i=Object.keys(Uf)[0]),!Uf[i])throw new Error(`interpolation mode ${i} is not defined`);return"object"!==of(e)&&(e=new vf(e)),"object"!==of(t)&&(t=new vf(t)),Uf[i](e,t,r).alpha(e.alpha()+r*(t.alpha()-e.alpha()))};vf.prototype.mix=vf.prototype.interpolate=function(e,t=.5,...r){return $f(this,e,t,...r)},vf.prototype.premultiply=function(e=!1){const t=this._rgb,r=t[3];return e?(this._rgb=[t[0]*r,t[1]*r,t[2]*r,r],this):new vf([t[0]*r,t[1]*r,t[2]*r,r],"rgb")};const{sin:Hf,cos:qf}=Math,Wf=(...e)=>{let[t,r,n]=af(e,"lch");return isNaN(n)&&(n=0),n*=gf,[t,qf(n)*r,Hf(n)*r]},Zf=(...e)=>{e=af(e,"lch");const[t,r,n]=e,[i,o,a]=Wf(t,r,n),[s,l,c]=zf(i,o,a);return[s,l,c,e.length>3?e[3]:1]},Yf=(...e)=>{const t=yf(af(e,"hcl"));return Zf(...t)},{sqrt:Xf,atan2:Kf,round:Jf}=Math,Qf=(...e)=>{const[t,r,n]=af(e,"lab"),i=Xf(r*r+n*n);let o=(Kf(n,r)*mf+360)%360;return 0===Jf(1e4*i)&&(o=Number.NaN),[t,i,o]},ep=(...e)=>{const[t,r,n,...i]=af(e,"rgb"),[o,a,s]=Bf(t,r,n),[l,c,u]=Qf(o,a,s);return[l,c,u,...i.length>0&&i[0]<1?[i[0]]:[]]};vf.prototype.lch=function(){return ep(this._rgb)},vf.prototype.hcl=function(){return yf(ep(this._rgb))};Object.assign(xf,{lch:(...e)=>new vf(...e,"lch"),hcl:(...e)=>new vf(...e,"hcl")}),_f.format.lch=Zf,_f.format.hcl=Yf,["lch","hcl"].forEach((e=>_f.autodetect.push({p:2,test:(...t)=>{if("array"===of(t=af(t,e))&&3===t.length)return e}}))),vf.prototype.saturate=function(e=1){const t=this.lch();return t[1]+=Pf.Kn*e,t[1]<0&&(t[1]=0),new vf(t,"lch").alpha(this.alpha(),!0)},vf.prototype.desaturate=function(e=1){return this.saturate(-e)},vf.prototype.set=function(e,t,r=!1){const[n,i]=e.split("."),o=this[n]();if(i){const e=n.indexOf(i)-("ok"===n.substr(0,2)?2:0);if(e>-1){if("string"==of(t))switch(t.charAt(0)){case"+":case"-":o[e]+=+t;break;case"*":o[e]*=+t.substr(1);break;case"/":o[e]/=+t.substr(1);break;default:o[e]=+t}else{if("number"!==of(t))throw new Error("unsupported value for Color.set");o[e]=t}const i=new vf(o,n);return r?(this._rgb=i._rgb,this):i}throw new Error(`unknown channel ${i} in mode ${n}`)}return o},vf.prototype.tint=function(e=.5,...t){return $f(this,"white",e,...t)},vf.prototype.shade=function(e=.5,...t){return $f(this,"black",e,...t)};const tp=(e,t,r)=>{const n=e._rgb,i=t._rgb;return new vf(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"rgb")};Uf.rgb=tp;const{sqrt:rp,pow:np}=Math,ip=(e,t,r)=>{const[n,i,o]=e._rgb,[a,s,l]=t._rgb;return new vf(rp(np(n,2)*(1-r)+np(a,2)*r),rp(np(i,2)*(1-r)+np(s,2)*r),rp(np(o,2)*(1-r)+np(l,2)*r),"rgb")};Uf.lrgb=ip;const op=(e,t,r)=>{const n=e.lab(),i=t.lab();return new vf(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"lab")};Uf.lab=op;const ap=(e,t,r,n)=>{let i,o,a,s,l,c,u,d,h,f,p,g;return"hsl"===n?(i=e.hsl(),o=t.hsl()):"hsv"===n?(i=e.hsv(),o=t.hsv()):"hcg"===n?(i=e.hcg(),o=t.hcg()):"hsi"===n?(i=e.hsi(),o=t.hsi()):"lch"===n||"hcl"===n?(n="hcl",i=e.hcl(),o=t.hcl()):"oklch"===n&&(i=e.oklch().reverse(),o=t.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||([a,l,u]=i,[s,c,d]=o),isNaN(a)||isNaN(s)?isNaN(a)?isNaN(s)?f=Number.NaN:(f=s,1!=u&&0!=u||"hsv"==n||(h=c)):(f=a,1!=d&&0!=d||"hsv"==n||(h=l)):(g=s>a&&s-a>180?s-(a+360):s<a&&a-s>180?s+360-a:s-a,f=a+r*g),void 0===h&&(h=l+r*(c-l)),p=u+r*(d-u),new vf("oklch"===n?[p,h,f]:[f,h,p],n)},sp=(e,t,r)=>ap(e,t,r,"lch");Uf.lch=sp,Uf.hcl=sp;const lp=e=>{if("number"==of(e)&&e>=0&&e<=16777215){return[e>>16,e>>8&255,255&e,1]}throw new Error("unknown num color: "+e)},cp=(...e)=>{const[t,r,n]=af(e,"rgb");return(t<<16)+(r<<8)+n};vf.prototype.num=function(){return cp(this._rgb)};Object.assign(xf,{num:(...e)=>new vf(...e,"num")}),_f.format.num=lp,_f.autodetect.push({p:5,test:(...e)=>{if(1===e.length&&"number"===of(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});const up=(e,t,r)=>{const n=e.num(),i=t.num();return new vf(n+r*(i-n),"num")};
29Uf.num=up;const{floor:dp}=Math,hp=(...e)=>{e=af(e,"hcg");let t,r,n,[i,o,a]=e;a*=255;const s=255*o;if(0===o)t=r=n=a;else{360===i&&(i=0),i>360&&(i-=360),i<0&&(i+=360),i/=60;const e=dp(i),l=i-e,c=a*(1-o),u=c+s*(1-l),d=c+s*l,h=c+s;switch(e){case 0:[t,r,n]=[h,d,c];break;case 1:[t,r,n]=[u,h,c];break;case 2:[t,r,n]=[c,h,d];break;case 3:[t,r,n]=[c,u,h];break;case 4:[t,r,n]=[d,c,h];break;case 5:[t,r,n]=[h,c,u]}}return[t,r,n,e.length>3?e[3]:1]},fp=(...e)=>{const[t,r,n]=af(e,"rgb"),i=cf(t,r,n),o=uf(t,r,n),a=o-i,s=100*a/255,l=i/(255-a)*100;let c;return 0===a?c=Number.NaN:(t===o&&(c=(r-n)/a),r===o&&(c=2+(n-t)/a),n===o&&(c=4+(t-r)/a),c*=60,c<0&&(c+=360)),[c,s,l]};vf.prototype.hcg=function(){return fp(this._rgb)};xf.hcg=(...e)=>new vf(...e,"hcg"),_f.format.hcg=hp,_f.autodetect.push({p:1,test:(...e)=>{if("array"===of(e=af(e,"hcg"))&&3===e.length)return"hcg"}});const pp=(e,t,r)=>ap(e,t,r,"hcg");Uf.hcg=pp;const{cos:gp}=Math,mp=(...e)=>{e=af(e,"hsi");let t,r,n,[i,o,a]=e;return isNaN(i)&&(i=0),isNaN(o)&&(o=0),i>360&&(i-=360),i<0&&(i+=360),i/=360,i<1/3?(n=(1-o)/3,t=(1+o*gp(ff*i)/gp(pf-ff*i))/3,r=1-(n+t)):i<2/3?(i-=1/3,t=(1-o)/3,r=(1+o*gp(ff*i)/gp(pf-ff*i))/3,n=1-(t+r)):(i-=2/3,r=(1-o)/3,n=(1+o*gp(ff*i)/gp(pf-ff*i))/3,t=1-(r+n)),t=tf(a*t*3),r=tf(a*r*3),n=tf(a*n*3),[255*t,255*r,255*n,e.length>3?e[3]:1]},{min:yp,sqrt:_p,acos:vp}=Math,bp=(...e)=>{let t,[r,n,i]=af(e,"rgb");r/=255,n/=255,i/=255;const o=yp(r,n,i),a=(r+n+i)/3,s=a>0?1-o/a:0;return 0===s?t=NaN:(t=(r-n+(r-i))/2,t/=_p((r-n)*(r-n)+(r-i)*(n-i)),t=vp(t),i>n&&(t=ff-t),t/=ff),[360*t,s,a]};vf.prototype.hsi=function(){return bp(this._rgb)};xf.hsi=(...e)=>new vf(...e,"hsi"),_f.format.hsi=mp,_f.autodetect.push({p:2,test:(...e)=>{if("array"===of(e=af(e,"hsi"))&&3===e.length)return"hsi"}});const xp=(e,t,r)=>ap(e,t,r,"hsi");Uf.hsi=xp;const wp=(...e)=>{e=af(e,"hsl");const[t,r,n]=e;let i,o,a;if(0===r)i=o=a=255*n;else{const e=[0,0,0],s=[0,0,0],l=n<.5?n*(1+r):n+r-n*r,c=2*n-l,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&(e[t]-=1),6*e[t]<1?s[t]=c+6*(l-c)*e[t]:2*e[t]<1?s[t]=l:3*e[t]<2?s[t]=c+(l-c)*(2/3-e[t])*6:s[t]=c;[i,o,a]=[255*s[0],255*s[1],255*s[2]]}return e.length>3?[i,o,a,e[3]]:[i,o,a,1]},Sp=(...e)=>{e=af(e,"rgba");let[t,r,n]=e;t/=255,r/=255,n/=255;const i=cf(t,r,n),o=uf(t,r,n),a=(o+i)/2;let s,l;return o===i?(s=0,l=Number.NaN):s=a<.5?(o-i)/(o+i):(o-i)/(2-o-i),t==o?l=(r-n)/(o-i):r==o?l=2+(n-t)/(o-i):n==o&&(l=4+(t-r)/(o-i)),l*=60,l<0&&(l+=360),e.length>3&&void 0!==e[3]?[l,s,a,e[3]]:[l,s,a]};vf.prototype.hsl=function(){return Sp(this._rgb)};xf.hsl=(...e)=>new vf(...e,"hsl"),_f.format.hsl=wp,_f.autodetect.push({p:2,test:(...e)=>{if("array"===of(e=af(e,"hsl"))&&3===e.length)return"hsl"}});const kp=(e,t,r)=>ap(e,t,r,"hsl");Uf.hsl=kp;const{floor:Tp}=Math,Ip=(...e)=>{e=af(e,"hsv");let t,r,n,[i,o,a]=e;if(a*=255,0===o)t=r=n=a;else{360===i&&(i=0),i>360&&(i-=360),i<0&&(i+=360),i/=60;const e=Tp(i),s=i-e,l=a*(1-o),c=a*(1-o*s),u=a*(1-o*(1-s));switch(e){case 0:[t,r,n]=[a,u,l];break;case 1:[t,r,n]=[c,a,l];break;case 2:[t,r,n]=[l,a,u];break;case 3:[t,r,n]=[l,c,a];break;case 4:[t,r,n]=[u,l,a];break;case 5:[t,r,n]=[a,l,c]}}return[t,r,n,e.length>3?e[3]:1]},{min:Mp,max:Ep}=Math,Pp=(...e)=>{e=af(e,"rgb");let[t,r,n]=e;const i=Mp(t,r,n),o=Ep(t,r,n),a=o-i;let s,l,c;return c=o/255,0===o?(s=Number.NaN,l=0):(l=a/o,t===o&&(s=(r-n)/a),r===o&&(s=2+(n-t)/a),n===o&&(s=4+(t-r)/a),s*=60,s<0&&(s+=360)),[s,l,c]};vf.prototype.hsv=function(){return Pp(this._rgb)};xf.hsv=(...e)=>new vf(...e,"hsv"),_f.format.hsv=Ip,_f.autodetect.push({p:2,test:(...e)=>{if("array"===of(e=af(e,"hsv"))&&3===e.length)return"hsv"}});const Ap=(e,t,r)=>ap(e,t,r,"hsv");Uf.hsv=Ap;function Cp(e,t){let r=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map((e=>[e])));let n=t[0].length,i=t[0].map(((e,r)=>t.map((e=>e[r])))),o=e.map((e=>i.map((t=>Array.isArray(e)?e.reduce(((e,r,n)=>e+r*(t[n]||0)),0):t.reduce(((t,r)=>t+r*e),0)))));return 1===r&&(o=o[0]),1===n?o.map((e=>e[0])):o}const Rp=(...e)=>{e=af(e,"lab");const[t,r,n,...i]=e,[o,a,s]=(l=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.11228680328
290317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],c=Cp([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],[t,r,n]),Cp(l,c.map((e=>e**3))));var l,c;const[u,d,h]=Df(o,a,s);return[u,d,h,...i.length>0&&i[0]<1?[i[0]]:[]]};const Lp=(...e)=>{const[t,r,n,...i]=af(e,"rgb");return[...function(e){const t=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=Cp([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e);return Cp(t,r.map((e=>Math.cbrt(e))))}(Nf(t,r,n)),...i.length>0&&i[0]<1?[i[0]]:[]]};vf.prototype.oklab=function(){return Lp(this._rgb)};Object.assign(xf,{oklab:(...e)=>new vf(...e,"oklab")}),_f.format.oklab=Rp,_f.autodetect.push({p:2,test:(...e)=>{if("array"===of(e=af(e,"oklab"))&&3===e.length)return"oklab"}});const Op=(e,t,r)=>{const n=e.oklab(),i=t.oklab();return new vf(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"oklab")};Uf.oklab=Op;const Dp=(e,t,r)=>ap(e,t,r,"oklch");Uf.oklch=Dp;const{pow:zp,sqrt:Fp,PI:Np,cos:Bp,sin:jp,atan2:Vp}=Math,Gp=(e,t)=>{const r=e.length,n=[0,0,0,0];for(let i=0;i<e.length;i++){const o=e[i],a=t[i]/r,s=o._rgb;n[0]+=zp(s[0],2)*a,n[1]+=zp(s[1],2)*a,n[2]+=zp(s[2],2)*a,n[3]+=s[3]*a}return n[0]=Fp(n[0]),n[1]=Fp(n[1]),n[2]=Fp(n[2]),n[3]>.9999999&&(n[3]=1),new vf(rf(n))},{pow:Up}=Math;function $p(e){let t="rgb",r=xf("#ccc"),n=0,i=[0,1],o=[],a=[0,0],s=!1,l=[],c=!1,u=0,d=1,h=!1,f={},p=!0,g=1;const m=function(e){if((e=e||["#fff","#000"])&&"string"===of(e)&&xf.brewer&&xf.brewer[e.toLowerCase()]&&(e=xf.brewer[e.toLowerCase()]),"array"===of(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=xf(e[t]);o.length=0;for(let t=0;t<e.length;t++)o.push(t/(e.length-1))}return b(),l=e};let y=e=>e,_=e=>e;const v=function(e,n){let i,c;if(null==n&&(n=!1),isNaN(e)||null===e)return r;if(n)c=e;else if(s&&s.length>2){const t=function(e){if(null!=s){const t=s.length-1;let r=0;for(;r<t&&e>=s[r];)r++;return r-1}return 0}(e);c=t/(s.length-2)}else c=d!==u?(e-u)/(d-u):1;c=_(c),n||(c=y(c)),1!==g&&(c=Up(c,g)),c=a[0]+c*(1-a[0]-a[1]),c=tf(c,0,1);const h=Math.floor(1e4*c);if(p&&f[h])i=f[h];else{if("array"===of(l))for(let e=0;e<o.length;e++){const r=o[e];if(c<=r){i=l[e];break}if(c>=r&&e===o.length-1){i=l[e];break}if(c>r&&c<o[e+1]){c=(c-r)/(o[e+1]-r),i=xf.interpolate(l[e],l[e+1],c,t);break}}else"function"===of(l)&&(i=l(c));p&&(f[h]=i)}return i};var b=()=>f={};m(e);const x=function(e){const t=xf(v(e));return c&&t[c]?t[c]():t};return x.classes=function(e){if(null!=e){if("array"===of(e))s=e,i=[e[0],e[e.length-1]];else{const t=xf.analyze(i);s=0===e?[t.min,t.max]:xf.limits(t,"e",e)}return x}return s},x.domain=function(e){if(!arguments.length)return i;u=e[0],d=e[e.length-1],o=[];const t=l.length;if(e.length===t&&u!==d)for(let t of Array.from(e))o.push((t-u)/(d-u));else{for(let e=0;e<t;e++)o.push(e/(t-1));if(e.length>2){const t=e.map(((t,r)=>r/(e.length-1))),r=e.map((e=>(e-u)/(d-u)));r.every(((e,r)=>t[r]===e))||(_=e=>{if(e<=0||e>=1)return e;let n=0;for(;e>=r[n+1];)n++;const i=(e-r[n])/(r[n+1]-r[n]);return t[n]+i*(t[n+1]-t[n])})}}return i=[u,d],x},x.mode=function(e){return arguments.length?(t=e,b(),x):t},x.range=function(e,t){return m(e),x},x.out=function(e){return c=e,x},x.spread=function(e){return arguments.length?(n=e,x):n},x.correctLightness=function(e){return null==e&&(e=!0),h=e,b(),y=h?function(e){const t=v(0,!0).lab()[0],r=v(1,!0).lab()[0],n=t>r;let i=v(e,!0).lab()[0];const o=t+(r-t)*e;let a=i-o,s=0,l=1,c=20;for(;Math.abs(a)>.01&&c-- >0;)n&&(a*=-1),a<0?(s=e,e+=.5*(l-e)):(l=e,e+=.5*(s-e)),i=v(e,!0).lab()[0],a=i-o;return e}:e=>e,x},x.padding=function(e){return null!=e?("number"===of(e)&&(e=[e,e]),a=e,x):a},x.colors=function(t,r){arguments.length<2&&(r="hex");let n=[];if(0===arguments.length)n=l.slice(0);else if(1===t)n=[x(.5)];else if(t>1){const e=i[0],r=i[1]-e;n=function(e,t,r){let n=[],i=e<t,o=r?i?t+1:t-1:t;for(let t=e;i?t<o:t>o;i?t++:t--)n.push(t);return n}(0,t,!1).map((n=>x(e+n/(t-1)*r)))}else{e=[];let t=[];if(s&&s.length>2)for(let e=1,r=s.length,n=1<=r;n?e<r:e>r;n?e++:e--)t.push(.5*(s[e-1]+s[e]));else t=i;n=t.map((e=>x(e)))}return xf[r]&&(n=n.map((e=>e[r]()))),n},x.cache=function(e){return null!=e?(p=e,x):p},x.gamma=function(e){return null!=e?(g=e,x):g},x.nodata=function(e){return null!=e?(r=xf(e),x):r},x}const{round:Hp}=Math;vf.prototype.rgb=function(e=!0){return!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Hp)},vf.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map(((t,r)=>r<3?!1===e?t:Hp(t):t))};Object.assign(xf,{rgb:(...e)=>new vf(...e,"rgb")}),_f.format.rgb=(...e)=>{const t=af(e,"rgba");return void 0===t[3]&&(t[3]=1),t},_f.autodetect.push({p:3,test:(...e)=>{if("array"===of(e=af(e,"rgba"))&&(3===e.length||4===e.length&&"number"==of(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});const qp=(e,t,r)=>{if(!qp[r])throw new Error("unknown blend mode "+r);return qp[r](e,t)},Wp=e=>(t,r)=>{const n=xf(r).rgb(),i=xf(t).rgb();return xf.rgb(e(n,i))},Zp=e=>(t,r)=>{const n=[];return n[0]=e(t[0],r[0]),n[1]=e(t[1],r[1]),n[2]=e(t[2],r[2]),n};qp.normal=Wp(Zp((e=>e))),qp.multiply=Wp(Zp(((e,t)=>e*t/255))),qp.screen=Wp(Zp(((e,t)=>255*(1-(1-e/255)*(1-t/255))))),qp.overlay=Wp(Zp(((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))))),qp.darken=Wp(Zp(((e,t)=>e>t?t:e))),qp.lighten=Wp(Zp(((e,t)=>e>t?e:t))),qp.dodge=Wp(Zp(((e,t)=>255===e||(e=t/255*255/(1-e/255))>255?255:e))),qp.burn=Wp(Zp(((e,t)=>255*(1-(1-t/255)/(e/255)))));const Yp=qp,{pow:Xp,sin:Kp,cos:Jp}=Math;const{floor:Qp,random:eg}=Math,{log:tg,pow:rg,floor:ng,abs:ig}=Math;function og(e,t=null){const r={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===of(e)&&(e=Object.values(e)),e.forEach((e=>{t&&"object"===of(e)&&(e=e[t]),null==e||isNaN(e)||(r.values.push(e),r.sum+=e,e<r.min&&(r.min=e),e>r.max&&(r.max=e),r.count+=1)})),r.domain=[r.min,r.max],r.limits=(e,t)=>ag(r,e,t),r}function ag(e,t="equal",r=7){"array"==of(e)&&(e=og(e));const{min:n,max:i}=e,o=e.values.sort(((e,t)=>e-t));if(1===r)return[n,i];const a=[];if("c"===t.substr(0,1)&&(a.push(n),a.push(i)),"e"===t.substr(0,1)){a.push(n);for(let e=1;e<r;e++)a.push(n+e/r*(i-n));a.push(i)}else if("l"===t.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");const e=Math.LOG10E*tg(n),t=Math.LOG10E*tg(i);a.push(n);for(let n=1;n<r;n++)a.push(rg(10,e+n/r*(t-e)));a.push(i)}else if("q"===t.substr(0,1)){a.push(n);for(let e=1;e<r;e++){const t=(o.length-1)*e/r,n=ng(t);if(n===t)a.push(o[n]);else{const e=t-n;a.push(o[n]*(1-e)+o[n+1]*e)}}a.push(i)}else if("k"===t.substr(0,1)){let e;const t=o.length,s=new Array(t),l=new Array(r);let c=!0,u=0,d=null;d=[],d.push(n);for(let e=1;e<r;e++)d.push(n+e/r*(i-n));for(d.push(i);c;){for(let e=0;e<r;e++)l[e]=0;for(let e=0;e<t;e++){const t=o[e];let n,i=Number.MAX_VALUE;for(let o=0;o<r;o++){const r=ig(d[o]-t);r<i&&(i=r,n=o),l[n]++,s[e]=n}}const n=new Array(r);for(let e=0;e<r;e++)n[e]=null;for(let r=0;r<t;r++)e=s[r],null===n[e]?n[e]=o[r]:n[e]+=o[r];for(let e=0;e<r;e++)n[e]*=1/l[e];c=!1;for(let e=0;e<r;e++)if(n[e]!==d[e]){c=!0;break}d=n,u++,u>200&&(c=!1)}const h={};for(let e=0;e<r;e++)h[e]=[];for(let r=0;r<t;r++)e=s[r],h[e].push(o[r]);let f=[];for(let e=0;e<r;e++)f.push(h[e][0]),f.push(h[e][h[e].length-1]);f=f.sort(((e,t)=>e-t)),a.push(f[0]);for(let e=1;e<f.length;e+=2){const t=f[e];isNaN(t)||-1!==a.indexOf(t)||a.push(t)}}return a}const sg=.022;
29function lg(e,t,r){return.2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(r/255,2.4)}const{sqrt:cg,pow:ug,min:dg,max:hg,atan2:fg,abs:pg,cos:gg,sin:mg,exp:yg,PI:_g}=Math;const vg={cool:()=>$p([xf.hsl(180,1,.9),xf.hsl(250,.7,.4)]),hot:()=>$p(["#000","#f00","#ff0","#fff"]).mode("rgb")},bg={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},xg=Object.keys(bg),wg=new Map(xg.map((e=>[e.toLowerCase(),e]))),Sg="function"==typeof Proxy?new Proxy(bg,{get(e,t){const r=t.toLowerCase();if(wg.has(r))return e[wg.get(r)]},getOwnPropertyNames:()=>Object.getOwnPropertyNames(xg)}):bg,kg=Sg,Tg=(...e)=>{e=af(e,"cmyk");const[t,r,n,i]=e,o=e.length>4?e[4]:1;return 1===i?[0,0,0,o]:[t>=1?0:255*(1-t)*(1-i),r>=1?0:255*(1-r)*(1-i),n>=1?0:255*(1-n)*(1-i),o]},{max:Ig}=Math,Mg=(...e)=>{let[t,r,n]=af(e,"rgb");t/=255,r/=255,n/=255;const i=1-Ig(t,Ig(r,n)),o=i<1?1/(1-i):0;return[(1-t-i)*o,(1-r-i)*o,(1-n-i)*o,i]};vf.prototype.cmyk=function(){return Mg(this._rgb)};Object.assign(xf,{cmyk:(...e)=>new vf(...e,"cmyk")}),_f.format.cmyk=Tg,_f.autodetect.push({p:2,test:(...e)=>{if("array"===of(e=af(e,"cmyk"))&&4===e.length)return"cmyk"}});const Eg=(...e)=>{const t=af(e,"hsla");let r=sf(e)||"lsa";return t[0]=df(t[0]||0)+"deg",t[1]=df(100*t[1])+"%",t[2]=df(100*t[2])+"%","hsla"===r||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),r="hsla"):t.length=3,`${r.substr(0,3)}(${t.join(" ")})`},Pg=(...e)=>{const t=af(e,"lab");let r=sf(e)||"lab";return t[0]=df(t[0])+"%",t[1]=df(t[1]),t[2]=df(t[2]),"laba"===r||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},Ag=(...e)=>{const t=af(e,"lch");let r=sf(e)||"lab";return t[0]=df(t[0])+"%",t[1]=df(t[1]),t[2]=isNaN(t[2])?"none":df(t[2])+"deg","lcha"===r||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},Cg=(...e)=>{const t=af(e,"lab");return t[0]=df(100*t[0])+"%",t[1]=hf(t[1]),t[2]=hf(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Rg=(...e)=>{const[t,r,n,...i]=af(e,"rgb"),[o,a,s]=Lp(t,r,n),[l,c,u]=Qf(o,a,s);return[l,c,u,...i.length>0&&i[0]<1?[i[0]]:[]]},Lg=(...e)=>{const t=af(e,"lch");return t[0]=df(100*t[0])+"%",t[1]=hf(t[1]),t[2]=isNaN(t[2])?"none":df(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:Og}=Math,Dg=(...e)=>{const t=af(e,"rgba");let r=sf(e)||"rgb";if("hsl"===r.substr(0,3))return Eg(Sp(t),r);if("lab"===r.substr(0,3)){const e=Rf();Cf("d50");const n=Pg(Bf(t),r);return Cf(e),n}if("lch"===r.substr(0,3)){const e=Rf();Cf("d50");const n=Ag(ep(t),r);return Cf(e),n}return"oklab"===r.substr(0,5)?Cg(Lp(t)):"oklch"===r.substr(0,5)?Lg(Rg(t)):(t[0]=Og(t[0]),t[1]=Og(t[1]),t[2]=Og(t[2]),("rgba"===r||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),r="rgba"),`${r.substr(0,3)}(${t.slice(0,"rgb"===r?3:4).join(" ")})`)},zg=(...e)=>{e=af(e,"lch");const[t,r,n,...i]=e,[o,a,s]=Wf(t,r,n),[l,c,u]=Rp(o,a,s);return[l,c,u,...i.length>0&&i[0]<1?[i[0]]:[]]},Fg=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,Ng=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Bg=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,jg=/\s*/.source,Vg=/\s+/.source,Gg=/\s*,\s*/.source,Ug=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,$g=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Hg=new RegExp("^rgba?\\("+jg+[Fg,Fg,Fg].join(Vg)+$g+"\\)$"),qg=new RegExp("^rgb\\("+jg+[Fg,Fg,Fg].join(Gg)+jg+"\\)$"),Wg=new RegExp("^rgba\\("+jg+[Fg,Fg,Fg,Ng].join(Gg)+jg+"\\)$"),Zg=new RegExp("^hsla?\\("+jg+[Ug,Bg,Bg].join(Vg)+$g+"\\)$"),Yg=new RegExp("^hsl?\\("+jg+[Ug,Bg,Bg].join(Gg)+jg+"\\)$"),Xg=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Kg=new RegExp("^lab\\("+jg+[Ng,Ng,Ng].join(Vg)+$g+"\\)$"),Jg=new RegExp("^lch\\("+jg+[Ng,Ng,Ug].join(Vg)+$g+"\\)$"),Qg=new RegExp("^oklab\\("+jg+[Ng,Ng,Ng].join(Vg)+$g+"\\)$"),em=new RegExp("^oklch\\("+jg+[Ng,Ng,Ug].join(Vg)+$g+"\\)$"),{round:tm}=Math,rm=e=>e.map(((e,t)=>t<=2?tf(tm(e),0,255):e)),nm=(e,t=0,r=100,n=!1)=>
29("string"==typeof e&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,e=n?t+.5*(e+1)*(r-t):t+e*(r-t)),+e),im=(e,t)=>"none"===e?t:e,om=e=>{if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t;if(_f.format.named)try{return _f.format.named(e)}catch(e){}if((t=e.match(Hg))||(t=e.match(qg))){let e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+nm(im(e[t],0),0,255);e=rm(e);const r=void 0!==t[4]?+nm(t[4],0,1):1;return e[3]=r,e}if(t=e.match(Wg)){const e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+nm(e[t],0,255);return e}if((t=e.match(Zg))||(t=e.match(Yg))){const e=t.slice(1,4);e[0]=+im(e[0].replace("deg",""),0),e[1]=.01*+nm(im(e[1],0),0,100),e[2]=.01*+nm(im(e[2],0),0,100);const r=rm(wp(e)),n=void 0!==t[4]?+nm(t[4],0,1):1;return r[3]=n,r}if(t=e.match(Xg)){const e=t.slice(1,4);e[1]*=.01,e[2]*=.01;const r=wp(e);for(let e=0;e<3;e++)r[e]=tm(r[e]);return r[3]=+t[4],r}if(t=e.match(Kg)){const e=t.slice(1,4);e[0]=nm(im(e[0],0),0,100),e[1]=nm(im(e[1],0),-125,125,!0),e[2]=nm(im(e[2],0),-125,125,!0);const r=Rf();Cf("d50");const n=rm(zf(e));Cf(r);const i=void 0!==t[4]?+nm(t[4],0,1):1;return n[3]=i,n}if(t=e.match(Jg)){const e=t.slice(1,4);e[0]=nm(e[0],0,100),e[1]=nm(im(e[1],0),0,150,!1),e[2]=+im(e[2].replace("deg",""),0);const r=Rf();Cf("d50");const n=rm(Zf(e));Cf(r);const i=void 0!==t[4]?+nm(t[4],0,1):1;return n[3]=i,n}if(t=e.match(Qg)){const e=t.slice(1,4);e[0]=nm(im(e[0],0),0,1),e[1]=nm(im(e[1],0),-.4,.4,!0),e[2]=nm(im(e[2],0),-.4,.4,!0);const r=rm(Rp(e)),n=void 0!==t[4]?+nm(t[4],0,1):1;return r[3]=n,r}if(t=e.match(em)){const e=t.slice(1,4);e[0]=nm(im(e[0],0),0,1),e[1]=nm(im(e[1],0),0,.4,!1),e[2]=+im(e[2].replace("deg",""),0);const r=rm(zg(e)),n=void 0!==t[4]?+nm(t[4],0,1):1;return r[3]=n,r}};om.test=e=>Hg.test(e)||Zg.test(e)||Kg.test(e)||Jg.test(e)||Qg.test(e)||em.test(e)||qg.test(e)||Wg.test(e)||Yg.test(e)||Xg.test(e)||"transparent"===e;const am=om;vf.prototype.css=function(e){return Dg(this._rgb,e)};xf.css=(...e)=>new vf(...e,"css"),_f.format.css=am,_f.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&"string"===of(e)&&am.test(e))return"css"}}),_f.format.gl=(...e)=>{const t=af(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};xf.gl=(...e)=>new vf(...e,"gl"),vf.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},vf.prototype.hex=function(e){return Mf(this._rgb,e)};xf.hex=(...e)=>new vf(...e,"hex"),_f.format.hex=Tf,_f.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&"string"===of(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:sm}=Math,lm=e=>{const t=e/100;let r,n,i;return t<66?(r=255,n=t<6?0:-155.25485562709179-.44596950469579133*(n=t-2)+104.49216199393888*sm(n),i=t<20?0:.8274096064007395*(i=t-10)-254.76935184120902+115.67994401066147*sm(i)):(r=351.97690566805693+.114206453784165*(r=t-55)-40.25366309332127*sm(r),n=325.4494125711974+.07943456536662342*(n=t-50)-28.0852963507957*sm(n),i=255),[r,n,i,1]},{round:cm}=Math,um=(...e)=>{const t=af(e,"rgb"),r=t[0],n=t[2];let i=1e3,o=4e4;let a;for(;o-i>.4;){a=.5*(o+i);const e=lm(a);e[2]/e[0]>=n/r?o=a:i=a}return cm(a)};vf.prototype.temp=vf.prototype.kelvin=vf.prototype.temperature=function(){return um(this._rgb)};const dm=(...e)=>new vf(...e,"temp");Object.assign(xf,{temp:dm,kelvin:dm,temperature:dm}),_f.format.temp=_f.format.kelvin=_f.format.temperature=lm,vf.prototype.oklch=function(){return Rg(this._rgb)};Object.assign(xf,{oklch:(...e)=>new vf(...e,"oklch")}),_f.format.oklch=zg,_f.autodetect.push({p:2,test:(...e)=>{if("array"===of(e=af(e,"oklch"))&&3===e.length)return"oklch"}}),Object.assign(xf,{analyze:og,average:(e,t="lrgb",r=null)=>{const n=e.length;r||(r=Array.from(new Array(n)).map((()=>1)));const i=n/r.reduce((function(e,t){return e+t}));if(r.forEach(((e,t)=>{r[t]*=i})),e=e.map((e=>new vf(e))),"lrgb"===t)return Gp(e,r);const o=e.shift(),a=o.get(t),s=[];let l=0,c=0;for(let e=0;e<a.length;e++)if(a[e]=(a[e]||0)*r[0],s.push(isNaN(a[e])?0:r[0]),"h"===t.charAt(e)&&!isNaN(a[e])){const t=a[e]/180*Np;l+=Bp(t)*r[0],c+=jp(t)*r[0]}let u=o.alpha()*r[0];e.forEach(((e,n)=>{const i=e.get(t);u+=e.alpha()*r[n+1];for(let e=0;e<a.length;e++)if(!isNaN(i[e]))if(s[e]+=r[n+1],"h"===t.charAt(e)){const t=i[e]/180*Np;l+=Bp(t)*r[n+1],c+=jp(t)*r[n+1]}else a[e]+=i[e]*r[n+1]}));for(let e=0;e<a.length;e++)if("h"===t.charAt(e)){let t=Vp(c/s[e],l/s[e])/Np*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;a[e]=t}else a[e]=a[e]/s[e];return u/=n,new vf(a,t).alpha(u>.99999?1:u,!0)},bezier:e=>{const t=function(e){let t,r,n,i;if(2===(e=e.map((e=>new vf(e)))).length)[r,n]=e.map((e=>e.lab())),t=function(e){const t=[0,1,2].map((t=>r[t]+e*(n[t]-r[t])));return new vf(t,"lab")};else if(3===e.length)[r,n,i]=e.map((e=>e.lab())),t=function(e){const t=[0,1,2].map((t=>(1-e)*(1-e)*r[t]+2*(1-e)*e*n[t]+e*e*i[t]));return new vf(t,"lab")};else if(4===e.length){let o;[r,n,i,o]=e.map((e=>e.lab())),t=function(e){const t=[0,1,2].map((t=>(1-e)*(1-e)*(1-e)*r[t]+3*(1-e)*(1-e)*e*n[t]+3*(1-e)*e*e*i[t]+e*e*e*o[t]));return new vf(t,"lab")}}else{if(!(e.length>=5))throw new RangeError("No point in running bezier with only one color.");{let r,n,i;r=e.map((e=>e.lab())),i=e.length-1,n=function(e){let t=[1,1];for(let r=1;r<e;r++){let e=[1];for(let r=1;r<=t.length;r++)e[r]=(t[r]||0)+t[r-1];t=e}return t}(i),t=function(e){const t=1-e,o=[0,1,2].map((o=>r.reduce(((r,a,s)=>r+n[s]*t**(i-s)*e**s*a[o]),0)));return new vf(o,"lab")}}}return t}(e);return t.scale=()=>$p(t),t},blend:Yp,brewer:kg,Color:vf,colors:wf,contrast:(e,t)=>
29{e=new vf(e),t=new vf(t);const r=e.luminance(),n=t.luminance();return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)},contrastAPCA:(e,t)=>{e=new vf(e),t=new vf(t),e.alpha()<1&&(e=$f(t,e,e.alpha(),"rgb"));const r=lg(...e.rgb()),n=lg(...t.rgb()),i=r>=sg?r:r+Math.pow(sg-r,1.414),o=n>=sg?n:n+Math.pow(sg-n,1.414),a=Math.pow(o,.56)-Math.pow(i,.57),s=Math.pow(o,.65)-Math.pow(i,.62),l=Math.abs(o-i)<5e-4?0:i<o?1.14*a:1.14*s;return 100*(Math.abs(l)<.1?0:l>0?l-.027:l+.027)},cubehelix:function(e=300,t=-1.5,r=1,n=1,i=[0,1]){let o,a=0;"array"===of(i)?o=i[1]-i[0]:(o=0,i=[i,i]);const s=function(s){const l=ff*((e+120)/360+t*s),c=Xp(i[0]+o*s,n),u=(0!==a?r[0]+s*a:r)*c*(1-c)/2,d=Jp(l),h=Kp(l);return xf(rf([255*(c+u*(-.14861*d+1.78277*h)),255*(c+u*(-.29227*d-.90649*h)),255*(c+u*(1.97294*d)),1]))};return s.start=function(t){return null==t?e:(e=t,s)},s.rotations=function(e){return null==e?t:(t=e,s)},s.gamma=function(e){return null==e?n:(n=e,s)},s.hue=function(e){return null==e?r:("array"===of(r=e)?(a=r[1]-r[0],0===a&&(r=r[1])):a=0,s)},s.lightness=function(e){return null==e?i:("array"===of(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=()=>xf.scale(s),s.hue(r),s},deltaE:function(e,t,r=1,n=1,i=1){var o=function(e){return 360*e/(2*_g)},a=function(e){return 2*_g*e/360};e=new vf(e),t=new vf(t);const[s,l,c]=Array.from(e.lab()),[u,d,h]=Array.from(t.lab()),f=(s+u)/2,p=(cg(ug(l,2)+ug(c,2))+cg(ug(d,2)+ug(h,2)))/2,g=.5*(1-cg(ug(p,7)/(ug(p,7)+ug(25,7)))),m=l*(1+g),y=d*(1+g),_=cg(ug(m,2)+ug(c,2)),v=cg(ug(y,2)+ug(h,2)),b=(_+v)/2,x=o(fg(c,m)),w=o(fg(h,y)),S=x>=0?x:x+360,k=w>=0?w:w+360,T=pg(S-k)>180?(S+k+360)/2:(S+k)/2,I=1-.17*gg(a(T-30))+.24*gg(a(2*T))+.32*gg(a(3*T+6))-.2*gg(a(4*T-63));let M=k-S;M=pg(M)<=180?M:k<=S?M+360:M-360,M=2*cg(_*v)*mg(a(M)/2);const E=u-s,P=v-_,A=1+.015*ug(f-50,2)/cg(20+ug(f-50,2)),C=1+.045*b,R=1+.015*b*I,L=30*yg(-ug((T-275)/25,2)),O=-(2*cg(ug(b,7)/(ug(b,7)+ug(25,7))))*mg(2*a(L)),D=cg(ug(E/(r*A),2)+ug(P/(n*C),2)+ug(M/(i*R),2)+O*(P/(n*C))*(M/(i*R)));return hg(0,dg(100,D))},distance:function(e,t,r="lab"){e=new vf(e),t=new vf(t);const n=e.get(r),i=t.get(r);let o=0;for(let e in n){const t=(n[e]||0)-(i[e]||0);o+=t*t}return Math.sqrt(o)},input:_f,interpolate:$f,limits:ag,mix:$f,random:()=>{let e="#";for(let t=0;t<6;t++)e+="0123456789abcdef".charAt(Qp(16*eg()));return new vf(e,"hex")},scale:$p,scales:vg,valid:(...e)=>{try{return new vf(...e),!0}catch(e){return!1}}});const hm=xf;var fm=$u('<div class="map-wrapper svelte-1b8lovz"><div class="map-container svelte-1b8lovz"></div></div>');function pm(e,t){Zs(t,!0);let r,n,i=fh(t,"farmFieldsGeojson",3,null),o=fh(t,"evapotranspirationData",3,null),a=fh(t,"mapboxPublicToken",3,""),s=null,l=null;yh((()=>{if(!n)return;let e=zh().latLngBounds(zh().latLng(54.5,8),zh().latLng(57.8,15.2));i()&&(e=Fh(i())),r=zh().map(n,{maxZoom:bh.leaflet.defaultLayerParams.maxZoom}).fitBounds(e);const t=zh().tileLayer("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",...bh.leaflet.defaultLayerParams}),c=zh().tileLayer(`https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.webp?access_token=${a()}`,{attribution:"© Mapbox",...bh.leaflet.defaultLayerParams}),u={OpenStreetMap:t,"Mapbox Satellite":c};if(c.addTo(r),zh().control.layers(u,{}).addTo(r),i()&&zh().geoJSON(i(),{style:{color:"orange",weight:2.6,opacity:1,fillOpacity:0},onEachFeature:(e,t)=>{e.properties?.name?t.bindPopup(`<strong>${e.properties.name}</strong>`):t.bindPopup("Field")}}).addTo(r),o()&&i()){const e=i().features[0].id.toString();o()[e]&&function(e){if(!r||!e)return;const t=e.features.map((e=>Number(e.properties.aggregated.value))),[n,i]=[Math.min(...t),Math.max(...t)],o=hm.scale("Blues").domain([n,i]);s&&r.removeLayer(s),s=zh().geoJSON(e,{style:e=>({fillColor:o(e.properties.aggregated.value).toString(),weight:.2,color:"white",fillOpacity:.7}),onEachFeature:(e,t)=>{const r=e.properties.aggregated.value;t.bindPopup(`<strong>ET value:</strong> ${Number(r).toFixed(2)} mm`)}}).addTo(r),l&&r.removeControl(l),l=new(zh().Control)({position:"bottomright"}),l.onAdd=()=>{const e=zh().DomUtil.create("div","legend");return e.innerHTML=`\n      <div class="legend-gradient" style="background: linear-gradient(to right, ${o(n)}, ${o(i)});"></div>\n      <div class="legend-labels">
29\n        <span>${n.toFixed(2)}</span><span>${i.toFixed(2)}</span>\n      </div>\n      <div class="legend-title">Evapotranspiration (mm)</div>`,e},l.addTo(r)}(o()[e])}})),_h((()=>{r&&r.remove()}));var c=fm();nh(uc(c),(e=>n=e),(()=>n)),Os(c),Yu(e,c),Ys()}Gs=!0;var gm=/\s+/g,mm=(...e)=>{const t=[],r=e=>{if(!e&&0!==e&&0n!==e)return;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)r(e[t]);return}const n=typeof e;if("string"===n||"number"===n||"bigint"===n){if("number"===n&&e!=e)return;t.push(String(e))}else if("object"===n){const r=Object.keys(e);for(let n=0,i=r.length;n<i;n++){const i=r[n];e[i]&&t.push(i)}}};for(let t=0,n=e.length;t<n;t++){const n=e[t];null!=n&&r(n)}return t.length>0?"string"==typeof(n=t.join(" "))&&n?n.replace(gm," ").trim():n:void 0;var n},ym=e=>!1===e?"false":!0===e?"true":0===e?"0":e,_m=e=>{if(!e||"object"!=typeof e)return!0;for(const t in e)return!1;return!0},vm=(e,t)=>{for(let r=0;r<e.length;r++){const n=e[r];Array.isArray(n)?vm(n,t):n&&t.push(n)}};var bm=(...e)=>{const t=[];vm(e,t);const r=[];for(let e=0;e<t.length;e++)t[e]&&r.push(t[e]);return r},xm=(e,t)=>{const r={};for(const n in e){const i=e[n];if(n in t){const e=t[n];Array.isArray(i)||Array.isArray(e)?r[n]=bm(e,i):r[n]="object"==typeof i&&"object"==typeof e&&i&&e?xm(i,e):e+" "+i}else r[n]=i}for(const n in t)n in e||(r[n]=t[n]);return r},wm={twMerge:!0,twMergeConfig:{}};var Sm=function(){let e=null,t={},r=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(t){e=t},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(e){t=e},get didTwMergeConfigChange(){return r},set didTwMergeConfigChange(e){r=e},reset(){e=null,t={},r=!1}}}(),km=i(2342),Tm=(e,t)=>{const r=mm(e);
29return r&&(t?.twMerge??1)?(Sm.cachedTwMerge&&!Sm.didTwMergeConfigChange||(Sm.didTwMergeConfigChange=!1,Sm.cachedTwMerge=(n=Sm.cachedTwMergeConfig,_m(n)?km.twMerge:(0,km.extendTailwindMerge)({...n,extend:{theme:n.theme,classGroups:n.classGroups,conflictingClassGroupModifiers:n.conflictingClassGroupModifiers,conflictingClassGroups:n.conflictingClassGroups,...n.extend}}))),Sm.cachedTwMerge(r)||void 0):r;var n},{createTV:Im,tv:Mm}=(e=>{const t=(t,r)=>{const{extend:n=null,slots:i={},variants:o={},compoundVariants:a=[],compoundSlots:s=[],defaultVariants:l={}}=t,c={...wm,...r},u=n?.base?mm(n.base,t?.base):t?.base,d=n?.variants&&!_m(n.variants)?xm(o,n.variants):o,h=n?.defaultVariants&&!_m(n.defaultVariants)?{...n.defaultVariants,...l}:l;_m(c.twMergeConfig)||((e,t)=>{if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const o=r[i];if(!n.includes(o))return!1;if(e[o]!==t[o])return!1}return!0})(c.twMergeConfig,Sm.cachedTwMergeConfig)||(Sm.didTwMergeConfigChange=!0,Sm.cachedTwMergeConfig=c.twMergeConfig);const f=_m(n?.slots),p=_m(i)?{}:{base:mm(t?.base,f&&n?.base),...i},g=f?p:((e,t)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];e[r]=r in e?mm(e[r],n):n}return e})({...n?.slots},_m(p)?{base:t?.base}:p),m=_m(n?.compoundVariants)?a:bm(n?.compoundVariants,a),y=t=>{if(_m(d)&&_m(i)&&f)return e(u,t?.class,t?.className)(c);if(m&&!Array.isArray(m))throw new TypeError('The "compoundVariants" prop must be an array. Received: '+typeof m);if(s&&!Array.isArray(s))throw new TypeError('The "compoundSlots" prop must be an array. Received: '+typeof s);const r=(e,r=d,n=null,i=null)=>{const o=r[e];if(!o||_m(o))return null;const a=i?.[e]??t?.[e];if(null===a)return null;const s=ym(a);if("object"==typeof s)return null;const l=h?.[e];return o[(null!=s?s:ym(l))||"false"]},n=(e,t)=>{if(!d||"object"!=typeof d)return null;const n=[];for(const i in d){const o=r(i,d,e,t),a="base"===e&&"string"==typeof o?o:o&&o[e];a&&n.push(a)}return n},o={};for(const e in t){const r=t[e];void 0!==r&&(o[e]=r)}const a=(e,r)=>{const n="object"==typeof t?.[e]?{[e]:t[e]?.initial}:{};return{...h,...o,...n,...r}},l=(e=[],t)=>{const r=[],n=e.length;for(let i=0;i<n;i++){const{class:n,className:o,...s}=e[i];let l=!0;const c=a(null,t);for(const e in s){const t=s[e],r=c[e];if(Array.isArray(t)){if(!t.includes(r)){l=!1;break}}else{if(!(null!=t&&!1!==t||null!=r&&!1!==r))continue;if(r!==t){l=!1;break}}}l&&(n&&r.push(n),o&&r.push(o))}return r},p=t=>{const r=l(m,t);if(!Array.isArray(r))return r;const n={},i=e;for(let e=0;e<r.length;e++){const t=r[e];if("string"==typeof t)n.base=i(n.base,t)(c);else if("object"==typeof t)for(const e in t)n[e]=i(n[e],t[e])(c)}return n},y=e=>{if(s.length<1)return null;const t={},r=a(null,e);for(let e=0;e<s.length;e++){const{slots:n=[],class:i,className:o,...a}=s[e];if(!_m(a)){let e=!0;for(const t in a){const n=r[t],i=a[t];if(void 0===n||(Array.isArray(i)?!i.includes(n):i!==n)){e=!1;break}}if(!e)continue}for(let e=0;e<n.length;e++){const r=n[e];t[r]||(t[r]=[]),t[r].push([i,o])}}return t};if(!_m(i)||!f){const t={};if("object"==typeof g&&!_m(g)){const r=e;for(const e in g)t[e]=t=>{const i=p(t),o=y(t);return r(g[e],n(e,t),i?i[e]:void 0,o?o[e]:void 0,t?.class,t?.className)(c)}}return t}return e(u,(()=>{if(!d)return null;const e=Object.keys(d),t=[];for(let n=0;n<e.length;n++){const i=r(e[n],d);i&&t.push(i)}return t})(),l(m),t?.class,t?.className)(c)};return y.variantKeys=(()=>{if(d&&"object"==typeof d)return Object.keys(d)})(),y.extend=n,y.base=u,y.slots=g,y.variants=d,y.defaultVariants=h,y.c
29ompoundSlots=s,y.compoundVariants=m,y};return{tv:t,createTV:e=>(r,n)=>t(r,n?xm(e,n):e)}})(((...e)=>t=>Tm(e,t)));const Em=Mm({base:"focus:outline-hidden whitespace-normal disabled:cursor-not-allowed disabled:opacity-50",variants:{color:{primary:"text-primary-500 focus:ring-primary-400 hover:bg-primary-200 dark:hover:bg-primary-800 dark:hover:text-primary-300",secondary:"text-secondary-500 focus:ring-secondary-400 hover:bg-secondary-200 dark:hover:bg-secondary-800 dark:hover:text-secondary-300",gray:"text-gray-500 focus:ring-gray-400 hover:bg-gray-200 dark:hover:bg-gray-800 dark:hover:text-gray-300",red:"text-red-500 focus:ring-red-400 hover:bg-red-200 dark:hover:bg-red-800 dark:hover:text-red-300",orange:"text-orange-500 focus:ring-orange-400 hover:bg-orange-200 dark:hover:bg-orange-800 dark:hover:text-orange-300",amber:"text-amber-500 focus:ring-amber-400 hover:bg-amber-200 dark:hover:bg-amber-800 dark:hover:text-amber-300",yellow:"text-yellow-500 focus:ring-yellow-400 hover:bg-yellow-200 dark:hover:bg-yellow-800 dark:hover:text-yellow-300",lime:"text-lime-500 focus:ring-lime-400 hover:bg-lime-200 dark:hover:bg-lime-800 dark:hover:text-lime-300",green:"text-green-500 focus:ring-green-400 hover:bg-green-200 dark:hover:bg-green-800 dark:hover:text-green-300",emerald:"text-emerald-500 focus:ring-emerald-400 hover:bg-emerald-200 dark:hover:bg-emerald-800 dark:hover:text-emerald-300",teal:"text-teal-500 focus:ring-teal-400 hover:bg-teal-200 dark:hover:bg-teal-800 dark:hover:text-teal-300",cyan:"text-cyan-500 focus:ring-cyan-400 hover:bg-cyan-200 dark:hover:bg-cyan-800 dark:hover:text-cyan-300",sky:"text-sky-500 focus:ring-sky-400 hover:bg-sky-200 dark:hover:bg-sky-800 dark:hover:text-sky-300",blue:"text-blue-500 focus:ring-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800 dark:hover:text-blue-300",indigo:"text-indigo-500 focus:ring-indigo-400 hover:bg-indigo-200 dark:hover:bg-indigo-800 dark:hover:text-indigo-300",violet:"text-violet-500 focus:ring-violet-400 hover:bg-violet-200 dark:hover:bg-violet-800 dark:hover:text-violet-300",purple:"text-purple-500 focus:ring-purple-400 hover:bg-purple-200 dark:hover:bg-purple-800 dark:hover:text-purple-300",fuchsia:"text-fuchsia-500 focus:ring-fuchsia-400 hover:bg-fuchsia-200 dark:hover:bg-fuchsia-800 dark:hover:text-fuchsia-300",pink:"text-pink-500 focus:ring-pink-400 hover:bg-pink-200 dark:hover:bg-pink-800 dark:hover:text-pink-300",rose:"text-rose-500 focus:ring-rose-400 hover:bg-rose-200 dark:hover:bg-rose-800 dark:hover:text-rose-300",none:""},size:{xs:"m-0.5 rounded-xs focus:ring-1 p-0.5",sm:"m-0.5 rounded-sm focus:ring-1 p-0.5",md:"m-0.5 rounded-lg focus:ring-2 p-1.5",lg:"m-0.5 rounded-lg focus:ring-2 p-2.5"}},defaultVariants:{color:"gray",size:"md",href:null},slots:{svg:""},compoundVariants:[{size:"xs",class:{svg:"w-3 h-3"}},{size:"sm",class:{svg:"w-3.5 h-3.5"}},{size:["md","lg"],class:{svg:"w-5 h-5"}},{size:["xs","sm","md","lg"],color:"none",class:"focus:ring-0 rounded-none m-0"}]}),Pm=Symbol("dismissable");function Am(e){return Ws(Pm,{dismiss:e})}var Cm=$u('<span class="sr-only"> </span>'),Rm=qu('<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>'),Lm=$u("<button><!> <!></button>"),Om=$u('<span class="sr-only"> </span>'),Dm=qu('<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>'),zm=$u("<a><!> <!></a>");function Fm(e,t){Zs(t,!0);let r=fh(t,"color",3,"gray"),n=fh(t,"name",3,"Close"),i=fh(t,"size",3,"md"),o=lh(t,["$$slots","$$events","$$legacy","children","color","onclick","name","ariaLabel","size","class","svgClass"]);const a=Dl((()=>Em({color:r(),size:i()}))),s=Dl((()=>yu(a).base)),l=Dl((()=>yu(a).svg)),c=function(){const e=qs(Pm);return e}();function u(e){t.onclick?.(e),e.defaultPrevented||c?.dismiss?.(e)}var d=Zu(),h=dc(d),f=e=>{var r=Lm();Nd(r,(e=>({type:"button",...o,class:e,onclick:u,"aria-label":t.ariaLabel??n()})),[()=>yu(s)({class:yd(t.class)})]);var i=uc(r),a=e=>{var t=Cm(),r=uc(t,!0);Os(t),Pc((()=>
29Ju(r,n()))),Yu(e,t)};ad(i,(e=>{n()&&e(a)}));var c=hc(i,2),d=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)},h=e=>{var r=Rm();Pc((e=>wd(r,0,e)),[()=>_d(yu(l)({class:t.svgClass}))]),Yu(e,r)};ad(c,(e=>{t.children?e(d):e(h,!1)})),Os(r),Yu(e,r)},p=e=>{var r=zm();Nd(r,(e=>({...o,onclick:u,class:e,"aria-label":t.ariaLabel??n()})),[()=>yu(s)({class:yd(t.class)})]);var i=uc(r),a=e=>{var t=Om(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,n()))),Yu(e,t)};ad(i,(e=>{n()&&e(a)}));var c=hc(i,2),d=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)},h=e=>{var t=Dm();Pc((e=>wd(t,0,e)),[()=>_d(yu(l)())]),Yu(e,t)};ad(c,(e=>{t.children?e(d):e(h,!1)})),Os(r),Yu(e,r)};ad(h,(e=>{void 0===t.href?e(f):e(p,!1)})),Yu(e,d),Ys()}const Nm=Math.min,Bm=Math.max,jm=Math.round,Vm=Math.floor,Gm=e=>({x:e,y:e}),Um={left:"right",right:"left",bottom:"top",top:"bottom"},$m={start:"end",end:"start"};function Hm(e,t,r){return Bm(e,Nm(t,r))}function qm(e,t){return"function"==typeof e?e(t):e}function Wm(e){return e.split("-")[0]}function Zm(e){return e.split("-")[1]}function Ym(e){return"x"===e?"y":"x"}function Xm(e){return"y"===e?"height":"width"}const Km=new Set(["top","bottom"]);function Jm(e){return Km.has(Wm(e))?"y":"x"}function Qm(e){return Ym(Jm(e))}function ey(e){return e.replace(/start|end/g,(e=>$m[e]))}const ty=["left","right"],ry=["right","left"],ny=["top","bottom"],iy=["bottom","top"];function oy(e,t,r,n){const i=Zm(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ry:ty:t?ty:ry;case"left":case"right":return t?ny:iy;default:return[]}}(Wm(e),"start"===r,n);return i&&(o=o.map((e=>e+"-"+i)),t&&(o=o.concat(o.map(ey)))),o}function ay(e){return e.replace(/left|right|bottom|top/g,(e=>Um[e]))}function sy(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ly(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function cy(e,t,r){let{reference:n,floating:i}=e;const o=Jm(t),a=Qm(t),s=Xm(a),l=Wm(t),c="y"===o,u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,h=n[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:n.y-i.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Zm(t)){case"start":f[a]-=h*(r&&c?-1:1);break;case"end":f[a]+=h*(r&&c?-1:1)}return f}async function uy(e,t){var r;void 0===t&&(t={});const{x:n,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=qm(t,e),p=sy(f),g=s[h?"floating"===d?"reference":"floating":d],m=ly(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(g)))||r?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,_=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),v=await(null==o.isElement?void 0:o.isElement(_))&&await(null==o.getScale?void 0:o.getScale(_))||{x:1,y:1},b=ly(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:_,strategy:l}):y);return{top:(m.top-b.top+p.top)/v.y,bottom:(b.bottom-m.bottom+p.bottom)/v.y,left:(m.left-b.left+p.left)/v.x,right:(b.right-m.right+p.right)/v.x}}const dy=new Set(["left","top"]);function hy(){return"undefined"!=typeof window}function fy(e){return my(e)?(e.nodeName||"").toLowerCase():"#document"}function py(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function gy(e){var t;return null==(t=(my(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function my(e){return!!hy()&&(e instanceof Node||e instanceof py(e).Node)}function yy(e){return!!hy()&&(e instanceof Element||e instanceof py(e).Element)}function _y(e){return!!hy()&&(e instanceof HTMLElement||e instanceof py(e).HTMLElement)}function vy(e){return!(!hy()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof py(e).ShadowRoot)}
vendor: 13,153 bytes, line 29
29const by=new Set(["inline","contents"]);function xy(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Ly(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!by.has(i)}const wy=new Set(["table","td","th"]);function Sy(e){return wy.has(fy(e))}const ky=[":popover-open",":modal"];function Ty(e){return ky.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}const Iy=["transform","translate","scale","rotate","perspective"],My=["transform","translate","scale","rotate","perspective","filter"],Ey=["paint","layout","strict","content"];function Py(e){const t=Ay(),r=yy(e)?Ly(e):e;return Iy.some((e=>!!r[e]&&"none"!==r[e]))||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||My.some((e=>(r.willChange||"").includes(e)))||Ey.some((e=>(r.contain||"").includes(e)))}function Ay(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Cy=new Set(["html","body","#document"]);function Ry(e){return Cy.has(fy(e))}function Ly(e){return py(e).getComputedStyle(e)}function Oy(e){return yy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dy(e){if("html"===fy(e))return e;const t=e.assignedSlot||e.parentNode||vy(e)&&e.host||gy(e);return vy(t)?t.host:t}function zy(e){const t=Dy(e);return Ry(t)?e.ownerDocument?e.ownerDocument.body:e.body:_y(t)&&xy(t)?t:zy(t)}function Fy(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const i=zy(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),a=py(i);if(o){const e=Ny(a);return t.concat(a,a.visualViewport||[],xy(i)?i:[],e&&r?Fy(e):[])}return t.concat(i,Fy(i,[],r))}function Ny(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function By(e){const t=Ly(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=_y(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=jm(r)!==o||jm(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function jy(e){return yy(e)?e:e.contextElement}function Vy(e){const t=jy(e);if(!_y(t))return Gm(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=By(t);let a=(o?jm(r.width):r.width)/n,s=(o?jm(r.height):r.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Gy=Gm(0);function Uy(e){const t=py(e);return Ay()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Gy}function $y(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const i=e.getBoundingClientRect(),o=jy(e);let a=Gm(1);t&&(n?yy(n)&&(a=Vy(n)):a=Vy(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==py(e))&&t}(o,r,n)?Uy(o):Gm(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const e=py(o),t=n&&yy(n)?py(n):n;let r=e,i=Ny(r);for(;i&&n&&t!==r;){const e=Vy(i),t=i.getBoundingClientRect(),n=Ly(i),o=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=a,r=py(i),i=Ny(r)}}return ly({width:u,height:d,x:l,y:c})}function Hy(e,t){const r=Oy(e).scrollLeft;return t?t.left+r:$y(gy(e)).left+r}function qy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Hy(e,r),y:r.top+t.scrollTop}}const Wy=new Set(["absolute","fixed"]);function Zy(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=py(e),n=gy(e),i=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=Ay();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}const c=Hy(n);if(c<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,a=Math.abs(n.clientWidth-t.clientWidth-i);a<=25&&(o-=a)}else c<=25&&(o+=c);return{width:o,height:a,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=gy(e),r=Oy(e),n=e.ownerDocument.body,i=Bm(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Bm(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Hy(e);const s=-r.scrollTop;return"rtl"===Ly(n).direction&&(a+=Bm(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:s}}(gy(e));else if(yy(t))n=function(e,t){const r=$y(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=_y(e)?Vy(e):Gm(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:n*o.y}}(t,r);else{const r=Uy(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ly(n)}function Yy(e,t){const r=Dy(e);return!(r===t||!yy(r)||Ry(r))&&("fixed"===Ly(r).position||Yy(r,t))}function Xy(e,t,r){const n=_y(t),i=gy(t),o="fixed"===r,a=$y(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Gm(0);function c(){l.x=Hy(i)}if(n||!n&&!o)if(("body"!==fy(t)||xy(i))&&(s=Oy(t)),n){const e=$y(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&c();o&&!n&&i&&c();const u=!i||n||o?Gm(0):qy(i,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function Ky(e){return"static"===Ly(e).position}function Jy(e,t){if(!_y(e)||"fixed"===Ly(e).position)return null;if(t)return t(e);let r=e.offsetParent;return gy(e)===r&&(r=r.ownerDocument.body),r}function Qy(e,t){const r=py(e);if(Ty(e))return r;if(!_y(e)){let t=Dy(e);for(;t&&!Ry(t);){if(yy(t)&&!Ky(t))return t;t=Dy(t)}return r}let n=Jy(e,t);for(;n&&Sy(n)&&Ky(n);)n=Jy(n,t);return n&&Ry(n)&&Ky(n)&&!Py(n)?r:n||function(e){let t=Dy(e);for(;_y(t)&&!Ry(t);){if(Py(t))return t;if(Ty(t))return null;t=Dy(t)}return null}(e)||r}const e_={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o="fixed"===i,a=gy(n),s=!!t&&Ty(t.floating);if(n===a||s&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Gm(1);const u=Gm(0),d=_y(n);if((d||!d&&!o)&&(("body"!==fy(n)||xy(a))&&(l=Oy(n)),_y(n))){const e=$y(n);c=Vy(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const h=!a||d||o?Gm(0):qy(a,l);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:r.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:gy,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o="clippingAncestors"===r?Ty(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Fy(e,[],!1).filter((e=>yy(e)&&"body"!==fy(e))),i=null;const o="fixed"===Ly(e).position;let a=o?Dy(e):e;for(;yy(a)&&!Ry(a);){const t=Ly(a),r=Py(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&i&&Wy.has(i.position)||xy(a)&&!r&&Yy(e,a))?n=n.filter((e=>e!==a)):i=t,a=Dy(a)}return t.set(e,n),n}(t,this._c):[].concat(r),a=[...o,n],s=a[0],l=a.reduce(((e,r)=>{const n=Zy(t,r,i);return e.top=Bm(n.top,e.top),e.right=Nm(n.right,e.right),e.bottom=Nm(n.bottom,e.bottom),e.left=Bm(n.left,e.left),e}),Zy(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Qy,getElementRects:async function(e){const t=this.getOffsetParent||Qy,r=this.getDimensions,n=await r(e.floating);return{reference:Xy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=By(e);return{width:t,height:r}},getScale:Vy,isElement:yy,isRTL:function(e){return"rtl"===Ly(e).direction}};function t_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function r_(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=jy(e),u=i||o?[...c?Fy(c):[],...Fy(t)]:[];u.forEach((e=>{i&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)}));const d=c&&s?function(e,t){let r,n=null;const i=gy(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(s||t(),!h||!f)return;const p={rootMargin:-Vm(d)+"px "+-Vm(i.clientWidth-(u+h))+"px "+-Vm(i.clientHeight-(d+f))+"px "+-Vm(u)+"px",threshold:Bm(0,Nm(1,l))||1};let g=!0;function m(t){const n=t[0].intersectionRatio;if(n!==l){if(!g)return a();n?a(!1,n):r=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==n||t_(c,e.getBoundingClientRect())||a(),g=!1}try{n=new IntersectionObserver(m,{...p,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(m,p)}n.observe(e)}(!0),o}(c,r):null;let h,f=-1,p=null;a&&(p=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),r()})),c&&!l&&p.observe(c),p.observe(t));let g=l?$y(e):null;return l&&function t(){const n=$y(e);g&&!t_(g,n)&&r();g=n,h=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{i&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const n_=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:i}=e,o=await(null==n.isRTL?void 0:n.isRTL(i.floating)),a=Wm(r),s=Zm(r),l="y"===Jm(r),c=dy.has(a)?-1:1,u=o&&l?-1:1,d=qm(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return a===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},i_=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=qm(e,t),c={x:r,y:n},u=await uy(t,l),d=Jm(Wm(i)),h=Ym(d);let f=c[h],p=c[d];if(o){const e="y"===h?"bottom":"right";f=Hm(f+u["y"===h?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";p=Hm(p+u["y"===d?"top":"left"],p,p-u[e])}const g=s.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:o,[d]:a}}}}}},o_=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=qm(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const y=Wm(i),_=Jm(s),v=Wm(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=h||(v||!g?[ay(s)]:function(e){const t=ay(e);return[ey(e),t,ey(t)]}(s)),w="none"!==p;!h&&w&&x.push(...oy(s,g,p,b));const S=[s,...x],k=await uy(t,m),T=[];let I=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&T.push(k[y]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Zm(e),i=Qm(e),o=Xm(i);let a="x"===i?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=ay(a)),[a,ay(a)]}(i,a,b);T.push(k[e[0]],k[e[1]])}if(I=[...I,{placement:i,overflows:T}],!T.every((e=>e<=0))){var M,E;const e=((null==(M=o.flip)?void 0:M.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&_!==Jm(t))||I.every((e=>Jm(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}}}let r=null==(E=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!r)switch(f){case"bestFit":{var P;const e=null==(P=I.filter((e=>{if(w){const t=Jm(e.placement);return t===_||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=s}if(i!==r)return{reset:{placement:r}}}return{}}}},a_=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=qm(e,t)||{};if(null==c)return{};const d=sy(u),h={x:r,y:n},f=Qm(i),p=Xm(f),g=await a.getDimensions(c),m="y"===f,y=m?"top":"left",_=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=o.reference[p]+o.reference[f]-h[f]-o.floating[p],x=h[f]-o.reference[f],w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=w?w[v]:0;S&&await(null==a.isElement?void 0:a.isElement(w))||(S=s.floating[v]||o.floating[p]);const k=b/2-x/2,T=S/2-g[p]/2-1,I=Nm(d[y],T),M=Nm(d[_],T),E=I,P=S-g[p]-M,A=S/2-g[p]/2+k,C=Hm(E,A,P),R=!l.arrow&&null!=Zm(i)&&A!==C&&o.reference[p]/2-(A<E?I:M)-g[p]/2<0,L=R?A<E?A-E:A-P:0;return{[f]:h[f]+L,data:{[f]:C,centerOffset:A-C-L,...R&&{alignmentOffset:L}},reset:R}}}),s_=(e,t,r)=>{const n=new Map,i={platform:e_,...r},o={...i.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=cy(c,n,l),h=n,f={},p=0;for(let r=0;r<s.length;r++){const{name:o,fn:g}=s[r],{x:m,y,data:_,reset:v}=await g({x:u,y:d,initialPlacement:n,placement:h,strategy:i,middlewareData:f,re
29cts:c,platform:a,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=y?y:d,f={...f,[o]:{...f[o],..._}},v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):v.rects),({x:u,y:d}=cy(c,h,l))),r=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{...i,platform:o})};function l_(e){const t=Math.cos(e*Math.PI*.5);return Math.abs(t)<1e-14?1:1-t}const c_=e=>e;function u_(e){const t=e-1;return t*t*t+1}function d_(e){const t="string"==typeof e&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}function h_(e,{delay:t=0,duration:r=400,easing:n=c_}={}){const i=+getComputedStyle(e).opacity;return{delay:t,duration:r,easing:n,css:e=>"opacity: "+e*i}}function f_(e,{delay:t=0,duration:r=400,easing:n=u_,x:i=0,y:o=0,opacity:a=0}={}){const s=getComputedStyle(e),l=+s.opacity,c="none"===s.transform?"":s.transform,u=l*(1-a),[d,h]=d_(i),[f,p]=d_(o);return{delay:t,duration:r,easing:n,css:(e,t)=>`\n\t\t\ttransform: ${c} translate(${(1-e)*d}${h}, ${(1-e)*f}${p});\n\t\t\topacity: ${l-u*t}`}}function p_(e,{delay:t=0,duration:r=400,easing:n=u_,axis:i="y"}={}){const o=getComputedStyle(e);const a=+o.opacity,s="y"===i?"height":"width",l=parseFloat(o[s]),c="y"===i?["top","bottom"]:["left","right"],u=c.map((e=>`${e[0].toUpperCase()}${e.slice(1)}`)),d=parseFloat(o[`padding${u[0]}`]),h=parseFloat(o[`padding${u[1]}`]),f=parseFloat(o[`margin${u[0]}`]),p=parseFloat(o[`margin${u[1]}`]),g=parseFloat(o[`border${u[0]}Width`]),m=parseFloat(o[`border${u[1]}Width`]);return{delay:t,duration:r,easing:n,css:e=>`overflow: hidden;opacity: ${Math.min(20*e,1)*a};${s}: ${e*l}px;padding-${c[0]}: ${e*d}px;padding-${c[1]}: ${e*h}px;margin-${c[0]}: ${e*f}px;margin-${c[1]}: ${e*p}px;border-${c[0]}-width: ${e*g}px;border-${c[1]}-width: ${e*m}px;min-${s}: 0`}}function g_(e,{delay:t=0,duration:r=400,easing:n=u_,start:i=0,opacity:o=0}={}){const a=getComputedStyle(e),s=+a.opacity,l="none"===a.transform?"":a.transform,c=1-i,u=s*(1-o);return{delay:t,duration:r,easing:n,css:(e,t)=>`\n\t\t\ttransform: ${l} scale(${1-c*t});\n\t\t\topacity: ${s-u*t}\n\t\t`}}var m_=$u("<div></div>");function y_(e,t){Zs(t,!0);let r=fh(t,"placement",3,"top"),n=fh(t,"class",3,"");const i=e=>e?`${e}px`:"";const o={left:" rotate-45",right:" -rotate-135",top:" rotate-135",bottom:" -rotate-45"};function a(e){Tc((()=>{e.style.left=i(t.cords.x),e.style.top=i(t.cords.y),e.style.right="",e.style.bottom="";let n=Wm(ay(r()));e.style[n]=i(-e.offsetWidth/2-function(e){const t=window.getComputedStyle(e);return Math.max(parseFloat(t.borderLeftWidth),parseFloat(t.borderBottomWidth))-.3}(e)),e.classList.remove("rotate-45","-rotate-45","rotate-135","-rotate-135"),e.className+=o[n]}))}var s=m_();fd(s,(e=>a?.(e))),Pc((()=>wd(s,1,`popover-arrow clip pointer-events-none absolute block h-[10px] w-[10px] border-b border-l border-inherit bg-inherit text-inherit ${n()??""}`))),Yu(e,s),Ys()}var __=$u("<div><!> <!></div>"),v_=$u('<div hidden=""></div> <!>',1);function b_(e,t){Zs(t,!0);let r=fh(t,"triggerDelay",3,200),n=fh(t,"trigger",3,"click"),i=fh(t,"placement",3,"top"),o=fh(t,"offset",3,8),a=fh(t,"arrow",3,!1),s=fh(t,"yOnly",3,!1),l=fh(t,"strategy",3,"absolute"),c=fh(t,"role",3,"tooltip"),u=fh(t,"middlewares",19,(()=>[o_(),i_()])),d=fh(t,"class",3,""),h=fh(t,"arrowClass",3,""),f=fh(t,"isOpen",15,!1),p=fh(t,"transition",3,h_),g=lh(t,["$$slots","$$events","$$legacy","triggeredBy","triggerDelay","trigger","placement","offset","arrow","yOnly","strategy","role","reference","middlewares","class","arrowClass","isOpen","transitionParams","transition","onbeforetoggle","ontoggle","onclose","children"]),m=!0,y=Dl((()=>"click"===n())),_=Dl((()=>"hover"===n())),v=$l(null),b=null,x=null,w=[],S=$l(Jl({placement:i(),cords:{x:0,y:0}}));Tc((()=>{t.reference&&yu(v)&&(x=yu(v).ownerDocument.querySelector(t.reference))}));let k=$l(null);Tc((()=>{yu(v)&&ql(k,yu(v).querySelector(".popover-arrow"),!0)}));let T=Dl((()=>{const e=[...u(),n_(o())];return yu(k)&&e.push(a_({element:yu(k)})),e}));const I={duration:100,easing:l_},M=Dl((()=>t.transitionParams??I)),E=e=>e?`${e}px`:"";function P(){if(b&&yu(v))return s_(x??b,yu(v),{placement:i(),middleware:yu(T),strategy:l()}).then((({x:e,y:t,middlewareData:{arrow:r},placement:n,strategy:i}
29)=>{yu(v)&&(Object.assign(yu(v).style,{position:i,left:s()?"0":E(e),right:"auto",top:E(t)}),r&&yu(k)&&ql(S,{placement:n,cords:{x:r.x,y:r.y}},!0))}))}const[A,C]=function(e,t,r){let n=null;function i(e,t,o){n=requestAnimationFrame((a=>{if(a-(o||0)<r())return i(e,t,o);n=null,e(...t)}))}function o(){null!==n&&(cancelAnimationFrame(n),n=null)}return[(...t)=>{o(),i(e,t,performance.now())},(...e)=>{o(),i(t,e,performance.now())}]}((async function(e){e.preventDefault(),e.target!==b&&w.includes(e.target)&&(b=e.target,f()&&(yu(v)?.dispatchEvent(new ToggleEvent("beforetoggle",{newState:"open",oldState:"open"})),await P(),yu(v)?.dispatchEvent(new ToggleEvent("toggle",{newState:"open",oldState:"open"})))),"mousedown"===e.type?f(!f()):f(!0)}),(async function(e){if("click"===n()&&"focusout"===e.type){const t=e.relatedTarget;if(yu(v)&&t&&yu(v).contains(t))return;if(!t)return}"mouseleave"===e?.type&&yu(v)?.contains(yu(v).ownerDocument.activeElement)||"focusout"===e?.type&&yu(v)?.contains(yu(v).ownerDocument.activeElement)||f(!1)}),(()=>r()));function R(e){if(!b||!yu(v))return;const r=Object.assign(e,{trigger:b});t.onbeforetoggle?.(r)}function L(e){if(!b)return;f("open"===e.newState);const r=Object.assign(e,{trigger:b});t.ontoggle?.(r),"closed"===e.newState&&t.onclose?.(r)}function O(e){const r=[["focusin",A,m],["focusout",C,m],["mousedown",A,yu(y)],["mouseenter",A,yu(_)],["mouseleave",C,yu(_)]];if(t.triggeredBy?w=[...e.ownerDocument.querySelectorAll(t.triggeredBy)]:e.previousElementSibling?w=[e.previousElementSibling]:e.parentElement&&(w=[e.parentElement]),w.length)return b=w[0],w.forEach((e=>{e.tabIndex<0&&(e.tabIndex=0);for(const[t,n,i]of r)i&&e.addEventListener(t,n)}
29)),()=>{w.forEach((e=>{for(const[t,n,i]of r)i&&e.removeEventListener(t,n)}))};console.error("No triggers found.",t.triggeredBy)}function D(e){"Escape"===e.key&&f(!1)}function z(e){if(!yu(v))return;const t=e.composedPath(),r=t.includes(yu(v)),n=w.some((e=>t.includes(e)));r||n||(C(e),f(!1))}Tc((()=>{let e=null;return f()&&yu(v)&&b&&(e=r_(x??b,yu(v),P),yu(v).ownerDocument.addEventListener("click",z),yu(v).ownerDocument.addEventListener("keydown",D)),()=>{e?.(),e=null,yu(v)?.ownerDocument.removeEventListener("click",z),yu(v)?.ownerDocument.removeEventListener("keydown",D)}}));var F=v_(),N=dc(F);pd(N,(()=>O));var B=hc(N,2),j=e=>{var r=__(),n=()=>yu(v)?.showPopover(),i=()=>yu(v)?.hidePopover();Nd(r,(e=>({popover:"manual",role:c(),onfocusout:C,onmouseleave:yu(_)?C:void 0,onmouseenter:yu(_)?A:void 0,class:e,onintrostart:n,onbeforetoggle:R,ontoggle:L,onoutroend:i,...g,[Pd]:{"overflow-visible":!0}})),[()=>yd(d())]);var o=uc(r);ud(o,(()=>t.children));var s=hc(o,2),l=e=>{y_(e,hh((()=>yu(S)),{get class(){return h()}}))};ad(s,(e=>{a()&&e(l)}
29)),Os(r),nh(r,(e=>ql(v,e)),(()=>yu(v))),Yd(3,r,p,(()=>yu(M))),Yu(e,r)};ad(B,(e=>{f()&&e(j)})),Yu(e,F),Ys()}Date.now();function x_(e){const t=qs("theme");return t?.[e]}Mm({base:"w-full",variants:{color:{primary:"text-primary-500 dark:text-primary-400",secondary:"text-secondary-500 dark:text-secondary-400"},flush:{true:"",false:"border border-gray-200 dark:border-gray-700 rounded-t-xl"}}}),Mm({slots:{base:"group",button:"flex items-center justify-between w-full font-medium text-left group-first:rounded-t-xl border-gray-200 dark:border-gray-700 border-b",content:"border-b border-gray-200 dark:border-gray-700",active:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800",inactive:"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"},variants:{flush:{true:{button:"py-5",content:"py-5"},false:{button:"p-5 border-s border-e group-first:border-t",content:"p-5 border-s border-e"}},open:{true:{},false:{}}},compoundVariants:[{flush:!0,open:!0,class:{button:"text-gray-900 dark:text-white"}},{flush:!0,open:!1,class:{button:"text-gray-500 dark:text-gray-400"}}],defaultVariants:{flush:!1,open:!1}}),Symbol("singleton");$u("<div><!></div>");qu('<svg class="h-3 w-3 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5 5 1 1 5"></path></svg>'),qu('<svg class="h-3 w-3 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"></path></svg>'),$u("<!> <!>",1),$u("<div><div><!></div></div>"),$u("<div><div><!></div></div>"),$u('<h2><button type="button"><!></button></h2> <!>',1);Bu(["click"]);const w_=Mm({base:"p-4 gap-3 text-sm",variants:{color:{primary:"bg-primary-50 dark:bg-gray-800 text-primary-800 dark:text-primary-400",secondary:"bg-secondary-50 dark:bg-secondary-800 text-secondary-800 dark:text-secondary-400",gray:"bg-gray-100 text-gray-500 focus:ring-gray-400 dark:bg-gray-700 dark:text-gray-300",red:"bg-red-100 text-red-500 focus:ring-red-400 dark:bg-red-200 dark:text-red-600",orange:"bg-orange-100 text-orange-500 focus:ring-orange-400 dark:bg-orange-200 dark:text-orange-600",amber:"bg-amber-100 text-amber-500 focus:ring-amber-400 dark:bg-amber-200 dark:text-amber-600",yellow:"bg-yellow-100 text-yellow-500 focus:ring-yellow-400 dark:bg-yellow-200 dark:text-yellow-600",lime:"bg-lime-100 text-lime-500 focus:ring-lime-400 dark:bg-lime-200 dark:text-lime-600",green:"bg-green-100 text-green-500 focus:ring-green-400 dark:bg-green-200 dark:text-green-600",emerald:"bg-emerald-100 text-emerald-500 focus:ring-emerald-400 dark:bg-emerald-200 dark:text-emerald-600",teal:"bg-teal-100 text-teal-500 focus:ring-teal-400 dark:bg-teal-200 dark:text-teal-600",cyan:"bg-cyan-100 text-cyan-500 focus:ring-cyan-400 dark:bg-cyan-200 dark:text-cyan-600",sky:"bg-sky-100 text-sky-500 focus:ring-sky-400 dark:bg-sky-200 dark:text-sky-600",blue:"bg-blue-100 text-blue-500 focus:ring-blue-400 dark:bg-blue-200 dark:text-blue-600",indigo:"bg-indigo-100 text-indigo-500 focus:ring-indigo-400 dark:bg-indigo-200 dark:text-indigo-600",violet:"bg-violet-100 text-violet-500 focus:ring-violet-400 dark:bg-violet-200 dark:text-violet-600",purple:"bg-purple-100 text-purple-500 focus:ring-purple-400 dark:bg-purple-200 dark:text-purple-600",fuchsia:"bg-fuchsia-100 text-fuchsia-500 focus:ring-fuchsia-400 dark:bg-fuchsia-200 dark:text-fuchsia-600",pink:"bg-pink-100 text-pink-500 focus:ring-pink-400 dark:bg-pink-200 dark:text-pink-600",rose:"bg-rose-100 text-rose-500 focus:ring-rose-400 dark:bg-rose-200 dark:text-rose-600"},rounded:{true:"rounded-lg"},border:{true:"border"},icon:{true:"flex items-center"},dismissable:{true:"flex items-center"}},compoundVariants:[{border:!0,color:"primary",class:"border-primary-500 dark:border-primary-200 divide-primary-500 dark:divide-primary-200"},{border:!0,color:"secondary",class:"border-secondary-500 dark:border-secondary-200 divide-secondary-500 dark:divide-secondary-200"},{border:!0,color:"gray",class:"border-gray-300 dark:border-gray-800 divide-gray-300 dark:divide-gray-800"},{border:!0,color:"red",class:"border-red-300 dark:border-red-800 divide-red-300 dark:divide-red-800"},{border:!0,color:"orange",class:"border-orange-300 dark:border-orange-800 divide-orange-300 dark:divide-orange-800"},{border:!0,color:"amber",class:"border-amber-300 dark:border-amber-800 divide-amber-300 dark:divide-amber-800"},{border:!0,color:"yellow",class:"border-yellow-300 dark:border-yellow-800 divide-yellow-300 dark:divide-yellow-800"},{border:!0,color:"lime",class:"border-lime-300 dark:border-lime-800 divide-lime-300 dark:divide-lime-800"},{border:!0,color:"green",class:"border-green-300 dark:border-green-800 divide-green-300 dark:divide-green-800"},{border:!0,color:"emerald",class:"border-emerald-300 dark:border-emerald-800 divide-emerald-300 dark:divide-emerald-800"},{border:!0,color:"teal",class:"border-teal-300 dark:border-teal-800 divide-teal-300 dark:divide-teal-800"},{border:!0,color:"cyan",class:"border-cyan-300 dark:border-cyan-800 divide-cyan-300 dark:divide-cyan-800"},{border:!0,color:"sky",class:"border-sky-300 dark:border-sky-800 divide-sky-300 dark:divide-sky-800"},{border:!0,color:"blue",class:"border-blue-300 dark:border-blue-800 divide-blue-300 dark:divide-blue-800"},{border:!0,color:"indigo",class:"border-indigo-300 dark:border-indigo-800 divide-indigo-300 dark:divide-indigo-800"},{border:!0,color:"violet",class:"border-violet-300 dark:border-violet-800 divide-violet-300 dark:divide-violet-800"},{border:!0,color:"purple",class:"border-purple-300 dark:border-purple-800 divide-purple-300 dark:divide-purple-800"},{border:!0,color:"fuchsia",class:"border-fuchsia-300 dark:border-fuchsia-800 divide-fuchsia-300 dark:divide-fuchsia-800"},{border:!0,color:"pink",class:"border-pink-300 dark:border-pink-800 divide-pink-300 dark:divide-pink-800"},{border:!0,color:"rose",class:"border-rose-300 dark:border-rose-800 divide-rose-300 dark:divide-rose-800"}],defaultVariants:{color:"primary",rounded:!0}});var S_=$u("<div><!></div>"),k_=$u("<div><!> <!> <!></div>");function T_(e,t){Zs(t,!0);let r=fh(t,"alertStatus",15,!0),n=fh(t,"color",3,"primary"),i=fh(t,"rounded",3,!0),o=fh(t,"transition",3,h_),a=lh(t,["$$slots","$$events","$$legacy","children","icon","alertStatus","closeIcon","color","rounded","border","class","dismissable","transition","params"]);const s=x_("alert");let l=Dl((()=>w_({color:n(),rounded:i(),border:t.border,icon:!!t.icon,dismissable:t.dismissable,class:yd(s,t.class)}))),c=$l(void 0);Am((function(){yu(c)?.dispatchEvent(new Event("close",{bubbles:!0,cancelable:!0}))&&r(!1)}));var u=Zu(),d=dc(u),h=e=>{var r=k_();Nd(r,(()=>({role:"alert",...a,class:yu(l)})));var i=uc(r),s=e=>{var r=Zu();ud(dc(r),(()=>t.icon)),Yu(e,r)};ad(i,(e=>{t.icon&&e(s)}));var u=hc(i,2),d=e=>{var r=S_();ud(uc(r),(()=>t.children)),Os(r),Yu(e,r)},h=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(u,(e=>{t.icon||t.dismissable?e(d):e(h,!1)}));var f=hc(u,2),p=e=>{var r=Zu(),i=dc(r),o=e=>{Fm(e,{class:"-my-1.5 ms-auto -me-1.5",get color(){return n()},ariaLabel:"Remove alert",children:(e,r)=>{var n=Zu();dd(dc(n),(()=>t.closeIcon),((e,t)=>{t(e,{})})),Yu(e,n)},$$slots:{default:!0}})},a=e=>{Fm(e,{class:"-my-1.5 ms-auto -me-1.5",get color(){return n()},ariaLabel:"Remove alert"})};ad(i,(e=>{t.closeIcon?e(o):e(a,!1)})),Yu(e,r)};ad(f,(e=>{t.dismissable&&e(p)})),Os(r),nh(r,(e=>ql(c,e)),(()=>yu(c))),Yd(3,r,o,(()=>t.params)),Yu(e,r)};ad(d,(e=>{r()&&e(h)})),Yu(e,u),Ys()}
29Mm({base:"relative flex items-center justify-center bg-gray-100 dark:bg-gray-600 text-gray-600 dark:text-gray-300",variants:{cornerStyle:{rounded:"rounded-sm",circular:"rounded-full"},border:{true:"p-1 ring-2 ring-gray-300 dark:ring-gray-500",false:""},stacked:{true:"border-2 not-first:-ms-4 border-white dark:border-gray-800",false:""},size:{xs:"w-6 h-6",sm:"w-8 h-8",md:"w-10 h-10",lg:"w-20 h-20",xl:"w-36 h-36"}},defaultVariants:{cornerStyle:"circular",border:!1,stacked:!1,size:"md"}}),Mm({base:"shrink-0",variants:{color:{primary:"bg-primary-500",secondary:"bg-secondary-500",gray:"bg-gray-200",red:"bg-red-500",orange:"bg-orange-600",amber:"bg-amber-500",yellow:"bg-yellow-300",lime:"bg-lime-500",green:"bg-green-500",emerald:"bg-emerald-500",teal:"bg-teal-500",cyan:"bg-cyan-500",sky:"bg-sky-500",blue:"bg-blue-500",indigo:"bg-indigo-500",violet:"bg-violet-500",purple:"bg-purple-500",fuchsia:"bg-fuchsia-500",pink:"bg-pink-500",rose:"bg-rose-500"},size:{xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-6 h-6"},cornerStyle:{rounded:"rounded-sm",circular:"rounded-full"},border:{true:"border border-gray-300 dark:border-gray-300",false:{}},hasChildren:{true:"inline-flex items-center justify-center",false:{}},placement:{default:"","top-left":"absolute top-0 start-0","top-center":"absolute top-0 start-1/2 -translate-x-1/2 rtl:translate-x-1/2","top-right":"absolute top-0 end-0","center-left":"absolute top-1/2 -translate-y-1/2 start-0",center:"absolute top-1/2 -translate-y-1/2 start-1/2 -translate-x-1/2 rtl:translate-x-1/2","center-right":"absolute top-1/2 -translate-y-1/2 end-0","bottom-left":"absolute bottom-0 start-0","bottom-center":"absolute bottom-0 start-1/2 -translate-x-1/2 rtl:translate-x-1/2","bottom-right":"absolute bottom-0 end-0"},offset:{true:{},false:{}}},compoundVariants:[{placement:"top-left",offset:!0,class:"-translate-x-1/3 rtl:translate-x-1/3 -translate-y-1/3"},{placement:"top-center",offset:!0,class:"-translate-y-1/3"},{placement:"top-right",offset:!0,class:"translate-x-1/3 rtl:-translate-x-1/3 -translate-y-1/3"},{placement:"center-left",offset:!0,class:"-translate-x-1/3 rtl:translate-x-1/3"},{placement:"center-right",offset:!0,class:"translate-x-1/3 rtl:-translate-x-1/3"},{placement:"bottom-left",offset:!0,class:"-translate-x-1/3 rtl:translate-x-1/3 translate-y-1/3"},{placement:"bottom-center",offset:!0,class:"translate-y-1/3"},{placement:"bottom-right",offset:!0,class:"translate-x-1/3 rtl:-translate-x-1/3 translate-y-1/3"}],defaultVariants:{color:"primary",size:"md",cornerStyle:"circular",border:!1,offset:!0,hasChildren:!1}});$u("<div><!></div>");$u("<img/>"),qu('<svg fill="currentColor" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M8 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd"></path></svg>'),$u("<!> <!> <!>",1),$u("<img/>");Mm({slots:{linkClass:"flex align-middle",base:"font-medium inline-flex items-center justify-center px-2.5 py-0.5"},variants:{color:{primary:{base:"bg-primary-100 text-primary-800 dark:bg-primary-900 dark:text-primary-300"},secondary:{base:"bg-secondary-100 text-secondary-800 dark:bg-secondary-900 dark:text-secondary-300"},gray:{base:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-300"},red:{base:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-300"},orange:{base:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-300"},amber:{base:"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-300"},yellow:{base:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300"},lime:{base:"bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-300"},green:{base:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300"},emerald:{base:"bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-300"},teal:{base:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-300"},cyan:{base:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-300"},sky:{base:"bg-sky-100 text-sky-800 dark:bg-sky-900 dark:text-sky-300"},blue:{base:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300"},indigo:{base:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-300"},violet:{base:"bg-violet-100 text-violet-800 dark:bg-violet-900 dark:text-violet-300"},fuchsia:{base:"bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-900 dark:text-fuchsia-300"}
29,purple:{base:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300"},pink:{base:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-300"},rose:{base:"bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-300"}},size:{small:"text-xs",large:"text-sm"},border:{true:{base:"border"}},rounded:{true:{base:"rounded-full"},false:"rounded-sm"}},compoundVariants:[{border:!0,color:"primary",class:"dark:bg-transparent dark:text-primary-400 border-primary-400 dark:border-primary-400"},{border:!0,color:"secondary",class:"dark:bg-transparent dark:text-secondary-400 border-secondary-400 dark:border-secondary-400"},{border:!0,color:"gray",class:"dark:bg-transparent dark:text-gray-400 border-gray-400 dark:border-gray-400"},{border:!0,color:"red",class:"dark:bg-transparent dark:text-red-400 border-red-400 dark:border-red-400"},{border:!0,color:"orange",class:"dark:bg-transparent dark:text-orange-400 border-orange-400 dark:border-orange-400"},{border:!0,color:"amber",class:"dark:bg-transparent dark:text-amber-400 border-amber-400 dark:border-amber-400"},{border:!0,color:"yellow",class:"dark:bg-transparent dark:text-yellow-300 border-yellow-300 dark:border-yellow-300"},{border:!0,color:"lime",class:"dark:bg-transparent dark:text-lime-400 border-lime-400 dark:border-lime-400"},{border:!0,color:"green",class:"dark:bg-transparent dark:text-green-400 border-green-400 dark:border-green-400"},{border:!0,color:"emerald",class:"dark:bg-transparent dark:text-emerald-400 border-emerald-400 dark:border-emerald-400"},{border:!0,color:"teal",class:"dark:bg-transparent dark:text-teal-400 border-teal-400 dark:border-teal-400"},{border:!0,color:"cyan",class:"dark:bg-transparent dark:text-cyan-400 border-cyan-400 dark:border-cyan-400"},{border:!0,color:"sky",class:"dark:bg-transparent dark:text-sky-400 border-sky-400 dark:border-sky-400"},{border:!0,color:"blue",class:"dark:bg-transparent dark:text-blue-400 border-blue-400 dark:border-blue-400"},{border:!0,color:"indigo",class:"dark:bg-transparent dark:text-indigo-400 border-indigo-400 dark:border-indigo-400"},{border:!0,color:"violet",class:"dark:bg-transparent dark:text-violet-400 border-violet-400 dark:border-violet-400"},{border:!0,color:"purple",class:"dark:bg-transparent dark:text-purple-400 border-purple-400 dark:border-purple-400"},{border:!0,color:"fuchsia",class:"dark:bg-transparent dark:text-fuchsia-400 border-fuchsia-400 dark:border-fuchsia-400"},{border:!0,color:"pink",class:"dark:bg-transparent dark:text-pink-400 border-pink-400 dark:border-pink-400"},{border:!0,color:"rose",class:"dark:bg-transparent dark:text-rose-400 border-rose-400 dark:border-rose-400"},{href:!0,color:"primary",class:"hover:bg-primary-200"},{href:!0,color:"secondary",class:"hover:bg-secondary-200"},{href:!0,color:"gray",class:"hover:bg-gray-200"},{href:!0,color:"red",class:"hover:bg-red-200"},{href:!0,color:"orange",class:"hover:bg-orange-200"},{href:!0,color:"amber",class:"hover:bg-amber-200"},{href:!0,color:"yellow",class:"hover:bg-yellow-200"},{href:!0,color:"lime",class:"hover:bg-lime-200"},{href:!0,color:"green",class:"hover:bg-green-200"},{href:!0,color:"emerald",class:"hover:bg-emerald-200"},{href:!0,color:"teal",class:"hover:bg-teal-200"},{href:!0,color:"cyan",class:"hover:bg-cyan-200"},{href:!0,color:"sky",class:"hover:bg-sky-200"},{href:!0,color:"blue",class:"hover:bg-blue-200"},{href:!0,color:"indigo",class:"hover:bg-indigo-200"},{href:!0,color:"violet",class:"hover:bg-violet-200"},{href:!0,color:"purple",class:"hover:bg-purple-200"},{href:!0,color:"fuchsia",class:"hover:bg-fuchsia-200"},{href:!0,color:"pink",class:"hover:bg-pink-200"},{href:!0,color:"rose",class:"hover:bg-rose-200"}],defaultVariants:{color:"primary",size:"small",rounded:!1}});$u("<a><!></a>"),$u("<div><!> <!></div>");Mm({slots:{base:"fixed z-50 flex justify-between p-4 mx-auto dark:bg-gray-700 dark:border-gray-600",insideDiv:"flex flex-col md:flex-row md:items-center gap-2 mx-auto",dismissable:"absolute end-2.5 top-2.5 md:static md:end-auto md:top-auto"},variants:{type:{top:{base:"top-0 start-0 w-full border-b border-gray-200 bg-gray-50"},bottom:{base:"bottom-0 start-0 w-full border-t border-gray-200 bg-gray-50"}},color:{primary:{base:"bg-primary-50 dark:bg-primary-900"},secondary:{base:"bg-secondary-50 dark:bg-secondary-900"},gray:{base:"bg-gray-50 dark:bg-gray-700"},red:{base:"bg-red-50 dark:bg-red-900"},orange:{base:"bg-orange-50 dark:bg-orange-900"},amber:{base:"bg-amber-50 dark:bg-amber-900"},yellow:{base:"bg-yellow-50 dark:bg-yellow-900"}
29,lime:{base:"bg-lime-50 dark:bg-lime-900"},green:{base:"bg-green-50 dark:bg-green-900"},emerald:{base:"bg-emerald-50 dark:bg-emerald-900"},teal:{base:"bg-teal-50 dark:bg-teal-900"},cyan:{base:"bg-cyan-50 dark:bg-cyan-900"},sky:{base:"bg-sky-50 dark:bg-sky-900"},blue:{base:"bg-blue-50 dark:bg-blue-900"},indigo:{base:"bg-indigo-50 dark:bg-indigo-900"},violet:{base:"bg-violet-50 dark:bg-violet-900"},purple:{base:"bg-purple-50 dark:bg-purple-900"},fuchsia:{base:"bg-fuchsia-50 dark:bg-fuchsia-900"},pink:{base:"bg-pink-50 dark:bg-pink-900"},rose:{base:"bg-rose-50 dark:bg-rose-900"}}},defaultVariants:{type:"top",multiline:!0}});$u('<div class="flex items-center justify-end"><!></div>'),$u("<div><div><!></div> <!></div>");Mm({slots:{base:"w-full z-30 border-gray-200 dark:bg-gray-700 dark:border-gray-600",inner:"grid h-full max-w-lg mx-auto"},variants:{position:{static:{base:"static"},fixed:{base:"fixed"},absolute:{base:"absolute"},relative:{base:"relative"},sticky:{base:"sticky"}},navType:{default:{base:"bottom-0 start-0 h-16 bg-white border-t"},border:{base:"bottom-0 start-0 h-16 bg-white border-t"},application:{base:"h-16 max-w-lg -translate-x-1/2 rtl:translate-x-1/2 bg-white border rounded-full bottom-4 start-1/2"},pagination:{base:"bottom-0 h-16 -translate-x-1/2 rtl:translate-x-1/2 bg-white border-t start-1/2"},group:{base:"bottom-0 -translate-x-1/2 rtl:translate-x-1/2 bg-white border-t start-1/2"},card:{base:"bottom-0 start-0 h-16 bg-white border-t"},meeting:{base:"bottom-0 start-0 grid h-16 grid-cols-1 px-8 bg-white border-t md:grid-cols-3",inner:"flex items-center justify-center mx-auto"},video:{base:"bottom-0 start-0 grid h-24 grid-cols-1 px-8 bg-white border-t md:grid-cols-3",inner:"flex items-center w-full"}}},defaultVariants:{position:"fixed",navType:"default"}}),Mm({slots:{base:"inline-flex flex-col items-center justify-center",span:"text-sm"},variants:{navType:{default:{base:"px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group",span:"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-500"},border:{base:"px-5 border-gray-200 border-x hover:bg-gray-50 dark:hover:bg-gray-800 group dark:border-gray-600",span:"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-500"},application:{base:"",span:"sr-only"},pagination:{base:"px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group",span:"sr-only"},group:{base:"p-4 hover:bg-gray-50 dark:hover:bg-gray-800 group",span:"sr-only"},card:{base:"px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group",span:"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-500"},meeting:{base:"",span:""},video:{base:"",span:""}},appBtnPosition:{left:{base:"px-5 rounded-s-full hover:bg-gray-50 dark:hover:bg-gray-800 group"},middle:{base:"px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group"},right:{base:"px-5 rounded-e-full hover:bg-gray-50 dark:hover:bg-gray-800 group"}}},defaultVariants:{navType:"default",appBtnPosition:"middle",active:!1}}),Mm({slots:{base:"w-full",innerDiv:"grid max-w-xs grid-cols-3 gap-1 p-1 mx-auto my-2 bg-gray-100 rounded-lg dark:bg-gray-600"}}),Mm({base:"px-5 py-1.5 text-xs font-medium rounded-lg",variants:{active:{true:"text-white bg-gray-900 dark:bg-gray-300 dark:text-gray-900",false:"text-gray-900 hover:bg-gray-200 dark:text-white dark:hover:bg-gray-700"}}});$u("<div><!> <div><!></div></div>");$u("<button><!> <span> </span></button>"),$u("<a><!> <span> </span></a>");$u("<button> </button>");$u('<div><div role="group"><!></div></div>');Mm({slots:{base:"flex",list:"inline-flex items-center space-x-1 rtl:space-x-reverse md:space-x-3 rtl:space-x-reverse"},variants:{solid:{true:{base:"px-5 py-3 text-gray-700 border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-800 dark:border-gray-700"},false:""}},defaultVariants:{solid:!1}}),Mm({slots:{base:"inline-flex items-center",separator:"h-6 w-6 text-gray-400 rtl:-scale-x-100"},variants:{home:{true:"",false:""},hasHref:{true:"",false:""}},compoundVariants:[{home:!0,class:{base:"inline-flex items-center text-sm font-medium text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white",separator:"me-2 h-4 w-4"}},{home:!1,hasHref:!0,class:{base:"ms-1 text-sm font-medium text-gray-700 hover:text-gray-900 md:ms-2 dark:text-gray-400 dark:hover:text-white"}},{home:!1,hasHref:!1,class:{base:"ms-1 text-sm font-medium text-gray-500 md:ms-2 dark:text-gray-400"}}]});$u("<nav><ol><!></ol></nav>");
29qu('<svg class="me-2 h-4 w-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path></svg>'),$u("<a><!> <!></a>"),qu('<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>'),$u("<a><!></a>"),$u("<span><!></span>"),$u("<!> <!>",1),$u("<li><!></li>");Mm({base:"inline-flex rounded-lg shadow-xs",variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}});$u("<div><!></div>");const I_=Mm({slots:{base:"text-center font-medium inline-flex items-center justify-center",outline:"bg-transparent border hover:text-white dark:bg-transparent dark:hover-text-white",shadow:"shadow-lg",spinner:"ms-2"},variants:{color:{primary:{base:"text-white bg-primary-700 hover:bg-primary-800 dark:bg-primary-600 dark:hover:bg-primary-700 focus-within:ring-primary-300 dark:focus-within:ring-primary-800",outline:"text-primary-700 border-primary-700 hover:bg-primary-800 dark:border-primary-500 dark:text-primary-500 dark:hover:bg-primary-600",shadow:"shadow-primary-500/50 dark:shadow-primary-800/80"},dark:{base:"text-white bg-gray-800 hover:bg-gray-900 dark:bg-gray-800 dark:hover:bg-gray-700 focus-within:ring-gray-300 dark:focus-within:ring-gray-700",outline:"text-gray-900 border-gray-800 hover:bg-gray-900 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-600",shadow:"shadow-gray-500/50 gray:shadow-gray-800/80"},alternative:{base:"text-gray-900 bg-transparent border border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 hover:text-primary-700 focus-within:text-primary-700 dark:focus-within:text-white dark:hover:text-white dark:hover:bg-gray-700 focus-within:ring-gray-200 dark:focus-within:ring-gray-700",outline:"text-gray-700 border-gray-700 hover:bg-gray-800 dark:border-gray-400 dark:text-gray-400 dark:hover:bg-gray-500",shadow:"_shadow-gray-500/50 dark:shadow-gray-800/80"},light:{base:"text-gray-900 bg-white border border-gray-300 hover:bg-gray-100 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 focus-within:ring-gray-200 dark:focus-within:ring-gray-700",outline:"text-gray-700 border-gray-700 hover:bg-gray-800 dark:border-gray-400 dark:text-gray-400 dark:hover:bg-gray-500",shadow:"shadow-gray-500/50 dark:shadow-gray-800/80"},secondary:{base:"text-white bg-secondary-700 hover:bg-secondary-800 dark:bg-secondary-600 dark:hover:bg-secondary-700 focus-within:ring-secondary-300 dark:focus-within:ring-secondary-800",outline:"text-secondary-700 border-secondary-700 hover:bg-secondary-800 dark:border-secondary-400 dark:text-secondary-400 dark:hover:bg-secondary-500",shadow:"shadow-secondary-500/50 dark:shadow-secondary-800/80"},gray:{base:"text-white bg-gray-700 hover:bg-gray-800 dark:bg-gray-600 dark:hover:bg-gray-700 focus-within:ring-gray-300 dark:focus-within:ring-gray-800",outline:"text-gray-700 border-gray-700 hover:bg-gray-800 dark:border-gray-400 dark:text-gray-400 dark:hover:bg-gray-500",shadow:"shadow-gray-500/50 dark:shadow-gray-800/80"},red:{base:"text-white bg-red-700 hover:bg-red-800 dark:bg-red-600 dark:hover:bg-red-700 focus-within:ring-red-300 dark:focus-within:ring-red-900",outline:"text-red-700 border-red-700 hover:bg-red-800 dark:border-red-500 dark:text-red-500 dark:hover:bg-red-600",shadow:"shadow-red-500/50 dark:shadow-red-800/80"},orange:{base:"text-white bg-orange-700 hover:bg-orange-800 dark:bg-orange-600 dark:hover:bg-orange-700 focus-within:ring-orange-300 dark:focus-within:ring-orange-900",outline:"text-orange-700 border-orange-700 hover:bg-orange-800 dark:border-orange-400 dark:text-orange-400 dark:hover:bg-orange-500",shadow:"shadow-orange-500/50 dark:shadow-orange-800/80"},amber:{base:"text-white bg-amber-700 hover:bg-amber-800 dark:bg-amber-600 dar
29k:hover:bg-amber-700 focus-within:ring-amber-300 dark:focus-within:ring-amber-900",outline:"text-amber-700 border-amber-700 hover:bg-amber-800 dark:border-amber-400 dark:text-amber-400 dark:hover:bg-amber-500",shadow:"shadow-amber-500/50 dark:shadow-amber-800/80"},yellow:{base:"text-white bg-yellow-400 hover:bg-yellow-500 focus-within:ring-yellow-300 dark:focus-within:ring-yellow-900",outline:"text-yellow-400 border-yellow-400 hover:bg-yellow-500 dark:border-yellow-300 dark:text-yellow-300 dark:hover:bg-yellow-400",shadow:"shadow-yellow-500/50 dark:shadow-yellow-800/80"},lime:{base:"text-white bg-lime-700 hover:bg-lime-800 dark:bg-lime-600 dark:hover:bg-lime-700 focus-within:ring-lime-300 dark:focus-within:ring-lime-800",outline:"text-lime-700 border-lime-700 hover:bg-lime-800 dark:border-lime-400 dark:text-lime-400 dark:hover:bg-lime-500",shadow:"shadow-lime-500/50 dark:shadow-lime-800/80"},green:{base:"text-white bg-green-700 hover:bg-green-800 dark:bg-green-600 dark:hover:bg-green-700 focus-within:ring-green-300 dark:focus-within:ring-green-800",outline:"text-green-700 border-green-700 hover:bg-green-800 dark:border-green-500 dark:text-green-500 dark:hover:bg-green-600",shadow:"shadow-green-500/50 dark:shadow-green-800/80"},emerald:{base:"text-white bg-emerald-700 hover:bg-emerald-800 dark:bg-emerald-600 dark:hover:bg-emerald-700 focus-within:ring-emerald-300 dark:focus-within:ring-emerald-800",outline:"text-emerald-700 border-emerald-700 hover:bg-emerald-800 dark:border-emerald-400 dark:text-emerald-400 dark:hover:bg-emerald-500",shadow:"shadow-emerald-500/50 dark:shadow-emerald-800/80"},teal:{base:"text-white bg-teal-700 hover:bg-teal-800 dark:bg-teal-600 dark:hover:bg-teal-700 focus-within:ring-teal-300 dark:focus-within:ring-teal-800",outline:"text-teal-700 border-teal-700 hover:bg-teal-800 dark:border-teal-400 dark:text-teal-400 dark:hover:bg-teal-500",shadow:"shadow-teal-500/50 dark:shadow-teal-800/80"},cyan:{base:"text-white bg-cyan-700 hover:bg-cyan-800 dark:bg-cyan-600 dark:hover:bg-cyan-700 focus-within:ring-cyan-300 dark:focus-within:ring-cyan-800",outline:"text-cyan-700 border-cyan-700 hover:bg-cyan-800 dark:border-cyan-400 dark:text-cyan-400 dark:hover:bg-cyan-500",shadow:"shadow-cyan-500/50 dark:shadow-cyan-800/80"},sky:{base:"text-white bg-sky-700 hover:bg-sky-800 dark:bg-sky-600 dark:hover:bg-sky-700 focus-within:ring-sky-300 dark:focus-within:ring-sky-800",outline:"text-sky-700 border-sky-700 hover:bg-sky-800 dark:border-sky-400 dark:text-sky-400 dark:hover:bg-sky-500",shadow:"shadow-sky-500/50 dark:shadow-sky-800/80"},blue:{base:"text-white bg-blue-700 hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700 focus-within:ring-blue-300 dark:focus-within:ring-blue-800",outline:"text-blue-700 border-blue-700 hover:bg-blue-800 dark:border-blue-500 dark:text-blue-500 dark:hover:bg-blue-500",shadow:"shadow-blue-500/50 dark:shadow-blue-800/80"},indigo:{base:"text-white bg-indigo-700 hover:bg-indigo-800 dark:bg-indigo-600 dark:hover:bg-indigo-700 focus-within:ring-indigo-300 dark:focus-within:ring-indigo-800",outline:"text-indigo-700 border-indigo-700 hover:bg-indigo-800 dark:border-indigo-400 dark:text-indigo-400 dark:hover:bg-indigo-500",shadow:"shadow-indigo-500/50 dark:shadow-indigo-800/80"},violet:{base:"text-white bg-violet-700 hover:bg-violet-800 dark:bg-violet-600 dark:hover:bg-violet-700 focus-within:ring-violet-300 dark:focus-within:ring-violet-800",outline:"text-violet-700 border-violet-700 hover:bg-violet-800 dark:border-violet-400 dark:text-violet-400 dark:hover:bg-violet-500",shadow:"shadow-violet-500/50 dark:shadow-violet-800/80"},purple:{base:"text-white bg-purple-700 hover:bg-purple-800 dark:bg-purple-600 dark:hover:bg-purple-700",outline:"text-purple-700 border-purple-700 hover:bg-purple-800 dark:border-purple-400 dark:text-purple-400 dark:hover:bg-purple-500",shadow:"shadow-purple-500/50 dark:shadow-purple-800/80"},fuchsia:{base:"text-white bg-fuchsia-700 hover:bg-fuchsia-800 dark:bg-fuchsia-600 dark:hover:bg-fuchsia-700",outline:"text-fuchsia-700 border-fuchsia-700 hover:bg-fuchsia-800 dark:border-fuchsia-400 dark:text-fuchsia-400 dark:hover:bg-fuchsia-500",shadow:"shadow-fuchsia-500/50 dark:shadow-fuchsia-800/80"},pink:{base:"text-white bg-pink-700 hover:bg-pink-800 dark:bg-pink-600 dark:hover:bg-pink-700",outline:"text-pink-700 border-pink-700 hover:bg-pink-800 dark:border-pink-400 dark:text-pink-400 dark:hover:bg-pink-500",shadow:"shadow-pink-500/50 dark:shadow-pink-800/80"},rose:{base:"text-white bg-rose-700 hover:bg-rose-800 dark:bg-rose-600 dar
29k:hover:bg-rose-700",outline:"text-rose-700 border-rose-700 hover:bg-rose-800 dark:border-rose-400 dark:text-rose-400 dark:hover:bg-rose-500",shadow:"shadow-rose-500/50 dark:shadow-rose-800/80"}},size:{xs:"px-3 py-2 text-xs",sm:"px-4 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},group:{true:"focus-within:ring-2 focus-within:z-10 [&:not(:first-child)]:rounded-s-none [&:not(:last-child)]:rounded-e-none [&:not(:last-child)]:border-e-0",false:"focus-within:ring-4 focus-within:outline-hidden"},disabled:{true:"cursor-not-allowed opacity-50",false:""},pill:{true:"rounded-full",false:"rounded-lg"},checked:{true:"",false:""}},compoundVariants:[],defaultVariants:{pill:!1}});Mm({slots:{base:"inline-flex items-center justify-center transition-all duration-75 ease-in text-white bg-linear-to-r ",outlineWrapper:"inline-flex items-center justify-center w-full border-0!"},variants:{color:{blue:{base:"from-blue-500 via-blue-600 to-blue-700 hover:bg-linear-to-br focus:ring-blue-300 dark:focus:ring-blue-800"},green:{base:"from-green-400 via-green-500 to-green-600 hover:bg-linear-to-br focus:ring-green-300 dark:focus:ring-green-800"},cyan:{base:"text-white bg-linear-to-r from-cyan-400 via-cyan-500 to-cyan-600 hover:bg-linear-to-br focus:ring-cyan-300 dark:focus:ring-cyan-800"},teal:{base:"text-white bg-linear-to-r from-teal-400 via-teal-500 to-teal-600 hover:bg-linear-to-br focus:ring-teal-300 dark:focus:ring-teal-800"},lime:{base:"text-gray-900 bg-linear-to-r from-lime-200 via-lime-400 to-lime-500 hover:bg-linear-to-br focus:ring-lime-300 dark:focus:ring-lime-800"},red:{base:"text-white bg-linear-to-r from-red-400 via-red-500 to-red-600 hover:bg-linear-to-br focus:ring-red-300 dark:focus:ring-red-800"},pink:{base:"text-white bg-linear-to-r from-pink-400 via-pink-500 to-pink-600 hover:bg-linear-to-br focus:ring-pink-300 dark:focus:ring-pink-800"},purple:{base:"text-white bg-linear-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-linear-to-br focus:ring-purple-300 dark:focus:ring-purple-800"},purpleToBlue:{base:"text-white bg-linear-to-br from-purple-600 to-blue-500 hover:bg-linear-to-bl focus:ring-blue-300 dark:focus:ring-blue-800"},cyanToBlue:{base:"text-white bg-linear-to-r from-cyan-500 to-blue-500 hover:bg-linear-to-bl focus:ring-cyan-300 dark:focus:ring-cyan-800"},greenToBlue:{base:"text-white bg-linear-to-br from-green-400 to-blue-600 hover:bg-linear-to-bl focus:ring-green-200 dark:focus:ring-green-800"},purpleToPink:{base:"text-white bg-linear-to-r from-purple-500 to-pink-500 hover:bg-linear-to-l focus:ring-purple-200 dark:focus:ring-purple-800"},pinkToOrange:{base:"text-white bg-linear-to-br from-pink-500 to-orange-400 hover:bg-linear-to-bl focus:ring-pink-200 dark:focus:ring-pink-800"}
29,tealToLime:{base:"text-gray-900 bg-linear-to-r from-teal-200 to-lime-200 hover:bg-linear-to-l focus:ring-lime-200 dark:focus:ring-teal-700"},redToYellow:{base:"text-gray-900 bg-linear-to-r from-red-200 via-red-300 to-yellow-200 hover:bg-linear-to-bl focus:ring-red-100 dark:focus:ring-red-400"}},outline:{true:{base:"p-0.5",outlineWrapper:"bg-white text-gray-900! dark:bg-gray-900 dark:text-white! hover:bg-transparent hover:text-inherit! group-hover:opacity-0! group-hover:text-inherit!"}},pill:{true:{base:"rounded-full",outlineWrapper:"rounded-full"},false:{base:"rounded-lg",outlineWrapper:"rounded-lg"}},size:{xs:"px-3 py-2 text-xs",sm:"px-4 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},shadow:{true:{base:"shadow-lg"}},group:{true:"rounded-none",false:""},disabled:{true:{base:"opacity-50 cursor-not-allowed"}}},compoundVariants:[{shadow:!0,color:"blue",class:{base:"shadow-blue-500/50 dark:shadow-blue-800/80"}},{shadow:!0,color:"green",class:{base:"shadow-green-500/50 dark:shadow-green-800/80"}},{shadow:!0,color:"cyan",class:{base:"shadow-cyan-500/50 dark:shadow-cyan-800/80"}},{shadow:!0,color:"teal",class:{base:"shadow-teal-500/50 dark:shadow-teal-800/80"}},{shadow:!0,color:"lime",class:{base:"shadow-lime-500/50 dark:shadow-lime-800/80"}},{shadow:!0,color:"red",class:{base:"shadow-red-500/50 dark:shadow-red-800/80"}},{shadow:!0,color:"pink",class:{base:"shadow-pink-500/50 dark:shadow-pink-800/80"}},{shadow:!0,color:"purple",class:{base:"shadow-purple-500/50 dark:shadow-purple-800/80"}},{shadow:!0,color:"purpleToBlue",class:{base:"shadow-blue-500/50 dark:shadow-blue-800/80"}},{shadow:!0,color:"cyanToBlue",class:{base:"shadow-cyan-500/50 dark:shadow-cyan-800/80"}},{shadow:!0,color:"greenToBlue",class:{base:"shadow-green-500/50 dark:shadow-green-800/80"}},{shadow:!0,color:"purpleToPink",class:{base:"shadow-purple-500/50 dark:shadow-purple-800/80"}},{shadow:!0,color:"pinkToOrange",class:{base:"shadow-pink-500/50 dark:shadow-pink-800/80"}},{shadow:!0,color:"tealToLime",class:{base:"shadow-lime-500/50 dark:shadow-teal-800/80"}},{shadow:!0,color:"redToYellow",class:{base:"shadow-red-500/50 dark:shadow-red-800/80"}},{group:!0,pill:!0,class:"first:rounded-s-full last:rounded-e-full"},{group:!0,pill:!1,class:"first:rounded-s-lg last:rounded-e-lg"}]});var M_=$u("<a><!></a>"),E_=$u("<button><!> <!></button>");function P_(e,t){Zs(t,!0);const r=qs("group"),n=qs("disabled");let i=fh(t,"outline",3,!1),o=fh(t,"size",3,"md"),a=fh(t,"shadow",3,!1),s=fh(t,"tag",3,"button"),l=fh(t,"loading",3,!1),c=fh(t,"spinnerProps",19,(()=>({size:"4"}))),u=lh(t,["$$slots","$$events","$$legacy","children","pill","outline","size","color","shadow","tag","disabled","loading","spinnerProps","class"]);const d=x_("button");let h=Dl((()=>r?"sm":o())),f=Dl((()=>t.color??(r?i()?"dark":"alternative":"primary"))),p=Dl((()=>Boolean(n)||Boolean(t.disabled)||l()));const g=Dl((()=>I_({color:yu(f),size:yu(h),disabled:yu(p),pill:t.pill,group:!!r}))),m=Dl((()=>yu(g).base)),y=Dl((()=>yu(g).outline)),_=Dl((()=>yu(g).shadow)),v=Dl((()=>yu(g).spinner));let b=Dl((()=>yu(m)({class:yd(i()&&yu(y)(),a()&&yu(_)(),d?.base,t.class)})));var x=Zu(),w=dc(x),S=e=>{var r=M_();Nd(r,(()=>({...u,class:yu(b)}))),ud(uc(r),(()=>t.children??Ka)),Os(r),Yu(e,r)},k=e=>{var r=Zu(),n=dc(r),i=e=>{var r=E_();Nd(r,(()=>({type:"button",...u,class:yu(b),disabled:yu(p)})));var n=uc(r);ud(n,(()=>t.children??Ka));var i=hc(n,2),o=e=>{{let t=Dl((()=>yu(v)()));nb(e,hh(c,{get class(){return yu(t)}}))}};ad(i,(e=>{l()&&e(o)})),Os(r),Yu(e,r)},o=e=>{var r=Zu();hd(dc(r),s,!1,((e,r)=>{Nd(e,(()=>({...u,class:yu(b)})));var n=Zu();ud(dc(n),(()=>t.children??Ka)),Yu(r,n)})),Yu(e,r)};ad(n,(e=>{"button"===s()?e(i):e(o,!1)}),!0),Yu(e,r)};ad(w,(e=>{void 0!==t.href?e(S):e(k,!1)})),Yu(e,x),Ys()}$u("<div><!></div>");Mm({slots:{base:"w-full flex max-w-sm bg-white border border-gray-200 rounded-lg dark:bg-gray-800 dark:border-gray-700",image:"rounded-t-lg"},variants:{size:{xs:{base:"max-w-xs"},sm:{base:"max-w-sm"},md:{base:"max-w-lg"},lg:{base:"max-w-2xl"},xl:{base:"max-w-none"}},color:{gray:{base:"border-gray-200 dark:bg-gray-800 dark:border-gray-700"},primary:{base:"border-primary-200 bg-primary-400 dark:bg-primary-800 dark:border-primary-700"},secondary:{base:"border-secondary-200 bg-secondary-400 dark:bg-secondary-800 dark:border-secondary-700"},red:{base:"border-red-200 bg-red-400 dark:bg-red-800 dark:border-red-700"},orange:{base:"border-orange-200 bg-orange-400 dark:bg-orange-800 dark:border-orange-700"},amber:{base:"border-amber-200 bg-amber-400 dark:bg-amber-800 dark:border-amber-700"},yellow:{base:"border-yellow-200 bg-yellow-400 dark:bg-yellow-800 dark:border-yellow-700"}
29,lime:{base:"border-lime-200 bg-lime-400 dark:bg-lime-800 dark:border-lime-700"},green:{base:"border-green-200 bg-green-400 dark:bg-green-800 dark:border-green-700"},emerald:{base:"border-emerald-200 bg-emerald-400 dark:bg-emerald-800 dark:border-emerald-700"},teal:{base:"border-teal-200 bg-teal-400 dark:bg-teal-800 dark:border-teal-700"},cyan:{base:"border-cyan-200 bg-cyan-400 dark:bg-cyan-800 dark:border-cyan-700"},sky:{base:"border-sky-200 bg-sky-400 dark:bg-sky-800 dark:border-sky-700"},blue:{base:"border-blue-200 bg-blue-400 dark:bg-blue-800 dark:border-blue-700"},indigo:{base:"border-indigo-200 bg-indigo-400 dark:bg-indigo-800 dark:border-indigo-700"},violet:{base:"border-violet-200 bg-violet-400 dark:bg-violet-800 dark:border-violet-700"},purple:{base:"border-purple-200 bg-purple-400 dark:bg-purple-800 dark:border-purple-700"},fuchsia:{base:"border-fuchsia-200 bg-fuchsia-400 dark:bg-fuchsia-800 dark:border-fuchsia-700"},pink:{base:"border-pink-200 bg-pink-400 dark:bg-pink-800 dark:border-pink-700"},rose:{base:"border-rose-200 bg-rose-400 dark:bg-rose-800 dark:border-rose-700"}},shadow:{xs:{base:"shadow-xs"},sm:{base:"shadow-sm"},normal:{base:"shadow"},md:{base:"shadow-md"},lg:{base:"shadow-lg"},xl:{base:"shadow-xl"},"2xl":{base:"shadow-2xl"},inner:{base:"shadow-inner"}},horizontal:{true:{base:"md:flex-row",image:"object-cover w-full h-96 md:h-auto md:w-48 md:rounded-none"}},reverse:{true:{base:"flex-col-reverse",image:"rounded-b-lg rounded-tl-none"},false:{base:"flex-col",image:"rounded-t-lg"}},href:{true:"",false:""},hasImage:{true:"",false:""}},compoundVariants:[{horizontal:!0,reverse:!0,class:{base:"md:flex-row-reverse",image:"md:rounded-e-lg"}},{horizontal:!0,reverse:!1,class:{base:"md:flex-row",image:"md:rounded-s-lg"}},{href:!0,color:"gray",class:{base:"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700"}},{href:!0,color:"primary",class:{base:"cursor-pointer hover:bg-primary-500 dark:hover:bg-primary-700"}},{href:!0,color:"secondary",class:{base:"cursor-pointer hover:bg-secondary-500 dark:hover:bg-secondary-700"}},{href:!0,color:"red",class:{base:"cursor-pointer hover:bg-red-500 dark:hover:bg-red-700"}},{href:!0,color:"orange",class:{base:"cursor-pointer hover:bg-orange-500 dark:hover:bg-orange-700"}},{href:!0,color:"amber",class:{base:"cursor-pointer hover:bg-amber-500 dark:hover:bg-amber-700"}},{href:!0,color:"yellow",class:{base:"cursor-pointer hover:bg-yellow-500 dark:hover:bg-yellow-700"}},{href:!0,color:"lime",class:{base:"cursor-pointer hover:bg-lime-500 dark:hover:bg-lime-700"}},{href:!0,color:"green",class:{base:"cursor-pointer hover:bg-green-500 dark:hover:bg-green-700"}},{href:!0,color:"emerald",class:{base:"cursor-pointer hover:bg-emerald-500 dark:hover:bg-emerald-700"}},{href:!0,color:"teal",class:{base:"cursor-pointer hover:bg-teal-500 dark:hover:bg-teal-700"}},{href:!0,color:"cyan",class:{base:"cursor-pointer hover:bg-cyan-500 dark:hover:bg-cyan-700"}},{href:!0,color:"sky",class:{base:"cursor-pointer hover:bg-sky-500 dark:hover:bg-sky-700"}},{href:!0,color:"blue",class:{base:"cursor-pointer hover:bg-blue-500 dark:hover:bg-blue-700"}},{href:!0,color:"indigo",class:{base:"cursor-pointer hover:bg-indigo-500 dark:hover:bg-indigo-700"}},{href:!0,color:"violet",class:{base:"cursor-pointer hover:bg-violet-500 dark:hover:bg-violet-700"}},{href:!0,color:"purple",class:{base:"cursor-pointer hover:bg-purple-500 dark:hover:bg-purple-700"}},{href:!0,color:"fuchsia",class:{base:"cursor-pointer hover:bg-fuchsia-500 dark:hover:bg-fuchsia-700"}},{href:!0,color:"pink",class:{base:"cursor-pointer hover:bg-pink-500 dark:hover:bg-pink-700"}},{href:!0,color:"rose",class:{base:"cursor-pointer hover:bg-rose-500 dark:hover:bg-rose-700"}}],defaultVariants:{size:"sm",shadow:"normal",horizontal:!1,reverse:!1}});$u('<img alt="" loading="lazy"/> <!>',1),$u("<div><!></div>"),$u("<a><!></a>");Mm({slots:{base:"grid overflow-hidden relative rounded-lg h-56 sm:h-64 xl:h-80 2xl:h-96",slide:""},variants:{},compoundVariants:[],defaultVariants:{}}),Mm({slots:{base:"absolute start-1/2 z-30 flex -translate-x-1/2 space-x-3 rtl:translate-x-1/2 rtl:space-x-reverse",indicator:"bg-gray-100 hover:bg-gray-300"},variants:{selected:{true:{indicator:"opacity-100"},false:{indicator:"opacity-60"}},position:{top:{base:"top-5"},bottom:{base:"bottom-5"}}}}),Mm({slots:{base:"flex absolute top-0 z-30 justify-center items-center px-4 h-full group focus:outline-hidden text-white dark:text-gray-300",span:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-white/30 group-hover:bg-white/50 group-focus:ring-4 group-focus:ring-white group-focus:outline-hidden sm:h-10 sm:w-10 dar
29k:bg-gray-800/30 dark:group-hover:bg-gray-800/60 dark:group-focus:ring-gray-800/70"},variants:{forward:{true:"end-0",false:"start-0"}}}),Mm({base:"flex flex-row justify-center bg-gray-100 w-full"}),Mm({base:"",variants:{selected:{true:"opacity-100",false:"opacity-60"}},defaultVariants:{selected:!1}}),Mm({base:"absolute block w-full h-full",variants:{fit:{contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}},defaultVariants:{fit:"cover"}});$u("<img/>"),$u("<img/>");$u('<link rel="preload" as="image"/>'),$u("<div><!> <!></div>");qu('<svg aria-hidden="true" class="h-5 w-5 sm:h-6 sm:w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>'),qu('<svg aria-hidden="true" class="h-5 w-5 sm:h-6 sm:w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg>'),$u('<span class="sr-only"> </span>'),$u("<span><!> <!></span>"),$u("<button><!></button>");$u("<!> <!>",1);$u('<button type="button"><!></button>'),$u("<div></div>");Bu(["click"]);$u("<img/>");$u("<button><!></button>"),$u("<div></div>");Bu(["click"]);Mm({base:"gap-2",variants:{embedded:{true:"px-1 py-1 focus-within:ring-0 bg-transparent hover:bg-transparent text-inherit",false:""}},defaultVariants:{embedded:!1}});Mm({base:"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-hidden rounded-lg text-sm p-2.5"});var A_;A_=$u('<script lang="ts">"use strict";\nif ("THEME_PREFERENCE_KEY" in localStorage) {\n    localStorage.getItem("THEME_PREFERENCE_KEY") === "dark" ? window.document.documentElement.classList.add("dark") : window.document.documentElement.classList.remove("dark");\n}\nelse {\n    if (window.matchMedia("(prefers-color-scheme: dark)").matches)\n        window.document.documentElement.classList.add("dark");\n}\n<\/script><!>',1),qu('<svg role="img" aria-label="Light mode" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1\n    0 100-2H3a1 1 0 000 2h1z" fill-rule="evenodd" clip-rule="evenodd"></path></svg>'),qu('<svg role="img" aria-label="Dark mode" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path></svg>'),$u('<button><span class="hidden dark:block"><!></span> <span class="block dark:hidden"><!></span></button>');Mm({slots:{base:"flex justify-between items-center",content:"flex flex-wrap items-center"},variants:{embedded:{true:{},false:{base:"py-2 px-3 rounded-lg dark:border"}},color:{default:{base:"bg-gray-50 dark:bg-gray-800 dark:border-gray-600",content:"divide-gray-300 dark:divide-gray-800"},primary:{base:"bg-primary-50 dark:bg-gray-800 dark:border-primary-800",content:"divide-primary-300 dark:divide-primary-800"},secondary:{base:"bg-secondary-50 dark:bg-gray-800 dark:border-secondary-800",content:"divide-secondary-300 dark:divide-primary-800"},gray:{base:"bg-gray-50 dark:bg-gray-800 dark:border-gray-800",content:"divide-gray-300 dark:divide-gray-800"},red:{base:"bg-red-50 dark:bg-gray-800 dark:border-red-800",content:"divide-red-300 dark:divide-red-800"},yellow:{base:"bg-yellow-50 dark:bg-gray-800 dark:border-yellow-800",content:"divide-yellow-300 dark:divide-yellow-800"},green:{base:"bg-green-50 dark:bg-gray-800 dark:border-green-800",content:"divide-green-300 dark:divide-green-800"},indigo:{base:"bg-indigo-50 dark:bg-gray-800 dark:border-indigo-800",content:"divide-indigo-300 dark:divide-indigo-800"}
29,purple:{base:"bg-purple-50 dark:bg-gray-800 dark:border-purple-800",content:"divide-purple-300 dark:divide-purple-800"},pink:{base:"bg-pink-50 dark:bg-gray-800 dark:border-pink-800",content:"divide-pink-300 dark:divide-pink-800"},blue:{base:"bg-blue-50 dark:bg-gray-800 dark:border-blue-800",content:"divide-blue-300 dark:divide-blue-800"},dark:{base:"bg-gray-50 dark:bg-gray-800 dark:border-gray-800",content:"divide-gray-300 dark:divide-gray-800"}},separators:{true:{content:"sm:divide-x rtl:divide-x-reverse"}}},compoundVariants:[{embedded:!0,color:"default",class:{base:"bg-transparent"}}],defaultVariants:{color:"default"}}),Mm({base:"flex items-center",variants:{spacing:{default:"space-x-1 rtl:space-x-reverse",tight:"space-x-0.5 rtl:space-x-reverse",loose:"space-x-2 rtl:space-x-reverse"},padding:{default:"sm:not(:last):pe-4 sm:not(:first):ps-4",none:""},position:{middle:"",first:"sm:ps-0",last:"sm:pe-0"}},compoundVariants:[{position:["first","last"],class:"sm:px-0"}],defaultVariants:{spacing:"default",padding:"default"}});const C_=Mm({base:"focus:outline-hidden whitespace-normal",variants:{color:{dar
29k:"text-gray-500 hover:text-gray-900 hover:bg-gray-200 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-600",gray:"text-gray-500 focus:ring-gray-400 hover:bg-gray-200 dark:hover:bg-gray-800 dark:hover:text-gray-300",red:"text-red-500 focus:ring-red-400 hover:bg-red-200 dark:hover:bg-red-800 dark:hover:text-red-300",yellow:"text-yellow-500 focus:ring-yellow-400 hover:bg-yellow-200 dark:hover:bg-yellow-800 dark:hover:text-yellow-300",green:"text-green-500 focus:ring-green-400 hover:bg-green-200 dark:hover:bg-green-800 dark:hover:text-green-300",indigo:"text-indigo-500 focus:ring-indigo-400 hover:bg-indigo-200 dark:hover:bg-indigo-800 dark:hover:text-indigo-300",purple:"text-purple-500 focus:ring-purple-400 hover:bg-purple-200 dark:hover:bg-purple-800 dark:hover:text-purple-300",pink:"text-pink-500 focus:ring-pink-400 hover:bg-pink-200 dark:hover:bg-pink-800 dark:hover:text-pink-300",blue:"text-blue-500 focus:ring-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800 dark:hover:text-blue-300",primary:"text-primary-500 focus:ring-primary-400 hover:bg-primary-200 dark:hover:bg-primary-800 dark:hover:text-primary-300",default:"focus:ring-gray-400 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-gray-50"},size:{xs:"m-0.5 rounded-xs focus:ring-1 p-0.5",sm:"m-0.5 rounded-sm focus:ring-1 p-0.5",md:"m-0.5 rounded-lg focus:ring-2 p-1.5",lg:"m-0.5 rounded-lg focus:ring-2 p-2.5"},background:{true:"",false:""}},compoundVariants:[{color:"default",background:!0,class:"dark:hover:bg-gray-600"},{color:"default",background:!1,class:"dark:hover:bg-gray-700"}],defaultVariants:{color:"default",size:"md"}});var R_=$u('<span class="sr-only"> </span>'),L_=$u("<button><!> <!></button>"),O_=$u('<span class="sr-only"> </span>'),D_=$u("<a><!> <!></a>");function z_(e,t){Zs(t,!0);const r=qs("background");let n=lh(t,["$$slots","$$events","$$legacy","children","color","name","aria-label","size","class"]);const i=x_("toolbarButton"),o=Dl((()=>C_({color:t.color,size:t.size,background:!!r,class:yd(i,t.class)})));var a=Zu(),s=dc(a),l=e=>{var r=L_();Nd(r,(()=>({type:"button",...n,class:yu(o),"aria-label":t["aria-label"]??t.name})));var i=uc(r),a=e=>{var r=R_(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,t.name))),Yu(e,r)};ad(i,(e=>{t.name&&e(a)})),ud(hc(i,2),(()=>t.children??Ka)),Os(r),Yu(e,r)},c=e=>{var r=D_();Nd(r,(()=>({...n,class:yu(o),"aria-label":t["aria-label"]??t.name})));var i=uc(r),a=e=>{var r=O_(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,t.name))),Yu(e,r)};ad(i,(e=>{t.name&&e(a)})),ud(hc(i,2),(()=>t.children??Ka)),Os(r),Yu(e,r)};ad(s,(e=>{void 0===t.href?e(l):e(c,!1)})),Yu(e,a),Ys()}const F_=Mm({slots:{base:"inline-block rounded-lg bg-white dark:bg-gray-700 shadow-lg p-4",input:"w-full rounded-md border px-4 py-2 text-sm focus:ring-2 focus:outline-none outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white disabled:cursor-not-allowed disabled:opacity-50 border-gray-300 bg-gray-50 text-gray-900",titleVariant:"mb-2 text-lg font-semibold text-gray-900 dark:text-white",polite:"text-sm rounded-lg text-gray-900 dark:text-white bg-white dark:bg-gray-700 font-semibold py-2.5 px-5 hover:bg-gray-100 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-200",button:"absolute inset-y-0 right-0 flex items-center px-3 text-gray-500 focus:outline-hidden dark:text-gray-400",actionButtons:"mt-4 flex justify-between",columnHeader:"text-center text-sm font-medium text-gray-500 dark:text-gray-400",grid:"grid grid-cols-7 gap-1 w-64",nav:"mb-4 flex items-center justify-between",dayButton:"h-8 w-full block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center font-semibold text-sm day p-0",monthButton:"rounded-lg px-3 py-2 text-sm hover:bg-gray-100 focus:ring-2 focus:ring-blue-500 dark:hover:bg-gray-700",actionSlot:""},variants:{color:{primary:{input:"focus:ring-primary-500 dark:focus:ring-primary-400",dayButton:"bg-primary-300 dark:bg-primary-900"},blue:{input:"focus:ring-blue-500 dark:focus:ring-blue-400",dayButton:"bg-blue-300 dark:bg-blue-900"},red:{input:"focus:ring-red-500 dark:focus:ring-red-400",dayButton:"bg-red-300 dark:bg-red-900"},green:{input:"focus:ring-green-500 dark:focus:ring-green-400",dayButton:"bg-green-300 dark:bg-green-900"},yellow:{input:"focus:ring-yellow-500 dark:focus:ring-yellow-400",dayButton:"bg-yellow-300 dark:bg-yellow-900"},purple:{input:"focus:ring-purple-500 dark:focus:ring-purple-400",dayButton:"bg-purple-300 dark:bg-purple-900"},dark:{input:"focus:ring-gray-500 dark:focus:ring-gray-400",dayButton:"bg-gray-300 dark:bg-gray-900"},light:{input:"focus:ring-gray-500 dark:focus:ring-gray-400",dayButton:"bg-gray-300 dark:bg-gray-900"},alternative:{input:"focus:ring-alternative-500 dark:focus:ring-alternative-400",dayButton:"bg-alternative-300 dark:bg-alternative-900"},secondary:{input:"focus:ring-secondary-500 dark:focus:ring-secondary-400",dayButton:"bg-secondary-300 dark:bg-secondary-900"},gray:{input:"focus:ring-gray-500 dark:focus:ring-gray-400",dayButton:"bg-gray-300 dark:bg-gray-900"},orange:{input:"focus:ring-orange-500 dark:focus:ring-orange-400",dayButton:"bg-orange-300 dark:bg-orange-900"},amber:{input:"focus:ring-amber-500 dark:focus:ring-amber-400",dayButton:"bg-amber-300 dark:bg-amber-900"},lime:{input:"focus:ring-lime-500 dark:focus:ring-lime-400",dayButton:"bg-lime-300 dark:bg-lime-900"},emerald:{input:"focus:ring-emerald-500 dark:focus:ring-emerald-400",dayButton:"bg-emerald-300 dark:bg-emerald-900"},teal:{input:"focus:ring-teal-500 dark:focus:ring-teal-400",dayButton:"bg-teal-300 dark:bg-teal-900"},cyan:{input:"focus:ring-cyan-500 dark:focus:ring-cyan-400",dayButton:"bg-cyan-300 dark:bg-cyan-900"},sky:{input:"focus:ring-sky-500 dark:focus:ring-sky-400",dayButton:"bg-sky-300 dark:bg-sky-900"},indigo:{input:"focus:ring-indigo-500 dark:focus:ring-indigo-400",dayButton:"bg-indigo-300 dark:bg-indigo-900"},violet:{input:"focus:ring-violet-500 dark:focus:ring-violet-400",dayButton:"bg-violet-300 dark:bg-violet-900"},fuchsia:{input:"focus:ring-fuchsia-500 dark:focus:ring-fuchsia-400",dayButton:"bg-fuchsia-300 dark:bg-fuchsia-900"},pink:{input:"focus:ring-pink-500 dark:focus:ring-pink-400",dayButton:"bg-pink-300 dark:bg-pink-900"},rose:{input:"focus:ring-rose-500 dark:focus:ring-rose-400",dayButton:"bg-rose-300 dark:bg-rose-900"}},inline:{false:{base:"absolute z-10 mt-1"}},current:{true:{dayButton:"text-gray-400 dark:text-gray-500"}},today:{true:{dayButton:"font-bold"}},unavailable:{true:{dayButton:"opacity-50 cursor-not-allowed hover:bg-gray-100 dark:hover:bg-gray-700"}}},compoundVariants:[]});var N_=i(411),B_=qu('<svg class="h-3 w-3 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg>'),j_=qu('<svg class="h-3 w-3 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg>'),V_=$u('<div class="relative"><input/> <button type="button"><svg class="h-4 w-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"></path></svg></button></div>'),G_=$u("<h2> </h2>"),U_=$u('<div><!> <h3 aria-live="polite"> </h3> <!></div> <div class="grid grid-cols-4 gap-2 p-4"></div>',1),$_=$u('<div role="columnheader"> </div>'),H_=$u('<div><!> <!> <!></div> <div role="grid"><!> <!></div>',1),q_=$u("<div><!> <!> <!></div>"),W_=$u("<div><!></div>"),Z_=$u('<div id="datepicker-dropdown" role="dialog" aria-label="Calendar"><!> <!> <!> <!></div>'),Y_=$u("<div><!> <!></div>");function X_(e,t){Zs(t,!0);const r=(e,t=Ka)=>{{let r=Dl((()=>t()?"Next month":"Previous month"));z_(e,{color:"dark",onclick:()=>function(e){ql(O,new Date(yu(O).getFullYear(),yu(O).getMonth()+e,1),!0)}(t()?1:-1),size:"lg",get"aria-label"(){return yu(r)},children:(e,r)=>{var n=B_(),i=uc(n);Os(n),Pc((()=>Fd(i,"d",t()?"M1 5h12m0 0L9 1m4 4L9 9":"M13 5H1m0 0 4 4M1 5l4-4"))),Yu(e,n)},$$slots:{default:!0}})}},n=(e,t=Ka)=>{{let r=Dl((()=>t()?"Next year":"Previous year"));z_(e,{color:"dark",onclick:()=>function(e){ql(O,new Date(yu(O).getFullYear()+e,yu(O).getMonth(),1),!0)}(t()?1:-1),size:"lg",get"aria-label"(){return yu(r)},children:(e,r)=>{var n=j_(),i=uc(n);Os(n),Pc((()=>Fd(i,"d",t()?"M1 5h12m0 0L9 1m4 4L9 9":"M13 5H1m0 0 4 4M1 5l4-4"))),Yu(e,n)},$$slots:{default:!0}})}};let i=fh(t,"value",15),o=fh(t,"defaultDate",3,null),a=fh(t,"range",3,!1),s=fh(t,"rangeFrom",15),l=fh(t,"rangeTo",15),c=fh(t,"availableFrom",3,null),u=fh(t,"availableTo",3,null),d=fh(t,"locale",3,"default"),h=fh(t,"translationLocale",23,d),f=fh(t,"firstDayOfWeek",3,0),p=fh(t,"placeholder",3,"Select date"),g=fh(t,"disabled",3,!1),m=fh(t,"required",3,!1),y=fh(t,"inputClass",3,""),_=fh(t,"color",3,"primary"),v=fh(t,"inline",3,!1),b=fh(t,"autohide",3,!0),x=fh(t,"showActionButtons",3,!1),w=fh(t,"title",3,""),S=fh(t,"inputmode",3,"none"),k=fh(t,"monthColor",3,"alternative"),T=fh(t,"monthBtnSelected",3,"bg-primary-500 text-white"),I=fh(t,"monthBtn",3,"text-gray-700 dark:text-gray-300"),M=fh(t,"elementRef",15),E=fh(t,"inputProps",19,(()=>({})));const P=x_("datepicker");h(h()??d());let A,C=$l(Jl(v())),R=$l(!1),L=$l(null);Tc((()=>{yu(L)&&M(yu(L))}));let O=$l(Jl(i()||o()||new Date)),D=null,z=$l(null),F=Dl((()=>function(e){const t=(0,N_.startOfMonth)(e),r=(0,N_.endOfMonth)(e),n=(0,N_.startOfWeek)(t,{weekStartsOn:f()}),i=(0,N_.endOfWeek)(r,{weekStartsOn:f()});return(0,N_.eachDayOfInterval)({start:n,end:i})}(yu(O))));yh((()=>
29{if(!v())return A?.ownerDocument.addEventListener("click",q),()=>{A?.ownerDocument.removeEventListener("click",q)}}));let N=Dl((()=>{const e=new Date(1970,0,4+f());return Array.from({length:7},((t,r)=>(0,N_.addDays)(e,r).toLocaleDateString(h(),{weekday:"short"})))}));let B=Dl((()=>Array.from({length:12},((e,t)=>new Date(2e3,t,1).toLocaleDateString(h(),{month:"short"})))));const j=(e,t)=>(0,N_.addDays)(e,t);function V(e){const t=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(c()){if(t<new Date(c().getFullYear(),c().getMonth(),c().getDate()))return!1}if(u()){if(t>new Date(u().getFullYear(),u().getMonth(),u().getDate()))return!1}return!0}function G(e){if(V(e))if(a()){if(!s()||s()&&l())s(e),l(void 0);else if(e<s()){const t=s();s(e),l(t)}else l(e);t.onselect?.({from:s(),to:l()})}else i(e),t.onselect?.(i()),b()&&!v()&&ql(C,!1)}function U(){const e=yu(L)?.value?.trim();if(!e)return s(void 0),l(void 0),void yu(L)?.setCustomValidity("");if(yu(L)?.setCustomValidity(""),a()){const n=e.split(" - ");if(2===n.length){const e=$(n[0]),i=$(n[1]);return e&&(0,N_.isValid)(e)&&V(e)&&i&&(0,N_.isValid)(i)&&V(i)?(r=ts(e>i?[i,e]:[e,i],2),s(r[0]),l(r[1]),void t.onselect?.({from:s(),to:l()})):void yu(L)?.setCustomValidity(`Please enter date range in format: ${H()} - ${H()}`)}}var r;const n=$(e);if(n&&(0,N_.isValid)(n))V(n)?G(n):yu(L)?.setCustomValidity("Selected date is not available");else{const e=H();yu(L)?.setCustomValidity(`Please enter date in format: ${e}`)}}function $(e){const t=H();try{const r=(0,N_.parse)(e,t,new Date);if((0,N_.isValid)(r))return r}catch(e){}const r=["d.M.yyyy","dd.MM.yyyy","M/d/yyyy","MM/dd/yyyy","d/M/yyyy","dd/MM/yyyy","yyyy-MM-dd","yyyy-M-d","M-d-yyyy","d-M-yyyy"];for(const t of r)try{const r=(0,N_.parse)(e,t,new Date);if((0,N_.isValid)(r))return r}catch(e){}try{const t=new Date(e);if((0,N_.isValid)(t)&&!isNaN(t.getTime()))return t}catch(e){}return null}function H(){const e="default"===d()?navigator.language:d(),r=new Date(2025,0,15).toLocaleDateString(e,t.dateFormat||{year:"numeric",month:"numeric",day:"numeric"});if(r.includes("."))return r.startsWith("15.")?"d.M.yyyy":r.startsWith("01.")?"M.d.yyyy":"d.M.yyyy";if(r.includes("/")){if(r.startsWith("1/"))return"M/d/yyyy";if(r.startsWith("15/"))return"d/M/yyyy";const n=new Date(2025,11,3).toLocaleDateString(e,t.dateFormat||{year:"numeric",month:"numeric",day:"numeric"});return n.startsWith("3/")||n.startsWith("03/")?"d/M/yyyy":"M/d/yyyy"}return r.includes("-")?r.startsWith("2025-")?"yyyy-M-d":r.startsWith("1-")?"M-d-yyyy":"d-M-yyyy":e.startsWith("en-US")?"M/d/yyyy":e.startsWith("de")||e.startsWith("at")||e.startsWith("ch")?"d.M.yyyy":e.startsWith("en-GB")||e.startsWith("en-AU")?"d/M/yyyy":"M/d/yyyy"}function q(e){yu(C)&&A&&!A.contains(e.target)&&(ql(C,!1),ql(R,!1))}const W=e=>e?.toLocaleDateString(d(),t.dateFormat)??"",Z=(e,t)=>!(!e||!t)&&(0,N_.isSameDay)(e,t),Y=e=>Z(e,new Date),X=e=>!!(a()&&s()&&l()&&(0,N_.isWithinInterval)(e,{start:s(),end:l()}));let K=Dl((()=>e=>a()?Z(e,s())||Z(e,l()):Z(e,i())));function J(e){if(yu(C)){switch(D||(D=i()||new Date),e.key){case"ArrowLeft":D=j(D,-1);break;case"ArrowRight":D=j(D,1);break;case"ArrowUp":D=j(D,-7);break;case"ArrowDown":D=j(D,7);break;case"Enter":a()?s()&&l()?b()&&!v()&&ql(C,!1):G(D):(G(D),b()&&!v()&&ql(C,!1));break;case"Escape":ql(C,!1),ql(R,!1),yu(L)?.focus();break;default:return}e.preventDefault(),D.getMonth()!==yu(O).getMonth()&&ql(O,new Date(D.getFullYear(),D.getMonth(),1),!0),setTimeout((()=>{const e=yu(z)?.querySelector(`button[aria-label="${D.toLocaleDateString(h(),{weekday:"long",year:"numeric",month:"long",day:"numeric"})}"]`);e?.focus()}),0)}}function Q(e){"Enter"===e.key?(e.preventDefault(),U(),b()&&!v()&&ql(C,!1)):" "===e.key&&(e.preventDefault(),ql(C,!yu(C)))}function ee(){i(s(l(void 0))),t.onclear?.()}function te(){const e=a()?{from:s(),to:l()}:i();e&&t.onapply?.(e),v()||ql(C,!1)}let{base:re,input:ne,button:ie,titleVariant:oe,actionButtons:ae,columnHeader:se,polite:le,grid:ce,nav:ue,dayButton:de,monthButton:he}=F_();var fe=Y_(),pe=uc(fe),ge=e=>{var r=V_(),n=uc(r),o=()=>ql(C,!0);Nd(n,((e,t)=>({...E(),type:"text",class:e,placeholder:p(),value:t,onfocus:o,onchange:U,onkeydown:Q,disabled:g(),required:m(),inputmode:S(),"aria-haspopup":"dialog"})),[()=>ne({color:_(),class:yd(P?.input,y())}),()=>a()?`${W(s())} - ${W(l())}`:W(i())],void 0,void 0,void 0,!0),nh(n,(e=>ql(L,e)),(()=>yu(L)));var c=hc(n,2);c.__click=()=>ql(C,!yu(C)),Os(r),Pc((e=>{wd(c,1,e),c.disabled=g(),Fd(c,"aria-label",yu(C)?"Close date picker":"Open date picker")}),[()=>_d(ie({class:yd(t.btnClass,P?.button,t.classes?.button)}))]),Yu(e,r)};ad(pe,(e=>{v()||e(ge)}));var me=hc(pe,2),ye=e=>{var o=Z_(),c=uc(o),u=e=>{var r=G_(),n=uc(r,!0);Os(r),Pc((e=>{wd(r,1,e),Ju(n,w())}),[()=>_d(oe({class:yd(P?.titleVariant,t.classes?.titleVariant)}))]),Yu(e,r)};ad(c,(e=>{w()&&e(u)}));var d=hc(c,2),f=e=>{var r=U_(),i=dc(r),o=uc(i);n(o,(()=>!1));var a=hc(o,2),s=uc(a,!0);Os(a);var l=hc(a,2);n(l,(()=>!0)),Os(i);var c=hc(i,2);Il(c,21,(()=>yu(B)),Tl,((e,r,n)=>{{let i=Dl((()=>he({class:yd(yu(O).getMonth()===n?T():I(),t.classes?.monthButton,P?.monthButton)})));P_(e,{type:"button",get color(){return k()},get class(){return yu(i)},onclick:e=>function(e,t){t.stopPropagation(),ql(O,new Date(yu(O).getFullYear(),e,1),!0),ql(R,!1)}(n,e),children:(e,t)=>{Ds();var n=Wu();Pc((()=>Ju(n,yu(r)))),Yu(e,n)},$$slots:{default:!0}})}})),Os(c),Pc(((e,t,r)=>{wd(i,1,e),wd(a,1,t),Ju(s,r)}),[()=>_d(ue({class:yd(P?.nav,t.classes?.nav)})),()=>_d(le({class:yd(P?.polite,t.classes?.polite)})),()=>yu(O).getFullYear()]),Yu(e,r)},p=e=>{var n=H_(),i=dc(n),o=uc(i);r(o,(()=>!1));var a=hc(o,2);{let e=Dl((()=>le({class:yd("cursor-pointer rounded px-2 py-1 hover:bg-gray-100 dark:hover:bg-gray-700",t.classes?.polite)})));P_(a,{type:"button",get class(){return yu(e)}
29,"aria-live":"polite",onclick:e=>function(e){e.stopPropagation(),ql(R,!yu(R))}(e),children:(e,t)=>{Ds();var r=Wu();Pc((e=>Ju(r,e)),[()=>yu(O).toLocaleString(h(),{month:"long",year:"numeric"})]),Yu(e,r)},$$slots:{default:!0}})}var s=hc(a,2);r(s,(()=>!0)),Os(i);var l=hc(i,2),c=uc(l);Il(c,16,(()=>yu(N)),(e=>e),((e,r)=>{var n=$_(),i=uc(n,!0);Os(n),Pc((e=>{wd(n,1,e),Ju(i,r)}),[()=>_d(se({class:yd(P?.columnHeader,t.classes?.columnHeader)}))]),Yu(e,n)})),Il(hc(c,2),16,(()=>yu(F)),(e=>e),((e,r)=>{const n=Dl((()=>r.getMonth()!==yu(O).getMonth())),i=Dl((()=>V(r)));{let o=Dl((()=>yu(K)(r)?_():"alternative")),a=Dl((()=>de({current:yu(n),today:Y(r),color:X(r)?_():void 0,unavailable:!yu(i),class:yd(P?.dayButton,t.classes?.dayButton,!yu(i)&&"cursor-not-allowed opacity-50")}))),s=Dl((()=>r.toLocaleDateString(h(),{weekday:"long",year:"numeric",month:"long",day:"numeric"}))),l=Dl((()=>yu(K)(r))),c=Dl((()=>!yu(i))),u=Dl((()=>!yu(i)));P_(e,{type:"button",get color(){return yu(o)},get class(){return yu(a)},onclick:()=>G(r),onkeydown:J,get"aria-label"(){return yu(s)},get"aria-selected"(){return yu(l)},get"aria-disabled"(){return yu(c)},get disabled(){return yu(u)},role:"gridcell",children:(e,t)=>{Ds();var n=Wu();Pc((e=>Ju(n,e)),[()=>r.getDate()]),Yu(e,n)},$$slots:{default:!0}})}})),Os(l),Pc(((e,t)=>{wd(i,1,e),wd(l,1,t)}),[()=>_d(ue({class:yd(t.classes?.nav)})),()=>_d(ce({class:yd(P?.grid,t.classes?.grid)}))]),Yu(e,n)};ad(d,(e=>{yu(R)?e(f):e(p,!1)}));var g=hc(d,2),m=e=>{var r=q_(),n=uc(r);{let e=Dl((()=>!V(new Date)));P_(n,{onclick:()=>G(new Date),get color(){return _()},size:"sm",get disabled(){return yu(e)},children:(e,t)=>{Ds(),Yu(e,Wu("Today"))},$$slots:{default:!0}})}var i=hc(n,2);P_(i,{onclick:ee,color:"red",size:"sm",children:(e,t)=>{Ds(),Yu(e,Wu("Clear"))},$$slots:{default:!0}}),P_(hc(i,2),{onclick:te,get color(){return _()},size:"sm",children:(e,t)=>{Ds(),Yu(e,Wu("Apply"))},$$slots:{default:!0}}),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(ae({class:yd(P?.actionButtons,t.classes?.actionButtons)}))]),Yu(e,r)};ad(g,(e=>{x()&&!yu(R)&&e(m)}));var y=hc(g,2),b=e=>{var r=W_();ud(uc(r),(()=>t.actionSlot),(()=>({selectedDate:a()?{from:s(),to:l()}:i(),handleClear:ee,handleApply:te,close:()=>{ql(C,!1),ql(R,!1)}}))),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yd(t.classes?.actionSlot,P?.actionSlot))]),Yu(e,r)};ad(y,(e=>{t.actionSlot&&e(b)})),Os(o),nh(o,(e=>ql(z,e)),(()=>yu(z))),Pc((e=>wd(o,1,e)),[()=>_d(re({inline:v(),class:yd(P?.base,t.class)}))]),Yd(3,o,(()=>h_),(()=>({duration:100}))),Yu(e,o)};ad(me,(e=>{(yu(C)||v())&&e(ye)})),Os(fe),nh(fe,(e=>A=e),(()=>A)),Pc((()=>wd(fe,1,_d(["relative",v()&&"inline-block"])))),Yu(e,fe),Ys()}Bu(["click"]);Mm({slots:{base:"relative mx-auto border-gray-800 dark:border-gray-800 bg-gray-800 border-[14px] rounded-xl h-[600px] w-[300px] shadow-xl",slot:"rounded-xl overflow-hidden w-[272px] h-[572px] bg-white dark:bg-gray-800",top:"w-[148px] h-[18px] bg-gray-800 top-0 rounded-b-[1rem] left-1/2 -translate-x-1/2 absolute",leftTop:"h-[32px] w-[3px] bg-gray-800 absolute -left-[17px] top-[72px] rounded-l-lg",leftMid:"h-[46px] w-[3px] bg-gray-800 absolute -left-[17px] top-[124px] rounded-l-lg",leftBot:"h-[46px] w-[3px] bg-gray-800 absolute -left-[17px] top-[178px] rounded-l-lg",right:"h-[64px] w-[3px] bg-gray-800 absolute -right-[17px] top-[142px] rounded-r-lg"}}),Mm({slots:{base:"relative mx-auto border-gray-800 dark:border-gray-800 bg-gray-800 border-[14px] rounded-[2.5rem] h-[600px] w-[300px]",slot:"rounded-[2rem] overflow-hidden w-[272px] h-[572px] bg-white dark:bg-gray-800",top:"h-[32px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -left-[17px] top-[72px] rounded-l-lg",leftTop:"h-[46px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -left-[17px] top-[124px] rounded-l-lg",leftBot:"h-[46px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -left-[17px] top-[178px] rounded-l-lg",right:"h-[64px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -right-[17px] top-[142px] rounded-r-lg"}}),Mm({slots:{base:"relative mx-auto border-gray-800 dark:border-gray-800 bg-gray-800 border-[16px] rounded-t-xl h-[172px] max-w-[301px] md:h-[294px] md:max-w-[512px]",inner:"rounded-xl overflow-hidden h-[140px] md:h-[262px]",bot:"relative mx-auto bg-gray-900 dark:bg-gray-700 rounded-b-xl h-[24px] max-w-[301px] md:h-[42px] md:max-w-[512px]",botUnder:"relative mx-auto bg-gray-800 rounded-b-xl h-[55px] max-w-[83px] md:h-[95px] md:max-w-[142px]"}}),Mm({slots:{base:"relative mx-auto border-gray-800 dark:border-gray-800 bg-gray-800 border-[14px] rounded-[2.5rem] h-[600px] w-[300px] shadow-xl",slot:"rounded-[2rem] overflow-hidden w-[272px] h-[572px] bg-white dark:bg-gray-800",top:"w-[148px] h-[18px] bg-gray-800 top-0 rounded-b-[1rem] left-1/2 -translate-x-1/2 absolute",leftTop:"h-[46px] w-[3px] bg-gray-800 absolute -left-[17px] top-[124px] rounded-l-lg",leftBot:"h-[46px] w-[3px] bg-gray-800 absolute -left-[17px] top-[178px] rounded-l-lg",right:"h-[64px] w-[3px] bg-gray-800 absolute -right-[17px] top-[142px] rounded-r-lg"}}),Mm({slots:{base:"relative mx-auto border-gray-800 dark:border-gray-800 bg-gray-800 border-[8px] rounded-t-xl h-[172px] max-w-[301px] md:h-[294px] md:max-w-[512px]",inner:"rounded-lg overflow-hidden h-[156px] md:h-[278px] bg-white dark:bg-gray-800",bot:"relative mx-auto bg-gray-900 dark:bg-gray-700 rounded-b-xl rounded-t-sm h-[17px] max-w-[351px] md:h-[21px] md:max-w-[597px]",botCen:"absolute left-1/2 top-0 -translate-x-1/2 roun
29ded-b-xl w-[56px] h-[5px] md:w-[96px] md:h-[8px] bg-gray-800"}}),Mm({slots:{base:"relative mx-auto bg-gray-800 dark:bg-gray-700 rounded-t-[2.5rem] h-[63px] max-w-[133px]",slot:"rounded-[2rem] overflow-hidden h-[193px] w-[188px]",rightTop:"h-[41px] w-[6px] bg-gray-800 dark:bg-gray-800 absolute -right-[16px] top-[40px] rounded-r-lg",rightBot:"h-[32px] w-[6px] bg-gray-800 dark:bg-gray-800 absolute -right-[16px] top-[88px] rounded-r-lg",top:"relative mx-auto border-gray-900 dark:bg-gray-800 dark:border-gray-800 border-[10px] rounded-[2.5rem] h-[213px] w-[208px]",bot:"relative mx-auto bg-gray-800 dark:bg-gray-700 rounded-b-[2.5rem] h-[63px] max-w-[133px]"}}),Mm({slots:{base:"relative mx-auto border-gray-800 dark:border-gray-800 bg-gray-800 border-[14px] rounded-[2.5rem] h-[454px] max-w-[341px] md:h-[682px] md:max-w-[512px]",slot:"rounded-[2rem] overflow-hidden h-[426px] md:h-[654px] bg-white dark:bg-gray-800",leftTop:"h-[32px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -left-[17px] top-[72px] rounded-l-lg",leftMid:"h-[46px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -left-[17px] top-[124px] rounded-l-lg",leftBot:"h-[46px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -left-[17px] top-[178px] rounded-l-lg",right:"h-[64px] w-[3px] bg-gray-800 dark:bg-gray-800 absolute -right-[17px] top-[142px] rounded-r-lg"}});$u("<div><div></div> <div></div> <div></div> <div></div> <div></div> <div><!></div></div>");$u("<div><div></div> <div></div> <div></div> <div></div> <div><!></div></div>");$u("<div><div><!></div></div> <div></div> <div></div>",1);$u("<div><div></div> <div></div> <div></div> <div></div> <div><!></div></div>");$u("<div><div><div><!></div></div> <div><div></div></div></div>");$u("<div><div></div> <div><div></div> <div></div> <div><!></div></div> <div></div></div>");$u("<div><div></div> <div></div> <div></div> <div></div> <div><!></div></div>");function K_(e,t={}){if(null===t)return{update(e={}){t=e},destroy(){}};const r=document.activeElement;let n=!1,i=!1;function o(){return Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))}function a(e){if("Tab"===e.key&&null!==t){const t=document.activeElement,r=o(),n=r.at(0),i=r.at(-1);e.shiftKey&&t===n&&(i?.focus(),e.preventDefault()),e.shiftKey||t!==i||(n?.focus(),e.preventDefault())}else"Escape"===e.key&&null!==t&&t.onEscape&&(e.preventDefault(),n=!0,t.onEscape())}function s(t){e.contains(t.relatedTarget)||t.relatedTarget===r||(i=!0)}return function(){if(null!==t){if(n=!!t.isClosing,!n&&!i){const e=o();e.length>0&&e[0].focus()}e.addEventListener("keydown",a),e.addEventListener("focusout",s)}}(),{update(r={}){e.removeEventListener("keydown",a),e.removeEventListener("focusout",s),r&&void 0!==r.isClosing&&(n=r.isClosing),null!==(t=r)&&(e.addEventListener("keydown",a),e.addEventListener("focusout",s))},destroy(){null!==t&&(e.removeEventListener("keydown",a),e.removeEventListener("focusout",s),n||i||!r||setTimeout((()=>{r.focus({preventScroll:!0})}),0))}}}const J_=Mm({slots:{base:"backdrop:bg-gray-900/50 open:flex flex-col bg-white dark:bg-gray-800",form:"flex flex-col w-full border-inherit dark:border-inherit divide-inherit dark:divide-inherit",close:"absolute top-2.5 end-2.5"},variants:{},defaultVariants:{}});var Q_=$u("<!> <!>",1),ev=$u('<form method="dialog"><!></form>'),tv=$u("<dialog><!></dialog>");function rv(e,t){Zs(t,!0);const r=e=>{var r=Q_(),n=dc(r);ud(n,(()=>t.children??Ka));var i=hc(n,2),o=e=>{{let r=Dl((()=>y({class:yd(t.classes?.close)})));Fm(e,{type:"submit",formnovalidate:!0,get class(){return yu(r)}})}};ad(i,(e=>{u()&&!c()&&e(o)})),Yu(e,r)};let n=fh(t,"onaction",3,(()=>!0)),i=fh(t,"form",3,!1),o=fh(t,"modal",3,!0),a=fh(t,"autoclose",3,!1),s=fh(t,"focustrap",3,!1),l=fh(t,"open",15,!1),c=fh(t,"permanent",3,!1),u=fh(t,"dismissable",3,!0),d=fh(t,"outsideclose",3,!0),h=fh(t,"transition",3,h_),f=lh(t,["$$slots","$$events","$$legacy","children","onaction","oncancel","onsubmit","ontoggle","form","modal","autoclose","focustrap","open","permanent","dismissable","outsideclose","class","classes","transition","transitionParams"]);const p=Dl((()=>t.transitionParams??{duration:100,easing:l_}));let{base:g,form:m,close:y}=J_();const _=()=>l(!1),v=e=>{if("function"==typeof e.requestClose)return e.requestClose();e.dispatchEvent(new Event("cancel",{bubbles:!0,cancelable:!0}))};function b(e){e.target===e.currentTarget&&(t.oncancel?.(e),e.defaultPrevented||(e.preventDefault(),c()||_()))}function x(e){const t=e.currentTarget;if(e.target===t){const r=t.getBoundingClientRect(),n=e.clientX>=r.left&&e.clientX<=r.right&&e.clientY>
29=r.top&&e.clientY<=r.bottom;if(d()&&!n)return v(t)}if(a()&&e.target instanceof HTMLButtonElement&&!c())return _()}function w(e){if(t.onsubmit?.(e),e.defaultPrevented)return;if(!(e.target instanceof HTMLFormElement)||"dialog"!==e.target.method)return;e.preventDefault();const r=e.currentTarget;if(e.submitter&&"value"in e.submitter&&(r.returnValue=String(e.submitter.value??"")),!r.returnValue)return v(r);if("function"==typeof n()){if(!1===n()({action:r.returnValue,data:new FormData(e.target)}))return}_()}function S(e){t.ontoggle?.(e),l("open"===e.newState)}function k(e){return o()?e.showModal():e.show(),queueMicrotask((()=>{const t=e.querySelector("[data-autofocus]")??e.querySelector('input, textarea, select, button:not([aria-label="Close"])');t?t.focus():e.focus()})),()=>e.close()}let T=$l(void 0);Am((function(){i()||yu(T)?.dispatchEvent(new Event("cancel",{bubbles:!0,cancelable:!0}))}));var I=Zu(),M=dc(I),E=e=>{var n=tv();Nd(n,(e=>({tabindex:"-1",onsubmit:w,oncancel:b,onclick:x,ontoggle:S,...f,class:e})),[()=>g({class:yd(t.class)})]);var o=uc(n),a=e=>{var n=ev(),i=uc(n);r(i),Os(n),Pc((e=>wd(n,1,e)),[()=>_d(m({class:yd(t.classes?.form)}))]),Yu(e,n)},l=e=>{r(e)};ad(o,(e=>{i()?e(a):e(l,!1)})),Os(n),pd(n,(()=>k)),nh(n,(e=>ql(T,e)),(()=>yu(T))),fd(n,(e=>{return t=e,s()?K_(t):void 0;var t})),Yd(7,n,h,(()=>yu(p))),Yu(e,n)};ad(M,(e=>{l()&&e(E)})),Yu(e,I),Ys()}Mm({extend:J_,slots:{base:"p-4 max-h-none max-w-none border border-gray-200 dark:border-gray-700 transform-gpu will-change-transform"},variants:{placement:{left:{base:"me-auto h-full"},right:{base:"ms-auto h-full"},top:{base:"mb-auto !w-full"},bottom:{base:"mt-auto !w-full"}},width:{default:{base:"w-80"},full:{base:"w-full"},half:{base:"w-1/2"}},modal:{false:{base:"fixed inset-0"},true:{base:""}},shifted:{true:{},false:{}}},compoundVariants:[{shifted:!1,modal:!1,class:{base:"z-50"}},{shifted:!0,placement:"left",class:{base:"-translate-x-full"}},{shifted:!0,placement:"right",class:{base:"translate-x-full"}},{shifted:!0,placement:"top",class:{base:"-translate-y-full"}},{shifted:!0,placement:"bottom",class:{base:"translate-y-full"}}],defaultVariants:{placement:"left",width:"default",modal:!0}}),Mm({slots:{base:"flex items-center justify-between",button:"ms-auto inline-flex h-8 w-8 items-center justify-center rounded-lg bg-transparent text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white",svg:"h-4 w-4"}}),Mm({slots:{base:"p-4 absolute flex select-none cursor-grab active:cursor-grabbing focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-300 dark:focus-visible:ring-gray-500",handle:"absolute rounded-lg bg-gray-300 dark:bg-gray-600"},variants:{placement:{left:{base:"inset-y-0 right-0 touch-pan-x",handle:"w-1 h-8 top-1/2 -translate-y-1/2"},right:{base:"inset-y-0 left-0 touch-pan-x",handle:"w-1 h-8 top-1/2 -translate-y-1/2"},top:{base:"inset-x-0 bottom-0 touch-pan-y",handle:"w-8 h-1 left-1/2 -translate-x-1/2"},bottom:{base:"inset-x-0 top-0 touch-pan-y",handle:"w-8 h-1 left-1/2 -translate-x-1/2"}}}});$u("<!> <!>",1);$u('<button><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"></path></svg> <span class="sr-only">Close drawer</span></button>'),$u("<div><!> <!></div>");$u("<button><!> <span></span></button>");Mm({base:"mt-2 divide-y divide-gray-300 dark:divide-gray-500 overflow-hidden rounded-lg bg-white shadow-sm dark:bg-gray-700"}),Mm({base:"my-1 h-px bg-gray-100 dark:bg-gray-500"}),Mm({base:"px-4 py-3 text-sm text-gray-900 dark:text-white"}),Mm({slots:{base:"block w-full text-left px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white",active:"block w-full text-left px-4 py-2 text-primary-700 dark:text-primary-600 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white",li:""}}),Mm({base:"py-2 text-sm text-gray-700 dark:text-gray-200"});$u("<ul><!></ul>");$u("<div></div>");$u("<div><!></div>");$u("<a><!></a>"),$u("<button><!></button>"),$u("<div><!></div>"),$u("<li><!></li>");
29const nv=Mm({base:"bg-white dark:bg-gray-800",variants:{footerType:{default:"p-4 rounded-lg shadow md:flex md:items-center md:justify-between md:p-6",sitemap:"bg-white dark:bg-gray-900",socialmedia:"p-4 sm:p-6",logo:"p-4 rounded-lg shadow md:px-6 md:py-8",sticky:"fixed bottom-0 left-0 z-20 w-full p-4 bg-white border-t border-gray-200 shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800 dark:border-gray-600"}}}),iv=(Mm({slots:{base:"flex items-center",span:"self-center text-2xl font-semibold whitespace-nowrap dark:text-white",img:"me-3 h-8"}}),Mm({slots:{base:"block text-sm text-gray-500 sm:text-center dark:text-gray-400",link:"hover:underline",bySpan:"ms-1"}})),ov=Mm({base:"text-gray-500 hover:text-gray-900 dark:hover:text-white"}),av=Mm({base:"text-gray-600 dark:text-gray-400"}),sv=Mm({slots:{base:"me-4 last:me-0 md:me-6",link:"hover:underline"}});var lv=$u("<footer><!></footer>");$u("<img/>"),$u("<span> </span>"),$u("<a><!> <!> <!></a>"),$u("<img/>");var cv=$u("<a> </a>"),uv=$u("<span> </span>"),dv=$u("<span> <!> </span>");var hv=$u("<a><!></a>");function fv(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","href","ariaLabel","class"]);const n=x_("footerIcon");var i=Zu(),o=dc(i),a=e=>{var i=hv();Nd(i,(e=>({...r,href:t.href,"aria-label":t.ariaLabel,class:e})),[()=>ov({class:yd(n,t.class)})]),ud(uc(i),(()=>t.children)),Os(i),Yu(e,i)},s=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(o,(e=>{t.href?e(a):e(s,!1)})),Yu(e,i),Ys()}var pv=$u("<li><a><!></a></li>");function gv(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","liClass","aClass","href","classes","class"]);t.liClass,t.aClass;const n=Dl((()=>t.classes??{link:t.aClass})),i=x_("footerLink"),{base:o,link:a}=sv();var s=pv(),l=uc(s);Nd(l,(e=>({...r,href:t.href,class:e})),[()=>a({class:yd(i?.link,yu(n).link)})]),ud(uc(l),(()=>t.children)),Os(l),Os(s),Pc((e=>wd(s,1,e)),[()=>_d(o({class:yd(i?.base,t.class??t.liClass)}))]),Yu(e,s),Ys()}var mv=$u("<ul><!></ul>");function yv(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","class","children"]);const n=x_("footerLinkGroup");var i=mv();Nd(i,(e=>({...r,class:e})),[()=>av({class:yd(n,t.class)})]),ud(uc(i),(()=>t.children)),Os(i),Yu(e,i),Ys()}Mm({slots:{image:"h-auto max-w-full rounded-lg",div:"grid"}});$u("<div><img/></div>"),$u("<div></div>");Mm({base:"px-2 py-1.5 text-xs font-semibold text-gray-800 bg-gray-100 border border-gray-200 rounded-lg dark:bg-gray-600 dark:text-gray-100 dark:border-gray-500"});$u("<kbd><!></kbd>");Mm({base:"flex bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 divide-gray-200 dark:divide-gray-600",variants:{rounded:{true:"rounded-lg",false:""},border:{true:"border border-gray-200 dark:border-gray-700",false:""},horizontal:{true:"flex-row divide-x",false:"flex-col divide-y"}},compoundVariants:[{border:!0,class:"divide-gray-200 dark:divide-gray-700"}],defaultVariants:{rounded:!0,border:!0,horizontal:!1}}),Mm({base:"py-2 px-4 w-full text-sm font-medium list-none flex items-center text-left gap-2",variants:{state:{normal:"",current:"text-white bg-primary-700 dark:text-white dark:bg-gray-800",disabled:"text-gray-900 bg-gray-100 dark:bg-gray-600 dark:text-gray-400"},active:{true:"",false:""},horizontal:{true:"first:rounded-s-lg last:rounded-e-lg",false:"first:rounded-t-lg last:rounded-b-lg"}},compoundVariants:[{active:!0,state:"disabled",class:"cursor-not-allowed"},{active:!0,state:"normal",class:"hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-600 dark:hover:text-white focus:z-40 focu
29s:outline-hidden focus:ring-2 focus:ring-primary-700 focus:text-primary-700 dark:focus:ring-gray-500 dark:focus:text-white"}]});$u("<!> <!>",1),$u("<li><!></li>"),$u("<button><!></button>"),$u("<a><!></a>");Mm({slots:{base:"w-fit bg-white shadow-md dark:bg-gray-700 text-gray-700 dark:text-gray-200 rounded-lg border border-gray-100 dark:border-gray-600 divide-gray-100 dark:divide-gray-600",div:"flex flex-col md:flex-row p-4 max-w-(--breakpoint-md) justify-center mx-auto mt-2",ul:"grid grid-flow-row gap-y-4 md:gap-x-0 auto-col-max auto-row-max grid-cols-2 md:grid-cols-3 text-sm font-medium",extra:"md:w-1/3 mt-4 md:mt-0"},variants:{full:{true:{base:"border-y shadow-xs w-full ml-0 rounded-none"}},hasExtra:{true:{}}},compoundVariants:[{full:!0,hasExtra:!0,class:{ul:"grid-cols-2 md:w-2/3"}}]});$u("<li><!></li>"),$u("<div><!></div>"),$u("<div><ul></ul> <!></div>");const _v=Mm({extend:J_,slots:{base:"w-full rounded-lg divide-y text-gray-500 dark:text-gray-400 border-gray-300 dark:border-gray-700 divide-gray-300 dark:divide-gray-700 bg-white dark:bg-gray-800 pointer-events-auto",form:"rounded-lg divide-y",header:"flex items-center p-4 md:p-5 justify-between rounded-t-lg shrink-0 text-xl font-semibold text-gray-900 dark:text-white",footer:"flex items-center p-4 md:p-5 space-x-3 rtl:space-x-reverse rounded-b-lg shrink-0",body:"p-4 md:p-5 space-y-4 overflow-y-auto overscroll-contain"},variants:{fullscreen:{true:{base:"fixed inset-0 w-screen h-screen max-w-none max-h-none m-0 p-0 border-none rounded-none bg-white dark:bg-gray-900"}},placement:{"top-left":{base:"mb-auto mr-auto"},"top-center":{base:"mb-auto mx-auto"},"top-right":{base:"mb-auto ml-auto"},"center-left":{base:"my-auto mr-auto"},center:{base:"my-auto mx-auto"},"center-right":{base:"my-auto ml-auto"},"bottom-left":{base:"mt-auto mr-auto"},"bottom-center":{base:"mt-auto mx-auto"},"bottom-right":{base:"mt-auto ml-auto"}},size:{none:{base:""},xs:{base:"max-w-md"},sm:{base:"max-w-lg"},md:{base:"max-w-2xl"},lg:{base:"max-w-4xl"},xl:{base:"max-w-7xl"}}},defaultVariants:{placement:"center",size:"md"}});var vv=$u("<h3> </h3> <!>",1),bv=$u("<div><!></div>"),xv=$u("<div><!></div>"),wv=$u("<!> <div><!></div> <!>",1);const Sv=Mm({base:"relative w-full px-2 py-2.5 sm:px-4"}),kv=Mm({base:"flex items-center"}),Tv=Mm({base:"mx-auto flex flex-wrap items-center justify-between ",variants:{fluid:{true:"w-full",false:"container"}}}),Iv=Mm({slots:{base:"",ul:"flex flex-col p-4 mt-0 rtl:space-x-reverse",active:"text-white bg-primary-700 dark:bg-primary-600",nonActive:"hover:text-primary-500 text-gray-700 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},variants:{breakpoint:{sm:{base:"w-full sm:block sm:w-auto",ul:"sm:flex-row sm:text-sm sm:font-medium",active:"sm:bg-transparent sm:text-primary-700 sm:dark:text-white sm:dark:bg-transparent",nonActive:"sm:hover:bg-transparent sm:border-0 sm:hover:text-primary-700 dark:sm:text-gray-400 sm:dark:hover:text-white sm:dark:hover:bg-transparent"},md:{base:"w-full md:block md:w-auto",ul:"md:flex-row md:text-sm md:font-medium",active:"md:bg-transparent md:text-primary-700 md:dark:text-white md:dark:bg-transparent",nonActive:"md:hover:bg-transparent md:border-0 md:hover:text-primary-700 dark:md:text-gray-400 md:dark:hover:text-white md:dark:hover:bg-transparent"},lg:{base:"w-full lg:block lg:w-auto",ul:"lg:flex-row lg:text-sm lg:font-medium",active:"lg:bg-transparent lg:text-primary-700 lg:dark:text-white lg:dark:bg-transparent",nonActive:"lg:hover:bg-transparent lg:border-0 lg:hover:text-primary-700 dark:lg:text-gray-400 lg:dark:hover:text-white lg:dark:hover:bg-transparent"},xl:{base:"w-full xl:block xl:w-auto",ul:"xl:flex-row xl:text-sm xl:font-medium",active:"xl:bg-transparent xl:text-primary-700 xl:dark:text-white xl:dark:bg-transparent",nonActive:"xl:hover:bg-transparent xl:border-0 xl:hover:text-primary-700 dark:xl:text-gray-400 xl:dark:hover:text-white xl:dark:hover:bg-transparent"}},hidden:{false:{base:"absolute top-full left-0 right-0 z-50 w-full",ul:"border rounded-lg bg-white shadow-lg dark:bg-gray-800 dark:border-gray-700 text-gray-700 dark:text-gray-400 border-gray-100 dark:border-gray-700 divide-gray-100 dark:divide-gray-700"},true:{base:"hidden"}}},compoundVariants:[{breakpoint:"sm",hidden:!1,class:{base:"sm:static sm:z-auto",ul:"sm:border-none sm:rounded-none sm:bg-inherit dark:sm:bg-inherit sm:shadow-none"}},{breakpoint:"md",hidden:!1,class:{base:"md:static md:z-auto",ul:"md:border-none md:rounded-none md:bg-inherit dark:md:bg-inherit md:shadow-none"}},{breakpoint:"lg",hidden:!1,class:{base:"lg:static lg:z-auto",ul:"lg:border-none lg:rou
29nded-none lg:bg-inherit dark:lg:bg-inherit lg:shadow-none"}},{breakpoint:"xl",hidden:!1,class:{base:"xl:static xl:z-auto",ul:"xl:border-none xl:rounded-none xl:bg-inherit dark:xl:bg-inherit xl:shadow-none"}}],defaultVariants:{breakpoint:"md"}}),Mv=Mm({base:"block py-2 pe-4 ps-3 rounded-sm",variants:{breakpoint:{sm:"sm:p-2 sm:border-0",md:"md:p-2 md:border-0",lg:"lg:p-2 lg:border-0",xl:"xl:p-2 xl:border-0"},hidden:{false:"text-gray-700 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"}},compoundVariants:[{breakpoint:"sm",hidden:!1,class:"sm:hover:bg-transparent sm:hover:text-primary-700 sm:dark:hover:text-white sm:dark:hover:bg-transparent"},{breakpoint:"md",hidden:!1,class:"md:hover:bg-transparent md:hover:text-primary-700 md:dark:hover:text-white md:dark:hover:bg-transparent"},{breakpoint:"lg",hidden:!1,class:"lg:hover:bg-transparent lg:hover:text-primary-700 lg:dark:hover:text-white lg:dark:hover:bg-transparent"},{breakpoint:"xl",hidden:!1,class:"xl:hover:bg-transparent xl:hover:text-primary-700 xl:dark:hover:text-white xl:dark:hover:bg-transparent"}],defaultVariants:{breakpoint:"md"}}),Ev=Mm({slots:{base:"ms-3",menu:"h-6 w-6 shrink-0"},variants:{breakpoint:{sm:{base:"sm:hidden"},md:{base:"md:hidden"},lg:{base:"lg:hidden"},xl:{base:"xl:hidden"}}},defaultVariants:{breakpoint:"md"}});var Pv=$u("<div><!></div>");function Av(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","fluid","class"]);const n=x_("navbarContainer");var i=Pv();Nd(i,(e=>({...r,class:e})),[()=>Tv({fluid:t.fluid,class:yd(n,t.class)})]),ud(uc(i),(()=>t.children??Ka)),Os(i),Yu(e,i),Ys()}var Cv=$u("<nav><div><!></div></nav>");var Rv=$u("<a><!></a>");var Lv=$u("<button><!></button>"),Ov=$u("<a><!></a>"),Dv=$u("<li><!></li>");function zv(e,t){Zs(t,!0);let r=qs("navState"),n=qs("breakpoint"),i=lh(t,["$$slots","$$events","$$legacy","children","onclick","activeClass","nonActiveClass","class"]);const o=x_("navbarLi");let a=Dl((()=>!!r.activeUrl&&t.href===r.activeUrl)),s=Dl((()=>Mv({breakpoint:n,hidden:r.hidden,class:yd(yu(a)?t.activeClass??r.activeClass:t.nonActiveClass??r.nonActiveClass,o,t.class)})));function l(e){void 0===t.href||r.hidden||(r.hidden=!0),t.onclick&&t.onclick(e)}var c=Dv(),u=uc(c),d=e=>{var r=Lv();Nd(r,(()=>({role:"presentation",onclick:l,...i,class:yu(s)}))),ud(uc(r),(()=>t.children??Ka)),Os(r),Yu(e,r)},h=e=>{var r=Ov();Nd(r,(()=>({...i,class:yu(s),onclick:l}))),ud(uc(r),(()=>t.children??Ka)),Os(r),Yu(e,r)};ad(u,(e=>{void 0===t.href?e(d):e(h,!1)})),Os(c),Yu(e,c),Ys()}Date;Set,Symbol.iterator;Map,Symbol.iterator;const Fv=Symbol();URLSearchParams,Symbol.iterator;URL;class Nv{#V;#G;constructor(e,t){this.#V=e,this.#G=xl(t)}get current(){return this.#G(),this.#V()}}const Bv=/\(.+\)/,jv=new Set(["all","print","screen","and","or","not","only"]);class Vv extends Nv{constructor(e,t){let r=Bv.test(e)||e.split(/[\s,]+/).some((e=>jv.has(e.trim())))?e:`(${e})`;const n=window.matchMedia(r);super((()=>n.matches),(e=>function(e,t,r,n={}){var i=Fu(t,e,r,n);return()=>{e.removeEventListener(t,i,n)}}(n,"change",e)))}}const Gv=new Vv("(prefers-reduced-motion: reduce)");var Uv=$u("<div><ul><!></ul></div>"),$v=$u("<div><ul><!></ul></div>");function Hv(e,t){Zs(t,!0);let r=qs("navState"),n=qs("breakpoint"),i=fh(t,"transition",3,p_),o=fh(t,"respectMotionPreference",3,!0),a=lh(t,["$$slots","$$events","$$legacy","children","activeUrl","ulClass","slideParams","transition","transitionParams","activeClass","nonActiveClass","respectMotionPreference","class","classes"]);t.ulClass,t.activeClass,t.nonActiveClass;const s=Dl((()=>t.classes??{ul:t.ulClass,active:t.activeClass,nonActive:t.nonActiveClass})),l=x_("navbarUl"),c=e=>e===p_?{delay:0,duration:200,easing:l_}:e===f_?{delay:0,duration:200,y:-10,easing:l_}:e===h_?{delay:0,duration:200,easing:l_}:e===g_?{delay:0,duration:200,start:.95,easing:l_}:{delay:0,duration:200,easing:l_},u=Dl((()=>c(i()))),d=Dl((()=>t.transitionParams??t.slideParams??yu(u))),h=Dl((()=>()=>o()&&Gv.current?{...yu(d),duration:0,delay:0}:yu(d)));let f=Dl((()=>r.hidden??!0)),p=Dl((()=>Iv({hidden:yu(f),breakpoint:n}))),g=Dl((()=>yu(p).base)),m=Dl((()=>yu(p).ul)),y=Dl((()=>yu(p).active)),_=Dl((()=>yu(p).nonActive));Tc((()=>{r.activeClass=yu(y)({class:yd(l?.active,yu(s).active)}),r.nonActiveClass=yu(_)({class:yd(l?.nonActive,yu(s).nonActive)}),r.activeUrl=t.activeUrl}));let v=Dl((()=>yu(g)({class:yd(l?.base,t.class)}))),b=Dl((()=>yu(m)({class:yd(l?.ul,yu(s).ul)})));var x=Zu(),w=dc(x),S=e=>{var r=Uv();Nd(r,(()=>({...a,class:yu(v)})));var n=uc(r);ud(uc(n),(()=>t.children??Ka)),Os(n),Os(r),Pc((()=>wd(n,1,_d(yu(b))))),Yd(3,r,i,(()=>yu(h)())),Yu(e,r)},k=e=>{var r=$v();Nd(r,(()=>({...a,class:yu(v)})));var n=uc(r);ud(uc(n),(()=>t.children??Ka)),Os(n),Os(r),Pc((()=>wd(n,1,_d(yu(b))))),Yu(e,r)};ad(w,(e=>{yu(f)?e(k,!1):e(S)})),Yu(e,x),Ys()}var qv=qu("<svg><!></svg>");function Wv(e,t){Zs(t,!0);let r=fh(t,"size",3,"24"),n=fh(t,"color",3,"currentColor"),i=fh(t,"variation",3,"outline"),o=fh(t,"ariaLabel",3,"bars 3"),a=lh(t,["$$slots","$$events","$$legacy","size","color","variation","ariaLabel","class"]),s=$l("0 0 24 24"),l=$l(""),c=`<path stroke="${n()}" stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16"></path> `,u=`<path fill="${n()}" clip-rule="evenodd" fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"></path> `;Tc((()=>{switch(i()){case"outline":default:ql(l,c),ql(s,"0 0 24 24");break;case"solid":ql(l,u),ql(s,"0 0 24 24")}}));var d=qv();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",role:"button",tabindex:"0",width:r(),height:r(),class:e,...a,"aria-label":o(),fill:"none",viewBox:yu(s),"stroke-width":"2"})),[()=>yd(t.class)]),function(e,t,r=!1,n=!1){var i=e,o="";Pc((()=>{var e=Jc;
29if(o!==(o=t()??"")){if(null!==e.nodes_start&&(zc(e.nodes_start,e.nodes_end),e.nodes_start=e.nodes_end=null),""!==o){if(As){Ps.data;for(var a=Ls(),s=a;null!==a&&(8!==a.nodeType||""!==a.data);)s=a,a=cc(a);if(null===a)throw Es(),Is;return Uu(Ps,s),void(i=Rs(a))}var l=o+"";r?l=`<svg>${l}</svg>`:n&&(l=`<math>${l}</math>`);var c=Gu(l);if((r||n)&&(c=lc(c)),Uu(lc(c),c.lastChild),r||n)for(;lc(c);)i.before(lc(c));else i.before(c)}}else As&&Ls()}))}(uc(d),(()=>yu(l)),!0),Os(d),Yu(e,d),Ys()}Mm({slots:{base:"inline-flex -space-x-px rtl:space-x-reverse items-center",tableDiv:"flex items-center text-sm mb-4",span:"font-semibold mx-1",prev:"rounded-none",next:"rounded-none",active:""},variants:{size:{default:"",large:""},layout:{table:{prev:"rounded-s bg-gray-800 hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white text-white  hover:text-gray-200",next:"text-white bg-gray-800 border-0 border-s border-gray-700 rounded-e hover:bg-gray-900 hover:text-gray-200 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},navigation:{prev:"rounded-s-lg",next:"rounded-e-lg"},pagination:{prev:"rounded-s-lg",next:"rounded-e-lg"}}},defaultVariants:{table:!1,size:"default"}}),Mm({base:"flex items-center font-medium",variants:{size:{default:"h-8 px-3 text-sm",large:"h-10 px-4 text-base"},active:{true:"text-primary-600 border border-gray-300 bg-primary-50 hover:bg-primary-100 hover:text-primary-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white",false:"text-gray-500 bg-white hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},group:{true:"",false:"rounded-lg"},table:{true:"rounded-sm",false:"border"},disabled:{true:"cursor-not-allowed opacity-50",false:""}},compoundVariants:[{group:!1,table:!1,class:"rounded-lg"}],defaultVariants:{size:"default",active:!1,group:!1,table:!1}}),Mm({base:"flex items-center font-medium",variants:{size:{default:"h-8 px-3 text-sm",large:"h-10 px-4 text-base"},active:{true:"text-primary-600 border border-gray-300 bg-primary-50 hover:bg-primary-100 hover:text-primary-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white",false:"text-gray-500 bg-white hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},group:{true:"",false:"rounded-lg"},table:{true:"rounded-sm",false:"border"}},compoundVariants:[{group:!1,table:!1,class:"rounded-lg"}],defaultVariants:{size:"default",active:!1,group:!1,table:!1}}),Mm({base:"inline-flex -space-x-px rtl:space-x-reverse items-center",variants:{table:{true:"divide-x rtl:divide-x-reverse dark divide-gray-700 dark:divide-gray-700",false:""},size:{default:"",large:""}},defaultVariants:{table:!1,size:"default"}});$u("<a><!></a>"),$u("<button><!></button>");$u("<div>Showing <span> </span> of <span> </span> Entries</div>"),$u("<li><!></li>"),$u("<nav><!> <ul><li><!></li> <!> <li><!></li></ul></nav>");$u("<a><!></a>"),$u("<button><!></button>");$u("<li><!></li>"),$u("<li><!></li>"),$u("<li><!></li>"),$u("<nav><ul><!> <!> <!></ul></nav>");Mm({slots:{base:"rounded-lg shadow-md bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 border border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700",content:"p-2",title:"py-2 px-3 rounded-t-md border-b ",h3:"font-semibold"},variants:{color:{default:{title:"bg-gray-100 border-gray-200 dark:border-gray-600 dark:bg-gray-700",h3:"text-gray-900 dark:text-white"},primary:{title:"bg-primary-700",h3:"text-white"},secondary:{title:"bg-secondary-700",h3:"text-white"},gray:{title:"bg-gray-700",h3:"text-white"},red:{title:"bg-red-700",h3:"text-white"},orange:{title:"bg-orange-700",h3:"text-white"},amber:{title:"bg-amber-700",h3:"text-white"},yellow:{title:"bg-yellow-500",h3:"text-gray-800"},lime:{title:"bg-lime-700",h3:"text-white"},green:{title:"bg-green-700",h3:"text-white"},emerald:{title:"bg-emerald-700",h3:"text-white"},teal:{title:"bg-teal-700",h3:"text-white"},cyan:{title:"bg-cyan-700",h3:"text-white"},sky:{title:"bg-sky-700",h3:"text-white"},blue:{title:"bg-blue-700",h3:"text-white"},indigo:{title:"bg-indigo-700",h3:"text-white"},violet:{title:"bg-violet-700",h3:"text-white"},purple:{title:"bg-purple-700",h3:"text-white"},fuchsia:{title:"bg-fuchsia-700",h3:"text-white"},pink:{title:"bg-pink-700",h3:"text-white"},rose:{title:"bg-rose-700",h3:"text-white"}}}});$u("<div><h3> </h3></div>"),$u("<!> <div><!></div>",1);Mm({slots:{base:"w-full bg-gray-200 rounded-full dark:bg-gray-700",label:"text-primary-100 text-xs font-medium text-center leading-none rounded-full",inside:"rounded-full",outside:"mb-1 flex justify-between",span:"text-base font-medium dark:text-white",progressCls:"text-sm font-medium dark:text-white"},variants:{color:{primary:{label:"bg-primary-600",inside:"bg-primary-600"},secondary:{label:"bg-secondary-600",inside:"bg-secondary-600"},gray:{label:"bg-gray-600 dark:bg-gray-300",inside:"bg-gray-600 dark:bg-gray-300"},red:{label:"bg-red-600 dark:bg-red-500",inside:"bg-red-600 dark:bg-red-500"}
29,orange:{label:"bg-orange-600 dark:bg-orange-500",inside:"bg-orange-600 dark:bg-orange-500"},amber:{label:"bg-amber-600 dark:bg-amber-500",inside:"bg-amber-600 dark:bg-amber-500"},yellow:{label:"bg-yellow-400",inside:"bg-yellow-400"},lime:{label:"bg-lime-600 dark:bg-lime-500",inside:"bg-lime-600 dark:bg-lime-500"},green:{label:"bg-green-600 dark:bg-green-500",inside:"bg-green-600 dark:bg-green-500"},emerald:{label:"bg-emerald-600 dark:bg-emerald-500",inside:"bg-emerald-600 dark:bg-emerald-500"},teal:{label:"bg-teal-600 dark:bg-teal-500",inside:"bg-teal-600 dark:bg-teal-500"},cyan:{label:"bg-cyan-600 dark:bg-cyan-500",inside:"bg-cyan-600 dark:bg-cyan-500"},sky:{label:"bg-sky-600 dark:bg-sky-500",inside:"bg-sky-600 dark:bg-sky-500"},blue:{label:"bg-blue-600",inside:"bg-blue-600"},indigo:{label:"bg-indigo-600 dark:bg-indigo-500",inside:"bg-indigo-600 dark:bg-indigo-500"},violet:{label:"bg-violet-600 dark:bg-violet-500",inside:"bg-violet-600 dark:bg-violet-500"},purple:{label:"bg-purple-600 dark:bg-purple-500",inside:"bg-purple-600 dark:bg-purple-500"},fuchsia:{label:"bg-fuchsia-600 dark:bg-fuchsia-500",inside:"bg-fuchsia-600 dark:bg-fuchsia-500"},pink:{label:"bg-pink-600 dark:bg-pink-500",inside:"bg-pink-600 dark:bg-pink-500"}
29,rose:{label:"bg-rose-600 dark:bg-rose-500",inside:"bg-rose-600 dark:bg-rose-500"}},labelInside:{true:"",false:""}},compoundVariants:[{labelInside:!0,class:{base:"text-primary-100 text-xs font-medium text-center leading-none rounded-full",label:"p-0.5"}},{labelInside:!1,class:{base:"rounded-full"}}],defaultVariants:{color:"primary",labelInside:!1}}),Mm({slots:{base:"relative inline-flex",label:"absolute inset-0 flex items-center justify-center text-sm font-medium",background:"opacity-25",foreground:"transition-all",outside:"flex flex-col items-center mb-2 text-center",span:"text-base font-medium",progressCls:"text-sm font-medium ml-1"},variants:{color:{primary:{background:"stroke-primary-600",foreground:"stroke-primary-600"},secondary:{background:"stroke-secondary-600",foreground:"stroke-secondary-600"},gray:{background:"stroke-gray-600 dark:stroke-gray-300",foreground:"stroke-gray-600 dark:stroke-gray-300"},red:{background:"stroke-red-600 dark:stroke-red-500",foreground:"stroke-red-600 dark:stroke-red-500"},orange:{background:"stroke-orange-600 dark:stroke-orange-500",foreground:"stroke-orange-600 dark:stroke-orange-500"},amber:{background:"stroke-amber-600 dark:stroke-amber-500",foreground:"stroke-amber-600 dark:stroke-amber-500"},yellow:{background:"stroke-yellow-400",foreground:"stroke-yellow-400"},lime:{background:"stroke-lime-600 dark:stroke-lime-500",foreground:"stroke-lime-600 dark:stroke-lime-500"},green:{background:"stroke-green-600 dark:stroke-green-500",foreground:"stroke-green-600 dark:stroke-green-500"},emerald:{background:"stroke-emerald-600 dark:stroke-emerald-500",foreground:"stroke-emerald-600 dark:stroke-emerald-500"},teal:{background:"stroke-teal-600 dark:stroke-teal-500",foreground:"stroke-teal-600 dark:stroke-teal-500"},cyan:{background:"stroke-cyan-600 dark:stroke-cyan-500",foreground:"stroke-cyan-600 dark:stroke-cyan-500"},sky:{background:"stroke-sky-600 dark:stroke-sky-500",foreground:"stroke-sky-600 dark:stroke-sky-500"},blue:{background:"stroke-blue-600",foreground:"stroke-blue-600"},indigo:{background:"stroke-indigo-600 dark:stroke-indigo-500",foreground:"stroke-indigo-600 dark:stroke-indigo-500"},violet:{background:"stroke-violet-600 dark:stroke-violet-500",foreground:"stroke-violet-600 dark:stroke-violet-500"},purple:{background:"stroke-purple-600 dark:stroke-purple-500",foreground:"stroke-purple-600 dark:stroke-purple-500"},fuchsia:{background:"stroke-fuchsia-600 dark:stroke-fuchsia-500",foreground:"stroke-fuchsia-600 dark:stroke-fuchsia-500"},pink:{background:"stroke-pink-600 dark:stroke-pink-500",foreground:"stroke-pink-600 dark:stroke-pink-500"}
29,rose:{background:"stroke-rose-600 dark:stroke-rose-500",foreground:"stroke-rose-600 dark:stroke-rose-500"}},labelInside:{true:{}}}});$u("<div><span> </span> <span> </span></div>"),$u("<div> </div>"),$u("<div></div>"),$u("<!> <div><!></div>",1);$u("<div><span> </span> <span> </span></div>"),$u("<div> </div>"),$u('<div class="flex flex-col items-center"><!> <div><svg viewBox="0 0 100 100" class="h-full w-full"><circle cx="50" cy="50" fill="none"></circle><circle cx="50" cy="50" fill="none" stroke-linecap="round"></circle></svg> <!></div></div>');Mm({slots:{base:"flex items-center mt-4",span:"text-sm font-medium text-gray-600 dark:text-gray-500",div2:"mx-4 w-2/4 h-5 bg-gray-200 rounded-sm dark:bg-gray-700",div3:"h-5 bg-yellow-400 rounded-sm",span2:"text-sm font-medium text-gray-600 dark:text-gray-500"}}),Mm({slots:{base:"flex items-center",p:"ms-2 text-sm font-bold text-gray-900 dark:text-white"}}),Mm({slots:{article:"md:grid md:grid-cols-3 md:gap-8",div:"mb-6 flex items-center space-x-4 rtl:space-x-reverse",div2:"space-y-1 font-medium dark:text-white",div3:"flex items-center text-sm text-gray-500 dark:text-gray-400",img:"h-10 w-10 rounded-full",ul:"space-y-4 text-sm text-gray-500 dark:text-gray-400",li:"flex items-center"}}),Mm({slots:{desc1:"bg-primary-100 w-8 text-primary-800 text-sm font-semibold inline-flex items-center p-1.5 rounded-sm dark:bg-primary-200 dark:text-primary-800",desc2:"ms-2 font-medium text-gray-900 dark:text-white",desc3span:"text-sm w-24 font-medium text-gray-500 dark:text-gray-400",desc3p:"text-sm w-24 font-medium text-gray-500 dark:text-gray-400",link:"ms-auto w-32 text-sm font-medium text-primary-600 hover:underline dark:text-primary-500",bar:"bg-primary-600 h-2.5 rounded-sm dark:bg-primary-500"}});$u("<div><span> </span> <div><div></div></div> <span> </span></div>"),$u("<!> <!> <!>",1);qu('<stop offset="0%"></stop><stop></stop><stop stop-color="transparent"></stop><stop offset="100%" stop-color="transparent"></stop>',1),qu('<stop offset="0%"></stop><stop offset="100%"></stop>',1),qu('<svg><defs><linearGradient><!></linearGradient></defs><path stroke-linecap="round" stroke-linejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"></path></svg>');qu('<stop offset="0%"></stop><stop></stop><stop stop-color="transparent"></stop><stop offset="100%" stop-color="transparent"></stop>',1),qu('<stop offset="0%"></stop><stop offset="100%"></stop>',1),qu('<svg><defs><linearGradient><!></linearGradient></defs><g stroke-width="2"><polygon points="165.000, 185.000, 188.511, 197.361, 184.021, 171.180, \n      203.042, 152.639, 176.756, 148.820, 165.000, 125.000, \n      153.244, 148.820, 126.958, 152.639, 145.979, 171.180,\n      141.489, 197.361, 165.000, 185.000"></polygon></g></svg>');$u("<!> <p> </p> <!>",1),$u("<!> <!> <!> <!>",1),$u("<div><!></div>");$u('<p class="ms-2 pt-1 text-sm font-medium text-gray-500 dark:text-gray-400"> </p>'),$u('<h3 class="ms-2 text-sm font-semibold text-gray-900 dark:text-white"> </h3>'),$u('<footer class="mb-5 text-sm text-gray-500 dark:text-gray-400"><p> </p></footer>'),$u('<a class="text-primary-600 dark:text-primary-500 ps-4 text-sm font-medium hover:underline">Report abuse</a>'),$u('<div class="mt-3 flex items-center space-x-3 divide-x divide-gray-200 rtl:space-x-reverse rtl:divide-x-reverse dark:divide-gray-600"><!> <!></div>'),$u('<article><div class="mb-4 flex items-center space-x-4 rtl:space-x-reverse"><img class="h-10 w-10 rounded-full"/> <div class="space-y-1 font-medium dark:text-white"><p> <time datetime="2014-08-16 19:00" class="block text-sm text-gray-500 dark:text-gray-400"> </time></p></div></div> <div class="mb-1 flex items-center"><!> <!></div> <!> <!> <aside><p class="mt-1 text-xs text-gray-500 dark:text-gray-400"><!></p> <!></aside></article>');$u("<div><!></div>"),$u("<li><!></li>"),$u("<li><!></li>"),$u("<li><!></li>"),$u("<ul><!> <!> <!></ul>"),$u('<footer><p class="mb-2 text-sm text-gray-500 dark:text-gray-400"> </p></footer>'),$u('<article><div><div><img/> <div><p> </p> <!></div></div> <!></div> <div class="col-span-2 mt-6 md:mt-0"><div class="mb-5 flex items-start"><div class="pe-4"><!> <h4 class="text-xl font-bold text-gray-900 dark:text-white"> </h4></div>
29 <p class="bg-primary-700 inline-flex items-center rounded-sm p-1.5 text-sm font-semibold text-white"> </p></div> <!></div></article>');$u("<p> </p>"),$u("<p> </p>"),$u("<span></span> <p> </p>",1),$u("<a> </a>"),$u("<!> <!> <!> <!>",1),$u('<dl><dt class="text-sm font-medium text-gray-500 dark:text-gray-400"> </dt> <dd class="mb-3 flex items-center"><div class="me-2 h-2.5 w-full rounded-sm bg-gray-200 dark:bg-gray-700"><div></div></div> <span class="text-sm font-medium text-gray-500 dark:text-gray-400"> </span></dd></dl>'),$u('<dl><dt class="text-sm font-medium text-gray-500 dark:text-gray-400"> </dt> <dd class="mb-3 flex items-center"><div class="me-2 h-2.5 w-full rounded-sm bg-gray-200 dark:bg-gray-700"><div></div></div> <span class="text-sm font-medium text-gray-500 dark:text-gray-400"> </span></dd></dl>'),$u('<div class="mb-5 flex items-center"><!></div> <div class="gap-8 sm:grid sm:grid-cols-2"><div><!></div> <div><!></div></div>',1);qu('<stop offset="0%"></stop><stop></stop><stop stop-color="transparent"></stop><stop offset="100%" stop-color="transparent"></stop>',1),qu('<stop offset="0%"></stop><stop offset="100%"></stop>',1),qu('<svg><defs><linearGradient><!></linearGradient></defs><path stroke-linecap="round" stroke-linejoin="round" d="M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z"></path></svg>');qu('<stop offset="0%"></stop><stop></stop><stop stop-color="transparent"></stop><stop offset="100%" stop-color="transparent"></stop>',1),qu('<stop offset="0%"></stop><stop offset="100%"></stop>',1),qu('<svg><defs><linearGradient x1="0%" y1="0%" x2="100%" y2="0%"><!></linearGradient></defs><path stroke-linecap="round" stroke-linejoin="round"></path></svg>');Mm({slots:{base:"top-0 left-0 z-50 w-64 transition-transform bg-gray-50 dark:bg-gray-800",active:"flex items-center group-has-[ul]:ms-6 p-2 text-base font-normal text-gray-900 bg-gray-200 dark:bg-gray-700 rounded-sm dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700",nonactive:"flex items-center group-has-[ul]:ms-6 p-2 text-base font-normal text-gray-900 rounded-sm dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700",div:"overflow-y-auto px-3 py-4 bg-gray-50 dark:bg-gray-800",backdrop:"fixed top-0 start-0 z-40 w-full h-full"},variants:{position:{fixed:{base:"fixed"},absolute:{base:"absolute"},static:{base:"static"}}
29,isOpen:{true:"block",false:"hidden"},breakpoint:{sm:{base:"sm:block"},md:{base:"md:block"},lg:{base:"lg:block"},xl:{base:"xl:block"},"2xl":{base:"2xl:block"}},alwaysOpen:{true:{base:"block"}},backdrop:{true:{backdrop:"bg-gray-900 opacity-75"}}},compoundVariants:[{alwaysOpen:!0,class:{base:"!block"}}]}),Mm({slots:{base:"inline-flex items-center text-sm text-gray-500 rounded-lg hover:bg-gray-100 focus:outline-hidden focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600",svg:"h-6 w-6 m-2"},variants:{breakpoint:{sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden","2xl":"2xl:hidden"}}}),Mm({slots:{base:"flex items-center ps-2.5 mb-5",img:"h-6 me-3 sm:h-7",span:"self-center text-xl font-semibold whitespace-nowrap dark:text-white"}}),Mm({slots:{base:"p-4 mt-6 bg-primary-50 rounded-lg dark:bg-primary-900",div:"flex items-center mb-3",span:"bg-primary-100 text-primary-800 text-sm font-semibold me-2 px-2.5 py-0.5 rounded-sm dark:bg-primary-200 dark:text-primary-900"}}),Mm({slots:{base:"group",btn:"flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-sm transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700",span:"flex-1 ms-3 text-left whitespace-nowrap",svg:"h-3 w-3 text-gray-800 dark:text-white",ul:"py-2 space-y-0"}});$u('<div role="presentation"></div>'),$u('<div role="presentation"></div>'),$u('<div role="presentation" class="fixed start-0 top-0 z-50 h-full w-full"></div>'),$u('<div role="presentation" class="fixed start-0 top-0 z-50 h-full w-full"></div>'),$u("<!> <aside><div><!></div></aside>",1),$u("<aside><div><!></div></aside>");Bu(["click"]);$u("<div><!></div>");qu('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5 5 1 1 5"></path></svg>'),qu('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"></path></svg>'),$u("<ul><!></ul>"),$u("<li><button><!> <span> </span> <!></button> <!></li>");$u("<ul><!></ul>");$u("<li><a><!> <span> </span> <!></a></li>");$u('<button><span class="sr-only">Open sidebar</span> <svg aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path></svg></button>');$u("<div><div><span> </span> <!></div> <!></div>");$u("<img/> <span> </span>",1),$u("<a><!></a>");Mm({slots:{base:"p-4 rounded-sm border border-gray-200 shadow-sm animate-pulse md:p-6 dark:border-gray-700",area:"mb-4 flex h-48 items-center justify-center rounded-sm bg-gray-300 dark:bg-gray-700",icon:"text-gray-200 dark:text-gray-600",line:"rounded-full bg-gray-200 dark:bg-gray-700",footer:"mt-4 flex items-center space-x-3 rtl:space-x-reverse"},variants:{size:{sm:{base:"max-w-sm"},md:{base:"max-w-md"},lg:{base:"max-w-lg"},xl:{base:"max-w-xl"},"2xl":{base:"max-w-2xl"}}}}),Mm({slots:{base:"space-y-8 animate-pulse md:space-y-0 md:space-x-8 rtl:space-x-reverse md:flex md:items-center",image:"flex w-full items-center justify-center rounded-sm bg-gray-300 sm:w-96 dark:bg-gray-700",svg:"text-gray-200",content:"w-full",line:"rounded-full bg-gray-200 dark:bg-gray-700"},variants:{size:{sm:{image:"h-32",content:"space-y-2"},md:{image:"h-48",content:"space-y-3"},lg:{image:"h-64",content:"space-y-4"}},rounded:{none:{image:"rounded-none",line:"rounded-none"},sm:{image:"rounded-xs",line:"rounded-xs"},md:{image:"rounded-sm",line:"rounded-sm"},lg:{image:"rounded-lg",line:"rounded-lg"},full:{image:"rounded-full",line:"rounded-full"}}}}),Mm({slots:{base:"p-4 space-y-4 max-w-md rounded-sm border border-gray-200 divide-y divide-gray-200 shadow-sm animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700",item:"flex items-center justify-between",content:"",title:"mb-2.5 h-2.5 w-24 rounded-full bg-gray-300 dark:bg-gray-600",subTitle:"h-2 w-32 rounded-full bg-gray-200 dark:bg-gray-700",extra:"h-2.5 w-12 rounded-full bg-gray-300 dark:bg-gray-700"},variants:{size:{sm:{base:"p-3 space-y-3 max-w-sm md:p-4",title:"mb-2 h-2 w-20",subTitle:"h-1.5 w-28",extra:"h-2 w-10"},md:{},lg:{base:"p-5 space-y-5 max-w-lg md:p-7",title:"mb-3 h-3 w-28",subTitle:"h-2.5 w-36",extra:"h-3 w-14"}},rounded:{none:{base:"rounded-none"},sm:{base:"rounded-xs"},md:{base:"rounded-sm"},lg:{base:"rounded-lg"},full:{base:"rounded-full p-8 md:p-16"}}}}),Mm({slots:{wrapper:"animate-pulse",line:"rounded-full bg-gray-200 dark:bg-gray-700"},variants:{size:{sm:{wrapper:"max-w-sm"},md:{wrapper:"max-w-md"},lg:{wrapper:"max-w-lg"},xl:{wrapper:"max-w-xl"},"2xl":{wrapper:"max-w-2xl"}}}}),Mm({slots:{base:"animate-pulse",lineA:"rounded-full bg-gray-200 dark:bg-gray-700",lineB:"rounded-full bg-gray-300 dark:bg-gray-700",svg:"me-2 h-10 w-10 text-gray-200 dark:text-gray-700",content:"mt-4 flex items-center justify-center"}}),Mm({slots:{base:"space-y-2.5 animate-pulse",div:"flex items-center space-x-2 rtl:space-x-reverse",lineA:"rounded-full bg-gray-200 dark:bg-gray-700",lineB:"rounded-full bg-gray-300 dark:bg-gray-600"},variants:{size:{sm:{base:"max-w-sm"},md:{base:"max-w-md"},lg:{base:"max-w-lg"},xl:{base:"max-w-xl"},"2xl":{base:"max-w-2xl"}}}}),Mm({base:"flex justify-center items-center h-56 bg-gray-300 rounded-lg animate-pulse dark:bg-gray-700",variants:{size:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"}}}),Mm({slots:{base:"p-4 max-w-sm rounded-sm border border-gray-200 shadow-sm animate-pulse md:p-6 dark:border-gray-700",wrapper:"mt-4 flex items-baseline space-x-6 rtl:space-x-reverse",hLine:"rounded-full bg-gray-200 dark:bg-gray-700",vLine:"w-full rounded-t-lg bg-gray-200 dark:bg-gray-700"}});$u('<div><div><svg width="48" height="48" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" viewBox="0 0 640 512"><path d="M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"></path></svg></div> <div></div> <div></div> <div></div> <div></div> <div><svg aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 
290 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z" clip-rule="evenodd"></path></svg> <div></div> <div></div></div> <span class="sr-only">Loading...</span></div>');$u("<div><div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div></div>"),$u('<div><div><svg width="48" height="48" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" viewBox="0 0 640 512"><path d="M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"></path></svg></div> <!> <span class="sr-only">Loading...</span></div>');$u("<div><div><div></div> <div></div></div> <div></div></div>"),$u('<div><!> <span class="sr-only">Loading...</span></div>');$u('<div><div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <span class="sr-only">Loading...</span></div>');$u('<div><div></div> <div></div> <div><svg aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z" clip-rule="evenodd"></path></svg> <div></div> <div></div></div> <span class="sr-only">Loading...</span></div>');$u('<div><div><div></div> <div></div> <div></div></div> <div><div></div> <div></div> <div></div></div> <div><div></div> <div></div> <div></div></div> <div><div></div> <div></div> <div></div></div> <div><div></div> <div></div> <div></div></div> <div><div></div> <div></div> <div></div></div> <span class="sr-only">Loading...</span></div>');$u('<div role="status"><svg width="48" height="48" class="text-gray-200 dark:text-gray-600" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" viewBox="0 0 384 512"><path d="M361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215z"></path></svg> <span class="sr-only">Loading...</span></div>');$u('<div role="status"><div></div> <div></div> <div><div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div></div> <span class="sr-only">Loading...</span></div>');Mm({slots:{base:"group bg-transparent",popper:"flex items-center gap-2 bg-transparent text-inherit"},variants:{vertical:{true:{popper:"flex-col"}}},defaultVariants:{vertical:!1}}),Mm({slots:{base:"w-[52px] h-[52px] shadow-xs p-0",span:"mb-px text-xs font-medium"},variants:{noTooltip:{false:{},true:{}},textOutside:{true:{base:"relative",span:"absolute -start-12 top-1/2 mb-px text-sm font-medium -translate-y-1/2"}}},compoundVariants:[{noTooltip:!0,textOutside:!1,class:{base:"flex flex-col"}}],defaultVariants:{}});$u("<div><!></div>");const Zv=Mm({base:"px-3 py-2 rounded-lg text-sm z-50 pointer-events-none",variants:{type:{light:"bg-white text-gray-800 dark:bg-white dark:text-gray-800 border border-gray-200 dark:border-gray-200",auto:"bg-white text-gray-800 dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700",dark:"bg-gray-800 text-white dark:bg-gray-800 dark:text-white dark:border dark:border-gray-700",custom:""},color:{primary:"bg-primary-600 dark:bg-primary-600",secondary:"bg-secondary-600 dark:bg-secondary-600",gray:"bg-gray-600 dark:bg-gray-600",red:"bg-red-600 dark:bg-red-600",orange:"bg-orange-600 dark:bg-orange-600",amber:"bg-amber-600 dark:bg-amber-600",yellow:"bg-yellow-400 dark:bg-yellow-400",lime:"bg-lime-600 dark:bg-lime-600",green:"bg-green-600 dark:bg-green-600",emerald:"bg-emerald-600 dark:bg-emerald-600",teal:"bg-teal-600 dark:bg-teal-600",cyan:"bg-cyan-600 dark:bg-cyan-600",sky:"bg-sky-600 dark:bg-sky-600",blue:"bg-blue-600 dar
29k:bg-blue-600",indigo:"bg-indigo-600 dark:bg-indigo-600",violet:"bg-violet-600 dark:bg-violet-600",purple:"bg-purple-600 dark:bg-purple-600",fuchsia:"bg-fuchsia-600 dark:bg-fuchsia-600",pink:"bg-pink-600 dark:bg-pink-600",rose:"bg-rose-800 dark:bg-rose-800"}},compoundVariants:[{color:["primary","secondary","gray","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],class:"border-0 dark:border-0"}],defaultVariants:{type:"dark",color:void 0}});var Yv=$u('<div class="pointer-events-none"><!></div>');function Xv(e,t){Zs(t,!0);let r=fh(t,"type",3,"dark"),n=fh(t,"color",3,void 0),i=fh(t,"trigger",3,"hover"),o=fh(t,"arrow",3,!0),a=fh(t,"placement",3,"top"),s=fh(t,"isOpen",15,!1),l=lh(t,["$$slots","$$events","$$legacy","type","color","trigger","arrow","children","placement","onbeforetoggle","class","isOpen"]);const c=Dl((()=>Zv({color:n(),type:r(),class:yd(t.class)})));b_(e,hh((()=>l),{get placement(){return a()},get trigger(){return i()},get arrow(){return o()},get class(){return yu(c)},onbeforetoggle:function(e){e.target instanceof HTMLElement&&e.target.querySelectorAll('a, button, input, textarea, select, details, [tabindex], [contenteditable="true"]').forEach((e=>e.setAttribute("tabindex","-1"))),t.onbeforetoggle?.(e)},get isOpen(){return s()},set isOpen(e){s(e)},children:(e,r)=>{var n=Yv();ud(uc(n),(()=>t.children)),Os(n),Yu(e,n)},$$slots:{default:!0}})),Ys()}$u("<!> <span> </span>",1),$u("<!> <!>",1);qu('<svg aria-hidden="true" class="h-8 w-8 transition-transform group-hover:rotate-45" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>'),$u('<!> <span class="sr-only"> </span>',1),$u('<!> <span class="sr-only"> </span>',1);const Kv=Mm({base:"inline-block",variants:{type:{default:"animate-spin",dots:"inline-flex items-center justify-center",bars:"inline-flex items-center justify-center",pulse:"animate-pulse",orbit:""},color:{primary:"fill-primary-600 text-gray-300",secondary:"fill-secondary-600 text-gray-300",gray:"fill-gray-600 dark:fill-gray-300 text-gray-300",red:"fill-red-600 text-gray-300",orange:"fill-orange-500 text-gray-300",amber:"fill-amber-500 text-gray-300",yellow:"fill-yellow-400 text-gray-300",lime:"fill-lime-500 text-gray-300",green:"fill-green-500 text-gray-300",emerald:"fill-emerald-500 text-gray-300",teal:"fill-teal-500 text-gray-300",cyan:"fill-cyan-500 text-gray-300",sky:"fill-sky-500 text-gray-300",blue:"fill-blue-600 text-gray-300",indigo:"fill-indigo-600 text-gray-300",violet:"fill-violet-600 text-gray-300",purple:"fill-purple-600 text-gray-300",fuchsia:"fill-fuchsia-600 text-gray-300",pink:"fill-pink-600 text-gray-300",rose:"fill-rose-600 text-gray-300"},size:{4:"w-4 h-4",5:"w-5 h-5",6:"w-6 h-6",8:"w-8 h-8",10:"w-10 h-10",12:"w-12 h-12",16:"w-16 h-16"}},defaultVariants:{type:"default",color:"primary",size:"8"}});var Jv=qu('<svg><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"></path><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"></path></svg>'),Qv=qu('<svg><circle cx="15" cy="15" r="15"><animate attributeName="r" values="15;9;
2915" dur="0.8s" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" values="1;.5;1" dur="0.8s" repeatCount="indefinite"></animate></circle><circle cx="60" cy="15" r="9" fill-opacity="0.3"><animate attributeName="r" values="9;15;9" dur="0.8s" begin="0.2s" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" values=".5;1;.5" dur="0.8s" begin="0.2s" repeatCount="indefinite"></animate></circle><circle cx="105" cy="15" r="15"><animate attributeName="r" values="15;9;15" dur="0.8s" begin="0.4s" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" values="1;.5;1" dur="0.8s" begin="0.4s" repeatCount="indefinite"></animate></circle></svg>'),eb=qu('<svg><rect y="10" width="15" height="120" rx="6"><animate attributeName="height" values="120;60;120" dur="1.2s" repeatCount="indefinite"></animate><animate attributeName="y" values="10;40;10" dur="1.2s" repeatCount="indefinite"></animate></rect><rect x="30" y="10" width="15" height="120" rx="6"><animate attributeName="height" values="120;60;120" dur="1.2s" begin="0.2s" repeatCount="indefinite"></animate><animate attributeName="y" values="10;40;10" dur="1.2s" begin="0.2s" repeatCount="indefinite"></animate></rect><rect x="60" y="10" width="15" height="120" rx="6"><animate attributeName="height" values="120;60;120" dur="1.2s" begin="0.4s" repeatCount="indefinite"></animate><animate attributeName="y" values="10;40;10" dur="1.2s" begin="0.4s" repeatCount="indefinite"></animate></rect></svg>'),tb=qu('<svg><circle cx="50" cy="50" r="8"><animate attributeName="r" values="8;45" dur="1.5s" repeatCount="indefinite"></animate><animate attributeName="opacity" values="0.9;0" dur="1.5s" repeatCount="indefinite"></animate></circle><circle cx="50" cy="50" r="8"><animate attributeName="r" values="8;45" begin="0.5s" dur="1.5s" repeatCount="indefinite"></animate><animate attributeName="opacity" values="0.9;0" begin="0.5s" dur="1.5s" repeatCount="indefinite"></animate></circle><circle cx="50" cy="50" r="8"><animate attributeName="r" values="8;45" begin="1s" dur="1.5s" repeatCount="indefinite"></animate><animate attributeName="opacity" values="0.9;0" begin="1s" dur="1.5s" repeatCount="indefinite"></animate></circle></svg>'),rb=qu('<svg><g><circle cx="50" cy="20" r="8"></circle><circle cx="73.66" cy="65" r="8"></circle><circle cx="26.34" cy="65" r="8"></circle><animateTransform attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1.2s" repeatCount="indefinite"></animateTransform></g></svg>');function nb(e,t){Zs(t,!0);let r=fh(t,"type",3,"default"),n=fh(t,"color",3,"primary"),i=fh(t,"size",3,"8"),o=fh(t,"currentFill",3,"inherit"),a=fh(t,"currentColor",3,"currentColor"),s=lh(t,["$$slots","$$events","$$legacy","type","color","size","class","currentFill","currentColor"]);const l=x_("spinner");let c=Dl((()=>Kv({type:r(),color:n(),size:i(),class:yd(l,t.class)})));var u=Zu(),d=dc(u),h=e=>{var t=Jv();Nd(t,(()=>({...s,role:"status",class:yu(c),viewBox:"0 0 100 101",fill:"none"})));var r=uc(t),n=hc(r);Os(t),Pc((()=>{Fd(r,"fill",a()),Fd(n,"fill",o())})),Yu(e,t)},f=e=>{var t=Zu(),n=dc(t),i=e=>{var t=Qv();Nd(t,(()=>({...s,role:"status",class:yu(c),viewBox:"0 0 120 30",fill:"currentColor"}))),Yu(e,t)},a=e=>{var t=Zu(),n=dc(t),i=e=>{var t=eb();Nd(t,(()=>({...s,role:"status",class:yu(c),viewBox:"0 0 135 140",fill:"currentColor"}))),Yu(e,t)},a=e=>{var t=Zu(),n=dc(t),i=e=>{var t=tb();Nd(t,(()=>({...s,role:"status",class:yu(c),viewBox:"0 0 100 100"})));var r=uc(t),n=hc(r),i=hc(n);Os(t),Pc((()=>{Fd(r,"fill",o()),Fd(n,"fill",o()),Fd(i,"fill",o())})),Yu(e,t)},a=e=>{var t=Zu(),n=dc(t),i=e=>{var t=rb();Nd(t,(()=>({...s,role:"status",class:yu(c),viewBox:"0 0 100 100",fill:"currentColor"}))),Yu(e,t)};ad(n,(e=>{"orbit"===r()&&e(i)}),!0),Yu(e,t)};ad(n,(e=>{"pulse"===r()?e(i):e(a,!1)}),!0),Yu(e,t)};ad(n,(e=>{"bars"===r()?e(i):e(a,!1)}),!0),Yu(e,t)};ad(n,(e=>{"dots"===r()?e(i):e(a,!1)}),!0),Yu(e,t)};ad(d,(e=>{"default"===r()?e(h):e(f,!1)})),Yu(e,u),Ys()}qu("<polyline></polyline>"),qu("<path></path>"),qu("<svg><!></svg>");Mm({slots:{base:"flex items-center w-full text-sm font-medium text-center text-gray-500 dark:text-gray-400 sm:text-base",item:"flex items-center",content:"flex items-center"},variants:{status:{completed:{item:"text-primary-600 dark:text-primary-500 md:w-full sm:after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10 dar
29k:after:border-gray-700",content:"after:content-['/'] sm:after:hidden after:mx-2 after:text-gray-200 dark:after:text-gray-500"},current:{item:"text-primary-600 dark:text-primary-500 md:w-full sm:after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10 dark:after:border-gray-700",content:"after:content-['/'] sm:after:hidden after:mx-2 after:text-gray-200 dark:after:text-gray-500"},pending:{item:"md:w-full sm:after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10 dark:after:border-gray-700",content:"after:content-['/'] sm:after:hidden after:mx-2 after:text-gray-200 dark:after:text-gray-500"}},isLast:{true:{item:"after:!hidden",content:"after:!hidden"},false:{}}},defaultVariants:{status:"pending",isLast:!1}}),Mm({slots:{base:"flex items-center w-full relative",item:"flex items-center justify-center z-10",circle:"flex items-center justify-center w-10 h-10 rounded-full lg:h-12 lg:w-12 shrink-0",line:"absolute h-1 top-1/2 -translate-y-1/2 bg-gray-200 dark:bg-gray-700",progressLine:"absolute h-1 top-1/2 -translate-y-1/2 bg-primary-600 dark:bg-primary-500 transition-all duration-300 ease-in-out"},variants:{status:{completed:{item:"text-primary-600 dark:text-primary-400 flex-1",circle:"bg-primary-600 dark:bg-primary-500 text-white"},current:{item:"flex-1",circle:"bg-primary-600 dark:bg-primary-500 text-white"},pending:{item:"flex-1",circle:"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"}}},defaultVariants:{status:"pending"}}),Mm({slots:{base:"items-center w-full space-y-4 sm:flex sm:space-x-8 sm:space-y-0 rtl:space-x-reverse",item:"flex items-center space-x-2.5 rtl:space-x-reverse",indicator:"flex items-center justify-center w-8 h-8 rounded-full shrink-0"},variants:{status:{completed:{item:"text-primary-600 dark:text-primary-500",indicator:"border border-primary-600 dark:border-primary-500 bg-primary-600 dark:bg-primary-500 text-white"},current:{item:"text-gray-500 dark:text-gray-400",indicator:"border border-gray-500 dark:border-gray-400 text-gray-500 dark:text-gray-400"},pending:{item:"text-gray-500 dark:text-gray-400",indicator:"border border-gray-500 dark:border-gray-400 text-gray-500 dark:text-gray-400"}}},defaultVariants:{status:"pending"}}),Mm({slots:{base:"space-y-4 w-72",card:"w-full p-4 border rounded-lg",content:"flex items-center justify-between"},variants:{status:{completed:{card:"text-green-700 border-green-300 bg-green-50 dark:bg-gray-800 dark:border-green-800 dark:text-green-400"},current:{card:"text-primary-700 bg-primary-100 border-primary-300 dark:bg-gray-800 dark:border-primary-800 dark:text-primary-400"},pending:{card:"text-gray-900 bg-gray-100 border-gray-300 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400"}}},defaultVariants:{status:"pending"}}),Mm({slots:{base:"flex items-center w-full p-3 space-x-2 text-sm font-medium text-center text-gray-500 bg-white border border-gray-200 rounded-lg shadow-xs dark:text-gray-400 sm:text-base dark:bg-gray-800 dark:border-gray-700 sm:p-4 sm:space-x-4 rtl:space-x-reverse",item:"flex items-center",indicator:"flex items-center justify-center w-5 h-5 me-2 text-xs rounded-full shrink-0"},variants:{status:{completed:{item:"text-primary-600 dark:text-primary-500",indicator:"border border-primary-600 dark:border-primary-500 bg-primary-600 dark:bg-primary-500 text-white"},current:{item:"text-primary-600 dark:text-primary-500",indicator:"border border-primary-600 dark:border-primary-500 bg-primary-600 dark:bg-primary-500 text-white"},pending:{item:"text-gray-500 dark:text-gray-400",indicator:"border border-gray-500 dark:border-gray-400 text-gray-500 dark:text-gray-400"}},hasChevron:{true:{},false:{}}},defaultVariants:{status:"pending",hasChevron:!1}}),Mm({slots:{base:"relative text-gray-500 border-s border-gray-200 dark:border-gray-700 dark:text-gray-400",item:"ms-6",circle:"absolute flex items-center justify-center w-8 h-8 rounded-full -start-4 ring-4 ring-white dark:ring-gray-900"},variants:{status:{completed:{circle:"bg-green-200 dark:bg-green-900"},current:{circle:"bg-primary-200 dark:bg-primary-900"},pending:{circle:"bg-gray-100 dark:bg-gray-700"}},isLast:{true:{},false:{item:"mb-10"}}},defaultVariants:{status:"pending",isLast:!1}});$u('<span class="me-2"> </span>'),$u("<span> </span>"),$u("<!> <!>",1),$u('<button type="button"><!></button>'),$u("<span><!></span>"),$u("<li><!></li>"),$u("<ol></ol>");Bu(["click"]);$u('<span class="text-sm font-semibold"> </span>'),$u('<button type="button"><!></button>'),$u('<span class="text-sm font-semibold"> </span>'),$u("<span><!></span>"),$u("<li><!></li>"),$u('<ol><div aria-hidden="true"></div> <div aria-hidden="true"></div> <!></ol>');Bu(["click"]);$u("<p> </p>"),$u('<button type="button" class="flex w-full cursor-pointer items-center space-x-2.5 text-left transition-opacity hover:opacity-75 rtl:space-x-reverse"><span><!></span> <span>
29<h3 class="leading-tight font-medium"> </h3> <!></span></button>'),$u("<p> </p>"),$u('<div class="flex items-center space-x-2.5 rtl:space-x-reverse"><span><!></span> <span><h3 class="leading-tight font-medium"> </h3> <!></span></div>'),$u("<li><!></li>"),$u("<ol></ol>");Bu(["click"]);$u('<button type="button"><div><span class="sr-only"> </span> <h3 class="font-medium"> </h3> <!></div></button>'),$u('<div><div><span class="sr-only"> </span> <h3 class="font-medium"> </h3> <!></div></div>'),$u("<li><!></li>"),$u("<ol></ol>");Bu(["click"]);qu('<svg><path d="m7 9 4-4-4-4M1 9l4-4-4-4"></path></svg>');$u('<span class="hidden sm:ms-2 sm:inline-flex"> </span>'),$u('<button type="button" class="flex cursor-pointer items-center transition-opacity hover:opacity-75"><span><!></span> <!></button>'),$u('<span class="hidden sm:ms-2 sm:inline-flex"> </span>'),$u('<span class="flex items-center"><span><!></span> <!></span>'),$u("<li><!> <!></li>"),$u("<ol></ol>");Bu(["click"]);qu('<svg><path d="M18 0H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2ZM6.5 3a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM3.014 13.021l.157-.625A3.427 3.427 0 0 1 6.5 9.571a3.426 3.426 0 0 1 3.322 2.805l.159.622-6.967.023ZM16 12h-3a1 1 0 0 1 0-2h3a1 1 0 0 1 0 2Zm0-3h-3a1 1 0 1 1 0-2h3a1 1 0 1 1 0 2Zm0-3h-3a1 1 0 1 1 0-2h3a1 1 0 1 1 0 2Z"></path></svg>');$u('<button type="button"><!></button>'),$u("<span><!></span>"),$u('<p class="text-sm"> </p>'),$u('<li><!> <div><h3 class="leading-tight font-medium"> </h3> <!></div></li>'),$u("<ol></ol>");Bu(["click"]);const ib=Mm({slots:{div:"relative overflow-x-auto",table:"w-full text-left text-sm"},variants:{color:{default:{table:"text-gray-500 dark:text-gray-400"},primary:{table:"text-primary-100 dark:text-primary-100"},secondary:{table:"text-secondary-100 dark:text-secondary-100"},gray:{table:"text-gray-100 dark:text-gray-100"},red:{table:"text-red-100 dark:text-red-100"},orange:{table:"text-orange-100 dark:text-orange-100"},amber:{table:"text-amber-100 dark:text-amber-100"},yellow:{table:"text-yellow-100 dark:text-yellow-100"},lime:{table:"text-lime-100 dark:text-lime-100"},green:{table:"text-green-100 dark:text-green-100"},emerald:{table:"text-emerald-100 dark:text-emerald-100"},teal:{table:"text-teal-100 dark:text-teal-100"},cyan:{table:"text-cyan-100 dark:text-cyan-100"},sky:{table:"text-sky-100 dark:text-sky-100"},blue:{table:"text-blue-100 dark:text-blue-100"},indigo:{table:"text-indigo-100 dark:text-indigo-100"},violet:{table:"text-violet-100 dark:text-violet-100"},purple:{table:"text-purple-100 dark:text-purple-100"},fuchsia:{table:"text-fuchsia-100 dark:text-fuchsia-100"},pink:{table:"text-pink-100 dark:text-pink-100"},rose:{table:"text-rose-100 dark:text-rose-100"}},shadow:{true:{div:"shadow-md sm:rounded-lg"}}}}),ob=Mm({base:"",variants:{color:{default:"bg-white dark:bg-gray-800 dark:border-gray-700",primary:"bg-white bg-primary-500 border-primary-400",secondary:"bg-white bg-secondary-500 border-secondary-400",gray:"bg-gray-500 border-gray-400",red:"bg-red-500 border-red-400",orange:"bg-orange-500 border-orange-400",amber:"bg-amber-500 border-amber-400",yellow:"bg-yellow-500 border-yellow-400",lime:"bg-lime-500 border-lime-400",green:"bg-white bg-green-500 border-green-400",emerald:"bg-emerald-500 border-emerald-400",teal:"bg-teal-500 border-teal-400",cyan:"bg-cyan-500 border-cyan-400",sky:"bg-sky-500 border-sky-400",blue:"bg-white bg-blue-500 border-blue-400",indigo:"bg-indigo-500 border-indigo-400",violet:"bg-violet-500 border-violet-400",purple:"bg-purple-500 border-purple-400",fuchsia:"bg-fuchsia-500 border-fuchsia-400",pink:"bg-pink-500 border-pink-400",rose:"bg-rose-500 border-rose-400"},hoverable:{true:""},striped:{true:""},border:{true:"border-b last:border-b-0"}},compoundVariants:[{hoverable:!0,color:"default",class:"hover:bg-gray-50 dark:hover:bg-gray-600"},{hoverable:!0,color:"primary",class:"hover:bg-primary-400 dark:hover:bg-primary-400"},{hoverable:!0,color:"secondary",class:"hover:bg-secondary-400 dark:hover:bg-secondary-400"},{hoverable:!0,color:"gray",class:"hover:bg-gray-400 dark:hover:bg-gray-400"},{hoverable:!0,color:"red",class:"hover:bg-red-400 dark:hover:bg-red-400"},{hoverable:!0,color:"orange",class:"hover:bg-orange-400 dark:hover:bg-orange-400"},{hoverable:!0,color:"amber",class:"hover:bg-amber-400 dark:hover:bg-amber-400"},{hoverable:!0,color:"yellow",class:"hover:bg-yellow-400 dark:hover:bg-yellow-400"},{hoverable:!0,color:"lime",class:"hover:bg-lime-400 dark:hover:bg-lime-400"},{hoverable:!0,color:"green",class:"hover:bg-green-400 dark:hover:bg-green-400"},{hoverable:!0,color:"emerald",class:"hover:bg-emerald-400 dark:hover:bg-emerald-400"},{hoverable:!0,color:"teal",class:"hover:bg-teal-400 dark:hover:bg-teal-400"},{hoverable:!0,color:"cyan",class:"hover:bg-cyan-400 dark:hover:bg-cyan-400"},{hoverable:!0,color:"sky",class:"hover:bg-sky-400 dark:hover:bg-sky-400"},{hoverable:!0,color:"blue",class:"hover:bg-blue-400 dark:hover:bg-blue-400"},{hoverable:!0,color:"indigo",class:"hover:bg-indigo-400 dark:hover:bg-indigo-400"},{hoverable:!0,color:"violet",class:"hover:bg-violet-400 dark:hover:bg-violet-400"},{hoverable:!0,color:"purple",class:"hover:bg-purple-400 dark:hover:bg-purple-400"},{hoverable:!0,color:"fuchsia",class:"hover:bg-fuchsia-400 dark:hover:bg-fuchsia-400"},{hoverable:!0,color:"pink",class:"hover:bg-pink-400 dark:hover:bg-pink-400"},{hoverable:!0,color:"rose",class:"hover:bg-rose-400 dark:hover:bg-rose-400"},{striped:!0,color:"default",class:"odd:bg-white even:bg-gray-50 dark:odd:bg-gray-800 dark:even:bg-gray-700"},{striped:!0,color:"primary",class:"odd:bg-primary-500 even:bg-primary-600 dark:odd:bg-primary-500 dark:even:bg-primary-600"},{striped:!0,color:"secondary",class:"odd:bg-secondary-500 even:bg-secondary-600 dark:odd:bg-secondary-500 dark:even:bg-secondary-600"},{striped:!0,color:"gray",class:"odd:bg-gray-500 even:bg-gray-600 dark:odd:bg-gray-500 dark:even:bg-gray-600"},{striped:!0,color:"red",class:"odd:bg-red-500 even:bg-red-600 dark:odd:bg-red-500 dark:even:bg-red-600"},{striped:!0,color:"orange",class:"odd:bg-orange-500 even:bg-orange-600 dar
29k:odd:bg-orange-500 dark:even:bg-orange-600"},{striped:!0,color:"amber",class:"odd:bg-amber-500 even:bg-amber-600 dark:odd:bg-amber-500 dark:even:bg-amber-600"},{striped:!0,color:"yellow",class:"odd:bg-yellow-500 even:bg-yellow-600 dark:odd:bg-yellow-500 dark:even:bg-yellow-600"},{striped:!0,color:"lime",class:"odd:bg-lime-500 even:bg-lime-600 dark:odd:bg-lime-500 dark:even:bg-lime-600"},{striped:!0,color:"green",class:"odd:bg-green-500 even:bg-green-600 dark:odd:bg-green-500 dark:even:bg-green-600"},{striped:!0,color:"emerald",class:"odd:bg-emerald-500 even:bg-emerald-600 dark:odd:bg-emerald-500 dark:even:bg-emerald-600"},{striped:!0,color:"teal",class:"odd:bg-teal-500 even:bg-teal-600 dark:odd:bg-teal-500 dark:even:bg-teal-600"},{striped:!0,color:"cyan",class:"odd:bg-cyan-500 even:bg-cyan-600 dark:odd:bg-cyan-500 dark:even:bg-cyan-600"},{striped:!0,color:"sky",class:"odd:bg-sky-500 even:bg-sky-600 dark:odd:bg-sky-500 dark:even:bg-sky-600"},{striped:!0,color:"blue",class:"odd:bg-blue-500 even:bg-blue-600 dark:odd:bg-blue-500 dark:even:bg-blue-600"},{striped:!0,color:"indigo",class:"odd:bg-indigo-500 even:bg-indigo-600 dark:odd:bg-indigo-500 dark:even:bg-indigo-600"},{striped:!0,color:"violet",class:"odd:bg-violet-500 even:bg-violet-600 dark:odd:bg-violet-500 dark:even:bg-violet-600"},{striped:!0,color:"purple",class:"odd:bg-purple-500 even:bg-purple-600 dark:odd:bg-purple-500 dark:even:bg-purple-600"},{striped:!0,color:"fuchsia",class:"odd:bg-fuchsia-500 even:bg-fuchsia-600 dark:odd:bg-fuchsia-500 dark:even:bg-fuchsia-600"},{striped:!0,color:"pink",class:"odd:bg-pink-500 even:bg-pink-600 dark:odd:bg-pink-500 dark:even:bg-pink-600"},{striped:!0,color:"rose",class:"odd:bg-rose-500 even:bg-rose-600 dar
29k:odd:bg-rose-500 dark:even:bg-rose-600"}]}),ab=Mm({base:"text-xs uppercase",variants:{color:{default:"text-gray-700 dark:text-gray-400 bg-gray-50 dark:bg-gray-700",primary:"text-white dark:text-white bg-primary-700 dark:bg-primary-700",secondary:"text-white dark:text-white bg-secondary-700 dark:bg-secondary-700",gray:"text-white dark:text-white bg-gray-700 dark:bg-gray-700",red:"text-white dark:text-white bg-red-700 dark:bg-red-700",orange:"text-white dark:text-white bg-orange-700 dark:bg-orange-700",amber:"text-white dark:text-white bg-amber-700 dark:bg-amber-700",yellow:"text-white dark:text-white bg-yellow-700 dark:bg-yellow-700",lime:"text-white dark:text-white bg-lime-700 dark:bg-lime-700",green:"text-white dark:text-white bg-green-700 dark:bg-green-700",emerald:"text-white dark:text-white bg-emerald-700 dark:bg-emerald-700",teal:"text-white dark:text-white bg-teal-700 dark:bg-teal-700",cyan:"text-white dark:text-white bg-cyan-700 dark:bg-cyan-700",sky:"text-white dark:text-white bg-sky-700 dark:bg-sky-700",blue:"text-white dark:text-white bg-blue-700 dark:bg-blue-700",indigo:"text-white dark:text-white bg-indigo-700 dark:bg-indigo-700",violet:"text-white dark:text-white bg-violet-700 dark:bg-violet-700",purple:"text-white dark:text-white bg-purple-700 dark:bg-purple-700",fuchsia:"text-white dark:text-white bg-fuchsia-700 dark:bg-fuchsia-700",pink:"text-white dark:text-white bg-pink-700 dark:bg-pink-700",rose:"text-white dark:text-white bg-rose-700 dark:bg-rose-700"},border:{true:"",false:""},striped:{true:"",false:""}},compoundVariants:[{color:"default",border:!0,class:""},{color:"default",striped:!0,class:""},{striped:!0,color:"blue",class:"border-blue-400"},{striped:!0,color:"green",class:"border-green-400"},{striped:!0,color:"red",class:"border-red-400"},{striped:!0,color:"yellow",class:"border-yellow-400"},{striped:!0,color:"purple",class:"border-purple-400"},{striped:!0,color:"indigo",class:"border-indigo-400"},{striped:!0,color:"pink",class:"border-pink-400"}]}),sb=Mm({base:"px-6 py-4 whitespace-nowrap font-medium"}),lb=Mm({base:"px-6 py-3"});Mm({slots:{root:"relative overflow-x-auto shadow-md sm:rounded-lg",inner:"p-4",search:"relative mt-1",svgDiv:"absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none",svg:"w-5 h-5",input:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-80 p-2.5 ps-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",table:"w-full text-left text-sm"},variants:{color:{default:{svg:"text-gray-500 dark:text-gray-400",table:"text-gray-500 dark:text-gray-400"},blue:{svg:"text-blue-500 dark:text-blue-400",table:"text-blue-100 dark:text-blue-100"},green:{svg:"text-green-500 dark:text-green-400",table:"text-green-100 dark:text-green-100"},red:{svg:"text-red-500 dark:text-red-400",table:"text-red-100 dark:text-red-100"},yellow:{svg:"text-yellow-500 dark:text-yellow-400",table:"text-yellow-100 dark:text-yellow-100"},purple:{svg:"text-purple-500 dark:text-purple-400",table:"text-purple-100 dark:text-purple-100"},indigo:{svg:"text-indigo-500 dark:text-indigo-400",table:"text-indigo-100 dark:text-indigo-100"},pink:{svg:"text-pink-500 dark:text-pink-400",table:"text-pink-100 dark:text-pink-100"}},striped:{true:{table:"[&_tbody_tr:nth-child(odd)]:bg-white [&_tbody_tr:nth-child(odd)]:dark:bg-gray-900 [&_tbody_tr:nth-child(even)]:bg-gray-50 [&_tbody_tr:nth-child(even)]:dark:bg-gray-800"},false:{}},hoverable:{true:{table:"[&_tbody_tr]:hover:bg-gray-50 [&_tbody_tr]:dark:hover:bg-gray-600"},false:{}}},defaultVariants:{color:"default",striped:!1,hoverable:!1}});var cb=$u("<th><!></th>");function ub(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","class"]);const n=x_("tableHeadCell");var i=cb();Nd(i,(e=>({...r,class:e})),[()=>lb({class:yd(n,t.class)})]);var o=uc(i),a=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(o,(e=>{t.children&&e(a)})),Os(i),Yu(e,i),Ys()}var db=$u("<!> <tr></tr>",1),hb=$u("<tr><!></tr>"),fb=$u("<thead><!></thead>");function pb(e,t){Zs(t,!0);let r=fh(t,"defaultRow",3,!0),n=lh(t,["$$slots","$$events","$$legacy","children","headerSlot","color","striped","border","class","headItems","defaultRow"]);const i=x_("tableHead"),o=qs("tableCtx");let a=Dl((()=>t.color?t.color:o.color||"default")),s=Dl((()=>t.striped?t.striped:o.striped||!1)),l=Dl((()=>t.border?t.border:o.border||!1));const c=Dl((()=>
29ab({color:yu(a),border:yu(l),striped:yu(s),class:yd(i,t.class)})));var u=fb();Nd(u,(()=>({...n,class:yu(c)})));var d=uc(u),h=e=>{var r=db(),n=dc(r),i=e=>{var r=Zu();ud(dc(r),(()=>t.headerSlot)),Yu(e,r)};ad(n,(e=>{t.headerSlot&&e(i)}));var o=hc(n,2);Il(o,21,(()=>t.headItems),Tl,((e,t)=>{ub(e,{children:(e,r)=>{Ds();var n=Wu();Pc((e=>Ju(n,e)),[()=>function(e){return"object"==typeof e&&"text"in e?e.text:String(e)}(yu(t))]),Yu(e,n)},$$slots:{default:!0}})})),Os(o),Yu(e,r)},f=e=>{var n=Zu(),i=dc(n),o=e=>{var n=Zu(),i=dc(n),o=e=>{var r=hb();ud(uc(r),(()=>t.children)),Os(r),Yu(e,r)},a=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(i,(e=>{r()?e(o):e(a,!1)})),Yu(e,n)};ad(i,(e=>{t.children&&e(o)}),!0),Yu(e,n)};ad(d,(e=>{t.headItems?e(h):e(f,!1)})),Os(u),Yu(e,u),Ys()}var gb=$u("<tr><!></tr>");function mb(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","class","color","striped","hoverable","border"]);const n=x_("tableBodyRow"),i=qs("tableCtx");let o=Dl((()=>t.color||i.color||"default")),a=Dl((()=>t.hoverable||i.hoverable||!1)),s=Dl((()=>t.striped||i.striped||!1)),l=Dl((()=>t.border||i.border||!1));const c=Dl((()=>ob({color:yu(o),hoverable:yu(a),striped:yu(s),border:yu(l),class:yd(n,t.class)})));var u=gb();Nd(u,(()=>({...r,class:yu(c)})));var d=uc(u),h=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(d,(e=>{t.children&&e(h)})),Os(u),Yu(e,u),Ys()}var yb=$u("<button><!></button>"),_b=$u("<td><!></td>");function vb(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","class","colspan","onclick"]);const n=x_("tableBodyCell");var i=_b();Nd(i,(e=>({...r,class:e,colspan:t.colspan??1})),[()=>sb({class:yd(n,t.class)})]);var o=uc(i),a=e=>{var r=yb();r.__click=function(...e){t.onclick?.apply(this,e)};var n=uc(r),i=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(n,(e=>{t.children&&e(i)})),Os(r),Yu(e,r)},s=e=>{var r=Zu(),n=dc(r),i=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(n,(e=>{t.children&&e(i)}),!0),Yu(e,r)};ad(o,(e=>{t.onclick?e(a):e(s,!1)})),Os(i),Yu(e,i),Ys()}Bu(["click"]);var bb=$u("<tbody><!></tbody>");function xb(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","bodyItems","class"]);var n=bb();Nd(n,(e=>({...r,class:e})),[()=>yd(t.class)]);var i=uc(n),o=e=>{var r=Zu();Il(dc(r),19,(()=>t.bodyItems),((e,t)=>"id"in e?e.id:t),((e,t)=>{mb(e,{children:(e,r)=>{var n=Zu();Il(dc(n),17,(()=>function(e){return Array.isArray(e)?e:Object.values(e)}(yu(t))),Tl,((e,t)=>
29{vb(e,{children:(e,r)=>{Ds();var n=Wu();Pc((()=>Ju(n,yu(t)??""))),Yu(e,n)},$$slots:{default:!0}})})),Yu(e,n)},$$slots:{default:!0}})})),Yu(e,r)},a=e=>{var r=Zu(),n=dc(r),i=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(n,(e=>{t.children&&e(i)}),!0),Yu(e,r)};ad(i,(e=>{t.bodyItems?e(o):e(a,!1)})),Os(n),Yu(e,n),Ys()}var wb=$u("<!> <!>",1),Sb=$u("<div><table><!><!><!></table></div>");$u('<div><div><label for="table-search" class="sr-only">Search</label> <div><div><svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"></path></svg></div> <input type="text" id="table-search"/></div> <!></div> <table><!></table> <!></div>');Mm({slots:{base:"flex space-x-2 rtl:space-x-reverse",content:"p-4 bg-gray-50 rounded-lg dark:bg-gray-800 mt-4",divider:"h-px bg-gray-200 dark:bg-gray-700",active:"p-4 text-primary-600 bg-gray-100 rounded-t-lg dark:bg-gray-800 dark:text-primary-500",inactive:"p-4 text-gray-500 rounded-t-lg hover:text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-300"},variants:{tabStyle:{full:{active:"p-4 w-full rounded-none group-first:rounded-s-lg group-last:rounded-e-lg text-gray-900 bg-gray-100 focus:ring-4 focus:ring-primary-300 focus:outline-hidden dark:bg-gray-700 dark:text-white",inactive:"p-4 w-full rounded-none group-first:rounded-s-lg group-last:rounded-e-lg text-gray-500 dark:text-gray-400 bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-primary-300 focus:outline-hidden dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700"},pill:{active:"py-3 px-4 text-white bg-primary-600 rounded-lg",inactive:"py-3 px-4 text-gray-500 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"},underline:{base:"-mb-px",active:"p-4 text-primary-600 border-b-2 border-primary-600 dark:text-primary-500 dark:border-primary-500 bg-transparent",inactive:"p-4 border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 text-gray-500 dark:text-gray-400 bg-transparent"},none:{active:"",inactive:""}},hasDivider:{true:{}}},compoundVariants:[{tabStyle:["full","pill"],hasDivider:!0,class:{divi
29der:"hidden"}}],defaultVariants:{tabStyle:"none",hasDivider:!0}}),Mm({slots:{base:"group focus-within:z-10",button:"inline-block text-sm font-medium text-center disabled:cursor-not-allowed"},variants:{open:{true:{button:"active"}},disabled:{true:{button:"cursor-not-allowed"}}},compoundVariants:[{open:!0,class:{button:""}},{open:!1,class:{button:""}}],defaultVariants:{open:!1,disabled:!1}});$u('<li><button type="button" role="tab"><!></button></li>');Bu(["click"]);$u("<div></div>"),$u('<ul><!></ul> <!> <div role="tabpanel"><!></div>',1);Mm({base:"relative border-s border-gray-200 dark:border-gray-700"}),Mm({slots:{li:"mb-10 ms-6",span:"flex absolute -start-3 justify-center items-center w-6 h-6 bg-blue-200 rounded-full ring-8 ring-white dark:ring-gray-900 dark:bg-blue-900",img:"rounded-full shadow-lg",outer:"p-4 bg-white rounded-lg border border-gray-200 shadow-xs dark:bg-gray-700 dark:border-gray-600",inner:"justify-between items-center mb-3 sm:flex",time:"mb-1 text-xs font-normal text-gray-400 sm:order-last sm:mb-0",title:"text-sm font-normal text-gray-500 lex dark:text-gray-300",text:"p-3 text-xs italic font-normal text-gray-500 bg-gray-50 rounded-lg border border-gray-200 dark:bg-gray-600 dark:border-gray-500 dark:text-gray-300"}}),Mm({slots:{div:"p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700",time:"text-lg font-semibold text-gray-900 dark:text-white",ol:"mt-3 divide-y divider-gray-200 dark:divide-gray-700"}}),Mm({slots:{base:"",a:"block items-center p-3 sm:flex hover:bg-gray-100 dark:hover:bg-gray-700",img:"me-3 mb-3 w-12 h-12 rounded-full sm:mb-0",div:"text-gray-600 dark:text-gray-400",title:"text-base font-normal",span:"inline-flex items-center text-xs font-normal text-gray-500 dark:text-gray-400",svg:"me-1 h-3 w-3"}});const kb={dot:"bg-primary-200 dark:bg-primary-900",ring:"ring-white dark:ring-gray-900",icon:"text-primary-600 dark:text-primary-400",connector:"border-primary-200 dark:border-primary-700"},Tb={dot:"bg-green-200 dark:bg-green-900",ring:"ring-white dark:ring-gray-900",icon:"text-green-600 dark:text-green-400",connector:"border-green-200 dark:border-green-700"},Ib={dot:"bg-orange-200 dark:bg-orange-900",ring:"ring-white dark:ring-gray-900",icon:"text-orange-600 dark:text-orange-400",connector:"border-orange-200 dark:border-orange-700"},Mb={dot:"bg-red-200 dark:bg-red-900",ring:"ring-white dark:ring-gray-900",icon:"text-red-600 dark:text-red-400",connector:"border-red-200 dark:border-red-700"},Eb={dot:"bg-blue-200 dark:bg-blue-900",ring:"ring-white dark:ring-gray-900",icon:"text-blue-600 dark:text-blue-400",connector:"border-blue-200 dark:border-blue-700"},Pb={dot:"bg-purple-200 dark:bg-purple-900",ring:"ring-white dark:ring-gray-900",icon:"text-purple-600 dark:text-purple-400",connector:"border-purple-200 dark:border-purple-700"},Ab={dot:"bg-gray-200 dark:bg-gray-700",ring:"ring-white dark:ring-gray-900",icon:"text-gray-600 dark:text-gray-400",connector:"border-gray-200 dark:border-gray-700"};Mm({variants:{order:{group:"p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700",horizontal:"sm:flex",activity:"relative",vertical:"relative",default:"relative border-s border-gray-200 dark:border-gray-700"}},defaultVariants:{order:"default"}}),Mm({slots:{base:"relative",div:"",time:"",h3:"",svg:"w-4 h-4",connector:"absolute top-6 left-3 w-px h-full"},variants:{order:{default:{base:"mb-10 ms-4",div:"absolute w-3 h-3 bg-gray-200 rounded-full mt-1.5 -left-1.5 border border-white dark:border-gray-900 dark:bg-gray-700",time:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",h3:"text-lg font-semibold text-gray-900 dark:text-white"},vertical:{base:"mb-10 ms-6 relative",div:"flex absolute -left-4 top-1.5 justify-center items-center w-6 h-6 rounded-full ring-8",time:"mb-1 pl-4 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",h3:"flex ml-4 items-center mb-1 text-lg font-semibold text-gray-900 dark:text-white",connector:"absolute top-7 -left-1.5 w-px h-full"},horizontal:{base:"relative mb-6 sm:mb-0",div:"flex items-center",time:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",h3:"text-lg font-semibold text-gray-900 dark:text-white"},activity:{base:"mb-10 ms-6 relative",div:"flex absolute -left-4 top-1.5 justify-center items-center w-6 h-6 rounded-full ring-8",time:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",h3:"text-lg font-semibold text-gray-900 dark:text-white",connector:"absolute top-7 -left-4 w-px h-full"},group:{base:"",div:"p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700",time:"text-lg font-semibold text-gray-900 dark:text-white",h3:"text-lg font-semibold text-gray-900 dark:text-white"}},color:{primary:{},green:{},orange:{},red:{},blue:{},purple:{},gray:{}},isLast:{true:{},false:{}}},compoundVariants:[{order:"vertical",color:"primary",class:{div:kb.dot+" "+kb.ring,svg:kb.icon,connector:"bg-primary-200 dark:bg-primary-700"}},{order:"vertical",color:"green",class:{div:Tb.dot+" "+Tb.ring,svg:Tb.icon,connector:"bg-green-200 dark:bg-green-700"}},{order:"vertical",color:"orange",class:{div:Ib.dot+" "+Ib.ring,svg:Ib.icon,
29connector:"bg-orange-200 dark:bg-orange-700"}},{order:"vertical",color:"red",class:{div:Mb.dot+" "+Mb.ring,svg:Mb.icon,connector:"bg-red-200 dark:bg-red-700"}},{order:"vertical",color:"blue",class:{div:Eb.dot+" "+Eb.ring,svg:Eb.icon,connector:"bg-blue-200 dark:bg-blue-700"}},{order:"vertical",color:"purple",class:{div:Pb.dot+" "+Pb.ring,svg:Pb.icon,connector:"bg-purple-200 dark:bg-purple-700"}},{order:"vertical",color:"gray",class:{div:Ab.dot+" "+Ab.ring,svg:Ab.icon,connector:"bg-gray-200 dark:bg-gray-700"}},{order:"horizontal",color:"primary",class:{div:kb.dot+" "+kb.ring,svg:kb.icon}},{order:"horizontal",color:"green",class:{div:Tb.dot+" "+Tb.ring,svg:Tb.icon}},{order:"horizontal",color:"orange",class:{div:Ib.dot+" "+Ib.ring,svg:Ib.icon}},{order:"horizontal",color:"red",class:{div:Mb.dot+" "+Mb.ring,svg:Mb.icon}},{order:"horizontal",color:"blue",class:{div:Eb.dot+" "+Eb.ring,svg:Eb.icon}},{order:"horizontal",color:"purple",class:{div:Pb.dot+" "+Pb.ring,svg:Pb.icon}},{order:"horizontal",color:"gray",class:{div:Ab.dot+" "+Ab.ring,svg:Ab.icon}},{isLast:!0,class:{connector:"hidden"}}],defaultVariants:{order:"default",color:"primary",isLast:!1}});$u("<ol><!></ol>");$u("<div><!></div>"),$u("<li><span><img/></span> <div><div><time> </time> <div><!></div></div> <!></div></li>");$u("<div><time> </time> <ol><!></ol></div>");$u('<div class="text-sm font-normal"> </div>'),qu('<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M3.707 2.293a1 1 0 00-1.414 1.414l14 14a1 1 0 001.414-1.414l-1.473-1.473A10.014 10.014 0 0019.542 10C18.268 5.943 14.478 3 10 3a9.958 9.958 0 00-4.512 1.074l-1.78-1.781zm4.261 4.26l1.514 1.515a2.003 2.003 0 012.45 2.45l1.514 1.514a4 4 0 00-5.478-5.478z" clip-rule="evenodd"></path><path d="M12.454 16.697L9.75 13.992a4 4 0 01-3.742-3.741L2.335 6.578A9.98 9.98 0 00.458 10c1.274 4.057 5.065 7 9.542 7 .847 0 1.669-.105 2.454-.303z"></path></svg> Private',1),qu('<svg fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z" clip-rule="evenodd"></path></svg> Public',1),$u("<li><a><img/> <div><div><!></div> <!> <span><!></span></div></a></li>");$u("<ol><!></ol>");$u('<div aria-hidden="true"></div>'),$u('<div><svg aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z" clip-rule="evenodd"></path></svg></div>'),$u("<time> </time>"),$u("<h3> </h3>"),$u("<time> </time>"),$u("<li><!> <!> <!> <!> <!></li>");Mm({slots:{base:"flex w-full max-w-xs p-4 text-gray-500 bg-white rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 gap-3",icon:"w-8 h-8 inline-flex items-center justify-center shrink-0 rounded-lg",content:"w-full text-sm font-normal",close:"ms-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex items-center justify-center h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700"},variants:{position:{"top-left":{base:"absolute top-5 start-5"},"top-right":{base:"absolute top-5 end-5"},"bottom-left":{base:"absolute bottom-5 start-5"},"bottom-right":{base:"absolute bottom-5 end-5"}},color:{primary:{icon:"text-primary-500 bg-primary-100 dark:bg-primary-800 dark:text-primary-200",close:"text-primary-500 dark:text-primary-200 hover:text-primary-600 dark:hover:text-primary-500"},gray:{icon:"text-gray-500 bg-gray-100 dark:bg-gray-700 dark:text-gray-200",close:"text-gray-500 dark:text-gray-200 hover:text-gray-600 dark:hover:text-gray-500"},red:{icon:"text-red-500 bg-red-100 dark:bg-red-800 dark:text-red-200",close:"text-red-500 dark:text-red-200 hover:text-red-600 dark:hover:text-red-500"}
29,orange:{icon:"text-orange-500 bg-orange-100 dark:bg-orange-700 dark:text-orange-200",close:"text-orange-500 dark:text-orange-200 hover:text-orange-600 dark:hover:text-orange-500"},amber:{icon:"text-amber-500 bg-amber-100 dark:bg-amber-700 dark:text-amber-200",close:"text-amber-500 dark:text-amber-200 hover:text-amber-600 dark:hover:text-amber-500"},yellow:{icon:"text-yellow-500 bg-yellow-100 dark:bg-yellow-800 dark:text-yellow-200",close:"text-yellow-500 dark:text-yellow-200 hover:text-yellow-600 dark:hover:text-yellow-500"},lime:{icon:"text-lime-500 bg-lime-100 dark:bg-lime-700 dark:text-lime-200",close:"text-lime-500 dark:text-lime-200 hover:text-lime-600 dark:hover:text-lime-500"},green:{icon:"text-green-500 bg-green-100 dark:bg-green-800 dark:text-green-200",close:"text-green-500 dark:text-green-200 hover:text-green-600 dark:hover:text-green-500"},emerald:{icon:"text-emerald-500 bg-emerald-100 dark:bg-emerald-800 dark:text-emerald-200",close:"text-emerald-500 dark:text-emerald-200 hover:text-emerald-600 dark:hover:text-emerald-500"},teal:{icon:"text-teal-500 bg-teal-100 dark:bg-teal-800 dark:text-teal-200",close:"text-teal-500 dark:text-teal-200 hover:text-teal-600 dark:hover:text-teal-500"},cyan:{icon:"text-cyan-500 bg-cyan-100 dark:bg-cyan-800 dark:text-cyan-200",close:"text-cyan-500 dark:text-cyan-200 hover:text-cyan-600 dark:hover:text-cyan-500"},sky:{icon:"text-sky-500 bg-sky-100 dark:bg-sky-800 dark:text-sky-200",close:"text-sky-500 dark:text-sky-200 hover:text-sky-600 dark:hover:text-sky-500"},blue:{icon:"text-blue-500 bg-blue-100 dark:bg-blue-800 dark:text-blue-200",close:"text-blue-500 dark:text-blue-200 hover:text-blue-600 dark:hover:text-blue-500"},indigo:{icon:"text-indigo-500 bg-indigo-100 dark:bg-indigo-800 dark:text-indigo-200",close:"text-indigo-500 dark:text-indigo-200 hover:text-indigo-600 dark:hover:text-indigo-500"},violet:{icon:"text-violet-500 bg-violet-100 dark:bg-violet-800 dark:text-violet-200",close:"text-violet-500 dark:text-violet-200 hover:text-violet-600 dark:hover:text-violet-500"},purple:{icon:"text-purple-500 bg-purple-100 dark:bg-purple-800 dark:text-purple-200",close:"text-purple-500 dark:text-purple-200 hover:text-purple-600 dark:hover:text-purple-500"},fuchsia:{icon:"text-fuchsia-500 bg-fuchsia-100 dark:bg-fuchsia-800 dark:text-fuchsia-200",close:"text-fuchsia-500 dark:text-fuchsia-200 hover:text-fuchsia-600 dark:hover:text-fuchsia-500"},pink:{icon:"text-pink-500 bg-pink-100 dark:bg-pink-700 dark:text-pink-200",close:"text-pink-500 dark:text-pink-200 hover:text-pink-600 dark:hover:text-pink-500"},rose:{icon:"text-rose-500 bg-rose-100 dark:bg-rose-700 dark:text-rose-200",close:"text-rose-500 dark:text-rose-200 hover:text-rose-600 dar
29k:hover:text-rose-500"}},align:{true:{base:"items-center"},false:{base:"items-start"}}}}),Mm({base:"fixed z-50 space-y-3"});$u("<div><!></div>"),$u("<div><!> <div><!></div> <!></div>");$u("<div><!></div>");$u("<div><div><!></div> <!></div>");$u("<div><!></div>");const Cb=Mm({slots:{base:"w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 me-2 rounded-sm",div:"flex items-center"},variants:{color:{primary:{base:"text-primary-600 focus:ring-primary-500 dark:focus:ring-primary-600"},secondary:{base:"text-secondary-600 focus:ring-secondary-500 dark:focus:ring-secondary-600"},gray:{base:"text-gray-600 focus:ring-gray-600 dark:ring-offset-gray-800 dark:focus:ring-gray-600"},red:{base:"text-red-600 focus:ring-red-600 dark:ring-offset-red-600 dark:focus:ring-red-600"},orange:{base:"text-orange-600 focus:ring-orange-600 dark:ring-offset-orange-600 dark:focus:ring-orange-600"},amber:{base:"text-amber-600 focus:ring-amber-600 dark:ring-offset-amber-600 dark:focus:ring-amber-600"},yellow:{base:"text-yellow-400 focus:ring-yellow-400 dark:ring-offset-yellow-400 dark:focus:ring-yellow-400"},lime:{base:"text-lime-700 focus:ring-lime-700 dark:ring-offset-lime-700 dark:focus:ring-lime-700"},green:{base:"text-green-600 focus:ring-green-600 dark:ring-offset-green-600 dark:focus:ring-green-600"},emerald:{base:"text-emerald-600 focus:ring-emerald-600 dark:ring-offset-emerald-600 dark:focus:ring-emerald-600"},teal:{base:"text-teal-600 focus:ring-teal-600 dark:ring-offset-teal-600 dark:focus:ring-teal-600"},cyan:{base:"text-cyan-600 focus:ring-cyan-600 dark:ring-offset-cyan-600 dark:focus:ring-cyan-600"},sky:{base:"text-sky-600 focus:ring-sky-600 dark:ring-offset-sky-600 dark:focus:ring-sky-600"},blue:{base:"text-blue-700 focus:ring-blue-600 dark:ring-offset-blue-700 dark:focus:ring-blue-700"},indigo:{base:"text-indigo-700 focus:ring-indigo-700 dark:ring-offset-indigo-700 dark:focus:ring-indigo-700"},violet:{base:"text-violet-600 focus:ring-violet-600 dark:ring-offset-violet-600 dark:focus:ring-violet-600"},purple:{base:"text-purple-600 focus:ring-purple-600 dark:ring-offset-purple-600 dark:focus:ring-purple-600"},fuchsia:{base:"text-fuchsia-600 focus:ring-fuchsia-600 dark:ring-offset-fuchsia-600 dark:focus:ring-fuchsia-600"},pink:{base:"text-pink-600 focus:ring-pink-600 dark:ring-offset-pink-600 dark:focus:ring-pink-600"}
29,rose:{base:"text-rose-600 focus:ring-rose-600 dark:ring-offset-rose-600 dark:focus:ring-rose-600"}},tinted:{true:{base:"dark:bg-gray-600 dark:border-gray-500"},false:{base:"dark:bg-gray-700 dark:border-gray-600"}},custom:{true:{base:"sr-only peer"}},rounded:{true:{base:"rounded-sm"}},inline:{true:{div:"inline-flex",false:"flex items-center"}},disabled:{true:{base:"cursor-not-allowed opacity-50 bg-gray-200 border-gray-300",div:"cursor-not-allowed opacity-70"},false:{}}},defaultVariants:{color:"primary",disabled:!1}}),Rb=(Mm({base:"",variants:{inline:{true:"inline-flex",false:"flex"},checked:{true:"outline-4 outline-green-500"}},defaultVariants:{inline:!0}}),Mm({base:"text-sm rtl:text-right font-medium block",variants:{color:{disabled:"text-gray-500 dark:text-gray-500",primary:"text-primary-700 dark:text-primary-500",secondary:"text-secondary-700 dark:text-secondary-500",green:"text-green-700 dark:text-green-500",emerald:"text-emerald-700 dark:text-emerald-500",red:"text-red-700 dark:text-red-500",blue:"text-blue-700 dark:text-blue-500",yellow:"text-yellow-700 dark:text-yellow-500",orange:"text-orange-700 dark:text-orange-500",gray:"text-gray-700 dark:text-gray-200",teal:"text-teal-700 dark:text-teal-500",cyan:"text-cyan-700 dark:text-cyan-500",sky:"text-sky-700 dark:text-sky-500",indigo:"text-indigo-700 dark:text-indigo-500",lime:"text-lime-700 dark:text-lime-500",amber:"text-amber-700 dark:text-amber-500",violet:"text-violet-700 dark:text-violet-500",purple:"text-purple-700 dark:text-purple-500",fuchsia:"text-fuchsia-700 dark:text-fuchsia-500",pink:"text-pink-700 dark:text-pink-500",rose:"text-rose-700 dark:text-rose-500"}}}));var Lb=$u("<label><!></label>");function Ob(e,t){Zs(t,!0);let r=fh(t,"color",3,"gray"),n=fh(t,"show",3,!0),i=lh(t,["$$slots","$$events","$$legacy","children","color","show","class"]);const o=x_("label");let a=Dl((()=>Rb({color:r(),class:yd(o,t.class)})));var s=Zu(),l=dc(s),c=e=>{var r=Lb();Nd(r,(()=>({...i,class:yu(a)}))),ud(uc(r),(()=>t.children)),Os(r),Yu(e,r)},u=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(l,(e=>{n()?e(c):e(u,!1)})),Yu(e,s),Ys()}var Db=$u("<input/> <!>",1),zb=$u("<input/> <!>",1);function Fb(e,t){Zs(t,!0);const r=[];let n=fh(t,"color",3,"primary"),i=fh(t,"group",31,(()=>Jl([]))),o=fh(t,"choices",19,(()=>[])),a=fh(t,"checked",15,!1),s=fh(t,"labelProps",19,(()=>({}))),l=lh(t,["$$slots","$$events","$$legacy","children","color","custom","inline","tinted","rounded","group","choices","checked","classes","class","divClass","disabled","value","labelProps"]);t.divClass;const c=Dl((()=>t.classes??{div:t.divClass})),u=x_("checkbox"),d=Dl((()=>
29Cb({color:n(),tinted:t.tinted,custom:t.custom,rounded:t.rounded,inline:t.inline,disabled:t.disabled??!1}))),h=Dl((()=>yu(d).base)),f=Dl((()=>yu(d).div));Tc((()=>{void 0!==t.value&&Array.isArray(i())&&a(i().includes(t.value))})),Tc((()=>{if(void 0===t.value||!Array.isArray(i()))return;const e=i().indexOf(t.value);void 0===a()&&a(e>=0),a()?e<0&&i().push(t.value):e>=0&&i().splice(e,1)}));var p=Zu(),g=dc(p),m=e=>{var n=Zu();Il(dc(n),19,o,((e,t)=>e.value??t),((e,n)=>{{let o=Dl((()=>!!t.children||!!yu(n).label)),a=Dl((()=>yu(f)({class:yd(u?.div,yu(c).div)})));Ob(e,hh({get show(){return yu(o)}},s,{get class(){return yu(a)},children:(e,o)=>{var a=Db(),s=dc(a);Nd(s,(e=>({type:"checkbox",value:yu(n).value,checked:yu(n).checked??!1,disabled:t.disabled,...l,class:e})),[()=>yu(h)({class:yd(u?.base,t.class)})],void 0,void 0,void 0,!0);var c=hc(s,2),d=e=>{var r=Zu();ud(dc(r),(()=>t.children),(()=>({value:yu(n).value,checked:yu(n).checked,disabled:t.disabled}))),Yu(e,r)},f=e=>{var t=Wu();Pc((()=>Ju(t,yu(n).label))),Yu(e,t)};ad(c,(e=>{t.children?e(d):e(f,!1)})),function(e,t,r,n,i=n){var o="checkbox"===r.getAttribute("type"),a=e;let s=!1;if(null!==t)for(var l of t)a=a[l]??=[];a.push(r),bc(r,"change",(()=>{var e=r.__value;o&&(e=Qd(a,e,r.checked)),i(e)}),(()=>i(o?[]:null))),Ec((()=>{var e=n();As&&r.defaultChecked!==r.checked?s=!0:o?(e=e||[],r.checked=e.includes(r.__value)):r.checked=ec(r.__value,e)})),kc((()=>{var e=a.indexOf(r);-1!==e&&a.splice(e,1)})),Jd.has(a)||(Jd.add(a),el((()=>{a.sort(((e,t)=>4===e.compareDocumentPosition(t)?-1:1)),Jd.delete(a)}))),el((()=>{if(s){var e;if(o)e=Qd(a,e,r.checked);else{var t=a.find((e=>e.checked));e=t?.__value}i(e)}}))}(r,[],s,(()=>(yu(n).value,i())),i),Yu(e,a)},$$slots:{default:!0}}))}})),Yu(e,n)},y=e=>{{let r=Dl((()=>!!t.children)),n=Dl((()=>yu(f)({class:yd(u?.div,yu(c).div)})));Ob(e,hh({get show(){return yu(r)}},s,{get class(){return yu(n)},children:(e,r)=>{var n=zb(),i=dc(n);Nd(i,(e=>({type:"checkbox",value:t.value,disabled:t.disabled,...l,class:e})),[()=>yu(h)({class:yd(u?.base,t.class)})],void 0,void 0,void 0,!0);var o=hc(i,2),s=e=>{var r=Zu();ud(dc(r),(()=>t.children),(()=>({value:t.value,checked:a(),disabled:t.disabled}))),Yu(e,r)};ad(o,(e=>{t.children&&e(s)})),function(e,t,r=t){bc(e,"change",(t=>{var n=t?e.defaultChecked:e.checked;r(n)})),(As&&e.defaultChecked!==e.checked||null==xu(t))&&r(e.checked),Ec((()=>{var r=t();e.checked=Boolean(r)}))}(i,a),Yu(e,n)},$$slots:{default:!0}}))}};ad(g,(e=>{o().length>0?e(m):e(y,!1)})),Yu(e,p),Ys()}$u("<!> <!>",1);Mm({base:"flex flex-col justify-center items-center w-full h-64 bg-gray-50 rounded-lg border-2 border-gray-300 border-dashed cursor-pointer dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600"});$u("<label><!> <input/></label>");Mm({slots:{base:"block w-full disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right p-2.5 focus:border-primary-500 focus:ring-primary-500 dark:focus:border-primary-500 dark:focus:ring-primary-500 bg-gray-50 text-gray-900 dark:bg-gray-700 dark:placeholder-gray-400 border-gray-300 dark:border-gray-600 text-sm rounded-lg border p-0! dark:text-gray-400",wrapper:"relative w-full",close:"flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400 end-0 p-2.5",svg:""},variants:{size:{sm:{base:"text-xs ps-9 pe-9 p-2"},md:{base:"text-sm ps-10 pe-10 p-2.5"},lg:{base:"sm:text-base ps-11 pe-11 p-3"}}}});$u("<div><input/> <!></div>");Mm({slots:{base:"relative",input:"block w-full text-sm text-gray-900 bg-transparent appearance-none dark:text-white focus:outline-hidden focus:ring-0 peer disabled:cursor-not-allowed disabled:opacity-50",label:"absolute text-sm duration-300 transform scale-75 z-10 origin-left rtl:origin-right peer-placeholder-shown:scale-100 peer-focus:scale-75",close:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-black",combo:"absolute top-full right-0 left-0 z-10 mt-1 max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800",svg:""},variants:{variant:{filled:{base:"relative",input:"rounded-t-lg border-0 border-b-2 bg-gray-50 dark:bg-gray-700",label:"-translate-y-4 start-2.5 peer-placeholder-shown:translate-y-0 peer-focus:-translate-y-4"},outlined:{base:"relative",input:"rounded-lg border",label:"-translate-y-4 bg-white dark:bg-gray-900 px-2 peer-focus:px-2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:-translate-y-4 start-1"},standard:{base:"relative z-0",input:"border-0 border-b-2",label:"-translate-y-6 -z-10 peer-focus:start-0 peer-placeholder-shown:translate-y-0 peer-focus:-translate-y-6"}},size:{small:{},default:{}},color:{default:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-primary-500 focus:border-primary-600",label:"text-gray-500 dark:text-gray-400 peer-focus:text-primary-600 dark:peer-focus:text-primary-500"},primary:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-primary-500 focus:border-primary-600",label:"text-primary-500 dark:text-primary-400 peer-focus:text-primary-600 dark:peer-focus:text-primary-500"},secondary:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-secondary-500 focus:border-secondary-600",label:"text-secondary-500 dark:text-secondary-400 peer-focus:text-secondary-600 dark:peer-focus:text-secondary-500"},gray:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-gray-500 focus:border-gray-600",label:"text-gray-500 dark:text-gray-400 peer-focus:text-gray-600 dark:peer-focus:text-gray-500"},red:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-red-500 focus:border-red-600",label:"text-red-500 dark:text-red-400 peer-focus:text-red-600 dark:peer-focus:text-red-500"},orange:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-orange-500 focus:border-orange-600",label:"text-orange-500 dark:text-orange-400 peer-focus:text-orange-600 dar
29k:peer-focus:text-orange-500"},amber:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-amber-500 focus:border-amber-600",label:"text-amber-500 dark:text-amber-400 peer-focus:text-amber-600 dark:peer-focus:text-amber-500"},yellow:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-yellow-500 focus:border-yellow-600",label:"text-yellow-500 dark:text-yellow-400 peer-focus:text-yellow-600 dark:peer-focus:text-yellow-500"},lime:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-lime-500 focus:border-lime-600",label:"text-lime-500 dark:text-lime-400 peer-focus:text-lime-600 dark:peer-focus:text-lime-500"},green:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-green-500 focus:border-green-600",label:"text-green-500 dark:text-green-400 peer-focus:text-green-600 dark:peer-focus:text-green-500"},emerald:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-emerald-500 focus:border-emerald-600",label:"text-emerald-500 dark:text-emerald-400 peer-focus:text-emerald-600 dark:peer-focus:text-emerald-500"},teal:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-teal-500 focus:border-teal-600",label:"text-teal-500 dark:text-teal-400 peer-focus:text-teal-600 dark:peer-focus:text-teal-500"},cyan:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-cyan-500 focus:border-cyan-600",label:"text-cyan-500 dark:text-cyan-400 peer-focus:text-cyan-600 dark:peer-focus:text-cyan-500"},sky:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-sky-500 focus:border-sky-600",label:"text-sky-500 dark:text-sky-400 peer-focus:text-sky-600 dark:peer-focus:text-sky-500"},blue:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-blue-500 focus:border-blue-600",label:"text-blue-500 dark:text-blue-400 peer-focus:text-blue-600 dark:peer-focus:text-blue-500"},indigo:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-indigo-500 focus:border-indigo-600",label:"text-indigo-500 dark:text-indigo-400 peer-focus:text-indigo-600 dark:peer-focus:text-indigo-500"},violet:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-violet-500 focus:border-violet-600",label:"text-violet-600 dark:text-violet-500 peer-focus:text-violet-600 dark:peer-focus:text-violet-500"},purple:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-purple-500 focus:border-purple-600",label:"text-purple-600 dark:text-purple-500 peer-focus:text-purple-600 dark:peer-focus:text-purple-500"},fuchsia:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-fuchsia-500 focus:border-fuchsia-600",label:"text-fuchsia-600 dark:text-fuchsia-500 peer-focus:text-fuchsia-600 dark:peer-focus:text-fuchsia-500"},pink:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-pink-500 focus:border-pink-600",label:"text-pink-600 dark:text-pink-500 peer-focus:text-pink-600 dark:peer-focus:text-pink-500"},rose:{input:"border-gray-300 dark:border-gray-600 dark:focus:border-rose-500 focus:border-rose-600",label:"text-rose-600 dar
29k:text-rose-500 peer-focus:text-rose-600 dark:peer-focus:text-rose-500"}}},compoundVariants:[{variant:"filled",size:"small",class:{input:"px-2.5 pb-1.5 pt-4",label:"top-3"}},{variant:"filled",size:"default",class:{input:"px-2.5 pb-2.5 pt-5",label:"top-4"}},{variant:"outlined",size:"small",class:{input:"px-2.5 pb-1.5 pt-3",label:"top-1"}},{variant:"outlined",size:"default",class:{input:"px-2.5 pb-2.5 pt-4",label:"top-2"}},{variant:"standard",size:"small",class:{input:"py-2 px-0",label:"top-3"}},{variant:"standard",size:"default",class:{input:"py-2.5 px-0",label:"top-3"}},{variant:"filled",color:"primary",class:{input:"dark:focus:border-primary-500 focus:border-primary-600"}}],defaultVariants:{variant:"standard",size:"default",color:"primary"}});$u('<div tabindex="-1" class="sr-only"></div>'),$u('<button type="button"> </button>'),$u("<div></div>"),$u("<!> <div><input/> <!> <label><!></label> <!></div>",1);Bu(["click"]);Mm({base:"text-xs font-normal text-gray-500 dark:text-gray-300",variants:{color:{disabled:"text-gray-400 dark:text-gray-500",primary:"text-primary-500 dark:text-primary-400",secondary:"text-secondary-500 dark:text-secondary-400",green:"text-green-500 dark:text-green-400",emerald:"text-emerald-500 dark:text-emerald-400",red:"text-red-500 dark:text-red-400",blue:"text-blue-500 dark:text-blue-400",yellow:"text-yellow-500 dark:text-yellow-400",orange:"text-orange-500 dark:text-orange-400",gray:"text-gray-500 dark:text-gray-400",teal:"text-teal-500 dark:text-teal-400",cyan:"text-cyan-500 dark:text-cyan-400",sky:"text-sky-500 dark:text-sky-400",indigo:"text-indigo-500 dark:text-indigo-400",lime:"text-lime-500 dark:text-lime-400",amber:"text-amber-500 dark:text-amber-400",violet:"text-violet-500 dark:text-violet-400",purple:"text-purple-500 dark:text-purple-400",fuchsia:"text-fuchsia-500 dark:text-fuchsia-400",pink:"text-pink-500 dark:text-pink-400",rose:"text-rose-500 dark:text-rose-400"}}});$u("<p><!></p>");const Nb=Mm({slots:{base:"relative w-full",input:"block w-full disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right focus:outline-hidden",left:"flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400 pointer-events-none start-0 p-2.5",right:"flex absolute inset-y-0 items-center text-gray-500 dark:text-gray-400 end-0 p-2.5",close:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-black",combo:"absolute top-full right-0 left-0 z-20 mt-1 max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800",comboItem:"text-gray-900 dark:text-gray-50",div:"",svg:""},variants:{size:{sm:{input:"text-xs px-2 py-1"},md:{input:"text-sm px-2.5 py-2.5"},lg:{input:"sm:text-base px-3 py-3"}},color:{default:{input:"border border-gray-300 dark:border-gray-600 focus:border-primary-500 focus:ring-primary-500 dark:focus:border-primary-500 dark:focus:ring-primary-500 bg-gray-50 text-gray-900 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 bg-gray-50 text-gray-900 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400"},tinted:{input:"border border-gray-300 dark:border-gray-500 bg-gray-50 text-gray-900 dark:bg-gray-600 dark:text-white dark:placeholder-gray-400"},primary:{input:"border border-primary-200 dark:border-primary-400 focus:ring-primary-500 focus:border-primary-600 dark:focus:ring-primary-500 dark:focus:border-primary-500 bg-primary-50 text-primary-900 placeholder-primary-700 dark:text-primary-400 dark:placeholder-primary-500 dark:bg-gray-700"},secondary:{input:"border border-secondary-200 dark:border-secondary-400 focus:ring-secondary-500 focus:border-secondary-600 dark:focus:ring-secondary-500 dark:focus:border-secondary-500 bg-secondary-50 text-secondary-900 placeholder-secondary-700 dark:text-secondary-400 dark:placeholder-secondary-500 dark:bg-gray-700"},green:{input:"border border-green-200 dark:border-green-400 focus:ring-green-500 focus:border-green-600 dark:focus:ring-green-500 dark:focus:border-green-500 bg-green-50 text-green-900 placeholder-green-700 dark:text-green-400 dark:placeholder-green-500 dark:bg-gray-700"},emerald:{input:"border border-emerald-200 dark:border-emerald-400 focus:ring-emerald-500 focus:border-emerald-600 dark:focus:ring-emerald-500 dark:focus:border-emerald-500 bg-emerald-50 text-emerald-900 placeholder-emerald-700 dark:text-emerald-400 dark:placeholder-emerald-500 dark:bg-gray-700"},red:{input:"border border-red-200 dark:border-red-400 focus:ring-red-500 focus:border-red-600 dark:focus:ring-red-500 dark:focus:border-red-500 bg-red-50 text-red-900 placeholder-red-700 dark:text-red-400 dark:placeholder-red-500 dark:bg-gray-700"},blue:{input:"border border-blue-200 dark:border-blue-400 focus:ring-blue-500 focus:border-blue-600 dar
29k:focus:ring-blue-500 dark:focus:border-blue-500 bg-blue-50 text-blue-900 placeholder-blue-700 dark:text-blue-400 dark:placeholder-blue-500 dark:bg-gray-700"},yellow:{input:"border border-yellow-200 dark:border-yellow-400 focus:ring-yellow-500 focus:border-yellow-600 dark:focus:ring-yellow-500 dark:focus:border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 dark:text-yellow-400 dark:placeholder-yellow-500 dark:bg-gray-700"},orange:{input:"border border-orange-200 dark:border-orange-400 focus:ring-orange-500 focus:border-orange-600 dark:focus:ring-orange-500 dark:focus:border-orange-500 bg-orange-50 text-orange-900 placeholder-orange-700 dark:text-orange-400 dark:placeholder-orange-500 dark:bg-gray-700"},gray:{input:"border border-gray-200 dark:border-gray-400 focus:ring-gray-500 focus:border-gray-600 dark:focus:ring-gray-500 dark:focus:border-gray-500 bg-gray-50 text-gray-900 placeholder-gray-700 dark:text-gray-400 dark:placeholder-gray-500 dark:bg-gray-700"},teal:{input:"border border-teal-200 dark:border-teal-400 focus:ring-teal-500 focus:border-teal-600 dark:focus:ring-teal-500 dark:focus:border-teal-500 bg-teal-50 text-teal-900 placeholder-teal-700 dark:text-teal-400 dark:placeholder-teal-500 dark:bg-gray-700"},cyan:{input:"border border-cyan-200 dark:border-cyan-400 focus:ring-cyan-500 focus:border-cyan-600 dark:focus:ring-cyan-500 dark:focus:border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 dark:text-cyan-400 dark:placeholder-cyan-500 dark:bg-gray-700"},sky:{input:"border border-sky-200 dark:border-sky-400 focus:ring-sky-500 focus:border-sky-600 dark:focus:ring-sky-500 dark:focus:border-sky-500 bg-sky-50 text-sky-900 placeholder-sky-700 dark:text-sky-400 dark:placeholder-sky-500 dark:bg-gray-700"},indigo:{input:"border border-indigo-200 dark:border-indigo-400 focus:ring-indigo-500 focus:border-indigo-600 dark:focus:ring-indigo-500 dark:focus:border-indigo-500 bg-indigo-50 text-indigo-900 placeholder-indigo-700 dark:text-indigo-400 dark:placeholder-indigo-500 dark:bg-gray-700"},lime:{input:"border border-lime-200 dark:border-lime-400 focus:ring-lime-500 focus:border-lime-600 dark:focus:ring-lime-500 dark:focus:border-lime-500 bg-lime-50 text-lime-900 placeholder-lime-700 dark:text-lime-400 dark:placeholder-lime-500 dark:bg-gray-700"},amber:{input:"border border-amber-200 dark:border-amber-400 focus:ring-amber-500 focus:border-amber-600 dark:focus:ring-amber-500 dark:focus:border-amber-500 bg-amber-50 text-amber-900 placeholder-amber-700 dark:text-amber-400 dark:placeholder-amber-500 dark:bg-gray-700"},violet:{input:"border border-violet-200 dark:border-violet-400 focus:ring-violet-500 focus:border-violet-600 dark:focus:ring-violet-500 dark:focus:border-violet-500 bg-violet-50 text-violet-900 placeholder-violet-700 dark:text-violet-400 dark:placeholder-violet-500 dark:bg-gray-700"},purple:{input:"border border-purple-200 dark:border-purple-400 focus:ring-purple-500 focus:border-purple-600 dark:focus:ring-purple-500 dark:focus:border-purple-500 bg-purple-50 text-purple-900 placeholder-purple-700 dark:text-purple-400 dark:placeholder-purple-500 dark:bg-gray-700"},fuchsia:{input:"border border-fuchsia-200 dark:border-fuchsia-400 focus:ring-fuchsia-500 focus:border-fuchsia-600 dark:focus:ring-fuchsia-500 dark:focus:border-fuchsia-500 bg-fuchsia-50 text-fuchsia-900 placeholder-fuchsia-700 dark:text-fuchsia-400 dark:placeholder-fuchsia-500 dark:bg-gray-700"},pink:{input:"border border-pink-200 dark:border-pink-400 focus:ring-pink-500 focus:border-pink-600 dark:focus:ring-pink-500 dark:focus:border-pink-500 bg-pink-50 text-pink-900 placeholder-pink-700 dark:text-pink-400 dark:placeholder-pink-500 dark:bg-gray-700"},rose:{input:"border border-rose-200 dark:border-rose-400 focus:ring-rose-500 focus:border-rose-600 dar
29k:focus:ring-rose-500 dark:focus:border-rose-500 bg-rose-50 text-rose-900 placeholder-rose-700 dark:text-rose-400 dark:placeholder-rose-500 dark:bg-gray-700"}},grouped:{false:{base:"rounded-lg",input:"rounded-lg"},true:{base:"first:rounded-s-lg last:rounded-e-lg not-first:-ms-px group",input:"group-first:rounded-s-lg group-last:rounded-e-lg group-not-first:-ms-px h-full"}}},defaultVariants:{size:"md",color:"default"}});var Bb=$u("<input/> <!>",1),jb=$u('<div tabindex="-1" class="sr-only"></div>'),Vb=$u("<div><!></div>"),Gb=$u("<div><!></div>"),Ub=$u('<button type="button"><p> </p></button>'),$b=$u("<div></div>"),Hb=$u("<div><!> <!> <!> <!></div>"),qb=$u("<!> <!>",1);function Wb(e,t){Zs(t,!0);const r=(e,r=Ka)=>{var a=Zu(),l=dc(a),c=e=>{var r=Zu(),n=dc(r);{let e=Dl((()=>({...u,class:yu(I)()})));ud(n,(()=>t.children),(()=>yu(e)))}Yu(e,r)},f=e=>{var a=Bb(),l=dc(a);Nd(l,(e=>({...u,oninput:F,onfocus:N,onblur:B,onkeydown:j,class:e})),[()=>[r()||yu(T)(),yu(I)({class:yd(h?.input,t.class)})]],void 0,void 0,void 0,!0),nh(l,(e=>i(e)),(()=>i()));var c=hc(l,2),f=e=>{{let t=Dl((()=>yu(P)({class:yd(h?.close,yu(d).close)}))),r=Dl((()=>yd(yu(d).svg)));Fm(e,{get class(){return yu(t)},get color(){return s()},"aria-label":"Clear search value",get svgClass(){return yu(r)}})}};ad(c,(e=>{void 0!==n()&&""!==n()&&o()&&e(f)})),Kd(l,n),Yu(e,a)};ad(l,(e=>{t.children?e(c):e(f,!1)})),Yu(e,a)};let n=fh(t,"value",15),i=fh(t,"elementRef",15),o=fh(t,"clearable",3,!1),a=fh(t,"color",3,"default"),s=fh(t,"clearableColor",3,"none"),l=fh(t,"data",19,(()=>[])),c=fh(t,"maxSuggestions",3,5),u=lh(t,["$$slots","$$events","$$legacy","children","left","right","value","elementRef","clearable","size","color","class","classes","wrapperClass","leftClass","rightClass","divClass","clearableSvgClass","clearableColor","clearableClass","clearableOnClick","data","maxSuggestions","onSelect","comboClass","comboItemClass","onInput","onFocus","onBlur","onKeydown","oninput","onfocus","onblur","onkeydown"]);t.wrapperClass,t.leftClass,t.rightClass,t.divClass,t.clearableSvgClass,t.clearableClass,t.comboClass;const d=Dl((()=>t.classes??{left:t.leftClass,right:t.rightClass,div:t.divClass,svg:t.clearableSvgClass,close:t.clearableClass,combo:t.comboClass,comboItem:t.comboItemClass})),h=x_("input"),f=Dl((()=>t.oninput||t.onInput)),p=Dl((()=>t.onfocus||t.onFocus)),g=Dl((()=>t.onblur||t.onBlur)),m=Dl((()=>t.onkeydown||t.onKeydown)),y=Dl((()=>Array.isArray(l())&&l().length>0));let _,v=qs("background"),b=qs("group"),x=!!b,w=Dl((()=>{return t.size||(e=b?.size,e&&"xs"===e?"sm":"xl"===e?"lg":e)||"md";var e}));const S=Dl((()=>"default"===a()&&v?"tinted":a())),k=Dl((()=>Nb({size:yu(w),color:yu(S),grouped:x}))),T=Dl((()=>yu(k).base)),I=Dl((()=>yu(k).input)),M=Dl((()=>yu(k).left)),E=Dl((()=>yu(k).right)),P=Dl((()=>yu(k).close)),A=Dl((()=>yu(k).combo)),C=Dl((()=>yu(k).comboItem));Am((()=>{if(i()){const e=i();e.value="",n(""),ql(D,!1),z(),_?.focus(),setTimeout((()=>{e.focus()}),100)}t.clearableOnClick&&t.clearableOnClick()}));let R=$l(!1),L=$l(Jl([])),O=$l(-1),D=$l(!1);function z(){if(!yu(y)||!yu(R))return void ql(L,[],!0);const e=(n()||"").toLowerCase(),t=e.lastIndexOf(" "),r=-1===t?e:e.substring(t+1);""!==r||yu(D)?r?ql(L,l().filter((e=>e.toLowerCase().includes(r))).slice(0,c()),!0):yu(D)&&ql(L,[...l()].slice(0,c()),!0):ql(L,[],!0),ql(O,-1)}function F(e){yu(f)&&yu(f)(e),String(n()||"").length>0&&ql(D,!1),z()}function N(e){yu(p)&&yu(p)(e),ql(R,!0),z()}function B(e){yu(g)&&yu(g)(e),setTimeout((()=>{ql(R,!1),ql(D,!1),ql(L,[],!0)}),200)}function j(e){yu(m)&&yu(m)(e),function(e){if(yu(y)&&("Backspace"!==e.key&&"Delete"!==e.key||n().length<=1&&ql(D,!0),yu(L).length))switch(e.key){case"ArrowDown":e.preventDefault(),ql(O,(yu(O)+1)%yu(L).length);break;case"ArrowUp":e.preventDefault(),ql(O,yu(O)<=0?yu(L).length-1:yu(O)-1,!0);break;case"Enter":yu(O)>=0&&(e.preventDefault(),V(yu(L)[yu(O)]));break;case"Escape":e.preventDefault(),ql(L,[],!0)}}(e)}function V(e){const r=n()||"",o=r.lastIndexOf(" ");n(-1===o?e+" ":r.substring(0,o+1)+e+" "),t.onSelect&&t.onSelect(e),ql(L,[],!0),ql(O,-1),i()&&i().focus()}Tc((()=>{yu(y)&&z()}));var G=qb(),U=dc(G),$=e=>{var t=jb();nh(t,(e=>_=e),(()=>_)),Yu(e,t)};ad(U,(e=>{o()&&e($)}));var H=hc(U,2),q=e=>{var n=Hb(),i=uc(n),o=e=>{var r=Vb();ud(uc(r),(()=>t.left)),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yu(M)({class:yd(h?.left,yu(d).left)}))]),Yu(e,r)};ad(i,(e=>{t.left&&e(o)}));var a=hc(i,2);r(a,(()=>!0));var s=hc(a,2),l=e=>{var r=Gb();ud(uc(r),(()=>t.right)),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yu(E)({class:yd(h?.right,yu(d).right)}))]),Yu(e,r)};ad(s,(e=>{t.right&&e(l)}));var c=hc(s,2),u=e=>{var t=$b();Il(t,22,(()=>yu(L)),(e=>e),((e,t,r)=>{var n=Ub();n.__click=()=>V(t);var i=uc(n),o=uc(i,!0);Os(i),Os(n),Pc((e=>{wd(n,1,`w-full px-3 py-2 text-left ${yu(r)===yu(O)?"bg-gray-100 dark:bg-gray-700":"hover:bg-gray-50 dark:hover:bg-gray-700"} focus:outline-none`),wd(i,1,e),Ju(o,t)}),[()=>_d(yu(C)({class:yd(h?.comboItem,yu(d).comboItem)}
29))]),Nu("mouseenter",n,(()=>ql(O,yu(r),!0))),Yu(e,n)})),Os(t),Pc((e=>wd(t,1,e)),[()=>_d(yu(A)({class:yd(h?.combo,yu(d).combo)}))]),Yu(e,t)};ad(c,(e=>{yu(y)&&yu(R)&&yu(L).length>0&&e(u)})),Os(n),Pc((e=>wd(n,1,e)),[()=>_d(yu(T)({class:yd(h?.base,yu(d).div)}))]),Yu(e,n)},W=e=>{r(e,(()=>!1))};ad(H,(e=>{yu(y)||t.right||t.left||o()?e(q):e(W,!1)})),Yu(e,G),Ys()}Bu(["click"]);Mm({slots:{div:"absolute inset-y-0 start-0 top-0 flex items-center ps-3.5 pointer-events-none",svg:"w-4 h-4 text-gray-500 dark:text-gray-400",input:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 disabled:cursor-not-allowed disabled:opacity-50",span:"absolute start-0 bottom-3 text-gray-500 dark:text-gray-400",floatingInput:"block py-2.5 ps-6 pe-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-primary-500 focus:outline-none focus:ring-0 focus:border-primary-600 peer disabled:cursor-not-allowed disabled:opacity-50",label:"absolute text-sm text-gray-500 dark:text-gray-400 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:start-6 peer-focus:start-0 peer-focus:text-primary-600 peer-focus:dark:text-primary-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto"},variants:{phoneType:{default:{},floating:{svg:"w-4 h-4 rtl:rotate-[270deg]"},countryCode:{input:"rounded-none rounded-e-lg"},copy:{},advanced:{}},phoneIcon:{true:{input:"ps-10"},false:{}}}});qu('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 19 18"><path d="M18 13.446a3.02 3.02 0 0 0-.946-1.985l-1.4-1.4a3.054 3.054 0 0 0-4.218 0l-.7.7a.983.983 0 0 1-1.39 0l-2.1-2.1a.983.983 0 0 1 0-1.389l.7-.7a2.98 2.98 0 0 0 0-4.217l-1.4-1.4a2.824 2.824 0 0 0-4.218 0c-3.619 3.619-3 8.229 1.752 12.979C6.785 16.639 9.45 18 11.912 18a7.175 7.175 0 0 0 5.139-2.325A2.9 2.9 0 0 0 18 13.446Z"></path></svg>'),$u("<div><!></div>"),$u('<div class="relative"><!> <input/></div>'),$u("<span><!></span>"),$u('<div class="relative"><!> <input/> <label> </label></div>');Mm({slots:{input:"flex items-center w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 mr-2",label:"flex items-center"},variants:{color:{primary:{input:"text-primary-600 focus:ring-primary-500 dark:focus:ring-primary-600"},secondary:{input:"text-secondary-600 focus:ring-secondary-500 dark:focus:ring-secondary-600"},gray:{input:"text-gray-600 focus:ring-gray-500 dark:focus:ring-gray-600"},red:{input:"text-red-600 focus:ring-red-500 dark:focus:ring-red-600"},orange:{input:"text-orange-500 focus:ring-orange-500 dark:focus:ring-orange-600"},amber:{input:"text-amber-600 focus:ring-amber-500 dark:focus:ring-amber-600"},yellow:{input:"text-yellow-400 focus:ring-yellow-500 dark:focus:ring-yellow-600"},lime:{input:"text-lime-600 focus:ring-lime-500 dark:focus:ring-lime-600"},green:{input:"text-green-600 focus:ring-green-500 dark:focus:ring-green-600"},emerald:{input:"text-emerald-600 focus:ring-emerald-500 dark:focus:ring-emerald-600"},teal:{input:"text-teal-600 focus:ring-teal-500 dark:focus:ring-teal-600"},cyan:{input:"text-cyan-600 focus:ring-cyan-500 dark:focus:ring-cyan-600"},sky:{input:"text-sky-600 focus:ring-sky-500 dark:focus:ring-sky-600"},blue:{input:"text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600"},indigo:{input:"text-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600"},violet:{input:"text-violet-600 focus:ring-violet-500 dark:focus:ring-violet-600"},purple:{input:"text-purple-600 focus:ring-purple-500 dark:focus:ring-purple-600"},fuchsia:{input:"text-fuchsia-600 focus:ring-fuchsia-500 dark:focus:ring-fuchsia-600"},pink:{input:"text-pink-600 focus:ring-pink-500 dark:focus:ring-pink-600"},rose:{input:"text-rose-600 focus:ring-rose-500 dark:focus:ring-rose-600"}},tinted:{true:{input:"dark:bg-gray-600 dark:border-gray-500"},false:{input:"dark:bg-gray-700 dark:border-gray-600"}},custom:{true:{input:"sr-only peer"},false:{input:"relative"}}
29,inline:{true:{label:"inline-flex"},false:{label:"flex"}}},defaultVariants:{color:"primary"}}),Mm({base:"",variants:{inline:{true:"inline-flex",false:"flex"}},defaultVariants:{inline:!0}});$u("<input/> <!>",1);$u("<input/> <!>",1);Mm({base:"w-full bg-gray-200 rounded-lg cursor-pointer dark:bg-gray-700",variants:{size:{sm:"h-1 range-sm",md:"h-2",lg:"h-3 range-lg"},color:{gray:"",red:"",blue:"",indigo:"",violet:"",purple:"",fuchsia:"",pink:"",rose:""},appearance:{auto:"range accent-red-500",none:"appearance-none"}},compoundVariants:[{appearance:"auto",color:"gray",class:"accent-gray-500"},{appearance:"auto",color:"red",class:"accent-red-500"},{appearance:"auto",color:"blue",class:"accent-blue-500"},{appearance:"auto",color:"indigo",class:"accent-indigo-500"},{appearance:"auto",color:"violet",class:"accent-violet-500"},{appearance:"auto",color:"purple",class:"accent-purple-500"},{appearance:"auto",color:"fuchsia",class:"accent-fuchsia-500"},{appearance:"auto",color:"pink",class:"accent-pink-500"},{appearance:"auto",color:"rose",class:"accent-rose-500"}]});$u("<input/>");Mm({slots:{base:"relative w-full",left:"absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none",icon:"text-gray-500 dark:text-gray-400",content:"absolute inset-y-0 end-0 flex items-center text-gray-500 dark:text-gray-400",input:"block w-full text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 disabled:cursor-not-allowed disabled:opacity-50",close:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-black",svg:""},variants:{size:{sm:{input:"text-xs p-2 ps-9 pe-9 ",icon:"w-3 h-3"},md:{input:"text-sm p-2.5 ps-10 pe-10",icon:"w-4 h-4"},lg:{input:"sm:text-base p-3 ps-11 pe-11",icon:"w-6 h-6"}}},defaultVariants:{size:"lg"}});$u("<div><!></div>"),$u('<div><div><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"></path></svg></div> <input/> <!> <!></div>');Mm({slots:{base:"relative w-full",select:"block w-full rtl:text-right",close:"absolute right-8 top-1/2 -translate-y-1/2 text-gray-400 hover:text-black",svg:""},variants:{underline:{true:{select:"text-gray-500 bg-transparent rounded-none! border-0 border-b-2 border-gray-200 appearance-none dark:text-gray-400 dark:border-gray-700 focus:outline-hidden focus:ring-0 focus:border-gray-200 peer px-0!"},false:{select:"text-gray-900 bg-gray-50 border border-gray-300 focus:outline-hidden focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"}},size:{sm:{select:"text-xs px-2.5 py-2.5"},md:{select:"text-sm px-2.5 py-2.5"},lg:{select:"text-base py-3 px-4"}},disabled:{true:{select:"cursor-not-allowed opacity-50"},false:{}},grouped:{false:{base:"rounded-lg",select:"rounded-lg"},true:{base:"first:rounded-s-lg last:rounded-e-lg not-first:-ms-px group",select:"group-first:rounded-s-lg group-last:rounded-e-lg group-not-first:-ms-px h-full"}}},defaultVariants:{underline:!1,size:"md"}}),Mm({slots:{base:"relative border border-gray-300 w-full flex items-center gap-2 dark:border-gray-600 ring-primary-500 dark:ring-primary-500 focus-visible:outline-hidden",select:"",dropdown:"absolute z-50 p-3 flex flex-col gap-1 max-h-64 bg-white border border-gray-300 dark:bg-gray-700 dark:border-gray-600 start-0 top-[calc(100%+1rem)] rounded-lg cursor-pointer overflow-y-scroll w-full",item:"py-2 px-3 rounded-lg text-gray-600 hover:text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:text-gray-300 dark:hover:bg-gray-600",close:"p-0 focus:ring-gray-400 dark:text-white",span:"",placeholder:"text-gray-400",svg:"ms-1 h-3 w-3 cursor-pointer text-gray-800 dark:text-white"},variants:{size:{sm:"px-2.5 py-2.5 min-h-[2.4rem] text-xs",md:"px-2.5 py-2.5 min-h-[2.7rem] text-sm",lg:"px-3 py-3 min-h-[3.2rem] sm:text-base"},disabled:{true:{base:"cursor-not-allowed opacity-50 pointer-events-none",item:"cursor-not-allowed opacity-50",close:"cursor-not-allowed"},false:{base:"focus-within:border-primary-500 dark:focus-within:border-primary-500 focus-within:ring-1"}},active:{true:{item:"bg-primary-100 text-primary-500 dark:bg-primary-500 dark:text-primary-100 hover:bg-primary-100 dark:hover:bg-primary-500 hover:text-primary-600 dark:hover:text-primary-100"}},selected:{true:{item:"bg-gray-100 text-black font-semibold hover:text-black dark:text-white dark:bg-gray-600 dark:hover:text-white"}},grouped:{false:{base:"rounded-lg",select:"rounded-lg"},true:{base:"first:rounded-s-lg last:rounded-e-lg not-first:-ms-px group",select:"group-first:rounded-s-lg group-last:rounded-e-lg group-not-first:-ms-px h-full"}}},compoundVariants:[{selected:!0,active:!0,class:{item:"bg-primary-200 dark:bg-primary-600 text-primary-700 dark:text-primary-100 font-semibold"}}],defaultVariants:{underline:!1,size:"md"}});$u("<option disabled> </option>"),$u("<option> </option>"),$u("<div><select><!><!><!></select> <!></div>");$u("<option> </option>"),$u("<span> </span>"),$u('<div role="presentation"> </div>'),$u('<div role="presentation"></div>'),$u('<select hidden="" multiple></select> <div><!> <span><!></span> <div class="ms-auto flex items-center gap-2"><!> <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg></div> <!></div>',1);Bu(["change","click"]);const Zb=Mm({slots:{div:"relative",base:"block w-full text-sm border-0 px-0 bg-inherit dark:bg-inherit focus:outline-hidden focu
29s:ring-0 disabled:cursor-not-allowed disabled:opacity-50",wrapper:"text-sm rounded-lg bg-gray-50 dark:bg-gray-600 text-gray-900 dark:placeholder-gray-400 dark:text-white border border-gray-200 dark:border-gray-500 disabled:cursor-not-allowed disabled:opacity-50",inner:"py-2 px-4 bg-white dark:bg-gray-800",header:"py-2 px-3 border-gray-200 dark:border-gray-500",footer:"py-2 px-3 border-gray-200 dark:border-gray-500",addon:"absolute top-2 right-2 z-10",close:"absolute right-2 top-5 -translate-y-1/2 text-gray-400 hover:text-black",svg:""},variants:{wrapped:{false:{wrapper:"p-2.5 text-sm focus:outline-hidden focus:ring-primary-500 border-gray-300 focus:border-primary-500 dark:focus:ring-primary-500 dark:focus:border-primary-500 disabled:cursor-not-allowed disabled:opacity-50"}},hasHeader:{true:{header:"border-b"},false:{inner:"rounded-t-lg"}},hasFooter:{true:{footer:"border-t"},false:{inner:"rounded-b-lg"}}}});var Yb=$u("<textarea></textarea>"),Xb=$u("<div><!></div>"),Kb=$u("<div><!></div>"),Jb=$u("<div><!></div>"),Qb=$u("<div><!> <div><!> <textarea></textarea></div> <!></div>"),ex=$u("<div><!> <!></div>");Mm({slots:{span:"me-3 shrink-0 bg-gray-200 rounded-full peer-focus:ring-4 peer-checked:after:translate-x-full peer-checked:rtl:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:bg-white after:border-gray-300 after:border after:rounded-full after:transition-all dark:bg-gray-600 dark:border-gray-500 relative ",label:"flex items-center",input:"w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 rounded-sm dark:bg-gray-700 dark:border-gray-600 sr-only peer"},variants:{disabled:{true:{label:"cursor-not-allowed opacity-50"}},checked:{true:"",false:""},off_state_label:{true:{span:"ms-3"}},color:{primary:{span:"peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 peer-checked:bg-primary-600"},secondary:{span:"peer-focus:ring-secondary-300 dark:peer-focus:ring-secondary-800 peer-checked:bg-secondary-600"},gray:{span:"peer-focus:ring-gray-300 dark:peer-focus:ring-gray-800 peer-checked:bg-gray-500"},red:{span:"peer-focus:ring-red-300 dark:peer-focus:ring-red-800 peer-checked:bg-red-600"},orange:{span:"peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:bg-orange-500"},amber:{span:"peer-focus:ring-amber-300 dark:peer-focus:ring-amber-800 peer-checked:bg-amber-600"},yellow:{span:"peer-focus:ring-yellow-300 dark:peer-focus:ring-yellow-800 peer-checked:bg-yellow-400"},lime:{span:"peer-focus:ring-lime-300 dark:peer-focus:ring-lime-800 peer-checked:bg-lime-500"},green:{span:"peer-focus:ring-green-300 dark:peer-focus:ring-green-800 peer-checked:bg-green-600"},emerald:{span:"peer-focus:ring-emerald-300 dark:peer-focus:ring-emerald-800 peer-checked:bg-emerald-600"},teal:{span:"peer-focus:ring-teal-300 dark:peer-focus:ring-teal-800 peer-checked:bg-teal-600"},cyan:{span:"peer-focus:ring-cyan-300 dark:peer-focus:ring-cyan-800 peer-checked:bg-cyan-600"},sky:{span:"peer-focus:ring-sky-300 dark:peer-focus:ring-sky-800 peer-checked:bg-sky-600"},blue:{span:"peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 peer-checked:bg-blue-600"},indigo:{span:"peer-focus:ring-indigo-300 dark:peer-focus:ring-indigo-800 peer-checked:bg-indigo-600"},violet:{span:"peer-focus:ring-violet-300 dark:peer-focus:ring-violet-800 peer-checked:bg-violet-600"},purple:{span:"peer-focus:ring-purple-300 dark:peer-focus:ring-purple-800 peer-checked:bg-purple-600"},fuchsia:{span:"peer-focus:ring-fuchsia-300 dark:peer-focus:ring-fuchsia-800 peer-checked:bg-fuchsia-600"},pink:{span:"peer-focus:ring-pink-300 dark:peer-focus:ring-pink-800 peer-checked:bg-pink-600"},rose:{span:"peer-focus:ring-rose-300 dark:peer-focus:ring-rose-800 peer-checked:bg-rose-600"}},size:{small:{span:"w-9 h-5 after:top-[2px] after:start-[2px] after:h-4 after:w-4"},default:{span:"w-11 h-6 after:top-0.5 after:start-[2px] after:h-5 after:w-5"},large:{span:"w-14 h-7 after:top-0.5 after:start-[4px]  after:h-6 after:w-6"}}},defaultVariants:{color:"primary"}});$u("<!> <input/> <span></span> <!>",1);Mm({slots:{buttonGroup:"inline-flex rounded-lg shadow-sm relative",input:"block disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right focus:ring-0 focus:outline-none",inputWithIcon:"relative px-2 pr-8",iconWrapper:"pointer-events-none absolute inset-y-0 end-0 top-0 flex items-center pe-3.5",icon:"h-4 w-4 text-gray-500 dark:text-gray-400",select:"text-gray-900 disabled:text-gray-400 bg-gray-50 border border-gray-300 focus:ring-0 focus:outline-none block w-full border-l-1 focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:disabled:text-gray-500 dark:focus:ring-primary-500 dark:focus:border-primary-500",button:"!rou
29nded-r-lg",buttonIcon:"ml-2 h-4 w-4",rangeSeparator:"flex items-center justify-center px-2 text-gray-500 dark:text-gray-400",rangeInputWrapper:"relative",rangeInput:"relative pr-8",rangeButton:"pointer-events-none absolute inset-y-0 top-0 right-0 flex items-center border-0 bg-transparent pe-3.5",dropdownContent:"p-4 last:rounded-r-lg",dropdownInner:"flex flex-col space-y-4",dropdownTimeRow:"flex space-x-4",dropdownTimeCol:"flex flex-col",dropdownTimeInput:"w-24 rounded-l-lg !border-r px-2",dropdownButton:"w-full !rounded-l-lg",toggleWrapper:"flex w-full flex-col space-y-2",toggleRow:"flex items-center justify-between",toggleTimeRow:"flex space-x-4 p-2.5",toggleTimeCol:"flex flex-col",toggleTimeInput:"w-24 rounded-lg !border-r px-2",inlineGrid:"grid w-full gap-2",inlineButton:"rounded-lg"},variants:{type:{default:{input:"rounded-e-lg"},select:{input:"w-1/3 rounded-l-lg rounded-e-none",select:"rounded-r-lg rounded-l-none"},dropdown:{input:"rounded-l-lg rounded-e-none"},range:{},"timerange-dropdown":{},"timerange-toggle":{},"inline-buttons":{}},columns:{1:{inlineGrid:"grid-cols-1"},2:{inlineGrid:"grid-cols-2"},3:{inlineGrid:"grid-cols-3"},4:{inlineGrid:"grid-cols-4"}},disabled:{true:{input:"disabled:cursor-not-allowed disabled:opacity-50"}}},defaultVariants:{type:"default",columns:2,disabled:!1}});qu('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"></path></svg>'),$u("<!> <div><!></div>",1),$u("<!> <!>",1),qu(' <svg aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>',1),$u("<!> <!> <!>",1),qu('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"></path></svg>'),qu('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6v4l3.276 3.276M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"></path></svg>'),$u('<div><!> <button type="button" aria-label="Open time picker"><!></button></div> <span>-</span> <div><!> <button type="button" aria-label="Open end time picker"><!></button></div>',1),qu(' <svg aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>',1),$u("<div><div><div><!> <!></div> <div><!> <!></div></div> <!></div>"),$u("<!> <!>",1),$u("<div><div><!> <!></div> <div><!> <!></div></div>"),$u("<div><div><!></div> <!></div>"),$u("<div></div>");Bu(["click"]);Mm({base:"inline-flex items-center hover:underline",variants:{color:{primary:"text-primary-600 dark:text-primary-500",secondary:"text-secondary-600 dark:text-secondary-500",gray:"text-gray-600 dark:text-gray-500",red:"text-red-600 dark:text-red-500",orange:"text-orange-600 dark:text-orange-500",amber:"text-amber-600 dark:text-amber-500",yellow:"text-yellow-600 dark:text-yellow-500",lime:"text-lime-600 dark:text-lime-500",green:"text-green-600 dark:text-green-500",emerald:"text-emerald-600 dark:text-emerald-500",teal:"text-teal-600 dark:text-teal-500",cyan:"text-cyan-600 dark:text-cyan-500",sky:"text-sky-600 dark:text-sky-500",blue:"text-blue-600 dark:text-blue-500",indigo:"text-indigo-600 dark:text-indigo-500",violet:"text-violet-600 dark:text-violet-500",purple:"text-purple-600 dark:text-purple-500",fuchsia:"text-fuchsia-600 dark:text-fuchsia-500",pink:"text-pink-600 dark:text-pink-500",rose:"text-rose-600 dar
29k:text-rose-500"}}});$u("<button><!></button>"),$u("<a><!></a>");Mm({base:"font-semibold text-gray-900 dark:text-white",variants:{border:{true:"border-s-4 border-gray-300 dark:border-gray-500",false:""},italic:{true:"italic",false:""},bg:{true:"bg-gray-50 dark:bg-gray-800",false:""},alignment:{left:"text-left",center:"text-center",right:"text-right"},size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl","6xl":"text-6xl","7xl":"text-7xl","8xl":"text-8xl","9xl":"text-9xl"}},defaultVariants:{border:!1,italic:!0,bg:!1,alignment:"left",size:"lg"}});$u("<blockquote><!></blockquote>");Mm({variants:{tag:{dt:"text-gray-500 md:text-lg dark:text-gray-400",dd:"text-lg font-semibold"}},defaultVariants:{tag:"dt"}});Mm({base:"font-bold text-gray-900 dark:text-white",variants:{tag:{h1:"text-5xl font-extrabold",h2:"text-4xl",h3:"text-3xl",h4:"text-2xl",h5:"text-xl",h6:"text-lg"}},defaultVariants:{tag:"h1"}});Mm({slots:{base:"h-px my-8 border-0",div:"inline-flex items-center justify-center w-full",content:"absolute px-4 -translate-x-1/2 rtl:translate-x-1/2 bg-white start-1/2 dark:bg-gray-900",bg:""},variants:{withChildren:{true:{base:"w-full",div:"relative"}}},defaultVariants:{withChildren:!1}});$u("<div><hr/> <div><!></div></div>"),$u("<hr/>");Mm({slots:{base:"max-w-full h-auto",figure:"",caption:"mt-2 text-sm text-center text-gray-500 dark:text-gray-400"},variants:{size:{xs:{base:"max-w-xs",figure:"max-w-xs"},sm:{base:"max-w-sm",figure:"max-w-sm"},md:{base:"max-w-md",figure:"max-w-md"},lg:{base:"max-w-lg",figure:"max-w-lg"},xl:{base:"max-w-xl",figure:"max-w-xl"},"2xl":{base:"max-w-2xl",figure:"max-w-2xl"},full:{base:"max-w-full",figure:"max-w-full"}},effect:{grayscale:{base:"cursor-pointer rounded-lg grayscale filter transition-all duration-300 hover:grayscale-0"},blur:{base:"blur-xs transition-all duration-300 hover:blur-none"},invert:{base:"invert filter transition-all duration-300 hover:invert-0"},sepia:{base:"sepia filter transition-all duration-300 hover:sepia-0"},saturate:{base:"saturate-50 filter transition-all duration-300 hover:saturate-100"},"hue-rotate":{base:"hue-rotate-60 filter transition-all duration-300 hover:hue-rotate-0"}},align:{left:{base:"mx-0",figure:"mx-0"},center:{base:"mx-auto",figure:"mx-auto"},right:{base:"ml-auto mr-0",figure:"ml-auto mr-0"}}}});$u("<img/>"),$u("<figure><!> <figcaption><!></figcaption></figure>"),$u("<img/>"),$u("<a><!></a>");Mm({base:"grid grid-cols-1 sm:grid-cols-2"});$u("<div><!></div>");Mm({base:"",variants:{tag:{ul:"list-disc",dl:"[&>*]:list-none list-none",ol:"list-decimal"},position:{inside:"list-inside",outside:"list-outside"}},defaultVariants:{position:"inside",tag:"ul"}});$u("<li><!></li>");Mm({base:"text-white dark:bg-blue-500 bg-blue-600 px-2 rounded-sm"});$u("<mark><!></mark>");Mm({base:"text-gray-900 dark:text-white",variants:{size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl","6xl":"text-6xl","7xl":"text-7xl","8xl":"text-8xl","9xl":"text-9xl"},weight:{thin:"font-thin",extralight:"font-extralight",light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extrabold:"font-extrabold",black:"font-black"},space:{tighter:"tracking-tighter",tight:"tracking-tight",normal:"tracking-normal",wide:"tracking-wide",wider:"tracking-wider",widest:"tracking-widest"},height:{none:"leading-none",tight:"leading-tight",snug:"leading-snug",normal:"leading-normal",relaxed:"leading-relaxed",loose:"leading-loose",3:"leading-3",4:"leading-4",5:"leading-5",6:"leading-6",7:"leading-7",8:"leading-8",9:"leading-9",10:"leading-10"},align:{left:"text-left",center:"text-center",right:"text-right"},whitespace:{normal:"whitespace-normal",nowrap:"whitespace-nowrap",pre:"whitespace-pre",preline:"whitespace-pre-line",prewrap:"whitespace-pre-wrap"},italic:{true:"italic"},firstUpper:{true:"first-line:uppercase first-line:tracking-widest first-letter:text-7xl first-letter:font-bold first-letter:text-gray-900 dark:first-letter:text-gray-100 first-letter:me-3 first-letter:float-left",false:""}
29,justify:{true:"text-justify",false:""}}});$u("<p><!></p>");Mm({base:"text-gray-500 dark:text-gray-400 font-semibold"});$u("<small><!></small>");Mm({variants:{italic:{true:"italic"},underline:{true:"underline decoration-2 decoration-blue-400 dark:decoration-blue-600"},linethrough:{true:"line-through"},uppercase:{true:"uppercase"},gradient:{skyToEmerald:"text-transparent bg-clip-text bg-linear-to-r to-emerald-600 from-sky-400",purpleToBlue:"text-transparent bg-clip-text bg-linear-to-r from-purple-500 to-blue-500",pinkToOrange:"text-transparent bg-clip-text bg-linear-to-r from-pink-500 to-orange-400",tealToLime:"text-transparent bg-clip-text bg-linear-to-r from-teal-400 to-lime-300",redToYellow:"text-transparent bg-clip-text bg-linear-to-r from-red-600 to-yellow-500",indigoToCyan:"text-transparent bg-clip-text bg-linear-to-r from-indigo-600 to-cyan-400",fuchsiaToRose:"text-transparent bg-clip-text bg-linear-to-r from-fuchsia-500 to-rose-500",amberToEmerald:"text-transparent bg-clip-text bg-linear-to-r from-amber-400 to-emerald-500",violetToRed:"text-transparent bg-clip-text bg-linear-to-r from-violet-600 to-red-500",blueToGreen:"text-transparent bg-clip-text bg-linear-to-r from-blue-400 via-teal-500 to-green-400",orangeToPurple:"text-transparent bg-clip-text bg-linear-to-r from-orange-400 via-pink-500 to-purple-500",yellowToRed:"text-transparent bg-clip-text bg-linear-to-r from-yellow-200 via-indigo-400 to-red-600",none:""},highlight:{blue:"text-blue-600 dark:text-blue-500",green:"text-green-600 dark:text-green-500",red:"text-red-600 dark:text-red-500",yellow:"text-yellow-600 dark:text-yellow-500",purple:"text-purple-600 dark:text-purple-500",pink:"text-pink-600 dark:text-pink-500",indigo:"text-indigo-600 dark:text-indigo-500",teal:"text-teal-600 dark:text-teal-500",orange:"text-orange-600 dark:text-orange-500",cyan:"text-cyan-600 dark:text-cyan-500",fuchsia:"text-fuchsia-600 dark:text-fuchsia-500",amber:"text-amber-600 dark:text-amber-500",lime:"text-lime-600 dark:text-lime-500",none:""},decoration:{solid:"underline decoratio-solid",double:"underline decoration-double",dotted:"underline decoration-dotted",dashed:"underline decoration-dashed",wavy:"underline decoration-wavy",none:"decoration-none"},decorationColor:{primary:"underline decoration-primary-400 dark:decoration-primary-600",secondary:"underline decoration-secondary-400 dark:decoration-secondary-600",gray:"underline decoration-gray-400 dark:decoration-gray-600",orange:"underline decoration-orange-400 dark:decoration-orange-600",red:"underline decoration-red-400 dark:decoration-red-600",yellow:"underline decoration-yellow-400 dark:decoration-yellow-600",lime:"underline decoration-lime-400 dark:decoration-lime-600",green:"underline decoration-green-400 dark:decoration-green-600",emerald:"underline decoration-emerald-400 dark:decoration-emerald-600",teal:"underline decoration-teal-400 dark:decoration-teal-600",cyan:"underline decoration-cyan-400 dark:decoration-cyan-600",sky:"underline decoration-sky-400 dark:decoration-sky-600",blue:"underline decoration-blue-400 dark:decoration-blue-600",indigo:"underline decoration-indigo-400 dark:decoration-indigo-600",violet:"underline decoration-violet-400 dark:decoration-violet-600",purple:"underline decoration-purple-400 dark:decoration-purple-600",fuchsia:"underline decoration-fuchsia-400 dark:decoration-fuchsia-600",pink:"underline decoration-pink-400 dark:decoration-pink-600",rose:"underline decoration-rose-400 dark:decoration-rose-600",none:"decoration-none"},decorationThickness:{1:"underline decoration-1",2:"underline decoration-2",4:"underline decoration-4",8:"underline decoration-8",0:"decoration-0"}}});$u("<span><!></span>");Mm({base:"inline-flex border border-gray-300 overflow-hidden",variants:{roundedSize:{sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"}}}),Mm({slots:{button:"relative flex items-center transition-all duration-200 focus:outline-none border-r last:border-r-0 dark:bg-white dark:text-gray-800 disabled:cursor-not-allowed disabled:opacity-50",content:"flex items-center w-full overflow-hidden relative",text:"transition-all duration-200 ml-0",icon:"absolute left-0 flex-shrink-0 text-green-600"},variants:{selected:{true:{text:"ml-5"},false:{}},size:{sm:{button:"p-1 px-2 text-sm"},md:{button:"p-2 px-4 text-base"},lg:{button:"p-3 px-5 text-lg"},xl:{button:"p-4 px-6 text-xl"}},roundedSize:{sm:{button:"first:rounded-s-sm last:rounded-e-sm"},md:{button:"first:rounded-s-md last:rounded-e-md"},lg:{button:"first:rounded-s-lg last:rounded-e-lg"},xl:{button:"first:rounded-s-xl last:rounded-e-xl"},full:{button:"first:rounded-s-full last:rounded-e-full"}},color:{primary:{button:"data-[selected=true]:bg-primary-200 data-[selected=false]:hover:bg-gray-100"},secondary:{button:"data-[selected=true]:bg-secondary-200 data-[selected=false]:hover:bg-gray-100"},gray:{button:"data-[selected=true]:bg-gray-200 data-[selected=false]:hover:bg-gray-100"},red:{button:"data-[selected=true]:bg-red-200 data-[selected=false]:hover:bg-red-50"},orange:{button:"data-[selected=true]:bg-orange-200 data-[selected=false]:hover:bg-orange-50"},amber:{button:"data-[selected=true]:bg-amber-200 data-[selected=false]:hover:bg-amber-50"},yellow:{button:"data-[selected=true]:bg-yellow-200 data-[selected=false]:hover:bg-yellow-50"},lime:{button:"data-[selected=true]:bg-lime-200 data-[selected=false]:hover:bg-lime-50"},green:{button:"data-[selected=true]:bg-green-200 data-[selected=false]:hover:bg-green-50"},emerald:{button:"data-[selected=true]:bg-emerald-200 data-[selected=false]:hover:bg-emerald-50"},teal:{button:"data-[selected=true]:bg-teal-200 data-[selected=false]:hover:bg-teal-50"},cyan:{button:"data-[selected=true]:bg-cyan-200 data-[selected=false]:hover:bg-cyan-50"},sky:{button:"data-[selected=true]:bg-sky-200 data-[selected=false]:hover:bg-sky-50"},blue:{button:"data-[selected=true]:bg-blue-200 data-[selected=false]:hover:bg-blue-50"},indigo:{button:"data-[selected=true]:bg-indigo-200 data-[selected=false]:hover:bg-indigo-50"},violet:{button:"data-[selected=true]:bg-violet-200 data-[selected=false]:hover:bg-violet-50"},purple:{button:"data-[selected=true]:bg-purple-200 data-[selected=false]:hover:bg-purple-50"},fuchsia:{button:"data-[selected=true]:bg-fuchsia-200 data-[selected=false]:hover:bg-fuchsia-50"},pink:{button:"data-[selected=true]:bg-pink-200 data-[selected=false]:hover:bg-pink-50"},rose:{button:"data-[selected=true]:bg-rose-200 data-[selected=false]:hover:bg-rose-50"},none:{}}},defaultVariants:{selected:!1,color:"primary",size:"md",roundedSize:"md"}});$u('<div class="inline"><div><!></div></div>');
29qu('<svg><polyline points="20 6 9 17 4 12"></polyline></svg>');$u("<button><div><!> <span><!></span></div></button>");Mm({slots:{base:"relative max-w-2xl mx-auto p-4 space-y-4",inputSection:"space-y-2",inputWrapper:"flex gap-2",input:"flex-1 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-blue-500 dark:text-white",searchWrapper:"flex gap-2",searchContainer:"relative flex-1",searchInput:"w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 pl-9 pr-3 py-2 text-sm outline-none focus:ring-2 focus:ring-blue-500 dark:text-white",searchIcon:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400",itemsList:"space-y-2 max-h-[500px] overflow-y-auto",emptyState:"text-center py-8",emptyIcon:"w-12 h-12 mx-auto text-gray-300 dark:text-gray-600 mb-3",emptyText:"text-sm text-gray-500 dark:text-gray-400",emptySubtext:"text-xs text-gray-400 dark:text-gray-500 mt-1",item:"group flex items-start gap-3 rounded-lg border border-gray-200 dark:border-gray-700 p-3 transition hover:bg-gray-50 dark:hover:bg-gray-800/50",itemContent:"flex-1 min-w-0",itemHeader:"flex items-center gap-2 mb-1",itemTimestamp:"text-xs text-gray-500 dark:text-gray-400",itemText:"text-sm text-gray-900 dark:text-gray-100 break-words line-clamp-2",itemActions:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",actionButton:"p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition flex items-center justify-center",actionIcon:"w-4 h-4 flex-shrink-0",pinButton:"p-1.5 rounded transition",deleteButton:"p-1.5 rounded text-red-500 hover:bg-red-100 dark:hover:bg-red-900/20 transition",toastContainer:"fixed top-4 left-1/2 -translate-x-1/2 z-50 animate-[slideIn_0.2s_ease-out]",toast:"flex items-center gap-2 px-4 py-2 rounded-lg shadow-lg",toastIcon:"w-5 h-5",toastText:"text-sm font-medium",addToClipboard:"whitespace-nowrap rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:opacity-50",clearAll:"rounded bg-red-600 px-4 py-2 text-white hover:bg-red-700",selectionMenu:"selection-menu fixed z-50 -translate-x-1/2 -translate-y-full",selectionBubble:"mb-2 flex items-center gap-2 rounded-lg bg-gray-900 px-3 py-2 text-white shadow-xl",selectionText:"max-w-[200px] truncate text-xs",selectionButton:"rounded bg-primary-700 px-2 py-1 text-xs font-medium whitespace-nowrap transition hover:bg-primary-500",selectionArrow:"absolute bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 bg-gray-900"},variants:{pinned:{true:{pinButton:"text-blue-600 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/20"},false:{pinButton:"hover:bg-gray-200 dark:hover:bg-gray-700"}},type:{success:{toast:"bg-green-500 text-white"},error:{toast:"bg-red-500 text-white"},info:{toast:"bg-blue-500 text-white"}}},defaultVariants:{pinned:!1,type:"success"}}),Mm({slots:{base:"w-full mx-auto mt-20 max-w-2xl bg-white dark:bg-gray-800 rounded-lg shadow-2xl ring-1 ring-black/5 dark:ring-white/10 overflow-hidden transform transition-all",search:"rounded-b-none border-0 py-3",list:"max-h-80 scroll-py-2 overflow-y-auto border-t border-gray-200 dark:border-gray-700",item:"cursor-pointer select-none px-4 py-2 text-sm text-gray-900 dark:text-gray-100 aria-selected:bg-primary-600 aria-selected:text-white",itemDescription:"text-xs truncate text-gray-500 dark:text-gray-400 aria-selected:text-primary-100",empty:"px-4 py-14 text-center border-t border-gray-200 dark:border-gray-700 text-sm text-gray-500 dark:text-gray-400",footer
29:"flex flex-wrap items-center justify-between gap-2 bg-gray-50 dark:bg-gray-900/50 px-4 py-2.5 text-xs text-gray-500 dark:text-gray-400 border-t border-gray-200 dark:border-gray-700",kbd:"inline-flex items-center gap-1 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-2 py-1 font-sans text-xs"},variants:{selected:{true:{}}},defaultVariants:{}}),Mm({slots:{container:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3 md:gap-4 p-2 md:p-4",column:"w-full rounded-xl shadow-sm p-3 md:p-4 flex flex-col bg-surface-elevated text-surface-foreground transition-colors",columnTitle:"text-sm md:text-base font-semibold mb-2 md:mb-3 dark:text-white",cardList:"flex flex-col gap-2 flex-1 min-h-[60px]",card:"bg-surface text-surface-foreground rounded-lg p-2.5 md:p-3 shadow-sm cursor-grab active:cursor-grabbing transition-all hover:bg-surface-hover hover:shadow-md",cardTitle:"font-medium text-sm md:text-base",cardDescription:"text-xs md:text-sm text-muted mt-1",cardTags:"flex flex-wrap gap-1 mt-2",cardTag:"text-[10px] md:text-xs bg-primary/10 text-primary px-1.5 md:px-2 py-0.5 rounded-full",addButton:"mt-2 md:mt-3 w-full bg-primary text-primary-foreground rounded-lg py-1.5 text-xs md:text-sm dark:text-primary-500 font-medium hover:bg-primary/90 transition-colors focus:ring-2 focus:ring-primary focus:ring-offset-2"},variants:{isDragOver:{true:{column:"ring-2 ring-primary"}},isDragging:{true:{card:"opacity-50"}}}}),Mm({slots:{card:"bg-surface text-surface-foreground rounded-lg p-2.5 md:p-3 shadow-sm shadow-black/20 dark:shadow-white/10 cursor-grab active:cursor-grabbing transition-all hover:bg-surface-hover hover:shadow-md",cardTitle:"font-medium text-sm md:text-base dark:text-white",cardDescription:"text-xs md:text-sm text-muted mt-1 dark:text-white",cardTags:"flex flex-wrap gap-1 mt-2 dark:text-white",cardTag:"text-[10px] md:text-xs bg-primary/10 text-primary px-1.5 md:px-2 py-0.5 rounded-full dark:text-white"},variants:{isDragging:{true:{card:"opacity-50"}}}}),Mm({slots:{base:"bg-white dark:bg-gray-900 p-2 transition-all duration-300 z-40 border-b border-gray-200 dark:border-gray-700",container:"",list:"",link:"px-4 py-2.5 transition-all duration-200 cursor-pointer rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-900",li:"p-2 m-1"},variants:{position:{top:{base:"top-0 left-0 right-0 w-full",container:"container mx-auto px-4",list:"flex space-x-1 overflow-x-auto scrollbar-none"},left:{base:"fixed left-0 top-0 bottom-0 h-full w-64 overflow-y-auto",container:"px-4 py-4",list:"flex flex-col space-y-1"},right:{base:"fixed right-0 top-0 bottom-0 h-full w-64 overflow-y-auto",container:"px-4 py-4",list:"flex flex-col space-y-1"}},sticky:{true:{base:""},false:{base:""}},isSticky:{true:{base:"shadow-lg"},false:{base:""}},active:{true:{link:"text-primary-700 dark:text-primary-400 bg-primary-50 dark:bg-primary-900/30 font-semibold focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-900"},false:{link:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800"}}},defaultVariants:{position:"top",sticky:!0,isSticky:!1,active:!1},compoundVariants:[{position:"top",sticky:!0,class:{base:"sticky"}}]}),Mm({base:"relative flex h-full w-full overflow-hidden select-none",variants:{direction:{horizontal:"",vertical:"flex-col"}},defaultVariants:{direction:"horizontal"}}),Mm({base:"flex flex-col relative overflow-hidden shrink-0 min-w-0 min-h-0"}),Mm({base:"bg-gray-300 shrink-0 relative z-10 transition-colors duration-200 hover:bg-gray-400 focus:bg-gray-400 focus:outline focus:outline-2 focus:outline-blue-500 focus:-outline-offset-2",variants:{direction:{horizontal:"w-1 cursor-col-resize",vertical:"h-1 cursor-row-resize"},isDragging:{true:"bg-blue-500",false:""}},defaultVariants:{direction:"horizontal",isDragging:!1}}),Mm({base:"absolute bg-transparent",variants:{direction:{horizontal:"w-3 h-full -left-1 top-0",vertical:"h-3 w-full -top-1 left-0"}},defaultVariants:{direction:"horizontal"}}),Mm({slots:{base:"space-y-2 dark:text-white",label:"text-base font-semibold",container:"flex w-full justify-between gap-2",wrapper:"relative h-full w-full",step:"h-full w-full rounded-xs",glow:"absolute -inset-1 rounded-xs opacity-30 blur-sm dark:opacity-25",incomplete:"h-full w-full rounded-xs bg-gray-200 dark:bg-gray-700"},variants:{size:{xs:{container:"h-1.5"},sm:{container:"h-2"},md:{container:"h-2.5"},lg:{container:"h-3"},xl:{container:"h-4"}}
29,color:{primary:{step:"data-[state=completed]:bg-primary-500 data-[state=completed]:dark:bg-primary-900 data-[state=current]:bg-primary-800 data-[state=current]:dark:bg-primary-400",glow:"bg-primary-800 dark:bg-primary-400"},secondary:{step:"data-[state=completed]:bg-secondary-500 data-[state=completed]:dark:bg-secondary-900 data-[state=current]:bg-secondary-800 data-[state=current]:dark:bg-secondary-400",glow:"bg-secondary-800 dark:bg-secondary-400"},gray:{step:"data-[state=completed]:bg-gray-400 data-[state=completed]:dark:bg-gray-500 data-[state=current]:bg-gray-700 data-[state=current]:dark:bg-gray-200",glow:"bg-gray-700 dark:bg-gray-200"},red:{step:"data-[state=completed]:bg-red-600 data-[state=completed]:dark:bg-red-900 data-[state=current]:bg-red-900 data-[state=current]:dark:bg-red-500",glow:"bg-red-900 dark:bg-red-500"},yellow:{step:"data-[state=completed]:bg-yellow-400 data-[state=completed]:dark:bg-yellow-600 data-[state=current]:bg-yellow-600 data-[state=current]:dark:bg-yellow-400",glow:"bg-yellow-600 dark:bg-yellow-400"},green:{step:"data-[state=completed]:bg-green-500 data-[state=completed]:dark:bg-green-900 data-[state=current]:bg-green-800 data-[state=current]:dark:bg-green-400",glow:"bg-green-800 dark:bg-green-400"},indigo:{step:"data-[state=completed]:bg-indigo-500 data-[state=completed]:dark:bg-indigo-900 data-[state=current]:bg-indigo-800 data-[state=current]:dark:bg-indigo-400",glow:"bg-indigo-800 dark:bg-indigo-400"},purple:{step:"data-[state=completed]:bg-purple-500 data-[state=completed]:dark:bg-purple-900 data-[state=current]:bg-purple-800 data-[state=current]:dark:bg-purple-400",glow:"bg-purple-800 dark:bg-purple-400"},pink:{step:"data-[state=completed]:bg-pink-500 data-[state=completed]:dark:bg-pink-900 data-[state=current]:bg-pink-800 data-[state=current]:dark:bg-pink-400",glow:"bg-pink-800 dark:bg-pink-400"},blue:{step:"data-[state=completed]:bg-blue-500 data-[state=completed]:dark:bg-blue-900 data-[state=current]:bg-blue-800 data-[state=current]:dark:bg-blue-400",glow:"bg-blue-800 dark:bg-blue-400"},custom:{step:"",glow:""}},glow:{true:{},false:{}},hideLabel:{true:{},false:{}}},compoundVariants:[{glow:!1,class:{glow:"hidden"}},{hideLabel:!0,class:{label:"hidden"}}],defaultVariants:{size:"md",color:"primary",glow:!1,hideLabel:!1}});$u("<h3> </h3>"),$u("<div></div>"),$u('<div><div data-state="current"></div> <!></div>'),$u('<div data-state="completed"></div>'),$u('<div data-state="incomplete"></div>'),$u("<div><!> <div></div></div>");Mm({slots:{base:"border border-gray-300 dark:border-gray-600 rounded-lg flex focus-within:ring-primary-500 focus-within:ring-1 focus-within:border-primary-500 scrollbar-hidden bg-gray-50 dark:bg-gray-700",tag:"flex items-center rounded-lg bg-gray-100 text-gray-900 border border-gray-300 my-1 ml-1 px-2 text-sm max-w-full min-w-fit",span:"items-center",close:"my-auto ml-1",input:"block text-sm m-2.5 p-0 bg-transparent border-none outline-none text-gray-900 h-min w-full min-w-fit focus:ring-0 placeholder-gray-400 dark:text-white disabled:cursor-not-allowed disabled:opacity-50",info:"mt-1 text-sm text-blue-500 dark:text-blue-400",warning:"mt-1 text-sm text-yellow-400 dark:text-yellow-300",error:"mt-1 text-sm text-red-500 dark:text-red-400"}});$u("<div><span> </span> <!></div>"),$u('<li><button type="button" class="block w-full cursor-pointer px-3 py-2 text-left hover:bg-gray-100"> </button></li>'),$u('<ul class="z-10 max-h-48 w-full overflow-auto rounded border border-gray-300 bg-white shadow" style="position: absolute;"></ul>'),$u('<!> <!> <!> <div><!> <div class="relative w-full"><input/> <!></div></div>',1);Bu(["click"]);Mm({slots:{overlay:"fixed inset-0 bg-black/50 backdrop-blur-sm",highlight:["fixed border-2 pointer-events-none transition-all duration-300","border-blue-500","shadow-[0_0_0_4px_rgba(59,130,246,0.2)]"],tooltip:["fixed bg-white rounded-xl shadow-2xl","w-80 max-w-[calc(100vw-2rem)]"],arrow:"absolute w-2 h-2 rotate-45 bg-white",content:"p-5 relative z-10 bg-white rounded-xl",title:"text-lg font-semibold text-gray-900 mb-3",description:"text-sm leading-relaxed text-gray-600 mb-4",progressContainer:"flex gap-2 justify-center",progressDot:["w-2 h-2 rounded-full bg-gray-300","hover:bg-gray-400 transition-all duration-200 hover:scale-110"],progressDotActive:"!bg-blue-500 !w-6 rounded",actions:["flex justify-between items-center px-5 py-4","border-t border-gray-200 relative z-10 bg-white rounded-b-xl"],navigation:"flex gap-2",button:["px-4 py-2 rounded-md text-sm font-medium","transition-all duration-200"],buttonPrimary:["text-white bg-blue-500 hover:bg-blue-600"],buttonSecondary:["text-gray-600 border border-gray-300","hover:bg-gray-50 hover:border-gray-400"]},variants:{size:{sm:{tooltip:"w-64",content:"p-4",actions:"px-4 py-3",title:"text-base",description:"text-xs",button:"px-3 py-1.5 text-xs"},md:{tooltip:"w-80",content:"p-5",actions:"px-5 py-4",title:"text-lg",description:"text-sm",button:"px-4 py-2 text-sm"},lg:{tooltip:"w-96",content:"p-6",actions:"px-6 py-5",title:"text-xl",description:"text-base",button:"px-5 py-2.5 text-base"}},color:{primary:{highlight:"border-primary-500 shadow-[0_0_0_4px_rgba(59,130,246,0.2)]",progressDotActive:"!bg-primary-500",buttonPrimary:"bg-primary-500 hover:bg-primary-600"},blue:{highlight:"border-blue-500 shadow-[0_0_0_4px_rgba(59,130,246,0.2)]",progressDotActive:"!bg-blue-500",buttonPrimary:"bg-blue-500 hover:bg-blue-600"},purple:{highlight:"border-purple-500 shadow-[0_0_0_4px_rgba(168,85,247,0.2)]",progressDotActive:"!bg-purple-500",buttonPrimary:"bg-purple-500 hover:bg-purple-600"},green:{highlight:"border-green-500 shadow-[0_0_0_4px_rgba(34,197,94,0.2)]",progressDotActive:"!bg-green-500",buttonPrimary:"bg-green-500 hover:bg-green-600"},red:{highlight:"border-red-500 shadow-[0_0_0_4px_rgba(239,68,68,0.2)]",progressDotActive:"!bg-red-500",buttonPrimary:"bg-red-500 hover:bg-red-600"}}},defaultVariants:{size:"md",color:"blue"}}),Mm({slots:{container:"overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent",spacer:"relative",content:"absolute top-0 left-0 right-0",item:""},variants:{contained:{true:{item:"[contain:layout_style_paint]"},false:{}}},defaultVariants:{contained:!1}
29});$u('<div role="listitem"><!></div>'),$u('<div role="list"><div><div></div></div></div>');Mm({slots:{container:"overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent",spacer:"relative",content:"relative w-full",item:""},variants:{contained:{true:{item:"[contain:layout_style_paint]"},false:{}}},defaultVariants:{contained:!1}});$u('<video><source/> <!> <track kind="captions"/> Your browser does not support the video tag.</video>',2);$u("<div><!></div>");$u('<div><div><input type="text" placeholder="Search clipboard..."/> <svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg></div> <button> </button></div>'),$u('<div><div><input type="text"/> <button> </button></div> <!></div>'),$u('<div><div><div><input type="text" placeholder="Search clipboard..."/> <svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg></div> <button> </button></div></div>'),$u('<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg> <p>No clipboard items yet.</p> <p><!></p>',1),$u("<p> </p>"),$u("<div><!></div>"),$u('<div><div><div><!> <span> </span></div> <p> </p></div> <div><button aria-label="Copy"><svg fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><rect width="8" height="8" x="8" y="8" rx="2" ry="2"></rect><path d="M4 12V4a2 2 0 0 1 2-2h8"></path></svg></button> <button><svg fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M12 17v5"></path><path d="M8 13h8l1-5h-10z"></path><path d="M10 3h4v5h-4z"></path></svg></button> <button aria-label="Delete"><svg fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14Z"></path><path d="M10 11v6M14 11v6"></path></svg></button></div></div>'),$u("<div><!></div>"),$u("<div><!> <!></div>"),$u("<div><!> <!></div>"),$u("<div><div><span> </span> <button>Save to Clipboard</button></div> <div></div></div>"),qu('<path d="M5 13l4 4L19 7"></path>'),qu('<circle cx="12" cy="12" r="10"></circle><path d="M15 9l-6 6M9 9l6 6"></path>',1),qu('<circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4M12 8h.01"></path>',1),$u('<div><div><svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><!></svg> <span> </span></div></div>'),$u("<!> <!> <!>",1);Bu(["keydown","click"]);$u('<span class="text-lg"> </span>'),$u("<div> </div>"),$u('<li role="option" tabindex="-1"><div class="flex items-center gap-3"><!> <div class="min-w-0 flex-1"><div class="truncate text-sm font-medium"> </div> <!></div></div></li>'),$u('<ul role="listbox"></ul>'),$u("<div><p> </p></div>"),$u("<span>j/k</span>"),$u("<span>↑↓</span>"),$u('<!> <!> <div><div class="flex items-center gap-4"><kbd><!> <span>Navigate</span></kbd> <kbd><span>↵</span> <span>Select</span></kbd></div> <kbd><span>ESC</span> <span>Close</span></kbd></div>',1);Bu(["click","keydown"]);$u("<p> </p>"),$u("<span> </span>"),$u("<div></div>"),$u("<article><p> </p> <!> <!></article>");$u('<div role="group"><h2> </h2> <div role="list"></div> <button>+ Add card</button></div>'),$u("<div></div>");Bu(["click"]);$u("<li><a> </a></li>"),$u('<nav><div><ul role="list"></ul></div></nav>');Bu(["click","keydown"]);Symbol("SPLIT_PANE");$u("<div><!></div>");$u('<div role="separator" tabindex="0" aria-valuemin="0" aria-valuemax="100"><div></div></div>');Bu(["mousedown","keydown"]);$u("<div><!></div> <!>",1);$u('<div role="button" tabindex="0" aria-label="Close tour"></div>'),$u("<h3> </h3>"),$u("<button></button>"),$u("<div></div>"),$u("<button>Previous</button>"),$u('<!> <div></div> <div tabindex="-1"><div></div> <div><!> <p> </p> <!></div> <div><button>
29Skip</button> <div><!> <button> </button></div></div></div>',1);Bu(["click","keydown"]);$u('<div role="listitem"><!></div>'),$u('<div role="list"><div><div></div></div></div>');var tx=qu("<title> </title>"),rx=qu("<desc> </desc>"),nx=qu('<svg><!><!><path fill-rule="evenodd" d="M12.51 8.796v1.697a3.738 3.738 0 0 1 3.288-1.684c3.455 0 4.202 2.16 4.202 4.97V19.5h-3.2v-5.072c0-1.21-.244-2.766-2.128-2.766-1.827 0-2.139 1.317-2.139 2.676V19.5h-3.19V8.796h3.168ZM7.2 6.106a1.61 1.61 0 0 1-.988 1.483 1.595 1.595 0 0 1-1.743-.348A1.607 1.607 0 0 1 5.6 4.5a1.601 1.601 0 0 1 1.6 1.606Z" clip-rule="evenodd"></path><path d="M7.2 8.809H4V19.5h3.2V8.809Z"></path></svg>');var ix=qu('<svg class="h-4 w-4 text-gray-500 hover:text-blue-600" fill="currentColor" viewBox="0 0 20 20"><path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z"></path><path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"></path></svg>'),ox=$u("<!> <!>",1),ax=$u("<!> <!>",1),sx=$u('<div class="md:flex md:justify-between ml-8 mr-8"><div class="mb-6 md:mb-0"><h3 class="text-xl font-bold text-gray-900">KARL Irrigation AB</h3> <div class="space-y-1 text-sm text-gray-600 pt-2"><p>Malmö, Sweden</p> <p><span class="font-bold">Org. Nr:</span> 559513-1425</p></div> <div class="mt-4"><div class="flex flex-wrap items-center gap-x-6 gap-y-2"><div class="flex items-center space-x-2"><!> <span class="text-sm text-gray-600">LinkedIn</span></div> <div class="flex items-center space-x-2"><!> <span class="text-sm text-gray-600">[email protected]</span></div> <div class="flex items-center space-x-2"><svg class="h-4 w-4 text-gray-500" fill="currentColor" viewBox="0 0 20 20"><path d="M2 3a1 1 0 011-1h2.153a1 1 0 01.986.836l.74 4.435a1 1 0 01-.54 1.06l-1.548.773a11.037 11.037 0 006.105 6.105l.774-1.548a1 1 0 011.059-.54l4.435.74a1 1 0 01.836.986V17a1 1 0 01-1 1h-2C7.82 18 2 12.18 2 5V3z"></path></svg> <span class="text-sm text-gray-600">+46 79 304 82 86</span></div></div></div></div> <div class="grid grid-cols-2 gap-8 sm:grid-cols-3 sm:gap-6"><div><h2 class="mb-2 text-sm font-semibold text-gray-900 uppercase dark:text-white">Company</h2> <!></div> <div><h2 class="mb-2 text-sm font-semibold text-gray-900 uppercase dark:text-white">Support</h2> <!></div> <div><h2 class="mb-2 text-sm font-semibold text-gray-900 uppercase dark:text-white">Legal</h2> <!></div></div></div> <hr class="my-6 border-gray-200 sm:mx-auto lg:my-8 dark:border-gray-700"/> <div class="text-center"><!></div>',1);function lx(e){!function(e,t){Zs(t,!0);let r=fh(t,"footerType",3,"default"),n=lh(t,["$$slots","$$events","$$legacy","children","footerType","class"]);const i=x_("footer"),o=Dl((()=>nv({footerType:r(),class:yd(i,t.class)})));var a=lv();Nd(a,(()=>({...n,class:yu(o)}))),ud(uc(a),(()=>t.children)),Os(a),Yu(e,a),Ys()}(e,{footerType:"socialmedia",class:"bg-gray-50 border-t",children:(e,t)=>{var r=sx(),n=dc(r),i=uc(n),o=hc(uc(i),4),a=uc(o),s=uc(a);fv(uc(s),{href:"https://www.linkedin.com/company/karl-farm",class:"p-0",children:(e,t)=>{!function(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"ariaLabel",3,"linkedin solid"),s=lh(t,["$$slots","$$events","$$legacy","size","color","title","desc","class","ariaLabel"]),l=`${t.title?.id||""} ${t.desc?.id||""}`;const c=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var u=nx();Nd(u,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:o(),...s,class:e,"aria-label":a(),"aria-describedby":yu(c)?l:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var d=uc(u),h=e=>{var r=tx(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(d,(e=>{t.title?.id&&t.title.title&&e(h)}));var f=hc(d),p=e=>{var r=rx(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(f,(e=>{t.desc?.id&&t.desc.desc&&e(p)})),Ds(2),Os(u),Yu(e,u),Ys()}(e,{class:"h-4 w-4 text-gray-500 hover:text-blue-600"})},$$slots:{default:!0}}),Ds(2),Os(s);var l=hc(s,2);fv(uc(l),{href:"/contact/",class:"p-0",children:(e,t)=>{Yu(e,ix())},$$slots:{default:!0}}),Ds(2),Os(l),Ds(2),Os(a),Os(o),Os(i);var c=hc(i,2),u=uc(c);yv(hc(uc(u),2),{children:(e,t)=>{var r=ox(),n=dc(r);gv(n,{class:"mb-4",href:"/",children:(e,t)=>{Ds(),Yu(e,Wu("Home"))},$$slots:{default:!0}}),gv(hc(n,2),{class:"mb-4",href:"/pricing/",children:(e,t)=>{Ds(),Yu(e,Wu("Pricing"))},$$slots:{default:!0}}),Yu(e,r)},$$slots:{default:!0}}),Os(u);var d=hc(u,2);yv(hc(uc(d),2),{children:(e,t)=>{gv(e,{class:"mb-4",href:"/contact/",children:(e,t)=>{Ds(),Yu(e,Wu("Contact"))},$$slots:{default:!0}})},$$slots:{default:!0}}),Os(d);var h=hc(d,2);yv(hc(uc(h),2),{children:(e,t)=>{var r=ax(),n=dc(r);gv(n,{class:"mb-4",href:"https://app.termly.io/policy-viewer/policy.html?policyUUID=28c2d96d-0934-443d-a5c3-29ba93c75dcd",target:"_blank",rel:"noopener noreferrer",children:(e,t)=>{Ds(),Yu(e,Wu("Privacy Policy"))},$$slots:{default:!0}}),gv(hc(n,2),{class:"mb-4",href:"https://app.termly.io/policy-viewer/policy.html?policyUUID=d4415968-34cf-4231-ae4f-3946f11708f5",target:"_blank",rel:"noopener noreferrer",children:(e,t)=>{Ds(),Yu(e,Wu("Terms & Conditions"))},$$slots:{default:!0}}),Yu(e,r)},$$slots:{default:!0}}),Os(h),Os(c),Os(n);var f=hc(n,4);!function(e,t){Zs(t,!0);let r=fh(t,"copyrightMessage",3,"All Rights Reserved."),n=fh(t,"year",7),i=lh(t,["$$slots","$$events","$$legacy","spanClass","aClass","href","by","copyrightMessage","year","bySpanClass","classes","class"]);t.aClass,t.spanClass,t.bySpanClass;const o=Dl((()=>t.classes??{bySpan:t.bySpanClass,link:t.aClass})),a=x_("footerCopyright");n()||n((new Date).getFullYear());const{base:s,link:l,bySpan:c}=iv();var u=dv(),d=uc(u),h=hc(d),f=e=>{var r=cv();Nd(r,(e=>({...i,href:t.href,class:e})),[()=>l({class:yd(a?.link,yu(o).link)})]);var n=uc(r,!0);Os(r),Pc((()=>Ju(n,t.by))),Yu(e,r)},p=e=>{var r=uv(),n=uc(r,!0);Os(r),Pc((e=>{wd(r,1,e),Ju(n,t.by)}),[()=>_d(c({class:yd(a?.bySpan,yu(o).bySpan)}))]),Yu(e,r)};ad(h,(e=>{t.href?e(f):e(p,!1)}));var g=hc(h);Os(u),Pc((e=>{wd(u,1,e),Ju(d,`© ${n()??""} `),Ju(g,` ${r()??""}`)}),[()=>_d(s({class:yd(a?.base,t.class??t.spanClass)}))]),Yu(e,u),Ys()}(uc(f),{href:"/",by:"KARL Irrigation™"}),Os(f),Yu(e,r)},$$slots:{default:!0}})}
29var cx=$u('<img src="/static/images/web/karl_sun.png" class="me-3 h-6 sm:h-9" alt="KARL Logo"/> <span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white">KARL Irrigation</span>',1),ux=$u("<!> <!> <!> <!>",1),dx=$u("<!> <!> <!>",1);function hx(e,t){Zs(t,!0);let r=fh(t,"currentPage",3,"home"),n=fh(t,"navigate",3,(()=>{}));function i(e,t){t.preventDefault(),n()(e)}!function(e,t){Zs(t,!0);let r=fh(t,"closeOnClickOutside",3,!0),n=fh(t,"breakpoint",3,"md"),i=lh(t,["$$slots","$$events","$$legacy","children","fluid","navContainerClass","class","closeOnClickOutside","breakpoint"]);const o=x_("navbar");let a,s=Jl({hidden:!0});Ws("navState",s),Ws("breakpoint",n());let l=()=>{s.hidden=!s.hidden};var c=Cv();Nu("click",rc,(function(e){r()&&(s.hidden||!a||a.contains(e.target)||(s.hidden=!0))}));var u=uc(c);Nd(u,(e=>({...i,class:e})),[()=>Sv({class:yd(o,t.class)})]);var d=uc(u);{let e=Dl((()=>yd(t.navContainerClass)));Av(d,{get fluid(){return t.fluid},get class(){return yu(e)},children:(e,r)=>{var n=Zu();ud(dc(n),(()=>t.children),(()=>({hidden:s.hidden,toggle:l,NavContainer:Av}))),Yu(e,n)},$$slots:{default:!0}})}Os(u),Os(c),nh(c,(e=>a=e),(()=>a)),Yu(e,c),Ys()}(e,{class:"border-b",children:(e,t)=>{var n=dx(),o=dc(n);!function(e,t){Zs(t,!0);let r=lh(t,["$$slots","$$events","$$legacy","children","class"]);const n=x_("navbarBrand");var i=Rv();Nd(i,(e=>({...r,class:e})),[()=>kv({class:yd(n,t.class)})]),ud(uc(i),(()=>t.children??Ka)),Os(i),Yu(e,i),Ys()}(o,{href:"/",onclick:e=>i("home",e),children:(e,t)=>{var r=cx();Ds(2),Yu(e,r)},$$slots:{default:!0}});var a=hc(o,2);!function(e,t){Zs(t,!0);let r=fh(t,"name",3,"Open main menu"),n=lh(t,["$$slots","$$events","$$legacy","children","onclick","menuClass","class","classes","name"]);t.menuClass;const i=Dl((()=>t.classes??{menu:t.menuClass})),o=x_("navbarHamburger"),a=qs("navState"),s=qs("breakpoint"),{base:l,menu:c}=Ev({breakpoint:s}),u=()=>{a.hidden=!a.hidden};{let a=Dl((()=>t.onclick||u)),s=Dl((()=>l({class:yd(o?.base,t.class)})));z_(e,hh({get name(){return r()},get onclick(){return yu(a)}},(()=>n),{get class(){return yu(s)},children:(e,t)=>{{let t=Dl((()=>c({class:yd(o?.menu,yu(i).menu)})));Wv(e,{get class(){return yu(t)}})}},$$slots:{default:!0}}))}Ys()}(a,{}),Hv(hc(a,2),{children:(e,t)=>{var n=ux(),o=dc(n);{let e=Dl((()=>"home"===r()?"text-blue-600":""));zv(o,{href:"/",get class(){return yu(e)},onclick:e=>i("home",e),children:(e,t)=>{Ds(),Yu(e,Wu("Home"))},$$slots:{default:!0}})}var a=hc(o,2);{let e=Dl((()=>"pricing"===r()?"text-blue-600":""));zv(a,{href:"/pricing/",get class(){return yu(e)},onclick:e=>i("pricing",e),children:(e,t)=>{Ds(),Yu(e,Wu("Pricing"))},$$slots:{default:!0}})}var s=hc(a,2);{let e=Dl((()=>"contact"===r()?"text-blue-600":""));zv(s,{href:"/contact/",get class(){return yu(e)},onclick:e=>i("contact",e),children:(e,t)=>{Ds(),Yu(e,Wu("Contact"))},$$slots:{default:!0}})}zv(hc(s,2),{href:"/accounts/login/",children:(e,t)=>{Ds(),Yu(e,Wu("Login"))},$$slots:{default:!0}}),Yu(e,n)},$$slots:{default:!0}}),Yu(e,n)},$$slots:{default:!0}}),Ys()}var fx=i(8613),px=$u("<section><div><!></div></section>");function gx(e,t){const r=uh(t,["children","$$slots","$$events","$$legacy"]);Zs(t,!1);let n=fh(t,"sectionClass",8,"relative py-6 sm:py-10"),i=fh(t,"name",8,"default");const o={advancedTable:{div:"mx-auto max-w-screen-xl px-4 lg:px-12"},blog:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},blogTemplate:{div:"flex justify-between px-4 mx-auto max-w-screen-xl"},comment:{div:"max-w-2xl mx-auto px-4"},contact:{div:"py-8 lg:py-16 px-4 mx-auto max-w-screen-md"},content:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},contentwithimg:{div:"gap-16 items-center py-8 px-4 mx-auto max-w-screen-xl lg:grid lg:grid-cols-2 lg:py-16 lg:px-6"},crudcreateform:{div:"py-8 px-4 mx-auto max-w-2xl lg:py-16"},crudcreatedrawer:{div:"h-80"},crudreadsection:{div:"py-8 px-4 mx-auto max-w-2xl lg:py-16"},cta:{div:"py-8 px-4 mx-auto max-w-screen-xl sm:py-16 lg:px-6"},ctawithimg:{div:"gap-8 items-center py-8 px-4 mx-auto max-w-screen-xl xl:gap-16 md:grid md:grid-cols-2 sm:py-16 lg:px-6"},default:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},faq:{div:"py-8 px-4 mx-auto max-w-screen-xl sm:py-16 lg:px-6"},feature:{div:"py-8 px-4 mx-auto max-w-screen-xl sm:py-16 lg:px-6"},forgotpassword:{div:"flex flex-col items-center justify-center px-6 py-8 mx-auto  lg:py-0"},headingwithctabutton:{div:"py-8 px-4 mx-auto max-w-screen-xl sm:py-16 lg:px-6"},heroDefault:{div:"py-8 px-4 mx-auto max-w-screen-xl text-center lg:py-16 lg:px-12"}
29,heroVisual:{div:"grid max-w-screen-xl px-4 py-8 mx-auto lg:gap-8 xl:gap-0 lg:py-16 lg:grid-cols-12"},login:{div:"flex flex-col items-center justify-center px-6 py-8 mx-auto lg:py-0"},logos:{div:"py-8 lg:py-16 mx-auto max-w-screen-xl px-4"},maintenance:{div:"py-8 px-4 mx-auto max-w-screen-md text-center lg:py-16 lg:px-12"},newsletter:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},none:{div:""},page500:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},page404:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},portfolio:{div:"max-w-screen-xl px-4 py-8 mx-auto lg:px-6 sm:py-16 lg:py-24"},pricing:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},register:{div:"flex flex-col items-center justify-center px-6 py-8 mx-auto lg:py-0"},reset:{div:"flex flex-col items-center justify-center px-6 py-8 mx-auto lg:py-0"},schedule:{div:"max-w-screen-xl px-4 py-8 mx-auto lg:px-6 sm:py-16 lg:py-24"},social:{div:"max-w-screen-xl px-4 py-8 mx-auto text-center lg:py-16 lg:px-6"},tableheader:{div:"max-w-screen-xl px-4 mx-auto lg:px-12 w-full"},team:{div:"py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6"},testimonial:{div:"max-w-screen-xl px-4 py-8 mx-auto text-center lg:py-16 lg:px-6"}};ih();var a=px(),s=uc(a);ld(uc(s),t,"default",{},null),Os(s),Os(a),Pc(((e,t)=>{wd(a,1,e),wd(s,1,t)}),[()=>_d((ku(fx.twMerge),ku(n()),ku(r),xu((()=>(0,fx.twMerge)(n(),r.classSection))))),()=>_d((ku(fx.twMerge),ku(i()),ku(r),xu((()=>(0,fx.twMerge)(o[i()].div,r.classDiv)))))]),Yu(e,a),Ys()}$u("<div><!></div>");$u("<a><img/> <!></a>");$u('<div tabindex="-1"><!></div>');$u("<div><div><!></div> <!></div>");$u("<h2><!></h2>"),$u("<!> <!>",1);$u("<div><!></div>");$u("<article><!></article>");$u("<h2><!></h2>"),$u("<div><!> <!></div>");$u("<div><!></div>");$u('<a rel="author"> </a>'),$u("<p><time> </time></p>"),$u('<p class="lead"> </p>'),$u("<article><header><address><div><img/> <div><!> <p> </p> <!></div></div></address> <h1> </h1></header> <!> <!> <!></article>");$u("<div><h2> </h2></div> <!>",1);$u("<p><time> </time></p>"),$u('<div class="flex items-center mt-4 space-x-4"><button type="button" class="flex items-center text-sm text-gray-500 hover:underline dark:text-gray-400"><!> Reply</button></div>'),$u('<article><footer><div class="flex items-center"><p class="inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white"><img class="mr-2 w-6 h-6 rounded-full"/> </p> <!></div> <!></footer> <p class="text-gray-500 dark:text-gray-400"> </p> <!></article> <!>',1);$u("<h2><!></h2>"),$u("<p><!></p>"),$u("<!> <!> <!>",1);$u("<h2><!></h2>"),$u("<div><!> <!></div>");$u("<h2><!></h2>"),$u("<div><!></div>"),$u("<div><!> <!></div> <!>",1);$u("<h2><!></h2>"),$u("<!> <div><!> <!></div>",1);$u("<div><!></div>");$u("<div><h3><!> <!></h3> <!></div>");var mx=$u("<div><!></div>");var yx=$u("<div><!></div>"),_x=$u("<h3><!></h3>"),vx=$u("<p><!></p>"),bx=$u("<div><!> <!> <!></div>");function xx(e,t){const r=cd(t),n=uh(t,["children","$$slots","$$events","$$legacy"]);Zs(t,!1);let i=fh(t,"divClass",8,"flex justify-center items-center mb-4 w-10 h-10 rounded-full bg-primary-100 lg:h-12 lg:w-12 dark:bg-primary-900"),o=fh(t,"h3Class",8,"mb-2 text-xl font-bold dark:text-white"),a=fh(t,"pClass",8,"text-gray-500 dark:text-gray-400");ih();var s=bx(),l=uc(s),c=e=>{var r=yx();ld(uc(r),t,"icon",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(i()),ku(n),xu((()=>(0,fx.twMerge)(i(),n.class)))))]),Yu(e,r)};ad(l,(e=>{xu((()=>r.icon))&&e(c)}));var u=hc(l,2),d=e=>{var r=_x();ld(uc(r),t,"h3",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(o()),ku(n),xu((()=>(0,fx.twMerge)(o(),n.classh3)))))]),Yu(e,r)};ad(u,(e=>{xu((()=>r.h3))&&e(d)}));var h=hc(u,2),f=e=>{var r=vx();ld(uc(r),t,"paragraph",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(a()),ku(n),xu((()=>(0,fx.twMerge)(a(),n.classp)))))]),Yu(e,r)};ad(h,(e=>{xu((()=>r.paragraph))&&e(f)})),Os(s),Yu(e,s),Ys()}$u('<span class="font-semibold text-gray-400 uppercase"><!></span>'),$u("<div><!> <!></div>");var wx=$u("<h1><!></h1>"),Sx=$u("<h2><!></h2>"),kx=$u("<p><!></p>"),Tx=$u("<div><!> <!> <!> <!></div>");function Ix(e,t){const r=cd(t),n=uh(t,["children","$$slots","$$events","$$legacy"]),i=uh(n,["h1Class","h2Class","pClass"]);Zs(t,!1);let o=fh(t,"h1Class",8,"mb-4 text-4xl font-extrabold tracking-tight leading-none text-gray-900 md:text-5xl lg:text-6xl dark:text-white"),a=fh(t,"h2Class",8,"mb-8 lg:mb-16 text-3xl font-extrabold tracking-tight leading-tight text-center text-gray-900 dark:text-white md:text-4xl"),s=fh(t,"pClass",8,"mb-8 text-lg font-normal text-gray-500 lg:text-xl sm:px-16 xl:px-48 dark:text-gray-400");ih();var l=Tx(),c=uc(l),u=e=>{var r=wx();Nd(r,(e=>({class:e,...i})),[()=>(ku(fx.twMerge),ku(o()),ku(n),xu((()=>(0,fx.twMerge)(o(),n.classH1))))]),ld(uc(r),t,"h1",{},null),Os(r),Yu(e,r)};ad(c,(e=>{xu((()=>r.h1))&&e(u)}));var d=hc(c,2),h=e=>{var r=Sx();ld(uc(r),t,"h2",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(a()),ku(n),xu((()=>(0,fx.twMerge)(a(),n.classH2)))))]),Yu(e,r)};ad(d,(e=>{xu((()=>r.h2))&&e(h)}));var f=hc(d,2),p=e=>{var r=kx();ld(uc(r),t,"paragraph",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(s()),ku(n),xu((()=>(0,fx.twMerge)(s(),n.classP)))))]),Yu(e,r)};ad(f,(e=>{xu((()=>r.paragraph))&&e(p)})),ld(hc(f,2),t,"default",{},null),Os(l),Pc((()=>wd(l,1,_d((ku(n),xu((()=>n.class))))))),Yu(e,l),Ys()}$u("<a><!> <!></a>");qu('<svg class="mx-auto mb-4 w-10 h-10 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
29<path fill="currentColor" d="M331.8 224.1c28.29 0 54.88 10.99 74.86 30.97l19.59 19.59c40.01-17.74 71.25-53.3 81.62-96.65c5.725-23.92 5.34-47.08 .2148-68.4c-2.613-10.88-16.43-14.51-24.34-6.604l-68.9 68.9h-75.6V97.2l68.9-68.9c7.912-7.912 4.275-21.73-6.604-24.34c-21.32-5.125-44.48-5.51-68.4 .2148c-55.3 13.23-98.39 60.22-107.2 116.4C224.5 128.9 224.2 137 224.3 145l82.78 82.86C315.2 225.1 323.5 224.1 331.8 224.1zM384 278.6c-23.16-23.16-57.57-27.57-85.39-13.9L191.1 158L191.1 95.99l-127.1-95.99L0 63.1l96 127.1l62.04 .0077l106.7 106.6c-13.67 27.82-9.251 62.23 13.91 85.39l117 117.1c14.62 14.5 38.21 14.5 52.71-.0016l52.75-52.75c14.5-14.5 14.5-38.08-.0016-52.71L384 278.6zM227.9 307L168.7 247.9l-148.9 148.9c-26.37 26.37-26.37 69.08 0 95.45C32.96 505.4 50.21 512 67.5 512s34.54-6.592 47.72-19.78l119.1-119.1C225.5 352.3 222.6 329.4 227.9 307zM64 472c-13.25 0-24-10.75-24-24c0-13.26 10.75-24 24-24S88 434.7 88 448C88 461.3 77.25 472 64 472z"></path></svg>');$u("<h1><!></h1>"),$u("<p><!></p>"),$u("<!> <!> <!>",1);$u("<h2><!></h2>"),$u("<div><!> <!></div>");$u("<h1><!></h1>"),$u("<div><!> <!></div>");$u("<h1><!></h1>"),$u("<div><!> <!></div>");$u('<div id="info-popup" tabindex="-1"><div><div><!></div></div></div>');$u("<p> </p>"),$u("<div><h2> </h2> <!></div> <div><!></div>",1);$u("<span> </span>"),$u("<h3> </h3>"),$u("<p> </p>"),$u('<div><!> <!> <!> <a title="" role="button"> <svg aria-hidden="true" class="w-5 h-5 ml-2 -mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg></a> <!></div>');var Mx=$u("<div><!></div>");function Ex(e,t){const r=uh(t,["children","$$slots","$$events","$$legacy"]);Zs(t,!1);let n=fh(t,"divClass",8,"flex flex-col p-6 mx-auto max-w-lg text-center text-gray-900 bg-white rounded-lg border border-gray-100 shadow dark:border-gray-600 xl:p-8 dark:bg-gray-800 dark:text-white");ih();var i=Mx();ld(uc(i),t,"default",{},null),Os(i),Pc((e=>wd(i,1,e)),[()=>_d((ku(fx.twMerge),ku(n()),ku(r),xu((()=>(0,fx.twMerge)(n(),r.class)))))]),Yu(e,i),Ys()}var Px=$u("<h3><!></h3>"),Ax=$u("<p><!></p>"),Cx=$u("<div><!></div>"),Rx=$u("<!> <!> <!>",1);function Lx(e,t){const r=cd(t),n=uh(t,["children","$$slots","$$events","$$legacy"]);Zs(t,!1);let i=fh(t,"h3Class",8,"mb-4 text-2xl font-semibold"),o=fh(t,"pClass",8,"font-light text-gray-500 sm:text-lg dark:text-gray-400"),a=fh(t,"priceClass",8,"flex justify-center items-baseline my-8");ih();var s=Rx(),l=dc(s),c=e=>{var r=Px();ld(uc(r),t,"h3",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(i()),ku(n),xu((()=>(0,fx.twMerge)(i(),n.class)))))]),Yu(e,r)};ad(l,(e=>{xu((()=>r.h3))&&e(c)}));var u=hc(l,2),d=e=>{var r=Ax();ld(uc(r),t,"paragraph",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(o()),ku(n),xu((()=>(0,fx.twMerge)(o(),n.classP)))))]),Yu(e,r)};ad(u,(e=>{xu((()=>r.paragraph))&&e(d)}));var h=hc(u,2),f=e=>{var r=Cx();ld(uc(r),t,"price",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(a()),ku(n),xu((()=>(0,fx.twMerge)(a(),n.classPrice)))))]),Yu(e,r)};ad(h,(e=>{xu((()=>r.price))&&e(f)})),Yu(e,s),Ys()}$u("<ul><!></ul> <!>",1);var Ox=$u("<h2><!></h2>"),Dx=$u("<p><!></p>"),zx=$u("<div><!> <!></div>");var Fx=qu("<title> </title>"),Nx=qu("<desc> </desc>"),Bx=qu('<svg><!><!><path fill-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm13.707-1.293a1 1 0 0 0-1.414-1.414L11 12.586l-1.793-1.793a1 1 0 0 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l4-4Z" clip-rule="evenodd"></path></svg>');function jx(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"ariaLabel",3,"check circle solid"),s=lh(t,["$$slots","$$events","$$legacy","size","color","title","desc","class","ariaLabel"]),l=`${t.title?.id||""} ${t.desc?.id||""}`;const c=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var u=Bx();Nd(u,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:o(),...s,class:e,"aria-label":a(),"aria-describedby":yu(c)?l:void 0,viewB
29ox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var d=uc(u),h=e=>{var r=Fx(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(d,(e=>{t.title?.id&&t.title.title&&e(h)}));var f=hc(d),p=e=>{var r=Nx(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(f,(e=>{t.desc?.id&&t.desc.desc&&e(p)})),Ds(),Os(u),Yu(e,u),Ys()}var Vx=$u("<li><!> <!></li>");function Gx(e,t){const r=uh(t,["children","$$slots","$$events","$$legacy"]);Zs(t,!1);let n=fh(t,"liClass",8,"flex items-center space-x-3");ih();var i=Vx(),o=uc(i);{let e=zl((()=>(ku(fx.twMerge),ku(r),xu((()=>(0,fx.twMerge)("ml-2",r.class))))));dd(o,(()=>jx),((t,r)=>{r(t,{size:"sm",get class(){return yu(e)}})}))}ld(hc(o,2),t,"default",{},null),Os(i),Pc((()=>wd(i,1,_d(n())))),Yu(e,i),Ys()}$u("<a><!></a>"),$u("<!> <div><!></div>",1);$u('<div class="max-w-3xl mx-auto text-center"><h2 class="text-4xl font-extrabold leading-tight tracking-tight text-gray-900 dark:text-white"> </h2> <!></div> <div class="flow-root max-w-3xl mx-auto mt-8 sm:mt-12 lg:mt-16"><div class="-my-4 divide-y divide-gray-200 dark:divide-gray-700"><!></div></div>',1);$u("<p> </p>"),$u("<a> </a>"),$u("<div><!> <h3><!></h3></div>");$u("<div><!></div>");$u("<a><!></a> <!>",1);$u("<div><dl><!></dl></div>");$u("<div><!> <div><!></div></div>"),$u("<div><!></div>"),$u("<div><!></div>");$u("<div><!></div>");$u('<div><h2 class="mb-4 text-4xl tracking-tight font-extrabold text-gray-900 dark:text-white"><!></h2> <!></div>');$u('<div><a><img/></a> <div class="p-5"><h3><a> </a></h3> <span> </span> <!> <ul class="flex space-x-4 sm:mt-0"><!></ul></div></div>');$u("<div><!></div>");$u("<figcaption><!></figcaption>"),$u("<figure><!> <!> <!></figure>");$u("<div><!></div>"),$u("<!> <div><!></div>",1);$u("<h3><!></h3>"),$u("<figcaption><!></figcaption>"),$u("<figure><blockquote><!> <!></blockquote> <!></figure>");$u('<a class="text-gray-500 hover:text-gray-900 dark:hover:text-white"><svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987
29h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z" clip-rule="evenodd"></path></svg></a>');$u('<a class="text-gray-500 hover:text-gray-900 dark:hover:text-white"><svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path></svg></a>');qu('<svg viewBox="0 0 24 27" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.017 18L14.017 10.609C14.017 4.905 17.748 1.039 23 0L23.995 2.151C21.563 3.068 20 5.789 20 8H24V18H14.017ZM0 18V10.609C0 4.905 3.748 1.038 9 0L9.996 2.151C7.563 3.068 6 5.789 6 8H9.983L9.983 18L0 18Z" fill="currentColor"></path></svg>');$u('<a class="text-gray-500 hover:text-gray-900 dark:hover:text-white"><svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path d="M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"></path></svg></a>');var Ux=$u('<div class="max-w-screen-lg mx-auto px-4 py-2 lg:py-4"><h2 class="mb-4 text-4xl tracking-tight font-extrabold text-center text-gray-900 flex items-center justify-center gap-3">Contact KARL <img src="/static/images/web/karl_sun.png" class="h-10 inline-block" alt="KARL Logo"/></h2> <p class="mb-8 lg:mb-12 font-light text-center text-gray-500 sm:text-xl max-w-2xl mx-auto">Whether you\'re looking to optimise your irrigation setup, need help with VRI planning, or have questions about our platform — our team is ready to help. Get in touch and we\'ll respond as soon as possible.</p> <div class="bg-white p-8 rounded-lg shadow-lg border border-gray-100"><h3 class="text-2xl font-bold text-gray-900 mb-6 text-center">Send us a message</h3> <!> <!> <form class="space-y-6"><div class="grid md:grid-cols-2 gap-4"><div><!> <!></div> <div><!> <!></div></div> <div><!> <!></div> <div><!> <!></div> <div class="text-center"><!></div></form></div></div>');function $x(e){let t=$l(""),r=$l(""),n=$l(""),i=$l(""),o=$l(!1),a=$l(""),s=$l("");function l(){const e=window.PAGE_DATA;return e?.csrfToken||""}async function c(e){e.preventDefault(),ql(o,!0),ql(a,""),ql(s,"");try{const e=await fetch("/api/contact/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":l()},body:JSON.stringify({name:yu(t),email:yu(r),subject:yu(n),message:yu(i)})});if(e.ok)ql(a,"Your message has been sent! We will get back to you soon."),ql(t,""),ql(r,""),ql(n,""),ql(i,"");else{const t=await e.json();ql(s,t.error||"Something went wrong. Please try again.",!0)}}catch{ql(s,"Could not send your message. Please try again later.")}finally{ql(o,!1)}}gx(e,{name:"default",class:"bg-gradient-to-br from-blue-50 via-white to-yellow-50",children:(e,l)=>{var u=Ux(),d=hc(uc(u),4),h=hc(uc(d),2),f=e=>{T_(e,{color:"green",class:"mb-4",children:(e,t)=>{Ds();var r=Wu();Pc((()=>Ju(r,yu(a)))),Yu(e,r)},$$slots:{default:!0}})};ad(h,(e=>{yu(a)&&e(f)}));var p=hc(h,2),g=e=>{T_(e,{color:"red",class:"mb-4",children:(e,t)=>{Ds();var r=Wu();Pc((()=>Ju(r,yu(s)))),Yu(e,r)},$$slots:{default:!0}})};ad(p,(e=>{yu(s)&&e(g)}));var m=hc(p,2),y=uc(m),_=uc(y),v=uc(_);Ob(v,{for:"name",class:"mb-2 block text-gray-700",children:(e,t)=>{Ds(),Yu(e,Wu("Your name"))},$$slots:{default:!0}}),Wb(hc(v,2),{id:"name",name:"name",placeholder:"John Doe",required:!0,class:"border-gray-300 focus:border-blue-500 focus:ring-blue-500",get value(){return yu(t)},set value(e){ql(t,e,!0)}}),Os(_);var b=hc(_,2),x=uc(b);Ob(x,{for:"email",class:"mb-2 block text-gray-700",children:(e,t)=>{Ds(),Yu(e,Wu("Your email"))},$$slots:{default:!0}}),Wb(hc(x,2),{id:"email",name:"email",type:"email",placeholder:"[email protected]",required:!0,class:"border-gray-300 focus:border-blue-500 focus:ring-blue-500",get value(){return yu(r)},set value(e){ql(r,e,!0)}}),Os(b),Os(y);var w=hc(y,2),S=uc(w);Ob(S,{for:"subject",class:"mb-2 block text-gray-700",children:(e,t)=>{Ds(),Yu(e,Wu("Subject"))},$$slots:{default:!0}}),Wb(hc(S,2),{id:"subject",name:"subject",placeholder:"How can we help you?",required:!0,class:"border-gray-300 focus:border-blue-500 focus:ring-blue-500",get value(){return yu(n)},set value(e){ql(n,e,!0)}}),Os(w);var k=hc(w,2),T=uc(k);Ob(T,{for:"message",class:"mb-2 block text-gray-700",children:(e,t)=>{Ds(),Yu(e,Wu("Your message"))},$$slots:{default:!0}}),function(e,t){Zs(t,!0);let r=fh(t,"value",15),n=fh(t,"elementRef",15),i=fh(t,"clearableColor",3,"none"),o=lh(t,["$$slots","$$events","$$legacy","header","footer","addon","value","elementRef","divClass","innerClass","headerClass","footerClass","addonClass","disabled","class","classes","clearable","clearableSvgClass","clearableColor","clearableClass","clearableOnClick","textareaClass"]);t.divClass,t.innerClass,t.headerClass,t.footerClass,t.addonClass,t.textareaClass,t.clearableClass,t.clearableSvgClass;const a=Dl((()=>t.classes??{div:t.divClass,inner:t.innerClass,header:t.headerClass,footer:t.footerClass,addon:t.addonClass,textarea:t.textareaClass,close:t.clearableClass,svg:t.clearableSvgClass})),s=x_("textarea");let l=Dl((()=>!!t.header)),c=Dl((()=>!!t.footer)),u=Dl((()=>!!t.addon)),d=Dl((()=>yu(l)||yu(c)||yu(u)));const h=Dl((()=>Zb({wrapped:yu(d),hasHeader:yu(l),hasFooter:yu(c)}))),f=Dl((()=>yu(h).div)),p=Dl((()=>yu(h).base)),g=Dl((()=>yu(h).wrapper)),m=Dl((()=>yu(h).inner)),y=Dl((()=>yu(h).header)),_=Dl((()=>yu(h).footer)),v=Dl((()=>yu(h).addon)),b=Dl((()=>yu(h).close));Am((()=>{n()&&(n(n().value="",!0),r(void 0)),t.clearableOnClick&&t.clearableOnClick()}));var x=ex(),w=uc(x),S=e=>{var i=Yb();mc(i),Nd(i,(e=>({disabled:t.disabled,...o,class:e})),[()=>yu(g)({class:yd(t.class,t.classes?.wrapper)})]),nh(i,(e=>n(e)),(()=>n())),Kd(i,r),Yu(e,i)},k=e=>{var i=Qb(),l=uc(i),c=e=>{var r=Xb();ud(uc(r),(()=>t.header)),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yu(y)({class:yd(s?.header,yu(a).header)}))]),Yu(e,r)};ad(l,(e=>{t.header&&e(c)}));var u=hc(l,2),d=uc(u),h=e=>{var r=Kb();ud(uc(r),(()=>t.addon)),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yu(v)({class:yd(s?.addon,yu(a).addon)}))]),Yu(e,r)};ad(d,(e=>{t.addon&&e(h)}));var f=hc(d,2);mc(f),Nd(f,(e=>({disabled:t.disabled,...o,class:e})),[()=>yu(p)({class:yd(s?.base,t.class)})]),nh(f,(e=>n(e)),(()=>n())),Os(u);var b=hc(u,2),x=e=>{var r=Jb();ud(uc(r),(()=>t.footer)),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yu(_)({class:yd(s?.footer,yu(a).footer)}))]),Yu(e,r)};ad(b,(e=>{t.footer&&e(x)})),Os(i),Pc(((e,t)=>{wd(i,1,e),wd(u,1,t)}),[()=>_d(yu(g)({class:yd(s?.wrapper,t.classes?.wrapper)})),()=>_d(yu(m)({class:yd(s?.inner,yu(a).inner)}))]),Kd(f,r),Yu(e,i)};ad(w,(e=>{yu(d)?e(k,!1):e(S)}));var T=hc(w,2),I=e=>{{let t=Dl((()=>yu(b)({class:yd(s?.close,yu(a).close)}))),r=Dl((()=>yd(yu(a).svg)));Fm(e,{get class(){return yu(t)},get color(){return i()},"aria-label":"Clear search value",get svgClass(){return yu(r)}})}};ad(T,(e=>{void 0!==r()&&""!==r()&&t.clearable&&e(I)})),Os(x),Pc((e=>wd(x,1,e)),[()=>_d(yu(f)({class:yd(s?.div,yu(a).div)}))]),Yu(e,x),Ys()}(hc(T,2),{id:"message",name:"message",rows:6,placeholder:"Tell us about your irrigation needs...",class:"w-full border-gray-300 focus:border-blue-500 focus:ring-blue-500",get value(){return yu(i)},set value(e){ql(i,e,!0)}}),Os(k);var I=hc(k,2);P_(uc(I),{type:"submit",get disabled(){return yu(o)},class:"bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white px-8 py-3 rounded-lg font-semibold shadow-md hover:shadow-lg transform hover:-translate-y-0.5 transition-all duration-200",children:(e,t)=>{Ds();var r=Wu();Pc((()=>Ju(r,yu(o)?"Sending...":"Send Message"))),Yu(e,r)},$$slots:{default:!0}}),Os(I),Os(m),Os(d),Os(u),Nu("submit",m,c),Yu(e,u)},$$slots:{default:!0}})}var Hx=$u('<div class="max-w-screen-2xl mx-auto px-4 py-8 lg:py-10 lg:px-6"><div class="grid grid-cols-1 lg:grid-cols-2 gap-x-12 gap-y-8 items-start"><div><p class="mt-2 text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl">ClearSKY Vision Integration</p> <p class="mt-6 text-lg leading-8 text-gray-600">Through our integration with <a href="https://clearsky.vision/" target="_blank" rel="noopener noreferrer" class="text-gray-700 underline hover:text-gray-900">ClearSKY Vision</a>, KARL delivers daily cloud-free satellite imagery. No more waiting for clear skies, get a continuous view of your field conditions every single day.</p> <p class="mt-4 text-lg leading-8 text-gray-600">ClearSKY uses advanced deep learning to combine data from Sentinel-1, Sentinel-2, and Landsat satellites, producing cloudless multi-spectral imagery that feeds directly into KARL\'s VRI pipeline. The result: irrigation maps based on the freshest possible crop data, updated daily.</p></div> <div>
29<video autoplay loop playsinline="" class="w-full rounded-lg shadow-lg" src="/static/images/web/fusion_timelapse.mp4"></video></div></div></div>',2);var qx=$u('<img src="/static/images/web/water-svgrepo-com.svg" alt="Water" class="w-10 h-10"/>'),Wx=$u('<img src="/static/images/web/crops-svgrepo-com.svg" alt="Crops" class="w-10 h-10"/>'),Zx=$u('<img src="/static/images/web/soil-svgrepo-com.svg" alt="Soil" class="w-10 h-10"/>'),Yx=$u("<!> <!> <!>",1),Xx=$u("<!> <!>",1);function Kx(e){gx(e,{name:"feature",classSection:"relative py-4 sm:py-6 bg-white",classDiv:"py-6 px-4 mx-auto max-w-screen-2xl sm:py-10 lg:px-6",children:(e,t)=>{var r=Xx(),n=dc(r);{const e=e=>{Ds(),Yu(e,Wu("Revolutionizing Agriculture with Smart Irrigation"))},t=e=>{Ds(),Yu(e,Wu("KARL Irrigation's automated variable rate system delivers precise water management tailored to your field's unique needs, maximizing efficiency and crop performance."))};Ix(n,{class:"mb-6 max-w-screen-lg lg:mb-10",h2Class:"mb-4 lg:mb-4 text-4xl tracking-tight font-extrabold text-gray-900 dark:text-white text-left",pClass:"text-gray-500 sm:text-xl dark:text-gray-400 text-left sm:px-0 xl:px-0",h2:e,paragraph:t,$$slots:{h2:!0,paragraph:!0}})}!function(e,t){const r=uh(t,["children","$$slots","$$events","$$legacy"]);Zs(t,!1);let n=fh(t,"divClass",8,"space-y-8 md:grid md:grid-cols-2 lg:grid-cols-3 md:gap-12 md:space-y-0");ih();var i=mx();ld(uc(i),t,"default",{},null),Os(i),Pc((e=>wd(i,1,e)),[()=>_d((ku(fx.twMerge),ku(n()),ku(r),xu((()=>(0,fx.twMerge)(n(),r.class)))))]),Yu(e,i),Ys()}(hc(n,2),{children:(e,t)=>{var r=Yx(),n=dc(r);{const e=e=>{Yu(e,qx())},t=e=>{Ds(),Yu(e,Wu("Save Water"))},r=e=>{Ds(),Yu(e,Wu("Reduce water consumption with precision irrigation that delivers exactly the right amount of water to each zone of your field based on real-time soil conditions and crop needs."))};xx(n,{icon:e,h3:t,paragraph:r,$$slots:{icon:!0,h3:!0,paragraph:!0}})}var i=hc(n,2);{const e=e=>{Yu(e,Wx())},t=e=>{Ds(),Yu(e,Wu("Increase Yields"))},r=e=>{Ds(),Yu(e,Wu("Optimize crop production with data-driven irrigation schedules that ensure consistent moisture levels, leading to healthier plants and higher yields across your entire operation."))};xx(i,{icon:e,h3:t,paragraph:r,$$slots:{icon:!0,h3:!0,paragraph:!0}})}{const e=e=>{Yu(e,Zx())},t=e=>{Ds(),Yu(e,Wu("Improve Soil Health"))},r=e=>{Ds(),Yu(e,Wu("Maintain optimal soil moisture and prevent over-watering that can lead to nutrient leaching and soil compaction, preserving long-term soil health and fertility."))};xx(hc(i,2),{icon:e,h3:t,paragraph:r,$$slots:{icon:!0,h3:!0,paragraph:!0}})}Yu(e,r)},$$slots:{default:!0}}),Yu(e,r)},$$slots:{default:!0}})}var Jx=$u('<section class="relative bg-gray-50 py-4 sm:py-6"><div class="py-6 px-4 mx-auto max-w-screen-2xl lg:py-10 lg:px-6"><div class="grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-start"><div class="font-light text-gray-500 sm:text-lg"><h2 class="mb-4 tracking-tight font-extrabold"><span class="block text-5xl lg:text-6xl text-gray-900">Precision Irrigation,</span> <span class="block text-5xl lg:text-6xl text-gray-900">Fully Automated</span></h2> <p class="mb-4">KARL Irrigation creates variable rate irrigation maps for hose reel, pivot, and drip irrigation systems. Using satellite data, we generate evapotranspiration measurements at 20-meter resolution and automatically convert these into customized VRI maps, delivered directly to your irrigation machinery with no manual input required.</p> <p class="mb-6">Through our partnerships with <a href="https://www.dhigroup.com/" target="_blank" rel="noopener noreferrer" class="text-gray-700 underline hover:text-gray-900">DHI</a>, <a href="https://clearsky.vision/" target="_blank" rel="noopener noreferrer" class="text-gray-700 underline hover:text-gray-900">ClearSKY Vision</a>, and <a href="https://raindancer.com/" target="_blank" rel="noopener noreferrer" class="text-gray-700 underline hover:text-gray-900">Raindancer</a>, we have developed the first fully automated variable rate irrigation system. Daily cloud-free satellite imagery and evapotranspiration data feed directly into precision VRI maps that are pushed to your irrigation machinery automatically, no manual steps required.</p> <div class="flex flex-wrap gap-3"><a href="/contact/" class="btn btn-primary btn-lg">Book a Meeting</a> <a href="/accounts/signup/" class="btn btn-outline btn-lg">Try for Free</a></div></div> <div class="relative"><img src="/static/images/web/Hose Reel 3 (1).jpg" alt="Hose reel irrigation" class="w-full rounded-lg shadow-lg"/> <div class="absolute bottom-0 -right-4 w-[48%] rounded-tl-lg shadow-xl overflow-hidden aspect-[4/3]"><img src="/static/images/web/HoseReelgif-ezgif.com-loop-count.gif" alt="Hose reel VRI map generation" class="w-[120%] h-full object-cover object-center -ml-[10%]"/></div></div></div></div></section>');$u('<p class="mb-2 text-gray-500 dark:text-gray-400">We use satelitte based measurements of Evapotranspiration along with irrigation machinery charateristics in order to determine the most optimal irrigation map for a field.</p>'),$u('<p class="mb-2 text-gray-500 dark:text-gray-400">Satellite based ET is derived by combining data from Sentinel 2 and 3.</p> <p class="text-gray-500 dark:text-gray-400">Check out this research article for a full techincal overview<a href="/" target="_blank" rel="noreferrer" class="text-blue-600 hover:underline dark:text-blue-500">DHI Paper</a></p>',1),$u('<p class="mb-2 text-gray-500 dark:text-gray-400">With correctly caliberated crop types, accurary is within 5%.</p>'),$u('<p class="mb-2 text-gray-500 dark:text-gray-400">With correctly caliberated crop types, accurary is within 5%.</p>'),$u('<p class="mb-2 text-gray-500 dark:text-gray-400">We generate irrigation maps for hose reel, pivot and drip irrigation systems.</p>'),$u('<p class="mb-2 text-gray-500 dark:text-gray-400">Prices are based on a per/Ha basis, see the pricing page for more detail.</p>'),$u("<!> <!> <!> <!> <!> <!>",1);var Qx=$u('<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8 text-gray-500 justify-items-center max-w-4xl mx-auto dark:text-gray-400"><a href="https://innovationsfonden.dk/da"><img src="/static/images/web/Innofounder.png" class="me-3 h-12 sm:h-12" alt="Innofounder Logo"/></a> <a href="/"><img src="/static/images/web/ESA.png" class="me-3 h-20 sm:h-20" alt="ESA Logo"/></a> <a href="/"><img src="/static/images/web/Ideon_Logo.jpg" class="me-3 h-16 sm:h-16" alt="Ideon Logo"/></a></div>');var ew=$u('<div class="max-w-screen-2xl mx-auto px-4 py-8 lg:py-10 lg:px-6"><div class="grid grid-cols-1 lg:grid-cols-2 gap-x-12 gap-y-8 items-start"><div class="flex justify-center order-2 lg:order-1"><img src="/static/images/web/raindancer_app.png" alt="Raindancer app interface" class="w-full"/></div> <div class="order-1 lg:order-2"><p class="mt-2 text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl">Raindancer Integration</p> <p class="mt-6 text-lg leading-8 text-gray-600">KARL integrates directly with <a href="https://raindancer.com/" target="_blank" rel="noopener noreferrer" class="text-gray-700 underline hover:text-gray-900">Raindancer</a> irrigation machines. Our system automatically generates VRI prescription maps and pushes them to your Raindancer account every day, with no manual steps.</p> <p class="mt-4 text-lg leading-8 text-gray-600">As satellite data updates, your irrigation zones update too. Raindancer receives new VRI maps based on the latest field conditions, ensuring your hose reel always applies the right amount of water in the right place.</p></div></div></div>');var tw=$u("<!> <!> <!> <!> <div><!></div>",1);function rw(e){var t=tw(),r=dc(t);!function(e){Yu(e,Jx())}(r);var n=hc(r,2);Kx(n);var i=hc(n,2);!function(e){gx(e,{name:"feature",classSection:"relative py-4 sm:py-6 bg-gray-50",classDiv:"py-6 px-4 mx-auto max-w-screen-2xl sm:py-10 lg:px-6",children:(e,t)=>{var r=Hx(),n=uc(r),i=hc(uc(n),2);uc(i).muted=!0,Os(i),Os(n),Os(r),Yu(e,r)},$$slots:{default:!0}})}(i);var o=hc(i,2);!function(e){gx(e,{name:"feature",classSection:"relative py-4 sm:py-6 bg-white",classDiv:"py-6 px-4 mx-auto max-w-screen-2xl sm:py-10 lg:px-6",children:(e,t)=>{Yu(e,ew())},$$slots:{default:!0}})}(o);var a=hc(o,2);!function(e){gx(e,{name:"logos",classSection:"relative py-4 sm:py-6 bg-gray-50",classDiv:"py-6 lg:py-10 mx-auto max-w-screen-2xl px-4",children:(e,t)=>{{const t=e=>{Ds(),Yu(e,Wu("Supported By"))};Ix(e,{h2:t,children:(e,t)=>{Yu(e,Qx())},$$slots:{h2:!0,default:!0}})}},$$slots:{default:!0}})}(uc(a)),Os(a),Yu(e,t)}var nw=$u('<span class="mr-2 text-5xl font-extrabold text-gray-900">Free</span>'),iw=$u("<span>Sentinel-2 satellite imagery</span>"),ow=$u("<span>Vegetation indices (NDVI, GNDVI, EVI & more)</span>"),aw=$u("<span>Precipitation & weather data</span>"),sw=$u("<span>Irrigation event tracking</span>"),lw=$u("<span>Task management</span>"),cw=$u('<!> <ul class="mb-8 space-y-4 text-left flex-1"><!> <!> <!> <!> <!></ul> <!>',1),uw=$u('<span class="mr-2 text-5xl font-extrabold text-emerald-600">€3</span> <span class="text-gray-500">/ha per year</span>',1),dw=$u("<span>Everything in Free</span>"),hw=$u("<span>Daily cloud-free satellite imagery</span>"),fw=$u("<span>Cloud-free vegetation indices (NDVI, GNDVI & more)</span>"),pw=$u("<span>Historical imagery archive</span>
29"),gw=$u('<!> <ul class="mb-8 space-y-4 text-left flex-1"><!> <!> <!> <!></ul> <!>',1),mw=$u('<span class="mr-2 text-5xl font-extrabold text-blue-600">€10</span> <span class="text-gray-500">/ha per year</span>',1),yw=$u("<span>Everything in Free</span>"),_w=$u("<span>Everything in ClearSKY</span>"),vw=$u("<span>Evapotranspiration (ET) data</span>"),bw=$u("<span>Variable Rate Irrigation (VRI) planning</span>"),xw=$u("<span>Water balance analytics</span>"),ww=$u('<!> <ul class="mb-8 space-y-4 text-left flex-1"><!> <!> <!> <!> <!></ul> <!>',1),Sw=$u('<!> <div class="space-y-8 sm:gap-6 lg:grid lg:grid-cols-3 lg:space-y-0 xl:gap-10 items-stretch"><!> <!> <!></div> <p class="mt-8 text-center text-sm text-gray-500">All paid features are upgraded per field inside the app, billed per hectare.</p>',1);function kw(e){gx(e,{name:"pricing",class:"bg-gradient-to-br from-blue-50 via-white to-yellow-50",children:(e,t)=>{var r=Sw(),n=dc(r);{const e=e=>{Ds(),Yu(e,Wu("Simple, Transparent Pricing"))},t=e=>{Ds(),Yu(e,Wu("Start free with satellite imagery and field management. Upgrade when you need advanced irrigation tools or daily cloudless imagery."))};!function(e,t){const r=cd(t),n=uh(t,["children","$$slots","$$events","$$legacy"]);Zs(t,!1);let i=fh(t,"divClass",8,"mx-auto max-w-screen-md text-center mb-8 lg:mb-12"),o=fh(t,"h2Class",8,"mb-4 text-4xl tracking-tight font-extrabold text-gray-900 dark:text-white"),a=fh(t,"pClass",8,"mb-5 font-light text-gray-500 sm:text-xl dark:text-gray-400");ih();var s=zx(),l=uc(s),c=e=>{var r=Ox();ld(uc(r),t,"h2",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(o()),ku(n),xu((()=>(0,fx.twMerge)(o(),n.classH2)))))]),Yu(e,r)};ad(l,(e=>{xu((()=>r.h2))&&e(c)}));var u=hc(l,2),d=e=>{var r=Dx();ld(uc(r),t,"paragraph",{},null),Os(r),Pc((e=>wd(r,1,e)),[()=>_d((ku(fx.twMerge),ku(a()),ku(n),xu((()=>(0,fx.twMerge)(a(),n.classP)))))]),Yu(e,r)};ad(u,(e=>{xu((()=>r.paragraph))&&e(d)})),Os(s),Pc((e=>wd(s,1,e)),[()=>_d((ku(fx.twMerge),ku(i()),ku(n),xu((()=>(0,fx.twMerge)(i(),n.class)))))]),Yu(e,s),Ys()}(n,{h2:e,paragraph:t,$$slots:{h2:!0,paragraph:!0}})}var i=hc(n,2),o=uc(i);Ex(o,{class:"border-2 border-gray-200 hover:border-blue-300 hover:shadow-xl transition-all duration-300 h-full",children:(e,t)=>{var r=cw(),n=dc(r);{const e=e=>{Ds(),Yu(e,Wu("Free"))},t=e=>{Ds(),Yu(e,Wu("Get started with satellite data and field management at no cost."))},r=e=>{Yu(e,nw())};Lx(n,{h3:e,paragraph:t,price:r,$$slots:{h3:!0,paragraph:!0,price:!0}})}var i=hc(n,2),o=uc(i);Gx(o,{class:"text-green-500",children:(e,t)=>{Yu(e,iw())},$$slots:{default:!0}});var a=hc(o,2);Gx(a,{class:"text-green-500",children:(e,t)=>{Yu(e,ow())},$$slots:{default:!0}});var s=hc(a,2);Gx(s,{class:"text-green-500",children:(e,t)=>{Yu(e,aw())},$$slots:{default:!0}});var l=hc(s,2);Gx(l,{class:"text-green-500",children:(e,t)=>{Yu(e,sw())},$$slots:{default:!0}}),Gx(hc(l,2),{class:"text-green-500",children:(e,t)=>{Yu(e,lw())},$$slots:{default:!0}}),Os(i),P_(hc(i,2),{href:"/accounts/signup/",color:"light",class:"w-full border-2 border-gray-300 hover:border-blue-400 font-semibold",children:(e,t)=>{Ds(),Yu(e,Wu("Get Started"))},$$slots:{default:!0}}),Yu(e,r)},$$slots:{default:!0}});var a=hc(o,2);Ex(a,{class:"border-2 border-gray-200 hover:border-emerald-400 hover:shadow-xl transition-all duration-300 h-full",children:(e,t)=>{var r=gw(),n=dc(r);{const e=e=>{Ds(),Yu(e,Wu("ClearSKY"))},t=e=>{Ds(),Yu(e,Wu("Daily cloud-free satellite imagery without the full Pro suite."))},r=e=>{var t=uw();Ds(2),Yu(e,t)};Lx(n,{h3:e,paragraph:t,price:r,$$slots:{h3:!0,paragraph:!0,price:!0}})}var i=hc(n,2),o=uc(i);Gx(o,{class:"text-green-500",children:(e,t)=>{Yu(e,dw())},$$slots:{default:!0}});var a=hc(o,2);Gx(a,{class:"text-green-500",children:(e,t)=>{Yu(e,hw())},$$slots:{default:!0}});var s=hc(a,2);Gx(s,{class:"text-green-500",children:(e,t)=>{Yu(e,fw())},$$slots:{default:!0}}),Gx(hc(s,2),{class:"text-green-500",children:(e,t)=>{Yu(e,pw())},$$slots:{default:!0}}),Os(i),P_(hc(i,2),{href:"/accounts/signup/",color:"green",class:"w-full bg-gradient-to-r from-emerald-500 to-emerald-600 hover:from-emerald-600 hover:to-emerald-700 text-white",children:(e,t)=>{Ds(),Yu(e,Wu("Start Free & Upgrade In-App"))},$$slots:{default:!0}}),Yu(e,r)},$$slots:{default:!0}}
29),Ex(hc(a,2),{class:"border-2 border-blue-500 bg-blue-50/50 hover:shadow-xl transition-all duration-300 h-full",children:(e,t)=>{var r=ww(),n=dc(r);{const e=e=>{Ds(),Yu(e,Wu("Pro"))},t=e=>{Ds(),Yu(e,Wu("Fully automated Precision Irrigation with VRI mapping."))},r=e=>{var t=mw();Ds(2),Yu(e,t)};Lx(n,{h3:e,paragraph:t,price:r,$$slots:{h3:!0,paragraph:!0,price:!0}})}var i=hc(n,2),o=uc(i);Gx(o,{class:"text-green-500",children:(e,t)=>{Yu(e,yw())},$$slots:{default:!0}});var a=hc(o,2);Gx(a,{class:"text-green-500",children:(e,t)=>{Yu(e,_w())},$$slots:{default:!0}});var s=hc(a,2);Gx(s,{class:"text-green-500",children:(e,t)=>{Yu(e,vw())},$$slots:{default:!0}});var l=hc(s,2);Gx(l,{class:"text-green-500",children:(e,t)=>{Yu(e,bw())},$$slots:{default:!0}}),Gx(hc(l,2),{class:"text-green-500",children:(e,t)=>{Yu(e,xw())},$$slots:{default:!0}}),Os(i),P_(hc(i,2),{href:"/accounts/signup/",color:"blue",class:"w-full bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800",children:(e,t)=>{Ds(),Yu(e,Wu("Start Free & Upgrade In-App"))},$$slots:{default:!0}}),Yu(e,r)},$$slots:{default:!0}}),Os(i),Ds(2),Yu(e,r)},$$slots:{default:!0}})}var Tw=$u('<div class="max-w-screen-md mx-auto text-center mb-12"><h2 class="mb-4 text-4xl tracking-tight font-extrabold text-gray-900">Our Products</h2> <p class="font-light text-gray-500 sm:text-xl">Tools built for modern irrigation management.</p></div> <div class="max-w-screen-lg mx-auto grid gap-8 md:grid-cols-3"><div class="bg-white rounded-xl border border-gray-200 p-8 text-center hover:shadow-lg transition-shadow"><div class="w-14 h-14 mx-auto mb-4 bg-blue-100 rounded-full flex items-center justify-center"><svg class="w-7 h-7 text-blue-600" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l5.447 2.724A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"></path></svg></div> <h3 class="text-xl font-bold text-gray-900 mb-3">VRI Irrigation App</h3> <p class="text-gray-500">Variable Rate Irrigation planning with satellite-driven prescription maps for pivot, hose reel, and drip systems.</p></div> <div class="bg-white rounded-xl border border-gray-200 p-8 text-center hover:shadow-lg transition-shadow"><div class="w-14 h-14 mx-auto mb-4 bg-emerald-100 rounded-full flex items-center justify-center"><svg class="w-7 h-7 text-emerald-600" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 13a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></div> <h3 class="text-xl font-bold text-gray-900 mb-3">Cloudless Imagery</h3> <p class="text-gray-500">Daily cloud-free satellite imagery at 20m resolution. Monitor your fields every day, regardless of weather conditions.</p></div> <div class="bg-white rounded-xl border border-gray-200 p-8 text-center hover:shadow-lg transition-shadow"><div class="w-14 h-14 mx-auto mb-4 bg-yellow-100 rounded-full flex items-center justify-center"><svg class="w-7 h-7 text-yellow-600" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"></path></svg></div> <h3 class="text-xl font-bold text-gray-900 mb-3">Raindancer Integration</h3> <p class="text-gray-500">Connect your Raindancer irrigation machines directly to KARL for real-time monitoring and automated VRI zone management.</p></div></div>',1);var Iw=$u('<div class="min-h-screen flex flex-col"><!> <main class="flex-1"><!></main> <!></div>');function Mw(e,t){Zs(t,!0);let r=fh(t,"currentPage",3,"home"),n=$l(Jl("undefined"!=typeof window?i():r()));function i(){const e=window.location.pathname;return"/"===e?"home":e.replace(/\//g,"")}"undefined"!=typeof window&&window.addEventListener("popstate",(()=>{ql(n,i(),!0)})),Tc((()=>{console.log("Current page in Svelte App:",yu(n))}));var o=Iw(),a=uc(o);hx(a,{get currentPage(){return yu(n)},navigate:function(e){ql(n,e,!0);const t="home"===e?"/":`/${e}/`;window.history.pushState({},"",t)}});var s=hc(a,2),l=uc(s),c=e=>{$x(e)},u=e=>{var t=Zu(),r=dc(t),i=e=>{kw(e)},o=e=>{var t=Zu(),r=dc(t),i=e=>{!function(e){gx(e,{name:"feature",class:"bg-gradient-to-br from-blue-50 via-white to-yellow-50",children:(e,t)=>{var r=Tw();Ds(2),Yu(e,r)},$$slots:{default:!0}})}(e)},o=e=>{rw(e)};ad(r,(e=>{"product"===yu(n)?e(i):e(o,!1)}),!0),Yu(e,t)};ad(r,(e=>{"pricing"===yu(n)?e(i):e(o,!1)}),!0),Yu(e,t)};ad(l,(e=>{"contact"===yu(n)?e(c):e(u,!1)})),Os(s),lx(hc(s,2)),Os(o),Yu(e,o),Ys()}function Ew(e){var t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(n)}function Pw(e){return("string"==typeof e?new Date("".concat(e,"T00:00:00")):e).toLocaleDateString("en-GB",{day:"numeric",month:"short"})}var Aw=[{value:"rgb",label:"RGB",fullName:"True Color Composite",formula:"B4, B3, B2",category:"visual",bands:"B4 (Red), B3 (Green), B2 (Blue)",description:"Natural color composite",available:!1,sources:["clearsky"]},{value:"ndvi",label:"NDVI",fullName:"Normalized Difference Vegetation Index",formula:"(B8A − B4) / (B8A + B4)",category:"vegetation",bands:"B8A (NIR), B4 (Red)",description:"Classic greenness index. Saturates above ~0.8 and distorted by bare soil early season.",available:!0,color:"#16a34a",backgroundColor:"rgba(22, 163, 74, 0.1)"},{value:"gndvi",label:"GNDVI",fullName:"Green Normalized Difference Vegetation Index",formula:"(B8A − B3) / (B8A + B3)",category:"vegetation",bands:"B8A (NIR), B3 (Green)",description:"More sensitive to chlorophyll than NDVI, saturates later. Good chlorophyll/N proxy.",available:!0,color:"#65a30d",backgroundColor:"rgba(101, 163, 13, 0.1)"},{value:"msavi",label:"MSAVI",fullName:"Modified Soil Adjusted Vegetation Index",formula:"0.5 × (2×B8A + 1 − √((2×B8A+1)² − 8×(B8A−B4)))",category:"vegetation",bands:"B8A (NIR), B4 (Red)",description:"Self adjusting soil correction. Use instead of N
29DVI when canopy cover < 50%.",available:!0,color:"#4ade80",backgroundColor:"rgba(74, 222, 128, 0.1)"},{value:"ndrei",label:"NDRE",fullName:"Normalized Difference Red Edge Index",formula:"(B8A − B5) / (B8A + B5)",category:"nutrient",bands:"B8A (NIR), B5 (Red Edge)",description:"Sensitive to chlorophyll and nitrogen; doesn't saturate until very high biomass.",available:!0,color:"#7c3aed",backgroundColor:"rgba(124, 58, 237, 0.1)"},{value:"cire",label:"CIre",fullName:"Chlorophyll Index Red Edge",formula:"(B8A / B5) − 1",category:"nutrient",bands:"B8A (NIR), B5 (Red Edge)",description:"Nearly linear relationship to leaf chlorophyll. Preferred for quantitative estimation.",available:!0,color:"#059669",backgroundColor:"rgba(5, 150, 105, 0.1)"},{value:"ndmi",label:"NDMI",fullName:"Normalized Difference Moisture Index",formula:"(B8A − B11) / (B8A + B11)",category:"water",bands:"B8A (NIR), B11 (SWIR)",description:"Standard canopy water content index. The moisture workhorse for agriculture.",available:!0,color:"#2563eb",backgroundColor:"rgba(37, 99, 235, 0.1)"},{value:"ndwi",label:"NDWI",fullName:"Normalized Difference Water Index",formula:"(B3 − B8A) / (B3 + B8A)",category:"water",bands:"B3 (Green), B8A (NIR)",description:"Original McFeeters NDWI for open water detection.",available:!0,color:"#0284c7",backgroundColor:"rgba(2, 132, 199, 0.1)"}],Cw=[{key:"visual",label:"Visual"},{key:"vegetation",label:"Vegetation & Biomass"},{key:"nutrient",label:"Nutrient & Chlorophyll"},{key:"water",label:"Water & Moisture"}],Rw="TRIAL_2026",Lw={pro:10,clearsky:3};function Ow(e){switch(e){case"last-irrigation":case"custom":return null;case"last-7":default:return 7;case"last-14":return 14;case"last-30":return 30}}var Dw="karl.sidebar.cropZoneFlatMode",zw="karl.layers.showRaindancerVRI";function Fw(e,t){if("undefined"==typeof localStorage)return t;try{var r=localStorage.getItem(e);return null===r?t:"true"===r}catch(e){return t}}function Nw(e,t){if("undefined"!=typeof localStorage)try{localStorage.setItem(e,t?"true":"false")}catch(e){}}var Bw=Jl({selectedFieldId:null,selectedFieldName:"",selectedCropZoneId:null,hoveredFieldId:null,activeBaseLayer:"satellite",showETLayer:!1,showVegetationIndexLayer:!1,layerToggleVersion:0,showIrrigationEquipment:!0,vriData:null,mapZoom:8,mapCenter:null,mapBounds:null,imagerySource:"standard",clearSkyDates:[],vegetationIndexType:"ndvi",satelliteReferenceFieldName:"",vegetationImages:[],selectedVegetationDate:null,vegetationSearchLoading:!1,vegetationLoadedFromDate:null,vegetationFetchedMonths:new Set,fieldStatistics:null,fieldStatisticsLoading:!1,legendColorScale:null,metricChangeFirst:null,metricChangeLast:null,metricChangeLoading:!1,showChangeRaster:!1,changeRasterData:null,changeRasterMode:"abs",changeRasterLoading:!1,selectedETDate:null,etAvailableDates:[],etDatesLoading:!1,etFetchedMonths:new Set,crossLayerReferenceDate:null,lastIrrigationDate:!0,selectedStartDate:"",selectedEndDate:"",selectedDaysBack:7,tableSortKey:"lastIrrigationEvent",tableSortAsc:!0,sidebarDateMode:"last-7",sidebarSelectedMetric:null,sidebarGroupBy:"none",cropZoneFlatMode:Fw(Dw,!1),fieldTimelineStart:Ew(new Date(Date.now()-6048e5)),fieldTimelineEnd:Ew(new Date),upgradeModalOpen:!1,upgradeTier:null,upgradeTrialCode:"",upgradeFieldSelectionActive:!1,upgradeSelectedFieldIds:[],upgradePreselectedFieldId:null,addFieldNeedsTypeSelection:!1,exportFieldSelectionActive:!1,exportSelectedFieldIds:[],gridViewPage:0,showRaindancerVRI:Fw(zw,!0),raindancerVRIData:null,raindancerVRILoading:!1});var jw=6371008.8,Vw={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*jw,kilometers:6371.0088,kilometres:6371.0088,meters:jw,metres:jw,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:jw/1852,radians:1,yards:6967335.223679999};function Gw(e,t,r={}){const n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function Uw(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Qw(e[0])||!Qw(e[1]))throw new Error("coordinates must contain numbers");return Gw({type:"Point",coordinates:e},t,r)}function $w(e,t,r={}
29){for(const t of e){if(t.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(t[t.length-1].length!==t[0].length)throw new Error("First and last Position are not equivalent.");for(let e=0;e<t[t.length-1].length;e++)if(t[t.length-1][e]!==t[0][e])throw new Error("First and last Position are not equivalent.")}return Gw({type:"Polygon",coordinates:e},t,r)}function Hw(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return Gw({type:"LineString",coordinates:e},t,r)}function qw(e,t={}){const r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function Ww(e,t,r={}){return Gw({type:"MultiLineString",coordinates:e},t,r)}function Zw(e,t,r={}){return Gw({type:"MultiPolygon",coordinates:e},t,r)}function Yw(e,t="kilometers"){const r=Vw[t];if(!r)throw new Error(t+" units is invalid");return e*r}function Xw(e,t="kilometers"){const r=Vw[t];if(!r)throw new Error(t+" units is invalid");return e/r}function Kw(e){return 180*(e%(2*Math.PI))/Math.PI}function Jw(e){return e%360*Math.PI/180}function Qw(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function eS(e,t,r){if(null!==e)for(var n,i,o,a,s,l,c,u,d=0,h=0,f=e.type,p="FeatureCollection"===f,g="Feature"===f,m=p?e.features.length:1,y=0;y<m;y++){s=(u=!!(c=p?e.features[y].geometry:g?e.geometry:e)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<s;_++){var v=0,b=0;if(null!==(a=u?c.geometries[_]:c)){l=a.coordinates;var x=a.type;switch(d=!r||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===t(l,h,y,v,b))return!1;h++,v++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],h,y,v,b))return!1;h++,"MultiPoint"===x&&v++}"LineString"===x&&v++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-d;i++){if(!1===t(l[n][i],h,y,v,b))return!1;h++}"MultiLineString"===x&&v++,"Polygon"===x&&b++}"Polygon"===x&&v++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(b=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-d;o++){if(!1===t(l[n][i][o],h,y,v,b))return!1;h++}b++}v++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===eS(a.geometries[n],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function tS(e,t){var r,n,i,o,a,s,l,c,u,d,h=0,f="FeatureCollection"===e.type,p="Feature"===e.type,g=f?e.features.length:1;for(r=0;r<g;r++){for(s=f?e.features[r].geometry:p?e.geometry:e,c=f?e.features[r].properties:p?e.properties:{},u=f?e.features[r].bbox:p?e.bbox:void 0,d=f?e.features[r].id:p?e.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,h,c,u,d))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===t(o.geometries[n],h,c,u,d))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,c,u,d))return!1;h++}}function rS(e,t){tS(e,(function(e,r,n,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(Gw(e,n,{bbox:i,id:o}),r,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<e.coordinates.length;l++){var c=e.coordinates[l];if(!1===t(Gw({type:a,coordinates:c},n),r,l))return!1}}))}function nS(e,t,r){var n=r,i=!1;return function(e,t){rS(e,(function(e,r,n){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var a,s=0,l=0,c=0;return!1!==eS(e,(function(o,u,d,h,f){if(void 0===a||r>s||h>l||f>c)return a=o,s=r,l=h,c=f,void(i=0);var p=Hw([a,o],e.properties);if(!1===t(p,r,n,f,i))return!1;i++,a=o}))&&void 0}}}))}(e,(function(e,o,a,s,l){n=!1===i&&void 0===r?e:t(n,e,o,a,s,l),i=!0})),n}function iS(e){return function(e,t,r){var n=r;return tS(e,(function(e,i,o,a,s){n=0===i&&void 0===r?e:t(n,e,i,o,a,s)})),n}(e,((e,t)=>e+function(e){let t,r=0;switch(e.type){case"Polygon":return oS(e.coordinates);case"MultiPolygon":for(t=0;
29t<e.coordinates.length;t++)r+=oS(e.coordinates[t]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(t)),0)}function oS(e){let t=0;if(e&&e.length>0){t+=Math.abs(lS(e[0]));for(let r=1;r<e.length;r++)t-=Math.abs(lS(e[r]))}return t}var aS=20294876564838.72,sS=Math.PI/180;function lS(e){const t=e.length-1;if(t<=2)return 0;let r=0,n=0;for(;n<t;){const i=e[n],o=e[n+1===t?0:n+1],a=e[n+2>=t?(n+2)%t:n+2],s=i[0]*sS,l=o[1]*sS;r+=(a[0]*sS-s)*Math.sin(l),n++}return r*aS}var cS=i(842),uS=i.n(cS);function dS(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return hS(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hS(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function hS(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function fS(e){return iS(e)/1e4}function pS(e){return fS(e).toFixed(1)}function gS(e){try{var t=[],r=function(e){if("number"==typeof e[0]&&"number"==typeof e[1])t.push(e);else{var n,i=dS(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r(o)}}catch(e){i.e(e)}finally{i.f()}}};if(r(e.geometry.coordinates),0===t.length)return null;var n=t.reduce((function(e,t){return e+t[0]}),0),i=t.reduce((function(e,t){return e+t[1]}),0);return[n/t.length,i/t.length]}catch(e){return null}}function mS(e){var t;if(null==e||null===(t=e.features)||void 0===t||!t.length)return null;var r=new(uS().LngLatBounds);return e.features.forEach((function(e){if(e.geometry){var t=function(e){"number"==typeof e[0]?r.extend(e):e.forEach(t)};t(e.geometry.coordinates)}})),r.isEmpty()?null:r}var yS=$u('<div class="flex justify-between mb-2"><span class="text-gray-600">Trial code</span> <span class="font-semibold text-green-600"> </span></div>'),_S=$u('<span class="line-through text-gray-400 text-base mr-1"> </span> €0.00',1),vS=$u('<div class="bg-red-50 border border-red-200 rounded-lg p-3 mb-4"><p class="text-sm text-red-700"> </p></div>'),bS=$u('<div class="text-center"><div><span class="text-2xl font-bold text-white"> </span></div> <h2 class="text-2xl font-bold text-gray-900 mb-2">Confirm Upgrade</h2> <div class="bg-gray-50 rounded-xl p-4 mb-4 text-left"><div class="flex justify-between mb-2"><span class="text-gray-600">Plan</span> <span class="font-semibold"> </span></div> <!> <div class="flex justify-between mb-2"><span class="text-gray-600">Fields</span> <span class="font-semibold"> </span></div> <div class="flex justify-between mb-2"><span class="text-gray-600">Total area</span> <span class="font-semibold"> </span></div> <div class="border-t border-gray-200 pt-2 mt-2"><div class="flex justify-between"><span class="text-gray-600">Annual cost</span> <span class="text-xl font-bold text-blue-600"><!></span></div></div></div> <div class="bg-amber-50 border border-amber-200 rounded-lg p-4 mb-4"><div class="flex items-start gap-3"><span class="text-amber-500 text-xl">&#9203;</span> <div class="text-left"><p class="text-sm font-medium text-amber-800">Data preparation in progress</p> <p class="text-xs text-amber-700 mt-1">Your satellite imagery and daily updates will be ready within <strong>24-72 hours</strong>.</p></div></div></div> <!> <div class="flex gap-3"><!> <!></div></div>'),xS=$u('<span class="inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 rounded-full text-xs font-medium"> </span>'),wS=$u('<span class="inline-flex items-center gap-1 px-2 py-0.5 bg-sky-100 text-sky-700 rounded-full text-xs font-medium"> </span>'),SS=$u('<div class="flex items-center justify-between text-sm"><span class="text-gray-700"> </span> <span class="text-gray-500"> <span class="font-medium text-blue-600"> </span></span></div>'),kS=$u('<div><div class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1">Pro Fields</div> <div class="space-y-1"><!> <div class="flex items-center justify-between text-sm pt-1 border-t border-gray-100"><span class="font-medium text-gray-700">Pro Subtotal</span> <span class="font-semibold text-blue-600"> </span></div></div></div>'),TS=$u('<div class="flex items-center justify-between text-sm"><span class="text-gray-700"> </span> <span class="text-gray-500"> <span class="font-medium text-sky-600"> </span></span></div>'),IS=$u('<div><div class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1">ClearSKY Fields</div> <div class="space-y-1"><!> <div class="flex items-center justify-between text-sm pt-1 border-t border-gray-100"><span class="font-medium text-gray-700">ClearSKY Subtotal</span> <span class="font-semibold text-sky-600"> </span></div></div></div>'),MS=$u('<div class="mt-3 pt-3 border-t border-gray-200 space-y-3"><!> <!> <div class="flex items-center justify-between text-sm pt-2 border-t border-gray-300"><span class="font-semibold text-gray-900">Total Annual Cost</span> <span class="font-bold text-gray-900"> </span></div></div>'),ES=$u('<div class="mt-3 bg-gray-50 rounded-lg p-3"><button class="w-full flex items-center justify-between text-left"><div class="flex items-center gap-3"><span class="text-sm text-gray-600">Current Plan:</span> <div class="flex items-center gap-2"><!> <!></div></div> <div class="flex items-center gap-2"><span class="text-sm font-semibold text-gray-900"> </span> <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
29<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></div></button> <!></div>'),PS=$u('<p class="text-sm text-gray-500 mt-2">All fields are on the Free plan</p>'),AS=$u('<span class="line-through text-gray-400 font-normal"> </span> &euro;0',1),CS=$u('<span class="line-through text-gray-400 font-normal"> </span> &euro;0',1),RS=$u('<span class="text-green-600 text-sm font-medium">&#10003; Applied</span>'),LS=$u('<span class="text-red-500 text-sm font-medium">Invalid code</span>'),OS=$u('<span class="text-xs text-gray-500"> </span>'),DS=$u('<p class="text-sm text-gray-500"> </p>'),zS=$u('<span class="line-through text-gray-400 text-sm mr-1"> </span> &euro;0.00',1),FS=$u('<div class="mt-3 pt-3 border-t border-gray-200"><div class="flex items-center justify-between text-sm"><span class="text-gray-600"> </span> <span><!> <span class="text-xs font-normal text-gray-500">/year</span></span></div></div>'),NS=$u('<div class="bg-red-50 border border-red-200 rounded-lg p-3 mb-4"><p class="text-sm text-red-700"> </p></div>'),BS=$u('<div class="mb-4"><h2 class="text-xl font-bold text-gray-900">Upgrade Your Fields</h2> <!></div> <div class="grid grid-cols-2 gap-4 mb-4"><button><div class="flex items-center gap-3 mb-2"><div class="w-10 h-10 bg-gradient-to-br from-sky-400 to-sky-500 rounded-full flex items-center justify-center"><span class="text-lg font-bold text-white">C</span></div> <div><h3 class="font-semibold text-gray-900">ClearSKY</h3> <div class="text-sm font-bold text-sky-600"><!> <span class="text-xs font-normal text-gray-500">/ha/yr</span></div></div></div> <ul class="text-xs text-gray-600 space-y-0.5"><li class="flex items-center gap-1"><span class="text-green-500">&#10003;</span> Daily cloudless satellite imagery</li> <li class="flex items-center gap-1"><span class="text-green-500">&#10003;</span> 10m&sup2; resolution</li> <li class="flex items-center gap-1"><span class="text-green-500">&#10003;</span> NDVI, NDRE, LAI indices</li></ul></button> <button><div class="flex items-center gap-3 mb-2"><div class="w-10 h-10 bg-gradient-to-br from-blue-500 to-indigo-500 rounded-full flex items-center justify-center"><span class="text-lg font-bold text-white">P</span></div> <div><h3 class="font-semibold text-gray-900">Pro <span class="text-xs font-normal text-gray-400">Best Value</span></h3> <div class="text-sm font-bold text-blue-600"><!> <span class="text-xs font-normal text-gray-500">/ha/yr</span></div></div></div> <p class="text-xs text-gray-600 mb-2"><span class="font-medium text-gray-700">Includes all ClearSKY features</span> plus:</p> <ul class="text-xs text-gray-600 space-y-0.5"><li class="flex items-center gap-1"><span class="text-green-500">&#10003;</span> Daily cloudless satellite imagery (10m&sup2;)</li> <li class="flex items-center gap-1"><span class="text-green-500">&#10003;</span> Evapotranspiration data (20m&sup2;)</li> <li class="flex items-center gap-1"><span class="text-green-500">&#10003;</span> Variable Rate Irrigation (VRI)</li> <li class="flex items-center gap-1"><span class="text-green-500">&#10003;</span> VRA prescription exports</li></ul></button></div> <div class="mb-4"><label class="text-sm font-medium text-gray-700 mb-1 block">Code</label> <div class="flex items-center gap-2"><input type="text" class="flex-1 text-sm border border-gray-300 rounded-md px-3 py-2 focus:ring-blue-500 focus:border-blue-500 uppercase" placeholder="Enter trial code"/> <!></div></div> <div class="bg-gray-50 rounded-xl p-4 mb-4"><div class="flex items-center justify-between mb-1"><span class="text-sm font-medium text-gray-700">Select Fields in Sidebar to Upgrade</span> <!></div> <!></div> <!> <!> <p class="text-xs text-center text-gray-400 mt-3">Use the checkboxes in the sidebar to select which fields to upgrade</p>',1),jS=$u('<div class="absolute z-[1100] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-2xl px-4"><div class="bg-white rounded-xl shadow-2xl p-6 relative"><button class="absolute top-4 right-4 text-gray-400 hover:text-gray-600 w-8 h-8 flex items-center justify-center text-2xl font-light hover:bg-gray-100 rounded-lg transition-colors">
29&times;</button> <!></div></div>');Bu(["click"]);var VS=$u('<div class="fixed inset-0 z-[2100] flex items-center justify-center bg-black/50"><div class="bg-white rounded-xl shadow-2xl w-full max-w-lg mx-4 text-center"><div class="px-6 pt-8 pb-2"><div class="mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4"><svg class="w-8 h-8 text-green-600" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 6.75V15m6-6v8.25m.503 3.498l4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 00-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0z"></path></svg></div> <h3 class="text-xl font-semibold text-gray-900">Welcome to KARL Irrigation</h3> <p class="text-gray-500 mt-2 text-sm">How would you like to get started?</p></div> <div class="px-6 py-5 flex flex-col gap-3"><button class="w-full px-4 py-4 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors font-medium text-base flex flex-col items-start gap-1"><span class="flex items-center gap-2 font-semibold"><svg class="w-5 h-5 flex-shrink-0" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 6.75V15m6-6v8.25m.503 3.498l4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 00-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0z"></path></svg> Add Your First Field</span> <span class="text-green-100 text-sm font-normal text-left">Draw a polygon or place a pivot circle on the map.</span></button> <div class="flex items-center gap-3"><div class="flex-1 h-px bg-gray-200"></div> <span class="text-xs text-gray-400 font-medium uppercase tracking-wide">or</span> <div class="flex-1 h-px bg-gray-200"></div></div> <button class="w-full px-4 py-4 bg-white border-2 border-amber-300 text-gray-800 rounded-lg hover:bg-amber-50 hover:border-amber-400 transition-colors font-medium text-base flex flex-col items-start gap-1"><span class="flex items-center gap-2 font-semibold"><img src="/static/images/web/RaindancerLogo.png" alt="Raindancer" class="w-5 h-5 object-contain flex-shrink-0"/> Sync from Raindancer</span> <span class="text-gray-500 text-sm font-normal text-left">Already using Raindancer? Connect your account to import your fields automatically.</span></button></div></div></div>');function GS(e){return GS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GS(e)}function US(e){return function(e){if(Array.isArray(e))return $S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return $S(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function HS(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */HS=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 29
29if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==GS(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(GS(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
29if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function qS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function WS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qS(Object(r),!0).forEach((function(t){ZS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ZS(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=GS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=GS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==GS(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YS(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function XS(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){YS(o,n,i,a,s,"next",e)}function s(e){YS(o,n,i,a,s,"throw",e)}a(void 0)}))}}function KS(e,t,r){return JS.apply(this,arguments)}function JS(){return JS=XS(HS().mark((function e(t,r,n){var i,o,a,s,l=arguments;return HS().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=l.length>3&&void 0!==l[3]?l[3]:0,e.prev=1,o={polygon_geojson:{type:"Feature",geometry:t},start_date:r,end_date:n,buffer_size_meter:i},e.next=5,fetch("/environmental/api/evapotranspiration/aggregated/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(o)});case 5:if((a=e.sent).ok){e.next=9;break}return console.error("[environmental] Failed to fetch ET grid: HTTP ".concat(a.status,": ").concat(a.statusText)),e.abrupt("return",null);case 9:return e.next=11,a.json();case 11:return s=e.sent,e.abrupt("return",s);case 15:return e.prev=15,e.t0=e.catch(1),console.error("[environmental] Error fetching ET grid:",e.t0),e.abrupt("return",null);case 19:case"end":return e.stop()}}),e,null,[[1,15]])}))),JS.apply(this,arguments)}function QS(e,t,r){return ek.apply(this,arguments)}function ek(){return ek=XS(HS().mark((function e(t,r,n){var i,o,a,s,l=arguments;return HS().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=l.length>3&&void 0!==l[3]?l[3]:0,e.prev=1,o={polygon_geojson:{type:"Feature",geometry:t},year:r,month:n,buffer_size_meter:i},e.next=5,fetch("/environmental/api/evapotranspiration/available-dates/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(o)});case 5:if((a=e.sent).ok){e.next=9;break}return console.error("[environmental] Failed to fetch ET dates: HTTP ".concat(a.status,": ").concat(a.statusText)),e.abrupt("return",[]);case 9:return e.next=11,a.json();case 11:return s=e.sent,e.abrupt("return",s.dates||[]);case 15:return e.prev=15,e.t0=e.catch(1),console.error("[environmental] Error fetching ET available dates:",e.t0),e.abrupt("return",[]);case 19:case"end":return e.stop()}}),e,null,[[1,15]])}))),ek.apply(this,arguments)}Bu(["click"]);var tk=new Map;function rk(e){return JSON.stringify(e).slice(0,200)}function nk(e){return ik.apply(this,arguments)}function ik(){return ik=XS(HS().mark((function e(t){var r,n,i,o;return HS().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=rk(t),!(n=tk.get(r))){e.next=4;break}return e.abrupt("return",n);case 4:return e.prev=4,e.next=7,fetch("/environmental/api/evapotranspiration/grid-cells/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({polygon_geojson:{type:"Feature",geometry:t}})});case 7:if((i=e.sent).ok){e.next=11;break}return console.error("[environmental] Failed to fetch ET grid cells: HTTP ".concat(i.status)),e.abrupt("return",null);case 11:return e.next=13,i.json();case 13:return o=e.sent,tk.set(r,o),e.abrupt("return",o);case 18:return e.prev=18,e.t0=e.catch(4),console.error("[environmental] Error fetching ET grid cells:",e.t0),e.abrupt("return",null);case 22:case"end":return e.stop()}}),e,null,[[4,18]])}))),ik.apply(this,arguments)}function ok(e,t,r){return ak.apply(this,arguments)}function ak(){return(ak=XS(HS().mark((function e(t,r,n){var i,o;return HS().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/environmental/api/evapotranspiration/values/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({polygon_geojson:{type:"Feature",geometry:t},start_date:r,end_date:n,buffer_size_meter:0})});case 3:if((i=e.sent).ok){e.next=7;break}return console.error("[environmental] Failed to fetch ET values: HTTP ".concat(i.status)),e.abrupt("return",null);case 7:return e.next=9,i.json();case 9:return o=e.sent,e.abrupt("return",o.values||null);case 13:return e.prev=13,e.t0=e.catch(0),console.error("[environmental] Error fetching ET values:",e.t0),e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function sk(e,t){return{type:"FeatureCollection",features:e.features.filter((function(e){return void 0!==t[String(e.id)]})).map((function(e){return WS(WS({},e),{},{properties:{aggregated:{value:t[String(e.id)]}}})}))}}function lk(){return(lk=XS(HS().mark((function e(t,r,n){var i,o;return HS().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nk(t);case 2:if(!((i=e.sent)&&i.features.length>0)){e.next=9;break}return e.next=6,ok(t,r,n);case 6:if(!(o=e.sent)){e.next=9;break}return e.abrupt("return",sk(i,o));case 9:return e.abrupt("return",KS(t,r,n));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ck(e,t,r){return uk.apply(this,arguments)}function uk(){return(uk=XS(HS().mark((function e(t,r,n){var i,o,a,s,l,c,u;return HS().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i="".concat(r,"-").concat(String(n).padStart(2,"0")),!Bw.etFetchedMonths.has(i)){e.next=3;break}return e.abrupt("return");case 3:return Bw.etDatesLoading=!0,e.prev=4,e.next=7,QS(t,r,n);case 7:o=e.sent,Bw.etFetchedMonths.add(i),a=new Set(Bw.etAvailableDates),(s=o.filter((function(e){return!a.has(e)}))).length>0&&(Bw.etAvailableDates=[].concat(US(Bw.etAvailableDates),US(s)).sort()),!Bw.selectedETDate&&Bw.etAvailableDates.length>0&&(l=US(Bw.etAvailableDates).sort((function(e,t){return t.localeCompare(e)})),Bw.crossLayerReferenceDate?(u=null!==(c=l.find((function(e){return e<=Bw.crossLayerReferenceDate})))&&void 0!==c?c:l[0],Bw.selectedETDate=u):Bw.selectedETDate=l[0]),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),console.error("[environmental] Failed to load ET dates:",e.t0);case 18:return e.prev=18,Bw.etDatesLoading=!1,e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[4,15,18,21]])})))).apply(this,arguments)}function dk(e,t,r){var n,i=null==r||null===(n=r.features)||void 0===n?void 0:n.find((function(e){return Number(e.id)===Bw.selectedFieldId}));null!=i&&i.geometry&&ck(i.geometry,e,t+1)}function hk(e){return hk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hk(e)}function fk(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */fk=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 29
29if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==hk(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(hk(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
29if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function pk(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function gk(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){pk(o,n,i,a,s,"next",e)}function s(e){pk(o,n,i,a,s,"throw",e)}a(void 0)}))}}var mk=new Map,yk=new Map;function _k(e,t,r,n){var i=e.toFixed(4),o=t.toFixed(4);return"".concat(i,",").concat(o,",").concat(r,",").concat(n)}function vk(){return vk=gk(fk().mark((function e(t,r,n){var i,o,a,s,l,c,u,d,h=arguments;return fk().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=h.length>3&&void 0!==h[3]?h[3]:(new Date).toISOString().split("T")[0],o=h.length>4?h[4]:void 0,a=(n||"").split("T")[0],s=(i||"").split("T")[0],l=_k(t,r,a,s),null!=o&&o.forceRefresh){e.next=12;break}if(!((c=mk.get(l))&&Date.now()-c.fetchedAt<36e5)){e.next=9;break}return e.abrupt("return",c.data);case 9:if(!(u=yk.get(l))){e.next=12;break}return e.abrupt("return",u);case 12:return d=gk(fk().mark((function e(){var n,i;return fk().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat(bh.karl.apiUrl,"/weather/historical?lat=").concat(t,"&lon=").concat(r,"&start_date=").concat(a,"&end_date=").concat(s,"&token=").concat(bh.karl.apiToken),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("Weather API error: ".concat(n.status," ").concat(n.statusText));case 6:return e.next=8,n.json();case 8:return i=e.sent,mk.set(l,{data:i,fetchedAt:Date.now()}),e.abrupt("return",i);case 11:return e.prev=11,yk.delete(l),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,,11,14]])}
29)))(),yk.set(l,d),e.abrupt("return",d);case 15:case"end":return e.stop()}}),e)}))),vk.apply(this,arguments)}var bk=qu("<title> </title>"),xk=qu("<desc> </desc>"),wk=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M4 10h16m-8-3V4M7 7V4m10 3V4M5 20h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Zm3-7h.01v.01H8V13Zm4 0h.01v.01H12V13Zm4 0h.01v.01H16V13Zm-8 4h.01v.01H8V17Zm4 0h.01v.01H12V17Zm4 0h.01v.01H16V17Z"></path></svg>');function Sk(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"calendar month outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=wk();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=bk(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=xk(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}var kk=qu("<title> </title>"),Tk=qu("<desc> </desc>"),Ik=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m8 10 4 4 4-4"></path></svg>');function Mk(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"chevron down outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=Ik();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=kk(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=Tk(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}var Ek=$u('<button class="absolute top-1 right-1 p-1 rounded-full hover:bg-blue-200/50 transition-colors text-blue-300 hover:text-blue-500 z-10" title="Dismiss"><svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>'),Pk=$u('<div class="relative border-t border-gray-100 border-b border-b-blue-200/60" style="background: linear-gradient(to bottom, rgb(219 234 254 / 0.5), rgb(249 250 251 / 0.2));"><button class="w-full text-left py-3 pl-4 pr-10 hover:bg-blue-100/40 transition-all flex items-center justify-between group"><div><div class="text-xs font-semibold text-gray-700">Upgrade to Pro</div> <div class="text-[11px] text-gray-500 mt-0.5">ET, VRI, cloud-free imagery at 20m²</div></div> <svg class="w-3.5 h-3.5 text-gray-300 group-hover:text-gray-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></button> <!></div>');Bu(["click"]);var Ak=qu("<title> </title>"),Ck=qu("<desc> </desc>"),Rk=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M21 13v-2a1 1 0 0 0-1-1h-.757l-.707-1.707.535-.536a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0l-.536.535L14 4.757V4a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v.757l-1.707.707-.536-.535a1 1 0 0 0-1.414 0L4.929 6.343a1 1 0 0 0 0 1.414l.536.536L4.757 10H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h.757l.707 1.707-.535.536a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l.536-.535 1.707.707V20a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-.757l1.707-.708.536.536a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-.535-.536.707-1.707H20a1 1 0 0 0 1-1Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"></path></svg>');var Lk=i(9506),Ok=i(7379),Dk=i(563),zk=i(8622);const Fk=new Map,Nk=new Map;function Bk(e,t,r=!0){Array.isArray(e)||(e=[e]),e.forEach((e=>{Fk.set(e,t),Nk.set(e,r)}))}function jk(e,t,r,n=1){return new(Object.getPrototypeOf(e).constructor)(t*r*n)}function Vk(e,t,r){return(1-r)*e+r*t}function Gk(e,t,r,n,i,o="nearest"){switch(o.toLowerCase()){case"nearest":return function(e,t,r,n,i){const o=t/n,a=r/i;return e.map((e=>{const s=jk(e,n,i);for(let l=0;l<i;++l){const i=Math.min(Math.round(a*l),r-1);for(let r=0;r<n;++r){const a=Math.min(Math.round(o*r),t-1),c=e[i*t+a];s[l*n+r]=c}}return s}))}(e,t,r,n,i);case"bilinear":case"linear":return function(e,t,r,n,i){const o=t/n,a=r/i;return e.map((e=>{const s=jk(e,n,i);for(let l=0;l<i;++l){const i=a*l,c=Math.floor(i),u=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const a=o*r,d=a%1,h=Math.floor(a),f=Math.min(Math.ceil(a),t-1),p=e[c*t+h],g=e[c*t+f],m=e[u*t+h],y=e[u*t+f],_=Vk(Vk(p,g,d),Vk(m,y,d),i%1);s[l*n+r]=_}}return s}))}(e,t,r,n,i);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function Uk(e,t,r,n,i,o,a="nearest"){switch(a.toLowerCase()){case"nearest":return function(e,t,r,n,i,o){const a=t/n,s=r/i,l=jk(e,n,i,o);for(let c=0;c<i;++c){const i=Math.min(Math.round(s*c),r-1);for(let r=0;r<n;++r){const s=Math.min(Math.round(a*r),t-1);for(let a=0;a<o;++a){const u=e[i*t*o+s*o+a];l[c*n*o+r*o+a]=u}}}return l}(e,t,r,n,i,o);case"bilinear":case"linear":return function(e,t,r,n,i,o){const a=t/n,s=r/i,l=jk(e,n,i,o);for(let c=0;c<i;++c){const i=s*c,u=Math.floor(i),d=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const s=a*r,h=s%1,f=Math.floor(s),p=Math.min(Math.ceil(s),t-1);for(let a=0;a<o;++a){const s=e[u*t*o+f*o+a],g=e[u*t*o+p*o+a],m=e[d*t*o+f*o+a],y=e[d*t*o+p*o+a],_=Vk(Vk(s,g,h),Vk(m,y,h),i%1);l[c*n*o+r*o+a]=_}}}return l}(e,t,r,n,i,o);default:throw new Error(`Unsupported resampling method: '${a}'`)}}function $k(e,t,r){let n=0;for(let i=t;i<r;++i)n+=e[i];return n}function Hk(e,t,r){switch(e){case 1:if(t<=8)return new Uint8Array(r);if(t<=16)return new Uint16Array(r);if(t<=32)return new Uint32Array(r);break;case 2:if(8===t)return new Int8Array(r);if(16===t)return new Int16Array(r);if(32===t)return new Int32Array(r);break;case 3:switch(t){case 16:case 32:return new Float32Array(r);case 64:return new Float64Array(r)}}throw Error("Unsupported data format/bitsPerSample")}Bk([void 0,1],(()=>i.e(121).then(i.bind(i,5121)).then((e=>e.default))),!1),Bk(5,(()=>i.e(764).then(i.bind(i,383)).then((e=>e.default)))),Bk(6,(()=>{throw new Error("old style JPEG compression is not supported.")})),Bk(7,(()=>i.e(457).then(i.bind(i,6457)).then((e=>e.default)))),Bk([8,32946],(()=>Promise.all([i.e(148),i.e(424)]).then(i.bind(i,424)).then((e=>e.default)))),Bk(32773,(()=>i.e(30).then(i.bind(i,1030)).then((e=>e.default)))),Bk(34887,(()=>Promise.all([i.e(148),i.e(623)]).then(i.bind(i,4623)).then((async e=>(await e.zstd.init(),e))).then((e=>e.default)))),Bk(5e4,(()=>i.e(780).then(i.bind(i,3780)).then((async e=>(await e.zstd.init(),e))).then((e=>e.default)))),Bk(50001,(()=>i.e(568).then(i.bind(i,6568)).then((e=>e.default))),!1);const qk=class{constructor(e,t,r,n,i,o){this.fileDirectory=e,this.geoKeys=t,this.dataView=r,this.littleEndian=n,this.tiles=i?{}:null,this.isTiled=!e.StripOffsets;const a=e.PlanarConfiguration;if(this.planarConfiguration=void 0===a?1:a,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}
29getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let t=0;t<this.fileDirectory.BitsPerSample.length;++t)e+=this.getSampleByteSize(t);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(e,t){return(0,Lk.Oe)(this,e,t)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,t){return Hk(this.getSampleFormat(e),this.getBitsPerSample(e),t)}async getTileOrStrip(e,t,r,n,i){const o=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight());let s;const{tiles:l}=this;let c,u;if(1===this.planarConfiguration?s=t*o+e:2===this.planarConfiguration&&(s=r*o*a+t*o+e),this.isTiled?(c=this.fileDirectory.TileOffsets[s],u=this.fileDirectory.TileByteCounts[s]):(c=this.fileDirectory.StripOffsets[s],u=this.fileDirectory.StripByteCounts[s]),0===u){const n=this.getBlockHeight(t)*this.getTileWidth(),i=2===this.planarConfiguration?this.getSampleByteSize(r):this.getBytesPerPixel(),o=new ArrayBuffer(n*i);return this.getArrayForSample(r,o).fill(this.getGDALNoData()||0),{x:e,y:t,sample:r,data:o}}const d=(await this.source.fetch([{offset:c,length:u}],i))[0];let h;return null!==l&&l[s]?h=l[s]:(h=(async()=>{let e=await n.decode(this.fileDirectory,d);const r=this.getSampleFormat(),i=this.getBitsPerSample();return function(e,t){return(1!==e&&2!==e||!(t<=32)||t%8!=0)&&(3!==e||16!==t&&32!==t&&64!==t)}(r,i)&&(e=function(e,t,r,n,i,o,a){const s=new DataView(e),l=2===r?1:n,c=Hk(t,i,2===r?a*o:a*o*n),u=parseInt("1".repeat(i),2);if(1===t){let e;e=1===r?n*i:i;let t=o*e;7&t&&(t=t+7&-8);for(let e=0;e<a;++e){const r=e*t;for(let t=0;t<o;++t){const n=r+t*l*i;for(let r=0;r<l;++r){const a=n+r*i,d=(e*o+t)*l+r,h=Math.floor(a/8),f=a%8;if(f+i<=8)c[d]=s.getUint8(h)>>8-i-f&u;else if(f+i<=16)c[d]=s.getUint16(h)>>16-i-f&u;else if(f+i<=24){const e=s.getUint16(h)<<8|s.getUint8(h+2);c[d]=e>>24-i-f&u}else c[d]=s.getUint32(h)>>32-i-f&u}}}}return c.buffer}(e,r,this.planarConfiguration,this.getSamplesPerPixel(),i,this.getTileWidth(),this.getBlockHeight(t))),e})(),null!==l&&(l[s]=h)),{x:e,y:t,sample:r,data:await h}}async _readRaster(e,t,r,n,i,o,a,s,l){const c=this.getTileWidth(),u=this.getTileHeight(),d=this.getWidth(),h=this.getHeight(),f=Math.max(Math.floor(e[0]/c),0),p=Math.min(Math.ceil(e[2]/c),Math.ceil(d/c)),g=Math.max(Math.floor(e[1]/u),0),m=Math.min(Math.ceil(e[3]/u),Math.ceil(h/u)),y=e[2]-e[0];let _=this.getBytesPerPixel();const v=[],b=[];for(let e=0;e<t.length;++e)1===this.planarConfiguration?v.push($k(this.fileDirectory.BitsPerSample,0,t[e])/8):v.push(0),b.push(this.getReaderForSample(t[e]));const x=[],{littleEndian:w}=this;for(let o=g;o<m;++o)for(let a=f;a<p;++a){let s;1===this.planarConfiguration&&(s=this.getTileOrStrip(a,o,0,i,l));for(let f=0;f<t.length;++f){const p=f,g=t[f];2===this.planarConfiguration&&(_=this.getSampleByteSize(g),s=this.getTileOrStrip(a,o,g,i,l));const m=s.then((i=>{const o=i.data,a=new DataView(o),s=this.getBlockHeight(i.y),l=i.y*u,f=i.x*c,g=l+s,m=(i.x+1)*c,x=b[p],S=Math.min(s,s-(g-e[3]),h-l),k=Math.min(c,c-(m-e[2]),d-f);for(let i=Math.max(0,e[1]-l);i<S;++i)for(let o=Math.max(0,e[0]-f);o<k;
29++o){const s=(i*c+o)*_,u=x.call(a,s+v[p],w);let d;n?(d=(i+l-e[1])*y*t.length+(o+f-e[0])*t.length+p,r[d]=u):(d=(i+l-e[1])*y+o+f-e[0],r[p][d]=u)}}));x.push(m)}}if(await Promise.all(x),o&&e[2]-e[0]!==o||a&&e[3]-e[1]!==a){let i;return i=n?Uk(r,e[2]-e[0],e[3]-e[1],o,a,t.length,s):Gk(r,e[2]-e[0],e[3]-e[1],o,a,s),i.width=o,i.height=a,i}return r.width=o||e[2]-e[0],r.height=a||e[3]-e[1],r}async readRasters({window:e,samples:t=[],interleave:r,pool:n=null,width:i,height:o,resampleMethod:a,fillValue:s,signal:l}={}){const c=e||[0,0,this.getWidth(),this.getHeight()];if(c[0]>c[2]||c[1]>c[3])throw new Error("Invalid subsets");const u=(c[2]-c[0])*(c[3]-c[1]),d=this.getSamplesPerPixel();if(t&&t.length){for(let e=0;e<t.length;++e)if(t[e]>=d)return Promise.reject(new RangeError(`Invalid sample index '${t[e]}'.`))}else for(let e=0;e<d;++e)t.push(e);let h;if(r){h=Hk(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),u*t.length),s&&h.fill(s)}else{h=[];for(let e=0;e<t.length;++e){const r=this.getArrayForSample(t[e],u);Array.isArray(s)&&e<s.length?r.fill(s[e]):s&&!Array.isArray(s)&&r.fill(s),h.push(r)}}const f=n||await async function(e){const t=Fk.get(e.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${e.Compression}`);return new(await t())(e)}(this.fileDirectory);return await this._readRaster(c,t,h,r,f,i,o,a,l)}async readRGB({window:e,interleave:t=!0,pool:r=null,width:n,height:i,resampleMethod:o,enableAlpha:a=!1,signal:s}={}){const l=e||[0,0,this.getWidth(),this.getHeight()];if(l[0]>l[2]||l[1]>l[3])throw new Error("Invalid subsets");const c=this.fileDirectory.PhotometricInterpretation;if(c===zk.ub.RGB){let l=[0,1,2];if(this.fileDirectory.ExtraSamples!==zk.AC.Unspecified&&a){l=[];for(let e=0;e<this.fileDirectory.BitsPerSample.length;e+=1)l.push(e)}return this.readRasters({window:e,interleave:t,samples:l,pool:r,width:n,height:i,resampleMethod:o,signal:s})}let u;switch(c){case zk.ub.WhiteIsZero:case zk.ub.BlackIsZero:case zk.ub.Palette:u=[0];break;case zk.ub.CMYK:u=[0,1,2,3];break;case zk.ub.YCbCr:case zk.ub.CIELab:u=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const d={window:l,interleave:!0,samples:u,pool:r,width:n,height:i,resampleMethod:o,signal:s},{fileDirectory:h}=this,f=await this.readRasters(d),p=2**this.fileDirectory.BitsPerSample[0];let g;switch(c){case zk.ub.WhiteIsZero:g=function(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<e.length;++r,n+=3)o=256-e[r]/t*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}(f,p);break;case zk.ub.BlackIsZero:g=function(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<e.length;++r,n+=3)o=e[r]/t*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}(f,p);break;case zk.ub.Palette:g=function(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3),o=t.length/3,a=t.length/3*2;for(let r=0,n=0;r<e.length;++r,n+=3){const s=e[r];i[n]=t[s]/65536*256,i[n+1]=t[s+o]/65536*256,i[n+2]=t[s+a]/65536*256}return i}(f,h.ColorMap);break;case zk.ub.CMYK:g=function(e){const{width:t,height:r}=e,n=new Uint8Array(t*r*3);for(let t=0,r=0;t<e.length;t+=4,r+=3){const i=e[t],o=e[t+1],a=e[t+2],s=e[t+3];n[r]=(255-i)/256*255*((255-s)/256),n[r+1]=(255-o)/256*255*((255-s)/256),n[r+2]=(255-a)/256*255*((255-s)/256)}return n}(f);break;case zk.ub.YCbCr:g=function(e){const{width:t,height:r}=e,n=new Uint8ClampedArray(t*r*3);for(let t=0,r=0;t<e.length;t+=3,r+=3){const i=e[t],o=e[t+1],a=e[t+2];n[r]=i+1.402*(a-128),n[r+1]=i-.34414*(o-128)-.71414*(a-128),n[r+2]=i+1.772*(o-128)}return n}(f);break;case zk.ub.CIELab:g=function(e){const{width:t,height:r}=e,n=new Uint8Array(t*r*3);for(let t=0,r=0;t<e.length;t+=3,r+=3){let i,o,a,s=(e[t+0]+16)/116,l=(e[t+1]<<24>>24)/500+s,c=s-(e[t+2]<<24>>24)/200;l=.95047*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),s=1*(s*s*s>.008856?s*s*s:(s-16/116)/7.787),c=1.08883*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),i=3.2406*l+-1.5372*s+-.4986*c,o=-.9689*l+1.8758*s+.0415*c,a=.0557*l+-.204*s+1.057*c,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,n[r]=255*Math.max(0,Math.min(1,i)),n[r+1]=255*Math.max(0,Math.min(1,o)),n[r+2]=255*Math.max(0,Math.min(1,a))}return n}(f);break;default:throw new Error("Unsupported photometric interpretation.")}if(!t){const e=new Uint8Array(g.length/3),t=new Uint8Array(g.length/3),r=new Uint8Array(g.length/3);for(let n=0,i=0;n<g.length;n+=3,++i)e[i]=g[n],t[i]=g[n+1],r[i]=g[n+2];g=[e,t,r]}return g.width=f.width,g.height=f.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}getGDALMetadata(e=null){const t={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA;let n=Dk(r,"Item");n=null===e?n.filter((e=>void 0===Ok(e,"sample"))):n.filter((t=>Number(Ok(t,"sample"))===e));for(let e=0;e<n.length;++e){const r=n[e];t[Ok(r,"name")]=r.inner}return t}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&6===e.length)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const t=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(r)return 0===r[1]&&0===r[4]?[r[0],-r[5],r[10]]:[Math.sqrt(r[0]*r[0]+r[4]*r[4]),-Math.sqrt(r[1]*r[1]+r[5]*r[5]),r[10]];if(e){const[t,r,n]=e.getResolution();return[t*e.getWidth()/this.getWidth(),r*e.getHeight()/this.getHeight(),n*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(e=!1){const t=this.getHeight(),r=this.getWidth();if(this.fileDirectory.ModelTransformation&&!e){const[e,n,i,o,a,s,l,c]=this.fileDirectory.ModelTransformation,u=[[0,0],[0,t],[r,0],[r,t]].map((([t,r])=>[o+e*t+n*r,c+a*t+s*r])),d=u.map((e=>e[0])),h=u.map((e=>e[1]));return[Math.min(...d),Math.min(...h),Math.max(...d),Math.max(...h)]}{const e=this.getOrigin(),n=this.getResolution(),i=e[0],o=e[1],a=i+n[0]*r,s=o+n[1]*t;return[Math.min(i,a),Math.min(o,s),Math.max(i,a),Math.max(o,s)]}}};class Wk{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}
29getUint64(e,t){const r=this.getUint32(e,t),n=this.getUint32(e+4,t);let i;if(t){if(i=r+2**32*n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*r+n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}getInt64(e,t){let r=0;const n=(128&this._dataView.getUint8(e+(t?7:0)))>0;let i=!0;for(let o=0;o<8;o++){let a=this._dataView.getUint8(e+(t?o:7-o));n&&(i?0!==a&&(a=255&~(a-1),i=!1):a=255&~a),r+=a*256**o}return n&&(r=-r),r}getUint8(e,t){return this._dataView.getUint8(e,t)}getInt8(e,t){return this._dataView.getInt8(e,t)}getUint16(e,t){return this._dataView.getUint16(e,t)}getInt16(e,t){return this._dataView.getInt16(e,t)}getUint32(e,t){return this._dataView.getUint32(e,t)}getInt32(e,t){return this._dataView.getInt32(e,t)}getFloat16(e,t){return(0,Lk.Oe)(this._dataView,e,t)}getFloat32(e,t){return this._dataView.getFloat32(e,t)}getFloat64(e,t){return this._dataView.getFloat64(e,t)}}class Zk{constructor(e,t,r,n){this._dataView=new DataView(e),this._sliceOffset=t,this._littleEndian=r,this._bigTiff=n}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const t=this.readUint32(e),r=this.readUint32(e+4);let n;if(this._littleEndian){if(n=t+2**32*r,!Number.isSafeInteger(n))throw new Error(`${n} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return n}if(n=2**32*t+r,!Number.isSafeInteger(n))throw new Error(`${n} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return n}readInt64(e){let t=0;const r=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0;let n=!0;for(let i=0;i<8;i++){let o=this._dataView.getUint8(e+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),t+=o*256**i}return r&&(t=-t),t}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}class Yk{async fetch(e,t=void 0){return Promise.all(e.map((e=>this.fetchSlice(e,t))))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}class Xk extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,Xk),this.name="AbortError"}}Error;Float64Array,Float32Array,Uint32Array,Uint16Array,Uint8Array;class Kk extends Yk{constructor(e){super(),this.arrayBuffer=e}fetchSlice(e,t){if(t&&t.aborted)throw new Xk("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}function Jk(e){switch(e){case zk.s$.BYTE:case zk.s$.ASCII:case zk.s$.SBYTE:case zk.s$.UNDEFINED:return 1;case zk.s$.SHORT:case zk.s$.SSHORT:return 2;case zk.s$.LONG:case zk.s$.SLONG:case zk.s$.FLOAT:case zk.s$.IFD:return 4;case zk.s$.RATIONAL:case zk.s$.SRATIONAL:case zk.s$.DOUBLE:case zk.s$.LONG8:case zk.s$.SLONG8:case zk.s$.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${e}`)}}function Qk(e,t,r,n){let i=null,o=null;const a=Jk(t);switch(t){case zk.s$.BYTE:case zk.s$.ASCII:case zk.s$.UNDEFINED:i=new Uint8Array(r),o=e.readUint8;break;case zk.s$.SBYTE:i=new Int8Array(r),o=e.readInt8;break;case zk.s$.SHORT:i=new Uint16Array(r),o=e.readUint16;break;case zk.s$.SSHORT:i=new Int16Array(r),o=e.readInt16;break;case zk.s$.LONG:case zk.s$.IFD:i=new Uint32Array(r),o=e.readUint32;break;case zk.s$.SLONG:i=new Int32Array(r),o=e.readInt32;break;case zk.s$.LONG8:case zk.s$.IFD8:i=new Array(r),o=e.readUint64;break;case zk.s$.SLONG8:i=new Array(r),o=e.readInt64;break;case zk.s$.RATIONAL:i=new Uint32Array(2*r),o=e.readUint32;break;case zk.s$.SRATIONAL:i=new Int32Array(2*r),o=e.readInt32;break;case zk.s$.FLOAT:i=new Float32Array(r),o=e.readFloat32;break;case zk.s$.DOUBLE:i=new Float64Array(r),o=e.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t!==zk.s$.RATIONAL&&t!==zk.s$.SRATIONAL)for(let t=0;t<r;++t)i[t]=o.call(e,n+t*a);else for(let t=0;t<r;t+=2)i[t]=o.call(e,n+t*a),i[t+1]=o.call(e,n+(t*a+4));return t===zk.s$.ASCII?new TextDecoder("utf-8").decode(i):i}class eT{constructor(e,t,r,n){this.fileDirectory=e,this.rawFileDirectory=t,this.geoKeyDirectory=r,this.nextIFDByteOffset=n}}
29class tT extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class rT{async readRasters(e={}){const{window:t,width:r,height:n}=e;let{resX:i,resY:o,bbox:a}=e;const s=await this.getImage();let l=s;const c=await this.getImageCount(),u=s.getBoundingBox();if(t&&a)throw new Error('Both "bbox" and "window" passed.');if(r||n){if(t){const[e,r]=s.getOrigin(),[n,i]=s.getResolution();a=[e+t[0]*n,r+t[1]*i,e+t[2]*n,r+t[3]*i]}const e=a||u;if(r){if(i)throw new Error("Both width and resX passed");i=(e[2]-e[0])/r}if(n){if(o)throw new Error("Both width and resY passed");o=(e[3]-e[1])/n}}if(i||o){const e=[];for(let t=0;t<c;++t){const r=await this.getImage(t),{SubfileType:n,NewSubfileType:i}=r.fileDirectory;(0===t||2===n||1&i)&&e.push(r)}e.sort(((e,t)=>e.getWidth()-t.getWidth()));for(let t=0;t<e.length;++t){const r=e[t],n=(u[2]-u[0])/r.getWidth(),a=(u[3]-u[1])/r.getHeight();if(l=r,i&&i>n||o&&o>a)break}}let d=t;if(a){const[e,t]=s.getOrigin(),[r,n]=l.getResolution(s);d=[Math.round((a[0]-e)/r),Math.round((a[1]-t)/n),Math.round((a[2]-e)/r),Math.round((a[3]-t)/n)],d=[Math.min(d[0],d[2]),Math.min(d[1],d[3]),Math.max(d[0],d[2]),Math.max(d[1],d[3])]}return l.readRasters({...e,window:d})}}class nT extends rT{constructor(e,t,r,n,i={}){super(),this.source=e,this.littleEndian=t,this.bigTiff=r,this.firstIFDOffset=n,this.cache=i.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,t){const r=this.bigTiff?4048:1024;return new Zk((await this.source.fetch([{offset:e,length:void 0!==t?t:r}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const t=this.bigTiff?20:12,r=this.bigTiff?8:2;
vendor: 1,980 bytes, line 29
29let n=await this.getSlice(e);const i=this.bigTiff?n.readUint64(e):n.readUint16(e),o=i*t+(this.bigTiff?16:6);n.covers(e,o)||(n=await this.getSlice(e,o));const a={},s=new Map;let l=e+(this.bigTiff?8:2);for(let e=0;e<i;l+=t,++e){const e=n.readUint16(l),t=n.readUint16(l+2),r=this.bigTiff?n.readUint64(l+4):n.readUint32(l+4);let i,o;const c=Jk(t),u=l+(this.bigTiff?12:8);if(c*r<=(this.bigTiff?8:4))i=Qk(n,t,r,u);else{const e=n.readOffset(u),o=Jk(t)*r;if(n.covers(e,o))i=Qk(n,t,r,e);else{i=Qk(await this.getSlice(e,o),t,r,e)}}o=1===r&&-1===zk.NZ.indexOf(e)&&t!==zk.s$.RATIONAL&&t!==zk.s$.SRATIONAL?i[0]:i;const d=zk.$[e];d&&(a[d]=o),s.set(e,o)}const c=function(e){const t=e.GeoKeyDirectory;if(!t)return null;const r={};for(let n=4;n<=4*t[3];n+=4){const i=zk.Hm[t[n]],o=t[n+1]?zk.$[t[n+1]]:null,a=t[n+2],s=t[n+3];let l=null;if(o){if(l=e[o],null==l)throw new Error(`Could not get value of geoKey '${i}'.`);"string"==typeof l?l=l.substring(s,s+a-1):l.subarray&&(l=l.subarray(s,s+a),1===a&&(l=l[0]))}else l=s;r[i]=l}return r}(a),u=n.readOffset(e+r+t*i);return new eT(a,s,c,u)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(0===e)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(t){if(t instanceof tT)throw new tT(e);throw t}return this.ifdRequests[e]=(async()=>{const t=await this.ifdRequests[e-1];if(0===t.nextIFDByteOffset)throw new tT(e);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const t=await this.requestIFD(e);return new qk(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,t=!0;for(;t;)try{await this.requestIFD(e),++e}catch(e){if(!(e instanceof tT))throw e;t=!1}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=";
29let r=await this.getSlice(e,130);if(t===Qk(r,zk.s$.ASCII,30,e)){const t=Qk(r,zk.s$.ASCII,130,e).split("\n")[0],n=Number(t.split("=")[1].split(" ")[0])+t.length;n>130&&(r=await this.getSlice(e,n));const i=Qk(r,zk.s$.ASCII,n,e);this.ghostValues={},i.split("\n").filter((e=>e.length>0)).map((e=>e.split("="))).forEach((([e,t])=>{this.ghostValues[e]=t}))}return this.ghostValues}static async fromSource(e,t,r){const n=(await e.fetch([{offset:0,length:1024}],r))[0],i=new Wk(n),o=i.getUint16(0,0);let a;if(18761===o)a=!0;else{if(19789!==o)throw new TypeError("Invalid byte order value.");a=!1}const s=i.getUint16(2,a);let l;if(42===s)l=!1;else{if(43!==s)throw new TypeError("Invalid magic number.");l=!0;if(8!==i.getUint16(4,a))throw new Error("Unsupported offset byte-size.")}const c=l?i.getUint64(8,a):i.getUint32(4,a);return new nT(e,a,l,c,t)}close(){return"function"==typeof this.source.close&&this.source.close()}}async function iT(e,t){return nT.fromSource(function(e){return new Kk(e)}(e),t)}var oT=[[0,227,119,94],[.0625,235,141,94],[.125,243,164,96],[.1875,248,186,101],[.25,252,205,114],[.3125,254,222,129],[.375,254,235,145],[.4375,248,243,156],[.5,229,238,149],[.5625,206,230,139],[.625,181,218,128],[.6875,156,203,118],[.75,131,188,108],[.8125,107,173,98],[.875,82,158,88],[1,56,142,78]],aT=[[0,139,90,43],[.167,194,165,102],[.333,247,247,189],[.5,161,218,180],[.667,65,182,196],[.833,34,94,168],[1,8,29,88]],sT=[[0,38,38,38],[.167,112,48,48],[.333,230,85,13],[.5,253,184,99],[.667,254,240,141],[.833,161,215,106],[1,56,142,78]],lT=[[0,56,142,78],[.167,161,215,106],[.333,254,240,141],[.5,253,204,138],[.667,194,146,100],[.833,139,90,43],[1,84,48,5]],cT=[[0,139,90,43],[.2,194,165,102],[.333,230,230,230],[.5,255,255,255],[.667,200,240,255],[.833,135,206,235],[1,70,130,180]],uT=[[0,56,142,78],[.167,161,215,106],[.333,254,240,141],[.5,189,189,189],[.667,150,130,160],[.833,128,88,138],[1,84,39,136]],dT={ndvi:{colormap:oT,min:0,max:1},gndvi:{colormap:oT,min:0,max:1},evi:{colormap:oT,min:0,max:1},evi2:{colormap:oT,min:0,max:1},savi:{colormap:oT,min:0,max:1},msavi:{colormap:oT,min:0,max:1},osavi:{colormap:oT,min:0,max:1},arvi:{colormap:oT,min:-.2,max:1},ndrei:{colormap:oT,min:0,max:.8},cire:{colormap:oT,min:0,max:3},ndwi:{colormap:aT,min:-.5,max:1},mndwi:{colormap:aT,min:-.5,max:1},lswi:{colormap:aT,min:-.5,max:1},ndmi:{colormap:aT,min:-.5,max:1},ndci:{colormap:aT,min:-.5,max:1},ndti:{colormap:aT,min:-.5,max:1},s2wi:{colormap:aT,min:-.5,max:1},wri:{colormap:aT,min:0,max:2},gvmi:{colormap:aT,min:-.5,max:1},msi:{colormap:aT,min:0,max:3},nmdi:{colormap:aT,min:-.5,max:1},nddi:{colormap:aT,min:0,max:3},nbr:{colormap:sT,min:-.5,max:.5},nbr2:{colormap:sT,min:-.5,max:.5},bais2:{colormap:sT,min:-1,max:1},bi:{colormap:lT,min:-.5,max:.5},dbsi:{colormap:lT,min:-.5,max:.5},ndsoii:{colormap:lT,min:-.5,max:.5},ndsi:{colormap:cT,min:-.5,max:1},ndglai:{colormap:cT,min:-.5,max:1},ndbi:{colormap:uT,min:-.5,max:.5},ui:{colormap:uT,min:-.5,max:.5}},hT={colormap:oT,min:-1,max:1};function fT(e){return dT[e.toLowerCase()]||hT}function pT(e,t){for(var r=Math.max(0,Math.min(1,e)),n=t[0],i=t[t.length-1],o=0;o<t.length-1;o++)if(r>=t[o][0]&&r<=t[o+1][0]){n=t[o],i=t[o+1];break}var a=i[0]-n[0],s=0===a?0:(r-n[0])/a;return[Math.round(n[1]+s*(i[1]-n[1])),Math.round(n[2]+s*(i[2]-n[2])),Math.round(n[3]+s*(i[3]-n[3]))]}function gT(e,t){var r=fT(t);return pT((e-r.min)/(r.max-r.min),r.colormap)}var mT=[180,180,180,255];var yT=6378137,_T=.0066943799901413165,vT=484813681109536e-20,bT=Math.PI/2,xT=1e-10,wT=.017453292519943295,ST=57.29577951308232,kT=Math.PI/4,TT=2*Math.PI,IT=3.14159265359,MT={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const ET=MT,PT={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var AT=/[\s_\-\/\(\)]/g;function CT(e,t){if(e[t])return e[t];for(var r,n=Object.keys(e),i=t.toLowerCase().replace(AT,""),o=-1;++o<n.length;)if((r=n[o]).toLowerCase().replace(AT,"")===i)return e[r]}function RT(e){var t,r,n,i={},o=e.split("+").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var r=t.split("=");return r.push(!0),e[r[0].toLowerCase()]=r[1],e}),{}),a={proj:"projName",datum:"datumCode",rf:function(e){i.rf=parseFloat(e)},lat_0:function(e){i.lat0=e*wT},lat_1:function(e){i.lat1=e*wT},lat_2:function(e){i.lat2=e*wT},lat_ts:function(e){i.lat_ts=e*wT},lon_0:function(e){i.long0=e*wT},lon_1:function(e){i.long1=e*wT},lon_2:function(e){i.long2=e*wT}
vendor: 4,235 bytes, line 29
29,alpha:function(e){i.alpha=parseFloat(e)*wT},gamma:function(e){i.rectified_grid_angle=parseFloat(e)*wT},lonc:function(e){i.longc=e*wT},x_0:function(e){i.x0=parseFloat(e)},y_0:function(e){i.y0=parseFloat(e)},k_0:function(e){i.k0=parseFloat(e)},k:function(e){i.k0=parseFloat(e)},a:function(e){i.a=parseFloat(e)},b:function(e){i.b=parseFloat(e)},r:function(e){i.a=i.b=parseFloat(e)},r_a:function(){i.R_A=!0},zone:function(e){i.zone=parseInt(e,10)},south:function(){i.utmSouth=!0},towgs84:function(e){i.datum_params=e.split(",").map((function(e){return parseFloat(e)}))},to_meter:function(e){i.to_meter=parseFloat(e)},units:function(e){i.units=e;var t=CT(PT,e);t&&(i.to_meter=t.to_meter)},from_greenwich:function(e){i.from_greenwich=e*wT},pm:function(e){var t=CT(ET,e);i.from_greenwich=(t||parseFloat(e))*wT},nadgrids:function(e){"@null"===e?i.datumCode="none":i.nadgrids=e},axis:function(e){var t="ewnsud";3===e.length&&-1!==t.indexOf(e.substr(0,1))&&-1!==t.indexOf(e.substr(1,1))&&-1!==t.indexOf(e.substr(2,1))&&(i.axis=e)},approx:function(){i.approx=!0},over:function(){i.over=!0}};for(t in o)r=o[t],t in a?"function"==typeof(n=a[t])?n(r):i[n]=r:i[t]=r;return"string"==typeof i.datumCode&&"WGS84"!==i.datumCode&&(i.datumCode=i.datumCode.toLowerCase()),i.projStr=e,i}const LT=class{static getId(e){const t=e.find((e=>Array.isArray(e)&&"ID"===e[0]));return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t="unit"){if(!e||e.length<3)return{type:t,name:"unknown",conversion_factor:null};const r=e[1],n=parseFloat(e[2])||null,i=e.find((e=>Array.isArray(e)&&"ID"===e[0]));return{type:t,name:r,conversion_factor:n,id:i?{authority:i[1],code:parseInt(i[2],10)}:null}}static convertAxis(e){const t=e[1]||"Unknown";let r;const n=t.match(/^\((.)\)$/);if(n){const e=n[1].toUpperCase();if("E"===e)r="east";else if("N"===e)r="north";else{if("U"!==e)throw new Error(`Unknown axis abbreviation: ${e}`);r="up"}}else r=e[2]?e[2].toLowerCase():"unknown";const i=e.find((e=>Array.isArray(e)&&"ORDER"===e[0])),o=i?parseInt(i[1],10):null,a=e.find((e=>Array.isArray(e)&&("LENGTHUNIT"===e[0]||"ANGLEUNIT"===e[0]||"SCALEUNIT"===e[0])));return{name:t,direction:r,unit:this.convertUnit(a),order:o}}static extractAxes(e){return e.filter((e=>Array.isArray(e)&&"AXIS"===e[0])).map((e=>this.convertAxis(e))).sort(((e,t)=>(e.order||0)-(t.order||0)))}static convert(e,t={}){switch(e[0]){case"PROJCRS":t.type="ProjectedCRS",t.name=e[1],t.base_crs=e.find((e=>Array.isArray(e)&&"BASEGEOGCRS"===e[0]))?this.convert(e.find((e=>Array.isArray(e)&&"BASEGEOGCRS"===e[0]))):null,t.conversion=e.find((e=>Array.isArray(e)&&"CONVERSION"===e[0]))?this.convert(e.find((e=>Array.isArray(e)&&"CONVERSION"===e[0]))):null;const r=e.find((e=>Array.isArray(e)&&"CS"===e[0]));r&&(t.coordinate_system={type:r[1],axis:this.extractAxes(e)});const n=e.find((e=>Array.isArray(e)&&"LENGTHUNIT"===e[0]));if(n){const e=this.convertUnit(n);t.coordinate_system.unit=e}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":t.type="GeographicCRS",t.name=e[1];const i=e.find((e=>Array.isArray(e)&&("DATUM"===e[0]||"ENSEMBLE"===e[0])));if(i){const r=this.convert(i);"ENSEMBLE"===i[0]?t.datum_ensemble=r:t.datum=r;const n=e.find((e=>Array.isArray(e)&&"PRIMEM"===e[0]));n&&"Greenwich"!==n[1]&&(r.prime_meridian={name:n[1],longitude:parseFloat(n[2])})}t.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},t.id=this.getId(e);break;case"DATUM":t.type="GeodeticReferenceFrame",t.name=e[1],t.ellipsoid=e.find((e=>Array.isArray(e)&&"ELLIPSOID"===e[0]))?this.convert(e.find((e=>Array.isArray(e)&&"ELLIPSOID"===e[0]))):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter((e=>Array.isArray(e)&&"MEMBER"===e[0])).map((e=>({type:"DatumEnsembleMember",name:e[1],id:this.getId(e)})));const o=e.find((e=>Array.isArray(e)&&"ENSEMBLEACCURACY"===e[0]));o&&(t.accuracy=parseFloat(o[1]));const a=e.find((e=>Array.isArray(e)&&"ELLIPSOID"===e[0]));a&&(t.ellipsoid=this.convert(a)),t.id=this.getId(e);break;case"ELLIPSOID":t.type="Ellipsoid",t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]);e.find((e=>Array.isArray(e)&&"LENGTHUNIT"===e[0]))&&this.convert(e.find((e=>Array.isArray(e)&&"LENGTHUNIT"===e[0])),t);break;
29case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find((e=>Array.isArray(e)&&"METHOD"===e[0]))?this.convert(e.find((e=>Array.isArray(e)&&"METHOD"===e[0]))):null,t.parameters=e.filter((e=>Array.isArray(e)&&"PARAMETER"===e[0])).map((e=>this.convert(e)));break;case"METHOD":t.type="Method",t.name=e[1],t.id=this.getId(e);break;case"PARAMETER":t.type="Parameter",t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find((e=>Array.isArray(e)&&("LENGTHUNIT"===e[0]||"ANGLEUNIT"===e[0]||"SCALEUNIT"===e[0])))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const s=e.find((e=>Array.isArray(e)&&"SOURCECRS"===e[0]));if(s){const e=s.find((e=>Array.isArray(e)));t.source_crs=e?this.convert(e):null}const l=e.find((e=>Array.isArray(e)&&"TARGETCRS"===e[0]));if(l){const e=l.find((e=>Array.isArray(e)));t.target_crs=e?this.convert(e):null}const c=e.find((e=>Array.isArray(e)&&"ABRIDGEDTRANSFORMATION"===e[0]));t.transformation=c?this.convert(c):null;break;case"ABRIDGEDTRANSFORMATION":if(t.type="Transformation",t.name=e[1],t.method=e.find((e=>Array.isArray(e)&&"METHOD"===e[0]))?this.convert(e.find((e=>Array.isArray(e)&&"METHOD"===e[0]))):null,t.parameters=e.filter((e=>Array.isArray(e)&&("PARAMETER"===e[0]||"PARAMETERFILE"===e[0]))).map((e=>"PARAMETER"===e[0]?this.convert(e):"PARAMETERFILE"===e[0]?{name:e[1],value:e[2],id:{authority:"EPSG",code:8656}}:void 0)),7===t.parameters.length){const e=t.parameters[6];"Scale difference"===e.name&&(e.value=Math.round(1e12*(e.value-1))/1e6)}t.id=this.getId(e);break;case"AXIS":t.coordinate_system||(t.coordinate_system={type:"unspecified",axis:[]}),t.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const u=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach((e=>{e.unit||(e.unit=u)})),u.conversion_factor&&1!==u.conversion_factor&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:u});break;default:t.keyword=e[0]}return t}};const OT=class extends LT{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&"Cartesian"===t.coordinate_system.subtype&&delete t.coordinate_system,t.usage&&delete t.usage,t}};const DT=class extends LT{static convert(e,t={}){super.convert(e,t);const r=e.find((e=>Array.isArray(e)&&"CS"===e[0]));r&&(t.coordinate_system={subtype:r[1],axis:this.extractAxes(e)});const n=e.find((e=>Array.isArray(e)&&"USAGE"===e[0]));if(n){const e=n.find((e=>Array.isArray(e)&&"SCOPE"===e[0])),r=n.find((e=>Array.isArray(e)&&"AREA"===e[0])),i=n.find((e=>Array.isArray(e)&&"BBOX"===e[0]));t.usage={},e&&(t.usage.scope=e[1]),r&&(t.usage.area=r[1]),i&&(t.usage.bbox=i.slice(1))}return t}};function zT(e){const t=function(e){return e.find((e=>Array.isArray(e)&&"USAGE"===e[0]))?"2019":(e.find((e=>Array.isArray(e)&&"CS"===e[0]))||"BOUNDCRS"===e[0]||"PROJCRS"===e[0]||e[0],"2015")}(e);return("2019"===t?DT:OT).convert(e)}const FT=function(e){var t=new $T(e);return t.output()};var NT=1,BT=/\s/,jT=/[A-Za-z]/,VT=/[A-Za-z84_]/,GT=/[,\]]/,UT=/[\d\.E\-\+]/;function $T(e){if("string"!=typeof e)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=NT}function HT(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var n=t?{}:e,i=r.reduce((function(e,t){return qT(t,e),e}),n);t&&(e[t]=i)}function qT(e,t){if(Array.isArray(e)){var r=e.shift();if("PARAMETER"===r&&(r=e.shift()),1===e.length)return Array.isArray(e[0])?(t[r]={},void qT(e[0],t[r])):void(t[r]=e[0]);if(e.length)if("TOWGS84"!==r){if("AXIS"===r)return r in t||(t[r]=[]),void t[r].push(e);var n;switch(Array.isArray(r)||(t[r]={}),r){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[r]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&qT(e[2],t[r]));case"SPHEROID":case"ELLIPSOID":return t[r]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&qT(e[3],t[r]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return e[0]=["name",e[0]],void HT(t,r,e);
vendor: 5,079 bytes, line 29
29case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return e[0]=["name",e[0]],HT(t,r,e),void(t[r].type=r);default:for(n=-1;++n<e.length;)if(!Array.isArray(e[n]))return qT(e,t[r]);return HT(t,r,e)}}else t[r]=e;else t[r]=!0}else t[e]=!0}$T.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;BT.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case NT:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},$T.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(GT.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},$T.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=NT)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=NT,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},$T.prototype.number=function(e){if(!UT.test(e)){if(GT.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},$T.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},$T.prototype.keyword=function(e){if(VT.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=NT)}if(!GT.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},$T.prototype.neutral=function(e){if(jT.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(UT.test(e))return this.word=e,void(this.state=3);if(!GT.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},$T.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function WT(e){return.017453292519943295*e}function ZT(e){const t=(e.projName||"").toLowerCase().replace(/_/g," ");e.long0||!e.longc||"albers conic equal area"!==t&&"lambert azimuthal equal area"!==t||(e.long0=e.longc),e.lat_ts||!e.lat1||"stereographic south pole"!==t&&"polar stereographic (variant b)"!==t?e.lat_ts||!e.lat0||"polar stereographic"!==t&&"polar stereographic (variant a)"!==t||(e.lat_ts=e.lat0,e.lat0=WT(e.lat0>0?90:-90),delete e.lat1):(e.lat0=WT(e.lat1>0?90:-90),e.lat_ts=e.lat1,delete e.lat1)}function YT(e){let t={units:null,to_meter:void 0};return"string"==typeof e?(t.units=e.toLowerCase(),"metre"===t.units&&(t.units="meter"),"meter"===t.units&&(t.to_meter=1)):e&&e.name&&(t.units=e.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.to_meter=e.conversion_factor),t}function XT(e){return"object"==typeof e?e.value*e.unit.conversion_factor:e}function KT(e,t){e.ellipsoid.radius?(t.a=e.ellipsoid.radius,t.rf=0):(t.a=XT(e.ellipsoid.semi_major_axis),void 0!==e.ellipsoid.inverse_flattening?t.rf=e.ellipsoid.inverse_flattening:void 0!==e.ellipsoid.semi_major_axis&&void 0!==e.ellipsoid.semi_minor_axis&&(t.rf=t.a/(t.a-XT(e.ellipsoid.semi_minor_axis))))}function JT(e,t={}){return e&&"object"==typeof e?"BoundCRS"===e.type?(JT(e.source_crs,t),e.transformation&&(e.transformation.method&&"NTv2"===e.transformation.method.name?t.nadgrids=e.transformation.parameters[0].value:t.datum_params=e.transformation.parameters.map((e=>e.value))),t):(Object.keys(e).forEach((r=>{const n=e[r];if(null!==n)switch(r){case"name":if(t.srsCode)break;t.name=n,t.srsCode=n;break;case"type":"GeographicCRS"===n?t.projName="longlat":"ProjectedCRS"===n&&e.conversion&&e.conversion.method&&(t.projName=e.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(t.ellps=n.ellipsoid.name,KT(n,t)),n.prime_meridian&&(t.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":t.ellps=n.name,KT(n,t);break;case"prime_meridian":t.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis)if(t.axis=n.axis.map((e=>{const t=e.direction;if("east"===t)return"e";if("north"===t)return"n";if("west"===t)return"w";if("south"===t)return"s";throw new Error(`Unknown axis direction: ${t}`)})).join("")+"u",n.unit){const{units:e,to_meter:r}=YT(n.unit);t.units=e,t.to_meter=r}else if(n.axis[0]&&n.axis[0].unit){const{units:e,to_meter:r}=YT(n.axis[0].unit);t.units=e,t.to_meter=r}break;case"id":n.authority&&n.code&&(t.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(t.projName=n.method.name),n.parameters&&n.parameters.forEac
vendor: 4,213 bytes, line 29
29h((e=>{const r=e.name.toLowerCase().replace(/\s+/g,"_"),n=e.value;e.unit&&e.unit.conversion_factor?t[r]=n*e.unit.conversion_factor:"degree"===e.unit?t[r]=n*Math.PI/180:t[r]=n}));break;case"unit":n.name&&(t.units=n.name.toLowerCase(),"metre"===t.units&&(t.units="meter")),n.conversion_factor&&(t.to_meter=n.conversion_factor);break;case"base_crs":JT(n,t),t.datumCode=n.id?n.id.authority+"_"+n.id.code:n.name}})),void 0!==t.latitude_of_false_origin&&(t.lat0=t.latitude_of_false_origin),void 0!==t.longitude_of_false_origin&&(t.long0=t.longitude_of_false_origin),void 0!==t.latitude_of_standard_parallel&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),void 0!==t.latitude_of_1st_standard_parallel&&(t.lat1=t.latitude_of_1st_standard_parallel),void 0!==t.latitude_of_2nd_standard_parallel&&(t.lat2=t.latitude_of_2nd_standard_parallel),void 0!==t.latitude_of_projection_centre&&(t.lat0=t.latitude_of_projection_centre),void 0!==t.longitude_of_projection_centre&&(t.longc=t.longitude_of_projection_centre),void 0!==t.easting_at_false_origin&&(t.x0=t.easting_at_false_origin),void 0!==t.northing_at_false_origin&&(t.y0=t.northing_at_false_origin),void 0!==t.latitude_of_natural_origin&&(t.lat0=t.latitude_of_natural_origin),void 0!==t.longitude_of_natural_origin&&(t.long0=t.longitude_of_natural_origin),void 0!==t.longitude_of_origin&&(t.long0=t.longitude_of_origin),void 0!==t.false_easting&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),void 0!==t.false_northing&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),void 0!==t.standard_parallel_1&&(t.lat1=t.standard_parallel_1),void 0!==t.standard_parallel_2&&(t.lat2=t.standard_parallel_2),void 0!==t.scale_factor_at_natural_origin&&(t.k0=t.scale_factor_at_natural_origin),void 0!==t.scale_factor_at_projection_centre&&(t.k0=t.scale_factor_at_projection_centre),void 0!==t.scale_factor_on_pseudo_standard_parallel&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),void 0!==t.azimuth&&(t.alpha=t.azimuth),void 0!==t.azimuth_at_projection_centre&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),ZT(t),t):e}var QT=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function eI(e){for(var t=Object.keys(e),r=0,n=t.length;r<n;++r){var i=t[r];-1!==QT.indexOf(i)&&tI(e[i]),"object"==typeof e[i]&&eI(e[i])}}function tI(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+":"+e.AUTHORITY[t])}if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var r="",n=0,i=e.AXIS.length;n<i;++n){var o=[e.AXIS[n][0].toLowerCase(),e.AXIS[n][1].toLowerCase()];-1!==o[0].indexOf("north")||("y"===o[0]||"lat"===o[0])&&"north"===o[1]?r+="n":-1!==o[0].indexOf("south")||("y"===o[0]||"lat"===o[0])&&"south"===o[1]?r+="s":-1!==o[0].indexOf("east")||("x"===o[0]||"lon"===o[0])&&"east"===o[1]?r+="e":-1===o[0].indexOf("west")&&("x"!==o[0]&&"lon"!==o[0]||"west"!==o[1])||(r+="w")}2===r.length&&(r+="u"),3===r.length&&(e.axis=r)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var a=e.GEOGCS;function s(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(a=e),a&&(a.DATUM?e.datumCode=a.DATUM.name.toLowerCase():e.datumCode=a.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_1949"===e.datumCode&&(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"belge_1972"===e.datumCode&&(e.datumCode="rnb72"),a.DATUM&&a.DATUM.SPHEROID&&(e.ellps=a.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=a.DATU
vendor: 6,386 bytes, line 29
29M.SPHEROID.a,e.rf=parseFloat(a.DATUM.SPHEROID.rf,10)),a.DATUM&&a.DATUM.TOWGS84&&(e.datum_params=a.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"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),e.rectified_grid_angle&&(e.rectified_grid_angle=WT(e.rectified_grid_angle));[["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",WT],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",WT],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",WT],["lat0","latitude_of_origin",WT],["lat0","standard_parallel_1",WT],["lat1","standard_parallel_1",WT],["lat2","standard_parallel_2",WT],["azimuth","Azimuth"],["alpha","azimuth",WT],["srsCode","name"]].forEach((function(t){return function(e,t){var r=t[0],n=t[1];!(r in e)&&n in e&&(e[r]=e[n],3===t.length&&(e[r]=t[2](e[r])))}(e,t)})),ZT(e)}function rI(e){if("object"==typeof e)return JT(e);const t=function(e){const t=e.toUpperCase();return t.includes("PROJCRS")||t.includes("GEOGCRS")||t.includes("BOUNDCRS")||t.includes("VERTCRS")||t.includes("LENGTHUNIT")||t.includes("ANGLEUNIT")||t.includes("SCALEUNIT")?"WKT2":(t.includes("PROJCS")||t.includes("GEOGCS")||t.includes("LOCAL_CS")||t.includes("VERT_CS")||t.includes("UNIT"),"WKT1")}(e);var r=FT(e);if("WKT2"===t){return JT(zT(r))}var n=r[0],i={};return qT(r,i),eI(i),i[n]}function nI(e){var t=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?nI[e]=RT(arguments[1]):nI[e]=rI(arguments[1]):r&&"object"==typeof r&&!("projName"in r)?nI[e]=rI(arguments[1]):(nI[e]=r,r||delete nI[e])}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){return Array.isArray(e)?nI.apply(t,e):nI(e)}));if("string"==typeof e){if(e in nI)return nI[e]}else"EPSG"in e?nI["EPSG:"+e.EPSG]=e:"ESRI"in e?nI["ESRI:"+e.ESRI]=e:"IAU2000"in e?nI["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(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");for(var t=1;t<=60;++t)e("EPSG:"+(32600+t),"+proj=utm +zone="+t+" +datum=WGS84 +units=m"),e("EPSG:"+(32700+t),"+proj=utm +zone="+t+" +south +datum=WGS84 +units=m");e("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),e("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),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"]}(nI);const iI=nI;var oI=["3857","900913","3785","102113"];const aI=function(e){if(!function(e){return"string"==typeof e}(e))return"projName"in e?e:rI(e);if(function(e){return e in iI}(e))return iI[e];if(function(e){return 0!==e.indexOf("+")&&-1!==e.indexOf("[")||"object"==typeof e&&!("srsCode"in e)}(e)){var t=rI(e);if(function(e){var t=CT(e,"authority");if(t){var r=CT(t,"epsg");return r&&oI.indexOf(r)>-1}}(t))return iI["EPSG:3857"];var r=function(e){var t=CT(e,"extension");if(t)return CT(t,"proj4")}(t);return r?RT(r):t}return function(e){return"+"===e[0]}(e)?RT(e):void 0};function sI(e,t){var r,n;if(e=e||{},!t)return e;for(n in t)void 0!==(r=t[n])&&(e[n]=r);return e}function lI(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}function cI(e){return e<0?-1:1}function uI(e,t){return t||Math.abs(e)<=IT?e:e-cI(e)*TT}function dI(e,t,r){var n=e*r,i=.5*e;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(bT-t))/n}function hI(e,t){for(var r,n,i=.5*e,o=bT-2*Math.atan(t),a=0;a<=15;a++)if(r=e*Math.sin(o),o+=n=bT-2*Math.atan(t*Math.pow((1-r)/(1+r),i))-o,Math.abs(n)<=1e-10)return o;return-9999}function fI(e){return e}var pI=["longlat","identity"];var gI=[{init:function(){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=lI(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,r,n=e.x,i=e.y;if(i*ST>90&&i*ST<-90&&n*ST>180&&n*ST<-180)return null;if(Math.abs(Math.abs(i)-bT)<=xT)return null;if(this.sphere)t=this.x0+this.a*this.k0*uI(n-this.long0,this.over),r=this.y0+this.a*this.k0*Math.log(Math.tan(kT+.5*i));else{var o=Math.sin(i),a=dI(this.e,i,o);t=this.x0+this.a*this.k0*uI(n-this.long0,this.over),r=this.y0-this.a*this.k0*Math.log(a)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,n=e.x-this.x0,i=e.y-this.y0;if(this.sphere)r=bT-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(r=hI(this.e,o)))return null}return t=uI(this.long0+n/(this.a*this.k0),this.over),e.x=t,e.y=r,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]},{init:function(){},forward:fI,inverse:fI,names:pI}],mI={},yI=[];function _I(e,t){var r=yI.length;
29return e.names?(yI[r]=e,e.names.forEach((function(e){mI[e.toLowerCase()]=r})),this):(console.log(t),!0)}function vI(e){return e.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}const bI={start:function(){gI.forEach(_I)},add:_I,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==mI[t]&&yI[mI[t]]||(t=vI(t))in mI&&yI[mI[t]]?yI[mI[t]]:void 0}};const xI={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},wI=xI.WGS84;var SI
vendor: 19,518 bytes, line 29
29={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var 
vendor: 1,350 bytes, line 29
29kI in SI){var TI=SI[kI];TI.datumName&&(SI[TI.datumName]=TI)}const II=SI;const MI=function(e,t,r,n,i,o,a){var s={};return s.datum_type=void 0===e||"none"===e?5:4,t&&(s.datum_params=t.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=vT,s.datum_params[4]*=vT,s.datum_params[5]*=vT,s.datum_params[6]=s.datum_params[6]/1e6+1))),a&&(s.datum_type=3,s.grids=a),s.a=r,s.b=n,s.es=i,s.ep2=o,s};var EI={};async function PI(e,t){for(var r=[],n=await t.getImageCount(),i=n-1;i>=0;i--){var o=await t.getImage(i),a=await o.readRasters(),s=[o.getWidth(),o.getHeight()],l=o.getBoundingBox().map(CI),c=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(CI),u=l[0]+(s[0]-1)*c[0],d=l[3]-(s[1]-1)*c[1],h=a[0],f=a[1],p=[];for(let e=s[1]-1;e>=0;e--)for(let t=s[0]-1;t>=0;t--){var g=e*s[0]+t;p.push([-RI(f[g]),RI(h[g])])}r.push({del:c,lim:s,ll:[-u,d],cvs:p})}var m={header:{nSubgrids:n},subgrids:r};return EI[e]=m,m}function AI(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:EI[e]||null,isNull:!1}}function CI(e){return e*Math.PI/180}
vendor: 4,167 bytes, line 29
29function RI(e){return e/3600*Math.PI/180}function LI(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function OI(e){return e.map((function(e){return[RI(e.longitudeShift),RI(e.latitudeShift)]}))}function DI(e,t,r){return{name:LI(e,t+8,t+16).trim(),parent:LI(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 zI(e,t,r,n,i){var o=t+176,a=16;!1===i&&(a=8);for(var s=[],l=0;l<r.gridNodeCount;l++){var c={latitudeShift:e.getFloat32(o+l*a,n),longitudeShift:e.getFloat32(o+l*a+4,n)};!1!==i&&(c.latitudeAccuracy=e.getFloat32(o+l*a+8,n),c.longitudeAccuracy=e.getFloat32(o+l*a+12,n)),s.push(c)}return s}function FI(e,t){if(!(this instanceof FI))return new FI(e);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,t=t||function(e){if(e)throw e};var r=aI(e);if("object"==typeof r){var n=FI.projections.get(r.projName);if(n){if(r.datumCode&&"none"!==r.datumCode){var i=CT(II,r.datumCode);i&&(r.datum_params=r.datum_params||(i.towgs84?i.towgs84.split(","):null),r.ellps=i.ellipse,r.datumName=i.datumName?i.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=function(e,t,r,n,i){if(!e){var o=CT(xI,n);o||(o=wI),e=o.a,t=o.b,r=o.rf}return r&&!t&&(t=(1-1/r)*e),(0===r||Math.abs(e-t)<xT)&&(i=!0,t=e),{a:e,b:t,rf:r,sphere:i}}(r.a,r.b,r.rf,r.ellps,r.sphere),a=function(e,t,r,n){var i=e*e,o=t*t,a=(i-o)/i,s=0;return n?(i=(e*=1-a*(.16666666666666666+a*(.04722222222222222+.022156084656084655*a)))*e,a=0):s=Math.sqrt(a),{es:a,e:s,ep2:(i-o)/o}}(o.a,o.b,o.rf,r.R_A),s=function(e){return void 0===e?null:e.split(",").map(AI)}(r.nadgrids),l=r.datum||MI(r.datumCode,r.datum_params,o.a,o.b,a.es,a.ep2,s);sI(this,r),sI(this,n),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=l,"init"in this&&"function"==typeof this.init&&this.init(),t(null,this)}else t("Could not get projection name from: "+e)}else t("Could not parse to valid json: "+e)}FI.projections=bI,FI.projections.start();const NI=FI;function BI(e,t,r){var n,i,o,a,s=e.x,l=e.y,c=e.z?e.z:0;if(l<-bT&&l>-1.001*bT)l=-bT;else if(l>bT&&l<1.001*bT)l=bT;else{if(l<-bT)return{x:-1/0,y:-1/0,z:e.z};if(l>bT)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(l),a=Math.cos(l),o=i*i,{x:((n=r/Math.sqrt(1-t*o))+c)*a*Math.cos(s),y:(n+c)*a*Math.sin(s),z:(n*(1-t)+c)*i}}function jI(e,t,r,n){var i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v=1e-12,b=e.x,x=e.y,w=e.z?e.z:0;if(i=Math.sqrt(b*b+x*x),o=Math.sqrt(b*b+x*x+w*w),i/r<v){if(y=0,o/r<v)return _=-n,{x:e.x,y:e.y,z:e.z}}else y=Math.atan2(x,b);a=w/o,d=(s=i/o)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),h=a*l,m=0;do{m++,c=t*(u=r/Math.sqrt(1-t*h*h))/(u+(_=i*d+w*h-u*(1-t*h*h))),g=(p=a*(l=1/Math.sqrt(1-c*(2-c)*s*s)))*d-(f=s*(1-c)*l)*h,d=f,h=p}while(g*g>1e-24&&m<30);return{x:y,y:Math.atan(p/Math.abs(f)),z:_}}function VI(e){return 1===e||2===e}function GI(e,t,r){if(function(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?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:2!==e.datum_type||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])}(e,t))return r;if(5===e.datum_type||5===t.datum_type)return r;var n=e.a,i=e.es;if(3===e.datum_type){if(0!==UI(e,!1,r))return;n=yT,i=_T}var o=t.a,a=t.b,s=t.es;if(3===t.datum_type&&(o=yT,a=6356752.314,s=_T),i===s&&n===o&&!VI(e.datum_type)&&!VI(t.datum_type))return r;if((r=BI(r,i,n),VI(e.datum_type)&&(r=function(e,t,r){if(1===t)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(2===t){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],c=r[6];return{x:c*(e.x-l*e.y+s*e.z)+n,y:c*(l*e.x+e.y-a*e.z)+i,z:c*(-s*e.x+a
vendor: 5,797 bytes, line 29
29*e.y+e.z)+o}}}(r,e.datum_type,e.datum_params)),VI(t.datum_type)&&(r=function(e,t,r){if(1===t)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(2===t){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],c=r[6],u=(e.x-n)/c,d=(e.y-i)/c,h=(e.z-o)/c;return{x:u+l*d-s*h,y:-l*u+d+a*h,z:s*u-a*d+h}}}(r,t.datum_type,t.datum_params)),r=jI(r,s,o,a),3===t.datum_type)&&0!==UI(t,!0,r))return;return r}function UI(e,t,r){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[];e:for(var a=0;a<e.grids.length;a++){var s=e.grids[a];if(o.push(s.name),s.isNull){i=n;break}if(null!==s.grid)for(var l=s.grid.subgrids,c=0,u=l.length;c<u;c++){var d=l[c],h=(Math.abs(d.del[1])+Math.abs(d.del[0]))/1e4,f=d.ll[0]-h,p=d.ll[1]-h,g=d.ll[0]+(d.lim[0]-1)*d.del[0]+h,m=d.ll[1]+(d.lim[1]-1)*d.del[1]+h;if(!(p>n.y||f>n.x||m<n.y||g<n.x)&&(i=$I(n,t,d),!isNaN(i.x)))break e}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*ST+" "+n.y*ST+" tried: '"+o+"'"),-1):(r.x=-i.x,r.y=i.y,0)}function $I(e,t,r){var n={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return n;var i={x:e.x,y:e.y};i.x-=r.ll[0],i.y-=r.ll[1],i.x=uI(i.x-Math.PI)+Math.PI;var o=HI(i,r);if(t){if(isNaN(o.x))return n;o.x=i.x-o.x,o.y=i.y-o.y;var a,s,l=9;do{if(s=HI(o,r),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge.  Using first approximation.");break}a={x:i.x-(s.x+o.x),y:i.y-(s.y+o.y)},o.x+=a.x,o.y+=a.y}while(l--&&Math.abs(a.x)>1e-12&&Math.abs(a.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=uI(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=e.x+o.x,n.y=e.y+o.y);return n}function HI(e,t){var r,n={x:e.x/t.del[0],y:e.y/t.del[1]},i=Math.floor(n.x),o=Math.floor(n.y),a=n.x-1*i,s=n.y-1*o,l={x:Number.NaN,y:Number.NaN};if(i<0||i>=t.lim[0])return l;if(o<0||o>=t.lim[1])return l;r=o*t.lim[0]+i;var c=t.cvs[r][0],u=t.cvs[r][1];r++;var d=t.cvs[r][0],h=t.cvs[r][1];r+=t.lim[0];var f=t.cvs[r][0],p=t.cvs[r][1];r--;var g=t.cvs[r][0],m=t.cvs[r][1],y=a*s,_=a*(1-s),v=(1-a)*(1-s),b=(1-a)*s;return l.x=v*c+_*d+b*g+y*f,l.y=v*u+_*h+b*m+y*p,l}function qI(e,t,r){var n,i,o,a=r.x,s=r.y,l=r.z||0,c={};for(o=0;o<3;o++)if(!t||2!==o||void 0!==r.z)switch(0===o?(n=a,i=-1!=="ew".indexOf(e.axis[o])?"x":"y"):1===o?(n=s,i=-1!=="ns".indexOf(e.axis[o])?"y":"x"):(n=l,i="z"),e.axis[o]){case"e":case"n":c[i]=n;break;case"w":case"s":c[i]=-n;break;case"u":void 0!==r[i]&&(c.z=n);break;case"d":void 0!==r[i]&&(c.z=-n);break;default:return null}return c}function WI(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 ZI(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function YI(e,t,r,n){var i,o=void 0!==(r=Array.isArray(r)?WI(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(e){ZI(e.x),ZI(e.y)}(r),e.datum&&t.datum&&function(e,t){return(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode||(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode}(e,t)&&(r=YI(e,i=new NI("WGS84"),r,n),e=i),n&&"enu"!==e.axis&&(r=qI(e,!1,r)),"longlat"===e.projName)r={x:r.x*wT,y:r.y*wT,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)))return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=GI(e.datum,t.datum,r))return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),"longlat"===t.projName?r={x:r.x*ST,y:r.y*ST,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})),n&&"enu"!==t.axis?qI(t,!0,r):(r&&!o&&delete r.z,r)}var XI=NI("WGS84");function KI(e,t,r,n){var i,o,a;return Array.isArray(r)?(i=YI(e,t,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.slice(3)):[i.x,i.y,r[2]].concat(r.slice(3)):[i.x,i.y].concat(r.slice(2)):[i.x,i.y]):(o=YI(e,t,r,n),2===(a=Object.keys(r)).length||a.forEach((function(n){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;o[n]=r[n]})),o)}function JI(e){return e instanceof NI?e:"object"==typeof e&&"oProj"in e?e.oProj:NI(e)}const QI=function(e,t,r){var n,i,o,a=!1;return void 0===t?(i=JI(e),n=XI,a=!0):(void 0!==t.x||Array.isArray(t))&&(r=t,i=JI(e),n=XI,a=!0),n||(n=JI(e)),i||(i=JI(t)),r?KI(n,i,r):(o={forward:function(e,t){return KI(n,i,e,t)},inverse:function(e,t){return KI(i,n,e,t)}},a&&(o.oProj=i),o)};var eM="AJSAJS",tM="AFAFAF",rM=65,nM=73,iM=79,oM=86,aM=90;const sM={forward:lM,inverse:function(e){var t=hM(gM(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:cM};function lM(e,t){return t=t||5,function(e,t){var r="00000"+e.easting,n="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(i=e.easting,o=e.northing,a=e.zoneNumber,s=pM(a),l=Math.floor(i/1e5),c=Math.floor(o/1e5)%20,function(e,t,r){var n=r-1,i=eM.charCodeAt(n),o=tM.charCodeAt(n),a=i+e-1,s=o+t,l=!1;return a>aM&&(a=a-aM+rM-1,l=!0),(a===nM||i<nM&&a>nM||(a>nM||i<nM)&&l)&&a++,(a===iM||i<iM&&a>iM||(a>iM||i<iM)&&l)&&++a===nM&&a++,a>aM&&(a=a-aM+rM-1),s>oM?(s=s-oM+rM-1,l=!0):l=!1,(s===nM||o<nM&&s>nM||(s>nM||o<nM)&&l)&&s++,(s===iM||o<iM&&s>iM||(s>iM||o<iM)&&l)&&++s===nM&&s++,s>oM&&(s=s-oM+rM-1),String.fromCharCode(a)+String.fromCharCode(s)}(l,c,s))+r.substr(r.length-5,t)+n.substr(n.length-5,t);var i,o,a,s,l,c}(function(e){var t,r,n,i,o,a,s,l,c=e.lat,u=e.lon,d=6378137,h=.00669438,f
vendor: 64,532 bytes, line 29
29=.9996,p=uM(c),g=uM(u);l=Math.floor((u+180)/6)+1,180===u&&(l=60);c>=56&&c<64&&u>=3&&u<12&&(l=32);c>=72&&c<84&&(u>=0&&u<9?l=31:u>=9&&u<21?l=33:u>=21&&u<33?l=35:u>=33&&u<42&&(l=37));s=uM(6*(l-1)-180+3),t=h/(1-h),r=d/Math.sqrt(1-h*Math.sin(p)*Math.sin(p)),n=Math.tan(p)*Math.tan(p),i=t*Math.cos(p)*Math.cos(p),o=Math.cos(p)*(g-s),a=d*((1-h/4-3*h*h/64-5*h*h*h/256)*p-(3*h/8+3*h*h/32+45*h*h*h/1024)*Math.sin(2*p)+(15*h*h/256+45*h*h*h/1024)*Math.sin(4*p)-35*h*h*h/3072*Math.sin(6*p));var m=f*r*(o+(1-n+i)*o*o*o/6+(5-18*n+n*n+72*i-58*t)*o*o*o*o*o/120)+5e5,y=f*(a+r*Math.tan(p)*(o*o/2+(5-n+9*i+4*i*i)*o*o*o*o/24+(61-58*n+n*n+600*i-330*t)*o*o*o*o*o*o/720));c<0&&(y+=1e7);return{northing:Math.round(y),easting:Math.round(m),zoneNumber:l,zoneLetter:fM(c)}}({lat:e[1],lon:e[0]}),t)}function cM(e){var t=hM(gM(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function uM(e){return e*(Math.PI/180)}function dM(e){return e/Math.PI*180}function hM(e){var t=e.northing,r=e.easting,n=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var o,a,s,l,c,u,d,h,f,p=.9996,g=6378137,m=.00669438,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=r-5e5,v=t;n<"N"&&(v-=1e7),d=6*(i-1)-180+3,o=.006739496752268451,f=(h=v/p/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*h)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*h)+151*y*y*y/96*Math.sin(6*h),a=g/Math.sqrt(1-m*Math.sin(f)*Math.sin(f)),s=Math.tan(f)*Math.tan(f),l=o*Math.cos(f)*Math.cos(f),c=.99330562*g/Math.pow(1-m*Math.sin(f)*Math.sin(f),1.5),u=_/(a*p);var b=f-a*Math.tan(f)/c*(u*u/2-(5+3*s+10*l-4*l*l-9*o)*u*u*u*u/24+(61+90*s+298*l+45*s*s-1.6983531815716497-3*l*l)*u*u*u*u*u*u/720);b=dM(b);var x,w=(u-(1+2*s+l)*u*u*u/6+(5-2*l+28*s-3*l*l+8*o+24*s*s)*u*u*u*u*u/120)/Math.cos(f);if(w=d+dM(w),e.accuracy){var S=hM({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});x={top:S.lat,right:S.lon,bottom:b,left:w}}else x={lat:b,lon:w};return x}function fM(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 pM(e){var t=e%6;return 0===t&&(t=6),t}function gM(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,r=e.length,n=null,i="",o=0;!/[A-Z]/.test(t=e.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+e;i+=t,o++}var a=parseInt(i,10);if(0===o||o+3>r)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;n=e.substring(o,o+=2);for(var l=pM(a),c=function(e,t){var r=eM.charCodeAt(t-1),n=1e5,i=!1;for(;r!==e.charCodeAt(0);){if(++r===nM&&r++,r===iM&&r++,r>aM){if(i)throw"Bad character: "+e;r=rM,i=!0}n+=1e5}return n}(n.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var r=tM.charCodeAt(t-1),n=0,i=!1;for(;r!==e.charCodeAt(0);){if(++r===nM&&r++,r===iM&&r++,r>oM){if(i)throw"Bad character: "+e;r=rM,i=!0}n+=1e5}return n}(n.charAt(1),l);u<mM(s);)u+=2e6;var d=r-o;if(d%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var h,f,p,g=d/2,m=0,y=0;return g>0&&(h=1e5/Math.pow(10,g),f=e.substring(o,o+g),m=parseFloat(f)*h,p=e.substring(o+g),y=parseFloat(p)*h),{easting:m+c,northing:y+u,zoneLetter:s,zoneNumber:a,accuracy:h}}function mM(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 yM(e,t,r){if(!(this instanceof yM))return new yM(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var n=e.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||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")}yM.fromMGRS=function(e){return new yM(cM(e))},yM.prototype.toMGRS=function(e){return lM([this.x,this.y],e)};const _M=yM;var vM=.046875,bM=.01953125,xM=.01068115234375;function wM(e){var t=[];t[0]=1-e*(.25+e*(vM+e*(bM+e*xM))),t[1]=e*(.75-e*(vM+e*(bM+e*xM)));var r=e*e;return t[2]=r*(.46875-e*(.013020833333333334+.007120768229166667*e)),r*=e,t[3]=r*(.3645833333333333-.005696614583333333*e),t[4]=r*e*.3076171875,t}function SM(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}function kM(e,t,r){for(var n=1/(1-t),i=e,o=20;o;--o){var a=Math.sin(i),s=1-t*a*a;if(i-=s=(SM(i,a,Math.cos(i),r)-e)*(s*Math.sqrt(s))*n,Math.abs(s)<xT)return i}return i}const TM={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=wM(this.es),this.ml0=SM(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,r,n,i=e.x,o=e.y,a=uI(i-this.long0,this.over),s=Math.sin(o),l=Math.cos(o);if(this.es){var c=l*a,u=Math.pow(c,2),d=this.ep2*Math.pow(l,2),h=Math.pow(d,2),f=Math.abs(l)>xT?Math.tan(o):0,p=Math.pow(f,2),g=Math.pow(p,2);t=1-this.es*Math.pow(s,2),c/=Math.sqrt(t);var m=SM(o,s,l,this.en);r=this.a*(this.k0*c*(1+u/6*(1-p+d+u/20*(5-18*p+g+14*d-58*p*d+u/42*(61+179*g-g*p-479*p)))))+this.x0,n=this.a*(this.k0*(m-this.ml0+s*a*c/2*(1+u/12*(5-p+9*d+4*h+u/30*(61+g-58*p+270*d-330*p*d+u/56*(1385+543*g-g*p-3111*p))))))+this.y0}else{var y=l*Math.sin(a);if(Math.abs(Math.abs(y)-1)<xT)return 93;if(r=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,n=l*Math.cos(a)/Math.sqrt(1-Math.pow(y,2)),(y=Math.abs(n))>=1){if(y-1>xT)return 93;n=0}else n=Math.acos(n);o<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return e.x=r,e.y=n,e},inverse:function(e){var t,r,n,i,o=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(r=kM(t=this.ml0+a/this.k0,this.es,this.en),Math.abs(r)<bT){var s=Math.sin(r),l=Math.cos(r),c=Math.abs(l)>xT?Math.tan(r):0,u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),h=Math.pow(c,2),f=Math.pow(h,2);t=1-this.es*Math.pow(s,2);var p=o*Math.sqrt(t)/this.k0,g=Math.pow(p,2);n=r-(t*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*h-9*u*h+u-4*d-g/30*(61+90*h-252*u*h+45*f+46*u-g/56*(1385+3633*h+4095*f+1574*f*h)))),i=uI(this.long0+p*(1-g/6*(1+2*h+u-g/20*(5+28*h+24*f+8*u*h+6*u-g/42*(61+662*h+1320*f+720*f*h))))/l,this.over)}else n=bT*cI(a),i=0;else{var m=Math.exp(o/this.k0),y=.5*(m-1/m),_=this.lat0+a/this.k0,v=Math.cos(_);t=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(y,2))),n=Math.asin(t),a<0&&(n=-n),i=0===y&&0===v?0:uI(Math.atan2(y,v)+this.long0,this.over)}return e.x=i,e.y=n,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function IM(e){var t=Math.exp(e);return t=(t-1/t)/2}function MM(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function EM(e){var t=Math.abs(e);return t=function(e){var t=1+e,r=t-1;return 0===r?e:e*Math.log(t)/r}(t*(1+t/(MM(1,t)+1))),e<0?-t:t}function PM(e,t){for(var r,n=2*Math.cos(2*t),i=e.length-1,o=e[i],a=0;--i>=0;)r=n*o-a+e[i],a=o,o=r;return t+r*Math.sin(2*t)}function AM(e,t,r){for(var n,i,o=Math.sin(t),a=Math.cos(t),s=IM(r),l=function(e){var t=Math.exp(e);return(t+1/t)/2}(r),c=2*a*l,u=-2*o*s,d=e.length-1,h=e[d],f=0,p=0,g=0;--d>=0;)n=p,i=f,h=c*(p=h)-n-u*(f=g)+e[d],g=u*p-i+c*f;return[(c=o*l)*h-(u=a*s)*g,c*g+u*h]}const CM={init:function(){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&&(TM.init.apply(this),this.forward=TM.forward,this.inverse=TM.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?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*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),r*=t,this.cgb[1]=r*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),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*(1.6+t*(-12686/2835)))),r*=t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(t*(-24832/14175)-2.4)),r*=t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),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*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),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*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),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*=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*=t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r*=t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var n=PM(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(e,t){for(var r,n=2*Math.cos(t),i=e.length-1,o=e[i],a=0;--i>=0;)r=n*o-a+e[i],a=o,o=r;return Math.sin(t)*r}(this.gtu,2*n))},forward:function(e){var t=uI(e.x-this.long0,this.over),r=e.y;r=PM(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(t),a=Math.cos(t);r=Math.atan2(n,a*i),t=Math.atan2(o*i,MM(n,i*a)),t=EM(Math.tan(t));var s,l,c=AM(this.gtu,2*r,2*t);return r+=c[0],t+=c[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e},inverse:function(e){var t,r,n=(e.x-this.x0)*(1/this.a),i=(e.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var o=AM(this.utg,2*i,2*n);i+=o[0],n+=o[1],n=Math.atan(IM(n));var a=Math.sin(i),s=Math.cos(i),l=Math.sin(n),c=Math.cos(n);i=Math.atan2(a*c,MM(l,c*s)),t=uI((n=Math.atan2(l,c*s))+this.long0,this.over),r=PM(this.cgb,i)}else t=1/0,r=1/0;return e.x=t,e.y=r,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};const RM={init:function(){var e=function(e,t){if(void 0===e){if((e=Math.floor(30*(uI(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e}(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*wT,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,CM.init.apply(this),this.forward=CM.forward,this.inverse=CM.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function LM(e,t){return Math.pow((1-e)/(1+e),t)}const OM={init:function(){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+kT)/(Math.pow(Math.tan(.5*this.lat0+kT),this.C)*LM(this.e*e,this.ratexp))},forward:function(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+kT),this.C)*LM(this.e*Math.sin(r),this.ratexp))-bT,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,r=e.y,n=Math.pow(Math.tan(.5*r+kT)/this.K,1/this.C),i=20;i>0&&(r=2*Math.atan(n*LM(this.e*Math.sin(e.y),-.5*this.e))-bT,!(Math.abs(r-e.y)<1e-14));--i)e.y=r;return i?(e.x=t,e.y=r,e):null},names:["gauss"]};const DM={init:function(){OM.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"))},forward:function(e){var t,r,n,i;return e.x=uI(e.x-this.long0,this.over),OM.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*n),e.x=i*r*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*r*n),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,r,n,i,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=MM(e.x,e.y)){var a=2*Math.atan2(o,this.R2);t=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+e.y*t*this.cosc0/o),n=Math.atan2(e.x*t,o*this.cosc0*r-e.y*this.sinc0*t)}else i=this.phic0,n=0;return e.x=n,e.y=i,OM.inverse.apply(this,[e]),e.x=uI(e.x+this.long0,this.over),e},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function zM(e,t,r){return t*=r,Math.tan(.5*(bT+e))*Math.pow((1-t)/(1+t),.5*r)}const FM={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=xT&&(this.k0=.5*(1+cI(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=xT&&(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)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=xT&&Math.abs(Math.cos(this.lat_ts))>xT&&(this.k0=.5*this.cons*lI(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/dI(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=lI(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(zM(this.lat0,this.sinlat0,this.e))-bT,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,r,n,i,o,a,s=e.x,l=e.y,c=Math.sin(l),u=Math.cos(l),d=uI(s-this.long0,this.over);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=xT&&Math.abs(l+this.lat0)<=xT?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(d)),e.x=this.a*t*u*Math.sin(d)+this.x0,e.y=this.a*t*(this.coslat0*c-this.sinlat0*u*Math.cos(d))+this.y0,e):(r=2*Math.atan(zM(l,c,this.e))-bT,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=xT?(o=dI(this.e,l*this.con,this.con*c),a=2*this.a*this.k0*o/this.cons,e.x=this.x0+a*Math.sin(s-this.long0),e.y=this.y0-this.con*a*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<xT?(t=2*this.a*this.k0/(1+i*Math.cos(d)),e.y=t*n):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*i*Math.cos(d))),e.y=t*(this.cosX0*n-this.sinX0*i*Math.cos(d))+this.y0),e.x=t*i*Math.sin(d)+this.x0,e))},inverse:function(e){var t,r,n,i,o;e.x-=this.x0,e.y-=this.y0;var a=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,r=this.lat0,a<=xT?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/a),t=Math.abs(this.coslat0)<xT?this.lat0>0?uI(this.long0+Math.atan2(e.x,-1*e.y),this.over):uI(this.long0+Math.atan2(e.x,e.y),this.over):uI(this.long0+Math.atan2(e.x*Math.sin(s),a*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s)),this.over),e.x=t,e.y=r,e)}if(Math.abs(this.coslat0)<=xT){if(a<=xT)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*hI(this.e,n),t=this.con*uI(this.con*this.long0+Math.atan2(e.x,-1*e.y),this.over)}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=xT?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/a),t=uI(this.long0+Math.atan2(e.x*Math.sin(i),a*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)),this.over)),r=-1*hI(this.e,Math.tan(.5*(bT+o)));return e.x=t,e.y=r,e},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_:zM};const NM={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),o=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(t,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*s+this.alpha*o/2*l},forward:function(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))),n=-this.alpha*(t+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*a+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,r=e.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,l=0,c=o,u=-1e3,d=0;Math.abs(c-u)>1e-7;){if(++d>20)return;l=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)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=c,e},names:["somerc"]};var BM=1e-7;const jM={init:function(){var e,t,r,n,i,o,a,s,l,c,u,d=0,h=0,f=0,p=0,g=0,m=0,y=0;this.no_off=function(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],r="object"==typeof e.projName?Object.keys(e.projName)[0]:e.projName;return"no_uoff"in e||"no_off"in e||-1!==t.indexOf(r)||-1!==t.indexOf(vI(r))}(this),this.no_rot="no_rot"in this;var _=!1;"alpha"in this&&(_=!0);var v=!1;if("rectified_grid_angle"in this&&(v=!0),_&&(y=this.alpha),v&&(d=this.rectified_grid_angle),_||v)h=this.longc;else if(f=this.long1,g=this.lat1,p=this.long2,m=this.lat2,Math.abs(g-m)<=BM||(e=Math.abs(g))<=BM||Math.abs(e-bT)<=BM||Math.abs(Math.abs(this.lat0)-bT)<=BM||Math.abs(Math.abs(m)-bT)<=BM)throw new Error;var b=1-this.es;t=Math.sqrt(b),Math.abs(this.lat0)>xT?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*t/e,(i=(n=this.B*t/(r*Math.sqrt(e)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(dI(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),_||v?(_?(u=Math.asin(Math.sin(y)/n),v||(d=y)):(u=d,y=Math.asin(n*Math.sin(u))),this.lam0=h-Math.asin(.5*(i-1/i)*Math.tan(u))/this.B):(o=Math.pow(dI(this.e,g,Math.sin(g)),this.B),a=Math.pow(dI(this.e,m,Math.sin(m)),this.B),i=this.E/o,l=(a-o)/(a+o),c=((c=this.E*this.E)-a*o)/(c+a*o),(e=f-p)<-Math.PI?p-=TT:e>Math.PI&&(p+=TT),this.lam0=uI(.5*(f+p)-Math.atan(c*Math.tan(.5*this.B*(f-p))/l)/this.B,this.over),u=Math.atan(2*Math.sin(this.B*uI(f-this.lam0,this.over))/(i-1/i)),d=y=Math.asin(n*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(kT-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(kT+i))},forward:function(e){var t,r,n,i,o,a,s,l,c={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-bT)>xT){if(t=.5*((o=this.E/Math.pow(dI(this.e,e.y,Math.sin(e.y)),this.B))-(a=1/o)),r=.5*(o+a),i=Math.sin(this.B*e.x),n=(t*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)<xT)throw new Error;l=.5*this.ArB*Math.log((1-n)/(1+n)),a=Math.cos(this.B*e.x),s=Math.abs(a)<BM?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+i*this.singam,a)}else l=e.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*e.y;return this.no_rot?(c.x=s,c.y=l):(s-=this.u_0,c.x=l*this.cosrot+s*this.sinrot,c.y=s*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(e){var t,r,n,i,o,a,s,l={};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),i=.5*((n=Math.exp(-this.BrA*r))-1/n),o=.5*(n+1/n),s=((a=Math.sin(this.BrA*t))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(s)-1)<xT)l.x=0,l.y=s<0?-bT:bT;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=hI(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};const VM={init:function(){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)<xT)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),n=lI(this.e,t,r),i=dI(this.e,this.lat1,t),o=Math.sin(this.lat2),a=Math.cos(this.lat2),s=lI(this.e,o,a),l=dI(this.e,this.lat2,o),c=Math.abs(Math.abs(this.lat0)-bT)<xT?0:dI(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>xT?this.ns=Math.log(n/s)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=xT&&(r=cI(r)*(bT-2e-10));var n,i,o=Math.abs(Math.abs(r)-bT);if(o>xT)n=dI(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((o=r*this.ns)<=0)return null;i=0}var a=this.ns*uI(t-this.long0,this.over);return e.x=this.k0*(i*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-i*Math.cos(a))+this.y0,e},inverse:function(e){var t,r,n,i,o,a=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+s*s),r=1):(t=-Math.sqrt(a*a+s*s),r=-1);var l=0;if(0!==t&&(l=Math.atan2(r*a,r*s)),0!==t||this.ns>0){if(r=1/this.ns,n=Math.pow(t/(this.a*this.f0),r),-9999===(i=hI(this.e,n)))return null}else i=-bT;return o=uI(l/this.ns+this.long0,this.over),e.x=o,e.y=i,e},names:["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)"]};const GM={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),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},forward:function(e){var t,r,n,i,o,a,s,l=e.x,c=e.y,u=uI(l-this.long0,this.over);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),n=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=s*Math.cos(a)/1,e.x=s*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,r,n,i,o,a,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),i=Math.atan2(e.y,e.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),e.x=this.long0-r/this.alfa,a=t,s=0;var c=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(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(s=1),a=e.y,c+=1}while(0===s&&c<15);return c>=15?null:e},names:["Krovak","krovak"]};function UM(e,t,r,n,i){return e*i-t*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function $M(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function HM(e){return.375*e*(1+.25*e*(1+.46875*e))}function qM(e){return.05859375*e*e*(1+.75*e)}function WM(e){return e*e*e*(35/3072)}function ZM(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}function YM(e){return Math.abs(e)<bT?e:e-cI(e)*Math.PI}function XM(e,t,r,n,i){var o,a;o=e/t;for(var s=0;s<15;s++)if(o+=a=(e-(t*o-r*Math.sin(2*o)+n*Math.sin(4*o)-i*Math.sin(6*o)))/(t-2*r*Math.cos(2*o)+4*n*Math.cos(4*o)-6*i*Math.cos(6*o)),Math.abs(a)<=1e-10)return o;return NaN}const KM={init:function(){this.sphere||(this.e0=$M(this.es),this.e1=HM(this.es),this.e2=qM(this.es),this.e3=WM(this.es),this.ml0=this.a*UM(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,r,n=e.x,i=e.y;if(n=uI(n-this.long0,this.over),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(n)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var o=Math.sin(i),a=Math.cos(i),s=ZM(this.a,this.e,o),l=Math.tan(i)*Math.tan(i),c=n*Math.cos(i),u=c*c,d=this.es*a*a/(1-this.es);t=s*c*(1-u*l*(1/6-(8-l+8*d)*u/120)),r=this.a*UM(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+s*o/a*u*(.5+(5-l+6*d)*u/24)}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,n=e.x/this.a,i=e.y/this.a;if(this.sphere){var o=i+this.lat0;t=Math.asin(Math.sin(o)*Math.cos(n)),r=Math.atan2(Math.tan(n),Math.cos(o))}else{var a=XM(this.ml0/this.a+i,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-bT)<=xT)return e.x=this.long0,e.y=bT,i<0&&(e.y*=-1),e;var s=ZM(this.a,this.e,Math.sin(a)),l=s*s*s/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(a),2),u=n*this.a/s,d=u*u;t=a-s*Math.tan(a)/l*u*u*(.5-(1+3*c)*u*u/24),r=u*(1-d*(c/3+(1+3*c)*c*d/15))/Math.cos(a)}return e.x=uI(r+this.long0,this.over),e.y=YM(t),e},names:["Cassini","Cassini_Soldner","cass"]};function JM(e,t){var r;return e>1e-7?(1-e*e)*(t/(1-(r=e*t)*r)-.5/e*Math.log((1-r)/(1+r))):2*t}var QM=.3333333333333333,eE=.17222222222222222,tE=.10257936507936508,rE=.06388888888888888,nE=.0664021164021164,iE=.016415012942191543;const oE={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-bT)<xT?this.mode=this.lat0<0?1:2:Math.abs(t)<xT?this.mode=3:this.mode=4,this.es>0)switch(this.qp=JM(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,r=[];return r[0]=e*QM,t=e*e,r[0]+=t*eE,r[1]=t*rE,t*=e,r[0]+=t*tE,r[1]+=t*nE,r[2]=t*iE,r}(this.es),this.mode){case 2:case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=JM(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else 4===this.mode&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,r,n,i,o,a,s,l,c,u,d=e.x,h=e.y;if(d=uI(d-this.long0,this.over),this.sphere){if(o=Math.sin(h),u=Math.cos(h),n=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+u*n:1+this.sinph0*o+this.cosph0*u*n)<=xT)return null;t=(r=Math.sqrt(2/r))*u*Math.sin(d),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*u*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(h+this.lat0)<xT)return null;r=kT-.5*h,t=(r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)))*Math.sin(d),r*=n}}else{switch(s=0,l=0,c=0,n=Math.cos(d),i=Math.sin(d),o=Math.sin(h),a=JM(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=a/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*l*n;break;case this.EQUIT:c=1+l*n;break;case this.N_POLE:c=bT+h,a=this.qp-a;break;case this.S_POLE:c=h-bT,a=this.qp+a}if(Math.abs(c)<xT)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),r=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*s-this.sinb1*l*n):(c=Math.sqrt(2/(1+l*n)))*s*this.ymf,t=this.xmf*c*l*i;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(c=Math.sqrt(a))*i,r=n*(this.mode===this.S_POLE?c:-c)):t=r=0}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,i,o,a,s,l,c,u,d=e.x/this.a,h=e.y/this.a;if(this.sphere){var f,p=0,g=0;if((r=.5*(f=Math.sqrt(d*d+h*h)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(r),p=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(f)<=xT?0:Math.asin(h*g/f),d*=g,h=p*f;break;case this.OBLIQ:r=Math.abs(f)<=xT?this.lat0:Math.asin(p*this.sinph0+h*g*this.cosph0/f),d*=g*this.cosph0,h=(p-Math.sin(r)*this.sinph0)*f;break;case this.N_POLE:h=-h,r=bT-r;break;case this.S_POLE:r-=bT}t=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,h*=this.dd,(a=Math.sqrt(d*d+h*h))<xT)return e.x=this.long0,e.y=this.lat0,e;i=2*Math.asin(.5*a/this.rq),n=Math.cos(i),d*=i=Math.sin(i),this.mode===this.OBLIQ?(s=n*this.sinb1+h*i*this.cosb1/a,o=this.qp*s,h=a*this.cosb1*n-h*this.sinb1*i):(s=h*i/a,o=this.qp*s,h=a*n)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(o=d*d+h*h))return e.x=this.long0,e.y=this.lat0,e;s=1-o/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(d,h),l=Math.asin(s),c=this.apa,u=l+l,r=l+c[0]*Math.sin(u)+c[1]*Math.sin(u+u)+c[2]*Math.sin(u+u+u)}return e.x=uI(this.long0+t,this.over),e.y=r,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function aE(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}const sE={init:function(){Math.abs(this.lat1+this.lat2)<xT||(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=lI(this.e3,this.sin_po,this.cos_po),this.qs1=JM(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=lI(this.e3,this.sin_po,this.cos_po),this.qs2=JM(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=JM(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>xT?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)},forward:function(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=JM(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*uI(t-this.long0,this.over),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return e.x=a,e.y=s,e},inverse:function(e){var t,r,n,i,o,a;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),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),i=0,0!==t&&(i=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),o=uI(i/this.ns0+this.long0,this.over),e.x=o,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function(e,t){var r,n,i,o,a=aE(.5*t);if(e<xT)return a;for(var s=e*e,l=1;l<=25;l++)if(a+=o=.5*(i=1-(n=e*(r=Math.sin(a)))*n)*i/Math.cos(a)*(t/(1-s)-r/i+.5/e*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return a;return null}};const lE={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,r,n,i,o,a,s,l=e.x,c=e.y;return n=uI(l-this.long0,this.over),t=Math.sin(c),r=Math.cos(c),i=Math.cos(n),(o=this.sin_p14*t+this.cos_p14*r*i)>0||Math.abs(o)<=xT?(a=this.x0+1*this.a*r*Math.sin(n)/o,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)/o):(a=this.x0+this.infinity_dist*r*Math.sin(n),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*i)),e.x=a,e.y=s,e},inverse:function(e){var t,r,n,i,o,a;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))?(i=Math.atan2(t,this.rc),r=Math.sin(i),a=aE((n=Math.cos(i))*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r),o=uI(this.long0+o,this.over)):(a=this.phic0,o=0),e.x=o,e.y=a,e},names:["gnom"]};const cE={init:function(){this.sphere||(this.k0=lI(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,r,n=e.x,i=e.y,o=uI(n-this.long0,this.over);if(this.sphere)t=this.x0+this.a*o*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=JM(this.e,Math.sin(i));t=this.x0+this.a*this.k0*o,r=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=r,e},inverse:function(e){var t,r;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=uI(this.long0+e.x/this.a/Math.cos(this.lat_ts),this.over),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=function(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*bT:bT;for(var n,i,o,a,s=Math.asin(.5*t),l=0;l<30;l++)if(i=Math.sin(s),o=Math.cos(s),a=e*i,s+=n=Math.pow(1-a*a,2)/(2*o)*(t/(1-e*e)-i/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return s;return NaN}(this.e,2*e.y*this.k0/this.a),t=uI(this.long0+e.x/(this.a*this.k0),this.over)),e.x=t,e.y=r,e},names:["cea"]};const uE={init:function(){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)},forward:function(e){var t=e.x,r=e.y,n=uI(t-this.long0,this.over),i=YM(r-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*i,e},inverse:function(e){var t=e.x,r=e.y;return e.x=uI(this.long0+(t-this.x0)/(this.a*this.rc),this.over),e.y=YM(this.lat0+(r-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};const dE={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=$M(this.es),this.e1=HM(this.es),this.e2=qM(this.es),this.e3=WM(this.es),this.ml0=this.a*UM(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,r,n,i=e.x,o=e.y,a=uI(i-this.long0,this.over);if(n=a*Math.sin(o),this.sphere)Math.abs(o)<=xT?(t=this.a*a,r=-1*this.a*this.lat0):(t=this.a*Math.sin(n)/Math.tan(o),r=this.a*(YM(o-this.lat0)+(1-Math.cos(n))/Math.tan(o)));else if(Math.abs(o)<=xT)t=this.a*a,r=-1*this.ml0;else{var s=ZM(this.a,this.e,Math.sin(o))/Math.tan(o);t=s*Math.sin(n),r=this.a*UM(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(n))}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){var t,r,n,i,o,a,s,l,c;if(n=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=xT)t=uI(n/this.a+this.long0,this.over),r=0;else{var u;for(a=this.lat0+i/this.a,s=n*n/this.a/this.a+a*a,l=a,o=20;o;--o)if(l+=c=-1*(a*(l*(u=Math.tan(l))+1)-l-.5*(l*l+s)*u)/((l-a)/u-1),Math.abs(c)<=xT){r=l;break}t=uI(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(r),this.over)}else if(Math.abs(i+this.ml0)<=xT)r=0,t=uI(this.long0+n/this.a,this.over);else{var d,h,f,p,g;for(a=(this.ml0+i)/this.a,s=n*n/this.a/this.a+a*a,l=a,o=20;o;--o)if(g=this.e*Math.sin(l),d=Math.sqrt(1-g*g)*Math.tan(l),h=this.a*UM(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(a*(d*(p=h/this.a)+1)-p-.5*d*(p*p+s))/(this.es*Math.sin(2*l)*(p*p+s-2*a*p)/(4*d)+(a-p)*(d*f-2/Math.sin(2*l))-f),Math.abs(c)<=xT){r=l;break}d=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=uI(this.long0+Math.asin(n*d/this.a)/Math.sin(r),this.over)}return e.x=t,e.y=r,e},names:["Polyconic","American_Polyconic","poly"]};const hE={init:function(){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},forward:function(e){var t,r=e.x,n=e.y-this.lat0,i=r-this.long0,o=n/vT*1e-5,a=i,s=1,l=0;for(t=1;t<=10;t++)s*=o,l+=this.A[t]*s;var c,u=l,d=a,h=1,f=0,p=0,g=0;for(t=1;t<=6;t++)c=f*u+h*d,h=h*u-f*d,f=c,p=p+this.B_re[t]*h-this.B_im[t]*f,g=g+this.B_im[t]*h+this.B_re[t]*f;return e.x=g*this.a+this.x0,e.y=p*this.a+this.y0,e},inverse:function(e){var t,r,n=e.x,i=e.y,o=n-this.x0,a=(i-this.y0)/this.a,s=o/this.a,l=1,c=0,u=0,d=0;for(t=1;t<=6;t++)r=c*a+l*s,l=l*a-c*s,c=r,u=u+this.C_re[t]*l-this.C_im[t]*c,d=d+this.C_im[t]*l+this.C_re[t]*c;for(var h=0;h<this.iterations;h++){var f,p=u,g=d,m=a,y=s;for(t=2;t<=6;t++)f=g*u+p*d,p=p*u-g*d,g=f,m+=(t-1)*(this.B_re[t]*p-this.B_im[t]*g),y+=(t-1)*(this.B_im[t]*p+this.B_re[t]*g);p=1,g=0;var _=this.B_re[1],v=this.B_im[1];for(t=2;t<=6;t++)f=g*u+p*d,p=p*u-g*d,g=f,_+=t*(this.B_re[t]*p-this.B_im[t]*g),v+=t*(this.B_im[t]*p+this.B_re[t]*g);var b=_*_+v*v;u=(m*_+y*v)/b,d=(y*_-m*v)/b}var x=u,w=d,S=1,k=0;for(t=1;t<=9;t++)S*=x,k+=this.D[t]*S;var T=this.lat0+k*vT*1e5,I=this.long0+w;return e.x=I,e.y=T,e},names:["New_Zealand_Map_Grid","nzmg"]};const fE={init:function(){},forward:function(e){var t=e.x,r=e.y,n=uI(t-this.long0,this.over),i=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return e.x=i,e.y=o,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=uI(this.long0+e.x/this.a,this.over),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e},names:["Miller_Cylindrical","mill"]};const pE={init:function(){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)},forward:function(e){var t,r,n=e.x,i=e.y;if(n=uI(n-this.long0,this.over),this.sphere){if(this.m)for(var o=this.n*Math.sin(i),a=20;a;--a){var s=(this.m*i+Math.sin(i)-o)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<xT)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;t=this.a*this.C_x*n*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var l=Math.sin(i),c=Math.cos(i);r=this.a*SM(i,l,c,this.en),t=this.a*n*c/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,n;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=aE((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=aE(Math.sin(t)/this.n)),r=uI(r+this.long0,this.over),t=YM(t)):(t=kM(e.y/this.a,this.es,this.en),(n=Math.abs(t))<bT?(n=Math.sin(t),r=uI(this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),this.over)):n-xT<bT&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};const gE={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0},forward:function(e){for(var t=e.x,r=e.y,n=uI(t-this.long0,this.over),i=r,o=Math.PI*Math.sin(r);;){var a=-(i+Math.sin(i)-o)/(1+Math.cos(i));if(i+=a,Math.abs(a)<xT)break}i/=2,Math.PI/2-Math.abs(r)<xT&&(n=0);var s=.900316316158*this.a*n*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=l,e},inverse:function(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 n=uI(this.long0+e.x/(.900316316158*this.a*Math.cos(t)),this.over);n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return e.x=n,e.y=i,e},names:["Mollweide","moll"]};const mE={init:function(){Math.abs(this.lat1+this.lat2)<xT||(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=$M(this.es),this.e1=HM(this.es),this.e2=qM(this.es),this.e3=WM(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=lI(this.e,this.sin_phi,this.cos_phi),this.ml1=UM(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<xT?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=lI(this.e,this.sin_phi,this.cos_phi),this.ml2=UM(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=UM(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,r=e.x,n=e.y;if(this.sphere)t=this.a*(this.g-n);else{var i=UM(this.e0,this.e1,this.e2,this.e3,n);t=this.a*(this.g-i)}var o=this.ns*uI(r-this.long0,this.over),a=this.x0+t*Math.sin(o),s=this.y0+this.rh-t*Math.cos(o);return e.x=a,e.y=s,e},inverse:function(e){var t,r,n,i;e.x-=this.x0,e.y=this.rh-e.y+this.y0,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;return 0!==r&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere?(i=uI(this.long0+o/this.ns,this.over),n=YM(this.g-r/this.a),e.x=i,e.y=n,e):(n=XM(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=uI(this.long0+o/this.ns,this.over),e.x=i,e.y=n,e)},names:["Equidistant_Conic","eqdc"]};const yE={init:function(){this.R=this.a},forward:function(e){var t,r,n=e.x,i=e.y,o=uI(n-this.long0,this.over);Math.abs(i)<=xT&&(t=this.x0+this.R*o,r=this.y0);var a=aE(2*Math.abs(i/Math.PI));(Math.abs(o)<=xT||Math.abs(Math.abs(i)-bT)<=xT)&&(t=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/o-o/Math.PI),l=s*s,c=Math.sin(a),u=Math.cos(a),d=u/(c+u-1),h=d*d,f=d*(2/c-1),p=f*f,g=Math.PI*this.R*(s*(d-p)+Math.sqrt(l*(d-p)*(d-p)-(p+l)*(h-p)))/(p+l);o<0&&(g=-g),t=this.x0+g;var m=l+d;return g=Math.PI*this.R*(f*m-s*Math.sqrt((p+l)*(l+1)-m*m))/(p+l),r=i>=0?this.y0+g:this.y0-g,e.x=t,e.y=r,e},inverse:function(e){var t,r,n,i,o,a,s,l,c,u,d,h;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,o=(n=e.x/d)*n+(i=e.y/d)*i,d=3*(i*i/(l=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+n*n)*s*s/l/l/l-9*a*s/l/l)/27)/(c=(a-s*s/3/l)/l)/(u=2*Math.sqrt(-c/3)),Math.abs(d)>1&&(d=d>=0?1:-1),h=Math.acos(d)/3,r=e.y>=0?(-u*Math.cos(h+Math.PI/3)-s/3/l)*Math.PI:-(-u*Math.cos(h+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(n)<xT?this.long0:uI(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-i*i)+o*o))/2/n,this.over),e.x=t,e.y=r,e},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};const _E={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))},forward:function(e){var t,r,n,i,o,a,s,l,c,u,d,h=e.x,f=e.y,p=Math.sin(e.y),g=Math.cos(e.y),m=uI(h-this.long0,this.over);return this.sphere?Math.abs(this.sin_p12-1)<=xT?(e.x=this.x0+this.a*(bT-f)*Math.sin(m),e.y=this.y0-this.a*(bT-f)*Math.cos(m),e):Math.abs(this.sin_p12+1)<=xT?(e.x=this.x0+this.a*(bT+f)*Math.sin(m),e.y=this.y0+this.a*(bT+f)*Math.cos(m),e):(c=this.sin_p12*p+this.cos_p12*g*Math.cos(m),l=(s=Math.acos(c))?s/Math.sin(s):1,e.x=this.x0+this.a*l*g*Math.sin(m),e.y=this.y0+this.a*l*(this.cos_p12*p-this.sin_p12*g*Math.cos(m)),e):(t=$M(this.es),r=HM(this.es),n=qM(this.es),i=WM(this.es),Math.abs(this.sin_p12-1)<=xT?(o=this.a*UM(t,r,n,i,bT),a=this.a*UM(t,r,n,i,f),e.x=this.x0+(o-a)*Math.sin(m),e.y=this.y0-(o-a)*Math.cos(m),e):Math.abs(this.sin_p12+1)<=xT?(o=this.a*UM(t,r,n,i,bT),a=this.a*UM(t,r,n,i,f),e.x=this.x0+(o+a)*Math.sin(m),e.y=this.y0+(o+a)*Math.cos(m),e):Math.abs(h)<xT&&Math.abs(f-this.lat0)<xT?(e.x=e.y=0,e):(u=function(e,t,r,n,i,o){const a=n-t,s=Math.atan((1-o)*Math.tan(e)),l=Math.atan((1-o)*Math.tan(r)),c=Math.sin(s),u=Math.cos(s),d=Math.sin(l),h=Math.cos(l);let f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E=a,P=100;do{if(p=Math.sin(E),g=Math.cos(E),m=Math.sqrt(h*p*(h*p)+(u*d-c*h*g)*(u*d-c*h*g)),0===m)return{azi1:0,s12:0};y=c*d+u*h*g,_=Math.atan2(m,y),v=u*h*p/m,b=1-v*v,x=0!==b?y-2*c*d/b:0,w=o/16*b*(4+o*(4-3*b)),f=E,E=a+(1-w)*o*v*(_+w*m*(x+w*y*(2*x*x-1)))}while(Math.abs(E-f)>1e-12&&--P>0);return 0===P?{azi1:NaN,s12:NaN}:(S=b*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),k=1+S/16384*(4096+S*(S*(320-175*S)-768)),T=S/1024*(256+S*(S*(74-47*S)-128)),I=T*m*(x+T/4*(y*(2*x*x-1)-T/6*x*(4*m*m-3)*(4*x*x-3))),M=i*(1-o)*k*(_-I),{azi1:Math.atan2(h*p,u*d-c*h*g),s12:M})}(this.lat0,this.long0,f,h,this.a,this.f),d=u.azi1,e.x=u.s12*Math.sin(d),e.y=u.s12*Math.cos(d),e))},inverse:function(e){var t,r,n,i,o,a,s,l,c,u,d,h,f,p,g;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*bT*this.a)return;return r=t/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(t)<=xT?a=this.lat0:(a=aE(i*this.sin_p12+e.y*n*this.cos_p12/t),s=Math.abs(this.lat0)-bT,o=Math.abs(s)<=xT?this.lat0>=0?uI(this.long0+Math.atan2(e.x,-e.y),this.over):uI(this.long0-Math.atan2(-e.x,e.y),this.over):uI(this.long0+Math.atan2(e.x*n,t*this.cos_p12*i-e.y*this.sin_p12*n),this.over)),e.x=o,e.y=a,e}return l=$M(this.es),c=HM(this.es),u=qM(this.es),d=WM(this.es),Math.abs(this.sin_p12-1)<=xT?(a=XM(((h=this.a*UM(l,c,u,d,bT))-(t=Math.sqrt(e.x*e.x+e.y*e.y)))/this.a,l,c,u,d),o=uI(this.long0+Math.atan2(e.x,-1*e.y),this.over),e.x=o,e.y=a,e):Math.abs(this.sin_p12+1)<=xT?(h=this.a*UM(l,c,u,d,bT),a=XM(((t=Math.sqrt(e.x*e.x+e.y*e.y))-h)/this.a,l,c,u,d),o=uI(this.long0+Math.atan2(e.x,e.y),this.over),e.x=o,e.y=a,e):(f=Math.atan2(e.x,e.y),p=Math.sqrt(e.x*e.x+e.y*e.y),g=function(e,t,r,n,i,o){const a=Math.atan((1-o)*Math.tan(e)),s=Math.sin(a),l=Math.cos(a),c=Math.sin(r),u=Math.cos(r),d=Math.atan2(s,l*u),h=l*c,f=1-h*h,p=f*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),g=1+p/16384*(4096+p*(p*(320-175*p)-768)),m=p/1024*(256+p*(p*(74-47*p)-128));let y,_,v,b,x,w=n/(i*(1-o)*g),S=100;do{_=Math.cos(2*d+w),v=Math.sin(w),b=Math.cos(w),x=m*v*(_+m/4*(b*(2*_*_-1)-m/6*_*(4*v*v-3)*(4*_*_-3))),y=w,w=n/(i*(1-o)*g)+x}while(Math.abs(w-y)>1e-12&&--S>0);if(0===S)return{lat2:NaN,lon2:NaN};const k=s*v-l*b*u,T=o/16*f*(4+o*(4-3*f));return{lat2:Math.atan2(s*b+l*v*u,(1-o)*Math.sqrt(h*h+k*k)),lon2:t+(Math.atan2(v*c,l*b-s*v*u)-(1-T)*o*h*(w+T*v*(_+T*b*(2*_*_-1))))}}(this.lat0,this.long0,f,p,this.a,this.f),e.x=g.lon2,e.y=g.lat2,e)},names:["Azimuthal_Equidistant","aeqd"]};const vE={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,r,n,i,o,a,s,l=e.x,c=e.y;return n=uI(l-this.long0,this.over),t=Math.sin(c),r=Math.cos(c),i=Math.cos(n),((o=this.sin_p14*t+this.cos_p14*r*i)>0||Math.abs(o)<=xT)&&(a=1*this.a*r*Math.sin(n),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)),e.x=a,e.y=s,e},inverse:function(e){var t,r,n,i,o,a,s;return e.x-=this.x0,e.y-=this.y0,r=aE((t=Math.sqrt(e.x*e.x+e.y*e.y))/this.a),n=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(t)<=xT?(s=this.lat0,e.x=a,e.y=s,e):(s=aE(i*this.sin_p14+e.y*n*this.cos_p14/t),o=Math.abs(this.lat0)-bT,Math.abs(o)<=xT?(a=this.lat0>=0?uI(this.long0+Math.atan2(e.x,-e.y),this.over):uI(this.long0-Math.atan2(-e.x,e.y),this.over),e.x=a,e.y=s,e):(a=uI(this.long0+Math.atan2(e.x*n,t*this.cos_p14*i-e.y*this.sin_p14*n),this.over),e.x=a,e.y=s,e))},names:["ortho"]};var bE=1,xE=2,wE=3,SE=4,kE=5,TE=6,IE=1,ME=2,EE=3,PE=4;function AE(e,t,r,n){var i;return e<xT?(n.value=IE,i=0):(i=Math.atan2(t,r),Math.abs(i)<=kT?n.value=IE:i>kT&&i<=bT+kT?(n.value=ME,i-=bT):i>bT+kT||i<=-(bT+kT)?(n.value=EE,i=i>=0?i-IT:i+IT):(n.value=PE,i+=bT)),i}function CE(e,t){var r=e+t;return r<-IT?r+=TT:r>+IT&&(r-=TT),r}const RE={init:function(){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>=bT-kT/2?this.face=kE:this.lat0<=-(bT-kT/2)?this.face=TE:Math.abs(this.long0)<=kT?this.face=bE:Math.abs(this.long0)<=bT+kT?this.face=this.long0>0?xE:SE:this.face=wE,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,r,n,i,o,a,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,r=e.x,this.face===kE)i=bT-t,r>=kT&&r<=bT+kT?(l.value=IE,n=r-bT):r>bT+kT||r<=-(bT+kT)?(l.value=ME,n=r>0?r-IT:r+IT):r>-(bT+kT)&&r<=-kT?(l.value=EE,n=r+bT):(l.value=PE,n=r);else if(this.face===TE)i=bT+t,r>=kT&&r<=bT+kT?(l.value=IE,n=-r+bT):r<kT&&r>=-kT?(l.value=ME,n=-r):r<-kT&&r>=-(bT+kT)?(l.value=EE,n=-r-bT):(l.value=PE,n=r>0?-r+IT:-r-IT);else{var c,u,d,h,f,p;this.face===xE?r=CE(r,+bT):this.face===wE?r=CE(r,+IT):this.face===SE&&(r=CE(r,-bT)),h=Math.sin(t),f=Math.cos(t),p=Math.sin(r),c=f*Math.cos(r),u=f*p,d=h,this.face===bE?n=AE(i=Math.acos(c),d,u,l):this.face===xE?n=AE(i=Math.acos(u),d,-c,l):this.face===wE?n=AE(i=Math.acos(-c),d,-u,l):this.face===SE?n=AE(i=Math.acos(-u),d,c,l):(i=n=0,l.value=IE)}return a=Math.atan(12/IT*(n+Math.acos(Math.sin(n)*Math.cos(kT))-bT)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===ME?a+=bT:l.value===EE?a+=IT:l.value===PE&&(a+=1.5*IT),s.x=o*Math.cos(a),s.y=o*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,r,n,i,o,a,s,l,c,u,d,h,f={lam:0,phi:0},p={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?p.value=IE:e.y>=0&&e.y>=Math.abs(e.x)?(p.value=ME,t-=bT):e.x<0&&-e.x>=Math.abs(e.y)?(p.value=EE,t=t<0?t+IT:t-IT):(p.value=PE,t+=bT),c=IT/12*Math.tan(t),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),a=Math.atan(o),(s=1-(n=Math.cos(t))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===kE)l=Math.acos(s),f.phi=bT-l,p.value===IE?f.lam=a+bT:p.value===ME?f.lam=a<0?a+IT:a-IT:p.value===EE?f.lam=a-bT:f.lam=a;else if(this.face===TE)l=Math.acos(s),f.phi=l-bT,p.value===IE?f.lam=-a+bT:p.value===ME?f.lam=-a:p.value===EE?f.lam=-a-bT:f.lam=a<0?-a-IT:-a+IT;else{var g,m,y;c=(g=s)*g,m=(c+=(y=c>=1?0:Math.sqrt(1-c)*Math.sin(a))*y)>=1?0:Math.sqrt(1-c),p.value===ME?(c=m,m=-y,y=c):p.value===EE?(m=-m,y=-y):p.value===PE&&(c=m,m=y,y=-c),this.face===xE?(c=g,g=-m,m=c):this.face===wE?(g=-g,m=-m):this.face===SE&&(c=g,g=m,m=-c),f.phi=Math.acos(-y)-bT,f.lam=Math.atan2(m,g),this.face===xE?f.lam=CE(f.lam,-bT):this.face===wE?f.lam=CE(f.lam,-IT):this.face===SE&&(f.lam=CE(f.lam,+bT))}return 0!==this.es&&(u=f.phi<0?1:0,d=Math.tan(f.phi),h=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-h*h)/(this.one_minus_f*h)),u&&(f.phi=-f.phi)),f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var LE=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.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,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.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]],OE=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],DE=.8487,zE=1.3523,FE=ST/5,NE=1/FE,BE=18,jE=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))};const VE={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=uI(e.x-this.long0,this.over),r=Math.abs(e.y),n=Math.floor(r*FE);n<0?n=0:n>=BE&&(n=17);var i={x:jE(LE[n],r=ST*(r-NE*n))*t,y:jE(OE[n],r)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*DE+this.x0,i.y=i.y*this.a*zE+this.y0,i},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*DE),y:Math.abs(e.y-this.y0)/(this.a*zE)};if(t.y>=1)t.x/=LE[18][0],t.y=e.y<0?-bT:bT;else{var r=Math.floor(t.y*BE);for(r<0?r=0:r>=BE&&(r=17);;)if(OE[r][0]>t.y)--r;else{if(!(OE[r+1][0]<=t.y))break;++r}var n=OE[r],i=5*(t.y-n[0])/(OE[r+1][0]-n[0]);i=function(e,t,r,n){for(var i=t;n;--n){var o=e(i);if(i-=o,Math.abs(o)<r)break}return i}((function(e){return(jE(n,e)-t.y)/function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])}(n,e)}),i,xT,100),t.x/=jE(LE[r],i),t.y=(5*r+i)*wT,e.y<0&&(t.y=-t.y)}return t.x=uI(t.x+this.long0,this.over),t},names:["Robinson","robin"]};const GE={init:function(){this.name="geocent"},forward:function(e){return BI(e,this.es,this.a)},inverse:function(e){return jI(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var UE=0,$E=1,HE=2,qE=3,WE={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}};const ZE={init:function(){if(Object.keys(WE).forEach(function(e){if(void 0===this[e])this[e]=WE[e].def;else{if(WE[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);WE[e].num&&(this[e]=parseFloat(this[e]))}WE[e].degrees&&(this[e]=this[e]*wT)}.bind(this)),Math.abs(Math.abs(this.lat0)-bT)<xT?this.mode=this.lat0<0?$E:UE:Math.abs(this.lat0)<xT?this.mode=HE:(this.mode=qE,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)},forward:function(e){e.x-=this.long0;var t,r,n,i,o=Math.sin(e.y),a=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case qE:r=this.sinph0*o+this.cosph0*a*s;break;case HE:r=a*s;break;case $E:r=-o;break;case UE:r=o}switch(t=(r=this.pn1/(this.p-r))*a*Math.sin(e.x),this.mode){case qE:r*=this.cosph0*o-this.sinph0*a*s;break;case HE:r*=o;break;case UE:r*=-a*s;break;case $E:r*=a*s}return i=1/((n=r*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-r*this.sg)*this.cw*i,r=n*i,e.x=t*this.a,e.y=r*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,r,n,i={x:e.x,y:e.y};n=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*n,r=this.pn1*e.y*this.cw*n,e.x=t*this.cg+r*this.sg,e.y=r*this.cg-t*this.sg;var o=MM(e.x,e.y);if(Math.abs(o)<xT)i.x=0,i.y=e.y;else{var a,s;switch(s=1-o*o*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/o+o/this.pn1),a=Math.sqrt(1-s*s),this.mode){case qE:i.y=Math.asin(a*this.sinph0+e.y*s*this.cosph0/o),e.y=(a-this.sinph0*Math.sin(i.y))*o,e.x*=s*this.cosph0;break;case HE:i.y=Math.asin(e.y*s/o),e.y=a*o,e.x*=s;break;case UE:i.y=Math.asin(a),e.y=-e.y;break;case $E:i.y=-Math.asin(a)}i.x=Math.atan2(e.x,e.y)}return e.x=i.x+this.long0,e.y=i.y,e},names:["Tilted_Perspective","tpers"]};const YE={init:function(){if(this.flip_axis="x"===this.sweep?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,0!==this.es){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")},forward:function(e){var t,r,n,i,o=e.x,a=e.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/MM(this.radius_p*Math.cos(a),Math.sin(a));if(r=s*Math.cos(o)*Math.cos(a),n=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/MM(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(i/MM(n,t)))}else"sphere"===this.shape&&(t=Math.cos(a),r=Math.cos(o)*t,n=Math.sin(o)*t,i=Math.sin(a),t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/MM(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(i/MM(n,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,r,n,i,o=-1,a=0,s=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*MM(1,s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*MM(1,a));var l=s/this.radius_p;if(t=a*a+l*l+o*o,(n=(r=2*this.radius_g*o)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(n))/(2*t),o=this.radius_g+i*o,a*=i,s*=i,e.x=Math.atan2(a,o),e.y=Math.atan(s*Math.cos(e.x)/o),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+a*a)),t=a*a+s*s+o*o,(n=(r=2*this.radius_g*o)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(n))/(2*t),o=this.radius_g+i*o,a*=i,s*=i,e.x=Math.atan2(a,o),e.y=Math.atan(s*Math.cos(e.x)/o)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var XE=1.340264,KE=-.081106,JE=893e-6,QE=.003796,eP=Math.sqrt(3)/2;const tP={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0,this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0},forward:function(e){var t=uI(e.x-this.long0,this.over),r=e.y,n=Math.asin(eP*Math.sin(r)),i=n*n,o=i*i*i;return e.x=t*Math.cos(n)/(eP*(XE+3*KE*i+o*(7*JE+9*QE*i))),e.y=n*(XE+KE*i+o*(JE+QE*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t,r,n,i,o=e.y;for(i=0;i<12&&(o-=n=(o*(XE+KE*(t=o*o)+(r=t*t*t)*(JE+QE*t))-e.y)/(XE+3*KE*t+r*(7*JE+9*QE*t)),!(Math.abs(n)<1e-9));++i);return r=(t=o*o)*t*t,e.x=eP*e.x*(XE+3*KE*t+r*(7*JE+9*QE*t))/Math.cos(o),e.y=Math.asin(Math.sin(o)/eP),e.x=uI(e.x+this.long0,this.over),e},names:["eqearth","Equal Earth","Equal_Earth"]};var rP=1e-10;function nP(e){var t,r,n,i=uI(e.x-(this.long0||0),this.over),o=e.y;return t=this.am1+this.m1-SM(o,r=Math.sin(o),n=Math.cos(o),this.en),r=n*i/(t*Math.sqrt(1-this.es*r*r)),e.x=t*Math.sin(r),e.y=this.am1-t*Math.cos(r),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function iP(e){var t,r,n,i;if(e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a,r=MM(e.x,e.y=this.am1-e.y),i=kM(this.am1+this.m1-r,this.es,this.en),(t=Math.abs(i))<bT)t=Math.sin(i),n=r*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else{if(!(Math.abs(t-bT)<=rP))throw new Error;n=0}return e.x=uI(n+(this.long0||0),this.over),e.y=YM(i),e}function oP(e){var t,r,n=uI(e.x-(this.long0||0),this.over),i=e.y;return r=this.cphi1+this.phi1-i,Math.abs(r)>rP?(e.x=r*Math.sin(t=n*Math.cos(i)/r),e.y=this.cphi1-r*Math.cos(t)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function aP(e){var t,r;e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var n=MM(e.x,e.y=this.cphi1-e.y);if(r=this.cphi1+this.phi1-n,Math.abs(r)>bT)throw new Error;return t=Math.abs(Math.abs(r)-bT)<=rP?0:n*Math.atan2(e.x,e.y)/Math.cos(r),e.x=uI(t+(this.long0||0),this.over),e.y=YM(r),e}const sP={init:function(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<rP)throw new Error;this.es?(this.en=wM(this.es),this.m1=SM(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=iP,this.forward=nP):(Math.abs(this.phi1)+rP>=bT?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=aP,this.forward=oP)},names:["bonne","Bonne (Werner lat_1=90)"]},lP={OBLIQUE:{forward:function(e,t){let{x:r,y:n}=t;r+=e.long0;const i=Math.cos(r),o=Math.sin(n),a=Math.cos(n);t.x=uI(Math.atan2(a*Math.sin(r),e.sphip*a*i+e.cphip*o)+e.lamp),t.y=Math.asin(e.sphip*o-e.cphip*a*i);const s=e.obliqueProjection.forward(t);e.isIdentity&&(s.x*=ST,s.y*=ST);return s},inverse:function(e,t){e.isIdentity&&(t.x*=wT,t.y*=wT);const r=e.obliqueProjection.inverse(t);let{x:n,y:i}=r;if(n<Number.MAX_VALUE){n-=e.lamp;const r=Math.cos(n),o=Math.sin(i),a=Math.cos(i);t.x=Math.atan2(a*Math.sin(n),e.sphip*a*r-e.cphip*o),t.y=Math.asin(e.sphip*o+e.cphip*a*r)}return t.x=uI(t.x+e.long0),t}},TRANSVERSE:{forward:function(e,t){let{x:r,y:n}=t;r+=e.long0;const i=Math.cos(n),o=Math.cos(r);t.x=uI(Math.atan2(i*Math.sin(r),Math.sin(n))+e.lamp),t.y=Math.asin(-1*i*o);const a=e.obliqueProjection.forward(t);e.isIdentity&&(a.x*=ST,a.y*=ST);return a},inverse:function(e,t){e.isIdentity&&(t.x*=wT,t.y*=wT);const r=e.obliqueProjection.inverse(t);let{x:n,y:i}=r;if(n<Number.MAX_VALUE){const r=Math.cos(i);n-=e.lamp,t.x=Math.atan2(r*Math.sin(n),-1*Math.sin(i)),t.y=Math.asin(r*Math.cos(n))}return t.x=uI(t.x+e.long0),t}}},cP={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};const uP={init:function(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=pI.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if("ob_tran"===this.o_proj)throw new Error("Invalid value for o_proj: "+this.o_proj);const e=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),t=NI(e);if(!t)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);let r;t.long0=0,this.obliqueProjection=t;const n=Object.keys(cP),i=e=>{if(void 0===this[e])return;const t=parseFloat(this[e])*wT;if(isNaN(t))throw new Error("Invalid value for "+e+": "+this[e]);return t};for(let e=0;e<n.length;e++){const t=n[e],o=cP[t],a=Object.entries(o);if(a.some((([e])=>void 0!==this[e]))){r=o;for(let e=0;e<a.length;e++){const[t,r]=a[e],n=i(t);if(void 0===n)throw new Error("Missing parameter: "+t+".");this[r]=n}break}}if(!r)throw new Error("No valid parameters provided for ob_tran projection.");
29const{lamp:o,phip:a}=function(e,t){let r,n;if(t===cP.ROTATE){let t=e.oLongC,i=e.oLatC,o=e.oAlpha;if(Math.abs(Math.abs(i)-bT)<=xT)throw new Error("Invalid value for o_lat_c: "+e.o_lat_c+" should be < 90°");n=t+Math.atan2(-1*Math.cos(o),-1*Math.sin(o)*Math.sin(i)),r=Math.asin(Math.cos(i)*Math.sin(o))}else if(t===cP.NEW_POLE)n=e.oLongP,r=e.oLatP;else{let t=e.oLong1,i=e.oLat1,o=e.oLong2,a=e.oLat2,s=Math.abs(i);if(Math.abs(i)>bT-xT)throw new Error("Invalid value for o_lat_1: "+e.o_lat_1+" should be < 90°");if(Math.abs(a)>bT-xT)throw new Error("Invalid value for o_lat_2: "+e.o_lat_2+" should be < 90°");if(Math.abs(i-a)<xT)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(s<xT)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");n=Math.atan2(Math.cos(i)*Math.sin(a)*Math.cos(t)-Math.sin(i)*Math.cos(a)*Math.cos(o),Math.sin(i)*Math.cos(a)*Math.sin(o)-Math.cos(i)*Math.sin(a)*Math.sin(t)),r=Math.atan(-1*Math.cos(n-t)/Math.tan(i))}return{lamp:n,phip:r}}(this,r);this.lamp=o,Math.abs(a)>xT?(this.cphip=Math.cos(a),this.sphip=Math.sin(a),this.projectionType=lP.OBLIQUE):this.projectionType=lP.TRANSVERSE},forward:function(e){return this.projectionType.forward(this,e)},inverse:function(e){return this.projectionType.inverse(this,e)},names:["General Oblique Transformation","General_Oblique_Transformation","ob_tran"]};const dP=Object.assign(QI,{defaultDatum:"WGS84",Proj:NI,WGS84:new NI("WGS84"),Point:_M,toPoint:WI,defs:iI,nadgrid:function(e,t,r){return t instanceof ArrayBuffer?function(e,t,r){var n=!0;void 0!==r&&!1===r.includeErrorFields&&(n=!1);var i=new DataView(t),o=function(e){var t=e.getInt32(8,!1);if(11===t)return!1;t=e.getInt32(8,!0),11!==t&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(i),a=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:LI(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,o),s=function(e,t,r,n){for(var i=176,o=[],a=0;a<t.nSubgrids;a++){var s=DI(e,i,r),l=zI(e,i,s,r,n),c=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),u=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);o.push({ll:[RI(s.lowerLongitude),RI(s.lowerLatitude)],del:[RI(s.longitudeInterval),RI(s.latitudeInterval)],lim:[c,u],count:s.gridNodeCount,cvs:OI(l)});var d=16;!1===n&&(d=8),i+=176+s.gridNodeCount*d}return o}(i,a,o,n),l={header:a,subgrids:s};return EI[e]=l,l}(e,t,r):{ready:PI(e,t)}},transform:YI,mgrs:sM,version:"__VERSION__"});!function(e){e.Proj.projections.add(TM),e.Proj.projections.add(CM),e.Proj.projections.add(RM),e.Proj.projections.add(DM),e.Proj.projections.add(FM),e.Proj.projections.add(NM),e.Proj.projections.add(jM),e.Proj.projections.add(VM),e.Proj.projections.add(GM),e.Proj.projections.add(KM),e.Proj.projections.add(oE),e.Proj.projections.add(sE),e.Proj.projections.add(lE),e.Proj.projections.add(cE),e.Proj.projections.add(uE),e.Proj.projections.add(dE),e.Proj.projections.add(hE),e.Proj.projections.add(fE),e.Proj.projections.add(pE),e.Proj.projections.add(gE),e.Proj.projections.add(mE),e.Proj.projections.add(yE),e.Proj.projections.add(_E),e.Proj.projections.add(vE),e.Proj.projections.add(RE),e.Proj.projections.add(VE),e.Proj.projections.add(GE),e.Proj.projections.add(ZE),e.Proj.projections.add(YE),e.Proj.projections.add(tP),e.Proj.projections.add(sP),e.Proj.projections.add(uP)}(dP);const hP=dP;for(var fP=1;fP<=60;fP++)hP.defs("EPSG:".concat(32600+fP),"+proj=utm +zone=".concat(fP," +datum=WGS84 +units=m +no_defs")),hP.defs("EPSG:".concat(32700+fP),"+proj=utm +zone=".concat(fP," +south +datum=WGS84 +units=m +no_defs"));function pP(e){return pP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pP(e)}function gP(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */gP=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 29
29if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==pP(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(pP(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
29if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function mP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||_P(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yP(e){return function(e){if(Array.isArray(e))return vP(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_P(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _P(e,t){if(e){if("string"==typeof e)return vP(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vP(e,t):void 0}}function vP(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function bP(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function xP(e){if(!e)return null;for(var t=4;t<e.length;t+=4){var r=e[t],n=e[t+3];if((3072===r||2048===r)&&n)return"EPSG:".concat(n)}return null}function wP(e,t,r,n,i){var o=[e,n],a=[r,n],s=[r,t],l=[e,t];if(i&&"EPSG:4326"!==i)try{return[hP(i,"EPSG:4326",o),hP(i,"EPSG:4326",a),hP(i,"EPSG:4326",s),hP(i,"EPSG:4326",l)]}catch(e){console.warn("[geotiff] Corner reprojection failed for ".concat(i,", falling back to axis-aligned bounds"))}return[o,a,s,l]}function SP(e,t,r,n){return kP.apply(this,arguments)}function kP(){return kP=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){bP(o,n,i,a,s,"next",e)}function s(e){bP(o,n,i,a,s,"throw",e)}a(void 0)}))}}(gP().mark((function e(t,r,n,i){var o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E,P,A,C,R,L,O,D,z,F,N,B,j,V,G,U,$,H,q,W,Z;return gP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,iT(t);case 2:return o=e.sent,e.next=5,o.getImage();case 5:return a=e.sent,s=a.getWidth(),l=a.getHeight(),e.next=10,a.readRasters();case 10:for(c=e.sent,u=c.length,d=u>=3&&"rgb"===n,h=c[0],f=d?c[0]:null,p=d?c[1]:null,g=d?c[2]:null,m=d&&u>=4?c[3]:null,y=a.getFileDirectory(),_=y.ModelTiepoint,v=y.ModelPixelScale,b=_[3],x=_[4],w=v[0],S=v[1],k=b,T=x,I=b+s*w,M=x-l*S,"EPSG:32767"===(E=xP(y.GeoKeyDirectory))&&(E=null),!E&&null!=i&&i.fallbackCRS&&Math.abs(k)>1e5&&(E=i.fallbackCRS),P=wP(k,M,I,T,E),A=Math.min.apply(Math,yP(P.map((function(e){return mP(e,1)[0]})))),C=Math.max.apply(Math,yP(P.map((function(e){return mP(e,1)[0]})))),R=Math.min.apply(Math,yP(P.map((function(e){return mP(e,2)[1]})))),L=Math.max.apply(Math,yP(P.map((function(e){return mP(e,2)[1]})))),(O=document.createElement("canvas")).width=s,O.height=l,D=O.getContext("2d"),z=D.createImageData(s,l),F=0;F<h.length;F++)N=4*F,d&&f&&p&&g?(B=f[F],j=p[F],V=g[F],0===(G=m?m[F]:255)||Number.isNaN(B)||Number.isNaN(j)||Number.isNaN(V)?(z.data[N]=0,z.data[N+1]=0,z.data[N+2]=0,z.data[N+3]=0):(z.data[N]=Math.min(255,Math.max(0,B)),z.data[N+1]=Math.min(255,Math.max(0,j)),z.data[N+2]=Math.min(255,Math.max(0,V)),z.data[N+3]=G)):(U=h[F],Number.isNaN(U)||U!=U?(z.data[N]=0,z.data[N+1]=0,z.data[N+2]=0,z.data[N+3]=0):-9999===U?(z.data[N]=mT[0],z.data[N+1]=mT[1],z.data[N+2]=mT[2],z.data[N+3]=mT[3]):($=gT(U,n),H=mP($,3),q=H[0],W=H[1],Z=H[2],z.data[N]=q,z.data[N+1]=W,z.data[N+2]=Z,z.data[N+3]=255));
vendor: 4,783 bytes, line 29
29return e.abrupt("return",{imageData:z,bounds:[A,R,C,L],quadCorners:P,width:s,height:l,date:r,metric:n,rawData:h,noDataValue:-9999});case 48:case"end":return e.stop()}}),e)}))),kP.apply(this,arguments)}function TP(e){return TP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TP(e)}function IP(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */IP=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==TP(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(TP(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEac
29h(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function MP(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function EP(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){MP(o,n,i,a,s,"next",e)}function s(e){MP(o,n,i,a,s,"throw",e)}a(void 0)}))}}function PP(e){return AP.apply(this,arguments)}function AP(){return(AP=EP(IP().mark((function e(t){var r,n;return IP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/environmental/api/clearsky/".concat(t,"/dates/"));case 2:if((r=e.sent).ok){e.next=5;break}return e.abrupt("return",[]);case 5:return e.next=7,r.json();case 7:return n=e.sent,e.abrupt("return",n.dates||[]);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}hP.defs("EPSG:3857","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs");var CP=new Set(["ndvi","gndvi","evi","msavi","ndrei","cire","msi","ndmi","nmdi","ndwi","mndwi","nddi","nbr","nbr2"]);function RP(e){return CP.has(e.toLowerCase())}function LP(){return(LP=EP(IP().mark((function e(t,r,n){var i,o;return IP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(RP(n)){e.next=2;break}return e.abrupt("return",null);case 2:return i="/environmental/api/clearsky/".concat(t,"/").concat(r,"/statistics/?metric=").concat(n),e.prev=3,e.next=6,fetch(i);case 6:if((o=e.sent).ok){e.next=9;break}return e.abrupt("return",null);case 9:return e.next=11,o.json();case 11:return e.abrupt("return",e.sent);case 14:return e.prev=14,e.t0=e.catch(3),console.error("[clearsky-api] Statistics fetch failed:",e.t0),e.abrupt("return",null);case 18:case"end":return e.stop()}}),e,null,[[3,14]])})))).apply(this,arguments)}function OP(e,t,r,n){return DP.apply(this,arguments)}function DP(){return DP=EP(IP().mark((function e(t,r,n,i){var o,a,s,l;return IP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(RP(r)){e.next=2;break}return e.abrupt("return",[]);case 2:return o=new URLSearchParams({metric:r}),n&&o.set("start_date",n),i&&o.set("end_date",i),a="/environmental/api/clearsky/".concat(t,"/statistics/timeseries/?").concat(o),e.prev=6,e.next=9,fetch(a);case 9:if((s=e.sent).ok){e.next=12;break}return e.abrupt("return",[]);case 12:return e.next=14,s.json();case 14:return l=e.sent,e.abrupt("return",l.data||[]);case 18:return e.prev=18,e.t0=e.catch(6),console.error("[clearsky-api] Timeseries fetch failed:",e.t0),e.abrupt("return",[]);case 22:case"end":return e.stop()}}
29),e,null,[[6,18]])}))),DP.apply(this,arguments)}function zP(){return zP=EP(IP().mark((function e(t,r,n,i,o){var a,s,l,c;return IP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new URLSearchParams({metric:r,window_days:String(n)}),i&&a.set("start_date",i),o&&a.set("end_date",o),s="/environmental/api/clearsky/".concat(t,"/statistics/temporal-cv/?").concat(a),e.prev=4,e.next=7,fetch(s);case 7:if((l=e.sent).ok){e.next=10;break}return e.abrupt("return",[]);case 10:return e.next=12,l.json();case 12:return c=e.sent,e.abrupt("return",c.data||[]);case 16:return e.prev=16,e.t0=e.catch(4),console.error("[clearsky-api] Temporal CV fetch failed:",e.t0),e.abrupt("return",[]);case 20:case"end":return e.stop()}}),e,null,[[4,16]])}))),zP.apply(this,arguments)}function FP(e,t){return NP.apply(this,arguments)}function NP(){return NP=EP(IP().mark((function e(t,r){var n,i,o,a,s,l,c,u=arguments;return IP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>2&&void 0!==u[2]?u[2]:"ndvi",i="/environmental/api/clearsky/".concat(t,"/").concat(r,"/raster/?metric=").concat(n),e.next=4,fetch(i);case 4:if((o=e.sent).ok){e.next=10;break}return e.next=8,o.json().catch((function(){return{}}));case 8:throw a=e.sent,new Error(a.error||"ClearSky fetch failed: ".concat(o.status));case 10:return s=o.headers.get("X-Raster-EPSG"),l=s?"EPSG:".concat(s):void 0,e.next=14,o.arrayBuffer();case 14:return c=e.sent,e.abrupt("return",SP(c,r,n,{fallbackCRS:l}));case 16:case"end":return e.stop()}}),e)}))),NP.apply(this,arguments)}function BP(e){return BP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BP(e)}function jP(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=UP(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:()=>n>=e.length?{done:!0}:{done:!1,value:e[n++]},e(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s(){r=r.call(e)},n(){var e=r.next();return a=e.done,e},e(e){s=!0,o=e},f(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function VP(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
30VP=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==BP(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];
30if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(BP(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function GP(e){return function(e){if(Array.isArray(e))return $P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||UP(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UP(e,t){if(e){if("string"==typeof e)return $P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$P(e,t):void 0}}function $P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function HP(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function qP(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){HP(o,n,i,a,s,"next",e)}function s(e){HP(o,n,i,a,s,"throw",e)}a(void 0)}))}}var WP=new Map,ZP=Jl({value:0});var YP=new Map;function XP(e,t,r,n){return"".concat(e,"-").concat(t,"-").concat(null!=r?r:"","-").concat(null!=n?n:"")}function KP(e,t,r,n){return JP.apply(this,arguments)}function JP(){return JP=qP(VP().mark((function e(t,r,n,i){var o,a,s,l,c,u;return VP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=XP(t,r,n,i),!(s=WP.get(a))){e.next=4;break}return e.abrupt("return",s);case 4:if(!(l=YP.get(a))){e.next=9;break}return e.next=8,l;case 8:return e.abrupt("return",null!==(c=WP.get(a))&&void 0!==c?c:{first:null,last:null,latest:null});case 9:return u=qP(VP().mark((function e(){var o,s,l,c;return VP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,OP(t,r,n,i);case 3:0===(o=e.sent).length?WP.set(a,{first:null,last:null,latest:null}):(s=GP(o).sort((function(e,t){return e.date.localeCompare(t.date)})),l={date:s[0].date,mean:s[0].mean},c={date:s[s.length-1].date,mean:s[s.length-1].mean},WP.set(a,{first:l,last:c,latest:c})),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),WP.set(a,{first:null,last:null,latest:null});case 10:return e.prev=10,YP.delete(a),ZP.value++,e.finish(10);case 14:case"end":return e.stop()}}),e,null,[[0,7,10,14]])}
30)))(),YP.set(a,u),e.next=13,u;case 13:return e.abrupt("return",null!==(o=WP.get(a))&&void 0!==o?o:{first:null,last:null,latest:null});case 14:case"end":return e.stop()}}),e)}))),JP.apply(this,arguments)}function QP(e,t,r,n){return WP.get(XP(e,t,r,n))}function eA(e,t,r,n){return tA.apply(this,arguments)}function tA(){return(tA=qP(VP().mark((function e(t,r,n,i){var o,a,s,l,c,u,d,h,f,p,g;return VP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.filter((function(e){var t,r;return!0===(null==e||null===(t=e.properties)||void 0===t?void 0:t.cloudless_activated)&&"string"==typeof(null===(r=e.properties)||void 0===r?void 0:r.farm_field_id)})),0!==o.length){e.next=3;break}return e.abrupt("return");case 3:a=new Set,s=jP(o);try{for(s.s();!(l=s.n()).done;)if(u=l.value,d=u.properties.farm_field_id,a.add(d),h=null===(c=u.properties)||void 0===c?void 0:c.crop_zones,Array.isArray(h)&&h.length>=2){f=jP(h);try{for(f.s();!(p=f.n()).done;)"string"==typeof(null==(g=p.value)?void 0:g.crop_zone_id)&&a.add(g.crop_zone_id)}catch(e){f.e(e)}finally{f.f()}}}catch(e){s.e(e)}finally{s.f()}return e.next=8,Promise.allSettled(Array.from(a).map((function(e){return KP(e,r,n,i)})));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rA(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
31rA=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==oA(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(oA(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEac
31h(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function nA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=sA(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:()=>n>=e.length?{done:!0}:{done:!1,value:e[n++]},e(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s(){r=r.call(e)},n(){var e=r.next();return a=e.done,e},e(e){s=!0,o=e},f(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function iA(e){return function(e){if(Array.isArray(e))return lA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||sA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oA(e){return oA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oA(e)}function aA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||sA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sA(e,t){if(e){if("string"==typeof e)return lA(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lA(e,t):void 0}}function lA(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function cA(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function uA(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){cA(o,n,i,a,s,"next",e)}function s(e){cA(o,n,i,a,s,"throw",e)}a(void 0)}))}}function dA(e,t){var r=Jl({}),n=$l(Jl({})),i=$l(!1),o=Dl((function(){return Bw.selectedStartDate?"custom"
31:"lastIrrigation"})),a=Dl((function(){var e=Bw.selectedVegetationDate;return e?{start:e,end:e}:null}));function s(){return(s=uA(rA().mark((function t(){var r,n,i;return rA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e&&null!==(r=e.features)&&void 0!==r&&r.length){t.next=2;break}return t.abrupt("return");case 2:if("clearsky"===Bw.imagerySource){t.next=4;break}return t.abrupt("return");case 4:if(n=Bw.vegetationIndexType){t.next=7;break}return t.abrupt("return");case 7:if(i=bu(a)){t.next=10;break}return t.abrupt("return");case 10:return t.next=12,eA(e.features,n,i.start,i.end);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function l(){return(l=uA(rA().mark((function e(){return rA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(){ql(i,!0);var r=e.features.map((function(e){try{var r,n=Number(e.id),i=null==t?void 0:t[n];if(null!=i&&i.daily_values){var o,a=Bw.selectedStartDate?new Date(Bw.selectedStartDate):null!==(o=e.properties)&&void 0!==o&&null!==(o=o.irrigation_events)&&void 0!==o&&null!==(o=o[0])&&void 0!==o&&o.date?new Date(e.properties.irrigation_events[0].date):new Date(Date.now()-6048e5);a.setHours(0,0,0,0);var s=Bw.selectedEndDate?new Date(Bw.selectedEndDate):new Date;s.setHours(23,59,59,999);for(var l=0,c=0,u=Object.entries(i.daily_values);c<u.length;c++){var d=aA(u[c],2),h=d[0],f=d[1],p=new Date(h);p.setHours(0,0,0,0),p>=a&&p<=s&&(l+=Number(f)||0)}return[n,l]}var g=null===(r=e.properties)||void 0===r?void 0:r.avg_evapotranspiration_per_date;if(g&&"object"===oA(g)){var m,y=Bw.selectedStartDate?new Date(Bw.selectedStartDate):null!==(m=e.properties)&&void 0!==m&&null!==(m=m.irrigation_events)&&void 0!==m&&null!==(m=m[0])&&void 0!==m&&m.date?new Date(e.properties.irrigation_events[0].date):new Date(Date.now()-6048e5);y.setHours(0,0,0,0);var _=Bw.selectedEndDate?new Date(Bw.selectedEndDate):new Date;_.setHours(23,59,59,999);for(var v=0,b=0,x=Object.entries(g);b<x.length;b++){var w=aA(x[b],2),S=w[0],k=w[1],T=new Date(S);T.setHours(0,0,0,0),T>=y&&T<=_&&(v+=Number(k)||0)}return[n,v]}return[n,0]}catch(t){return console.error("Error calculating evapotranspiration average for field ".concat(e.id,":"),t),[Number(e.id),0]}}));ql(n,Object.fromEntries(r),!0),ql(i,!1)}function u(e){if("clearsky"!==Bw.imagerySource)return Number.NaN;var t=Bw.vegetationIndexType,r=bu(a);if(!t||!r)return Number.NaN;var n=QP(e,t,r.start,r.end);return null!=n&&n.latest?n.latest.mean:Number.NaN}function d(e){var t=e.properties;if(!t||!0!==t.cloudless_activated)return Number.NaN;var r=t.farm_field_id;if("string"!=typeof r)return Number.NaN;var n=u(r);if(!Number.isNaN(n))return n;var i=t.crop_zones;if(Array.isArray(i)&&1===i.length){var o,a=null===(o=i[0])||void 0===o?void 0:o.crop_zone_id;if("string"==typeof a)return u(a)}return Number.NaN}function h(e){return Number.isNaN(e)?"–":e.toFixed(2)}function f(e){return h(u(e))}function p(e){var t,o,a,s,l,c,u=Number(e.id),f=e.properties.name||"–",p=null===(t=e.properties)||void 0===t||null===(t=t.irrigation_events)||void 0===t?void 0:t[0],g=null!=p&&p.date?new Date(p.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):"–",m=(null==p||null===(o=p.irrigation_amount)||void 0===o?void 0:o.toFixed(0))||"0",y=Bw.selectedStartDate?new Date(Bw.selectedStartDate):null!==(a=e.properties)&&void 0!==a&&null!==(a=a.irrigation_events)&&void 0!==a&&null!==(a=a[0])&&void 0!==a&&a.date?new Date(e.properties.irrigation_events[0].date):new Date(Date.now()-6048e5);y.setHours(0,0,0,0);var _=Bw.selectedEndDate?new Date(Bw.selectedEndDate):new Date;_.setHours(23,59,59,999);var v=(null===(s=e.properties)||void 0===s||null===(s=s.irrigation_events)||void 0===s?void 0:s.reduce((function(e,t){if(!t.date)return e;var r=new Date(t.date.split("T")[0]);r.setDate(r.getDate()+1);var n=new Date(r.toISOString().split("T")[0]);return n>=y&&n<=_?e+(t.irrigation_amount||0):e}),0))||0,b=bu(i)?"...":v.toFixed(0),x=bu(i)?"...":null!=(null===(l=bu(n))||void 0===l?void 0:l[u])?(-Math.abs(bu(n)[u])).toFixed(0):"–",w=bu(i)?"...":null!=(null==r?void 0:r[u])?r[u].toFixed(0):"–",S=bu(i)?"...":null!=(null==r?void 0:r[u])&&null!=(null===(c=bu(n))||void 0===c?void 0:c[u])?(r[u]+v-bu(n)[u]).toFixed(0):"–",k="";if(Bw.selectedStartDate){var T=new Date(Bw.selectedStartDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"});if(Bw.selectedEndDate){var I=new Date(Bw.selectedEndDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"});
31k="".concat(T," - ").concat(I)}else k="Since ".concat(T)}else if(null!=p&&p.date)k="Since last irrigation";else{var M=new Date;M.setDate(M.getDate()-7),k="Since ".concat(M.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}))}var E=function(e){return h(d(e))}(e);return{id:u,name:f,lastIrrigationEvent:g,amount:m,et:x,precip:w,irrigation:b,diff:S,satMetric:E,dateLabel:k}}function g(e,t,r){var n,i,o=(null!==(n=null===(i=e.properties)||void 0===i?void 0:i.irrigation_events)&&void 0!==n?n:[]).filter((function(e){return null==e.crop_zone_id||e.crop_zone_id===t}));if("irrigation"===r){var a=o.reduce((function(e,t){var r;return e+(null!==(r=t.irrigation_amount)&&void 0!==r?r:0)}),0);return{display:a>0?a.toFixed(0):"0",numeric:a}}if("lastIrrigationEvent"===r){var s=o.find((function(e){return e.date}));if(null==s||!s.date)return{display:"–",numeric:Number.NEGATIVE_INFINITY};var l=new Date(s.date).getTime();return{display:new Date(s.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}),numeric:l}}return{display:"—",numeric:Number.NaN}}function m(){return(m=uA(rA().mark((function t(){var r,n;return rA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e&&null!==(r=e.features)&&void 0!==r&&r.length){t.next=2;break}return t.abrupt("return");case 2:null!==Bw.selectedFieldId&&(e.features.map((function(e){return Number(e.id)})).includes(Bw.selectedFieldId)?Bw.selectedFieldName||(n=e.features.find((function(e){return Number(e.id)===Bw.selectedFieldId})))&&(Bw.selectedFieldName=n.properties.name||""):(Bw.selectedFieldId=null,Bw.selectedFieldName=""));try{c()}catch(e){console.error("calculateEvapotranspirationAverages failed in initialize:",e)}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return{get precipitationData(){return r},get evapotranspirationAvgData(){return bu(n)},get isLoading(){return bu(i)},get dateMode(){return bu(o)},loadPrecipitationData:function(){return l.apply(this,arguments)},calculateEvapotranspirationAverages:c,loadSatelliteMeans:function(){return s.apply(this,arguments)},getTableRowData:p,getSortedFeatures:function(t,r){var n,i=null!==(n=null==e?void 0:e.features)&&void 0!==n?n:[];return t?iA(i).sort((function(e,n){var i=p(e),o=p(n);if("name"===t){var a=(i.name||"").toLowerCase(),s=(o.name||"").toLowerCase();return r?a.localeCompare(s):s.localeCompare(a)}if("lastIrrigationEventDate"===t||"lastIrrigationEvent"===t){var l,c,u=null!==(l=e.properties)&&void 0!==l&&null!==(l=l.irrigation_events)&&void 0!==l&&null!==(l=l[0])&&void 0!==l&&l.date?new Date(e.properties.irrigation_events[0].date).getTime():Number.NEGATIVE_INFINITY,h=null!==(c=n.properties)&&void 0!==c&&null!==(c=c.irrigation_events)&&void 0!==c&&null!==(c=c[0])&&void 0!==c&&c.date?new Date(n.properties.irrigation_events[0].date).getTime():Number.NEGATIVE_INFINITY;return r?u-h:h-u}if("amount"===t){var f,g,m,y,_=null!==(f=null===(g=e.properties)||void 0===g||null===(g=g.irrigation_events)||void 0===g||null===(g=g[0])||void 0===g?void 0:g.irrigation_amount)&&void 0!==f?f:0,v=null!==(m=null===(y=n.properties)||void 0===y||null===(y=y.irrigation_events)||void 0===y||null===(y=y[0])||void 0===y?void 0:y.irrigation_amount)&&void 0!==m?m:0;return r?_-v:v-_}if("satMetric"===t){var b=d(e),x=d(n);return Number.isNaN(b)&&Number.isNaN(x)?0:Number.isNaN(b)?1:Number.isNaN(x)?-1:r?b-x:x-b}var w=Number("–"===i[t]||"..."===i[t]?Number.NaN:i[t]),S=Number("–"===o[t]||"..."===o[t]?Number.NaN:o[t]);return Number.isNaN(w)&&Number.isNaN(S)?0:Number.isNaN(w)?1:Number.isNaN(S)?-1:r?w-S:S-w})):iA(i)},getFlatRows:function(t,r,n){var i,o,a=[],s=nA(null!==(i=null==e?void 0:e.features)&&void 0!==i?i:[]);try{for(s.s();!(o=s.n()).done;){var l,c,h=o.value,m=p(h),y=null!==(l=null===(c=h.properties)||void 0===c?void 0:c.crop_zones)&&void 0!==l?l:[];if(Array.isArray(y)&&y.length>=2){var _,v=nA(y);try{for(v.s();!(_=v.n()).done;){var b,x,w=_.value,S=null!==(b=w.crop_zone_id)&&void 0!==b?b:null,k="";"satMetric"===n&&S?k=f(S):n&&S&&(k=g(h,S,n).display),a.push({id:m.id,cropZoneId:S,label:"".concat(m.name,": ").concat(null!==(x=w.name)&&void 0!==x?x:"").replace(/: $/,""),field:h,metric:k,isZoneRow:!0})}}catch(e){v.e(e)}finally{v.f()}}else{var T=n&&m[n]||"";a.push({id:m.id,cropZoneId:null,label:m.name,field:h,metric:T,isZoneRow:!1})}}}catch(e){s.e(e)}finally{s.f()}if(!t)return a;var I=function(e){if("name"===t)return Number.NaN;if("satMetric"===t)return e.cropZoneId?u(e.cropZoneId):d(e.field);if("lastIrrigationEvent"===t||"lastIrrigationEventDate"===t){var r;if(e.cropZoneId)return g(e.field,e.cropZoneId,"lastIrrigationEvent").numeric;var n=null===(r=e.field.properties)||void 0===r||null===(r=r.irrigation_events)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.date;return n?new Date(n).getTime():Number.NEGATIVE_INFINITY}if("irrigation"===t){if(e.cropZoneId)return g(e.field,e.cropZoneId,"irrigation").numeric;var i=Number(e.metric);return Number.isNaN(i)?Number.NaN:i}var o=Number(e.metric);return Number.isNaN(o)?Number.NaN:o};return a.sort((function(e,n){if("name"===t)return r?e.label.localeCompare(n.label):n.label.localeCompare(e.label);var i=I(e),o=I(n);return Number.isNaN(i)&&Number.isNaN(o)?0:Number.isNaN(i)?1:Number.isNaN(o)?-1:r?i-o:o-i}))},formatSatMetricByUuid:f,initialize:function(){return m.apply(this,arguments)}}}var hA=$u('<div class="flex-shrink-0 bg-white border-b border-gray-200 px-4 py-3"><div class="mb-2"><h2 class="text-lg font-bold text-gray-900">Export Fields</h2></div> <p class="text-sm text-gray-500 mb-3">Select fields to export as GeoJSON</p> <div class="flex items-center gap-2"><button class="flex-1 px-3 py-1.5 text-xs font-medium text-gray-600 border border-gray-300 hover:bg-gray-50 rounded-md transition-colors">Select all</button> <button class="flex-1 px-3 py-1.5 text-xs font-medium text-gray-600 border border-gray-300 hover:bg-gray-50 rounded-md transition-colors">Clear all</button></div></div>'),fA=$u('<div class="flex-shrink-0 bg-white border-b border-gray-200 px-4 py-3"><div class="mb-3"><h2 class="text-lg font-bold text-gray-900"> </h2></div> <p class="text-sm text-gray-500 mb-3">Click fields to select</p> <div class="flex items-center gap-2"><button class="flex-1 px-3 py-1.5 text-xs font-medium text-gray-600 border border-gray-300 hover:bg-gray-50 rounded-md transition-colors">Select all</button> <button class="flex-1 px-3 py-1.5 text-xs font-medium text-gray-600 border border-gray-300 hover:bg-gray-50 rounded-md transition-colors">Clear all</button></div></div>'),pA=$u('<span class="flex items-center gap-1"><span class="flex-shrink-0 w-4 h-4" aria-hidden="true"></span> <span>Field Name</span></span>'),gA=$u('<span class="truncate"> </span>'),mA=$u("<!> <!>",1),yA=$u('<span class="flex-shrink-0 inline-flex items-center justify-center w-4 h-4 rounded-full bg-blue-50 text-blue-700 text-[10px] font-bold" title="Pro subscription">P</span>'),_A=$u('<span class="flex-shrink-0 inline-flex items-center justify-center w-4 h-4 rounded-full bg-sky-50 text-sky-700 text-[10px] font-bold" title="ClearSky subscription">C</span>'),vA=$u('<span class="flex-shrink-0 w-4 h-4" aria-hidden="true"></span>'),bA=$u('<div class="flex items-center gap-1"><!> <span class="block truncate text-sm"> </span></div>'),xA=$u('<span class="text-sm text-gray-700"> </span>'),wA=$u("<!> <!>",1),SA=$u('<span class="flex-shrink-0 w-4 h-4 bg-blue-500 rounded flex items-center justify-center text-white text-xs" title="Click to remove">✓</span>'),kA=$u('<span class="flex-shrink-0 w-4 h-4 border border-gray-300 rounded"></span>'),TA=$u('<span class="flex-shrink-0 w-4 h-4 bg-blue-500 rounded-full flex items-center justify-center text-white text-xs" title="Click to remove">✓</span>'),IA=$u('<span class="flex-shrink-0 w-4 h-4 border border-gray-300 rounded-full"></span>'),MA=$u('<span class="flex-shrink-0 inline-flex items-center justify-center w-4 h-4 rounded-full bg-blue-50 text-blue-700 text-[10px] font-bold" title="Pro subscription">P</span>'),EA=$u('<span class="flex-shrink-0 inline-flex items-center justify-center w-4 h-4 rounded-full bg-sky-50 text-sky-700 text-[10px] font-bold" title="ClearSky subscription">C</span>'),PA=$u('<span class="flex-shrink-0 w-4 h-4" aria-hidden="true"></span>'),AA=$u('<img src="/static/images/web/RaindancerCloud.png" alt="Synced to Raindancer" title="Synced to Raindancer" class="flex-shrink-0 w-4 h-4"/>'),CA=$u('<span class="text-xs text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded flex items-center gap-1"><span class="animate-spin inline-block w-2.5 h-2.5 border border-amber-600 border-t-transparent roun
31ded-full"></span> </span>'),RA=$u('<div class="flex items-center gap-1"><!> <!> <span class="block truncate text-base"> </span> <!> <!></div>'),LA=$u("<!> <!>",1),OA=$u('<div class="flex items-center gap-1 pl-6"><span class="block truncate italic text-sm text-gray-700"> </span></div>'),DA=$u('<span class="italic text-sm text-gray-700"> </span>'),zA=$u("<!> <!>",1),FA=$u("<!> <!>",1),NA=$u("<!> <!>",1),BA=$u("<!> <!>",1),jA=$u('<div class="absolute left-0 bottom-full mb-1 w-56 bg-white border border-gray-200 rounded-md shadow-lg z-30 p-2"><label class="flex items-center gap-2 px-2 py-1.5 text-xs text-gray-700 cursor-pointer hover:bg-gray-50 rounded"><input type="checkbox" class="w-3.5 h-3.5"/> <span>Flatten field grouping</span></label></div>'),VA=$u('<div class="flex-shrink-0 bg-white border-t border-gray-200 px-3 py-1.5 flex justify-start"><div class="relative"><button type="button" class="inline-flex items-center justify-center w-7 h-7 text-gray-500 hover:text-gray-900 hover:bg-gray-100 rounded transition-colors" title="Sidebar settings" aria-label="Sidebar settings"><!></button> <!></div></div>'),GA=$u('<div class="h-full w-full flex flex-col"><!> <!> <div class="flex-1 overflow-y-auto overflow-x-hidden"><!></div> <!></div>');function UA(e,t){Zs(t,!0);const r=" pl-3 py-4 text-sm",n=`bg-gray-50 cursor-pointer hover:bg-gray-100 ${r}`.trim(),i=Dl((()=>Bw.showVegetationIndexLayer&&!!Bw.vegetationIndexType&&"clearsky"===Bw.imagerySource)),o=Dl((()=>yu(i)?"satMetric":Bw.sidebarSelectedMetric)),a=Dl((()=>null!==yu(o)||Bw.upgradeFieldSelectionActive)),s=dA(t.farmFieldsGeojson,t.evapotranspirationData),l=Dl((()=>(Bw.vegetationIndexType||"").toUpperCase())),c=Dl((()=>({lastIrrigationEvent:"Last Irrigation",precip:"Rain (mm)",irrigation:"Irrigation (mm)",et:"ET (mm)",diff:"Balance (mm)",satMetric:yu(l)})));let u=$l(0);const d=Dl((()=>{yu(u);const e=s.getSortedFeatures(Bw.tableSortKey,Bw.tableSortAsc),t=Bw.sidebarGroupBy;if("none"===t)return[{label:null,fields:e}];const r=[],n=[];for(const i of e){("clearsky"===t?i.properties?.cloudless_activated:i.properties?.pro_activated)?r.push(i):n.push(i)}return[{label:"clearsky"===t?"ClearSKY Fields":"Pro Fields",fields:r,isActivated:!0},{label:"Other Fields",fields:n,isActivated:!1}].filter((e=>e.fields.length>0))}));function h(e){Bw.tableSortKey===e?Bw.tableSortAsc=!Bw.tableSortAsc:(Bw.tableSortKey=e,Bw.tableSortAsc=!1)}function f(e){const t=e.properties?.crop_zones;return Array.isArray(t)&&t.length>=2}const p=Dl((()=>(t.farmFieldsGeojson?.features??[]).some((e=>f(e)))));function g(){var e;Bw.cropZoneFlatMode=!Bw.cropZoneFlatMode,e=Bw.cropZoneFlatMode,Nw(Dw,e)}let m=$l(!1),y=$l(void 0);Tc((()=>
31{if(!yu(m))return;const e=e=>{yu(y)&&!yu(y).contains(e.target)&&ql(m,!1)};return window.addEventListener("click",e,!0),()=>window.removeEventListener("click",e,!0)}));const _=Dl((()=>(yu(u),s.getFlatRows(Bw.tableSortKey,Bw.tableSortAsc,yu(o)))));Tc((()=>{yu(i)&&(Bw.vegetationIndexType,Bw.selectedVegetationDate,s.loadSatelliteMeans().finally((()=>{Yl(u)})))}));const v=Dl((()=>Bw.upgradeFieldSelectionActive)),b=Dl((()=>Bw.exportFieldSelectionActive));function x(e){return!!Bw.upgradeTier&&("pro"===Bw.upgradeTier?!0===e.properties?.pro_activated:!0===e.properties?.cloudless_activated)}function w(e){try{return fS(e.geometry)}catch{return 0}}const S=Dl((()=>Bw.upgradeTrialCode.trim().toUpperCase()===Rw));Dl((()=>{if(!Bw.upgradeTier||!t.farmFieldsGeojson)return{fields:0,hectares:0,price:0};let e=0;for(const r of Bw.upgradeSelectedFieldIds){const n=t.farmFieldsGeojson.features.find((e=>(e.properties?.id||e.id)===r));n&&(e+=w(n))}const r=yu(S)?0:Lw[Bw.upgradeTier];return{fields:Bw.upgradeSelectedFieldIds.length,hectares:e,price:e*r}}));yh((async()=>{await s.initialize()}));var k=GA(),T=uc(k),I=e=>{var r=hA(),n=hc(uc(r),4),i=uc(n);i.__click=()=>{const e=t.farmFieldsGeojson?.features?.map((e=>Number(e.properties?.id??e.id))).filter((e=>!Number.isNaN(e)))||[];Bw.exportSelectedFieldIds=e},hc(i,2).__click=()=>Bw.exportSelectedFieldIds=[],Os(n),Os(r),Yu(e,r)};ad(T,(e=>{yu(b)&&e(I)}));var M=hc(T,2),E=e=>{var r=fA(),n=uc(r),i=uc(n),o=uc(i,!0);Os(i),Os(n);var a=hc(n,4),s=uc(a);s.__click=()=>{const e=t.farmFieldsGeojson?.features?.filter((e=>!x(e)))?.map((e=>Number(e.id)))||[];Bw.upgradeSelectedFieldIds=e},hc(s,2).__click=()=>Bw.upgradeSelectedFieldIds=[],Os(a),Os(r),Pc((()=>Ju(o,"pro"===Bw.upgradeTier?"Upgrade to Pro":"Upgrade to Cloudless"))),Yu(e,r)};ad(M,(e=>{yu(v)&&e(E)}));var P=hc(M,2);!function(e,t){Zs(t,!0);let r=fh(t,"border",3,!0),n=fh(t,"color",3,"default"),i=lh(t,["$$slots","$$events","$$legacy","children","footerSlot","captionSlot","items","divClass","striped","hoverable","border","shadow","color","class","classes"]);t.divClass;const o=Dl((()=>t.classes??{div:t.divClass})),a=x_("table"),s=Dl((()=>ib({color:n(),shadow:t.shadow}))),l=Dl((()=>yu(s).div)),c=Dl((()=>yu(s).table));Ws("tableCtx",{get striped(){return t.striped},get hoverable(){return t.hoverable},get border(){return r()},get color(){return n()}});let u=Dl((()=>t.items&&t.items.length>0?Object.keys(t.items[0]).map((e=>({text:e.charAt(0).toUpperCase()+e.slice(1)}))):[])),d=Dl((()=>t.items&&t.items.length>0?t.items.map((e=>Object.values(e))):[]));var h=Sb(),f=uc(h);Nd(f,(e=>({...i,class:e})),[()=>yu(c)({class:yd(a?.table,t.class)})]);var p=uc(f),g=e=>{var r=Zu();ud(dc(r),(()=>t.captionSlot)),Yu(e,r)};ad(p,(e=>{t.captionSlot&&e(g)}));var m=hc(p),y=e=>{var t=wb(),r=dc(t);pb(r,{get headItems(){return yu(u)}}),xb(hc(r,2),{get bodyItems(){return yu(d)}}),Yu(e,t)},_=e=>{var r=Zu(),n=dc(r),i=e=>{var r=Zu();ud(dc(r),(()=>t.children)),Yu(e,r)};ad(n,(e=>{t.children&&e(i)}),!0),Yu(e,r)};ad(m,(e=>{t.items&&t.items.length>0?e(y):e(_,!1)}));var v=hc(m),b=e=>{var r=Zu();ud(dc(r),(()=>t.footerSlot)),Yu(e,r)};ad(v,(e=>{t.footerSlot&&e(b)})),Os(f),Os(h),Pc((e=>wd(h,1,e)),[()=>_d(yu(l)({class:yd(a?.div,yu(o).div)}))]),Yu(e,h),Ys()}(uc(P),{striped:!1,class:"w-full table-fixed border-separate border-spacing-0",children:(e,t)=>{var i=BA(),l=dc(i);pb(l,{class:"sticky top-0 z-20",children:(e,t)=>{var r=mA(),i=dc(r);{let e=Dl((()=>`sticky left-0 z-30 pr-3 ${n} ${yu(a)?"w-2/3":"w-full"}`));ub(i,{get class(){return yu(e)},onclick:()=>h("name"),children:(e,t)=>{Yu(e,pA())},$$slots:{default:!0}})}var s=hc(i,2),l=e=>{{let t=Dl((()=>`text-right pr-6 ${n} ${yu(v)?"w-20":"w-1/3"}`));ub(e,{get class(){return yu(t)},onclick:()=>yu(o)&&h(yu(o)),children:(e,t)=>{var r=gA(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(v)?"ha":yu(o)?yu(c)[yu(o)]:""))),Yu(e,r)},$$slots:{default:!0}})}};ad(s,(e=>{yu(a)&&e(l)})),Yu(e,r)},$$slots:{default:!0}}),xb(hc(l,2),{children:(e,t)=>{var n=Zu(),i=dc(n),l=e=>{var t=Zu();Il(dc(t),19,(()=>yu(_)),(e=>`${e.id}-${e.cropZoneId??"f"}`),((e,t,n)=>{const i=Dl((()=>Bw.selectedFieldId===yu(t).id&&(null==yu(t).cropZoneId&&!f(yu(t).field)||Bw.selectedCropZoneId===yu(t).cropZoneId)));{let o=Dl((()=>`cursor-pointer\n                        ${yu(n)>0?"border-t border-gray-200":""}\n                        ${yu(i)?"bg-blue-100":Bw.hoveredFieldId===yu(t).id?"bg-blue-50":yu(n)%2==1?"bg-gray-50":"bg-white"}`));mb(e,{get class(){return yu(o)},onmouseenter:()=>{Bw.hoveredFieldId=yu(t).id},onmouseleave:()=>{Bw.hoveredFieldId=null},onclick:()=>{Bw.selectedFieldId=yu(t).id,Bw.selectedFieldName=yu(t).field.properties?.name||yu(t).label,Bw.selectedCropZoneId=yu(t).cropZoneId},children:(e,n)=>{var i=wA(),o=dc(i);vb(o,{class:`sticky left-0 z-10 pr-3 ${r} bg-inherit overflow-hidden`,children:(e,r)=>{var n=bA(),i=uc(n),o=e=>{Yu(e,yA())},a=e=>{var r=Zu(),n=dc(r),i=e=>{Yu(e,_A())},o=e=>{Yu(e,vA())};ad(n,(e=>{yu(t).field.properties?.cloudless_activated?e(i):e(o,!1)}),!0),Yu(e,r)};ad(i,(e=>{yu(t).field.properties?.pro_activated?e(o):e(a,!1)}));var s=hc(i,2),l=uc(s,!0);Os(s),Os(n),Pc((()=>Ju(l,yu(t).label))),Yu(e,n)},$$slots:{default:!0}});var s=hc(o,2),l=e=>{vb(e,{class:`text-right pr-6 ${r}`,children:(e,r)=>{var n=xA(),i=uc(n,!0);Os(n),Pc((()=>Ju(i,yu(t).metric))),Yu(e,n)},$$slots:{default:!0}})};ad(s,(e=>{yu(a)&&e(l)}
31)),Yu(e,i)},$$slots:{default:!0}})}})),Yu(e,t)},c=e=>{var t=Zu();Il(dc(t),17,(()=>yu(d)),Tl,((e,t)=>{var n=NA(),i=dc(n),l=e=>{mb(e,{class:"bg-gray-100 border-t border-gray-300",children:(e,r)=>{{let r=Dl((()=>yu(a)?2:1));vb(e,{get colspan(){return yu(r)},class:"py-2 px-3 text-xs font-semibold text-gray-600",children:(e,r)=>{Ds();var n=Wu();Pc((()=>Ju(n,yu(t).label))),Yu(e,n)},$$slots:{default:!0}})}},$$slots:{default:!0}})};ad(i,(e=>{yu(t).label&&e(l)})),Il(hc(i,2),19,(()=>yu(t).fields),(e=>Number(e.id)),((e,t,n)=>{const i=Dl((()=>s.getTableRowData(yu(t)))),l=Dl((()=>Bw.selectedFieldId===yu(i).id)),c=Dl((()=>f(yu(t)))),u=Dl((()=>yu(l)&&!yu(c))),d=Dl((()=>{return e=yu(i).id,Bw.upgradeSelectedFieldIds.includes(e);var e})),h=Dl((()=>{return e=yu(i).id,Bw.exportSelectedFieldIds.includes(e);var e})),p=Dl((()=>x(yu(t)))),g=Dl((()=>w(yu(t)))),m=Dl((()=>Bw.hoveredFieldId===yu(i).id&&!yu(c)));var y=FA(),_=dc(y);{let e=Dl((()=>`cursor-pointer\n                        ${yu(n)>0?"border-t border-gray-400":""}\n                        ${yu(b)&&yu(h)||yu(v)&&yu(d)?"bg-blue-100 border-l-2 border-l-blue-500":yu(u)?"bg-blue-100":yu(m)?"bg-blue-50":yu(n)%2==1?"bg-gray-50":"bg-white"}\n                        ${yu(p)?"opacity-60 cursor-not-allowed":""}`));mb(_,{get class(){return yu(e)},onmouseenter:()=>{Bw.hoveredFieldId=yu(i).id},onmouseleave:()=>{Bw.hoveredFieldId=null},onclick:()=>{if(yu(b))!function(e){const t=Bw.exportSelectedFieldIds.indexOf(e);Bw.exportSelectedFieldIds=t>=0?Bw.exportSelectedFieldIds.filter((t=>t!==e)):[...Bw.exportSelectedFieldIds,e]}(yu(i).id);else if(yu(v))!function(e,t){if(x(t))return;const r=Bw.upgradeSelectedFieldIds.indexOf(e);Bw.upgradeSelectedFieldIds=r>=0?Bw.upgradeSelectedFieldIds.filter((t=>t!==e)):[...Bw.upgradeSelectedFieldIds,e]}(yu(i).id,yu(t));else{Bw.selectedFieldId=yu(i).id,Bw.selectedFieldName=yu(i).name;const e=yu(t).properties?.crop_zones??[];Bw.selectedCropZoneId=e[0]?.crop_zone_id??null}},children:(e,n)=>{var s=LA(),l=dc(s);{let e=Dl((()=>`${yu(v)||yu(b)?"":"sticky left-0 z-10"} pr-3 ${r} bg-inherit overflow-hidden`));vb(l,{get class(){return yu(e)},children:(e,r)=>{var n=RA(),o=uc(n),a=e=>{Yu(e,SA())},s=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,kA())},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,TA())},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,IA())};ad(r,(e=>{yu(v)&&!yu(p)&&e(n)}),!0),Yu(e,t)};ad(r,(e=>{yu(v)&&yu(d)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(r,(e=>{yu(b)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(o,(e=>{yu(b)&&yu(h)?e(a):e(s,!1)}));var l=hc(o,2),c=e=>{Yu(e,MA())},u=e=>{var r=Zu(),n=dc(r),i=e=>{Yu(e,EA())},o=e=>{Yu(e,PA())};ad(n,(e=>{yu(t).properties?.cloudless_activated?e(i):e(o,!1)}),!0),Yu(e,r)};ad(l,(e=>{yu(t).properties?.pro_activated?e(c):e(u,!1)}));var f=hc(l,2),g=uc(f,!0);Os(f);var m=hc(f,2),y=e=>{Yu(e,AA())};ad(m,(e=>{yu(t).properties?.raindancer_field_guid&&e(y)}));var _=hc(m,2),x=e=>{var r=CA(),n=hc(uc(r));Os(r),Pc((()=>{Fd(r,"title","Setting up "+("pro"===yu(t).properties.processing_status?"Pro":"Cloudless")),Ju(n," "+("pro"===yu(t).properties.processing_status?"Pro":"Cloudless"))})),Yu(e,r)};ad(_,(e=>{yu(t).properties?.processing_status&&e(x)})),Os(n),Pc((()=>Ju(g,yu(i).name))),Yu(e,n)},$$slots:{default:!0}})}var c=hc(l,2),u=e=>{vb(e,{class:`text-right pr-6 ${r}`,children:(e,r)=>{var n=Zu(),a=dc(n),s=e=>{var t=Wu();Pc((e=>Ju(t,e)),[()=>yu(g).toFixed(1)]),Yu(e,t)},l=e=>{var r=Zu(),n=dc(r),a=e=>{var r=Zu(),n=dc(r),a=e=>{Yu(e,Wu("—"))},s=e=>{var t=Wu();Pc((()=>Ju(t,yu(i)[yu(o)]))),Yu(e,t)};ad(n,(e=>{f(yu(t))?e(a):e(s,!1)})),Yu(e,r)};ad(n,(e=>{yu(o)&&e(a)}),!0),Yu(e,r)};ad(a,(e=>{yu(v)?e(s):e(l,!1)})),Yu(e,n)},$$slots:{default:!0}})};ad(c,(e=>{yu(a)&&e(u)})),Yu(e,s)},$$slots:{default:!0}})}var S=hc(_,2),k=e=>{var n=Zu();Il(dc(n),17,(()=>yu(t).properties.crop_zones),(e=>e.crop_zone_id??e.id),((e,n)=>{const c=Dl((()=>yu(l)&&null!=yu(n).crop_zone_id&&yu(n).crop_zone_id===Bw.selectedCropZoneId)),u=Dl((()=>function(e,t,r){if(!r)return"";if(!e||!t)return"—";if("satMetric"===r)return s.formatSatMetricByUuid(t);const n=(e.properties?.irrigation_events??[]).filter((e=>null==e.crop_zone_id||e.crop_zone_id===t));if("irrigation"===r){const e=n.reduce(((e,t)=>e+(t.irrigation_amount??0)),0);return e>0?e.toFixed(0):"0"}if("lastIrrigationEvent"===r){const e=n.find((e=>e.date));return e?.date?new Date(e.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):"–"}return"—"}(yu(t),yu(n).crop_zone_id??null,yu(o))));{let t=Dl((()=>"cursor-pointer\n                            "+(yu(c)?"bg-blue-100":"bg-white")));mb(e,{get class(){return yu(t)},onclick:()=>{yu(n).crop_zone_id&&(Bw.selectedFieldId=yu(i).id,Bw.selectedFieldName=yu(i).name,Bw.selectedCropZoneId=yu(n).crop_zone_id)},children:(e,t)=>{var i=zA(),o=dc(i);vb(o,{class:`sticky left-0 z-10 pr-3 ${r} bg-inherit overflow-hidden`,children:(e,t)=>
31{var r=OA(),i=uc(r),o=uc(i);Os(i),Os(r),Pc((()=>Ju(o,`${yu(n).name??""}${yu(n).crop_type?`: ${yu(n).crop_type}`:""}`))),Yu(e,r)},$$slots:{default:!0}});var s=hc(o,2),l=e=>{vb(e,{class:`text-right pr-6 ${r}`,children:(e,t)=>{var r=DA(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(u)))),Yu(e,r)},$$slots:{default:!0}})};ad(s,(e=>{yu(a)&&e(l)})),Yu(e,i)},$$slots:{default:!0}})}})),Yu(e,n)};ad(S,(e=>{!yu(b)&&!yu(v)&&Array.isArray(yu(t).properties?.crop_zones)&&yu(t).properties.crop_zones.length>=2&&e(k)})),Yu(e,y)})),Yu(e,n)})),Yu(e,t)};ad(i,(e=>{Bw.cropZoneFlatMode&&yu(p)&&!yu(b)&&!yu(v)?e(l):e(c,!1)})),Yu(e,n)},$$slots:{default:!0}}),Yu(e,i)},$$slots:{default:!0}}),Os(P);var A=hc(P,2),C=e=>{var t=VA(),r=uc(t),n=uc(r);n.__click=()=>ql(m,!yu(m)),function(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"cog outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=Rk();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=Ak(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=Ck(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p),y=hc(m);Os(d),Pc((()=>{Fd(m,"stroke-width",a()),Fd(y,"stroke-width",a())})),Yu(e,d),Ys()}(uc(n),{class:"w-4 h-4"}),Os(n);var i=hc(n,2),o=e=>{var t=jA(),r=uc(t),n=uc(r);Ld(n),n.__change=g,Ds(2),Os(r),Os(t),Pc((()=>Dd(n,Bw.cropZoneFlatMode))),Yu(e,t)};ad(i,(e=>{yu(m)&&e(o)})),Os(r),nh(r,(e=>ql(y,e)),(()=>yu(y))),Os(t),Yu(e,t)};ad(A,(e=>{yu(b)||yu(v)||!yu(p)||e(C)})),Os(k),Yu(e,k),Ys()}Bu(["click","change"]);$u('<div role="dialog" tabindex="-1" class="fixed z-[9999] bg-white rounded-xl shadow-2xl ring-1 ring-black/10 p-4"><!> <div class="border-t border-gray-200 my-3"></div> <div class="flex gap-2"><button class="flex-1 text-xs px-2 py-1.5 bg-gray-100 text-gray-700 rounded hover:bg-gray-200 transition-colors">Cancel</button> <button class="flex-1 text-xs px-2 py-1.5 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">Apply</button></div></div>'),$u('<div class="mt-2"><div class="relative sidebar-date-container"><button class="w-full flex items-center gap-3 px-4 py-2 bg-white hover:bg-gray-50 rounded-lg transition-colors text-sm border border-gray-300"><!> <span class="font-medium text-gray-800"> </span> <span class="text-gray-400">→</span> <span class="font-medium text-gray-800"> </span> <span class="text-xs text-gray-500"> </span> <!></button> <!></div></div>');var $A=$u('<div class="flex-shrink-0 px-4 pb-3 border-b border-gray-200 overflow-visible" style="padding-top: 14px;"><div class="flex items-center justify-between"><h1 class="text-xl font-bold text-gray-900">Farm Overview</h1>  <div></div></div> <!></div>'),HA=$u('<button class="inline-flex items-center gap-1.5 px-3 text-gray-700 bg-white rounded-lg hover:bg-gray-50 transition-all text-sm font-medium shadow-md border border-gray-300" style="height: 36px;" title="Admin: export field boundaries as GeoJSON">⬇ Export</button>'),qA=$u('<div class="absolute bottom-4 right-4 z-10 flex items-center gap-2"><!> <button class="inline-flex items-center gap-1.5 px-3 text-white rounded-lg hover:opacity-90 transition-all text-sm font-medium shadow-md border border-green-700" style="height: 36px; background-color: #2da44e;"><span class="text-lg leading-none">+</span> Add Field</button></div>'),WA=$u('<div class="absolute bottom-4 left-4 right-4 z-10 flex items-center gap-2"><button class="flex-1 inline-flex items-center justify-center px-3 text-gray-700 bg-white rounded-lg hover:bg-gray-50 transition-all text-sm font-medium shadow-md border border-gray-300" style="height: 36px;">Cancel</button> <button class="flex-1 inline-flex items-center justify-center gap-1.5 px-3 text-white rounded-lg transition-all text-sm font-medium shadow-md border border-blue-700 disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90" style="height: 36px; background-color: #2563eb;"> </button></div>'),ZA=$u('<!> <!> <div class="flex-1 overflow-y-auto overflow-x-hidden relative w-full"><!> <!> <!></div>',1);function YA(e,t){Zs(t,!0);fh(t,"appMode",19,(()=>({type:"map"})));let r=fh(t,"isAdmin",3,!1);function n(){Bw.exportSelectedFieldIds=[],Bw.exportFieldSelectionActive=!0}function i(){Bw.exportFieldSelectionActive=!1,Bw.exportSelectedFieldIds=[]}function o(){if(!t.farmFieldsGeojson||0===Bw.exportSelectedFieldIds.length)return;const e=new Set(Bw.exportSelectedFieldIds),r={type:"FeatureCollection",features:t.farmFieldsGeojson.features.filter((t=>{const r=t.properties?.id??t.id;return void 0!==r&&e.has(Number(r))}))},n=new Blob([JSON.stringify(r,null,2)],{type:"application/geo+json"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i;const a=(new Date).toISOString().slice(0,19).replace(/[:T]/g,"-");o.download=`farm-fields-${a}.geojson`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(i)}let a=$l(!1),s=$l(!1);$l(Jl({from:void 0,to:void 0})),$l(null);const l=[{value:"last-irrigation",label:"Since irrigation",shortLabel:"Since irrigation"},{value:"last-7",label:"7 days",shortLabel:"7d"}];Dl((()=>l.find((e=>e.value===Bw.sidebarDateMode))?.shortLabel||"7d")),Dl((()=>()=>{if("custom"===Bw.sidebarDateMode&&Bw.selectedStartDate&&Bw.selectedEndDate){const e=new Date(`${Bw.selectedStartDate}T00:00:00`),t=new Date(`${Bw.selectedEndDate}T00:00:00`),r=Math.ceil((t.getTime()-e.getTime())/864e5)+1;return{startStr:Bw.selectedStartDate,endStr:Bw.selectedEndDate,days:r}}const e=Ow(Bw.sidebarDateMode),t=new Date(Date.now()-864e5);return{startStr:Ew(new Date(t.getTime()-864e5*((e||7)-1))),endStr:Ew(t),days:e||7}}));var c=ZA();Nu("click",tc,(function(e){const t=e.target;t.closest(".settings-dropdown")||t.closest(".settings-button")||ql(a,!1),t.closest(".sidebar-date-container")||ql(s,!1)}));var u=dc(c),d=e=>{var t=$A();ad(hc(uc(t),2),(e=>{0})),Os(t),Yu(e,t)};ad(u,(e=>{Bw.upgradeFieldSelectionActive||Bw.exportFieldSelectionActive||e(d)}));var h=hc(u,2),f=e=>{!function(e,t){Zs(t,!0);let r=fh(t,"dismissible",3,!1),n=$l(!1);function i(){Bw.upgradeTier="pro",Bw.upgradeModalOpen=!0}function o(){ql(n,!0)}var a=Zu(),s=dc(a),l=e=>{var t=Pk(),n=uc(t);n.__click=i;var a=hc(n,2),s=e=>{var t=Ek();t.__click=o,Yu(e,t)};ad(a,(e=>{r()&&e(s)})),Os(t),Yu(e,t)};ad(s,(e=>{yu(n)||e(l)}
31)),Yu(e,a),Ys()}(e,{dismissible:!0})};ad(h,(e=>{Bw.upgradeFieldSelectionActive||Bw.exportFieldSelectionActive||e(f)}));var p=hc(h,2),g=uc(p);UA(g,{get farmFieldsGeojson(){return t.farmFieldsGeojson},get evapotranspirationData(){return t.evapotranspirationData}});var m=hc(g,2),y=e=>{var i=qA(),o=uc(i),a=e=>{var t=HA();t.__click=n,Yu(e,t)};ad(o,(e=>{r()&&e(a)})),hc(o,2).__click=()=>t.onAddField?.(),Os(i),Yu(e,i)};ad(m,(e=>{Bw.upgradeFieldSelectionActive||Bw.exportFieldSelectionActive||e(y)}));var _=hc(m,2),v=e=>{var t=WA(),r=uc(t);r.__click=i;var n=hc(r,2);n.__click=o;var a=uc(n);Os(n),Os(t),Pc((()=>{n.disabled=0===Bw.exportSelectedFieldIds.length,Ju(a,`Download GeoJSON (${Bw.exportSelectedFieldIds.length??""})`)})),Yu(e,t)};ad(_,(e=>{Bw.exportFieldSelectionActive&&e(v)})),Os(p),Yu(e,c),Ys()}Bu(["click"]);const XA={CANVAS:"mapboxgl-canvas",CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},KA={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},JA={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},QA={POLYGON:"polygon",LINE:"line_string",POINT:"point"},eC={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},tC={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select"},rC={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},nC={MOVE:"move",CHANGE_PROPERTIES:"change_properties",CHANGE_COORDINATES:"change_coordinates"},iC={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},oC={ACTIVE:"true",INACTIVE:"false"},aC=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],sC=-90,lC=-85,cC=90,uC=85,dC=-270,hC=270;function fC(e){return function(t){const r=t.featureTarget;return!!r&&(!!r.properties&&r.properties.meta===e)}}function pC(e){return!!e.originalEvent&&(!!e.originalEvent.shiftKey&&0===e.originalEvent.button)}function gC(e){return!!e.featureTarget&&(!!e.featureTarget.properties&&(e.featureTarget.properties.active===oC.ACTIVE&&e.featureTarget.properties.meta===iC.FEATURE))}function mC(e){return!!e.featureTarget&&(!!e.featureTarget.properties&&(e.featureTarget.properties.active===oC.INACTIVE&&e.featureTarget.properties.meta===iC.FEATURE))}function yC(e){return void 0===e.featureTarget}function _C(e){return!!e.featureTarget&&(!!e.featureTarget.properties&&e.featureTarget.properties.meta===iC.FEATURE)}function vC(e){const t=e.featureTarget;return!!t&&(!!t.properties&&t.properties.meta===iC.VERTEX)}function bC(e){return!!e.originalEvent&&!0===e.originalEvent.shiftKey}function xC(e){return"Escape"===e.key||27===e.keyCode}function wC(e){return"Enter"===e.key||13===e.keyCode}function SC(e){return"Backspace"===e.key||8===e.keyCode}function kC(e){return"Delete"===e.key||46===e.keyCode}function TC(e){return"1"===e.key||49===e.keyCode}function IC(e){return"2"===e.key||50===e.keyCode}function MC(e){return"3"===e.key||51===e.keyCode}function EC(e){const t=e.key||String.fromCharCode(e.keyCode);return t>="0"&&t<="9"}function PC(){return!0}var AC=i(9778);const CC={Point:0,LineString:1,MultiLineString:1,Polygon:2};function RC(e,t){const r=CC[e.geometry.type]-CC[t.geometry.type];return 0===r&&e.geometry.type===eC.POLYGON?e.area-t.area:r}const LC=function(e){return e.map((e=>(e.geometry.type===eC.POLYGON&&(e.area=AC.geometry({type:eC.FEATURE,property:{},geometry:e.geometry})),e))).sort(RC).map((e=>(delete e.area,e)))};const OC=function(e,t=0){return[[e.point.x-t,e.point.y-t],[e.point.x+t,e.point.y+t]]};function DC(e){if(this._items={},this._nums={},this._length=e?e.length:0,e)for(let t=0,r=e.length;t<r;t++)this.add(e[t]),void 0!==e[t]&&("string"==typeof e[t]?this._items[e[t]]=t:this._nums[e[t]]=t)}DC.prototype.add=function(e){return this.has(e)||(this._length++,"string"==typeof e?this._items[e]=this._length:this._nums[e]=this._length),this},DC.prototype.delete=function(e){return!1===this.has(e)||(this._length--,delete this._items[e],delete this._nums[e]),this},DC.prototype.has=function(e){return("string"==typeof e||"number"==typeof e)&&(void 0!==this._items[e]||void 0!==this._nums[e])},DC.prototype.values=function(){const e=[];
vendor: 53,363 bytes, line 31
31return Object.keys(this._items).forEach((t=>{e.push({k:t,v:this._items[t]})})),Object.keys(this._nums).forEach((t=>{e.push({k:JSON.parse(t),v:this._nums[t]})})),e.sort(((e,t)=>e.v-t.v)).map((e=>e.k))},DC.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};const zC=DC,FC=[iC.FEATURE,iC.MIDPOINT,iC.VERTEX],NC={click:function(e,t,r){return BC(e,t,r,r.options.clickBuffer)},touch:function(e,t,r){return BC(e,t,r,r.options.touchBuffer)}};function BC(e,t,r,n){if(null===r.map)return[];const i=e?OC(e,n):t,o={};r.options.styles&&(o.layers=r.options.styles.map((e=>e.id)).filter((e=>null!=r.map.getLayer(e))));const a=r.map.queryRenderedFeatures(i,o).filter((e=>-1!==FC.indexOf(e.properties.meta))),s=new zC,l=[];return a.forEach((e=>{const t=e.properties.id;s.has(t)||(s.add(t),l.push(e))})),LC(l)}function jC(e,t){const r=NC.click(e,null,t),n={mouse:JA.NONE};return r[0]&&(n.mouse=r[0].properties.active===oC.ACTIVE?JA.MOVE:JA.POINTER,n.feature=r[0].properties.meta),-1!==t.events.currentModeName().indexOf("draw")&&(n.mouse=JA.ADD),t.ui.queueMapClasses(n),t.ui.updateMapClasses(),r[0]}function VC(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(r*r+n*n)}const GC=4,UC=12,$C=500;function HC(e,t,r={}){const n=null!=r.fineTolerance?r.fineTolerance:GC,i=null!=r.grossTolerance?r.grossTolerance:UC,o=null!=r.interval?r.interval:$C;e.point=e.point||t.point,e.time=e.time||t.time;const a=VC(e.point,t.point);return a<n||a<i&&t.time-e.time<o}const qC=25,WC=250;function ZC(e,t,r={}){const n=null!=r.tolerance?r.tolerance:qC,i=null!=r.interval?r.interval:WC;e.point=e.point||t.point,e.time=e.time||t.time;return VC(e.point,t.point)<n&&t.time-e.time<i}const YC=function(e,t){const r={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},n={on(e,t,n){if(void 0===r[e])throw new Error(`Invalid event type: ${e}`);r[e].push({selector:t,fn:n})},render(e){t.store.featureChanged(e)}},i=function(e,i){const o=r[e];let a=o.length;for(;a--;){const e=o[a];if(e.selector(i)){e.fn.call(n,i)||t.store.render(),t.ui.updateMapClasses();break}}};return e.start.call(n),{render:e.render,stop(){e.stop&&e.stop()},trash(){e.trash&&(e.trash(),t.store.render())},combineFeatures(){e.combineFeatures&&e.combineFeatures()},uncombineFeatures(){e.uncombineFeatures&&e.uncombineFeatures()},drag(e){i("drag",e)},click(e){i("click",e)},mousemove(e){i("mousemove",e)},mousedown(e){i("mousedown",e)},mouseup(e){i("mouseup",e)},mouseout(e){i("mouseout",e)},keydown(e){i("keydown",e)},keyup(e){i("keyup",e)},touchstart(e){i("touchstart",e)},touchmove(e){i("touchmove",e)},touchend(e){i("touchend",e)},tap(e){i("tap",e)}}};const XC=((e,t=21)=>(r=t)=>{let n="",i=0|r;for(;i--;)n+=e[Math.random()*e.length|0];return n})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",32);function KC(){return XC()}const JC=function(e,t){this.ctx=e,this.properties=t.properties||{},this.coordinates=t.geometry.coordinates,this.id=t.id||KC(),this.type=t.geometry.type};JC.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},JC.prototype.incomingCoords=function(e){this.setCoordinates(e)},JC.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},JC.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},JC.prototype.setProperty=function(e,t){this.properties[e]=t},JC.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:eC.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},JC.prototype.internal=function(e){const t={id:this.id,meta:iC.FEATURE,"meta:type":this.type,active:oC.INACTIVE,mode:e};if(this.ctx.options.userProperties)for(const e in this.properties)t[`user_${e}`]=this.properties[e];return{type:eC.FEATURE,properties:t,geometry:{coordinates:this.getCoordinates(),type:this.type}}};const QC=JC,eR=function(e,t){QC.call(this,e,t)};(eR.prototype=Object.create(QC.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},eR.prototype.updateCoordinate=function(e,t,r){this.coordinates=3===arguments.length?[t,r]:[e,t],this.changed()},eR.prototype.getCoordinate=function(){return this.getCoordinates()};const tR=eR,rR=function(e,t){QC.call(this,e,t)};(rR.prototype=Object.create(QC.prototype)).isValid=function(){return this.coordinates.length>1},rR.prototype.addCoordinate=function(e,t,r){this.changed();const n=parseInt(e,10);this.coordinates.splice(n,0,[t,r])},rR.prototype.getCoordinate=function(e){const t=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[t]))},rR.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)},rR.prototype.updateCoordinate=function(e,t,r){const n=parseInt(e,10);this.coordinates[n]=[t,r],this.changed()};const nR=rR,iR=function(e,t){QC.call(this,e,t),this.coordinates=this.coordinates.map((e=>e.slice(0,-1)))};(iR.prototype=Object.create(QC.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every((e=>e.length>2))},iR.prototype.incomingCoords=function(e){this.coordinates=e.map((e=>e.slice(0,-1))),this.changed()},iR.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},iR.prototype.addCoordinate=function(e,t,r){this.changed();const n=e.split(".").map((e=>parseInt(e,10)));this.coordinates[n[0]].splice(n[1],0,[t,r])},iR.prototype.removeCoordinate=function(e){this.changed();const t=e.split(".").map((e=>parseInt(e,10))),r=this.coordinates[t[0]];r&&(r.splice(t[1],1),r.length<3&&this.coordinates.splice(t[0],1))},iR.prototype.getCoordinate=function(e){const t=e.split(".").map((e=>parseInt(e,10))),r=this.coordinates[t[0]];return JSON.parse(JSON.stringify(r[t[1]]))},iR.prototype.getCoordinates=function(){return this.coordinates.map((e=>e.concat([e[0]])))},iR.prototype.updateCoordinate=function(e,t,r){this.changed();const n=e.split("."),i=parseInt(n[0],10),o=parseInt(n[1],10);void 0===this.coordinates[i]&&(this.coordinates[i]=[]),this.coordinates[i][o]=[t,r]};const oR=iR,aR={MultiPoint:tR,MultiLineString:nR,MultiPolygon:oR},sR=(e,t,r,n,i)=>{const o=r.split("."),a=parseInt(o[0],10),s=o[1]?o.slice(1).join("."):null;return e[a][t](s,n,i)},lR=function(e,t){if(QC.call(this,e,t),delete this.coordinates,this.model=aR[t.geometry.type],void 0===this.model)throw new TypeError(`${t.geometry.type} is not a valid type`);this.features=this._coordinatesToFeatures(t.geometry.coordinates)};(lR.prototype=Object.create(QC.prototype))._coordinatesToFeatures=function(e){const t=this.model.bind(this);return e.map((e=>new t(this.ctx,{id:KC(),type:eC.FEATURE,properties:{},geometry:{coordinates:e,type:this.type.replace("Multi","")}})))},lR.prototype.isValid=function(){return this.features.every((e=>e.isValid()))},lR.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()},lR.prototype.getCoordinate=function(e){return sR(this.features,"getCoordinate",e)},lR.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((e=>e.type===eC.POLYGON?e.getCoordinates():e.coordinates))))},lR.prototype.updateCoordinate=function(e,t,r){sR(this.features,"updateCoordinate",e,t,r),this.changed()},lR.prototype.addCoordinate=function(e,t,r){sR(this.features,"addCoordinate",e,t,r),this.changed()},lR.prototype.removeCoordinate=function(e){sR(this.features,"removeCoordinate",e),this.changed()},lR.prototype.getFeatures=function(){return this.features};const cR=lR;function uR(e){this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}uR.prototype.setSelected=function(e){return this._ctx.store.setSelected(e)},uR.prototype.setSelectedCoordinates=function(e){this._ctx.store.setSelectedCoordinates(e),e.reduce(((e,t)=>(void 0===e[t.feature_id]&&(e[t.feature_id]=!0,this._ctx.store.get(t.feature_id).changed()),e)),{})},uR.prototype.getSelected=function(){return this._ctx.store.getSelected()},uR.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},uR.prototype.isSelected=function(e){return this._ctx.store.isSelected(e)},uR.prototype.getFeature=function(e){return this._ctx.store.get(e)},uR.prototype.select=function(e){return this._ctx.store.select(e)},uR.prototype.deselect=function(e){return this._ctx.store.deselect(e)},uR.prototype.deleteFeature=function(e,t={}){return this._ctx.store.delete(e,t)},uR.prototype.addFeature=function(e,t={}){return this._ctx.store.add(e,t)},uR.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},uR.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},uR.prototype.setActionableState=function(e={}){const t={trash:e.trash||!1,combineFeatures:e.combineFeatures||!1,uncombineFeatures:e.uncombineFeatures||!1};return this._ctx.events.actionable(t)},uR.prototype.changeMode=function(e,t={},r={}){return this._ctx.events.changeMode(e,t,r)},uR.prototype.fire=function(e,t){return this._ctx.events.fire(e,t)},uR.prototype.updateUIClasses=function(e){return this._ctx.ui.queueMapClasses(e)},uR.prototype.activateUIButton=function(e){return this._ctx.ui.setActiveButton(e)},uR.prototype.featuresAt=function(e,t,r="click"){if("click"!==r&&"touch"!==r)throw new Error("invalid buffer type");return NC[r](e,t,this._ctx)},uR.prototype.newFeature=function(e){const t=e.geometry.type;return t===eC.POINT?new tR(this._ctx,e):t===eC.LINE_STRING?new nR(this._ctx,e):t===eC.POLYGON?new oR(this._ctx,e):new cR(this._ctx,e)},uR.prototype.isInstanceOf=function(e,t){if(e===eC.POINT)return t instanceof tR;if(e===eC.LINE_STRING)return t instanceof nR;if(e===eC.POLYGON)return t instanceof oR;if("MultiFeature"===e)return t instanceof cR;throw new Error(`Unknown feature class: ${e}`)},uR.prototype.doRender=function(e){return this._ctx.store.featureChanged(e)};const dR=uR;uR.prototype.onSetup=function(){},uR.prototype.onDrag=function(){},uR.prototype.onClick=function(){},uR.prototype.onMouseMove=function(){},uR.prototype.onMouseDown=function(){},uR.prototype.onMouseUp=function(){},uR.prototype.onMouseOut=function(){},uR.prototype.onKeyUp=function(){},uR.prototype.onKeyDown=function(){},uR.prototype.onTouchStart=function(){},uR.prototype.onTouchMove=function(){},uR.prototype.onTouchEnd=function(){},uR.prototype.onTap=function(){},uR.prototype.onStop=function(){},uR.prototype.onTrash=function(){},uR.prototype.onCombineFeature=function(){},uR.prototype.onUncombineFeature=function(){},uR.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};const hR={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},fR=Object.keys(hR);function pR(e){const t=Object.keys(e);return function(r,n={}){let i={};const o=t.reduce(((t,r)=>(t[r]=e[r],t)),new dR(r));return{start(){i=o.onSetup(n),fR.forEach((t=>{const r=hR[t];let n=()=>!1;var a;e[r]&&(n=()=>!0),this.on(t,n,(a=r,e=>o[a](i,e)))}))},stop(){o.onStop(i)},trash(){o.onTrash(i)},combineFeatures(){o.onCombineFeatures(i)},uncombineFeatures(){o.onUncombineFeatures(i)},render(e,t){o.toDisplayFeatures(i,e,t)}}}}const gR=function(e){return[].concat(e).filter((e=>void 0!==e))};function mR(){const e=this;if(!(e.ctx.map&&void 0!==e.ctx.map.getSource(KA.HOT)))return s();const t=e.ctx.events.currentModeName();e.ctx.ui.queueMapClasses({mode:t});let r=[],n=[];e.isDirty?n=e.getAllIds():(r=e.getChangedIds().filter((t=>void 0!==e.get(t))),n=e.sources.hot.filter((t=>t.properties.id&&-1===r.indexOf(t.properties.id)&&void 0!==e.get(t.properties.id))).map((e=>e.properties.id))),e.sources.hot=[];const i=e.sources.cold.length;e.sources.cold=e.isDirty?[]:e.sources.cold.filter((e=>{const t=e.properties.id||e.properties.parent;return-1===r.indexOf(t)}));const o=i!==e.sources.cold.length||n.length>0;function a(r,n){const i=e.get(r).internal(t);e.ctx.events.currentModeRender(i,(r=>{r.properties.mode=t,e.sources[n].push(r)}))}function s(){e.isDirty=!1,e.clearChangedIds()}r.forEach((e=>a(e,"hot"))),n.forEach((e=>a(e,"cold"))),o&&e.ctx.map.getSource(KA.COLD).setData({type:eC.FEATURE_COLLECTION,features:e.sources.cold}),e.ctx.map.getSource(KA.HOT).setData({type:eC.FEATURE_COLLECTION,features:e.sources.hot}),s()}function yR(e){let t;this._features={},this._featureIds=new zC,this._selectedFeatureIds=new zC,this._selectedCoordinates=[],this._changedFeatureIds=new zC,this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=e,this.sources={hot:[],cold:[]},this.render=()=>{t||(t=requestAnimationFrame((()=>{t=null,mR.call(this),this._emitSelectionChange&&(this.ctx.events.fire(rC.SELECTION_CHANGE,{features:this.getSelected().map((e=>e.toGeoJSON())),points:this.getSelectedCoordinates().map((e=>({type:eC.FEATURE,properties:{},geometry:{type:eC.POINT,coordinates:e.coordinates}})))}),this._emitSelectionChange=!1),this.ctx.events.fire(rC.RENDER,{})})))},this.isDirty=!1}function _R(e,t={}){const r=e._selectedCoordinates.filter((t=>e._selectedFeatureIds.has(t.feature_id)));e._selectedCoordinates.length===r.length||t.silent||(e._emitSelectionChange=!0),e._selectedCoordinates=r}yR.prototype.createRenderBatch=function(){const e=this.render;let t=0;return this.render=function(){t++},()=>{this.render=e,t>0&&this.render()}},yR.prototype.setDirty=function(){return this.isDirty=!0,this},yR.prototype.featureCreated=function(e,t={}){this._changedFeatureIds.add(e);if(!0!==(null!=t.silent?t.silent:this.ctx.options.suppressAPIEvents)){const t=this.get(e);this.ctx.events.fire(rC.CREATE,{features:[t.toGeoJSON()]})}return this},yR.prototype.featureChanged=function(e,t={}){this._changedFeatureIds.add(e);return!0!==(null!=t.silent?t.silent:this.ctx.options.suppressAPIEvents)&&this.ctx.events.fire(rC.UPDATE,{action:t.action?t.action:nC.CHANGE_COORDINATES,features:[this.get(e).toGeoJSON()]}),this},yR.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},yR.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},yR.prototype.getAllIds=function(){return this._featureIds.values()},yR.prototype.add=function(e,t={}){return this._features[e.id]=e,this._featureIds.add(e.id),this.featureCreated(e.id,{silent:t.silent}),this},yR.prototype.delete=function(e,t={}){const r=[];return gR(e).forEach((e=>{this._featureIds.has(e)&&(this._featureIds.delete(e),this._selectedFeatureIds.delete(e),t.silent||-1===r.indexOf(this._features[e])&&r.push(this._features[e].toGeoJSON()),delete this._features[e],this.isDirty=!0)})),r.length&&this.ctx.events.fire(rC.DELETE,{features:r}),_R(this,t),this},yR.prototype.get=function(e){return this._features[e]},yR.prototype.getAll=function(){return Object.keys(this._features).map((e=>this._features[e]))},yR.prototype.select=function(e,t={}){return gR(e).forEach((e=>{this._selectedFeatureIds.has(e)||(this._selectedFeatureIds.add(e),this._changedFeatureIds.add(e),t.silent||(this._emitSelectionChange=!0))})),this},yR.prototype.deselect=function(e,t={}){return gR(e).forEach((e=>{this._selectedFeatureIds.has(e)&&(this._selectedFeatureIds.delete(e),this._changedFeatureIds.add(e),t.silent||(this._emitSelectionChange=!0))})),_R(this,t),this},yR.prototype.clearSelected=function(e={}){return this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this},yR.prototype.setSelected=function(e,t={}){return e=gR(e),this.deselect(this._selectedFeatureIds.values().filter((t=>-1===e.indexOf(t))),{silent:t.silent}),this.select(e.filter((e=>!this._selectedFeatureIds.has(e))),{silent:t.silent}),this},yR.prototype.setSelectedCoordinates=function(e){return this._selectedCoordinates=e,this._emitSelectionChange=!0,this},yR.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},yR.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},yR.prototype.getSelected=function(){return this.getSelectedIds().map((e=>this.get(e)))},yR.prototype.getSelectedCoordinates=function(){return this._selectedCoordinates.map((e=>({coordinates:this.get(e.feature_id).getCoordinate(e.coord_path)})))},yR.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)},yR.prototype.setFeatureProperty=function(e,t,r,n={}){this.get(e).setProperty(t,r),this.featureChanged(e,{silent:n.silent,action:nC.CHANGE_PROPERTIES})},yR.prototype.storeMapConfig=function(){aC.forEach((e=>{this.ctx.map[e]&&(this._mapInitialConfig[e]=this.ctx.map[e].isEnabled())}))},yR.prototype.restoreMapConfig=function(){Object.keys(this._mapInitialConfig).forEach((e=>{this._mapInitialConfig[e]?this.ctx.map[e].enable():this.ctx.map[e].disable()}))},yR.prototype.getInitialConfigValue=function(e){return void 0===this._mapInitialConfig[e]||this._mapInitialConfig[e]};const vR=["mode","feature","mouse"];function bR(e){let t=null,r=null;const n={onRemove(){return e.map.off("load",n.connect),clearInterval(r),n.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.boxZoomInitial&&e.map.boxZoom.enable(),e.map=null,e.container=null,e.store=null,t&&t.parentNode&&t.parentNode.removeChild(t),t=null,this},connect(){e.map.off("load",n.connect),clearInterval(r),n.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd(i){if(e.map=i,e.events=function(e){const t=Object.keys(e.options.modes).reduce(((t,r)=>(t[r]=pR(e.options.modes[r]),t)),{});let r={},n={};const i={};let o=null,a=null;i.drag=function(t,r){r({point:t.point,time:(new Date).getTime()})?(e.ui.queueMapClasses({mouse:JA.DRAG}),a.drag(t)):t.originalEvent.stopPropagation()},i.mousedrag=function(e){i.drag(e,(e=>!HC(r,e)))},i.touchdrag=function(e){i.drag(e,(e=>!ZC(n,e)))},i.mousemove=function(t){if(1===(void 0!==t.originalEvent.buttons?t.originalEvent.buttons:t.originalEvent.which))return i.mousedrag(t);const r=jC(t,e);t.featureTarget=r,a.mousemove(t)},i.mousedown=function(t){r={time:(new Date).getTime(),point:t.point};const n=jC(t,e);t.featureTarget=n,a.mousedown(t)},i.mouseup=function(t){const n=jC(t,e);t.featureTarget=n,HC(r,{point:t.point,time:(new Date).getTime()})?a.click(t):a.mouseup(t)},i.mouseout=function(e){a.mouseout(e)},i.touchstart=function(t){if(!e.options.touchEnabled)return;n={time:(new Date).getTime(),point:t.point};const r=NC.touch(t,null,e)[0];t.featureTarget=r,a.touchstart(t)},i.touchmove=function(t){if(e.options.touchEnabled)return a.touchmove(t),i.touchdrag(t)},i.touchend=function(t){if(t.originalEvent.preventDefault(),!e.options.touchEnabled)return;const r=NC.touch(t,null,e)[0];t.featureTarget=r,ZC(n,{time:(new Date).getTime(),point:t.point})?a.tap(t):a.touchend(t)};const s=e=>{const t=SC(e),r=kC(e),n=EC(e);return!(t||r||n)};function l(r,n,i={}){a.stop();const s=t[r];if(void 0===s)throw new Error(`${r} is not valid`);o=r;const l=s(e,n);a=YC(l,e),i.silent||e.map.fire(rC.MODE_CHANGE,{mode:r}),e.store.setDirty(),e.store.render()}i.keydown=function(t){(t.srcElement||t.target).classList.contains(XA.CANVAS)&&((SC(t)||kC(t))&&e.options.controls.trash?(t.preventDefault(),a.trash()):s(t)?a.keydown(t):TC(t)&&e.options.controls.point?l(tC.DRAW_POINT):IC(t)&&e.options.controls.line_string?l(tC.DRAW_LINE_STRING):MC(t)&&e.options.controls.polygon&&l(tC.DRAW_POLYGON))},i.keyup=function(e){s(e)&&a.keyup(e)},i.zoomend=function(){e.store.changeZoom()},i.data=function(t){if("style"===t.dataType){const{setup:t,map:r,options:n,store:i}=e;n.styles.some((e=>r.getLayer(e.id)))||(t.addLayers(),i.setDirty(),i.render())}};const c={trash:!1,combineFeatures:!1,uncombineFeatures:!1},u={start(){o=e.options.defaultMode,a=YC(t[o](e),e)},changeMode:l,actionable:function(t){let r=!1;Object.keys(t).forEach((e=>{if(void 0===c[e])throw new Error("Invalid action type");c[e]!==t[e]&&(r=!0),c[e]=t[e]})),r&&e.map.fire(rC.ACTIONABLE,{actions:c})},currentModeName:()=>o,currentModeRender:(e,t)=>a.render(e,t),fire(t,r){e.map&&e.map.fire(t,r)},addEventListeners(){e.map.on("mousemove",i.mousemove),e.map.on("mousedown",i.mousedown),e.map.on("mouseup",i.mouseup),e.map.on("data",i.data),e.map.on("touchmove",i.touchmove),e.map.on("touchstart",i.touchstart),e.map.on("touchend",i.touchend),e.container.addEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",i.keydown),e.container.addEventListener("keyup",i.keyup))},removeEventListeners(){e.map.off("mousemove",i.mousemove),e.map.off("mousedown",i.mousedown),e.map.off("mouseup",i.mouseup),e.map.off("data",i.data),e.map.off("touchmove",i.touchmove),e.map.off("touchstart",i.touchstart),e.map.off("touchend",i.touchend),e.container.removeEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",i.keydown),e.container.removeEventListener("keyup",i.keyup))},trash(e){a.trash(e)},combineFeatures(){a.combineFeatures()},uncombineFeatures(){a.uncombineFeatures()},getMode:()=>o};return u}(e),e.ui=function(e){const t={};let r=null,n={mode:null,feature:null,mouse:null},i={mode:null,feature:null,mouse:null};function o(e){i=Object.assign(i,e)}function a(){if(!e.container)return;const t=[],r=[];vR.forEach((e=>{i[e]!==n[e]&&(t.push(`${e}-${n[e]}`),null!==i[e]&&r.push(`${e}-${i[e]}`))})),t.length>0&&e.container.classList.remove(...t),r.length>0&&e.container.classList.add(...r),n=Object.assign(n,i)}function s(e,t={}){const n=document.createElement("button");return n.className=`${XA.CONTROL_BUTTON} ${t.className}`,n.setAttribute("title",t.title),t.container.appendChild(n),n.addEventListener("click",(n=>{if(n.preventDefault(),n.stopPropagation(),n.target===r)return l(),void t.onDeactivate();c(e),t.onActivate()}),!0),n}function l(){r&&(r.classList.remove(XA.ACTIVE_BUTTON),r=null)}function c(e){l();const n=t[e];n&&n&&"trash"!==e&&(n.classList.add(XA.ACTIVE_BUTTON),r=n)}return{setActiveButton:c,queueMapClasses:o,updateMapClasses:a,clearMapClasses:function(){o({mode:null,feature:null,mouse:null}),a()},addButtons:function(){const r=e.options.controls,n=document.createElement("div");return n.className=`${XA.CONTROL_GROUP} ${XA.CONTROL_BASE}`,r?(r[QA.POINT]&&(t[QA.POINT]=s(QA.POINT,{container:n,className:XA.CONTROL_BUTTON_POINT,title:"Marker tool "+(e.options.keybindings?"(1)":""),onActivate:()=>e.events.changeMode(tC.DRAW_POINT),onDeactivate:()=>e.events.trash()})),r[QA.LINE]&&(t[QA.LINE]=s(QA.LINE,{container:n,className:XA.CONTROL_BUTTON_LINE,title:"LineString tool "+(e.options.keybindings?"(2)":""),onActivate:()=>e.events.changeMode(tC.DRAW_LINE_STRING),onDeactivate:()=>e.events.trash()})),r[QA.POLYGON]&&(t[QA.POLYGON]=s(QA.POLYGON,{container:n,className:XA.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(e.options.keybindings?"(3)":""),onActivate:()=>e.events.changeMode(tC.DRAW_POLYGON),onDeactivate:()=>e.events.trash()})),r.trash&&(t.trash=s("trash",{container:n,className:XA.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:()=>{e.events.trash()}})),r.combine_features&&(t.combine_features=s("combineFeatures",{container:n,className:XA.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:()=>{e.events.combineFeatures()}})),r.uncombine_features&&(t.uncombine_features=s("uncombineFeatures",{container:n,className:XA.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:()=>{e.events.uncombineFeatures()}})),n):n},removeButtons:function(){Object.keys(t).forEach((e=>{const r=t[e];r.parentNode&&r.parentNode.removeChild(r),delete t[e]}))}}}(e),e.container=i.getContainer(),e.store=new yR(e),t=e.ui.addButtons(),e.options.boxSelect){e.boxZoomInitial=i.boxZoom.isEnabled(),i.boxZoom.disable();const t=i.dragPan.isEnabled();i.dragPan.disable(),i.dragPan.enable(),t||i.dragPan.disable()}return i.loaded()?n.connect():(i.on("load",n.connect),r=setInterval((()=>{i.loaded()&&n.connect()}),16)),e.events.start(),t},addLayers(){e.map.addSource(KA.COLD,{data:{type:eC.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.map.addSource(KA.HOT,{data:{type:eC.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.options.styles.forEach((t=>{e.map.addLayer(t)})),e.store.setDirty(!0),e.store.render()},removeLayers(){e.options.styles.forEach((t=>{e.map.getLayer(t.id)&&e.map.removeLayer(t.id)})),e.map.getSource(KA.COLD)&&e.map.removeSource(KA.COLD),e.map.getSource(KA.HOT)&&e.map.removeSource(KA.HOT)}};return e.setup=n,n}const xR="#3bb2d0",wR="#fbb03b",SR="#fff",kR=[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":["case",["==",["get","active"],"true"],wR,xR],"fill-opacity":.1}},{id:"gl-draw-lines",type:"line",filter:["any",["==","$type","LineString"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["==",["get","active"],"true"],wR,xR],"line-dasharray":["case",["==",["get","active"],"true"],[.2,2],[2,0]],"line-width":2}},{id:"gl-draw-point-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":SR}},{id:"gl-draw-point-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":["case",["==",["get","active"],"true"],wR,xR]}},{id:"gl-draw-vertex-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":SR}},{id:"gl-draw-vertex-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":wR}},{id:"gl-draw-midpoint",type:"circle",filter:["all",["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":wR}}];function TR(e,t){this.x=e,this.y=t}TR.prototype={clone(){return new TR(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround(e,t){const r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),o=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:TR},TR.convert=function(e){if(e instanceof TR)return e;if(Array.isArray(e))return new TR(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new TR(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const IR=function(e,t){const r=t.getBoundingClientRect();return new TR(e.clientX-r.left-(t.clientLeft||0),e.clientY-r.top-(t.clientTop||0))};function MR(e,t,r,n){return{type:eC.FEATURE,properties:{meta:iC.VERTEX,parent:e,coord_path:r,active:n?oC.ACTIVE:oC.INACTIVE},geometry:{type:eC.POINT,coordinates:t}}}function ER(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return PR(e);case"FeatureCollection":return function(e){const t={type:"FeatureCollection"};return Object.keys(e).forEach((r=>{switch(r){case"type":case"features":return;default:t[r]=e[r]}})),t.features=e.features.map((e=>PR(e))),t}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return CR(e);default:throw new Error("unknown GeoJSON type")}}function PR(e){const t={type:"Feature"};return Object.keys(e).forEach((r=>{switch(r){case"type":case"properties":case"geometry":return;default:t[r]=e[r]}})),t.properties=AR(e.properties),null==e.geometry?t.geometry=null:t.geometry=CR(e.geometry),t}function AR(e){const t={};return e?(Object.keys(e).forEach((r=>{const n=e[r];"object"==typeof n?null===n?t[r]=null:Array.isArray(n)?t[r]=n.map((e=>e)):t[r]=AR(n):t[r]=n})),t):t}function CR(e){const t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?(t.geometries=e.geometries.map((e=>CR(e))),t):(t.coordinates=RR(e.coordinates),t)}function RR(e){const t=e;return"object"!=typeof t[0]?t.slice():t.map((e=>RR(e)))}function LR(e,t={}){return OR(e,"mercator",t)}function OR(e,t,r={}){var n=(r=r||{}).mutate;if(!e)throw new Error("geojson is required");return Array.isArray(e)&&Qw(e[0])?e="mercator"===t?DR(e):zR(e):(!0!==n&&(e=ER(e)),eS(e,(function(e){var r="mercator"===t?DR(e):zR(e);e[0]=r[0],e[1]=r[1]}))),e}function DR(e){var t,r=Math.PI/180,n=6378137,i=20037508.342789244,o=[n*(Math.abs(e[0])<=180?e[0]:e[0]-360*((t=e[0])<0?-1:t>0?1:0))*r,n*Math.log(Math.tan(.25*Math.PI+.5*e[1]*r))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function zR(e){var t=180/Math.PI,r=6378137;return[e[0]*t/r,(.5*Math.PI-2*Math.atan(Math.exp(-e[1]/r)))*t]}function FR(e,t,r){const n=t.geometry.coordinates,i=r.geometry.coordinates;if(n[1]>uC||n[1]<lC||i[1]>uC||i[1]<lC)return null;const o=LR(n),a=LR(i),s=e=>Number(e.toFixed(8)),l=(e,t)=>(e+t)/2,c=function(e,t={}){return OR(e,"wgs84",t)}([l(o[0],a[0]),l(o[1],a[1])]),u=[s(c[0]),s(c[1])];return{type:eC.FEATURE,properties:{meta:iC.MIDPOINT,parent:e,lng:u[0],lat:u[1],coord_path:r.properties.coord_path},geometry:{type:eC.POINT,coordinates:u}}}const NR=function e(t,r={},n=null){const{type:i,coordinates:o}=t.geometry,a=t.properties&&t.properties.id;let s=[];function l(e,t){let n="",i=null;e.forEach(((e,o)=>{const l=null!=t?`${t}.${o}`:String(o),u=MR(a,e,l,c(l));if(r.midpoints&&i){const e=FR(a,i,u);e&&s.push(e)}i=u;const d=JSON.stringify(e);n!==d&&s.push(u),0===o&&(n=d)}))}function c(e){return!!r.selectedPaths&&-1!==r.selectedPaths.indexOf(e)}return i===eC.POINT?s.push(MR(a,o,n,c(n))):i===eC.POLYGON?o.forEach(((e,t)=>{l(e,null!==n?`${n}.${t}`:String(t))})):i===eC.LINE_STRING?l(o,n):0===i.indexOf(eC.MULTI_PREFIX)&&function(){const n=i.replace(eC.MULTI_PREFIX,"");o.forEach(((i,o)=>{const a={type:eC.FEATURE,properties:t.properties,geometry:{type:n,coordinates:i}};s=s.concat(e(a,r,o))}))}(),s},BR={enable(e){setTimeout((()=>{e.map&&e.map.doubleClickZoom&&e._ctx&&e._ctx.store&&e._ctx.store.getInitialConfigValue&&e._ctx.store.getInitialConfigValue("doubleClickZoom")&&e.map.doubleClickZoom.enable()}),0)},disable(e){setTimeout((()=>{e.map&&e.map.doubleClickZoom&&e.map.doubleClickZoom.disable()}),0)}},{LAT_MIN:jR,LAT_MAX:VR,LAT_RENDERED_MIN:GR,LAT_RENDERED_MAX:UR,LNG_MIN:$R,LNG_MAX:HR}=e;function qR(e,t){let r=jR,n=VR,i=jR,o=VR,a=HR,s=$R;e.forEach((e=>{const t=function(e){const t={Point:0,LineString:1,Polygon:2,MultiPoint:1,MultiLineString:2,MultiPolygon:3}[e.geometry.type],r=[e.geometry.coordinates].flat(t),n=r.map((e=>e[0])),i=r.map((e=>e[1])),o=e=>Math.min.apply(null,e),a=e=>Math.max.apply(null,e);return[o(n),o(i),a(n),a(i)]}(e),l=t[1],c=t[3],u=t[0],d=t[2];l>r&&(r=l),c<n&&(n=c),c>i&&(i=c),l<o&&(o=l),u<a&&(a=u),d>s&&(s=d)}));const l=t;return r+l.lat>UR&&(l.lat=UR-r),i+l.lat>VR&&(l.lat=VR-i),n+l.lat<GR&&(l.lat=GR-n),o+l.lat<jR&&(l.lat=jR-o),a+l.lng<=$R&&(l.lng+=360*Math.ceil(Math.abs(l.lng)/360)),s+l.lng>=HR&&(l.lng-=360*Math.ceil(Math.abs(l.lng)/360)),l}function WR(e,t){const r=qR(e.map((e=>e.toGeoJSON())),t);e.forEach((e=>{const t=e.getCoordinates(),n=e=>{const t={lng:e[0]+r.lng,lat:e[1]+r.lat};return[t.lng,t.lat]},i=e=>e.map((e=>n(e))),o=e=>e.map((e=>i(e)));let a;e.type===eC.POINT?a=n(t):e.type===eC.LINE_STRING||e.type===eC.MULTI_POINT?a=t.map(n):e.type===eC.POLYGON||e.type===eC.MULTI_LINE_STRING?a=t.map(i):e.type===eC.MULTI_POLYGON&&(a=t.map(o)),e.incomingCoords(a)}))}const ZR={onSetup:function(e){const t={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initialDragPanState:this.map.dragPan.isEnabled(),initiallySelectedFeatureIds:e.featureIds||[]};return this.setSelected(t.initiallySelectedFeatureIds.filter((e=>void 0!==this.getFeature(e)))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),t},fireUpdate:function(){this.fire(rC.UPDATE,{action:nC.MOVE,features:this.getSelected().map((e=>e.toGeoJSON()))})},fireActionable:function(){const e=this.getSelected(),t=e.filter((e=>this.isInstanceOf("MultiFeature",e)));let r=!1;if(e.length>1){r=!0;const t=e[0].type.replace("Multi","");e.forEach((e=>{e.type.replace("Multi","")!==t&&(r=!1)}))}const n=t.length>0,i=e.length>0;this.setActionableState({combineFeatures:r,uncombineFeatures:n,trash:i})},getUniqueIds:function(e){if(!e.length)return[];return e.map((e=>e.properties.id)).filter((e=>void 0!==e)).reduce(((e,t)=>(e.add(t),e)),new zC).values()},stopExtendedInteractions:function(e){e.boxSelectElement&&(e.boxSelectElement.parentNode&&e.boxSelectElement.parentNode.removeChild(e.boxSelectElement),e.boxSelectElement=null),(e.canDragMove||e.canBoxSelect)&&!0===e.initialDragPanState&&this.map.dragPan.enable(),e.boxSelecting=!1,e.canBoxSelect=!1,e.dragMoving=!1,e.canDragMove=!1},onStop:function(){BR.enable(this)},onMouseMove:function(e,t){return _C(t)&&e.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(e),!0},onMouseOut:function(e){return!e.dragMoving||this.fireUpdate()}};ZR.onTap=ZR.onClick=function(e,t){return yC(t)?this.clickAnywhere(e,t):fC(iC.VERTEX)(t)?this.clickOnVertex(e,t):_C(t)?this.clickOnFeature(e,t):void 0},ZR.clickAnywhere=function(e){const t=this.getSelectedIds();t.length&&(this.clearSelectedFeatures(),t.forEach((e=>this.doRender(e)))),BR.enable(this),this.stopExtendedInteractions(e)},ZR.clickOnVertex=function(e,t){this.changeMode(tC.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat}),this.updateUIClasses({mouse:JA.MOVE})},ZR.startOnActiveFeature=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),this.doRender(t.featureTarget.properties.id),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},ZR.clickOnFeature=function(e,t){BR.disable(this),this.stopExtendedInteractions(e);const r=bC(t),n=this.getSelectedIds(),i=t.featureTarget.properties.id,o=this.isSelected(i);if(!r&&o&&this.getFeature(i).type!==eC.POINT)return this.changeMode(tC.DIRECT_SELECT,{featureId:i});o&&r?(this.deselect(i),this.updateUIClasses({mouse:JA.POINTER}),1===n.length&&BR.enable(this)):!o&&r?(this.select(i),this.updateUIClasses({mouse:JA.MOVE})):o||r||(n.forEach((e=>this.doRender(e))),this.setSelected(i),this.updateUIClasses({mouse:JA.MOVE})),this.doRender(i)},ZR.onMouseDown=function(e,t){return e.initialDragPanState=this.map.dragPan.isEnabled(),gC(t)?this.startOnActiveFeature(e,t):this.drawConfig.boxSelect&&pC(t)?this.startBoxSelect(e,t):void 0},ZR.startBoxSelect=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),e.boxSelectStartLocation=IR(t.originalEvent,this.map.getContainer()),e.canBoxSelect=!0},ZR.onTouchStart=function(e,t){if(gC(t))return this.startOnActiveFeature(e,t)},ZR.onDrag=function(e,t){return e.canDragMove?this.dragMove(e,t):this.drawConfig.boxSelect&&e.canBoxSelect?this.whileBoxSelect(e,t):void 0},ZR.whileBoxSelect=function(e,t){e.boxSelecting=!0,this.updateUIClasses({mouse:JA.ADD}),e.boxSelectElement||(e.boxSelectElement=document.createElement("div"),e.boxSelectElement.classList.add(XA.BOX_SELECT),this.map.getContainer().appendChild(e.boxSelectElement));const r=IR(t.originalEvent,this.map.getContainer()),n=Math.min(e.boxSelectStartLocation.x,r.x),i=Math.max(e.boxSelectStartLocation.x,r.x),o=Math.min(e.boxSelectStartLocation.y,r.y),a=Math.max(e.boxSelectStartLocation.y,r.y),s=`translate(${n}px, ${o}px)`;e.boxSelectElement.style.transform=s,e.boxSelectElement.style.WebkitTransform=s,e.boxSelectElement.style.width=i-n+"px",e.boxSelectElement.style.height=a-o+"px"},ZR.dragMove=function(e,t){e.dragMoving=!0,t.originalEvent.stopPropagation();const r={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};WR(this.getSelected(),r),e.dragMoveLocation=t.lngLat},ZR.onTouchEnd=ZR.onMouseUp=function(e,t){if(e.dragMoving)this.fireUpdate();else if(e.boxSelecting){const r=[e.boxSelectStartLocation,IR(t.originalEvent,this.map.getContainer())],n=this.featuresAt(null,r,"click"),i=this.getUniqueIds(n).filter((e=>!this.isSelected(e)));i.length&&(this.select(i),i.forEach((e=>this.doRender(e))),this.updateUIClasses({mouse:JA.MOVE}))}this.stopExtendedInteractions(e)},ZR.toDisplayFeatures=function(e,t,r){t.properties.active=this.isSelected(t.properties.id)?oC.ACTIVE:oC.INACTIVE,r(t),this.fireActionable(),t.properties.active===oC.ACTIVE&&t.geometry.type!==eC.POINT&&NR(t).forEach(r)},ZR.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},ZR.onCombineFeatures=function(){const e=this.getSelected();if(0===e.length||e.length<2)return;const t=[],r=[],n=e[0].type.replace("Multi","");for(let i=0;i<e.length;i++){const o=e[i];if(o.type.replace("Multi","")!==n)return;o.type.includes("Multi")?o.getCoordinates().forEach((e=>{t.push(e)})):t.push(o.getCoordinates()),r.push(o.toGeoJSON())}if(r.length>1){const e=this.newFeature({type:eC.FEATURE,properties:r[0].properties,geometry:{type:`Multi${n}`,coordinates:t}});this.addFeature(e),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([e.id]),this.fire(rC.COMBINE_FEATURES,{createdFeatures:[e.toGeoJSON()],deletedFeatures:r})}this.fireActionable()},ZR.onUncombineFeatures=function(){const e=this.getSelected();if(0===e.length)return;const t=[],r=[];for(let n=0;n<e.length;n++){const i=e[n];this.isInstanceOf("MultiFeature",i)&&(i.getFeatures().forEach((e=>{this.addFeature(e),e.properties=i.properties,t.push(e.toGeoJSON()),this.select([e.id])})),this.deleteFeature(i.id,{silent:!0}),r.push(i.toGeoJSON()))}t.length>1&&this.fire(rC.UNCOMBINE_FEATURES,{createdFeatures:t,deletedFeatures:r}),this.fireActionable()};const YR=ZR,XR=fC(iC.VERTEX),KR=fC(iC.MIDPOINT),JR={fireUpdate:function(){this.fire(rC.UPDATE,{action:nC.CHANGE_COORDINATES,features:this.getSelected().map((e=>e.toGeoJSON()))})},fireActionable:function(e){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:e.selectedCoordPaths.length>0})},startDragging:function(e,t){null==e.initialDragPanState&&(e.initialDragPanState=this.map.dragPan.isEnabled()),this.map.dragPan.disable(),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},stopDragging:function(e){e.canDragMove&&!0===e.initialDragPanState&&this.map.dragPan.enable(),e.initialDragPanState=null,e.dragMoving=!1,e.canDragMove=!1,e.dragMoveLocation=null},onVertex:function(e,t){this.startDragging(e,t);const r=t.featureTarget.properties,n=e.selectedCoordPaths.indexOf(r.coord_path);bC(t)||-1!==n?bC(t)&&-1===n&&e.selectedCoordPaths.push(r.coord_path):e.selectedCoordPaths=[r.coord_path];const i=this.pathsToCoordinates(e.featureId,e.selectedCoordPaths);this.setSelectedCoordinates(i)},onMidpoint:function(e,t){this.startDragging(e,t);const r=t.featureTarget.properties;e.feature.addCoordinate(r.coord_path,r.lng,r.lat),this.fireUpdate(),e.selectedCoordPaths=[r.coord_path]},pathsToCoordinates:function(e,t){return t.map((t=>({feature_id:e,coord_path:t})))},onFeature:function(e,t){0===e.selectedCoordPaths.length?this.startDragging(e,t):this.stopDragging(e)},dragFeature:function(e,t,r){WR(this.getSelected(),r),e.dragMoveLocation=t.lngLat},dragVertex:function(e,t,r){const n=e.selectedCoordPaths.map((t=>e.feature.getCoordinate(t))),i=qR(n.map((e=>({type:eC.FEATURE,properties:{},geometry:{type:eC.POINT,coordinates:e}}))),r);for(let t=0;t<n.length;t++){const r=n[t];e.feature.updateCoordinate(e.selectedCoordPaths[t],r[0]+i.lng,r[1]+i.lat)}},clickNoTarget:function(){this.changeMode(tC.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(tC.SIMPLE_SELECT)},clickActiveFeature:function(e){e.selectedCoordPaths=[],this.clearSelectedCoordinates(),e.feature.changed()},onSetup:function(e){const t=e.featureId,r=this.getFeature(t);if(!r)throw new Error("You must provide a featureId to enter direct_select mode");if(r.type===eC.POINT)throw new TypeError("direct_select mode doesn't handle point features");const n={featureId:t,feature:r,dragMoveLocation:e.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:e.coordPath?[e.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(t,n.selectedCoordPaths)),this.setSelected(t),BR.disable(this),this.setActionableState({trash:!0}),n},onStop:function(){BR.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(e,t,r){e.featureId===t.properties.id?(t.properties.active=oC.ACTIVE,r(t),NR(t,{map:this.map,midpoints:!0,selectedPaths:e.selectedCoordPaths}).forEach(r)):(t.properties.active=oC.INACTIVE,r(t)),this.fireActionable(e)},onTrash:function(e){e.selectedCoordPaths.sort(((e,t)=>t.localeCompare(e,"en",{numeric:!0}))).forEach((t=>e.feature.removeCoordinate(t))),this.fireUpdate(),e.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(e),!1===e.feature.isValid()&&(this.deleteFeature([e.featureId]),this.changeMode(tC.SIMPLE_SELECT,{}))},onMouseMove:function(e,t){const r=gC(t),n=XR(t),i=KR(t),o=0===e.selectedCoordPaths.length;r&&o||n&&!o?this.updateUIClasses({mouse:JA.MOVE}):this.updateUIClasses({mouse:JA.NONE});return(n||r||i)&&e.dragMoving&&this.fireUpdate(),this.stopDragging(e),!0},onMouseOut:function(e){return e.dragMoving&&this.fireUpdate(),!0}};JR.onTouchStart=JR.onMouseDown=function(e,t){return XR(t)?this.onVertex(e,t):gC(t)?this.onFeature(e,t):KR(t)?this.onMidpoint(e,t):void 0},JR.onDrag=function(e,t){if(!0!==e.canDragMove)return;e.dragMoving=!0,t.originalEvent.stopPropagation();const r={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};e.selectedCoordPaths.length>0?this.dragVertex(e,t,r):this.dragFeature(e,t,r),e.dragMoveLocation=t.lngLat},JR.onClick=function(e,t){return yC(t)?this.clickNoTarget(e,t):gC(t)?this.clickActiveFeature(e,t):mC(t)?this.clickInactive(e,t):void this.stopDragging(e)},JR.onTap=function(e,t){return yC(t)?this.clickNoTarget(e,t):gC(t)?this.clickActiveFeature(e,t):mC(t)?this.clickInactive(e,t):void 0},JR.onTouchEnd=JR.onMouseUp=function(e){e.dragMoving&&this.fireUpdate(),this.stopDragging(e)};const QR=JR,eL={onSetup:function(){const e=this.newFeature({type:eC.FEATURE,properties:{},geometry:{type:eC.POINT,coordinates:[]}});return this.addFeature(e),this.clearSelectedFeatures(),this.updateUIClasses({mouse:JA.ADD}),this.activateUIButton(QA.POINT),this.setActionableState({trash:!0}),{point:e}},stopDrawingAndRemove:function(e){this.deleteFeature([e.point.id],{silent:!0}),this.changeMode(tC.SIMPLE_SELECT)}};eL.onTap=eL.onClick=function(e,t){this.updateUIClasses({mouse:JA.MOVE}),e.point.updateCoordinate("",t.lngLat.lng,t.lngLat.lat),this.fire(rC.CREATE,{features:[e.point.toGeoJSON()]}),this.changeMode(tC.SIMPLE_SELECT,{featureIds:[e.point.id]})},eL.onStop=function(e){this.activateUIButton(),e.point.getCoordinate().length||this.deleteFeature([e.point.id],{silent:!0})},eL.toDisplayFeatures=function(e,t,r){const n=t.properties.id===e.point.id;if(t.properties.active=n?oC.ACTIVE:oC.INACTIVE,!n)return r(t)},eL.onTrash=eL.stopDrawingAndRemove,eL.onKeyUp=function(e,t){if(xC(t)||wC(t))return this.stopDrawingAndRemove(e,t)};const tL=eL;const rL=function(e,t){return!!e.lngLat&&(e.lngLat.lng===t[0]&&e.lngLat.lat===t[1])},nL={onSetup:function(){const e=this.newFeature({type:eC.FEATURE,properties:{},geometry:{type:eC.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),BR.disable(this),this.updateUIClasses({mouse:JA.ADD}),this.activateUIButton(QA.POLYGON),this.setActionableState({trash:!0}),{polygon:e,currentVertexPosition:0}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&rL(t,e.polygon.coordinates[0][e.currentVertexPosition-1]))return this.changeMode(tC.SIMPLE_SELECT,{featureIds:[e.polygon.id]});this.updateUIClasses({mouse:JA.ADD}),e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat),e.currentVertexPosition++,e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(tC.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},onMouseMove:function(e,t){e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat),vC(t)&&this.updateUIClasses({mouse:JA.POINTER})}};nL.onTap=nL.onClick=function(e,t){return vC(t)?this.clickOnVertex(e,t):this.clickAnywhere(e,t)},nL.onKeyUp=function(e,t){xC(t)?(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(tC.SIMPLE_SELECT)):wC(t)&&this.changeMode(tC.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},nL.onStop=function(e){this.updateUIClasses({mouse:JA.NONE}),BR.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.polygon.id)&&(e.polygon.removeCoordinate(`0.${e.currentVertexPosition}`),e.polygon.isValid()?this.fire(rC.CREATE,{features:[e.polygon.toGeoJSON()]}):(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(tC.SIMPLE_SELECT,{},{silent:!0})))},nL.toDisplayFeatures=function(e,t,r){const n=t.properties.id===e.polygon.id;if(t.properties.active=n?oC.ACTIVE:oC.INACTIVE,!n)return r(t);if(0===t.geometry.coordinates.length)return;const i=t.geometry.coordinates[0].length;if(!(i<3)){if(t.properties.meta=iC.FEATURE,r(MR(e.polygon.id,t.geometry.coordinates[0][0],"0.0",!1)),i>3){const n=t.geometry.coordinates[0].length-3;r(MR(e.polygon.id,t.geometry.coordinates[0][n],`0.${n}`,!1))}if(i<=4){const e=[[t.geometry.coordinates[0][0][0],t.geometry.coordinates[0][0][1]],[t.geometry.coordinates[0][1][0],t.geometry.coordinates[0][1][1]]];if(r({type:eC.FEATURE,properties:t.properties,geometry:{coordinates:e,type:eC.LINE_STRING}}),3===i)return}return r(t)}},nL.onTrash=function(e){this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(tC.SIMPLE_SELECT)};const iL=nL,oL={onSetup:function(e){const t=(e=e||{}).featureId;let r,n,i="forward";if(t){if(r=this.getFeature(t),!r)throw new Error("Could not find a feature with the provided featureId");let o=e.from;if(o&&"Feature"===o.type&&o.geometry&&"Point"===o.geometry.type&&(o=o.geometry),o&&"Point"===o.type&&o.coordinates&&2===o.coordinates.length&&(o=o.coordinates),!o||!Array.isArray(o))throw new Error("Please use the `from` property to indicate which point to continue the line from");const a=r.coordinates.length-1;if(r.coordinates[a][0]===o[0]&&r.coordinates[a][1]===o[1])n=a+1,r.addCoordinate(n,...r.coordinates[a]);else{if(r.coordinates[0][0]!==o[0]||r.coordinates[0][1]!==o[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");i="backwards",n=0,r.addCoordinate(n,...r.coordinates[0])}}else r=this.newFeature({type:eC.FEATURE,properties:{},geometry:{type:eC.LINE_STRING,coordinates:[]}}),n=0,this.addFeature(r);return this.clearSelectedFeatures(),BR.disable(this),this.updateUIClasses({mouse:JA.ADD}),this.activateUIButton(QA.LINE),this.setActionableState({trash:!0}),{line:r,currentVertexPosition:n,direction:i}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&rL(t,e.line.coordinates[e.currentVertexPosition-1])||"backwards"===e.direction&&rL(t,e.line.coordinates[e.currentVertexPosition+1]))return this.changeMode(tC.SIMPLE_SELECT,{featureIds:[e.line.id]});this.updateUIClasses({mouse:JA.ADD}),e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),"forward"===e.direction?(e.currentVertexPosition++,e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)):e.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(tC.SIMPLE_SELECT,{featureIds:[e.line.id]})},onMouseMove:function(e,t){e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),vC(t)&&this.updateUIClasses({mouse:JA.POINTER})}};oL.onTap=oL.onClick=function(e,t){if(vC(t))return this.clickOnVertex(e,t);this.clickAnywhere(e,t)},oL.onKeyUp=function(e,t){wC(t)?this.changeMode(tC.SIMPLE_SELECT,{featureIds:[e.line.id]}):xC(t)&&(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(tC.SIMPLE_SELECT))},oL.onStop=function(e){BR.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.line.id)&&(e.line.removeCoordinate(`${e.currentVertexPosition}`),e.line.isValid()?this.fire(rC.CREATE,{features:[e.line.toGeoJSON()]}):(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(tC.SIMPLE_SELECT,{},{silent:!0})))},oL.onTrash=function(e){this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(tC.SIMPLE_SELECT)},oL.toDisplayFeatures=function(e,t,r){const n=t.properties.id===e.line.id;if(t.properties.active=n?oC.ACTIVE:oC.INACTIVE,!n)return r(t);t.geometry.coordinates.length<2||(t.properties.meta=iC.FEATURE,r(MR(e.line.id,t.geometry.coordinates["forward"===e.direction?t.geometry.coordinates.length-2:1],""+("forward"===e.direction?t.geometry.coordinates.length-2:1),!1)),r(t))};const aL={simple_select:YR,direct_select:QR,draw_point:tL,draw_polygon:iL,draw_line_string:oL},sL={defaultMode:tC.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:kR,modes:aL,controls:{},userProperties:!1,suppressAPIEvents:!0},lL={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},cL={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function uL(e,t){return e.map((e=>e.source?e:Object.assign({},e,{id:`${e.id}.${t}`,source:"hot"===t?KA.HOT:KA.COLD})))}var dL=i(2017),hL=i(8186);function fL(e,t){return e.length===t.length&&JSON.stringify(e.map((e=>e)).sort())===JSON.stringify(t.map((e=>e)).sort())}const pL={Polygon:oR,LineString:nR,Point:tR,MultiPolygon:cR,MultiLineString:cR,MultiPoint:cR};const gL=function(e,t){const r={options:e=function(e={}){let t=Object.assign({},e);return e.controls||(t.controls={}),!1===e.displayControlsDefault?t.controls=Object.assign({},cL,e.controls):t.controls=Object.assign({},lL,e.controls),t=Object.assign({},sL,t),t.styles=uL(t.styles,"cold").concat(uL(t.styles,"hot")),t}(e)};t=function(e,t){t.modes=tC;const r=void 0===e.options.suppressAPIEvents||!!e.options.suppressAPIEvents;return t.getFeatureIdsAt=function(t){return NC.click({point:t},null,e).map((e=>e.properties.id))},t.getSelectedIds=function(){return e.store.getSelectedIds()},t.getSelected=function(){return{type:eC.FEATURE_COLLECTION,features:e.store.getSelectedIds().map((t=>e.store.get(t))).map((e=>e.toGeoJSON()))}},t.getSelectedPoints=function(){return{type:eC.FEATURE_COLLECTION,features:e.store.getSelectedCoordinates().map((e=>({type:eC.FEATURE,properties:{},geometry:{type:eC.POINT,coordinates:e.coordinates}})))}},t.set=function(r){if(void 0===r.type||r.type!==eC.FEATURE_COLLECTION||!Array.isArray(r.features))throw new Error("Invalid FeatureCollection");const n=e.store.createRenderBatch();let i=e.store.getAllIds().slice();const o=t.add(r),a=new zC(o);return i=i.filter((e=>!a.has(e))),i.length&&t.delete(i),n(),o},t.add=function(t){const n=JSON.parse(JSON.stringify(hL(t))).features.map((t=>{if(t.id=t.id||KC(),null===t.geometry)throw new Error("Invalid geometry: null");if(void 0===e.store.get(t.id)||e.store.get(t.id).type!==t.geometry.type){const n=pL[t.geometry.type];if(void 0===n)throw new Error(`Invalid geometry type: ${t.geometry.type}.`);const i=new n(e,t);e.store.add(i,{silent:r})}else{const n=e.store.get(t.id),i=n.properties;n.properties=t.properties,dL(i,t.properties)||e.store.featureChanged(n.id,{silent:r}),dL(n.getCoordinates(),t.geometry.coordinates)||n.incomingCoords(t.geometry.coordinates)}return t.id}));return e.store.render(),n},t.get=function(t){const r=e.store.get(t);if(r)return r.toGeoJSON()},t.getAll=function(){return{type:eC.FEATURE_COLLECTION,features:e.store.getAll().map((e=>e.toGeoJSON()))}},t.delete=function(n){return e.store.delete(n,{silent:r}),t.getMode()!==tC.DIRECT_SELECT||e.store.getSelectedIds().length?e.store.render():e.events.changeMode(tC.SIMPLE_SELECT,void 0,{silent:r}),t},t.deleteAll=function(){return e.store.delete(e.store.getAllIds(),{silent:r}),t.getMode()===tC.DIRECT_SELECT?e.events.changeMode(tC.SIMPLE_SELECT,void 0,{silent:r}):e.store.render(),t},t.changeMode=function(n,i={}){return n===tC.SIMPLE_SELECT&&t.getMode()===tC.SIMPLE_SELECT?(fL(i.featureIds||[],e.store.getSelectedIds())||
31(e.store.setSelected(i.featureIds,{silent:r}),e.store.render()),t):(n===tC.DIRECT_SELECT&&t.getMode()===tC.DIRECT_SELECT&&i.featureId===e.store.getSelectedIds()[0]||e.events.changeMode(n,i,{silent:r}),t)},t.getMode=function(){return e.events.getMode()},t.trash=function(){return e.events.trash({silent:r}),t},t.combineFeatures=function(){return e.events.combineFeatures({silent:r}),t},t.uncombineFeatures=function(){return e.events.uncombineFeatures({silent:r}),t},t.setFeatureProperty=function(n,i,o){return e.store.setFeatureProperty(n,i,o,{silent:r}),t},t}(r,t),r.api=t;const n=bR(r);return t.onAdd=n.onAdd,t.onRemove=n.onRemove,t.types=QA,t.options=e,t};function mL(e){gL(e,this)}mL.modes=aL,mL.constants=e,mL.lib=r;const yL=mL;function _L(e){return _L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_L(e)}function vL(e,t,r){return t=kL(t),function(e,t){if(t&&("object"==_L(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wL()?Reflect.construct(t,r||[],kL(e).constructor):t.apply(e,r))}function bL(e,t){if("function"!=typeof t&&null!==t)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&&SL(e,t)}function xL(e){var t="function"==typeof Map?new Map:void 0;return xL=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(wL())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&SL(i,r.prototype),i}(e,arguments,kL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),SL(r,e)},xL(e)}function wL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wL=function(){return!!e})()}function SL(e,t){return SL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SL(e,t)}function kL(e){return kL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kL(e)}function TL(e){return function(e){if(Array.isArray(e))return AL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||PL(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ML(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?IL(Object(r),!0).forEach((function(t){CL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function EL(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=PL(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function PL(e,t){if(e){if("string"==typeof e)return AL(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?AL(e,t):void 0}}function AL(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function CL(e,t,r){return(t=NL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RL(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */RL=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 31
31if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==_L(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(_L(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
31if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function LL(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function OL(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){LL(o,n,i,a,s,"next",e)}function s(e){LL(o,n,i,a,s,"throw",e)}a(void 0)}))}}function DL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,NL(n.key),n)}}function FL(e,t,r){return t&&zL(e.prototype,t),r&&zL(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function NL(e){var t=function(e,t){if("object"!=_L(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_L(t)?t:t+""}var BL="http://localhost".replace(/\/+$/,""),jL=function(){return FL((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};DL(this,e),this.configuration=t}),[{key:"config",set:function(e){this.configuration=e}},{key:"basePath",get:function(){return null!=this.configuration.basePath?this.configuration.basePath:BL}},{key:"fetchApi",get:function(){return this.configuration.fetchApi}},{key:"middleware",get:function(){return this.configuration.middleware||[]}},{key:"queryParamsStringify",get:function(){return this.configuration.queryParamsStringify||WL}},{key:"username",get:function(){return this.configuration.username}},{key:"password",get:function(){return this.configuration.password}},{key:"apiKey",get:function(){var e=this.configuration.apiKey;if(e)return"function"==typeof e?e:function(){return e}}},{key:"accessToken",get:function(){var e=this.configuration.accessToken;if(e)return"function"==typeof e?e:OL(RL().mark((function t(){return RL().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e);case 1:case"end":return t.stop()}}),t)})))}},{key:"headers",get:function(){return this.configuration.headers}},{key:"credentials",get:function(){return this.configuration.credentials}}])}(),VL=new jL,GL=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:VL;DL(this,e),CL(this,"fetchApi",function(){var e=OL(RL().mark((function e(r,n){var i,o,a,s,l,c,u,d,h,f,p;return RL().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i={url:r,init:n},o=EL(t.middleware),e.prev=2,o.s();case 4:if((a=o.n()).done){e.next=15;break}if(!(s=a.value).pre){e.next=13;break}return e.next=9,s.pre(ML({fetch:t.fetchApi},i));case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0=i;case 12:i=e.t0;case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),o.e(e.t1);case 20:return e.prev=20,o.f(),e.finish(20);case 23:return l=void 0,e.prev=24,e.next=27,(t.configuration.fetchApi||fetch)(i.url,i.init);case 27:l=e.sent,e.next=60;break;case 30:e.prev=30,e.t2=e.catch(24),c=EL(t.middleware),e.prev=33,c.s();case 35:if((u=c.n()).done){e.next=46;break}if(!(d=u.value).onError){e.next=44;break}return e.next=40,d.onError({fetch:t.fetchApi,url:i.url,init:i.init,error:e.t2,response:l?l.clone():void 0});case 40:if(e.t3=e.sent,e.t3){e.next=43;break}e.t3=l;case 43:l=e.t3;case 44:e.next=35;break;case 46:e.next=51;break;case 48:e.prev=48,e.t4=e.catch(33),c.e(e.t4);case 51:return e.prev=51,c.f(),e.finish(51);case 54:if(void 0!==l){e.next=60;break}if(!(e.t2 instanceof Error)){e.next=59;break}throw new HL(e.t2,"The request failed and the interceptors did not return an alternative response");case 59:throw e.t2;case 60:h=EL(t.middleware),e.prev=61,h.s();case 63:if((f=h.n()).done){e.next=74;break}if(!(p=f.value).post){e.next=72;break}return e.next=68,p.post({fetch:t.fetchApi,url:i.url,init:i.init,response:l.clone()});case 68:if(e.t5=e.sent,e.t5){e.next=71;break}e.t5=l;case 71:l=e.t5;case 72:e.next=63;break;case 74:e.next=79;break;case 76:e.prev=76,e.t6=e.catch(61),h.e(e.t6);case 79:return e.prev=79,h.f(),e.finish(79);case 82:return e.abrupt("return",l);case 83:case"end":return e.stop()}}),e,null,[[2,17,20,23],[24,30],[33,48,51,54],[61,76,79,82]])})));return function(t,r){return e.apply(this,arguments)}}()),this.configuration=r,this.middleware=r.middleware}return FL(e,[{key:"withMiddleware",value:function(){var e,t=this.clone();return t.middleware=(e=t.middleware).concat.apply(e,arguments),t}},{key:"withPreMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{pre:e}}));return this.withMiddleware.apply(this,TL(n))}},{key:"withPostMiddleware",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map((function(e){return{post:e}}));return this.withMiddleware.apply(this,TL(n))}},{key:"isJsonMime",value:function(t){return!!t&&e.jsonRegex.test(t)}},{key:"request",value:(r=OL(RL().mark((function e(t,r){var n,i,o,a;return RL().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createFetchParams(t,r);case 2:return n=e.sent,i=n.url,o=n.init,e.next=7,this.fetchApi(i,o);case 7:if(!((a=e.sent)&&a.status>=200&&a.status<300)){e.next=10;break}return e.abrupt("return",a);case 10:throw new $L(a,"Response returned an error code");case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"createFetchParams",value:(t=OL(RL().mark((function e(t,r){var n,i,o,a,s,l,c;return RL().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.configuration.basePath+t.path,void 0!==t.query&&0!==Object.keys(t.query).length&&(n+="?"+this.configuration.queryParamsStringify(t.query)),i=Object.assign({}
31,this.configuration.headers,t.headers),Object.keys(i).forEach((function(e){return void 0===i[e]?delete i[e]:{}})),o="function"==typeof r?r:OL(RL().mark((function e(){return RL().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}}),e)}))),a={method:t.method,headers:i,body:t.body,credentials:this.configuration.credentials},e.t0=ML,e.t1=ML({},a),e.next=10,o({init:a,context:t});case 10:return e.t2=e.sent,s=(0,e.t0)(e.t1,e.t2),u=s.body,l="undefined"!=typeof FormData&&u instanceof FormData||s.body instanceof URLSearchParams||UL(s.body)?s.body:this.isJsonMime(i["Content-Type"])?JSON.stringify(s.body):s.body,c=ML(ML({},s),{},{body:l}),e.abrupt("return",{url:n,init:c});case 15:case"end":return e.stop()}var u}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"clone",value:function(){var e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}]);var t,r}();function UL(e){return"undefined"!=typeof Blob&&e instanceof Blob}CL(GL,"jsonRegex",new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i"));var $L=function(e){function t(e,r){var n;return DL(this,t),CL(n=vL(this,t,[r]),"name","ResponseError"),n.response=e,n}return bL(t,e),FL(t)}(xL(Error)),HL=function(e){function t(e,r){var n;return DL(this,t),CL(n=vL(this,t,[r]),"name","FetchError"),n.cause=e,n}return bL(t,e),FL(t)}(xL(Error)),qL=function(e){function t(e,r){var n;return DL(this,t),CL(n=vL(this,t,[r]),"name","RequiredError"),n.field=e,n}return bL(t,e),FL(t)}(xL(Error));function WL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).map((function(r){return ZL(r,e[r],t)})).filter((function(e){return e.length>0})).join("&")}function ZL(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r+(r.length?"[".concat(e,"]"):e);if(t instanceof Array){var i=t.map((function(e){return encodeURIComponent(String(e))})).join("&".concat(encodeURIComponent(n),"="));return"".concat(encodeURIComponent(n),"=").concat(i)}return t instanceof Set?ZL(e,Array.from(t),r):t instanceof Date?"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(t.toISOString())):t instanceof Object?WL(t,n):"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(t)))}var YL=function(){return FL((function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};DL(this,e),this.raw=t,this.transformer=r}),[{key:"value",value:(e=OL(RL().mark((function e(){return RL().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,this.raw.json();case 3:return e.t1=e.sent,e.abrupt("return",e.t0.transformer.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}]);var e}(),XL=function(){return FL((function e(t){DL(this,e),this.raw=t}),[{key:"value",value:(e=OL(RL().mark((function e(){return RL().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})}]);var e}();function KL(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,farmFieldId:e.farm_field_id,cropType:null==e.crop_type?void 0:e.crop_type,boundaryGeojson:e.boundary_geojson,centerLng:e.center_lng,centerLat:e.center_lat,radiusMeters:e.radius_meters,startAngle:e.start_angle,endAngle:e.end_angle}}(e)}function JL(e){return function(e){if(null==e)return e;return{name:e.name,farm_field_id:e.farmFieldId,crop_type:e.cropType,boundary_geojson:e.boundaryGeojson}}(e,!1)}function QL(e){return function(e){if(null==e)return e;return{type:null==e.type?void 0:e.type,coordinates:null==e.coordinates?void 0:e.coordinates}}(e)}function eO(e){return function(e){if(null==e)return e;return{type:e.type,coordinates:e.coordinates}}(e,!1)}function tO(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,boundaryGeojson:e.boundary_geojson,boundaryName:null==e.boundary_name?void 0:e.boundary_name,boundary:QL(e.boundary),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}(e)}function rO(e){return function(e){if(null==e)return e;return{boundary_geojson:e.boundaryGeojson,boundary_name:e.boundaryName,boundary:eO(e.boundary)}}(e,!1)}function nO(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,description:e.description,field:e.field,planName:null==e.plan_name?void 0:e.plan_name,startDate:null==e.start_date?void 0:new Date(e.start_date),endDate:null==e.end_date?void 0:new Date(e.end_date),fieldIrrigationVolume:null==e.field_irrigation_volume?void 0:e.field_irrigation_volume,zonesCreatedCount:e.zones_created_count,zonesGeojson:e.zones_geojson}}(e)}function iO(e){return function(e){if(null==e)return e;return{field:e.field,plan_name:e.planName,start_date:null==e.startDate?void 0:e.startDate.toISOString().substring(0,10),end_date:null==e.endDate?void 0:e.endDate.toISOString().substring(0,10),field_irrigation_volume:e.fieldIrrigationVolume}}(e,!1)}function oO(e){return function(e){if(null==e)return e;
31return{id:e.id,name:e.name,boundaryGeojson:e.boundary_geojson,centerLng:e.center_lng,centerLat:e.center_lat,radiusMeters:e.radius_meters,startAngle:e.start_angle,endAngle:e.end_angle}}(e)}function aO(e){return function(e){if(null==e)return e;return{name:e.name,boundary_geojson:e.boundaryGeojson}}(e,!1)}function sO(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,description:e.description,route:e.route,routeId:e.route_id,routeName:e.route_name,fieldId:e.field_id,zoneHeightMeter:e.zone_height_meter,zoneWidthMeter:e.zone_width_meter,fieldBufferSizeMeter:null==e.field_buffer_size_meter?void 0:e.field_buffer_size_meter,planName:null==e.plan_name?void 0:e.plan_name,zonesCreatedCount:e.zones_created_count,zonesGeojson:e.zones_geojson}}(e)}function lO(e){return function(e){if(null==e)return e;return{route:e.route,field_id:e.fieldId,zone_height_meter:e.zoneHeightMeter,zone_width_meter:e.zoneWidthMeter,field_buffer_size_meter:e.fieldBufferSizeMeter,plan_name:e.planName}}(e,!1)}function cO(e){return function(e){if(null==e)return e;return{type:null==e.type?void 0:e.type,coordinates:null==e.coordinates?void 0:e.coordinates}}(e)}function uO(e){return function(e){if(null==e)return e;return{type:e.type,coordinates:e.coordinates}}(e,!1)}function dO(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,fieldId:e.field_id,routeGeojson:e.route_geojson,routeName:null==e.route_name?void 0:e.route_name,routeLine:cO(e.route_line),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}(e)}function hO(e){return function(e){if(null==e)return e;return{field_id:e.fieldId,route_geojson:e.routeGeojson,route_name:e.routeName,route_line:uO(e.routeLine)}}(e,!1)}function fO(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(KL)}}(e)}function pO(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(tO)}}(e)}function gO(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(nO)}}(e)}function mO(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(oO)}}(e)}function yO(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(sO)}}(e)}function _O(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(dO)}}(e)}function vO(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,fieldId:e.field_id,extentName:null==e.extent_name?void 0:e.extent_name,centerLng:e.center_lng,centerLat:e.center_lat,radiusMeters:e.radius_meters,startAngle:e.start_angle,endAngle:e.end_angle,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}(e)}function bO(e){return function(e){if(null==e)return e;return{field_id:e.fieldId,extent_name:e.extentName}}(e,!1)}function xO(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(vO)}}(e)}function wO(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,description:e.description,pivotExtent:e.pivot_extent,zoneAngle:null==e.zone_angle?void 0:e.zone_angle,planName:null==e.plan_name?void 0:e.plan_name,zonesCreatedCount:e.zones_created_count,zonesGeojson:e.zones_geojson,centerLng:e.center_lng,centerLat:e.center_lat,radiusMeters:e.radius_meters,startAngle:e.start_angle,endAngle:e.end_angle,extentId:e.extent_id,extentName:e.extent_name}}(e)}function SO(e){return function(e){if(null==e)return e;return{pivot_extent:e.pivotExtent,zone_angle:e.zoneAngle,plan_name:e.planName}}(e,!1)}function kO(e){return function(e){if(null==e)return e;return{count:e.count,next:null==e.next?void 0:e.next,previous:null==e.previous?void 0:e.previous,results:e.results.map(wO)}}(e)}function TO(e){return function(e){if(null==e)return e;return{name:e.name,farm_field_id:e.farmFieldId,crop_type:e.cropType,boundary_geojson:e.boundaryGeojson}}(e,!1)}function IO(e){return function(e){if(null==e)return e;return{boundary_geojson:e.boundaryGeojson,boundary_name:e.boundaryName,boundary:eO(e.boundary)}}(e,!1)}function MO(e){return function(e){if(null==e)return e;return{field:e.field,plan_name:e.planName,start_date:null==e.startDate?void 0:e.startDate.toISOString().substring(0,10),end_date:null==e.endDate?void 0:e.endDate.toISOString().substring(0,10),field_irrigation_volume:e.fieldIrrigationVolume}}(e,!1)}function EO(e){return function(e){if(null==e)return e;return{name:e.name,boundary_geojson:e.boundaryGeojson}}(e,!1)}function PO(e){return function(e){if(null==e)return e;return{route:e.route,field_id:e.fieldId,zone_height_meter:e.zoneHeightMeter,zone_width_meter:e.zoneWidthMeter,field_buffer_size_meter:e.fieldBufferSizeMeter,plan_name:e.planName}}(e,!1)}function AO(e){return function(e){if(null==e)return e;return{field_id:e.fieldId,route_geojson:e.routeGeojson,route_name:e.routeName,route_line:uO(e.routeLine)}}(e,!1)}function CO(e){return function(e){if(null==e)return e;return{field_id:e.fieldId,extent_name:e.extentName}}(e,!1)}function RO(e){return function(e){if(null==e)return e;return{pivot_extent:e.pivotExtent,zone_angle:e.zoneAngle,plan_name:e.planName}}(e,!1)}function LO(e){return LO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LO(e)}function OO(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */OO=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 31
31if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==LO(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(LO(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
31if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function DO(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function zO(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){DO(o,n,i,a,s,"next",e)}function s(e){DO(o,n,i,a,s,"throw",e)}a(void 0)}))}}function FO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,NO(n.key),n)}}function NO(e){var t=function(e,t){if("object"!=LO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=LO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==LO(t)?t:t+""}function BO(e,t,r){return t=VO(t),function(e,t){if(t&&("object"==LO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jO()?Reflect.construct(t,r||[],VO(e).constructor):t.apply(e,r))}function jO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jO=function(){return!!e})()}function VO(e){return VO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},VO(e)}function GO(e,t){return GO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GO(e,t)}var UO=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),BO(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)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&&GO(e,t)}(t,e),function(e,t,r){return t&&FO(e.prototype,t),r&&FO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"cropZonesCreateRaw",value:(Ue=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling cropZonesCreate().');case 2:if(null!=t.cropZone){e.next=4;break}throw new qL("cropZone",'Required parameter "cropZone" was null or undefined when calling cropZonesCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/crop-zones/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:JL(t.cropZone)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return KL(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ue.apply(this,arguments)})},{key:"cropZonesCreate",value:(Ge=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cropZonesCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ge.apply(this,arguments)})},{key:"cropZonesDestroyRaw",value:(Ve=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling cropZonesDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling cropZonesDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/crop-zones/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ve.apply(this,arguments)})},{key:"cropZonesDestroy",value:(je=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cropZonesDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return je.apply(this,arguments)})},{key:"cropZonesListRaw",value:(Be=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling cropZonesList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/crop-zones/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return fO(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return Be.apply(this,arguments)})},{key:"cropZonesList",value:(Ne=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cropZonesListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ne.apply(this,arguments)})},{key:"cropZonesPartialUpdateRaw",value:(Fe=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling cropZonesPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling cropZonesPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/crop-zones/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:TO(t.patchedCropZone)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return KL(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return Fe.apply(this,arguments)})},{key:"cropZonesPartialUpdate",value:(ze=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cropZonesPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ze.apply(this,arguments)})},{key:"cropZonesRetrieveRaw",value:(De=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling cropZonesRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling cropZonesRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/crop-zones/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return KL(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return De.apply(this,arguments)})},{key:"cropZonesRetrieve",value:(Oe=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cropZonesRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Oe.apply(this,arguments)})},{key:"cropZonesUpdateRaw",value:(Le=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling cropZonesUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling cropZonesUpdate().');case 4:if(null!=t.cropZone){e.next=6;break}throw new qL("cropZone",'Required parameter "cropZone" was null or undefined when calling cropZonesUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/crop-zones/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:JL(t.cropZone)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return KL(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return Le.apply(this,arguments)})},{key:"cropZonesUpdate",value:(Re=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cropZonesUpdateRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Re.apply(this,arguments)})},{key:"dripIrrigationBoundariesCreateRaw",value:(Ce=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationBoundariesCreate().');case 2:if(null!=t.dripIrrigationBoundary){e.next=4;break}throw new qL("dripIrrigationBoundary",'Required parameter "dripIrrigationBoundary" was null or undefined when calling dripIrrigationBoundariesCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-boundaries/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:rO(t.dripIrrigationBoundary)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return tO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ce.apply(this,arguments)})},{key:"dripIrrigationBoundariesCreate",value:(Ae=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationBoundariesCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ae.apply(this,arguments)})},{key:"dripIrrigationBoundariesDestroyRaw",value:(Pe=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationBoundariesDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationBoundariesDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-boundaries/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return Pe.apply(this,arguments)})},{key:"dripIrrigationBoundariesDestroy",value:(Ee=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationBoundariesDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ee.apply(this,arguments)})},{key:"dripIrrigationBoundariesListRaw",value:(Me=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationBoundariesList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-boundaries/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return pO(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return Me.apply(this,arguments)})},{key:"dripIrrigationBoundariesList",value:(Ie=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationBoundariesListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ie.apply(this,arguments)})},{key:"dripIrrigationBoundariesPartialUpdateRaw",value:(Te=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationBoundariesPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationBoundariesPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-boundaries/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:IO(t.patchedDripIrrigationBoundary)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return tO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return Te.apply(this,arguments)})},{key:"dripIrrigationBoundariesPartialUpdate",value:(ke=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationBoundariesPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ke.apply(this,arguments)})},{key:"dripIrrigationBoundariesRetrieveRaw",value:(Se=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationBoundariesRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationBoundariesRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-boundaries/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return tO(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return Se.apply(this,arguments)})},{key:"dripIrrigationBoundariesRetrieve",value:(we=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationBoundariesRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return we.apply(this,arguments)})},{key:"dripIrrigationBoundariesUpdateRaw",value:(xe=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationBoundariesUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationBoundariesUpdate().');
31case 4:if(null!=t.dripIrrigationBoundary){e.next=6;break}throw new qL("dripIrrigationBoundary",'Required parameter "dripIrrigationBoundary" was null or undefined when calling dripIrrigationBoundariesUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-boundaries/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:rO(t.dripIrrigationBoundary)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return tO(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return xe.apply(this,arguments)})},{key:"dripIrrigationBoundariesUpdate",value:(be=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationBoundariesUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return be.apply(this,arguments)})},{key:"dripIrrigationPlansCreateRaw",value:(ve=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationPlansCreate().');case 2:if(null!=t.dripIrrigationPlan){e.next=4;break}throw new qL("dripIrrigationPlan",'Required parameter "dripIrrigationPlan" was null or undefined when calling dripIrrigationPlansCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-plans/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:iO(t.dripIrrigationPlan)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return nO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return ve.apply(this,arguments)})},{key:"dripIrrigationPlansCreate",value:(_e=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationPlansCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _e.apply(this,arguments)})},{key:"dripIrrigationPlansDestroyRaw",value:(ye=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationPlansDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationPlansDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return ye.apply(this,arguments)})},{key:"dripIrrigationPlansDestroy",value:(me=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationPlansDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return me.apply(this,arguments)})},{key:"dripIrrigationPlansListRaw",value:(ge=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationPlansList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-plans/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return gO(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return ge.apply(this,arguments)})},{key:"dripIrrigationPlansList",value:(pe=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationPlansListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return pe.apply(this,arguments)})},{key:"dripIrrigationPlansPartialUpdateRaw",value:(fe=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationPlansPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationPlansPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:MO(t.patchedDripIrrigationPlan)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return nO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return fe.apply(this,arguments)})},{key:"dripIrrigationPlansPartialUpdate",value:(he=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationPlansPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return he.apply(this,arguments)})},{key:"dripIrrigationPlansRetrieveRaw",value:(de=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationPlansRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationPlansRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return nO(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return de.apply(this,arguments)})},{key:"dripIrrigationPlansRetrieve",value:(ue=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationPlansRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ue.apply(this,arguments)})},{key:"dripIrrigationPlansUpdateRaw",value:(ce=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling dripIrrigationPlansUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling dripIrrigationPlansUpdate().');case 4:if(null!=t.dripIrrigationPlan){e.next=6;break}throw new qL("dripIrrigationPlan",'Required parameter "dripIrrigationPlan" was null or undefined when calling dripIrrigationPlansUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/drip-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:iO(t.dripIrrigationPlan)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return nO(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return ce.apply(this,arguments)})},{key:"dripIrrigationPlansUpdate",value:(le=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dripIrrigationPlansUpdateRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return le.apply(this,arguments)})},{key:"farmFieldsCreateRaw",value:(se=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling farmFieldsCreate().');case 2:if(null!=t.farmField){e.next=4;break}throw new qL("farmField",'Required parameter "farmField" was null or undefined when calling farmFieldsCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/farm-fields/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:aO(t.farmField)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return oO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return se.apply(this,arguments)})},{key:"farmFieldsCreate",value:(ae=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.farmFieldsCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ae.apply(this,arguments)})},{key:"farmFieldsDestroyRaw",value:(oe=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling farmFieldsDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling farmFieldsDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/farm-fields/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return oe.apply(this,arguments)})},{key:"farmFieldsDestroy",value:(ie=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.farmFieldsDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return ie.apply(this,arguments)})},{key:"farmFieldsListRaw",value:(ne=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling farmFieldsList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/farm-fields/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return mO(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return ne.apply(this,arguments)})},{key:"farmFieldsList",value:(re=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.farmFieldsListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return re.apply(this,arguments)})},{key:"farmFieldsPartialUpdateRaw",value:(te=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling farmFieldsPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling farmFieldsPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/farm-fields/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:EO(t.patchedFarmField)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return oO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return te.apply(this,arguments)})},{key:"farmFieldsPartialUpdate",value:(ee=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.farmFieldsPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return ee.apply(this,arguments)})},{key:"farmFieldsRetrieveRaw",value:(Q=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling farmFieldsRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling farmFieldsRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/farm-fields/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return oO(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return Q.apply(this,arguments)})},{key:"farmFieldsRetrieve",value:(J=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.farmFieldsRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return J.apply(this,arguments)})},{key:"farmFieldsUpdateRaw",value:(K=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling farmFieldsUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling farmFieldsUpdate().');case 4:if(null!=t.farmField){e.next=6;break}throw new qL("farmField",'Required parameter "farmField" was null or undefined when calling farmFieldsUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/farm-fields/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:aO(t.farmField)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return oO(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return K.apply(this,arguments)})},{key:"farmFieldsUpdate",value:(X=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.farmFieldsUpdateRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return X.apply(this,arguments)})},{key:"hoseReelIrrigationPlansCreateRaw",value:(Y=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationPlansCreate().');case 2:if(null!=t.hoseReelIrrigationPlan){e.next=4;break}throw new qL("hoseReelIrrigationPlan",'Required parameter "hoseReelIrrigationPlan" was null or undefined when calling hoseReelIrrigationPlansCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-plans/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:lO(t.hoseReelIrrigationPlan)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return sO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return Y.apply(this,arguments)})},{key:"hoseReelIrrigationPlansCreate",value:(Z=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationPlansCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return Z.apply(this,arguments)})},{key:"hoseReelIrrigationPlansDestroyRaw",value:(W=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationPlansDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationPlansDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return W.apply(this,arguments)})},{key:"hoseReelIrrigationPlansDestroy",value:(q=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationPlansDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"hoseReelIrrigationPlansListRaw",value:(H=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationPlansList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-plans/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return yO(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return H.apply(this,arguments)})},{key:"hoseReelIrrigationPlansList",value:($=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationPlansListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return $.apply(this,arguments)})},{key:"hoseReelIrrigationPlansPartialUpdateRaw",value:(U=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationPlansPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationPlansPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:PO(t.patchedHoseReelIrrigationPlan)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return sO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"hoseReelIrrigationPlansPartialUpdate",value:(G=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationPlansPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return G.apply(this,arguments)})},{key:"hoseReelIrrigationPlansRetrieveRaw",value:(V=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationPlansRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationPlansRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return sO(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return V.apply(this,arguments)})},{key:"hoseReelIrrigationPlansRetrieve",value:(j=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationPlansRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"hoseReelIrrigationPlansUpdateRaw",value:(B=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationPlansUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationPlansUpdate().');case 4:if(null!=t.hoseReelIrrigationPlan){e.next=6;break}throw new qL("hoseReelIrrigationPlan",'Required parameter "hoseReelIrrigationPlan" was null or undefined when calling hoseReelIrrigationPlansUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:lO(t.hoseReelIrrigationPlan)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return sO(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return B.apply(this,arguments)})},{key:"hoseReelIrrigationPlansUpdate",value:(N=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationPlansUpdateRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesCreateRaw",value:(F=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationRoutesCreate().');case 2:if(null!=t.hoseReelIrrigationRoute){e.next=4;break}throw new qL("hoseReelIrrigationRoute",'Required parameter "hoseReelIrrigationRoute" was null or undefined when calling hoseReelIrrigationRoutesCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-routes/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:hO(t.hoseReelIrrigationRoute)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return dO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return F.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesCreate",value:(z=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationRoutesCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesDestroyRaw",value:(D=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationRoutesDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationRoutesDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-routes/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesDestroy",value:(O=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationRoutesDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesListRaw",value:(L=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationRoutesList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-routes/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return _O(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesList",value:(R=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationRoutesListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesPartialUpdateRaw",value:(C=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationRoutesPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationRoutesPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-routes/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:AO(t.patchedHoseReelIrrigationRoute)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return dO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesPartialUpdate",value:(A=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationRoutesPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesRetrieveRaw",value:(P=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationRoutesRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationRoutesRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-routes/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return dO(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesRetrieve",value:(E=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationRoutesRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesUpdateRaw",value:(M=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling hoseReelIrrigationRoutesUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling hoseReelIrrigationRoutesUpdate().');case 4:if(null!=t.hoseReelIrrigationRoute){e.next=6;break}throw new qL("hoseReelIrrigationRoute",'Required parameter "hoseReelIrrigationRoute" was null or undefined when calling hoseReelIrrigationRoutesUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/hose-reel-irrigation-routes/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:hO(t.hoseReelIrrigationRoute)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return dO(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"hoseReelIrrigationRoutesUpdate",value:(I=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.hoseReelIrrigationRoutesUpdateRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"pivotIrrigationExtentsCreateRaw",value:(T=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationExtentsCreate().');case 2:if(null!=t.pivotIrrigationExtent){e.next=4;break}throw new qL("pivotIrrigationExtent",'Required parameter "pivotIrrigationExtent" was null or undefined when calling pivotIrrigationExtentsCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-extents/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:bO(t.pivotIrrigationExtent)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return vO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"pivotIrrigationExtentsCreate",value:(k=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationExtentsCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"pivotIrrigationExtentsDestroyRaw",value:(S=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationExtentsDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationExtentsDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-extents/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"pivotIrrigationExtentsDestroy",value:(w=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationExtentsDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"pivotIrrigationExtentsListRaw",value:(x=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationExtentsList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-extents/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return xO(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"pivotIrrigationExtentsList",value:(b=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationExtentsListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"pivotIrrigationExtentsPartialUpdateRaw",value:(v=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationExtentsPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationExtentsPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-extents/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:CO(t.patchedPivotIrrigationExtent)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return vO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"pivotIrrigationExtentsPartialUpdate",value:(_=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationExtentsPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"pivotIrrigationExtentsRetrieveRaw",value:(y=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationExtentsRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationExtentsRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-extents/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return vO(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"pivotIrrigationExtentsRetrieve",value:(m=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationExtentsRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"pivotIrrigationExtentsUpdateRaw",value:(g=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationExtentsUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationExtentsUpdate().');case 4:if(null!=t.pivotIrrigationExtent){e.next=6;break}throw new qL("pivotIrrigationExtent",'Required parameter "pivotIrrigationExtent" was null or undefined when calling pivotIrrigationExtentsUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-extents/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:bO(t.pivotIrrigationExtent)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return vO(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"pivotIrrigationExtentsUpdate",value:(p=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationExtentsUpdateRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"pivotIrrigationPlansCreateRaw",value:(f=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationPlansCreate().');case 2:if(null!=t.pivotIrrigationPlan){e.next=4;break}throw new qL("pivotIrrigationPlan",'Required parameter "pivotIrrigationPlan" was null or undefined when calling pivotIrrigationPlansCreate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-plans/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"POST",headers:i,query:n,body:SO(t.pivotIrrigationPlan)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return wO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"pivotIrrigationPlansCreate",value:(h=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationPlansCreateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"pivotIrrigationPlansDestroyRaw",value:(d=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationPlansDestroy().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationPlansDestroy().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"DELETE",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new XL(o));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"pivotIrrigationPlansDestroy",value:(u=zO(OO().mark((function e(t,r){return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationPlansDestroyRaw(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"pivotIrrigationPlansListRaw",value:(c=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.teamSlug){e.next=2;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationPlansList().');case 2:if(n={},null!=t.page&&(n.page=t.page),i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=10;break}return e.next=9,this.configuration.apiKey("Authorization");case 9:i.Authorization=e.sent;case 10:return e.next=12,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-plans/".replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 12:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return kO(e)})));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"pivotIrrigationPlansList",value:(l=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationPlansListRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"pivotIrrigationPlansPartialUpdateRaw",value:(s=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationPlansPartialUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationPlansPartialUpdate().');case 4:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=12;break}return e.next=11,this.configuration.apiKey("Authorization");case 11:i.Authorization=e.sent;case 12:return e.next=14,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PATCH",headers:i,query:n,body:RO(t.patchedPivotIrrigationPlan)},r);case 14:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return wO(e)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"pivotIrrigationPlansPartialUpdate",value:(a=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationPlansPartialUpdateRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"pivotIrrigationPlansRetrieveRaw",value:(o=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationPlansRetrieve().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationPlansRetrieve().');case 4:if(n={},i={},!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=11;break}return e.next=10,this.configuration.apiKey("Authorization");case 10:i.Authorization=e.sent;case 11:return e.next=13,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"GET",headers:i,query:n},r);case 13:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return wO(e)})));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"pivotIrrigationPlansRetrieve",value:(i=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationPlansRetrieveRaw(t,r);case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"pivotIrrigationPlansUpdateRaw",value:(n=zO(OO().mark((function e(t,r){var n,i,o;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.id){e.next=2;break}throw new qL("id",'Required parameter "id" was null or undefined when calling pivotIrrigationPlansUpdate().');case 2:if(null!=t.teamSlug){e.next=4;break}throw new qL("teamSlug",'Required parameter "teamSlug" was null or undefined when calling pivotIrrigationPlansUpdate().');case 4:if(null!=t.pivotIrrigationPlan){e.next=6;break}throw new qL("pivotIrrigationPlan",'Required parameter "pivotIrrigationPlan" was null or undefined when calling pivotIrrigationPlansUpdate().');case 6:if(n={},(i={})["Content-Type"]="application/json",!this.configuration||void 0===this.configuration.username&&void 0===this.configuration.password||(i.Authorization="Basic "+btoa(this.configuration.username+":"+this.configuration.password)),!this.configuration||!this.configuration.apiKey){e.next=14;break}return e.next=13,this.configuration.apiKey("Authorization");case 13:i.Authorization=e.sent;case 14:return e.next=16,this.request({path:"/a/{team_slug}/farms/api/pivot-irrigation-plans/{id}/".replace("{".concat("id","}"),encodeURIComponent(String(t.id))).replace("{".concat("team_slug","}"),encodeURIComponent(String(t.teamSlug))),method:"PUT",headers:i,query:n,body:SO(t.pivotIrrigationPlan)},r);case 16:return o=e.sent,e.abrupt("return",new YL(o,(function(e){return wO(e)})));case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"pivotIrrigationPlansUpdate",value:(r=zO(OO().mark((function e(t,r){var n;return OO().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pivotIrrigationPlansUpdateRaw(t,r);
31case 2:return n=e.sent,e.next=5,n.value();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]);var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E,P,A,C,R,L,O,D,z,F,N,B,j,V,G,U,$,H,q,W,Z,Y,X,K,J,Q,ee,te,re,ne,ie,oe,ae,se,le,ce,ue,de,he,fe,pe,ge,me,ye,_e,ve,be,xe,we,Se,ke,Te,Ie,Me,Ee,Pe,Ae,Ce,Re,Le,Oe,De,ze,Fe,Ne,Be,je,Ve,Ge,Ue}(GL);var $O=qu("<title> </title>"),HO=qu("<desc> </desc>"),qO=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M5 12h14M5 12l4-4m-4 4 4 4"></path></svg>');function WO(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"arrow left outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=qO();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=$O(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=HO(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}
31function ZO(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function YO(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function XO(e){return"Feature"===e.type?e.geometry:e}function KO(e,t,r,n={}){const i=ZO(e),o=Jw(i[0]),a=Jw(i[1]),s=Jw(r),l=Xw(t,n.units),c=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(s));return Uw([Kw(o+Math.atan2(Math.sin(s)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(c))),Kw(c)],n.properties)}function JO(e,t,r={}){const n=r.steps||64,i=r.properties?r.properties:!Array.isArray(e)&&"Feature"===e.type&&e.properties?e.properties:{},o=[];for(let i=0;i<n;i++)o.push(KO(e,t,-360*i/n,r).geometry.coordinates);return o.push(o[0]),$w([o],i)}function QO(e,t,r,n,i={}){const o=i.steps||64,a=eD(r),s=eD(n),l=Array.isArray(e)||"Feature"!==e.type?{}:e.properties;if(a===s)return Hw(JO(e,t,i).geometry.coordinates[0],l);const c=a,u=a<s?s:s+360;let d=c;const h=[];let f=0;const p=(u-c)/o;for(;d<=u;)h.push(KO(e,t,d,i).geometry.coordinates),f++,d=c+f*p;return Hw(h,l)}function eD(e){let t=e%360;return t<0&&(t+=360),t}function tD(e,t,r,n,i={}){if(!function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}(i=i||{}))throw new Error("options is invalid");const o=i.properties;if(!e)throw new Error("center is required");if(null==r)throw new Error("bearing1 is required");if(null==n)throw new Error("bearing2 is required");if(!t)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");if(rD(r)===rD(n))return JO(e,t,i);const a=YO(e),s=QO(e,t,r,n,i),l=[[a]];return eS(s,(function(e){l[0].push(e)})),l[0].push(a),$w(l,o)}function rD(e){let t=e%360;return t<0&&(t+=360),t}function nD(e,t,r={}){var n=ZO(e),i=ZO(t),o=Jw(i[1]-n[1]),a=Jw(i[0]-n[0]),s=Jw(n[1]),l=Jw(i[1]),c=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return Yw(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r.units)}function iD(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return oD(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oD(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function oD(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var aD=["farm-fields-fill","farm-fields-outline","farm-fields-gated-overlay","pivots-fill","pivots-outline","hose-reels-outline","drip-boundaries-fill","drip-boundaries-outline","vri-fill","vri-outline","rd-vri-fill","rd-vri-outline","active-crop-zone-outline","active-crop-zone-outline-glow","inactive-crop-zones-layer","inactive-crop-zones-outline"];function sD(e){if(e){var t,r=iD(aD);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.getLayer(n)&&e.setLayoutProperty(n,"visibility","none")}}catch(e){r.e(e)}finally{r.f()}}}function lD(e){if(e){var t,r=iD(aD);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.getLayer(n)&&e.setLayoutProperty(n,"visibility","visible")}}catch(e){r.e(e)}finally{r.f()}}}var cD=[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3b82f6","fill-opacity":.15}},{id:"gl-draw-polygon-stroke",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"line-color":"#3b82f6","line-width":2.5}},{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"]],paint:{"circle-radius":6,"cir
31cle-color":"#ffffff","circle-stroke-color":"#3b82f6","circle-stroke-width":2}},{id:"gl-draw-point-mid",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":4,"circle-color":"#3b82f6","circle-opacity":.7}}];function uD(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return dD(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dD(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function dD(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var hD="add-field-preview",fD="add-field-center",pD="add-field-preview-fill",gD="add-field-preview-outline",mD="add-field-center-point",yD=[pD,gD,mD],_D=[hD,fD];function vD(e,t,r,n,i){var o=t/1e3;return o<=0?null:"semi-circular"===r&&i-n<360?tD(e,o,n,i,{units:"kilometers",steps:64}):JO(e,o,{units:"kilometers",steps:64})}function bD(e,t,r,n,i,o){var a=vD(t,r,n,i,o);if(a){var s=e.getSource(hD);null!=s&&s.setData&&s.setData({type:"FeatureCollection",features:[a]})}}function xD(e,t,r,n,i){var o={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[e[0],e[1]]},properties:{radius:t,start_angle:"semi-circular"===r?n:0,end_angle:"semi-circular"===r?i:360}}]};return{type:"circular",center_lng:e[0],center_lat:e[1],radius_meters:t,geojson:JSON.stringify(o)}}function wD(e,t){sD(e),e.getSource(hD)||(e.addSource(hD,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),e.addLayer({id:pD,type:"fill",source:hD,paint:{"fill-color":"#3b82f6","fill-opacity":.15}}),e.addLayer({id:gD,type:"line",source:hD,paint:{"line-color":"#3b82f6","line-width":2.5}})),e.getSource(fD)||(e.addSource(fD,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),e.addLayer({id:mD,type:"circle",source:fD,paint:{"circle-radius":6,"circle-color":"#ffffff","circle-stroke-color":"#3b82f6","circle-stroke-width":2}})),e.getCanvas().style.cursor="crosshair";var r=function(e,t){return function(r){if(!t.getCircleFinalized()){var n=t.getCircleCenter();if(n){var i=nD(n,[r.lngLat.lng,r.lngLat.lat],{units:"meters"});t.setCircleRadiusMeters(i),t.setCircleFinalized(!0),bD(e,n,i,t.getFieldType(),t.getStartAngle(),t.getEndAngle());var o=xD(n,i,t.getFieldType(),t.getStartAngle(),t.getEndAngle());t.setDrawnGeometry(o),e.getCanvas().style.cursor="",t.setDrawPhaseForm()}else{var a=[r.lngLat.lng,r.lngLat.lat];t.setCircleCenter(a);var s=e.getSource(fD);null!=s&&s.setData&&s.setData({type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:a},properties:{}}]})}}}}(e,t),n=function(e,t){return function(r){var n=t.getCircleCenter();if(n&&!t.getCircleFinalized()){var i=nD(n,[r.lngLat.lng,r.lngLat.lat],{units:"meters"});t.setCircleRadiusMeters(i),bD(e,n,i,t.getFieldType(),t.getStartAngle(),t.getEndAngle())}}}(e,t);return e.on("click",r),e.on("mousemove",n),{clickHandler:r,mouseMoveHandler:n}}function SD(e,t){t&&(e.off("click",t.clickHandler),e.off("mousemove",t.mouseMoveHandler)),e.getCanvas().style.cursor="";var r,n=uD(yD);try{for(n.s();!(r=n.n()).done;){var i=r.value;e.getLayer(i)&&e.removeLayer(i)}}catch(e){n.e(e)}finally{n.f()}var o,a=uD(_D);try{for(a.s();!(o=a.n()).done;){var s=o.value;e.getSource(s)&&e.removeSource(s)}}catch(e){a.e(e)}finally{a.f()}}function kD(e,t){var r=t.getCircleCenter();if(r&&!(t.getCircleRadiusMeters()<=0)){bD(e,r,t.getCircleRadiusMeters(),t.getFieldType(),t.getStartAngle(),t.getEndAngle());var n=xD(r,t.getCircleRadiusMeters(),t.getFieldType(),t.getStartAngle(),t.getEndAngle());t.setDrawnGeometry(n)}}var TD=$u('<button class="p-1.5 hover:bg-gray-100 rounded-lg transition-colors text-gray-500 hover:text-gray-700" title="Back to map"><!></button>'),ID=$u('<p class="text-sm text-gray-500"> </p>'),MD=$u('<div><p class="block text-sm font-medium text-gray-700 mb-3">Select Field Type</p> <div class="space-y-2"><button class="w-full flex items-center gap-3 p-3 border-2 border-gray-200 rounded-lg hover:border-blue-500 hover:bg-blue-50 transition-all text-left"><div class="w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center flex-shrink-0">
31<svg class="w-5 h-5 text-blue-600" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="5,3 19,3 22,15 12,21 2,15"></polygon></svg></div> <div><div class="text-sm font-semibold text-gray-900">Polygon</div> <div class="text-xs text-gray-500">Draw a custom field boundary</div></div></button> <button class="w-full flex items-center gap-3 p-3 border-2 border-gray-200 rounded-lg hover:border-blue-500 hover:bg-blue-50 transition-all text-left"><div class="w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center flex-shrink-0"><svg class="w-5 h-5 text-green-600" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><circle cx="12" cy="12" r="1" fill="currentColor"></circle></svg></div> <div><div class="text-sm font-semibold text-gray-900">Full Pivot</div> <div class="text-xs text-gray-500">Click center, then click to set radius</div></div></button> <button class="w-full flex items-center gap-3 p-3 border-2 border-gray-200 rounded-lg hover:border-blue-500 hover:bg-blue-50 transition-all text-left"><div class="w-10 h-10 bg-amber-100 rounded-lg flex items-center justify-center flex-shrink-0"><svg class="w-5 h-5 text-amber-600" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 12 L12 3 A9 9 0 0 1 21 12 Z"></path><circle cx="12" cy="12" r="1" fill="currentColor"></circle></svg></div> <div><div class="text-sm font-semibold text-gray-900">Partial Pivot</div> <div class="text-xs text-gray-500">Circle with adjustable start/end angles</div></div></button></div></div>'),ED=$u('<p class="text-sm text-blue-800 font-medium">Draw your field boundary</p> <p class="text-xs text-blue-600 mt-1">Click on the map to place vertices. Double-click to finish the polygon.</p>',1),PD=$u('<p class="text-sm text-blue-800 font-medium">Place the center point</p> <p class="text-xs text-blue-600 mt-1">Click on the map to set the pivot center.</p>',1),AD=$u('<p class="text-sm text-blue-800 font-medium">Set the radius</p> <p class="text-xs text-blue-600 mt-1">Move the mouse and click to set the field radius.</p> <p class="text-xs text-gray-500 mt-2"> </p>',1),CD=$u('<div class="space-y-4"><div class="p-3 bg-blue-50 border border-blue-200 rounded-lg"><!></div> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg transition-colors border border-gray-200">← Change Field Type</button></div>'),RD=$u('<div class="px-3 py-2 bg-red-50 rounded-lg text-sm text-red-600 font-medium"> </div>'),LD=$u('<div class="px-3 py-2 bg-green-50 rounded-lg text-sm text-green-700 font-medium"> </div>'),OD=$u('<div><label for="add-field-radius" class="block text-sm font-medium text-gray-700 mb-1.5">Radius (meters)</label> <input id="add-field-radius" type="number" min="1" step="1" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors"/></div>'),DD=$u('<div class="p-3 bg-blue-50 border border-blue-200 rounded-lg"><h4 class="text-sm font-medium text-gray-700 mb-2">Pivot Angles</h4> <div class="flex gap-3"><div class="flex-1"><label for="add-start-angle" class="block text-xs text-gray-600 mb-1">Start (°)</label> <input id="add-start-angle" type="number" min="0" max="360" class="w-full px-2 py-1.5 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"/></div> <div class="flex-1"><label for="add-end-angle" class="block text-xs text-gray-600 mb-1">End (°)</label> <input id="add-end-angle" type="number" min="0" max="360" class="w-full px-2 py-1.5 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"/></div></div></div>'),zD=$u("<option> </option>"),FD=$u('<p class="text-xs text-gray-500 mt-1">Automatically set to Center Pivot for circular fields.</p>'),ND=qu('<svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Creating...',1),BD=$u('<div class="space-y-4"><!> <!> <!> <!> <div><label for="add-field-name" class="block text-sm font-medium text-gray-700 mb-1.5">
31Field Name</label> <input id="add-field-name" type="text" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors" placeholder="Enter field name"/></div> <div><label for="add-field-crop" class="block text-sm font-medium text-gray-700 mb-1.5">Crop Type</label> <select id="add-field-crop" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors bg-white"><option>Select crop type...</option><!></select></div> <div><label for="add-field-irrigation" class="block text-sm font-medium text-gray-700 mb-1.5">Irrigation Type</label> <select id="add-field-irrigation" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors bg-white disabled:bg-gray-50 disabled:text-gray-500"><option disabled>Select irrigation type...</option><option>Center Pivot</option><option>Hose Reel</option><option>Drip Irrigation</option><option>None / Other</option></select> <!></div> <div class="pt-3 border-t border-gray-200"><div class="flex items-center gap-2 text-sm"><span class="text-gray-600">Area:</span> <span class="font-medium text-gray-900"> </span></div></div> <div class="pt-3 border-t border-gray-200 space-y-2"><button class="w-full px-4 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium text-sm disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2"><!></button> <button class="w-full px-4 py-2.5 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors font-medium text-sm border border-gray-200">Start Over</button> <button class="w-full px-4 py-2.5 text-gray-500 hover:bg-gray-50 rounded-lg transition-colors text-sm">Cancel</button></div></div>'),jD=$u('<div class="flex h-full w-full"><div class="font-sans w-80 flex-shrink-0 flex flex-col h-full border-r border-gray-200 bg-white shadow-xl z-10 overflow-y-auto"><div class="p-5 space-y-5"><div class="flex items-center gap-3"><!> <div><h2 class="text-lg font-semibold text-gray-900">Add New Field</h2> <!></div></div>  <!></div></div> <div class="flex-1 relative bg-gray-100"><div class="absolute inset-0"></div></div></div>');function VD(e,t){Zs(t,!0);let r=fh(t,"validCropTypes",19,(()=>[])),n=fh(t,"mapInstance",3,null),i=fh(t,"mapPlaceholderRef",15,null);const o=new UO(new jL({basePath:"",headers:{"X-CSRFToken":bh.csrfToken}}));let a=$l(null),s=$l("select-type"),l=$l(""),c=$l(""),u=$l(null),d=null,h=$l(null),f=$l(null),p=$l(0),g=$l(!1),m=$l(0),y=$l(360),_=$l(null);const v={getCircleCenter:()=>yu(f),setCircleCenter:e=>{ql(f,e,!0)},getCircleRadiusMeters:()=>yu(p),setCircleRadiusMeters:e=>{ql(p,e,!0)},getCircleFinalized:()=>yu(g),setCircleFinalized:e=>{ql(g,e,!0)},getFieldType:()=>yu(a),getStartAngle:()=>yu(m),getEndAngle:()=>yu(y),setDrawnGeometry:e=>{ql(h,e,!0)},setDrawPhaseForm:()=>{ql(s,"form")}};let b=$l(!1),x=$l(""),w=$l("");const S=Dl((()=>{if(!yu(h))return"0";try{if("circular"===yu(h).type){const e=vD([yu(h).center_lng,yu(h).center_lat],yu(h).radius_meters,yu(a),yu(m),yu(y));if(e)return pS(e)}else if(yu(h).geojson){return pS(JSON.parse(yu(h).geojson))}}catch{}return"0"}));function k(e){ql(a,e,!0),ql(s,"drawing"),Bw.addFieldNeedsTypeSelection=!1,ql(u,"polygon"===e?null:"pivot",!0)}function T(e){if(!e.features?.length)return;const t=e.features[0].geometry;ql(h,{type:"polygon",geojson:JSON.stringify(t)},!0),ql(s,"form")}function I(){if(n()){if(d){try{n().off("draw.create",T),n().removeControl(d)}catch{}d=null}SD(n(),yu(_)),ql(_,null),lD(n())}}function M(){I(),t.onClose?.()}async function E(){if(!(yu(l)&&yu(c)&&yu(h)&&yu(u)))return;ql(b,!0),ql(x,""),ql(w,"");const e=function(){const e=bh.basePath.match(/\/a\/([^\/]+)\//);return e?e[1]:""}();try{const t=await o.farmFieldsCreate({teamSlug:e,farmField:{name:yu(l),boundaryGeojson:yu(h).geojson}});try{await fetch(`${bh.basePath}farms/api/farm-fields/${t.id}/`,{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({primary_irrigation_type:yu(u)})})}catch(e){console.error("Failed to set irrigation type:",e)}try{const e=await fetch(`${bh.basePath}farms/api/crop-zones/?field=${t.id}`,{headers:{"X-CSRFToken":bh.csrfToken}}),r=await e.json(),n=(Array.isArray(r)?r:r?.results??[])[0];n?.id&&await fetch(`${bh.basePath}farms/api/crop-zones/${n.id}/`,{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({crop_type:Number(yu(c))})})}catch(e){console.error("Failed to set crop type on auto-created zone:",e)}if("circular"===yu(a)||"semi-circular"===yu(a))try{await o.pivotIrrigationExtentsCreate({teamSlug:e,pivotIrrigationExtent:{fieldId:t.id,extentName:`${yu(l)} Extent`}})}catch(e){console.error("Failed to create pivot extent:",e)}ql(w,"Field created successfully!"),setTimeout((()=>{window.location.reload()}),800)}catch(e){console.error("Failed to create field:",e),ql(x,e?.body?.detail||"Failed to create field. Please try again.",!0)}finally{ql(b,!1)}}function P(){I(),ql(a,null),ql(s,"select-type"),ql(h,null),ql(f,null),ql(p,0),ql(g,!1),ql(m,0),ql(y,360),ql(l,""),ql(c,""),ql(u,null),ql(x,""),ql(w,"")}Tc((()=>{const e=n(),t=yu(s),r=yu(a);if(!e||"drawing"!==t||!r)return;const i=setTimeout((()=>{"polygon"===r?function(){if(!n())return;d=new yL({displayControlsDefault:!1,controls:{polygon:!1,trash:!1},defaultMode:"draw_polygon",styles:cD}),n().addControl(d),sD(n()),n().on("draw.create",T)}():e&&ql(_,wD(e,v),!0)}),400);return()=>{clearTimeout(i)}})),Tc((()=>{yu(m),yu(y);"semi-circular"===yu(a)&&yu(g)&&yu(f)&&n()&&kD(n(),v)})),Tc((()=>{yu(p);("circular"===yu(a)||"semi-circular"===yu(a))&&yu(g)&&yu(f)&&n()&&kD(n(),v)})),Tc((()=>(Bw.addFieldNeedsTypeSelection="select-type"===yu(s),()=>{Bw.addFieldNeedsTypeSelection=!1}))),Tc((()=>
31{if(n())return()=>{I()}}));var A=jD(),C=uc(A),R=uc(C),L=uc(R),O=uc(L),D=e=>{var t=TD();t.__click=M,WO(uc(t),{class:"w-5 h-5"}),Os(t),Yu(e,t)};ad(O,(e=>{t.farmFieldsGeojson?.features?.length&&e(D)}));var z=hc(O,2),F=hc(uc(z),2),N=e=>{var t=ID(),r=uc(t);Os(t),Pc((()=>Ju(r,`${yu(S)??""} Ha`))),Yu(e,t)};ad(F,(e=>{"form"===yu(s)&&yu(h)&&e(N)})),Os(z),Os(L);var B=hc(L,2),j=e=>{var t=MD(),r=hc(uc(t),2),n=uc(r);n.__click=()=>k("polygon");var i=hc(n,2);i.__click=()=>k("circular"),hc(i,2).__click=()=>k("semi-circular"),Os(r),Os(t),Yu(e,t)},V=e=>{var t=Zu(),n=dc(t),i=e=>{var t=CD(),r=uc(t),n=uc(r),i=e=>{var t=ED();Ds(2),Yu(e,t)},o=e=>{var t=Zu(),r=dc(t),n=e=>{var t=PD();Ds(2),Yu(e,t)},i=e=>{var t=AD(),r=hc(dc(t),4),n=uc(r);Os(r),Pc((e=>Ju(n,`Radius: ${e??""} m`)),[()=>Math.round(yu(p))]),Yu(e,t)};ad(r,(e=>{yu(f)?e(i,!1):e(n)}),!0),Yu(e,t)};ad(n,(e=>{"polygon"===yu(a)?e(i):e(o,!1)})),Os(r),hc(r,2).__click=P,Os(t),Yu(e,t)},o=e=>{var t=Zu(),n=dc(t),i=e=>{var t=BD(),n=uc(t),i=e=>{var t=RD(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(x)))),Yu(e,t)};ad(n,(e=>{yu(x)&&e(i)}));var o=hc(n,2),s=e=>{var t=LD(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(w)))),Yu(e,t)};ad(o,(e=>{yu(w)&&e(s)}));var d=hc(o,2),h=e=>{var t=OD(),r=hc(uc(t),2);Ld(r),Os(t),Kd(r,(()=>yu(p)),(e=>ql(p,e))),Yu(e,t)};ad(d,(e=>{"circular"!==yu(a)&&"semi-circular"!==yu(a)||e(h)}));var f=hc(d,2),g=e=>{var t=DD(),r=hc(uc(t),2),n=uc(r),i=hc(uc(n),2);Ld(i),Os(n);var o=hc(n,2),a=hc(uc(o),2);Ld(a),Os(o),Os(r),Os(t),Kd(i,(()=>yu(m)),(e=>ql(m,e))),Kd(a,(()=>yu(y)),(e=>ql(y,e))),Yu(e,t)};ad(f,(e=>{"semi-circular"===yu(a)&&e(g)}));var _=hc(f,2),v=hc(uc(_),2);Ld(v),Os(_);var k=hc(_,2),T=hc(uc(k),2),I=uc(T);I.value=I.__value="",Il(hc(I),17,r,Tl,((e,t)=>{var r=zD(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t).name),i!==(i=yu(t).id)&&(r.value=(r.__value=yu(t).id)??"")})),Yu(e,r)})),Os(T),Os(k);var A=hc(k,2),C=hc(uc(A),2),R=uc(C);R.value=(R.__value=null)??"";var L=hc(R);L.value=L.__value="pivot";var O=hc(L);O.value=O.__value="hose_reel";var D=hc(O);D.value=D.__value="drip";var z=hc(D);z.value=z.__value="none",Os(C);var F=hc(C,2),N=e=>{Yu(e,FD())};ad(F,(e=>{"polygon"!==yu(a)&&e(N)})),Os(A);var B=hc(A,2),j=uc(B),V=hc(uc(j),2),G=uc(V);Os(V),Os(j),Os(B);var U=hc(B,2),$=uc(U);$.__click=E;var H=uc($),q=e=>{var t=ND();Ds(),Yu(e,t)},W=e=>{Yu(e,Wu("Create Field"))};ad(H,(e=>{yu(b)?e(q):e(W,!1)})),Os($);var Z=hc($,2);Z.__click=P;var Y=hc(Z,2);Y.__click=M,Os(U),Os(t),Pc((()=>{C.disabled="polygon"!==yu(a),Ju(G,`${yu(S)??""} Ha`),$.disabled=yu(b)||!yu(l)||!yu(c)||!yu(u),Z.disabled=yu(b),Y.disabled=yu(b)})),Kd(v,(()=>yu(l)),(e=>ql(l,e))),Md(T,(()=>yu(c)),(e=>ql(c,e))),Md(C,(()=>yu(u)),(e=>ql(u,e))),Yu(e,t)};ad(n,(e=>{"form"===yu(s)&&e(i)}),!0),Yu(e,t)};ad(n,(e=>{"drawing"===yu(s)?e(i):e(o,!1)}),!0),Yu(e,t)};ad(B,(e=>{"select-type"===yu(s)?e(j):e(V,!1)})),Os(R),Os(C);var G=hc(C,2);nh(uc(G),(e=>i(e)),(()=>i())),Os(G),Os(A),Yu(e,A),Ys()}function GD(e){return GD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GD(e)}function UD(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */UD=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}
vendor: 4,251 bytes, line 31
31))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==GD(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(GD(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}
31},t}function $D(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function HD(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){$D(o,n,i,a,s,"next",e)}function s(e){$D(o,n,i,a,s,"throw",e)}a(void 0)}))}}function qD(e,t){return WD.apply(this,arguments)}function WD(){return(WD=HD(UD().mark((function e(t,r){return UD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/edit-farm/update-field-name/").concat(t,"/"),{method:"POST",headers:{"X-CSRFToken":bh.csrfToken,"Content-Type":"application/x-www-form-urlencoded"},body:"name=".concat(encodeURIComponent(r))});case 2:if(e.sent.ok){e.next=5;break}throw new Error("Failed to update field name");case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZD(e,t){return YD.apply(this,arguments)}function YD(){return(YD=HD(UD().mark((function e(t,r){var n,i;return UD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/edit-farm/update-crop-type/").concat(t,"/"),{method:"POST",headers:{"X-CSRFToken":bh.csrfToken,"Content-Type":"application/x-www-form-urlencoded"},body:"crop_type=".concat(encodeURIComponent(r))});case 2:if((n=e.sent).ok){e.next=8;break}return e.next=6,n.json().catch((function(){return{}}));case 6:throw i=e.sent,new Error(i.error||"Failed to update crop type");case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function XD(){return(XD=HD(UD().mark((function e(t,r){var n,i,o,a,s;return UD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/api/farm-fields/").concat(t,"/vri-settings/"),{method:"PATCH",headers:{"X-CSRFToken":bh.csrfToken,"Content-Type":"application/json"},body:JSON.stringify(r)});case 2:if((n=e.sent).ok){e.next=9;break}return e.next=6,n.json().catch((function(){return{}}));case 6:throw a=e.sent,s=a.detail||(null===(i=a.vri_cap_min_pct)||void 0===i?void 0:i[0])||(null===(o=a.vri_target_min_pct)||void 0===o?void 0:o[0])||"Failed to save VRI settings",new Error(s);case 9:return e.abrupt("return",n.json());case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function KD(e,t){return JD.apply(this,arguments)}function JD(){return(JD=HD(UD().mark((function e(t,r){return UD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/api/farm-fields/").concat(t,"/"),{method:"PATCH",headers:{"X-CSRFToken":bh.csrfToken,"Content-Type":"application/json"},body:JSON.stringify({primary_irrigation_type:r})});case 2:if(e.sent.ok){e.next=5;break}throw new Error("Failed to update irrigation type");case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function QD(e,t){return ez.apply(this,arguments)}function ez(){return(ez=HD(UD().mark((function e(t,r){var n,i,o;return UD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/api/crop-zones/").concat(t,"/"),{method:"PATCH",headers:{"X-CSRFToken":bh.csrfToken,"Content-Type":"application/json"},body:JSON.stringify(r)});case 2:if((n=e.sent).ok){e.next=8;break}return e.next=6,n.json().catch((function(){return{}}));case 6:throw o=e.sent,new Error(o.detail||(null===(i=o.name)||void 0===i?void 0:i[0])||"Failed to update crop zone");case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tz(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */tz=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 31
31if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==oz(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(oz(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
31if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function rz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rz(Object(r),!0).forEach((function(t){iz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function iz(e,t,r){return(t=cz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oz(e){return oz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oz(e)}function az(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function sz(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){az(o,n,i,a,s,"next",e)}function s(e){az(o,n,i,a,s,"throw",e)}a(void 0)}))}}function lz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cz(n.key),n)}}function cz(e){var t=function(e,t){if("object"!=oz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=oz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oz(t)?t:t+""}function uz(e,t,r){return t=pz(t),function(e,t){if(t&&("object"==oz(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hz()?Reflect.construct(t,r||[],pz(e).constructor):t.apply(e,r))}function dz(e){var t="function"==typeof Map?new Map:void 0;return dz=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(hz())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&fz(i,r.prototype),i}(e,arguments,pz(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),fz(r,e)},dz(e)}function hz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hz=function(){return!!e})()}function fz(e,t){return fz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fz(e,t)}function pz(e){return pz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pz(e)}Bu(["click"]);var gz=function(e){function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:401;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=uz(this,t,[e])).name="RaindancerAuthError",r.status=n,r}return function(e,t){if("function"!=typeof t&&null!==t)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&&fz(e,t)}(t,e),function(e,t,r){return t&&lz(e.prototype,t),r&&lz(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(dz(Error));function mz(e){return yz.apply(this,arguments)}function yz(){return yz=sz(tz().mark((function e(t){var r,n,i,o=arguments;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},n="".concat((a=void 0,a=bh.basePath.replace(/\/$/,""),"".concat(a,"/raindancer/api"))).concat(t),i=nz({"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},r.headers||{}),e.abrupt("return",fetch(n,nz(nz({},r),{},{headers:i,credentials:"same-origin"})));case 4:case"end":return e.stop()}var a}),e)}))),yz.apply(this,arguments)}function _z(e){return vz.apply(this,arguments)}function vz(){return(vz=sz(tz().mark((function e(t){var r,n;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(401!==t.status){e.next=12;break}return r="Raindancer session expired. Please reconnect.",e.prev=2,e.next=5,t.clone().json();case 5:null!=(n=e.sent)&&n.error&&(r=n.error),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:throw new gz(r,401);case 12:case"end":return e.stop()}}),e,null,[[2,9]])}
31)))).apply(this,arguments)}function bz(){return(bz=sz(tz().mark((function e(t,r,n){var i,o,a;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={},r&&(i.zones=r),n&&(i.crop_zone_id=n),e.next=5,mz("/vri-push/".concat(t,"/push/"),{method:"POST",body:JSON.stringify(i)});case 5:return o=e.sent,e.next=8,_z(o);case 8:return e.next=10,o.json();case 10:if(a=e.sent,o.ok){e.next=13;break}throw new Error(a.error||"Failed to push VRI zones to Raindancer");case 13:return e.abrupt("return",a);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xz(){return(xz=sz(tz().mark((function e(t){var r,n;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mz("/fields/".concat(t,"/orphan/"),{method:"POST",body:JSON.stringify({})});case 2:if((r=e.sent).ok){e.next=8;break}return e.next=6,r.json().catch((function(){return{}}));case 6:throw n=e.sent,new Error(n.error||"Failed to disconnect field from Raindancer");case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wz(e){return Sz.apply(this,arguments)}function Sz(){return(Sz=sz(tz().mark((function e(t){var r,n;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mz("/vri-zones/".concat(t,"/zones/"));case 2:return r=e.sent,e.next=5,_z(r);case 5:return e.next=7,r.json();case 7:if(n=e.sent,r.ok){e.next=10;break}throw new Error(n.error||"Failed to fetch VRI zones");case 10:return e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kz(){return(kz=sz(tz().mark((function e(t){var r,n,i;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mz("/vri-zones/".concat(t,"/zones/"),{method:"DELETE"});case 2:return n=e.sent,e.next=5,_z(n);case 5:return e.next=7,n.json();case 7:if(i=e.sent,n.ok){e.next=10;break}throw new Error(i.error||"Failed to delete VRI zones");case 10:return e.abrupt("return",{deleted:null!==(r=i.deleted)&&void 0!==r?r:0});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tz(){return(Tz=sz(tz().mark((function e(t){var r,n;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mz("/vri-push/crop-zones/".concat(t,"/auto-push-status/"));case 2:return r=e.sent,e.next=5,r.json();case 5:if(n=e.sent,r.ok){e.next=8;break}throw new Error(n.error||"Failed to get auto-push status");case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Iz(e,t,r){return Mz.apply(this,arguments)}function Mz(){return(Mz=sz(tz().mark((function e(t,r,n){var i,o,a;return tz().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={enabled:r},void 0!==n&&(i.vri_source=n),e.next=4,mz("/vri-push/crop-zones/".concat(t,"/auto-push/"),{method:"POST",body:JSON.stringify(i)});case 4:return o=e.sent,e.next=7,o.json();case 7:if(a=e.sent,o.ok){e.next=10;break}throw new Error(a.error||"Failed to update auto-push setting");case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ez(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return eS(e,(e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])})),r}var Pz=$u("<option> </option>"),Az=$u('<div><label class="block text-sm font-medium text-gray-700 mb-1.5">Crop Type</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors bg-white"><option>Select crop type...</option><!></select></div>'),Cz=$u('<button type="button"><div class="font-medium text-gray-900"> </div> <div class="text-xs text-gray-500"> </div></button>'),Rz=$u("<option> </option>"),Lz=$u('<div class="pt-3 border-t border-gray-200 space-y-4"><div><label class="block text-sm font-medium text-gray-700 mb-1.5">Zone name</label> <input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors" placeholder="Zone name"/></div> <div><label class="block text-sm font-medium text-gray-700 mb-1.5">Crop Type</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors bg-white"><option>Select crop type...</option><!></select></div></div>'),Oz=$u('<div><label class="block text-sm font-medium text-gray-700 mb-1.5">Crop Zones</label> <div class="space-y-1.5"></div></div> <!>',1),Dz=$u('<p class="text-xs text-amber-600 mt-1"> </p>'),zz=$u('<p class="text-xs text-gray-500 mb-3">Click on the map to set a new pivot center, then move the cursor to adjust the radius\n          and click again to confirm. The original pivot is shown faintly underneath as a reference.\n          Use the angle inputs below to reshape the arc.</p> <div class="grid grid-cols-2 gap-2 mb-3"><div><label for="pivot-start-angle" class="block text-xs font-medium text-gray-600 mb-1">Start angle (°)</label> <input id="pivot-start-angle" type="number" min="0" max="360" step="1" class="w-full px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500"/></div> <div><label for="pivot-end-angle" class="block text-xs font-medium text-gray-600 mb-1">End angle (°)</label> <input id="pivot-end-angle" type="number" min="0" max="360" step="1" class="w-full px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500"/></div></div>',1),Fz=$u('<p class="text-xs text-gray-500 mb-3">Drag the polygon vertices on the map to adjust the field boundary. The area will update automatically.</p>'),Nz=$u('<p class="text-xs text-gray-500 mb-3">Drag the polygon vertices on the map to adjust the boundary of <span class="font-medium text-gray-700"> </span>.\n          The overall field outline is locked while zones exist.</p>'),Bz=$u('<p class="text-xs text-gray-500 mb-3">Select a crop zone above to edit its boundary on the map.</p>'),jz=$u('<span class="text-xs text-amber-600 font-medium">(modified)</span>'),Vz=$u('<span class="text-xs text-amber-600 font-medium">(modified)</span>'),Gz=$u('<span class="text-xs text-amber-600 font-medium">(zone modified)</span>'),Uz=$u('<div class="px-3 py-2 bg-green-50 rounded-lg text-sm text-green-700 font-medium"> </div>'),$z=$u('<div class="px-3 py-2 bg-red-50 rounded-lg text-sm text-red-600 font-medium"> </div>'),Hz=$u('<div class="pt-3 border-t border-gray-200"><button class="w-full text-left px-3 py-2.5 rounded-lg hover:bg-amber-50 transition-colors text-sm text-amber-700 font-medium disabled:opacity-50"> </button> <p class="text-xs text-gray-500 mt-1 px-1">Keeps the field in Karl and lets you reconnect later.</p></div>'),qz=$u('<div class="flex h-full w-full"><div class="font-sans w-80 flex-shrink-0 flex flex-col h-full border-r border-gray-200 bg-white shadow-xl z-10 overflow-y-auto"><div class="p-5 space-y-5"><div class="flex items-center gap-3"><button class="p-1.5 hover:bg-gray-100 rounded-lg transition-colors text-gray-500 hover:text-gray-700" title="Back to field view"><!></button> <div><h2 class="text-lg font-semibold text-gray-900">Edit Field</h2> <p class="text-sm text-gray-500"> </p></div></div> <div><label class="block text-sm font-medium text-gray-700 mb-1.5">
31Field Name</label> <input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors" placeholder="Enter field name"/></div> <!> <div><label class="block text-sm font-medium text-gray-700 mb-1.5">Irrigation Type</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors bg-white"><option>Not set</option><option>Center Pivot</option><option>Hose Reel</option><option>Drip Irrigation</option><option>None / Other</option></select> <!></div> <div class="pt-3 border-t border-gray-200"><h4 class="text-sm font-medium text-gray-700 mb-2">Boundary</h4> <!> <div class="flex items-center gap-2 text-sm"><span class="text-gray-600">Area:</span> <span class="font-medium text-gray-900"> </span> <!></div></div> <!> <!> <div class="pt-3 border-t border-gray-200 space-y-2"><button class="w-full px-4 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium text-sm disabled:opacity-50 disabled:cursor-not-allowed"> </button> <button class="w-full px-4 py-2.5 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors font-medium text-sm border border-gray-200">Cancel</button></div> <!> <div class="pt-3 border-t border-gray-200"><button class="w-full text-left px-3 py-2.5 rounded-lg hover:bg-red-50 transition-colors text-sm text-red-600 font-medium">Delete Field</button></div></div></div> <div class="flex-1 relative bg-gray-100"><div class="absolute inset-0"></div></div></div>');function Wz(e,t){Zs(t,!0);let r=fh(t,"validCropTypes",19,(()=>[])),n=fh(t,"mapInstance",3,null),i=fh(t,"mapPlaceholderRef",15,null),o=null;const a=Dl((()=>t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===Bw.selectedFieldId)))),s=Dl((()=>yu(a)?.properties?.name||Bw.selectedFieldName||"")),l=Dl((()=>{const e=yu(a)?.properties?.crop_zones;return Array.isArray(e)?e:[]})),c=Dl((()=>yu(l).length>1)),u=Dl((()=>yu(l)[0]?.crop_type||"")),d=Dl((()=>{const e=yu(a)?.properties;return e?.primary_irrigation_type||null})),h=Dl((()=>{switch(yu(d)){case"pivot":return"Center Pivot";case"hose_reel":return"Hose Reel";case"drip":return"Drip Irrigation";case"none":return"None / Other";default:return"Not Set"}})),f=Dl((()=>{const e=yu(a)?.properties;if(!e)return null;
31const t=e.radius??e.radius_meters,r=e.center;if("number"!=typeof t||!Array.isArray(r)||2!==r.length)return null;const n="number"==typeof e.start_angle?e.start_angle:0,i="number"==typeof e.end_angle?e.end_angle:360;return{center:[r[0],r[1]],radiusMeters:t,startAngle:n,endAngle:i}})),p=Dl((()=>null!==yu(f))),g=Dl((()=>yu(p)&&!yu(c)));let m=null,y=$l(null),_=$l(0),v=$l(!1),b=$l(0),x=$l(360),w=$l("circular"),S=$l(null),k=$l(null);const T=Dl((()=>null!==yu(k)?yu(k).toFixed(1):yu(a)?.geometry?pS(yu(a)):"0"));let I=$l(""),M=$l(""),E=$l(null),P=$l(!1),A=$l(null),C=$l(null),R=$l(!1),L=$l(Jl([]));const O=Dl((()=>yu(L).find((e=>e.cropZoneId===Bw.selectedCropZoneId))??null)),D=Dl((()=>yu(I)!==yu(s)||(yu(E)!==yu(d)||(yu(c)?yu(L).some((e=>e.name!==e.originalName||e.cropType!==e.originalCropType||e.boundaryChanged)):yu(M)!==yu(u)||(!(!yu(g)||!yu(Z))||!!yu(R))))));Tc((()=>{yu(a)&&(ql(I,yu(s),!0),ql(M,yu(u),!0),ql(E,yu(d),!0),ql(A,null),ql(C,null),ql(R,!1),ql(k,null),ql(L,yu(l).map((e=>({id:e.id,cropZoneId:e.crop_zone_id,name:e.name??"",originalName:e.name??"",cropType:e.crop_type??"",originalCropType:e.crop_type??"",boundary:e.boundary,originalBoundary:e.boundary,boundaryChanged:!1}))),!0),yu(c)&&!Bw.selectedCropZoneId?Bw.selectedCropZoneId=yu(L)[0]?.cropZoneId??null:yu(c)||(Bw.selectedCropZoneId=null))})),Tc((()=>{if(!n()||!yu(a))return;yu(c)&&Bw.selectedCropZoneId;const e=yu(g),t=setTimeout((()=>{e?function(){if(!n()||!yu(f))return;if(ql(y,null),ql(_,yu(f).radiusMeters,!0),ql(v,!1),ql(b,yu(f).startAngle,!0),ql(x,yu(f).endAngle,!0),ql(w,0===yu(f).startAngle&&360===yu(f).endAngle?"circular":"semi-circular",!0),ql(S,null),sD(n()),function(){if(!n()||!yu(f))return;if(n().getSource(U))return;const e=vD(yu(f).center,yu(f).radiusMeters,0===yu(f).startAngle&&360===yu(f).endAngle?"circular":"semi-circular",yu(f).startAngle,yu(f).endAngle);n().addSource(U,{type:"geojson",data:{type:"FeatureCollection",features:e?[e]:[]}}),n().addLayer({id:$,type:"fill",source:U,paint:{"fill-color":"#9ca3af","fill-opacity":.12}}),n().addLayer({id:H,type:"line",source:U,paint:{"line-color":"#6b7280","line-width":1.5,"line-dasharray":[3,3]}})}(),yu(a))try{const e=Ez(yu(a));n().fitBounds(e,{padding:80,maxZoom:17})}catch{}m=wD(n(),q)}():function(){if(!n()||!yu(a))return;let e=null;if(yu(c)){const t=yu(L).find((e=>e.cropZoneId===Bw.selectedCropZoneId));e=t?.boundary??null}else e=yu(a).geometry??null;if(!e)return;o=new yL({displayControlsDefault:!1,controls:{polygon:!1,trash:!1},defaultMode:"simple_select",styles:cD}),n().addControl(o);const t={type:"Feature",geometry:e,properties:{}},r=o.add(t);sD(n()),function(){if(!n()||!yu(a))return;if(V(),yu(c)){const e=Bw.selectedCropZoneId,t=yu(L).filter((t=>t.cropZoneId!==e&&t.boundary));n().addSource(z,{type:"geojson",data:{type:"FeatureCollection",features:t.map((e=>({type:"Feature",geometry:e.boundary,properties:{name:e.name,crop_type:e.cropType}})))}}),n().addLayer({id:F,type:"fill",source:z,paint:{"fill-color":"#94a3b8","fill-opacity":.2}}),n().addLayer({id:N,type:"line",source:z,paint:{"line-color":"#64748b","line-width":2,"line-dasharray":[2,2]}})}yu(c)&&yu(a).geometry&&(n().addSource(B,{type:"geojson",data:{type:"Feature",geometry:yu(a).geometry,properties:{}}}),n().addLayer({id:j,type:"line",source:B,paint:{"line-color":"#1f2937","line-width":2}}))}(),r?.[0]&&o.changeMode("direct_select",{featureId:r[0]});const i=Ez({type:"Feature",geometry:e,properties:{}});n().fitBounds(i,{padding:80,maxZoom:17}),n().on("draw.update",Y),n().on("draw.selectionchange",Y)}()}),400);return()=>{clearTimeout(t),e?function(){if(!n())return void(m=null);SD(n(),m),m=null,function(){if(!n())return;try{n().getLayer(H)&&n().removeLayer(H),n().getLayer($)&&n().removeLayer($),n().getSource(U)&&n().removeSource(U)}catch{}}(),lD(n())}():G()}}));const z="edit-mode-zones",F="edit-mode-zones-fill",N="edit-mode-zones-outline",B="edit-mode-field-outline",j="edit-mode-field-outline";function V(){if(n()){for(const e of[F,N,j])n().getLayer(e)&&n().removeLayer(e);for(const e of[z,B])n().getSource(e)&&n().removeSource(e)}}function G(){if(o&&n())try{n().off("draw.update",Y),n().off("draw.selectionchange",Y),n().removeControl(o)}catch{}o=null,V(),lD(n())}const U="edit-pivot-reference-src",$="edit-pivot-reference-fill",H="edit-pivot-reference-outline";const q={getCircleCenter:()=>yu(y),setCircleCenter:e=>{ql(y,e,!0)},getCircleRadiusMeters:()=>yu(_),setCircleRadiusMeters:e=>{ql(_,e,!0)},getCircleFinalized:()=>yu(v),setCircleFinalized:e=>{ql(v,e,!0)},getFieldType:()=>yu(w),getStartAngle:()=>yu(b),getEndAngle:()=>yu(x),setDrawnGeometry:e=>{ql(S,e,!0),ql(k,Math.PI*(e.radius_meters/100)**2/100)},setDrawPhaseForm:()=>{}};function W(){n()&&yu(y)&&yu(v)&&(ql(w,0===yu(b)&&360===yu(x)?"circular":"semi-circular",!0),kD(n(),q))}const Z=Dl((()=>!(!yu(g)||!yu(f))&&(!(!yu(v)||!yu(y)||yu(_)<=0)||(yu(b)!==yu(f).startAngle||yu(x)!==yu(f).endAngle))));function Y(){if(!o)return;const e=o.getAll();if(0===e.features.length)return;const t=e.features[0];if(ql(k,fS(t),!0),yu(c)){const e=Bw.selectedCropZoneId,r=yu(L).find((t=>t.cropZoneId===e));r&&(r.boundary=t.geometry,r.boundaryChanged=!0)}else ql(R,!0)}function X(){G(),Bw.selectedCropZoneId=null,t.onClose?.()}const K=Dl((()=>!!yu(a)?.properties?.raindancer_field_guid));let J=$l(!1);async function Q(){const e=Bw.selectedFieldId;if(e&&confirm(`Disconnect "${yu(s)}" from Raindancer?\n\nThe field stays in Karl with all its history. You can reconnect it later from the Raindancer page.`)){ql(J,!0),ql(A,null);try{await function(e){return xz.apply(this,arguments)}(e),window.location.reload()}catch(e){ql(A,e instanceof Error?e.message:"Failed to disconnect from Raindancer",!0),ql(J,!1)}}}var ee=qz(),te=uc(ee),re=uc(te),ne=uc(re),ie=uc(ne);ie.__click=X,WO(uc(ie),{class:"w-5 h-5"}),Os(ie);var oe=hc(ie,2),ae=hc(uc(oe),2),se=uc(ae);Os(ae),Os(oe),Os(ne);var le=hc(ne,2),ce=hc(uc(le),2);Ld(ce),Os(le);var ue=hc(le,2),de=e=>{var t=Az(),n=hc(uc(t),2),i=uc(n);i.value=i.__value="",Il(hc(i),17,r,Tl,((e,t)=>
31{var r=Pz(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t)),i!==(i=yu(t))&&(r.value=(r.__value=yu(t))??"")})),Yu(e,r)})),Os(n),Os(t),Md(n,(()=>yu(M)),(e=>ql(M,e))),Yu(e,t)},he=e=>{var t=Oz(),n=dc(t),i=hc(uc(n),2);Il(i,21,(()=>yu(L)),(e=>e.cropZoneId),((e,t)=>{var r=Cz();r.__click=()=>{return e=yu(t).cropZoneId,void(Bw.selectedCropZoneId=e);var e};var n=uc(r),i=uc(n,!0);Os(n);var o=hc(n,2),a=uc(o);Os(o),Os(r),Pc((()=>{wd(r,1,"w-full text-left px-3 py-2 rounded-lg border transition-colors text-sm "+(Bw.selectedCropZoneId===yu(t).cropZoneId?"border-blue-500 bg-blue-50":"border-gray-200 hover:bg-gray-50")),Ju(i,yu(t).name||"Unnamed zone"),Ju(a,`${(yu(t).cropType||"No crop type")??0}${yu(t).boundaryChanged?" · boundary modified":""}`)})),Yu(e,r)})),Os(i),Os(n);var o=hc(n,2),a=e=>{var t=Lz(),n=uc(t),i=hc(uc(n),2);Ld(i),Os(n);var o=hc(n,2),a=hc(uc(o),2),s=uc(a);s.value=s.__value="",Il(hc(s),17,r,Tl,((e,t)=>{var r=Rz(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t)),i!==(i=yu(t))&&(r.value=(r.__value=yu(t))??"")})),Yu(e,r)})),Os(a),Os(o),Os(t),Kd(i,(()=>yu(O).name),(e=>yu(O).name=e)),Md(a,(()=>yu(O).cropType),(e=>yu(O).cropType=e)),Yu(e,t)};ad(o,(e=>{yu(O)&&e(a)})),Yu(e,t)};ad(ue,(e=>{yu(c)?e(he,!1):e(de)}));var fe=hc(ue,2),pe=hc(uc(fe),2),ge=uc(pe);ge.value=(ge.__value=null)??"";var me=hc(ge);me.value=me.__value="pivot";var ye=hc(me);ye.value=ye.__value="hose_reel";var _e=hc(ye);_e.value=_e.__value="drip";var ve=hc(_e);ve.value=ve.__value="none",Os(pe);var be=hc(pe,2),xe=e=>{var t=Dz(),r=uc(t);Os(t),Pc((e=>Ju(r,`⚠ Changing type will remove existing ${e??""} machinery from this field.`)),[()=>yu(h).toLowerCase()]),Yu(e,t)};ad(be,(e=>{yu(E)!==yu(d)&&yu(d)&&"pivot"!==yu(d)&&"none"!==yu(d)&&e(xe)})),Os(fe);var we=hc(fe,2),Se=hc(uc(we),2),ke=e=>{var t=zz(),r=hc(dc(t),2),n=uc(r),i=hc(uc(n),2);Ld(i),i.__change=W,Os(n);var o=hc(n,2),a=hc(uc(o),2);Ld(a),a.__change=W,Os(o),Os(r),Kd(i,(()=>yu(b)),(e=>ql(b,e))),Kd(a,(()=>yu(x)),(e=>ql(x,e))),Yu(e,t)},Te=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Fz())},i=e=>{var t=Zu(),r=dc(t),n=e=>{var t=Nz(),r=hc(uc(t)),n=uc(r,!0);Os(r),Ds(),Os(t),Pc((()=>Ju(n,yu(O).name||"the selected zone"))),Yu(e,t)},i=e=>{Yu(e,Bz())};ad(r,(e=>{yu(O)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(r,(e=>{yu(c)?e(i,!1):e(n)}),!0),Yu(e,t)};ad(Se,(e=>{yu(g)?e(ke):e(Te,!1)}));var Ie=hc(Se,2),Me=hc(uc(Ie),2),Ee=uc(Me);Os(Me);var Pe=hc(Me,2),Ae=e=>{Yu(e,jz())},Ce=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Vz())},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Gz())};ad(r,(e=>{yu(c)&&yu(O)?.boundaryChanged&&e(n)}),!0),Yu(e,t)};ad(r,(e=>{!yu(c)&&yu(R)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(Pe,(e=>{yu(g)&&yu(Z)?e(Ae):e(Ce,!1)})),Os(Ie),Os(we);var Re=hc(we,2),Le=e=>{var t=Uz(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(C)))),Yu(e,t)};ad(Re,(e=>{yu(C)&&e(Le)}));var Oe=hc(Re,2),De=e=>{var t=$z(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(A)))),Yu(e,t)};ad(Oe,(e=>{yu(A)&&e(De)}));var ze=hc(Oe,2),Fe=uc(ze);Fe.__click=async function(){if(!Bw.selectedFieldId)return;const e=Bw.selectedFieldId;ql(P,!0),ql(A,null),ql(C,null);try{if(yu(I)!==yu(s)&&(await qD(e,yu(I)),Bw.selectedFieldName=yu(I)),!yu(c)&&yu(M)&&yu(M)!==yu(u)&&await ZD(e,yu(M)),yu(E)!==yu(d)){const r=Bw.selectedFieldId;yu(d)&&"pivot"!==yu(d)&&"none"!==yu(d)&&await async function(e,r){try{if("hose_reel"===r&&t.hoseReelRoutesGeojson?.features)for(const r of t.hoseReelRoutesGeojson.features){const t=r.properties;t?.farm_field!==e&&t?.farm_field_id!==e||await fetch(`${bh.basePath}farms/api/hose-reel-irrigation-routes/${r.id}/`,{method:"DELETE",headers:{"X-CSRFToken":bh.csrfToken,"X-Requested-With":"XMLHttpRequest"}})}else if("drip"===r&&t.dripBoundariesGeojson?.features)for(const r of t.dripBoundariesGeojson.features){const t=r.properties;t?.farm_field!==e&&t?.farm_field_id!==e||await fetch(`${bh.basePath}farms/api/drip-irrigation-boundaries/${r.id}/`,{method:"DELETE",headers:{"X-CSRFToken":bh.csrfToken,"X-Requested-With":"XMLHttpRequest"}})}}catch(e){console.warn("Failed to clean up old machinery:",e)}}(r,yu(d)),await KD(e,yu(E)),t.farmFieldsGeojson&&yu(a)?.properties&&(yu(a).properties.primary_irrigation_type=yu(E))}if(!yu(c)&&yu(g)&&yu(Z)&&yu(f)){const t=yu(v)&&yu(y)?yu(y):yu(f).center,r=yu(v)&&yu(_)>0?yu(_):yu(f).radiusMeters,n=0===yu(b)&&360===yu(x),i=JSON.stringify({type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[t[0],t[1]]}
31,properties:{radius:r,start_angle:n?0:yu(b),end_angle:n?360:yu(x)}}]}),o=await fetch(`${bh.basePath}farms/api/farm-fields/${e}/`,{method:"PATCH",headers:{"X-CSRFToken":bh.csrfToken,"Content-Type":"application/json"},body:JSON.stringify({boundary_geojson:i})});if(!o.ok){const e=await o.json().catch((()=>({})));throw new Error(e?.boundary_geojson?.[0]||e?.detail||"Failed to update field")}}else if(!yu(c)&&yu(R)&&o){const t=o.getAll();if(t.features.length>0){const r=t.features[0].geometry,n=JSON.stringify({type:"FeatureCollection",features:[{type:"Feature",geometry:r,properties:{}}]}),i=await fetch(`${bh.basePath}farms/api/farm-fields/${e}/`,{method:"PATCH",headers:{"X-CSRFToken":bh.csrfToken,"Content-Type":"application/json"},body:JSON.stringify({boundary_geojson:n})});if(!i.ok){const e=await i.json().catch((()=>({})));throw new Error(e?.boundary_geojson?.[0]||e?.detail||"Failed to update field")}}}if(yu(c))for(const e of yu(L)){const t={};e.name!==e.originalName&&(t.name=e.name),e.cropType!==e.originalCropType&&(t.crop_type_name=e.cropType),e.boundaryChanged&&e.boundary&&(t.boundary_geojson=JSON.stringify({type:"FeatureCollection",features:[{type:"Feature",geometry:e.boundary,properties:{}}]})),0!==Object.keys(t).length&&await QD(e.id,t)}if(t.farmFieldsGeojson&&yu(a)){const r=t.farmFieldsGeojson.features.find((t=>Number(t.id)===e));if(r){if(r.properties&&(r.properties.name=yu(I),!yu(c)&&yu(M)!==yu(u)&&r.properties.crop_zones?.[0]&&(r.properties.crop_zones[0].crop_type=yu(M)),yu(c))){const e=r.properties.crop_zones;if(Array.isArray(e))for(const t of e){const e=yu(L).find((e=>e.cropZoneId===t.crop_zone_id));e&&(t.name=e.name,t.crop_type=e.cropType||null,e.boundaryChanged&&e.boundary&&(t.boundary=e.boundary))}}if(!yu(c)&&yu(R)&&o){const e=o.getAll();e.features.length>0&&(r.geometry=e.features[0].geometry)}}}if(n()&&t.farmFieldsGeojson){const e=n().getSource("farm-fields");e?.setData&&e.setData(t.farmFieldsGeojson)}ql(C,"Field saved successfully"),ql(R,!1),setTimeout((()=>{G(),t.onClose?.()}),800)}catch(e){ql(A,e.message||"Failed to save changes",!0)}finally{ql(P,!1)}};var Ne=uc(Fe,!0);Os(Fe);var Be=hc(Fe,2);Be.__click=X,Os(ze);var je=hc(ze,2),Ve=e=>{var t=Hz(),r=uc(t);r.__click=Q;var n=uc(r,!0);Os(r),Ds(2),Os(t),Pc((()=>{r.disabled=yu(J)||yu(P),Ju(n,yu(J)?"Disconnecting...":"Disconnect from Raindancer")})),Yu(e,t)};ad(je,(e=>{yu(K)&&e(Ve)}));var Ge=hc(je,2);uc(Ge).__click=async function(){if(!confirm(`Are you sure you want to delete "${yu(s)}"? This action cannot be undone.`))return;const e=Bw.selectedFieldId;G();try{(await fetch(`${bh.basePath}farms/edit-farm/delete-farm-field/${e}/`,{method:"POST",headers:{"X-CSRFToken":bh.csrfToken}})).ok?window.location.reload():alert("Failed to delete field. Please try again.")}catch{alert("Error deleting field. Please try again.")}},Os(Ge),Os(re),Os(te);var Ue=hc(te,2);nh(uc(Ue),(e=>i(e)),(()=>i())),Os(Ue),Os(ee),Pc((()=>{Ju(se,`${(yu(s)||`Field ${Bw.selectedFieldId}`)??""} · ${yu(T)??""} Ha`),Ju(Ee,`${yu(T)??""} Ha`),Fe.disabled=yu(P)||!yu(D),Ju(Ne,yu(P)?"Saving...":"Save Changes"),Be.disabled=yu(P)})),Kd(ce,(()=>yu(I)),(e=>ql(I,e))),Md(pe,(()=>yu(E)),(e=>ql(E,e))),Yu(e,ee),Ys()}Bu(["click","change"]);var Zz=qu("<title> </title>"),Yz=qu("<desc> </desc>"),Xz=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M5 12h14m-7 7V5"></path></svg>');function Kz(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"plus outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=Xz();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=Zz(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=Yz(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}var Jz=qu("<title> </title>"),Qz=qu("<desc> </desc>"),eF=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"></path></svg>');function tF(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"trash bin outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=eF();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewB
31ox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=Jz(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=Qz(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}const rF=11102230246251565e-32,nF=134217729,iF=(3+8*rF)*rF;function oF(e,t,r,n,i){let o,a,s,l,c=t[0],u=n[0],d=0,h=0;u>c==u>-c?(o=c,c=t[++d]):(o=u,u=n[++h]);let f=0;if(d<e&&h<r)for(u>c==u>-c?(a=c+o,s=o-(a-c),c=t[++d]):(a=u+o,s=o-(a-u),u=n[++h]),o=a,0!==s&&(i[f++]=s);d<e&&h<r;)u>c==u>-c?(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++d]):(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=n[++h]),o=a,0!==s&&(i[f++]=s);for(;d<e;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=t[++d],o=a,0!==s&&(i[f++]=s);for(;h<r;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=n[++h],o=a,0!==s&&(i[f++]=s);return 0===o&&0!==f||(i[f++]=o),f}function aF(e){return new Float64Array(e)}const sF=aF(4),lF=aF(8),cF=aF(12),uF=aF(16),dF=aF(4);function hF(e,t,r,n,i,o){const a=(t-o)*(r-i),s=(e-i)*(n-o),l=a-s,c=Math.abs(a+s);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,r,n,i,o,a){let s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k;const T=e-i,I=r-i,M=t-o,E=n-o;b=T*E,h=nF*T,f=h-(h-T),p=T-f,h=nF*E,g=h-(h-E),m=E-g,x=p*m-(b-f*g-p*g-f*m),w=M*I,h=nF*M,f=h-(h-M),p=M-f,h=nF*I,g=h-(h-I),m=I-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,sF[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,sF[1]=v-(y+d)+(d-w),k=_+y,d=k-_,sF[2]=_-(k-d)+(y-d),sF[3]=k;let P=function(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}(4,sF),A=22204460492503146e-32*a;if(P>=A||-P>=A)return P;if(d=e-T,s=e-(T+d)+(d-i),d=r-I,c=r-(I+d)+(d-i),d=t-M,l=t-(M+d)+(d-o),d=n-E,u=n-(E+d)+(d-o),0===s&&0===l&&0===c&&0===u)return P;if(A=11093356479670487e-47*a+iF*Math.abs(P),P+=T*u+E*s-(M*c+I*l),P>=A||-P>=A)return P;b=s*E,h=nF*s,f=h-(h-s),p=s-f,h=nF*E,g=h-(h-E),m=E-g,x=p*m-(b-f*g-p*g-f*m),w=l*I,h=nF*l,f=h-(h-l),p=l-f,h=nF*I,g=h-(h-I),m=I-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,dF[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,dF[1]=v-(y+d)+(d-w),k=_+y,d=k-_,dF[2]=_-(k-d)+(y-d),dF[3]=k;const C=oF(4,sF,4,dF,lF);b=T*u,h=nF*T,f=h-(h-T),p=T-f,h=nF*u,g=h-(h-u),m=u-g,x=p*m-(b-f*g-p*g-f*m),w=M*c,h=nF*M,f=h-(h-M),p=M-f,h=nF*c,g=h-(h-c),m=c-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,dF[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,dF[1]=v-(y+d)+(d-w),k=_+y,d=k-_,dF[2]=_-(k-d)+(y-d),dF[3]=k;const R=oF(C,lF,4,dF,cF);b=s*u,h=nF*s,f=h-(h-s),p=s-f,h=nF*u,g=h-(h-u),m=u-g,x=p*m-(b-f*g-p*g-f*m),w=l*c,h=nF*l,f=h-(h-l),p=l-f,h=nF*c,g=h-(h-c),m=c-g,S=p*m-(w-f*g-p*g-f*m),y=x-S,d=x-y,dF[0]=x-(y+d)+(d-S),_=b+y,d=_-b,v=b-(_-d)+(y-d),y=v-w,d=v-y,dF[1]=v-(y+d)+(d-w),k=_+y,d=k-_,dF[2]=_-(k-d)+(y-d),dF[3]=k;const L=oF(R,cF,4,dF,uF);return uF[L-1]}(e,t,r,n,i,o,c)}aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(8),aF(8),aF(8),aF(4),aF(8),aF(8),aF(8),aF(12);aF(192),aF(192);aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(8),aF(8),aF(8),aF(8),aF(8),aF(8),aF(8),aF(8),aF(8),aF(4),aF(4),aF(4),aF(8),aF(16),aF(16),aF(16),aF(32),aF(32),aF(48),aF(64);aF(1152),aF(1152);aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(4),aF(24),aF(24),aF(24),aF(24),aF(24),aF(24),aF(24),aF(24),aF(24),aF(24),aF(1152),aF(1152),aF(1152),aF(1152),aF(1152),aF(2304),aF(2304),aF(3456),aF(5760),aF(8),aF(8),aF(8),aF(16),aF(24),aF(48),aF(48),aF(96),aF(192),aF(384),aF(384),aF(384),aF(768);aF(96),aF(96),aF(96),aF(1152);function fF(e,t){var r,n,i,o,a,s,l,c,u,d=0,h=e[0],f=e[1],p=t.length;for(r=0;r<p;r++){n=0;var g=t[r],m=g.length-1;if((c=g[0])[0]!==g[m][0]&&c[1]!==g[m][1])throw new Error("First and last coordinates in a ring must be the same");for(o=c[0]-h,a=c[1]-f;n<m;n++){if(s=(u=g[n+1])[0]-h,l=u[1]-f,0===a&&0===l){if(s<=0&&o>=0||o<=0&&s>=0)return 0}else if(l>=0&&a<=0||l<=0&&a>=0){if(0===(i=hF(o,s,a,l,0,0)))return 0;(i>0&&l>0&&a<=0||i<0&&l<=0&&a>0)&&d++}c=u,a=l,o=s}}return d%2!=0}function pF(e,t,r={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");const n=ZO(e),i=XO(t),o=i.type,a=t.bbox;let s=i.coordinates;if(a&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(n,a))return!1;"Polygon"===o&&(s=[s]);let l=!1;for(var c=0;c<s.length;++c){const e=fF(n,s[c]);if(0===e)return!r.ignoreBoundary;e&&(l=!0)}return l}class gF{constructor(e=[],t=mF){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=1+(e<<1),o=t[n];const a=n+1;if(a<this.length&&r(t[a],o)<0&&(n=a,o=t[a]),r(o,i)>=0)break;t[e]=o,e=n}t[e]=i}}function mF(e,t){return e<t?-1:e>t?1:0}function yF(e,t){return e.p.x>t.p.x?1:e.p.x<t.p.x?-1:e.p.y!==t.p.y?e.p.y>t.p.y?1:-1:1}function _F(e,t){return e.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:e.rightSweepEvent.p.x<t.rightSweepEvent.p.x?-1:e.rightSweepEvent.p.y!==t.rightSweepEvent.p.y?e.rightSweepEvent.p.y<t.rightSweepEvent.p.y?1:-1:1}class vF{constructor(e,t,r,n){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=r,this.eventId=n,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}}let bF=0,xF=0,wF=0;function SF(e,t){const r="Feature"===e.type?e.geometry:e;let n=r.coordinates;"Polygon"!==r.type&&"MultiLineString"!==r.type||(n=[n]),"LineString"===r.type&&(n=[[n]]);for(let e=0;e<n.length;e++)for(let r=0;r<n[e].length;r++){let i=n[e][r][0],o=null;xF+=1;for(let a=0;a<n[e][r].length-1;a++){o=n[e][r][a+1];const s=new vF(i,bF,xF,wF),l=new vF(o,bF,xF,wF+1);s.otherEvent=l,l.otherEvent=s,yF(s,l)>0?(l.isLeftEndpoint=!0,s.isLeftEndpoint=!1):(s.isLeftEndpoint=!0,l.isLeft
31Endpoint=!1),t.push(s),t.push(l),i=o,wF+=1}}bF+=1}class kF{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}}function TF(e,t){if(null===e||null===t)return!1;if(e.leftSweepEvent.ringId===t.leftSweepEvent.ringId&&(e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.rightSweepEvent)||e.leftSweepEvent.isSamePoint(t.leftSweepEvent)||e.leftSweepEvent.isSamePoint(t.rightSweepEvent)))return!1;const r=e.leftSweepEvent.p.x,n=e.leftSweepEvent.p.y,i=e.rightSweepEvent.p.x,o=e.rightSweepEvent.p.y,a=t.leftSweepEvent.p.x,s=t.leftSweepEvent.p.y,l=t.rightSweepEvent.p.x,c=t.rightSweepEvent.p.y,u=(c-s)*(i-r)-(l-a)*(o-n),d=(l-a)*(n-s)-(c-s)*(r-a),h=(i-r)*(n-s)-(o-n)*(r-a);if(0===u)return!1;const f=d/u,p=h/u;if(f>=0&&f<=1&&p>=0&&p<=1){return[r+f*(i-r),n+f*(o-n)]}return!1}const IF=function(e,t){const r=new gF([],yF);return function(e,t){if("FeatureCollection"===e.type){const r=e.features;for(let e=0;e<r.length;e++)SF(r[e],t)}else SF(e,t)}(e,r),function(e,t){t=t||!1;const r=[],n=new gF([],_F);for(;e.length;){const i=e.pop();if(i.isLeftEndpoint){const e=new kF(i);for(let o=0;o<n.data.length;o++){const a=n.data[o];if(t&&a.leftSweepEvent.featureId===i.featureId)continue;const s=TF(e,a);!1!==s&&r.push(s)}n.push(e)}else!1===i.isLeftEndpoint&&n.pop()}return r}(r,t)};var MF=IF;function EF(e,t,r={}){const{removeDuplicates:n=!0,ignoreSelfIntersections:i=!0}=r;let o=[];"FeatureCollection"===e.type?o=o.concat(e.features):"Feature"===e.type?o.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||o.push(Gw(e)),"FeatureCollection"===t.type?o=o.concat(t.features):"Feature"===t.type?o.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||o.push(Gw(t));const a=MF(qw(o),i);let s=[];if(n){const e={};a.forEach((t=>{const r=t.join(",");e[r]||(e[r]=!0,s.push(t))}))}else s=a;return qw(s.map((e=>Uw(e))))}function PF(e,t={}){const r=XO(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),r.type){case"Polygon":return function(e,t={}){const r=XO(e),n=r.coordinates,i=t.properties?t.properties:"Feature"===e.type?e.properties:{};return AF(n,i)}(r,t);case"MultiPolygon":return function(e,t={}){const r=XO(e),n=r.coordinates,i=t.properties?t.properties:"Feature"===e.type?e.properties:{},o=[];return n.forEach((e=>{o.push(AF(e,i))})),qw(o)}(r,t);default:throw new Error("invalid poly")}}function AF(e,t){return e.length>1?Ww(e,t):Hw(e[0],t)}function CF(e,t,{ignoreSelfIntersections:r=!0}={ignoreSelfIntersections:!0}){let n=!0;return rS(e,(e=>{rS(t,(t=>{if(!1===n)return!1;n=function(e,t,r){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,i=t.coordinates,!(n[0]===i[0]&&n[1]===i[1]);case"LineString":return!RF(t,e);case"Polygon":return!pF(e,t)}break;case"LineString":switch(t.type){case"Point":return!RF(e,t);case"LineString":return!function(e,t,r){const n=EF(e,t,{ignoreSelfIntersections:r});if(n.features.length>0)return!0;return!1}(e,t,r);case"Polygon":return!LF(t,e,r)}break;case"Polygon":switch(t.type){case"Point":return!pF(t,e);case"LineString":return!LF(e,t,r);case"Polygon":return!function(e,t,r){for(const r of e.coordinates[0])if(pF(r,t))return!0;for(const r of t.coordinates[0])if(pF(r,e))return!0;const n=EF(PF(e),PF(t),{ignoreSelfIntersections:r});if(n.features.length>0)return!0;return!1}(t,e,r)}}var n,i;return!1}(e.geometry,t.geometry,r)}))})),n}function RF(e,t){for(let r=0;r<e.coordinates.length-1;r++)if(OF(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function LF(e,t,r){for(const r of t.coordinates)if(pF(r,e))return!0;return EF(t,PF(e),{ignoreSelfIntersections:r}).features.length>0}function OF(e,t,r){const n=r[0]-e[0],i=r[1]-e[1],o=t[0]-e[0],a=t[1]-e[1];return 0==n*a-i*o&&(Math.abs(o)>=Math.abs(a)?o>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1])}function DF(e,t,{ignoreSelfIntersections:r=!0}={}){let n=!1;return rS(e,(e=>{rS(t,(t=>{if(!0===n)return!0;n=!CF(e.geometry,t.geometry,{ignoreSelfIntersections:r})}))})),n}function zF(e,t={}){return nS(e,((e,r)=>{const n=r.geometry.coordinates;return e+nD(n[0],n[1],t)}),0)}var FF=Object.defineProperty,NF=Object.defineProperties,BF=Object.getOwnPropertyDescriptors,jF=Object.getOwnPropertySymbols,VF=Object.prototype.hasOwnProperty,GF=Object.prototype.propertyIsEnumerable,UF=(e,t,r)=>t in e?FF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$F=(e,t)=>{for(var r in t||(t={}))VF.call(t,r)&&UF(e,r,t[r]);if(jF)for(var r of jF(t))GF.call(t,r)&&UF(e,r,t[r]);return e},HF=(e,t)=>NF(e,BF(t));function qF(e,t,r={}){if(!e||!t)throw new Error("lines and pt are required arguments");const n=ZO(t);let i=Uw([1/0,1/0],{dist:1/0,index:-1,multiFeatureIndex:-1,location:-1}),o=0;return rS(e,(function(e,a,s){const l=YO(e);for(let e=0;e<l.length-1;e++){const a=Uw(l[e]);a.properties.dist=nD(t,a,r);const c=ZO(a),u=Uw(l[e+1]);u.properties.dist=nD(t,u,r);const d=ZO(u),h=nD(a,u,r);let f,p,g;c[0]===n[0]&&c[1]===n[1]?[f,,p]=[c,void 0,!1]:d[0]===n[0]&&d[1]===n[1]?[f,,p]=[d,void 0,!0]:[f,,p]=KF(a.geometry.coordinates,u.geometry.coordinates,ZO(t)),f&&(g=Uw(f,{dist:nD(t,f,r),multiFeatureIndex:s,location:o+nD(a,f,r)})),g&&g.properties.dist<i.properties.dist&&(i=HF($F({},g),{properties:HF($F({},g.properties),{index:p?e+1:e})})),o+=h}})),i}function WF(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2))}function ZF(e,t){const r=function(e,t){const[r,n,i]=e,[o,a,s]=t;return r*o+n*a+i*s}(e,t)/(WF(e)*WF(t));return Math.acos(Math.min(Math.max(r,-1),1))}function YF(e){const t=Jw(e[1]),r=Jw(e[0]);return[Math.cos(t)*Math.cos(r),Math.cos(t)*Math.sin(r),Math.sin(t)]}function XF(e){const[t,r,n]=e,i=Kw(Math.asin(n));return[Kw(Math.atan2(r,t)),i]}function KF(e,t,r){const n=YF(e),i=YF(t),o=YF(r),[a,s,l]=o,[c,u,d]=function(e,t){const[r,n,i]=e,[o,a,s]=t;return[n*s-i*a,i*o-r*s,r*a-n*o]}(n,i),h=u*l-d*s,f=d*a-c*l,p=c*s-u*a,g=p*u-f*d,m=h*d-p*c,y=f*c-h*u,_=1/Math.sqrt(Math.pow(g,2)+Math.pow(m,2)+Math.pow(y,2)),v=[g*_,m*_,y*_],b=[-1*g*_,-1*m*_,-1*y*_],x=ZF(n,i),w=ZF(n,v),S=ZF(i,v),k=ZF(n,b),T=ZF(i,b);let I;return I=w<k&&w<T||S<k&&S<T?v:b,ZF(n,I)>x||ZF(i,I)>x?nD(XF(I),XF(n))<=nD(XF(I),XF(i))?[XF(n),!0,!1]:[XF(i),!1,!0]:[XF(I),!1,!1]}function JF(e){return JF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JF(e)}function QF(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}
31finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||iN(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eN(e){return function(e){if(Array.isArray(e))return oN(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||iN(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rN(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=JF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=JF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==JF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nN(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=iN(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function iN(e,t){if(e){if("string"==typeof e)return oN(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oN(e,t):void 0}}function oN(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function aN(e){var t,r=null===(t=e.coordinates)||void 0===t?void 0:t[0];return!r||r.length<2?null:Hw(r)}var sN=yL.modes.draw_polygon,lN=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tN(Object(r),!0).forEach((function(t){rN(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tN(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},sN);function cN(e,t){var r=e._snapLines,n=e._blockers;if(r&&0!==r.length||n&&0!==n.length){var i=[t.lngLat.lng,t.lngLat.lat];if(n){var o,a=nN(n);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(pF(i,s)){var l=QF(qF(Hw(s.geometry.coordinates[0]),i).geometry.coordinates,2),c=l[0],u=l[1];return void(t.lngLat={lng:c,lat:u})}}}catch(e){a.e(e)}finally{a.f()}}if(r&&0!==r.length){var d,h=i[0],f=i[1],p=Number.POSITIVE_INFINITY,g=nN(r);try{for(g.s();!(d=g.n()).done;){var m,y,_=qF(d.value,i),v=null!==(m=null===(y=_.properties)||void 0===y?void 0:y.dist)&&void 0!==m?m:Number.POSITIVE_INFINITY;if(v<p){p=v;var b=QF(_.geometry.coordinates,2),x=b[0],w=b[1];h=x,f=w}}}catch(e){g.e(e)}finally{g.f()}t.lngLat={lng:h,lat:f}}}}lN.onSetup=function(e){var t,r,n=sN.onSetup.call(this,e||{}),i=[];null!=e&&e.boundary&&i.push.apply(i,eN(function(e){var t=[];if("Polygon"===e.type){var r=aN(e);r&&t.push(r)}else if("MultiPolygon"===e.type){var n,i=nN(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=null==o?void 0:o[0];a&&a.length>=2&&t.push(Hw(a))}}catch(e){i.e(e)}finally{i.f()}}return t}(e.boundary)));var o,a=nN(null!==(t=null==e?void 0:e.snapPolygons)&&void 0!==t?t:[]);try{for(a.s();!(o=a.n()).done;){var s=aN(o.value);s&&i.push(s)}}catch(e){a.e(e)}finally{a.f()}var l,c=[],u=nN(null!==(r=null==e?void 0:e.blockingPolygons)&&void 0!==r?r:[]);try{for(u.s();!(l=u.n()).done;){var d,h=l.value;null!=h&&h.coordinates&&(null===(d=h.coordinates[0])||void 0===d?void 0:d.length)>=4&&c.push($w(h.coordinates))}}catch(e){u.e(e)}finally{u.f()}return n._snapLines=i,n._blockers=c,n},lN.onMouseMove=function(e,t){return cN(e,t),sN.onMouseMove.call(this,e,t)},lN.onClick=function(e,t){return cN(e,t),sN.onClick.call(this,e,t)},lN.onTap=function(e,t){return cN(e,t),sN.onTap.call(this,e,t)};const uN=lN;function dN(e){return dN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dN(e)}function hN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
31t%2?hN(Object(r),!0).forEach((function(t){pN(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hN(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pN(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=dN(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=dN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dN(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gN(e){var t="drip"===e?"#22c55e":"#f59e0b",r="drip"===e?"#16a34a":"#d97706";return[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":t,"fill-opacity":.2}},{id:"gl-draw-polygon-stroke",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"line-color":r,"line-width":2.5}},{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"],["!=","mode","static"]],paint:{"line-color":"#d97706","line-width":3}},{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"]],paint:{"circle-radius":6,"circle-color":"#ffffff","circle-stroke-color":r,"circle-stroke-width":2}},{id:"gl-draw-point-mid",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":4,"circle-color":t,"circle-opacity":.7}}]}var mN="machinery-highlight",yN="machinery-highlight-fill",_N="machinery-highlight-line";function vN(e){if(e)try{e.getLayer(yN)&&e.removeLayer(yN),e.getLayer(_N)&&e.removeLayer(_N),e.getSource(mN)&&e.removeSource(mN)}catch(e){}}var bN=$u('<div class="fixed inset-0 bg-black/40 flex items-center justify-center z-[9999]"><div class="bg-white rounded-xl shadow-xl w-80 p-6"><h3 class="text-base font-semibold text-gray-900 mb-1">Machinery Type</h3> <p class="text-sm text-gray-500 mb-4">What type of machinery is on this field?</p> <select class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 mb-4"><option disabled>Select machinery type...</option><option>Center Pivot</option><option>Hose Reel</option><option>Drip Irrigation</option></select> <div class="flex gap-2"><button class="flex-1 px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors">Cancel</button> <button class="flex-1 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"> </button></div></div></div>'),xN=$u('<div class="flex flex-col items-center justify-center py-12 text-center"><p class="text-sm text-gray-500 mb-4">No machinery type set for this field.</p> <button class="px-5 py-2 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700 transition-colors font-medium">Set Machinery Type</button></div> <!>',1),wN=$u('<div class="space-y-3 p-3 bg-amber-50 rounded-lg border border-amber-200"><h4 class="text-sm font-semibold text-amber-900"> </h4> <p class="text-xs text-amber-700"> </p> <div><label class="block text-xs font-medium text-amber-800 mb-1">Name (optional)</label> <input type="text" class="w-full px-2.5 py-1.5 text-sm border border-amber-300 rounded-lg focus:ring-2 focus:ring-amber-500 focus:border-amber-500 outline-none bg-white"/></div> <div class="flex gap-2"><button class="flex-1 px-3 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors text-sm font-medium disabled:opacity-50"> </button> <button class="flex-1 px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors text-sm font-medium border border-gray-200">Cancel</button></div></div>'),SN=$u('<button class="flex items-center gap-1 px-2.5 py-1.5 text-xs font-medium text-blue-700 bg-blue-50 hover:bg-blue-100 rounded-lg transition-colors"><!> Add</button>'),kN=$u('<p class="text-xs text-gray-400">
31Pivot extents are created automatically for circular fields.</p>'),TN=$u('<p class="text-xs text-gray-400"> </p>'),IN=$u('<div class="text-center py-6"><div class="w-12 h-12 mx-auto mb-3 rounded-full bg-gray-100 flex items-center justify-center"><svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M11.42 15.17L17.25 21A2.652 2.652 0 0021 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 11-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 004.486-6.336l-3.276 3.277a3.004 3.004 0 01-2.25-2.25l3.276-3.276a4.5 4.5 0 00-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085"></path></svg></div> <p class="text-sm text-gray-500 mb-1"><!></p> <!></div>'),MN=qu('<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>'),EN=$u('<div role="button" tabindex="0" title="Delete"><!></div>'),PN=$u('<button><div class="min-w-0 flex-1"><div class="text-sm font-medium text-gray-900 truncate"> </div> <div class="text-xs text-gray-500 mt-0.5"> </div></div> <!></button>'),AN=$u('<div class="space-y-1.5"></div>'),CN=$u('<div class="flex items-center justify-between"><h3 class="text-sm font-medium text-gray-700"> <span class="text-gray-400 font-normal"> </span></h3> <!></div> <!>',1),RN=$u("<div><span> </span></div> <!>",1),LN=$u('<div class="flex h-full w-full"><div class="font-sans w-80 flex-shrink-0 flex flex-col h-full border-r border-gray-200 bg-white shadow-xl z-10 overflow-y-auto"><div class="p-5 space-y-5"><div class="flex items-center gap-3"><button class="p-1.5 hover:bg-gray-100 rounded-lg transition-colors text-gray-500 hover:text-gray-700" title="Back to field view"><!></button> <div><h2 class="text-lg font-semibold text-gray-900">Edit Machinery</h2> <p class="text-sm text-gray-500"> </p></div></div>  <!> <div class="pt-3 border-t border-gray-200"><button class="w-full px-4 py-2.5 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors font-medium text-sm border border-gray-200">Back to Field</button></div></div></div> <div class="flex-1 relative bg-gray-100"><div class="absolute inset-0"></div></div></div>');function ON(e,t){Zs(t,!0);let r=fh(t,"mapInstance",3,null),n=fh(t,"mapPlaceholderRef",15,null),i=!1,o=!1;yh((()=>{i=Bw.showVegetationIndexLayer,o=Bw.showETLayer,Bw.showVegetationIndexLayer=!1,Bw.showETLayer=!1})),_h((()=>{Bw.showVegetationIndexLayer=i,Bw.showETLayer=o}));let a=$l(null),s=$l(!1),l=$l(null),c=$l(!1),u=null,d=$l(!1),h=$l(""),f=null;const p=Dl((()=>t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===Bw.selectedFieldId)))),g=Dl((()=>yu(p)?.properties?.name||Bw.selectedFieldName||"")),m=Dl((()=>{const e=yu(p)?.properties;return e?.primary_irrigation_type||null})),y=Dl((()=>{switch(yu(m)){case"pivot":return"Center Pivot";case"hose_reel":return"Hose Reel";case"drip":return"Drip Irrigation";case"none":return"None / Other";default:return"Not Set"}})),_=(Dl((()=>{switch(yu(m)){case"pivot":return"blue";case"hose_reel":return"amber";case"drip":return"green";default:return"gray"}})),Dl((()=>{const e=Bw.selectedFieldId;if(!e)return[];const r=[];if("pivot"===yu(m)){if(t.pivotExtentsGeojson?.features)for(const n of t.pivotExtentsGeojson.features){const t=n.properties;if(t?.farm_field===e||t?.farm_field_id===e){const i=t?.radius_meters,o=t?.start_angle??0,a=t?.end_angle??360,s=0===o&&360===a;r.push({id:Number(n.id),name:t?.name||"Pivot Extent",type:"Pivot Extent",details:i?`${i.toFixed(0)}m radius${s?"":` (${o}°–${a}°)`}`:"Extent polygon",fieldId:e,sourceType:"pivotExtent",geometry:n.geometry})}}}else if("drip"===yu(m)){if(t.dripBoundariesGeojson?.features&&yu(p)?.geometry){const n=Gw(yu(p).geometry);for(const i of t.dripBoundariesGeojson.features)if(i.geometry)try{if
31(DF(n,i)){const t=i.properties,n=pS(i.geometry);r.push({id:Number(i.id),name:t?.name||"Drip Zone",type:"Drip Zone",details:`${n} Ha`,fieldId:e,sourceType:"drip",geometry:i.geometry})}}catch{}}}else if("hose_reel"===yu(m)&&t.hoseReelRoutesGeojson?.features&&yu(p)?.geometry){const n=Gw(yu(p).geometry);for(const i of t.hoseReelRoutesGeojson.features)if(i.geometry)try{if(DF(n,i)){const t=i.properties,n=zF(i,{units:"meters"}).toFixed(0);r.push({id:Number(i.id),name:t?.name||"Route",type:"Hose Reel Route",details:`${n}m`,fieldId:e,sourceType:"hoseReel",geometry:i.geometry})}}catch{}}return r})));function v(){vN(r())}function b(e){if(yu(l)===e.id){if(ql(l,null),v(),yu(p)){const e=Ez(yu(p));r()?.fitBounds(e,{padding:60,maxZoom:17})}}else ql(l,e.id,!0),function(e,t){if(e&&t.geometry){vN(e),e.addSource(mN,{type:"geojson",data:{type:"Feature",geometry:t.geometry,properties:{}}}),"LineString"===t.geometry.type||"MultiLineString"===t.geometry.type?e.addLayer({id:_N,type:"line",source:mN,paint:{"line-color":"#f59e0b","line-width":5,"line-opacity":1}}):(e.addLayer({id:yN,type:"fill",source:mN,paint:{"fill-color":"#22c55e","fill-opacity":.3}}),e.addLayer({id:_N,type:"line",source:mN,paint:{"line-color":"#16a34a","line-width":3,"line-opacity":1}}));var r=Ez(t.geometry);e.fitBounds(r,{padding:80,maxZoom:17})}}(r(),e)}Tc((()=>()=>v())),Tc((()=>{if(r()&&yu(p)){const e=setTimeout((()=>{const e=Ez(yu(p));r()?.fitBounds(e,{padding:60,maxZoom:17})}),300);return()=>clearTimeout(e)}}));let x=$l(!1),w=$l("");function S(){if(r()&&!yu(c)&&(u=function(e,t){var r=new yL({displayControlsDefault:!1,controls:{polygon:!1,line_string:!1,trash:!1},defaultMode:"hose_reel"===t?"draw_line_string":"draw_polygon",styles:gN(t),modes:fN(fN({},yL.modes),{},{draw_polygon_snap:uN})});return e.addControl(r),r}(r(),yu(m)),ql(c,!0),ql(h,""),ql(l,null),v(),"drip"===yu(m)&&u&&yu(p)?.geometry)){const e=yu(p).geometry;if("Polygon"===e.type||"MultiPolygon"===e.type){const r=[];for(const e of t.dripBoundariesGeojson?.features??[]){const t=e.geometry;"Polygon"===t?.type&&r.push(t)}try{u.changeMode("draw_polygon_snap",{boundary:e,snapPolygons:r,blockingPolygons:r})}catch(e){console.warn("EditMachineryView: failed to enter draw_polygon_snap",e)}}null===f&&(f=Bw.showIrrigationEquipment),Bw.showIrrigationEquipment=!0}}function k(){!function(e,t){if(t&&e)try{e.removeControl(t)}catch(e){}}(r(),u),u=null,ql(c,!1),ql(h,""),null!==f&&(Bw.showIrrigationEquipment=f,f=null)}async function T(){if(!u||!r()||!Bw.selectedFieldId)return;const e=u.getAll();if(!e.features.length)return void alert("Please draw a shape on the map first.");const n=e.features[0].geometry;ql(d,!0);try{if("hose_reel"===yu(m)){const e=yu(h).trim()||`Route ${yu(_).length+1}`,r=await fetch(`${bh.basePath}farms/api/hose-reel-irrigation-routes/`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({field_id:Bw.selectedFieldId,route_geojson:JSON.stringify(n),route_name:e})});if(!r.ok){const e=await r.json().catch((()=>({})));throw new Error(e?.detail||e?.route_geojson?.[0]||"Failed to create route")}const i=await r.json().catch((()=>({}))),o={type:"Feature",id:i?.id,geometry:n,properties:{id:i?.id,name:e,field_id:Bw.selectedFieldId}};t.onHoseReelRouteAdded?.(o)}else if("drip"===yu(m)){const e=yu(h).trim()||`Zone ${yu(_).length+1}`,r=await fetch(`${bh.basePath}farms/api/drip-irrigation-boundaries/`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({boundary_geojson:JSON.stringify(n),boundary_name:e})});if(!r.ok){const e=await r.json().catch((()=>({})));throw new Error(e?.detail||e?.boundary_geojson?.[0]||"Failed to create zone")}const i=await r.json().catch((()=>({}))),o={type:"Feature",id:i?.id,geometry:n,properties:{id:i?.id,name:e}};t.onDripBoundaryAdded?.(o)}k()}catch(e){alert(e.message||"Failed to save. Please try again.")}finally{ql(d,!1)}}async function I(e){if("pivotExtent"!==e.sourceType){if(confirm(`Delete "${e.name}"? This cannot be undone.`)){ql(a,e.id,!0);try{let r;r="drip"===e.sourceType?`${bh.basePath}farms/api/drip-irrigation-boundaries/${e.id}/`:`${bh.basePath}farms/api/hose-reel-irrigation-routes/${e.id}/`;(await fetch(r,{method:"DELETE",headers:{"X-Requested-With":"XMLHttpRequest","X-CSRFToken":bh.csrfToken}})).ok?(yu(l)===e.id&&(ql(l,null),v()),"drip"===e.sourceType?t.onDripBoundaryDeleted?.(e.id):t.onHoseReelRouteDeleted?.(e.id)):alert("Failed to delete. Please try again.")}catch(e){console.error("Delete failed:",e),alert("Error deleting. Please try again.")}finally{ql(a,null)}}}else alert("Pivot extents cannot be deleted — they are tied to the field geometry.")}function M(){k(),v(),t.onClose?.()}var E=LN(),P=uc(E),A=uc(P),C=uc(A),R=uc(C);R.__click=M,WO(uc(R),{class:"w-5 h-5"}),Os(R);var L=hc(R,2),O=hc(uc(L),2),D=uc(O,!0);Os(O),Os(L),Os(C);
31var z=hc(C,2),F=e=>{var r=xN(),n=dc(r);hc(uc(n),2).__click=()=>{ql(x,!0),ql(w,"")},Os(n);var i=hc(n,2),o=e=>{var r=bN();r.__keydown=e=>{"Escape"===e.key&&ql(x,!1)},r.__click=e=>{e.target===e.currentTarget&&ql(x,!1)};var n=uc(r),i=hc(uc(n),4),o=uc(i);o.value=o.__value="";var a=hc(o);a.value=a.__value="pivot";var l=hc(a);l.value=l.__value="hose_reel";var c=hc(l);c.value=c.__value="drip",Os(i);var u=hc(i,2),d=uc(u);d.__click=()=>ql(x,!1);var h=hc(d,2);h.__click=()=>async function(e){if(Bw.selectedFieldId){ql(s,!0);try{if(!(await fetch(`${bh.basePath}farms/api/farm-fields/${Bw.selectedFieldId}/`,{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({primary_irrigation_type:e})})).ok)throw new Error("Failed to save irrigation type");if(t.farmFieldsGeojson){const r=t.farmFieldsGeojson.features.find((e=>Number(e.id)===Bw.selectedFieldId));r?.properties&&(r.properties.primary_irrigation_type=e)}}catch(e){console.error("Error saving irrigation type:",e),alert("Failed to save irrigation type. Please try again.")}finally{ql(s,!1)}}}(yu(w));var f=uc(h,!0);Os(h),Os(u),Os(n),Os(r),Pc((()=>{h.disabled=!yu(w)||yu(s),Ju(f,yu(s)?"Saving...":"Confirm")})),Md(i,(()=>yu(w)),(e=>ql(w,e))),Yu(e,r)};ad(i,(e=>{yu(x)&&e(o)})),Yu(e,r)},N=e=>{var t=RN(),r=dc(t),n=uc(r),i=uc(n,!0);Os(n),Os(r);var o=hc(r,2),s=e=>{var t=wN(),r=uc(t),n=uc(r,!0);Os(r);var i=hc(r,2),o=uc(i,!0);Os(i);var a=hc(i,2),s=hc(uc(a),2);Ld(s),Os(a);var l=hc(a,2),c=uc(l);c.__click=T;var u=uc(c,!0);Os(c),hc(c,2).__click=k,Os(l),Os(t),Pc((()=>{Ju(n,"hose_reel"===yu(m)?"Draw a route line":"Draw a zone boundary"),Ju(o,"hose_reel"===yu(m)?"Click on the map to draw the hose reel route. Double-click to finish.":"Click on the map to draw the zone boundary. Double-click to close the polygon."),Fd(s,"placeholder","hose_reel"===yu(m)?"Route name...":"Zone name..."),c.disabled=yu(d),Ju(u,yu(d)?"Saving...":"Save")})),Kd(s,(()=>yu(h)),(e=>ql(h,e))),Yu(e,t)},u=e=>{var t=CN(),r=dc(t),n=uc(r),i=uc(n),o=hc(i),s=uc(o);Os(o),Os(n);var c=hc(n,2),u=e=>{var t=SN();t.__click=S,Kz(uc(t),{class:"w-3.5 h-3.5"}),Ds(),Os(t),Yu(e,t)};ad(c,(e=>{"pivot"!==yu(m)&&e(u)})),Os(r);var d=hc(r,2),h=e=>{var t=IN(),r=hc(uc(t),2),n=uc(r),i=e=>{Yu(e,Wu("No pivot extent found for this field."))},o=e=>{var t=Wu();Pc((()=>Ju(t,`No ${"hose_reel"===yu(m)?"routes":"zones"} yet`))),Yu(e,t)};ad(n,(e=>{"pivot"===yu(m)?e(i):e(o,!1)})),Os(r);var a=hc(r,2),s=e=>{Yu(e,kN())},l=e=>{var t=TN(),r=uc(t);Os(t),Pc((()=>Ju(r,`Click "+ Add" to draw ${"hose_reel"===yu(m)?"a route":"a zone"} on the map.`))),Yu(e,t)};ad(a,(e=>{"pivot"===yu(m)?e(s):e(l,!1)})),Os(t),Yu(e,t)},f=e=>{var t=AN();Il(t,21,(()=>yu(_)),(e=>e.id),((e,t)=>{var r=PN();r.__click=()=>b(yu(t));var n=uc(r),i=uc(n),o=uc(i,!0);Os(i);var s=hc(i,2),c=uc(s,!0);Os(s),Os(n);var u=hc(n,2),d=e=>{var r=EN();r.__click=e=>{e.stopPropagation(),I(yu(t))}
31,r.__keydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),I(yu(t)))};var n=uc(r),i=e=>{Yu(e,MN())},o=e=>{tF(e,{class:"w-4 h-4"})};ad(n,(e=>{yu(a)===yu(t).id?e(i):e(o,!1)})),Os(r),Pc((()=>{wd(r,1,"ml-2 p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors flex-shrink-0 "+(yu(a)===yu(t).id?"opacity-50 pointer-events-none":"")),Fd(r,"aria-label",`Delete ${yu(t).name??""}`)})),Yu(e,r)};ad(u,(e=>{"pivotExtent"!==yu(t).sourceType&&e(d)})),Os(r),Pc((()=>{wd(r,1,"w-full flex items-center justify-between px-3 py-2.5 rounded-lg border transition-all text-left\n                  "+(yu(l)===yu(t).id?"pivot"===yu(m)?"bg-blue-50 border-blue-300 ring-1 ring-blue-200":"hose_reel"===yu(m)?"bg-amber-50 border-amber-300 ring-1 ring-amber-200":"bg-green-50 border-green-300 ring-1 ring-green-200":"bg-gray-50 border-gray-200 hover:border-gray-300 hover:bg-gray-100")),Ju(o,yu(t).name),Ju(c,yu(t).details)})),Yu(e,r)})),Os(t),Yu(e,t)};ad(d,(e=>{0===yu(_).length?e(h):e(f,!1)})),Pc((()=>{Ju(i,("pivot"===yu(m)?"Pivot Extents":"hose_reel"===yu(m)?"Routes":"Zones")+" "),Ju(s,`(${yu(_).length??""})`)})),Yu(e,t)};ad(o,(e=>{yu(c)?e(s):e(u,!1)})),Pc((()=>{wd(r,1,"flex items-center gap-2 px-3 py-2 rounded-lg border\n        "+("pivot"===yu(m)?"bg-blue-50 border-blue-200":"hose_reel"===yu(m)?"bg-amber-50 border-amber-200":"drip"===yu(m)?"bg-green-50 border-green-200":"bg-gray-50 border-gray-200")),wd(n,1,"text-xs font-bold uppercase tracking-wider\n          "+("pivot"===yu(m)?"text-blue-700":"hose_reel"===yu(m)?"text-amber-700":"drip"===yu(m)?"text-green-700":"text-gray-700")),Ju(i,yu(y))})),Yu(e,t)};ad(z,(e=>{yu(m)&&"none"!==yu(m)?e(N,!1):e(F)}));var B=hc(z,2);uc(B).__click=M,Os(B),Os(A),Os(P);var j=hc(P,2);nh(uc(j),(e=>n(e)),(()=>n())),Os(j),Os(E),Pc((()=>Ju(D,yu(g)||`Field ${Bw.selectedFieldId}`))),Yu(e,E),Ys()}Bu(["click","keydown"]);var DN=qu("<title> </title>"),zN=qu("<desc> </desc>"),FN=qu('<svg><!><!><path fill-rule="evenodd" d="M11.32 6.176H5c-1.105 0-2 .949-2 2.118v10.588C3 20.052 3.895 21 5 21h11c1.105 0 2-.948 2-2.118v-7.75l-3.914 4.144A2.46 2.46 0 0 1 12.81 16l-2.681.568c-1.75.37-3.292-1.263-2.942-3.115l.536-2.839c.097-.512.335-.983.684-1.352l2.914-3.086Z" clip-rule="evenodd"></path><path fill-rule="evenodd" d="M19.846 4.318a2.148 2.148 0 0 0-.437-.692 2.014 2.014 0 0 0-.654-.463 1.92 1.92 0 0 0-1.544 0 2.014 2.014 0 0 0-.654.463l-.546.578 2.852 3.02.546-.579a2.14 2.14 0 0 0 .437-.692 2.244 2.244 0 0 0 0-1.635ZM17.45 8.721 14.597 5.7 9.82 10.76a.54.54 0 0 0-.137.27l-.536 2.84c-.07.37.239.696.588.622l2.682-.567a.492.492 0 0 0 .255-.145l4.778-5.06Z" clip-rule="evenodd"></path></svg>');var NN=qu("<title> </title>"),BN=qu("<desc> </desc>"),jN=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M4 4v15a1 1 0 0 0 1 1h15M8 16l2.5-5.5 3 3L17.273 7 20 9.667"></path></svg>');var VN=qu("<title> </title>"),GN=qu("<desc> </desc>"),UN=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M9.143 4H4.857A.857.857 0 0 0 4 4.857v4.286c0 .473.384.857.857.857h4.286A.857.857 0 0 0 10 9.143V4.857A.857.857 0 0 0 9.143 4Zm10 0h-4.286a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286A.857.857 0 0 0 20 9.143V4.857A.857.857 0 0 0 19.143 4Zm-10 10H4.857a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286a.857.857 0 0 0 .857-.857v-4.286A.857.857 0 0 0 9.143 14Zm10 0h-4.286a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286a.857.857 0 0 0 .857-.857v-4.286a.857.857 0 0 0-.857-.857Z"></path></svg>');function $N(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"grid outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=UN();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewB
31ox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=VN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=GN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}var HN=qu("<title> </title>"),qN=qu("<desc> </desc>"),WN=qu('<svg><!><!><path fill-rule="evenodd" d="M8 10V7a4 4 0 1 1 8 0v3h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h1Zm2-3a2 2 0 1 1 4 0v3h-4V7Zm2 6a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1Z" clip-rule="evenodd"></path></svg>');var ZN=qu("<title> </title>"),YN=qu("<desc> </desc>"),XN=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M12 13V8m0 8h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"></path></svg>');var KN=qu("<title> </title>"),JN=qu("<desc> </desc>"),QN=qu('<svg><!><!><path fill-rule="evenodd" d="M5.005 10.19a1 1 0 0 1 1 1v.233l5.998 3.464L18 11.423v-.232a1 1 0 1 1 2 0V12a1 1 0 0 1-.5.866l-6.997 4.042a1 1 0 0 1-1 0l-6.998-4.042a1 1 0 0 1-.5-.866v-.81a1 1 0 0 1 1-1ZM5 15.15a1 1 0 0 1 1 1v.232l5.997 3.464 5.998-3.464v-.232a1 1 0 1 1 2 0v.81a1 1 0 0 1-.5.865l-6.998 4.042a1 1 0 0 1-1 0L4.5 17.824a1 1 0 0 1-.5-.866v-.81a1 1 0 0 1 1-1Z" clip-rule="evenodd"></path><path d="M12.503 2.134a1 1 0 0 0-1 0L4.501 6.17A1 1 0 0 0 4.5 7.902l7.002 4.047a1 1 0 0 0 1 0l6.998-4.04a1 1 0 0 0 0-1.732l-6.997-4.042Z"></path></svg>');var eB=qu("<title> </title>"),tB=qu("<desc> </desc>"),rB=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m14 8-4 4 4 4"></path></svg>');function nB(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"chevron left outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=rB();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=eB(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=tB(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}var iB=qu("<title> </title>"),oB=qu("<desc> </desc>"),aB=qu('<svg><!><!><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m10 16 4-4-4-4"></path></svg>');function sB(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"chevron right outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=aB();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=iB(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=oB(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}var lB=[13.0038,55.605];function cB(e){return cB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cB(e)}function uB(e){return function(e){if(Array.isArray(e))return pB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||fB(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dB(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */dB=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 31
31if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==cB(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(cB(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
31if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function hB(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||fB(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fB(e,t){if(e){if("string"==typeof e)return pB(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pB(e,t):void 0}}function pB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function gB(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function mB(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){gB(o,n,i,a,s,"next",e)}function s(e){gB(o,n,i,a,s,"throw",e)}a(void 0)}))}}function yB(){return bh.satApiUrl||"https://dealer-apis-0cek.onrender.com"}var _B=new Map;function vB(e,t){var r=t||(new Date).toISOString().slice(0,7);return"".concat(e,"-").concat(r)}function bB(e,t,r){return xB.apply(this,arguments)}function xB(){return xB=mB(dB().mark((function e(t,r,n){var i,o,a,s,l,c,u,d,h,f,p,g,m,y;return dB().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==n?void 0:n.month)||(new Date).toISOString().slice(0,7),o=vB(t,i),null!=n&&n.forceRefresh){e.next=6;break}if(!((a=_B.get(o))&&Date.now()-a.fetchedAt<18e5)){e.next=6;break}return e.abrupt("return",a.images);case 6:return null!=n&&n.month?(c=n.month.split("-").map(Number),u=hB(c,2),d=u[0],h=u[1],f=new Date(d,h-1,1),p=new Date(d,h,0),s=f.toISOString().split("T")[0],l=p.toISOString().split("T")[0]):(g=new Date,(m=new Date).setDate(m.getDate()-60),s=m.toISOString().split("T")[0],l=g.toISOString().split("T")[0]),e.next=9,wB(r,{startDate:s,endDate:l});case 9:return y=e.sent,_B.set(o,{images:y,fetchedAt:Date.now(),month:i}),e.abrupt("return",y);case 12:case"end":return e.stop()}}),e)}))),xB.apply(this,arguments)}function wB(e,t){return SB.apply(this,arguments)}function SB(){return SB=mB(dB().mark((function e(t,r){var n,i,o,a,s,l,c,u,d,h,f,p,g,m,y;return dB().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=performance.now(),i=null!=r&&r.endDate?new Date(r.endDate):new Date,o=null!=r&&r.startDate?new Date(r.startDate):new Date,null!=r&&r.startDate||o.setDate(o.getDate()-60),a=o.toISOString().split("T")[0],s=i.toISOString().split("T")[0],l="Polygon"===t.type?t.coordinates[0]:t.coordinates[0][0],c=l.map((function(e){return e[0]})),u=l.map((function(e){return e[1]})),d=[Math.min.apply(Math,uB(c)),Math.min.apply(Math,uB(u)),Math.max.apply(Math,uB(c)),Math.max.apply(Math,uB(u))].join(","),h="".concat(yB(),"/atla/search?bbox=").concat(d,"&start_date=").concat(a,"&end_date=").concat(s,"&max_cloud_cover=100&bbox_cloud_cover=true"),e.next=13,fetch(h);case 13:if((f=e.sent).ok){e.next=16;break}throw new Error("Image search failed: ".concat(f.status," ").concat(f.statusText));case 16:return e.next=18,f.json();case 18:return p=e.sent,(g=p.map((function(e){var t;return{id:(null===(t=e.stac_href)||void 0===t?void 0:t.split("/").pop())||e.datetime,date:e.datetime.split("T")[0],datetime:e.datetime,cloud_cover:e.cloud_cover,bbox_cloud_cover:e.bbox_cloud_cover,stac_href:e.stac_href}}))).sort((function(e,t){return new Date(t.datetime).getTime()-new Date(e.datetime).getTime()})),m=new Set,(y=g.filter((function(e){var t=e.datetime.split("T")[0];return!m.has(t)&&(m.add(t),!0)}))).length>0&&console.debug("[sat-api] ".concat(y.length," images found (").concat((performance.now()-n).toFixed(0),"ms)")),e.abrupt("return",y);case 25:case"end":return e.stop()}}),e)}))),SB.apply(this,arguments)}function kB(e,t){return TB.apply(this,arguments)}function TB(){return TB=mB(dB().mark((function e(t,r){var n,i,o,a,s,l,c=arguments;return dB().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>2&&void 0!==c[2]?c[2]:"ndvi",i=performance.now(),o=n.toUpperCase(),e.next=5,fetch("".concat(yB(),"/raster"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({polygon:t,date:r,metric:n,mask_clouds:!0})});case 5:if((a=e.sent).ok){e.next=11;break}return e.next=9,a.json().catch((function(){return{}}));case 9:throw s=e.sent,new Error(s.detail||"GeoTIFF fetch failed: ".concat(a.status));case 11:return e.next=13,a.arrayBuffer();case 13:return l=e.sent,console.debug("[sat-api] ".concat(o," raster: ").concat((l.byteLength/1024).toFixed(1),"KB (").concat((performance.now()-i).toFixed(0),"ms)")),e.abrupt("return",SP(l,r,n));case 16:case"end":return e.stop()}}),e)}))),TB.apply(this,arguments)}function IB(e,t,r,n){return MB.apply(this,arguments)}function MB(){return(MB=mB(dB().mark((function e(t,r,n,i){var o,a,s,l,c,u;return dB().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o="".concat(t,"-").concat(String(r+1).padStart(2,"0")),!i.has(o)){e.next=3;break}return e.abrupt("return",null);case 3:return a=new Date(t,r,1),s=new Date(t,r+1,0),l=a.toISOString().split("T")[0],c=s.toISOString().split("T")[0],e.next=9,wB(n,{startDate:l,endDate:c});case 9:return u=e.sent,e.abrupt("return",{images:u,monthKey:o,monthStart
31Str:l});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EB(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return PB(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?PB(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function AB(e,t){var r,n,i=null!==(r=null===(n=e.properties)||void 0===n?void 0:n.crop_zones)&&void 0!==r?r:[];if(t){var o=i.find((function(e){return e.crop_zone_id===t}));if(null!=o&&o.boundary)return o.boundary}var a=i.find((function(e){return e.boundary}));return null!=a&&a.boundary?a.boundary:e.geometry}function CB(e,t){if(!e)return null;var r=e.bounds,n=e.width,i=e.height,o=e.rawData,a=e.noDataValue,s=t.lng,l=t.lat,c=EB(r,4),u=c[0],d=c[1],h=c[2],f=c[3];if(s<u||s>h||l<d||l>f)return null;var p=(s-u)/(h-u),g=(f-l)/(f-d),m=Math.floor(p*n),y=Math.floor(g*i);m=Math.max(0,Math.min(n-1,m));var _=o[(y=Math.max(0,Math.min(i-1,y)))*n+m];return null!==a&&_===a||Number.isNaN(_)?null:_}function RB(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */RB=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==LB(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);
vendor: 4,365 bytes, line 31
31if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(LB(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function LB(e){return LB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LB(e)}function OB(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function DB(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){OB(o,n,i,a,s,"next",e)}function s(e){OB(o,n,i,a,s,"throw",e)}a(void 0)}))}}function zB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=NB(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
31}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function FB(e){return function(e){if(Array.isArray(e))return BB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||NB(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function NB(e,t){if(e){if("string"==typeof e)return BB(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?BB(e,t):void 0}}function BB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function jB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function VB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jB(Object(r),!0).forEach((function(t){GB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function GB(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=LB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=LB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==LB(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var UB={N:"nir",R:"red",G:"green",B:"blue",RE1:"rededge1",RE2:"rededge2",RE3:"rededge3",N2:"nir08",S1:"swir16",S2:"swir22"},$B={g:2.5,C1:6,C2:7.5};function HB(e,t,r){var n,i=e,o=VB(VB({},$B),r),a=zB(FB(t).sort((function(e,t){return t.length-e.length})));try{for(a.s();!(n=a.n()).done;){var s=n.value;UB[s]?i=i.replace(new RegExp("\\b".concat(s,"\\b"),"g"),UB[s]):void 0!==o[s]&&(i=i.replace(new RegExp("\\b".concat(s,"\\b"),"g"),String(o[s])))}}catch(e){a.e(e)}finally{a.f()}return i}var qB=JSON.parse('{"u":{"AFRI1600":{"application_domain":"vegetation","bands":["N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-17","formula":"(N - 0.66 * S1) / (N + 0.66 * S1)","long_name":"Aerosol Free Vegetation Index (1600 nm)","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/S0034-4257(01)00190-0","short_name":"AFRI1600"},"AFRI2100":{"application_domain":"vegetation","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-17","formula":"(N - 0.5 * S2) / (N + 0.5 * S2)","long_name":"Aerosol Free Vegetation Index (2100 nm)","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/S0034-4257(01)00190-0","short_name":"AFRI2100"},"ANDWI":{"application_domain":"water","bands":["B","G","R","N","S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"(B + G + R - N - S1 - S2)/(B + G + R + N + S1 + S2)","long_name":"Augmented Normalized Difference Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.envsoft.2021.105030","short_name":"ANDWI"},"ARI":{"application_domain":"vegetation","bands":["G","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-20","formula":"(1 / G) - (1 / RE1)","long_name":"Anthocyanin Reflectance Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1562/0031-8655(2001)074%3C0038:OPANEO%3E2.0.CO;2","short_name":"ARI"},"ARI2":{"application_domain":"vegetation","bands":["N","G","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"N * ((1 / G) - (1 / RE1))","long_name":"Anthocyanin Reflectance Index 2","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1562/0031-8655(2001)074%3C0038:OPANEO%3E2.0.CO;2","short_name":"ARI2"},"ARVI":{"application_domain":"vegetation","bands":["N","R","gamma","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-11","formula":"(N - (R - gamma * (R - B))) / (N + (R - gamma * (R - B)))","long_name":"Atmospherically Resistant Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1109/36.134076","short_name":"ARVI"},"ATSAVI":{"application_domain":"vegetation","bands":["sla","N","R","slb"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"sla * (N - sla * R - slb) / (sla * N + R - sla * slb + 0.08 * (1 + sla ** 2.0))","long_name":"Adjusted Transformed Soil-Adjusted Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(91)90009-U","short_name":"ATSAVI"},"AVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(N * (1.0 - R) * (N - R)) ** (1/3)","long_name":"Advanced Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.465.8749&rep=rep1&type=pdf","short_name":"AVI"},"AWEInsh":{"application_domain":"water","bands":["G","S1","N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"4.0 * (G - S1) - 0.25 * N + 2.75 * S2","long_name":"Automated Water Extraction Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2013.08.029","short_name":"AWEInsh"},"AWEIsh":{"application_domain":"water","bands":["B","G","N","S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"B + 2.5 * G - 1.5 * (N + S1) - 0.25 * S2","long_name":"Automated Water Extraction Index with Shadows Elimination","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2013.08.029","short_name":"AWEIsh"},"BAI":{"application_domain":"burn","bands":["R","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"1.0 / ((0.1 - R) ** 2.0 + (0.06 - N) ** 2.0)","long_name":"Burned Area Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://digital.csic.es/bitstream/10261/6426/1/Martin_Isabel_Serie_Geografica.pdf","short_name":"BAI"},"BAIM":{"application_domain":"burn","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-20","formula":"1.0/((0.05 - N) ** 2.0) + ((0.2 - S2) ** 2.0)","long_name":"Burned Area Index adapted to MODIS","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.foreco.2006.08.248","short_name":"BAIM"},"BAIS2":{"application_domain":"burn","bands":["RE2","RE3","N2","R","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(1.0 - ((RE2 * RE3 * N2) / R) ** 0.5) * (((S2 - N2)/(S2 + N2) ** 0.5) + 1.0)","long_name":"Burned Area Index for Sentinel 2","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/ecrs-2-05177","short_name":"BAIS2"},"BCC":{"application_domain":"vegetation","bands":["B","R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"B / (R + G + B)","long_name":"Blue Chromatic Coordinate","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(87)90088-5","short_name":"BCC"},"BI":{"application_domain":"soil","bands":["S1","R","N","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"((S1 + R) - (N + B))/((S1 + R) + (N + B))","long_name":"Bare Soil Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.465.8749&rep=rep1&type=pdf","short_name":"BI"},"BITM":{"application_domain":"soil","bands":["B","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-11-20","formula":"(((B**2.0)+(G**2.0)+(R**2.0))/3.0)**0.5","long_name":"Landsat TM-based Brightness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(98)00030-3","short_name":"BITM"},"BIXS":{"application_domain":"soil","bands":["G","R"],"contributor":"https://github.com/remi-braun","date_of_addition":"2022-11-20","formula":"(((G**2.0)+(R**2.0))/2.0)**0.5","long_name":"SPOT HRV XS-based Brightness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(98)00030-3","short_name":"BIXS"},"BLFEI":{"application_domain":"urban","bands":["G","R","S2","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-02-09","formula":"(((G+R+S2)/3.0)-S1)/(((G+R+S2)/3.0)+S1)","long_name":"Built-Up Land Features Extraction Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/10106049.2018.1497094","short_name":"BLFEI"},"BNDVI":{"application_domain":"vegetation","bands":["N","B"],"contributor":"https://github.com/MATRIX4284","date_of_addition":"2021-04-07","formula":"(N - B)/(N + B)","long_name":"Blue Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S1672-6308(07)60027-4","short_name":"BNDVI"},"BRBA":{"application_domain":"urban","bands":["R","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"R/S1","long_name":"Band Ratio for Built-up Area","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.omicsonline.org/scientific-reports/JGRS-SR136.pdf","short_name":"BRBA"},"BWDRVI":{"application_domain":"vegetation","bands":["alpha","N","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-20","formula":"(alpha * N - B) / (alpha * N + B)","long_name":"Blue Wide Dynamic Range Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2135/cropsci2007.01.0031","short_name":"BWDRVI"},"BaI":{"application_domain":"soil","bands":["R","S1","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"R + S1 - N","long_name":"Bareness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1109/IGARSS.2005.1525743","short_name":"BaI"},"CCI":{"application_domain":"vegetation","bands":["G1","R"],"contributor":"https://github.com/joanvlasschaert","date_of_addition":"2023-03-12","formula":"(G1 - R)/(G1 + R)","long_name":"Chlorophyll Carotenoid Index","platforms":["MODIS"],"reference":"https://doi.org/10.1073/pnas.1606162113","short_name":"CCI"},"CIG":{"application_domain":"vegetation","bands":["N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N / G) - 1.0","long_name":"Chlorophyll Index Green","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1078/0176-1617-00887","short_name":"CIG"},"CIRE":{"application_domain":"vegetation","bands":["N","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-13","formula":"(N / RE1) - 1","long_name":"Chlorophyll Index Red Edge","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1078/0176-1617-00887","short_name":"CIRE"},"CRI550":{"application_domain":"vegetation","bands":["B","G"],"contributor":"https://github.com/eomasters-repos","date_of_addition":"2024-08-08","formula":"(1.0 / B) - (1.0 / G)","long_name":"Carotenoid Reflectance Index using 550 nm","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1562/0031-8655(2002)0750272A
31CCIPL2.0.CO2","short_name":"CRI550"},"CRI700":{"application_domain":"vegetation","bands":["B","RE1"],"contributor":"https://github.com/eomasters-repos","date_of_addition":"2024-08-08","formula":"(1.0 / B) - (1.0 / RE1)","long_name":"Carotenoid Reflectance Index using 700 nm","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1562/0031-8655(2002)0750272ACCIPL2.0.CO2","short_name":"CRI700"},"CRSWIR":{"application_domain":"vegetation","bands":["S1","N2","S2","lambdaS2","lambdaN2","lambdaS1"],"contributor":"https://github.com/kenoz","date_of_addition":"2025-06-23","formula":"S1 / (N2 + ((S2 - N2) / (lambdaS2 - lambdaN2)) * (lambdaS1 - lambdaN2))","long_name":"Continuum Removal SWIR","platforms":["Sentinel-2"],"reference":"https://www.onf.fr/onf/+/cec::les-rendez-vous-techniques-de-lonf-no69-70.html","short_name":"CRSWIR"},"CSI":{"application_domain":"burn","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"N/S2","long_name":"Char Soil Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2005.04.014","short_name":"CSI"},"CSIT":{"application_domain":"burn","bands":["N","S2","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"N / (S2 * T / 10000.0)","long_name":"Char Soil Index Thermal","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1080/01431160600954704","short_name":"CSIT"},"CVI":{"application_domain":"vegetation","bands":["N","R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N * R) / (G ** 2.0)","long_name":"Chlorophyll Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1007/s11119-010-9204-3","short_name":"CVI"},"DBI":{"application_domain":"urban","bands":["B","T1","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"((B - T1)/(B + T1)) - ((N - R)/(N + R))","long_name":"Dry Built-Up Index","platforms":["Landsat-OLI"],"reference":"https://doi.org/10.3390/land7030081","short_name":"DBI"},"DBSI":{"application_domain":"soil","bands":["S1","G","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"((S1 - G)/(S1 + G)) - ((N - R)/(N + R))","long_name":"Dry Bareness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/land7030081","short_name":"DBSI"},"DPDD":{"application_domain":"radar","bands":["VV","VH"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"(VV + VH)/2.0 ** 0.5","long_name":"Dual-Pol Diagonal Distance","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.1016/j.rse.2018.09.003","short_name":"DPDD"},"DSI":{"application_domain":"vegetation","bands":["S1","N"],"contributor":"https://github.com/remi-braun","date_of_addition":"2022-10-26","formula":"S1/N","long_name":"Drought Stress Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.asprs.org/wp-content/uploads/pers/1999journal/apr/1999_apr_495-501.pdf","short_name":"DSI"},"DSWI1":{"application_domain":"vegetation","bands":["N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-10-29","formula":"N/S1","long_name":"Disease-Water Stress Index 1","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160310001618031","short_name":"DSWI1"},"DSWI2":{"application_domain":"vegetation","bands":["S1","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-10-29","formula":"S1/G","long_name":"Disease-Water Stress Index 2","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160310001618031","short_name":"DSWI2"},"DSWI3":{"application_domain":"vegetation","bands":["S1","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-10-29","formula":"S1/R","long_name":"Disease-Water Stress Index 3","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160310001618031","short_name":"DSWI3"},"DSWI4":{"application_domain":"vegetation","bands":["G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-10-29","formula":"G/R","long_name":"Disease-Water Stress Index 4","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/01431160310001618031","short_name":"DSWI4"},"DSWI5":{"application_domain":"vegetation","bands":["N","G","S1","R"],"contributor":"https://github.com/remi-braun","date_of_addition":"2022-10-26","formula":"(N + G)/(S1 + R)","long_name":"Disease-Water Stress Index 5","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160310001618031","short_name":"DSWI5"},"DVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"N - R","long_name":"Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(94)00114-3","short_name":"DVI"},"DVIplus":{"application_domain":"vegetation","bands":["lambdaN","lambdaR","lambdaG","G","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-20","formula":"((lambdaN - lambdaR)/(lambdaN - lambdaG)) * G + (1.0 - ((lambdaN - lambdaR)/(lambdaN - lambdaG))) * N - R","long_name":"Difference Vegetation Index Plus","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2019.03.028","short_name":"DVIplus"},"DpRVIHH":{"application_domain":"radar","bands":["HV","HH"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-12-25","formula":"(4.0 * HV)/(HH + HV)","long_name":"Dual-Polarized Radar Vegetation Index HH","platforms":["Sentinel-1 (Dual Polarisation HH-HV)"],"reference":"https://www.tandfonline.com/doi/abs/10.5589/m12-043","short_name":"DpRVIHH"},"DpRVIVV":{"application_domain":"radar","bands":["VH","VV"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-12-25","formula":"(4.0 * VH)/(VV + VH)","long_name":"Dual-Polarized Radar Vegetation Index VV","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.3390/app9040655","short_name":"DpRVIVV"},"EBBI":{"application_domain":"urban","bands":["S1","N","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-17","formula":"(S1 - N) / (10.0 * ((S1 + T) ** 0.5))","long_name":"Enhanced Built-Up and Bareness Index","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.3390/rs4102957","short_name":"EBBI"},"EBI":{"application_domain":"vegetation","bands":["R","G","B","epsilon"],"contributor":"https://github.com/geoSanjeeb","date_of_addition":"2023-07-03","formula":"(R + G + B)/((G/B) * (R - B + epsilon))","long_name":"Enhanced Bloom Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.isprsjprs.2019.08.006","short_name":"EBI"},"EMBI":{"application_domain":"soil","bands":["S1","S2","N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"((((S1 - S2 - N)/(S1 + S2 + N)) + 0.5) - ((G - S1)/(G + S1)) - 0.5)/((((S1 - S2 - N)/(S1 + S2 + N)) + 0.5) + ((G - S1)/(G + S1)) + 1.5)","long_name":"Enhanced Modified Bare Soil Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.jag.2022.102703","short_name":"EMBI"},"ENDVI":{"application_domain":"vegetation","bands":["N","G","B"],"contributor":"https://github.com/gagev","date_of_addition":"2024-04-08","formula":"((N + G) - (2 * B)) / ((N + G) + (2 * B))","long_name":"Enhanced Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1371/journal.pone.0186193","short_name":"ENDVI"},"EVI":{"application_domain":"vegetation","bands":["g","N","R","C1","C2","B","L"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"g * (N - R) / (N + C1 * R - C2 * B + L)","long_name":"Enhanced Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(96)00112-5","short_name":"EVI"},"EVI2":{"application_domain":"vegetation","bands":["g","N","R","L"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"g * (N - R) / (N + 2.4 * R + L)","long_name":"Two-Band Enhanced Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2008.06.006","short_name":"EVI2"},"EVIv":{"application_domain":"vegetation","bands":["N","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2024-05-16","formula":"2.5 * ((N - R)/(N + 6 * R - 7.5 * B + 1.0)) * N","long_name":"Enhanced Vegetation Index of Vegetation","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1029/2024JG008240","short_name":"EVIv"},"ExG":{"application_domain":"vegetation","bands":["G","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"2 * G - R - B","long_name":"Excess Green Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.13031/2013.27838","short_name":"ExG"},"ExGR":{"application_domain":"vegetation","bands":["G","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(2.0 * G - R - B) - (1.3 * R - G)","long_name":"ExG - ExR Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.compag.2008.03.009","short_name":"ExGR"},"ExR":{"application_domain":"vegetation","bands":["R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"1.3 * R - G","long_name":"Excess Red Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1117/12.336896","short_name":"ExR"},"FAI":{"application_domain":"water","bands":["N","R","S1","lambdaN","lambdaR","lambdaS1"],"contributor":"https://github.com/emanuelcastanho","date_of_addition":"2024-05-03","formula":"N - (R + (S1 - R)*((lambdaN - lambdaR)/(lambdaS1 - lambdaR)))","long_name":"Floating Algae Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2009.05.012","short_name":"FAI"},"FCVI":{"application_domain":"vegetation","bands":["N","R","G","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-20","formula":"N - ((R + G + B)/3.0)","long_name":"Fluorescence Correction Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2020.111676","short_name":"FCVI"},"FDI":{"application_domain":"water","bands":["N","RE2","S1","lambdaN","lambdaR","lambdaS1"],"contributor":"https://github.com/guillemc23","date_of_addition":"2025-07-18","formula":"N - (RE2 + 10 * (S1 - RE2) * (lambdaN - lambdaR)/(lambdaS1 - lambdaR))","long_name":"Floating Debris Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1038/s41598-020-62298-z","short_name":"FDI"},"FWEI":{"application_domain":"water","bands":["B","G","R","N"],"contributor":"https://github.com/kalab-oto","date_of_addition":"2025-04-15","formula":"(((B + G + R) / 3.0) - N)/(((B + G + R) / 3.0) + N)","long_name":"Flood/Water Extraction Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1007/s00477-024-02660-z","short_name":"FWEI"},"GARI":{"application_domain":"vegetation","bands":["N","G","B","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - (G - (B - R))) / (N - (G + (B - R)))","long_name":"Green Atmospherically Resistant Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(96)00072-7","short_name":"GARI"},"GBNDVI":{"application_domain":"vegetation","bands":["N","G","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - (G + B))/(N + (G + B))","long_name":"Green-Blue Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S1672-6308(07)60027-4","short_name":"GBNDVI"},"GCC":{"application_domain":"vegetation","bands":["G","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"G / (R + G + B)","long_name":"Green Chromatic Coordinate","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(87)90088-5","short_name":"GCC"},"GDVI":{"application_domain":"vegetation","bands":["N","nexp","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"((N ** nexp) - (R ** nexp)) / ((N ** nexp) + (R ** nexp))","long_name":"Generalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.3390/rs6021211","short_name":"GDVI"},"GEMI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"((2.0*((N ** 2.0)-(R ** 2.0)) + 1.5*N + 0.5*R)/(N + R + 0.5))*(1.0 - 0.25*((2.0 * ((N ** 2.0) 
31- (R ** 2)) + 1.5 * N + 0.5 * R)/(N + R + 0.5)))-((R - 0.125)/(1 - R))","long_name":"Global Environment Monitoring Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"http://dx.doi.org/10.1007/bf00031911","short_name":"GEMI"},"GLI":{"application_domain":"vegetation","bands":["G","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(2.0 * G - R - B) / (2.0 * G + R + B)","long_name":"Green Leaf Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"http://dx.doi.org/10.1080/10106040108542184","short_name":"GLI"},"GM1":{"application_domain":"vegetation","bands":["RE2","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"RE2/G","long_name":"Gitelson and Merzlyak Index 1","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0176-1617(96)80284-7","short_name":"GM1"},"GM2":{"application_domain":"vegetation","bands":["RE2","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"RE2/RE1","long_name":"Gitelson and Merzlyak Index 2","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0176-1617(96)80284-7","short_name":"GM2"},"GNDVI":{"application_domain":"vegetation","bands":["N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - G)/(N + G)","long_name":"Green Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(96)00072-7","short_name":"GNDVI"},"GOSAVI":{"application_domain":"vegetation","bands":["N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(N - G) / (N + G + 0.16)","long_name":"Green Optimized Soil Adjusted Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2134/agronj2004.0314","short_name":"GOSAVI"},"GRNDVI":{"application_domain":"vegetation","bands":["N","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - (G + R))/(N + (G + R))","long_name":"Green-Red Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S1672-6308(07)60027-4","short_name":"GRNDVI"},"GRVI":{"application_domain":"vegetation","bands":["N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"N/G","long_name":"Green Ratio Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2134/agronj2004.0314","short_name":"GRVI"},"GSAVI":{"application_domain":"vegetation","bands":["L","N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(1.0 + L) * (N - G) / (N + G + L)","long_name":"Green Soil Adjusted Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2134/agronj2004.0314","short_name":"GSAVI"},"GVMI":{"application_domain":"vegetation","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"((N + 0.1) - (S2 + 0.02)) / ((N + 0.1) + (S2 + 0.02))","long_name":"Global Vegetation Moisture Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/S0034-4257(02)00037-8","short_name":"GVMI"},"IAVI":{"application_domain":"vegetation","bands":["N","R","gamma","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(N - (R - gamma * (B - R)))/(N + (R - gamma * (B - R)))","long_name":"New Atmospherically Resistant Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://www.jipb.net/EN/abstract/abstract23925.shtml","short_name":"IAVI"},"IBI":{"application_domain":"urban","bands":["S1","N","R","L","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-02-09","formula":"(((S1-N)/(S1+N))-(((N-R)*(1.0+L)/(N+R+L))+((G-S1)/(G+S1)))/2.0)/(((S1-N)/(S1+N))+(((N-R)*(1.0+L)/(N+R+L))+((G-S1)/(G+S1)))/2.0)","long_name":"Index-Based Built-Up Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160802039957","short_name":"IBI"},"IKAW":{"application_domain":"vegetation","bands":["R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(R - B)/(R + B)","long_name":"Kawashima Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1006/anbo.1997.0544","short_name":"IKAW"},"IPVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"N/(N + R)","long_name":"Infrared Percentage Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(90)90085-Z","short_name":"IPVI"},"IRECI":{"application_domain":"vegetation","bands":["RE3","R","RE1","RE2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-17","formula":"(RE3 - R) / (RE1 / RE2)","long_name":"Inverted Red-Edge Chlorophyll Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.isprsjprs.2013.04.007","short_name":"IRECI"},"IRGBVI":{"application_domain":"vegetation","bands":["G","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-07-11","formula":"(5.0 * (G ** 2.0) 
31- 2.0 * (R ** 2.0) - 5.0 * (B ** 2.0)) / (5.0 * (G ** 2.0) + 2.0 * (R ** 2.0) + 5.0 * (B ** 2.0))","long_name":"Improved-Red-Green-Blue Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.jag.2024.103668","short_name":"IRGBVI"},"LSWI":{"application_domain":"water","bands":["N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-20","formula":"(N - S1)/(N + S1)","long_name":"Land Surface Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2003.11.008","short_name":"LSWI"},"MBI":{"application_domain":"soil","bands":["S1","S2","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"((S1 - S2 - N)/(S1 + S2 + N)) + 0.5","long_name":"Modified Bare Soil Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/land10030231","short_name":"MBI"},"MBWI":{"application_domain":"water","bands":["omega","G","R","N","S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"(omega * G) - R - N - S1 - S2","long_name":"Multi-Band Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.jag.2018.01.018","short_name":"MBWI"},"MCARI":{"application_domain":"vegetation","bands":["RE1","R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-13","formula":"((RE1 - R) - 0.2 * (RE1 - G)) * (RE1 / R)","long_name":"Modified Chlorophyll Absorption in Reflectance Index","platforms":["Sentinel-2"],"reference":"http://dx.doi.org/10.1016/S0034-4257(00)00113-9","short_name":"MCARI"},"MCARI1":{"application_domain":"vegetation","bands":["N","R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"1.2 * (2.5 * (N - R) - 1.3 * (N - G))","long_name":"Modified Chlorophyll Absorption in Reflectance Index 1","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2003.12.013","short_name":"MCARI1"},"MCARI2":{"application_domain":"vegetation","bands":["N","R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"(1.5 * (2.5 * (N - R) - 1.3 * (N - G))) / ((((2.0 * N + 1) ** 2) - (6.0 * N - 5 * (R ** 0.5)) - 0.5) ** 0.5)","long_name":"Modified Chlorophyll Absorption in Reflectance Index 2","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2003.12.013","short_name":"MCARI2"},"MCARI705":{"application_domain":"vegetation","bands":["RE2","RE1","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"((RE2 - RE1) - 0.2 * (RE2 - G)) * (RE2 / RE1)","long_name":"Modified Chlorophyll Absorption in Reflectance Index (705 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.agrformet.2008.03.005","short_name":"MCARI705"},"MCARIOSAVI":{"application_domain":"vegetation","bands":["RE1","R","G","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"(((RE1 - R) - 0.2 * (RE1 - G)) * (RE1 / R)) / (1.16 * (N - R) / (N + R + 0.16))","long_name":"MCARI/OSAVI Ratio","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(00)00113-9","short_name":"MCARIOSAVI"},"MCARIOSAVI705":{"application_domain":"vegetation","bands":["RE2","RE1","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"(((RE2 - RE1) - 0.2 * (RE2 - G)) * (RE2 / RE1)) / (1.16 * (RE2 - RE1) / (RE2 + RE1 + 0.16))","long_name":"MCARI/OSAVI Ratio (705 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.agrformet.2008.03.005","short_name":"MCARIOSAVI705"},"MGRVI":{"application_domain":"vegetation","bands":["G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"(G ** 2.0 - R ** 2.0) / (G ** 2.0 + R ** 2.0)","long_name":"Modified Green Red Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.jag.2015.02.012","short_name":"MGRVI"},"MI":{"application_domain":"vegetation","bands":["N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-07-11","formula":"(N - S1) / (N * S1)","long_name":"Mangrove Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.researchgate.net/profile/Gathot-Winarso/publication/277137915_NEW_MANGROVE_INDEX_AS_DEGRADATIONHEALTH_INDICATOR_USING_REMOTE_SENSING_DATA_SEGARA_ANAKAN_AND_ALAS_PURWO_CASE_STUDY/links/5562d90c08ae8c0cab333ab4/NEW-MANGROVE-INDEX-AS-DEGRADATION-HEALTH-INDICATOR-USING-REMOTE-SENSING-DATA-SEGARA-ANAKAN-AND-A
31LAS-PURWO-CASE-STUDY.pdf","short_name":"MI"},"MIRBI":{"application_domain":"burn","bands":["S2","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"10.0 * S2 - 9.8 * S1 + 2.0","long_name":"Mid-Infrared Burn Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160110053185","short_name":"MIRBI"},"MLSWI26":{"application_domain":"water","bands":["N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-20","formula":"(1.0 - N - S1)/(1.0 - N + S1)","long_name":"Modified Land Surface Water Index (MODIS Bands 2 and 6)","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs71215805","short_name":"MLSWI26"},"MLSWI27":{"application_domain":"water","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-20","formula":"(1.0 - N - S2)/(1.0 - N + S2)","long_name":"Modified Land Surface Water Index (MODIS Bands 2 and 7)","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs71215805","short_name":"MLSWI27"},"MNDVI":{"application_domain":"vegetation","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - S2)/(N + S2)","long_name":"Modified Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/014311697216810","short_name":"MNDVI"},"MNDWI":{"application_domain":"water","bands":["G","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(G - S1) / (G + S1)","long_name":"Modified Normalized Difference Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160600589179","short_name":"MNDWI"},"MNLI":{"application_domain":"vegetation","bands":["L","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-11","formula":"(1 + L)*((N ** 2) - R)/((N ** 2) + R + L)","long_name":"Modified Non-Linear Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1109/TGRS.2003.812910","short_name":"MNLI"},"MRBVI":{"application_domain":"vegetation","bands":["R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(R ** 2.0 - B ** 2.0)/(R ** 2.0 + B ** 2.0)","long_name":"Modified Red Blue Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.3390/s20185055","short_name":"MRBVI"},"MSAVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-13","formula":"0.5 * (2.0 * N + 1 - (((2 * N + 1) ** 2) - 8 * (N - R)) ** 0.5)","long_name":"Modified Soil-Adjusted Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(94)90134-1","short_name":"MSAVI"},"MSI":{"application_domain":"vegetation","bands":["S1","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"S1/N","long_name":"Moisture Stress Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/0034-4257(89)90046-1","short_name":"MSI"},"MSR":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"(N / R - 1) / ((N / R + 1) ** 0.5)","long_name":"Modified Simple Ratio","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/07038992.1996.10855178","short_name":"MSR"},"MSR705":{"application_domain":"vegetation","bands":["RE2","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"(RE2 / RE1 - 1) / ((RE2 / RE1 + 1) ** 0.5)","long_name":"Modified Simple Ratio (705 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.agrformet.2008.03.005","short_name":"MSR705"},"MTCI":{"application_domain":"vegetation","bands":["RE2","RE1","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-13","formula":"(RE2 - RE1) / (RE1 - R)","long_name":"MERIS Terrestrial Chlorophyll Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1080/0143116042000274015","short_name":"MTCI"},"MTVI1":{"application_domain":"vegetation","bands":["N","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"1.2 * (1.2 * (N - G) - 2.5 * (R - G))","long_name":"Modified Triangular Vegetation Index 1","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2003.12.013","short_name":"MTVI1"},"MTVI2":{"application_domain":"vegetation","bands":["N","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"(1.5 * (1.2 * (N - G) - 2.5 * (R - G))) / ((((2.0 * N + 1) ** 2) - (6.0 * N - 5 * (R ** 0.5)) - 0.5) ** 0.5)","long_name":"Modified Triangular Vegetation Index 2","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2003.12.013","short_name":"MTVI2"},"MVI":{"application_domain":"vegetation","bands":["N","G","S1"],"contributor":"https://github.com/delatorredm","date_of_addition":"2025-04-08","formula":"(N - G) / (S1 - G)","long_name":"Mangrove Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.isprsjprs.2020.06.001","short_name":"MVI"},"MuWIR":{"application_domain":"water","bands":["B","G","N","S2","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-09","formula":"-4.0 * ((B - G)/(B + G)) + 2.0 * ((G - N)/(G + N)) + 2.0 * ((G - S2)/(G + S2)) - ((G - S1)/(G + S1))","long_name":"Revised Multi-Spectral Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs10101643","short_name":"MuWIR"},"NBAI":{"application_domain":"urban","bands":["S2","S1","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"(S2 - S1/G)/(S2 + S1/G)","long_name":"Normalized Built-up Area Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.omicsonline.org/scientific-reports/JGRS-SR136.pdf","short_name":"NBAI"},"NBLI":{"application_domain":"soil","bands":["R","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(R - T)/(R + T)","long_name":"Normalized Difference Bare Land Index","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.3390/rs9030249","short_name":"NBLI"},"NBLIOLI":{"application_domain":"soil","bands":["R","T1"],"contributor":"https://github.com/davemlz","date_of_addition":"2023-03-12","formula":"(R - T1)/(R + T1)","long_name":"Normalized Difference Bare Land Index for Landsat-OLI","platforms":["Landsat-OLI"],"reference":"https://doi.org/10.3390/rs9030249","short_name":"NBLIOLI"},"NBR":{"application_domain":"burn","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - S2) / (N + S2)","long_name":"Normalized Burn Ratio","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3133/ofr0211","short_name":"NBR"},"NBR2":{"application_domain":"burn","bands":["S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-20","formula":"(S1 - S2) / (S1 + S2)","long_name":"Normalized Burn Ratio 2","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.usgs.gov/core-science-systems/nli/landsat/landsat-normalized-burn-ratio-2","short_name":"NBR2"},"NBRSWIR":{"application_domain":"burn","bands":["S2","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"(S2 - S1 - 0.02)/(S2 + S1 + 0.1)","long_name":"Normalized Burn Ratio SWIR","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/22797254.2020.1738900","short_name":"NBRSWIR"},"NBRT1":{"application_domain":"burn","bands":["N","S2","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - (S2 * T / 10000.0)) / (N + (S2 * T / 10000.0))","long_name":"Normalized Burn Ratio Thermal 1","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1080/01431160500239008","short_name":"NBRT1"},"NBRT2":{"application_domain":"burn","bands":["N","T","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"((N / (T / 10000.0)) - S2) / ((N / (T / 10000.0)) + S2)","long_name":"Normalized Burn Ratio Thermal 2","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1080/01431160500239008","short_name":"NBRT2"},"NBRT3":{"application_domain":"burn","bands":["N","T","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"((N - (T / 10000.0)) - S2) / ((N - (T / 10000.0)) + S2)","long_name":"Normalized Burn Ratio Thermal 3","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1080/01431160500239008","short_name":"NBRT3"},"NBRplus":{"application_domain":"burn","bands":["S2","N2","G","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"(S2 - N2 - G - B)/(S2 + N2 + G + B)","long_name":"Normalized Burn Ratio Plus","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/rs14071727","short_name":"NBRplus"},"NBSIMS":{"application_domain":"snow","bands":["G","R","N","B","S2","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-09","formula":"0.36 * (G + R + N) - (((B + S2)/G) + S1)","long_name":"Non-Binary Snow Index for Multi-Component Surfaces","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs13142777","short_name":"NBSIMS"},"NBUI":{"application_domain":"urban","bands":["S1","N","T","R","L","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"((S1 - N)/(10.0 * (T + S1) ** 0.5)) - (((N - R) * (1.0 + L))/(N - R + L)) - (G - S1)/(G + S1)","long_name":"New Built-Up Index","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://hdl.handle.net/1959.11/29500","
31short_name":"NBUI"},"ND705":{"application_domain":"vegetation","bands":["RE2","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(RE2 - RE1)/(RE2 + RE1)","long_name":"Normalized Difference (705 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(02)00010-X","short_name":"ND705"},"NDBI":{"application_domain":"urban","bands":["S1","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"(S1 - N) / (S1 + N)","long_name":"Normalized Difference Built-Up Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"http://dx.doi.org/10.1080/01431160304987","short_name":"NDBI"},"NDBaI":{"application_domain":"soil","bands":["S1","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-17","formula":"(S1 - T) / (S1 + T)","long_name":"Normalized Difference Bareness Index","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1109/IGARSS.2005.1526319","short_name":"NDBaI"},"NDCI":{"application_domain":"water","bands":["RE1","R"],"contributor":"https://github.com/kalab-oto","date_of_addition":"2022-10-10","formula":"(RE1 - R)/(RE1 + R)","long_name":"Normalized Difference Chlorophyll Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.rse.2011.10.016","short_name":"NDCI"},"NDDI":{"application_domain":"vegetation","bands":["N","R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(((N - R)/(N + R)) - ((G - N)/(G + N)))/(((N - R)/(N + R)) + ((G - N)/(G + N)))","long_name":"Normalized Difference Drought Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1029/2006GL029127","short_name":"NDDI"},"NDGI":{"application_domain":"vegetation","bands":["lambdaN","lambdaR","lambdaG","G","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-20","formula":"(((lambdaN - lambdaR)/(lambdaN - lambdaG)) * G + (1.0 - ((lambdaN - lambdaR)/(lambdaN - lambdaG))) * N - R)/(((lambdaN - lambdaR)/(lambdaN - lambdaG)) * G + (1.0 - ((lambdaN - lambdaR)/(lambdaN - lambdaG))) * N + R)","long_name":"Normalized Difference Greenness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2019.03.028","short_name":"NDGI"},"NDGlaI":{"application_domain":"snow","bands":["G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(G - R)/(G + R)","long_name":"Normalized Difference Glacier Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/01431160802385459","short_name":"NDGlaI"},"NDII":{"application_domain":"vegetation","bands":["N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-20","formula":"(N - S1)/(N + S1)","long_name":"Normalized Difference Infrared Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.asprs.org/wp-content/uploads/pers/1983journal/jan/1983_jan_77-83.pdf","short_name":"NDII"},"NDISIb":{"application_domain":"urban","bands":["T","B","N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(T - (B + N + S1) / 3.0)/(T + (B + N + S1) / 3.0)","long_name":"Normalized Difference Impervious Surface Index Blue","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.14358/PERS.76.5.557","short_name":"NDISIb"},"NDISIg":{"application_domain":"urban","bands":["T","G","N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(T - (G + N + S1) / 3.0)/(T + (G + N + S1) / 3.0)","long_name":"Normalized Difference Impervious Surface Index Green","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.14358/PERS.76.5.557","short_name":"NDISIg"},"NDISImndwi":{"application_domain":"urban","bands":["T","G","S1","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(T - (((G - S1)/(G + S1)) + N + S1) / 3.0)/(T + (((G - S1)/(G + S1)) + N + S1) / 3.0)","long_name":"Normalized Difference Impervious Surface Index with MNDWI","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.14358/PERS.76.5.557","short_name":"NDISImndwi"},"NDISIndwi":{"application_domain":"urban","bands":["T","G","N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(T - (((G - N)/(G + N)) + N + S1) / 3.0)/(T + (((G - N)/(G + N)) + N + S1) / 3.0)","long_name":"Normalized Difference Impervious Surface Index with NDWI","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.14358/PERS.76.5.557","short_name":"NDISIndwi"},"NDISIr":{"application_domain":"urban","bands":["T","R","N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(T - (R + N + S1) / 3.0)/(T + (R + N + S1) / 3.0)","long_name":"Normalized Difference Impervious Surface Index Red","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.14358/PERS.76.5.557","short_name":"NDISIr"},"NDMI":{"application_domain":"vegetation","bands":["N","S1"],"contributor":"https://github.com/bpurinton","date_of_addition":"2021-12-01","formula":"(N - S1)/(N + S1)","long_name":"Normalized Difference Moisture Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/S0034-4257(01)00318-2","short_name":"NDMI"},"NDPI":{"application_domain":"vegetation","bands":["N","alpha","R","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-20","formula":"(N - (alpha * R + (1.0 - alpha) * S1))/(N + (alpha * R + (1.0 - alpha) * S1))","long_name":"Normalized Difference Phenology Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2017.04.031","short_name":"NDPI"},"NDPolI":{"application_domain":"radar","bands":["VV","VH"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"(VV - VH)/(VV + VH)","long_name":"Normalized Difference Polarization Index","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://www.isprs.org/proceedings/XXXVII/congress/4_pdf/267.pdf","short_name":"NDPolI"},"NDPonI":{"application_domain":"water","bands":["S1","G"],"contributor":"https://github.com/CvenGeo","date_of_addition":"2022-10-03","formula":"(S1-G)/(S1+G)","long_name":"Normalized Difference Pond Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2006.07.012","short_name":"NDPonI"},"NDREI":{"application_domain":"vegetation","bands":["N","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-13","formula":"(N - RE1) / (N + RE1)","long_name":"Normalized Difference Red Edge Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/1011-1344(93)06963-4","short_name":"NDREI"},"NDSI":{"application_domain":"snow","bands":["G","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(G - S1) / (G + S1)","long_name":"Normalized Difference Snow Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1109/IGARSS.1994.399618","short_name":"NDSI"},"NDSII":{"application_domain":"snow","bands":["G","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(G - N)/(G + N)","long_name":"Normalized Difference Snow Ice Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/01431160802385459","short_name":"NDSII"},"NDSIITM":{"application_domain":"snow","bands":["R","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2026-01-10","formula":"(R - S1)/(R + S1)","long_name":"Normalized Difference Snow/Ice Index for Landsat TM","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160119766","short_name":"NDSIITM"},"NDSIWV":{"application_domain":"soil","bands":["G","Y"],"contributor":"https://github.com/remi-braun","date_of_addition":"2022-11-20","formula":"(G - Y)/(G + Y)","long_name":"WorldView Normalized Difference Soil Index","platforms":[],"reference":"https://www.semanticscholar.org/paper/Using-WorldView-2-Vis-NIR-MSI-Imagery-to-Support-Wolf/5e5063ccc4ee76b56b721c866e871d47a77f9fb4","short_name":"NDSIWV"},"NDSInw":{"application_domain":"snow","bands":["N","S1","beta"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(N - S1 - beta)/(N + S1)","long_name":"Normalized Difference Snow Index with 
31no Water","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/w12051339","short_name":"NDSInw"},"NDSWIR":{"application_domain":"burn","bands":["N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"(N - S1)/(N + S1)","long_name":"Normalized Difference SWIR","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1109/TGRS.2003.819190","short_name":"NDSWIR"},"NDSaII":{"application_domain":"snow","bands":["R","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(R - S1) / (R + S1)","long_name":"Normalized Difference Snow and Ice Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/01431160119766","short_name":"NDSaII"},"NDSoI":{"application_domain":"soil","bands":["S2","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(S2 - G)/(S2 + G)","long_name":"Normalized Difference Soil Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.jag.2015.02.010","short_name":"NDSoI"},"NDTI":{"application_domain":"water","bands":["R","G"],"contributor":"https://github.com/CvenGeo","date_of_addition":"2022-10-03","formula":"(R-G)/(R+G)","long_name":"Normalized Difference Turbidity Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2006.07.012","short_name":"NDTI"},"NDTI4RE":{"application_domain":"vegetation","bands":["gamma","S1","S2","N","RE3"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-09-30","formula":"gamma * (S1 - S2)/(S1 + S2) + (1 - gamma) * (N - RE3)/(N + RE3)","long_name":"4-band Red Edge Normalized Difference Tillage Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.jag.2022.102793","short_name":"NDTI4RE"},"NDTillI":{"application_domain":"vegetation","bands":["S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-10-11","formula":"(S1 - S2)/(S1 + S2)","long_name":"Normalized Difference Tillage Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.asprs.org/wp-content/uploads/pers/1997journal/jan/1997_jan_87-93.pdf","short_name":"NDTillI"},"NDVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - R)/(N + R)","long_name":"Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://ntrs.nasa.gov/citations/19740022614","short_name":"NDVI"},"NDVI4RE":{"application_domain":"vegetation","bands":["alpha","RE3","RE2","beta","R","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-09-30","formula":"((alpha * RE3 + (1 - alpha) * RE2) - (beta * R + (1 - beta) * RE1))/((alpha * RE3 + (1 - alpha) * RE2) + (beta * R + (1 - beta) * RE1))","long_name":"4-band Red Edge Normalized Difference Vegetation Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.jag.2022.102793","short_name":"NDVI4RE"},"NDVI705":{"application_domain":"vegetation","bands":["RE2","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"(RE2 - RE1) / (RE2 + RE1)","long_name":"Normalized Difference Vegetation Index (705 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0176-1617(11)81633-0","short_name":"NDVI705"},"NDVIMNDWI":{"application_domain":"water","bands":["N","R","G","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"((N - R)/(N + R)) - ((G - S1)/(G + S1))","long_name":"NDVI-MNDWI Model","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1007/978-3-662-45737-5_51","short_name":"NDVIMNDWI"},"NDVIT":{"application_domain":"burn","bands":["N","R","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(N - (R * T / 10000.0))/(N + (R * T / 10000.0))","long_name":"Normalized Difference Vegetation Index Thermal","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1080/01431160600954704","short_name":"NDVIT"},"NDWI":{"application_domain":"water","bands":["G","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(G - N) / (G + N)","long_name":"Normalized Difference Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/01431169608948714","short_name":"NDWI"},"NDWIns":{"application_domain":"water","bands":["G","alpha","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(G - alpha * N)/(G + N)","long_name":"Normalized Difference Water Index with 
31no Snow Cover and Glaciers","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.3390/w12051339","short_name":"NDWIns"},"NDYI":{"application_domain":"vegetation","bands":["G","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(G - B) / (G + B)","long_name":"Normalized Difference Yellowness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2016.06.016","short_name":"NDYI"},"NGRDI":{"application_domain":"vegetation","bands":["G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(G - R) / (G + R)","long_name":"Normalized Green Red Difference Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(79)90013-0","short_name":"NGRDI"},"NHFD":{"application_domain":"urban","bands":["RE1","A"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-17","formula":"(RE1 - A) / (RE1 + A)","long_name":"Non-Homogeneous Feature Difference","platforms":["Sentinel-2"],"reference":"https://www.semanticscholar.org/paper/Using-WorldView-2-Vis-NIR-MSI-Imagery-to-Support-Wolf/5e5063ccc4ee76b56b721c866e871d47a77f9fb4","short_name":"NHFD"},"NIRv":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-16","formula":"((N - R) / (N + R)) * N","long_name":"Near-Infrared Reflectance of Vegetation","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1126/sciadv.1602244","short_name":"NIRv"},"NIRvH2":{"application_domain":"vegetation","bands":["N","R","k","lambdaN","lambdaR"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"N - R - k * (lambdaN - lambdaR)","long_name":"Hyperspectral Near-Infrared Reflectance of Vegetation","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2021.112723","short_name":"NIRvH2"},"NIRvP":{"application_domain":"vegetation","bands":["N","R","PAR"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-18","formula":"((N - R) / (N + R)) * N * PAR","long_name":"Near-Infrared Reflectance of Vegetation and Incoming PAR","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.rse.2021.112763","short_name":"NIRvP"},"NLI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-11","formula":"((N ** 2) - R)/((N ** 2) + R)","long_name":"Non-Linear Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/02757259409532252","short_name":"NLI"},"NMDI":{"application_domain":"vegetation","bands":["N","S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-11","formula":"(N - (S1 - S2))/(N + (S1 - S2))","long_name":"Normalized Multi-band Drought Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1029/2007GL031021","short_name":"NMDI"},"NPCI":{"application_domain":"vegetation","bands":["R","A"],"contributor":"https://github.com/MartinuzziFrancesco","date_of_addition":"2025-03-19","formula":"(R - A) / (R + A)","long_name":"Normalized Pigments Chlorophyll Ratio Index","platforms":["Sentinel-2","Landsat-OLI"],"reference":"https://doi.org/10.1016/0034-4257(94)90136-8","short_name":"NPCI"},"NRFIg":{"application_domain":"vegetation","bands":["G","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(G - S2) / (G + S2)","long_name":"Normalized Rapeseed Flowering Index Green","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs13010105","short_name":"NRFIg"},"NRFIr":{"application_domain":"vegetation","bands":["R","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(R - S2) / (R + S2)","long_name":"Normalized Rapeseed Flowering Index Red","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs13010105","short_name":"NRFIr"},"NSDS":{"application_domain":"soil","bands":["S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"(S1 - S2)/(S1 + S2)","long_name":"Normalized Shortwave Infrared Difference Soil-Moisture","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/land10030231","short_name":"NSDS"},"NSDSI1":{"application_domain":"soil","bands":["S1","S2"],"contributor":"https://github.com/CvenGeo","date_of_addition":"2022-10-03","formula":"(S1-S2)/S1","long_name":"Normalized Shortwave-Infrared Difference Bare Soil Moisture Index 1","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.isprsjprs.2019.06.012","short_name":"NSDSI1"},"NSDSI2":{"application_domain":"soil","bands":["S1","S2"],"contributor":"https://github.com/CvenGeo","date_of_addition":"2022-10-03","formula":"(S1-S2)/S2","long_name":"Normalized Shortwave-Infrared Difference Bare Soil Moisture Index 2","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.isprsjprs.2019.06.012","short_name":"NSDSI2"},"NSDSI3":{"application_domain":"soil","bands":["S1","S2"],"contributor":"https://github.com/CvenGeo","date_of_addition":"2022-10-03","formula":"(S1-S2)/(S1+S2)","long_name":"Normalized Shortwave-Infrared Difference Bare Soil Moisture Index 3","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.isprsjprs.2019.06.012","short_name":"NSDSI3"},"NSTv1":{"application_domain":"burn","bands":["N","S2","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-10-06","formula":"((N-S2)/(N+S2))*T","long_name":"NIR-SWIR-Temperature Version 1","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1016/j.rse.2011.06.010","short_name":"NSTv1"},"NSTv2":{"application_domain":"burn","bands":["N","S2","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-10-06","formula":"(N-(S2+T))/(N+(S2+T))","long_name":"NIR-SWIR-Temperature Version 2","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1016/j.rse.2011.06.010","short_name":"NSTv2"},"NWI":{"application_domain":"water","bands":["B","N","S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"(B - (N + S1 + S2))/(B + (N + S1 + S2))","long_name":"New Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.11873/j.issn.1004-0323.2009.2.167","short_name":"NWI"},"NormG":{"application_domain":"vegetation","bands":["G","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"G/(N + G + R)","long_name":"Normalized Green","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2134/agronj2004.0314","short_name":"NormG"},"NormNIR":{"application_domain":"vegetation","bands":["N","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"N/(N + G + R)","long_name":"Normalized NIR","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2134/agronj2004.0314","short_name":"NormNIR"},"NormR":{"application_domain":"vegetation","bands":["R","N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"R/(N + G + R)","long_name":"Normalized Red","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2134/agronj2004.0314","short_name":"NormR"},"OCVI":{"application_domain":"vegetation","bands":["N","G","R","cex
31p"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-13","formula":"(N / G) * (R / G) ** cexp","long_name":"Optimized Chlorophyll Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"http://dx.doi.org/10.1007/s11119-008-9075-z","short_name":"OCVI"},"OSAVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-11","formula":"(N - R) / (N + R + 0.16)","long_name":"Optimized Soil-Adjusted Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(95)00186-7","short_name":"OSAVI"},"OSI":{"application_domain":"water","bands":["G","R","B"],"contributor":"https://github.com/emanuelcastanho","date_of_addition":"2024-05-03","formula":"(G + R)/B","long_name":"Oil Spill Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.mex.2021.101327","short_name":"OSI"},"PI":{"application_domain":"water","bands":["N","R"],"contributor":"https://github.com/emanuelcastanho","date_of_addition":"2024-05-03","formula":"N/(N + R)","long_name":"Plastic Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.3390/rs12162648","short_name":"PI"},"PISI":{"application_domain":"urban","bands":["B","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-18","formula":"0.8192 * B - 0.5735 * N + 0.0750","long_name":"Perpendicular Impervious Surface Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.3390/rs10101521","short_name":"PISI"},"PSRI":{"application_domain":"vegetation","bands":["R","B","RE2"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(R - B)/RE2","long_name":"Plant Senescing Reflectance Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1034/j.1399-3054.1999.106119.x","short_name":"PSRI"},"QpRVI":{"application_domain":"radar","bands":["HV","HH","VV"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-12-24","formula":"(8.0 * HV)/(HH + VV + 2.0 * HV)","long_name":"Quad-Polarized Radar Vegetation Index","platforms":[],"reference":"https://doi.org/10.1109/IGARSS.2001.976856","short_name":"QpRVI"},"RCC":{"application_domain":"vegetation","bands":["R","G","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"R / (R + G + B)","long_name":"Red Chromatic Coordinate","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(87)90088-5","short_name":"RCC"},"RDVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"(N - R) / ((N + R) ** 0.5)","long_name":"Renormalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(94)00114-3","short_name":"RDVI"},"REDSI":{"application_domain":"vegetation","bands":["RE3","R","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"((705.0 - 665.0) * (RE3 - R) - (783.0 - 665.0) * (RE1 - R)) / (2.0 * R)","long_name":"Red-Edge Disease Stress Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/s18030868","short_name":"REDSI"},"RENDVI":{"application_domain":"vegetation","bands":["RE2","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-09","formula":"(RE2 - RE1)/(RE2 + RE1)","long_name":"Red Edge Normalized Difference Vegetation Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0176-1617(11)81633-0","short_name":"RENDVI"},"RFDI":{"application_domain":"radar","bands":["HH","HV"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-12-25","formula":"(HH - HV)/(HH + HV)","long_name":"Radar Forest Degradation Index","platforms":["Sentinel-1 (Dual Polarisation HH-HV)"],"reference":"https://doi.org/10.5194/bg-9-179-2012","short_name":"RFDI"},"RGBVI":{"application_domain":"vegetation","bands":["G","B","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(G ** 2.0 - B * R)/(G ** 2.0 + B * R)","long_name":"Red Green Blue Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.jag.2015.02.012","short_name":"RGBVI"},"RGRI":{"application_domain":"vegetation","bands":["R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"R/G","long_name":"Red-Green Ratio Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.jag.2014.03.018","short_name":"RGRI"},"RI":{"application_domain":"vegetation","bands":["R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-09","formula":"(R - G)/(R + G)","long_name":"Redness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://www.documentation.ird.fr/hor/fdi:34390","short_name":"RI"},"RI4XS":{"application_domain":"soil","bands":["R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-11-20","formula":"(R**2.0)/(G**4.0)","long_name":"SPOT HRV XS-based Redne
31ss Index 4","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(98)00030-3","short_name":"RI4XS"},"RNDVI":{"application_domain":"water","bands":["R","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2024-05-16","formula":"(R - N)/(R + N)","long_name":"Reversed Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.3390/rs12162648","short_name":"RNDVI"},"RVI":{"application_domain":"vegetation","bands":["RE2","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"RE2 / R","long_name":"Ratio Vegetation Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.2134/agronj1968.00021962006000060016x","short_name":"RVI"},"RVI4RE":{"application_domain":"vegetation","bands":["alpha","RE3","RE2","beta","R","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-09-30","formula":"(alpha * RE3 + (1 - alpha) * RE2)/(beta * R + (1 - beta) * RE1)","long_name":"4-band Red Edge Ratio Vegetation Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.jag.2022.102793","short_name":"RVI4RE"},"S2REP":{"application_domain":"vegetation","bands":["RE3","R","RE1","RE2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-17","formula":"705.0 + 35.0 * ((((RE3 + R) / 2.0) - RE1) / (RE2 - RE1))","long_name":"Sentinel-2 Red-Edge Position","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.isprsjprs.2013.04.007","short_name":"S2REP"},"S2WI":{"application_domain":"water","bands":["RE1","S2"],"contributor":"https://github.com/MATRIX4284","date_of_addition":"2022-03-06","formula":"(RE1 - S2)/(RE1 + S2)","long_name":"Sentinel-2 Water Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/w13121647","short_name":"S2WI"},"S3":{"application_domain":"snow","bands":["N","R","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(N * (R - S1)) / ((N + R) * (N + S1))","long_name":"S3 Snow Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3178/jjshwr.12.28","short_name":"S3"},"SARVI":{"application_domain":"vegetation","bands":["L","N","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-11","formula":"(1 + L)*(N - (R - (R - B))) / (N + (R - (R - B)) + L)","long_name":"Soil Adjusted and Atmospherically Resistant Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1109/36.134076","short_name":"SARVI"},"SAVI":{"application_domain":"vegetation","bands":["L","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(1.0 + L) * (N - R) / (N + R + L)","long_name":"Soil-Adjusted Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(88)90106-X","short_name":"SAVI"},"SAVI2":{"application_domain":"vegetation","bands":["N","R","slb","sla"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"N / (R + (slb / sla))","long_name":"Soil-Adjusted Vegetation Index 2","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/01431169008955053","short_name":"SAVI2"},"SAVI4RE":{"application_domain":"vegetation","bands":["alpha","RE3","RE2","beta","R","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-09-30","formula":"2.0 * ((alpha * RE3 + (1 - alpha) * RE2) - (beta * R + (1 - beta) * RE1))/((alpha * RE3 + (1 - alpha) * RE2) + (beta * R + (1 - beta) * RE1 + 1))","long_name":"4-band Red Edge Soil Adjusted Vegetation Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.jag.2022.102793","short_name":"SAVI4RE"},"SAVIT":{"application_domain":"burn","bands":["L","N","R","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(1.0 + L) * (N - (R * T / 10000.0)) / (N + (R * T / 10000.0) + L)","long_name":"Soil-Adjusted Vegetation Index Thermal","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1080/01431160600954704","short_name":"SAVIT"},"SEVI":{"application_domain":"vegetation","bands":["N","R","fdelta"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"(N/R) + fdelta * (1.0/R)","long_name":"Shadow-Eliminated Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/17538947.2018.1495770","short_name":"SEVI"},"SI":{"application_domain":"vegetation","bands":["B","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"((1.0 - B) * (1.0 - G) * (1.0 - R)) ** (1/3)","long_name":"Shadow Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.465.8749&rep=rep1&type=pdf","short_name":"SI"},"SIPI":{"application_domain":"vegetation","bands":["N","A","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-17","formula":"(N - A) / (N - R)","long_name":"Structure Insensitive Pigment Index","platforms":["Sentinel-2","Landsat-OLI"],"reference":"https://eurekamag.com/research/009/395/009395053.php","short_name":"SIPI"},"SLAVI":{"application_domain":"vegetation","bands":["N","R","S2"],"contributor":"https://github.com/geoSanjeeb","date_of_addition":"2023-07-03","formula":"N/(R + S2)","long_name":"Specific Leaf Area Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.asprs.org/wp-content/uploads/pers/2000journal/february/2000_feb_
31183-191.pdf","short_name":"SLAVI"},"SNDTI":{"application_domain":"vegetation","bands":["L","S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-10-11","formula":"(1.0 + L) * (S1 - S2) / (S1 + S2 + L)","long_name":"Soil-Adjusted Normalized Difference Tillage Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1080/22797254.2017.1418186","short_name":"SNDTI"},"SNDTI4RE":{"application_domain":"vegetation","bands":["gamma","S1","S2","N","RE3"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-09-30","formula":"gamma * ((S1 - S2) * 2.0)/(S1 + S2 + 1.0) + (1 - gamma) * ((N - RE3) * 2.0)/(N + RE3 + 1.0)","long_name":"4-band Red Edge Soil-Adjusted Normalized Difference Tillage Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.jag.2022.102793","short_name":"SNDTI4RE"},"SR":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"N/R","long_name":"Simple Ratio","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.2307/1936256","short_name":"SR"},"SR2":{"application_domain":"vegetation","bands":["N","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-09","formula":"N/G","long_name":"Simple Ratio (800 and 550 nm)","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1080/01431169308904370","short_name":"SR2"},"SR3":{"application_domain":"vegetation","bands":["N2","G","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-09","formula":"N2/(G * RE1)","long_name":"Simple Ratio (860, 550 and 708 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(98)00046-7","short_name":"SR3"},"SR555":{"application_domain":"vegetation","bands":["RE2","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"RE2 / G","long_name":"Simple Ratio (555 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0176-1617(11)81633-0","short_name":"SR555"},"SR705":{"application_domain":"vegetation","bands":["RE2","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"RE2 / RE1","long_name":"Simple Ratio (705 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0176-1617(11)81633-0","short_name":"SR705"},"STI":{"application_domain":"vegetation","bands":["S1","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-10-11","formula":"S1 / S2","long_name":"Simple Tillage Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.asprs.org/wp-content/uploads/pers/1997journal/jan/1997_jan_87-93.pdf","short_name":"STI"},"STI4RE":{"application_domain":"vegetation","bands":["gamma","S1","S2","N","RE3"],"contributor":"https://github.com/davemlz","date_of_addition":"2025-09-30","formula":"gamma * S1/S2 + (1 - gamma) * N/RE3","long_name":"4-band Red Edge Soil Tillage Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.jag.2022.102793","short_name":"STI4RE"},"SWI":{"application_domain":"snow","bands":["G","N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(G * (N - S1)) / ((G + N) * (N + S1))","long_name":"Snow Water Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs11232774","short_name":"SWI"},"SWM":{"application_domain":"water","bands":["B","G","N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-20","formula":"(B + G)/(N + S1)","long_name":"Sentinel Water Mask","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://eoscience.esa.int/landtraining2017/files/posters/MILCZAREK.pdf","short_name":"SWM"},"SeLI":{"application_domain":"vegetation","bands":["N2","RE1"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-08","formula":"(N2 - RE1) / (N2 + RE1)","long_name":"Sentinel-2 LAI Green Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/s19040904","short_name":"SeLI"},"TCARI":{"application_domain":"vegetation","bands":["RE1","R","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-13","formula":"3 * ((RE1 - R) - 0.2 * (RE1 - G) * (RE1 / R))","long_name":"Transformed Chlorophyll Absorption in Reflectance Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(02)00018-4","short_name":"TCARI"},"TCARIOSAVI":{"application_domain":"vegetation","bands":["RE1","R","G","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"(3 * ((RE1 - R) - 0.2 * (RE1 - G) * (RE1 / R))) / (1.16 * (N - R) / (N + R + 0.16))","long_name":"TCARI/OSAVI Ratio","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(02)00018-4","short_name":"TCARIOSAVI"},"TCARIOSAVI705":{"application_domain":"vegetation","bands":["RE2","RE1","G"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-11-06","formula":"(3 * ((RE2 - RE1) - 0.2 * (RE2 - G) * (RE2 / RE1))) / (1.16 * (RE2 - RE1) / (RE2 + RE1 + 0.16))","long_name":"TCARI/OSAVI Ratio (705 and 750 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/j.agrformet.2008.03.005","short_name":"TCARIOSAVI705"},"TCI":{"application_domain":"vegetation","bands":["RE1","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"1.2 * (RE1 - G) - 1.5 * (R - G) * (RE1 / R) ** 0.5","long_name":"Triangular Chlorophyll Index","platforms":["Sentinel-2"],"reference":"http://dx.doi.org/10.1109/TGRS.2007.904836","short_name":"TCI"},"TDVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-09","formula":"1.5 * ((N - R)/((N ** 2.0 + R + 0.5) ** 0.5))","long_name":"Transformed Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1109/IGARSS.2002.1026867","short_name":"TDVI"},"TGI":{"application_domain":"vegetation","bands":["R","G","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"- 0.5 * (190 * (R - G) - 120 * (R - B))","long_name":"Triangular Greenness Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"http://dx.doi.org/10.1016/j.jag.2012.07.020","short_name":"TGI"},"TRRVI":{"application_domain":"vegetation","bands":["RE2","R","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"((RE2 - R) / (RE2 + R)) / (((N - R) / (N + R)) + 1.0)","long_name":"Transformed Red Range Vegetation Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/rs12152359","short_name":"TRRVI"},"TSAVI":{"application_domain":"vegetation","bands":["sla","N","R","slb"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"sla * (N - sla * R - slb) / (sla * N + R - sla * slb)","long_name":"Transformed Soil-Adjusted Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1109/IGARSS.1989.576128","short_name":"TSAVI"},"TTVI":{"application_domain":"vegetation","bands":["RE3","RE2","N2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"0.5 * ((865.0 - 740.0) * (RE3 - RE2) - (N2 - RE2) * (783.0 - 740))","long_name":"Transformed Triangular Vegetation Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/rs12010016","short_name":"TTVI"},"TVI":{"application_domain":"vegetation","bands":["N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(((N - R)/(N + R)) + 0.5) ** 0.5","long_name":"Transformed Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://ntrs.nasa.gov/citations/19740022614","short_name":"TVI"},"TWI":{"application_domain":"water","bands":["RE1","RE2","G","S2","B","N"],"contributor":"https://github.com/remi-braun","date_of_addition":"2023-02-10","formula":"(2.84 * (RE1 - RE2) / (G + S2)) + ((1.25 * (G - B) - (N - B)) / (N + 1.25 * G - 0.25 * B))","long_name":"Triangle Water Index","platforms":["Sentinel-2"],"reference":"https://doi.org/10.3390/rs14215289","short_name":"TWI"},"TriVI":{"application_domain":"vegetation","bands":["N","G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"0.5 * (120 * (N - G) - 200 * (R - G))","long_name":"Triangular Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"http://dx.doi.org/10.1016/S0034-4257(00)00197-8","short_name":"TriVI"},"UI":{"application_domain":"urban","bands":["S2","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-02-07","formula":"(S2 - N)/(S2 + N)","long_name":"Urban Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://www.isprs.org/proceedings/XXXI/congress/part7/321_XXXI-part7.pdf","short_name":"UI"},"VARI":{"application_domain":"vegetation","bands":["G","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(G - R) / (G + R - B)","long_name":"Visible Atmospherically Resistant Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(01)00289-9","short_name":"VARI"},"VARI700":{"application_domain":"vegetation","bands":["RE1","R","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-20","formula":"(RE1 - 1.7 * R + 0.7 * B) / (RE1 + 1.3 * R - 1.3 * B)","long_name":"Visible Atmospherically Resistant Index (700 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(01)00289-9","short_name":"VARI700"},"VDDPI":{"application_domain":"radar","bands":["VV","VH"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"(VV + VH)/VV","long_name":"Vertical Dual De-Polarization Index","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.1016/j.rse.2018.09.003","short_name":"VDDPI"},"VHVVD":{"application_domain":"radar","bands":["VH","VV"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"VH - VV","long_name":"VH-VV Difference","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.3390/app9040655","short_name":"VHVVD"},"VHVVP":{"application_domain":"radar","bands":["VH","VV"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"VH * VV","long_name":"VH-VV Product","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.1109/IGARSS47720.2021.9554099","short_name":"VHVVP"},"VHVVR":{"application_domain":"radar","bands":["VH","VV"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"VH/VV","long_name":"VH-VV Ratio","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.1109/IGARSS47720.2021.9554099","short_name":"VHVVR"},"VI6T":{"application_domain":"burn","bands":["N","T"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"(N - T/10000.0)/(N + T/10000.0)","long_name":"VI6T Index","platforms":["Landsat-TM","Landsat-ETM+"],"reference":"https://doi.org/10.1080/01431160500239008","short_name":"VI6T"},"VI700":{"application_domain":"vegetation","bands":["RE1","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-20","formula":"(RE1 - R) / (RE1 + R)","long_name":"Vegetation Index (700 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(01)00289-9","short_name":"VI700"},"VIBI":{"application_domain":"urban","bands":["N","R","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-09-22","formula":"((N-R)/(N+R))/(((N-R)/(N+R)) + ((S1-N)/(S1+N)))","long_name":"Vegetation Index Built-up Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"http://dx.doi.org/10.1080/01431161.2012.687842","short_name":"VIBI"},"VIG":{"application_domain":"vegetation","bands":["G","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-20","formula":"(G - R) / (G + R)","long_name":"Vegetation Index Green","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/S0034-4257(01)00289-9","short_name":"VIG"},"VVVHD":{"application_domain":"radar","bands":["VV","VH"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"VV - VH","long_name":"VV-VH Difference","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.1109/IGARSS47720.2021.9554099","short_name":"VVVHD"},"VVVHR":{"application_domain":"radar","bands":["VV","VH"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"VV/VH","long_name":"VV-VH Ratio","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.3390/app9040655","short_name":"VVVHR"},"VVVHS":{"application_domain":"radar","bands":["VV","VH"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-19","formula":"VV + VH","long_name":"VV-VH Sum","platforms":["Sentinel-1 (Dual Polarisation VV-VH)"],"reference":"https://doi.org/10.1109/IGARSS47720.2021.9554099","short_name":"VVVHS"},"VgNIRBI":{"application_domain":"urban","bands":["G","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-02-09","formula":"(G - N)/(G + N)","long_name":"Visible Green-Based Built-Up Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.ecolind.2015.03.037","short_name":"VgNIRBI"},"VrNIRBI":{"application_domain":"urban","bands":["R","N"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-02-09","formula":"(R - N)/(R + N)","long_name":"Visible Red-Based Built-Up Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/j.ecolind.2015.03.037","short_name":"VrNIRBI"},"WDRVI":{"application_domain":"vegetation","bands":["alpha","N","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"(alpha * N - R) / (alpha * N + R)","long_name":"Wide Dynamic Range Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1078/0176-1617-01176","short_name":"WDRVI"},"WDVI":{"application_domain":"vegetation","bands":["N","sla","R"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-14","formula":"N - sla * R","long_name":"Weighted Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1016/0034-4257(89)90076-X","short_name":"WDVI"},"WI1":{"application_domain":"water","bands":["G","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(G - S2) / (G + S2)","long_name":"Water Index 1","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs11182186","short_name":"WI1"},"WI2":{"application_domain":"water","bands":["B","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-09-18","formula":"(B - S2) / (B + S2)","long_name":"Water Index 2","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.3390/rs11182186","short_name":"WI2"},"WI2015":{"application_domain":"water","bands":["G","R","N","S1","S2"],"contributor":"https://github.com/remi-braun","date_of_addition":"2022-10-26","formula":"1.7204 
31+ 171 * G + 3 * R - 70 * N - 45 * S1 - 71 * S2","long_name":"Water Index 2015","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1016/j.rse.2015.12.055","short_name":"WI2015"},"WRI":{"application_domain":"water","bands":["G","R","N","S1"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-01-17","formula":"(G + R)/(N + S1)","long_name":"Water Ratio Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1109/GEOINFORMATICS.2010.5567762","short_name":"WRI"},"bNIRv":{"application_domain":"vegetation","bands":["N","B"],"contributor":"https://github.com/davemlz","date_of_addition":"2024-05-16","formula":"((N - B)/(N + B)) * N","long_name":"Blue Near-Infrared Reflectance of Vegetation","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1029/2024JG008240","short_name":"bNIRv"},"kEVI":{"application_domain":"kernel","bands":["g","kNN","kNR","C1","C2","kNB","kNL"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-10","formula":"g * (kNN - kNR) / (kNN + C1 * kNR - C2 * kNB + kNL)","long_name":"Kernel Enhanced Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1126/sciadv.abc7447","short_name":"kEVI"},"kIPVI":{"application_domain":"kernel","bands":["kNN","kNR"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"kNN/(kNN + kNR)","long_name":"Kernel Infrared Percentage Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1126/sciadv.abc7447","short_name":"kIPVI"},"kNDVI":{"application_domain":"kernel","bands":["kNN","kNR"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"(kNN - kNR)/(kNN + kNR)","long_name":"Kernel Normalized Difference Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1126/sciadv.abc7447","short_name":"kNDVI"},"kRVI":{"application_domain":"kernel","bands":["kNN","kNR"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-04-07","formula":"kNN / kNR","long_name":"Kernel Ratio Vegetation Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1126/sciadv.abc7447","short_name":"kRVI"},"kVARI":{"application_domain":"kernel","bands":["kGG","kGR","kGB"],"contributor":"https://github.com/davemlz","date_of_addition":"2021-05-10","formula":"(kGG - kGR) / (kGG + kGR - kGB)","long_name":"Kernel Visible Atmospherically Resistant Index","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS","Planet-Fusion"],"reference":"https://doi.org/10.1126/sciadv.abc7447","short_name":"kVARI"},"mND705":{"application_domain":"vegetation","bands":["RE2","RE1","A"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(RE2 - RE1)/(RE2 + RE1 - A)","long_name":"Modified Normalized Difference (705, 750 and 445 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(02)00010-X","short_name":"mND705"},"mSR705":{"application_domain":"vegetation","bands":["RE2","A"],"contributor":"https://github.com/davemlz","date_of_addition":"2022-04-08","formula":"(RE2 - A)/(RE2 + A)","long_name":"Modified Simple Ratio (705 and 445 nm)","platforms":["Sentinel-2"],"reference":"https://doi.org/10.1016/S0034-4257(02)00010-X","short_name":"mSR705"},"sNIRvLSWI":{"application_domain":"vegetation","bands":["N","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2024-05-16","formula":"((N - S2)/(N + S2)) * N","long_name":"SWIR-enhanced Near-Infrared Reflectance of Vegetation for LSWI","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1029/2024JG008240","short_name":"sNIRvLSWI"},"sNIRvNDPI":{"application_domain":"vegetation","bands":["N","alpha","R","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2024-05-16","formula":"(N - (alpha * R + (1.0 - alpha) * S2))/(N + (alpha * R + (1.0 - alpha) * S2)) * N","long_name":"SWIR-enhanced Near-Infrared Reflectance of Vegetation for NDPI","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1029/2024JG008240","short_name":"sNIRv
31NDPI"},"sNIRvNDVILSWIP":{"application_domain":"vegetation","bands":["N","R","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2024-05-16","formula":"((N - R)/(N + R)) * ((N - S2)/(N + S2)) * N","long_name":"SWIR-enhanced Near-Infrared Reflectance of Vegetation for the NDVI-LSWI Product","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1029/2024JG008240","short_name":"sNIRvNDVILSWIP"},"sNIRvNDVILSWIS":{"application_domain":"vegetation","bands":["N","R","S2"],"contributor":"https://github.com/davemlz","date_of_addition":"2024-05-16","formula":"(((N - R)/(N + R)) + ((N - S2)/(N + S2))) * N","long_name":"SWIR-enhanced Near-Infrared Reflectance of Vegetation for the NDVI-LSWI Sum","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1029/2024JG008240","short_name":"sNIRvNDVILSWIS"},"sNIRvSWIR":{"application_domain":"vegetation","bands":["N","R","S2"],"contributor":"https://github.com/MartinuzziFrancesco","date_of_addition":"2024-05-14","formula":"((N - R - S2 ** 2.0)/(N + R + S2 ** 2.0)) * N","long_name":"SWIR-enhanced Near-Infrared Reflectance of Vegetation","platforms":["Sentinel-2","Landsat-OLI","Landsat-TM","Landsat-ETM+","MODIS"],"reference":"https://doi.org/10.1029/2024JG008240","short_name":"sNIRvSWIR"}}}').u,WB={ndrei:"NDREI",cire:"CIRE"},ZB={evi:{L:1}},YB=Aw.filter((function(e){return e.available&&"visual"!==e.category})).map((function(e){var t,r,n,i=WB[e.value]||e.value.toUpperCase(),o=qB[i];return{key:i,label:e.label,longName:null!==(t=null==o?void 0:o.long_name)&&void 0!==t?t:e.description,expression:o?HB(o.formula,o.bands,ZB[e.value]):"",color:null!==(r=e.color)&&void 0!==r?r:"#6b7280",backgroundColor:null!==(n=e.backgroundColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.1)",domain:e.category,description:e.description}}));function XB(e){return YB.find((function(t){return t.key===e}))}var KB=new Map,JB=36e5;function QB(e){var t,r;if(null!=e&&null!==(t=e.features)&&void 0!==t&&null!==(t=t[0])&&void 0!==t&&null!==(t=t.properties)&&void 0!==t&&t.statistics){var n=e.features[0].properties.statistics,i=Object.keys(n)[0];r=i?n[i]:null}else if(null!=e&&e.statistics){var o=Object.keys(e.statistics)[0];r=o?e.statistics[o]:null}return r?{min:r.min,max:r.max,mean:r.mean,count:r.count,sum:r.sum,std:r.std,median:r.median}:null}function ej(e,t,r){return tj.apply(this,arguments)}function tj(){return tj=DB(RB().mark((function e(t,r,n){var i,o,a,s,l,c,u,d,h;return RB().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=JSON.stringify(null!==(i=r.geometry)&&void 0!==i?i:null),a="".concat(t,"-").concat(n,"-").concat(o),!((s=KB.get(a))&&Date.now()-s.fetchedAt<JB)){e.next=5;break}return e.abrupt("return",s.stats);case 5:return l=new URLSearchParams({stac_href:t,expression:n}),c={type:"FeatureCollection",features:[r]},e.prev=7,e.next=10,fetch("/environmental/api/satellite-statistics/?".concat(l),{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(c)});case 10:if((u=e.sent).ok){e.next=14;break}return console.error("[statistics] API error: ".concat(u.status)),e.abrupt("return",null);case 14:return e.next=16,u.json();case 16:if(d=e.sent,h=QB(d)){e.next=21;break}return console.error("[statistics] No statistics in response:",d),e.abrupt("return",null);case 21:return KB.set(a,{stats:h,fetchedAt:Date.now()}),e.abrupt("return",h);case 25:return e.prev=25,e.t0=e.catch(7),console.error("Failed to fetch field statistics:",e.t0),e.abrupt("return",null);case 29:case"end":return e.stop()}}),e,null,[[7,25]])}))),tj.apply(this,arguments)}function rj(){return(rj=DB(RB().mark((function e(t,r,n,i){var o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M,E,P,A,C,R,L,O;return RB().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=XB(n)){e.next=4;break}return console.debug("[statistics] No metric definition for: ".concat(n)),e.abrupt("return",[]);case 4:if(l=null!==(o=null==i?void 0:i.maxImages)&&void 0!==o?o:20,c=null!==(a=null==i?void 0:i.maxCloudCover)&&void 0!==a?a:0,u=t.filter((function(e){var t,r;return(null!==(t=null!==(r=e.bbox_cloud_cover)&&void 0!==r?r:e.cloud_cover)&&void 0!==t?t:100)<=c&&e.stac_href})).slice(0,l),0!==u.length){e.next=9;break}return e.abrupt("return",[]);case 9:d=[],h=[],f=zB(u);try{for(f.s();!(p=f.n()).done;)g=p.value,m="".concat(g.stac_href,"-").concat(s.expression),(y=KB.get(m))&&Date.now()-y.fetchedAt<JB?d.push({date:g.date,mean:y.stats.mean,min:y.stats.min,max:y.stats.max,cloudCover:null!==(_=null!==(v=g.bbox_cloud_cover)&&void 0!==v?v:g.cloud_cover)&&void 0!==_?_:0}):h.push(g)}catch(e){f.e(e)}finally{f.f()}if(b=[],!(h.length>0)){e.next=58;break}return x=h.map((function(e){return e.stac_href})),w={type:"FeatureCollection",features:[r]},e.prev=17,e.next=20,fetch("/environmental/api/satellite-statistics/batch/",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({stac_hrefs:x,expression:s.expression,geojson:w})});case 20:if((S=e.sent).ok){e.next=24;break}return console.error("[statistics] Batch API error: ".concat(S.status)),e.abrupt("return",d);case 24:return e.next=26,S.json();case 26:k=e.sent,T=k.results||{},I=zB(h),e.prev=29,I.s();case 31:if((M=I.n()).done){e.next=44;break}if(A=M.value,C=T[A.stac_href]){e.next=36;break}return e.abrupt("continue",42);
31case 36:if(R=QB(C)){e.next=39;break}return e.abrupt("continue",42);case 39:L="".concat(A.stac_href,"-").concat(s.expression),KB.set(L,{stats:R,fetchedAt:Date.now()}),b.push({date:A.date,mean:R.mean,min:R.min,max:R.max,cloudCover:null!==(E=null!==(P=A.bbox_cloud_cover)&&void 0!==P?P:A.cloud_cover)&&void 0!==E?E:0});case 42:e.next=31;break;case 44:e.next=49;break;case 46:e.prev=46,e.t0=e.catch(29),I.e(e.t0);case 49:return e.prev=49,I.f(),e.finish(49);case 52:e.next=58;break;case 54:return e.prev=54,e.t1=e.catch(17),console.error("[statistics] Batch request failed:",e.t1),e.abrupt("return",d);case 58:return O=[].concat(d,b).sort((function(e,t){return new Date(e.date).getTime()-new Date(t.date).getTime()})),console.debug("[statistics] ".concat(O.length," ").concat(n," points (").concat(d.length," cached, ").concat(b.length," fetched)")),e.abrupt("return",O);case 61:case"end":return e.stop()}}),e,null,[[17,54],[29,46,49,52]])})))).apply(this,arguments)}function nj(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ij(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ij(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ij(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function oj(e,t,r){if(e.size>=50){var n=e.keys().next().value;void 0!==n&&e.delete(n)}e.set(t,r)}function aj(e){if(!e.geometry)return null;var t=0,r=0,n=0,i=function(e){"number"==typeof e[0]?(t+=e[0],r+=e[1],n++):e.forEach(i)};return i(e.geometry.coordinates),n>0?{lng:t/n,lat:r/n}:null}function sj(e,t){if(!e.length)return null;var r,n=null,i=Number.POSITIVE_INFINITY,o=nj(e);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=aj(a);if(s){var l=Math.pow(s.lng-t.lng,2)+Math.pow(s.lat-t.lat,2);l<i&&(i=l,n=a)}}}catch(e){o.e(e)}finally{o.f()}return n}function lj(e){var t=e.fieldId,r=e.date,n=e.metric,i=e.source,o=e.zoneUuid;return"".concat(t,"-").concat(r,"-").concat(n,"-").concat(i,"-").concat(null!=o?o:"")}function cj(e){var t=e.fieldId,r=e.date,n=e.metric,i=e.source;return"".concat(t,"-").concat(r,"-").concat(n,"-").concat(i,"-")}function uj(e){return uj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uj(e)}function dj(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */dj=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}
vendor: 4,251 bytes, line 31
31))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==uj(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(uj(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}
31},t}function hj(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function fj(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){hj(o,n,i,a,s,"next",e)}function s(e){hj(o,n,i,a,s,"throw",e)}a(void 0)}))}}function pj(){return pj=fj(dj().mark((function e(t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y;return dj().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.polygonFields,i=t.mapCenter,o=t.findClosestField,a=null,i&&(a=o(n,i)),a||(a=n[0]),null!==(r=a)&&void 0!==r&&r.geometry){e.next=6;break}throw new Error("No valid reference field geometry");case 6:return s=Number(a.id),new Date,(l=new Date).setDate(l.getDate()-60),c=l.toISOString().split("T")[0],e.next=13,bB(String(s),a.geometry);case 13:for(u=e.sent,d=new Set,h=new Date,f=new Date(c),p=new Date(f);p<=h;p.setMonth(p.getMonth()+1))g="".concat(p.getFullYear(),"-").concat(String(p.getMonth()+1).padStart(2,"0")),d.add(g);return m=null,u.length>0&&(y=u.find((function(e){var t,r;return 0===(null!==(t=null!==(r=e.bbox_cloud_cover)&&void 0!==r?r:e.cloud_cover)&&void 0!==t?t:100)})),m=y?y.date:u[0].date),e.abrupt("return",{images:u,refFieldId:s,startDateStr:c,searchMonths:d,autoSelectedDate:m});case 21:case"end":return e.stop()}}),e)}))),pj.apply(this,arguments)}function gj(e){return mj.apply(this,arguments)}function mj(){return mj=fj(dj().mark((function e(t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v;return dj().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_=function(){return(_=fj(dj().mark((function e(){var t,r,u,p,y,_;return dj().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((t=m++)>=n.length)){e.next=4;break}return e.abrupt("return");case 4:return r=n[t],u=Number(r.id),p=cj({fieldId:u,date:i,metric:o,source:a}),e.prev=7,e.next=10,kB(r.geometry,i,o);case 10:y=e.sent,oj(s,p,y),c(),g++,f++,l(f,h),console.debug("[rasterFetcher] Cached ".concat(d," for field ").concat(u,": ")+"".concat(y.width,"x").concat(y.height,"px (").concat(f,"/").concat(h,")")),e.next=25;break;case 19:e.prev=19,e.t0=e.catch(7),_=e.t0 instanceof Error?e.t0.message:String(e.t0),console.error("[rasterFetcher] Failed to fetch ".concat(d," for field ").concat(u," ")+"(date=".concat(i,", source=").concat(a,"): ").concat(_)),f++,l(f,h);case 25:e.next=0;break;case 27:case"end":return e.stop()}}),e,null,[[7,19]])})))).apply(this,arguments)},y=function(){return _.apply(this,arguments)},n=t.fieldsToFetch,i=t.selectedDate,o=t.metric,a=t.source,s=t.cache,l=t.onProgress,c=t.onCacheUpdate,u=1===n.length&&null!==(r=t.overrideScopeUuid)&&void 0!==r?r:null,d=o.toUpperCase(),h=n.length,f=0,"clearsky"!==a){e.next=13;break}return p=n.map(function(){var e=fj(dj().mark((function e(t){var r,n,p,g,m,y;return dj().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Number(t.id),p=null===(r=t.properties)||void 0===r?void 0:r.farm_field_id){e.next=7;break}return console.warn("[rasterFetcher] Field ".concat(n," has no farm_field_id, skipping ClearSky fetch")),f++,l(f,h),e.abrupt("return");case 7:return g=null!=u?u:p,m=lj({fieldId:n,date:i,metric:o,source:a,zoneUuid:null!=u?u:null}),e.prev=9,e.next=12,FP(g,i,o);
31case 12:y=e.sent,oj(s,m,y),c(),f++,l(f,h),console.debug("[rasterFetcher] ClearSky cached ".concat(d," for field ").concat(n," (scope=").concat(g,"): ")+"".concat(y.width,"x").concat(y.height,"px (").concat(f,"/").concat(h,")")),e.next=25;break;case 20:e.prev=20,e.t0=e.catch(9),console.error("[rasterFetcher] ClearSky fetch failed for field ".concat(n,":"),e.t0),f++,l(f,h);case 25:case"end":return e.stop()}}),e,null,[[9,20]])})));return function(t){return e.apply(this,arguments)}}()),e.next=11,Promise.all(p);case 11:return console.debug("[rasterFetcher] ClearSky batch complete for ".concat(h," fields")),e.abrupt("return",{successCount:f,totalCount:h});case 13:return g=0,m=0,v=Array.from({length:Math.min(4,n.length)},y),e.next=19,Promise.all(v);case 19:return console.info("[rasterFetcher] Standard batch complete: ".concat(g,"/").concat(h," fields loaded")),e.abrupt("return",{successCount:g,totalCount:h});case 21:case"end":return e.stop()}}),e)}))),mj.apply(this,arguments)}function yj(){return yj=fj(dj().mark((function e(t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x;return dj().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.field,n=t.selectedDate,i=t.metric,o=t.source,a=t.zoneUuid,s=t.cache,l=t.onCacheUpdate,c=Number(r.id),u=lj({fieldId:c,date:n,metric:i,source:o,zoneUuid:a}),!(d=s.get(u))){e.next=6;break}return e.abrupt("return",{cacheKey:u,data:d});case 6:if(h=i.toUpperCase(),"clearsky"!==o){e.next=31;break}if(g=null===(f=r.properties)||void 0===f?void 0:f.farm_field_id){e.next=12;break}return console.warn("[rasterFetcher] Field ".concat(c," has no farm_field_id, skipping ClearSky fetch")),e.abrupt("return",{cacheKey:u,data:null});case 12:if(null!==(p=r.properties)&&void 0!==p&&p.cloudless_activated){e.next=15;break}return console.info("[rasterFetcher] Field ".concat(c," is not cloudless_activated, skipping ClearSky fetch")),e.abrupt("return",{cacheKey:u,data:null});case 15:return m=null!=a?a:g,e.prev=16,e.next=19,FP(m,n,i);case 19:return y=e.sent,oj(s,u,y),l(),console.info("[rasterFetcher] ClearSky single-field cached ".concat(h," for field ").concat(c," ")+"(scope=".concat(m,"): ").concat(y.width,"x").concat(y.height,"px")),e.abrupt("return",{cacheKey:u,data:y});case 26:return e.prev=26,e.t0=e.catch(16),_=e.t0 instanceof Error?e.t0.message:String(e.t0),console.error("[rasterFetcher] ClearSky single-field fetch failed for field ".concat(c," ")+"(date=".concat(n,", scope=").concat(m,"): ").concat(_)),e.abrupt("return",{cacheKey:u,data:null});case 31:return v=AB(r,a),e.prev=32,e.next=35,kB(v,n,i);case 35:return b=e.sent,oj(s,u,b),l(),console.info("[rasterFetcher] Standard single-field cached ".concat(h," for field ").concat(c,": ")+"".concat(b.width,"x").concat(b.height,"px")),e.abrupt("return",{cacheKey:u,data:b});case 42:return e.prev=42,e.t1=e.catch(32),x=e.t1 instanceof Error?e.t1.message:String(e.t1),console.error("[rasterFetcher] Standard single-field fetch failed for field ".concat(c," ")+"(date=".concat(n,"): ").concat(x)),e.abrupt("return",{cacheKey:u,data:null});case 47:case"end":return e.stop()}}),e,null,[[16,26],[32,42]])}))),yj.apply(this,arguments)}var _j=$u("<button> </button>"),vj=$u('<div class="absolute top-full left-1/2 -translate-x-1/2 mt-1 w-28 bg-white border border-gray-200 rounded-lg shadow-lg z-50 max-h-48 overflow-y-auto"></div>'),bj=$u("<button> </button>"),xj=$u('<div class="absolute top-full left-1/2 -translate-x-1/2 mt-1 w-20 bg-white border border-gray-200 rounded-lg shadow-lg z-50 max-h-48 overflow-y-auto"></div>'),wj=$u('<div class="absolute inset-0 bg-white/70 z-20 flex items-center justify-center gap-2 rounded"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"></div> <span class="text-xs text-gray-500">Loading...</span></div>'),Sj=$u('<div class="text-center text-[10px] font-medium text-gray-500 py-1"> </div>'),kj=$u('<div class="h-8"></div>'),Tj=$u('<img src="/static/images/cloud.png" alt="Cloudy" class="absolute -top-1 inset-x-0 w-full h-full object-contain opacity-35 pointer-events-none scale-125"/>'),Ij=$u('<button><!> <span class="leading-none relative z-10"> </span></button>'),Mj=$u('<div class="flex justify-end mt-1"><div class="group relative"><button class="p-1 text-gray-400 hover:text-blue-500 transition-colors" aria-label="Field info"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></button> <div class="absolute bottom-full right-0 mb-1 hidden group-hover:block bg-gray-800 text-white text-xs rounded px-2 py-1 
31whitespace-nowrap shadow-lg z-30"> </div></div></div>'),Ej=$u('<div class="bg-white rounded-xl shadow-xl border border-gray-200 p-4 w-80"><div class="flex items-center justify-between mb-3"><button class="p-1.5 hover:bg-gray-100 rounded transition-colors" title="Previous month" aria-label="Previous month"><!></button> <div class="flex items-center gap-1"><div class="relative"><button class="px-2 py-1 text-sm font-semibold text-gray-900 hover:bg-gray-100 rounded transition-colors flex items-center"> <!></button> <!></div> <div class="relative"><button class="px-2 py-1 text-sm font-semibold text-gray-900 hover:bg-gray-100 rounded transition-colors flex items-center"> <!></button> <!></div></div> <button class="p-1.5 hover:bg-gray-100 rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed" title="Next month" aria-label="Next month"><!></button></div> <div class="relative"><!> <div class="grid grid-cols-7 gap-1 mb-1"></div> <div class="grid grid-cols-7 gap-1"></div></div> <!></div>');function Pj(e,t){Zs(t,!0);let r=fh(t,"images",19,(()=>[])),n=fh(t,"dates",19,(()=>[])),i=fh(t,"loading",3,!1);const o=function(){const e=t.selectedDate||Bw.crossLayerReferenceDate;if(e){const[t,r]=e.split("-").map(Number);return{year:t,month:r-1}}const r=new Date;return{year:r.getFullYear(),month:r.getMonth()}}();let a=$l(Jl(o.year)),s=$l(Jl(o.month));Tc((()=>
31{if(t.selectedDate){const[e,r]=t.selectedDate.split("-").map(Number);ql(a,e,!0),ql(s,r-1)}}));const l=Dl((()=>{const e=new Map;for(const t of r())e.set(t.date,t);for(const t of n())e.has(t)||e.set(t,null);return e})),c=(new Date).toISOString().split("T")[0],u=Dl((()=>new Date(yu(a),yu(s),1))),d=Dl((()=>new Date(yu(a),yu(s)+1,0))),h=Dl((()=>yu(u).getDay())),f=Dl((()=>{const e=[];for(let t=0;t<yu(h);t++)e.push(null);for(let t=1;t<=yu(d).getDate();t++)e.push(new Date(yu(a),yu(s),t));for(;e.length%7!=0;)e.push(null);return e}));function p(e){const t=g(e);return yu(l).has(t)}const g=Ew;function m(e){return e.bbox_cloud_cover??e.cloud_cover??0}let y=null,_=$l(!1);function v(e,r){t.onMonthChange&&(function(e,t){const r=`${e}-${String(t+1).padStart(2,"0")}`;for(const e of yu(l).keys())if(e.startsWith(r))return!0;return!1}(e,r)||ql(_,!0),y&&clearTimeout(y),y=setTimeout((()=>{ql(_,!1),t.onMonthChange(e,r)}),1e3))}const b=Dl((()=>yu(_)||i()));const x=Dl((()=>()=>!1));const w=new Date(2018,2,1),S=["January","February","March","April","May","June","July","August","September","October","November","December"],k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],T=["Su","Mo","Tu","We","Th","Fr","Sa"];let I=$l(!1),M=$l(!1);const E=Dl((()=>{const e=[];for(let t=(new Date).getFullYear();t>=w.getFullYear();t--)e.push(t);return e}));function P(e){return!(yu(a)===w.getFullYear()&&e<w.getMonth())}var A=Ej(),C=uc(A),R=uc(C);R.__click=function(){0===yu(s)?(Yl(a,-1),ql(s,11)):Yl(s,-1),v(yu(a),yu(s))},nB(uc(R),{class:"w-4 h-4 text-gray-600"}),Os(R);var L=hc(R,2),O=uc(L),D=uc(O);D.__click=e=>{e.stopPropagation(),ql(I,!yu(I)),ql(M,!1)};var z=uc(D);Mk(hc(z),{class:"w-3 h-3 ml-0.5 text-gray-500"}),Os(D);var F=hc(D,2),N=e=>{var t=vj();Il(t,21,(()=>k),Tl,((e,t,r)=>{var n=_j();n.__click=e=>{e.stopPropagation(),function(e){yu(a)===w.getFullYear()&&e<w.getMonth()||(ql(s,e,!0),ql(I,!1),v(yu(a),yu(s)))}(r)};var i=uc(n,!0);Os(n),Pc(((e,o)=>{wd(n,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-blue-50 transition-colors\n                  ${r===yu(s)?"bg-blue-100 text-blue-700":"text-gray-700"}\n                  ${e??""}`),n.disabled=o,Ju(i,yu(t))}),[()=>P(r)?"":"opacity-40 cursor-not-allowed",()=>!P(r)]),Yu(e,n)})),Os(t),Yu(e,t)};ad(F,(e=>{yu(I)&&e(N)})),Os(O);var B=hc(O,2),j=uc(B);j.__click=e=>{e.stopPropagation(),ql(M,!yu(M)),ql(I,!1)};var V=uc(j);Mk(hc(V),{class:"w-3 h-3 ml-0.5 text-gray-500"}),Os(j);var G=hc(j,2),U=e=>{var t=xj();Il(t,21,(()=>yu(E)),Tl,((e,t)=>
31{var r=bj();r.__click=e=>{e.stopPropagation(),function(e){ql(a,e,!0),ql(M,!1),e===w.getFullYear()&&yu(s)<w.getMonth()&&ql(s,w.getMonth(),!0),v(yu(a),yu(s))}(yu(t))};var n=uc(r,!0);Os(r),Pc((()=>{wd(r,1,"w-full px-3 py-1.5 text-left text-sm hover:bg-blue-50 transition-colors\n                  "+(yu(t)===yu(a)?"bg-blue-100 text-blue-700":"text-gray-700")),Ju(n,yu(t))})),Yu(e,r)})),Os(t),Yu(e,t)};ad(G,(e=>{yu(M)&&e(U)})),Os(B),Os(L);var $=hc(L,2);$.__click=function(){11===yu(s)?(Yl(a),ql(s,0)):Yl(s),v(yu(a),yu(s))},sB(uc($),{class:"w-4 h-4 text-gray-600"}),Os($),Os(C);var H=hc(C,2),q=uc(H),W=e=>{Yu(e,wj())};ad(q,(e=>{yu(b)&&e(W)}));var Z=hc(q,2);Il(Z,21,(()=>T),Tl,((e,t)=>{var r=Sj(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(t)))),Yu(e,r)})),Os(Z);var Y=hc(Z,2);Il(Y,21,(()=>yu(f)),Tl,((e,r)=>{var n=Zu(),i=dc(n),o=e=>{Yu(e,kj())},a=e=>{const n=Dl((()=>function(e){const t=g(e);return yu(l).get(t)}(yu(r)))),i=Dl((()=>g(yu(r)))),o=Dl((()=>yu(i)===t.selectedDate)),a=Dl((()=>yu(i)>c)),s=Dl((()=>p(yu(r)))),u=Dl((()=>yu(s)&&function(e){return!!e&&m(e)>10}(yu(n))));var d=Ij();d.__click=()=>{return yu(r)&&void(p(e=yu(r))&&t.onSelect(g(e)));var e};var h=uc(d),f=e=>{Yu(e,Tj())};ad(h,(e=>{yu(u)&&e(f)}));var y=hc(h,2),_=uc(y,!0);Os(y),Os(d),Pc(((e,t)=>{wd(d,1,"h-9 w-full relative flex items-center justify-center rounded text-xs font-medium transition-all overflow-visible\n            "+(yu(o)?"bg-blue-600 text-white ring-2 ring-blue-300":yu(s)&&!yu(u)?"bg-white text-gray-900 border border-gray-400 hover:bg-gray-100 cursor-pointer":yu(s)&&yu(u)?"bg-transparent text-gray-600 hover:bg-gray-100 cursor-pointer":yu(a)?"text-gray-300 cursor-not-allowed":"text-gray-400 cursor-not-allowed")),d.disabled=!yu(s)||yu(a),Fd(d,"title",e),Ju(_,t)}),[()=>yu(u)?`${Math.round(m(yu(n)))}% cloud cover`:yu(a)?"Future date":yu(s)?"":"No data available",()=>yu(r).getDate()]),Yu(e,d)};ad(i,(e=>{null===yu(r)?e(o):e(a,!1)})),Yu(e,n)})),Os(Y),Os(H);var X=hc(H,2),K=e=>{var r=Mj(),n=uc(r),i=hc(uc(n),2),o=uc(i);Os(i),Os(n),Os(r),Pc((()=>Ju(o,`Dates based on: ${t.fieldName??""}`))),Yu(e,r)};ad(X,(e=>{t.fieldName&&e(K)})),Os(A),Pc((e=>{Ju(z,`${S[yu(s)]??""} `),Ju(V,`${yu(a)??""} `),$.disabled=e}),[()=>yu(x)()]),Yu(e,A),Ys()}Bu(["click"]);var Aj=$u('<div class="inline-flex items-center bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden" style="height: 36px;"><button style="height: 36px;" title="Map View"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"></path></svg></button> <button style="height: 36px;" title="Grid View"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"></path></svg></button></div>'),Cj=$u('<span class="font-semibold"> </span>'),Rj=$u('<button class="px-2 hover:bg-red-50 transition-colors border-l border-gray-200 flex items-center justify-center" style="height: 36px;" title="Clear data layer"><svg class="w-3.5 h-3.5 text-gray-400 hover:text-red-500" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button>'),Lj=$u('<div class="mb-3"><select class="w-full px-2.5 py-1.5 text-xs font-medium border border-gray-200 rounded-md bg-white text-gray-700 cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500"><option>Standard</option><option>Cloudless</option></select></div>'),Oj=$u('<!> <span class="text-sm"> </span>',1),Dj=$u('<div class="px-0 mt-2"><div class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-1 px-2.5"> </div> <!></div>
31'),zj=$u('<!> <span class="text-sm">Irrigation Equipment</span>',1),Fj=$u('<!> <span class="text-sm">Raindancer VRI Map</span>',1),Nj=$u('<div class="animate-spin rounded-full h-3.5 w-3.5 border-b-2 border-teal-600"></div>'),Bj=$u('<div class="flex items-center gap-2.5 hover:bg-gray-50 p-2.5 rounded-lg"><!> <!></div>'),jj=$u('<div class="fixed z-[10000] w-52 p-2.5 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none"><div class="font-semibold mb-0.5"> </div> <div class="text-gray-300 mb-0.5"> </div> <div class="text-gray-300"> </div></div>'),Vj=$u('<div class="fixed w-80 p-4 space-y-4 bg-white rounded-xl shadow-xl border border-gray-200 z-[9999] overflow-y-auto"><div class="mb-3 pb-4 border-b border-gray-200"><div class="text-sm font-semibold text-gray-900 mb-3">Satellite Data</div> <!> <!></div> <div><div class="text-sm font-semibold text-gray-900 mb-2">Other Layers</div> <!> <!></div></div> <!>',1),Gj=$u('<span class="text-sm text-gray-400">Loading...</span>'),Uj=$u('<span class="text-sm text-amber-600"> </span>'),$j=$u('<span class="text-sm text-gray-400">No dates</span>'),Hj=$u('<span class="text-sm font-semibold text-gray-700"> </span> <!>',1),qj=$u('<span class="text-sm text-gray-400">Loading...</span>'),Wj=$u('<span class="text-sm text-gray-400">No dates</span>'),Zj=$u('<span class="text-sm font-semibold text-gray-700"> </span> <!>',1),Yj=$u('<button class="px-2.5 hover:bg-blue-50 transition-colors border-l border-gray-200 flex items-center justify-center text-xs font-medium text-blue-600 hover:text-blue-700" style="height: 36px;" title="Jump to latest image">Latest</button>'),Xj=$u('<div class="fixed z-[9999]"><!></div>'),Kj=$u('<div class="relative date-picker-container"><div class="inline-flex items-center bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden" style="height: 36px;"><button class="px-2 hover:bg-gray-100 transition-colors border-r border-gray-200 disabled:opacity-30 disabled:cursor-not-allowed flex items-center justify-center" style="height: 36px;"><!></button> <button class="px-3 hover:bg-gray-50 transition-colors flex items-center gap-1.5 justify-center" style="height: 36px;"><!></button> <button class="px-2 hover:bg-gray-100 transition-colors border-l border-gray-200 disabled:opacity-30 disabled:cursor-not-allowed flex items-center justify-center" style="height: 36px;"><!></button> <!></div> <!></div>'),Jj=$u('<span class="text-sm text-amber-600">Pro required</span>'),Qj=$u('<span class="flex items-center gap-1.5 text-sm text-gray-400"><div class="animate-spin rounded-full h-3 w-3 border-b-2 border-gray-400"></div> Loading...</span>'),eV=$u('<span class="text-sm text-gray-400">No data yet</span>'),tV=$u('<span class="text-sm font-semibold text-gray-700"> </span> <!>',1),rV=$u('<button class="px-2.5 hover:bg-blue-50 transition-colors border-l border-gray-200 flex items-center justify-center text-xs font-medium text-blue-600 hover:text-blue-700" style="height: 36px;" title="Jump to latest data">Latest</button>'),nV=$u('<div class="fixed z-[9999]"><!></div>'),iV=$u('<div class="relative et-date-picker-container"><div class="inline-flex items-center bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden" style="height: 36px;"><button class="px-2 hover:bg-gray-100 transition-colors border-r border-gray-200 disabled:opacity-30 disabled:cursor-not-allowed flex items-center justify-center" style="height: 36px;"><!></button> <button class="px-3 hover:bg-gray-50 transition-colors flex items-center gap-1.5 justify-center" style="height: 36px;"><!></button> <button class="px-2 hover:bg-gray-100 transition-colors border-l border-gray-200 disabled:opacity-30 disabled:cursor-not-allowed flex items-center justify-center" style="height: 36px;"><!></button> <!></div> <!></div>'),oV=$u('<div><!> <div class="relative layer-controls-container flex flex-col items-start gap-2"><div class="inline-flex items-center bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden" style="height: 36px;"><button class="inline-flex items-center gap-1.5 px-3 text-gray-700 hover:bg-gray-50 transition-all text-sm font-medium" style="height: 36px;"><!> <!> <!></button> <!></div> <!></div> <!> <!></div>');function aV(e,t){Zs(t,!0);let r=fh(t,"inline",3,!1),n=fh(t,"activeView",3,null),i=(fh(t,"isAdmin",3,!1),$l(!1)),o=$l(!1),a=$l(null),s=$l(Jl({top:0,left:0}));function l(){ql(a,null)}const c=Dl((()=>
31{if(!t.farmFieldsGeojson)return null;const e=t.farmFieldsGeojson.features?.find((e=>!0===e?.properties?.cloudless_activated&&e?.properties?.farm_field_id));return e?.properties?.farm_field_id||null})),u=Dl((()=>{if(!t.farmFieldsGeojson)return null;if(Bw.selectedFieldId){const e=t.farmFieldsGeojson.features?.find((e=>Number(e.id)===Bw.selectedFieldId));if(e?.properties?.cloudless_activated&&e.properties.farm_field_id)return e.properties.farm_field_id}return yu(c)})),d=Dl((()=>!!yu(c)));let h=null;Tc((()=>{const e=Bw.selectedFieldId;if(e===h)return;if(h=e,!e)return;const r=t.farmFieldsGeojson?.features?.find((t=>Number(t.id)===e));!!r?.properties?.cloudless_activated?_("clearsky"):"clearsky"===Bw.imagerySource&&_("standard")}));const f=Dl((()=>{if(!r()||!t.farmFieldsGeojson||!Bw.selectedFieldId)return!1;const e=t.farmFieldsGeojson.features?.find((e=>Number(e.id)===Bw.selectedFieldId));return!!e?.properties?.raindancer_field_guid})),p=Dl((()=>{if(!t.farmFieldsGeojson||!Bw.selectedFieldId)return!1;const e=t.farmFieldsGeojson.features?.find((e=>Number(e.id)===Bw.selectedFieldId));return!0===e?.properties?.pro_activated})),g=Dl((()=>Bw.showETLayer?"ET":Bw.showVegetationIndexLayer?Bw.vegetationIndexType.toUpperCase():null));let m=$l(!1),y=$l(null);async function _(e){const t=Bw.selectedVegetationDate;t&&(Bw.crossLayerReferenceDate=t),Bw.imagerySource=e,Bw.selectedVegetationDate=null,ql(y,null);const r=Aw.find((e=>e.value===Bw.vegetationIndexType));if(r?.sources&&!r.sources.includes(e)&&(Bw.vegetationIndexType="ndvi"),"clearsky"===e&&yu(u))if(ql(m,!0),ql(i,!1),Bw.showVegetationIndexLayer||(Bw.vegetationIndexType="ndvi",Bw.showVegetationIndexLayer=!0,Bw.showETLayer=!1),Bw.clearSkyDates=await PP(yu(u)),ql(m,!1),Bw.clearSkyDates.length>0){const e=Bw.crossLayerReferenceDate;if(e){const t=Bw.clearSkyDates.find((t=>t<=e))??Bw.clearSkyDates[0];Bw.selectedVegetationDate=t}else Bw.selectedVegetationDate=Bw.clearSkyDates[0]}else ql(y,"No cloudless images available for this field");else Bw.clearSkyDates=[]}function v(e){Bw.selectedVegetationDate=e}function b(e){const t=e.target;t.closest(".layer-controls-container")||ql(i,!1),t.closest(".date-picker-container")||ql(o,!1),t.closest(".et-date-picker-container")||ql(R,!1)}function x(e){if(!e)return"Select date";const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}function w(e){return e?.bbox_cloud_cover??e?.cloud_cover??0}function S(){const e=Bw.selectedVegetationDate;if(!e)return null;if("clearsky"===Bw.imagerySource){const t=Bw.clearSkyDates.indexOf(e);if(t>=0&&t<Bw.clearSkyDates.length-1)return Bw.clearSkyDates[t+1]}else{const t=[...Bw.vegetationImages].filter((e=>w(e)<=10)).map((e=>e.date)).sort(((e,t)=>t.localeCompare(e))),r=t.indexOf(e);if(r>=0&&r<t.length-1)return t[r+1]}return null}function k(){const e=Bw.selectedVegetationDate;if(!e)return null;if("clearsky"===Bw.imagerySource){const t=Bw.clearSkyDates.indexOf(e);if(t>0)return Bw.clearSkyDates[t-1]}else{const t=[...Bw.vegetationImages].filter((e=>w(e)<=10)).map((e=>e.date)).sort(((e,t)=>t.localeCompare(e))),r=t.indexOf(e);if(r>0)return t[r-1]}return null}function T(){const e=S();e&&v(e)}function I(){const e=k();e&&v(e)}Tc((()=>{const e=yu(u);"clearsky"===Bw.imagerySource&&0===Bw.clearSkyDates.length&&e&&(async()=>{const t=await PP(e);Bw.clearSkyDates=t,t.length>0&&!Bw.selectedVegetationDate&&(Bw.selectedVegetationDate=t[0])})()})),yh((()=>{document.addEventListener("mousedown",b)})),_h((()=>{document.removeEventListener("mousedown",b)})),Tc((()=>{var e;e=Bw.showRaindancerVRI,Nw(zw,e)}));const M=Dl((()=>null!==S())),E=Dl((()=>null!==k()));let P=$l(null),A=$l(null),C=$l(Jl({top:0,left:0,maxHeight:0}));let R=$l(!1),L=$l(null);function O(e){Bw.selectedETDate=e}function D(e,r){t.onETMonthChange&&t.onETMonthChange(e,r)}function z(){const e=Bw.selectedETDate;if(!e)return null;const t=[...Bw.etAvailableDates].sort(((e,t)=>t.localeCompare(e))),r=t.indexOf(e);return r>=0&&r<t.length-1?t[r+1]:null}function F(){const e=Bw.selectedETDate;if(!e)return null;const t=[...Bw.etAvailableDates].sort(((e,t)=>t.localeCompare(e))),r=t.indexOf(e);return r>0?t[r-1]:null}const N=Dl((()=>null!==z())),B=Dl((()=>null!==F()));function j(){const e=z();e&&O(e)}function V(){const e=F();e&&O(e)}const G=Dl((()=>Bw.etAvailableDates.length>0?[...Bw.etAvailableDates].sort(((e,t)=>t.localeCompare(e)))[0]:null)),U=Dl((()=>!!Bw.selectedETDate&&Bw.selectedETDate!==yu(G))),$=Dl((()=>
31{if("clearsky"===Bw.imagerySource)return Bw.clearSkyDates.length>0?Bw.clearSkyDates[0]:null;const e=[...Bw.vegetationImages].map((e=>e.date)).sort(((e,t)=>t.localeCompare(e)));return e.length>0?e[0]:null})),H=Dl((()=>!!Bw.selectedVegetationDate&&Bw.selectedVegetationDate!==yu($)));function q(){const e=[...Bw.etAvailableDates].sort(((e,t)=>t.localeCompare(e)));e.length>0&&O(e[0])}function W(){if("clearsky"===Bw.imagerySource)Bw.clearSkyDates.length>0&&v(Bw.clearSkyDates[0]);else{const e=[...Bw.vegetationImages].map((e=>e.date)).sort(((e,t)=>t.localeCompare(e)));e.length>0&&v(e[0])}}var Z=oV(),Y=uc(Z),X=e=>{var r=Aj(),i=uc(r);i.__click=()=>t.onViewChange?.("map");var o=hc(i,2);o.__click=()=>t.onViewChange?.("grid"),Os(r),Pc((()=>{wd(i,1,"px-3 text-sm font-medium transition-colors flex items-center justify-center "+("map"===n()?"bg-blue-50 text-blue-700":"text-gray-500 hover:bg-gray-50")),wd(o,1,"px-3 text-sm font-medium transition-colors flex items-center justify-center "+("grid"===n()?"bg-blue-50 text-blue-700":"text-gray-500 hover:bg-gray-50"))})),Yu(e,r)};ad(Y,(e=>{!r()&&n()&&e(X)}));var K=hc(Y,2),J=uc(K),Q=uc(J);Q.__click=function(){if(!yu(i)&&yu(P)){const e=yu(P).getBoundingClientRect(),t=4,r=e.bottom+t,n=window.innerHeight-r-16;ql(C,{top:r,left:e.left,maxHeight:n},!0)}ql(i,!yu(i))};var ee=uc(Q);!function(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"ariaLabel",3,"layers solid"),s=lh(t,["$$slots","$$events","$$legacy","size","color","title","desc","class","ariaLabel"]),l=`${t.title?.id||""} ${t.desc?.id||""}`;const c=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var u=QN();Nd(u,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:o(),...s,class:e,"aria-label":a(),"aria-describedby":yu(c)?l:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var d=uc(u),h=e=>{var r=KN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(d,(e=>{t.title?.id&&t.title.title&&e(h)}));var f=hc(d),p=e=>{var r=JN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(f,(e=>{t.desc?.id&&t.desc.desc&&e(p)})),Ds(2),Os(u),Yu(e,u),Ys()}(ee,{class:"w-4 h-4"});var te=hc(ee,2),re=e=>{var t=Cj(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(g)))),Yu(e,t)},ne=e=>{Yu(e,Wu("Select Layer"))};ad(te,(e=>{yu(g)?e(re):e(ne,!1)})),Mk(hc(te,2),{class:"w-3.5 h-3.5 ml-1"}),Os(Q),nh(Q,(e=>ql(P,e)),(()=>yu(P)));var ie=hc(Q,2),oe=e=>{var t=Rj();t.__click=e=>{e.stopPropagation(),Bw.showVegetationIndexLayer=!1,Bw.showETLayer=!1,Bw.crossLayerReferenceDate=null,Bw.layerToggleVersion++,ql(i,!1),ql(o,!1),ql(R,!1)},Yu(e,t)};ad(ie,(e=>{yu(g)&&e(oe)})),Os(J);var ae=hc(J,2),se=e=>{var t=Vj(),r=dc(t),n=uc(r),o=hc(uc(n),2),c=e=>{var t=Lj(),r=uc(t);r.__change=e=>_(e.target.value);var n=uc(r);n.value=n.__value="standard";var i,o=hc(n);o.value=o.__value="clearsky",Os(r),Id(r),Os(t),Pc((()=>{i!==(i=Bw.imagerySource)&&(r.value=(r.__value=Bw.imagerySource)??"",Td(r,Bw.imagerySource))})),Yu(e,t)};ad(o,(e=>{yu(d)&&e(c)})),Il(hc(o,2),17,(()=>Cw),Tl,((e,t)=>
31{const r=Dl((()=>Aw.filter((e=>e.category===yu(t).key&&(!e.sources||e.sources.includes(Bw.imagerySource))))));var n=Zu(),o=dc(n),c=e=>{var n=Dj(),o=uc(n),c=uc(o,!0);Os(o),Il(hc(o,2),17,(()=>yu(r)),Tl,((e,t)=>{Ob(e,{class:"flex items-center gap-2.5 cursor-pointer hover:bg-gray-50 p-2.5 rounded-lg",onmouseenter:e=>function(e,t){const r=e.currentTarget.getBoundingClientRect();ql(s,{top:r.top,left:r.right+8},!0),ql(a,t,!0)}(e,yu(t)),onmouseleave:l,children:(e,r)=>{var n=Oj(),o=dc(n);{let e=Dl((()=>Bw.showVegetationIndexLayer&&Bw.vegetationIndexType===yu(t).value));Fb(o,{get checked(){return yu(e)},onchange:()=>{return e=yu(t).value,Bw.showVegetationIndexLayer&&Bw.vegetationIndexType===e?(Bw.selectedVegetationDate&&(Bw.crossLayerReferenceDate=Bw.selectedVegetationDate),Bw.showVegetationIndexLayer=!1):(Bw.showETLayer&&Bw.selectedETDate&&(Bw.crossLayerReferenceDate=Bw.selectedETDate,Bw.selectedVegetationDate=null),Bw.vegetationIndexType=e,Bw.showVegetationIndexLayer=!0,Bw.showETLayer=!1),Bw.layerToggleVersion++,void ql(i,!1);var e}})}var a=hc(o,2),s=uc(a,!0);Os(a),Pc((()=>Ju(s,yu(t).label))),Yu(e,n)},$$slots:{default:!0}})})),Os(n),Pc((()=>Ju(c,yu(t).label))),Yu(e,n)};ad(o,(e=>{yu(r).length>0&&e(c)})),Yu(e,n)})),Os(n);var u=hc(n,2),h=hc(uc(u),2);Ob(h,{class:"flex items-center gap-2.5 cursor-pointer hover:bg-gray-50 p-2.5 rounded-lg",children:(e,t)=>{var r=zj();Fb(dc(r),{get checked(){return Bw.showIrrigationEquipment},set checked(e){Bw.showIrrigationEquipment=e}}),Ds(2),Yu(e,r)},$$slots:{default:!0}});var p=hc(h,2),g=e=>{var t=Bj(),r=uc(t);Ob(r,{class:"flex items-center gap-2.5 cursor-pointer flex-1",children:(e,t)=>{var r=Fj();Fb(dc(r),{get checked(){return Bw.showRaindancerVRI},set checked(e){Bw.showRaindancerVRI=e}}),Ds(2),Yu(e,r)},$$slots:{default:!0}});var n=hc(r,2),i=e=>{Yu(e,Nj())};ad(n,(e=>{Bw.raindancerVRILoading&&e(i)})),Os(t),Yu(e,t)};ad(p,(e=>{yu(f)&&e(g)})),Os(u),Os(r);var m=hc(r,2),y=e=>{var t=jj(),r=uc(t),n=uc(r,!0);Os(r);var i=hc(r,2),o=uc(i,!0);Os(i);var l=hc(i,2),c=uc(l,!0);Os(l),Os(t),Pc((()=>{kd(t,`top: ${yu(s).top??""}px; left: ${yu(s).left??""}px;`),Ju(n,yu(a).label),Ju(o,yu(a).fullName),Ju(c,yu(a).description)})),Yu(e,t)};ad(m,(e=>{yu(a)&&e(y)})),Pc((()=>kd(r,`top: ${yu(C).top??""}px; left: ${yu(C).left??""}px; max-height: ${yu(C).maxHeight??""}px;`))),Yu(e,t)};ad(ae,(e=>{yu(i)&&e(se)})),Os(K);var le=hc(K,2),ce=e=>{var r=Kj(),n=uc(r),i=uc(n);i.__click=T,nB(uc(i),{class:"w-3.5 h-3.5 text-gray-600"}),Os(i);var a=hc(i,2);a.__click=()=>ql(o,!yu(o));var s=uc(a),l=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Gj())},i=e=>{var t=Zu(),r=dc(t),n=e=>{var t=Uj(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(y)))),Yu(e,t)},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,$j())},i=e=>{var t=Hj(),r=dc(t),n=uc(r,!0);Os(r),Mk(hc(r,2),{class:"w-3 h-3 text-gray-400"}),Pc((e=>Ju(n,e)),[()=>x(Bw.selectedVegetationDate)]),Yu(e,t)};ad(r,(e=>{0===Bw.clearSkyDates.length?e(n):e(i,!1)}),!0),Yu(e,t)};ad(r,(e=>{yu(y)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(r,(e=>{yu(m)?e(n):e(i,!1)})),Yu(e,t)},c=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,qj())},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Wj())},i=e=>{var t=Zj(),r=dc(t),n=uc(r,!0);Os(r),Mk(hc(r,2),{class:"w-3 h-3 text-gray-400"}),Pc((e=>Ju(n,e)),[()=>x(Bw.selectedVegetationDate)]),Yu(e,t)};ad(r,(e=>{0===Bw.vegetationImages.length?e(n):e(i,!1)}),!0),Yu(e,t)};ad(r,(e=>{Bw.vegetationSearchLoading?e(n):e(i,!1)})),Yu(e,t)};ad(s,(e=>{"clearsky"===Bw.imagerySource?e(l):e(c,!1)})),Os(a);var u=hc(a,2);u.__click=I,sB(uc(u),{class:"w-3.5 h-3.5 text-gray-600"}),Os(u);var d=hc(u,2),h=e=>{var t=Yj();t.__click=W,Yu(e,t)};ad(d,(e=>{yu(H)&&e(h)})),Os(n);var f=hc(n,2),p=e=>{const r=Dl((()=>yu(A)?.getBoundingClientRect()));var n=Xj();n.__mousedown=e=>e.stopPropagation();var i=uc(n),o=e=>{var t=Zu(),r=dc(t),n=e=>{{let t=Dl((()=>Bw.selectedFieldName||Bw.satelliteReferenceFieldName||void 0));Pj(e,{get dates(){return Bw.clearSkyDates},get selectedDate(){return Bw.selectedVegetationDate},loading:!1,onSelect:v,get fieldName(){return yu(t)}})}};ad(r,(e=>{Bw.clearSkyDates.length>0&&e(n)})),Yu(e,t)},a=e=>{var r=Zu(),n=dc(r),i=e=>{{let r=Dl((()=>Bw.selectedFieldName||Bw.satelliteReferenceFieldName||void 0));
31Pj(e,{get images(){return Bw.vegetationImages},get selectedDate(){return Bw.selectedVegetationDate},get loading(){return Bw.vegetationSearchLoading},get loadedFromDate(){return Bw.vegetationLoadedFromDate},onSelect:v,get onMonthChange(){return t.onMonthChange},get fieldName(){return yu(r)}})}};ad(n,(e=>{Bw.vegetationImages.length>0&&e(i)})),Yu(e,r)};ad(i,(e=>{"clearsky"===Bw.imagerySource?e(o):e(a,!1)})),Os(n),Pc((()=>kd(n,`top: ${(yu(r)?.bottom??0)+4}px; left: ${yu(r)?.left??0??""}px;`))),Yu(e,n)};ad(f,(e=>{yu(o)&&e(p)})),Os(r),nh(r,(e=>ql(A,e)),(()=>yu(A))),Pc((()=>{i.disabled=!yu(M),Fd(i,"title",yu(M)?"Previous clear day":"No earlier clear days"),u.disabled=!yu(E),Fd(u,"title",yu(E)?"Next clear day":"No later clear days")})),Yu(e,r)};ad(le,(e=>{Bw.showVegetationIndexLayer&&e(ce)}));var ue=hc(le,2),de=e=>{var t=iV(),r=uc(t),n=uc(r);n.__click=j,nB(uc(n),{class:"w-3.5 h-3.5 text-gray-600"}),Os(n);var i=hc(n,2);i.__click=()=>{yu(p)&&Bw.etAvailableDates.length>0&&ql(R,!yu(R))};var o=uc(i),a=e=>{Yu(e,Jj())},s=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,Qj())},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,eV())},i=e=>{var t=tV(),r=dc(t),n=uc(r,!0);Os(r),Mk(hc(r,2),{class:"w-3 h-3 text-gray-400"}),Pc((e=>Ju(n,e)),[()=>x(Bw.selectedETDate)]),Yu(e,t)};ad(r,(e=>{0===Bw.etAvailableDates.length?e(n):e(i,!1)}),!0),Yu(e,t)};ad(r,(e=>{Bw.etDatesLoading&&0===Bw.etAvailableDates.length?e(n):e(i,!1)}),!0),Yu(e,t)};ad(o,(e=>{!yu(p)&&Bw.selectedFieldId?e(a):e(s,!1)})),Os(i);var l=hc(i,2);l.__click=V,sB(uc(l),{class:"w-3.5 h-3.5 text-gray-600"}),Os(l);var c=hc(l,2),u=e=>{var t=rV();t.__click=q,Yu(e,t)};ad(c,(e=>{yu(U)&&e(u)})),Os(r);var d=hc(r,2),h=e=>{const t=Dl((()=>yu(L)?.getBoundingClientRect()));var r=nV();r.__mousedown=e=>e.stopPropagation();var n=uc(r);{let e=Dl((()=>Bw.selectedFieldName||Bw.satelliteReferenceFieldName||void 0));Pj(n,{get dates(){return Bw.etAvailableDates},get selectedDate(){return Bw.selectedETDate},get loading(){return Bw.etDatesLoading},onSelect:O,onMonthChange:D,get fieldName(){return yu(e)}})}Os(r),Pc((()=>kd(r,`top: ${(yu(t)?.bottom??0)+4}px; left: ${yu(t)?.left??0??""}px;`))),Yu(e,r)};ad(d,(e=>{yu(R)&&e(h)})),Os(t),nh(t,(e=>ql(L,e)),(()=>yu(L))),Pc((()=>{n.disabled=!yu(N),Fd(n,"title",yu(N)?"Previous day":"No earlier days"),Fd(i,"title",yu(p)?Bw.etDatesLoading?"Fetching available ET dates...":0===Bw.etAvailableDates.length?"No ET data available for this field yet. Data is typically processed within a few minutes of activation.":"Select a date to view ET data":"Upgrade this field to Pro to enable ET data"),l.disabled=!yu(B),Fd(l,"title",yu(B)?"Next day":"No later days")})),Yu(e,t)};ad(ue,(e=>{Bw.showETLayer&&Bw.selectedFieldId&&e(de)})),Os(Z),Pc((()=>{wd(Z,1,`${r()?"flex items-center gap-2":"absolute z-[1100] flex items-center gap-2"} ${Bw.upgradeModalOpen?"pointer-events-none opacity-50":""}`),kd(Z,r()?"":"top: 13px; left: 24px;"),Q.disabled=Bw.upgradeModalOpen})),Yu(e,Z),Ys()}Bu(["click","change","mousedown"]);var sV=new Map,lV=Jl({value:0});function cV(){lV.value++}function uV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dV(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dV(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dV(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var hV=[[0,180,30,30],[.25,220,120,120],[.5,245,245,245],[.75,120,200,120],[1,30,140,60]];function fV(e,t){if("rel"===e)return{min:-50,max:50};var r=fT(t),n=.3*(r.max-r.min);return{min:-n,max:n}}function pV(e,t){return pT((e-t.min)/(t.max-t.min),hV)}function gV(e,t,r,n){if(e.width!==t.width||e.height!==t.height)return console.warn("[changeRaster] Dimension mismatch:",e.width,e.height,"vs",t.width,t.height),null;for(var i=e.width,o=e.height,a=e.rawData.length,s=new Float32Array(a),l=fV(r,n),c=0;c<a;c++){var u=e.rawData[c],d=t.rawData[c];
31Number.isNaN(u)||Number.isNaN(d)||u===e.noDataValue||d===t.noDataValue?s[c]=Number.NaN:"rel"===r?Math.abs(u)<.01?s[c]=Number.NaN:s[c]=(d-u)/u*100:s[c]=d-u}var h=document.createElement("canvas");h.width=i,h.height=o;for(var f=h.getContext("2d").createImageData(i,o),p=0;p<a;p++){var g=4*p,m=s[p];if(Number.isNaN(m))f.data[g]=0,f.data[g+1]=0,f.data[g+2]=0,f.data[g+3]=0;else{var y=uV(pV(m,l),3),_=y[0],v=y[1],b=y[2];f.data[g]=_,f.data[g+1]=v,f.data[g+2]=b,f.data[g+3]=255}}return{imageData:f,bounds:e.bounds,width:i,height:o,date:"".concat(e.date,"_").concat(t.date),metric:"".concat(n,"_change_").concat(r),rawData:s,noDataValue:null}}function mV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||_V(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yV(e){return function(e){if(Array.isArray(e))return vV(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_V(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _V(e,t){if(e){if("string"==typeof e)return vV(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vV(e,t):void 0}}function vV(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function bV(e,t,r,n){for(var i=0,o=0,a=0,s=0,l=0,c=0,u=0;u<e.length;u++){var d=e[u],h=t[u];Number.isNaN(d)||Number.isNaN(h)||(null!=r&&d===r||null!=n&&h===n||(i+=d,o+=h,a+=d*h,s+=d*d,l+=h*h,c++))}if(c<3)return null;var f=Math.sqrt((c*s-i*i)*(c*l-o*o));return 0===f?null:(c*a-i*o)/f}function xV(e){var t=yV(e.keys());if(t.length<2)return null;var r,n=e.get(t[0]),i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_V(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(e);try{for(i.s();!(r=i.n()).done;){var o=mV(r.value,2),a=o[0];if(o[1].rawData.length!==n.rawData.length)return console.warn("[correlationMatrix] Dimension mismatch for ".concat(a)),null}}catch(e){i.e(e)}finally{i.f()}for(var s=t.length,l=Array.from({length:s},(function(){return Array(s).fill(0)})),c=0;c<s;c++){l[c][c]=1;for(var u=e.get(t[c]),d=c+1;d<s;d++){var h=e.get(t[d]),f=bV(u.rawData,h.rawData,u.noDataValue,h.noDataValue);l[c][d]=null!=f?f:0,l[d][c]=null!=f?f:0}}return{metrics:t,matrix:l}}function wV(e){var t=Math.max(-1,Math.min(1,e));if(t>=0){var r=t,n=Math.round(255*(1-r)),i=Math.round(255*(1-r));return"rgb(".concat(n,", ").concat(i,", 255)")}var o=-t,a=Math.round(255*(1-o)),s=Math.round(255*(1-o));return"rgb(255, ".concat(a,", ").concat(s,")")}function SV(e){return SV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},SV(e)}function kV(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */kV=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 31
31if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==SV(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(SV(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
31if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function TV(e){return function(e){if(Array.isArray(e))return IV(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return IV(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?IV(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IV(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function MV(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function EV(e,t,r){return PV.apply(this,arguments)}function PV(){return PV=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){MV(o,n,i,a,s,"next",e)}function s(e){MV(o,n,i,a,s,"throw",e)}a(void 0)}))}}(kV().mark((function e(t,r,n){var i,o,a,s,l,c,u,d;return kV().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Bw.selectedFieldId&&(o=null==n||null===(a=n.features)||void 0===a?void 0:a.find((function(e){return Number(e.id)===Bw.selectedFieldId}))),o||(o=null==n||null===(s=n.features)||void 0===s?void 0:s[0]),null!==(i=o)&&void 0!==i&&i.geometry){e.next=4;break}return e.abrupt("return");case 4:if("Polygon"===o.geometry.type||"MultiPolygon"===o.geometry.type){e.next=6;break}return e.abrupt("return");case 6:return Bw.vegetationSearchLoading=!0,e.prev=7,e.next=10,IB(t,r,o.geometry,Bw.vegetationFetchedMonths);case 10:if(l=e.sent){e.next=13;break}return e.abrupt("return");case 13:Bw.vegetationFetchedMonths.add(l.monthKey),c=new Set(Bw.vegetationImages.map((function(e){return e.date}))),u=l.images.filter((function(e){return!c.has(e.date)})),(d=[].concat(TV(Bw.vegetationImages),TV(u))).sort((function(e,t){return new Date(t.datetime).getTime()-new Date(e.datetime).getTime()})),Bw.vegetationImages=d,(!Bw.vegetationLoadedFromDate||l.monthStartStr<Bw.vegetationLoadedFromDate)&&(Bw.vegetationLoadedFromDate=l.monthStartStr),e.next=25;break;case 22:e.prev=22,e.t0=e.catch(7),console.error("[satellite] Failed to load satellite images:",e.t0);case 25:return e.prev=25,Bw.vegetationSearchLoading=!1,e.finish(25);case 28:case"end":return e.stop()}}),e,null,[[7,22,25,28]])}))),PV.apply(this,arguments)}var AV=$u('<button class="text-[10px] text-blue-600 hover:text-blue-800">Change metrics</button>'),CV=$u("<option> </option>"),RV=$u("<optgroup></optgroup>"),LV=$u('<div class="flex items-center gap-2"><span class="text-[10px] text-gray-400 w-4"> </span> <select class="flex-1 px-2.5 py-1.5 text-xs border border-gray-200 rounded-md bg-white text-gray-700 cursor-pointer"></select></div>'),OV=$u('<div class="flex flex-col gap-3"><p class="text-xs text-gray-500">Select 4 spectral indices to compare:</p> <!> <div class="text-[10px] text-gray-400 mt-1"><!> <!></div> <button class="mt-2 w-full px-4 py-2 rounded-lg font-medium text-sm transition-colors bg-blue-600 hover:bg-blue-700 text-white">Generate Maps</button></div>'),DV=$u('<div class="fixed z-[10000] pointer-events-none bg-gray-900 text-white text-sm font-mono px-2.5 py-1 rounded shadow-lg"> </div>'),zV=$u('<div class="text-xs font-semibold text-gray-500 uppercase tracking-wider pb-1 border-b border-gray-100"> </div>'),FV=$u('<div class="aspect-square w-full bg-gray-50 rounded-lg border border-gray-200 flex items-center justify-center"><svg class="w-4 h-4 animate-spin text-gray-400" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg></div>'),NV=$u('<canvas class="w-full rounded-lg border border-gray-200 cursor-crosshair" style="image-rendering: pixelated;"></canvas> <div class="mt-1"><div class="flex items-center gap-1"><span class="text-[9px] text-gray-400 font-mono w-8 text-right"> </span> <div class="relative flex-1 h-2.5 rounded-sm border border-gray-200"><div class="absolute top-0 h-full border-l border-gray-600"></div> <div class="absolute top-0 w-0.5 h-full bg-gray-800 rounded"></div> <div class="absolute top-0 h-full border-l border-gray-600"></div></div> <span class="text-[9px] text-gray-400 font-mono w-8"> </span></div> <div class="flex justify-between text-[8px] text-gray-400 mt-0.5 px-9"><span> </span> <span class="font-medium"> </span> <span> </span></div></div>',1),BV=$u('<div class="aspect-square w-full bg-gray-50 rounded-lg border border-gray-200 flex items-center justify-center"><span class="text-[9px] text-red-400"> </span></div>'),jV=$u('<div class="aspect-square w-full bg-gray-50 rounded-lg border border-gray-200 flex items-center justify-center"><span class="text-[9px] text-gray-400">No data</span></div>'),VV=$u('<div class="aspect-square w-full bg-gray-50 rounded-lg border border-gray-200 flex items-center justify-center"><svg class="w-4 h-4 animate-spin text-gray-400" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg></div>'),GV=$u('<canvas class="w-full rounded-lg border border-gray-200 cursor-crosshair" style="image-rendering: pixelated;"></canvas> <div class="mt-1"><div class="flex items-center gap-1"><span class="text-[9px] text-gray-400 font-mono w-8 text-right"> </span> <div class="relative flex-1 h-2.5 rounded-sm border border-gray-200"><div class="absolute top-0 h-full border-l border-gray-600"></div> <div class="absolute top-0 w-0.5 h-full bg-gray-800 rounded"></div> <div class="absolute top-0 h-full border-l border-gray-600"></div></div> <span class="text-[9px] text-gray-400 font-mono w-8"> </span></div> <div class="flex justify-between text-[8px] text-gray-400 mt-0.5 px-9"><span> </span> <span class="font-medium"> </span> <span> </span></div></div>',1),UV=$u('<div class="aspect-square w-full bg-gray-50 rounded-lg border border-gray-200 flex items-center justify-center"><span class="text-[9px] text-red-400"> </span></div>'),$V=$u('<div class="aspect-square w-full bg-gray-50 rounded-lg border border-gray-200 flex items-center justify-center"><span class="text-[9px] text-gray-400">No data</span></div>'),HV=$u('<div class="flex flex-col"><span class="text-xs font-semibold text-gray-700 mb-1"> </span> <!></div>'),qV=$u('<div class="flex flex-col"><span class="text-xs font-semibold text-gray-700 mb-1"> </span> <!></div> <!>',1),WV=$u('<!> <div class="grid gap-4"><div class="text-xs font-semibold text-gray-500 uppercase tracking-wider pb-1 border-b border-gray-100"> </div> <!> <!></div>',1),ZV=$u('<div class="fixed inset-0 z-[9999] flex items-center justify-center bg-black/50"><div><div class="flex items-center justify-between mb-4"><div class="flex items-center gap-2"><h3 class="text-sm font-semibold text-gray-800">Detailed Maps</h3> <!></div> <button class="p-1.5 hover:bg-gray-100 rounded-full transition-colors text-gray-400 hover:text-gray-600"><svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
31<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <!></div></div>');function YV(e,t){Zs(t,!0);const r=Dl((()=>Aw.filter((e=>e.available&&"visual"!==e.category&&(!e.sources||e.sources.includes(t.imagerySource))))));let n=$l("select"),i=$l(Jl(["ndvi","gndvi","msavi","ndmi"])),o=$l(Jl({})),a=$l(Jl({})),s=Jl({}),l=Jl({}),c=Jl({}),u=Jl({}),d={},h={},f=$l(null),p=$l(Jl({x:0,y:0}));const g=Dl((()=>!!t.changeFirstDate&&!!t.changeLastDate&&t.changeFirstDate!==t.changeLastDate));function m(e){return Aw.find((t=>t.value===e))?.label??e.toUpperCase()}function y(){ql(n,"view"),function(){for(const e of yu(i))t.dailyDate&&(s[e]=!0,c[e]=null,yu(o)[e]=null,v(e,t.dailyDate).then((t=>{yu(o)[e]=t})).catch((()=>{c[e]="Failed"})).finally((()=>{s[e]=!1}))),yu(g)&&(l[e]=!0,u[e]=null,yu(a)[e]=null,Promise.all([v(e,t.changeFirstDate),v(e,t.changeLastDate)]).then((([r,n])=>{yu(a)[e]=gV(r,n,t.viewChangeMode,e)})).catch((()=>{u[e]="Failed"})).finally((()=>{l[e]=!1})))}()}function _(){ql(n,"select"),ql(o,{},!0),ql(a,{},!0)}async function v(e,r){const n=t.imagerySource,i=`${t.fieldId}-${r}-${e}-${n}`,o=sV.get(i);if(o)return o;if("clearsky"===n&&t.farmFieldId)return FP(t.farmFieldId,r,e);if(!t.fieldGeometry)throw new Error("No field geometry");return kB(t.fieldGeometry,r,e)}function b(e){const t=e.rawData,r=e.noDataValue;let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=0,a=0;for(let e=0;e<t.length;e++){const s=t[e];Number.isNaN(s)||null!==r&&s===r||(s<n&&(n=s),s>i&&(i=s),o+=s,a++)}return a>0?{min:n,max:i,mean:o/a}:{min:0,max:0,mean:0}}function x(e,t){if(!t)return void ql(f,null);const r=e.currentTarget.getBoundingClientRect(),n=Math.floor((e.clientX-r.left)/r.width*t.width),i=Math.floor((e.clientY-r.top)/r.height*t.height)*t.width+n;if(i<0||i>=t.rawData.length)return void ql(f,null);const o=t.rawData[i];ql(f,Number.isNaN(o)||null!==t.noDataValue&&o===t.noDataValue?null:o,!0),ql(p,{x:e.clientX,y:e.clientY},!0)}function w(e,r){const n=[];if(r){const r=fV(t.viewChangeMode,e);for(let e=0;e<=12;e++){const t=e/12,i=r.min+t*(r.max-r.min),[o,a,s]=pV(i,r);n.push(`rgb(${o},${a},${s}) ${(100*t).toFixed(1)}%`)}}else{const t=fT(e);for(let r=0;r<=12;r++){const i=r/12,o=t.min+i*(t.max-t.min),[a,s,l]=gT(o,e);n.push(`rgb(${a},${s},${l}) ${(100*i).toFixed(1)}%`)}}return`linear-gradient(to right, ${n.join(", ")})`}function S(e,r){return r?fV(t.viewChangeMode,e):fT(e)}function k(e,t,r){const n=r-t;return n>0?Math.max(0,Math.min(100,(e-t)/n*100)):50}Tc((()=>{for(const e of yu(i))for(const[t,r]of[[yu(o),d],[yu(a),h]]){const n=t[e],i=r[e];if(!n||!i)continue;i.width=n.width,i.height=n.height;const o=i.getContext("2d");o&&(o.imageSmoothingEnabled=!1,o.putImageData(n.imageData,0,0))}})),Tc((()=>{t.open||(ql(n,"select"),ql(o,{},!0),ql(a,{},!0))}));var T=Zu();Nu("keydown",tc,(function(e){"Escape"===e.key&&t.onClose()}));var I=dc(T),M=e=>{var v=ZV();v.__click=function(...e){t.onClose?.apply(this,e)};var T=uc(v);T.__click=e=>e.stopPropagation();var I=uc(T),M=uc(I),E=hc(uc(M),2),P=e=>{var t=AV();t.__click=_,Yu(e,t)};ad(E,(e=>{"view"===yu(n)&&e(P)})),Os(M),hc(M,2).__click=function(...e){t.onClose?.apply(this,e)},Os(I);var A=hc(I,2),C=e=>{var n=OV(),o=hc(uc(n),2);Il(o,16,(()=>[0,1,2,3]),Tl,((e,t)=>
31{var n=LV(),o=uc(n),a=uc(o);Os(o);var s,l=hc(o,2);l.__change=e=>function(e,t){ql(i,yu(i).map(((r,n)=>n===e?t:r)),!0)}(t,e.target.value),Il(l,21,(()=>Cw),Tl,((e,t)=>{const n=Dl((()=>yu(r).filter((e=>e.category===yu(t).key))));var i=Zu(),o=dc(i),a=e=>{var r=RV();Il(r,21,(()=>yu(n)),Tl,((e,t)=>{var r=CV(),n=uc(r);Os(r);var i={};Pc((()=>{Ju(n,`${yu(t).label??""} — ${yu(t).description??""}`),i!==(i=yu(t).value)&&(r.value=(r.__value=yu(t).value)??"")})),Yu(e,r)})),Os(r),Pc((()=>Fd(r,"label",yu(t).label))),Yu(e,r)};ad(o,(e=>{yu(n).length>0&&e(a)})),Yu(e,i)})),Os(l),Id(l),Os(n),Pc((()=>{Ju(a,`${t+1}.`),s!==(s=yu(i)[t])&&(l.value=(l.__value=yu(i)[t])??"",Td(l,yu(i)[t]))})),Yu(e,n)}));var a=hc(o,2),s=uc(a),l=e=>{var r=Wu();Pc((()=>Ju(r,`Daily: ${t.dailyDate??""}`))),Yu(e,r)};ad(s,(e=>{t.dailyDate&&e(l)}));var c=hc(s,2),u=e=>{var r=Wu();Pc((()=>Ju(r,` |  Change: ${t.changeFirstDate??""} → ${t.changeLastDate??""}`))),Yu(e,r)};ad(c,(e=>{yu(g)&&e(u)})),Os(a),hc(a,2).__click=y,Os(n),Yu(e,n)},R=e=>{var r=WV(),n=dc(r),y=e=>{var t=DV(),r=uc(t,!0);Os(t),Pc((e=>{kd(t,`left: ${yu(p).x+14}px; top: ${yu(p).y-10}px;`),Ju(r,e)}),[()=>yu(f).toFixed(4)]),Yu(e,t)};ad(n,(e=>{null!==yu(f)&&e(y)}));var _=hc(n,2),v=uc(_),T=uc(v);Os(v);var I=hc(v,2),M=e=>{var r=zV(),n=uc(r);Os(r),Pc((()=>Ju(n,`Change — ${t.changeFirstDate??""} → ${t.changeLastDate??""}`))),Yu(e,r)};ad(I,(e=>{yu(g)&&e(M)})),Il(hc(I,2),17,(()=>yu(i)),Tl,((e,t)=>
31{var r=qV(),n=dc(r),i=uc(n),p=uc(i,!0);Os(i);var y=hc(i,2),_=e=>{Yu(e,FV())},v=e=>{var r=Zu(),n=dc(r),i=e=>{const r=Dl((()=>yu(o)[yu(t)])),n=Dl((()=>b(yu(r)))),i=Dl((()=>S(yu(t),!1)));var a=NV(),s=dc(a);s.__mousemove=e=>x(e,yu(r)),nh(s,((e,t)=>d[t]=e),(e=>d?.[e]),(()=>[yu(t)]));var l=hc(s,2),c=uc(l),u=uc(c),h=uc(u,!0);Os(u);var p=hc(u,2),g=uc(p),m=hc(g,2),y=hc(m,2);Os(p);var _=hc(p,2),v=uc(_,!0);Os(_),Os(c);var T=hc(c,2),I=uc(T),M=uc(I,!0);Os(I);var E=hc(I,2),P=uc(E,!0);Os(E);var A=hc(E,2),C=uc(A,!0);Os(A),Os(T),Os(l),Pc(((e,t,r,n,i,o,a,s,l)=>{Ju(h,e),kd(p,`background: ${t??""};`),kd(g,`left: ${r??""}%;`),kd(m,`left: ${n??""}%;`),kd(y,`left: ${i??""}%;`),Ju(v,o),Ju(M,a),Ju(P,s),Ju(C,l)}),[()=>yu(i).min.toFixed(2),()=>w(yu(t),!1),()=>k(yu(n).min,yu(i).min,yu(i).max),()=>k(yu(n).mean,yu(i).min,yu(i).max),()=>k(yu(n).max,yu(i).min,yu(i).max),()=>yu(i).max.toFixed(2),()=>yu(n).min.toFixed(3),()=>yu(n).mean.toFixed(3),()=>yu(n).max.toFixed(3)]),Nu("mouseleave",s,(()=>ql(f,null))),Yu(e,a)},a=e=>{var r=Zu(),n=dc(r),i=e=>{var r=BV(),n=uc(r),i=uc(n,!0);Os(n),Os(r),Pc((()=>Ju(i,c[yu(t)]))),Yu(e,r)},o=e=>{Yu(e,jV())};ad(n,(e=>{c[yu(t)]?e(i):e(o,!1)}),!0),Yu(e,r)};ad(n,(e=>{yu(o)[yu(t)]?e(i):e(a,!1)}),!0),Yu(e,r)};ad(y,(e=>{s[yu(t)]?e(_):e(v,!1)})),Os(n);var T=hc(n,2),I=e=>{var r=HV(),n=uc(r),i=uc(n);Os(n);var o=hc(n,2),s=e=>{Yu(e,VV())},c=e=>{var r=Zu(),n=dc(r),i=e=>{const r=Dl((()=>yu(a)[yu(t)])),n=Dl((()=>b(yu(r)))),i=Dl((()=>S(yu(t),!0)));var o=GV(),s=dc(o);s.__mousemove=e=>x(e,yu(r)),nh(s,((e,t)=>h[t]=e),(e=>h?.[e]),(()=>[yu(t)]));var l=hc(s,2),c=uc(l),u=uc(c),d=uc(u,!0);Os(u);var p=hc(u,2),g=uc(p),m=hc(g,2),y=hc(m,2);Os(p);var _=hc(p,2),v=uc(_,!0);Os(_),Os(c);var T=hc(c,2),I=uc(T),M=uc(I,!0);Os(I);var E=hc(I,2),P=uc(E,!0);Os(E);var A=hc(E,2),C=uc(A,!0);Os(A),Os(T),Os(l),Pc(((e,t,r,n,i,o,a,s,l)=>{Ju(d,e),kd(p,`background: ${t??""};`),kd(g,`left: ${r??""}%;`),kd(m,`left: ${n??""}%;`),kd(y,`left: ${i??""}%;`),Ju(v,o),Ju(M,a),Ju(P,s),Ju(C,l)}),[()=>yu(i).min.toFixed(2),()=>w(yu(t),!0),()=>k(yu(n).min,yu(i).min,yu(i).max),()=>k(yu(n).mean,yu(i).min,yu(i).max),()=>k(yu(n).max,yu(i).min,yu(i).max),()=>yu(i).max.toFixed(2),()=>yu(n).min.toFixed(3),()=>yu(n).mean.toFixed(3),()=>yu(n).max.toFixed(3)]),Nu("mouseleave",s,(()=>ql(f,null))),Yu(e,o)},o=e=>{var r=Zu(),n=dc(r),i=e=>{var r=UV(),n=uc(r),i=uc(n,!0);Os(n),Os(r),Pc((()=>Ju(i,u[yu(t)]))),Yu(e,r)},o=e=>{Yu(e,$V())};ad(n,(e=>{u[yu(t)]?e(i):e(o,!1)}),!0),Yu(e,r)};ad(n,(e=>{yu(a)[yu(t)]?e(i):e(o,!1)}),!0),Yu(e,r)};ad(o,(e=>{l[yu(t)]?e(s):e(c,!1)})),Os(r),Pc((e=>Ju(i,`${e??""} (Change)`)),[()=>m(yu(t))]),Yu(e,r)};ad(T,(e=>{yu(g)&&e(I)})),Pc((e=>Ju(p,e)),[()=>m(yu(t))]),Yu(e,r)})),Os(_),Pc((()=>{kd(_,`grid-template-columns: ${yu(g)?"1fr 1fr":"1fr"};`),Ju(T,`Daily — ${t.dailyDate??"—"??""}`)})),Yu(e,r)};ad(A,(e=>{"select"===yu(n)?e(C):e(R,!1)})),Os(T),Os(v),Pc((()=>wd(T,1,"bg-white rounded-xl shadow-2xl p-5 max-h-[90vh] overflow-y-auto "+("select"===yu(n)?"w-[400px]":"w-[90vw] max-w-5xl")))),Yu(e,v)};ad(I,(e=>{t.open&&e(M)})),Yu(e,T),Ys()}Bu(["click","change","mousemove"]);var XV=$u("<option> </option>"),KV=$u("<option> </option>"),JV=$u('<div class="text-sm text-red-600 bg-red-50 px-3 py-2 rounded-lg"> </div>'),QV=$u('<div class="fixed inset-0 z-[2100] flex items-center justify-center bg-black/50"><div class="bg-white rounded-xl shadow-2xl w-full max-w-md mx-4 overflow-visible"><div class="px-5 py-4 border-b border-gray-200 flex items-center justify-between"><h3 class="text-lg font-semibold text-gray-900">Edit Field Information</h3> <button class="p-1.5 hover:bg-gray-100 rounded-lg transition-colors"><svg class="w-5 h-5 text-gray-500" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div class="p-5 space-y-4"><div><label class="block text-sm font-medium text-gray-700 mb-1.5">Field Name</label> <input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors" placeholder="Enter field name"/></div> <div><label class="block text-sm font-medium text-gray-700 mb-1.5">Crop Type</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors bg-white"><option>Select crop type...</option><!></select></div> <div><label class="block text-sm font-medium text-gray-700 mb-1.5">Irrigation Type</label> <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors bg-white"><option>Not set</option><!></select> <p class="text-xs text-gray-500 mt-1">Determines VRI planning mode for this field</p></div> <div><label class="block text-sm font-medium text-gray-700 mb-1.5">Seeding Date</label> <!> <p class="text-xs text-gray-500 mt-1">Note: Seeding date is stored as a sowing task</p></div> <!></div> <div class="px-5 py-4 border-t border-gray-200 flex justify-end gap-3"><button class="px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors font-medium">Cancel</button> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed"> </button></div></div></div>');Bu(["click"]);var eG=$u('<div class="flex flex-col space-y-4"><div><!> <!></div> <div><!> <!></div> <div><!> <textarea id="irrigation-notes" class="w-full border rounded p-2" rows="3" placeholder="Enter notes for this irrigation event"></textarea></div> <div class="flex items-center space-x-4 mt-6"><!> <!></div></div>');function tG(e,t){Zs(t,!0);let r=$l(!1),n=$l(null),i=$l(null),o=$l("");function a(){if(!t.fieldId)return;if(!yu(n))return;const e=(a=yu(n))?Ew(a):"";var a;const s=document.querySelector('form[method="post"]'),l=s.querySelector('select[name="event-event_type"]'),c=s.querySelector('select[name="event-farm_field"]'),u=s.querySelector('input[name="event-crop_zone"]'),d=s.querySelector('input[name="event-timestamp"]'),h=s.querySelector('input[name="event-amount"]'),f=s.querySelector('textarea[name="event-note"]'),p=s.querySelector('button[name="event-submit"]');if(l&&c&&d&&p){if(l.value="irrigation",c.value=String(t.fieldId),d.value=e,u&&(u.value=Bw.selectedCropZoneId??""),h&&(h.value=yu(i)?String(yu(i)):""),f&&(f.value=yu(o)||""),null!=t.fieldId)try{sessionStorage.setItem("karl_restore_field_id",String(t.fieldId))}catch{}ql(r,!1),p.click()}}var s={openModal:function(){ql(n,null),ql(i,null),ql(o,""),ql(r,!0)}};return function(e,t){Zs(t,!0);let r=fh(t,"open",15,!1),n=fh(t,"permanent",3,!1),i=fh(t,"dismissable",3,!0),o=fh(t,"size",3,"md"),a=fh(t,"transition",3,h_),s=fh(t,"fullscreen",3,!1),l=lh(t,["$$slots","$$events","$$legacy","children","header","footer","title","open","permanent","dismissable","closeBtnClass","headerClass","bodyClass","footerClass","size","placement","class","classes","transitionParams","transition","fullscreen"]);t.headerClass,t.bodyClass,t.footerClass,t.closeBtnClass;const c=Dl((()=>t.classes??{header:t.headerClass,body:t.bodyClass,footer:t.footerClass,close:t.closeBtnClass})),u=x_("modal"),d={duration:100,easing:l_},h=Dl((()=>t.transitionParams??d)),f=Dl((()=>_v({placement:t.placement,size:o()}))),p=Dl((()=>yu(f).base)),g=Dl((()=>yu(f).header)),m=Dl((()=>yu(f).footer)),y=Dl((()=>yu(f).body));{let o=Dl((()=>i()&&!t.title&&!n())),d=Dl((()=>yu(p)({fullscreen:s(),class:yd(u?.base,t.class)})));rv(e,hh({get transition(){return a()},get dismissable(){return yu(o)},get transitionParams(){return yu(h)},get classes(){return t.classes}},(()=>l),{get class(){return yu(d)},get open(){return r()},set open(e){r(e)},children:(e,r)=>{var o=wv(),a=dc(o),s=e=>{var r=bv(),o=uc(r),a=e=>{var r=vv(),o=dc(r),a=uc(o,!0);Os(o);var s=hc(o,2),l=e=>{{let t=Dl((()=>yd(yu(c).close)));Fm(e,{type:"submit",formnovalidate:!0,get class(){return yu(t)}})}};ad(s,(e=>{i()&&!n()&&e(l)}
31)),Pc((()=>Ju(a,t.title))),Yu(e,r)},s=e=>{var r=Zu(),n=dc(r),i=e=>{var r=Zu();ud(dc(r),(()=>t.header)),Yu(e,r)};ad(n,(e=>{t.header&&e(i)}),!0),Yu(e,r)};ad(o,(e=>{t.title?e(a):e(s,!1)})),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yu(g)({class:yd(u?.header,yu(c).header)}))]),Yu(e,r)};ad(a,(e=>{(t.title||t.header)&&e(s)}));var l=hc(a,2);ud(uc(l),(()=>t.children??Ka)),Os(l);var d=hc(l,2),h=e=>{var r=xv();ud(uc(r),(()=>t.footer)),Os(r),Pc((e=>wd(r,1,e)),[()=>_d(yu(m)({class:yd(u?.footer,yu(c).footer)}))]),Yu(e,r)};ad(d,(e=>{t.footer&&e(h)})),Pc((e=>wd(l,1,e)),[()=>_d(yu(y)({class:yd(u?.body,yu(c).body)}))]),Yu(e,o)},$$slots:{default:!0}}))}Ys()}(e,{size:"md",autoclose:!1,get title(){return`Add Irrigation - ${t.fieldName??""}`},get open(){return yu(r)},set open(e){ql(r,e,!0)},children:(e,s)=>{var l=eG(),c=uc(l),u=uc(c);Ob(u,{for:"irrigation-date",class:"mb-2",children:(e,t)=>{Ds(),Yu(e,Wu("Date"))},$$slots:{default:!0}}),X_(hc(u,2),{get value(){return yu(n)},set value(e){ql(n,e,!0)}}),Os(c);var d=hc(c,2),h=uc(d);Ob(h,{for:"irrigation-amount",class:"mb-2",children:(e,t)=>{Ds(),Yu(e,Wu("Irrigation Amount (mm)"))},$$slots:{default:!0}}),Wb(hc(h,2),{id:"irrigation-amount",type:"number",step:"0.1",min:"0",placeholder:"Enter amount in mm",get value(){return yu(i)},set value(e){ql(i,e,!0)}}),Os(d);var f=hc(d,2),p=uc(f);Ob(p,{for:"irrigation-notes",class:"mb-2",children:(e,t)=>{Ds(),Yu(e,Wu("Notes (optional)"))},$$slots:{default:!0}});var g=hc(p,2);mc(g),Os(f);var m=hc(f,2),y=uc(m);{let e=Dl((()=>!t.fieldId||!yu(n)));P_(y,{onclick:a,get disabled(){return yu(e)},children:(e,t)=>{Ds(),Yu(e,Wu("Add Irrigation"))},$$slots:{default:!0}})}P_(hc(y,2),{color:"light",onclick:()=>ql(r,!1),children:(e,t)=>{Ds(),Yu(e,Wu("Cancel"))},$$slots:{default:!0}}),Os(m),Os(l),Kd(g,(()=>yu(o)),(e=>ql(o,e))),Yu(e,l)},$$slots:{default:!0}}),Ys(s)}var rG=$u('<button class="absolute right-2 top-1/2 -translate-y-1/2 text-red-500 hover:text-red-700 transition-colors leading-none px-1 bg-gray-50" title="Delete irrigation event" aria-label="Delete irrigation event">×</button>'),nG=$u('<div class="flex justify-between items-center text-sm bg-gray-50 rounded px-3 py-2 group relative"><span class="text-gray-600"> </span> <span class="font-medium text-blue-600"> </span> <!></div>'),iG=$u('<div class="space-y-1.5"></div>'),oG=$u('<div class="text-sm text-gray-400 italic">No irrigation recorded</div>'),aG=$u('<div role="dialog" aria-modal="true" aria-label="Irrigation Information" tabindex="-1" class="fixed inset-0 bg-black/40 z-[2000] flex items-center justify-center p-4"><div role="document" class="bg-white rounded-xl shadow-2xl w-full max-w-md max-h-[80vh] flex flex-col"><div class="flex items-center justify-between px-5 py-4 border-b border-gray-200"><h3 class="text-base font-semibold text-gray-900">Irrigation Information</h3> <button class="text-gray-400 hover:text-gray-600 transition-colors" title="Close" aria-label="Close"><svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div class="flex-1 overflow-y-auto px-5 py-4"><div class="text-xs font-medium text-gray-500 uppercase tracking-wide mb-2">History</div> <!></div> <div class="px-5 py-3 border-t border-gray-200 flex justify-end"><button class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors text-sm font-medium">+ Add Irrigation</button></div></div></div>'),sG=$u('<div><button class="w-full flex items-center justify-between px-3 py-2 bg-white hover:bg-gray-50 rounded-lg transition-colors text-sm border border-gray-300"><span class="font-medium text-gray-700">Irrigation Information</span> <span class="text-xs text-gray-500"> </span></button></div> <!> <!>',1);function lG(e,t){Zs(t,!0);fh(t,"dateRangeLabel",3,"");let r=fh(t,"precipTotal",3,0),n=fh(t,"etTotal",3,0),i=fh(t,"irrigationTotal",3,0),o=$l(void 0),a=$l(null),s=$l(!1);Dl((()=>{if(!t.tasksData||!t.selectedField)return"---";const e=Number(t.selectedField.id),r=t.tasksData.find((t=>"sowing"===t.type&&t.farm_field_id===e));return r?.date?new Date(r.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):"---"}));const l=Dl((()=>t.selectedField?.properties?.irrigation_events?t.selectedField.properties.irrigation_events:[])),c=Dl((()=>yu(l).reduce(((e,t)=>e+(t.irrigation_amount??0)),0)));Dl((()=>r()+i()+n()));function u(){yu(o)&&yu(o).openModal()}var d=sG(),h=dc(d),f=uc(h);f.__click=()=>ql(s,!0);var p=hc(uc(f),2),g=uc(p);Os(p),Os(f),Os(h);var m=hc(h,2),y=e=>{var r=aG();r.__click=()=>
31ql(s,!1),r.__keydown=e=>{"Escape"===e.key&&ql(s,!1)};var n=uc(r);n.__click=e=>e.stopPropagation(),n.__keydown=e=>e.stopPropagation();var i=uc(n);hc(uc(i),2).__click=()=>ql(s,!1),Os(i);var o=hc(i,2),c=hc(uc(o),2),d=e=>{var r=iG();Il(r,21,(()=>yu(l)),Tl,((e,r)=>{var n=nG(),i=uc(n),o=uc(i,!0);Os(i);var s=hc(i,2),l=uc(s);Os(s);var c=hc(s,2),u=e=>{var n=rG();n.__click=()=>async function(e){const r=`${bh.basePath}farms/edit-farm/delete-irrigation-event/${e}/`;try{await fetch(r,{method:"POST",headers:{"X-CSRFToken":bh.csrfToken}}),null!=t.selectedField?.id&&sessionStorage.setItem("karl_restore_field_id",String(t.selectedField.id)),window.location.reload()}catch(e){console.error("Failed to delete irrigation event:",e)}}(yu(r).id),Yu(e,n)};ad(c,(e=>{yu(a)===yu(r).id&&e(u)})),Os(n),Pc(((e,t)=>{Ju(o,e),Ju(l,`${t??""} mm`)}),[()=>new Date(yu(r).date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}),()=>yu(r).irrigation_amount?.toFixed(0)||"0"]),Nu("mouseenter",n,(()=>ql(a,yu(r).id,!0))),Nu("mouseleave",n,(()=>ql(a,null))),Yu(e,n)})),Os(r),Yu(e,r)},h=e=>{Yu(e,oG())};ad(c,(e=>{yu(l).length>0?e(d):e(h,!1)})),Os(o);var f=hc(o,2);uc(f).__click=u,Os(f),Os(n),Os(r),Yu(e,r)};ad(m,(e=>{yu(s)&&e(y)}));var _=hc(m,2);{let e=Dl((()=>t.selectedField?Number(t.selectedField.id):null)),r=Dl((()=>t.selectedField?.properties?.name||""));nh(tG(_,{get fieldId(){return yu(e)},get fieldName(){return yu(r)}}),(e=>ql(o,e,!0)),(()=>yu(o)))}Pc((e=>Ju(g,`${e??""} mm total`)),[()=>yu(c).toFixed(0)]),Yu(e,d),Ys()}function cG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||uG(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uG(e,t){if(e){if("string"==typeof e)return dG(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dG(e,t):void 0}}function dG(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Bu(["click","keydown"]);var hG={labels:[],rawDates:[],et:{standard:[],cumulative:[],total:0},precipitation:{standard:[],cumulative:[],total:0},irrigation:{standard:[],cumulative:[],total:0},difference:{standard:[],cumulative:[],total:0}};function fG(e){var t=e.split("T")[0];try{return new Date(t).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch(e){return t}}function pG(e,t,r,n,i){if(!n||!i)return hG;var o=new Date(n);o.setHours(0,0,0,0);var a=new Date(i);a.setHours(23,59,59,999);for(var s=new Map,l=0,c=Object.entries(e);l<c.length;l++){var u=cG(c[l],2),d=u[0],h=u[1],f=new Date(d);f.setHours(0,0,0,0),f>=o&&f<=a&&s.set(d,+(h||0))}for(var p=new Map,g=0,m=Object.entries(t);g<m.length;g++){var y=cG(m[g],2),_=y[0],v=y[1],b=new Date(_);b.setHours(0,0,0,0),b>=o&&b<=a&&p.set(_,v||0)}var x,w=new Map,S=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=uG(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(r);try{for(S.s();!(x=S.n()).done;){var k,T=x.value,I=null===(k=T.date)||void 0===k?void 0:k.split("T")[0];
31if(I){var M=new Date(I);if(M.setDate(M.getDate()+1),I=M.toISOString().split("T")[0],new Date(I)>=o&&new Date(I)<=a){var E=T.irrigation_amount||0;w.set(I,(w.get(I)||0)+E)}}}}catch(e){S.e(e)}finally{S.f()}var P=[],A=new Date(o);A.setHours(0,0,0,0);var C=new Date(a);for(C.setHours(0,0,0,0);A.getTime()<=C.getTime();)P.push(Ew(A)),A.setDate(A.getDate()+1);for(var R=[],L=[],O=[],D=[],z=[],F=[],N=[],B=[],j=0,V=0,G=0,U=0,$=0,H=P;$<H.length;$++){var q=H[$],W=s.get(q)||0,Z=p.get(q)||0,Y=w.get(q)||0;j+=W,V+=Z,G+=Y,R.push(-Math.abs(W)),L.push(-Math.abs(j)),O.push(Z),D.push(V),z.push(Y),F.push(G);var X=Z+Y-W;N.push(X),U+=X,B.push(U)}return{labels:P.map(fG),rawDates:P,et:{standard:R,cumulative:L,total:-Math.abs(j)},precipitation:{standard:O,cumulative:D,total:V},irrigation:{standard:z,cumulative:F,total:G},difference:{standard:N,cumulative:B,total:U}}}var gG=$u('<div class="absolute inset-0 flex items-center justify-center text-gray-500">Loading chart data...</div>'),mG=$u('<canvas class="absolute inset-0 w-full h-full"></canvas>'),yG=$u('<div class="flex-shrink-0 rounded border border-gray-100 bg-white p-2"><div class="relative w-full h-full"><!></div></div>');function _G(e,t){Zs(t,!0);let r=fh(t,"labels",19,(()=>[])),n=fh(t,"series",19,(()=>[])),i=fh(t,"legend",3,!0),o=fh(t,"title",3,null),a=fh(t,"loading",3,!1),s=fh(t,"height",3,"250px"),l=fh(t,"legendClick",3,!0),c=fh(t,"showCumulativeTooltips",3,!1),u=fh(t,"unit",3,"mm"),d=fh(t,"decimals",3,1),h=fh(t,"yMin",3,void 0),f=fh(t,"yMax",3,void 0),p=fh(t,"y2",3,void 0),g=null,m=$l(null);Tc((()=>{yu(m)&&n().length&&r().length&&!a()&&function(){if(!yu(m)||a())return;g&&g.destroy();const e=n().some((e=>e.isFloatingBar)),t=n().map((e=>({...e,data:[...e.data]})));let s=t.findIndex((e=>e.label.toLowerCase().includes("evapotranspiration")));-1!==s&&(t[s].data=t[s].data.map((e=>"number"==typeof e?-Math.abs(e):e)));let y=t.findIndex((e=>e.label.toLowerCase().includes("precip"))),_=t.findIndex((e=>e.isIrrigation)),v=t.findIndex((e=>e.label.toLowerCase().includes("balance")));if(-1!==y&&-1!==_&&-1!==s&&-1!==v){let e=t[y].data,r=t[_].data,n=t[s].data;t[v].data=e.map(((e,t)=>("number"==typeof e?e:0)+("number"==typeof r[t]?r[t]:0)+("number"==typeof n[t]?n[t]:0)))}const b=t.some((e=>e.isWhisker)),x=t.some((e=>"string"==typeof e.fill)),w=e||x||b,S=t.map(((e,t)=>({label:e.label,data:e.data,type:e.type,backgroundColor:e.backgroundColor??(e.isIrrigation?"#a259e6":"bar"===e.type?e.color:void 0),borderColor:e.isIrrigation?"#a259e6":e.borderColor??e.color,borderWidth:e.borderWidth??2,borderDash:e.borderDash,borderSkipped:!e.isFloatingBar&&void 0,tension:e.tension??("line"===e.type?.3:void 0),fill:e.fill??!1,pointRadius:e.pointRadius??("line"===e.type?0:void 0),pointHoverRadius:e.pointHoverRadius??("line"===e.type?4:void 0),pointBackgroun
31dColor:e.pointColors??void 0,order:"line"===e.type?0:1,spanGaps:!0,barPercentage:e.isFloatingBar?.6:void 0,yAxisID:e.yAxisID??"y",_hiddenInLegend:e.hiddenInLegend??!1,_isWhisker:e.isWhisker??!1}))),k=yu(m).getContext("2d");if(!k)return;const T=e=>{const t=k.createLinearGradient(0,0,0,yu(m)?.height),r=(e.startsWith("#"),e);return t.addColorStop(0,`${r}60`),t.addColorStop(.5,`${r}20`),t.addColorStop(1,`${r}00`),t},I=S.map((e=>"line"!==e.type||!0!==e.fill||!e.borderColor||e.backgroundColor&&e.backgroundColor.includes("128, 128, 128")?e:{...e,backgroundColor:T(e.borderColor),fill:"origin"})),M={id:"whiskerLines",afterDatasetsDraw(e){if(!b)return;const t=e.ctx,r=e.getDatasetMeta(0),n=S.map(((t,r)=>t._isWhisker?e.getDatasetMeta(r):null)).filter(Boolean);if(r&&0!==n.length){t.save(),t.strokeStyle=S.find((e=>e._isWhisker))?.borderColor??"rgba(0,0,0,0.2)",t.lineWidth=1;for(let e=0;e<r.data.length;e++){const i=r.data[e];if(i)for(const r of n){const n=r.data[e];n&&(t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(n.x,n.y),t.stroke(),t.beginPath(),t.moveTo(n.x-4,n.y),t.lineTo(n.x+4,n.y),t.stroke())}}t.restore()}}},E={id:"y2RefLine",afterDraw(e){const t=e.scales.y2;if(!t)return;const r=e.ctx,n=t.getPixelForValue(1);n<e.chartArea.top||n>e.chartArea.bottom||(r.save(),r.strokeStyle="rgba(124, 58, 237, 0.25)",r.lineWidth=1,r.setLineDash([6,4]),r.beginPath(),r.moveTo(e.chartArea.left,n),r.lineTo(e.chartArea.right,n),r.stroke(),r.restore())}},P=[];b&&P.push(M),p()&&P.push(E),g=new La(k,{type:"bar",data:{labels:r(),datasets:I},plugins:P,options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:i(),position:"top",onClick:l()?void 0:()=>{},labels:{filter:e=>{const t=I[e.datasetIndex];return!t?._hiddenInLegend&&!t?._isWhisker}}},title:o()?{display:!0,text:o()}:void 0,tooltip:c()?{displayColors:!1,callbacks:{title:e=>e[0]?.label||"",label:e=>{const t=e.parsed.y;if("line"===e.dataset.type){const r=e.dataIndex;let n=t;return r>0&&(n=t-Number(e.dataset.data[r-1])),[`Daily: ${n.toFixed(1)} mm`,`Total: ${t.toFixed(1)} mm`]}return`Daily: ${t.toFixed(1)} mm`}}}:{callbacks:{label:e=>{const t=e.dataset.label||"",r="y2"===e.dataset.yAxisID,n=u()&&!r?` ${u()}`:"",i=e.raw;return Array.isArray(i)&&2===i.length?`${t}: ${i[0].toFixed(d())} – ${i[1].toFixed(d())}${n}`:`${t}: ${e.parsed.y.toFixed(r?2:d())}${n}`}}}},interaction:{mode:"index",intersect:!1},scales:{x:{grid:{display:!1},max:void 0,title:void 0,stacked:!w,ticks:{maxTicksLimit:7,autoSkip:!0}},y:{beginAtZero:void 0===h()&&!w,position:"left",stacked:!w,min:h(),max:f(),ticks:{maxTicksLimit:4,autoSkip:!0}},...p()?{y2:{position:"right",min:p().min,max:p().max,grid:{drawOnChartArea:!1},ticks:{maxTicksLimit:4,autoSkip:!0}}}:{}}}})}()})),Tc((()=>()=>{g&&g.destroy()}));var y=yG(),_=uc(y),v=uc(_),b=e=>{Yu(e,gG())},x=e=>{var t=mG();nh(t,(e=>ql(m,e)),(()=>yu(m))),Yu(e,t)};ad(v,(e=>{a()?e(b):e(x,!1)})),Os(_),Os(y),Pc((()=>kd(y,`height: ${s()??""}`))),Yu(e,y),Ys()}var vG=$u('<button><span class="w-2 h-2 rounded-full flex-shrink-0"></span> <span class="font-medium w-12"> </span> <span class="text-gray-400 truncate flex-1"> </span></button>'),bG=$u('<div class="px-2.5 pt-2 pb-1 text-[10px] font-semibold text-gray-400 uppercase tracking-wider"> </div> <!>',1),xG=$u('<div class="absolute z-50 mt-1 w-56 bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden"></div>'),wG=$u('<span class="relative group inline-flex"><button> </button></span>'),SG=$u("<option> </option>"),kG=$u('<select class="ml-1 px-1.5 py-0.5 text-[10px] border border-gray-200 rounded-md bg-white text-gray-600 cursor-pointer"></select>'),TG=$u('<div class="flex items-center border border-gray-200 rounded-md overflow-hidden ml-1"></div> <!>',1),IG=$u('<div class="mb-2 p-3 bg-gray-50 border border-gray-200 rounded-lg text-xs text-gray-700 leading-relaxed"><div class="flex items-center justify-between mb-2"><span class="font-semibold text-gray-900">Understanding CV Metrics</span> <button type="button" class="text-gray-400 hover:text-gray-600">&times;</button></div> <p class="mb-2"><strong>Spatial CV</strong> (amber) measures how much pixel values differ across the field on a single day — higher means more variability for VRI to exploit. <strong>Pixel CV</strong> (red) measures how much individual pixels fluctuate over time. <strong>Field CV</strong> (blue) measures how much the overall field average changes. <strong>Churn</strong> (purple, right axis) is the ratio Pixel CV / Field CV — the dashed line at 1.0 is the baseline.</p> <table class="w-full text-[11px] border-collapse"><thead><tr class="border-b border-gray-300"><th class="text-left py-1 pr-2">Field CV</th><th class="text-left py-1 pr-2">Pixel CV</th><th class="text-left py-1 pr-2">Churn</th><th class="text-left py-1">Interpretation</th></tr></thead><tbody><tr class="border-b border-gray-100"><td class="py-1 pr-2">Low</td><td class="py-1 pr-2">Low</td><td class="py-1 pr-2">~1</td><td class="py-1">Stable field, stable pattern. Ideal for VRI.</td></tr><tr class="border-b border-gray-100"><td class="py-1 pr-2">Low</td><td class="py-1 pr-2 text-red-600 font-medium">High</td><td class="py-1 pr-2 text-red-600 font-medium">&gt;&gt;1</td><td class="py-1">Field mean looks steady but zones are silently reorganizing. VRI zones may be unreliable.</td></tr><tr class="border-b border-gray-100"><td class="py-1 pr-2">High</td><td class="py-1 pr-2">High</td><td class="py-1 pr-2">~1</td><td class="py-1">Whole field changing (e.g., crop growth stage) but spatial pattern is preserved. Zones still valid.</td></tr><tr><td class="py-1 pr-2">High</td><td class="py-1 pr-2">Low</td><td class="py-1 pr-2">&lt;1</td><td class="py-1">Edge case / data quality issue. Mathematically unlikely.</td></tr></tbody></table></div>'),MG=$u('<div class="flex items-center gap-3 mb-1 text-xs"><span class="text-gray-500"> </span> <span class="font-medium">Pixel CV <span class="text-red-600"> </span></span> <span class="text-gray-300">|</span> <span class="font-medium">Field CV <span class="text-blue-600"> </span></span> <span class="text-gray-300">|</span> <span class="font-medium">Churn <span class="text-purple-600"> </span></span> <button type="button" class="ml-1 text-gray-400 hover:text-gray-600 cursor-help" title="What do these metrics mean?"><svg class="w-3.5 h-3.5 inline" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></button></div> <!>',1),EG=$u('<div class="h-[250px] flex items-center justify-center bg-gray-50 rounded"><span class="text-gray-400">Fetching satellite data...</span></div>'),PG=$u('<div class="h-[100px] flex items-center justify-center bg-gray-50 rounded text-gray-400 text-sm">No satellite passes in the selected period</div>'),AG=$u('<div class="space-y-6"><div class="mb-8"><div class="flex items-center gap-2 mb-2 mt-4"><span class="font-semibold">Satellite Metric</span> <span class="text-xs text-gray-400"> </span> <div class="relative"><button class="flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-medium border border-gray-200 bg-white hover:bg-gray-50 transition-colors"><span class="w-2 h-2 rounded-full flex-shrink-0"></span> <span> </span> <svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
31<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></button> <!></div> <!></div> <!> <!></div> <div class="flex items-center gap-4 mb-1"><div class="flex items-center gap-2"><span class="font-semibold">Precipitation (Accumulated)</span> <span class="rounded px-2 py-1 text-white"> </span></div></div> <!> <div class="flex items-center gap-4 mb-1"><div class="flex items-center gap-2"><span class="font-semibold">Irrigation (Accumulated)</span> <span class="rounded px-2 py-1 text-white"> </span></div></div> <!></div>');function CG(e,t){Zs(t,!0);const r="#a259e6",n="rgba(5, 150, 105, 0.7)";let i=$l(Jl({})),o=$l(!1),a=$l(!1),s=$l(Jl(Bw.vegetationIndexType||"ndvi")),l=$l(Jl([])),c=$l(!1),u=$l(Jl([])),d=$l(!1),h=$l("line"),f=$l(!1),p=$l(Jl([])),g=$l(!1),m=$l(14),y=$l(!1),_=$l(void 0);Tc((()=>{if(!yu(y))return;const e=e=>{yu(_)&&!yu(_).contains(e.target)&&ql(y,!1)};return window.addEventListener("click",e,!0),()=>window.removeEventListener("click",e,!0)})),Tc((()=>{const e=yu(s);xu((()=>{Bw.showVegetationIndexLayer&&"rgb"!==Bw.vegetationIndexType&&Bw.vegetationIndexType!==e&&(Bw.vegetationIndexType=e)}))})),Tc((()=>{const e=Bw.vegetationIndexType;Bw.showVegetationIndexLayer&&"rgb"!==e&&xu((()=>{e!==yu(s)&&ql(s,e,!0)}))}));const v=Dl((()=>Aw.find((e=>e.value===yu(s))))),b=Dl((()=>"NDREI"===yu(s).toUpperCase()?"NDREI":yu(s).toUpperCase())),x=(Dl((()=>XB(yu(b)))),Dl((()=>fT(yu(s))))),w=Dl((()=>Aw.filter((e=>e.available&&"visual"!==e.category&&(!e.sources||e.sources.includes(Bw.imagerySource)))))),S=Dl((()=>t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===Bw.selectedFieldId)))),k=Dl((()=>!0===yu(S)?.properties?.cloudless_activated)),T=Dl((()=>{const e=Bw.selectedCropZoneId;if(e)return e;const t=yu(S)?.properties?.crop_zones??[],r=t[0]?.crop_zone_id;return r||yu(S)?.properties?.farm_field_id})),I=Dl((()=>"clearsky"===Bw.imagerySource));Dl((()=>yu(S)?.properties?.pro_activated??!1));Dl((()=>yu(S)?.properties?.crop_zones?.[0].name)),Dl((()=>yu(S)?.properties?.crop_zones?.[0].crop_type||"Undefined Crop"));const M=Dl((()=>{const e=yu(S)?.properties?.irrigation_events;if(!Array.isArray(e))return[];const t=Bw.selectedCropZoneId;return e.filter((e=>!!e.date)).filter((e=>!t||!e.crop_zone_id||e.crop_zone_id===t)).map((e=>({...e,dateObj:new Date(e.date)}))).filter((e=>!Number.isNaN(e.dateObj.getTime()))).sort(((e,t)=>t.dateObj.getTime()-e.dateObj.getTime()))}));Tc((()=>
31{if(!yu(S))return void ql(a,!1);ql(o,!0),ql(a,!1);(async()=>{try{const e=yu(S).geometry.coordinates[0],t=e.reduce(((e,[t,r])=>e+r),0)/e.length,r=e.reduce(((e,[t])=>e+t),0)/e.length,n=(Bw.fieldTimelineStart||"").split("T")[0],o=(Bw.fieldTimelineEnd||"").split("T")[0],s=await function(e,t,r){return vk.apply(this,arguments)}(t,r,n,o),l={};for(const[e,t]of Object.entries(s)){const r=e.split("T")[0];l[r]=(l[r]||0)+(t.precipitation||0)}ql(i,l,!0),ql(a,!0)}catch(e){console.error("Error fetching precipitation data:",e),ql(i,{},!0),ql(a,!0)}finally{ql(o,!1)}})()}));let E=null,P=0;Tc((()=>{if(!yu(S)?.geometry)return ql(l,[],!0),void ql(c,!1);const e=Bw.fieldTimelineStart,t=Bw.fieldTimelineEnd,r=yu(b);if(!e||!t)return ql(l,[],!0),void ql(c,!1);const n=yu(S).geometry,i=yu(S).properties?.crop_zones??[],o=Bw.selectedCropZoneId,a=o?i.find((e=>e.crop_zone_id===o)):void 0,s={type:"Feature",properties:{},geometry:a?.boundary??n};E&&clearTimeout(E),ql(c,!0);const u=++P;E=setTimeout((()=>{wB(n,{startDate:e,endDate:t}).then((e=>function(e,t,r,n){return rj.apply(this,arguments)}(e,s,r,{maxImages:100,maxCloudCover:0}))).then((e=>{u===P&&ql(l,e,!0)})).catch((e=>{u===P&&(console.error(`Failed to fetch ${r} history:`,e),ql(l,[],!0))})).finally((()=>{u===P&&ql(c,!1)}))}),150)}));let A=null,C=0;Tc((()=>
31{if(!yu(k)||!yu(T))return ql(u,[],!0),void ql(d,!1);const e=Bw.fieldTimelineStart,t=Bw.fieldTimelineEnd,r=yu(s);if(!e||!t)return ql(u,[],!0),void ql(d,!1);A&&clearTimeout(A),ql(d,!0);const n=++C;A=setTimeout((()=>{OP(yu(T),r,e,t).then((e=>{n===C&&ql(u,e,!0)})).catch((e=>{n===C&&(console.error(`Failed to fetch ClearSky ${r} history:`,e),ql(u,[],!0))})).finally((()=>{n===C&&ql(d,!1)}))}),150)}));let R=null;Tc((()=>{if("cv"!==yu(h)||!yu(k)||!yu(T))return void ql(p,[],!0);const e=Bw.fieldTimelineStart,t=Bw.fieldTimelineEnd,r=yu(s),n=yu(m);e&&t?(R&&clearTimeout(R),ql(g,!0),R=setTimeout((()=>{(function(e,t,r,n,i){return zP.apply(this,arguments)})(yu(T),r,n,e,t).then((e=>{ql(p,e,!0)})).catch((e=>{console.error(`Failed to fetch temporal CV for ${r}:`,e),ql(p,[],!0)})).finally((()=>{ql(g,!1)}))}),250)):ql(p,[],!0)}));const L=Dl((()=>{const e=Bw.selectedFieldId,r=e&&t.evapotranspirationData?.[e]?.daily_values,n=yu(S)?.properties?.avg_evapotranspiration_per_date;return pG(r||n||{},yu(i),yu(M),Bw.fieldTimelineStart,Bw.fieldTimelineEnd)})),O=(Dl((()=>{if(!yu(M).length)return"No Irrigation Recorded";const e=yu(M)[0];return`Irrigated ${e.date}  (${e.days_since_last_irrigation} days ago)`})),Dl((()=>{if(0===yu(L).rawDates.length||0===yu(l).length)return[];const e=new Map;for(const t of yu(l))e.set(t.date,t.mean);return yu(L).rawDates.map((t=>e.get(t)??null))}))),D=Dl((()=>{if(0===yu(L).rawDates.length||0===yu(u).length)return{mean:[],min:[],max:[],ciUpper:[],ciLower:[],cv:[]};const e=new Map;for(const t of yu(u))e.set(t.date,t);return{mean:yu(L).rawDates.map((t=>e.get(t)?.mean??null)),min:yu(L).rawDates.map((t=>e.get(t)?.min??null)),max:yu(L).rawDates.map((t=>e.get(t)?.max??null)),ciUpper:yu(L).rawDates.map((t=>{const r=e.get(t);return r?r.mean+1.96*r.std:null})),ciLower:yu(L).rawDates.map((t=>{const r=e.get(t);return r?r.mean-1.96*r.std:null})),cv:yu(L).rawDates.map((t=>{const r=e.get(t)?.cv;return null!=r?100*r:null}))}})),z=Dl((()=>{if(0===yu(L).rawDates.length||0===yu(p).length)return{pixelCV:[],fieldCV:[],churn:[]};const e=new Map;for(const t of yu(p))e.set(t.date,t);return{pixelCV:yu(L).rawDates.map((t=>e.get(t)?.mean_pixel_temporal_cv??null)),fieldCV:yu(L).rawDates.map((t=>e.get(t)?.field_temporal_cv??null)),churn:yu(L).rawDates.map((t=>e.get(t)?.churn_ratio??null))}}));function F(e,t,r){const n=1.1*e;return Math.max(t,Math.ceil(n/r)*r)}const N=Dl((()=>{let e=yu(D).cv.reduce(((e,t)=>null!=t&&t>e?t:e),0);const t=yu(z).pixelCV.reduce(((e,t)=>null!=t&&100*t>e?100*t:e),0),r=yu(z).fieldCV.reduce(((e,t)=>null!=t&&100*t>e?100*t:e),0);return e=Math.max(e,t,r),F(e,50,25)})),B=Dl((()=>{const e=yu(z).churn.reduce(((e,t)=>null!=t&&t>e?t:e),0);return F(e,3,1)})),j=Dl((()=>0===yu(p).length?null:yu(p)[yu(p).length-1])),V=Dl((()=>yu(I)?yu(D).mean:yu(O))),G=Dl((()=>"cv"===yu(h)?yu(d)||yu(g):yu(I)?yu(d):yu(c))),U=Dl((()=>yu(I)?yu(u).length>0:yu(l).length>0)),$=Dl((()=>{if(!yu(V)||0===yu(V).length)return[];const e=yu(s);return yu(V).map((t=>{if(null==t)return"transparent";const[r,n,i]=gT(t,e);return`rgb(${r},${n},${i})`}))}));Tc((()=>{const e=yu(I)?yu(u):yu(l),t=yu(I)?yu(d):yu(c);if(Bw.metricChangeLoading=t,!e||0===e.length)return Bw.metricChangeFirst=null,void(Bw.metricChangeLast=null);const r=[...e].sort(((e,t)=>e.date.localeCompare(t.date)));Bw.metricChangeFirst={date:r[0].date,mean:r[0].mean},Bw.metricChangeLast={date:r[r.length-1].date,mean:r[r.length-1].mean}}));var H=AG(),q=uc(H),W=uc(q),Z=hc(uc(W),2),Y=uc(Z);Os(Z);var X=hc(Z,2),K=uc(X);K.__click=()=>ql(y,!yu(y));var J=uc(K),Q=hc(J,2),ee=uc(Q,!0);Os(Q);var te=hc(Q,2);Os(K);var re=hc(K,2),ne=e=>{var t=xG();Il(t,21,(()=>Cw),Tl,((e,t)=>
31{const r=Dl((()=>yu(w).filter((e=>e.category===yu(t).key))));var n=Zu(),i=dc(n),o=e=>{var n=bG(),i=dc(n),o=uc(i,!0);Os(i),Il(hc(i,2),17,(()=>yu(r)),Tl,((e,t)=>{var r=vG();r.__click=()=>{ql(s,yu(t).value,!0),ql(y,!1)};var n=uc(r),i=hc(n,2),o=uc(i,!0);Os(i);var a=hc(i,2),l=uc(a,!0);Os(a),Os(r),Pc((()=>{wd(r,1,"w-full text-left px-2.5 py-1.5 text-xs flex items-center gap-2 hover:bg-gray-50 transition-colors\n                      "+(yu(s)===yu(t).value?"bg-blue-50 text-blue-700 font-medium":"text-gray-700")),kd(n,`background:${yu(t).color??"#6b7280"??""}`),Ju(o,yu(t).label),Ju(l,yu(t).fullName)})),Yu(e,r)})),Pc((()=>Ju(o,yu(t).label))),Yu(e,n)};ad(i,(e=>{yu(r).length>0&&e(o)})),Yu(e,n)})),Os(t),Yu(e,t)};ad(re,(e=>{yu(y)&&e(ne)})),Os(X),nh(X,(e=>ql(_,e)),(()=>yu(_)));var ie=hc(X,2),oe=e=>{var t=TG(),r=dc(t);Il(r,20,(()=>[{key:"line",label:"Mean"},{key:"candlestick",label:"Candlestick"},{key:"cv",label:"CV"}]),Tl,((e,t)=>{var r=wG(),n=uc(r);n.__click=()=>ql(h,t.key,!0);var i=uc(n,!0);Os(n),Os(r),Pc((()=>{wd(n,1,"px-2 py-0.5 text-[10px] font-medium transition-colors "+(yu(h)===t.key?"bg-purple-600 text-white":"bg-white text-gray-500 hover:bg-gray-50")),Ju(i,t.label)})),Yu(e,r)})),Os(r);var n=hc(r,2),i=e=>{var t,r=kG();r.__change=e=>ql(m,Number(e.target.value),!0),Il(r,20,(()=>[7,14,30,60,90]),Tl,((e,t)=>
31{var r=SG(),n=uc(r);Os(r);var i={};Pc((()=>{Ju(n,`${t??""}d`),i!==(i=t)&&(r.value=(r.__value=t)??"")})),Yu(e,r)})),Os(r),Id(r),Pc((()=>{t!==(t=yu(m))&&(r.value=(r.__value=yu(m))??"",Td(r,yu(m)))})),Yu(e,r)};ad(n,(e=>{"cv"===yu(h)&&e(i)})),Yu(e,t)};ad(ie,(e=>{yu(I)&&yu(u).length>0&&e(oe)})),Os(W);var ae=hc(W,2),se=e=>{var t=MG(),r=dc(t),n=uc(r),i=uc(n);Os(n);var o=hc(n,2),a=hc(uc(o)),s=uc(a,!0);Os(a),Os(o);var l=hc(o,4),c=hc(uc(l)),u=uc(c,!0);Os(c),Os(l);var d=hc(l,4),h=hc(uc(d)),p=uc(h,!0);Os(h),Os(d),hc(d,2).__click=()=>ql(f,!yu(f)),Os(r);var g=hc(r,2),m=e=>{var t=IG(),r=uc(t);hc(uc(r),2).__click=()=>ql(f,!1),Os(r),Ds(4),Os(t),Yu(e,t)};ad(g,(e=>{yu(f)&&e(m)})),Pc(((e,t,r)=>{Ju(i,`Latest (${yu(j).window_dates_count??""} dates):`),Ju(s,e),Ju(u,t),Ju(p,r)}),[()=>yu(j).mean_pixel_temporal_cv.toFixed(3),()=>yu(j).field_temporal_cv.toFixed(3),()=>yu(j).churn_ratio.toFixed(2)]),Yu(e,t)};ad(ae,(e=>{"cv"===yu(h)&&yu(j)&&e(se)}));var le=hc(ae,2),ce=e=>{const t=Dl((()=>yu(v)?.color??"#6b7280")),r=Dl((()=>yu(v)?.backgroundColor??"rgba(107, 114, 128, 0.1)"));{let n=Dl((()=>yu(I)&&"line"!==yu(h))),i=Dl((()=>"cv"===yu(h)?"%":"")),o=Dl((()=>"cv"===yu(h)?1:2)),a=Dl((()=>"cv"===yu(h)?0:yu(x).min)),s=Dl((()=>"cv"===yu(h)?yu(N):yu(x).max)),l=Dl((()=>"cv"===yu(h)?{min:0,max:yu(B)}:void 0)),c=Dl((()=>yu(I)&&"candlestick"===yu(h)?[{label:"Mean",data:yu(D).mean,type:"line",color:yu(t),borderColor:yu(t),borderWidth:2,tension:.3,fill:!1,pointRadius:4,pointHoverRadius:6,pointColors:yu($)},{label:"95% CI",data:yu(D).ciUpper,type:"line",color:`${yu(t)}4D`,borderColor:`${yu(t)}4D`,backgroundColor:`${yu(t)}1F`,borderWidth:1,tension:.3,fill:"+1",pointRadius:0,pointHoverRadius:0,borderDash:[3,3]},{label:"95% CI Lower",data:yu(D).ciLower,type:"line",color:`${yu(t)}4D`,borderColor:`${yu(t)}4D`,borderWidth:1,tension:.3,fill:!1,pointRadius:0,pointHoverRadius:0,borderDash:[3,3],hiddenInLegend:!0},{label:"Min",data:yu(D).min,type:"line",color:`${yu(t)}26`,borderColor:`${yu(t)}26`,borderWidth:1,tension:.3,fill:!1,pointRadius:0,pointHoverRadius:0,isWhisker:!0},{label:"Max",data:yu(D).max,type:"line",color:`${yu(t)}26`,borderColor:`${yu(t)}26`,borderWidth:1,tension:.3,fill:!1,pointRadius:0,pointHoverRadius:0,isWhisker:!0}]:yu(I)&&"cv"===yu(h)?[{label:"Spatial CV",data:yu(D).cv,type:"line",color:"#d97706",borderColor:"#d97706",backgroundColor:"rgba(217, 119, 6, 0.08)",borderWidth:2.5,tension:.3,fill:!0,pointRadius:3,pointHoverRadius:5},{label:`Pixel Temporal CV (${yu(m)}d)`,data:yu(z).pixelCV.map((e=>null!=e?100*e:null)),type:"line",color:"#ef4444",borderColor:"#ef4444",borderWidth:1.5,tension:.3,fill:!1,pointRadius:2,pointHoverRadius:4},{label:`Field Temporal CV (${yu(m)}d)`,data:yu(z).fieldCV.map((e=>null!=e?100*e:null)),type:"line",color:"#3b82f6",borderColor:"#3b82f6",borderWidth:1.5,tension:.3,fill:!1,pointRadius:2,pointHoverRadius:4,borderDash:[5,3]},{label:"Churn",data:yu(z).churn,type:"line",color:"#7c3aed",borderColor:"#7c3aed",borderWidth:1.5,tension:.3,fill:!1,pointRadius:2,pointHoverRadius:4,borderDash:[2,2],yAxisID:"y2"}]:[{label:yu(v)?.label??"NDVI",data:yu(V),type:"line",color:yu(t),borderColor:yu(t),backgroundColor:yu(r),borderWidth:2,tension:.3,fill:!0,pointRadius:4,pointHoverRadius:6,pointColors:yu($)}]));_G(e,{get labels(){return yu(L).labels},get loading(){return yu(G)},get legend(){return yu(n)},title:null,height:"250px",get unit(){return yu(i)},get decimals(){return yu(o)},get yMin(){return yu(a)},get yMax(){return yu(s)},get y2(){return yu(l)},get series(){return yu(c)}})}},ue=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,EG())},i=e=>{Yu(e,PG())};ad(r,(e=>{yu(G)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(le,(e=>{yu(U)?e(ce):e(ue,!1)})),Os(q);var de=hc(q,2),he=uc(de),fe=hc(uc(he),2);kd(fe,"background:#059669");var pe=uc(fe);Os(fe),Os(he),Os(de);var ge=hc(de,2);{let e=Dl((()=>[{label:"Precipitation",data:yu(L).precipitation.cumulative,type:"line",color:n,borderColor:n,backgroundColor:"rgba(128, 128, 128, 0.1)",borderWidth:2,tension:.3,fill:!0,pointRadius:0,pointHoverRadius:4}]));_G(ge,{get labels(){return yu(L).labels},get loading(){return yu(o)},legend:!1,title:null,height:"250px",showCumulativeTooltips:!0,get series(){return yu(e)}})}var me=hc(ge,2),ye=uc(me),_e=hc(uc(ye),2);kd(_e,"background:#a259e6");var ve=uc(_e);Os(_e),Os(ye),Os(me);var be=hc(me,2);{let e=Dl((()=>[{label:"Irrigation",data:yu(L).irrigation.cumulative,type:"line",color:r,borderColor:r,backgroundColor:"rgba(128, 128, 128, 0.1)",borderWidth:2,tension:.3,fill:!0,pointRadius:0,pointHoverRadius:4,isIrrigation:!0}]));_G(be,{get labels(){return yu(L).labels},get loading(){return yu(o)},legend:!1,title:null,height:"250px",showCumulativeTooltips:!0,get series(){return yu(e)}})}Os(H),Pc(((e,t)=>{Ju(Y,`(${yu(I)?"ClearSky":"Standard"})`),kd(J,`background:${yu(v)?.color??"#6b7280"??""}`),Ju(ee,yu(v)?.label??"NDVI"),wd(te,0,"w-3 h-3 text-gray-400 "+(yu(y)?"rotate-180":"")),Ju(pe,`${e??""} mm`),Ju(ve,`${t??""} mm`)}),[()=>Math.round(yu(L).precipitation.total),()=>Math.round(yu(L).irrigation.total)]),Yu(e,H),Ys()}function RG(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */RG=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(t,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return l(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");
vendor: 4,840 bytes, line 31
31if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=u(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d={};function h(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==r&&n.call(y,o)&&(g=y);var _=p.prototype=h.prototype=Object.create(g);function v(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==FG(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;l(this,"_invoke",(function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function x(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,x(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function w(e){this.tryEntries.push(e)}function S(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(e){this.tryEntries=[[-1]],e.forEach(w,this),this.reset(!0)}function T(t){if(null!=t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(FG(t)+" is not iterable")}return f.prototype=p,l(_,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},v(b.prototype),l(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(c(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(_),l(_,s,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,l=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!l&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<l)return this.method="next",this.arg=e,n(l),!0;if(s<c)return n(c),!1}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===e||"continue"===e)&&i[0]<=t&&t<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];
31if(r[2]===e)return this.complete(r[4],r[3]),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r[0]===e){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:T(t),r,n},"next"===this.method&&(this.arg=e),d}},t}function LG(e){return function(e){if(Array.isArray(e))return jG(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||BG(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OG(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function DG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OG(Object(r),!0).forEach((function(t){zG(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OG(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=FG(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=FG(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==FG(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FG(e){return FG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FG(e)}function NG(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=BG(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function BG(e,t){if(e){if("string"==typeof e)return jG(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jG(e,t):void 0}}function jG(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function VG(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function GG(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){VG(o,n,i,a,s,"next",e)}function s(e){VG(o,n,i,a,s,"throw",e)}a(void 0)}))}}Bu(["click","change"]);var UG=new Set(["ndmi"]);function $G(e){var t=e.detail||e.error||JSON.stringify(e);return"string"==typeof t&&t.includes("500 Server Error")?"The external VRI API service is currently unavailable. Please try again in a few moments, or contact support if the issue persists.":Array.isArray(e)&&e.length>0&&(t=e[0]).includes("500 Server Error")?"The external VRI API service is currently unavailable. Please try again in a few moments.":t}function HG(e){return e?"?force=true":""}function qG(e,t){t.farmFieldId&&(e.farm_field_id=t.farmFieldId),t.imageryDate&&(e.imagery_date=t.imageryDate),t.cropZoneId&&(e.crop_zone_id=t.cropZoneId)}function WG(e,t){null!=t.minIrrigationPct&&(e.min_irrigation_pct=t.minIrrigationPct),null!=t.maxIrrigationPct&&(e.max_irrigation_pct=t.maxIrrigationPct),null!=t.targetMinPct&&null!=t.targetMaxPct&&(e.target_min_pct=t.targetMinPct,e.target_max_pct=t.targetMaxPct),null!=t.fieldIrrigationVolume&&(e.field_irrigation_volume=t.fieldIrrigationVolume)}function ZG(e,t){t&&(t.method&&(e.method=t.method),null!=t.signals&&(e.signals=t.signals),null!=t.shrinkageAlpha&&
31(e.shrinkage_alpha=t.shrinkageAlpha),null!=t.bufferSizeMeter&&(e.buffer_size_meter=t.bufferSizeMeter))}function YG(){return(YG=GG(RG().mark((function e(t,r){var n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r?"?crop_zone_id=".concat(encodeURIComponent(r)):"",e.next=3,fetch("".concat(bh.basePath,"farms/api/farm-fields/").concat(t,"/msavi-status/").concat(n),{headers:{"X-CSRFToken":bh.csrfToken}});case 3:if((i=e.sent).ok){e.next=6;break}throw new Error("MSAVI status request failed (".concat(i.status,")"));case 6:return e.abrupt("return",i.json());case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var XG=1e-5;function KG(){return KG=GG(RG().mark((function e(t){var r,n,i,o,a;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/api/pivot-irrigation-extents/"),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({field_id:t.id})});case 2:if(!(r=e.sent).ok){e.next=5;break}return e.abrupt("return",r.json());case 5:return e.next=7,fetch("".concat(bh.basePath,"farms/api/pivot-irrigation-extents/"),{headers:{"X-CSRFToken":bh.csrfToken}});case 7:if((n=e.sent).ok){e.next=13;break}return e.next=11,r.json().catch((function(){return{error:"Unknown error"}}));case 11:throw i=e.sent,new Error($G(i));case 13:return e.next=15,n.json();case 15:if(o=e.sent,a=o.find((function(e){return Math.abs(e.center_lng-t.centerLng)<XG&&Math.abs(e.center_lat-t.centerLat)<XG&&Math.abs(e.radius_meters-t.radiusMeters)<1&&e.start_angle===t.startAngle&&e.end_angle===t.endAngle}))){e.next=19;break}throw new Error("Failed to create or find pivot extent for this field");case 19:return e.abrupt("return",a);case 20:case"end":return e.stop()}}),e)}))),KG.apply(this,arguments)}function JG(){return(JG=GG(RG().mark((function e(t){var r,n,i,o;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return qG(r={pivot_extent:t.pivotExtentId,zone_angle:t.zoneAngle,plan_name:t.planName,base_irrigation_amount:t.baseIrrigationAmount},t),WG(r,t),ZG(r,t),null!=t.upsampleFactor&&(r.upsample_factor=t.upsampleFactor),e.next=7,fetch("".concat(bh.basePath,"farms/api/pivot-irrigation-plans/").concat(HG(t.force)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(r)});case 7:if((n=e.sent).ok){e.next=14;break}return e.next=11,n.json().catch((function(){return{error:"Unknown error"}}));case 11:throw i=e.sent,console.error("❌ Pivot API Error (".concat(n.status,"):"),i),new Error($G(i));case 14:return e.next=16,n.json();case 16:return o=e.sent,e.abrupt("return",o);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function QG(e,t,r,n,i,o,a,s,l,c,u){var d={field_id:t,routes:e.map((function(e){var t,r,n=null!==(t=null===(r=e.properties)||void 0===r?void 0:r.id)&&void 0!==t?t:e.id;return{route_id:String(n)}})),zone_height_meter:r,zone_width_meter:n,plan_name_base:l};return i&&(d.farm_field_id=i),o&&(d.reference_date=o),a&&(d.data_source=a),s&&(d.crop_zone_id=s),c&&(d.batch_id=c),null!=(null==u?void 0:u.minIrrigationPct)&&(d.min_irrigation_pct=u.minIrrigationPct),null!=(null==u?void 0:u.maxIrrigationPct)&&(d.max_irrigation_pct=u.maxIrrigationPct),null!=(null==u?void 0:u.targetMinPct)&&null!=(null==u?void 0:u.targetMaxPct)&&(d.target_min_pct=u.targetMinPct,d.target_max_pct=u.targetMaxPct),null!=(null==u?void 0:u.fieldIrrigationVolume)&&(d.field_irrigation_volume=u.fieldIrrigationVolume),ZG(d,u),d}function eU(e,t){var r,n=new Map,i=NG(t);try{for(i.s();!(r=i.n()).done;){var o,a,s,l=r.value,c=null!==(o=null===(a=l.properties)||void 0===a?void 0:a.id)&&void 0!==o?o:l.id,u=(null===(s=l.properties)||void 0===s?void 0:s.name)||"Route ".concat(c);n.set(String(c),u)}}catch(e){i.e(e)}finally{i.f()}var d=null==e?void 0:e.upstream;return Array.isArray(d)?d.map((function(e){var t,r;return{routeName:n.get(String(null!==(t=null==e?void 0:e.route_id)&&void 0!==t?t:""))||"Route ".concat(null!==(r=null==e?void 0:e.route_id)&&void 0!==r?r:"?"),error:(null==e?void 0:e.reason)||(null==e?void 0:e.detail)||"Validation failed"}})):d&&"object"===FG(d)&&Array.isArray(d.detail)?d.detail.map((function(e){var t,r;return{routeName:n.get(String(null!==(t=null==e?void 0:e.route_id)&&void 0!==t?t:""))||"Route ".concat(null!==(r=null==e?void 0:e.route_id)&&void 0!==r?r:"?"),error:(null==e?void 0:e.reason)||(null==e?void 0:e.msg)||"Validation failed"}})):[{routeName:"All routes",error:$G(e)}]}function tU(){return tU=GG(RG().mark((function e(t,r,n,i){var o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x=arguments;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=x.length>4&&void 0!==x[4]?x[4]:40,s=x.length>5&&void 0!==x[5]?x[5]:70,l=x.length>6?x[6]:void 0,c=x.length>7?x[7]:void 0,u=x.length>8?x[8]:void 0,d=x.length>9?x[9]:void 0,h=x.length>10?x[10]:void 0,f=x.length>11?x[11]:void 0,p=x.length>12?x[12]:void 0,t.length){e.next=11;break}return e.abrupt("return",{success:!1,plans:[],totalCount:0,successCount:0,failureCount:0,baseIrr
31igationAmount:i,errors:[{routeName:"All routes",error:"No routes selected"}]});case 11:return g=QG(t,r,a,s,c,u,d,f,n,l,p),e.next=14,fetch("".concat(bh.basePath,"farms/api/hose-reel-irrigation-plans/batch/").concat(HG(h)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(g)});case 14:if((m=e.sent).ok){e.next=21;break}return e.next=18,m.json().catch((function(){return{error:"Unknown error"}}));case 18:return y=e.sent,console.error("❌ Hose reel batch API Error (".concat(m.status,"):"),y),e.abrupt("return",{success:!1,plans:[],totalCount:t.length,successCount:0,failureCount:t.length,baseIrrigationAmount:i,errors:eU(y,t)});case 21:return e.next=23,m.json();case 23:return _=e.sent,v=_.plan_ids||{},b=(_.configurations||[]).map((function(e){var t,r,i=v[e.route_id];return{id:null!=i?i:0,name:"".concat(n," - ").concat(e.route_id),zones_geojson:{type:"FeatureCollection",features:null!==(t=e.features)&&void 0!==t?t:[],properties:{route_id:e.route_id,total_zones:e.total_zones,total_area_m2:e.total_area_m2,weighted_avg_irrigation_percentage:e.weighted_avg_irrigation_percentage,total_baseline_irrigation_m3:e.total_baseline_irrigation_m3,total_recommended_irrigation_m3:e.total_recommended_irrigation_m3,total_irrigation_difference_m3:e.total_irrigation_difference_m3,total_irrigation_savings_percentage:e.total_irrigation_savings_percentage}},created_at:void 0,imagery_date:u,batch_id:null!==(r=_.batch_id)&&void 0!==r?r:l,route_id:Number(e.route_id)}})),e.abrupt("return",{success:b.length>0,plans:b,totalCount:t.length,successCount:b.length,failureCount:t.length-b.length,baseIrrigationAmount:i,imageryDate:(null===(o=_.properties)||void 0===o?void 0:o.reference_date_used)||u,errors:[],batchProperties:_.properties,configurations:_.configurations});case 27:case"end":return e.stop()}}),e)}))),tU.apply(this,arguments)}function rU(){return(rU=GG(RG().mark((function e(t){var r,n,i,o;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return qG(r={drip_boundary:t.dripBoundaryId,plan_name:t.planName,field:t.fieldId},t),WG(r,t),ZG(r,t),e.next=6,fetch("".concat(bh.basePath,"farms/api/drip-irrigation-plans/").concat(HG(t.force)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(r)});case 6:if((n=e.sent).ok){e.next=13;break}return e.next=10,n.json().catch((function(){return{error:"Unknown error"}}));case 10:throw i=e.sent,console.error("❌ Drip API Error (".concat(n.status,"):"),i),new Error($G(i));case 13:return e.next=15,n.json();case 15:return o=e.sent,e.abrupt("return",o);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nU(){return(nU=GG(RG().mark((function e(t){var r,n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return qG(r={pivot_extent:t.pivotExtentId,zone_angle:t.zoneAngle,plan_name:t.planName,base_irrigation_amount:t.baseIrrigationAmount},t),WG(r,t),ZG(r,t),null!=t.upsampleFactor&&(r.upsample_factor=t.upsampleFactor),e.next=7,fetch("".concat(bh.basePath,"farms/api/pivot-irrigation-plans/preview/").concat(HG(t.force)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(r)});case 7:if((n=e.sent).ok){e.next=13;break}return e.next=11,n.json().catch((function(){return{error:"Unknown error"}}));case 11:throw i=e.sent,new Error($G(i));case 13:return e.abrupt("return",n.json());case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function iU(){return(iU=GG(RG().mark((function e(t){var r,n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return qG(r={drip_boundary:t.dripBoundaryId,plan_name:t.planName,field:t.fieldId},t),WG(r,t),ZG(r,t),e.next=6,fetch("".concat(bh.basePath,"farms/api/drip-irrigation-plans/preview/").concat(HG(t.force)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(r)});case 6:if((n=e.sent).ok){e.next=12;break}return e.next=10,n.json().catch((function(){return{error:"Unknown error"}}));case 10:throw i=e.sent,new Error($G(i));case 12:return e.abrupt("return",n.json());case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oU(){return oU=GG(RG().mark((function e(t,r,n,i){var o,a,s,l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T,I,M=arguments;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=M.length>4&&void 0!==M[4]?M[4]:40,s=M.length>5&&void 0!==M[5]?M[5]:70,l=M.length>6?M[6]:void 0,c=M.length>7?M[7]:void 0,u=M.length>8&&void 0!==M[8]&&M[8],d=M.length>9?M[9]:void 0,h=M.length>10?M[10]:void 0,f=M.length>11?M[11]:void 0,t.length){e.next=10;break}return e.abrupt("return",{success:!1,zonesGeojson:{type:"FeatureCollection",features:[]}
31,baseIrrigationAmount:i,errors:[{routeName:"All routes",error:"No routes selected"}]});case 10:return p=QG(t,r,a,s,l,c,d,h,n,void 0,f),e.next=13,fetch("".concat(bh.basePath,"farms/api/hose-reel-irrigation-plans/preview-batch/").concat(HG(u)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(p)});case 13:if((g=e.sent).ok){e.next=19;break}return e.next=17,g.json().catch((function(){return{error:"Unknown error"}}));case 17:return m=e.sent,e.abrupt("return",{success:!1,zonesGeojson:{type:"FeatureCollection",features:[]},baseIrrigationAmount:i,errors:eU(m,t)});case 19:return e.next=21,g.json();case 21:y=e.sent,_=[],v=NG(y.configurations||[]);try{for(v.s();!(b=v.n()).done;){x=b.value,w=NG(x.features||[]);try{for(w.s();!(S=w.n()).done;)k=S.value,T=k.properties||{},_.push(DG(DG({},k),{},{properties:DG(DG({},T),{},{route_id:x.route_id})}))}catch(e){w.e(e)}finally{w.f()}}}catch(e){v.e(e)}finally{v.f()}return I={type:"FeatureCollection",features:_},y.properties&&(I.properties=DG(DG({},y.properties),{},{route_configurations:y.configurations})),e.abrupt("return",{success:_.length>0,zonesGeojson:I,baseIrrigationAmount:i,imageryDate:(null===(o=y.properties)||void 0===o?void 0:o.reference_date_used)||c,errors:[],batchProperties:y.properties,configurations:y.configurations});case 28:case"end":return e.stop()}}),e)}))),oU.apply(this,arguments)}function aU(){return(aU=GG(RG().mark((function e(t){var r,n,i,o,a;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={pivot_extent:t.pivotExtentId,plan_name:t.planName,min_sector_width:null!==(r=t.minSectorWidth)&&void 0!==r?r:6,angle_increment:null!==(n=t.angleIncrement)&&void 0!==n?n:1},null!=t.upsampleFactor&&(i.upsample_factor=t.upsampleFactor),qG(i,t),WG(i,t),ZG(i,t),e.next=7,fetch("".concat(bh.basePath,"farms/api/pivot-irrigation-plans/sector-speed-control-preview/").concat(HG(t.force)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(i)});case 7:if((o=e.sent).ok){e.next=13;break}return e.next=11,o.json().catch((function(){return{error:"Unknown error"}}));case 11:throw a=e.sent,new Error($G(a));case 13:return e.abrupt("return",o.json());case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sU(){return(sU=GG(RG().mark((function e(t,r,n){var i,o,a;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return qG(i={pivot_extent:t.pivotExtentId,plan_name:t.planName,base_irrigation_amount:t.baseIrrigationAmount,generation_method:"sector_speed_control",selected_config_index:r,sector_speed_control_data:n},t),WG(i,t),ZG(i,t),null!=t.upsampleFactor&&(i.upsample_factor=t.upsampleFactor),e.next=7,fetch("".concat(bh.basePath,"farms/api/pivot-irrigation-plans/").concat(HG(t.force)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(i)});case 7:if((o=e.sent).ok){e.next=14;break}return e.next=11,o.json().catch((function(){return{error:"Unknown error"}}));case 11:throw a=e.sent,console.error("❌ Sector speed control save error (".concat(o.status,"):"),a),new Error($G(a));case 14:return e.abrupt("return",o.json());case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lU(e){return Array.isArray(e)?e:e&&Array.isArray(e.results)?e.results:[]}function cU(){return cU=GG(RG().mark((function e(t){var r,n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t?"?pivot_extent=".concat(t):"",e.next=3,fetch("".concat(bh.basePath,"farms/api/pivot-irrigation-plans/").concat(r),{headers:{"X-CSRFToken":bh.csrfToken}});case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("Failed to fetch saved plans");case 6:return e.next=8,n.json();case 8:return i=e.sent,e.abrupt("return",lU(i));case 10:case"end":return e.stop()}}),e)}))),cU.apply(this,arguments)}function uU(){return uU=GG(RG().mark((function e(t){var r,n;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.length>0?"?routes=".concat(t.join(",")):"",e.next=3,fetch("".concat(bh.basePath,"farms/api/hose-reel-irrigation-plans/batches/").concat(r),{headers:{"X-CSRFToken":bh.csrfToken}});case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("Failed to fetch plan batches");case 6:return e.abrupt("return",n.json());case 7:case"end":return e.stop()}}),e)}))),uU.apply(this,arguments)}function dU(){return(dU=GG(RG().mark((function e(t){var r,n,i,o,a;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/api/hose-reel-irrigation-plans/?batch=").concat(encodeURIComponent(t)),{headers:{"X-CSRFToken":bh.csrfToken}});case 2:if((r=e.sent).ok){e.next=5;break}throw new Error("Failed to fetch batch plans");case 5:return e.next=7,r.json();case 7:return n=e.sent,i=lU(n),o=i.map((function(e){return fU("hose_reel",e.id)})),e.next=12,Promise.all(o);case 12:return a=e.sent,e.abrupt("return",vU(a));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}
31function hU(){return(hU=GG(RG().mark((function e(){var t,r;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(bh.basePath,"farms/api/drip-irrigation-plans/"),{headers:{"X-CSRFToken":bh.csrfToken}});case 2:if((t=e.sent).ok){e.next=5;break}throw new Error("Failed to fetch saved plans");case 5:return e.next=7,t.json();case 7:return r=e.sent,e.abrupt("return",lU(r));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fU(e,t){return pU.apply(this,arguments)}function pU(){return pU=GG(RG().mark((function e(t,r){var n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={pivot:"pivot-irrigation-plans",hose_reel:"hose-reel-irrigation-plans",drip:"drip-irrigation-plans",field_binned:"field-binned-irrigation-plans"},e.next=3,fetch("".concat(bh.basePath,"farms/api/").concat(n[t],"/").concat(r,"/"),{headers:{"X-CSRFToken":bh.csrfToken}});case 3:if((i=e.sent).ok){e.next=6;break}throw new Error("Failed to fetch plan details");case 6:return e.abrupt("return",i.json());case 7:case"end":return e.stop()}}),e)}))),pU.apply(this,arguments)}function gU(){return gU=GG(RG().mark((function e(t){var r,n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null!=t?"?field=".concat(t):"",e.next=3,fetch("".concat(bh.basePath,"farms/api/field-binned-irrigation-plans/").concat(r),{headers:{"X-CSRFToken":bh.csrfToken}});case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("Failed to fetch saved plans");case 6:return e.next=8,n.json();case 8:return i=e.sent,e.abrupt("return",lU(i));case 10:case"end":return e.stop()}}),e)}))),gU.apply(this,arguments)}function mU(){return mU=GG(RG().mark((function e(t,r,n){var i,o,a;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={pivot:"pivot-irrigation-plans",hose_reel:"hose-reel-irrigation-plans",drip:"drip-irrigation-plans",field_binned:"field-binned-irrigation-plans"},e.next=3,fetch("".concat(bh.basePath,"farms/api/").concat(i[t],"/").concat(r,"/"),{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({name:n})});case 3:if((o=e.sent).ok){e.next=9;break}return e.next=7,o.json().catch((function(){return{error:"Unknown error"}}));case 7:throw a=e.sent,new Error($G(a));case 9:case"end":return e.stop()}}),e)}))),mU.apply(this,arguments)}function yU(e){var t=new Date,r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),s=e?" (".concat({pivot:"pivot",hose_reel:"hose reel",drip:"drip",field_binned:"field"}[e],")"):"";return"".concat(r,"-").concat(n,"-").concat(i," ").concat(o,":").concat(a).concat(s)}function _U(e){try{var t="string"==typeof e?JSON.parse(e):e;return"FeatureCollection"===t.type?t:"Feature"===t.type?{type:"FeatureCollection",features:[t]}:Array.isArray(t)?{type:"FeatureCollection",features:t}:null}catch(e){return console.error("Error parsing zones_geojson:",e),null}}function vU(e){var t,r,n,i,o,a,s,l=[],c=[],u=NG(e);try{var d=function(){var e=s.value;if(!e.zones_geojson)return 0;var t=_U(e.zones_geojson);if(!t)return 0;var r=null!=e.route_id?String(e.route_id):"",n=t.features.map((function(e){var t,n=e.properties||{};return DG(DG({},e),{},{properties:DG(DG({},n),{},{route_id:r||(null!==(t=n.route_id)&&void 0!==t?t:"")})})}));l.push.apply(l,LG(n)),c.push({route_id:r,type:"FeatureCollection",features:n,total_zones:e.total_zones,total_area_m2:e.total_area_m2,weighted_avg_irrigation_percentage:e.weighted_avg_irrigation_percentage,total_baseline_irrigation_m3:e.total_baseline_irrigation_m3,total_recommended_irrigation_m3:e.total_recommended_irrigation_m3,total_irrigation_difference_m3:e.total_irrigation_difference_m3,total_irrigation_savings_percentage:e.total_irrigation_savings_percentage})};for(u.s();!(s=u.n()).done;)d()}catch(e){u.e(e)}finally{u.f()}var h=e[0]||{},f=function(e){for(var t=0,r=!1,n=0,i=c;n<i.length;n++){var o=i[n][e];"number"==typeof o&&(t+=o,r=!0)}return r?t:void 0},p=function(e){if(!h.zones_geojson)return null;var t=_U(h.zones_geojson);return null!==(e=null==t?void 0:t.properties)&&void 0!==e?e:null}(),g={farm_field_id:null!==(t=h.farm_field_id)&&void 0!==t?t:null==p?void 0:p.farm_field_id,imagery_date:null!==(r=h.imagery_date)&&void 0!==r?r:null==p?void 0:p.imagery_date,crop_zone_id:null!==(n=h.crop_zone_id)&&void 0!==n?n:null==p?void 0:p.crop_zone_id,method:null!==(i=h.method)&&void 0!==i?i:null==p?void 0:p.method,reference_date_used:null!==(o=h.reference_date_used)&&void 0!==o?o:null==p?void 0:p.reference_date_used,method_metadata:null!==(a=h.method_metadata)&&void 0!==a?a:null==p?void 0:p.method_metadata,total_routes:c.length,total_zones:f("total_zones"),total_area_m2:f("total_area_m2"),total_baseline_irrigation_m3:f("total_baseline_irrigation_m3"),total_recommended_irrigation_m3:f("total_recommended_irrigation_m3"),total_irrigation_difference_m3:f("total_irrigation_difference_m3"),weighted_avg_irrigation_percentage:h.weighted_avg_irrigation_percentage,total_irrigation_savings_percentage:h.total_irrigation_savings_percentage,route_configurations:c};return{type:"FeatureCollection",features:l,properties:g}}function bU(){return(bU=GG(RG().mark((function e(t){var r,n,i,o;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={field_id:t.fieldId,imagery_date:t.imageryDate,plan_name:null!==(r=t.planName)&&void 0!==r?r:"Field Zones Preview"},null!=t.numZones&&(n.num_zones=t.numZones),null!=t.smoothingWindow&&(n.smoothing_window=t.smoothingWindow),null!=t.fieldIrrigationVolume&&(n.field_irrigation_volume=t.fieldIrrigationVolume),t.cropZoneId&&(n.crop_zone_id=t.cropZoneId),t.mode&&(n.mode=t.mode),null!=t.spatialWeight&&(n.spatial_weight=t.spatialWeight),null!=t.valueWeight&&(n.value_weight=t.valueWeight),null!=t.minMarginalR2&&(n.min_marginal_r2=t.minMarginalR2),null!=t.minIrrigationPct&&(n.min_irrigation_pct=t.minIrrigationPct),null!=t.maxIrrigationPct&&(n.max_irrigation_pct=t.maxIrrigationPct),null!=t.targetMinPct&&null!=t.targetMaxPct&&(n.target_min_pct=t.targetMinPct,n.target_max_pct=t.targetMaxPct),ZG(n,t),e.next=15,fetch("".concat(bh.basePath,"farms/api/field-binned-irrigation-plans/preview/"),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(n)});case 15:if((i=e.sent).ok){e.next=21;break}return e.next=19,i.json().catch((function(){return{error:"Unknown error"}}));case 19:throw o=e.sent,new Error($G(o));case 21:return e.abrupt("return",i.json());case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xU(){return(xU=GG(RG().mark((function e(t){var r,n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={field_id:t.fieldId,imagery_date:t.imageryDate},t.planName&&(r.plan_name=t.planName),null!=t.numZones&&(r.num_zones=t.numZones),null!=t.smoothingWindow&&(r.smoothing_window=t.smoothingWindow),null!=t.fieldIrrigationVolume&&(r.field_irrigation_volume=t.fieldIrrigationVolume),t.farmFieldId&&(r.farm_field_id=t.farmFieldId),t.cropZoneId&&(r.crop_zone_id=t.cropZoneId),t.mode&&(r.mode=t.mode),null!=t.spatialWeight&&(r.spatial_weight=t.spatialWeight),null!=t.valueWeight&&(r.value_weight=t.valueWeight),null!=t.minMarginalR2&&(r.min_marginal_r2=t.minMarginalR2),null!=t.minIrrigationPct&&(r.min_irrigation_pct=t.minIrrigationPct),null!=t.maxIrrigationPct&&(r.max_irrigation_pct=t.maxIrrigationPct),null!=t.targetMinPct&&null!=t.targetMaxPct&&(r.target_min_pct=t.targetMinPct,r.target_max_pct=t.targetMaxPct),null!=t.fieldBinnedData&&(r.field_binned_data=t.fieldBinnedData),null!=t.selectedConfigIndex&&(r.selected_config_index=t.selectedConfigIndex),ZG(r,t),e.next=19,fetch("".concat(bh.basePath,"farms/api/field-binned-irrigation-plans/").concat(HG(t.force)),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(r)});case 19:if((n=e.sent).ok){e.next=25;break}return e.next=23,n.json().catch((function(){return{error:"Unknown error"}}));case 23:throw i=e.sent,new Error($G(i));case 25:return e.abrupt("return",n.json());case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wU(){return(wU=GG(RG().mark((function e(t){var r,n,i;return RG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={imagery_date:t.imageryDate},null!=t.fieldId&&(r.field_id=t.fieldId),t.farmFieldId&&(r.farm_field_id=t.farmFieldId),t.cropZoneId&&(r.crop_zone_id=t.cropZoneId),t.method&&(r.method=t.method),t.signals&&(r.signals=t.signals),null!=t.shrinkageAlpha&&
31(r.shrinkage_alpha=t.shrinkageAlpha),null!=t.bufferSizeMeter&&(r.buffer_size_meter=t.bufferSizeMeter),e.next=10,fetch("".concat(bh.basePath,"farms/api/vri-debug/"),{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(r)});case 10:if((n=e.sent).ok){e.next=16;break}return e.next=14,n.json().catch((function(){return{error:"Unknown error"}}));case 14:throw i=e.sent,new Error($G(i));case 16:return e.abrupt("return",n.json());case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function SU(e,t){var r=Gw(e),n=[],i={types:[],pivotExtents:[],hoseReelRoutes:[],dripBoundaries:[]};return t.pivotExtents.forEach((function(e){try{e.geometry&&DF(r,e)&&(i.pivotExtents.push(e),n.includes("pivot")||n.push("pivot"))}catch(e){console.warn("Error checking pivot extent intersection:",e)}})),t.hoseReelRoutes.forEach((function(e){try{e.geometry&&DF(r,e)&&(i.hoseReelRoutes.push(e),n.includes("hose-reel")||n.push("hose-reel"))}catch(e){console.warn("Error checking hose reel route intersection:",e)}})),t.dripBoundaries.forEach((function(e){try{e.geometry&&DF(r,e)&&(i.dripBoundaries.push(e),n.includes("drip")||n.push("drip"))}catch(e){console.warn("Error checking drip boundary intersection:",e)}})),i.types=n,i}var kU=$u('<p class="text-xs text-gray-500 mb-2"> </p>'),TU=$u('<!> <p class="text-sm text-gray-700 leading-relaxed"> </p>',1),IU=$u('<li class="text-sm text-gray-700"><span class="font-medium"></span> </li>'),MU=$u('<ul class="space-y-2"></ul>'),EU=$u('<p class="text-sm text-gray-700 leading-relaxed"> </p>'),PU=$u('<div class="fixed inset-0 z-[2100] flex items-center justify-center bg-black/50"><div class="bg-white rounded-xl shadow-2xl w-full max-w-md mx-4"><div class="px-5 py-4 border-b border-gray-200 flex items-center justify-between"><div class="flex items-center gap-2"><div class="w-8 h-8 rounded-full bg-red-100 flex items-center justify-center flex-shrink-0"><svg class="w-5 h-5 text-red-600" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"></path></svg></div> <h3 class="text-lg font-semibold text-gray-900">Unable to Generate VRI Map</h3></div> <button class="p-1.5 hover:bg-gray-100 rounded-lg transition-colors"><svg class="w-5 h-5 text-gray-500" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div class="px-5 py-4"><!></div> <div class="px-5 py-4 border-t border-gray-200 flex justify-end"><button class="px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium text-sm">OK</button></div></div></div>');function AU(e,t){Zs(t,!0);let r=Dl((()=>t.message?function(e){const t=e.split("; ").filter(Boolean),r=/^\d+\.?:\s*/;if(t.length>1&&t.every((e=>r.test(e)))){const e=[];let n="";for(const r of t){const t=r.match(/^(\d+)\.?:\s*(.*)/);t&&(e.push(t[1]),n||(n=t[2]))}return t.every((e=>{const t=e.match(/^\d+\.?:\s*(.*)/);return t&&t[1]===n}))?{isZoneError:!0,summary:n,zones:e}:{isZoneError:!0,summary:"",zones:t.map((e=>e.replace(r,"").trim()))}}return{isZoneError:!1,summary:e,zones:[]}}(t.message):null));var n=Zu();Nu("keydown",tc,(function(e){"Escape"===e.key&&t.onClose()}));var i=dc(n),o=e=>{var n=PU();n.__click=function(...e){t.onClose?.apply(this,e)};var i=uc(n);i.__click=e=>e.stopPropagation();var o=uc(i);hc(uc(o),2).__click=function(...e){t.onClose?.apply(this,e)},Os(o);var a=hc(o,2),s=uc(a),l=e=>{var t=TU(),n=dc(t),i=e=>{var t=kU(),n=uc(t);Os(t),Pc((e=>Ju(n,`Affected zones: ${e??""}`)),[()=>yu(r).zones.join(", ")]),Yu(e,t)};ad(n,(e=>{yu(r).zones.length>0&&e(i)}));var o=hc(n,2),a=uc(o,!0);Os(o),Pc((()=>Ju(a,yu(r).summary))),Yu(e,t)},c=e=>{var n=Zu(),i=dc(n),o=e=>{var t=MU();Il(t,21,(()=>yu(r).zones),Tl,((e,t,r)=>{var n=IU(),i=uc(n);i.textContent=`Zone ${r+1}:`;var o=hc(i);Os(n),Pc((()=>Ju(o,` ${yu(t)??""}`))),Yu(e,n)})),Os(t),Yu(e,t)},a=e=>{var r=EU(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,t.message))),Yu(e,r)};ad(i,(e=>
31{yu(r)?.isZoneError?e(o):e(a,!1)}),!0),Yu(e,n)};ad(s,(e=>{yu(r)?.isZoneError&&yu(r).summary?e(l):e(c,!1)})),Os(a);var u=hc(a,2);uc(u).__click=function(...e){t.onClose?.apply(this,e)},Os(u),Os(i),Os(n),Yu(e,n)};ad(i,(e=>{t.message&&e(o)})),Yu(e,n),Ys()}function CU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"number"==typeof e&&Number.isFinite(e)?"".concat(e.toFixed(t)).concat(r):"—"}function RU(e){return"number"==typeof e&&Number.isFinite(e)?Math.round(e).toLocaleString():"—"}function LU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return"number"==typeof e&&Number.isFinite(e)?"".concat(e.toFixed(t),"%"):"—"}function OU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return"number"==typeof e&&Number.isFinite(e)?"".concat((e/1e4).toFixed(t)," ha"):"—"}function DU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return"number"==typeof e&&Number.isFinite(e)?"".concat(e>0?"+":"").concat(e.toFixed(t)):"—"}Bu(["click"]);var zU=$u('<div class="text-blue-800 mb-1.5"> </div>'),FU=$u('<section class="rounded-md border border-blue-200 bg-blue-50 p-3 text-xs"><div class="font-semibold text-blue-900 mb-1">Auto-selected index: <span class="inline-flex items-center px-1.5 py-0.5 rounded bg-blue-100 text-blue-800 text-[11px] font-semibold tracking-wide ml-1"> </span> <span class="ml-2 font-normal text-blue-800"> </span></div> <!> <div class="grid grid-cols-2 gap-x-4 text-blue-900"><div><span class="text-blue-700">Field mean NDVI</span> <span class="tabular-nums"> </span></div> <div><span class="text-blue-700">Field mean MSAVI</span> <span class="tabular-nums"> </span></div></div></section>'),NU=$u('<tr class="border-b border-gray-100 last:border-b-0"><td class="py-1 pr-3"> <span class="text-gray-500"> </span> <span> </span></td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1"> </td></tr>'),BU=$u('<section class="rounded-md border border-gray-200 bg-white p-3 text-xs"><div class="font-semibold text-gray-800 mb-2">Per-signal diagnostics</div> <div class="overflow-x-auto"><table class="w-full text-xs"><thead><tr class="text-gray-500 border-b border-gray-200"><th class="text-left font-medium py-1 pr-3">Signal</th><th class="text-right font-medium py-1 pr-3" title="Raw signal mean">μ_raw</th><th class="text-right font-medium py-1 pr-3" title="σ-clipped signal mean">μ_clip</th><th class="text-right font-medium py-1 pr-3">σ_clip</th><th class="text-right font-medium py-1 pr-3">Weight</th><th class="text-right font-medium py-1 pr-3" title="Field-mean relative influence — sums to 100%">Share</th><th class="text-right font-medium py-1 pr-3" title="Field-mean absolute contribution to multiplier (pp)">Contrib (pp)</th><th class="text-right font-medium py-1 pr-3">Dates</th><th class="text-right font-medium py-1" title="Pixels clipped low / high during σ-clip">Clipped lo/hi</th></tr></thead><tbody></tbody></table></div></section>'),jU=$u("<span> </span>"),VU=$u('<div class="flex flex-wrap gap-1"></div>'),GU=$u('<section class="rounded-md border border-gray-200 bg-white p-3 text-xs"><div class="font-semibold text-gray-800 mb-2">Imagery dates</div> <div class="text-gray-600 mb-2">Window <span class="font-medium tabular-nums"> </span> – <span class="font-medium tabular-nums"> </span> <span class="text-gray-400 mx-1">·</span> <span class="font-medium"> </span> fetched\n          / <span class="font-medium"> </span> attempted</div> <!></section>'),UU=$u('<section class="rounded-md border border-gray-200 bg-white p-3 text-xs"><div class="font-semibold text-gray-800 mb-2">Multiplier raster</div> <div class="grid grid-cols-2 sm:grid-cols-4 gap-x-4 gap-y-1"><div><span class="text-gray-500">Range</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">σ</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">% near baseline</span> <span class="font-medium tabular-nums"> </span></div></div></section>'),$U=$u('<section class="rounded-md border border-gray-200 bg-white p-3 text-xs">
31<div class="font-semibold text-gray-800 mb-2">Water mask</div> <div class="flex gap-4 text-gray-700"><div><span class="text-gray-500">Pixels</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">Area</span> <span class="font-medium tabular-nums"> </span></div></div></section>'),HU=$u('<div><span class="text-gray-500"> </span> <span class="font-medium tabular-nums"> </span></div>'),qU=$u('<div class="grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-0.5 mb-2"></div>'),WU=$u('<div class="mb-2"><span class="text-gray-500">Amplitude A</span> <span class="font-medium tabular-nums"> </span></div> <!>',1),ZU=$u('<div class="col-span-full"><span class="text-gray-500">Weights</span> <span class="font-medium tabular-nums"> </span></div>'),YU=$u('<div class="grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-0.5"><div><span class="text-gray-500">μ_S</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">σ_S</span> <span class="font-medium tabular-nums"> </span></div> <!></div>'),XU=$u('<section class="rounded-md border border-gray-200 bg-white p-3 text-xs"><div class="font-semibold text-gray-800 mb-2">Fusion &amp; amplitude</div> <!> <!></section>'),KU=$u('<div class="flex flex-col gap-3"><!> <!> <!> <!> <!> <!></div>');function JU(e,t){Zs(t,!0);const r=Dl((()=>t.audit??{}));var n=Zu(),i=dc(n),o=e=>{var t=KU(),n=uc(t),i=e=>{const t=Dl((()=>yu(r).auto_selection));var n=FU(),i=uc(n),o=hc(uc(i)),a=uc(o,!0);Os(o);var s=hc(o,2),l=uc(s);Os(s),Os(i);var c=hc(i,2),u=e=>{var r=zU(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(t).rule_applied))),Yu(e,r)};ad(c,(e=>{yu(t).rule_applied&&e(u)}));var d=hc(c,2),h=uc(d),f=hc(uc(h),2),p=uc(f,!0);Os(f),Os(h);var g=hc(h,2),m=hc(uc(g),2),y=uc(m,!0);Os(m),Os(g),Os(d),Os(n),Pc(((e,r,n)=>{Ju(a,e),Ju(l,`· tier=${yu(t).tier??"—"??""}`),Ju(p,r),Ju(y,n)}),[()=>yu(t).selected_index?.toUpperCase()??"—",()=>CU(yu(t).field_mean_ndvi,3),()=>CU(yu(t).field_mean_msavi,3)]),Yu(e,n)};ad(n,(e=>{yu(r).auto_selection&&e(i)}));var o=hc(n,2),a=e=>{var t=BU(),n=hc(uc(t),2),i=uc(n),o=hc(uc(i));Il(o,21,(()=>yu(r).per_signal),Tl,((e,t)=>{const r=Dl((()=>yu(t).scalar_diagnostics??{})),n=Dl((()=>yu(t).spec?.sign??yu(r).sign??1));var i=NU(),o=uc(i),a=uc(o),s=hc(a),l=uc(s,!0);Os(s);var c=hc(s,2);let u;var d=uc(c,!0);Os(c),Os(o);var h=hc(o),f=uc(h,!0);Os(h);var p=hc(h),g=uc(p,!0);Os(p);var m=hc(p),y=uc(m,!0);Os(m);var _=hc(m),v=uc(_,!0);Os(_);var b=hc(_),x=uc(b,!0);Os(b);var w=hc(b),S=uc(w,!0);Os(w);var k=hc(w),T=uc(k,!0);Os(k);var I=hc(k),M=uc(I);Os(I),Os(i),Pc(((e,r,i,o,s,h,p,m,_,b)=>{Ju(a,`${e??""} `),Ju(l,yu(t).spec?.mode??""),u=wd(c,1,"ml-1 inline-flex items-center px-1 rounded text-[10px] font-medium tabular-nums",null,u,{"bg-emerald-100":1===yu(n),"text-emerald-800":1===yu(n),"bg-amber-100":-1===yu(n),"text-amber-800":-1===yu(n)}),Fd(c,"title",1===yu(n)?"Vigor (+1) — above-mean pixels get more water"
31:"Deficit (-1) — below-mean pixels get more water (drying → more water)"),Ju(d,1===yu(n)?"↑ vigor":"↓ deficit"),Ju(f,r),Ju(g,i),Ju(y,o),Ju(v,s),Ju(x,h),Ju(S,p),Ju(T,m),Ju(M,`${_??""} / ${b??""}`)}),[()=>yu(t).spec?.index?.toUpperCase()??"—",()=>CU(yu(r).mu_raw,3),()=>CU(yu(r).mu_clipped,3),()=>CU(yu(r).sigma_clipped,3),()=>LU(100*(yu(r).weight??0),0),()=>LU(yu(r).mean_share_pct,0),()=>CU(yu(r).mean_contribution_pp,2),()=>RU(yu(t).raster_inputs?.dates_count),()=>RU(yu(r).pixels_clipped_low),()=>RU(yu(r).pixels_clipped_high)]),Yu(e,i)})),Os(o),Os(i),Os(n),Os(t),Yu(e,t)};ad(o,(e=>{yu(r).per_signal?.length&&e(a)}));var s=hc(o,2),l=e=>{const t=Dl((()=>yu(r).date_window));var n=GU(),i=hc(uc(n),2),o=hc(uc(i)),a=uc(o,!0);Os(o);var s=hc(o,2),l=uc(s,!0);Os(s);var c=hc(s,4),u=uc(c,!0);Os(c);var d=hc(c,2),h=uc(d,!0);Os(d),Ds(),Os(i);var f=hc(i,2),p=e=>{var r=VU();Il(r,21,(()=>yu(t).dates_attempted),Tl,((e,r)=>{const n=Dl((()=>yu(t).dates_fetched?.includes(yu(r))));var i=jU();let o;var a=uc(i,!0);Os(i),Pc((()=>{o=wd(i,1,"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] tabular-nums",null,o,{"bg-green-100":yu(n),"text-green-800":yu(n),"bg-gray-100":!yu(n),"text-gray-500":!yu(n),"line-through":!yu(n)}),Fd(i,"title",yu(n)?"scene fetched":"attempted but unavailable"),Ju(a,yu(r))})),Yu(e,i)})),Os(r),Yu(e,r)};ad(f,(e=>{yu(t).dates_attempted?.length&&e(p)})),Os(n),Pc((()=>{Ju(a,yu(t).start??"—"),Ju(l,yu(t).end??"—"),Ju(u,yu(t).dates_fetched?.length??0),Ju(h,yu(t).dates_attempted?.length??0)})),Yu(e,n)};ad(s,(e=>{yu(r).date_window&&e(l)}));var c=hc(s,2),u=e=>{const t=Dl((()=>yu(r).multiplier.stats));var n=UU(),i=hc(uc(n),2),o=uc(i),a=hc(uc(o),2),s=uc(a);Os(a),Os(o);var l=hc(o,2),c=hc(uc(l),2),u=uc(c,!0);Os(c),Os(l);var d=hc(l,2),h=hc(uc(d),2),f=uc(h,!0);Os(h),Os(d),Os(i),Os(n),Pc(((e,t,r,n)=>{Ju(s,`${e??""} … ${t??""}`),Ju(u,r),Ju(f,n)}),[()=>CU(yu(t).min,3),()=>CU(yu(t).max,3),()=>CU(yu(t).std,3),()=>LU(yu(t).pct_neutral)]),Yu(e,n)};ad(c,(e=>{yu(r).multiplier?.stats&&e(u)}));var d=hc(c,2),h=e=>{const t=Dl((()=>yu(r).water_mask));var n=$U(),i=hc(uc(n),2),o=uc(i),a=hc(uc(o),2),s=uc(a,!0);Os(a),Os(o);var l=hc(o,2),c=hc(uc(l),2),u=uc(c,!0);Os(c),Os(l),Os(i),Os(n),Pc(((e,t)=>{Ju(s,e),Ju(u,t)}),[()=>RU(yu(t).pixel_count),()=>LU(yu(t).area_pct)]),Yu(e,n)};ad(d,(e=>{yu(r).water_mask&&e(h)}));var f=hc(d,2),p=e=>{var t=XU(),n=hc(uc(t),2),i=e=>{var t=WU(),n=dc(t),i=hc(uc(n),2),o=uc(i,!0);Os(i),Os(n);var a=hc(n,2),s=e=>{var t=qU();Il(t,21,(()=>yu(r).amplitude.breakdown),Tl,((e,t)=>
31{var r=HU(),n=uc(r),i=uc(n,!0);Os(n);var o=hc(n,2),a=uc(o,!0);Os(o),Os(r),Pc((e=>{Ju(i,yu(t).signal),Ju(a,e)}),[()=>CU(yu(t).contribution,4)]),Yu(e,r)})),Os(t),Yu(e,t)};ad(a,(e=>{yu(r).amplitude.breakdown?.length&&e(s)})),Pc((e=>Ju(o,e)),[()=>CU(yu(r).amplitude.value,4)]),Yu(e,t)};ad(n,(e=>{yu(r).amplitude&&e(i)}));var o=hc(n,2),a=e=>{var t=YU(),n=uc(t),i=hc(uc(n),2),o=uc(i,!0);Os(i),Os(n);var a=hc(n,2),s=hc(uc(a),2),l=uc(s,!0);Os(s),Os(a);var c=hc(a,2),u=e=>{var t=ZU(),n=hc(uc(t),2),i=uc(n);Os(n),Os(t),Pc((e=>Ju(i,`[${e??""}]`)),[()=>yu(r).fusion.weights.map((e=>e.toFixed(2))).join(", ")]),Yu(e,t)};ad(c,(e=>{yu(r).fusion.weights?.length&&e(u)})),Os(t),Pc(((e,t)=>{Ju(o,e),Ju(l,t)}),[()=>CU(yu(r).fusion.mu_S,4),()=>CU(yu(r).fusion.sigma_S,4)]),Yu(e,t)};ad(o,(e=>{yu(r).fusion&&e(a)})),Os(t),Yu(e,t)};ad(f,(e=>{(yu(r).fusion||yu(r).amplitude)&&e(p)})),Os(t),Yu(e,t)};ad(i,(e=>{t.audit&&e(o)})),Yu(e,n),Ys()}var QU=$u('<div class="rounded border border-gray-100 bg-white p-2" style="height: 260px"><div class="relative w-full h-full"><canvas class="absolute inset-0 w-full h-full"></canvas></div></div>');function e$(e,t){Zs(t,!0);let r=null,n=$l(null);function i(e,r){const[n,i]=t.optram.ndvi_range;return[{x:n,y:r+e*n},{x:i,y:r+e*i}]}Tc((()=>{yu(n)&&t.optram&&function(){if(!yu(n))return;r&&r.destroy();const e=yu(n).getContext("2d");if(!e)return;const{dry_slope:o,dry_intercept:a,wet_slope:s,wet_intercept:l}=t.optram.edges;r=new La(e,{type:"scatter",data:{datasets:[{label:"Pixels",type:"scatter",data:t.optram.scatter.map((([e,t])=>({x:e,y:t}))),backgroundColor:"rgba(100, 116, 139, 0.35)",pointRadius:1.5,pointHoverRadius:3},{label:"Dry edge",type:"line",data:i(o,a),borderColor:"#dc2626",backgroundColor:"#dc2626",borderWidth:2,pointRadius:0},{label:"Wet edge",type:"line",data:i(s,l),borderColor:"#2563eb",backgroundColor:"#2563eb",borderWidth:2,pointRadius:0},{label:"Dry anchors",type:"scatter",data:t.optram.anchors.map((e=>({x:e.ndvi,y:e.dry_str}))),backgroundColor:"#dc2626",pointStyle:"crossRot",pointRadius:3},{label:"Wet anchors",type:"scatter",data:t.optram.anchors.map((e=>({x:e.ndvi,y:e.wet_str}))),backgroundColor:"#2563eb",pointStyle:"crossRot",pointRadius:3}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"top",labels:{boxWidth:12,font:{size:11}}},tooltip:{callbacks:{label:e=>{const t=e.parsed.x.toFixed(3),r=e.parsed.y.toFixed(3);return`${e.dataset.label}: (NDVI ${t}, STR ${r})`}}}}
31,scales:{x:{type:"linear",min:t.optram.ndvi_range[0],max:t.optram.ndvi_range[1],title:{display:!0,text:"NDVI"}},y:{type:"linear",title:{display:!0,text:"STR"}}}}})}()})),Tc((()=>()=>{r&&r.destroy()}));var o=QU(),a=uc(o);nh(uc(a),(e=>ql(n,e)),(()=>yu(n))),Os(a),Os(o),Yu(e,o),Ys()}var t$=$u('<div class="flex flex-col items-center justify-center py-12 gap-3"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div> <div class="text-sm text-gray-600">Loading debug data…</div> <div class="text-[11px] text-gray-400">Payload can be large (~25 MB).</div></div>'),r$=$u('<div class="text-sm text-red-700 bg-red-50 border border-red-200 rounded-md p-3"> </div>'),n$=$u('<span class="text-[10px] text-gray-500 uppercase"> </span>'),i$=$u('<div class="text-[10px] text-gray-600 truncate"> </div>'),o$=$u('<canvas class="max-w-full max-h-full" style="image-rendering: pixelated; image-rendering: crisp-edges;"></canvas>'),a$=$u('<span class="text-[11px] text-gray-400">no raster</span>'),s$=$u('<div class="flex justify-between text-[9px] font-mono text-gray-400 px-0.5"><span> </span> <span> </span></div>'),l$=$u('<span class="text-gray-400">z</span> <span> </span>',1),c$=$u('<span class="text-gray-400">·</span> <span> </span>',1),u$=$u('<span class="inline-flex items-center gap-1.5 px-1.5 py-0.5 rounded border border-gray-300 bg-white text-[10px] font-mono tabular-nums shadow-sm"><span class="font-semibold text-blue-700"> </span> <!> <!></span>'),d$=$u('<div class="relative h-3 text-[9px] font-mono text-gray-400 px-0.5"><span class="absolute -translate-x-1/2 tabular-nums"> </span> <span class="absolute -translate-x-1/2 tabular-nums"> </span> <span class="absolute -translate-x-1/2 tabular-nums font-medium text-gray-600"> </span> <span class="absolute -translate-x-1/2 tabular-nums"> </span> <span class="absolute -translate-x-1/2 tabular-nums"> </span></div> <div class="h-5 flex items-center justify-center"><!></div>',1),h$=$u('<div class="flex flex-col gap-0.5"><canvas class="w-full rounded-sm" style="height: 40px;"></canvas> <!></div>'),f$=$u('<div class="border border-gray-200 rounded-md bg-gray-50 p-2 flex flex-col gap-1.5" style="width: 256px;"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-1.5 min-w-0"><span class="inline-flex items-center px-1.5 py-0.5 rounded bg-blue-100 text-blue-800 text-[10px] font-semibold tracking-wide"> </span> <!></div> <span class="text-[10px] text-gray-400 truncate"> </span></div> <!> <div class="bg-white border border-gray-200 rounded flex justify-center items-center overflow-hidden" style="height: 200px;"><!></div> <!> <div class="rounded bg-white border border-gray-200 px-2 py-1.5 text-gray-700 flex flex-col gap-1.5"><div class="grid grid-cols-3 gap-2"><div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">Mean</div> <div class="text-xs font-mono font-medium tabular-nums"> </div></div> <div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">Std</div> <div class="text-xs font-mono font-medium tabular-nums"> </div></div> <div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">Pixels</div> <div class="text-xs font-mono font-medium tabular-nums"> </div></div></div> <div class="grid grid-cols-5 gap-1 pt-1 border-t border-gray-100"><div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">Min</div> <div class="text-[11px] font-mono tabular-nums text-gray-600"> </div></div> <div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">p5</div> <div class="text-[11px] font-mono tabular-nums text-gray-600"> </div></div> <div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">p50</div> <div class="text-[11px] font-mono tabular-nums font-medium text-gray-700"> </div></div> <div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">p95</div> <div class="text-[11px] font-mono tabular-nums text-gray-600"> </div></div> <div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight">Max</div> <div class="text-[11px] font-mono tabular-nums text-gray-600"> </div></div></div></div> <div class="text-[9px] text-gray-400 font-mono truncate"> </div></div>'),p$=$u('<section><div class="flex items-baseline gap-2 mb-2 border-b border-gray-200 pb-1.5"><h3 class="text-sm font-semibold text-gray-800"> </h3> <span class="text-[11px] text-gray-500"> </span></div> <div class="flex flex-wrap gap-3"></div></section>'),g$=$u('<div><div class="text-[9px] uppercase tracking-wide text-gray-400 leading-tight"> </div> <div class="text-[11px] font-mono tabular-nums text-gray-600"> </div></div>'),m$=$u('<section class="mt-5">
31<h3 class="text-sm font-semibold text-gray-800 mb-2 border-b border-gray-200 pb-1">OPTRAM trapezoid</h3> <!> <div class="flex flex-wrap gap-x-5 gap-y-1 mt-2"></div></section>'),y$=$u('<div class="text-[11px] text-amber-700 bg-amber-50 border border-amber-200 rounded-md px-2 py-1 mb-2">Output truncated — large keys (e.g. <code>raster_grid</code>) are omitted to keep the page responsive.</div>'),_$=$u('<!> <pre class="text-[11px] bg-gray-50 border border-gray-200 rounded-md p-3 mb-3 overflow-auto max-h-96"> </pre>',1),v$=$u('<div class="mt-5"><h3 class="text-sm font-semibold text-gray-800 mb-2 border-b border-gray-200 pb-1">Audit diagnostics</h3> <!> <button type="button" class="text-xs text-blue-600 hover:text-blue-800 mt-3 mb-2"> </button> <!></div>'),b$=$u('<div class="flex items-center gap-3 mb-4 text-sm text-gray-700"><span><span class="font-medium">Method:</span> </span> <span class="text-gray-400">&bull;</span> <span><span class="font-medium">Reference date used:</span> </span> <span class="text-gray-400">&bull;</span> <span><span class="font-medium">Stages:</span> </span></div> <div class="flex flex-col gap-5"></div> <!> <!>',1),x$=$u('<div role="dialog" aria-modal="true" aria-label="Admin VRI" tabindex="-1" class="fixed inset-0 z-[1200] bg-black/50 flex items-start justify-center overflow-y-auto py-8"><div class="bg-white rounded-xl shadow-2xl w-full max-w-6xl mx-4 p-6 relative"><button type="button" class="absolute top-4 right-4 text-gray-400 hover:text-gray-600 w-8 h-8 flex items-center justify-center text-2xl font-light hover:bg-gray-100 rounded-lg transition-colors" title="Close" aria-label="Close Admin VRI">&times;</button> <h2 class="text-lg font-semibold text-gray-900 mb-1">Admin VRI — per-pixel pipeline trace</h2> <p class="text-xs text-gray-500 mb-3">Diagnostic view of the underlying data the VRI pipeline used. Read-only — does not generate a plan.</p> <div class="flex items-center gap-2 mb-4 text-[11px] text-gray-600"><span class="text-gray-500">Colour key</span> <span class="tabular-nums text-rose-700">below mean</span> <canvas class="rounded-sm border border-gray-200" style="width: 240px; height: 10px;" title="RdBu ramp — red = below the stage\'s mean, white = at the mean, blue = above. Applied to every stage. Each tile\'s numeric range is printed under its histogram."></canvas> <span class="tabular-nums text-blue-700">above mean</span> <span class="text-gray-400">— anchor (white) is each stage\'s mean</span></div> <!></div></div>');function w$(e,t){Zs(t,!0);const r=fh(t,"farmFieldId",3,null),n=fh(t,"cropZoneId",3,null),i=fh(t,"signals",3,null),o=fh(t,"shrinkageAlpha",3,null),a=fh(t,"bufferSizeMeter",3,null);let s=$l(!1),l=$l(null),c=$l(null),u=$l(!1),d=$l(null),h=$l(!1);const f=Jl({}),p=5e5,g=new Set(["raster_grid"]);function m(){if(!yu(u)&&yu(c)?.audit&&null===yu(d)){const e=function(e){const t={};for(const[r,n]of Object.entries(e))t[r]=g.has(r)?"[omitted — too large to render]":n;let r;try{r=JSON.stringify(t,null,2)}catch{return{text:"[failed to stringify audit]",truncated:!1}}return r.length>p?{text:`${r.slice(0,p)}\n…[truncated]`,truncated:!0}:{text:r,truncated:!1}}(yu(c).audit);ql(d,e.text,!0),ql(h,e.truncated,!0)}ql(u,!yu(u))}const y=new Set(["ndvi","msavi","ndmi","ndre","cire","evi","gndvi","msi","ndwi","savi","lai","fapar","fcover"]);function _(e){const t=e.id.split("_").filter(Boolean);t.length&&/^\d+$/.test(t[0])&&t.shift();let r=null;t.length&&y.has(t[0].toLowerCase())&&(r=t.shift().toUpperCase());let n=null;!t.length||"value"!==t[0]&&"slope"!==t[0]||(n=t.shift());return{index:r,mode:n,step:t.join("_")||"other"}}const v=["raw","clipped","z","share_pct","contribution_pp","fused","fused_standardised","multiplier","water_mask","smoothed","composite","stability","anomaly","deficit","productivity","fusion","amplitude","other"];function b(e){return{raw:"Raw",clipped:"σ-clipped",z:"Z-score",share_pct:"Share %",contribution_pp:"Contribution (pp)",fused:"Fused",fused_standardised:"Fused (standardised)",multiplier:"Final multiplier",water_mask:"Water mask",smoothed:"Smoothed",composite:"Composite",stability:"Stability",anomaly:"Anomaly",deficit:"Deficit",productivity:"Productivity",fusion:"Fusion",amplitude:"Amplitude",other:"Other"}[e]??e.replace(/_/g," ")}const x=Dl((()=>
31{if(!yu(c))return[];const e=new Map;for(const t of yu(c).stages){const{step:r}=_(t);e.has(r)||e.set(r,[]),e.get(r).push(t)}const t=[],r=[];for(const[n,i]of e.entries()){const e={step:n,label:b(n),stages:i};v.includes(n)?t.push(e):r.push(e)}return t.sort(((e,t)=>v.indexOf(e.step)-v.indexOf(t.step))),r.sort(((e,t)=>e.step.localeCompare(t.step))),[...t,...r]}));function w(e){e.target===e.currentTarget&&t.onClose()}Tc((()=>{t.open&&(ql(s,!0),ql(l,null),ql(c,null),ql(d,null),ql(h,!1),ql(u,!1),function(e){return wU.apply(this,arguments)}({fieldId:t.fieldId,farmFieldId:r()??void 0,imageryDate:t.imageryDate,cropZoneId:n(),method:t.method,signals:i()??void 0,shrinkageAlpha:o()??void 0,bufferSizeMeter:a()}).then((e=>{ql(c,e,!0)})).catch((e=>{ql(l,e instanceof Error?e.message:String(e),!0)})).finally((()=>{ql(s,!1)})))}));const S=[[178,24,43],[244,165,130],[247,247,247],[146,197,222],[33,102,172]];function k(e,t){const r=Math.max(0,Math.min(1,t))*(e.length-1),n=Math.floor(r),i=Math.min(e.length-1,n+1),o=r-n;return[Math.round(e[n][0]+(e[i][0]-e[n][0])*o),Math.round(e[n][1]+(e[i][1]-e[n][1])*o),Math.round(e[n][2]+(e[i][2]-e[n][2])*o)]}function T(e,t,r){const n=r-e||1,i=t-r||1;return e=>k(S,e<=r?.5-(r-e)/n*.5:.5+(e-r)/i*.5)}function I(e){let t=Number.isFinite(e.summary.min)?e.summary.min:0,r=Number.isFinite(e.summary.max)?e.summary.max:1;return"binary"===e.units?(t=0,r=1):t===r&&(r=t+1),function(e){return"slope"===_(e).mode}(e)?(t=Math.min(t,0),r=Math.max(r,0),t===r&&(r=t+1),{units:e.units,lo:t,hi:r,anchor:0}):{units:e.units,lo:t,hi:r}}function M(e,t,r,n){const i=t.raster?.data;if(!i?.length||!i[0]?.length)return;const o=i.length,a=i[0].length,s=Math.max(1,Math.min(r/a,r/o));e.width=a,e.height=o,e.style.width=a*s+"px",e.style.height=o*s+"px";const l=e.getContext("2d");if(!l)return;const c=l.createImageData(a,o),u=n?.lo??t.summary.min,d=n?.hi??t.summary.max,h=Number.isFinite(t.summary.mean)?t.summary.mean:(u+d)/2,f=T(u,d,Math.max(u,Math.min(d,n?.anchor??h)));for(let e=0;e<o;e++){const t=i[e];for(let r=0;r<a;r++){const n=t[r],i=4*(e*a+r);if(null==n||Number.isNaN(n)){c.data[i+3]=0;continue}const[o,s,l]=f(n);c.data[i]=o,c.data[i+1]=s,c.data[i+2]=l,c.data[i+3]=255}}l.putImageData(c,0,0)}const E=new WeakMap;function P(e,t,r,n){const i=e.raster?.data;if(!i?.length||!i[0]?.length)return null;const o=E.get(e);if(o&&o.lo===t&&o.hi===r)return o;const a="binary"===n?2:24,s=r-t||1,l=new Array(a).fill(0);let c=0;for(let e=0;e<i.length;e++){const r=i[e];for(let e=0;e<r.length;e++){const n=r[e];if(null==n||Number.isNaN(n))continue;const i=(n-t)/s;l[Math.max(0,Math.min(a-1,Math.floor(i*a)))]++,c++}}if(!c)return null;const u=new Array(a).fill(0);let d=0;for(let e=0;e<a;e++)d+=l[e],u[e]=d;const h={bins:l,cumulative:u,total:c,lo:t,hi:r,nbins:a};return E.set(e,h),h}function A(e,t,r,n=null){const i=r?.units??t.units,o=r?.lo??t.summary.min,a=r?.hi??t.summary.max,s=P(t,o,a,i);if(!s)return;const{bins:l,total:c,nbins:u}=s,d=a-o||1,h=Math.max(...l)||1,f=Math.min(window.devicePixelRatio||1,2),p=e.clientWidth||200,g=e.clientHeight||40;e.width=Math.round(p*f),e.height=Math.round(g*f);const m=e.getContext("2d");if(!m)return;m.scale(f,f),m.clearRect(0,0,p,g),m.fillStyle="#f9fafb",m.fillRect(0,0,p,g);const y=Number.isFinite(t.summary.mean)?t.summary.mean:(o+a)/2,_=Math.max(o,Math.min(a,r?.anchor??y)),v=T(o,a,_),b=p/u;for(let e=0;e<u;e++){const t=o+(e+.5)/u*d,[r,n,i]=v(t),a=l[e]/h*(g-2);m.fillStyle=`rgb(${r},${n},${i})`,m.fillRect(e*b,g-a,Math.max(1,b-1),a)}if("binary"!==i){const e=e=>(e-o)/d*p,r=(t,r,n)=>{!Number.isFinite(t)||t<o||t>a||(m.fillStyle=n,m.fillRect(Math.max(0,Math.min(p-1,e(t)))-.5,0,1,r))};r(t.summary.min,2,"rgba(107, 114, 128, 0.65)"),r(t.summary.p5,3,"rgba(107, 114, 128, 0.65)"),r(t.summary.p50,4,"rgba(55, 65, 81, 0.85)"),r(t.summary.p95,3,"rgba(107, 114, 128, 0.65)"),r(t.summary.max,2,"rgba(107, 114, 128, 0.65)")}if(_>=o&&_<=a&&"binary"!==i){const e=(_-o)/d*p;m.save(),m.strokeStyle="rgba(0, 0, 0, 0.6)",m.lineWidth=1.25,m.setLineDash([3,2]),m.beginPath(),m.moveTo(e,0),m.lineTo(e,g),m.stroke(),m.restore()}if(null!==n&&Number.isFinite(n)&&n>
31=o&&n<=a&&"binary"!==i){const e=(n-o)/d*p;m.save(),m.strokeStyle="rgba(37, 99, 235, 0.95)",m.lineWidth=1.5,m.beginPath(),m.moveTo(e,0),m.lineTo(e,g),m.stroke(),m.restore()}}function C(e,t=3){return null==e||Number.isNaN(e)?"—":Math.abs(e)>=1e3?e.toFixed(0):e.toFixed(t)}function R(e){return Number.isFinite(e)?Math.abs(e)>=1e3?e.toFixed(0):Math.abs(e)>=10?e.toFixed(1):e.toFixed(2):"—"}var L=Zu(),O=dc(L),D=e=>{var r=x$();r.__click=w,r.__keydown=e=>"Escape"===e.key&&t.onClose();var n=uc(r),i=uc(n);i.__click=function(...e){t.onClose?.apply(this,e)};var o=hc(i,6);fd(hc(uc(o),4),(e=>function(e){const t=Math.min(window.devicePixelRatio||1,2),r=e.clientWidth||240,n=e.clientHeight||10;e.width=Math.round(r*t),e.height=Math.round(n*t);const i=e.getContext("2d");if(!i)return;i.scale(t,t),i.clearRect(0,0,r,n);const o=r/64;for(let e=0;e<64;e++){const t=e/63,[r,a,s]=k(S,t);i.fillStyle=`rgb(${r},${a},${s})`,i.fillRect(e*o,0,Math.ceil(o)+1,n)}i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(r/2-.5,0,1,n)}?.(e))),Ds(4),Os(o);var a=hc(o,2),p=e=>{Yu(e,t$())},g=e=>{var t=Zu(),r=dc(t),n=e=>{var t=r$(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(l)))),Yu(e,t)},i=e=>{var t=Zu(),r=dc(t),n=e=>{var t=b$(),r=dc(t),n=uc(r),i=hc(uc(n));Os(n);var o=hc(n,4),a=hc(uc(o));Os(o);var s=hc(o,4),l=hc(uc(s));Os(s),Os(r);var p=hc(r,2);Il(p,21,(()=>yu(x)),(e=>e.step),((e,t)=>{var r=p$(),n=uc(r),i=uc(n),o=uc(i,!0);Os(i);var a=hc(i,2),s=uc(a);Os(a),Os(n);var l=hc(n,2);Il(l,21,(()=>yu(t).stages),(e=>e.id),((e,t)=>{const r=Dl((()=>_(yu(t)))),n=Dl((()=>I(yu(t))));var i=f$(),o=uc(i),a=uc(o),s=uc(a),l=uc(s,!0);Os(s);var c=hc(s,2),u=e=>{var t=n$(),n=uc(t,!0);Os(t),Pc((()=>Ju(n,yu(r).mode))),Yu(e,t)};ad(c,(e=>{yu(r).mode&&e(u)})),Os(a);var d=hc(a,2),h=uc(d,!0);Os(d),Os(o);var p=hc(o,2),g=e=>{var r=i$(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"title",yu(t).name),Ju(n,yu(t).name)})),Yu(e,r)};ad(p,(e=>{yu(t).name&&e(g)}));var m=hc(p,2),y=uc(m),v=e=>{var r=o$();fd(r,((e,t)=>function(e,t){M(e,t.stage,t.maxDim,t.scale);let r=t.stage;const n=t=>{const n=r.raster?.data;if(!n?.length||!n[0]?.length)return;const i=e.getBoundingClientRect();if(i.width<=0||i.height<=0)return;const o=(t.clientX-i.left)/i.width,a=(t.clientY-i.top)/i.height,s=n[0].length,l=n.length,c=Math.max(0,Math.min(s-1,Math.floor(o*s))),u=n[Math.max(0,Math.min(l-1,Math.floor(a*l)))][c];f[r.id]="number"==typeof u&&Number.isFinite(u)?u:null},i=()=>{f[r.id]=null};return e.addEventListener("mousemove",n),e.addEventListener("mouseleave",i),{update(t){t.stage.id!==r.id&&(f[r.id]=null,r=t.stage),M(e,t.stage,t.maxDim,t.scale)},destroy(){e.removeEventListener("mousemove",n),e.removeEventListener("mouseleave",i),delete f[r.id]}}}?.(e,t)),(()=>({stage:yu(t),maxDim:200,scale:yu(n)}))),Yu(e,r)},b=e=>{Yu(e,a$())};ad(y,(e=>{yu(t).raster?.data?.length?e(v):e(b,!1)})),Os(m);var x=hc(m,2),w=e=>{const r=Dl((()=>f[yu(t).id]??null)),i=Dl((()=>null!==yu(r)&&Number.isFinite(yu(r))));var o=h$(),a=uc(o);fd(a,((e,t)=>function(e,t){return A(e,t.stage,t.scale,t.hoverValue??null),{update(t){A(e,t.stage,t.scale,t.hoverValue??null)}}}?.(e,t)),(()=>({stage:yu(t),scale:yu(n),hoverValue:yu(r)})));var s=hc(a,2),l=e=>{var t=s$(),r=uc(t),i=uc(r,!0);Os(r);var o=hc(r,2),a=uc(o,!0);Os(o),Os(t),Pc(((e,t)=>{Ju(i,e),Ju(a,t)}),[()=>R(yu(n).lo),()=>R(yu(n).hi)]),Yu(e,t)},c=e=>{const o=Dl((()=>yu(n).hi-yu(n).lo||1)),a=Dl((()=>Math.max(0,Math.min(100,(yu(t).summary.min-yu(n).lo)/yu(o)*100)))),s=Dl((()=>Math.max(0,Math.min(100,(yu(t).summary.p5-yu(n).lo)/yu(o)*100)))),l=Dl((()=>Math.max(0,Math.min(100,(yu(t).summary.p50-yu(n).lo)/yu(o)*100)))),c=Dl((()=>Math.max(0,Math.min(100,(yu(t).summary.p95-yu(n).lo)/yu(o)*100)))),u=Dl((()=>Math.max(0,Math.min(100,(yu(t).summary.max-yu(n).lo)/yu(o)*100))));var d=d$(),h=dc(d),f=uc(h),p=uc(f,!0);Os(f);var g=hc(f,2),m=uc(g,!0);Os(g);var y=hc(g,2),_=uc(y,!0);Os(y);var v=hc(y,2),b=uc(v,!0);Os(v);var x=hc(v,2),w=uc(x,!0);Os(x),Os(h);var S=hc(h,2),k=uc(S),T=e=>{const i=Dl((()=>yu(t).summary.std)),o=Dl((()=>Number.isFinite(yu(i))&&yu(i)>0?(yu(r)-yu(t).summary.mean)/yu(i):null)),a=Dl((()=>function(e,t,r){const n=t.lo,i=t.hi,o=P(e,n,i,t.units);if(!o)return null;const a=i-n||1,s=Math.max(0,Math.min(1-1e-9,(r-n)/a)),l=Math.floor(s*o.nbins);return(0===l?0:o.cumulative[l-1])/o.total}(yu(t),yu(n),yu(r))));var s=u$(),l=uc(s),c=uc(l,!0);Os(l);var u=hc(l,2),d=e=>{var t=l$(),r=hc(dc(t),2),n=uc(r,!0);Os(r),Pc((e=>Ju(n,e)),[()=>(yu(o)>=0?"+":"")+yu(o).toFixed(2)]),Yu(e,t)};ad(u,(e=>
31{null!==yu(o)&&e(d)}));var h=hc(u,2),f=e=>{var t=c$(),r=hc(dc(t),2),n=uc(r);Os(r),Pc((e=>Ju(n,`${e??""}%`)),[()=>Math.round(100*yu(a))]),Yu(e,t)};ad(h,(e=>{null!==yu(a)&&e(f)})),Os(s),Pc((e=>Ju(c,e)),[()=>C(yu(r),3)]),Yu(e,s)};ad(k,(e=>{yu(i)&&e(T)})),Os(S),Pc(((e,t,r,n,o)=>{kd(f,`left: ${yu(a)}%`),Ju(p,e),kd(g,`left: ${yu(s)}%`),Ju(m,t),kd(y,`left: ${yu(l)}%`),Ju(_,r),kd(v,`left: ${yu(c)}%`),Ju(b,n),kd(x,`left: ${yu(u)}%`),Ju(w,o),Fd(S,"aria-hidden",!yu(i))}),[()=>R(yu(t).summary.min),()=>R(yu(t).summary.p5),()=>R(yu(t).summary.p50),()=>R(yu(t).summary.p95),()=>R(yu(t).summary.max)]),Yu(e,d)};ad(s,(e=>{"binary"===yu(t).units?e(l):e(c,!1)})),Os(o),Yu(e,o)};ad(x,(e=>{yu(t).raster?.data?.length&&e(w)}));var S=hc(x,2),k=uc(S),T=uc(k),E=hc(uc(T),2),L=uc(E,!0);Os(E),Os(T);var O=hc(T,2),D=hc(uc(O),2),z=uc(D,!0);Os(D),Os(O);var F=hc(O,2),N=hc(uc(F),2),B=uc(N,!0);Os(N),Os(F),Os(k);var j=hc(k,2),V=uc(j),G=hc(uc(V),2),U=uc(G,!0);Os(G),Os(V);var $=hc(V,2),H=hc(uc($),2),q=uc(H,!0);Os(H),Os($);var W=hc($,2),Z=hc(uc(W),2),Y=uc(Z,!0);Os(Z),Os(W);var X=hc(W,2),K=hc(uc(X),2),J=uc(K,!0);Os(K),Os(X);var Q=hc(X,2),ee=hc(uc(Q),2),te=uc(ee,!0);Os(ee),Os(Q),Os(j),Os(S);var re=hc(S,2),ne=uc(re,!0);Os(re),Os(i),Pc(((e,n,o,a,s,c,u,f)=>{Fd(i,"title",yu(t).description),Ju(l,yu(r).index??"—"),Fd(d,"title",yu(t).units),Ju(h,yu(t).units),Ju(L,e),Ju(z,n),Ju(B,o),Ju(U,a),Ju(q,s),Ju(Y,c),Ju(J,u),Ju(te,f),Fd(re,"title",yu(t).id),Ju(ne,yu(t).id)}),[()=>C(yu(t).summary.mean),()=>C(yu(t).summary.std),()=>yu(t).summary.valid_pixels.toLocaleString(),()=>C(yu(t).summary.min),()=>C(yu(t).summary.p5),()=>C(yu(t).summary.p50),()=>C(yu(t).summary.p95),()=>C(yu(t).summary.max)]),Yu(e,i)})),Os(l),Os(r),Pc((()=>{Ju(o,yu(t).label),Ju(s,`${yu(t).stages.length??""} raster${1===yu(t).stages.length?"":"s"}`)})),Yu(e,r)})),Os(p);var g=hc(p,2),y=e=>{var t=m$(),r=hc(uc(t),2);e$(r,{get optram(){return yu(c).optram}});var n=hc(r,2);Il(n,21,(()=>[["Fit pixels",yu(c).optram.fit_pixels],["Populated bins",yu(c).optram.populated_bins],["Total valid px",yu(c).optram.total_valid_pixels],["Edge window (days)",yu(c).optram.edge_window_days_used],["Edge scenes",yu(c).optram.edge_scenes],["W clipped at 0",yu(c).optram.frac_clip_0],["W clipped at 1",yu(c).optram.frac_clip_1]]),Tl,((e,t)=>
31{var r=Dl((()=>ts(yu(t),2)));let n=()=>yu(r)[1];var i=Zu(),o=dc(i),a=e=>{var t=g$(),i=uc(t),o=uc(i,!0);Os(i);var a=hc(i,2),s=uc(a,!0);Os(a),Os(t),Pc((e=>{Ju(o,yu(r)[0]),Ju(s,e)}),[()=>C(n())]),Yu(e,t)};ad(o,(e=>{null!=n()&&e(a)})),Yu(e,i)})),Os(n),Os(t),Yu(e,t)};ad(g,(e=>{yu(c).optram&&e(y)}));var v=hc(g,2),b=e=>{var t=v$(),r=hc(uc(t),2);JU(r,{get audit(){return yu(c).audit}});var n=hc(r,2);n.__click=m;var i=uc(n);Os(n);var o=hc(n,2),a=e=>{var t=_$(),r=dc(t),n=e=>{Yu(e,y$())};ad(r,(e=>{yu(h)&&e(n)}));var i=hc(r,2),o=uc(i,!0);Os(i),Pc((()=>Ju(o,yu(d)))),Yu(e,t)};ad(o,(e=>{yu(u)&&null!==yu(d)&&e(a)})),Os(t),Pc((e=>Ju(i,`${yu(u)?"▼":"▶"} Show raw audit (everything, ${e??""} keys)`)),[()=>Object.keys(yu(c).audit).length]),Yu(e,t)};ad(v,(e=>{Object.keys(yu(c).audit??{}).length>0&&e(b)})),Pc((()=>{Ju(i,` ${yu(c).method??""}`),Ju(a,` ${yu(c).reference_date_used??""}`),Ju(l,` ${yu(c).stages.length??""}`)})),Yu(e,t)};ad(r,(e=>{yu(c)&&e(n)}),!0),Yu(e,t)};ad(r,(e=>{yu(l)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(a,(e=>{yu(s)?e(p):e(g,!1)})),Os(n),Os(r),Yu(e,r)};ad(O,(e=>{t.open&&e(D)})),Yu(e,L),Ys()}Bu(["click","keydown"]);var S$=$u('<button type="button" title="Run /admin/vri-debug for the current reference date (admin only)" class="inline-flex items-center gap-1 px-3 py-2 rounded-md text-xs font-medium border border-gray-300 text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"><svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg> Admin VRI</button> <!>',1);function k$(e,t){const r=fh(t,"farmFieldId",3,null),n=fh(t,"cropZoneId",3,null),i=fh(t,"disabled",3,!1),o=fh(t,"signals",3,null),a=fh(t,"shrinkageAlpha",3,null),s=fh(t,"bufferSizeMeter",3,null);let l=$l(!1);var c=S$(),u=dc(c);u.__click=()=>ql(l,!0),w$(hc(u,2),{get open(){return yu(l)},get fieldId(){return t.fieldId},get farmFieldId(){return r()},get cropZoneId(){return n()},get dataSource(){return t.dataSource},get imageryDate(){return t.imageryDate},get method(){return t.method},get signals(){return o()},get shrinkageAlpha(){return a()},get bufferSizeMeter(){return s()},onClose:()=>ql(l,!1)}),Pc((()=>u.disabled=i()||!t.imageryDate)),Yu(e,c)}Bu(["click"]);var T$=$u("<option> </option>"),I$=$u("<option> </option>"),M$=$u('<div class="text-[10px] text-amber-700 pl-1"> </div>'),E$=$u('<div class="flex flex-col gap-1"><div class="grid grid-cols-12 gap-1.5 items-center"><select class="col-span-2 px-1.5 py-1 border border-gray-300 rounded text-[11px] bg-white disabled:bg-gray-100"></select> <select class="col-span-2 px-1.5 py-1 border border-gray-300 rounded text-[11px] bg-white disabled:bg-gray-100"></select> <select class="col-span-3 px-1.5 py-1 border border-gray-300 rounded text-[11px] bg-white disabled:bg-gray-100"><option>+1 vigor</option><option>-1 deficit</option></select> <input type="number" min="0" max="1" step="0.05" placeholder="weight (opt)" class="col-span-3 px-1.5 py-1 border border-gray-300 rounded text-[11px] disabled:bg-gray-100"/> <button type="button" class="col-span-2 text-[10px] px-1.5 py-1 rounded bg-white border border-gray-300 hover:bg-red-50 hover:border-red-300 hover:text-red-700 disabled:opacity-50" title="Remove signal">Remove</button></div> <!></div>'),P$=$u('<div class="text-[10px] text-amber-700 mt-1"> </div>'),A$=$u('<div class="text-[10px] text-gray-500">Add at least one signal — required when method is "custom".</div>'),C$=$u('<div class="flex flex-col gap-1.5 border border-gray-200 rounded-md p-2 bg-gray-50"><div class="flex items-center justify-between"><span class="text-[11px] font-medium text-gray-600">Signals</span> <button type="button" class="text-[10px] px-2 py-0.5 rounded bg-white border border-gray-300 hover:bg-gray-100 disabled:opacity-50">+ Add signal</button></div> <!> <!> <!></div>'),R$=$u('<div class="flex flex-col gap-2"><div class="flex items-center gap-3"><label for="vri-methodology" class="text-[11px] text-gray-500 w-28 flex-shrink-0" title="Methodology preset. Standard is the recommended default. Custom lets you supply signals.">Methodology</label> <select id="vri-methodology" class="flex-1 px-2 py-1 border border-gray-300 rounded text-xs bg-white disabled:bg-gray-100"><option>Standard</option><option>Standard 2</option><option>Standard 3</option><option>Custom</option></select></div> <div class="flex items-center gap-3"><label for="vri-shrinkage-alpha" class="text-[11px] text-gray-500 w-28 flex-shrink-0" title="Weight-shrinkage parameter [0, 1]. 0 = pure σ-driven, 1 = uniform weights. Default 0.3. Leave blank to use the upstream default.">Shrinkage α</label> <input id="vri-shrinkage-alpha" type="number" min="0" max="1" step="0.05" placeholder="0.3 (default)" class="flex-1 px-2 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div> <div class="flex items-center gap-3"><label for="vri-buffer-size-meter" class="text-[11px] text-gray-500 w-28 flex-shrink-0" title="Methodology-stats buffer in meters. Negative = inset (excludes edge pixels — roads, hedgerows, headlands — from per-signal stats). Leave blank to use the backend default. Common useful range: -3 to -10. Has no effect on zone shapes.">Field edge buffer (m)</label> <input id="vri-buffer-size-meter" type="number" min="-50" max="50" step="1" placeholder="—" class="flex-1 px-2 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div> <!></div>');function L$(e,t){Zs(t,!0);let r=fh(t,"method",15),n=fh(t,"signals",15),i=fh(t,"shrinkageAlpha",15),o=fh(t,"bufferSizeMeter",15),a=fh(t,"disabled",3,!1);
31const s=["auto","ndvi","gndvi","msavi","ndmi"],l=["value","slope"],c=Dl((()=>"custom"===r()));function u(e){r(e),"custom"===e?n()&&0!==n().length||n([{index:"auto",mode:"value"},{index:"auto",mode:"slope"}]):n(null)}function d(){const e=[...n()??[],{index:"auto",mode:"value"}];n(e)}function h(e,t){const r=(n()??[]).map(((r,n)=>n===e?{...r,...t}:r));n(r)}const f=Dl((()=>{if(!yu(c)||!n()?.length)return null;const e=n().filter((e=>"number"==typeof e.weight));if(0===e.length)return null;if(e.length!==n().length)return"If any signal has a weight, every signal must have one.";const t=e.reduce(((e,t)=>e+(t.weight??0)),0);return Math.abs(t-1)>.001?`Weights sum to ${t.toFixed(2)}. Upstream requires 1.00.`:null}));var p=R$(),g=uc(p),m=hc(uc(g),2);m.__change=e=>u(e.target.value);var y=uc(m);y.value=y.__value="standard";var _=hc(y);_.value=_.__value="standard2";var v=hc(_);v.value=v.__value="standard3";var b,x=hc(v);x.value=x.__value="custom",Os(m),Id(m),Os(g);var w=hc(g,2),S=hc(uc(w),2);Ld(S),S.__input=e=>{const t=e.target.value;i(""===t?null:Number(t))},Os(w);var k=hc(w,2),T=hc(uc(k),2);Ld(T),T.__input=e=>{const t=e.target.value;o(""===t?null:Number(t))},Os(k);var I=hc(k,2),M=e=>{var t=C$(),r=uc(t),i=hc(uc(r),2);i.__click=d,Os(r);var o=hc(r,2);Il(o,17,(()=>n()??[]),Tl,((e,t,r)=>{const i=Dl((()=>function(e){return UG.has(e.index)&&1===(e.sign??1)?`${e.index.toUpperCase()} normally uses sign=-1 so drying pixels get more water.`:null}(yu(t))));var o,c=E$(),u=uc(c),d=uc(u);d.__change=e=>h(r,{index:e.target.value}),Il(d,21,(()=>s),Tl,((e,t)=>
31{var r=T$(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t)),i!==(i=yu(t))&&(r.value=(r.__value=yu(t))??"")})),Yu(e,r)})),Os(d),Id(d);var f,p=hc(d,2);p.__change=e=>h(r,{mode:e.target.value}),Il(p,21,(()=>l),Tl,((e,t)=>{var r=I$(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t)),i!==(i=yu(t))&&(r.value=(r.__value=yu(t))??"")})),Yu(e,r)})),Os(p),Id(p);var g=hc(p,2);g.__change=e=>h(r,{sign:Number(e.target.value)}),Fd(g,"title","Direction:\n  +1 (vigor) — above-mean pixels get more water (NDVI / GNDVI / MSAVI).\n  -1 (deficit) — below-mean pixels get more water (NDMI / stress signals — drying → more water).");var m=uc(g);m.value=m.__value="1";var y,_=hc(m);_.value=_.__value="-1",Os(g),Id(g);var v=hc(g,2);Ld(v),v.__input=e=>{const t=e.target.value;h(r,{weight:""===t?void 0:Number(t)})};var b=hc(v,2);b.__click=()=>function(e){const t=(n()??[]).filter(((t,r)=>r!==e));n(t.length>0?t:null)}(r),Os(u);var x=hc(u,2),w=e=>{var t=M$(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(i)))),Yu(e,t)};ad(x,(e=>{yu(i)&&e(w)})),Os(c),Pc((e=>{d.disabled=a(),o!==(o=yu(t).index)&&(d.value=(d.__value=yu(t).index)??"",Td(d,yu(t).index)),p.disabled=a(),f!==(f=yu(t).mode)&&(p.value=(p.__value=yu(t).mode)??"",Td(p,yu(t).mode)),g.disabled=a(),y!==(y=e)&&(g.value=(g.__value=e)??"",Td(g,e)),Od(v,yu(t).weight??""),v.disabled=a(),b.disabled=a()}),[()=>(yu(t).sign??1).toString()]),Yu(e,c)}));var c=hc(o,2),u=e=>{var t=P$(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(f)))),Yu(e,t)};ad(c,(e=>{yu(f)&&e(u)}));var p=hc(c,2),g=e=>{Yu(e,A$())};ad(p,(e=>{n()?.length||e(g)})),Os(t),Pc((()=>i.disabled=a())),Yu(e,t)};ad(I,(e=>{yu(c)&&e(M)})),Os(p),Pc((()=>{m.disabled=a(),b!==(b=r())&&(m.value=(m.__value=r())??"",Td(m,r())),Od(S,i()??""),S.disabled=a(),Od(T,o()??""),T.disabled=a()})),Yu(e,p),Ys()}Bu(["change","input","click"]);var O$=$u('<div class="text-[10px] text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1">This target band isn\'t centered on 100% — total water applied will change.</div>'),D$=$u('<span class="text-xs text-green-600"> </span>'),z$=$u('<div class="text-xs text-red-600 bg-red-50 border border-red-200 rounded px-2 py-1"> </div>'),F$=$u('<div class="flex flex-col gap-3 pt-2 border-t border-gray-100"><div class="text-[10px] font-semibold text-gray-500 uppercase tracking-wider">VRI range</div> <div class="grid grid-cols-2 gap-2"><div><label for="vri-cap-min" class="text-[10px] text-gray-500" title="Lower hard clamp on per-zone irrigation %. Default 85.">Cap min %</label> <input id="vri-cap-min" type="number" min="0" max="200" step="1" placeholder="85" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div> <div><label for="vri-cap-max" class="text-[10px] text-gray-500" title="Upper hard clamp on per-zone irrigation %. Default 115.">Cap max %</label> <input id="vri-cap-max" type="number" min="0" max="300" step="1" placeholder="115" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div></div> <div class="grid grid-cols-2 gap-2"><div><label for="vri-target-min" class="text-[10px] text-gray-500" title="Optional target band min %. When both target values are set, zones are remapped to fill the band (overrides the cap). Leave blank to use the cap.">Target min %</label> <input id="vri-target-min" type="number" min="0" max="200" step="1" placeholder="—" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div> <div><label for="vri-target-max" class="text-[10px] text-gray-500" title="Optional target band max %. When both target values are set, zones are remapped to fill the band (overrides the cap). Leave blank to use the cap.">Target max %</label> <input id="vri-target-max" type="number" min="0" max="300" step="1" placeholder="—" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div></div> <!> <div class="flex items-center gap-2"><button type="button" class="px-3 py-1 rounded text-xs font-medium bg-gray-700 hover:bg-gray-800 text-white disabled:bg-gray-400 disabled:cursor-not-allowed"> </button> <!></div> <!></div>');function N$(e,t){Zs(t,!0);let r=fh(t,"capMinPct",15),n=fh(t,"capMaxPct",15),i=fh(t,"targetMinPct",15),o=fh(t,"targetMaxPct",15),a=fh(t,"method",11,"standard"),s=fh(t,"signals",11,null),l=fh(t,"shrinkageAlpha",11,null),
31c=fh(t,"bufferSizeMeter",11,null),u=fh(t,"isAdmin",3,!1),d=$l(!1),h=$l(null),f=$l("");const p=Dl((()=>null==i()!=(null==o()))),g=Dl((()=>null!=i()&&null!=o()&&i()>=o())),m=Dl((()=>null!=r()&&null!=n()&&r()>n())),y=Dl((()=>null!=i()&&null!=o()&&(i()+o())/2!=100));var _=F$(),v=hc(uc(_),2),b=uc(v),x=hc(uc(b),2);Ld(x),Os(b);var w=hc(b,2),S=hc(uc(w),2);Ld(S),Os(w),Os(v);var k=hc(v,2),T=uc(k),I=hc(uc(T),2);Ld(I),Os(T);var M=hc(T,2),E=hc(uc(M),2);Ld(E),Os(M),Os(k);var P=hc(k,2),A=e=>{Yu(e,O$())};ad(P,(e=>{!yu(y)||yu(p)||yu(g)||e(A)}));var C=hc(P,2),R=uc(C);R.__click=async function(){const e=null==r()||null==n()?"Cap min and max are required.":yu(m)?"Cap min must be ≤ cap max.":yu(p)?"Set both target min and max, or leave both blank.":yu(g)?"Target min must be less than target max.":null;if(e)ql(h,e,!0);else{ql(d,!0),ql(h,null),ql(f,"");try{const e={vri_cap_min_pct:r(),vri_cap_max_pct:n(),vri_target_min_pct:i(),vri_target_max_pct:o()};u()&&(e.vri_method=a(),e.vri_signals="custom"===a()?s():null,e.vri_shrinkage_alpha=l(),e.vri_buffer_size_meter=c());const d=await function(e,t){return XD.apply(this,arguments)}(t.fieldId,e);ql(f,"Saved"),t.onSaved?.(d),setTimeout((()=>{ql(f,"")}),3e3)}catch(e){ql(h,e instanceof Error?e.message:"Failed to save VRI settings",!0)}finally{ql(d,!1)}}};var L=uc(R,!0);Os(R);var O=hc(R,2),D=e=>{var t=D$(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(f)))),Yu(e,t)};ad(O,(e=>{yu(f)&&e(D)})),Os(C);var z=hc(C,2),F=e=>{var t=z$(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(h)))),Yu(e,t)};ad(z,(e=>{yu(h)&&e(F)})),Os(_),Pc((()=>{R.disabled=yu(d),Ju(L,yu(d)?"Saving…":"Save settings")})),Kd(x,r),Kd(S,n),Kd(I,i),Kd(E,o),Yu(e,_),Ys()}Bu(["click"]);var B$=$u('<div class="text-sm text-amber-700 bg-amber-50 border border-amber-200 rounded-md p-3">No drip boundaries found. Please create drip irrigation boundaries first.</div>'),j$=$u('<div class="flex items-center gap-3"><label for="drip-vri-mode" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Mode</label> <select id="drip-vri-mode" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white"><option>Equipment-based</option><option>Field zones (no equipment)</option></select></div>'),V$=$u('<div class="flex items-center gap-2 px-2 py-1.5 border-b border-gray-100 last:border-b-0"><div class="w-2.5 h-2.5 bg-blue-500 rounded-sm"></div> <span class="text-sm text-gray-700"> </span></div>'),G$=$u('<div class="pt-2 border-t border-gray-100 flex flex-col gap-2"><div class="text-[10px] font-semibold text-gray-500 uppercase tracking-wider">Admin</div> <!></div>'),U$=$u('<div class="flex flex-col gap-3 pt-2 border-t border-gray-200"><!> <div class="flex items-start gap-3"><div class="text-sm font-medium text-gray-700 w-28 flex-shrink-0 pt-1">Drip Zones</div> <div class="flex-1 border border-gray-300 rounded-md max-h-32 overflow-y-auto"></div></div> <div class="flex items-center gap-3"><label for="drip-imagery-date" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0" title="Anchor for the analysis window. Zones are generated from imagery up to this date, not from a single image.">Reference date</label> <input id="drip-imagery-date" type="date" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 disabled:bg-gray-100 disabled:text-gray-500"/></div> <div class="flex items-center gap-3"><label for="plan-name" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Plan Name</label> <input id="plan-name" type="text" placeholder="Enter plan name" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 disabled:bg-gray-100 disabled:text-gray-500"/></div> <div class="flex items-center gap-3"><label for="drip-fiv" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Irrigation Volume (mm)</label> <input id="drip-fiv" type="number" min="0" step="0.1" placeholder="—" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 disabled:bg-gray-100 disabled:text-gray-500"/></div> <!> <!></div>'),$$=$u('<div class="flex items-center justify-between"><div class="text-sm text-gray-600"><span class="font-medium"> </span> <span class="text-gray-400 mx-1">&bull;</span> <span class="text-xs">Cloudless</span></div> <button type="button" class="p-1.5 rounded-md hover:bg-gray-100 text-gray-500 hover:text-gray-700 transition-colors" title="Plan settings"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></button></div> <!>',1),H$=$u('<div class="text-sm text-green-600 bg-green-50 border border-green-200 rounded-md p-2"> </div>'),q$=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Saving...</span>'),W$=$u('<div class="flex gap-2"><button class="flex-1 px-4 py-2 rounded-lg font-medium transition-colors border border-gray-300 text-gray-700 hover:bg-gray-50 disabled:opacity-50">Adjust</button> <button class="flex-1 px-4 py-2 rounded-lg font-medium transition-colors bg-green-600 hover:bg-green-700 text-white disabled:bg-gray-400 disabled:cursor-not-allowed"><!></button></div> <div class="text-xs text-blue-600 bg-blue-50 border border-blue-200 rounded-md p-2">Preview shown on map. Click "Save Plan" to keep it, or "Adjust" to change parameters.</div>',1),Z$=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Generating Preview...</span>'),Y$=$u('<div class="flex gap-2"><button>
31<!></button> <!></div>'),X$=$u('<div class="flex flex-col gap-3 p-4 bg-white border border-gray-200 rounded-lg"><!> <!> <!> <!></div>');function K$(e,t){Zs(t,!0);let r=fh(t,"farmFieldId",3,null),n=fh(t,"cropZoneId",3,null),i=fh(t,"isAdmin",3,!1),o=fh(t,"vriMode",3,null),a=$l(Jl(t.vriSettings.capMinPct)),s=$l(Jl(t.vriSettings.capMaxPct)),l=$l(Jl(t.vriSettings.targetMinPct)),c=$l(Jl(t.vriSettings.targetMaxPct));let u=$l(Jl(yU("drip"))),d=$l(Jl(function(e){const t=new Date;return t.setDate(t.getDate()+e),t.toISOString().split("T")[0]}(-1))),h=$l(!1),f=$l(!1),p=$l(null),g=$l(""),m=$l(!1);const y="advanced";let _=$l(""),v=$l(Jl(t.vriSettings.method)),b=$l(Jl(t.vriSettings.signals)),x=$l(Jl(t.vriSettings.shrinkageAlpha)),w=$l(Jl(t.vriSettings.bufferSizeMeter)),S=$l(!1);function k(){return yu(u).trim()?0!==t.boundaries.length||(ql(p,"No drip boundaries found"),!1):(ql(p,"Please enter a plan name"),!1)}function T(){const e=t.boundaries[0];return{dripBoundaryId:e.properties?.id||e.id,fieldId:t.fieldId,planName:yu(u).trim(),farmFieldId:r()||void 0,imageryDate:yu(d),dataSource:y||void 0,cropZoneId:n()||void 0,fieldIrrigationVolume:"number"==typeof yu(_)?yu(_):void 0,minIrrigationPct:yu(a),maxIrrigationPct:yu(s),targetMinPct:yu(l),targetMaxPct:yu(c),method:yu(v),signals:"custom"===yu(v)?yu(b):null,shrinkageAlpha:yu(x),bufferSizeMeter:yu(w)}}async function I(){if(k()){ql(h,!0),ql(p,null),ql(g,"");try{const e=await function(e){return iU.apply(this,arguments)}(T()),r=_U(e.zones_geojson);if(r){ql(m,!0);const e="number"==typeof yu(_)?yu(_):0;t.onPreviewGenerated(r,e)}}catch(e){console.error("Error generating drip VRI preview:",e),ql(p,e instanceof Error?e.message:"Failed to generate preview",!0)}finally{ql(h,!1)}}}async function M(){if(k()){ql(f,!0),ql(p,null);try{const e=await function(e){return rU.apply(this,arguments)}(T());ql(g,"Plan saved successfully"),ql(m,!1);const r=_U(e.zones_geojson);r&&t.onPlanCreated(e,r),setTimeout((()=>{ql(g,""),ql(u,yU("drip"),!0)}),5e3)}catch(e){console.error("Error saving drip VRI plan:",e),ql(p,e instanceof Error?e.message:"Failed to save plan",!0)}finally{ql(f,!1)}}}function E(){ql(m,!1)}var P=X$(),A=uc(P),C=e=>{Yu(e,B$())},R=e=>{var r=$$(),n=dc(r),h=uc(n),f=uc(h),p=uc(f);Os(f),Ds(4),Os(h),hc(h,2).__click=()=>ql(S,!yu(S)),Os(n);var g=hc(n,2),y=e=>{var r=U$(),n=uc(r),h=e=>{var r=j$(),n=hc(uc(r),2);n.__change=e=>t.onVriModeChange(e.target.value);var i=uc(n);i.value=i.__value="equipment";var a,s=hc(i);s.value=s.__value="field_binned",Os(n),Id(n),Os(r),Pc((()=>{a!==(a=o())&&(n.value=(n.__value=o())??"",Td(n,o()))})),Yu(e,r)};ad(n,(e=>{o()&&t.onVriModeChange&&e(h)}));var f=hc(n,2),p=hc(uc(f),2);Il(p,21,(()=>t.boundaries),Tl,((e,t)=>
31{const r=Dl((()=>yu(t).properties?.id||yu(t).id)),n=Dl((()=>yu(t).properties?.name||`Zone ${yu(r)}`));var i=V$(),o=hc(uc(i),2),a=uc(o,!0);Os(o),Os(i),Pc((()=>Ju(a,yu(n)))),Yu(e,i)})),Os(p),Os(f);var g=hc(f,2),y=hc(uc(g),2);Ld(y),Os(g);var S=hc(g,2),k=hc(uc(S),2);Ld(k),Os(S);var T=hc(S,2),I=hc(uc(T),2);Ld(I),Os(T);var M=hc(T,2);N$(M,{get fieldId(){return t.fieldId},get isAdmin(){return i()},get onSaved(){return t.onVriSettingsSaved},get capMinPct(){return yu(a)},set capMinPct(e){ql(a,e,!0)},get capMaxPct(){return yu(s)},set capMaxPct(e){ql(s,e,!0)},get targetMinPct(){return yu(l)},set targetMinPct(e){ql(l,e,!0)},get targetMaxPct(){return yu(c)},set targetMaxPct(e){ql(c,e,!0)},get method(){return yu(v)},set method(e){ql(v,e,!0)},get signals(){return yu(b)},set signals(e){ql(b,e,!0)},get shrinkageAlpha(){return yu(x)},set shrinkageAlpha(e){ql(x,e,!0)},get bufferSizeMeter(){return yu(w)},set bufferSizeMeter(e){ql(w,e,!0)}});var E=hc(M,2),P=e=>{var t=G$();L$(hc(uc(t),2),{get disabled(){return yu(m)},get method(){return yu(v)},set method(e){ql(v,e,!0)},get signals(){return yu(b)},set signals(e){ql(b,e,!0)},get shrinkageAlpha(){return yu(x)},set shrinkageAlpha(e){ql(x,e,!0)},get bufferSizeMeter(){return yu(w)},set bufferSizeMeter(e){ql(w,e,!0)}}),Os(t),Yu(e,t)};ad(E,(e=>{i()&&e(P)})),Os(r),Pc((()=>{y.disabled=yu(m),k.disabled=yu(m),I.disabled=yu(m)})),Kd(y,(()=>yu(d)),(e=>ql(d,e))),Kd(k,(()=>yu(u)),(e=>ql(u,e))),Kd(I,(()=>yu(_)),(e=>ql(_,e))),Yu(e,r)};ad(g,(e=>{yu(S)&&e(y)})),Pc((()=>Ju(p,`${t.boundaries.length??""} drip zone${t.boundaries.length>1?"s":""}`))),Yu(e,r)};ad(A,(e=>{0===t.boundaries.length?e(C):e(R,!1)}));var L=hc(A,2);AU(L,{get message(){return yu(p)},onClose:()=>ql(p,null)});var O=hc(L,2),D=e=>{var t=H$(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(g)))),Yu(e,t)};ad(O,(e=>{yu(g)&&e(D)}));var z=hc(O,2),F=e=>{var o=Zu(),a=dc(o),s=e=>{var t=W$(),r=dc(t),n=uc(r);n.__click=E;var i=hc(n,2);i.__click=M;var o=uc(i),a=e=>{Yu(e,q$())},s=e=>{Yu(e,Wu("Save Plan"))};ad(o,(e=>{yu(f)?e(a):e(s,!1)})),Os(i),Os(r),Ds(2),Pc((()=>{n.disabled=yu(f),i.disabled=yu(f)})),Yu(e,t)},l=e=>{var o=Y$(),a=uc(o);a.__click=I;var s=uc(a),l=e=>{Yu(e,Z$())},c=e=>{Yu(e,Wu("Generate Preview"))};ad(s,(e=>{yu(h)?e(l):e(c,!1)})),Os(a);var f=hc(a,2),p=e=>{{let i=Dl((()=>"custom"===yu(v)?yu(b):null));k$(e,{get fieldId(){return t.fieldId},get farmFieldId(){return r()},get cropZoneId(){return n()},dataSource:y,get imageryDate(){return yu(d)},get method(){return yu(v)},get signals(){return yu(i)},get shrinkageAlpha(){return yu(x)},get bufferSizeMeter(){return yu(w)}})}};ad(f,(e=>{i()&&e(p)})),Os(o),Pc(((e,t)=>{a.disabled=e,wd(a,1,t)}),[()=>yu(h)||!yu(u).trim(),()=>"flex-1 px-4 py-2 rounded-lg font-medium transition-colors "+(yu(h)||!yu(u).trim()?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 hover:bg-blue-700 text-white")]),Yu(e,o)};ad(a,(e=>{yu(m)?e(s):e(l,!1)})),Yu(e,o)};ad(z,(e=>{t.boundaries.length>0&&e(F)})),Os(P),Yu(e,P),Ys()}Bu(["click","change"]);var J$=$u('<div class="text-xs text-blue-700 bg-blue-50 border border-blue-200 rounded-md p-2"> </div>'),Q$=$u('<div class="flex items-center gap-3"><label for="field-binned-vri-mode" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Mode</label> <select id="field-binned-vri-mode" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white"><option>Equipment-based</option><option>Field zones (no equipment)</option></select></div>'),eH=$u("<option> </option>"),tH=$u('<div class="flex items-center gap-3"><label for="field-binned-num-zones" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0"> </label> <select id="field-binned-num-zones" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white"><option> </option><!></select></div>'),rH=$u('<div class="flex flex-col gap-3 pt-2 border-t border-gray-100"><!> <div class="grid grid-cols-3 gap-2"><div><label for="fb-smoothing" class="text-[10px] text-gray-500" title="Smoothing window in pixels (1-11, odd). Default 5.">Smoothing</label>
31 <input id="fb-smoothing" type="number" min="1" max="11" step="2" placeholder="—" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div> <div><label for="fb-spatial-weight" class="text-[10px] text-gray-500" title="K-means weight on (x,y). Default 1.0.">Spatial w</label> <input id="fb-spatial-weight" type="number" min="0" step="0.1" placeholder="—" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div> <div><label for="fb-value-weight" class="text-[10px] text-gray-500" title="K-means weight on multiplier. Default 1.0.">Value w</label> <input id="fb-value-weight" type="number" min="0" step="0.1" placeholder="—" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div> <div><label for="fb-min-marg" class="text-[10px] text-gray-500" title="Auto-mode stop threshold. Default 0.02.">Min marg R²</label> <input id="fb-min-marg" type="number" min="0" max="1" step="0.01" placeholder="—" class="w-full px-2 py-1 border border-gray-300 rounded text-xs"/></div></div></div>'),nH=$u('<div class="flex flex-col gap-3 pt-2 border-t border-gray-200"><!> <div class="flex items-center gap-3"><label for="field-binned-plan-name" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Plan name</label> <input id="field-binned-plan-name" type="text" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"/></div> <div class="flex items-center gap-3"><label for="field-binned-mode" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Mode</label> <select id="field-binned-mode" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white"><option>Range (pick zones after)</option><option>Auto (recommended N)</option><option>Fixed (exact N)</option></select></div> <!> <div class="flex items-center gap-3"><label for="field-binned-imagery-date" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0" title="Anchor for the analysis window. Zones are generated from imagery up to this date, not from a single image.">Reference date</label> <input id="field-binned-imagery-date" type="date" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"/></div> <div class="flex items-center gap-3"><label for="fb-fiv-visible" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Irrigation Volume (mm)</label> <input id="fb-fiv-visible" type="number" min="0" step="0.1" placeholder="—" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"/></div> <!> <!></div>'),iH=$u("<option> <!> <!> <!> <!></option>"),oH=$u('<span><span class="text-gray-500">Area</span> <span class="font-medium tabular-nums"> </span></span>
31'),aH=$u('<span><span class="text-gray-500">Δ</span> <span class="font-medium tabular-nums"> </span></span>'),sH=$u('<span><span class="text-gray-500">Baseline</span> <span class="font-medium tabular-nums"> </span></span> <span><span class="text-gray-500">Recom.</span> <span class="font-medium tabular-nums"> </span></span> <!>',1),lH=$u('<span><span class="text-gray-500">Variance</span> <span class="font-medium tabular-nums"> </span></span>'),cH=$u('<div class="flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-gray-600 pl-[7.5rem]"><!> <!> <!></div>'),uH=$u('<div class="flex flex-col gap-2 pt-2 border-t border-gray-200"><div class="flex items-center gap-3"><label for="field-binned-config" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Show</label> <select id="field-binned-config" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm bg-white"></select></div> <!></div>'),dH=$u('<div class="text-sm text-red-600 bg-red-50 border border-red-200 rounded-md p-2"> </div>'),hH=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Generating...</span>'),fH=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Saving...</span>'),pH=$u('<div class="text-sm text-red-600 bg-red-50 border border-red-200 rounded-md p-2"> </div>'),gH=$u('<span class="text-gray-400 mx-1">&bull;</span> <span> </span>',1),mH=$u('<span class="text-gray-400 mx-1">&bull;</span> <span> </span>',1),yH=$u('<div class="text-gray-500"> </div>'),_H=$u('<div class="text-xs text-gray-600 bg-gray-50 border border-gray-200 rounded-md p-2 flex flex-col gap-1"><div><span class="font-semibold text-gray-900"> </span> <!> <!></div> <!></div>'),vH=$u("<li> </li>"),bH=$u('<div class="text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded-md p-2"><div class="font-semibold mb-1">Warnings</div> <ul class="list-disc pl-4 space-y-0.5"></ul></div>'),xH=$u('<div class="flex flex-col gap-3 p-4 bg-white border border-gray-200 rounded-lg"><!> <div class="flex items-center justify-between"><div class="text-sm text-gray-600"><span class="font-medium">Field zones overview</span> <span class="text-gray-400 mx-1">&bull;</span> <span class="text-xs">no equipment required</span></div> <button type="button" class="p-1.5 rounded-md hover:bg-gray-100 text-gray-500 hover:text-gray-700 transition-colors" title="Settings"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></button></div> <!> <!> <!> <div class="flex gap-2"><button><!></button> <button><!></button> <!></div> <!> <!> <!></div>');function wH(e,t){Zs(t,!0);const r=fh(t,"farmFieldId",3,null),n=fh(t,"cropZoneId",3,null),i=fh(t,"advisoryMessage",3,null),o=fh(t,"vriMode",3,null),a=fh(t,"isAdmin",3,!1);let s=$l("auto"),l=$l(""),c=$l(Jl(function(e){const t=new Date;return t.setDate(t.getDate()+e),t.toISOString().split("T")[0]}(-1))),u=$l(Jl(yU("field_binned"))),d=$l(!1),h=$l(!1),f=$l(null),p=$l(null),g=$l(!1);const m="advanced";let y=$l(""),_=$l(""),v=$l(""),b=$l(""),x=$l(""),w=$l(Jl(t.vriSettings.capMinPct)),S=$l(Jl(t.vriSettings.capMaxPct)),k=$l(Jl(t.vriSettings.targetMinPct)),T=$l(Jl(t.vriSettings.targetMaxPct)),I=$l(Jl(t.vriSettings.method)),M=$l(Jl(t.vriSettings.signals)),E=$l(Jl(t.vriSettings.shrinkageAlpha)),P=$l(Jl(t.vriSettings.bufferSizeMeter)),A=$l(Jl([])),C=$l(0),R=$l(null),L=$l(null),O=$l(null),D=$l(null),z=$l(Jl([])),F=$l(null),N=$l(!1);Tc((()=>{yu(s),yu(l),yu(c),n(),yu(y),yu(_),yu(v),yu(b),yu(x),yu(w),yu(S),yu(k),yu(T),yu(I),yu(M),yu(E),yu(P),ql(g,!1),ql(A,[],!0),ql(R,null)}));function B(){const e={method:yu(I),reference_date_used:yu(c)};return"number"==typeof yu(x)&&(e.field_irrigation_volume=yu(x)),e}function j(e,t={}){const{features:r,...n}=e,i={total_zones:e.num_zones??e.features.length};return{type:"FeatureCollection",features:e.features,properties:{...B(),...t,...n,...i}}}function V(){return"number"==typeof yu(x)?yu(x):0}var G=xH(),U=uc(G),$=e=>{var t=J$(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,i()))),Yu(e,t)};ad(U,(e=>{i()&&e($)}));var H=hc(U,2);hc(uc(H),2).__click=()=>ql(N,!yu(N)),Os(H);var q=hc(H,2),W=e=>{var r=nH(),n=uc(r),i=e=>{var r=Q$(),n=hc(uc(r),2);n.__change=e=>t.onVriModeChange(e.target.value);var i=uc(n);i.value=i.__value="equipment";var a,s=hc(i);s.value=s.__value="field_binned",Os(n),Id(n),Os(r),Pc((()=>{a!==(a=o())&&(n.value=(n.__value=o())??"",Td(n,o()))})),Yu(e,r)};ad(n,(e=>{o()&&t.onVriModeChange&&e(i)}));var d=hc(n,2),h=hc(uc(d),2);Ld(h),Os(d);var f=hc(d,2),p=hc(uc(f),2),g=uc(p);g.value=g.__value="range";var m=hc(g);m.value=m.__value="auto";var A=hc(m);A.value=A.__value="fixed",Os(p),Os(f);var C=hc(f,2),R=e=>{var t=tH(),r=uc(t),n=uc(r,!0);Os(r);var i=hc(r,2),o=uc(i),a=uc(o,!0);Os(o),o.value=o.__value="",Il(hc(o),16,(()=>[2,3,4,5,6,7,8,10,12,15,20]),Tl,((e,t)=>
31{var r=eH(),n=uc(r);Os(r);var i={};Pc((()=>{Ju(n,`${t??""} zones`),i!==(i=t)&&(r.value=(r.__value=t)??"")})),Yu(e,r)})),Os(i),Os(t),Pc((()=>{Ju(n,"range"===yu(s)?"Up to":"Zones"),Ju(a,"range"===yu(s)?"Backend default":"Required")})),Md(i,(()=>yu(l)),(e=>ql(l,e))),Yu(e,t)};ad(C,(e=>{"auto"!==yu(s)&&e(R)}));var L=hc(C,2),O=hc(uc(L),2);Ld(O),Os(L);var D=hc(L,2),z=hc(uc(D),2);Ld(z),Os(D);var F=hc(D,2);N$(F,{get fieldId(){return t.fieldId},get isAdmin(){return a()},get onSaved(){return t.onVriSettingsSaved},get capMinPct(){return yu(w)},set capMinPct(e){ql(w,e,!0)},get capMaxPct(){return yu(S)},set capMaxPct(e){ql(S,e,!0)},get targetMinPct(){return yu(k)},set targetMinPct(e){ql(k,e,!0)},get targetMaxPct(){return yu(T)},set targetMaxPct(e){ql(T,e,!0)},get method(){return yu(I)},set method(e){ql(I,e,!0)},get signals(){return yu(M)},set signals(e){ql(M,e,!0)},get shrinkageAlpha(){return yu(E)},set shrinkageAlpha(e){ql(E,e,!0)},get bufferSizeMeter(){return yu(P)},set bufferSizeMeter(e){ql(P,e,!0)}});var N=hc(F,2),B=e=>{var t=rH(),r=uc(t);L$(r,{get method(){return yu(I)},set method(e){ql(I,e,!0)},get signals(){return yu(M)},set signals(e){ql(M,e,!0)},get shrinkageAlpha(){return yu(E)},set shrinkageAlpha(e){ql(E,e,!0)},get bufferSizeMeter(){return yu(P)},set bufferSizeMeter(e){ql(P,e,!0)}});var n=hc(r,2),i=uc(n),o=hc(uc(i),2);Ld(o),Os(i);var a=hc(i,2),s=hc(uc(a),2);Ld(s),Os(a);var l=hc(a,2),c=hc(uc(l),2);Ld(c),Os(l);var u=hc(l,2),d=hc(uc(u),2);Ld(d),Os(u),Os(n),Os(t),Kd(o,(()=>yu(y)),(e=>ql(y,e))),Kd(s,(()=>yu(_)),(e=>ql(_,e))),Kd(c,(()=>yu(v)),(e=>ql(v,e))),Kd(d,(()=>yu(b)),(e=>ql(b,e))),Yu(e,t)};ad(N,(e=>{a()&&e(B)})),Os(r),Kd(h,(()=>yu(u)),(e=>ql(u,e))),Md(p,(()=>yu(s)),(e=>ql(s,e))),Kd(O,(()=>yu(c)),(e=>ql(c,e))),Kd(z,(()=>yu(x)),(e=>ql(x,e))),Yu(e,r)};ad(q,(e=>{yu(N)&&e(W)}));var Z=hc(q,2),Y=e=>{var r,n=uH(),i=uc(n),o=hc(uc(i),2);o.__change=e=>function(e){ql(C,e,!0);const r=yu(A)[e];r&&(ql(L,r.num_zones,!0),t.onZonesGenerated(j(r,yu(R)?.properties??{}),V()))}(Number(e.target.value)),Il(o,21,(()=>yu(A)),Tl,((e,t,r)=>{var n=iH(),i=uc(n),o=hc(i),a=e=>{var r=Wu();Pc((e=>Ju(r,`· R²=${e??""}`)),[()=>yu(t).r_squared.toFixed(2)]),Yu(e,r)};ad(o,(e=>{null!=yu(t).r_squared&&e(a)}));var s=hc(o,2),l=e=>{var r=Wu();Pc((e=>Ju(r,`· ΔR²=${e??""}`)),[()=>yu(t).marginal_r2.toFixed(2)]),Yu(e,r)};ad(s,(e=>{null!=yu(t).marginal_r2&&e(l)}));var c=hc(s,2),u=e=>{var r=Wu();Pc((e=>Ju(r,`· ${e??""}% avg`)),[()=>yu(t).weighted_avg_irrigation_percentage.toFixed(1)]),Yu(e,r)};ad(c,(e=>{null!=yu(t).weighted_avg_irrigation_percentage&&e(u)}));var d=hc(c,2),h=e=>{var r=Wu();Pc((e=>Ju(r,`· Δ ${yu(t).total_irrigation_savings_percentage>0?"+":""}${e??""}%`)),[()=>yu(t).total_irrigation_savings_percentage.toFixed(2)]),Yu(e,r)};ad(d,(e=>{(yu(t).total_baseline_irrigation_m3??0)>0&&null!=yu(t).total_irrigation_savings_percentage&&e(h)})),Os(n),n.value=n.__value=r,Pc((()=>Ju(i,`${yu(t).num_zones??""} zone${1===yu(t).num_zones?"":"s"} `))),Yu(e,n)})),Os(o),Id(o),Os(i);var a=hc(i,2),s=e=>{const t=Dl((()=>yu(A)[yu(C)]));var r=cH(),n=uc(r),i=e=>{var r=oH(),n=hc(uc(r),2),i=uc(n);Os(n),Os(r),Pc((e=>Ju(i,`${e??""} ha`)),[()=>(yu(t).total_area_m2/1e4).toFixed(2)]),Yu(e,r)};ad(n,(e=>{null!=yu(t).total_area_m2&&e(i)}));var o=hc(n,2),a=e=>{var r=sH(),n=dc(r),i=hc(uc(n),2),o=uc(i);Os(i),Os(n);var a=hc(n,2),s=hc(uc(a),2),l=uc(s);Os(s),Os(a);var c=hc(a,2),u=e=>{var r=aH(),n=hc(uc(r),2),i=uc(n);Os(n),Os(r),Pc((e=>Ju(i,`${yu(t).total_irrigation_difference_m3>0?"+":""}${e??""} m³`)),[()=>yu(t).total_irrigation_difference_m3.toFixed(2)]),Yu(e,r)};ad(c,(e=>{null!=yu(t).total_irrigation_difference_m3&&e(u)})),Pc(((e,t)=>{Ju(o,`${e??""} m³`),Ju(l,`${t??""} m³`)}),[()=>yu(t).total_baseline_irrigation_m3?.toFixed(1),()=>yu(t).total_recommended_irrigation_m3?.toFixed(1)]),Yu(e,r)};ad(o,(e=>{(yu(t).total_baseline_irrigation_m3??0)>0&&e(a)}));var s=hc(o,2),l=e=>{var r=lH(),n=hc(uc(r),2),i=uc(n);Os(n),Os(r),Pc((e=>Ju(i,`${e??""}%`)),[()=>yu(t).variance_captured_pct.toFixed(0)]),Yu(e,r)};ad(s,(e=>{null!=yu(t).variance_captured_pct&&e(l)})),Os(r),Yu(e,r)};ad(a,(e=>{yu(A)[yu(C)]&&e(s)})),Os(n),Pc((()=>{r!==(r=yu(C))&&(o.value=(o.__value=yu(C))??"",Td(o,yu(C)))})),Yu(e,n)};ad(Z,(e=>{yu(A).length>1&&e(Y)}));var X=hc(Z,2),K=e=>{var t=dH(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(f)))),Yu(e,t)};ad(X,(e=>{yu(f)&&e(K)}));var J=hc(X,2),Q=uc(J);Q.__click=async function(){ql(d,!0),ql(f,null),ql(p,null),ql(z,[],!0),ql(A,[],!0),ql(R,null),ql(L,null),ql(O,null),ql(F,null);try{const e=await function(e){return bU.apply(this,arguments)}({fieldId:t.fieldId,imageryDate:yu(c),cropZoneId:n()??void 0,mode:yu(s),numZones:"number"==typeof yu(l)?yu(l):void 0,dataSource:m||void 0,smoothingWindow:"number"==typeof yu(y)?yu(y):void 0,spatialWeight:"number"==typeof yu(_)?yu(_):void 0,valueWeight:"number"==typeof yu(v)?yu(v):void 0,minMarginalR2:"number"==typeof yu(b)?yu(b):void 0,fieldIrrigationVolume:"number"==typeof yu(x)?yu(x):void 0,minIrrigationPct:yu(w),maxIrrigationPct:yu(S),targetMinPct:yu(k),targetMaxPct:yu(T),method:yu(I),signals:"custom"===yu(I)?yu(M):null,
31shrinkageAlpha:yu(E),bufferSizeMeter:yu(P)}),r=e.zones_geojson.properties??{};ql(D,r.field_area_ha??null,!0),ql(F,r.max_allowed??null,!0);const i=r.advanced_metadata;if(ql(z,Array.isArray(i?.warnings)?i.warnings:[],!0),"FeatureCollectionList"===e.zones_geojson.type){const n=e.zones_geojson;if(ql(A,n.configurations??[],!0),ql(R,n,!0),0===yu(A).length)return void ql(f,"Backend returned no configurations.");const i=function(e){if(e.length<=1)return 0;const t="number"==typeof yu(b)?yu(b):.01;for(let r=3;r<e.length;r++)if((e[r].r_squared??0)-(e[r-3].r_squared??0)<t)return r-3;return e.length-1}(yu(A));ql(C,i,!0);const o=yu(A)[i];return ql(L,o.num_zones,!0),ql(O,r.selection_reason??`Auto-selected ${o.num_zones} zones (R²=${(o.r_squared??0).toFixed(2)})`,!0),ql(g,!0),void t.onZonesGenerated(j(o,n.properties??{}),V())}const o=_U(e.zones_geojson);if(!o)return void ql(f,"Backend returned no zones.");ql(L,r.num_zones??o.features.length,!0),ql(O,r.selection_reason??null,!0),ql(g,!0),t.onZonesGenerated(function(e){const t=e.properties??{};return e.properties={...B(),...t},e}(o),V())}catch(e){console.error("Error generating field-binned VRI:",e),ql(f,e instanceof Error?e.message:"Failed to generate field zones.",!0)}finally{ql(d,!1)}};var ee=uc(Q),te=e=>{Yu(e,hH())},re=e=>{Yu(e,Wu("Generate Field Zones"))};ad(ee,(e=>{yu(d)?e(te):e(re,!1)})),Os(Q);var ne=hc(Q,2);ne.__click=async function(){ql(h,!0),ql(p,null);try{const e=yu(R)&&yu(A).length>0,i=e?yu(A)[yu(C)]:null,o=await function(e){return xU.apply(this,arguments)}({fieldId:t.fieldId,imageryDate:yu(c),numZones:i?.num_zones??("number"==typeof yu(l)?yu(l):void 0),farmFieldId:r()??void 0,planName:yu(u).trim()||void 0,cropZoneId:n()??void 0,dataSource:m||void 0,smoothingWindow:"number"==typeof yu(y)?yu(y):void 0,spatialWeight:"number"==typeof yu(_)?yu(_):void 0,valueWeight:"number"==typeof yu(v)?yu(v):void 0,minMarginalR2:"number"==typeof yu(b)?yu(b):void 0,fieldIrrigationVolume:"number"==typeof yu(x)?yu(x):void 0,minIrrigationPct:yu(w),maxIrrigationPct:yu(S),targetMinPct:yu(k),targetMaxPct:yu(T),mode:e?void 0:yu(s),fieldBinnedData:e?yu(R):void 0,selectedConfigIndex:e?yu(C):void 0,method:yu(I),signals:"custom"===yu(I)?yu(M):null,shrinkageAlpha:yu(E),bufferSizeMeter:yu(P)});ql(u,yU("field_binned"),!0),t.onPlanSaved?.(o)}catch(e){console.error("Error saving field-binned VRI plan:",e),ql(p,e instanceof Error?e.message:"Failed to save plan.",!0)}finally{ql(h,!1)}};var ie=uc(ne),oe=e=>{Yu(e,fH())},ae=e=>{Yu(e,Wu("Save"))};ad(ie,(e=>{yu(h)?e(oe):e(ae,!1)})),Os(ne);var se=hc(ne,2),le=e=>{{let i=Dl((()=>"custom"===yu(I)?yu(M):null));k$(e,{get fieldId(){return t.fieldId},get farmFieldId(){return r()},get cropZoneId(){return n()},dataSource:m,get imageryDate(){return yu(c)},get method(){return yu(I)},get signals(){return yu(i)},get shrinkageAlpha(){return yu(E)},get bufferSizeMeter(){return yu(P)}})}};ad(se,(e=>{a()&&e(le)})),Os(J);var ce=hc(J,2),ue=e=>{var t=pH(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(p)))),Yu(e,t)};ad(ce,(e=>{yu(p)&&e(ue)}));var de=hc(ce,2),he=e=>{var t=_H(),r=uc(t),n=uc(r),i=uc(n);Os(n);var o=hc(n,2),a=e=>{var t=gH(),r=hc(dc(t),2),n=uc(r);Os(r),Pc((e=>Ju(n,`${e??""} ha`)),[()=>yu(D).toFixed(1)]),Yu(e,t)};ad(o,(e=>{null!=yu(D)&&e(a)}));var s=hc(o,2),l=e=>{var t=mH(),r=hc(dc(t),2),n=uc(r);Os(r),Pc((()=>Ju(n,`max ${yu(F)??""}`))),Yu(e,t)};ad(s,(e=>{null!=yu(F)&&e(l)})),Os(r);var c=hc(r,2),u=e=>{var t=yH(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(O)))),Yu(e,t)};ad(c,(e=>{yu(O)&&e(u)})),Os(t),Pc((()=>Ju(i,`${yu(L)??""} zone${1===yu(L)?"":"s"}`))),Yu(e,t)};ad(de,(e=>{null!=yu(L)&&e(he)}));var fe=hc(de,2),pe=e=>{var t=bH(),r=hc(uc(t),2);Il(r,21,(()=>yu(z)),Tl,((e,t)=>
31{var r=vH(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(t)))),Yu(e,r)})),Os(r),Os(t),Yu(e,t)};ad(fe,(e=>{yu(z).length>0&&e(pe)})),Os(G),Pc((()=>{Q.disabled=yu(d)||yu(h),wd(Q,1,"flex-1 px-4 py-2 rounded-lg font-medium transition-colors "+(yu(d)||yu(h)?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 hover:bg-blue-700 text-white")),ne.disabled=!yu(g)||yu(h)||yu(d),wd(ne,1,"px-4 py-2 rounded-lg font-medium transition-colors "+(!yu(g)||yu(h)||yu(d)?"bg-gray-200 text-gray-500 cursor-not-allowed":"bg-green-600 hover:bg-green-700 text-white")),Fd(ne,"title",yu(g)?"Save this plan":"Generate a preview first")})),Yu(e,G),Ys()}Bu(["click","change"]);var SH=$u('<div class="text-sm text-amber-700 bg-amber-50 border border-amber-200 rounded-md p-3">No hose reel routes found. Please create a hose reel route first.</div>'),kH=$u('<div class="flex items-center gap-1.5"><label for="hr-vri-mode" class="text-[11px] text-gray-500 w-16 flex-shrink-0">Mode</label> <select id="hr-vri-mode" class="flex-1 px-1.5 py-1 border border-gray-300 rounded text-xs bg-white"><option>Equipment-based</option><option>Field zones (no equipment)</option></select></div>'),TH=$u('<label class="flex items-center gap-1.5 px-2 py-1 hover:bg-gray-50 cursor-pointer text-xs"><input type="checkbox" class="w-3 h-3 text-blue-600 border-gray-300 rounded disabled:opacity-50"/> <span class="text-gray-700"> </span></label>'),IH=$u('<div role="listbox" class="absolute z-10 w-full mt-0.5 bg-white border border-gray-300 rounded shadow-lg max-h-40 overflow-y-auto"><label class="flex items-center gap-1.5 px-2 py-1 hover:bg-gray-50 cursor-pointer border-b border-gray-100 text-xs"><input type="checkbox" class="w-3 h-3 text-blue-600 border-gray-300 rounded"/> <span class="font-medium text-gray-900"> </span></label> <!></div>'),MH=$u('<div class="pt-1.5 border-t border-gray-200 flex flex-col gap-1.5"><div class="text-[10px] font-semibold text-gray-500 uppercase tracking-wider">Admin</div> <!></div>'),EH=$u('<div class="relative z-50 flex flex-col gap-1.5 pt-1.5 border-t border-gray-200 bg-white pb-2"><!> <div class="flex items-center gap-1.5"><label for="hr-imagery-date" class="text-[11px] text-gray-500 w-16 flex-shrink-0" title="Reference date — anchor for the analysis window, not a single image.">Reference</label> <input id="hr-imagery-date" type="date" class="flex-1 px-1.5 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div> <div class="flex items-center gap-1.5"><span class="text-[11px] text-gray-500 w-16 flex-shrink-0"> </span> <div class="relative flex-1"><button type="button" aria-haspopup="listbox" class="w-full px-1.5 py-1 border border-gray-300 rounded text-xs text-left bg-white flex items-center justify-between disabled:bg-gray-100"><span class="text-gray-900 truncate"> </span> <svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></button> <!></div></div> <div class="flex items-center gap-1.5"><label for="plan-name" class="text-[11px] text-gray-500 w-16 flex-shrink-0">Name</label> <input id="plan-name" type="text" placeholder="Plan name" class="flex-1 px-1.5 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div> <div class="grid grid-cols-3 gap-1.5"><div><label for="base-amount" class="text-[10px] text-gray-400">Irrigation Volume (mm)</label> <input id="base-amount" type="number" min="0" step="0.1" placeholder="—" class="w-full px-1.5 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div> <div><label for="zone-width" class="text-[10px] text-gray-400">Hose Reel Diameter m</label> <input id="zone-width" type="number" min="10" max="200" step="5" class="w-full px-1.5 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div> <div><label for="zone-height" class="text-[10px] text-gray-400">Zone Size m</label> <input id="zone-height" type="number" min="10" max="200" step="5" class="w-full px-1.5 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div></div> <!> <!></div>'),PH=$u('<div class="flex items-center justify-between"><div class="text-sm text-gray-600"><span class="font-medium"> </span> <span class="text-gray-400 mx-1">&bull;</span> <span class="text-xs"> </span></div> <button type="button" class="p-1.5 rounded-md hover:bg-gray-100 text-gray-500 hover:text-gray-700 transition-colors" title="Plan settings"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></button></div> <!>',1),AH=$u('<div class="text-sm text-green-600 bg-green-50 border border-green-200 rounded-md p-2"> </div>'),CH=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Saving...</span>
31'),RH=$u('<div class="flex gap-2"><button class="flex-1 px-4 py-2 rounded-lg font-medium transition-colors border border-gray-300 text-gray-700 hover:bg-gray-50 disabled:opacity-50">Adjust</button> <button class="flex-1 px-4 py-2 rounded-lg font-medium transition-colors bg-green-600 hover:bg-green-700 text-white disabled:bg-gray-400 disabled:cursor-not-allowed"><!></button></div> <div class="text-xs text-blue-600 bg-blue-50 border border-blue-200 rounded-md p-2">Preview shown on map. Click "Save" to keep, or "Adjust" to change parameters.</div>',1),LH=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Generating Preview...</span>'),OH=$u('<div class="flex gap-2"><button><!></button> <!></div>'),DH=$u('<div class="flex flex-col gap-3 p-4 bg-white border border-gray-200 rounded-lg"><!> <!> <!> <!></div>');function zH(e,t){Zs(t,!0);let r=fh(t,"farmFieldId",3,null),n=fh(t,"cropZoneId",3,null),i=fh(t,"cropZoneBoundary",3,null),o=fh(t,"isAdmin",3,!1),a=fh(t,"vriMode",3,null),s=$l(Jl(t.vriSettings.capMinPct)),l=$l(Jl(t.vriSettings.capMaxPct)),c=$l(Jl(t.vriSettings.targetMinPct)),u=$l(Jl(t.vriSettings.targetMaxPct));let d=$l(Jl(yU("hose_reel"))),h=$l(null),f=$l(Jl(function(e){const t=new Date;return t.setDate(t.getDate()+e),t.toISOString().split("T")[0]}(-1))),p=$l(!1),g=$l(!1),m=$l(null),y=$l(""),_=$l(!1),v=$l(!1);const b="advanced";let x=$l(40),w=$l(70),S=$l(Jl(t.vriSettings.method)),k=$l(Jl(t.vriSettings.signals)),T=$l(Jl(t.vriSettings.shrinkageAlpha)),I=$l(Jl(t.vriSettings.bufferSizeMeter));const M=Dl((()=>({minIrrigationPct:yu(s),maxIrrigationPct:yu(l),targetMinPct:yu(c),targetMaxPct:yu(u),fieldIrrigationVolume:yu(h)??void 0,method:yu(S),signals:"custom"===yu(S)?yu(k):null,shrinkageAlpha:yu(T),bufferSizeMeter:yu(I)})));let E=$l(Jl(new Set)),P=$l(!0),A=$l(!1),C=$l(void 0);function R(e){yu(A)&&yu(C)&&!yu(C).contains(e.target)&&ql(A,!1)}Tc((()=>{if(yu(A))return window.addEventListener("click",R,!0),()=>window.removeEventListener("click",R,!0)}));const L=Dl((()=>i()?t.routes.filter((e=>{try{return DF(e,i())}catch{return!0}})):t.routes)),O=Dl((()=>yu(P)?yu(L):yu(L).filter((e=>{const t=e.properties?.id||e.id;return yu(E).has(t)})))),D=Dl((()=>{if(yu(P))return`All Routes (${t.routes.length})`;if(0===yu(E).size)return"Select routes...";if(1===yu(E).size){const e=Array.from(yu(E))[0],r=t.routes.find((t=>(t.properties?.id||t.id)===e));return r?.properties?.name||`Route ${e}`}return`${yu(E).size} routes selected`}));function z(){ql(P,!yu(P)),yu(P)&&ql(E,new Set,!0)}function F(){return yu(d).trim()?0!==yu(O).length||(ql(m,"Please select at least one route"),!1):(ql(m,"Please enter a plan name"),!1)}async function N(){if(F()){ql(p,!0),ql(m,null),ql(y,"");try{const e=await function(e,t,r,n){return oU.apply(this,arguments)}(yu(O),t.fieldId,yu(d).trim(),yu(h),yu(x),yu(w),r()||void 0,yu(f),!1,b||void 0,n()||void 0,yu(M));if(!e.success){const t=e.errors.map((e=>`${e.routeName}: ${e.error}`)).join("; ");throw new Error(t||"Failed to generate preview for all routes")}ql(_,!0),t.onPreviewGenerated(e.zonesGeojson,yu(h)),e.errors.length>0&&ql(m,`${e.errors.length} route(s) failed preview`)}catch(e){console.error("Error generating hose reel preview:",e),ql(m,e instanceof Error?e.message:"Failed to generate preview",!0)}finally{ql(p,!1)}}}async function B(){if(F()){ql(g,!0),ql(m,null);try{const e=crypto.randomUUID(),i=await function(e,t,r,n){return tU.apply(this,arguments)}(yu(O),t.fieldId,yu(d).trim(),yu(h),yu(x),yu(w),e,r()||void 0,yu(f),b||void 0,!1,n()||void 0,yu(M));if(!(i.successCount>0))throw new Error("Failed to save plans for all routes");{ql(y,`Saved ${i.successCount} plan(s)${i.failureCount>0?` (${i.failureCount} failed)`:""}`);const e=vU(i.plans);ql(_,!1),t.onPlansCreated(i,e),setTimeout((()=>{ql(y,""),ql(d,yU("hose_reel"),!0)}),5e3)}}catch(e){console.error("Error saving hose reel VRI plans:",e),ql(m,e instanceof Error?e.message:"Failed to save plans",!0)}finally{ql(g,!1)}}}function j(){ql(_,!1)}var V=DH(),G=uc(V),U=e=>{Yu(e,SH())},$=e=>{var r=PH(),n=dc(r),i=uc(n),p=uc(i),g=uc(p);Os(p);var m=hc(p,4),y=uc(m);Os(m),Os(i),hc(i,2).__click=()=>ql(v,!yu(v)),Os(n);var b=hc(n,2),M=e=>{var r=EH(),n=uc(r),i=e=>{var r=kH(),n=hc(uc(r),2);n.__change=e=>t.onVriModeChange(e.target.value);var i=uc(n);i.value=i.__value="equipment";var o,s=hc(i);s.value=s.__value="field_binned",Os(n),Id(n),Os(r),Pc((()=>{o!==(o=a())&&(n.value=(n.__value=a())??"",Td(n,a()))})),Yu(e,r)};ad(n,(e=>{a()&&t.onVriModeChange&&e(i)}));var p=hc(n,2),g=hc(uc(p),2);Ld(g),Os(p);var m=hc(p,2),y=uc(m),v=uc(y);Os(y);var b=hc(y,2),M=uc(b);M.__click=()=>ql(A,!yu(A));var R=uc(M),L=uc(R,!0);Os(R);var F=hc(R,2);Os(M);var N=hc(M,2),B=e=>{var r=IH(),n=uc(r),i=uc(n);Ld(i),i.__change=z;var o=hc(i,2),a=uc(o);Os(o),Os(n),Il(hc(n,2),17,(()=>t.routes),Tl,((e,r)=>{const n=Dl((()=>yu(r).properties?.id||yu(r).id)),i=Dl((()=>yu(r).properties?.name||`Route ${yu(n)}`)),o=Dl((()=>yu(P)||yu(E).has(yu(n))));var a=TH(),s=uc(a);Ld(s),s.__change=()=>function(e){const r=new Set(yu(E));r.has(e)?r.delete(e):r.add(e),ql(E,r,!0),ql(P,!1),r.size===t.routes.length&&(ql(P,!0),ql(E,new Set,!0))}(yu(n));var l=hc(s,2),c=uc(l,!0);Os(l),Os(a),Pc((()=>{Dd(s,yu(o)),s.disabled=yu(P),Ju(c,yu(i))})),Yu(e,a)})),Os(r),Pc((()=>{Dd(i,yu(P)),Ju(a,`All (${t.routes.length??""})`)})),Yu(e,r)};ad(N,(e=>{yu(A)&&e(B)})),Os(b),nh(b,(e=>ql(C,e)),(()=>yu(C))),Os(m);var j=hc(m,2),V=hc(uc(j),2);Ld(V),Os(j);var G=hc(j,2),U=uc(G),$=hc(uc(U),2);Ld($),Os(U);var H=hc(U,2),q=hc(uc(H),2);Ld(q),Os(H);var W=hc(H,2),Z=hc(uc(W),2);Ld(Z),Os(W),Os(G);var Y=hc(G,2);N$(Y,{get fieldId(){return t.fieldId},get isAdmin(){return o()},get onSaved(){return t.onVriSettingsSaved},get capMinPct(){return yu(s)},set capMinPct(e){ql(s,e,!0)},get capMaxPct(){return yu(l)},set capMaxPct(e){ql(l,e,!0)},get targetMinPct(){return yu(c)},set targetMinPct(e){ql(c,e,!0)},get targetMaxPct(){return yu(u)},set targetMaxPct(e){ql(u,e,!0)},get method(){return yu(S)},set method(e){ql(S,e,!0)},get signals(){return yu(k)},set signals(e){ql(k,e,!0)},get shrinkageAlpha(){return yu(T)},set shrinkageAlpha(e){ql(T,e,!0)},get bufferSizeMeter(){return yu(I)},set bufferSizeMeter(e){ql(I,e,!0)}});var X=hc(Y,2),K=e=>{var t=MH();L$(hc(uc(t),2),{get disabled(){return yu(_)},get method(){return yu(S)},set method(e){ql(S,e,!0)},get signals(){return yu(k)},set signals(e){ql(k,e,!0)},get shrinkageAlpha(){return yu(T)},set shrinkageAlpha(e){ql(T,e,!0)},get bufferSizeMeter(){return yu(I)},set bufferSizeMeter(e){ql(I,e,!0)}}),Os(t),Yu(e,t)};ad(X,(e=>{o()&&e(K)})),Os(r),Pc((()=>{g.disabled=yu(_),Ju(v,`Routes (${yu(O).length??""})`),M.disabled=yu(_),Fd(M,"aria-expanded",yu(A)),Ju(L,yu(D)),wd(F,0,"w-3 h-3 text-gray-400 flex-shrink-0 "+(yu(A)?"rotate-180":"")),V.disabled=yu(_),$.disabled=yu(_),q.disabled=yu(_),Z.disabled=yu(_)})),Kd(g,(()=>yu(f)),(e=>ql(f,e))),Kd(V,(()=>yu(d)),(e=>ql(d,e))),Kd($,(()=>yu(h)),(e=>ql(h,e))),Kd(q,(()=>yu(w)),(e=>ql(w,e))),Kd(Z,(()=>yu(x)),(e=>ql(x,e))),Yu(e,r)};ad(b,(e=>{yu(v)&&e(M)})),Pc((()=>{Ju(g,`${yu(O).length??""} route${1!==yu(O).length?"s":""}`),Ju(y,`${yu(w)??""}m diameter · ${yu(x)??""}m zone`)})),Yu(e,r)};ad(G,(e=>{0===t.routes.length?e(U):e($,!1)}));var H=hc(G,2);AU(H,{get message(){return yu(m)},onClose:()=>ql(m,null)});var q=hc(H,2),W=e=>{var t=AH(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(y)))),Yu(e,t)};ad(q,(e=>{yu(y)&&e(W)}));var Z=hc(q,2),Y=e=>{var i=Zu(),a=dc(i),s=e=>{var t=RH(),r=dc(t),n=uc(r);n.__click=j;var i=hc(n,2);i.__click=B;var o=uc(i),a=e=>{Yu(e,CH())},s=e=>{var t=Wu();Pc((()=>Ju(t,"Save Plan"+(yu(O).length>
311?"s":"")))),Yu(e,t)};ad(o,(e=>{yu(g)?e(a):e(s,!1)})),Os(i),Os(r),Ds(2),Pc((()=>{n.disabled=yu(g),i.disabled=yu(g)})),Yu(e,t)},l=e=>{var i=OH(),a=uc(i);a.__click=()=>N();var s=uc(a),l=e=>{Yu(e,LH())},c=e=>{Yu(e,Wu("Generate Preview"))};ad(s,(e=>{yu(p)?e(l):e(c,!1)})),Os(a);var u=hc(a,2),h=e=>{{let i=Dl((()=>"custom"===yu(S)?yu(k):null));k$(e,{get fieldId(){return t.fieldId},get farmFieldId(){return r()},get cropZoneId(){return n()},dataSource:b,get imageryDate(){return yu(f)},get method(){return yu(S)},get signals(){return yu(i)},get shrinkageAlpha(){return yu(T)},get bufferSizeMeter(){return yu(I)}})}};ad(u,(e=>{o()&&e(h)})),Os(i),Pc(((e,t)=>{a.disabled=e,wd(a,1,t)}),[()=>yu(p)||!yu(d).trim()||0===yu(O).length,()=>"flex-1 px-4 py-2 rounded-lg font-medium transition-colors "+(yu(p)||!yu(d).trim()||0===yu(O).length?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 hover:bg-blue-700 text-white")]),Yu(e,i)};ad(a,(e=>{yu(_)?e(s):e(l,!1)})),Yu(e,i)};ad(Z,(e=>{t.routes.length>0&&e(Y)})),Os(V),Yu(e,V),Ys()}Bu(["click","change"]);var FH=$u('<div class="text-sm text-gray-600"><span class="font-medium"> </span> <span class="text-gray-400 mx-1">&bull;</span> <span class="text-xs"> </span></div>'),NH=$u('<div class="flex items-center gap-3"><label for="pivot-vri-mode" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Mode</label> <select id="pivot-vri-mode" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 bg-white"><option>Equipment-based</option><option>Field zones (no equipment)</option></select></div>'),BH=$u('<div class="flex items-center gap-3"><label for="zone-degrees" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Deg/Zone</label> <input id="zone-degrees" type="number" min="1" max="90" step="1" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 disabled:bg-gray-100 disabled:text-gray-500"/> <span class="text-xs text-gray-400 flex-shrink-0"> </span></div>'),jH=$u('<div class="flex items-center gap-3"><label for="min-sector-width" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Min Width</label> <input id="min-sector-width" type="number" min="1" max="90" step="1" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 disabled:bg-gray-100 disabled:text-gray-500"/> <span class="text-xs text-gray-400 flex-shrink-0">deg</span></div> <div class="flex items-center gap-3"><label for="angle-increment" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Increment</label> <input id="angle-increment" type="number" min="0.5" max="10" step="0.5" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 disabled:bg-gray-100 disabled:text-gray-500"/> <span class="text-xs text-gray-400 flex-shrink-0">deg</span></div>',1),VH=$u('<div class="pt-2 border-t border-gray-100 flex flex-col gap-2"><div class="text-[10px] font-semibold text-gray-500 uppercase tracking-wider">Admin</div> <!> <div class="grid grid-cols-3 gap-2"><div><label for="pivot-upsample" class="text-[10px] text-gray-400" title="Sector speed control upsample factor. Optimised mode only. Default 5.">Upsample</label> <input id="pivot-upsample" type="number" min="1" max="10" step="1" class="w-full px-2 py-1 border border-gray-300 rounded text-xs disabled:bg-gray-100"/></div></div></div>'),GH=$u('<div class="flex flex-col gap-3 pt-2 border-t border-gray-200"><!> <div class="flex items-center gap-3"><label for="imagery-date" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0" title="Anchor for the analysis window. Zones are generated from imagery up to this date, not from a single image.">Reference date</label> <input id="imagery-date" type="date" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 disabled:bg-gray-100 disabled:text-gray-500"/></div> <div class="flex items-center gap-3"><label for="plan-name" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Plan Name</label> <input id="plan-name" type="text" placeholder="Enter plan name" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 disabled:bg-gray-100 disabled:text-gray-500"/></div> <!> <!> <div class="flex items-center gap-3"><label for="base-amount" class="text-sm font-medium text-gray-700 w-28 flex-shrink-0">Irrigation Volume (mm)</label> <input id="base-amount" type="number" min="0" step="0.1" placeholder="—" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 disabled:bg-gray-100 disabled:text-gray-500"/></div> <!> <!></div>'),UH=$u("<option> <!> <!> <!></option>"),$H=$u('<span><span class="text-gray-500">Area</span> <span class="font-medium tabular-nums"> </span></span>'),HH=$u('<span><span class="text-gray-500">Δ</span> <span class="font-medium tabular-nums"> </span></span>'),qH=$u('<span><span class="text-gray-500">Baseline</span> <span class="font-medium tabular-nums"> </span></span> <span><span class="text-gray-500">Recom.</span> <span class="font-medium tabular-nums"> </span></span> <!>',1),WH=$u('<span><span class="text-gray-500">Variance</span> <span class="font-medium tabular-nums"> </span></span>'),ZH=$u('<div class="text-xs text-gray-500"> </div> <div class="flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-gray-600"><!> <!> <!></div>',1),YH=$u('<div class="flex flex-col gap-2 pt-2 border-t border-gray-200"><label for="config-select" class="text-xs font-medium text-gray-600"> </label> <select id="config-select" class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white"></select> <!></div>'),XH=$u('<div class="text-sm text-green-600 bg-green-50 border border-green-200 rounded-md p-2"> </div>'),KH=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Saving...</span>'),JH=$u('<div class="flex gap-2"><button class="flex-1 px-4 py-2 rounded-lg font-medium transition-colors border border-gray-300 text-gray-700 hover:bg-gray-50 disabled:opacity-50">Adjust</button> <button class="flex-1 px-4 py-2 rounded-lg font-medium transition-colors bg-green-600 hover:bg-green-700 text-white disabled:bg-gray-400 disabled:cursor-not-allowed"><!></button></div> <div class="text-xs text-blue-600 bg-blue-50 border border-blue-200 rounded-md p-2">Preview shown on map. Click "Save Plan" to keep it, or "Adjust" to change parameters.</div>
31',1),QH=$u('<span class="flex items-center justify-center gap-2"><div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Generating Preview...</span>'),eq=$u('<div class="flex gap-2"><button><!></button> <!></div>'),tq=$u('<div class="flex flex-col gap-3 p-4 bg-white border border-gray-200 rounded-lg"><div class="flex items-center justify-between"><!> <button type="button" class="p-1.5 rounded-md hover:bg-gray-100 text-gray-500 hover:text-gray-700 transition-colors" title="Plan settings"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></button></div> <div class="flex rounded-lg border border-gray-300 overflow-hidden"><button type="button">Fixed Zones</button> <button type="button">Dynamic Zones</button></div> <!> <!> <!> <!> <!></div>');function rq(e,t){Zs(t,!0);let r=fh(t,"farmFieldId",3,null),n=fh(t,"cropZoneId",3,null),i=fh(t,"isAdmin",3,!1),o=fh(t,"vriMode",3,null),a=$l(Jl(t.vriSettings.capMinPct)),s=$l(Jl(t.vriSettings.capMaxPct)),l=$l(Jl(t.vriSettings.targetMinPct)),c=$l(Jl(t.vriSettings.targetMaxPct));let u=$l(Jl(yU("pivot"))),d=$l(6),h=$l(null),f=$l(Jl(function(e){const t=new Date;return t.setDate(t.getDate()+e),t.toISOString().split("T")[0]}(-1))),p=$l(!1),g=$l(!1),m=$l(null),y=$l(""),_=$l(null),v=$l(!1),b=$l(!1),x=$l("sector_speed_control");const w="advanced";let S=$l(6),k=$l(1),T=$l(Jl([])),I=$l(0),M=$l(null),E=$l(5),P=$l(Jl(t.vriSettings.method)),A=$l(Jl(t.vriSettings.signals)),C=$l(Jl(t.vriSettings.shrinkageAlpha)),R=$l(Jl(t.vriSettings.bufferSizeMeter));const L=Dl((()=>Math.round(360/yu(d)))),O=Dl((()=>yu(T).length>0?yu(T)[yu(I)]:null));function D(){if(!yu(u).trim())return ql(m,"Please enter a plan name"),!1;if(!t.pivotExtent)return ql(m,"No pivot extent available"),!1;if("zone_angle"===yu(x)){if(yu(d)<1||yu(d)>90)return ql(m,"Degrees per zone must be between 1 and 90"),!1}else{if(yu(S)<1||yu(S)>90)return ql(m,"Min sector width must be between 1 and 90"),!1;if(yu(k)<.5||yu(k)>10)return ql(m,"Angle increment must be between 0.5 and 10"),!1}return!(null!=yu(h)&&yu(h)<=0)||(ql(m,"Irrigation volume must be greater than 0"),!1)}function z(){return{pivotExtentId:t.pivotExtent.id,planName:yu(u).trim(),baseIrrigationAmount:yu(h),farmFieldId:r()||void 0,imageryDate:yu(f),dataSource:w||void 0,cropZoneId:n()||void 0,fieldIrrigationVolume:yu(h)??void 0,minIrrigationPct:yu(a),maxIrrigationPct:yu(s),targetMinPct:yu(l),targetMaxPct:yu(c),upsampleFactor:yu(E),method:yu(P),signals:"custom"===yu(P)?yu(A):null,shrinkageAlpha:yu(C),bufferSizeMeter:yu(R)}}async function F(){if(D()){ql(p,!0),ql(m,null),ql(y,"");try{if("zone_angle"===yu(x)){const e=await function(e){return nU.apply(this,arguments)}({...z(),zoneAngle:yu(d)}),r=_U(e.zones_geojson);r&&(ql(_,r,!0),ql(v,!0),ql(T,[],!0),ql(M,null),t.onPreviewGenerated(r,yu(h)))}else{const e=await function(e){return aU.apply(this,arguments)}({...z(),minSectorWidth:yu(S),angleIncrement:yu(k)});if(ql(T,e.configurations,!0),ql(M,{metadata:e.metadata,results:e.configurations.map(((t,r)=>{const n=e.metadata?._raw_results;return n?.[r]??t}))},!0),ql(M,e,!0),yu(T).length>0){let e=0;for(let t=1;t<yu(T).length&&yu(T)[t].marginal_r2>=.02;t++)e=t;ql(I,e,!0);const r=yu(T)[e];ql(_,r.zones_geojson,!0),ql(v,!0),t.onPreviewGenerated(r.zones_geojson,yu(h))}}}catch(e){console.error("Error generating pivot VRI preview:",e),ql(m,e instanceof Error?e.message:"Failed to generate preview",!0)}finally{ql(p,!1)}}}async function N(){if(D()){ql(g,!0),ql(m,null);try{let e;
31e="sector_speed_control"===yu(x)&&yu(M)?await function(e,t,r){return sU.apply(this,arguments)}(z(),yu(I),yu(M)):await function(e){return JG.apply(this,arguments)}({...z(),zoneAngle:yu(d)}),ql(y,"Plan saved successfully"),ql(v,!1),ql(_,null),ql(T,[],!0),ql(M,null),t.onPlanCreated(e,yu(h)),setTimeout((()=>{ql(y,"")}),5e3)}catch(e){console.error("Error saving pivot VRI plan:",e),ql(m,e instanceof Error?e.message:"Failed to save plan",!0)}finally{ql(g,!1)}}}function B(){ql(v,!1),ql(_,null),ql(T,[],!0),ql(M,null)}function j(e){yu(v)&&B(),ql(x,e,!0)}var V=tq(),G=uc(V),U=uc(G),$=e=>{var r=FH(),n=uc(r),i=uc(n,!0);Os(n);var o=hc(n,4),a=uc(o);Os(o),Os(r),Pc((e=>{Ju(i,t.pivotExtent.name||`Pivot ${t.pivotExtent.id}`),Ju(a,`${e??""}m`)}),[()=>t.pivotExtent.radius_meters?.toFixed(0)||"?"]),Yu(e,r)};ad(U,(e=>{t.pivotExtent&&e($)})),hc(U,2).__click=()=>ql(b,!yu(b)),Os(G);var H=hc(G,2),q=uc(H);q.__click=()=>j("zone_angle");var W=hc(q,2);W.__click=()=>j("sector_speed_control"),Os(H);var Z=hc(H,2),Y=e=>{var r=GH(),n=uc(r),p=e=>{var r=NH(),n=hc(uc(r),2);n.__change=e=>t.onVriModeChange(e.target.value);var i=uc(n);i.value=i.__value="equipment";var a,s=hc(i);s.value=s.__value="field_binned",Os(n),Id(n),Os(r),Pc((()=>{a!==(a=o())&&(n.value=(n.__value=o())??"",Td(n,o()))})),Yu(e,r)};ad(n,(e=>{o()&&t.onVriModeChange&&e(p)}));var g=hc(n,2),m=hc(uc(g),2);Ld(m),Os(g);var y=hc(g,2),_=hc(uc(y),2);Ld(_),Os(y);var b=hc(y,2),w=e=>{var t=BH(),r=hc(uc(t),2);Ld(r);var n=hc(r,2),i=uc(n);Os(n),Os(t),Pc((()=>{r.disabled=yu(v),Ju(i,`${yu(L)??""} zones`)})),Kd(r,(()=>yu(d)),(e=>ql(d,e))),Yu(e,t)};ad(b,(e=>{"zone_angle"===yu(x)&&e(w)}));var T=hc(b,2),I=e=>{var t=jH(),r=dc(t),n=hc(uc(r),2);Ld(n),Ds(2),Os(r);var i=hc(r,2),o=hc(uc(i),2);Ld(o),Ds(2),Os(i),Pc((()=>{n.disabled=yu(v),o.disabled=yu(v)})),Kd(n,(()=>yu(S)),(e=>ql(S,e))),Kd(o,(()=>yu(k)),(e=>ql(k,e))),Yu(e,t)};ad(T,(e=>{"sector_speed_control"===yu(x)&&e(I)}));var M=hc(T,2),O=hc(uc(M),2);Ld(O),Os(M);var D=hc(M,2);N$(D,{get fieldId(){return t.fieldId},get isAdmin(){return i()},get onSaved(){return t.onVriSettingsSaved},get capMinPct(){return yu(a)},set capMinPct(e){ql(a,e,!0)},get capMaxPct(){return yu(s)},set capMaxPct(e){ql(s,e,!0)},get targetMinPct(){return yu(l)},set targetMinPct(e){ql(l,e,!0)},get targetMaxPct(){return yu(c)},set targetMaxPct(e){ql(c,e,!0)},get method(){return yu(P)},set method(e){ql(P,e,!0)},get signals(){return yu(A)},set signals(e){ql(A,e,!0)},get shrinkageAlpha(){return yu(C)},set shrinkageAlpha(e){ql(C,e,!0)},get bufferSizeMeter(){return yu(R)},set bufferSizeMeter(e){ql(R,e,!0)}});var z=hc(D,2),F=e=>{var t=VH(),r=hc(uc(t),2);L$(r,{get disabled(){return yu(v)},get method(){return yu(P)},set method(e){ql(P,e,!0)},get signals(){return yu(A)},set signals(e){ql(A,e,!0)},get shrinkageAlpha(){return yu(C)},set shrinkageAlpha(e){ql(C,e,!0)},get bufferSizeMeter(){return yu(R)},set bufferSizeMeter(e){ql(R,e,!0)}});var n=hc(r,2),i=uc(n),o=hc(uc(i),2);Ld(o),Os(i),Os(n),Os(t),Pc((()=>o.disabled=yu(v))),Kd(o,(()=>yu(E)),(e=>ql(E,e))),Yu(e,t)};ad(z,(e=>{i()&&e(F)})),Os(r),Pc((()=>{m.disabled=yu(v),_.disabled=yu(v),O.disabled=yu(v)})),Kd(m,(()=>yu(f)),(e=>ql(f,e))),Kd(_,(()=>yu(u)),(e=>ql(u,e))),Kd(O,(()=>yu(h)),(e=>ql(h,e))),Yu(e,r)};ad(Z,(e=>{yu(b)&&e(Y)}));var X=hc(Z,2),K=e=>{var r=YH(),n=uc(r),i=uc(n);Os(n);var o,a=hc(n,2);a.__change=e=>function(e){ql(I,e,!0);const r=yu(T)[e];r&&(ql(_,r.zones_geojson,!0),t.onPreviewGenerated(r.zones_geojson,yu(h)))}(Number(e.target.value)),Il(a,21,(()=>yu(T)),Tl,((e,t,r)=>{var n=UH(),i=uc(n),o=hc(i),a=e=>{var r=Wu();Pc((e=>Ju(r,`(+${e??""})`)),[()=>yu(t).marginal_r2.toFixed(3)]),Yu(e,r)};ad(o,(e=>{yu(t).marginal_r2>0&&e(a)}));var s=hc(o,2),l=e=>{var r=Wu();Pc((e=>Ju(r,`· ${e??""}% avg`)),[()=>yu(t).weighted_avg_irrigation_percentage.toFixed(1)]),Yu(e,r)};ad(s,(e=>{null!=yu(t).weighted_avg_irrigation_percentage&&e(l)}));var c=hc(s,2),u=e=>{var r=Wu();Pc((e=>Ju(r,`· Δ ${yu(t).total_irrigation_savings_percentage>0?"+":""}${e??""}%`)),[()=>yu(t).total_irrigation_savings_percentage.toFixed(2)]),Yu(e,r)};ad(c,(e=>{(yu(t).total_baseline_irrigation_m3??0)>0&&null!=yu(t).total_irrigation_savings_percentage&&e(u)})),Os(n),n.value=n.__value=r,Pc((e=>Ju(i,`${yu(t).num_sectors??""} sector${1!==yu(t).num_sectors?"s":""} — R² = ${e??""} `)),[()=>yu(t).r_squared.toFixed(3)]),Yu(e,n)})),Os(a),Id(a);var s=hc(a,2),l=e=>{var t=ZH(),r=dc(t),n=uc(r);Os(r);var i=hc(r,2),o=uc(i),a=e=>{var t=$H(),r=hc(uc(t),2),n=uc(r);Os(r),Os(t),Pc((e=>Ju(n,`${e??""} ha`)),[()=>(yu(O).total_area_m2/1e4).toFixed(2)]),Yu(e,t)};ad(o,(e=>{null!=yu(O).total_area_m2&&e(a)}));var s=hc(o,2),l=e=>{var t=qH(),r=dc(t),n=hc(uc(r),2),i=uc(n);Os(n),Os(r);var o=hc(r,2),a=hc(uc(o),2),s=uc(a);Os(a),Os(o);var l=hc(o,2),c=e=>{var t=HH(),r=hc(uc(t),2),n=uc(r);Os(r),Os(t),Pc((e=>Ju(n,`${yu(O).total_irrigation_difference_m3>0?"+":""}${e??""} m³`)),[()=>yu(O).total_irrigation_difference_m3.toFixed(2)]),Yu(e,t)};ad(l,(e=>{null!=yu(O).total_irrigation_difference_m3&&e(c)})),Pc(((e,t)=>{Ju(i,`${e??""} m³`),Ju(s,`${t??""} m³`)}),[()=>yu(O).total_baseline_irrigation_m3?.toFixed(1),()=>yu(O).total_recommended_irrigation_m3?.toFixed(1)]),Yu(e,t)};ad(s,(e=>{(yu(O).total_baseline_irrigation_m3??0)>0&&e(l)}));var c=hc(s,2),u=e=>{var t=WH(),r=hc(uc(t),2),n=uc(r);Os(r),Os(t),Pc((e=>Ju(n,`${e??""}%`)),[()=>yu(O).variance_captured_pct.toFixed(0)]),Yu(e,t)};ad(c,(e=>{null!=yu(O).variance_captured_pct&&e(u)})),Os(i),Pc(((e,t)=>Ju(n,`R² = ${e??""} — explains ${t??""}% of variance`)),[()=>yu(O).r_squared.toFixed(3),()=>(100*yu(O).r_squared).toFixed(1)]),Yu(e,t)};ad(s,(e=>{yu(O)&&e(l)})),Os(r),Pc((()=>{Ju(i,`Configuration (${yu(T).length??""} available)`),o!==(o=yu(I))&&(a.value=(a.__value=yu(I))??"",Td(a,yu(I)))})),Yu(e,r)};ad(X,(e=>{yu(v)&&yu(T).length>0&&e(K)}));var J=hc(X,2);AU(J,{get message(){return yu(m)},onClose:()=>ql(m,null)});var Q=hc(J,2),ee=e=>{var t=XH(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(y)))),Yu(e,t)};ad(Q,(e=>{yu(y)&&e(ee)}));var te=hc(Q,2),re=e=>{var t=JH(),r=dc(t),n=uc(r);n.__click=B;var i=hc(n,2);i.__click=N;var o=uc(i),a=e=>{Yu(e,KH())},s=e=>{Yu(e,Wu("Save Plan"))};ad(o,(e=>{yu(g)?e(a):e(s,!1)})),Os(i),Os(r),Ds(2),Pc((()=>{n.disabled=yu(g),i.disabled=yu(g)})),Yu(e,t)},ne=e=>{var t=eq(),o=uc(t);o.__click=F;var a=uc(o),s=e=>{Yu(e,QH())},l=e=>{Yu(e,Wu("Generate Preview"))};ad(a,(e=>{yu(p)?e(s):e(l,!1)})),Os(o);var c=hc(o,2),d=e=>{{let t=Dl((()=>"custom"===yu(P)?yu(A):null));k$(e,{get farmFieldId(){return r()},get cropZoneId(){return n()},dataSource:w,get imageryDate(){return yu(f)},get method(){return yu(P)},get signals(){return yu(t)},get shrinkageAlpha(){return yu(C)},get bufferSizeMeter(){return yu(R)}})}};ad(c,(e=>{i()&&r()&&e(d)}
31)),Os(t),Pc(((e,t)=>{o.disabled=e,wd(o,1,t)}),[()=>yu(p)||!yu(u).trim(),()=>"flex-1 px-4 py-2 rounded-lg font-medium transition-colors "+(yu(p)||!yu(u).trim()?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 hover:bg-blue-700 text-white")]),Yu(e,t)};ad(te,(e=>{yu(v)?e(re):e(ne,!1)})),Os(V),Pc((()=>{q.disabled=yu(v),wd(q,1,`flex-1 px-3 py-1.5 text-xs font-medium transition-colors ${"zone_angle"===yu(x)?"bg-blue-600 text-white":"bg-white text-gray-600 hover:bg-gray-50"} disabled:opacity-70`),W.disabled=yu(v),wd(W,1,`flex-1 px-3 py-1.5 text-xs font-medium transition-colors border-l border-gray-300 ${"sector_speed_control"===yu(x)?"bg-blue-600 text-white":"bg-white text-gray-600 hover:bg-gray-50"} disabled:opacity-70`)})),Yu(e,V),Ys()}Bu(["click","change"]);var nq=$u("<option disabled>Loading saved plans...</option>"),iq=$u("<option> </option>"),oq=$u('<button type="button" class="px-2 py-2 text-gray-500 hover:text-gray-700 rounded-md hover:bg-gray-100" title="Rename plan" aria-label="Rename plan"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg></button>'),aq=$u('<div class="flex items-center gap-2"><input type="text" class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"/> <button type="button" class="px-3 py-2 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded-md disabled:bg-gray-400">Save</button> <button type="button" class="px-3 py-2 text-sm bg-gray-200 hover:bg-gray-300 text-gray-700 rounded-md">Cancel</button></div>'),sq=$u('<div class="mb-3 flex flex-col gap-2"><div class="flex items-center gap-2"><select class="flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white"><option>+ New Plan</option><!></select> <!></div> <!></div>'),lq=$u('<div class="mb-3 p-3 text-sm text-amber-800 bg-amber-50 border border-amber-200 rounded-md flex gap-2"><svg class="w-5 h-5 flex-shrink-0 text-amber-600" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg> <div><div class="font-medium mb-0.5">Low vegetation</div> <div class="leading-relaxed"> </div></div></div>'),cq=$u('<div class="flex items-center justify-center py-4"><div class="animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"></div> <span class="ml-3 text-gray-600 text-sm">Loading infrastructure...</span></div>'),uq=$u('<div class="text-sm text-red-700 bg-red-50 border border-red-200 rounded-md p-3"> </div>'),dq=$u("<!> <!>",1),hq=$u("<!> <!>",1),fq=$u('<div class="flex items-center justify-center py-4"><div class="animate-spin rounded-full h-5 w-5 border-b-2 border-blue-600"></div> <span class="ml-2 text-gray-600 text-sm">Loading plan...</span></div>'),pq=$u('<div class="text-sm text-red-700 bg-red-50 border border-red-200 rounded-md p-3 mb-3"> </div>'),gq=$u('<div class="text-xs text-gray-500 mt-0.5"> </div>'),mq=$u('<div class="text-xs text-gray-400 mt-1"> </div>'),yq=$u('<div class="font-medium text-gray-900"> </div> <!> <!>',1),_q=$u('<div class="text-sm text-gray-600 bg-gray-50 border border-gray-200 rounded-md p-3"><!></div>'),vq=$u("<!> <!> <!>",1),bq=$u('<div class="mb-2 p-2 text-xs text-amber-800 bg-amber-50 border border-amber-200 rounded-md">Raindancer connection issue. Open <a class="underline font-medium">Raindancer settings</a> to reconnect or check access.</div>'),xq=$u('<div class="mb-2 p-2 text-xs text-green-700 bg-green-50 border border-green-200 rounded-md"> </div>'),wq=$u('<div class="mb-2 p-2 text-xs text-red-700 bg-red-50 border border-red-200 rounded-md"> </div>'),Sq=$u('<div class="mb-2 p-2 text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded-md">Save the plan first before pushing to Raindancer.</div>'),kq=$u('<div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white"></div> Pushing...',1),Tq=qu('<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"></path></svg> Push to Raindancer',1),Iq=$u('<div class="mt-3 pt-3 border-t border-gray-200"><!> <!> <!> <!> <button class="w-full px-3 py-2 text-sm font-medium text-white bg-teal-600 rounded-lg hover:bg-teal-700 transition-colors disabled:opacity-50 flex items-center justify-center gap-2"><!></button></div>'),Mq=$u('<div class="mb-2 p-2 text-xs text-green-700 bg-green-50 border border-green-200 rounded-md"> </div>'),Eq=$u('<div class="mb-2 p-2 text-xs text-red-700 bg-red-50 border border-red-200 rounded-md"> </div>'),Pq=$u('<div class="animate-spin rounded-full h-4 w-4 border-b-2 border-red-700"></div> Deleting...',1),Aq=qu('<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6M1 7h22M10 7V4a1 1 0 011-1h2a1 1 0 011 1v3"></path></svg> ',1),Cq=$u('<div class="mt-3 pt-3 border-t border-gray-200"><!> <!> <button class="w-full px-3 py-2 text-sm font-medium text-red-700 bg-red-50 border border-red-200 rounded-lg hover:bg-red-100 transition-colors disabled:opacity-50 flex items-center justify-center gap-2"><!></button></div>'),Rq=$u('<div class="text-[10px] text-gray-400 truncate"> </div>'),Lq=$u('<div class="mt-3 pt-3 border-t border-gray-200"><div class="p-2 bg-gray-50 border border-gray-200 rounded-lg space-y-2"><div class="flex items-center justify-between gap-2"><div class="flex-1 min-w-0"><div class="text-xs font-medium text-gray-700">Daily Auto-Push (this crop zone)</div> <!></div> <button role="switch" aria-label="Toggle daily auto-push VRI to Raindancer for this crop zone"><span></span></button></div> <div class="flex items-center gap-2"><label for="rd-vri-source" class="text-[10px] font-medium text-gray-600">Map type</label> <select id="rd-vri-source" class="flex-1 text-xs px-2 py-1 border border-gray-300 rounded-md bg-white focus:ring-2 focus:ring-teal-500 disabled:opacity-50"><option>Field Based VRI</option><option> </option></select></div></div></div>'),Oq=$u('<div class="flex flex-col h-full overflow-hidden"><div class="flex-shrink-0"><!> <!> <!> <!> <!></div></div>');function Dq(e,t){Zs(t,!0);const r=e=>{var r=sq(),i=uc(r),o=uc(i);o.__change=e=>{const r=e.target.value;if("new"===r)ql(f,null),ql(g,null),ql(y,null),ql(b,!0),ql(s,null),n()(null,0);else{const e=yu(J).find((e=>e.key===r));e&&function(e){"hose_reel_batch"===e.type?re(e.id):"hose_reel"===e.type?re("__single__",e.id):"pivot"===e.type||"drip"===e.type?async function(e){ql(f,e,!0),ql(g,null),ql(y,null),ql(b,!1),ql(v,!0),ql(a,null);try{const r=await fU(t.vriType,e),i=_U(r.zones_geojson);i&&(ql(s,i,!0),ql(l,r.base_irrigation_amount??null,!0),n()(i,yu(l)))}
31catch(e){console.error("Error loading plan detail:",e),ql(a,e instanceof Error?e.message:"Failed to load plan",!0)}finally{ql(v,!1)}}(e.id):"field_binned"===e.type&&async function(e){ql(y,e,!0),ql(f,null),ql(g,null),ql(b,!1),ql(v,!0),ql(a,null);try{const t=_U((await fU("field_binned",e)).zones_geojson);t&&(ql(s,t,!0),ql(l,0),n()(t,0))}catch(e){console.error("Error loading field-binned plan detail:",e),ql(a,e instanceof Error?e.message:"Failed to load plan",!0)}finally{ql(v,!1)}}(e.id)}(e)}};var c=uc(o);c.value=c.__value="new";var u,d=hc(c),h=e=>{Yu(e,nq())},p=e=>{var t=Zu();Il(dc(t),17,(()=>yu(J)),Tl,((e,t)=>{var r=iq(),n=uc(r);Os(r);var i={};Pc((()=>{Ju(n,`${yu(t).name??""}${"hose_reel_batch"===yu(t).type&&yu(t).plan_count>1?` (${yu(t).plan_count} routes)`:""}`),i!==(i=yu(t).key)&&(r.value=(r.__value=yu(t).key)??"")})),Yu(e,r)})),Yu(e,t)};ad(d,(e=>{yu(_)?e(h):e(p,!1)})),Os(o),Id(o);var m=hc(o,2),x=e=>{const t=Dl((()=>yu(J).find((e=>e.key===yu(Q)))));var r=Zu(),n=dc(r),i=e=>{var r=oq();r.__click=()=>{return e=yu(t),ql(k,e.key,!0),void ql(T,e.name,!0);var e},Yu(e,r)};ad(n,(e=>{yu(t)&&"hose_reel_batch"!==yu(t).type&&e(i)})),Yu(e,r)};ad(m,(e=>{"new"!==yu(Q)&&e(x)})),Os(i);var w=hc(i,2),S=e=>{const t=Dl((()=>yu(J).find((e=>e.key===yu(k)))));var r=aq(),n=uc(r);Ld(n),n.__keydown=e=>{"Enter"===e.key?te(yu(t)):"Escape"===e.key&&ee()};var i=hc(n,2);i.__click=()=>te(yu(t));var o=hc(i,2);o.__click=ee,Os(r),Pc((e=>{n.disabled=yu(I),i.disabled=e,o.disabled=yu(I)}),[()=>yu(I)||!yu(T).trim()]),Kd(n,(()=>yu(T)),(e=>ql(T,e))),Yu(e,r)};ad(w,(e=>{yu(k)&&yu(J).some((e=>e.key===yu(k)))&&e(S)})),Os(r),Pc((()=>{u!==(u=yu(Q))&&(o.value=(o.__value=yu(Q))??"",Td(o,yu(Q)))})),Yu(e,r)},n=fh(t,"onVRIDataChange",3,(()=>{})),i=fh(t,"isAdmin",3,!1);let o=$l(!1),a=$l(null),s=$l(null),l=$l(null),c=$l(null),u=$l(Jl([])),d=$l(Jl([])),h=$l(Jl([])),f=$l(null),p=$l(Jl([])),g=$l(null),m=$l(Jl([])),y=$l(null),_=$l(!1),v=$l(!1),b=$l(!0),x=$l("equipment");function w(e){e!==yu(x)&&(ql(x,e,!0),ql(s,null),ql(y,null),n()(null,0))}let S=null,k=$l(null),T=$l(""),I=$l(!1),M=$l(!1),E=$l(null),P=$l(null),A=$l(!1),C=$l(0),R=$l(!1),L=$l(!1),O=$l(!1),D=$l(null),z=$l("field_binned"),F=$l(!1),N=0,B=$l(null),j=0;const V=Dl((()=>{if(!Bw.selectedFieldId||!t.farmFieldsGeojson)return null;const e=t.farmFieldsGeojson.features?.find((e=>Number(e.id)===Bw.selectedFieldId));return e?.properties?.farm_field_id||null})),G=(Dl((()=>{if(!Bw.selectedFieldId||!t.farmFieldsGeojson)return!1;const e=t.farmFieldsGeojson.features?.find((e=>Number(e.id)===Bw.selectedFieldId));return!0===e?.properties?.cloudless_activated})),Dl((()=>{const e=t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===Bw.selectedFieldId)),r=e?.properties??{};return{capMinPct:r.vri_cap_min_pct??85,capMaxPct:r.vri_cap_max_pct??115,targetMinPct:r.vri_target_min_pct??null,targetMaxPct:r.vri_target_max_pct??null,method:r.vri_method||"standard",signals:r.vri_signals??null,shrinkageAlpha:r.vri_shrinkage_alpha??null,bufferSizeMeter:r.vri_buffer_size_meter??null}})));function U(e){const r=t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===Bw.selectedFieldId));r?.properties&&(r.properties.vri_cap_min_pct=e.vri_cap_min_pct,r.properties.vri_cap_max_pct=e.vri_cap_max_pct,r.properties.vri_target_min_pct=e.vri_target_min_pct,r.properties.vri_target_max_pct=e.vri_target_max_pct,void 0!==e.vri_method&&(r.properties.vri_method=e.vri_method),void 0!==e.vri_signals&&(r.properties.vri_signals=e.vri_signals),void 0!==e.vri_shrinkage_alpha&&(r.properties.vri_shrinkage_alpha=e.vri_shrinkage_alpha),void 0!==e.vri_buffer_size_meter&&(r.properties.vri_buffer_size_meter=e.vri_buffer_size_meter))}const $=Dl((()=>{const e=Bw.selectedCropZoneId;if(!e||!Bw.selectedFieldId||!t.farmFieldsGeojson)return null;const r=t.farmFieldsGeojson.features?.find((e=>Number(e.id)===Bw.selectedFieldId)),n=(r?.properties?.crop_zones??[]).find((t=>t.crop_zone_id===e));return n?.boundary??null})),H=Dl((()=>()=>{switch(t.vriType){case"pivot":return!!yu(c);case"hose_reel":return yu(u).length>0;case"drip":return yu(d).length>0}})),q=Dl((()=>()=>{if(!Bw.selectedFieldId)return!1;const e=t.farmFieldsGeojson?.features.find((e=>Number(e.id)===Bw.selectedFieldId));return!!e?.properties?.raindancer_field_guid})),W=Dl((()=>()=>!!yu(s)&&yu(q)())),Z=Dl((()=>()=>!!yu(W)()&&(!!yu(b)&&(!yu(f)&&!yu(g))))),Y=Dl((()=>()=>{switch(t.vriType){case"pivot":return"No pivot found for this field. Please create a pivot first.";case"hose_reel":return"No hose reel routes found on this field. Please add hose reel routes first.";case"drip":return"No drip irrigation zones found on this field. Please add drip boundaries first."}}));Dl((()=>yu(f)&&yu(h).length?yu(h).find((e=>e.id===yu(f)))??null:null));async function X(){ql(_,!0);try{switch(t.vriType){case"pivot":ql(h,yu(c)?await function(e){return cU.apply(this,arguments)}(yu(c).id):[],!0);break;case"hose_reel":if(yu(u).length>0){const e=yu(u).map((e=>
31Number(e.properties?.id||e.id))).filter(Boolean);ql(p,await function(e){return uU.apply(this,arguments)}(e),!0)}else ql(p,[],!0);break;case"drip":ql(h,await function(){return hU.apply(this,arguments)}(),!0)}Bw.selectedFieldId?ql(m,await function(e){return gU.apply(this,arguments)}(Bw.selectedFieldId),!0):ql(m,[],!0)}catch(e){console.error("Error loading saved plans:",e),ql(h,[],!0),ql(p,[],!0),ql(m,[],!0)}finally{ql(_,!1)}}async function K(e){await X(),ql(y,e.id,!0);const t=_U(e.zones_geojson);t&&(ql(s,t,!0),n()(t,0))}const J=Dl((()=>{const e=[];for(const t of yu(p))"batch"===t.type?e.push({key:`hose_reel_batch:${t.batch_id}`,type:"hose_reel_batch",id:t.batch_id,name:t.name,plan_count:t.plan_count,created_at:t.created_at}):e.push({key:`hose_reel:${t.plan_id}`,type:"hose_reel",id:t.plan_id,name:t.name,plan_count:1,created_at:t.created_at});if("pivot"===t.vriType)for(const t of yu(h))e.push({key:`pivot:${t.id}`,type:"pivot",id:t.id,name:t.name,zones_count:t.zones_created_count,created_at:t.created_at??""});else if("drip"===t.vriType)for(const t of yu(h))e.push({key:`drip:${t.id}`,type:"drip",id:t.id,name:t.name,zones_count:t.zones_created_count,created_at:t.created_at??""});for(const t of yu(m))e.push({key:`field_binned:${t.id}`,type:"field_binned",id:t.id,name:t.name,zones_count:t.zones_created_count,created_at:t.created_at??""});return e.sort(((e,t)=>e.created_at&&t.created_at?t.created_at.localeCompare(e.created_at):e.name.localeCompare(t.name))),e}));const Q=Dl((()=>yu(b)&&!yu(y)?"new":yu(g)&&"__single__"!==yu(g)?`hose_reel_batch:${yu(g)}`:"__single__"===yu(g)&&yu(f)?`hose_reel:${yu(f)}`:yu(y)?`field_binned:${yu(y)}`:yu(f)&&"pivot"===t.vriType?`pivot:${yu(f)}`:yu(f)&&"drip"===t.vriType?`drip:${yu(f)}`:"new"));function ee(){ql(k,null),ql(T,"")}async function te(e){const t=yu(T).trim();if(t&&t!==e.name)if("hose_reel_batch"!==e.type){ql(I,!0);try{await function(e,t,r){return mU.apply(this,arguments)}(e.type,e.id,t)}catch(e){console.error("Rename failed:",e)}finally{ql(I,!1)}ee(),await X()}else ee();else ee()}async function re(e,t){ql(g,e,!0),ql(f,t??null,!0),ql(y,null),ql(b,!1),ql(v,!0),ql(a,null);try{let r;if("__single__"===e&&t){r=_U((await fU("hose_reel",t)).zones_geojson)??{type:"FeatureCollection",features:[]}}else r=await function(e){return dU.apply(this,arguments)}(e);ql(s,r,!0),n()(r,yu(l))}catch(e){console.error("Error loading batch:",e),ql(a,e instanceof Error?e.message:"Failed to load plan",!0)}finally{ql(v,!1)}}async function ne(){if(Bw.selectedFieldId&&t.farmFieldsGeojson){ql(o,!0),ql(a,null),ql(c,null),ql(u,[],!0),ql(d,[],!0),ql(h,[],!0),ql(p,[],!0),ql(m,[],!0),ql(f,null),ql(g,null),ql(y,null),ql(b,!0);try{const e=t.farmFieldsGeojson.features.find((e=>Number(e.id)===Bw.selectedFieldId));if(!e?.geometry)throw new Error("Selected field not found or has no geometry");switch(t.vriType){case"pivot":await async function(e){const r=e.properties,n=r?.center,i=r?.radius;if(!n||"number"!=typeof i)return;const o=n[0],a=n[1],s=r?.start_angle??0,l=r?.end_angle??360,u=1e-5,d=1;if(t.pivotExtentsGeojson?.features?.length)for(const e of t.pivotExtentsGeojson.features){const t=e.properties;if(!t?.center_lng||!t?.center_lat||!t?.radius_meters)continue;const r=t.start_angle??0,n=t.end_angle??360;if(Math.abs(t.center_lng-o)<u&&Math.abs(t.center_lat-a)<u&&Math.abs(t.radius_meters-i)<d&&r===s&&n===l)return void ql(c,{id:t.id,name:t.name,center_lng:t.center_lng,center_lat:t.center_lat,radius_meters:t.radius_meters,start_angle:r,end_angle:n},!0)}const h=await function(e){return KG.apply(this,arguments)}({id:Number(e.id),centerLng:o,centerLat:a,radiusMeters:i,startAngle:s,endAngle:l});ql(c,{id:h.id,name:h.name,center_lng:h.center_lng,center_lat:h.center_lat,radius_meters:h.radius_meters,start_angle:h.start_angle,end_angle:h.end_angle},!0)}(e);break;case"hose_reel":!function(e){if(!t.hoseReelRoutesGeojson?.features?.length)return;const r=t.hoseReelRoutesGeojson.features.filter((e=>null!==e.geometry)),n=SU(e.geometry,{pivotExtents:[],hoseReelRoutes:r,dripBoundaries:[]});ql(u,n.hoseReelRoutes,!0)}(e);break;case"drip":!function(e){if(!t.dripBoundariesGeojson?.features?.length)return;
31const r=t.dripBoundariesGeojson.features.filter((e=>null!==e.geometry)),n=SU(e.geometry,{pivotExtents:[],hoseReelRoutes:[],dripBoundaries:r});ql(d,n.dripBoundaries,!0)}(e)}}catch(e){console.error("Error finding infrastructure:",e),ql(a,e instanceof Error?e.message:"Failed to find infrastructure",!0)}finally{ql(o,!1)}}}async function ie(e,t){ql(l,t,!0);const r=_U(e.zones_geojson);r&&(ql(s,r,!0),n()(r,yu(l))),await X(),e.id&&(ql(f,e.id,!0),ql(b,!1))}function oe(e,t){ql(l,t,!0),ql(s,e,!0),n()(e,yu(l))}async function ae(e,t){ql(l,e.baseIrrigationAmount,!0),ql(s,t,!0),n()(t,yu(l)),await X();const r=e.plans?.[0]?.batch_id;r?(ql(g,r,!0),ql(f,null),ql(b,!1)):e.plans?.length>0&&e.plans[0].id&&(ql(f,e.plans[0].id,!0),ql(g,null),ql(b,!1))}function se(e,t){ql(l,t,!0),ql(s,e,!0),n()(e,yu(l))}async function le(e,t){ql(s,t,!0),n()(t,yu(l)),await X()}function ce(e,t){ql(l,t,!0),ql(s,e,!0),n()(e,yu(l))}function ue(e,t){ql(l,t,!0),ql(s,e,!0),n()(e,yu(l))}async function de(){if(Bw.selectedFieldId){ql(M,!0),ql(E,null),ql(P,null);try{const e=await function(e,t,r){return bz.apply(this,arguments)}(Bw.selectedFieldId,yu(s)??void 0,Bw.selectedCropZoneId);ql(E,`Pushed ${e.zones_pushed} zone${1!==e.zones_pushed?"s":""} to Raindancer`),he()}catch(e){e instanceof gz?(ql(A,!0),ql(P,null)):ql(P,e instanceof Error?e.message:"Push failed",!0)}finally{ql(M,!1)}}}async function he(){if(Bw.selectedFieldId&&yu(q)())try{const e=await wz(Bw.selectedFieldId);ql(C,e.features?.length??0,!0)}catch(e){e instanceof gz&&ql(A,!0),ql(C,0)}else ql(C,0)}async function fe(){if(!Bw.selectedFieldId||0===yu(C))return;if(confirm(`Delete all ${yu(C)} active VRI zone${1!==yu(C)?"s":""} on this field in Raindancer? This cannot be undone.`)){ql(R,!0),ql(E,null),ql(P,null);try{const{deleted:e}=await function(e){return kz.apply(this,arguments)}(Bw.selectedFieldId);ql(E,`Removed ${e} zone${1!==e?"s":""} from Raindancer`),ql(C,0),Bw.raindancerVRIData=null}catch(e){e instanceof gz?(ql(A,!0),ql(P,null)):ql(P,e instanceof Error?e.message:"Delete failed",!0)}finally{ql(R,!1)}}}async function pe(){const e=Bw.selectedCropZoneId;if(!e)return ql(L,!1),ql(D,null),ql(z,"field_binned"),void ql(F,!1);const t=++N;ql(O,!0);try{const r=await function(e){return Tz.apply(this,arguments)}(e);if(t!==N)return;ql(L,r.auto_push_vri,!0),ql(D,r.last_vri_push_at,!0),ql(z,r.vri_source,!0),ql(F,r.hose_reel_route_available,!0)}catch{}finally{t===N&&ql(O,!1)}}async function ge(){const e=Bw.selectedCropZoneId;if(e){ql(O,!0);try{const t=await Iz(e,!yu(L));ql(L,t.auto_push_vri,!0),ql(D,t.last_vri_push_at,!0),ql(z,t.vri_source,!0),ql(F,t.hose_reel_route_available,!0)}catch(e){ql(P,e instanceof Error?e.message:"Failed to update auto-push",!0)}finally{ql(O,!1)}}}Tc((()=>{const e=Bw.selectedFieldId;e!==S&&(S=e,e&&(ql(s,null),n()(null,0),ne(),X(),ql(C,0),he()))}));let me=null;Tc((()=>{const e=Bw.selectedFieldId;e!==me&&(me=e,ql(x,yu(H)()?"equipment":"field_binned",!0))})),Tc((()=>{const e=Bw.selectedFieldId,t=Bw.selectedCropZoneId;if(!e)return void ql(B,null);const r=++j;(function(e,t){return YG.apply(this,arguments)})(e,t).then((e=>{r===j&&ql(B,e,!0)})).catch((()=>{r===j&&ql(B,null)}))}));let ye=null;Tc((()=>{const e=Bw.selectedCropZoneId;if(e===ye)return;const t=null!==ye;ye=e,pe(),t&&(ql(s,null),n()(null,0),ql(f,null),ql(g,null),ql(y,null),ql(b,!0))}));var _e=Oq(),ve=uc(_e),be=uc(ve),xe=e=>{var t=lq(),r=hc(uc(t),2),n=hc(uc(r),2),i=uc(n,!0);Os(n),Os(r),Os(t),Pc((()=>Ju(i,yu(B).message))),Yu(e,t)};ad(be,(e=>{yu(B)?.below_threshold&&yu(B).message&&e(xe)}));var we=hc(be,2),Se=e=>{Yu(e,cq())},ke=e=>{var n=Zu(),o=dc(n),s=e=>{var t=uq(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(a)))),Yu(e,t)},l=e=>{var n=Zu(),o=dc(n),s=e=>{var t=dq(),n=dc(t),o=e=>{r(e)};ad(n,(e=>{yu(J).length>0&&e(o)})),sd(hc(n,2),(()=>Bw.selectedCropZoneId),(e=>{{let t=Dl((()=>yu(Y)()));wH(e,{get fieldId(){return Bw.selectedFieldId},get farmFieldId(){return yu(V)},get cropZoneId(){return Bw.selectedCropZoneId},onZonesGenerated:ue,onPlanSaved:K,get advisoryMessage(){return yu(t)},vriMode:null,get vriSettings(){return yu(G)},onVriSettingsSaved:U,get isAdmin(){return i()}})}})),Yu(e,t)},l=e=>{var n=Zu(),o=dc(n),s=e=>{var t=hq(),n=dc(t);r(n),sd(hc(n,2),(()=>Bw.selectedCropZoneId),(e=>{wH(e,{get fieldId(){return Bw.selectedFieldId},get farmFieldId(){return yu(V)},get cropZoneId(){return Bw.selectedCropZoneId},onZonesGenerated:ue,onPlanSaved:K,advisoryMessage:null,get vriMode(){return yu(x)},onVriModeChange:w,get vriSettings(){return yu(G)},onVriSettingsSaved:U,get isAdmin(){return i()}})})),Yu(e,t)},l=e=>{var n=vq(),o=dc(n);r(o);var s=hc(o,2),l=e=>{Yu(e,fq())},h=e=>{var t=Zu(),r=dc(t),n=e=>{var t=pq(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(a)))),Yu(e,t)};ad(r,(e=>{yu(a)&&e(n)}),!0),Yu(e,t)};ad(s,(e=>{yu(v)?e(l):e(h,!1)}));var p=hc(s,2),m=e=>{const t=Dl((()=>yu(J).find((e=>e.key===yu(Q)))));var r=_q(),n=uc(r),i=e=>{var r=yq(),n=dc(r),i=uc(n,!0);Os(n);var o=hc(n,2),a=e=>{var r=gq(),n=uc(r);Os(r),Pc((()=>Ju(n,`${yu(t).plan_count??""} routes`))),Yu(e,r)};ad(o,(e=>{"hose_reel_batch"===yu(t).type&&yu(t).plan_count>1&&e(a)}));var s=hc(o,2),l=e=>
31{var r=mq(),n=uc(r);Os(r),Pc((e=>Ju(n,`Created ${e??""}`)),[()=>new Date(yu(t).created_at).toLocaleDateString()]),Yu(e,r)};ad(s,(e=>{yu(t).created_at&&e(l)})),Pc((()=>Ju(i,yu(t).name))),Yu(e,r)};ad(n,(e=>{yu(t)&&e(i)})),Os(r),Yu(e,r)},_=e=>{var r=Zu(),n=dc(r),o=e=>{var r=Zu();sd(dc(r),(()=>Bw.selectedCropZoneId),(e=>{var r=Zu(),n=dc(r),o=e=>{rq(e,{get pivotExtent(){return yu(c)},get fieldId(){return Bw.selectedFieldId},onPlanCreated:ie,onPreviewGenerated:oe,get farmFieldId(){return yu(V)},get cropZoneId(){return Bw.selectedCropZoneId},get vriSettings(){return yu(G)},onVriSettingsSaved:U,get isAdmin(){return i()},get vriMode(){return yu(x)},onVriModeChange:w})},a=e=>{var r=Zu(),n=dc(r),o=e=>{zH(e,{get fieldId(){return Bw.selectedFieldId},get routes(){return yu(u)},onPlansCreated:ae,onPreviewGenerated:se,get farmFieldId(){return yu(V)},get cropZoneId(){return Bw.selectedCropZoneId},get cropZoneBoundary(){return yu($)},get vriSettings(){return yu(G)},onVriSettingsSaved:U,get isAdmin(){return i()},get vriMode(){return yu(x)},onVriModeChange:w})},a=e=>{var r=Zu(),n=dc(r),o=e=>{K$(e,{get fieldId(){return Bw.selectedFieldId},get boundaries(){return yu(d)},onPlanCreated:le,onPreviewGenerated:ce,get farmFieldId(){return yu(V)},get cropZoneId(){return Bw.selectedCropZoneId},get vriSettings(){return yu(G)},onVriSettingsSaved:U,get isAdmin(){return i()},get vriMode(){return yu(x)},onVriModeChange:w})};ad(n,(e=>{"drip"===t.vriType&&yu(d).length>0&&e(o)}),!0),Yu(e,r)};ad(n,(e=>{"hose_reel"===t.vriType&&yu(u).length>0?e(o):e(a,!1)}),!0),Yu(e,r)};ad(n,(e=>{"pivot"===t.vriType&&yu(c)?e(o):e(a,!1)})),Yu(e,r)})),Yu(e,r)};ad(n,(e=>{yu(b)&&e(o)}),!0),Yu(e,r)};ad(p,(e=>{yu(b)||!(yu(f)||yu(g)||yu(y))||yu(v)?e(_,!1):e(m)})),Yu(e,n)};ad(o,(e=>{"field_binned"===yu(x)?e(s):e(l,!1)})),Yu(e,n)};ad(o,(e=>{yu(H)()?e(l,!1):e(s)}),!0),Yu(e,n)};ad(o,(e=>{yu(a)&&!yu(H)()?e(s):e(l,!1)}),!0),Yu(e,n)};ad(we,(e=>{yu(o)?e(Se):e(ke,!1)}));var Te=hc(we,2),Ie=e=>{var t=Iq(),r=uc(t),n=e=>{var t=bq(),r=hc(uc(t));Ds(),Os(t),Pc((()=>Fd(r,"href",`/a/${bh.teamSlug??""}/raindancer/`))),Yu(e,t)};ad(r,(e=>{yu(A)&&e(n)}));var i=hc(r,2),o=e=>{var t=xq(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(E)))),Yu(e,t)};ad(i,(e=>{yu(E)&&e(o)}));var a=hc(i,2),s=e=>{var t=wq(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(P)))),Yu(e,t)};ad(a,(e=>{yu(P)&&e(s)}));var l=hc(a,2),c=e=>{Yu(e,Sq())};ad(l,(e=>{yu(Z)()&&e(c)}));var u=hc(l,2);u.__click=de;var d=uc(u),h=e=>{var t=kq();Ds(),Yu(e,t)},f=e=>{var t=Tq();Ds(),Yu(e,t)};ad(d,(e=>{yu(M)?e(h):e(f,!1)})),Os(u),Os(t),Pc((e=>u.disabled=e),[()=>yu(M)||yu(Z)()]),Yu(e,t)};ad(Te,(e=>{yu(W)()&&e(Ie)}));var Me=hc(Te,2),Ee=e=>{var t=Cq(),r=uc(t),n=e=>{var t=Mq(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(E)))),Yu(e,t)};ad(r,(e=>{!yu(W)()&&yu(E)&&e(n)}));var i=hc(r,2),o=e=>{var t=Eq(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(P)))),Yu(e,t)};ad(i,(e=>{!yu(W)()&&yu(P)&&e(o)}));var a=hc(i,2);a.__click=fe;var s=uc(a),l=e=>{var t=Pq();Ds(),Yu(e,t)},c=e=>{var t=Aq(),r=hc(dc(t));Pc((()=>Ju(r,` Delete Raindancer VRI (${yu(C)??""} zone${1!==yu(C)?"s":""})`))),Yu(e,t)};ad(s,(e=>{yu(R)?e(l):e(c,!1)})),Os(a),Os(t),Pc((()=>a.disabled=yu(R))),Yu(e,t)};ad(Me,(e=>{yu(q)()&&yu(C)>0&&e(Ee)}));var Pe=hc(Me,2),Ae=e=>{var t=Lq(),r=uc(t),n=uc(r),i=uc(n),o=hc(uc(i),2),a=e=>{var t=Rq(),r=uc(t);Os(t),Pc((e=>Ju(r,`Last: ${e??""}`)),[()=>new Date(yu(D)).toLocaleDateString()]),Yu(e,t)};ad(o,(e=>{yu(D)&&e(a)})),Os(i);var s=hc(i,2);s.__click=ge;var l=uc(s);Os(s),Os(n);var c=hc(n,2),u=hc(uc(c),2);u.__change=e=>async function(e){const t=Bw.selectedCropZoneId;if(t&&e!==yu(z)&&("hose_reel"!==e||yu(F))){ql(O,!0);try{const r=await Iz(t,yu(L),e);ql(L,r.auto_push_vri,!0),ql(D,r.last_vri_push_at,!0),ql(z,r.vri_source,!0),ql(F,r.hose_reel_route_available,!0)}catch(e){ql(P,e instanceof Error?e.message:"Failed to update VRI source",!0)}finally{ql(O,!1)}}}(e.target.value);var d=uc(u);d.value=d.__value="field_binned";var h,f=hc(d),p=uc(f);Os(f),f.value=f.__value="hose_reel",Os(u),Id(u),Os(c),Os(r),Os(t),Pc((()=>{wd(s,1,"relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-teal-500 focus:ring-offset-1 disabled:opacity-50 "+(yu(L)?"bg-teal-600":"bg-gray-300")),s.disabled=yu(O),Fd(s,"aria-checked",yu(L)),wd(l,1,"pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out "+(yu(L)?"translate-x-4":"translate-x-0")),u.disabled=yu(O),Fd(u,"title",yu(F)?"Choose the VRI map shape for daily auto-push":"No hose-reel route on this crop zone — defaulting to Field Based VRI"),f.disabled=!yu(F),Fd(f,"title",yu(F)?"":"No hose-reel route intersects this crop zone"),Ju(p,"Hose Reel Based VRI"+(yu(F)?"":" (no route)")),h!==(h=yu(z))&&(u.value=(u.__value=yu(z))??"",Td(u,yu(z)))})),Yu(e,t)};ad(Pe,(e=>{yu(q)()&&Bw.selectedCropZoneId&&e(Ae)})),Os(ve),Os(_e),Yu(e,_e),Ys()}Bu(["change","click","keydown"]);var zq=$u('<span class="text-gray-500">· Routes</span> <span class="font-medium tabular-nums"> </span>',1),Fq=$u('<div class="grid grid-cols-2 sm:grid-cols-4 gap-x-4 gap-y-1 text-xs mt-1"><div><span class="text-gray-500">Baseline</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">Recommended</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">Δ</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">Savings</span> <span class="font-medium tabular-nums"> </span></div></div>'),Nq=$u('<div><dt class="text-gray-500 inline">Variance captured</dt> <dd class="font-medium tabular-nums inline"> </dd></div>'),Bq=$u('<dl class="grid grid-cols-2 sm:grid-cols-4 gap-x-4 gap-y-1 text-xs mb-2"><div><dt class="text-gray-500 inline">Zones</dt> <dd class="font-medium tabular-nums inline"> </dd></div> <div><dt class="text-gray-500 inline" title="Coefficient of determination — share of within-field variance explained by the chosen zone boundaries">R²</dt> <dd class="font-medium tabular-nums inline"> </dd></div> <div><dt class="text-gray-500 inline" title="R² gained by going from N-1 zones to N zones">Marginal R²</dt> <dd class="font-medium tabular-nums inline"> </dd></div> <!></dl>'),jq=$u('<div class="text-[11px] text-gray-600 leading-relaxed mb-2"> </div>'),Vq=$u('<tr><td class="text-right tabular-nums py-1"> </td><td class="text-right tabular-nums py-1"> </td><td class="text-right tabular-nums py-1"> </td><td class="text-right tabular-nums py-1"> </td></tr>'),Gq=$u('<table class="w-full text-xs"><thead><tr class="text-gray-500 border-b border-gray-200"><th class="text-right font-medium py-1">N zones</th><th class="text-right font-medium py-1">R²</th><th class="text-right font-medium py-1">Marginal R²</th><th class="text-right font-medium py-1">Variance captured</th></tr></thead><tbody></tbody></table>'),Uq=$u('<div class="mt-3 pt-3 border-t border-gray-200"><div class="text-xs font-semibold uppercase tracking-wide text-gray-500 mb-2">Zone-fit quality</div> <!> <!> <!></div>'),$q=$u('<section class="rounded-lg border border-gray-200 bg-white p-4 mb-4 text-sm"><dl class="grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-1 text-xs"><div><dt class="text-gray-500 inline">Method</dt> <dd class="font-medium inline"> </dd></div> <div><dt class="text-gray-500 inline">Imagery date</dt> <dd class="font-medium tabular-nums inline"> </dd></div> <div><dt class="text-gray-500 inline" title="A — multiplier raster\'s spread (effective field σ); single-number prescription strength">Amplitude</dt> <dd class="font-medium tabular-nums inline"> </dd></div></dl> <div class="mt-3 pt-3 border-t border-gray-200"><div class="text-xs font-semibold uppercase tracking-wide text-gray-500 mb-2">Field Totals</div> <div class="grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-1 text-xs"><div><span class="text-gray-500">Zones</span> <span class="font-medium tabular-nums"> </span> <!></div> <div><span class="text-gray-500">Area</span> <span class="font-medium tabular-nums"> </span></div> <div><span class="text-gray-500">Avg pct</span> <span class="font-medium tabular-nums"> </span></div></div> <!></div> <!></section>'),Hq=$u('<section class="rounded-lg border border-amber-200 bg-amber-50 p-4 mb-4 text-sm text-amber-800"><div class="font-medium mb-1">No run details available</div> <div class="text-xs leading-relaxed">This plan was saved before per-run metadata was captured. Re-generate the\n      plan to see method, imagery date, amplitude, and field totals here.</div></section>');function qq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return null;var r=e.zone_irrigation_amount_mm;if("number"==typeof r&&Number.isFinite(r))return r;var n=e.absolute_irrigation_amount;if("number"==typeof n&&Number.isFinite(n))return n;var i=e.relative_irrigation_percentage;return null!=t&&Number.isFinite(t)&&"number"==typeof i&&Number.isFinite(i)?t*i/100:null}function Wq(e,t){var r=qq(e,t);if(null==r)return"—";if(null==t||!Number.isFinite(t))return r.toFixed(2);var n=r-t,i=n>0?"+":"";
31return"".concat(r.toFixed(2)," (").concat(i).concat(n.toFixed(2),")")}var Zq=$u('<th class="text-left font-medium py-1 pr-3"> </th>'),Yq=$u('<th class="text-right font-medium py-1 pr-3">Baseline m³</th> <th class="text-right font-medium py-1 pr-3">Recom. m³</th> <th class="text-right font-medium py-1 pr-3">Δ m³</th> <th class="text-right font-medium py-1 pr-3">Δ %</th>',1),Xq=$u('<td class="py-1 pr-3 tabular-nums text-gray-700"> </td>'),Kq=$u('<td class="text-right tabular-nums py-1 pr-3"> </td> <td class="text-right tabular-nums py-1 pr-3"> </td> <td class="text-right tabular-nums py-1 pr-3"> </td> <td class="text-right tabular-nums py-1 pr-3"> </td>',1),Jq=$u('<tr class="border-b border-gray-100 last:border-b-0"><td class="py-1 pr-3 font-medium"> </td><!><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1 pr-3 font-medium"> </td><td class="text-right tabular-nums py-1 pr-3"> </td><!><td class="text-right tabular-nums py-1 pr-3"> </td><td class="text-right tabular-nums py-1"> </td></tr>'),Qq=$u('<section class="rounded-lg border border-gray-200 bg-white p-4 mb-4 text-sm"><div class="flex items-baseline justify-between mb-2"><h4 class="text-sm font-semibold text-gray-800">Per-zone breakdown</h4> <span class="text-[11px] text-gray-500"> <!></span></div> <div class="overflow-x-auto"><table class="w-full text-xs"><thead><tr class="text-gray-500 border-b border-gray-200"><th class="text-left font-medium py-1 pr-3">Zone</th><!><th class="text-right font-medium py-1 pr-3">Area</th><th class="text-right font-medium py-1 pr-3" title="Multiplier raster pixels falling inside the zone">Pixels</th><th class="text-right font-medium py-1 pr-3">Irr %</th><th class="text-right font-medium py-1 pr-3">Amount mm</th><!><th class="text-right font-medium py-1 pr-3" title="Mean ± std of the raw multiplier inside the zone (pre-clamp)">μ ± σ</th><th class="text-right font-medium py-1" title="Min … max of the raw multiplier inside the zone">min … max</th></tr></thead><tbody></tbody></table></div></section>');function eW(e,t){Zs(t,!0);const r=Dl((()=>t.vriData.properties??{})),n=Dl((()=>"number"==typeof yu(r).field_irrigation_volume?yu(r).field_irrigation_volume:0)),i=Dl((()=>yu(n)>0)),o=Dl((()=>{const e=t.vriData.features?.[0]?.properties??{};return"string"==typeof e.name||"string"==typeof e.zone_name?"drip":"number"==typeof e.start_angle||"number"==typeof e.angle_start?"pivot":"number"==typeof e.start_distance_m?"hose_reel":"field_binned"})),a=Dl((()=>"pivot"===yu(o)?"Angle":"hose_reel"===yu(o)?"Along path":null));var s=Qq(),l=uc(s),c=hc(uc(l),2),u=uc(c),d=hc(u),h=e=>{Yu(e,Wu("· m³ columns hidden (no field volume set)"))};ad(d,(e=>{yu(i)||e(h)})),Os(c),Os(l);var f=hc(l,2),p=uc(f),g=uc(p),m=uc(g),y=hc(uc(m)),_=e=>{var t=Zq(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(a)))),Yu(e,t)};ad(y,(e=>{yu(a)&&e(_)}));var v=hc(y,5),b=e=>{var t=Yq();Ds(6),Yu(e,t)};ad(v,(e=>{yu(i)&&e(b)})),Ds(2),Os(m),Os(g);var x=hc(g);Il(x,21,(()=>t.vriData.features),Tl,((e,t,r)=>{const s=Dl((()=>yu(t).properties??{}));var l=Jq(),c=uc(l),u=uc(c,!0);Os(c);var d=hc(c),h=e=>{var t=Xq(),r=uc(t,!0);Os(t),Pc((e=>Ju(r,e)),[()=>function(e){if("pivot"===yu(o)){const t=e?.start_angle??e?.angle_start,r=e?.end_angle??e?.angle_end;return"number"==typeof t&&"number"==typeof r?`${t.toFixed(1)}°–${r.toFixed(1)}°`:"—"}if("hose_reel"===yu(o)){const t=e?.start_distance_m,r=e?.end_distance_m;return"number"==typeof t&&"number"==typeof r?`${t.toFixed(0)}–${r.toFixed(0)} m`:"—"}return""}(yu(s))]),Yu(e,t)};ad(d,(e=>{yu(a)&&e(h)}));var f=hc(d),p=uc(f,!0);Os(f);var g=hc(f),m=uc(g,!0);Os(g);var y=hc(g),_=uc(y,!0);Os(y);var v=hc(y),b=uc(v,!0);Os(v);var x=hc(v),w=e=>{var t=Kq(),r=dc(t),n=uc(r,!0);Os(r);var i=hc(r,2),o=uc(i,!0);Os(i);var a=hc(i,2),l=uc(a,!0);Os(a);var c=hc(a,2),u=uc(c,!0);Os(c),Pc(((e,t,r,i)=>{Ju(n,e),Ju(o,t),Ju(l,r),Ju(u,i)}),[()=>CU(yu(s).baseline_irrigation_m3,2),()=>CU(yu(s).recommended_irrigation_m3,2),()=>DU(yu(s).irrigation_difference_m3,2),()=>DU(yu(s).irrigation_difference_percentage,2)]),Yu(e,t)};ad(x,(e=>{yu(i)&&e(w)}));var S=hc(x),k=uc(S,!0);Os(S);var T=hc(S),I=uc(T,!0);Os(T),Os(l),Pc(((e,t,r,n,i,o,a)=>{Ju(u,e),Ju(p,t),Ju(m,r),Ju(_,n),Ju(b,i),Ju(k,o),Ju(I,a)}),[()=>function(e,t){const r=e?.zone_id??t;if("drip"===yu(o)){const t=e?.zone_name??e?.name;return t?`${r} · ${t}`:String(r)}return String(r)}(yu(s),r+1),()=>OU(yu(s).area_m2),()=>RU(yu(s).pixel_count),()=>LU(yu(s).relative_irrigation_percentage),()=>function(e){const t=qq(e,yu(n)>0?yu(n):null);return null==t?"—":t.toFixed(2)}(yu(s)),()=>function(e){const t=e?.multiplier_mean,r=e?.multiplier_std;return"number"!=typeof t?"—":"number"==typeof r?`${t.toFixed(3)} ± ${r.toFixed(3)}`:t.toFixed(3)}(yu(s)),()=>function(e){const t=e?.multiplier_min,r=e?.multiplier_max;return"number"!=typeof t||"number"!=typeof r?"—":`${t.toFixed(3)} … ${r.toFixed(3)}`}(yu(s))]),Yu(e,l)})),Os(x),Os(p),Os(f),Os(s),Pc((()=>Ju(u,`${t.vriData.features.length??""} zone${1===t.vriData.features.length?"":"s"} `))),Yu(e,s),Ys()}var tW=$u('<span class="badge badge-outline"> </span>'),rW=$u('<span class="badge badge-outline"> </span>'),nW=$u('<div class="flex flex-wrap gap-2 mb-3"><!> <!></div>'),iW=$u('<dialog class="modal"><div class="modal-box max-w-4xl"><div class="flex items-start justify-between mb-3"><div><h3 class="text-lg font-bold">VRI Run Details</h3> <p class="text-sm text-gray-500">Results for the current VRI plan — method, imagery date, amplitude, zone-fit, and\n          field totals. Per-signal diagnostics are admin-only (Admin VRI debug view).</p></div> <button class="btn btn-sm btn-ghost btn-circle" aria-label="Close">✕</button></div> <!> <!> <!> <div class="modal-action"><button class="btn btn-sm">Close</button></div></div> <form method="dialog" class="modal-backdrop"><button>
31close</button></form></dialog>');function oW(e,t){Zs(t,!0);let r=fh(t,"open",15),n=$l(void 0);const i=Dl((()=>t.vriData.properties??{})),o=Dl((()=>yu(i).reference_date_used??yu(i).method_metadata?.reference_date_used??null)),a=Dl((()=>yu(i).method??yu(i).method_metadata?.method??null));function s(){r(!1),t.onClose?.()}Tc((()=>{yu(n)&&(r()&&!yu(n).open?yu(n).showModal():!r()&&yu(n).open&&yu(n).close())}));var l=iW(),c=uc(l),u=uc(c);hc(uc(u),2).__click=s,Os(u);var d=hc(u,2),h=e=>{var t=nW(),r=uc(t),n=e=>{var t=tW(),r=uc(t);Os(t),Pc((()=>Ju(r,`Method: ${yu(a)??""}`))),Yu(e,t)};ad(r,(e=>{yu(a)&&e(n)}));var i=hc(r,2),s=e=>{var t=rW(),r=uc(t);Os(t),Pc((()=>Ju(r,`Reference: ${yu(o)??""}`))),Yu(e,t)};ad(i,(e=>{yu(o)&&e(s)})),Os(t),Yu(e,t)};ad(d,(e=>{(yu(a)||yu(o))&&e(h)}));var f=hc(d,2);!function(e,t){Zs(t,!0);const r=Dl((()=>t.properties??{})),n=Dl((()=>yu(r).method_metadata??null)),i=Dl((()=>yu(r).reference_date_used??yu(n)?.reference_date_used??null)),o=Dl((()=>yu(r).method??yu(n)?.method??null)),a=Dl((()=>"number"==typeof yu(n)?.amplitude?yu(n).amplitude:"number"==typeof yu(r).amplitude?yu(r).amplitude:null)),s=Dl((()=>"number"==typeof yu(r).field_irrigation_volume?yu(r).field_irrigation_volume:0)),l=Dl((()=>yu(s)>0)),c=Dl((()=>Array.isArray(yu(r).configurations_summary)&&yu(r).configurations_summary.length>0?yu(r).configurations_summary:null)),u=Dl((()=>"number"==typeof yu(r).num_zones?yu(r).num_zones:null)),d=Dl((()=>yu(c)&&null!==yu(u)?yu(c).find((e=>e.num_zones===yu(u)))??null:null)),h=Dl((()=>null!==yu(o)||null!==yu(i)||null!==yu(a)||null!==yu(c)));var f=Zu(),p=dc(f),g=e=>{var t=$q(),n=uc(t),s=uc(n),h=hc(uc(s),2),f=uc(h,!0);Os(h),Os(s);var p=hc(s,2),g=hc(uc(p),2),m=uc(g,!0);Os(g),Os(p);var y=hc(p,2),_=hc(uc(y),2),v=uc(_,!0);Os(_),Os(y),Os(n);var b=hc(n,2),x=hc(uc(b),2),w=uc(x),S=hc(uc(w),2),k=uc(S,!0);Os(S);var T=hc(S,2),I=e=>{var t=zq(),n=hc(dc(t),2),i=uc(n,!0);Os(n),Pc((e=>Ju(i,e)),[()=>RU(yu(r).total_routes)]),Yu(e,t)};ad(T,(e=>{"number"==typeof yu(r).total_routes&&e(I)})),Os(w);var M=hc(w,2),E=hc(uc(M),2),P=uc(E,!0);Os(E),Os(M);var A=hc(M,2),C=hc(uc(A),2),R=uc(C,!0);Os(C),Os(A),Os(x);var L=hc(x,2),O=e=>{var t=Fq(),n=uc(t),i=hc(uc(n),2),o=uc(i);Os(i),Os(n);var a=hc(n,2),s=hc(uc(a),2),l=uc(s);Os(s),Os(a);var c=hc(a,2),u=hc(uc(c),2),d=uc(u);Os(u),Os(c);var h=hc(c,2),f=hc(uc(h),2),p=uc(f,!0);Os(f),Os(h),Os(t),Pc(((e,t,r,n)=>{Ju(o,`${e??""} m³`),Ju(l,`${t??""} m³`),Ju(d,`${r??""} m³`),Ju(p,n)}),[()=>CU(yu(r).total_baseline_irrigation_m3,1),()=>CU(yu(r).total_recommended_irrigation_m3,1),()=>CU(yu(r).total_irrigation_difference_m3,2),()=>LU(yu(r).total_irrigation_savings_percentage,2)]),Yu(e,t)};ad(L,(e=>{yu(l)&&e(O)})),Os(b);var D=hc(b,2),z=e=>{var t=Uq(),n=hc(uc(t),2),i=e=>{var t=Bq(),r=uc(t),n=hc(uc(r),2),i=uc(n,!0);Os(n),Os(r);var o=hc(r,2),a=hc(uc(o),2),s=uc(a,!0);Os(a),Os(o);var l=hc(o,2),c=hc(uc(l),2),u=uc(c,!0);Os(c),Os(l);var h=hc(l,2),f=e=>{var t=Nq(),r=hc(uc(t),2),n=uc(r,!0);Os(r),Os(t),Pc((e=>Ju(n,e)),[()=>LU(yu(d).variance_captured_pct)]),Yu(e,t)};ad(h,(e=>{"number"==typeof yu(d).variance_captured_pct&&e(f)})),Os(t),Pc(((e,t,r)=>{Ju(i,e),Ju(s,t),Ju(u,r)}),[()=>RU(yu(d).num_zones),()=>CU(yu(d).r_squared,3),()=>CU(yu(d).marginal_r2,3)]),Yu(e,t)};ad(n,(e=>{yu(d)&&e(i)}));var o=hc(n,2),a=e=>{var t=jq(),n=uc(t,!0);Os(t),Pc((()=>Ju(n,yu(r).selection_reason))),Yu(e,t)};ad(o,(e=>{yu(r).selection_reason&&e(a)}));var s=hc(o,2),l=e=>{var t=Gq(),r=hc(uc(t));Il(r,21,(()=>yu(c)),Tl,((e,t)=>
31{var r=Vq();let n;var i=uc(r),o=uc(i,!0);Os(i);var a=hc(i),s=uc(a,!0);Os(a);var l=hc(a),c=uc(l,!0);Os(l);var d=hc(l),h=uc(d,!0);Os(d),Os(r),Pc(((e,i,a,l)=>{n=wd(r,1,"border-b border-gray-100 last:border-b-0",null,n,{"bg-blue-50":yu(u)===yu(t).num_zones,"font-semibold":yu(u)===yu(t).num_zones}),Ju(o,e),Ju(s,i),Ju(c,a),Ju(h,l)}),[()=>RU(yu(t).num_zones),()=>CU(yu(t).r_squared,3),()=>CU(yu(t).marginal_r2,3),()=>"number"==typeof yu(t).variance_captured_pct?LU(yu(t).variance_captured_pct):"—"]),Yu(e,r)})),Os(r),Os(t),Yu(e,t)};ad(s,(e=>{yu(c)&&e(l)})),Os(t),Yu(e,t)};ad(D,(e=>{(yu(c)||yu(d)||yu(r).selection_reason)&&e(z)})),Os(t),Pc(((e,t,r,n)=>{Ju(f,yu(o)??"—"),Ju(m,yu(i)??"—"),Ju(v,e),Ju(k,t),Ju(P,r),Ju(R,n)}),[()=>null!==yu(a)?CU(yu(a),4):"—",()=>RU(yu(r).total_zones),()=>OU(yu(r).total_area_m2),()=>LU(yu(r).weighted_avg_irrigation_percentage)]),Yu(e,t)},m=e=>{Yu(e,Hq())};ad(p,(e=>{yu(h)?e(g):e(m,!1)})),Yu(e,f),Ys()}(f,{get properties(){return yu(i)}});var p=hc(f,2);eW(p,{get vriData(){return t.vriData}});var g=hc(p,2);uc(g).__click=s,Os(g),Os(c),Ds(2),Os(l),nh(l,(e=>ql(n,e)),(()=>yu(n))),Nu("close",l,s),Yu(e,l),Ys()}Bu(["click"]);var aW={STROKE:"#eab308",FILL:"#eab308"},sW={STROKE:"#ffffff",FILL:"#ffffff"},lW=["#FFFFFF","#F5F9FF","#EBF3FF","#E1EDFF","#D7E7FF","#CDE1FF","#C3DBFF","#B9D5FF","#AFCFFF","#A5C9FF","#9BC3FF","#91BDFF","#87B7FF","#7DB1FF","#73ABFF","#69A5FF","#5F9FFF","#5599FF","#4B93FF","#418DD1","#3787C3","#2D81B5","#237BA7","#197599","#176F8B","#15697D","#13636F","#115D61","#0F5753","#0D5145","#0D47A1"];function cW(e){var t=Math.round(e)-85;return t<=0?lW[0]:t>=lW.length?lW[lW.length-1]:lW[t]}var uW=$u('<button type="button" class="btn btn-ghost btn-xs gap-1" title="View this VRI run\'s methodology, signals, and field totals"><svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"></path><path d="M7 14l4-4 3 3 5-6"></path></svg> Detail</button>'),dW=$u('<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider border-b"> </th>'),hW=$u('<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border border-gray-400"> </span>'),fW=$u("<td><!></td>"),pW=$u("<tr></tr>"),gW=$u('<div class="flex flex-col overflow-hidden"><div class="flex items-center justify-between mb-4 flex-shrink-0"><h3 class="text-lg font-semibold"> </h3> <div class="flex items-center gap-2"><!> <div class="text-sm text-gray-600"> </div></div></div> <div class="flex-1 overflow-x-auto"><table class="w-full bg-white border border-gray-200 rounded-lg"><thead><tr></tr></thead><tbody class="divide-y divide-gray-200"></tbody></table></div></div>');function mW(e,t){Zs(t,!0);let r=fh(t,"headerColorClass",3,"bg-gray-50");var n=gW(),i=uc(n),o=uc(i),a=uc(o,!0);Os(o);var s=hc(o,2),l=uc(s),c=e=>{var r=uW();r.__click=function(...e){t.onDetailClick?.apply(this,e)},Yu(e,r)};ad(l,(e=>{t.onDetailClick&&e(c)}));var u=hc(l,2),d=uc(u);Os(u),Os(s),Os(i);var h=hc(i,2),f=uc(h),p=uc(f),g=uc(p);Il(g,21,(()=>t.columns),Tl,((e,t)=>
31{var r=dW(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(t).header))),Yu(e,r)})),Os(g),Os(p);var m=hc(p);Il(m,21,(()=>t.vriData.features),Tl,((e,r,n)=>{const i=Dl((()=>yu(r).properties));var o=pW();wd(o,1,_d(n%2==0?"bg-white":"bg-gray-50")),Il(o,21,(()=>t.columns),Tl,((e,t)=>{const r=Dl((()=>yu(t).value(yu(i)??null,n)));var o=fW(),a=uc(o),s=e=>{const t=Dl((()=>yu(i)?.relative_irrigation_percentage??100)),n=Dl((()=>cW(yu(t)))),o=Dl((()=>function(e){var t=e.replace("#","");return(.299*Number.parseInt(t.substr(0,2),16)+.587*Number.parseInt(t.substr(2,2),16)+.114*Number.parseInt(t.substr(4,2),16))/255>.5?"#1F2937":"#FFFFFF"}(yu(n))));var a=hW(),s=uc(a,!0);Os(a),Pc((()=>{kd(a,`background-color: ${yu(n)??""}; color: ${yu(o)??""};`),Ju(s,yu(r))})),Yu(e,a)},l=e=>{var t=Wu();Pc((()=>Ju(t,yu(r)))),Yu(e,t)};ad(a,(e=>{yu(t).isPercentageBadge?e(s):e(l,!1)})),Os(o),Pc((()=>wd(o,1,"px-4 py-3 whitespace-nowrap text-sm "+(yu(t).bold?"font-medium text-gray-900":"text-gray-500")))),Yu(e,o)})),Os(o),Yu(e,o)})),Os(m),Os(f),Os(h),Os(n),Pc((()=>{Ju(a,t.title),Ju(d,`${t.vriData.features.length??""} zone${1!==t.vriData.features.length?"s":""}`),wd(p,1,r())})),Yu(e,n),Ys()}Bu(["click"]);var yW=$u("<!> <!>",1);var _W=$u("<!> <!>",1);var vW=$u("<!> <!>",1);var bW=$u("<!> <!>",1);var xW=$u('<div class="flex border border-gray-300 rounded-lg overflow-hidden shadow-sm"><button>Daily</button> <button>Change</button></div>'),wW=$u('<div class="fixed z-[9999] bg-white rounded-xl shadow-2xl ring-1 ring-black/10 p-4"><!> <div class="border-t border-gray-200 my-3"></div> <div class="flex gap-2"><button class="flex-1 text-xs px-2 py-1.5 bg-gray-100 text-gray-700 rounded hover:bg-gray-200 transition-colors">Cancel</button> <button class="flex-1 text-xs px-2 py-1.5 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">Apply</button></div></div>'),SW=$u('<span class="text-xs" aria-hidden="true">🔒</span>'),kW=$u('<div class="absolute right-0 top-full mt-1 bg-white rounded-lg shadow-xl border border-gray-200 w-52 z-[2000] overflow-hidden"><div class="py-1"><button class="w-full text-left px-4 py-2.5 hover:bg-gray-50 transition-colors text-gray-700 text-sm font-medium">Field Data</button> <button class="w-full text-left px-4 py-2.5 hover:bg-gray-50 transition-colors text-gray-700 text-sm font-medium">Irrigation Equipment</button> <button><span>Edit Crop Zones</span> <!></button></div> <div class="border-t border-gray-200"><button class="w-full text-left px-4 py-2.5 hover:bg-red-50 transition-colors text-red-600 text-sm font-medium">Delete Field</button></div></div>'),TW=$u('<div class="rounded-lg border border-gray-200 bg-white shadow-sm p-3 w-full overflow-x-auto"><!></div>'),IW=$u('<span class="text-xs text-gray-500 truncate"> </span>'),MW=$u("<!> <!>",1),EW=$u('<span class="text-[10px] text-gray-400 font-mono"> </span>'),PW=$u('<span class="text-[10px] text-gray-400 font-mono"> </span>'),AW=$u('<div class="grid grid-cols-4 gap-1.5"><div class="rounded-md px-2 py-1.5 text-center bg-gray-50 border border-gray-200"><div class="text-[9px] text-gray-500 uppercase tracking-wide">Min</div> <div class="text-[11px] font-mono font-semibold text-gray-700"> </div></div> <div class="rounded-md px-2 py-1.5 text-center bg-gray-50 border border-gray-200"><div class="text-[9px] text-gray-500 uppercase tracking-wide">Mean</div> <div class="text-[11px] font-mono font-bold text-gray-700"> </div></div> <div class="rounded-md px-2 py-1.5 text-center bg-gray-50 border border-gray-200"><div class="text-[9px] text-gray-500 uppercase tracking-wide">Max</div> <div class="text-[11px] font-mono font-semibold text-gray-700"> </div></div> <div id="cv-stat-box" class="rounded-md px-2 py-1.5 text-center bg-gray-50 border border-gray-200"><div class="text-[9px] text-gray-500 uppercase tracking-wide">CV</div> <div class="text-[11px] font-mono font-semibold text-gray-700"> </div></div> <!></div>'),CW=$u('<div class="grid grid-cols-3 gap-1.5"><div class="rounded-md px-2 py-1.5 text-center bg-gray-50 border border-gray-200"><div class="text-[9px] text-gray-500 uppercase tracking-wide">Min</div> <div class="text-[11px] font-mono font-semibold text-gray-700"> </div></div> <div class="rounded-md px-2 py-1.5 text-center bg-gray-50 border border-gray-200"><div class="text-[9px] text-gray-500 uppercase tracking-wide">Mean</div> <div class="text-[11px] font-mono font-bold text-gray-700"> </div></div> <div class="rounded-md px-2 py-1.5 text-center bg-gray-50 border border-gray-200"><div class="text-[9px] text-gray-500 uppercase tracking-wide">Max</div> <div class="text-[11px] font-mono font-semibold text-gray-700"> </div></div></div>'),RW=$u('<div class="text-[10px] text-gray-400 italic">Computing change statistics...</div>'),LW=$u('<div class="flex gap-1.5"><button class="flex-1 flex items-center justify-center px-2 py-1 rounded text-[10px] font-medium transition-colors border bg-white text-gray-500 border-gray-200 hover:bg-gray-50">Field Distribution Chart</button></div>'),OW=qu('<svg class="w-2.5 h-2.5 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>'),DW=$u('<div class="flex gap-1.5"><button>
31<!></button> <button class="flex-1 flex items-center justify-center px-2 py-1 rounded text-[10px] font-medium transition-colors border bg-white text-gray-500 border-gray-200 hover:bg-gray-50">Maps</button></div>'),zW=$u('<div class="mt-3 pt-3 border-t border-gray-200 space-y-2.5"><div class="flex items-center justify-between"><div class="flex items-center gap-2"><span class="text-xs font-semibold text-gray-700"> </span> <!></div> <span class="text-[9px] text-gray-400">abs (% of mean)</span></div> <!> <!> <!> <!></div>'),FW=$u("<!> <!>",1),NW=$u('<div class="flex items-center justify-center h-full"><div class="max-w-sm text-center p-8"><!> <h3 class="text-lg font-semibold text-gray-900 mb-2">No Machinery Set</h3> <p class="text-sm text-gray-500 mb-4">Select the type of machinery on this field to get started.</p> <button class="px-5 py-2 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700 transition-colors font-medium">Set Machinery Type</button></div></div>'),BW=$u('<div class="flex items-center justify-center h-full"><div class="max-w-sm text-center p-8"><!> <h3 class="text-lg font-semibold text-gray-900 mb-2">No Machinery Set</h3> <p class="text-sm text-gray-500 mb-4">Select the type of machinery on this field to enable VRI planning.</p> <button class="px-5 py-2 bg-blue-600 text-white text-sm rounded-lg hover:bg-blue-700 transition-colors font-medium">Set Machinery Type</button></div></div>'),jW=$u('<div class="border-t border-gray-200 p-4"><!></div>'),VW=$u('<div class="absolute inset-0 pointer-events-auto bg-white flex flex-col overflow-hidden"><div class="flex-shrink-0 border-b border-gray-200 bg-white z-[1002] relative"><div class="flex items-center px-4" style="padding-top: 13px; padding-bottom: 13px;"><div class="flex items-center gap-2 flex-shrink-0 min-w-0"><div class="relative z-[1100]"><!></div> <!> <div class="date-dropdown-container"><div class="relative"><button class="flex items-center gap-2 px-3 py-2 bg-white hover:bg-gray-50 rounded-lg transition-colors text-sm border border-gray-300"><!> <span class="font-medium text-gray-800"> </span> <span class="text-gray-400">→</span> <span class="font-medium text-gray-800"> </span> <span class="text-xs text-gray-500"> </span> <!></button> <!></div></div></div> <div class="flex items-center gap-3 flex-1 pl-4 justify-end"><div class="relative"><button class="flex items-center gap-1.5 px-3 bg-white border border-gray-200 shadow-md hover:bg-gray-50 rounded-lg transition-all text-gray-500 hover:text-gray-700 text-sm font-medium" style="height: 36px;"><!> <span>Edit</span> <!></button> <!></div> <button class="p-1.5 hover:bg-gray-100 rounded-full transition-colors text-gray-400 hover:text-gray-600" title="Close" aria-label="Close field view"><svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div></div></div> <div class="flex-1 overflow-y-auto" style="overflow-y: scroll;"><div class="flex items-stretch p-4 pb-6"><div style="width: calc(55% - 8px);" class="flex-shrink-0 flex flex-col gap-4 self-stretch"><div class="relative overflow-hidden rounded-lg border border-gray-200 bg-gray-100 shadow-sm" style="min-height: 380px; height: 50vh; max-height: 580px;"><div class="absolute inset-0"></div></div> <!></div> <div class="w-[45%] flex flex-col pl-4 self-stretch overflow-visible"><div class="flex items-center bg-gray-100 rounded-lg p-1 mb-3 mx-4 flex-shrink-0"><button><!> Field Data</button> <button><!> VRI Map <!></button></div> <div class="flex flex-col flex-shrink-0 mx-4 mb-2"><!> <div class="flex items-center gap-2"><h2 class="text-base font-semibold text-gray-900 truncate" style="max-width: 180px;"> </h2> <span class="text-gray-300">•</span> <span class="text-sm text-gray-600 truncate flex items-center gap-1" style="max-width: 140px;"> <!></span> <span class="text-gray-300">•</span> <span class="text-sm text-gray-600 whitespace-nowrap"> </span></div></div> <div class="relative flex-1 pt-2 px-4 pb-0 bg-white overflow-visible flex flex-col"><!></div></div></div> <!></div></div>'),GW=$u('<th class="p-0.5 text-center text-gray-500 font-medium" style="writing-mode: vertical-lr; transform: rotate(180deg); height: 45px;"> </th>'),UW=$u('<td class="p-0 text-center font-mono"><div class="w-full aspect-square flex items-center justify-center" style="min-width: 24px; min-height: 24px;"> </div></td>'),$W=$u('<tr><td class="p-0.5 text-right text-gray-500 font-medium pr-1 whitespace-nowrap"> </td><!></tr>'),HW=$u('<div><div class="text-xs font-semibold text-gray-600 mb-2">Daily</div> <div class="overflow-x-auto"><table class="w-full border-collapse" style="font-size: 9px;"><thead><tr><th class="p-0.5"></th><!></tr></thead><tbody></tbody></table></div></div>'),qW=$u('<th class="p-0.5 text-center text-gray-500 font-medium" style="writing-mode: vertical-lr; transform: rotate(180deg); height: 45px;"> </th>'),WW=$u('<td class="p-0 text-center font-mono"><div class="w-full aspect-square flex items-center justify-center" style="min-width: 24px; min-height: 24px;"> </div></td>'),ZW=$u('<tr><td class="p-0.5 text-right text-gray-500 font-medium pr-1 whitespace-nowrap"> </td><!></tr>'),YW=$u('<div><div class="text-xs font-semibold text-gray-600 mb-2">Difference</div> <div class="overflow-x-auto"><table class="w-full border-collapse" style="font-size: 9px;"><thead><tr><th class="p-0.5"></th><!></tr></thead><tbody></tbody></table></div></div>'),XW=$u('<div class="fixed inset-0 z-[9999] flex items-center justify-center bg-black/40"><div class="bg-white rounded-xl shadow-2xl p-5 max-w-4xl w-full mx-4 max-h-[90vh] overflow-y-auto"><div class="flex items-center justify-between mb-4"><h3 class="text-sm font-semibold text-gray-800">Metric Correlations</h3> <button class="p-1 hover:bg-gray-100 rounded-full transition-colors text-gray-400 hover:text-gray-600"><svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
31<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div><!> <!></div> <div class="flex items-center justify-center gap-1.5 text-[9px] text-gray-400 mt-3"><span class="w-4 h-2.5 rounded-sm" style="background: rgb(255,0,0);"></span> <span>-1</span> <span class="w-4 h-2.5 rounded-sm" style="background: rgb(255,255,255); border: 1px solid #e5e7eb;"></span> <span>0</span> <span class="w-4 h-2.5 rounded-sm" style="background: rgb(0,0,255);"></span> <span>+1</span></div></div></div>'),KW=$u('<div class="fixed inset-0 bg-black/40 flex items-center justify-center z-[9999]"><div class="bg-white rounded-xl shadow-xl w-80 p-6"><h3 class="text-base font-semibold text-gray-900 mb-1">Machinery Type</h3> <p class="text-sm text-gray-500 mb-4">What type of machinery is on this field?</p> <select class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 mb-4"><option disabled>Select machinery type...</option><option>Center Pivot</option><option>Hose Reel</option><option>Drip Irrigation</option></select> <div class="flex gap-2"><button class="flex-1 px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors">Cancel</button> <button class="flex-1 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"> </button></div></div></div>'),JW=$u('<div class="flex-1 rounded-t-sm transition-colors hover:opacity-80"></div>'),QW=$u('<div class="absolute top-2 bottom-2 w-px pointer-events-none"><div class="absolute -top-0.5 left-1 text-[10px] text-gray-700 font-mono whitespace-nowrap font-semibold"> </div></div>'),eZ=$u('<div class="fixed inset-0 bg-black/40 flex items-center justify-center z-[9999] p-4"><div class="bg-white rounded-xl shadow-2xl w-full max-w-2xl p-6"><div class="flex items-center justify-between mb-4"><div><h3 class="text-base font-semibold text-gray-900">Field Distribution Chart</h3> <p class="text-xs text-gray-500 mt-0.5"> </p></div> <button class="text-gray-400 hover:text-gray-600 transition-colors" title="Close" aria-label="Close"><svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div class="relative"><div class="flex items-end gap-px rounded-md bg-white border border-gray-200 p-2" style="height: 220px;"></div> <!></div> <div class="flex justify-between text-[10px] text-gray-500 mt-1 font-mono px-2"><span> </span> <span> </span></div></div></div>'),tZ=$u("<!> <!> <!> <!> <!> <!>",1);function rZ(e,t){Zs(t,!0);let r=fh(t,"mapPlaceholderRef",15,null),n=fh(t,"validCropTypes",19,(()=>[])),i=fh(t,"isAdmin",3,!1),o=$l("field-data");const a=Dl((()=>"field-data"===yu(o))),s=Dl((()=>"vri"===yu(o)));let l=$l(null),c=$l(!1),u=$l(""),d=$l(!1);async function h(){if(yu(u)&&Bw.selectedFieldId){ql(d,!0);try{if(!(await fetch(`${bh.basePath}farms/api/farm-fields/${Bw.selectedFieldId}/`,{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({primary_irrigation_type:yu(u)})})).ok)throw new Error("Failed to save irrigation type");if(t.farmFieldsGeojson){const e=t.farmFieldsGeojson.features.find((e=>Number(e.id)===Bw.selectedFieldId));e?.properties&&(e.properties.primary_irrigation_type=yu(u))}ql(l,yu(u),!0),ql(c,!1),ql(u,"")}catch(e){console.error("Error saving irrigation type:",e),alert("Failed to save irrigation type. Please try again.")}finally{ql(d,!1)}}}let f=$l(!1),p=$l(!1),g=$l(null),m=$l(null),y=$l(Jl(Bw.sidebarDateMode)),_=$l(Jl({from:Bw.selectedStartDate?new Date(`${Bw.selectedStartDate}T00:00:00`):void 0,to:Bw.selectedEndDate?new Date(`${Bw.selectedEndDate}T00:00:00`):void 0})),v=$l(!1),b=$l(!1),x=$l(null);const w=Dl((()=>{if("custom"===yu(y)&&yu(_).from&&yu(_).to){const e=Math.ceil((yu(_).to.getTime()-yu(_).from.getTime())/864e5)+1;return{startStr:Ew(yu(_).from),endStr:Ew(yu(_).to),days:e}}const e=Ow(yu(y)),t=new Date;return{startStr:Ew(new Date(t.getTime()-864e5*((e||7)-1))),endStr:Ew(t),days:e||7}}));Tc((()=>{Bw.fieldTimelineStart!==yu(w).startStr&&(Bw.fieldTimelineStart=yu(w).startStr),Bw.fieldTimelineEnd!==yu(w).endStr&&(Bw.fieldTimelineEnd=yu(w).endStr)}));const S=Dl((()=>(Bw.showVegetationIndexLayer||Bw.showETLayer)&&null!=Bw.fieldStatistics)),k=Dl((()=>Bw.fieldStatistics)),T=Dl((()=>Bw.showETLayer?"ET":Bw.vegetationIndexType?.toUpperCase()||""));function I(e,t){if(null==e||!Number.isFinite(e))return"–";const r=e.toFixed(2);return null!=t&&Number.isFinite(t)&&0!==t?`${r} (${Math.round(e/t*100)}%)`:r}let M=$l(Jl([])),E=$l(null),P=$l(!1),A=$l(!1),C=$l(null),R=$l(null),L=$l(!1);const O="abs",D=Dl((()=>{const e=Bw.metricChangeFirst,t=Bw.metricChangeLast;if(!e||!t)return null;const r=t.mean-e.mean,n=0!==e.mean?(t.mean-e.mean)/e.mean*100:null;return{firstDate:e.date,lastDate:t.date,absolute:r,relative:n,isPositive:r>=0}})),z=Dl((()=>Bw.showETLayer||Bw.showVegetationIndexLayer)),F=Dl((()=>yu(z)&&null!==yu(D)&&Bw.metricChangeFirst?.date!==Bw.metricChangeLast?.date)),N=(Dl((()=>
31{if(!yu(D))return"";const e=yu(D).isPositive?"+":"",t=`${e}${yu(D).absolute.toFixed(3)}`;return null!=yu(D).relative?`${t} (${e}${yu(D).relative.toFixed(1)}%)`:t})),Dl((()=>yu(D)?.isPositive?"#059669":"#dc2626")),Dl((()=>{const e=Bw.changeRasterData;if(!e?.rawData)return null;let t=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,n=0,i=0;for(let o=0;o<e.rawData.length;o++){const a=e.rawData[o];!Number.isNaN(a)&&Number.isFinite(a)&&(a<t&&(t=a),a>r&&(r=a),n+=a,i++)}if(0===i)return null;const o=n/i;let a=0;for(let t=0;t<e.rawData.length;t++){const r=e.rawData[t];!Number.isNaN(r)&&Number.isFinite(r)&&(a+=(r-o)**2)}return{min:t,max:r,mean:o,std:Math.sqrt(a/i)}})));let B=$l("daily"),j=$l(!1);Tc((()=>{Bw.showChangeRaster="change"===yu(B),Bw.changeRasterMode=O}));let V=null,G=null,U=null,$=0,H=null;function q(){const e="change"===yu(B)&&Bw.changeRasterData?function(){const e=Bw.changeRasterData;if(!e?.rawData)return[];const t=[];for(let r=0;r<e.rawData.length;r++){const n=e.rawData[r];!Number.isNaN(n)&&Number.isFinite(n)&&t.push(n)}return t}():function(){const e=Bw.selectedFieldId;if(!e)return[];const t=Bw.imagerySource||"standard",r=Bw.showETLayer?"et":Bw.vegetationIndexType,n=`${e}-${Bw.showETLayer?Bw.selectedETDate:Bw.selectedVegetationDate}-${r}-${t}`,i=sV.get(n);if(!i?.rawData)return[];const o=i.rawData,a=i.noDataValue,s=[];for(let e=0;e<o.length;e++){const t=o[e];null!=a&&t===a||!Number.isNaN(t)&&Number.isFinite(t)&&s.push(t)}return s}();if(0===e.length)return ql(M,[],!0),void ql(E,null);let t=0;for(const r of e)t+=r;ql(E,t/e.length);const r=Math.min(...e),n=(Math.max(...e)-r)/30||1,i=new Array(30).fill(0);for(const t of e){i[Math.min(Math.floor((t-r)/n),29)]++}ql(M,i.map(((e,t)=>({x:r+(t+.5)*n,y:e}))),!0)}Tc((()=>{const e=Bw.selectedFieldId;if(e!==H){H=e,V=null,G=null,U=null,Bw.metricChangeFirst=null,Bw.metricChangeLast=null,Bw.changeRasterData=null;const t="change"===yu(B)&&null!==e;Bw.metricChangeLoading=t,Bw.changeRasterLoading=t}})),Tc((()=>{const e=Bw.metricChangeFirst,r=Bw.metricChangeLast,n=Bw.selectedFieldId,i=Bw.vegetationIndexType,o=Bw.imagerySource,a=O,s=++$;if(!e||!r||!n||e.date===r.date)return Bw.changeRasterData=null,void(Bw.changeRasterLoading="change"===yu(B)&&null!==n&&Bw.metricChangeLoading);const l=`${n}|${o}|${i}|${e.date}|${r.date}`;if(U===l&&V&&G){const e=gV(V,G,a,i);return Bw.changeRasterData=e,void(Bw.changeRasterLoading=!1)}V=null,G=null,U=null,Bw.changeRasterLoading=!0;const c=async e=>{const r=`${n}-${e}-${i}-${o}`,a=sV.get(r);if(a)return a;const s=t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===n));if(!s?.geometry)throw new Error("Field geometry not found");if("clearsky"===o){return FP(yu(le)??s.properties?.farm_field_id,e,i)}return kB(s.geometry,e,i)};Promise.all([c(e.date),c(r.date)]).then((([e,t])=>{if(s!==$)return;V=e,G=t,U=l;const r=gV(e,t,a,i);Bw.changeRasterData=r})).catch((e=>{s===$&&(console.error("[FieldView] Failed to compute change raster:",e),Bw.changeRasterData=null)})).finally((()=>{s===$&&(Bw.changeRasterLoading=!1)}))}));const W=Aw.filter((e=>e.available&&"visual"!==e.category&&(!e.sources||e.sources.includes(Bw.imagerySource))));function Z(e){const t=e.target;t.closest(".date-dropdown-container")||t.closest(".field-date-dropdown")||t.closest(".field-date-container")||(ql(v,!1),ql(b,!1))}function Y(){Bw.selectedFieldId=null,Bw.selectedFieldName="",Bw.vriData=null,Bw.raindancerVRIData=null,t.onClose&&t.onClose()}Tc((()=>{lV.value,Bw.changeRasterData,yu(B),Bw.selectedVegetationDate,Bw.vegetationIndexType;yu(S)&&yu(k)?q():(ql(M,[],!0),ql(E,null))})),Tc((()=>{if(yu(v)||yu(b))return document.addEventListener("click",Z),()=>document.removeEventListener("click",Z)})),Tc((()=>{Bw.selectedFieldId&&(ql(y,Bw.sidebarDateMode,!0),ql(_,{from:Bw.selectedStartDate?new Date(`${Bw.selectedStartDate}T00:00:00`):void 0,to:Bw.selectedEndDate?new Date(`${Bw.selectedEndDate}T00:00:00`):void 0},!0))}));let X=Dl((()=>t.farmFieldsGeojson&&t.evapotranspirationData?dA(t.farmFieldsGeojson,t.evapotranspirationData):null));yh((async()=>{yu(X)&&await yu(X).initialize()})),Tc((()=>{if(yu(f))return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){const t=e.target;yu(m)&&!yu(m).contains(t)&&yu(g)&&!yu(g).contains(t)&&ql(f,!1)}})),Tc((()=>{yu(X)&&void 0!==Bw.selectedStartDate&&Promise.resolve(yu(X).loadPrecipitationData()).catch((e=>console.error("loadPrecipitationData effect failed:",e))).finally((()=>yu(X).calculateEvapotranspirationAverages()))}));const K=Dl((()=>t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===Bw.selectedFieldId)))),J=Dl((()=>yu(K)?.properties?.pro_activated??!1)),Q=Dl((()=>!0===yu(K)?.properties?.cloudless_activated));function ee(){ql(f,!1),yu(Q)?t.onSplitField?.():(Bw.selectedFieldId&&(Bw.upgradePreselectedFieldId=Bw.selectedFieldId),Bw.upgradeTier="pro",Bw.upgradeModalOpen=!0)}
31function te(){yu(J)?ql(o,"vri"):(Bw.selectedFieldId&&(Bw.upgradePreselectedFieldId=Bw.selectedFieldId),Bw.upgradeTier="pro",Bw.upgradeModalOpen=!0)}const re=Dl((()=>yu(K)?.properties?.crop_zones?.[0]?.crop_type||"Undefined Crop")),ne=Dl((()=>yu(K)?.properties?.crop_zones??[])),ie=Dl((()=>{const e=Bw.selectedCropZoneId;return e?yu(ne).find((t=>t.crop_zone_id===e))??null:null})),oe=Dl((()=>!!yu(ie)&&yu(ne).length>1)),ae=Dl((()=>yu(ie)?.crop_type||yu(re))),se=Dl((()=>!yu(ie)?.crop_type||"No Crop"===yu(ae))),le=Dl((()=>{const e=Bw.selectedCropZoneId;if(e)return e;const t=yu(ne)[0]?.crop_zone_id;return t||(yu(K)?.properties?.farm_field_id??null)})),ce=Dl((()=>{if(!yu(K))return yu(K);const e=yu(ie)?.crop_zone_id;if(!e)return yu(K);const t=(yu(K).properties?.irrigation_events??[]).filter((t=>null==t.crop_zone_id||t.crop_zone_id===e));return{...yu(K),properties:{...yu(K).properties,irrigation_events:t}}})),ue=Dl((()=>yu(ce)&&yu(X)?yu(X).getTableRowData(yu(ce)):null)),de=Dl((()=>{if(!t.tasksData||!yu(K))return null;const e=Number(yu(K).id),r=t.tasksData.filter((t=>"sowing"===t.type&&t.farm_field_id===e)).sort(((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()));return r[0]?.date||null})),he=Dl((()=>yu(K)?.geometry?pS(yu(K)):"0")),fe=(Dl((()=>{const e=yu(ce)?.properties?.irrigation_events?.[0];return e?.date?new Date(e.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):"---"})),Dl((()=>{if(null!==yu(l))return yu(l);const e=yu(K)?.properties;return e?.primary_irrigation_type||null})));Tc((()=>{Bw.selectedFieldId&&(ql(l,null),Bw.changeRasterData=null,ql(P,!1),ql(C,null),ql(R,null),ql(A,!1))}));let pe=$l(0);function ge(e,t=0){Bw.vriData=e,ql(pe,t,!0)}Tc((()=>{"vri"!==yu(o)&&(Bw.vriData=null)}));const me=Dl((()=>!!yu(K)?.properties?.raindancer_field_guid));Tc((()=>{const e=Bw.selectedFieldId,t=Bw.showRaindancerVRI,r=yu(me);t&&e&&r?(Bw.raindancerVRILoading=!0,wz(e).then((t=>{Bw.selectedFieldId===e&&Bw.showRaindancerVRI&&(Bw.raindancerVRIData=t)})).catch((e=>{console.debug("Raindancer VRI zones unavailable:",e),Bw.raindancerVRIData=null})).finally((()=>{Bw.raindancerVRILoading=!1}))):Bw.raindancerVRIData=null}));var ye=tZ(),_e=dc(ye),ve=e=>{var n=VW(),l=uc(n),d=uc(l),h=uc(d),p=uc(h);aV(uc(p),{inline:!0,onMonthChange:(e,r)=>EV(e,r,t.farmFieldsGeojson),onETMonthChange:(e,r)=>dk(e,r,t.farmFieldsGeojson),get farmFieldsGeojson(){return t.farmFieldsGeojson},get isAdmin(){return i()},onActivated:()=>window.location.reload()}),Os(p);var E=hc(p,2),z=e=>{var t=xW(),r=uc(t);r.__click=()=>ql(B,"daily");var n=hc(r,2);n.__click=()=>ql(B,"change"),Os(t),Pc((()=>{wd(r,1,"px-3 py-2 text-sm font-medium transition-colors "+("daily"===yu(B)?"bg-gray-800 text-white":"bg-white text-gray-600 hover:bg-gray-50")),wd(n,1,"px-3 py-2 text-sm font-medium transition-colors "+("change"===yu(B)?"bg-blue-600 text-white":"bg-white text-gray-600 hover:bg-gray-50"))})),Yu(e,t)};ad(E,(e=>{yu(F)&&e(z)}));var V=hc(E,2),G=uc(V),U=uc(G);U.__click=e=>{e.stopPropagation(),ql(b,!yu(b))};var $=uc(U);Sk($,{class:"w-4 h-4 text-gray-500 flex-shrink-0"});var H=hc($,2),q=uc(H,!0);Os(H);var Z=hc(H,4),X=uc(Z,!0);Os(Z);var K=hc(Z,2),re=uc(K);Os(K),Mk(hc(K,2),{class:"w-3 h-3 text-gray-400 flex-shrink-0"}),Os(U),nh(U,(e=>ql(x,e)),(()=>yu(x)));var ne=hc(U,2),de=e=>{const t=Dl((()=>yu(x).getBoundingClientRect()));var r=wW();r.__click=e=>e.stopPropagation();var n=uc(r);X_(n,{range:!0,inline:!0,get rangeFrom(){return yu(_).from},set rangeFrom(e){yu(_).from=e},get rangeTo(){return yu(_).to},set rangeTo(e){yu(_).to=e}});var i=hc(n,4),o=uc(i);o.__click=()=>ql(b,!1),hc(o,2).__click=()=>{yu(_).from&&yu(_).to&&(ql(y,"custom"),ql(v,!1),ql(b,!1)),ql(b,!1)},Os(i),Os(r),Pc((()=>kd(r,`top: ${yu(t).bottom+8}px; left: ${yu(t).left??""}px;`))),Yu(e,r)};ad(ne,(e=>{yu(b)&&yu(x)&&e(de)})),Os(G),Os(V),Os(h);var me=hc(h,2),ye=uc(me),_e=uc(ye);_e.__click=()=>ql(f,!yu(f));var ve=uc(_e);!function(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"ariaLabel",3,"edit solid"),s=lh(t,["$$slots","$$events","$$legacy","size","color","title","desc","class","ariaLabel"]),l=`${t.title?.id||""} ${t.desc?.id||""}`;const c=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var u=FN();Nd(u,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:o(),...s,class:e,"aria-label":a(),"aria-describedby":yu(c)?l:void 0,viewB
31ox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var d=uc(u),h=e=>{var r=DN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(d,(e=>{t.title?.id&&t.title.title&&e(h)}));var f=hc(d),p=e=>{var r=zN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(f,(e=>{t.desc?.id&&t.desc.desc&&e(p)})),Ds(2),Os(u),Yu(e,u),Ys()}(ve,{class:"w-3.5 h-3.5"}),Mk(hc(ve,4),{class:"w-3 h-3"}),Os(_e),nh(_e,(e=>ql(g,e)),(()=>yu(g)));var be=hc(_e,2),xe=e=>{var r=kW(),n=uc(r),i=uc(n);i.__click=()=>{ql(f,!1),t.onEditField?.()};var o=hc(i,2);o.__click=()=>{ql(f,!1),t.onEditMachinery?.()};var a=hc(o,2);a.__click=ee;var s=hc(uc(a),2),l=e=>{Yu(e,SW())};ad(s,(e=>{yu(Q)||e(l)})),Os(a),Os(n);var c=hc(n,2);uc(c).__click=async()=>{if(confirm(`Are you sure you want to delete "${Bw.selectedFieldName}"? This action cannot be undone.`)){const e=Bw.selectedFieldId,t=`${bh.basePath}farms/edit-farm/delete-farm-field/${e}/`;try{const e=await fetch(t,{method:"POST",headers:{"X-CSRFToken":bh.csrfToken}});e.ok?window.location.reload():(console.error("Failed to delete field:",await e.text()),alert("Failed to delete field. Please try again."))}catch(e){console.error("Error deleting field:",e),alert("Error deleting field. Please try again.")}}ql(f,!1)},Os(c),Os(r),nh(r,(e=>ql(m,e)),(()=>yu(m))),Pc((()=>{wd(a,1,"w-full text-left px-4 py-2.5 hover:bg-gray-50 transition-colors text-sm font-medium flex items-center justify-between gap-2 "+(yu(Q)?"text-gray-700":"text-gray-500")),Fd(a,"title",yu(Q)?"":"Requires ClearSky or Pro")})),Yu(e,r)};ad(be,(e=>{yu(f)&&e(xe)})),Os(ye),hc(ye,2).__click=Y,Os(me),Os(d),Os(l);var we=hc(l,2),Se=uc(we),ke=uc(Se),Te=uc(ke);nh(uc(Te),(e=>r(e)),(()=>r())),Os(Te);var Ie=hc(Te,2),Me=e=>{var t=TW(),r=uc(t),n=e=>{!function(e,t){Zs(t,!0);let r=fh(t,"baseIrrigationAmount",3,null),n=fh(t,"isAdmin",3,!1),i=$l(!1);const o=[{header:"Zone ID",bold:!0,value:(e,t)=>String(e?.zone_id||t+1)},{header:"Start Angle",bold:!0,value:e=>void 0!==e?.start_angle?`${e.start_angle.toFixed(1)}°`:"N/A"},{header:"End Angle",bold:!0,value:e=>void 0!==e?.end_angle?`${e.end_angle.toFixed(1)}°`:"N/A"},{header:"Irrigation %",isPercentageBadge:!0,value:e=>`${Math.round(e?.relative_irrigation_percentage??100)}%`},{header:"Amount (mm)",bold:!0,value:e=>Wq(e,r())}];var a=bW(),s=dc(a);{let e=Dl((()=>n()?()=>ql(i,!0):void 0));mW(s,{title:"Pivot VRI Plan Zones",get vriData(){return t.vriData},get columns(){return o},headerColorClass:"bg-green-50",get onDetailClick(){return yu(e)}})}oW(hc(s,2),{get vriData(){return t.vriData},onClose:()=>ql(i,!1),get open(){return yu(i)},set open(e){ql(i,e,!0)}}),Yu(e,a),Ys()}(e,{get vriData(){return Bw.vriData},get baseIrrigationAmount(){return yu(pe)},get isAdmin(){return i()}})},o=e=>{var t=Zu(),r=dc(t),n=e=>{!function(e,t){Zs(t,!0);let r=fh(t,"baseIrrigationAmount",3,null),n=fh(t,"isAdmin",3,!1),i=$l(!1);const o=[{header:"Zone ID",bold:!0,value:(e,t)=>String(e?.zone_id||t+1)},{header:"Irrigation %",isPercentageBadge:!0,value:e=>`${Math.round(e?.relative_irrigation_percentage??100)}%`},{header:"Amount (mm)",bold:!0,value:e=>Wq(e,r())}];var a=vW(),s=dc(a);{let e=Dl((()=>n()?()=>ql(i,!0):void 0));mW(s,{title:"Hose Reel VRI Plan Zones",get vriData(){return t.vriData},get columns(){return o},headerColorClass:"bg-orange-50",get onDetailClick(){return yu(e)}})}oW(hc(s,2),{get vriData(){return t.vriData},onClose:()=>ql(i,!1),get open(){return yu(i)},set open(e){ql(i,e,!0)}}),Yu(e,a),Ys()}(e,{get vriData(){return Bw.vriData},get baseIrrigationAmount(){return yu(pe)},get isAdmin(){return i()}})},o=e=>{var t=Zu(),r=dc(t),n=e=>{!function(e,t){Zs(t,!0);let r=fh(t,"baseIrrigationAmount",3,null),n=fh(t,"isAdmin",3,!1),i=$l(!1);const o=[{header:"Zone ID",bold:!0,value:(e,t)=>String(e?.zone_id||t+1)},{header:"Zone Name",value:e=>e?.zone_name||e?.name||"Unknown"},{header:"Irrigation %",isPercentageBadge:!0,value:e=>`${Math.round(e?.relative_irrigation_percentage??100)}%`},{header:"Amount (mm)",bold:!0,value:e=>Wq(e,r())}];var a=yW(),s=dc(a);{let e=Dl((()=>n()?()=>ql(i,!0):void 0));mW(s,{title:"Drip VRI Plan Zones",get vriData(){return t.vriData},get columns(){return o},headerColorClass:"bg-blue-50",get onDetailClick(){return yu(e)}})}oW(hc(s,2),{get vriData(){return t.vriData},onClose:()=>ql(i,!1),get open(){return yu(i)},set open(e){ql(i,e,!0)}}),Yu(e,a),Ys()}(e,{get vriData(){return Bw.vriData}
31,get baseIrrigationAmount(){return yu(pe)},get isAdmin(){return i()}})},o=e=>{!function(e,t){Zs(t,!0);let r=fh(t,"baseIrrigationAmount",3,null),n=fh(t,"isAdmin",3,!1),i=$l(!1);const o=[{header:"Zone ID",bold:!0,value:(e,t)=>String(e?.zone_id||t+1)},{header:"Irrigation %",isPercentageBadge:!0,value:e=>`${Math.round(e?.relative_irrigation_percentage??100)}%`},{header:"Amount (mm)",bold:!0,value:e=>Wq(e,r())},{header:"Area (ha)",value:e=>"number"==typeof e?.area_m2?(e.area_m2/1e4).toFixed(2):"—"}];var a=_W(),s=dc(a);{let e=Dl((()=>n()?()=>ql(i,!0):void 0));mW(s,{title:"Field Zones",get vriData(){return t.vriData},get columns(){return o},headerColorClass:"bg-purple-50",get onDetailClick(){return yu(e)}})}oW(hc(s,2),{get vriData(){return t.vriData},onClose:()=>ql(i,!1),get open(){return yu(i)},set open(e){ql(i,e,!0)}}),Yu(e,a),Ys()}(e,{get vriData(){return Bw.vriData},get baseIrrigationAmount(){return yu(pe)},get isAdmin(){return i()}})};ad(r,(e=>{"drip"===yu(fe)?e(n):e(o,!1)}),!0),Yu(e,t)};ad(r,(e=>{"hose_reel"===yu(fe)?e(n):e(o,!1)}),!0),Yu(e,t)};ad(r,(e=>{"pivot"===yu(fe)?e(n):e(o,!1)})),Os(t),Yu(e,t)};ad(Ie,(e=>{yu(s)&&Bw.vriData?.features?.length&&e(Me)})),Os(ke);var Ee=hc(ke,2),Pe=uc(Ee),Ae=uc(Pe);Ae.__click=()=>ql(o,"field-data"),function(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"chart outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=jN();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=NN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=BN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}(uc(Ae),{class:"w-4 h-4"}),Ds(),Os(Ae);var Ce=hc(Ae,2);Ce.__click=te;var Re=uc(Ce);$N(Re,{class:"w-4 h-4"});var Le=hc(Re,2),Oe=e=>{!function(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"ariaLabel",3,"lock solid"),s=lh(t,["$$slots","$$events","$$legacy","size","color","title","desc","class","ariaLabel"]),l=`${t.title?.id||""} ${t.desc?.id||""}`;const c=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var u=WN();Nd(u,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:o(),...s,class:e,"aria-label":a(),"aria-describedby":yu(c)?l:void 0,viewBox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var d=uc(u),h=e=>{var r=HN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(d,(e=>{t.title?.id&&t.title.title&&e(h)}));var f=hc(d),p=e=>{var r=qN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(f,(e=>{t.desc?.id&&t.desc.desc&&e(p)})),Ds(),Os(u),Yu(e,u),Ys()}(e,{class:"w-3.5 h-3.5 text-gray-400"})};ad(Le,(e=>{yu(J)||e(Oe)})),Os(Ce),Os(Pe);var De=hc(Pe,2),ze=uc(De),Fe=e=>{var t=IW(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,Bw.selectedFieldName||`Field ${Bw.selectedFieldId}`))),Yu(e,t)};ad(ze,(e=>{yu(oe)&&e(Fe)}));var Ne=hc(ze,2),Be=uc(Ne),je=uc(Be,!0);Os(Be);var Ve=hc(Be,4),Ge=uc(Ve),Ue=hc(Ge),$e=e=>{var t=MW(),r=dc(t);!function(e,t){Zs(t,!0);const r=qs("iconCtx")??{},n={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"};let i=fh(t,"size",19,(()=>r.size||"md")),o=fh(t,"color",19,(()=>r.color||"currentColor")),a=fh(t,"strokeWidth",19,(()=>r.strokeWidth||"2")),s=fh(t,"ariaLabel",3,"exclamation circle outline"),l=lh(t,["$$slots","$$events","$$legacy","size","color","title","strokeWidth","desc","class","ariaLabel"]),c=`${t.title?.id||""} ${t.desc?.id||""}`;const u=Dl((()=>!(!t.title?.id&&!t.desc?.id)));var d=XN();Nd(d,(e=>({xmlns:"http://www.w3.org/2000/svg",fill:"none",color:o(),...l,class:e,"aria-label":s(),"aria-describedby":yu(u)?c:void 0,viewB
31ox:"0 0 24 24"})),[()=>(0,km.twMerge)(yd("shrink-0",n[i()],t.class))]);var h=uc(d),f=e=>{var r=ZN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.title.id),Ju(n,t.title.title)})),Yu(e,r)};ad(h,(e=>{t.title?.id&&t.title.title&&e(f)}));var p=hc(h),g=e=>{var r=YN(),n=uc(r,!0);Os(r),Pc((()=>{Fd(r,"id",t.desc.id),Ju(n,t.desc.desc)})),Yu(e,r)};ad(p,(e=>{t.desc?.id&&t.desc.desc&&e(g)}));var m=hc(p);Os(d),Pc((()=>Fd(m,"stroke-width",a()))),Yu(e,d),Ys()}(r,{class:"w-4 h-4 text-amber-500 flex-shrink-0"}),Xv(hc(r,2),{children:(e,t)=>{Ds(),Yu(e,Wu("Set crop type for this field"))},$$slots:{default:!0}}),Yu(e,t)};ad(Ue,(e=>{yu(se)&&e($e)})),Os(Ve);var He=hc(Ve,4),qe=uc(He);Os(He),Os(Ne),Os(De);var We=hc(De,2),Ze=uc(We),Ye=e=>{var r=FW(),n=dc(r);{let e=Dl((()=>yu(ue)?.dateLabel||"")),r=Dl((()=>parseFloat(yu(ue)?.precip||"0"))),i=Dl((()=>parseFloat(yu(ue)?.et||"0"))),o=Dl((()=>parseFloat(yu(ue)?.irrigation||"0")));lG(n,{get selectedField(){return yu(ce)},get tasksData(){return t.tasksData},get dateRangeLabel(){return yu(e)},get precipTotal(){return yu(r)},get etTotal(){return yu(i)},get irrigationTotal(){return yu(o)}})}var o=hc(n,2),a=e=>{const r=Dl((()=>Bw.legendColorScale)),n=(Dl((()=>yu(r)?.(yu(k).min))),Dl((()=>yu(r)?.(yu(k).mean))),Dl((()=>yu(r)?.(yu(k).max))),Dl((()=>Bw.showETLayer?Bw.selectedETDate:Bw.selectedVegetationDate)));var o=zW(),a=uc(o),s=uc(a),l=uc(s),c=uc(l,!0);Os(l);var u=hc(l,2),d=e=>{var t=EW(),r=uc(t);Os(t),Pc(((e,t)=>Ju(r,`${e??""} → ${t??""}`)),[()=>Pw(Bw.fieldTimelineStart),()=>Pw(Bw.fieldTimelineEnd)]),Yu(e,t)},h=e=>{var t=Zu(),r=dc(t),i=e=>{var t=PW(),r=uc(t,!0);Os(t),Pc((e=>Ju(r,e)),[()=>Pw(yu(n))]),Yu(e,t)};ad(r,(e=>{yu(n)&&e(i)}),!0),Yu(e,t)};ad(u,(e=>{"change"===yu(B)&&Bw.fieldTimelineStart&&Bw.fieldTimelineEnd?e(d):e(h,!1)})),Os(s),Ds(2),Os(a);var f=hc(a,2),p=e=>{var t=AW(),r=uc(t),n=hc(uc(r),2),i=uc(n,!0);Os(n),Os(r);var o=hc(r,2),a=hc(uc(o),2),s=uc(a,!0);Os(a),Os(o);var l=hc(o,2),c=hc(uc(l),2),u=uc(c,!0);Os(c),Os(l);var d=hc(l,2),h=hc(uc(d),2),f=uc(h,!0);Os(h),Os(d),Xv(hc(d,2),{triggeredBy:"#cv-stat-box",placement:"top",class:"text-xs max-w-xs",children:(e,t)=>{Ds(),Yu(e,Wu("Coefficient of Variation shows how much variability there is in the field. Higher values mean more variable crop performance."))},$$slots:{default:!0}}),Os(t),Pc(((e,t,r,n)=>{Ju(i,e),Ju(s,t),Ju(u,r),Ju(f,n)}),[()=>I(yu(k).min,yu(k).mean),()=>null!=yu(k).mean&&Number.isFinite(yu(k).mean)?yu(k).mean.toFixed(2):"–",()=>I(yu(k).max,yu(k).mean),()=>0!==yu(k).mean?`${Math.round(yu(k).std/yu(k).mean*100)}%`:"—"]),Yu(e,t)};ad(f,(e=>{"daily"===yu(B)&&e(p)}));var g=hc(f,2),m=e=>{var t=Zu(),r=dc(t),n=e=>{const t=Dl((()=>yu(k).mean));var r=CW(),n=uc(r),i=hc(uc(n),2),o=uc(i,!0);Os(i),Os(n);var a=hc(n,2),s=hc(uc(a),2),l=uc(s,!0);Os(s),Os(a);var c=hc(a,2),u=hc(uc(c),2),d=uc(u,!0);Os(u),Os(c),Os(r),Pc(((e,t,r)=>{Ju(o,e),Ju(l,t),Ju(d,r)}),[()=>I(yu(N).min,yu(t)),()=>I(yu(N).mean,yu(t)),()=>I(yu(N).max,yu(t))]),Yu(e,r)},i=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,RW())};ad(r,(e=>{Bw.changeRasterLoading&&e(n)}),!0),Yu(e,t)};ad(r,(e=>{yu(N)?e(n):e(i,!1)})),Yu(e,t)};ad(g,(e=>{"change"===yu(B)&&yu(F)&&yu(D)&&e(m)}));var y=hc(g,2),_=e=>{var t=LW();uc(t).__click=()=>ql(j,!0),Os(t),Yu(e,t)};ad(y,(e=>{yu(M).length>0&&e(_)}));var v=hc(y,2),b=e=>{var r=DW(),n=uc(r);n.__click=()=>{ql(P,!yu(P)),!yu(P)||yu(C)||yu(L)||async function(){const e=Bw.selectedFieldId,r=Bw.imagerySource||"standard";if(!e)return;const n=t.farmFieldsGeojson?.features?.find((t=>Number(t.id)===e));if(!n?.geometry)return;ql(L,!0),ql(C,null),ql(R,null);const i=Bw.showETLayer?Bw.selectedETDate:Bw.selectedVegetationDate,o=Bw.metricChangeFirst?.date,a=Bw.metricChangeLast?.date,s=o&&a&&o!==a,l=async(t,i)=>{const o=`${e}-${t}-${i}-${r}`,a=sV.get(o);return a||("clearsky"===r?FP(yu(le)??n.properties?.farm_field_id,t,i):kB(n.geometry,t,i))};try{if(i){const e=new Map;for(const t of W)try{e.set(t.label,await l(i,t.value))}catch(e){console.warn(`[correlations] Daily fetch failed ${t.label}:`,e)}ql(C,xV(e),!0)}if(s){const e=new Map;for(const t of W)try{const[r,n]=await Promise.all([l(o,t.value),l(a,t.value)]),i=gV(r,n,O,t.value);i&&e.set(t.label,i)}catch(e){console.warn(`[correlations] Change fetch failed ${t.label}:`,e)}ql(R,xV(e),!0)}}catch(e){console.error("[correlations] Failed:",e)}finally{ql(L,!1)}}()};var i=uc(n),o=e=>{Yu(e,OW())},a=e=>{Yu(e,Wu("Correlations"))};ad(i,(e=>{yu(L)?e(o):e(a,!1)})),Os(n),hc(n,2).__click=()=>ql(A,!0),Os(r),Pc((()=>wd(n,1,"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded text-[10px] font-medium transition-colors border\n                        "+(yu(P)?"bg-gray-700 text-white border-gray-700":"bg-white text-gray-500 border-gray-200 hover:bg-gray-50")))),Yu(e,r)};ad(v,(e=>{i()&&e(b)})),Os(o),Pc((()=>Ju(c,yu(T)))),Yu(e,o)};ad(o,(e=>{yu(S)&&yu(k)&&e(a)})),Yu(e,r)},Xe=e=>{var r=Zu(),n=dc(r),o=e=>{var r=Zu(),n=dc(r),o=e=>{var t=NW(),r=uc(t),n=uc(r);$N(n,{class:"w-12 h-12 mx-auto text-gray-300 mb-3"}),hc(n,6).__click=()=>{ql(c,!0),ql(u,"")},Os(r),Os(t),Yu(e,t)},a=e=>{var r=Zu(),n=dc(r),o=e=>{{let r=Dl((()=>t.farmFieldsGeojson||{type:"FeatureCollection",features:[]}));Dq(e,{vriType:"pivot",get farmFieldsGeojson(){return yu(r)},get pivotExtentsGeojson(){return t.pivotExtentsGeojson},onVRIDataChange:ge,get isAdmin(){return i()}})}},a=e=>{var r=Zu(),n=dc(r),o=e=>{{let r=Dl((()=>t.farmFieldsGeojson||{type:"FeatureCollection",features:[]}));Dq(e,{vriType:"hose_reel",get farmFieldsGeojson(){return yu(r)},get hoseReelRoutesGeojson(){return t.hoseReelRoutesGeojson},onVRIDataChange:ge,get isAdmin(){return i()}})}},a=e=>{var r=Zu(),n=dc(r),o=e=>{{let r=Dl((()=>t.farmFieldsGeojson||{type:"FeatureCollection",features:[]}));Dq(e,{vriType:"drip",get farmFieldsGeojson(){return yu(r)},get dripBoundariesGeojson(){return t.dripBoundariesGeojson},onVRIDataChange:ge,get isAdmin(){return i()}})}},a=e=>{var t=Zu(),r=dc(t),n=e=>{var t=BW(),r=uc(t),n=uc(r);$N(n,{class:"w-12 h-12 mx-auto text-gray-300 mb-3"}),hc(n,6).__click=()=>{ql(c,!0),ql(u,"")},Os(r),Os(t),Yu(e,t)};ad(r,(e=>{"none"===yu(fe)&&e(n)}),!0),Yu(e,t)};ad(n,(e=>{"drip"===yu(fe)?e(o):e(a,!1)}),!0),Yu(e,r)};ad(n,(e=>{"hose_reel"===yu(fe)?e(o):e(a,!1)}),!0),Yu(e,r)};ad(n,(e=>{"pivot"===yu(fe)?e(o):e(a,!1)}),!0),Yu(e,r)};ad(n,(e=>{null===yu(fe)?e(o):e(a,!1)})),Yu(e,r)};ad(n,(e=>{yu(s)&&e(o)}),!0),Yu(e,r)};ad(Ze,(e=>{yu(a)?e(Ye):e(Xe,!1)})),Os(We),Os(Ee),Os(Se);var Ke=hc(Se,2),Je=e=>{var r=jW();CG(uc(r),{get farmFieldsGeojson(){return t.farmFieldsGeojson},get evapotranspirationData(){return t.evapotranspirationData}}),Os(r),Yu(e,r)};ad(Ke,(e=>{yu(a)&&e(Je)})),Os(we),Os(n),Pc(((e,t)=>{Ju(q,e),Ju(X,t),Ju(re,`(${yu(w).days??""}d)`),kd(Se,yu(s)&&Bw.vriData?.features?.length?"min-height: 380px;":"min-height: 380px; height: 50vh; max-height: 580px;"),wd(Ae,1,"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium rounded-md transition-all "+(yu(a)?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900")),wd(Ce,1,"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium rounded-md transition-all "+(yu(s)?"bg-white text-gray-900 shadow-sm":yu(J)?"text-gray-600 hover:text-gray-900":"text-gray-400")),Fd(Ce,"title",yu(J)?"":"Upgrade to Pro"),Ju(je,yu(oe)?yu(ie).name:Bw.selectedFieldName||`Field ${Bw.selectedFieldId}`),Ju(Ge,`${yu(ae)??""} `),Ju(qe,`${yu(he)??""} Ha`)}),[()=>Pw(yu(w).startStr),()=>Pw(yu(w).endStr)]),Nu("scroll",we,(function(...e){t.onScroll?.apply(this,e)})),Yu(e,n)};ad(_e,(e=>{Bw.selectedFieldId&&e(ve)}));var be=hc(_e,2);{let e=Dl((()=>yu(K)?.geometry)),t=Dl((()=>yu(le)??yu(K)?.properties?.farm_field_id)),r=Dl((()=>Bw.metricChangeFirst?.date??null)),n=Dl((()=>Bw.metricChangeLast?.date??null));YV(be,{get open(){return yu(A)},onClose:()=>ql(A,!1),get fieldId(){return Bw.selectedFieldId},get fieldGeometry(){return yu(e)},get farmFieldId(){return yu(t)},get imagerySource(){return Bw.imagerySource},viewChangeMode:O,get dailyDate(){return Bw.selectedVegetationDate},get changeFirstDate(){return yu(r)},get changeLastDate(){return yu(n)}})}var xe=hc(be,2),we=e=>{var t=XW();t.__click=()=>ql(P,!1);var r=uc(t);r.__click=e=>e.stopPropagation();var n=uc(r);hc(uc(n),2).__click=()=>ql(P,!1),Os(n);var i=hc(n,2),o=uc(i),a=e=>{var t=HW(),r=hc(uc(t),2),n=uc(r),i=uc(n),o=uc(i);Il(hc(uc(o)),17,(()=>yu(C).metrics),Tl,((e,t)=>
31{var r=GW(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(t)))),Yu(e,r)})),Os(o),Os(i);var a=hc(i);Il(a,21,(()=>yu(C).metrics),Tl,((e,t,r)=>{var n=$W(),i=uc(n),o=uc(i,!0);Os(i),Il(hc(i),17,(()=>yu(C).matrix[r]),Tl,((e,t,n)=>{var i=UW(),o=uc(i),a=uc(o,!0);Os(o),Os(i),Pc(((e,t,o,s,l)=>{kd(i,`background: ${e??""}; color: ${t??""}; text-shadow: ${o??""};`),Fd(i,"title",`${yu(C).metrics[r]??""} × ${yu(C).metrics[n]??""}: ${s??""}`),Ju(a,l)}),[()=>wV(yu(t)),()=>Math.abs(yu(t))>.5?"white":"#333",()=>Math.abs(yu(t))>.5?"0 1px 1px rgba(0,0,0,0.3)":"none",()=>yu(t).toFixed(3),()=>r===n?"":yu(t).toFixed(2)]),Yu(e,i)})),Os(n),Pc((()=>Ju(o,yu(t)))),Yu(e,n)})),Os(a),Os(n),Os(r),Os(t),Yu(e,t)};ad(o,(e=>{yu(C)&&e(a)}));var s=hc(o,2),l=e=>{var t=YW(),r=hc(uc(t),2),n=uc(r),i=uc(n),o=uc(i);Il(hc(uc(o)),17,(()=>yu(R).metrics),Tl,((e,t)=>{var r=qW(),n=uc(r,!0);Os(r),Pc((()=>Ju(n,yu(t)))),Yu(e,r)})),Os(o),Os(i);var a=hc(i);Il(a,21,(()=>yu(R).metrics),Tl,((e,t,r)=>{var n=ZW(),i=uc(n),o=uc(i,!0);Os(i),Il(hc(i),17,(()=>yu(R).matrix[r]),Tl,((e,t,n)=>{var i=WW(),o=uc(i),a=uc(o,!0);Os(o),Os(i),Pc(((e,t,o,s,l)=>{kd(i,`background: ${e??""}; color: ${t??""}; text-shadow: ${o??""};`),Fd(i,"title",`${yu(R).metrics[r]??""} × ${yu(R).metrics[n]??""}: ${s??""}`),Ju(a,l)}),[()=>wV(yu(t)),()=>Math.abs(yu(t))>.5?"white":"#333",()=>Math.abs(yu(t))>.5?"0 1px 1px rgba(0,0,0,0.3)":"none",()=>yu(t).toFixed(3),()=>r===n?"":yu(t).toFixed(2)]),Yu(e,i)})),Os(n),Pc((()=>Ju(o,yu(t)))),Yu(e,n)})),Os(a),Os(n),Os(r),Os(t),Yu(e,t)};ad(s,(e=>{yu(R)&&e(l)})),Os(i),Ds(2),Os(r),Os(t),Pc((()=>wd(i,1,`grid ${yu(C)&&yu(R)?"grid-cols-2":"grid-cols-1"} gap-6`))),Yu(e,t)};ad(xe,(e=>{yu(P)&&(yu(C)||yu(R))&&e(we)}));var Se=hc(xe,2);{let e=Dl((()=>Bw.selectedFieldId??0)),r=Dl((()=>Bw.selectedFieldName??""));!function(e,t){Zs(t,!0);const r=[{value:"pivot",label:"Pivot"},{value:"hose_reel",label:"Hose Reel"},{value:"drip",label:"Drip"},{value:"none",label:"None / Other"}];let n=fh(t,"open",3,!1),i=fh(t,"fieldId",3,null),o=fh(t,"fieldName",3,""),a=fh(t,"cropType",3,""),s=fh(t,"irrigationType",3,null),l=fh(t,"seedingDate",3,null),c=fh(t,"validCropTypes",19,(()=>[])),u=$l(Jl(o())),d=$l(Jl(a())),h=$l(Jl(s())),f=$l(Jl(l()?new Date(l()):null)),p=$l(!1),g=$l(null);async function m(){if(i()){ql(p,!0),ql(g,null);try{if(yu(u)!==o()&&await qD(i(),yu(u)),yu(d)&&yu(d)!==a()&&await ZD(i(),yu(d)),yu(h)!==s()&&(await KD(i(),yu(h)),t.farmFieldsGeojson)){const e=t.farmFieldsGeojson.features.find((e=>Number(e.id)===i()));e?.properties&&(e.properties.primary_irrigation_type=yu(h))}t.onSave?.({irrigationType:yu(h)}),t.onClose?.(),window.location.reload()}catch(e){ql(g,e.message||"Failed to save changes",!0)}finally{ql(p,!1)}}}Tc((()=>{n()&&(ql(u,o()),ql(d,a()),ql(h,s()),ql(f,l()?new Date(l()):null,!0),ql(g,null))}));var y=Zu(),_=dc(y),v=e=>{var n=QV();n.__click=function(...e){t.onClose?.apply(this,e)};var i=uc(n);i.__click=e=>e.stopPropagation();var o=uc(i);hc(uc(o),2).__click=function(...e){t.onClose?.apply(this,e)},Os(o);var a=hc(o,2),s=uc(a),l=hc(uc(s),2);Ld(l),Os(s);var y=hc(s,2),_=hc(uc(y),2),v=uc(_);v.value=v.__value="",Il(hc(v),17,c,Tl,((e,t)=>
31{var r=XV(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t)),i!==(i=yu(t))&&(r.value=(r.__value=yu(t))??"")})),Yu(e,r)})),Os(_),Os(y);var b=hc(y,2),x=hc(uc(b),2),w=uc(x);w.value=(w.__value=null)??"",Il(hc(w),17,(()=>r),Tl,((e,t)=>{var r=KV(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t).label),i!==(i=yu(t).value)&&(r.value=(r.__value=yu(t).value)??"")})),Yu(e,r)})),Os(x),Ds(2),Os(b);var S=hc(b,2);X_(hc(uc(S),2),{get value(){return yu(f)},set value(e){ql(f,e,!0)}}),Ds(2),Os(S);var k=hc(S,2),T=e=>{var t=JV(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(g)))),Yu(e,t)};ad(k,(e=>{yu(g)&&e(T)})),Os(a);var I=hc(a,2),M=uc(I);M.__click=function(...e){t.onClose?.apply(this,e)};var E=hc(M,2);E.__click=m;var P=uc(E,!0);Os(E),Os(I),Os(i),Os(n),Pc((()=>{M.disabled=yu(p),E.disabled=yu(p),Ju(P,yu(p)?"Saving...":"Save Changes")})),Kd(l,(()=>yu(u)),(e=>ql(u,e))),Md(_,(()=>yu(d)),(e=>ql(d,e))),Md(x,(()=>yu(h)),(e=>ql(h,e))),Yu(e,n)};ad(_,(e=>{n()&&e(v)})),Yu(e,y),Ys()}(Se,{get open(){return yu(p)},get fieldId(){return yu(e)},get fieldName(){return yu(r)},get cropType(){return yu(re)},get irrigationType(){return yu(fe)},get seedingDate(){return yu(de)},get farmFieldsGeojson(){return t.farmFieldsGeojson},get validCropTypes(){return n()},onClose:()=>ql(p,!1),onSave:e=>{ql(p,!1),void 0!==e?.irrigationType&&ql(l,e.irrigationType,!0)}})}var ke=hc(Se,2),Te=e=>{var t=KW();t.__keydown=e=>{"Escape"===e.key&&ql(c,!1)},t.__click=e=>{e.target===e.currentTarget&&ql(c,!1)};var r=uc(t),n=hc(uc(r),4),i=uc(n);i.value=i.__value="";var o=hc(i);o.value=o.__value="pivot";var a=hc(o);a.value=a.__value="hose_reel";var s=hc(a);s.value=s.__value="drip",Os(n);var l=hc(n,2),f=uc(l);f.__click=()=>ql(c,!1);var p=hc(f,2);p.__click=h;var g=uc(p,!0);Os(p),Os(l),Os(r),Os(t),Pc((()=>{p.disabled=!yu(u)||yu(d),Ju(g,yu(d)?"Saving...":"Confirm")})),Md(n,(()=>yu(u)),(e=>ql(u,e))),Yu(e,t)};ad(ke,(e=>{yu(c)&&e(Te)}));var Ie=hc(ke,2),Me=e=>{const t=Dl((()=>Bw.legendColorScale)),r=Dl((()=>Math.max(...yu(M).map((e=>e.y))))),n=Dl((()=>"change"===yu(B)&&!!Bw.changeRasterData)),i=Dl((()=>yu(M)[0]?.x??0)),o=Dl((()=>yu(M)[yu(M).length-1]?.x??1)),a=Dl((()=>yu(o)-yu(i)||1)),s=Dl((()=>yu(E))),l=Dl((()=>null!=yu(s)?(yu(s)-yu(i))/yu(a)*100:null)),c=Dl((()=>yu(n)||0===yu(k).mean||null==yu(s)?"":` (${Math.round(yu(s)/yu(k).mean*100)}%)`)),u=Dl((()=>yu(n)||0===yu(k).mean?"":` (${Math.round(yu(i)/yu(k).mean*100)}%)`)),d=Dl((()=>yu(n)||0===yu(k).mean?"":` (${Math.round(yu(o)/yu(k).mean*100)}%)`));var h=eZ();h.__keydown=e=>{"Escape"===e.key&&ql(j,!1)},h.__click=e=>{e.target===e.currentTarget&&ql(j,!1)};var f=uc(h),p=uc(f),g=uc(p),m=hc(uc(g),2),y=uc(m);Os(m),Os(g),hc(g,2).__click=()=>ql(j,!1),Os(p);var _=hc(p,2),v=uc(_);Il(v,21,(()=>yu(M)),Tl,((e,i)=>{const o=Dl((()=>yu(n)?yu(i).x>=0?"#059669":"#dc2626":yu(t)?.(yu(i).x)||"#60a5fa")),a=Dl((()=>yu(n)||0===yu(k).mean?"":` (${Math.round(yu(i).x/yu(k).mean*100)}%)`));var s=JW();Pc((e=>{kd(s,`height: ${yu(r)>0?yu(i).y/yu(r)*100:0}%; background: ${yu(o)??""}; min-width: 3px;`),Fd(s,"title",`${e??""}${yu(a)??""}: ${yu(i).y??""} px`)}),[()=>yu(i).x.toFixed(3)]),Yu(e,s)})),Os(v);var b=hc(v,2),x=e=>{var t=QW(),r=uc(t),n=uc(r);Os(r),Os(t),Pc((e=>{kd(t,`left: calc(${yu(l)??""}% + 8px); background: rgba(0,0,0,0.7);`),Ju(n,`mean ${e??""}${yu(c)??""}`)}),[()=>yu(s).toFixed(3)]),Yu(e,t)};ad(b,(e=>{null!=yu(l)&&yu(l)>=0&&yu(l)<=100&&e(x)})),Os(_);var w=hc(_,2),S=uc(w),I=uc(S);Os(S);var P=hc(S,2),A=uc(P);Os(P),Os(w),Os(f),Os(h),Pc(((e,t)=>{Ju(y,`Pixel distribution${yu(n)?" (Change)":""} — ${yu(T)??""}`),Ju(I,`${e??""}${yu(u)??""}`),Ju(A,`${t??""}${yu(d)??""}`)}),[()=>yu(i).toFixed(2),()=>yu(o).toFixed(2)]),Yu(e,h)};ad(Ie,(e=>{yu(j)&&yu(S)&&yu(k)&&yu(M).length>0&&e(Me)})),Yu(e,ye),Ys()}Bu(["click","keydown"]);var nZ=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,iZ=Math.ceil,oZ=Math.floor,aZ="[BigNumber Error] ",sZ=aZ+"Number primitive has more than 15 significant digits: ",lZ=1e14,cZ=14,uZ=9007199254740991,dZ=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],hZ=1e7,fZ=1e9;function pZ(e){var t=0|e;return e>0||e===t?t:t-1}function gZ(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=cZ-t.length;r--;t="0"+t);o+=t}for(i=o.length;
vendor: 5,525 bytes, line 31
3148===o.charCodeAt(--i););return o.slice(0,i+1||1)}function mZ(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,l=e.e,c=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=l==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return l>c^r?1:-1;for(s=(l=i.length)<(c=o.length)?l:c,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return l==c?0:l>c^r?1:-1}function yZ(e,t,r,n){if(e<t||e>r||e!==oZ(e))throw Error(aZ+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function _Z(e){var t=e.c.length-1;return pZ(e.e/cZ)==t&&e.c[t]%2!=0}function vZ(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function bZ(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var xZ=function e(t){var r,n,i,o,a,s,l,c,u,d,h=I.prototype={constructor:I,toString:null,valueOf:null},f=new I(1),p=20,g=4,m=-7,y=21,_=-1e7,v=1e7,b=!1,x=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",T=!0;function I(e,t){var r,o,a,s,l,c,u,d,h=this;if(!(h instanceof I))return new I(e,t);if(null==t){if(e&&!0===e._isBigNumber)return h.s=e.s,void(!e.c||e.e>v?h.c=h.e=null:e.e<_?h.c=[h.e=0]:(h.e=e.e,h.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,l=e;l>=10;l/=10,s++);return void(s>v?h.c=h.e=null:(h.e=s,h.c=[e]))}d=String(e)}else{if(!nZ.test(d=String(e)))return i(h,d,c);h.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf("."))>-1&&(d=d.replace(".","")),(l=d.search(/e/i))>0?(s<0&&(s=l),s+=+d.slice(l+1),d=d.substring(0,l)):s<0&&(s=d.length)}else{if(yZ(t,2,k.length,"Base"),10==t&&T)return A(h=new I(e),p+h.e+1,g);if(d=String(e),c="number"==typeof e){if(0*e!=0)return i(h,d,c,t);if(h.s=1/e<0?(d=d.slice(1),-1):1,I.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(sZ+e)}else h.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=k.slice(0,t),s=l=0,u=d.length;l<u;l++)if(r.indexOf(o=d.charAt(l))<0){if("."==o){if(l>s){s=u;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,l=-1,s=0;continue}return i(h,String(e),c,t)}c=!1,(s=(d=n(d,t,10,h.s)).indexOf("."))>-1?d=d.replace(".",""):s=d.length}for(l=0;48===d.charCodeAt(l);l++);for(u=d.length;48===d.charCodeAt(--u););if(d=d.slice(l,++u)){if(u-=l,c&&I.DEBUG&&u>15&&(e>uZ||e!==oZ(e)))throw Error(sZ+h.s*e);if((s=s-l-1)>v)h.c=h.e=null;else if(s<_)h.c=[h.e=0];else{if(h.e=s,h.c=[],l=(s+1)%cZ,s<0&&(l+=cZ),l<u){for(l&&h.c.push(+d.slice(0,l)),u-=cZ;l<u;)h.c.push(+d.slice(l,l+=cZ));l=cZ-(d=d.slice(l)).length}else l-=u;for(;l--;d+="0");h.c.push(+d)}}else h.c=[h.e=0]}function M(e,t,r,n){var i,o,a,s,l;if(null==r?r=g:yZ(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)l=gZ(e.c),l=1==n||2==n&&(a<=m||a>=y)?vZ(l,a):bZ(l,a,"0");else if(o=(e=A(new I(e),t,r)).e,s=(l=gZ(e.c)).length,1==n||2==n&&(t<=o||o<=m)){for(;s<t;l+="0",s++);l=vZ(l,o)}else if(t-=a,l=bZ(l,o,"0"),o+1>s){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=o-s)>0)for(o+1==s&&(l+=".");t--;l+="0");return e.s<0&&i?"-"+l:l}function E(e,t){for(var r,n,i=1,o=new I(e[0]);i<e.length;i++)(!(n=new I(e[i])).s||(r=mZ(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function P(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*cZ-1)>v?e.c=e.e=null:r<_?e.c=[e.e=0]:(e.e=r,e.c=t),e}function A(e,t,r,n){var i,o,a,s,l,c,u,d=e.c,h=dZ;if(d){e:{for(i=1,s=d[0];s>=10;s/=10,i++);if((o=t-i)<0)o+=cZ,a=t,l=d[c=0],u=oZ(l/h[i-a-1]%10);else if((c=iZ((o+1)/cZ))>=d.length){if(!n)break e;for(;d.length<=c;d.push(0));l=u=0,i=1,a=(o%=cZ)-cZ+1}else{for(l=s=d[c],i=1;s>=10;s/=10,i++);u=(a=(o%=cZ)-cZ+i)<0?0:oZ(l/h[i-a-1]%10)}if(n=n||t<0||null!=d[c+1]||(a<0?l:l%h[i-a-1]),n=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(o>0?a>0?l/h[i-a]:0:d[c-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,n?(t-=e.e+1,d[0]=h[(cZ-t%cZ)%cZ],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=c,s=1,c--):(d.length=c+1,s=h[cZ-o],d[c]=a>0?oZ(l/h[i-a]%h[a])*s:0),n)for(;;){if(0==c){for(o=1,a=d[0];a>=10;a/=10,o++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,d[0]==lZ&&(d[0]=1));break}if(d[c]+=s,d[c]!=lZ)break;d[c--]=0,s=1}for(o=d.length;0===d[--o];d.pop());}e.e>v?e.c=e.e=null:e.e<_&&(e.c=[e.e=0])}return e}function C(e){var t,r=e.e;return null===r?e.toString():(t=gZ(e.c),t=r<=m||r>=y?vZ(t,r):bZ(t,r,"0"),e.s<0?"-"+t:t)}return I.clone=e,I.ROUND_UP=0,I.ROUND_DOWN=1,I.ROUND_CEIL=2,I.ROUND_FLOOR=3,I.ROUND_HALF_UP=4,I.ROUND_HALF_DOWN=5,I.ROUND_HALF_EVEN=6,I.ROUND_HALF_CEIL=7,I.ROUND_HALF_FLOOR=8,I.EUCLID=9,I.config=I.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(aZ+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(yZ(r=e[t],0,fZ,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(yZ(r=e[t],0,8,t),g=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(yZ(r[0],-fZ,0,t),yZ(r[1],0,fZ,t),m=r[0],y=r[1]):(yZ(r,-fZ,fZ,t),m=-(y=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)yZ(r[0],-fZ,-1,t),yZ(r[1],1,fZ,t),_=r[0],v=r[1];else{if(yZ(r,-fZ,fZ,t),!r)throw Error(aZ+t+" cannot be zero: "+r);_=-(v=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(aZ+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(aZ+"crypto unavailable");
vendor: 9,971 bytes, line 31
31b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(yZ(r=e[t],0,9,t),x=r),e.hasOwnProperty(t="POW_PRECISION")&&(yZ(r=e[t],0,fZ,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(aZ+t+" not an object: "+r);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(aZ+t+" invalid: "+r);T="0123456789"==r.slice(0,10),k=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:g,EXPONENTIAL_AT:[m,y],RANGE:[_,v],CRYPTO:b,MODULO_MODE:x,POW_PRECISION:w,FORMAT:S,ALPHABET:k}},I.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!I.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-fZ&&i<=fZ&&i===oZ(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%cZ)<1&&(t+=cZ),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=lZ||r!==oZ(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(aZ+"Invalid BigNumber: "+e)},I.maximum=I.max=function(){return E(arguments,-1)},I.minimum=I.min=function(){return E(arguments,1)},I.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return oZ(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,l=[],c=new I(f);if(null==e?e=p:yZ(e,0,fZ),i=iZ(e/cZ),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(l.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(aZ+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(l.push(o%1e14),s+=7);s=i/7}if(!b)for(;s<i;)(o=a())<9e15&&(l[s++]=o%1e14);for(i=l[--s],e%=cZ,i&&e&&(o=dZ[cZ-e],l[s]=oZ(i/o)*o);0===l[s];l.pop(),s--);if(s<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=cZ);for(s=1,o=l[0];o>=10;o/=10,s++);s<cZ&&(n-=cZ-s)}return c.e=n,c.c=l,c}),I.sum=function(){for(var e=1,t=arguments,r=new I(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,a=[0],s=0,l=e.length;s<l;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var l,c,u,d,h,f,m,y,_=n.indexOf("."),v=p,b=g;for(_>=0&&(d=w,w=0,n=n.replace(".",""),f=(y=new I(i)).pow(n.length-_),w=d,y.c=t(bZ(gZ(f.c),f.e,"0"),10,o,e),y.e=y.c.length),u=d=(m=t(n,i,o,s?(l=k,e):(l=e,k))).length;0==m[--d];m.pop());if(!m[0])return l.charAt(0);if(_<0?--u:(f.c=m,f.e=u,f.s=a,m=(f=r(f,y,v,b,o)).c,h=f.r,u=f.e),_=m[c=u+v+1],d=o/2,h=h||c<0||null!=m[c+1],h=b<4?(null!=_||h)&&(0==b||b==(f.s<0?3:2)):_>d||_==d&&(4==b||h||6==b&&1&m[c-1]||b==(f.s<0?8:7)),c<1||!m[0])n=h?bZ(l.charAt(1),-v,l.charAt(0)):l.charAt(0);else{if(m.length=c,h)for(--o;++m[--c]>o;)m[c]=0,c||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,n="";_<=d;n+=l.charAt(m[_++]));n=bZ(n,u,l.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,l=e.length,c=t%hZ,u=t/hZ|0;for(e=e.slice();l--;)s=((i=c*(o=e[l]%hZ)+(n=u*o+(a=e[l]/hZ|0)*c)%hZ*hZ+s)/r|0)+(n/hZ|0)+u*a,e[l]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var l,c,u,d,h,f,p,g,m,y,_,v,b,x,w,S,k,T=n.s==i.s?1:-1,M=n.c,E=i.c;if(!(M&&M[0]&&E&&E[0]))return new I(n.s&&i.s&&(M?!E||M[0]!=E[0]:E)?M&&0==M[0]||!E?0*T:T/0:NaN);for(m=(g=new I(T)).c=[],T=o+(c=n.e-i.e)+1,s||(s=lZ,c=pZ(n.e/cZ)-pZ(i.e/cZ),T=T/cZ|0),u=0;E[u]==(M[u]||0);u++);if(E[u]>(M[u]||0)&&c--,T<0)m.push(1),d=!0;else{for(x=M.length,S=E.length,u=0,T+=2,(h=oZ(s/(E[0]+1)))>1&&(E=e(E,h,s),M=e(M,h,s),S=E.length,x=M.length),b=S,_=(y=M.slice(0,S)).length;_<S;y[_++]=0);k=E.slice(),k=[0].concat(k),w=E[0],E[1]>=s/2&&w++;do{if(h=0,(l=t(E,y,S,_))<0){if(v=y[0],S!=_&&(v=v*s+(y[1]||0)),(h=oZ(v/w))>1)for(h>=s&&(h=s-1),p=(f=e(E,h,s)).length,_=y.length;1==t(f,y,p,_);)h--,r(f,S<p?k:E,p,s),p=f.length,l=1;else 0==h&&(l=h=1),p=(f=E.slice()).length;if(p<_&&(f=[0].concat(f)),r(y,f,_,s),_=y.length,-1==l)for(;t(E,y,S,_)<1;)h++,r(y,S<_?k:E,_,s),_=y.length}else 0===l&&(h++,y=[0]);m[u++]=h,y[0]?y[_++]=M[b]||0:(y=[M[b]],_=1)}while((b++<x||null!=y[0])&&T--);d=null!=y[0],m[0]||m.splice(0,1)}if(s==lZ){for(u=1,T=m[0];T>=10;T/=10,u++);A(g,o+(g.e=u+c*cZ-1)+1,a,d)}else g.e=c,g.r=+d;return g}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,c=/^\.([^.]+)$/,u=/^-?(Infinity|NaN)$/,d=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(d,"");if(u.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(s,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(l,"$1").replace(c,"0.$1")),t!=o))return new I(o,i);if(I.DEBUG)throw Error(aZ+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},h.absoluteValue=h.abs=function(){var e=new I(this);return e.s<0&&(e.s=1),e},h.comparedTo=function(e,t){return mZ(this,new I(e,t))},h.decimalPlaces=h.dp=function(e,t){var r,n,i,o=this;if(null!=e)return yZ(e,0,fZ),null==t?t=g:yZ(t,0,8),A(new I(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-pZ(this.e/cZ))*cZ,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},h.dividedBy=h.div=function(e,t){return r(this,new I(e,t),p,g)},h.dividedToIntegerBy=h.idiv=function(e,t){return r(this,new I(e,t),0,1)},h.exponentiatedBy=h.pow=function(e,t){var r,n,i,o,a,s,l,c,u=this;if((e=new I(e)).c&&!e.isInteger())throw Error(aZ+"Exponent not an integer: "+C(e));if(null!=t&&(t=new I(t)),a=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return c=new I(Math.pow(+C(u),a?e.s*(2-_Z(e)):+C(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new I(NaN);(n=!s&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||a&&u.c[1]>=24e7:u.c[0]<8e13||a&&u.c[0]<=9999975e7)))return o=u.s<0&&_Z(e)?-0:0,u.e>-1&&(o=1/o),new I(s?1/o:o);w&&(o=iZ(w/cZ+2))}for(a?(r=new I(.5),s&&(e.s=1),l=_Z(e)):l=(i=Math.abs(+C(e)))%2,c=new I(f);;){if(l){if(!(c=c.times(u)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=oZ(i/2)))break;l=i%2}else if(A(e=e.times(r),e.e+1,1),e.e>14)l=_Z(e);else{if(0===(i=+C(e)))break;l=i%2}u=u.times(u),o?u.c&&u.c.length>o&&(u.c.length=o):n&&(u=u.mod(t))}return n?c:(s&&(c=f.div(c)),t?c.mod(t):o?A(c,w,g,undefined):c)},h.integerValue=function(e){var t=new I(this);return null==e?e=g:yZ(e,0,8),A(t,t.e+1,e)},h.isEqualTo=h.eq=function(e,t){return 0===mZ(this,new I(e,t))},h.isFinite=function(){return!!this.c},h.isGreaterThan=h.gt=function(e,t){return mZ(this,new I(e,t))>0},h.isGreaterThanOrEqualTo=h.gte=function(e,t){return 1===(t=mZ(this,new I(e,t)))||0===t},h.isInteger=function(){return!!this.c&&pZ(this.e/cZ)>this.c.length-2},h.isLessThan=h.lt=function(e,t){return mZ(this,new I(e,t))<0},h.isLessThanOrEqualTo=h.lte=function(e,t){return-1===(t=mZ(this,new I(e,t)))||0===t},h.isNaN=function(){return!this.s},h.isNegative=function(){return this.s<0},h.isPositive=function(){return this.s>0},h.isZero=function(){return!!this.c&&0==this.c[0]},h.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,a.plus(e);var l=a.e/cZ,c=e.e/cZ,u=a.c,d=e.c;if(!l||!c){if(!u||!d)return u?(e.s=-t,e):new I(d?a:NaN);if(!u[0]||!d[0])return d[0]?(e.s=-t,e):new I(u[0]?a:3==g?-0:0)}if(l=pZ(l),c=pZ(c),u=u.slice(),s=l-c){for((o=s<0)?(s=-s,i=u):(c=l,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=u.length)<(t=d.length))?s:t,s=t=0;t<n;t++)if(u[t]!=d[t]){o=u[t]<d[t];break}if(o&&(i=u,u=d,d=i,e.s=-e.s),(t=(n=d.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=lZ-1;n>s;){if(u[--n]<d[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=lZ}u[n]-=d[n]}for(;0==u[0];u.splice(0,1),--c);return u[0]?P(e,u,c):(e.s=3==g?-1:1,e.c=[e.e=0],e)},h.modulo=h.mod=function(e,t){var n,i,o=this;return e=new I(e,t),!o.c||!e.s||e.c&&!e.c[0]?new I(NaN):!e.c||o.c&&!o.c[0]?new I(o):(9==x?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,x),(e=o.minus(n.times(e))).c[0]||1!=x||(e.s=o.s),e)},h.multipliedBy=h.times=function(e,t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,y=this,_=y.c,v=(e=new I(e,t)).c;if(!(_&&v&&_[0]&&v[0]))return!y.s||!e.s||_&&!_[0]&&!v||v&&!v[0]&&!_?e.c=e.e=e.s=null:(e.s*=y.s,_&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=pZ(y.e/cZ)+pZ(e.e/cZ),e.s*=y.s,(l=_.length)<(d=v.length)&&(p=_,_=v,v=p,i=l,l=d,d=i),i=l+d,p=[];i--;p.push(0));for(g=lZ,m=hZ,i=d;--i>=0;){for(r=0,h=v[i]%m,f=v[i]/m|0,o=i+(a=l);o>i;)r=((c=h*(c=_[--a]%m)+(s=f*c+(u=_[a]/m|0)*h)%m*m+p[o]+r)/g|0)+(s/m|0)+f*u,p[o--]=c%g;p[o]=r}return r?++n:p.splice(0,1),P(e,p,n)},h.negated=function(){var e=new I(this);return e.s=-e.s||null,e},h.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new I(e,t)).s,!i||!t)return new I(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/cZ,a=e.e/cZ,s=n.c,l=e.c;if(!o||!a){if(!s||!l)return new I(i/0);if(!s[0]||!l[0])return l[0]?e:new I(s[0]?n:0*i)}if(o=pZ(o),a=pZ(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=l):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=l.length)<0&&(r=l,l=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+l[t]+i)/lZ|0,s[t]=lZ===s[t]?0:s[t]%lZ;return i&&(s=[i].concat(s),++a),P(e,s,a)},h.precision=h.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return yZ(e,1,fZ),null==t?t=g:yZ(t,0,8),A(new I(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*cZ+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},h.shiftedBy=function(e){return yZ(e,-9007199254740991,uZ),this.times("1e"+e)},h.squareRoot=h.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,l=a.s,c=a.e,u=p+4,d=new I("0.5");
vendor: 1,903 bytes, line 31
31if(1!==l||!s||!s[0])return new I(!l||l<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(l=Math.sqrt(+C(a)))||l==1/0?(((t=gZ(s)).length+c)%2==0&&(t+="0"),l=Math.sqrt(+t),c=pZ((c+1)/2)-(c<0||c%2),n=new I(t=l==1/0?"5e"+c:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new I(l+""),n.c[0])for((l=(c=n.e)+u)<3&&(l=0);;)if(o=n,n=d.times(o.plus(r(a,o,u,1))),gZ(o.c).slice(0,l)===(t=gZ(n.c)).slice(0,l)){if(n.e<c&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(A(n,n.e+p+2,1),e=!n.times(n).eq(a));break}if(!i&&(A(o,o.e+p+2,0),o.times(o).eq(a))){n=o;break}u+=4,l+=4,i=1}return A(n,n.e+p+1,g,e)},h.toExponential=function(e,t){return null!=e&&(yZ(e,0,fZ),e++),M(this,e,t,1)},h.toFixed=function(e,t){return null!=e&&(yZ(e,0,fZ),e=e+this.e+1),M(this,e,t)},h.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=S;else if("object"!=typeof r)throw Error(aZ+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,l=+r.secondaryGroupSize,c=r.groupSeparator||"",u=a[0],d=a[1],h=i.s<0,f=h?u.slice(1):u,p=f.length;if(l&&(o=s,s=l,l=o,p-=o),s>0&&p>0){for(o=p%s||s,u=f.substr(0,o);o<p;o+=s)u+=c+f.substr(o,s);l>0&&(u+=c+f.slice(o)),h&&(u="-"+u)}n=d?u+(r.decimalSeparator||"")+((l=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):u}return(r.prefix||"")+n+(r.suffix||"")},h.toFraction=function(e){var t,n,i,o,a,s,l,c,u,d,h,p,m=this,y=m.c;if(null!=e&&(!(l=new I(e)).isInteger()&&(l.c||1!==l.s)||l.lt(f)))throw Error(aZ+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+C(l));if(!y)return new I(m);for(t=new I(f),u=n=new I(f),i=c=new I(f),p=gZ(y),a=t.e=p.length-m.e-1,t.c[0]=dZ[(s=a%cZ)<0?cZ+s:s],e=!e||l.comparedTo(t)>0?a>0?t:u:l,s=v,v=1/0,l=new I(p),c.c[0]=0;d=r(l,t,0,1),1!=(o=n.plus(d.times(i))).comparedTo(e);
vendor: 6,774 bytes, line 31
31)n=i,i=o,u=c.plus(d.times(o=u)),c=o,t=l.minus(d.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(u)),n=n.plus(o.times(i)),c.s=u.s=m.s,h=r(u,i,a*=2,g).minus(m).abs().comparedTo(r(c,n,a,g).minus(m).abs())<1?[u,i]:[c,n],v=s,h},h.toNumber=function(){return+C(this)},h.toPrecision=function(e,t){return null!=e&&yZ(e,1,fZ),M(this,e,t,2)},h.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=m||o>=y?vZ(gZ(r.c),o):bZ(gZ(r.c),o,"0"):10===e&&T?t=bZ(gZ((r=A(new I(r),p+o+1,g)).c),r.e,"0"):(yZ(e,2,k.length,"Base"),t=n(bZ(gZ(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},h.valueOf=h.toJSON=function(){return C(this)},h._isBigNumber=!0,h[Symbol.toStringTag]="BigNumber",h[Symbol.for("nodejs.util.inspect.custom")]=h.valueOf,null!=t&&I.set(t),I}();const wZ=xZ;var SZ=class{key;left=null;right=null;constructor(e){this.key=e}},kZ=class extends SZ{constructor(e){super(e)}},TZ=class e extends SZ{value;constructor(e,t){super(e),this.value=t}replaceValue(t){const r=new e(this.key,t);return r.left=this.left,r.right=this.right,r}},IZ=class{size=0;modificationCount=0;splayCount=0;splay(e){const t=this.root;if(null==t)return this.compare(e,e),-1;let r=null,n=null,i=null,o=null,a=t;const s=this.compare;let l;for(;;)if(l=s(a.key,e),l>0){let t=a.left;if(null==t)break;if(l=s(t.key,e),l>0&&(a.left=t.right,t.right=a,a=t,t=a.left,null==t))break;null==r?n=a:r.left=a,r=a,a=t}else{if(!(l<0))break;{let t=a.right;if(null==t)break;if(l=s(t.key,e),l<0&&(a.right=t.left,t.left=a,a=t,t=a.right,null==t))break;null==i?o=a:i.right=a,i=a,a=t}}return null!=i&&(i.right=a.left,a.left=o),null!=r&&(r.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),l}splayMin(e){let t=e,r=t.left;for(;null!=r;){const e=r;t.left=e.right,e.right=t,t=e,r=t.left}return t}splayMax(e){let t=e,r=t.right;for(;null!=r;){const e=r;t.right=e.left,e.left=t,t=e,r=t.right}return t}_delete(e){if(null==this.root)return null;if(0!=this.splay(e))return null;let t=this.root;const r=t,n=t.left;if(this.size--,null==n)this.root=t.right;else{const e=t.right;t=this.splayMax(n),t.right=e,this.root=t}return this.modificationCount++,r}addNewRoot(e,t){this.size++,this.modificationCount++;const r=this.root;null!=r?(t<0?(e.left=r,e.right=r.right,r.right=null):(e.right=r,e.left=r.left,r.left=null),this.root=e):this.root=e}_first(){const e=this.root;return null==e?null:(this.root=this.splayMin(e),this.root)}_last(){const e=this.root;return null==e?null:(this.root=this.splayMax(e),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(e){return this.validKey(e)&&0==this.splay(e)}defaultCompare(){return(e,t)=>e<t?-1:e>t?1:0}wrap(){return{getRoot:()=>this.root,setRoot:e=>{this.root=e},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:e=>{this.splayCount=e},splay:e=>this.splay(e),has:e=>this.has(e)}}},MZ=(Symbol.iterator,Symbol.toStringTag,class e extends IZ{root=null;compare;validKey;constructor(e,t){super(),this.compare=e??this.defaultCompare(),this.validKey=t??(e=>null!=e&&null!=e)}delete(e){return!!this.validKey(e)&&null!=this._delete(e)}deleteAll(e){for(const t of e)this.delete(t)}forEach(e){const t=this[Symbol.iterator]();let r;for(;r=t.next(),!r.done;)e(r.value,r.value,this)}add(e){const t=this.splay(e);return 0!=t&&this.addNewRoot(new kZ(e),t),this}addAndReturn(e){const t=this.splay(e);return 0!=t&&this.addNewRoot(new kZ(e),t),this.root.key}addAll(e){for(const t of e)this.add(t)}isEmpty(){return null==this.root}isNotEmpty(){return null!=this.root}single(){if(0==this.size)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(0==this.size)throw"Bad state: No element";return this._first().key}last(){if(0==this.size)throw"Bad state: No element";return this._last().key}lastBefore(e){if(null==e)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(e)<0)return this.root.key;let t=this.root.left;if(null==t)return null;let r=t.right;for(;null!=r;)t=r,r=t.right;return t.key}firstAfter(e){if(null==e)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(e)>0)return this.root.key;let t=this.root.right;if(null==t)return null;let r=t.left;for(;null!=r;)t=r,r=t.left;return t.key}retainAll(t){const r=new e(this.compare,this.validKey),n=this.modificationCount;for(const e of t){if(n!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(e)&&0==this.splay(e)&&r.add(this.root.key)}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}lookup(e){if(!this.validKey(e))return null;return 0!=this.splay(e)?null:this.root.key}intersection(t){const r=new e(this.compare,this.validKey);for(const e of this)t.has(e)&&r.add(e);return r}difference(t){const r=new e(this.compare,this.validKey);for(const e of this)t.has(e)||r.add(e);return r}union(e){const t=this.clone();return t.addAll(e),t}clone(){const t=new e(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(e){if(null==e)return null;const t=new kZ(e.key);return function e(t,r){let n,i;do{if(n=t.left,i=t.right,null!=n){const t=new kZ(n.key);r.left=t,e(n,t)}if(null!=i){const e=new kZ(i.key);r.right=e,t=i,r=e}}while(null!=i)}(e,t),t}toSet(){return this.clone()}entries(){return new AZ(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[Symbol.iterator](){return new PZ(this.wrap())}[Symbol.toStringTag]="[object Set]"}),EZ=class{tree;path=new Array;modificationCount=null;splayCount;constructor(e){this.tree=e,this.splayCount=e.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const e=this.path[this.path.length-1];return this.getValue(e)}rebuildPath(e){this.path.splice(0,this.path.length),this.tree.splay(e),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(e){for(;null!=e;)this.path.push(e),e=e.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(null==this.modificationCount){this.modificationCount=this.tree.getModificationCount();let e=this.tree.getRoot();for(;null!=e;)this.path.push(e),e=e.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let e=this.path[this.path.length-1],t=e.right;if(null!=t){for(;null!=t;)this.path.push(t),t=t.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}}
31,PZ=class extends EZ{getValue(e){return e.key}},AZ=class extends EZ{getValue(e){return[e.key,e.key]}},CZ=class extends EZ{constructor(e){super(e)}getValue(e){return e.value}},RZ=class extends EZ{constructor(e){super(e)}getValue(e){return[e.key,e.value]}replaceValue(e){if(this.modificationCount!=this.tree.getModificationCount())throw"Concurrent modification during iteration.";this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);const t=this.path.pop(),r=t.replaceValue(e);if(this.path.length){const e=this.path[this.path.length-1];t===e.left?e.left=r:e.right=r}else this.tree.setRoot(r);this.path.push(r);const n=this.tree.getSplayCount()+1;this.tree.setSplayCount(n),this.splayCount=n}},LZ=e=>()=>e,OZ=e=>{const t=e?(t,r)=>r.minus(t).abs().isLessThanOrEqualTo(e):LZ(!1);return(e,r)=>t(e,r)?0:e.comparedTo(r)};function DZ(e){const t=e?(t,r,n,i,o)=>t.exponentiatedBy(2).isLessThanOrEqualTo(i.minus(r).exponentiatedBy(2).plus(o.minus(n).exponentiatedBy(2)).times(e)):LZ(!1);return(e,r,n)=>{const i=e.x,o=e.y,a=n.x,s=n.y,l=o.minus(s).times(r.x.minus(a)).minus(i.minus(a).times(r.y.minus(s)));return t(l,i,o,a,s)?0:l.comparedTo(0)}}var zZ=e=>e,FZ=e=>{if(e){const t=new MZ(OZ(e)),r=new MZ(OZ(e)),n=(e,t)=>t.addAndReturn(e),i=e=>({x:n(e.x,t),y:n(e.y,r)});return i({x:new wZ(0),y:new wZ(0)}),i}return zZ},NZ=e=>({set:e=>{BZ=NZ(e)},reset:()=>NZ(e),compare:OZ(e),snap:FZ(e),orient:DZ(e)}),BZ=NZ(),jZ=(e,t)=>e.ll.x.isLessThanOrEqualTo(t.x)&&t.x.isLessThanOrEqualTo(e.ur.x)&&e.ll.y.isLessThanOrEqualTo(t.y)&&t.y.isLessThanOrEqualTo(e.ur.y),VZ=(e,t)=>{if(t.ur.x.isLessThan(e.ll.x)||e.ur.x.isLessThan(t.ll.x)||t.ur.y.isLessThan(e.ll.y)||e.ur.y.isLessThan(t.ll.y))return null;const r=e.ll.x.isLessThan(t.ll.x)?t.ll.x:e.ll.x,n=e.ur.x.isLessThan(t.ur.x)?e.ur.x:t.ur.x;return{ll:{x:r,y:e.ll.y.isLessThan(t.ll.y)?t.ll.y:e.ll.y},ur:{x:n,y:e.ur.y.isLessThan(t.ur.y)?e.ur.y:t.ur.y}}},GZ=(e,t)=>e.x.times(t.y).minus(e.y.times(t.x)),UZ=(e,t)=>e.x.times(t.x).plus(e.y.times(t.y)),$Z=e=>UZ(e,e).sqrt(),HZ=(e,t,r)=>{const n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return GZ(i,n).div($Z(i)).div($Z(n))},qZ=(e,t,r)=>{const n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return UZ(i,n).div($Z(i)).div($Z(n))},WZ=(e,t,r)=>t.y.isZero()?null:{x:e.x.plus(t.x.div(t.y).times(r.minus(e.y))),y:r},ZZ=(e,t,r)=>t.x.isZero()?null:{x:r,y:e.y.plus(t.y.div(t.x).times(r.minus(e.x)))},YZ=class e{point;isLeft;segment;otherSE;consumedBy;static compare(t,r){const n=e.comparePoints(t.point,r.point);return 0!==n?n:(t.point!==r.point&&t.link(r),t.isLeft!==r.isLeft?t.isLeft?1:-1:nY.compare(t.segment,r.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}constructor(e,t){void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let e=0,r=t.length;e<r;e++){const r=t[e];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const r=this.point.events[t];
vendor: 10,199 bytes, line 31
31if(void 0===r.segment.consumedBy)for(let n=t+1;n<e;n++){const e=this.point.events[n];void 0===e.consumedBy&&(r.otherSE.point.events===e.otherSE.point.events&&r.segment.consume(e.segment))}}}getAvailableLinkedEvents(){const e=[];for(let t=0,r=this.point.events.length;t<r;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,r=r=>{const n=r.otherSE;t.set(r,{sine:HZ(this.point,e.point,n.point),cosine:qZ(this.point,e.point,n.point)})};return(e,n)=>{t.has(e)||r(e),t.has(n)||r(n);const{sine:i,cosine:o}=t.get(e),{sine:a,cosine:s}=t.get(n);return i.isGreaterThanOrEqualTo(0)&&a.isGreaterThanOrEqualTo(0)?o.isLessThan(s)?1:o.isGreaterThan(s)?-1:0:i.isLessThan(0)&&a.isLessThan(0)?o.isLessThan(s)?-1:o.isGreaterThan(s)?1:0:a.isLessThan(i)?-1:a.isGreaterThan(i)?1:0}}},XZ=class e{events;poly;_isExteriorRing;_enclosingRing;static factory(t){const r=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];if(!i.isInResult()||i.ringOut)continue;let o=null,a=i.leftSE,s=i.rightSE;const l=[a],c=a.point,u=[];for(;o=a,a=s,l.push(a),a.point!==c;)for(;;){const t=a.getAvailableLinkedEvents();if(0===t.length){const e=l[0].point,t=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${e.x}, ${e.y}]. Last matching segment found ends at [${t.x}, ${t.y}].`)}if(1===t.length){s=t[0].otherSE;break}let n=null;for(let e=0,t=u.length;e<t;e++)if(u[e].point===a.point){n=e;break}if(null!==n){const t=u.splice(n)[0],i=l.splice(t.index);i.unshift(i[0].otherSE),r.push(new e(i.reverse()));continue}u.push({index:l.length,point:a.point});const i=a.getLeftmostComparator(o);s=t.sort(i)[0].otherSE;break}r.push(new e(l))}return r}constructor(e){this.events=e;for(let t=0,r=e.length;t<r;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let r=1,n=this.events.length-1;r<n;r++){const n=this.events[r].point,i=this.events[r+1].point;0!==BZ.orient(n,e,i)&&(t.push(n),e=n)}if(1===t.length)return null;const r=t[0],n=t[1];0===BZ.orient(r,e,n)&&t.shift(),t.push(t[0]);const i=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:t.length-1,a=this.isExteriorRing()?t.length:-1,s=[];for(let e=o;e!=a;e+=i)s.push([t[e].x.toNumber(),t[e].y.toNumber()]);return s}isExteriorRing(){if(void 0===this._isExteriorRing){const e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let t=1,r=this.events.length;t<r;t++){const r=this.events[t];YZ.compare(e,r)>0&&(e=r)}let t=e.segment.prevInResult(),r=t?t.prevInResult():null;for(;;){if(!t)return null;if(!r)return t.ringOut;if(r.ringOut!==t.ringOut)return r.ringOut?.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut?.enclosingRing();t=r.prevInResult(),r=t?t.prevInResult():null}}},KZ=class{exteriorRing;interiorRings;constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=this.exteriorRing.getGeom();if(null===e)return null;const t=[e];for(let e=0,r=this.interiorRings.length;e<r;e++){const r=this.interiorRings[e].getGeom();null!==r&&t.push(r)}return t}},JZ=class{rings;polys;constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,r=this.polys.length;t<r;t++){const r=this.polys[t].getGeom();null!==r&&e.push(r)}return e}_composePolys(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r];if(!n.poly)if(n.isExteriorRing())t.push(new KZ(n));else{const e=n.enclosingRing();e?.poly||t.push(new KZ(e)),e?.poly?.addInterior(n)}}return t}},QZ=class{queue;tree;segments;constructor(e,t=nY.compare){this.queue=e,this.tree=new MZ(t),this.segments=[]}process(e){const t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.delete(e.otherSE):this.tree.delete(t),r;e.isLeft&&this.tree.add(t);let n=t,i=t;do{n=this.tree.lastBefore(n)}while(null!=n&&null!=n.consumedBy);do{i=this.tree.firstAfter(i)}while(null!=i&&null!=i.consumedBy);if(e.isLeft){let o=null;if(n){const e=n.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(o=e),!n.isAnEndpoint(e))){const t=this._splitSafely(n,e);for(let e=0,n=t.length;e<n;e++)r.push(t[e])}}let a=null;if(i){const e=i.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(a=e),!i.isAnEndpoint(e))){const t=this._splitSafely(i,e);for(let e=0,n=t.length;e<n;e++)r.push(t[e])}}if(null!==o||null!==a){let e=null;if(null===o)e=a;else if(null===a)e=o;else{e=YZ.comparePoints(o,a)<=0?o:a}this.queue.delete(t.rightSE),r.push(t.rightSE);const n=t.split(e);for(let e=0,t=n.length;e<t;e++)r.push(n[e])}r.length>0?(this.tree.delete(t),r.push(e)):(this.segments.push(t),t.prev=n)}else{if(n&&i){const e=n.getIntersection(i);if(null!==e){if(!n.isAnEndpoint(e)){const t=this._splitSafely(n,e);for(let e=0,n=t.length;e<n;e++)r.push(t[e])}if(!i.isAnEndpoint(e)){const t=this._splitSafely(i,e);for(let e=0,n=t.length;e<n;e++)r.push(t[e])}}}this.tree.delete(t)}return r}_splitSafely(e,t){this.tree.delete(e);const r=e.rightSE;this.queue.delete(r);const n=e.split(t);return n.push(r),void 0===e.consumedBy&&this.tree.add(e),n}},eY=new class{type;numMultiPolys;run(e,t,r){eY.type=e;const n=[new aY(t,!0)];for(let e=0,t=r.length;e<t;e++)n.push(new aY(r[e],!1));if(eY.numMultiPolys=n.length,"difference"===eY.type){const e=n[0];let t=1;for(;t<n.length;)null!==VZ(n[t].bbox,e.bbox)?t++:n.splice(t,1)}if("intersection"===eY.type)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let r=e+1,i=n.length;r<i;r++)if(null===VZ(t.bbox,n[r].bbox))return[]}const i=new MZ(YZ.compare);for(let e=0,t=n.length;e<t;e++){const t=n[e].getSweepEvents();for(let e=0,r=t.length;e<r;e++)i.add(t[e])}const o=new QZ(i);let a=null;for(0!=i.size&&(a=i.first(),i.delete(a));a;){const e=o.process(a);for(let t=0,r=e.length;t<r;t++){const r=e[t];void 0===r.consumedBy&&i.add(r)}0!=i.size?(a=i.first(),i.delete(a)):a=null}BZ.reset();const s=XZ.factory(o.segments);return new JZ(s).getGeom()}},tY=eY,rY=0,nY=class e{id;leftSE;rightSE;rings;windings;ringOut;consumedBy;prev;_prevInResult;_beforeState;_afterState;_isInResult;static compare(e,t){const r=e.leftSE.point.x,n=t.leftSE.point.x,i=e.rightSE.point.x,o=t.rightSE.point.x;if(o.isLessThan(r))return 1;if(i.isLessThan(n))return-1;const a=e.leftSE.point.y,s=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(r.isLessThan(n)){if(s.isLessThan(a)&&s.isLessThan(l))return 1;if(s.isGreaterThan(a)&&s.isGreaterThan(l))return-1;const r=e.comparePoint(t.leftSE.point);if(r<0)return 1;if(r>0)return-1;const n=t.comparePoint(e.rightSE.point);return 0!==n?n:-1}if(r.isGreaterThan(n)){if(a.isLessThan(s)&&a.isLessThan(c))return-1;if(a.isGreaterThan(s)&&a.isGreaterThan(c))return 1;const r=t.comparePoint(e.leftSE.point);if(0!==r)return r;const n=e.comparePoint(t.rightSE.point);return n<0?1:n>0?-1:1}if(a.isLessThan(s))return-1;if(a.isGreaterThan(s))return 1;if(i.isLessThan(o)){const r=t.comparePoint(e.rightSE.point);if(0!==r)return r}if(i.isGreaterThan(o)){const r=e.comparePoint(t.rightSE.point);if(r<0)return 1;if(r>0)return-1}if(!i.eq(o)){const e=l.minus(a),t=i.minus(r),u=c.minus(s),d=o.minus(n);if(e.isGreaterThan(t)&&u.isLessThan(d))return 1;if(e.isLessThan(t)&&u.isGreaterThan(d))return-1}return i.isGreaterThan(o)?1:i.isLessThan(o)||l.isLessThan(c)?-1:l.isGreaterThan(c)?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,r,n){this.id=++rY,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=r,this.windings=n}static fromRing(t,r,n){let i,o,a;const s=YZ.comparePoints(t,r);if(s<0)i=t,o=r,a=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);i=r,o=t,a=-1}const l=new YZ(i,!0),c=new YZ(o,!1);return new e(l,c,[n],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return BZ.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),r=e.bbox(),n=VZ(t,r);if(null===n)return null;const i=this.leftSE.point,o=this.rightSE.point,a=e.leftSE.point,s=e.rightSE.point,l=jZ(t,a)&&0===this.comparePoint(a),c=jZ(r,i)&&0===e.comparePoint(i),u=jZ(t,s)&&0===this.comparePoint(s),d=jZ(r,o)&&0===e.comparePoint(o);if(c&&l)return d&&!u?o:!d&&u?s:null;if(c)return u&&i.x.eq(s.x)&&i.y.eq(s.y)?null:i;if(l)return d&&o.x.eq(a.x)&&o.y.eq(a.y)?null:a;if(d&&u)return null;if(d)return o;if(u)return s;const h=((e,t,r,n)=>{if(t.x.isZero())return ZZ(r,n,e.x);if(n.x.isZero())return ZZ(e,t,r.x);if(t.y.isZero())return WZ(r,n,e.y);if(n.y.isZero())return WZ(e,t,r.y);const i=GZ(t,n);if(i.isZero())return null;const o={x:r.x.minus(e.x),y:r.y.minus(e.y)},a=GZ(o,t).div(i),s=GZ(o,n).div(i),l=e.x.plus(s.times(t.x)),c=r.x.plus(a.times(n.x)),u=e.y.plus(s.times(t.y)),d=r.y.plus(a.times(n.y));return{x:l.plus(c).div(2),y:u.plus(d).div(2)}})(i,this.vector(),a,e.vector());return null===h?null:jZ(n,h)?BZ.snap(h):null}split(t){const r=[],n=void 0!==t.events,i=new YZ(t,!0),o=new YZ(t,!1),a=this.rightSE;this.replaceRightSE(o),r.push(o),r.push(i);const s=new e(i,a,this.rings.slice(),this.windings.slice());return YZ.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),YZ.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,t=this.windings.length;e<t;e++)this.windings[e]*=-1}consume(t){let r=this,n=t;for(;r.consumedBy;)r=r.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=e.compare(r,n);if(0!==i){if(i>0){const e=r;r=n,n=e}if(r.prev===n){const e=r;r=n,n=e}
vendor: 1,433 bytes, line 31
31for(let e=0,t=n.rings.length;e<t;e++){const t=n.rings[e],i=n.windings[e],o=r.rings.indexOf(t);-1===o?(r.rings.push(t),r.windings.push(i)):r.windings[o]+=i}n.rings=null,n.windings=null,n.consumedBy=r,n.leftSE.consumedBy=r.leftSE,n.rightSE.consumedBy=r.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,r=this._afterState.windings,n=this._afterState.multiPolys;for(let e=0,n=this.rings.length;e<n;e++){const n=this.rings[e],i=this.windings[e],o=t.indexOf(n);-1===o?(t.push(n),r.push(i)):r[o]+=i}const i=[],o=[];for(let e=0,n=t.length;e<n;e++){if(0===r[e])continue;const n=t[e],a=n.poly;if(-1===o.indexOf(a))if(n.isExterior)i.push(a);else{-1===o.indexOf(a)&&o.push(a);const e=i.indexOf(n.poly);-1!==e&&i.splice(e,1)}}for(let e=0,t=i.length;e<t;e++){const t=i[e].multiPoly;-1===n.indexOf(t)&&n.push(t)}return this._afterState}
31isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(tY.type){case"union":{const r=0===e.length,n=0===t.length;this._isInResult=r!==n;break}case"intersection":{let r,n;e.length<t.length?(r=e.length,n=t.length):(r=t.length,n=e.length),this._isInResult=n===tY.numMultiPolys&&r<n;break}case"xor":{const r=Math.abs(e.length-t.length);this._isInResult=r%2==1;break}case"difference":{const r=e=>1===e.length&&e[0].isSubject;this._isInResult=r(e)!==r(t);break}}return this._isInResult}},iY=class{poly;isExterior;segments;bbox;constructor(e,t,r){if(!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=BZ.snap({x:new wZ(e[0][0]),y:new wZ(e[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let i=n;for(let t=1,r=e.length;t<r;t++){if("number"!=typeof e[t][0]||"number"!=typeof e[t][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=BZ.snap({x:new wZ(e[t][0]),y:new wZ(e[t][1])});r.x.eq(i.x)&&r.y.eq(i.y)||(this.segments.push(nY.fromRing(i,r,this)),r.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.x),r.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.y),r.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.x),r.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.y),i=r)}n.x.eq(i.x)&&n.y.eq(i.y)||this.segments.push(nY.fromRing(i,n,this))}getSweepEvents(){const e=[];for(let t=0,r=this.segments.length;t<r;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}},oY=class{multiPoly;exteriorRing;interiorRings;bbox;constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new iY(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let t=1,r=e.length;t<r;t++){const r=new iY(e[t],this,!1);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,r=this.interiorRings.length;t<r;t++){const r=this.interiorRings[t].getSweepEvents();for(let t=0,n=r.length;t<n;t++)e.push(r[t])}return e}},aY=class{isSubject;polys;bbox;constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(e){}this.polys=[],this.bbox={ll:{x:new wZ(Number.POSITIVE_INFINITY),y:new wZ(Number.POSITIVE_INFINITY)},ur:{x:new wZ(Number.NEGATIVE_INFINITY),y:new wZ(Number.NEGATIVE_INFINITY)}};for(let t=0,r=e.length;t<r;t++){const r=new oY(e[t],this);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,r=this.polys.length;t<r;t++){const r=this.polys[t].getSweepEvents();for(let t=0,n=r.length;t<n;t++)e.push(r[t])}return e}};BZ.set;function sY(e){const t=[];if(tS(e,(e=>{t.push(e.coordinates)}
31)),t.length<2)throw new Error("Must have at least two features");const r=e.features[0].properties||{},n=((e,...t)=>tY.run("difference",e,t))(t[0],...t.slice(1));return 0===n.length?null:1===n.length?$w(n[0],r):Zw(n,r)}function lY(e,t,r){var n=e.radiusMeters/1e3;if(n<=0)return null;var i=t,o=r;return o<i&&(o+=360),o-i<.5?null:tD(e.center,n,i,o,{units:"kilometers",steps:64})}var cY=$u('<p class="text-xs text-gray-500"><!></p>'),uY=$u("<option> </option>"),dY=$u('<div class="grid grid-cols-2 gap-2"><div><label class="block text-[10px] font-medium text-gray-600 mb-1">Start (°)</label> <input type="number" min="0" max="360" step="1" class="w-full px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500"/></div> <div><label class="block text-[10px] font-medium text-gray-600 mb-1">End (°)</label> <input type="number" min="0" max="360" step="1" class="w-full px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500"/></div></div>'),hY=$u('<div class="border border-gray-200 rounded-lg p-3 space-y-2"><div class="flex items-center gap-2"><input type="text" placeholder="Name" class="flex-1 px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"/> <button class="p-1.5 text-red-600 hover:bg-red-50 rounded transition-colors" title="Remove zone" aria-label="Remove zone"><!></button></div> <select class="w-full px-2 py-1 border border-gray-300 rounded text-sm bg-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"><option>No crop type</option><!></select> <!></div>'),fY=$u('<div class="text-sm text-red-700 bg-red-50 border border-red-200 rounded-md p-2"> </div>'),pY=$u('<button class="w-full px-4 py-2.5 rounded-lg font-medium text-sm border border-red-300 bg-red-50 text-red-700 hover:bg-red-100 transition-colors disabled:opacity-50"> </button>'),gY=$u('<div class="flex h-full w-full"><div class="font-sans w-80 flex-shrink-0 flex flex-col h-full border-r border-gray-200 bg-white shadow-xl z-10 overflow-y-auto"><div class="p-5 space-y-5"><div class="flex items-center gap-3"><button class="p-1.5 hover:bg-gray-100 rounded-lg transition-colors text-gray-500 hover:text-gray-700" title="Back to field view"><!></button> <div><h2 class="text-lg font-semibold text-gray-900">Edit Crop Zones</h2> <p class="text-sm text-gray-500"> </p></div></div> <p class="text-xs text-gray-600 leading-relaxed"><!></p> <div class="flex flex-col gap-2"><label class="flex items-center justify-between gap-2 px-3 py-2 border border-gray-200 rounded-md bg-white cursor-pointer"><span class="text-xs font-medium text-gray-700">NDVI overlay</span> <input type="checkbox" class="h-4 w-4 accent-blue-600"/></label> <label class="flex items-center justify-between gap-2 px-3 py-2 border border-gray-200 rounded-md bg-white cursor-pointer"><span class="text-xs font-medium text-gray-700">Equipment overlay</span> <input type="checkbox" class="h-4 w-4 accent-blue-600"/></label></div> <button class="flex items-center justify-center gap-2 w-full px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white text-sm font-medium rounded-lg transition-colors"><!> </button> <div class="flex flex-col gap-2"><h3 class="text-sm font-semibold text-gray-900"> </h3> <!> <!></div> <!> <!> <div class="pt-3 border-t border-gray-200 flex flex-col gap-2"><button> </button> <button class="w-full px-4 py-2.5 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors font-medium text-sm border border-gray-200">Cancel</button></div></div></div> <div class="flex-1 relative bg-gray-100"><div class="absolute inset-0"></div></div></div>');function mY(e,t){Zs(t,!0);let r=fh(t,"mapInstance",3,null),n=fh(t,"mapPlaceholderRef",15,null),i=fh(t,"validCropTypes",19,(()=>[])),o=null,a=$l(Jl([])),s=$l(!1),l=$l(null),c=$l(null);const u=Dl((()=>t.farmFieldsGeojson?.features?.find((e=>Number(e.id)===Bw.selectedFieldId)))),d=Dl((()=>yu(u)?.properties?.name||Bw.selectedFieldName||`Field ${Bw.selectedFieldId}`)),h=Dl((()=>{const e=yu(u)?.properties;if(!e)return null;
31const t=e.radius??e.radius_meters,r=e.center;if("number"!=typeof t||!Array.isArray(r)||2!==r.length)return null;const n="number"==typeof e.start_angle?e.start_angle:0,i="number"==typeof e.end_angle?e.end_angle:360;return{center:[r[0],r[1]],radiusMeters:t,fieldStartAngle:n,fieldEndAngle:i}})),f=Dl((()=>null!==yu(h)));let p=!1,g=!1,m=null,y=$l(!1);const _=["hose-reels-outline","hose-reel-starts-fill","drip-boundaries-fill","drip-boundaries-outline"];yh((async()=>{p=Bw.showETLayer,g=Bw.showVegetationIndexLayer,m=Bw.vegetationIndexType,Bw.showETLayer=!1,Bw.showVegetationIndexLayer=!0,Bw.vegetationIndexType="ndvi",await mu();const e=r(),t=()=>{if(e){if(sD(e),yu(u))try{const t=Ez(yu(u));e.fitBounds(t,{padding:60,maxZoom:17})}catch(e){console.warn("SplitFieldView: fitBounds failed",e)}try{!function(){if(!r()||!yu(u))return;if(r().getSource(k))return;r().addSource(k,{type:"geojson",data:{type:"FeatureCollection",features:[yu(u)]}}),r().addLayer({id:I,type:"line",source:k,paint:{"line-color":"#fbbf24","line-width":6,"line-opacity":.35}}),r().addLayer({id:T,type:"line",source:k,paint:{"line-color":"#f59e0b","line-width":2}})}()}catch(e){console.warn("SplitFieldView: boundary layer failed",e)}try{yu(f)?(!function(){if(!r())return;if(r().getSource(v))return;r().addSource(v,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),r().addLayer({id:b,type:"fill",source:v,paint:{"fill-color":"#10b981","fill-opacity":.22}}),r().addLayer({id:x,type:"line",source:v,paint:{"line-color":"#059669","line-width":2}})}(),S(),0===yu(a).length&&N()):(!function(){if(!r()||o)return;o=new yL({displayControlsDefault:!1,controls:{polygon:!1,trash:!1},defaultMode:"simple_select",styles:[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#8b5cf6","fill-opacity":.25}},{id:"gl-draw-polygon-stroke",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"line-color":"#7c3aed","line-width":2.5}},{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"]],paint:{"circle-radius":6,"circle-color":"#ffffff","circle-stroke-color":"#7c3aed","circle-stroke-width":2}}],modes:{...yL.modes,draw_polygon_snap:uN}}),r().addControl(o),r().on("draw.create",D),r().on("draw.update",z),r().on("draw.delete",F)}(),S())}catch(e){console.error("SplitFieldView: draw setup failed",e)}setTimeout((()=>M()),50),setTimeout((()=>M()),500),setTimeout((()=>M()),1500)}};e&&(e.isStyleLoaded()?t():e.once("style.load",t))})),_h((()=>{!function(){if(!r())return;if(o){r().off("draw.create",D),r().off("draw.update",z),r().off("draw.delete",F);try{r().removeControl(o)}catch{}o=null}}(),function(){if(!r())return;try{r().getLayer(x)&&r().removeLayer(x),r().getLayer(b)&&r().removeLayer(b),r().getSource(v)&&r().removeSource(v)}catch{}}(),function(){if(!r())return;try{r().getLayer(T)&&r().removeLayer(T),r().getLayer(I)&&r().removeLayer(I),r().getSource(k)&&r().removeSource(k)}catch{}}(),lD(r()),Bw.showETLayer=p,Bw.showVegetationIndexLayer=g,m&&(Bw.vegetationIndexType=m)}));const v="split-field-saved-sectors-src",b="split-field-saved-sectors-fill",x="split-field-saved-sectors-outline";function w(){if(!r())return;const e=r().getSource(v);if(!e?.setData)return;const t=yu(a).filter((e=>e.sector)).map((e=>e.feature));e.setData({type:"FeatureCollection",features:t})}function S(){const e=yu(u)?.properties?.crop_zones??[];if(0===e.length)return;const t=[];for(const r of e){const e=r.crop_zone_id??`cz-${t.length}-${Math.random().toString(36).slice(2,6)}`;if(yu(f)&&"number"==typeof r.start_angle&&"number"==typeof r.end_angle&&!!yu(h)&&yu(h)){const n=r.start_angle,i=r.end_angle,o=lY(yu(h),n,i);if(!o)continue;t.push({id:e,feature:o,name:r.name??`Zone ${t.length+1}`,cropType:r.crop_type??"",sector:{startAngle:n,endAngle:i}})}else if(r.boundary){const n={type:"Feature",id:e,geometry:r.boundary,properties:{}};if(t.push({id:e,feature:n,name:r.name??`Zone ${t.length+1}`,cropType:r.crop_type??""}),o)try{o.add({...n,id:e})}catch(e){console.warn("SplitFieldView: failed to add existing zone to draw control",e)}}}ql(a,t,!0),yu(f)&&w()}const k="split-field-outline-src",T="split-field-outline-line",I="split-field-outline-glow";function M(){if(!r())return;const e=r().getLayer(I)?I:void 0;if(!e)return;const t=r().getStyle()?.layers||[];for(const n of t)if(n.id.startsWith("vegetation-raster-")||n.id.startsWith("vegetation-source-"))try{r().moveLayer(n.id,e)}catch{}}function E(e){const t=e.coordinates[0]??[];let r=0;for(let e=0,n=t.length;e<n-1;e++)r+=t[e][0]*t[e+1][1]-t[e+1][0]*t[e][1];return Math.abs(r)/2}function P(e){if("Polygon"===e.type)return e;let t=null,r=0;for(const n of e.coordinates){const e={type:"Polygon",coordinates:n},i=E(e);i>r&&(r=i,t=e)}return t}function A(e,t,r){return{type:"Feature",id:e,properties:t.properties??{},geometry:r}}function C(e){if(!yu(u)||"Polygon"!==yu(u).geometry.type)return e;if("Polygon"!==e.geometry.type)return e;const t=yu(u).geometry.coordinates[0];if(!t||t.length<2)return e;try{const r=Hw(t),n=[],i=e.geometry.coordinates[0]??[];for(const e of i){const t=qF(r,e).geometry.coordinates,i=n[n.length-1];i&&i[0]===t[0]&&i[1]===t[1]||n.push([t[0],t[1]])}if(n.length-(n.length>1&&R(n[0],n[n.length-1])?1:0)<3)return null;R(n[0],n[n.length-1])||n.push([n[0][0],n[0][1]]);const o={type:"Polygon",coordinates:[n]};return A(e.id,e,o)}catch(t){return console.warn("SplitFieldView: snap failed",t),e}}function R(e,t){return e[0]===t[0]&&e[1]===t[1]}function L(e,t){if("Polygon"!==e.geometry.type)return e;let r=e;for(const n of yu(a))if(n.id!==t&&"Polygon"===n.feature.geometry.type)try{const t=sY({type:"FeatureCollection",features:[r,n.feature]}
31);if(!t||!t.geometry)return null;const i=P(t.geometry);if(!i)return null;r=A(e.id,e,i)}catch(e){console.warn("SplitFieldView: subtract failed",e)}return r}function O(e,t){if(o){try{o.delete(e)}catch{}o.add({...t,id:e})}}function D(e){for(const t of e.features){const e=String(t.id??Math.random().toString(36).slice(2)),r=C(t);if(!r){o?.delete(e),ql(l,"Draw at least three points so they can snap to the field boundary.");continue}const n=L(r,e);n?(O(e,n),ql(l,null),ql(a,[...yu(a),{id:e,feature:n,name:`Zone ${yu(a).length+1}`,cropType:""}],!0)):(o?.delete(e),ql(l,"New zone is fully covered by existing zones — discarded."))}}function z(e){for(const t of e.features){const e=String(t.id??""),r=C(t);if(!r){const t=yu(a).find((t=>t.id===e))?.feature;t&&O(e,t),ql(l,"Edit reverted — zone would have fewer than three vertices after snapping.");continue}const n=L(r,e);if(n)O(e,n),ql(l,null),ql(a,yu(a).map((t=>t.id===e?{...t,feature:n}:t)),!0);else{const t=yu(a).find((t=>t.id===e))?.feature;t&&O(e,t),ql(l,"Edit reverted — zone would be fully covered by another zone.")}}}function F(e){const t=new Set(e.features.map((e=>e.id)));ql(a,yu(a).filter((e=>!t.has(e.id))),!0)}function N(){if(!yu(h))return;const e=yu(a).length>0?yu(a)[yu(a).length-1].sector?.endAngle:void 0,t="number"==typeof e?e:yu(h).fieldStartAngle,r=t+90,n=yu(h).fieldEndAngle>yu(h).fieldStartAngle?yu(h).fieldEndAngle:360,i=Math.min(r,n),o=lY(yu(h),t,i);if(!o)return;const s=`sector-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;ql(a,[...yu(a),{id:s,feature:o,name:`Zone ${yu(a).length+1}`,cropType:"",sector:{startAngle:t,endAngle:i}}],!0),w()}function B(e,t,r){if(!yu(h))return;const n=lY(yu(h),t,r);n&&(ql(a,yu(a).map((i=>i.id===e?{...i,feature:n,sector:{startAngle:t,endAngle:r}}:i)),!0),w())}async function j(e=!1){if(ql(l,null),ql(c,e?yu(c):null,!0),yu(a).length<1)return void ql(l,"Add at least one zone before saving.");const t=new Set;for(const e of yu(a)){const r=e.name.trim();if(!r)return void ql(l,"Every zone needs a name.");if(t.has(r))return void ql(l,`Duplicate zone name: ${r}.`);t.add(r)}ql(s,!0);try{const t={field_id:Bw.selectedFieldId,zones:yu(a).map((e=>{return{name:e.name.trim(),crop_type_name:e.cropType.trim()||void 0,boundary_geojson:e.sector&&yu(h)?(t=yu(h),r=e.sector.startAngle,n=e.sector.endAngle,JSON.stringify({type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[t.center[0],t.center[1]]},properties:{radius:t.radiusMeters,start_angle:r,end_angle:n}}]})):JSON.stringify(e.feature.geometry)};var t,r,n})),delete_existing_plans:e},r=await fetch(`${bh.basePath}farms/api/crop-zones/split/`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify(t)});if(409===r.status){const e=await r.json().catch((()=>({})));if(e?.can_delete_and_retry)return ql(c,Number(e.existing_plan_count??0)||0,!0),void ql(l,e.detail||"Delete all saved VRI plans for this field before adding crop zones.",!0)}if(!r.ok){const e=await r.json().catch((()=>({})));throw new Error(e?.zones||e?.field_id||e?.detail||e?.error||"Failed to save crop zones.")}window.location.reload()}catch(e){ql(l,e instanceof Error?e.message:"Failed to save crop zones.",!0)}finally{ql(s,!1)}}function V(){t.onClose?.()}var G=gY(),U=uc(G),$=uc(U),H=uc($),q=uc(H);q.__click=V,WO(uc(q),{class:"w-5 h-5"}),Os(q);var W=hc(q,2),Z=hc(uc(W),2),Y=uc(Z,!0);Os(Z),Os(W),Os(H);var X=hc(H,2),K=uc(X),J=e=>{Yu(e,Wu("Pivot zones are sectors of the pivot arc. Add a zone, then enter its start and end\n        angles in degrees (0 = North, increasing clockwise). The map updates live."))},Q=e=>{Yu(e,Wu("Draw one polygon per crop. Each crop zone becomes an independent VRI target,\n        and VRI maps pushed to Raindancer will not overwrite each other."))};ad(K,(e=>{yu(f)?e(J):e(Q,!1)})),Os(X);var ee=hc(X,2),te=uc(ee),re=hc(uc(te),2);Ld(re),re.__change=e=>function(e){Bw.showVegetationIndexLayer=e,e&&(Bw.vegetationIndexType="ndvi",setTimeout((()=>M()),50),setTimeout((()=>M()),500))}(e.target.checked),Os(te);var ne=hc(te,2),ie=hc(uc(ne),2);Ld(ie),ie.__change=e=>function(e){if(ql(y,e,!0),r())for(const t of _)r().getLayer(t)&&r().setLayoutProperty(t,"visibility",e?"visible":"none")}(e.target.checked),Os(ne),Os(ee);var oe=hc(ee,2);oe.__click=function(){if(yu(f))return void N();if(!o)return;const e=yu(u)?.geometry;if(!e||"Polygon"!==e.type&&"MultiPolygon"!==e.type)o.changeMode("draw_polygon");else{const t=yu(a).map((e=>e.feature.geometry)).filter((e=>"Polygon"===e?.type));o.changeMode("draw_polygon_snap",{boundary:e,snapPolygons:t,blockingPolygons:t})}};var ae=uc(oe);Kz(ae,{class:"w-4 h-4"});var se=hc(ae);Os(oe);var le=hc(oe,2),ce=uc(le),ue=uc(ce);Os(ce);var de=hc(ce,2),he=e=>{var t=cY(),r=uc(t),n=e=>{Yu(e,Wu('No zones yet. Click "Add Sector Zone" to create one and set its angles.'))},i=e=>{Yu(e,Wu('No zones drawn yet. Click "Draw New Zone" and trace a polygon on the map.'))};ad(r,(e=>{yu(f)?e(n):e(i,!1)})),Os(t),Yu(e,t)};ad(de,(e=>{0===yu(a).length&&e(he)})),Il(hc(de,2),17,(()=>yu(a)),(e=>e.id),((e,t,r)=>{var n=hY(),s=uc(n),l=uc(s);Ld(l);var c=hc(l,2);c.__click=()=>function(e){const t=yu(a).find((t=>t.id===e));if(t?.sector)return ql(a,yu(a).filter((t=>
31t.id!==e)),!0),void w();o&&(o.delete(e),ql(a,yu(a).filter((t=>t.id!==e)),!0))}(yu(t).id),tF(uc(c),{class:"w-4 h-4"}),Os(c),Os(s);var u=hc(s,2),d=uc(u);d.value=d.__value="",Il(hc(d),17,i,Tl,((e,t)=>{var r=uY(),n=uc(r,!0);Os(r);var i={};Pc((()=>{Ju(n,yu(t)),i!==(i=yu(t))&&(r.value=(r.__value=yu(t))??"")})),Yu(e,r)})),Os(u);var h=hc(u,2),f=e=>{var r=dY(),n=uc(r),i=uc(n),o=hc(i,2);Ld(o),o.__change=e=>B(yu(t).id,Number(e.target.value),yu(t).sector.endAngle),Os(n);var a=hc(n,2),s=uc(a),l=hc(s,2);Ld(l),l.__change=e=>B(yu(t).id,yu(t).sector.startAngle,Number(e.target.value)),Os(a),Os(r),Pc((()=>{Fd(i,"for",`zone-start-${yu(t).id}`),Fd(o,"id",`zone-start-${yu(t).id}`),Od(o,yu(t).sector.startAngle),Fd(s,"for",`zone-end-${yu(t).id}`),Fd(l,"id",`zone-end-${yu(t).id}`),Od(l,yu(t).sector.endAngle)})),Yu(e,r)};ad(h,(e=>{yu(t).sector&&e(f)})),Os(n),Kd(l,(()=>yu(t).name),(e=>yu(t).name=e)),Md(u,(()=>yu(t).cropType),(e=>yu(t).cropType=e)),Yu(e,n)})),Os(le);var fe=hc(le,2),pe=e=>{var t=fY(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,yu(l)))),Yu(e,t)};ad(fe,(e=>{yu(l)&&e(pe)}));var ge=hc(fe,2),me=e=>{var t=pY();t.__click=()=>{confirm(`Delete ${yu(c)} saved VRI plan${1!==yu(c)?"s":""} and add crop zones?\n\nThis permanently removes the saved plans. Equipment (pivot extents, hose reel routes, drip boundaries) will be kept.`)&&j(!0)};var r=uc(t,!0);Os(t),Pc((()=>{t.disabled=yu(s),Ju(r,yu(s)?"Deleting and adding zones…":`Delete ${yu(c)} saved VRI plan${1!==yu(c)?"s":""} and add crop zones`)})),Yu(e,t)};ad(ge,(e=>{null!==yu(c)&&yu(c)>0&&e(me)}));var ye=hc(ge,2),_e=uc(ye);_e.__click=()=>j(!1);var ve=uc(_e,!0);Os(_e),hc(_e,2).__click=V,Os(ye),Os($),Os(U);var be=hc(U,2);nh(uc(be),(e=>n(e)),(()=>n())),Os(be),Os(G),Pc((()=>{Ju(Y,yu(d)),Dd(re,Bw.showVegetationIndexLayer&&"ndvi"===Bw.vegetationIndexType),Dd(ie,yu(y)),Ju(se," "+(yu(f)?"Add Sector Zone":"Draw New Zone")),Ju(ue,`Zones (${yu(a).length??""})`),_e.disabled=yu(s)||yu(a).length<2,wd(_e,1,"w-full px-4 py-2.5 rounded-lg font-medium text-sm transition-colors "+(yu(s)||yu(a).length<2?"bg-gray-200 text-gray-500 cursor-not-allowed":"bg-green-600 hover:bg-green-700 text-white")),Ju(ve,yu(s)?"Saving…":"Save crop zones")})),Yu(e,G),Ys()}function yY(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||bY(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _Y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=bY(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vY(e){return function(e){if(Array.isArray(e))return xY(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||bY(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bY(e,t){if(e){if("string"==typeof e)return xY(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xY(e,t):void 0}}function xY(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function wY(){var e=null,t=new Set,r=new Set,n=null,i=null;return{reset:function(){e=null},update:function o(a,s,l,c,u,d){var h,f=null!==(h=null==s?void 0:s.size)&&void 0!==h?h:0;if(!a.isStyleLoaded()&&l&&f>0){var p=!1,g=function(){p||(p=!0,o(a,s,l,c,u,d))};return a.once("style.load",g),void a.once("idle",g)}var m=l&&f>0?"".concat(c,"-").concat(u,"-").concat(f,"-").concat(vY(null==s?void 0:s.keys()).join(",")):"none",y=t.size>0||r.size>0;if(m!==e||y){e=m;var _,v=_Y(t);try{for(v.s();!(_=v.n()).done;){var b=_.value;a.getLayer(b)&&a.removeLayer(b)}}catch(e){v.e(e)}finally{v.f()}var x,w=_Y(r);try{for(w.s();!(x=w.n()).done;){var S=x.value;a.getSource(S)&&a.removeSource(S)}}catch(e){w.e(e)}finally{w.f()}if(t.clear(),r.clear(),a.getLayer("vegetation-raster")&&a.removeLayer("vegetation-raster"),a.getSource("vegetation-source")&&a.removeSource("vegetation-source"),l&&s&&0!==s.size){var k,T=0,I=_Y(s);try{for(I.s();!(k=I.n()).done;){var M=yY(k.value,2),E=M[0],P=M[1],A=P.imageData,C=P.bounds,R=P.quadCorners,L=P.width,O=P.height;if(n||(n=document.createElement("canvas"),i=n.getContext("2d")),i){n.width=L,n.height=O,i.putImageData(A,0,0);var D=n.toDataURL("image/png"),z="vegetation-source-".concat(T),F="vegetation-raster-".concat(T);if(Math.abs(C[0])<180&&Math.abs(C[1])<90){r.add(z);
31var N=null!=R?R:[[C[0],C[3]],[C[2],C[3]],[C[2],C[1]],[C[0],C[1]]];a.addSource(z,{type:"image",url:D,coordinates:N}),t.add(F),a.addLayer({id:F,type:"raster",source:z,paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}}),T++}else console.warn("[vegetationLayer] Skipping layer for field ".concat(E,": bounds not in WGS84"))}else console.error("[vegetationLayer] Failed to create canvas context for field",E)}}catch(e){I.e(e)}finally{I.f()}if("rgb"===c)d(null);else{var B=fT(c);d({colorScale:function(e){var t=yY(gT(e,c),3),r=t[0],n=t[1],i=t[2];return"rgb(".concat(r,",").concat(n,",").concat(i,")")},min:B.min,max:B.max,show:!0})}}else d(null)}}}}Bu(["click","change"]);var SY=$u('<span class="text-[9px] text-gray-500 ml-1"> </span>'),kY=$u("<span> </span>"),TY=$u('<span class="text-xs font-semibold text-gray-400 tabular-nums">–</span>'),IY=$u('<div class="flex items-center justify-center gap-4 px-2 py-1.5 bg-white border-t border-gray-200 rounded-b-lg"><div class="flex items-center gap-1"><span class="text-[10px] text-gray-400 uppercase">Change</span> <!></div></div>'),MY=$u('<div class="flex items-center justify-center gap-4 px-2 py-1.5 bg-white border-t border-gray-200 rounded-b-lg"><div class="flex items-center gap-1"><span class="text-[10px] text-gray-400 uppercase">Min</span> <span class="text-xs font-semibold text-gray-700 tabular-nums"> </span></div> <div class="flex items-center gap-1"><span class="text-[10px] text-gray-400 uppercase">Mean</span> <span class="text-xs font-bold text-gray-900 tabular-nums"> </span></div> <div class="flex items-center gap-1"><span class="text-[10px] text-gray-400 uppercase">Max</span> <span class="text-xs font-semibold text-gray-700 tabular-nums"> </span></div></div>'),EY=$u('<div class="absolute inset-0 z-10 flex flex-col rounded-lg cursor-pointer hover:ring-2 hover:ring-blue-400 transition-shadow"><div class="relative flex-1 min-h-0"><div class="absolute top-2 left-2 z-10 bg-white/90 backdrop-blur-sm px-2 py-0.5 rounded shadow-sm border border-gray-200"><span class="text-xs font-semibold text-gray-800"> </span> <!></div></div> <!></div>'),PY=$u('<div class="absolute inset-0 rounded-lg border border-dashed border-gray-200 bg-gray-50"></div>');Bu(["click"]);var AY=$u('<div class="flex items-center gap-2"><span class="text-[10px] font-semibold text-gray-600 uppercase tracking-wide"> </span> <span class="text-[10px] font-medium text-gray-500 tabular-nums"> </span> <div class="h-3 w-28 rounded-sm border border-gray-300"></div> <span class="text-[10px] font-medium text-gray-500 tabular-nums"> </span></div>');var CY=$u('<div class="flex items-center gap-2"><button class="p-1.5 rounded-lg border border-gray-200 hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed transition-colors"><!></button> <span class="text-sm text-gray-600 font-medium tabular-nums min-w-[80px] text-center"> </span> <button class="p-1.5 rounded-lg border border-gray-200 hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed transition-colors"><!></button></div>'),RY=$u('<div class="relative min-h-0"><div><div class="w-full h-full"></div></div> <!></div>'),LY=$u('<div><div class="flex items-center justify-between px-4 border-b border-gray-200 bg-white flex-shrink-0 relative z-[1002]" style="padding-top: 13px; padding-bottom: 13px;"><div class="flex items-center gap-2"><div class="inline-flex items-center bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden" style="height: 36px;"><button class="px-3 text-sm font-medium transition-colors flex items-center justify-center text-gray-500 hover:bg-gray-50" style="height: 36px;" title="Map View"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"></path></svg></button> <button class="px-3 text-sm font-medium transition-colors flex items-center justify-center bg-blue-50 text-blue-700" style="height: 36px;" title="Grid View"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"></path></svg></button></div> <!> <!></div> <!></div> <div class="flex-1 grid grid-cols-2 grid-rows-2 gap-3 p-3 overflow-hidden"></div></div>');function OY(e,t){Zs(t,!0);let r=fh(t,"isAdmin",3,!1),n=$l(Jl([])),i=$l(Jl([])),o=[],a=!1,s=$l(!1);yh((()=>{ql(s,!0)}));const l=Dl((()=>t.farmFieldsGeojson?dA(t.farmFieldsGeojson,null):null)),c=Dl((()=>yu(l)?yu(l).getSortedFeatures(Bw.tableSortKey,Bw.tableSortAsc):[])),u=Dl((()=>{const e=[];for(const t of yu(c)){const r=t.properties?.crop_zones??[];if(0!==r.length)for(const n of r)e.push({key:n.crop_zone_id??`field-${t.id}-zone-${e.length}`,field:t,zone:n});else e.push({key:`field-${t.id}`,field:t,zone:null})}return e})),d=Dl((()=>Bw.showVegetationIndexLayer&&!!Bw.selectedVegetationDate)),h=Dl((()=>Bw.vegetationIndexType)),f=Dl((()=>fT(yu(h)))),p=Dl((()=>e=>{const[t,r,n]=gT(e,yu(h));return`rgb(${t},${r},${n})`})),g=Dl((()=>Math.max(1,Math.ceil(yu(u).length/4)))),m=Dl((()=>Math.min(Bw.gridViewPage,yu(g)-1))),y=Dl((()=>{const e=4*yu(m);return yu(u).slice(e,e+4)}));function _(){yu(m)>0&&(Bw.gridViewPage=yu(m)-1)}function v(){yu(m)<yu(g)-1&&(Bw.gridViewPage=yu(m)+1)}Tc((()=>{t.isVisible&&!a&&yu(s)&&requestAnimationFrame((()=>function(){if(!t.mapboxPublicToken)return;
31if(o.filter(Boolean).length<4)return;uS().accessToken=t.mapboxPublicToken;const e="satellite"===Bw.activeBaseLayer?"mapbox://styles/mapbox/satellite-streets-v12":"mapbox://styles/mapbox/streets-v12",r=[],s=[];for(let t=0;t<4;t++){const n=new(uS().Map)({container:o[t],style:e,center:lB,zoom:12,interactive:!1,attributionControl:!1});s.push(!1),n.on("load",(()=>{yu(i)[t]=!0,ql(i,[...yu(i)],!0)})),r.push(n)}ql(n,r,!0),ql(i,s,!0),a=!0}()))})),Tc((()=>{t.isVisible&&a&&yu(n).length>0&&requestAnimationFrame((()=>{requestAnimationFrame((()=>{for(const e of yu(n))e.resize()}))}))})),Tc((()=>{if(t.isVisible&&!Bw.selectedVegetationDate&&Bw.showVegetationIndexLayer)if("clearsky"===Bw.imagerySource){if(Bw.clearSkyDates.length>0){const e=[...Bw.clearSkyDates].sort(((e,t)=>t.localeCompare(e)));Bw.selectedVegetationDate=e[0]}}else if(Bw.vegetationImages.length>0){const e=[...Bw.vegetationImages].map((e=>e.date)).sort(((e,t)=>t.localeCompare(e)));Bw.selectedVegetationDate=e[0]}}));let b=null;Tc((()=>{const e=Bw.activeBaseLayer;if(!a||e===b)return;b=e;const t="satellite"===e?"mapbox://styles/mapbox/satellite-streets-v12":"mapbox://styles/mapbox/streets-v12";for(const e of yu(n))e.setStyle(t)}));let x="";Tc((()=>{if(!t.isVisible)return;const e=Bw.showVegetationIndexLayer,r=Bw.selectedVegetationDate,n=Bw.vegetationIndexType,i=Bw.imagerySource;if(!e||!r)return void(x="");const o=yu(y).filter((e=>"Polygon"===e.field.geometry?.type||"MultiPolygon"===e.field.geometry?.type));if(0===o.length)return;const a=`grid-${i}-${r}-${n}-${o.map((e=>e.key)).join(",")}`;if(a===x)return;if(x=a,"clearsky"===i){for(const e of o){if(!e.field.properties?.cloudless_activated)continue;const t=e.zone?.crop_zone_id??null,o=`${Number(e.field.id)}-${r}-${n}-${i}-${t??""}`;sV.has(o)||gj({fieldsToFetch:[e.field],selectedDate:r,metric:n,source:i,cache:sV,onProgress:()=>{},onCacheUpdate:()=>{cV()},overrideScopeUuid:t})}return}const s=new Set,l=[];for(const e of o){const t=Number(e.field.id);if(s.has(t))continue;s.add(t);const o=`${t}-${r}-${n}-${i}-`;sV.has(o)||l.push(e.field)}0!==l.length&&gj({fieldsToFetch:l,selectedDate:r,metric:n,source:i,cache:sV,onProgress:()=>{},onCacheUpdate:()=>{cV()}})}));const w=Dl((()=>{lV.value;const e=new Map,t=Bw.selectedVegetationDate,r=Bw.vegetationIndexType,n=Bw.imagerySource;if(!t||!Bw.showVegetationIndexLayer)return e;for(const i of yu(y)){const o=Number(i.field.id),a=i.zone?.crop_zone_id??null,s="clearsky"===n?`${o}-${t}-${r}-${n}-${a??""}`:`${o}-${t}-${r}-${n}-`,l=sV.get(s);l&&e.set(i.key,l)}return e}));let S=$l(Jl(new Map)),k="";Tc((()=>{if(!t.isVisible)return;const e=Bw.showVegetationIndexLayer,r=Bw.selectedVegetationDate,n=Bw.vegetationIndexType;if(!e||!r)return ql(S,new Map,!0),void(k="");const i=Bw.vegetationImages.find((e=>e.date===r));if(!i?.stac_href)return;const o=XB(n.toUpperCase());if(!o)return;const a=yu(y).filter((e=>"Polygon"===e.field.geometry?.type||"MultiPolygon"===e.field.geometry?.type));if(0===a.length)return;const s=a.map((e=>e.key)).join(","),l=`stats-${r}-${n}-${s}`;if(l!==k){k=l,ql(S,new Map,!0);for(const e of a){const t=e.zone?.boundary?{type:"Feature",geometry:e.zone.boundary,properties:{}}:e.field;ej(i.stac_href,t,o.expression).then((t=>{k===l&&t&&null!=t.min&&null!=t.max&&null!=t.mean&&ql(S,new Map(yu(S)).set(e.key,{min:t.min,max:t.max,mean:t.mean}),!0)})).catch((()=>{}))}}})),Tc((()=>{t.isVisible&&yu(l)&&Bw.showVegetationIndexLayer&&Bw.vegetationIndexType&&"clearsky"===Bw.imagerySource&&(Bw.showChangeRaster,Bw.selectedVegetationDate,Bw.fieldTimelineStart,Bw.fieldTimelineEnd,yu(l).loadSatelliteMeans())}));const T=Dl((()=>{ZP.value;const e=new Map;if(!Bw.showChangeRaster||!Bw.showVegetationIndexLayer)return e;const t=Bw.vegetationIndexType;if(!t)return e;const r=Bw.fieldTimelineStart||void 0,n=Bw.fieldTimelineEnd||void 0;if(!r||!n)return e;for(const i of yu(y)){const o=i.field.properties;if(!o||!0!==o.cloudless_activated||"string"!=typeof o.farm_field_id){e.set(i.key,null);continue}const a=QP(i.zone?.crop_zone_id??o.farm_field_id,t,r,n);a?.first&&a?.last?e.set(i.key,a.last.mean-a.first.mean):e.set(i.key,null)}return e}));_h((()=>{for(const e of yu(n))e.remove()}));var I=LY();let M;var E=uc(I),P=uc(E),A=uc(P);uc(A).__click=function(...e){t.onSwitchToMap?.apply(this,e)},Ds(2),Os(A);var C=hc(A,2);aV(C,{inline:!0,get farmFieldsGeojson(){return t.farmFieldsGeojson},get isAdmin(){return r()},onMonthChange:(e,r)=>EV(e,r,t.farmFieldsGeojson),onETMonthChange:(e,r)=>dk(e,r,t.farmFieldsGeojson)});var R=hc(C,2),L=e=>{{let t=Dl((()=>yu(h).toUpperCase()));!function(e,t){Zs(t,!0);const r=Dl((()=>
31{if(!t.colorScale)return"";const e=[];for(let r=0;r<=10;r++){const n=r/10,i=t.min+n*(t.max-t.min),o=t.colorScale(i);e.push(`${o} ${100*n}%`)}return`linear-gradient(to right, ${e.join(", ")})`}));var n=AY(),i=uc(n),o=uc(i,!0);Os(i);var a=hc(i,2),s=uc(a,!0);Os(a);var l=hc(a,2),c=hc(l,2),u=uc(c,!0);Os(c),Os(n),Pc(((e,n)=>{Ju(o,t.label),Ju(s,e),kd(l,`background: ${yu(r)??""};`),Ju(u,n)}),[()=>t.min.toFixed(1),()=>t.max.toFixed(1)]),Yu(e,n),Ys()}(e,{get colorScale(){return yu(p)},get min(){return yu(f).min},get max(){return yu(f).max},get label(){return yu(t)}})}};ad(R,(e=>{yu(d)&&"rgb"!==yu(h)&&e(L)})),Os(P);var O=hc(P,2),D=e=>{var t=CY(),r=uc(t);r.__click=_,nB(uc(r),{class:"w-4 h-4 text-gray-600"}),Os(r);var n=hc(r,2),i=uc(n);Os(n);var o=hc(n,2);o.__click=v,sB(uc(o),{class:"w-4 h-4 text-gray-600"}),Os(o),Os(t),Pc((()=>{r.disabled=0===yu(m),Ju(i,`Page ${yu(m)+1} of ${yu(g)??""}`),o.disabled=yu(m)>=yu(g)-1})),Yu(e,t)};ad(O,(e=>{yu(g)>1&&e(D)})),Os(E);var z=hc(E,2);Il(z,21,(()=>({length:4})),Tl,((e,r,a)=>{const s=Dl((()=>yu(y)[a]??null));var l=RY(),c=uc(l);let u;nh(uc(c),((e,t)=>o[t]=e),(e=>o?.[e]),(()=>[a])),Os(c);var d=hc(c,2);{let e=Dl((()=>yu(s)?.field??null)),r=Dl((()=>yu(s)?.zone??null)),o=Dl((()=>yu(n)[a]??null)),l=Dl((()=>yu(i)[a]??!1)),c=Dl((()=>yu(s)?yu(w).get(yu(s).key)??null:null)),u=Dl((()=>yu(s)?yu(S).get(yu(s).key)??null:null)),h=Dl((()=>yu(s)?yu(T).get(yu(s).key)??null:null));!function(e,t){Zs(t,!0);let r=fh(t,"zone",3,null),n=fh(t,"satChange",3,null);const i=Dl((()=>Bw.showChangeRaster)),o=wY(),a=Dl((()=>t.field?.properties?.name??"")),s=Dl((()=>t.field?Number(t.field.id):null)),l=Dl((()=>{const e=yu(a)||"",t=(r()?.name??"").trim();return t&&t!==e?`${e}: ${t}`:e})),c=Dl((()=>r()?.boundary?fS({type:"Feature",geometry:r().boundary,properties:{}}):t.field?fS(t.field):0)),u=Dl((()=>Bw.showVegetationIndexLayer)),d=Dl((()=>Bw.vegetationIndexType)),h=Dl((()=>Bw.selectedVegetationDate)),f=Dl((()=>"clearsky"===Bw.imagerySource&&Bw.showVegetationIndexLayer&&!t.field?.properties?.cloudless_activated));let p=null;function g(){if(yu(s))return yu(f)?(Bw.upgradePreselectedFieldId=yu(s),Bw.upgradeTier="clearsky",void(Bw.upgradeModalOpen=!0)):void t.onClick(yu(s))}Tc((()=>{if(!t.map||!t.mapLoaded||!t.field)return;const e=`${Number(t.field.id)}|${r()?.crop_zone_id??""}`;if(e===p)return;p=e,o.reset(),t.map.resize();const n={type:"FeatureCollection",features:[r()?.boundary?{type:"Feature",geometry:r().boundary,properties:{}}:t.field]},i=t.map.getSource("grid-field-polygon");i?i.setData(n):(t.map.addSource("grid-field-polygon",{type:"geojson",data:n}),t.map.addLayer({id:"grid-field-fill",type:"fill",source:"grid-field-polygon",paint:{"fill-color":"#eab308","fill-opacity":.08}}),t.map.addLayer({id:"grid-field-outline",type:"line",source:"grid-field-polygon",paint:{"line-color":"#eab308","line-width":2}}));const a=mS(n);a&&t.map.fitBounds(a,{padding:20,maxZoom:17,animate:!1})})),Tc((()=>{if(!t.map||!t.mapLoaded)return;const e=new Map;yu(s)&&t.vegetationRaster&&e.set(yu(s),t.vegetationRaster),o.update(t.map,e,yu(u),yu(d),yu(h)??"",(()=>{}))})),Tc((()=>{if(!t.map||!t.mapLoaded)return;if(!t.map.getLayer("grid-field-fill")||!t.map.getLayer("grid-field-outline"))return;const e=yu(f)?"#6b7280":"#eab308",r=yu(f)?.45:.08,n=yu(f)?"#6b7280":"#eab308";t.map.setPaintProperty("grid-field-fill","fill-color",e),t.map.setPaintProperty("grid-field-fill","fill-opacity",r),t.map.setPaintProperty("grid-field-outline","line-color",n)}));var m=Zu(),y=dc(m),_=e=>{var r=EY();r.__click=g;var o=uc(r),a=uc(o),s=uc(a),d=uc(s,!0);Os(s);var f=hc(s,2),p=e=>{var t=SY(),r=uc(t);Os(t),Pc((e=>Ju(r,`${e??""} ha`)),[()=>yu(c).toFixed(1)]),Yu(e,t)};ad(f,(e=>{yu(c)>0&&e(p)})),Os(a),Os(o);var m=hc(o,2),y=e=>{var t=IY(),r=uc(t),i=hc(uc(r),2),o=e=>{var t=kY();let r;var i=uc(t);Os(t),Pc((e=>{r=wd(t,1,"text-xs font-bold tabular-nums",null,r,{"text-green-600":n()>=0,"text-red-600":n()<0}),Ju(i,`${n()>=0?"+":""}${e??""}`)}),[()=>n().toFixed(2)]),Yu(e,t)},a=e=>{Yu(e,TY())};ad(i,(e=>{null!=n()?e(o):e(a,!1)})),Os(r),Os(t),Yu(e,t)},_=e=>{var r=Zu(),n=dc(r),i=e=>{var r=MY(),n=uc(r),i=hc(uc(n),2),o=uc(i,!0);Os(i),Os(n);var a=hc(n,2),s=hc(uc(a),2),l=uc(s,!0);Os(s),Os(a);var c=hc(a,2),u=hc(uc(c),2),d=uc(u,!0);Os(u),Os(c),Os(r),Pc(((e,t,r)=>
31{Ju(o,e),Ju(l,t),Ju(d,r)}),[()=>t.fieldStatistics.min.toFixed(2),()=>t.fieldStatistics.mean.toFixed(2),()=>t.fieldStatistics.max.toFixed(2)]),Yu(e,r)};ad(n,(e=>{yu(u)&&yu(h)&&t.fieldStatistics&&null!=t.fieldStatistics.min&&null!=t.fieldStatistics.mean&&null!=t.fieldStatistics.max&&e(i)}),!0),Yu(e,r)};ad(m,(e=>{yu(u)&&yu(h)&&yu(i)?e(y):e(_,!1)})),Os(r),Pc((()=>Ju(d,yu(l)))),Yu(e,r)},v=e=>{Yu(e,PY())};ad(y,(e=>{t.field?e(_):e(v,!1)})),Yu(e,m),Ys()}(d,{get field(){return yu(e)},get zone(){return yu(r)},get map(){return yu(o)},get mapLoaded(){return yu(l)},get vegetationRaster(){return yu(c)},get fieldStatistics(){return yu(u)},get satChange(){return yu(h)},get onClick(){return t.onFieldClick}})}Os(l),Pc((()=>u=wd(c,1,"absolute inset-0 rounded-lg overflow-hidden",null,u,{invisible:!yu(s)}))),Yu(e,l)})),Os(z),Os(I),Pc((()=>M=wd(I,1,"absolute inset-0 flex flex-col bg-gray-50",null,M,{hidden:!t.isVisible}))),Yu(e,I),Ys()}Bu(["click"]);var DY=i(5915),zY=i.n(DY),FY=$u('<span class="text-[9px] font-semibold text-gray-700 uppercase tracking-wide mb-0.5"> </span>'),NY=$u('<div class="absolute pointer-events-none bg-gray-500"></div> <div class="absolute pointer-events-none bg-gray-500"></div> <div class="absolute pointer-events-none bg-gray-700 rounded-full"></div> <div class="absolute pointer-events-none bg-gray-500"></div>',1),BY=$u('<div class="absolute left-full ml-1 flex items-center gap-1 pointer-events-none transition-all duration-75 ease-out z-10"><div class="w-0 h-0 border-t-4 border-b-4 border-r-4 border-transparent border-r-gray-800"></div> <span class="bg-white text-gray-900 text-xs font-semibold font-mono px-1.5 py-0.5 rounded border border-gray-200 shadow-sm whitespace-nowrap"> </span></div>'),jY=$u('<span class="text-[9px] text-gray-500"> </span>'),VY=$u('<div class="absolute top-1/2 left-2.5 -translate-y-1/2 z-[1000] bg-white/95 backdrop-blur-sm p-2 rounded-lg shadow-md border border-gray-200"><div class="flex flex-col items-center gap-1"><!> <span class="text-[10px] font-medium text-gray-600"> </span> <div class="relative"><div class="w-4 h-48 rounded border border-gray-300"></div> <!> <!></div> <span class="text-[10px] font-medium text-gray-600"> </span> <!></div></div>');var GY="inactive-crop-zones-src",UY="inactive-crop-zones-layer",$Y="inactive-crop-zones-outline",HY="active-crop-zone-src",qY="active-crop-zone-outline-glow",WY="active-crop-zone-outline";function ZY(e){YY(e),e.getLayer($Y)&&e.removeLayer($Y),e.getLayer(UY)&&e.removeLayer(UY),e.getSource(GY)&&e.removeSource(GY)}function YY(e){e.getLayer(WY)&&e.removeLayer(WY),e.getLayer(qY)&&e.removeLayer(qY),e.getSource(HY)&&e.removeSource(HY)}function XY(e,t,r){var n=e.getSource(t);n?n.setData(r):e.addSource(t,{type:"geojson",data:r})}function KY(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=QY(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function JY(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||QY(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function QY(e,t){if(e){if("string"==typeof e)return eX(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eX(e,t):void 0}}function eX(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var tX=[[0,239,243,255],[.25,189,215,231],[.5,107,174,214],[.75,49,130,189],[1,8,81,156]];function rX(e){for(var t=Math.max(0,Math.min(1,e)),r=tX[0],n=tX[tX.length-1],i=0;i<tX.length-1;i++)if(t>=tX[i][0]&&t<=tX[i+1][0]){r=tX[i],n=tX[i+1];break}var o=n[0]-r[0],a=0===o?0:(t-r[0])/o;return[Math.round(r[1]+a*(n[1]-r[1])),Math.round(r[2]+a*(n[2]-r[2])),Math.round(r[3]+a*(n[3]-r[3]))]}function nX(e){var t,r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=KY(e[0]);try{for(a.s();!(t=a.n()).done;){var s=t.value;s[0]<r&&(r=s[0]),s[0]>i&&(i=s[0]),s[1]<n&&(n=s[1]),s[1]>o&&(o=s[1])}}catch(e){a.e(e)}finally{a.f()}return[r,n,i,o]}function iX(){var e=null,t=null,r=new Set,n=new Set,i=null,o=null;return{reset:function(){e=null,t=null},getHoverData:function(){return t},update:function a(s,l,c,u,d){var h,f,p,g=(null==l||null===(h=l.features)||void 0===h?void 0:h.length)||0;if(!s.isStyleLoaded()&&c&&g>0){var m=!1,y=function(){m||(m=!0,a(s,l,c,u,d))};return s.once("style.load",y),void s.once("idle",y)}var _=(null==l||null===(f=l.features)||void 0===f?void 0:f.length)||0,v=c&&_>0?"".concat(_,"-").concat(null===(p=l.features[0])||void 0===p||null===(p=p.properties)||void 0===p||null===(p=p.aggregated)||void 0===p?void 0:p.value):"none",b=r.size>0||n.size>0;if(v!==e||b){e=v;var x,w=KY(r);try{for(w.s();!(x=w.n()).done;){var S=x.value;s.getLayer(S)&&s.removeLayer(S)}}catch(e){w.e(e)}finally{w.f()}var k,T=KY(n);try{for(T.s();!(k=T.n()).done;){var I=k.value;s.getSource(I)&&s.removeSource(I)}}catch(e){T.e(e)}finally{T.f()}r.clear(),n.clear();try{s.getLayer("et-fill")&&s.removeLayer("et-fill"),s.getLayer("et-outline")&&s.removeLayer("et-outline"),s.getSource("et-data")&&s.removeSource("et-data")}catch(e){}if(!c||0===_)return t=null,d(null),void(u&&u(null));var M,E=l.features,P=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,C=KY(E);try{for(C.s();!(M=C.n()).done;){var R,L=M.value,O=Number((null===(R=L.properties)||void 0===R||null===(R=R.aggregated)||void 0===R?void 0:R.value)||0);O<P&&(P=O),O>A&&(A=O)}}catch(e){C.e(e)}finally{C.f()}var D=function(e,t,r){if(0===e.length)return null;var n,i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=[],c=KY(e);try{for(c.s();!(n=c.n()).done;){var u,d=n.value,h=Number((null===(u=d.properties)||void 0===u||null===(u=u.aggregated)||void 0===u?void 0:u.value)||0),f=d.geometry,p=nX("MultiPolygon"===f.type?f.coordinates[0]:f.coordinates);l.push({bbox:p,value:h}),p[0]<i&&(i=p[0]),p[1]<o&&(o=p[1]),p[2]>a&&(a=p[2]),p[3]>s&&(s=p[3])}}catch(e){c.e(e)}finally{c.f()}var g=a-i,m=s-o;if(g<=0||m<=0)return null;for(var y=Math.max(l[0].bbox[2]-l[0].bbox[0],1e-4),_=Math.max(l[0].bbox[3]-l[0].bbox[1],1e-4),v=32*Math.max(1,Math.round(g/y)),b=32*Math.max(1,Math.round(m/_)),x=new ImageData(v,b),w=x.data,S=new Float32Array(v*b).fill(Number.NaN),k=0,T=l;k<T.length;k++)for(var I=T[k],M=JY(rX(r===t?.5:(I.value-t)/(r-t)),3),E=M[0],P=M[1],A=M[2],C=Math.round((I.bbox[0]-i)/g*v),R=Math.round((I.bbox[2]-i)/g*v),L=Math.round((s-I.bbox[3])/m*b),O=Math.round((s-I.bbox[1])/m*b),D=Math.max(0,Math.min(C,R)),z=Math.min(v,Math.max(C,R)),F=Math.max(0,Math.min(L,O)),N=Math.min(b,Math.max(L,O)),B=F;B<N;B++)for(var j=D;j<z;j++){var V=4*(B*v+j);w[V]=E,w[V+1]=P,w[V+2]=A,w[V+3]=255,S[B*v+j]=I.value}return{imageData:x,bounds:[i,o,a,s],width:v,height:b,rawData:S}}(E,P,A);if(!D)return t=null,d(null),void(u&&u(null));var z=D.imageData,F=D.bounds,N=D.width,B=D.height,j=D.rawData;if(t={bounds:F,width:N,height:B,rawData:j},i||(i=document.createElement("canvas"),o=i.getContext("2d")),o){i.width=N,i.height=B,o.putImageData(z,0,0);var V=i.toDataURL("image/png"),G="et-raster-source",U="et-raster-layer";n.add(G),s.addSource(G,{type:"image",url:V,coordinates:[[F[0],F[3]],[F[2],F[3]],[F[2],F[1]],[F[0],F[1]]]}),r.add(U),s.addLayer({id:U,type:"raster",source:G,paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}});var $={colorScale:function(e){return function(e,t,r){var n=JY(rX(r===t?.5:(e-t)/(r-t)),3),i=n[0],o=n[1],a=n[2];return"rgb(".concat(i,",").concat(o,",").concat(a,")")}(e,P,A)},min:P,max:A,show:!0};d($),u&&u($)}else console.error("[etLayer] Failed to create canvas context")}}}}function oX(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return aX(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?aX(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
31}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function aX(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var sX="";function lX(e){var t,r,n,i,o,a=Bw.selectedFieldId,s=Bw.showVegetationIndexLayer,l=Bw.selectedVegetationDate,c=Bw.vegetationIndexType;if("rgb"===c)return Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1,void(sX="");if(!a||!s||!l)return Bw.showETLayer||(Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1),void(sX="");var u=null==e||null===(t=e.features)||void 0===t?void 0:t.find((function(e){return Number(e.id)===a}));if(null==u||!u.geometry)return Bw.fieldStatistics=null,void(Bw.fieldStatisticsLoading=!1);var d="clearsky"===Bw.imagerySource,h=Bw.selectedCropZoneId,f=null===(r=u.properties)||void 0===r?void 0:r.crop_zones,p=null==f||null===(n=f[0])||void 0===n?void 0:n.crop_zone_id,g=null!==(i=null!=h?h:p)&&void 0!==i?i:null===(o=u.properties)||void 0===o?void 0:o.farm_field_id,m="".concat(a,"-").concat(l,"-").concat(c,"-").concat(Bw.imagerySource,"-").concat(null!=g?g:"");if(m!==sX)if(sX=m,Bw.fieldStatisticsLoading=!0,Bw.fieldStatistics=null,d){if(!g)return Bw.fieldStatistics=null,void(Bw.fieldStatisticsLoading=!1);(function(e,t,r){return LP.apply(this,arguments)})(g,l,c).then((function(e){sX===m&&(e&&Number.isFinite(e.min)&&Number.isFinite(e.max)&&Number.isFinite(e.mean)?Bw.fieldStatistics=e:Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1)})).catch((function(e){console.error("[fieldStatistics] ClearSky statistics fetch failed:",e),sX===m&&(Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1)}))}else{var y=Bw.vegetationImages.find((function(e){return e.date===l}));if(null==y||!y.stac_href)return Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1,void(sX="");var _=XB(c.toUpperCase());if(!_)return Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1,void(sX="");var v={type:"Feature",properties:{},geometry:AB(u,h)};ej(y.stac_href,v,_.expression).then((function(e){if(sX===m){var t;if(e&&Number.isFinite(e.min)&&Number.isFinite(e.max)&&Number.isFinite(e.mean))Bw.fieldStatistics={min:e.min,max:e.max,mean:e.mean,std:null!==(t=e.std)&&void 0!==t?t:0};else Bw.fieldStatistics=null;Bw.fieldStatisticsLoading=!1}})).catch((function(e){console.error("[fieldStatistics] Vegetation statistics fetch failed:",e),sX===m&&(Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1)}))}}var cX=null;function uX(){cX&&(cX.remove(),cX=null)}function dX(e,t){uX();var r=gS(t);if(r){var n=Number(t.id),i=(cX=new(uS().Popup)({closeButton:!1,closeOnClick:!1,className:"et-gated-popup",anchor:"center",offset:0}).setLngLat(r).setHTML('\n      <div style="text-align: center; cursor: pointer; padding: 4px 8px;" class="et-gated-popup-content" data-field-id="'.concat(n,'">\n        <div style="font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px;">ET requires</div>\n        <div style="font-size: 14px; font-weight: 600; color: #2563eb;">Upgrade to Pro</div>\n      </div>\n    ')).addTo(e)).getElement();i&&(i.style.cursor="pointer",i.addEventListener("click",(function(){Bw.upgradePreselectedFieldId=n,Bw.upgradeTier="pro",Bw.upgradeModalOpen=!0})))}}function hX(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=pX(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function fX(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}
31finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||pX(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pX(e,t){if(e){if("string"==typeof e)return gX(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gX(e,t):void 0}}function gX(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var mX=["pivots-fill","pivots-outline","hose-reels-outline","hose-reel-starts-fill","drip-boundaries-fill","drip-boundaries-outline"];function yX(){var e=null;return{reset:function(){e=null},update:function(t,r,n,i,o){var a,s,l,c,u,d,h=null!==(a=null==r||null===(s=r.features)||void 0===s?void 0:s.filter((function(e){var t;return"pivot"===(null===(t=e.properties)||void 0===t?void 0:t.type)})).length)&&void 0!==a?a:0,f=null!==(l=null==n||null===(c=n.features)||void 0===c?void 0:c.length)&&void 0!==l?l:0,p=null!==(u=null==i||null===(d=i.features)||void 0===d?void 0:d.length)&&void 0!==u?u:0,g="".concat(h,"-").concat(f,"-").concat(p,"-").concat(o);if(g!==e){var m=!!e&&e.endsWith("-true"),y=e&&g.replace(/-(?:true|false)$/,"")===e.replace(/-(?:true|false)$/,"");e=g,y&&m!==o&&function(e,t){var r,n=!1,i=t?"visible":"none",o=hX(mX);try{for(o.s();!(r=o.n()).done;){var a=r.value;e.getLayer(a)&&(e.setLayoutProperty(a,"visibility",i),n=!0)}}catch(e){o.e(e)}finally{o.f()}return n}(t,o)||function(e,t,r,n,i){var o,a,s;if(["pivots","hose-reels","hose-reel-starts","drip-boundaries"].forEach((function(t){e.getLayer("".concat(t,"-fill"))&&e.removeLayer("".concat(t,"-fill")),e.getLayer("".concat(t,"-outline"))&&e.removeLayer("".concat(t,"-outline")),e.getSource(t)&&e.removeSource(t)})),i){if(null!=t&&null!==(o=t.features)&&void 0!==o&&o.length){var l=t.features.filter((function(e){var t;return"pivot"===(null===(t=e.properties)||void 0===t?void 0:t.type)})).map((function(e){for(var t=fX(e.geometry.coordinates,2),r=t[0],n=t[1],i=e.properties.radius||400,o=[],a=0;a<=64;a++){var s=a/64*2*Math.PI,l=i*Math.cos(s),c=i*Math.sin(s),u=l/(111320*Math.cos(n*Math.PI/180)),d=c/110540;o.push([r+u,n+d])}return{type:"Feature",properties:e.properties,geometry:{type:"Polygon",coordinates:[o]}}}));l.length&&(e.addSource("pivots",{type:"geojson",data:{type:"FeatureCollection",features:l}}),e.addLayer({id:"pivots-fill",type:"fill",source:"pivots",paint:{"fill-color":aW.FILL,"fill-opacity":.1}}),e.addLayer({id:"pivots-outline",type:"line",source:"pivots",paint:{"line-color":aW.STROKE,"line-width":2}}))}if(null!=r&&null!==(a=r.features)&&void 0!==a&&a.length){e.addSource("hose-reels",{type:"geojson",data:r}),e.addLayer({id:"hose-reels-outline",type:"line",source:"hose-reels",paint:{"line-color":sW.STROKE,"line-width":3,"line-opacity":.9}});var c=r.features.filter((function(e){var t,r;return"LineString"===(null===(t=e.geometry)||void 0===t?void 0:t.type)&&(null===(r=e.geometry.coordinates)||void 0===r?void 0:r.length)})).map((function(e){return{type:"Feature",properties:e.properties,geometry:{type:"Point",coordinates:e.geometry.coordinates[0]}}}));c.length&&(e.addSource("hose-reel-starts",{type:"geojson",data:{type:"FeatureCollection",features:c}}),e.addLayer({id:"hose-reel-starts-fill",type:"circle",source:"hose-reel-starts",paint:{"circle-radius":6,"circle-color":sW.STROKE,"circle-opacity":.9,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}))}null!=n&&null!==(s=n.features)&&void 0!==s&&s.length&&(e.addSource("drip-boundaries",{type:"geojson",data:n}),e.addLayer({id:"drip-boundaries-fill",type:"fill",source:"drip-boundaries",paint:{"fill-color":"#ffffff","fill-opacity":.05}}),e.addLayer({id:"drip-boundaries-outline",type:"line",source:"drip-boundaries",paint:{"line-color":"#ffffff","line-width":3,"line-opacity":.8,"line-dasharray":[2,2]}}))}}(t,r,n,i,o)}}}}function _X(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return vX(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vX(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
31}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vX(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var bX=["farm-fields-fill","farm-fields-border","farm-fields-gated-overlay","vri-fill","vri-outline","rd-vri-fill","rd-vri-outline","vegetation-raster-*","et-raster-layer","pivots-fill","pivots-outline","hose-reels-outline","farm-fields-outline","drip-boundaries-fill","drip-boundaries-outline"];[].concat(["pivots-fill","pivots-outline","hose-reels-outline","drip-boundaries-fill","drip-boundaries-outline"],["farm-fields-outline"]);function xX(e,t){var r={fields:"farm-fields-fill",vri:"vri-fill",raindancerVri:"rd-vri-fill",vegetation:"vegetation-raster-*",et:"et-raster-layer",equipment:"pivots-fill"}[t],n=bX.indexOf(r);if(-1!==n)for(var i,o=function(){var t=bX[a];if(t.endsWith("*")){var r,n=t.slice(0,-1),i=((null===(r=e.getStyle())||void 0===r?void 0:r.layers)||[]).find((function(e){return e.id.startsWith(n)}));if(i)return{v:i.id}}else if(e.getLayer(t))return{v:t}},a=n+1;a<bX.length;a++)if(i=o())return i.v}var wX=["vri-fill","vri-outline","rd-vri-fill","rd-vri-outline"];function SX(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return kX(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kX(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function kX(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function TX(){var e=null,t={farmFieldsClickHandler:null,gatedOverlayClickHandler:null,farmFieldsMouseEnterHandler:null,farmFieldsMouseLeaveHandler:null};return{reset:function(){e=null},update:function(r,n){var i,o,a,s,l,c=null!==(i=null===(o=n.farmFieldsGeojson)||void 0===o||null===(o=o.features)||void 0===o?void 0:o.length)&&void 0!==i?i:0,u=0,d=SX(null!==(a=null===(s=n.farmFieldsGeojson)||void 0===s?void 0:s.features)&&void 0!==a?a:[]);try{for(d.s();!(l=d.n()).done;){var h,f=null===(h=l.value.properties)||void 0===h?void 0:h.crop_zones;Array.isArray(f)&&(u+=f.length)}}catch(e){d.e(e)}finally{d.f()}var p="".concat(c,"-").concat(u,"-").concat(n.showET,"-").concat(!!n.showCloudlessGate);p!==e&&(e=p,function(e,t,r){var n,i=t.farmFieldsGeojson,o=t.showET,a=t.showCloudlessGate,s=void 0!==a&&a,l=t.interactive,c=t.onFieldClick;r.farmFieldsClickHandler&&e.getLayer("farm-fields-fill")&&(e.off("click","farm-fields-fill",r.farmFieldsClickHandler),r.farmFieldsClickHandler=null),r.gatedOverlayClickHandler&&e.getLayer("farm-fields-gated-overlay")&&(e.off("click","farm-fields-gated-overlay",r.gatedOverlayClickHandler),r.gatedOverlayClickHandler=null),r.farmFieldsMouseEnterHandler&&e.getLayer("farm-fields-fill")&&(e.off("mouseenter","farm-fields-fill",r.farmFieldsMouseEnterHandler),r.farmFieldsMouseEnterHandler=null),r.farmFieldsMouseLeaveHandler&&e.getLayer("farm-fields-fill")&&(e.off("mouseleave","farm-fields-fill",r.farmFieldsMouseLeaveHandler),r.farmFieldsMouseLeaveHandler=null),e.getLayer("farm-fields-gated-overlay")&&e.removeLayer("farm-fields-gated-overlay"),e.getLayer("farm-fields-fill")&&e.removeLayer("farm-fields-fill"),e.getLayer("farm-fields-border")&&e.removeLayer("farm-fields-border"),e.getLayer("farm-fields-outline")&&e.removeLayer("farm-fields-outline"),e.getSource("farm-fields")&&e.removeSource("farm-fields"),e.getSource("farm-fields-crop-zones")&&e.removeSource("farm-fields-crop-zones"),e.addSource("farm-fields",{type:"geojson",data:i});var u,d=[],h=SX(null!==(n=i.features)&&void 0!==n?n:[]);try{for(h.s();!(u=h.n()).done;){var f,p,g,m=SX(null!==(f=null===(p=u.value.properties)||void 0===p?void 0:p.crop_zones)&&void 0!==f?f:[]);try{for(m.s();!(g=m.n()).done;){var y,_=g.value;_.boundary&&d.push({type:"Feature",geometry:_.boundary,properties:{crop_zone_id:null!==(y=_.crop_zone_id)&&void 0!==y?y:null}})}}catch(e){m.e(e)}finally{m.f()}}}catch(e){h.e(e)}finally{h.f()}e.addSource("farm-fields-crop-zones",{type:"geojson",data:{type:"FeatureCollection",features:d}});var v=xX(e,"fields");
31e.addLayer({id:"farm-fields-fill",type:"fill",source:"farm-fields",paint:{"fill-color":"#4b5563","fill-opacity":.35}},v),e.addLayer({id:"farm-fields-border",type:"line",source:"farm-fields",paint:{"line-color":"#4b5563","line-width":4}},v),e.addLayer({id:"farm-fields-outline",type:"line",source:"farm-fields-crop-zones",paint:{"line-color":"#eab308","line-width":3}});var b=null,x=null;if(o?(b="pro",x=["!=",["get","pro_activated"],!0]):s&&(b="clearsky",x=["!=",["get","cloudless_activated"],!0]),b&&x){var w=b;e.addLayer({id:"farm-fields-gated-overlay",type:"fill",source:"farm-fields",filter:x,paint:{"fill-color":"#6b7280","fill-opacity":.45}}),r.gatedOverlayClickHandler=function(e){var t;if(null!==(t=e.features)&&void 0!==t&&t[0]){var r=Number(e.features[0].id);Bw.upgradePreselectedFieldId=r,Bw.upgradeTier=w,Bw.upgradeModalOpen=!0}},e.on("click","farm-fields-gated-overlay",r.gatedOverlayClickHandler)}c&&l&&(r.farmFieldsClickHandler=function(e){var t;if(null!==(t=e.features)&&void 0!==t&&t[0]){var r=Number(e.features[0].id),n=e.features[0].properties,i=null==n?void 0:n.pro_activated,a=null==n?void 0:n.cloudless_activated;if(o&&!i)return Bw.upgradePreselectedFieldId=r,Bw.upgradeTier="pro",void(Bw.upgradeModalOpen=!0);if(s&&!a)return Bw.upgradePreselectedFieldId=r,Bw.upgradeTier="clearsky",void(Bw.upgradeModalOpen=!0);c(r)}},e.on("click","farm-fields-fill",r.farmFieldsClickHandler),r.farmFieldsMouseEnterHandler=function(){e.getCanvas().style.cursor="pointer"},r.farmFieldsMouseLeaveHandler=function(){e.getCanvas().style.cursor=""},e.on("mouseenter","farm-fields-fill",r.farmFieldsMouseEnterHandler),e.on("mouseleave","farm-fields-fill",r.farmFieldsMouseLeaveHandler))}(r,n,t))}}}function IX(e){return IX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},IX(e)}function MX(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function EX(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?MX(Object(r),!0).forEach((function(t){PX(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MX(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function PX(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=IX(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=IX(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==IX(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var AX="rd-vri-data",CX="rd-vri-fill",RX="rd-vri-outline";function LX(e,t){var r;if(function(e){e.getLayer(CX)&&e.removeLayer(CX);e.getLayer(RX)&&e.removeLayer(RX);e.getSource(AX)&&e.removeSource(AX)}(e),null!=t&&null!==(r=t.features)&&void 0!==r&&r.length){var n=xX(e,"raindancerVri"),i=t.features.map((function(e){var t,r;return EX(EX({},e),{},{properties:EX(EX({},e.properties),{},{_fillColor:cW(null!==(t=null===(r=e.properties)||void 0===r?void 0:r.percentage)&&void 0!==t?t:100)})})}));e.addSource(AX,{type:"geojson",data:{type:"FeatureCollection",features:i}}),e.addLayer({id:CX,type:"fill",source:AX,paint:{"fill-color":["get","_fillColor"],"fill-opacity":.75}},n),e.addLayer({id:RX,type:"line",source:AX,paint:{"line-color":"rgba(0, 0, 0, 0.4)","line-width":1}},n)}}function OX(e){return OX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OX(e)}function DX(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zX(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
31t%2?DX(Object(r),!0).forEach((function(t){FX(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DX(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function FX(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=OX(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=OX(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==OX(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var NX=null;var BX=!1;function jX(e){BX||(BX=!0,e.on("mouseenter","vri-fill",(function(){e.getCanvas().style.cursor="pointer"})),e.on("mouseleave","vri-fill",(function(){e.getCanvas().style.cursor="",NX&&(NX.remove(),NX=null)})),e.on("mousemove","vri-fill",(function(t){var r;if(null!==(r=t.features)&&void 0!==r&&r.length){var n=t.features[0].properties||{};NX&&NX.remove(),NX=new(uS().Popup)({closeButton:!1,closeOnClick:!1,className:"vri-zone-tooltip",anchor:"bottom",offset:8}).setLngLat(t.lngLat).setHTML(function(e){var t=e.relative_irrigation_percentage,r=e.plan_name||e.zone_name||e.name||"",n=e.zone_id,i=[];return r&&i.push('<div style="font-weight:600;font-size:11px;color:#111">'.concat(r,"</div>")),null!=n&&i.push('<div style="font-size:10px;color:#666">Zone '.concat(n,"</div>")),null!=t&&i.push('<div style="font-size:12px;font-weight:700;color:#2563eb">'.concat(Math.round(t),"%</div>")),'<div style="line-height:1.3;text-align:center">'.concat(i.join(""),"</div>")}(n)).addTo(e)}})))}function VX(){var e=null;return{reset:function(){e=null},update:function(t,r){var n,i=null!=r&&null!==(n=r.features)&&void 0!==n&&n.length?JSON.stringify(r.features.map((function(e){var t,r;return[null===(t=e.properties)||void 0===t?void 0:t.id,null===(r=e.properties)||void 0===r?void 0:r.relative_irrigation_percentage]}))):"none";i!==e&&(e=i,function(e,t){var r;if(e.getLayer("vri-fill")&&e.removeLayer("vri-fill"),e.getLayer("vri-outline")&&e.removeLayer("vri-outline"),e.getSource("vri-data")&&e.removeSource("vri-data"),NX&&(NX.remove(),NX=null),BX=!1,null!=t&&null!==(r=t.features)&&void 0!==r&&r.length){var n=xX(e,"vri"),i=t.features.map((function(e){var t;return zX(zX({},e),{},{properties:zX(zX({},e.properties),{},{_fillColor:cW((null===(t=e.properties)||void 0===t?void 0:t.relative_irrigation_percentage)||100)})})}));e.addSource("vri-data",{type:"geojson",data:{type:"FeatureCollection",features:i}}),e.addLayer({id:"vri-fill",type:"fill",source:"vri-data",paint:{"fill-color":["get","_fillColor"],"fill-opacity":1}},n),e.addLayer({id:"vri-outline",type:"line",source:"vri-data",paint:{"line-color":"rgba(0, 0, 0, 0.3)","line-width":.5}},n),jX(e)}}(t,r))}}}function GX(){var e,t=iX(),r=wY(),n=VX(),i=(e=null,{reset:function(){e=null},update:function(t,r){var n,i,o,a,s=null!==(n=null==r||null===(i=r.features)||void 0===i?void 0:i.length)&&void 0!==n?n:0,l=s>0&&null!==(o=null==r||null===(a=r.features[0])||void 0===a||null===(a=a.properties)||void 0===a?void 0:a.id)&&void 0!==o?o:"",c=s>0?"".concat(s,"-").concat(l):"none";c!==e&&(e=c,LX(t,r))}}),o=yX(),a=TX(),s=!1;function l(e){!function(e,t){if(t){var r,n=_X(["pivots-fill","pivots-outline"]);try{for(n.s();!(r=n.n()).done;){var i=r.value;e.getLayer(i)&&e.moveLayer(i)}}catch(e){n.e(e)}finally{n.f()}}var o,a=_X(wX);try{for(a.s();!(o=a.n()).done;){var s=o.value;e.getLayer(s)&&e.moveLayer(s)}}catch(e){a.e(e)}finally{a.f()}if(t&&e.getLayer("hose-reels-outline")&&e.moveLayer("hose-reels-outline"),e.getLayer("farm-fields-outline")&&e.moveLayer("farm-fields-outline"),t){var l,c=_X(["drip-boundaries-fill","drip-boundaries-outline"]);try{for(c.s();!(l=c.n()).done;){var u=l.value;e.getLayer(u)&&e.moveLayer(u)}}catch(e){c.e(e)}finally{c.f()}}}(e,s)}function c(){t.reset(),r.reset(),n.reset(),i.reset(),o.reset(),a.reset()}return{updateFields:function(e,t){a.update(e,t),l(e)},updateEquipment:function(e,t){s=t.visible,o.update(e,t.equipmentGeojson,t.hoseReelRoutesGeojson,t.dripBoundariesGeojson,t.visible),l(e)},updateET:function(e,n){t.update(e,n.evapotranspirationData,n.visible,void 0,n.onLegendUpdate),n.visible&&r.update(e,void 0,!1,"","",(function(){})),l(e)},updateVegetation:function(e,n){r.update(e,n.vegetationRasters,n.visible,n.vegetationIndexType,n.selectedVegetationDate,
31n.onLegendUpdate),n.visible&&t.update(e,null,!1,void 0,(function(){})),l(e)},updateVRI:function(e,t){n.update(e,t.vriData),l(e)},updateRaindancerVRI:function(e,t){i.update(e,t.data),l(e)},handleStyleChange:function(e,s){c(),a.update(e,s.fields),n.update(e,s.vri.vriData),i.update(e,s.raindancerVri.data),r.update(e,s.vegetation.vegetationRasters,s.vegetation.visible,s.vegetation.vegetationIndexType,s.vegetation.selectedVegetationDate,s.vegetation.onLegendUpdate),t.update(e,s.et.evapotranspirationData,s.et.visible,void 0,s.et.onLegendUpdate),o.update(e,s.equipment.equipmentGeojson,s.equipment.hoseReelRoutesGeojson,s.equipment.dripBoundariesGeojson,s.equipment.visible),l(e)},resetAll:c,getETHoverData:function(){return t.getHoverData()},get equipmentVisible(){return s},set equipmentVisible(e){s=e}}}var UX=null;function $X(e){var t=e.getBounds(),r=e.getCenter();Bw.mapZoom=e.getZoom(),Bw.mapCenter={lng:r.lng,lat:r.lat},Bw.mapBounds={west:t.getWest(),south:t.getSouth(),east:t.getEast(),north:t.getNorth()}}var HX=$u('<div class="w-full h-full relative basemap-container svelte-1200lwp"><div class="w-full h-full"></div> <!> <!></div>');function qX(e,t){Zs(t,!0);let r,n=fh(t,"interactive",3,!0),i=fh(t,"showZoomControls",3,!0),o=fh(t,"initialCenter",3,lB),a=fh(t,"initialZoom",3,12),s=fh(t,"maxZoom",3,22),l=fh(t,"minZoom",3,0),c=fh(t,"autoFitBounds",3,!0),u=fh(t,"isLoadingData",3,!1),d=fh(t,"etGridLoading",3,!1),h=fh(t,"vegetationRastersLoading",3,!1),f=fh(t,"showLegend",3,!0),p=fh(t,"showLayerControls",3,!1),g=fh(t,"activeView",3,null),m=fh(t,"showSearchBar",3,!1),y=fh(t,"lockMinZoomToFitBounds",3,!1),_=fh(t,"isAdmin",3,!1),v=$l(null),b=$l(!1),x=!1,w=null,S=null,k=null;const T=GX();let I=$l(null),M=$l(null);function E(e){ql(I,e,!0)}function P(e){ql(M,e,!0)}const A=Dl((()=>{if(Bw.showChangeRaster&&Bw.changeRasterData){const e=fV(Bw.changeRasterMode,Bw.vegetationIndexType);return{colorScale:t=>{const[r,n,i]=pV(t,e);return`rgb(${r},${n},${i})`},min:e.min,max:e.max,show:!0}}const e=yu(I)??yu(M);return e||{colorScale:null,min:0,max:0,show:!1}})),C=Dl((()=>{if(Bw.showChangeRaster&&Bw.changeRasterData){const e=Bw.changeRasterData.rawData;let t=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,n=0,i=0;for(let o=0;o<e.length;o++){const a=e[o];!Number.isNaN(a)&&Number.isFinite(a)&&(a<t&&(t=a),a>r&&(r=a),n+=a,i++)}return i>0?{min:t,max:r,mean:n/i,std:0}:null}return Bw.fieldStatistics}));Tc((()=>{Bw.legendColorScale=yu(A).show&&yu(A).colorScale?yu(A).colorScale:null}));let R=$l(null),L=$l(null);const O=Dl((()=>void 0!==t.forceShowET?t.forceShowET:Bw.showETLayer)),D=Dl((()=>Bw.showVegetationIndexLayer)),z=Dl((()=>void 0!==t.forceShowEquipment?t.forceShowEquipment:Bw.showIrrigationEquipment)),F=Dl((()=>"clearsky"===Bw.imagerySource&&yu(D)));function N(){yu(v)&&y()&&yu(v).setMinZoom(l())}function B(){if(!yu(v)||!y())return;const e=Math.min(yu(v).getZoom(),s()-.01);yu(v).setMinZoom(e)}function j(){if(!yu(v)||!yu(b))return;let e=null;t.fitBoundsTarget?e=mS({type:"FeatureCollection",features:[t.fitBoundsTarget]}):t.farmFieldsGeojson&&(e=mS(t.farmFieldsGeojson)),e&&(N(),yu(v).fitBounds(e,{padding:40,maxZoom:17,animate:!1}),x=!0,t.fitBoundsTarget?.id&&(w=Number(t.fitBoundsTarget.id)),B())}yh((()=>{if(!r)return;uS().accessToken=t.mapboxPublicToken;let e=o(),u=a(),d=null;if(c()&&t.farmFieldsGeojson?.features?.length&&(d=mS(t.farmFieldsGeojson),d)){const t=d.getCenter();e=[t.lng,t.lat],u=14}ql(v,new(uS().Map)({container:r,style:"satellite"===Bw.activeBaseLayer?"mapbox://styles/mapbox/satellite-streets-v12":"mapbox://styles/mapbox/streets-v12",center:e,zoom:u,maxZoom:s(),minZoom:l(),interactive:n(),attributionControl:!1}),!0),d&&yu(v).fitBounds(d,{padding:40,maxZoom:17,animate:!1}),i()&&n()&&(S=new(uS().NavigationControl)({showCompass:!1}),yu(v).addControl(S,"top-right")),yu(v).addControl(new(uS().AttributionControl)({compact:!0}),"bottom-right"),yu(v).on("load",(()=>{ql(b,!0),t.farmFieldsGeojson&&T.updateFields(yu(v),{farmFieldsGeojson:t.farmFieldsGeojson,showET:yu(O),showCloudlessGate:yu(F),interactive:n(),onFieldClick:t.onFieldClick}),T.updateEquipment(yu(v),{equipmentGeojson:t.equipmentGeojson,hoseReelRoutesGeojson:t.hoseReelRoutesGeojson,dripBoundariesGeojson:t.dripBoundariesGeojson,visible:yu(z)}),T.updateET(yu(v),{evapotranspirationData:t.evapotranspirationData,visible:yu(O),onLegendUpdate:E}),T.updateVRI(yu(v),{vriData:t.vriData}),c()&&j(),t.onMapReady&&yu(v)&&t.onMapReady(yu(v))})),yu(v).on("mousemove",(e=>{const r={lng:e.lngLat.lng,lat:e.lngLat.lat};if(yu(O)?ql(L,function(e,t){if(!e)return null;
31var r=e.bounds,n=e.width,i=e.height,o=e.rawData,a=JY(r,4),s=a[0],l=a[1],c=a[2],u=a[3],d=t.lng,h=t.lat;if(d<s||d>c||h<l||h>u)return null;var f=(d-s)/(c-s),p=(u-h)/(u-l),g=Math.floor(f*n),m=Math.floor(p*i);g=Math.max(0,Math.min(n-1,g));var y=o[(m=Math.max(0,Math.min(i-1,m)))*n+g];return Number.isNaN(y)?null:y}(T.getETHoverData(),r),!0):ql(L,null),yu(D)&&"rgb"!==Bw.vegetationIndexType&&t.vegetationRasters&&t.vegetationRasters.size>0){for(const[e,n]of t.vegetationRasters){const e=CB(n,r);if(null!==e)return void ql(R,e,!0)}ql(R,null)}else ql(R,null)})),yu(v).on("mouseleave",(()=>{ql(R,null),ql(L,null)})),function(e){var t=function(){UX&&clearTimeout(UX),UX=setTimeout((function(){e&&$X(e)}),300)};e.on("moveend",t)}(yu(v)),$X(yu(v))})),Tc((()=>{yu(v)&&(m()&&n()?k||(k=new(zY())({accessToken:t.mapboxPublicToken,mapboxgl:uS(),marker:!1,placeholder:"Search for a location...",collapsed:!0,flyTo:{speed:1.5,zoom:14}}),yu(v).addControl(k,"top-left")):k&&(yu(v).removeControl(k),k=null))})),Tc((()=>{if(!yu(v)||!yu(b)||!t.farmFieldsGeojson)return void uX();const e=yu(O),r=Bw.selectedFieldId;if(!e)return void uX();if(r){const e=t.farmFieldsGeojson.features?.find((e=>Number(e.id)===r));return void(e&&!e.properties?.pro_activated?dX(yu(v),e):uX())}const n=t.farmFieldsGeojson.features?.filter((e=>!e.properties?.pro_activated))||[];n.length>0?dX(yu(v),n[0]):uX()})),_h((()=>{uX(),removeStatsLoadingPopup(),yu(v)&&(yu(v).remove(),ql(v,null))}));let V=Bw.activeBaseLayer;Tc((()=>{if(!yu(v)||!yu(b))return;const e=Bw.activeBaseLayer;if(e===V)return;V=e;const r="satellite"===e?"mapbox://styles/mapbox/satellite-streets-v12":"mapbox://styles/mapbox/streets-v12";yu(v).setStyle(r);const i=setTimeout((()=>{console.error("[BaseMap] Style load timed out after 10s — layers may be missing")}),1e4);yu(v).once("style.load",(()=>{clearTimeout(i),T.handleStyleChange(yu(v),{fields:{farmFieldsGeojson:t.farmFieldsGeojson,showET:yu(O),showCloudlessGate:yu(F),interactive:n(),onFieldClick:t.onFieldClick},equipment:{equipmentGeojson:t.equipmentGeojson,hoseReelRoutesGeojson:t.hoseReelRoutesGeojson,dripBoundariesGeojson:t.dripBoundariesGeojson,visible:yu(z)},et:{evapotranspirationData:t.evapotranspirationData,visible:yu(O),onLegendUpdate:E},vegetation:{vegetationRasters:t.vegetationRasters,visible:yu(D),vegetationIndexType:Bw.vegetationIndexType,selectedVegetationDate:Bw.selectedVegetationDate??"",onLegendUpdate:P},vri:{vriData:t.vriData},raindancerVri:{data:t.raindancerVRIData}})}))})),Tc((()=>{if(!yu(v)||!yu(b))return;yu(z);T.updateEquipment(yu(v),{equipmentGeojson:t.equipmentGeojson,hoseReelRoutesGeojson:t.hoseReelRoutesGeojson,dripBoundariesGeojson:t.dripBoundariesGeojson,visible:yu(z)})})),Tc((()=>{if(!yu(v)||!yu(b)||!t.farmFieldsGeojson)return;Bw.layerToggleVersion,yu(O),t.evapotranspirationData,yu(F);T.updateET(yu(v),{evapotranspirationData:t.evapotranspirationData,visible:yu(O),onLegendUpdate:E}),T.updateFields(yu(v),{farmFieldsGeojson:t.farmFieldsGeojson,showET:yu(O),showCloudlessGate:yu(F),interactive:n(),onFieldClick:t.onFieldClick})})),Tc((()=>{if(!yu(v)||!yu(b))return;Bw.layerToggleVersion,yu(D),t.vegetationRasters,Bw.vegetationIndexType,Bw.selectedVegetationDate;T.updateVegetation(yu(v),{vegetationRasters:t.vegetationRasters,visible:yu(D),vegetationIndexType:Bw.vegetationIndexType,selectedVegetationDate:Bw.selectedVegetationDate??"",onLegendUpdate:P})})),Tc((()=>{Bw.selectedFieldId,Bw.selectedCropZoneId,Bw.showVegetationIndexLayer,Bw.selectedVegetationDate,Bw.vegetationIndexType,Bw.imagerySource;lX(t.farmFieldsGeojson)})),Tc((()=>{Bw.showETLayer,t.evapotranspirationData;!function(e){var t=Bw.showETLayer,r=null==e?void 0:e.features;if(t&&r&&0!==r.length){var n,i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=0,s=0,l=oX(r);try{for(l.s();!(n=l.n()).done;){var c,u=n.value,d=Number(null===(c=u.properties)||void 0===c||null===(c=c.aggregated)||void 0===c?void 0:c.value);Number.isNaN(d)||(d<i&&(i=d),d>o&&(o=d),a+=d,s++)}}catch(e){l.e(e)}finally{l.f()}if(s>0){var h,f=a/s,p=0,g=oX(r);try{for(g.s();!(h=g.n()).done;){var m,y=h.value,_=Number(null===(m=y.properties)||void 0===m||null===(m=m.aggregated)||void 0===m?void 0:m.value);Number.isNaN(_)||(p+=Math.pow(_-f,2))}}catch(e){g.e(e)}finally{g.f()}Bw.fieldStatistics={min:i,max:o,mean:f,std:Math.sqrt(p/s)}}else Bw.fieldStatistics=null;Bw.fieldStatisticsLoading=!1}else Bw.showVegetationIndexLayer||(Bw.fieldStatistics=null,Bw.fieldStatisticsLoading=!1)}(t.evapotranspirationData)})),Tc((()=>
31{if(!yu(v)||!yu(b))return;t.vriData;T.updateVRI(yu(v),{vriData:t.vriData})})),Tc((()=>{if(!yu(v)||!yu(b))return;t.raindancerVRIData;T.updateRaindancerVRI(yu(v),{data:t.raindancerVRIData})})),Tc((()=>{if(!yu(v)||!yu(b))return;const e=Bw.selectedFieldId,r=Bw.selectedCropZoneId;if(!e||!t.farmFieldsGeojson)return void ZY(yu(v));const n=t.farmFieldsGeojson.features?.find((t=>Number(t.id)===e));n&&"Polygon"===n.geometry?.type?function(e,t,r){var n,i,o,a;if(t){var s=null!==(n=null===(i=t.properties)||void 0===i?void 0:i.crop_zones)&&void 0!==n?n:[],l=r?s.find((function(e){return e.crop_zone_id===r})):s[0],c=null!==(o=null==l?void 0:l.crop_zone_id)&&void 0!==o?o:null,u=s.filter((function(e){return e.boundary&&e.crop_zone_id!==c})).map((function(e){return{type:"Feature",geometry:e.boundary,properties:{}}}));XY(e,GY,{type:"FeatureCollection",features:u}),e.getLayer(UY)||e.addLayer({id:UY,type:"fill",source:GY,paint:{"fill-color":"#4b5563","fill-opacity":.55}}),e.getLayer($Y)||e.addLayer({id:$Y,type:"line",source:GY,paint:{"line-color":"#9ca3af","line-width":2}});var d=null!==(a=null==l?void 0:l.boundary)&&void 0!==a?a:null;d?(XY(e,HY,{type:"FeatureCollection",features:[{type:"Feature",geometry:d,properties:{}}]}),e.getLayer(qY)||e.addLayer({id:qY,type:"line",source:HY,paint:{"line-color":"#fbbf24","line-width":6,"line-opacity":.3}}),e.getLayer(WY)||e.addLayer({id:WY,type:"line",source:HY,paint:{"line-color":"#eab308","line-width":3}})):YY(e)}else ZY(e)}(yu(v),n,r??null):ZY(yu(v))})),Tc((()=>{if(yu(b)&&t.fitBoundsTarget&&c()){const e=t.fitBoundsTarget.id?Number(t.fitBoundsTarget.id):null,r=!x,n=e&&e!==w&&Bw.selectedFieldId===e;(r||n)&&j()}})),Tc((()=>{if(!yu(v)||!yu(b))return;yu(v).getMinZoom()>=s()&&yu(v).setMinZoom(Math.max(0,s()-.01)),yu(v).setMaxZoom(s()),y()||yu(v).setMinZoom(l())}));let G=null;Tc((()=>{yu(v)&&yu(b)&&G!==n()&&(G=n(),n()?(yu(v).scrollZoom.enable(),yu(v).dragPan.enable(),yu(v).doubleClickZoom.enable(),yu(v).touchZoomRotate.enable(),i()&&!S&&(S=new(uS().NavigationControl)({showCompass:!1}),yu(v).addControl(S,"top-right"))):(yu(v).scrollZoom.disable(),yu(v).dragPan.disable(),yu(v).doubleClickZoom.disable(),yu(v).touchZoomRotate.disable(),S&&(yu(v).removeControl(S),S=null)))}));const U="field-loading-overlay",$="field-loading-overlay-src";let H=null;function q(){yu(v)&&(yu(v).getLayer(U)&&yu(v).removeLayer(U),yu(v).getSource($)&&yu(v).removeSource($),H&&(H.remove(),H=null))}Tc((()=>{if(!yu(v)||!yu(b))return;const e=Bw.selectedFieldId,r=Bw.fieldStatisticsLoading,n=Bw.showChangeRaster&&Bw.changeRasterLoading,i=u()||d()||h()||n;if(!(i||r)||!e||!t.farmFieldsGeojson)return void q();const o=t.farmFieldsGeojson.features.find((t=>Number(t.id)===e));if(!o?.geometry)return void q();i?(yu(v).getSource($)?yu(v).getSource($).setData({type:"FeatureCollection",features:[o]}):yu(v).addSource($,{type:"geojson",data:{type:"FeatureCollection",features:[o]}}),yu(v).getLayer(U)||yu(v).addLayer({id:U,type:"fill",source:$,paint:{"fill-color":"#ffffff","fill-opacity":.55}})):(yu(v).getLayer(U)&&yu(v).removeLayer(U),yu(v).getSource($)&&yu(v).removeSource($));const a=`\n    <div style="display:flex;align-items:center;gap:8px;padding:6px 12px;">\n      <div style="width:16px;height:16px;border:2px solid #bfdbfe;border-top-color:#2563eb;border-radius:50%;animation:field-spin 0.8s linear infinite;flex-shrink:0;"></div>
31\n      <span style="font-size:12px;font-weight:500;color:#4b5563;white-space:nowrap;">${d()||u(),h(),"Loading…"}</span>\n    </div>\n  `;if(H)H.setHTML(a);else{const e=gS(o);e&&(H=new(uS().Popup)({closeButton:!1,closeOnClick:!1,className:"field-loading-popup",anchor:"center",offset:0}).setLngLat(e).setHTML(a).addTo(yu(v)))}return()=>{q()}}));var W={getMap:function(){return yu(v)},refitBounds:function(){if(!yu(v)||!yu(b))return;let e=null;t.fitBoundsTarget?e=mS({type:"FeatureCollection",features:[t.fitBoundsTarget]}):t.farmFieldsGeojson&&(e=mS(t.farmFieldsGeojson)),e&&(N(),yu(v).fitBounds(e,{padding:20,maxZoom:17,animate:!1}),B())}},Z=HX(),Y=uc(Z);nh(Y,(e=>r=e),(()=>r));var X=hc(Y,2),K=e=>{aV(e,{get onMonthChange(){return t.onSatelliteMonthChange},get onETMonthChange(){return t.onETMonthChange},get farmFieldsGeojson(){return t.farmFieldsGeojson},onActivated:()=>window.location.reload(),get activeView(){return g()},get onViewChange(){return t.onViewChange},get isAdmin(){return _()}})};ad(X,(e=>{p()&&!Bw.selectedFieldId&&e(K)}));var J=hc(X,2),Q=e=>{{let t=Dl((()=>yu(O)?yu(L):yu(R))),r=Dl((()=>yu(O)?"ET":Bw.vegetationIndexType.toUpperCase()));!function(e,t){Zs(t,!0);let r=fh(t,"hoverValue",3,null),n=fh(t,"unit",3,""),i=fh(t,"label",3,""),o=fh(t,"fieldStatistics",3,null);Dl((()=>!!o()));const a=Dl((()=>{if(!t.colorScale)return"";const e=[];for(let r=0;r<=10;r++){const n=r/10,i=t.max-n*(t.max-t.min),o=t.colorScale(i);e.push(`${o} ${100*n}%`)}return`linear-gradient(to bottom, ${e.join(", ")})`})),s=Dl((()=>{if(null===r()||void 0===r())return null;const e=t.max-t.min;if(0===e)return 50;const n=(r()-t.min)/e*100;return Math.max(0,Math.min(100,n))}));function l(e){const r=t.max-t.min;return 0===r?50:Math.max(0,Math.min(100,(e-t.min)/r*100))}var c=Zu(),u=dc(c),d=e=>{var c=VY(),u=uc(c),d=uc(u),h=e=>{var t=FY(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,i()))),Yu(e,t)};ad(d,(e=>{i()&&e(h)}));var f=hc(d,2),p=uc(f,!0);Os(f);var g=hc(f,2),m=uc(g),y=hc(m,2),_=e=>
31{var t=NY(),r=dc(t),n=hc(r,2),i=hc(n,2),a=hc(i,2);Pc(((e,t,o,s,l)=>{kd(r,`bottom: ${e??""}%; top: ${t??""}%; left: -5px; width: 1px;`),kd(n,`bottom: ${o??""}%; left: -8px; width: 7px; height: 1px; transform: translateY(0.5px);`),kd(i,`bottom: ${s??""}%; left: -9px; width: 9px; height: 3px; transform: translateY(1.5px);`),kd(a,`bottom: ${l??""}%; left: -8px; width: 7px; height: 1px; transform: translateY(0.5px);`)}),[()=>l(o().min),()=>100-l(o().max),()=>l(o().max),()=>l(o().mean),()=>l(o().min)]),Yu(e,t)};ad(y,(e=>{o()&&null!=o().min&&null!=o().max&&null!=o().mean&&e(_)}));var v=hc(y,2),b=e=>{var t=BY(),n=hc(uc(t),2),i=uc(n,!0);Os(n),Os(t),Pc((e=>{kd(t,`bottom: ${yu(s)??""}%; transform: translateY(50%);`),Ju(i,e)}),[()=>r()?.toFixed(2)]),Yu(e,t)};ad(v,(e=>{null!==yu(s)&&e(b)})),Os(g);var x=hc(g,2),w=uc(x,!0);Os(x);var S=hc(x,2),k=e=>{var t=jY(),r=uc(t,!0);Os(t),Pc((()=>Ju(r,n()))),Yu(e,t)};ad(S,(e=>{n()&&e(k)})),Os(u),Os(c),Pc(((e,t)=>{Ju(p,e),kd(m,`background: ${yu(a)??""};`),Ju(w,t)}),[()=>t.max.toFixed(1),()=>t.min.toFixed(1)]),Yu(e,c)};ad(u,(e=>{t.show&&t.colorScale&&e(d)})),Yu(e,c),Ys()}(e,{get map(){return yu(v)},get colorScale(){return yu(A).colorScale},get min(){return yu(A).min},get max(){return yu(A).max},get show(){return yu(A).show},get hoverValue(){return yu(t)},get label(){return yu(r)},get fieldStatistics(){return yu(C)}})}};return ad(J,(e=>{f()&&yu(A).show&&yu(A).colorScale&&yu(v)&&e(Q)})),Os(Z),Yu(e,Z),Ys(W)}var WX=$u('<div class="w-full h-full"><!></div>');function ZX(e,t){Zs(t,!0);let r,n=fh(t,"isCompactMode",3,!1),i=fh(t,"isAddFieldMode",3,!1),o=fh(t,"isLoadingData",3,!1),a=fh(t,"showLayerControls",3,!1),s=fh(t,"activeView",3,null),l=fh(t,"isAdmin",3,!1),c=$l(null),u=$l(!1),d=$l(!1),h=$l(Jl({loaded:0,total:0}));const f=Dl((()=>{const e=lV.value,t=new Map,r=Bw.selectedVegetationDate,n=Bw.vegetationIndexType,i=Bw.imagerySource,o=Bw.selectedFieldId;if(!r||!Bw.showVegetationIndexLayer)return t;if(o){const e=lj({fieldId:o,date:r,metric:n,source:i,zoneUuid:Bw.selectedCropZoneId}),a=sV.get(e);return a&&t.set(o,a),t}const a=`-${r}-${n}-${i}-`;for(const[e,r]of sV){const n=e.indexOf(a);if(n<0)continue;const i=Number(e.slice(0,n));if(Number.isNaN(i))continue;""===e.slice(n+a.length)&&t.set(i,r)}return console.debug(`[MapView] Derived rasters: ${t.size} fields for ${r} (${i}, cache v${e})`),t})),p=Dl((()=>{if(Bw.showChangeRaster){if(Bw.changeRasterData&&Bw.selectedFieldId){const e=new Map;return e.set(Bw.selectedFieldId,Bw.changeRasterData),e}return new Map}return yu(f)}));let g="",m="",y="",_="",v="",b="";Tc((()=>{const e=Bw.selectedFieldId,r=Bw.showETLayer;if(!e||!r)return Bw.etAvailableDates=[],Bw.etFetchedMonths.clear(),Bw.selectedETDate=null,v="",b="",ql(c,null),void(g="");const n=t.farmFieldsGeojson?.features?.find((t=>Number(t.id)===e));if(!n?.geometry||!n.properties?.pro_activated)return;const i=`et-field-${e}`;if(i===b)return;b=i,Bw.etAvailableDates=[],Bw.etFetchedMonths.clear(),Bw.selectedETDate=null,nk(n.geometry);const o=new Date;ck(n.geometry,o.getFullYear(),o.getMonth()+1);const a=0===o.getMonth()?12:o.getMonth(),s=0===o.getMonth()?o.getFullYear()-1:o.getFullYear();ck(n.geometry,s,a)})),Tc((()=>{const e=Bw.selectedFieldId,r=Bw.showETLayer,n=Bw.selectedETDate;if(!e||!r||!n)return ql(c,null),void(g="");const i=t.farmFieldsGeojson?.features?.find((t=>Number(t.id)===e));if(!i?.geometry||!i.properties?.pro_activated)return ql(c,null),void(g="");const o=`${e}-${n}`;o!==g&&(g=o,ql(u,!0),function(e,t,r){return lk.apply(this,arguments)}(i.geometry,n,n).then((e=>{g===o&&(ql(c,e,!0),ql(u,!1))})).catch((e=>{console.error("[MapView] ET data fetch failed:",e),g===o&&(ql(c,null),ql(u,!1))})))})),Tc((()=>{const e=Bw.showVegetationIndexLayer,r=Bw.mapCenter,n=(Bw.mapZoom,Bw.selectedFieldId),i=Bw.imagerySource;if(!e)return void(m="");
31if("standard"!==i)return void(m="");const o=t.farmFieldsGeojson?.features?.filter((e=>"Polygon"===e.geometry?.type||"MultiPolygon"===e.geometry?.type))||[];if(0===o.length)return void(Bw.vegetationImages=[]);let a=null;n&&(a=o.find((e=>Number(e.id)===n))||null),!a&&r&&(a=sj(o,r)),a||(a=o[0]);const s=Number(a?.id),l=`ref-${s}-${i}`;if(l===m){if(!Bw.selectedVegetationDate&&Bw.vegetationImages.length>0){const e=[...Bw.vegetationImages].map((e=>e.date)).sort(((e,t)=>t.localeCompare(e))),t=Bw.crossLayerReferenceDate,r=t?e.find((e=>e<=t))??e[0]:e[0];console.debug(`[MapView] Dedup hit — re-picking date from cached images: ${r}`),Bw.selectedVegetationDate=r}return}m=l,Bw.satelliteReferenceFieldName=a?.properties?.name||"",Bw.vegetationSearchLoading=!0,Bw.vegetationFetchedMonths.clear();const c=Bw.vegetationIndexType.toUpperCase();console.debug(`[MapView] Searching for ${c} images using reference field ${s}`),function(e){return pj.apply(this,arguments)}({polygonFields:o,mapCenter:r,findClosestField:sj}).then((e=>{if(console.debug(`[MapView] Found ${e.images.length} satellite images`),m===l){Bw.vegetationImages=e.images,Bw.vegetationSearchLoading=!1,Bw.vegetationLoadedFromDate=e.startDateStr;for(const t of e.searchMonths)Bw.vegetationFetchedMonths.add(t);if(!Bw.selectedVegetationDate)if(Bw.crossLayerReferenceDate&&e.images.length>0){const t=[...e.images].map((e=>e.date)).sort(((e,t)=>t.localeCompare(e))),r=t.find((e=>e<=Bw.crossLayerReferenceDate))??t[0];console.debug(`[MapView] Cross-layer date ${Bw.crossLayerReferenceDate} → closest image: ${r}`),Bw.selectedVegetationDate=r}else e.autoSelectedDate&&(console.debug(`[MapView] Auto-selected image: ${e.autoSelectedDate}`),Bw.selectedVegetationDate=e.autoSelectedDate)}})).catch((e=>{console.error("[MapView] Image search failed:",e),m===l&&(Bw.vegetationImages=[],Bw.vegetationSearchLoading=!1)}))})),Tc((()=>{const e=Bw.showVegetationIndexLayer,r=Bw.selectedVegetationDate,n=Bw.vegetationIndexType,i=Bw.imagerySource,o=Bw.mapZoom,a=Bw.selectedFieldId,s=Bw.selectedCropZoneId;if(!a)return void(_="");if(!e||!r)return void(_="");if(o<11)return void console.info(`[MapView] Skipping ${i} fetch: zoom ${o.toFixed(1)} < 11 (zoom in further to load satellite imagery)`);const l=(t.farmFieldsGeojson?.features?.filter((e=>"Polygon"===e.geometry?.type||"MultiPolygon"===e.geometry?.type))||[]).find((e=>Number(e.id)===a));if(!l)return void console.info(`[MapView] Skipping ${i} fetch: selected field ${a} has no polygon geometry`);const c=lj({fieldId:a,date:r,metric:n,source:i,zoneUuid:s});if(c===_)return;if(_=c,sV.has(c))return ql(h,{loaded:1,total:1},!0),ql(d,!1),void cV();const u=n.toUpperCase(),f="clearsky"===i?"ClearSky":"Standard";console.info(`[MapView] Fetching ${u} raster (${f}) for field ${a} (date: ${r})`),ql(d,!0),ql(h,{loaded:0,total:1},!0),function(e){return yj.apply(this,arguments)}({field:l,selectedDate:r,metric:n,source:i,zoneUuid:s,cache:sV,onCacheUpdate:()=>{cV()}}).then((e=>{_===c&&(ql(h,{loaded:1,total:1},!0),ql(d,!1),e.data||console.warn(`[MapView] ${f} single-field fetch produced no raster for field ${a} — check earlier rasterFetcher warnings/errors for details.`))}))})),Tc((()=>{const e=Bw.showVegetationIndexLayer,r=Bw.selectedVegetationDate,n=Bw.vegetationIndexType,i=Bw.imagerySource,o=Bw.mapZoom,a=Bw.mapBounds;if(Bw.selectedFieldId)return void(y="");if(!e||!r)return void(y="");if(o<11)return void console.info(`[MapView] Skipping ${i} fetch: zoom ${o.toFixed(1)} < 11 (zoom in further to load satellite imagery)`);const s=t.farmFieldsGeojson?.features?.filter((e=>"Polygon"===e.geometry?.type||"MultiPolygon"===e.geometry?.type))||[];if(0===s.length)return void console.info(`[MapView] Skipping ${i} fetch: no polygon fields available`);let l=s;a&&(l=s.filter((e=>function(e,t){if(!e.geometry)return!1;var r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=function(e){"number"==typeof e[0]?(r=Math.min(r,e[0]),n=Math.max(n,e[0]),i=Math.min(i,e[1]),o=Math.max(o,e[1])):e.forEach(a)};return a(e.geometry.coordinates),!(n<t.west||r>t.east||o<t.south||i>
31t.north)}(e,a))));const c=a?`${a.west.toFixed(3)}-${a.east.toFixed(3)}`:"all",u=`batch-${i}-${r}-${n}-${c}`;if(0===l.length)return void console.info(`[MapView] Skipping ${i} fetch: no fields in current viewport`);if(u===y)return;y=u;const f=l.filter((e=>{const t=`${Number(e.id)}-${r}-${n}-${i}-`;return!sV.has(t)&&!("clearsky"===i&&!e.properties?.cloudless_activated)}));if(0===f.length){const e="clearsky"===i?l.filter((e=>!e.properties?.cloudless_activated)).length:0;return void console.info(`[MapView] Skipping ${i} fetch: all ${l.length} fields cached or gated${e>0?` (${e} non-ClearSky fields filtered)`:""}`)}const p=n.toUpperCase(),g="clearsky"===i?"ClearSky":"Standard";console.info(`[MapView] Fetching ${p} rasters (${g}) for ${f.length}/${l.length} fields (date: ${r})`),ql(d,!0),ql(h,{loaded:0,total:f.length},!0),gj({fieldsToFetch:f,selectedDate:r,metric:n,source:i,cache:sV,overrideScopeUuid:null,onProgress:(e,t)=>{ql(h,{loaded:e,total:t},!0)},onCacheUpdate:()=>{cV()}}).then((e=>{y===u&&(console.info(`[MapView] ${g} batch complete: ${e.successCount}/${e.totalCount} fields loaded`),0===e.successCount&&e.totalCount>0&&console.warn(`[MapView] ${g} batch produced no rasters — check earlier rasterFetcher warnings/errors for the upstream API response.`),ql(d,!1))}))}));const x=Dl((()=>{if(!t.farmFieldsGeojson?.features?.length)return null;if(Bw.selectedFieldId){const e=t.farmFieldsGeojson.features.find((e=>Number(e.id)===Bw.selectedFieldId));if(e)return e}if(t.lastFieldIdBeforeVRI){const e=t.farmFieldsGeojson.features.find((e=>Number(e.id)===t.lastFieldIdBeforeVRI));if(e)return e}return t.farmFieldsGeojson.features[0]}));var w={triggerResize:function(){const e=r?.getMap();e&&(e.resize(),r?.refitBounds?.())},resizeOnly:function(){r?.getMap()?.resize()},getMap:function(){return r?.getMap()??null}},S=WX(),k=uc(S);{let e=Dl((()=>t.mapboxPublicToken||"")),h=Dl((()=>!Bw.upgradeModalOpen)),f=Dl((()=>n()&&!i()?13:0)),g=Dl((()=>n()&&!i())),m=Dl((()=>o()||yu(u)||yu(d)));nh(qX(k,{get mapboxPublicToken(){return yu(e)},get interactive(){return yu(h)},showZoomControls:!0,get showLayerControls(){return a()},get activeView(){return s()},get onViewChange(){return t.onViewChange},get farmFieldsGeojson(){return t.farmFieldsGeojson},get equipmentGeojson(){return t.equipmentGeojson},get hoseReelRoutesGeojson(){return t.hoseReelRoutesGeojson},get dripBoundariesGeojson(){return t.dripBoundariesGeojson},get evapotranspirationData(){return yu(c)},get vriData(){return Bw.vriData},get raindancerVRIData(){return Bw.raindancerVRIData},get cropZonesData(){return t.cropZonesData},get fitBoundsTarget(){return yu(x)},autoFitBounds:!0,maxZoom:22,get minZoom(){return yu(f)},get lockMinZoomToFitBounds(){return yu(g)},get isLoadingData(){return yu(m)},get etGridLoading(){return yu(u)},get vegetationRastersLoading(){return yu(d)},showLegend:!0,onFieldClick:function(e){Bw.selectedFieldId=e;const r=t.farmFieldsGeojson?.features?.find((t=>Number(t.id)===e));r&&(Bw.selectedFieldName=r.properties?.name||`Field ${e}`)},get vegetationRasters(){return yu(p)},onSatelliteMonthChange:(e,r)=>EV(e,r,t.farmFieldsGeojson),onETMonthChange:(e,r)=>dk(e,r,t.farmFieldsGeojson),get showSearchBar(){return i()},get onMapReady(){return t.onMapReady},get isAdmin(){return l()}}),(e=>r=e),(()=>r))}return Os(S),Yu(e,S),Ys(w)}var YX=$u('<aside class="font-sans flex flex-col h-full border-r border-gray-200 transition-all duration-300 bg-white flex-shrink-0 shadow-xl z-10 w-80"><!></aside>'),XX=$u('<div class="absolute inset-0 bg-black/40 backdrop-blur-sm z-[1050]"></div>'),KX=$u('<div class="absolute top-4 left-80 right-0 flex justify-center z-[1005] pointer-events-none"><div class="bg-white/95 backdrop-blur-sm border border-gray-200 rounded-xl shadow-lg px-8 py-5 text-center"><p class="text-base font-medium text-gray-700">Select a field type in the sidebar to start drawing</p></div></div>'),JX=$u('<div class="absolute inset-0"><!></div>'),QX=$u('<div class="absolute inset-0 z-[1002] flex"><!></div>'),eK=$u('<div class="absolute inset-0 z-[1002] flex"><!></div>'),tK=$u('<div class="absolute inset-0 z-[1002] flex"><!></div>
31'),rK=$u('<div class="absolute inset-0 z-[1002] flex"><!></div>'),nK=$u('<div class="flex h-full w-full"><!>  <main class="flex flex-col flex-1 h-full bg-gray-50 relative overflow-hidden"><!>   <div><!></div>  <!> <!>  <!> <!> <!>  <!>  <!>  <!>  <!></main></div>');function iK(e,t){Zs(t,!0);let r=fh(t,"validCropTypes",19,(()=>[])),n=fh(t,"isAdmin",3,!1),i=$l(Jl(t.hoseReelRoutesGeojson)),o=$l(Jl(t.dripBoundariesGeojson)),a={type:"map"},s=null;const l=!t.farmFieldsGeojson?.features?.length;let c,u,d=$l(l),h=$l(Jl(l?{type:"add-field"}:{type:"map"})),f=$l("fullscreen"),p=$l(null),g=$l(null),m=$l(null),y=$l(null),_=$l(null),v=$l(null);const b=Dl((()=>!!t.farmFieldsGeojson?.features?.some((e=>!0===e?.properties?.cloudless_activated))));function x(e){"field-detail"!==yu(h).type&&(a=yu(h));const r="field-detail"!==yu(h).type||yu(h).fieldId!==e;ql(h,{type:"field-detail",fieldId:e},!0),r&&(Bw.selectedCropZoneId=function(e){const r=t.farmFieldsGeojson?.features?.find((t=>Number(t.id)===e)),n=r?.properties?.crop_zones??[];return n[0]?.crop_zone_id??null}(e)),Bw.selectedFieldId=e}function w(){ql(h,a,!0),Bw.selectedFieldName="",Bw.vriData=null,"clearsky"!==Bw.imagerySource||yu(b)||(Bw.imagerySource="standard",Bw.clearSkyDates=[],Bw.selectedVegetationDate=null)}function S(){const e=Bw.selectedFieldId;ql(h,e?{type:"field-detail",fieldId:e}:{type:"map"},!0)}function k(){const e=Bw.selectedFieldId;ql(h,e?{type:"field-detail",fieldId:e}:{type:"map"},!0)}function T(){const e=Bw.selectedFieldId;ql(h,e?{type:"field-detail",fieldId:e}:{type:"map"},!0)}function I(){ql(h,{type:"add-field"},!0),Bw.vriData=null}function M(){ql(h,{type:"map"},!0)}function E(e){const t=yu(i)??{type:"FeatureCollection",features:[]};ql(i,{...t,type:"FeatureCollection",features:[...t.features,e]},!0)}function P(e){yu(i)&&ql(i,{...yu(i),features:yu(i).features.filter((t=>t.id!==e&&t.properties?.id!==e))},!0)}function A(e){const t=yu(o)??{type:"FeatureCollection",features:[]};ql(o,{...t,type:"FeatureCollection",features:[...t.features,e]},!0)}function C(e){yu(o)&&ql(o,{...yu(o),features:yu(o).features.filter((t=>t.id!==e&&t.properties?.id!==e))},!0)}function R(){const e="fullscreen"!==yu(f),t="field-detail"===yu(h).type||"edit-field"===yu(h).type||"edit-machinery"===yu(h).type||"split-field"===yu(h).type||"add-field"===yu(h).type;if("map"===yu(h).type)ql(f,"fullscreen");else if("add-field"===yu(h).type&&yu(_)&&c){const e=yu(_).getBoundingClientRect(),t=c.getBoundingClientRect();ql(f,{top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height},!0)}else if("edit-machinery"===yu(h).type&&yu(m)&&c){const e=yu(m).getBoundingClientRect(),t=c.getBoundingClientRect();ql(f,{top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height},!0)}else if("split-field"===yu(h).type&&yu(y)&&c){const e=yu(y).getBoundingClientRect(),t=c.getBoundingClientRect();ql(f,{top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height},!0)}else if("edit-field"===yu(h).type&&yu(g)&&c){const e=yu(g).getBoundingClientRect(),t=c.getBoundingClientRect();ql(f,{top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height},!0)}else if("field-detail"===yu(h).type&&yu(p)&&c){const e=yu(p).getBoundingClientRect(),t=c.getBoundingClientRect();ql(f,{top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height},!0)}requestAnimationFrame((()=>{"add-field"===yu(h).type?u?.resizeOnly?.():t?u?.triggerResize?.():e&&u?.resizeOnly?.()}))}yh((async()=>{yu(b)&&(Bw.imagerySource="clearsky");try{const e=sessionStorage.getItem("karl_restore_field_id");if(e){sessionStorage.removeItem("karl_restore_field_id");const r=Number(e),n=t.farmFieldsGeojson?.features?.some((e=>Number(e.id)===r));n&&!Number.isNaN(r)&&x(r)}}catch{}}));const L=Dl((()=>{if("grid"===yu(h).type)return"position: absolute; inset: 0; visibility: hidden; pointer-events: none;";if("fullscreen"===yu(f))return"position: absolute; inset: 0;";const e="edit-field"===yu(h).type||"edit-machinery"===yu(h).type||"split-field"===yu(h).type||"add-field"===yu(h).type?1003:1001;return`position: absolute; top: ${yu(f).top}px; left: ${yu(f).left}px; width: ${yu(f).width}px; height: ${yu(f).height}px; z-index: ${e}; border-radius: 0.5rem; overflow: hidden;`}));Tc((()=>{const e=Bw.selectedFieldId;e&&"edit-field"!==yu(h).type&&"edit-machinery"!==yu(h).type&&"split-field"!==yu(h).type&&"add-field"!==yu(h).type&&"grid"!==yu(h).type&&("field-detail"===yu(h).type&&yu(h).fieldId===e||x(e))})),Tc((()=>{yu(h).type,yu(p),yu(g),yu(m),yu(y),yu(_);mu().then((()=>{R()}))})),yh((()=>{let e=null;return c&&(e=new ResizeObserver((()=>{R()})),e.observe(c)),()=>{e?.disconnect()}})),Tc((()=>{const e=[yu(p),yu(g),yu(m),yu(y),yu(_)],t=[];for(const r of e)if(r){const e=new ResizeObserver((()=>R()));e.observe(r),t.push((()=>e.disconnect()))}return()=>t.forEach((e=>e()))}));var O=nK(),D=uc(O),z=e=>{var r=YX();YA(uc(r),{get farmFieldsGeojson(){return t.farmFieldsGeojson},evapotranspirationData:s,get appMode(){return yu(h)},onAddField:I,get isAdmin(){return n()}}),Os(r),Yu(e,r)};ad(D,(e=>{"edit-field"!==yu(h).type&&"edit-machinery"!==yu(h).type&&"add-field"!==yu(h).type&&e(z)}));var F=hc(D,2),N=uc(F),B=e=>{Yu(e,XX())};ad(N,(e=>{Bw.upgradeModalOpen&&e(B)}));var j=hc(N,2),V=uc(j);{let e=Dl((()=>"edit-field"!==yu(h).type&&"edit-machinery"!==yu(h).type&&"add-field"!==yu(h).type&&"grid"!==yu(h).type)),r=Dl((()=>"map"===yu(h).type||"grid"===yu(h).type?yu(h).type:null)),a=Dl((()=>"field-detail"===yu(h).type||"edit-field"===yu(h).type||"edit-machinery"===yu(h).type||"split-field"===yu(h).type||"add-field"===yu(h).type)),l=Dl((()=>"add-field"===yu(h).type));nh(ZX(V,{get mapboxPublicToken(){return t.mapboxPublicToken},get farmFieldsGeojson(){return t.farmFieldsGeojson},evapotranspirationData:s,get equipmentGeojson(){return t.equipmentGeojson},get hoseReelRoutesGeojson(){return yu(i)},get dripBoundariesGeojson(){return yu(o)},lastFieldIdBeforeVRI:null,get showLayerControls(){return yu(e)},get activeView(){return yu(r)},onViewChange:e=>{"grid"===e?(ql(h,{type:"grid"},!0),Bw.selectedFieldId=null,Bw.selectedFieldName="",Bw.selectedCropZoneId=null,Bw.vriData=null):ql(h,{type:"map"},!0)},get isCompactMode(){return yu(a)},get isAddFieldMode(){return yu(l)},onMapReady:function(e){ql(v,e,!0)},get isAdmin(){return n()}}),(e=>u=e),(()=>u))}Os(j);var G=hc(j,2);{let e=Dl((()=>"grid"===yu(h).type));OY(G,{get isVisible(){return yu(e)},get farmFieldsGeojson(){return t.farmFieldsGeojson},get mapboxPublicToken(){return t.mapboxPublicToken},get isAdmin(){return n()},onFieldClick:e=>x(e),onSwitchToMap:()=>{ql(h,{type:"map"},!0)}})}var U=hc(G,2),$=e=>{Yu(e,KX())};
31ad(U,(e=>{"add-field"===yu(h).type&&Bw.addFieldNeedsTypeSelection&&e($)}));var H=hc(U,2),q=e=>{var a=JX(),l=uc(a);{let e=Dl((()=>r().map((e=>e.name))));rZ(l,{get farmFieldsGeojson(){return t.farmFieldsGeojson},evapotranspirationData:s,get tasksData(){return t.tasksData},onClose:w,onEditField:()=>{return e="fieldId"in yu(h)?yu(h).fieldId:0,ql(h,{type:"edit-field",fieldId:e},!0),Bw.selectedFieldId=e,void(Bw.vriData=null);var e},onEditMachinery:()=>{return e="fieldId"in yu(h)?yu(h).fieldId:0,ql(h,{type:"edit-machinery",fieldId:e},!0),Bw.selectedFieldId=e,void(Bw.vriData=null);var e},onSplitField:()=>{return e="fieldId"in yu(h)?yu(h).fieldId:0,ql(h,{type:"split-field",fieldId:e},!0),Bw.selectedFieldId=e,void(Bw.vriData=null);var e},onScroll:R,get pivotExtentsGeojson(){return t.pivotExtentsGeojson},get hoseReelRoutesGeojson(){return yu(i)},get dripBoundariesGeojson(){return yu(o)},get validCropTypes(){return yu(e)},get isAdmin(){return n()},get mapPlaceholderRef(){return yu(p)},set mapPlaceholderRef(e){ql(p,e,!0)}})}Os(a),Yu(e,a)};ad(H,(e=>{"field-detail"===yu(h).type&&e(q)}));var W=hc(H,2);!function(e,t){Zs(t,!0);let r=fh(t,"open",15),n=$l(!1),i=$l(null),o=$l(!1),a=$l(!1);const s=Dl((()=>Bw.upgradeTrialCode.trim().toUpperCase()===Rw)),l=Dl((()=>({pro:yu(s)?0:Lw.pro,clearsky:yu(s)?0:Lw.clearsky})));function c(e){Bw.upgradeTier=e;const r=Bw.upgradeSelectedFieldIds.filter((r=>{const n=t.farmFieldsGeojson?.features.find((e=>(e.properties?.id||e.id)===r));return!!n&&!h(n,e)}));Bw.upgradeSelectedFieldIds=r}function u(){Bw.upgradeFieldSelectionActive=!1,Bw.upgradeTier=null,Bw.upgradeTrialCode="",Bw.upgradeSelectedFieldIds=[],Bw.upgradePreselectedFieldId=null,ql(o,!1),ql(i,null),r(!1)}function d(e){try{return fS(e.geometry)}catch{return 0}}function h(e,t){return"pro"===t?!0===e.properties?.pro_activated:!0===e.properties?.cloudless_activated||!0===e.properties?.pro_activated}Tc((()=>{r()&&!yu(a)&&(ql(a,!0),Bw.upgradeFieldSelectionActive=!0,Bw.upgradeTier||(Bw.upgradeTier="pro"),Bw.upgradePreselectedFieldId?Bw.upgradeSelectedFieldIds=[Bw.upgradePreselectedFieldId]:Bw.selectedFieldId?Bw.upgradeSelectedFieldIds=[Bw.selectedFieldId]:Bw.upgradeSelectedFieldIds=[]),r()||ql(a,!1)}));let f=$l(!1);const p=Dl((()=>{if(!t.farmFieldsGeojson)return{total:0,free:0,clearsky:0,pro:0,proFields:[],clearskyFields:[],freeFields:[],totalCost:0};let e=0,r=0,n=0;const i=[],o=[],a=[];for(const s of t.farmFieldsGeojson.features){const t=s.properties?.id||s.id,c=s.properties?.name||`Field ${t}`,u=d(s);if(s.properties?.pro_activated){n++;const e=u*yu(l).pro;i.push({id:t,name:c,ha:u,cost:e})}else if(s.properties?.cloudless_activated){r++;const e=u*yu(l).clearsky;o.push({id:t,name:c,ha:u,cost:e})}else e++,a.push({id:t,name:c,ha:u})}const s=i.reduce(((e,t)=>e+t.cost),0)+o.reduce(((e,t)=>e+t.cost),0);return{total:t.farmFieldsGeojson.features.length,free:e,clearsky:r,pro:n,proFields:i,clearskyFields:o,freeFields:a,totalCost:s}})),g=Dl((()=>t.farmFieldsGeojson&&Bw.upgradeTier?t.farmFieldsGeojson.features.filter((e=>!h(e,Bw.upgradeTier))):[])),m=Dl((()=>{if(!Bw.upgradeTier||!t.farmFieldsGeojson)return{fields:0,hectares:0,price:0};let e=0;for(const r of Bw.upgradeSelectedFieldIds){const n=t.farmFieldsGeojson.features.find((e=>(e.properties?.id||e.id)===r));n&&(e+=d(n))}const r=yu(l)[Bw.upgradeTier];return{fields:Bw.upgradeSelectedFieldIds.length,hectares:e,price:e*r}}));function y(){yu(m).fields>0&&ql(o,!0)}function _(){ql(o,!1)}async function v(){if(Bw.upgradeTier&&0!==Bw.upgradeSelectedFieldIds.length){ql(n,!0),ql(i,null);try{for(const e of Bw.upgradeSelectedFieldIds){const t=await fetch(`${bh.basePath}farms/api/farm-fields/${e}/activate-subscription/`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":bh.csrfToken},body:JSON.stringify({subscription_type:"clearsky"===Bw.upgradeTier?"clearsky":"pro",trial_code:yu(s)?Bw.upgradeTrialCode.trim().toUpperCase():void 0})});if(!t.ok){const r=await t.json();throw new Error(r.error||`Failed to activate field ${e}`)}}window.location.reload()}catch(e){ql(i,e instanceof Error?e.message:"Failed to activate subscription",!0),ql(o,!1)}finally{ql(n,!1)}}}var b=Zu(),x=dc(b),w=e=>{var t=jS(),r=uc(t),a=uc(r);a.__click=u;var l=hc(a,2),d=e=>{var t=bS(),r=uc(t),o=uc(r),a=uc(o,!0);Os(o),Os(r);var l=hc(r,4),c=uc(l),u=hc(uc(c),2),d=uc(u,!0);Os(u),Os(c);var h=hc(c,2),f=e=>{var t=yS(),r=hc(uc(t),2),n=uc(r,!0);Os(r),Os(t),Pc((()=>Ju(n,Rw))),Yu(e,t)};ad(h,(e=>{yu(s)&&e(f)}));var p=hc(h,2),g=hc(uc(p),2),y=uc(g);Os(g),Os(p);var b=hc(p,2),x=hc(uc(b),2),w=uc(x);Os(x),Os(b);var S=hc(b,2),k=uc(S),T=hc(uc(k),2),I=uc(T),M=e=>{var t=_S(),r=dc(t),n=uc(r);Os(r),Ds(),Pc((e=>Ju(n,`€${e??""}`)),[()=>(yu(m).hectares*Lw[Bw.upgradeTier]).toFixed(2)]),Yu(e,t)},E=e=>{var t=Wu();Pc((e=>Ju(t,`€${e??""}`)),[()=>yu(m).price.toFixed(2)]),Yu(e,t)};ad(I,(e=>{yu(s)?e(M):e(E,!1)})),Os(T),Os(k),Os(S),Os(l);var P=hc(l,4),A=e=>{var t=vS(),r=uc(t),n=uc(r,!0);Os(r),Os(t),Pc((()=>Ju(n,yu(i)))),Yu(e,t)};ad(P,(e=>{yu(i)&&e(A)}));var C=hc(P,2),R=uc(C);P_(R,{color:"light",class:"flex-1",get disabled(){return yu(n)},onclick:_,children:(e,t)=>{Ds(),Yu(e,Wu("← Back"))},$$slots:{default:!0}}),P_(hc(R,2),{color:"blue",class:"flex-1",get disabled(){return yu(n)},onclick:v,children:(e,t)=>{Ds();var r=Wu();Pc((()=>Ju(r,yu(n)?"Processing...":"Confirm & Pay"))),Yu(e,r)},$$slots:{default:!0}}
31),Os(C),Os(t),Pc((e=>{wd(r,1,`inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br ${"pro"===Bw.upgradeTier?"from-blue-500 to-indigo-500":"from-sky-400 to-sky-500"} rounded-full mb-4`),Ju(a,"pro"===Bw.upgradeTier?"P":"C"),Ju(d,"pro"===Bw.upgradeTier?"Pro":"ClearSKY"),Ju(y,`${yu(m).fields??""} field${1!==yu(m).fields?"s":""}`),Ju(w,`${e??""} ha`)}),[()=>yu(m).hectares.toFixed(1)]),Yu(e,t)},h=e=>{var t=BS(),r=dc(t),n=hc(uc(r),2),o=e=>{var t=ES(),r=uc(t);r.__click=()=>ql(f,!yu(f));var n=uc(r),i=hc(uc(n),2),o=uc(i),a=e=>{var t=xS(),r=uc(t);Os(t),Pc((()=>Ju(r,`${yu(p).pro??""} Pro`))),Yu(e,t)};ad(o,(e=>{yu(p).pro>0&&e(a)}));var s=hc(o,2),l=e=>{var t=wS(),r=uc(t);Os(t),Pc((()=>Ju(r,`${yu(p).clearsky??""} ClearSKY`))),Yu(e,t)};ad(s,(e=>{yu(p).clearsky>0&&e(l)})),Os(i),Os(n);var c=hc(n,2),u=uc(c),d=uc(u);Os(u);var h=hc(u,2);Os(c),Os(r);var g=hc(r,2),m=e=>{var t=MS(),r=uc(t),n=e=>{var t=kS(),r=hc(uc(t),2),n=uc(r);Il(n,17,(()=>yu(p).proFields),Tl,((e,t)=>{var r=SS(),n=uc(r),i=uc(n,!0);Os(n);var o=hc(n,2),a=uc(o),s=hc(a),l=uc(s);Os(s),Os(o),Os(r),Pc(((e,r)=>{Ju(i,yu(t).name),Ju(a,`${e??""} ha · `),Ju(l,`€${r??""}`)}),[()=>yu(t).ha.toFixed(1),()=>yu(t).cost.toFixed(2)]),Yu(e,r)}));var i=hc(n,2),o=hc(uc(i),2),a=uc(o);Os(o),Os(i),Os(r),Os(t),Pc((e=>Ju(a,`€${e??""}/year`)),[()=>yu(p).proFields.reduce(((e,t)=>e+t.cost),0).toFixed(2)]),Yu(e,t)};ad(r,(e=>{yu(p).proFields.length>0&&e(n)}));var i=hc(r,2),o=e=>{var t=IS(),r=hc(uc(t),2),n=uc(r);Il(n,17,(()=>yu(p).clearskyFields),Tl,((e,t)=>
31{var r=TS(),n=uc(r),i=uc(n,!0);Os(n);var o=hc(n,2),a=uc(o),s=hc(a),l=uc(s);Os(s),Os(o),Os(r),Pc(((e,r)=>{Ju(i,yu(t).name),Ju(a,`${e??""} ha · `),Ju(l,`€${r??""}`)}),[()=>yu(t).ha.toFixed(1),()=>yu(t).cost.toFixed(2)]),Yu(e,r)}));var i=hc(n,2),o=hc(uc(i),2),a=uc(o);Os(o),Os(i),Os(r),Os(t),Pc((e=>Ju(a,`€${e??""}/year`)),[()=>yu(p).clearskyFields.reduce(((e,t)=>e+t.cost),0).toFixed(2)]),Yu(e,t)};ad(i,(e=>{yu(p).clearskyFields.length>0&&e(o)}));var a=hc(i,2),s=hc(uc(a),2),l=uc(s);Os(s),Os(a),Os(t),Pc((e=>Ju(l,`€${e??""}/year`)),[()=>yu(p).totalCost.toFixed(2)]),Yu(e,t)};ad(g,(e=>{yu(f)&&e(m)})),Os(t),Pc((e=>{Ju(d,`€${e??""}/year`),wd(h,0,"w-4 h-4 text-gray-400 transition-transform "+(yu(f)?"rotate-180":""))}),[()=>yu(p).totalCost.toFixed(2)]),Yu(e,t)},a=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,PS())};ad(r,(e=>{0===Bw.upgradeSelectedFieldIds.length&&e(n)}),!0),Yu(e,t)};ad(n,(e=>{(yu(p).pro>0||yu(p).clearsky>0)&&0===Bw.upgradeSelectedFieldIds.length?e(o):e(a,!1)})),Os(r);var l=hc(r,2),u=uc(l);u.__click=()=>c("clearsky");var d=uc(u),h=hc(uc(d),2),_=hc(uc(h),2),v=uc(_),b=e=>{var t=AS(),r=dc(t),n=uc(r);Os(r),Ds(),Pc((()=>Ju(n,`€${Lw.clearsky??""}`))),Yu(e,t)},x=e=>{var t=Wu();Pc((()=>Ju(t,`€${Lw.clearsky??""}`))),Yu(e,t)};ad(v,(e=>{yu(s)?e(b):e(x,!1)})),Ds(2),Os(_),Os(h),Os(d),Ds(2),Os(u);var w=hc(u,2);w.__click=()=>c("pro");var S=uc(w),k=hc(uc(S),2),T=hc(uc(k),2),I=uc(T),M=e=>{var t=CS(),r=dc(t),n=uc(r);Os(r),Ds(),Pc((()=>Ju(n,`€${Lw.pro??""}`))),Yu(e,t)},E=e=>{var t=Wu();Pc((()=>Ju(t,`€${Lw.pro??""}`))),Yu(e,t)};ad(I,(e=>{yu(s)?e(M):e(E,!1)})),Ds(2),Os(T),Os(k),Os(S),Ds(4),Os(w),Os(l);var P=hc(l,2),A=hc(uc(P),2),C=uc(A);Ld(C);var R=hc(C,2),L=e=>{var t=Zu(),r=dc(t),n=e=>{Yu(e,RS())},i=e=>{Yu(e,LS())};ad(r,(e=>{yu(s)?e(n):e(i,!1)})),Yu(e,t)};ad(R,(e=>{Bw.upgradeTrialCode.trim().length>0&&e(L)})),Os(A),Os(P);var O=hc(P,2),D=uc(O),z=hc(uc(D),2),F=e=>{var t=OS(),r=uc(t);Os(t),Pc((()=>Ju(r,`${yu(g).length??""} field${1!==yu(g).length?"s":""} available`))),Yu(e,t)};ad(z,(e=>{yu(g).length>0&&e(F)})),Os(D);var N=hc(D,2),B=e=>{var t=DS(),r=uc(t);Os(t),Pc((()=>Ju(r,"All fields already have "+("pro"===Bw.upgradeTier?"Pro":"ClearSKY or Pro")))),Yu(e,t)},j=e=>{var t=FS(),r=uc(t),n=uc(r),i=uc(n);Os(n);var o=hc(n,2),a=uc(o),l=e=>{var t=zS(),r=dc(t),n=uc(r);Os(r),Ds(),Pc((e=>Ju(n,`€${e??""}`)),[()=>(yu(m).hectares*Lw[Bw.upgradeTier]).toFixed(2)]),Yu(e,t)},c=e=>{var t=Wu();Pc((e=>Ju(t,`€${e??""}`)),[()=>yu(m).price.toFixed(2)]),Yu(e,t)};ad(a,(e=>{yu(s)?e(l):e(c,!1)})),Ds(2),Os(o),Os(r),Os(t),Pc((e=>{Ju(i,`${yu(m).fields??""} field${1!==yu(m).fields?"s":""} selected · ${e??""} ha`),wd(o,1,"text-lg font-bold "+("pro"===Bw.upgradeTier?"text-blue-600":"text-sky-600"))}),[()=>yu(m).hectares.toFixed(1)]),Yu(e,t)};ad(N,(e=>{0===yu(g).length?e(B):e(j,!1)})),Os(O);var V=hc(O,2),G=e=>{var t=NS(),r=uc(t),n=uc(r,!0);Os(r),Os(t),Pc((()=>Ju(n,yu(i)))),Yu(e,t)};ad(V,(e=>{yu(i)&&e(G)}));var U=hc(V,2);{let e=Dl((()=>"pro"===Bw.upgradeTier?"blue":"light")),t=Dl((()=>"clearsky"===Bw.upgradeTier?"bg-sky-500 hover:bg-sky-600 text-white border-sky-500":"")),r=Dl((()=>0===yu(m).fields));P_(U,{get color(){return yu(e)},get class(){return`w-full ${yu(t)??""}`},get disabled(){return yu(r)},onclick:y,children:(e,t)=>{var r=Zu(),n=dc(r),i=e=>{Yu(e,Wu("Select fields to upgrade"))},o=e=>{var t=Zu(),r=dc(t),n=e=>{var t=Wu();Pc((()=>Ju(t,`Upgrade ${yu(m).fields??""} field${1!==yu(m).fields?"s":""} · €0.00/year (trial)`))),Yu(e,t)},i=e=>{var t=Wu();Pc((e=>Ju(t,`Upgrade ${yu(m).fields??""} field${1!==yu(m).fields?"s":""} · €${e??""}/year`)),[()=>yu(m).price.toFixed(2)]),Yu(e,t)};ad(r,(e=>{yu(s)?e(n):e(i,!1)}),!0),Yu(e,t)};ad(n,(e=>{0===yu(m).fields?e(i):e(o,!1)})),Yu(e,r)},$$slots:{default:!0}})}Ds(2),Pc((()=>{wd(u,1,"text-left p-4 rounded-xl border-2 transition-all "+("clearsky"===Bw.upgradeTier?"border-sky-400 bg-sky-50":"border-gray-200 hover:border-sky-300 bg-white")),wd(w,1,"text-left p-4 rounded-xl border-2 transition-all "+("pro"===Bw.upgradeTier?"border-blue-400 bg-blue-50":"border-gray-200 hover:border-blue-300 bg-white"))})),Kd(C,(()=>Bw.upgradeTrialCode),(e=>Bw.upgradeTrialCode=e)),Yu(e,t)};ad(l,(e=>{yu(o)?e(d):e(h,!1)})),Os(r),Os(t),Yu(e,t)};ad(x,(e=>{r()&&e(w)})),Yu(e,b),Ys()}(W,{get farmFieldsGeojson(){return t.farmFieldsGeojson},get open(){return Bw.upgradeModalOpen},set open(e){Bw.upgradeModalOpen=e}});var Z=hc(W,2);!function(e,t){Zs(t,!0);let r=fh(t,"open",3,!1);function n(){window.location.href=`/a/${bh.teamSlug}/raindancer/`}var i=Zu(),o=dc(i),a=e=>{var r=VS(),i=uc(r),o=hc(uc(i),2),a=uc(o);a.__click=function(...e){t.onAddField?.apply(this,e)},hc(a,4).__click=n,Os(o),Os(i),Os(r),Yu(e,r)};ad(o,(e=>{r()&&e(a)})),Yu(e,i),Ys()}(Z,{get open(){return yu(d)},onAddField:()=>{ql(d,!1)}});var Y=hc(Z,2),X=e=>{var n=QX(),a=uc(n);{let e=Dl((()=>r().map((e=>e.name))));Wz(a,{get farmFieldsGeojson(){return t.farmFieldsGeojson},get validCropTypes(){return yu(e)},get hoseReelRoutesGeojson(){return yu(i)},get dripBoundariesGeojson(){return yu(o)},get mapInstance(){return yu(v)},onClose:S,get mapPlaceholderRef(){return yu(g)},set mapPlaceholderRef(e){ql(g,e,!0)}})}Os(n),Yu(e,n)};ad(Y,(e=>{"edit-field"===yu(h).type&&e(X)}));var K=hc(Y,2),J=e=>{var r=eK();ON(uc(r),{get farmFieldsGeojson(){return t.farmFieldsGeojson},get equipmentGeojson(){return t.equipmentGeojson},get pivotExtentsGeojson(){return t.pivotExtentsGeojson},get hoseReelRoutesGeojson(){return yu(i)},get dripBoundariesGeojson(){return yu(o)},onHoseReelRouteAdded:E,onHoseReelRouteDeleted:P,onDripBoundaryAdded:A,onDripBoundaryDeleted:C,get mapInstance(){return yu(v)},onClose:k,get mapPlaceholderRef(){return yu(m)},set mapPlaceholderRef(e){ql(m,e,!0)}}),Os(r),Yu(e,r)};ad(K,(e=>{"edit-machinery"===yu(h).type&&e(J)}));var Q=hc(K,2),ee=e=>{var n=tK(),i=uc(n);{let e=Dl((()=>r().map((e=>e.name))));mY(i,{get farmFieldsGeojson(){return t.farmFieldsGeojson},get validCropTypes(){return yu(e)},get mapInstance(){return yu(v)},onClose:T,get mapPlaceholderRef(){return yu(y)},set mapPlaceholderRef(e){ql(y,e,!0)}})}Os(n),Yu(e,n)};ad(Q,(e=>{"split-field"===yu(h).type&&e(ee)}));var te=hc(Q,2),re=e=>{var n=rK();VD(uc(n),{get farmFieldsGeojson(){return t.farmFieldsGeojson},get validCropTypes(){return r()},get mapInstance(){return yu(v)},onClose:M,get mapPlaceholderRef(){return yu(_)},set mapPlaceholderRef(e){ql(_,e,!0)}}),Os(n),Yu(e,n)};ad(te,(e=>{"add-field"===yu(h).type&&e(re)})),Os(F),nh(F,(e=>c=e),(()=>c)),Os(O),Pc((()=>kd(j,yu(L)))),Yu(e,O),Ys()}i.p,i.p,i.p;zh().Icon.Default.imagePath="/static/dist-images/";var oK={initIrrigationApp:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,a=arguments.length>
317&&void 0!==arguments[7]?arguments[7]:null,s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",c=arguments.length>10&&void 0!==arguments[10]?arguments[10]:"",u=arguments.length>11&&void 0!==arguments[11]?arguments[11]:"",d=arguments.length>12&&void 0!==arguments[12]?arguments[12]:[],h=arguments.length>13&&void 0!==arguments[13]&&arguments[13];return bh.basePath="/a/".concat(l,"/"),bh.csrfToken=c,bh.satApiUrl=u,bh.teamSlug=l,Qu(iK,{target:document.getElementById("irrigation-app"),props:{farmFieldsGeojson:e,equipmentGeojson:t,tasksData:n,pivotExtentsGeojson:i,hoseReelRoutesGeojson:o,dripBoundariesGeojson:a,mapboxPublicToken:s,validCropTypes:d,isAdmin:h}})},initBiomassApp:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return bh.atla.apiToken=o,Qu(Jh,{target:document.getElementById("biomass-app"),props:{farmFieldsGeojson:e,mapboxPublicToken:t,teamSlug:r,farms:n,selectedFarmId:i}})},initEvapotranspirationApp:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Qu(pm,{target:document.getElementById("map-evapotranspiration"),props:{farmFieldsGeojson:e,evapotranspirationData:t,mapboxPublicToken:r}})},initHomepageApp:function(){return Qu(Mw,{target:document.getElementById("landing-page"),props:{currentPage:(window.PAGE_DATA||{}).currentPage||"home"}})}},aK=a;void 0===window.SiteJS&&(window.SiteJS={}),window.SiteJS.app={DashboardCharts:Fa,Cookies:a,Farms:oK}})(),(SiteJS=void 0===SiteJS?{}:SiteJS).app=o})();

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