1/*! For license information please see main.bdf7605c.js.LICENSE.txt */ 2!function(){var e={219:function(e,t,r){"use strict";var n=r(3763),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function l(e){return n.isMemo(e)?s:o[e.$$typeof]||i}o[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[n.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(m){var i=p(r);i&&i!==m&&e(t,i,n)}var s=u(r);d&&(s=s.concat(d(r)));for(var o=l(t),f=l(r),g=0;g<s.length;++g){var _=s[g];if(!a[_]&&(!n||!n[_])&&(!f||!f[_])&&(!o||!o[_])){var y=h(r,_);try{c(t,_,y)}catch(v){}}}}return t}},4983:function(e,t){"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,o=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,f=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,_=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function b(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case d:case a:case o:case s:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case f:case l:return e;default:return t}}case i:return t}}}function w(e){return b(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=h,t.Fragment=a,t.Lazy=g,t.Memo=f,t.Portal=i,t.Profiler=o,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return w(e)||b(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return b(e)===c},t.isContextProvider=function(e){return b(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===h},t.isFragment=function(e){return b(e)===a},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===f},t.isPortal=function(e){return b(e)===i},t.isProfiler=function(e){return b(e)===o},t.isStrictMode=function(e){return b(e)===s},t.isSuspense=function(e){return b(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===d||e===o||e===s||e===p||e===m||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===f||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===y||e.$$typeof===v||e.$$typeof===x||e.$$typeof===_)},t.typeOf=b},3763:function(e,t,r){"use strict";e.exports=r(4983)},2740:function(e){"use strict";e.exports=function(e,t,r,n,i,a,s,o){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,s,o],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},2730:function(e,t,r){"use strict";var n=r(5043),i=r(8853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(o[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function f(e,t,r,n,i,a,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new f(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEac
vendor: 34,480 bytes, line 2
2h((function(e){var t=e[0];g[t]=new f(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new f(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new f(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new f(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new f(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new f(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)}));var _=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function v(e,t,r,n){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:n||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,r,n){if(null===t||"undefined"===typeof t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!d.call(m,e)||!d.call(p,e)&&(h.test(e)?m[e]=!0:(p[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(_,y);g[t]=new f(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(_,y);g[t]=new f(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(_,y);g[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)}));var x=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=Symbol.for("react.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),N=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var A=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var L=Symbol.iterator;function D(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=L&&e[L]||e["@@iterator"])?e:null}var z,O=Object.assign;function R(e){if(void 0===z)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||""}return"\n"+z+e}var F=!1;function B(e,t){if(!e||F)return"";F=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&"string"===typeof c.stack){for(var i=c.stack.split("\n"),a=n.stack.split("\n"),s=i.length-1,o=a.length-1;1<=s&&0<=o&&i[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==a[o]){if(1!==s||1!==o)do{if(s--,0>--o||i[s]!==a[o]){var l="\n"+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=s&&0<=o);break}}}finally{F=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?R(e):""}function V(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function $(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case C:return"Fragment";case w:return"Portal";case k:return"Profiler";case S:return"StrictMode";case P:return"Suspense";case I:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case E:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case M:return null!==(t=e.displayName||null)?t:$(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return $(e(t))}catch(r){}}return null}function U(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Z(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=q(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function W(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function X(e,t){var r=t.checked;return O({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function J(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=H(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function K(e,t){null!=(t=t.checked)&&v(e,"checked",t,!1)}function Y(e,t){K(e,t);var r=H(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,r):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Q(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function ee(e,t,r){"number"===t&&W(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var te=Array.isArray;function re(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+H(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ne(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return O({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(a(92));if(te(r)){if(1<r.length)throw Error(a(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:H(r)}}function ae(e,t){var r=H(t.value),n=H(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,de=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function he(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},me=["Webkit","ms","Moz","O"];function fe(e,t,r){return null==t||"boolean"===typeof t||""===t?"":r||"number"!==typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=fe(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(pe).forEach((function(e){me.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var _e=O({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(_e[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function ve(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xe=null;function be(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var we=null,Ce=null,Se=null;function ke(e){if(e=vi(e)){if("function"!==typeof we)throw Error(a(280));var t=e.stateNode;t&&(t=bi(t),we(e.stateNode,e.type,t))}}function je(e){Ce?Se?Se.push(e):Se=[e]:Ce=e}function Ee(){if(Ce){var e=Ce,t=Se;if(Se=Ce=null,ke(e),t)for(e=0;e<t.length;e++)ke(t[e])}}function Te(e,t){return e(t)}function Pe(){}var Ie=!1;function Me(e,t,r){if(Ie)return e(t,r);Ie=!0;try{return Te(e,t,r)}finally{Ie=!1,(null!==Ce||null!==Se)&&(Pe(),Ee())}}function Ne(e,t){var r=e.stateNode;if(null===r)return null;var n=bi(r);if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!==typeof r)throw Error(a(231,t,typeof r));return r}var Ae=!1;if(u)try{var Le={};Object.defineProperty(Le,"passive",{get:function(){Ae=!0}}),window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch(ue){Ae=!1}function De(e,t,r,n,i,a,s,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(u){this.onError(u)}}var ze=!1,Oe=null,Re=!1,Fe=null,Be={onError:function(e){ze=!0,Oe=e}};function Ve(e,t,r,n,i,a,s,o,l){ze=!1,Oe=null,De.apply(Be,arguments)}function $e(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function Ue(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if($e(e)!==e)throw Error(a(188))}function qe(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=$e(e)))throw Error(a(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(n=i.return)){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return He(i),e;if(s===n)return He(i),t;s=s.sibling}throw Error(a(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o)throw Error(a(189))}}if(r.alternate!==n)throw Error(a(190))}if(3!==r.tag)throw Error(a(188));return r.stateNode.current===r?e:t}(e))?Ze(e):null}function Ze(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ze(e);if(null!==t)return t;e=e.sibling}return null}var Ge=i.unstable_scheduleCallback,We=i.unstable_cancelCallback,Xe=i.unstable_shouldYield,Je=i.unstable_requestPaint,Ke=i.unstable_now,Ye=i.unstable_getCurrentPriorityLevel,Qe=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,rt=i.unstable_LowPriority,nt=i.unstable_IdlePriority,it=null,at=null;var st=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/lt|0)|0},ot=Math.log,lt=Math.LN2;var ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,s=268435455&r;if(0!==s){var o=s&~i;0!==o?n=dt(o):0!==(a&=s)&&(n=dt(a))}else 0!==(s=r&~i)?n=dt(s):0!==a&&(n=dt(a));if(0===n)return 0;if(0!==t&&t!==n&&0===(t&i)&&((i=n&-n)>=(a=t&-t)||16===i&&0!==(4194240&a)))return t;if(0!==(4&n)&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-st(t)),n|=e[r],t&=~i;return n}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function mt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function ft(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function _t(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=r}function yt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-st(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var vt=0;function xt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var bt,wt,Ct,St,kt,jt=!1,Et=[],Tt=null,Pt=null,It=null,Mt=new Map,Nt=new Map,At=[],Lt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Dt(e,t){switch(e){case"focusin":case"focusout":Tt=null;break;case"dragenter":case"dragleave":Pt=null;break;case"mouseover":case"mouseout":It=null;break;case"pointerover":case"pointerout":Mt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nt.delete(t.pointerId)}}function zt(e,t,r,n,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=vi(t))&&wt(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Ot(e){var t=yi(e.target);if(null!==t){var r=$e(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=Ue(r)))return e.blockedOn=t,void kt(e.priority,(function(){Ct(r)}))}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function Rt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=vi(r))&&wt(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);xe=n,r.target.dispatchEvent(n),xe=null,t.shift()}return!0}function Ft(e,t,r){Rt(e)&&r.delete(t)}function Bt(){jt=!1,null!==Tt&&Rt(Tt)&&(Tt=null),null!==Pt&&Rt(Pt)&&(Pt=null),null!==It&&Rt(It)&&(It=null),Mt.forEach(Ft),Nt.forEach(Ft)}function Vt(e,t){e.blockedOn===t&&(e.blockedOn=null,jt||(jt=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Bt)))}function $t(e){function t(t){return Vt(t,e)}if(0<Et.length){Vt(Et[0],e);for(var r=1;r<Et.length;r++){var n=Et[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==Tt&&Vt(Tt,e),null!==Pt&&Vt(Pt,e),null!==It&&Vt(It,e),Mt.forEach(t),Nt.forEach(t),r=0;r<At.length;r++)(n=At[r]).blockedOn===e&&(n.blockedOn=null);for(;0<At.length&&null===(r=At[0]).blockedOn;)Ot(r),null===r.blockedOn&&At.shift()}var Ut=x.ReactCurrentBatchConfig,Ht=!0;function qt(e,t,r,n){var i=vt,a=Ut.transition;Ut.transition=null;try{vt=1,Gt(e,t,r,n)}finally{vt=i,Ut.transition=a}}function Zt(e,t,r,n){var i=vt,a=Ut.transition;Ut.transition=null;try{vt=4,Gt(e,t,r,n)}finally{vt=i,Ut.transition=a}}function Gt(e,t,r,n){if(Ht){var i=Xt(e,t,r,n);if(null===i)Hn(e,t,n,Wt,r),Dt(e,n);else if(function(e,t,r,n,i){switch(t){case"focusin":return Tt=zt(Tt,e,t,r,n,i),!0;case"dragenter":return Pt=zt(Pt,e,t,r,n,i),!0;case"mouseover":return It=zt(It,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return Mt.set(a,zt(Mt.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Nt.set(a,zt(Nt.get(a)||null,e,t,r,n,i)),!0}return!1}(i,e,t,r,n))n.stopPropagation();else if(Dt(e,n),4&t&&-1<Lt.indexOf(e)){for(;null!==i;){var a=vi(i);if(null!==a&&bt(a),null===(a=Xt(e,t,r,n))&&Hn(e,t,n,Wt,r),a===i)break;i=a}null!==i&&n.stopPropagation()}else Hn(e,t,n,null,r)}}var Wt=null;function Xt(e,t,r,n){if(Wt=null,null!==(e=yi(e=be(n))))if(null===(t=$e(e)))e=null;else if(13===(r=t.tag)){if(null!==(e=Ue(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wt=e,null}function Jt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ye()){case Qe:return 1;case et:return 4;case tt:case rt:return 16;case nt:return 536870912;default:return 16}default:return 16}}var Kt=null,Yt=null,Qt=null;function er(){if(Qt)return Qt;var e,t,r=Yt,n=r.length,i="value"in Kt?Kt.value:Kt.textContent,a=i.length;for(e=0;e<n&&r[e]===i[e];e++);var s=n-e;for(t=1;t<=s&&r[n-t]===i[a-t];t++);return Qt=i.slice(e,1<t?1-t:void 0)}function tr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rr(){return!0}function nr(){return!1}function ir(e){function t(t,r,n,i,a){for(var s in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rr:nr,this.isPropagationStopped=nr,this}return O(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),t}var ar,sr,or,lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cr=ir(lr),ur=O({},lr,{view:0,detail:0}),dr=ir(ur),hr=O({},ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==or&&(or&&"mousemove"===e.type?(ar=e.screenX-or.screenX,sr=e.screenY-or.screenY):sr=ar=0,or=e),ar)},movementY:function(e){return"movementY"in e?e.movementY:sr}}),pr=ir(hr),mr=ir(O({},hr,{dataTransfer:0})),fr=ir(O({},ur,{relatedTarget:0})),gr=ir(O({},lr,{animationName:0,elapsedTime:0,pseudoElement:0})),_r=O({},lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yr=ir(_r),vr=ir(O({},lr,{data:0})),xr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},br={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=wr[e])&&!!t[e]}function Sr(){return Cr}var kr=O({},ur,{key:function(e){if(e.key){var t=xr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?br[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sr,charCode:function(e){return"keypress"===e.type?tr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),jr=ir(kr),Er=ir(O({},hr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tr=ir(O({},ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sr})),Pr=ir(O({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ir=O({},hr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Mr=ir(Ir),Nr=[9,13,27,32],Ar=u&&"CompositionEvent"in window,Lr=null;u&&"documentMode"in document&&(Lr=document.documentMode);var Dr=u&&"TextEvent"in window&&!Lr,zr=u&&(!Ar||Lr&&8<Lr&&11>=Lr),Or=String.fromCharCode(32),Rr=!1;function Fr(e,t){switch(e){case"keyup":return-1!==Nr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Br(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Vr=!1;var $r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!$r[e.type]:"textarea"===t}function Hr(e,t,r,n){je(n),0<(t=Zn(t,"onChange")).length&&(r=new cr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var qr=null,Zr=null;function Gr(e){Rn(e,0)}function Wr(e){if(G(xi(e)))return e}function Xr(e,t){if("change"===e)return t}var Jr=!1;if(u){var Kr;if(u){var Yr="oninput"in document;if(!Yr){var Qr=document.createElement("div");Qr.setAttribute("oninput","return;"),Yr="function"===typeof Qr.oninput}Kr=Yr}else Kr=!1;Jr=Kr&&(!document.documentMode||9<document.documentMode)}function en(){qr&&(qr.detachEvent("onpropertychange",tn),Zr=qr=null)}function tn(e){if("value"===e.propertyName&&Wr(Zr)){var t=[];Hr(t,Zr,e,be(e)),Me(Gr,t)}}function rn(e,t,r){"focusin"===e?(en(),Zr=r,(qr=t).attachEvent("onpropertychange",tn)):"focusout"===e&&en()}function nn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Wr(Zr)}function an(e,t){if("click"===e)return Wr(t)}function sn(e,t){if("input"===e||"change"===e)return Wr(t)}var on="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function ln(e,t){if(on(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!d.call(t,i)||!on(e[i],t[i]))return!1}return!0}function cn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function un(e,t){var r,n=cn(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cn(n)}}function dn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hn(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=W((e=t.contentWindow).document)}return t}function pn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function mn(e){var t=hn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&dn(r.ownerDocument.documentElement,r)){if(null!==n&&pn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=void 0===n.end?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=un(r,a);var s=un(r,n);i&&s&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof r.focus&&r.focus(),r=0;r<t.length;r++)(e=t[r]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fn=u&&"documentMode"in document&&11>=document.documentMode,gn=null,_n=null,yn=null,vn=!1;function xn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;vn||null==gn||gn!==W(n)||("selectionStart"in(n=gn)&&pn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},yn&&ln(yn,n)||(yn=n,0<(n=Zn(_n,"onSelect")).length&&(t=new cr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=gn)))}function bn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var wn={animationend:bn("Animation","AnimationEnd"),animationiteration:bn("Animation","AnimationIteration"),animationstart:bn("Animation","AnimationStart"),transitionend:bn("Transition","TransitionEnd")},Cn={},Sn={};function kn(e){if(Cn[e])return Cn[e];if(!wn[e])return e;var t,r=wn[e];for(t in r)if(r.hasOwnProperty(t)&&t in Sn)return Cn[e]=r[t];return e}u&&(Sn=document.createElement("div").style,"AnimationEvent"in window||(delete wn.animationend.animation,delete wn.animationiteration.animation,delete wn.animationstart.animation),"TransitionEvent"in window||delete wn.transitionend.transition);var jn=kn("animationend"),En=kn("animationiteration"),Tn=kn("animationstart"),Pn=kn("transitionend"),In=new Map,Mn="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Nn(e,t){In.set(e,t),l(t,[e])}for(var An=0;An<Mn.length;An++){var Ln=Mn[An];Nn(Ln.toLowerCase(),"on"+(Ln[0].toUpperCase()+Ln.slice(1)))}Nn(jn,"onAnimationEnd"),Nn(En,"onAnimationIteration"),Nn(Tn,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(Pn,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focu
2sin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),zn=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dn));function On(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,n,i,s,o,l,c){if(Ve.apply(this,arguments),ze){if(!ze)throw Error(a(198));var u=Oe;ze=!1,Oe=null,Re||(Re=!0,Fe=u)}}(n,t,void 0,e),e.currentTarget=null}function Rn(e,t){t=0!==(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var s=n.length-1;0<=s;s--){var o=n[s],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&i.isPropagationStopped())break e;On(i,o,c),a=l}else for(s=0;s<n.length;s++){if(l=(o=n[s]).instance,c=o.currentTarget,o=o.listener,l!==a&&i.isPropagationStopped())break e;On(i,o,c),a=l}}}if(Re)throw e=Fe,Re=!1,Fe=null,e}function Fn(e,t){var r=t[fi];void 0===r&&(r=t[fi]=new Set);var n=e+"__bubble";r.has(n)||(Un(t,e,2,!1),r.add(n))}function Bn(e,t,r){var n=0;t&&(n|=4),Un(r,e,n,t)}var Vn="_reactListening"+Math.random().toString(36).slice(2);function $n(e){if(!e[Vn]){e[Vn]=!0,s.forEach((function(t){"selectionchange"!==t&&(zn.has(t)||Bn(t,!1,e),Bn(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Vn]||(t[Vn]=!0,Bn("selectionchange",!1,t))}}function Un(e,t,r,n){switch(Jt(t)){case 1:var i=qt;break;case 4:i=Zt;break;default:i=Gt}r=i.bind(null,t,r,e),i=void 0,!Ae||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Hn(e,t,r,n,i){var a=n;if(0===(1&t)&&0===(2&t)&&null!==n)e:for(;;){if(null===n)return;var s=n.tag;if(3===s||4===s){var o=n.stateNode.containerInfo;if(o===i||8===o.nodeType&&o.parentNode===i)break;if(4===s)for(s=n.return;null!==s;){var l=s.tag;if((3===l||4===l)&&((l=s.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;s=s.return}for(;null!==o;){if(null===(s=yi(o)))return;if(5===(l=s.tag)||6===l){n=a=s;continue e}o=o.parentNode}}n=n.return}Me((function(){var n=a,i=be(r),s=[];e:{var o=In.get(e);if(void 0!==o){var l=cr,c=e;switch(e){case"keypress":if(0===tr(r))break e;case"keydown":case"keyup":l=jr;break;case"focusin":c="focus",l=fr;break;case"focusout":c="blur",l=fr;break;case"beforeblur":case"afterblur":l=fr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=pr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Tr;break;case jn:case En:case Tn:l=gr;break;case Pn:l=Pr;break;case"scroll":l=dr;break;case"wheel":l=Mr;break;case"copy":case"cut":case"paste":l=yr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Er}var u=0!==(4&t),d=!u&&"scroll"===e,h=u?null!==o?o+"Capture":null:o;u=[];for(var p,m=n;null!==m;){var f=(p=m).stateNode;if(5===p.tag&&null!==f&&(p=f,null!==h&&(null!=(f=Ne(m,h))&&u.push(qn(m,f,p)))),d)break;m=m.return}0<u.length&&(o=new l(o,c,null,r,i),s.push({event:o,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||r===xe||!(c=r.relatedTarget||r.fromElement)||!yi(c)&&!c[mi])&&(l||o)&&(o=i.window===i?i:(o=i.ownerDocument)?o.defaultView||o.parentWindow:window,l?(l=n,null!==(c=(c=r.relatedTarget||r.toElement)?yi(c):null)&&(c!==(d=$e(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=n),l!==c)){if(u=pr,f="onMouseLeave",h="onMouseEnter",m="mou
2se","pointerout"!==e&&"pointerover"!==e||(u=Er,f="onPointerLeave",h="onPointerEnter",m="pointer"),d=null==l?o:xi(l),p=null==c?o:xi(c),(o=new u(f,m+"leave",l,r,i)).target=d,o.relatedTarget=p,f=null,yi(i)===n&&((u=new u(h,m+"enter",c,r,i)).target=p,u.relatedTarget=d,f=u),d=f,l&&c)e:{for(h=c,m=0,p=u=l;p;p=Gn(p))m++;for(p=0,f=h;f;f=Gn(f))p++;for(;0<m-p;)u=Gn(u),m--;for(;0<p-m;)h=Gn(h),p--;for(;m--;){if(u===h||null!==h&&u===h.alternate)break e;u=Gn(u),h=Gn(h)}u=null}else u=null;null!==l&&Wn(s,o,l,u,!1),null!==c&&null!==d&&Wn(s,d,c,u,!0)}if("select"===(l=(o=n?xi(n):window).nodeName&&o.nodeName.toLowerCase())||"input"===l&&"file"===o.type)var g=Xr;else if(Ur(o))if(Jr)g=sn;else{g=nn;var _=rn}else(l=o.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(g=an);switch(g&&(g=g(e,n))?Hr(s,g,r,i):(_&&_(e,o,n),"focusout"===e&&(_=o._wrapperState)&&_.controlled&&"number"===o.type&&ee(o,"number",o.value)),_=n?xi(n):window,e){case"focusin":(Ur(_)||"true"===_.contentEditable)&&(gn=_,_n=n,yn=null);break;case"focusout":yn=_n=gn=null;break;case"mousedown":vn=!0;break;case"contextmenu":case"mouseup":case"dragend":vn=!1,xn(s,r,i);break;case"selectionchange":if(fn)break;case"keydown":case"keyup":xn(s,r,i)}var y;if(Ar)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Vr?Fr(e,r)&&(v="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(v="onCompositionStart");v&&(zr&&"ko"!==r.locale&&(Vr||"onCompositionStart"!==v?"onCompositionEnd"===v&&Vr&&(y=er()):(Yt="value"in(Kt=i)?Kt.value:Kt.textContent,Vr=!0)),0<(_=Zn(n,v)).length&&(v=new vr(v,e,null,r,i),s.push({event:v,listeners:_}),y?v.data=y:null!==(y=Br(r))&&(v.data=y))),(y=Dr?function(e,t){switch(e){case"compositionend":return Br(t);case"keypress":return 32!==t.which?null:(Rr=!0,Or);case"textInput":return(e=t.data)===Or&&Rr?null:e;default:return null}}(e,r):function(e,t){if(Vr)return"compositionend"===e||!Ar&&Fr(e,t)?(e=er(),Qt=Yt=Kt=null,Vr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zr&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=Zn(n,"onBeforeInput")).length&&(i=new vr("onBeforeInput","beforeinput",null,r,i),s.push({event:i,listeners:n}),i.data=y))}Rn(s,t)}))}function qn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Zn(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=Ne(e,r))&&n.unshift(qn(e,a,i)),null!=(a=Ne(e,t))&&n.push(qn(e,a,i))),e=e.return}return n}function Gn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Wn(e,t,r,n,i){for(var a=t._reactName,s=[];null!==r&&r!==n;){var o=r,l=o.alternate,c=o.stateNode;if(null!==l&&l===n)break;5===o.tag&&null!==c&&(o=c,i?null!=(l=Ne(r,a))&&s.unshift(qn(r,l,o)):i||null!=(l=Ne(r,a))&&s.push(qn(r,l,o))),r=r.return}0!==s.length&&e.push({event:t,listeners:s})}var Xn=/\r\n?/g,Jn=/\u0000|\uFFFD/g;function Kn(e){return("string"===typeof e?e:""+e).replace(Xn,"\n").replace(Jn,"")}function Yn(e,t,r){if(t=Kn(t),Kn(e)!==t&&r)throw Error(a(425))}function Qn(){}var ei=null,ti=null;function ri(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ni="function"===typeof setTimeout?setTimeout:void 0,ii="function"===typeof clearTimeout?clearTimeout:void 0,ai="function"===typeof Promise?Promise:void 0,si="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof ai?function(e){return ai.resolve(null).then(e).catch(oi)}:ni;function oi(e){setTimeout((function(){throw e}))}function li(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return e.removeChild(i),void $t(t);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}
vendor: 82,992 bytes, line 2
2while(r);$t(t)}function ci(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ui(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var di=Math.random().toString(36).slice(2),hi="__reactFiber$"+di,pi="__reactProps$"+di,mi="__reactContainer$"+di,fi="__reactEvents$"+di,gi="__reactListeners$"+di,_i="__reactHandles$"+di;function yi(e){var t=e[hi];if(t)return t;for(var r=e.parentNode;r;){if(t=r[mi]||r[hi]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=ui(e);null!==e;){if(r=e[hi])return r;e=ui(e)}return t}r=(e=r).parentNode}return null}function vi(e){return!(e=e[hi]||e[mi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function xi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function bi(e){return e[pi]||null}var wi=[],Ci=-1;function Si(e){return{current:e}}function ki(e){0>Ci||(e.current=wi[Ci],wi[Ci]=null,Ci--)}function ji(e,t){Ci++,wi[Ci]=e.current,e.current=t}var Ei={},Ti=Si(Ei),Pi=Si(!1),Ii=Ei;function Mi(e,t){var r=e.type.contextTypes;if(!r)return Ei;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in r)a[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ni(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ai(){ki(Pi),ki(Ti)}function Li(e,t,r){if(Ti.current!==Ei)throw Error(a(168));ji(Ti,t),ji(Pi,r)}function Di(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,"function"!==typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in t))throw Error(a(108,U(e)||"Unknown",i));return O({},r,n)}function zi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,Ii=Ti.current,ji(Ti,e),ji(Pi,Pi.current),!0}function Oi(e,t,r){var n=e.stateNode;if(!n)throw Error(a(169));r?(e=Di(e,t,Ii),n.__reactInternalMemoizedMergedChildContext=e,ki(Pi),ki(Ti),ji(Ti,e)):ki(Pi),ji(Pi,r)}var Ri=null,Fi=!1,Bi=!1;function Vi(e){null===Ri?Ri=[e]:Ri.push(e)}function $i(){if(!Bi&&null!==Ri){Bi=!0;var e=0,t=vt;try{var r=Ri;for(vt=1;e<r.length;e++){var n=r[e];do{n=n(!0)}while(null!==n)}Ri=null,Fi=!1}catch(i){throw null!==Ri&&(Ri=Ri.slice(e+1)),Ge(Qe,$i),i}finally{vt=t,Bi=!1}}return null}var Ui=[],Hi=0,qi=null,Zi=0,Gi=[],Wi=0,Xi=null,Ji=1,Ki="";function Yi(e,t){Ui[Hi++]=Zi,Ui[Hi++]=qi,qi=e,Zi=t}function Qi(e,t,r){Gi[Wi++]=Ji,Gi[Wi++]=Ki,Gi[Wi++]=Xi,Xi=e;var n=Ji;e=Ki;var i=32-st(n)-1;n&=~(1<<i),r+=1;var a=32-st(t)+i;if(30<a){var s=i-i%5;a=(n&(1<<s)-1).toString(32),n>>=s,i-=s,Ji=1<<32-st(t)+i|r<<i|n,Ki=a+e}else Ji=1<<a|r<<i|n,Ki=e}function ea(e){null!==e.return&&(Yi(e,1),Qi(e,1,0))}function ta(e){for(;e===qi;)qi=Ui[--Hi],Ui[Hi]=null,Zi=Ui[--Hi],Ui[Hi]=null;for(;e===Xi;)Xi=Gi[--Wi],Gi[Wi]=null,Ki=Gi[--Wi],Gi[Wi]=null,Ji=Gi[--Wi],Gi[Wi]=null}var ra=null,na=null,ia=!1,aa=null;function sa(e,t){var r=Nc(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,null===(t=e.deletions)?(e.deletions=[r],e.flags|=16):t.push(r)}function oa(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ra=e,na=ci(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ra=e,na=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(r=null!==Xi?{id:Ji,overflow:Ki}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},(r=Nc(18,null,null,0)).stateNode=t,r.return=e,e.child=r,ra=e,na=null,!0);default:return!1}}function la(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function ca(e){if(ia){var t=na;if(t){var r=t;if(!oa(e,t)){if(la(e))throw Error(a(418));t=ci(r.nextSibling);var n=ra;t&&oa(e,t)?sa(n,r):(e.flags=-4097&e.flags|2,ia=!1,ra=e)}}else{if(la(e))throw Error(a(418));e.flags=-4097&e.flags|2,ia=!1,ra=e}}}function ua(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ra=e}function da(e){if(e!==ra)return!1;if(!ia)return ua(e),ia=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ri(e.type,e.memoizedProps)),t&&(t=na)){if(la(e))throw ha(),Error(a(418));for(;t;)sa(e,t),t=ci(t.nextSibling)}if(ua(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){na=ci(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}na=null}}else na=ra?ci(e.stateNode.nextSibling):null;return!0}function ha(){for(var e=na;e;)e=ci(e.nextSibling)}function pa(){na=ra=null,ia=!1}function ma(e){null===aa?aa=[e]:aa.push(e)}var fa=x.ReactCurrentBatchConfig;function ga(e,t){if(e&&e.defaultProps){for(var r in t=O({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}var _a=Si(null),ya=null,va=null,xa=null;function ba(){xa=va=ya=null}function wa(e){var t=_a.current;ki(_a),e._currentValue=t}function Ca(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Sa(e,t){ya=e,xa=va=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(xo=!0),e.firstContext=null)}function ka(e){var t=e._currentValue;if(xa!==e)if(e={context:e,memoizedValue:t,next:null},null===va){if(null===ya)throw Error(a(308));va=e,ya.dependencies={lanes:0,firstContext:e}}else va=va.next=e;return t}var ja=null;function Ea(e){null===ja?ja=[e]:ja.push(e)}function Ta(e,t,r,n){var i=t.interleaved;return null===i?(r.next=r,Ea(t)):(r.next=i.next,i.next=r),t.interleaved=r,Pa(e,n)}function Pa(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var Ia=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Na(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Aa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function La(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!==(2&Pl)){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Pa(e,r)}return null===(i=n.interleaved)?(t.next=t,Ea(n)):(t.next=i.next,i.next=t),n.interleaved=t,Pa(e,r)}function Da(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&r))){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,yt(e,r)}}function za(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,a=null;if(null!==(r=r.firstBaseUpdate)){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===a?i=a=s:a=a.next=s,r=r.next}while(null!==r);null===a?i=a=t:a=a.next=t}else i=a=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Oa(e,t,r,n){var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(null!==o){i.shared.pending=null;var l=o,c=l.next;l.next=null,null===s?a=c:s.next=c,s=l;var u=e.alternate;null!==u&&((o=(u=u.updateQueue).lastBaseUpdate)!==s&&(null===o?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(null!==a){var d=i.baseState;for(s=0,u=c=l=null,o=a;;){var h=o.lane,p=o.eventTime;if((n&h)===h){null!==u&&(u=u.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,f=o;switch(h=t,p=r,f.tag){case 1:if("function"===typeof(m=f.payload)){d=m.call(p,d,h);break e}d=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null===(h="function"===typeof(m=f.payload)?m.call(p,d,h):m)||void 0===h)break e;d=O({},d,h);break e;case 2:Ia=!0}}null!==o.callback&&0!==o.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,s|=h;if(null===(o=o.next)){if(null===(o=i.shared.pending))break;o=(h=o).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===u&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{s|=i.lane,i=i.next}while(i!==t)}else null===a&&(i.shared.lanes=0);Ol|=s,e.lanes=s,e.memoizedState=d}}function Ra(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!==typeof i)throw Error(a(191,i));i.call(n)}}}var Fa=(new n.Component).refs;function Ba(e,t,r,n){r=null===(r=r(n,t=e.memoizedState))||void 0===r?t:O({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var Va={isMounted:function(e){return!!(e=e._reactInternals)&&$e(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=tc(),i=rc(e),a=Aa(n,i);a.payload=t,void 0!==r&&null!==r&&(a.callback=r),null!==(t=La(e,a,i))&&(nc(t,e,i,n),Da(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=tc(),i=rc(e),a=Aa(n,i);a.tag=1,a.payload=t,void 0!==r&&null!==r&&(a.callback=r),null!==(t=La(e,a,i))&&(nc(t,e,i,n),Da(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=tc(),n=rc(e),i=Aa(r,n);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),null!==(t=La(e,i,n))&&(nc(t,e,n,r),Da(t,e,n))}};function $a(e,t,r,n,i,a,s){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,s):!t.prototype||!t.prototype.isPureReactComponent||(!ln(r,n)||!ln(i,a))}function Ua(e,t,r){var n=!1,i=Ei,a=t.contextType;return"object"===typeof a&&null!==a?a=ka(a):(i=Ni(t)?Ii:Ti.current,a=(n=null!==(n=t.contextTypes)&&void 0!==n)?Mi(e,i):Ei),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Va,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ha(e,t,r,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Va.enqueueReplaceState(t,t.state,null)}function qa(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=Fa,Ma(e);var a=t.contextType;"object"===typeof a&&null!==a?i.context=ka(a):(a=Ni(t)?Ii:Ti.current,i.context=Mi(e,a)),i.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(Ba(e,t,a,r),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Va.enqueueReplaceState(i,i.state,null),Oa(e,r,i,n),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4194308)}function Za(e,t,r){if(null!==(e=r.ref)&&"function"!==typeof e&&"object"!==typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(a(309));var n=r.stateNode}if(!n)throw Error(a(147,e));var i=n,s=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=i.refs;t===Fa&&(t=i.refs={}),null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!==typeof e)throw Error(a(284));if(!r._owner)throw Error(a(290,e))}return e}function Ga(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wa(e){return(0,e._init)(e._payload)}function Xa(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Lc(e,t)).index=0,e.sibling=null,e}function s(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=2,r):n:(t.flags|=2,r):(t.flags|=1048576,r)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,r,n){return null===t||6!==t.tag?((t=Rc(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function c(e,t,r,n){var a=r.type;return a===C?d(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===N&&Wa(a)===t.type)?((n=i(t,r.props)).ref=Za(e,t,r),n.return=e,n):((n=Dc(r.type,r.key,r.props,null,e.mode,n)).ref=Za(e,t,r),n.return=e,n)}function u(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=Fc(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function d(e,t,r,n,a){return null===t||7!==t.tag?((t=zc(r,e.mode,n,a)).return=e,t):((t=i(t,r)).return=e,t)}function h(e,t,r){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Rc(""+t,e.mode,r)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case b:return(r=Dc(t.type,t.key,t.props,null,e.mode,r)).ref=Za(e,null,t),r.return=e,r;case w:return(t=Fc(t,e.mode,r)).return=e,t;case N:return h(e,(0,t._init)(t._payload),r)}if(te(t)||D(t))return(t=zc(t,e.mode,r,null)).return=e,t;Ga(e,t)}return null}function p(e,t,r,n){var i=null!==t?t.key:null;if("string"===typeof r&&""!==r||"number"===typeof r)return null!==i?null:l(e,t,""+r,n);if("object"===typeof r&&null!==r){switch(r.$$typeof){case b:return r.key===i?c(e,t,r,n):null;case w:return r.key===i?u(e,t,r,n):null;case N:return p(e,t,(i=r._init)(r._payload),n)}if(te(r)||D(r))return null!==i?null:d(e,t,r,n,null);Ga(e,r)}return null}function m(e,t,r,n,i){if("string"===typeof n&&""!==n||"number"===typeof n)return l(t,e=e.get(r)||null,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case b:return c(t,e=e.get(null===n.key?r:n.key)||null,n,i);case w:return u(t,e=e.get(null===n.key?r:n.key)||null,n,i);case N:return m(e,t,r,(0,n._init)(n._payload),i)}if(te(n)||D(n))return d(t,e=e.get(r)||null,n,i,null);Ga(t,n)}return null}function f(i,a,o,l){for(var c=null,u=null,d=a,f=a=0,g=null;null!==d&&f<o.length;f++){d.index>f?(g=d,d=null):g=d.sibling;var _=p(i,d,o[f],l);if(null===_){null===d&&(d=g);break}e&&d&&null===_.alternate&&t(i,d),a=s(_,a,f),null===u?c=_:u.sibling=_,u=_,d=g}if(f===o.length)return r(i,d),ia&&Yi(i,f),c;if(null===d){for(;f<o.length;f++)null!==(d=h(i,o[f],l))&&(a=s(d,a,f),null===u?c=d:u.sibling=d,u=d);return ia&&Yi(i,f),c}for(d=n(i,d);f<o.length;f++)null!==(g=m(d,i,f,o[f],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?f:g.key),a=s(g,a,f),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach((function(e){return t(i,e)})),ia&&Yi(i,f),c}function g(i,o,l,c){var u=D(l);if("function"!==typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var d=u=null,f=o,g=o=0,_=null,y=l.next();null!==f&&!y.done;g++,y=l.next()){f.index>g?(_=f,f=null):_=f.sibling;var v=p(i,f,y.value,c);if(null===v){null===f&&(f=_);break}e&&f&&null===v.alternate&&t(i,f),o=s(v,o,g),null===d?u=v:d.sibling=v,d=v,f=_}if(y.done)return r(i,f),ia&&Yi(i,g),u;if(null===f){for(;!y.done;g++,y=l.next())null!==(y=h(i,y.value,c))&&(o=s(y,o,g),null===d?u=y:d.sibling=y,d=y);return ia&&Yi(i,g),u}for(f=n(i,f);!y.done;g++,y=l.next())null!==(y=m(f,i,g,y.value,c))&&(e&&null!==y.alternate&&f.delete(null===y.key?g:y.key),o=s(y,o,g),null===d?u=y:d.sibling=y,d=y);return e&&f.forEach((function(e){return t(i,e)})),ia&&Yi(i,g),u}return function e(n,a,s,l){if("object"===typeof s&&null!==s&&s.type===C&&null===s.key&&(s=s.props.children),"object"===typeof s&&null!==s){switch(s.$$typeof){case b:e:{for(var c=s.key,u=a;null!==u;){if(u.key===c){if((c=s.type)===C){if(7===u.tag){r(n,u.sibling),(a=i(u,s.props.children)).return=n,n=a;break e}}else if(u.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===N&&Wa(c)===u.type){r(n,u.sibling),(a=i(u,s.props)).ref=Za(n,u,s),a.return=n,n=a;break e}r(n,u);break}t(n,u),u=u.sibling}s.type===C?((a=zc(s.props.children,n.mode,l,s.key)).return=n,n=a):((l=Dc(s.type,s.key,s.props,null,n.mode,l)).ref=Za(n,a,s),l.return=n,n=l)}return o(n);case w:e:{for(u=s.key;null!==a;){if(a.key===u){if(4===a.tag&&a.stateNode.containerInfo===s.containerInfo&&a.stateNode.implementation===s.implementation){r(n,a.sibling),(a=i(a,s.children||[])).return=n,n=a;break e}r(n,a);break}t(n,a),a=a.sibling}(a=Fc(s,n.mode,l)).return=n,n=a}return o(n);case N:return e(n,a,(u=s._init)(s._payload),l)}if(te(s))return f(n,a,s,l);if(D(s))return g(n,a,s,l);Ga(n,s)}return"string"===typeof s&&""!==s||"number"===typeof s?(s=""+s,null!==a&&6===a.tag?(r(n,a.sibling),(a=i(a,s)).return=n,n=a):(r(n,a),(a=Rc(s,n.mode,l)).return=n,n=a),o(n)):r(n,a)}}var Ja=Xa(!0),Ka=Xa(!1),Ya={},Qa=Si(Ya),es=Si(Ya),ts=Si(Ya);function rs(e){if(e===Ya)throw Error(a(174));return e}function ns(e,t){switch(ji(ts,t),ji(es,e),ji(Qa,Ya),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ki(Qa),ji(Qa,t)}function is(){ki(Qa),ki(es),ki(ts)}function as(e){rs(ts.current);var t=rs(Qa.current),r=le(t,e.type);t!==r&&(ji(es,e),ji(Qa,r))}function ss(e){es.current===e&&(ki(Qa),ki(es))}var os=Si(0);function ls(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cs=[];function us(){for(var e=0;e<cs.length;e++)cs[e]._workInProgressVersionPrimary=null;cs.length=0}var ds=x.ReactCurrentDispatcher,hs=x.ReactCurrentBatchConfig,ps=0,ms=null,fs=null,gs=null,_s=!1,ys=!1,vs=0,xs=0;function bs(){throw Error(a(321))}function ws(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!on(e[r],t[r]))return!1;return!0}function Cs(e,t,r,n,i,s){if(ps=s,ms=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ds.current=null===e||null===e.memoizedState?so:oo,e=r(n,i),ys){s=0;do{if(ys=!1,vs=0,25<=s)throw Error(a(301));s+=1,gs=fs=null,t.updateQueue=null,ds.current=lo,e=r(n,i)}while(ys)}if(ds.current=ao,t=null!==fs&&null!==fs.next,ps=0,gs=fs=ms=null,_s=!1,t)throw Error(a(300));return e}function Ss(){var e=0!==vs;return vs=0,e}function ks(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===gs?ms.memoizedState=gs=e:gs=gs.next=e,gs}function js(){if(null===fs){var e=ms.alternate;e=null!==e?e.memoizedState:null}else e=fs.next;var t=null===gs?ms.memoizedState:gs.next;if(null!==t)gs=t,fs=e;else{if(null===e)throw Error(a(310));e={memoizedState:(fs=e).memoizedState,baseState:fs.baseState,baseQueue:fs.baseQueue,queue:fs.queue,next:null},null===gs?ms.memoizedState=gs=e:gs=gs.next=e}return gs}function Es(e,t){return"function"===typeof t?t(e):t}function Ts(e){var t=js(),r=t.queue;if(null===r)throw Error(a(311));r.lastRenderedReducer=e;var n=fs,i=n.baseQueue,s=r.pending;if(null!==s){if(null!==i){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(null!==i){s=i.next,n=n.baseState;var l=o=null,c=null,u=s;do{var d=u.lane;if((ps&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,o=n):c=c.next=h,ms.lanes|=d,Ol|=d}u=u.next}while(null!==u&&u!==s);null===c?o=n:c.next=l,on(n,t.memoizedState)||(xo=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(null!==(e=r.interleaved)){i=e;do{s=i.lane,ms.lanes|=s,Ol|=s,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ps(e){var t=js(),r=t.queue;if(null===r)throw Error(a(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,s=t.memoizedState;if(null!==i){r.pending=null;var o=i=i.next;do{s=e(s,o.action),o=o.next}while(o!==i);on(s,t.memoizedState)||(xo=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function Is(){}function Ms(e,t){var r=ms,n=js(),i=t(),s=!on(n.memoizedState,i);if(s&&(n.memoizedState=i,xo=!0),n=n.queue,Us(Ls.bind(null,r,n,e),[e]),n.getSnapshot!==t||s||null!==gs&&1&gs.memoizedState.tag){if(r.flags|=2048,Rs(9,As.bind(null,r,n,i,t),void 0,null),null===Il)throw Error(a(349));0!==(30&ps)||Ns(r,t,i)}return i}function Ns(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=ms.updateQueue)?(t={lastEffect:null,stores:null},ms.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function As(e,t,r,n){t.value=r,t.getSnapshot=n,Ds(t)&&zs(e)}function Ls(e,t,r){return r((function(){Ds(t)&&zs(e)}))}function Ds(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!on(e,r)}catch(n){return!0}}function zs(e){var t=Pa(e,1);null!==t&&nc(t,e,1,-1)}function Os(e){var t=ks();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:e},t.queue=e,e=e.dispatch=to.bind(null,ms,e),[t.memoizedState,e]}function Rs(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=ms.updateQueue)?(t={lastEffect:null,stores:null},ms.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Fs(){return js().memoizedState}function Bs(e,t,r,n){var i=ks();ms.flags|=e,i.memoizedState=Rs(1|t,r,void 0,void 0===n?null:n)}function Vs(e,t,r,n){var i=js();n=void 0===n?null:n;var a=void 0;if(null!==fs){var s=fs.memoizedState;if(a=s.destroy,null!==n&&ws(n,s.deps))return void(i.memoizedState=Rs(t,r,a,n))}ms.flags|=e,i.memoizedState=Rs(1|t,r,a,n)}function $s(e,t){return Bs(8390656,8,e,t)}function Us(e,t){return Vs(2048,8,e,t)}function Hs(e,t){return Vs(4,2,e,t)}function qs(e,t){return Vs(4,4,e,t)}function Zs(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Gs(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,Vs(4,4,Zs.bind(null,t,e),r)}function Ws(){}function Xs(e,t){var r=js();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&ws(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Js(e,t){var r=js();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&ws(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Ks(e,t,r){return 0===(21&ps)?(e.baseState&&(e.baseState=!1,xo=!0),e.memoizedState=r):(on(r,t)||(r=ft(),ms.lanes|=r,Ol|=r,e.baseState=!0),t)}function Ys(e,t){var r=vt;vt=0!==r&&4>r?r:4,e(!0);var n=hs.transition;hs.transition={};try{e(!1),t()}finally{vt=r,hs.transition=n}}function Qs(){return js().memoizedState}function eo(e,t,r){var n=rc(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ro(e))no(t,r);else if(null!==(r=Ta(e,t,r,n))){nc(r,e,n,tc()),io(r,t,n)}}function to(e,t,r){var n=rc(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ro(e))no(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,o=a(s,r);if(i.hasEagerState=!0,i.eagerState=o,on(o,s)){var l=t.interleaved;return null===l?(i.next=i,Ea(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(c){}null!==(r=Ta(e,t,i,n))&&(nc(r,e,n,i=tc()),io(r,t,n))}}function ro(e){var t=e.alternate;return e===ms||null!==t&&t===ms}function no(e,t){ys=_s=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function io(e,t,r){if(0!==(4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,yt(e,r)}}var ao={readContext:ka,useCallback:bs,useContext:bs,useEffect:bs,useImperativeHandle:bs,useInsertionEffect:bs,useLayoutEffect:bs,useMemo:bs,useReducer:bs,useRef:bs,useState:bs,useDebugValue:bs,useDeferredValue:bs,useTransition:bs,useMutableSource:bs,useSyncExternalStore:bs,useId:bs,unstable_isNewReconciler:!1},so={readContext:ka,useCallback:function(e,t){return ks().memoizedState=[e,void 0===t?null:t],e},useContext:ka,useEffect:$s,useImperativeHandle:function(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,Bs(4194308,4,Zs.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bs(4,2,e,t)},useMemo:function(e,t){var r=ks();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ks();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=eo.bind(null,ms,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},ks().memoizedState=e},useState:Os,useDebugValue:Ws,useDeferredValue:function(e){return ks().memoizedState=e},useTransition:function(){var e=Os(!1),t=e[0];return e=Ys.bind(null,e[1]),ks().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ms,i=ks();if(ia){if(void 0===r)throw Error(a(407));r=r()}else{if(r=t(),null===Il)throw Error(a(349));0!==(30&ps)||Ns(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,$s(Ls.bind(null,n,s,e),[e]),n.flags|=2048,Rs(9,As.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=ks(),t=Il.identifierPrefix;if(ia){var r=Ki;t=":"+t+"R"+(r=(Ji&~(1<<32-st(Ji)-1)).toString(32)+r),0<(r=vs++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=xs++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oo={readContext:ka,useCallback:Xs,useContext:ka,useEffect:Us,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:qs,useMemo:Js,useReducer:Ts,useRef:Fs,useState:function(){return Ts(Es)},useDebugValue:Ws,useDeferredValue:function(e){return Ks(js(),fs.memoizedState,e)},useTransition:function(){return[Ts(Es)[0],js().memoizedState]},useMutableSource:Is,useSyncExternalStore:Ms,useId:Qs,unstable_isNewReconciler:!1},lo={readContext:ka,useCallback:Xs,useContext:ka,useEffect:Us,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:qs,useMemo:Js,useReducer:Ps,useRef:Fs,useState:function(){return Ps(Es)},useDebugValue:Ws,useDeferredValue:function(e){var t=js();return null===fs?t.memoizedState=e:Ks(t,fs.memoizedState,e)},useTransition:function(){return[Ps(Es)[0],js().memoizedState]},useMutableSource:Is,useSyncExternalStore:Ms,useId:Qs,unstable_isNewReconciler:!1};function co(e,t){try{var r="",n=t;do{r+=V(n),n=n.return}while(n);var i=r}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i,digest:null}}function uo(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function ho(e,t){try{console.error(t.value)}catch(r){setTimeout((function(){throw r}))}}var po="function"===typeof WeakMap?WeakMap:Map;function mo(e,t,r){(r=Aa(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ql||(ql=!0,Zl=n),ho(0,t)},r}function fo(e,t,r){(r=Aa(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"===typeof n){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){ho(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(r.callback=function(){ho(0,t),"function"!==typeof n&&(null===Gl?Gl=new Set([this]):Gl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function go(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new po;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=jc.bind(null,e,t,r),t.then(e,e))}function _o(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function yo(e,t,r,n,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=Aa(-1,1)).tag=2,La(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var vo=x.ReactCurrentOwner,xo=!1;function bo(e,t,r,n){t.child=null===e?Ka(t,null,r,n):Ja(t,e.child,r,n)}function wo(e,t,r,n,i){r=r.render;var a=t.ref;return Sa(t,i),n=Cs(e,t,r,n,a,i),r=Ss(),null===e||xo?(ia&&r&&ea(t),t.flags|=1,bo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qo(e,t,i))}function Co(e,t,r,n,i){if(null===e){var a=r.type;return"function"!==typeof a||Ac(a)||void 0!==a.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Dc(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,So(e,t,a,n,i))}if(a=e.child,0===(e.lanes&i)){var s=a.memoizedProps;if((r=null!==(r=r.compare)?r:ln)(s,n)&&e.ref===t.ref)return qo(e,t,i)}return t.flags|=1,(e=Lc(a,n)).ref=t.ref,e.return=t,t.child=e}function So(e,t,r,n,i){if(null!==e){var a=e.memoizedProps;if(ln(a,n)&&e.ref===t.ref){if(xo=!1,t.pendingProps=n=a,0===(e.lanes&i))return t.lanes=e.lanes,qo(e,t,i);0!==(131072&e.flags)&&(xo=!0)}}return Eo(e,t,r,n,i)}function ko(e,t,r){var n=t.pendingProps,i=n.children,a=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ji(Ll,Al),Al|=r;else{if(0===(1073741824&r))return e=null!==a?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ji(Ll,Al),Al|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==a?a.baseLanes:r,ji(Ll,Al),Al|=n}else null!==a?(n=a.baseLanes|r,t.memoizedState=null):n=r,ji(Ll,Al),Al|=n;return bo(e,t,i,r),t.child}function jo(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Eo(e,t,r,n,i){var a=Ni(r)?Ii:Ti.current;return a=Mi(t,a),Sa(t,i),r=Cs(e,t,r,n,a,i),n=Ss(),null===e||xo?(ia&&n&&ea(t),t.flags|=1,bo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qo(e,t,i))}function To(e,t,r,n,i){if(Ni(r)){var a=!0;zi(t)}else a=!1;if(Sa(t,i),null===t.stateNode)Ho(e,t),Ua(t,r,n),qa(t,r,n,i),n=!0;else if(null===e){var s=t.stateNode,o=t.memoizedProps;s.props=o;var l=s.context,c=r.contextType;"object"===typeof c&&null!==c?c=ka(c):c=Mi(t,c=Ni(r)?Ii:Ti.current);var u=r.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof s.getSnapshotBeforeUpdate;d||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o!==n||l!==c)&&Ha(t,s,n,c),Ia=!1;var h=t.memoizedState;s.state=h,Oa(t,n,s,i),l=t.memoizedState,o!==n||h!==l||Pi.current||Ia?("function"===typeof u&&(Ba(t,r,u,n),l=t.memoizedState),(o=Ia||$a(t,r,o,n,h,l,c))?(d||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4194308)):("function"===typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),s.props=n,s.state=l,s.context=c,n=o):("function"===typeof s.componentDidMount&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Na(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:ga(t.type,o),s.props=c,d=t.pendingProps,h=s.context,"object"===typeof(l=r.contextType)&&null!==l?l=ka(l):l=Mi(t,l=Ni(r)?Ii:Ti.current);var p=r.getDerivedStateFromProps;(u="function"===typeof p||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o!==d||h!==l)&&Ha(t,s,n,l),Ia=!1,h=t.memoizedState,s.state=h,Oa(t,n,s,i);var m=t.memoizedState;o!==d||h!==m||Pi.current||Ia?("function"===typeof p&&(Ba(t,r,p,n),m=t.memoizedState),(c=Ia||$a(t,r,c,n,h,m,l)||!1)?(u||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(n,m,l),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,m,l)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof s.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),s.props=n,s.state=m,s.context=l,n=c):("function"!==typeof s.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Po(e,t,r,n,a,i)}function Po(e,t,r,n,i,a){jo(e,t);var s=0!==(128&t.flags);if(!n&&!s)return i&&Oi(t,r,!1),qo(e,t,a);n=t.stateNode,vo.current=t;var o=s&&"function"!==typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&s?(t.child=Ja(t,e.child,null,a),t.child=Ja(t,null,o,a)):bo(e,t,o,a),t.memoizedState=n.state,i&&Oi(t,r,!0),t.child}function Io(e){var t=e.stateNode;t.pendingContext?Li(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Li(0,t.context,!1),ns(e,t.containerInfo)}function Mo(e,t,r,n,i){return pa(),ma(i),t.flags|=256,bo(e,t,r,n),t.child}var No,Ao,Lo,Do,zo={dehydrated:null,treeContext:null,retryLane:0};function Oo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ro(e,t,r){var n,i=t.pendingProps,s=os.current,o=!1,l=0!==(128&t.flags);if((n=l)||(n=(null===e||null!==e.memoizedState)&&0!==(2&s)),n?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),ji(os,1&s),null===e)return ca(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=i.children,e=i.fallback,o?(i=t.mode,o=t.child,l={mode:"hidden",children:l},0===(1&i)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=Oc(l,i,0,null),e=zc(e,i,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Oo(r),t.memoizedState=zo,e):Fo(t,l));if(null!==(s=e.memoizedState)&&null!==(n=s.dehydrated))return function(e,t,r,n,i,s,o){if(r)return 256&t.flags?(t.flags&=-257,Bo(e,t,o,n=uo(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=n.fallback,i=t.mode,n=Oc({mode:"visible",children:n.children},i,0,null),(s=zc(s,i,o,null)).flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,0!==(1&t.mode)&&Ja(t,e.child,null,o),t.child.memoizedState=Oo(o),t.memoizedState=zo,s);if(0===(1&t.mode))return Bo(e,t,o,null);if("$!"===i.data){if(n=i.nextSibling&&i.nextSibling.dataset)var l=n.dgst;return n=l,Bo(e,t,o,n=uo(s=Error(a(419)),n,void 0))}if(l=0!==(o&e.childLanes),xo||l){if(null!==(n=Il)){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(n.suspendedLanes|o))?0:i)&&i!==s.retryLane&&(s.retryLane=i,Pa(e,i),nc(n,e,i,-1))}return gc(),Bo(e,t,o,n=uo(Error(a(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Tc.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,na=ci(i.nextSibling),ra=t,ia=!0,aa=null,null!==e&&(Gi[Wi++]=Ji,Gi[Wi++]=Ki,Gi[Wi++]=Xi,Ji=e.id,Ki=e.overflow,Xi=t),t=Fo(t,n.children),t.flags|=4096,t)}(e,t,l,i,n,s,r);if(o){o=i.fallback,l=t.mode,n=(s=e.child).sibling;var c={mode:"hidden",children:i.children};return 0===(1&l)&&t.child!==s?((i=t.child).childLanes=0,i.pendingProps=c,t.deletions=null):(i=Lc(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==n?o=Lc(n,o):(o=zc(o,l,r,null)).flags|=2,o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,l=null===(l=e.child.memoizedState)?Oo(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~r,t.memoizedState=zo,i}return e=(o=e.child).sibling,i=Lc(o,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Fo(e,t){return(t=Oc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bo(e,t,r,n){return null!==n&&ma(n),Ja(t,e.child,null,r),(e=Fo(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Vo(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Ca(e.return,t,r)}function $o(e,t,r,n,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function Uo(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(bo(e,t,n.children,r),0!==(2&(n=os.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Vo(e,r,t);else if(19===e.tag)Vo(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ji(os,n),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===ls(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),$o(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ls(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}$o(t,!0,r,null,a);break;case"together":$o(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ho(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qo(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Ol|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(r=Lc(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Lc(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Zo(e,t){if(!ia)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Go(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Wo(e,t,r){var n=t.pendingProps;switch(ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Go(t),null;case 1:case 17:return Ni(t.type)&&Ai(),Go(t),null;case 3:return n=t.stateNode,is(),ki(Pi),ki(Ti),us(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(da(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==aa&&(oc(aa),aa=null))),Ao(e,t),Go(t),null;case 5:ss(t);var i=rs(ts.current);if(r=t.type,null!==e&&null!=t.stateNode)Lo(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(a(166));return Go(t),null}if(e=rs(Qa.current),da(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[hi]=t,n[pi]=s,e=0!==(1&t.mode),r){case"dialog":Fn("cancel",n),Fn("close",n);break;case"iframe":case"object":case"embed":Fn("load",n);break;case"video":case"audio":for(i=0;i<Dn.length;i++)Fn(Dn[i],n);break;case"source":Fn("error",n);break;case"img":case"image":case"link":Fn("error",n),Fn("load",n);break;case"details":Fn("toggle",n);break;case"input":J(n,s),Fn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},Fn("invalid",n);break;case"textarea":ie(n,s),Fn("invalid",n)}for(var l in ye(r,s),i=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"===typeof c?n.textContent!==c&&(!0!==s.suppressHydrationWarning&&Yn(n.textContent,c,e),i=["children",c]):"number"===typeof c&&n.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Yn(n.textContent,c,e),i=["children",""+c]):o.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Fn("scroll",n)}switch(r){case"input":Z(n),Q(n,s,!0);break;case"textarea":Z(n),se(n);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(n.onclick=Qn)}n=i,t.updateQueue=n,null!==n&&(t.flags|=4)}else{l=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof n.is?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),"select"===r&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[hi]=t,e[pi]=n,No(e,t,!1,!1),t.stateNode=e;e:{switch(l=ve(r,n),r){case"dialog":Fn("cancel",e),Fn("close",e),i=n;break;case"iframe":case"object":case"embed":Fn("load",e),i=n;break;case"video":case"audio":for(i=0;i<Dn.length;i++)Fn(Dn[i],e);i=n;break;case"source":Fn("error",e),i=n;break;case"img":case"image":case"link":Fn("error",e),Fn("load",e),i=n;break;case"details":Fn("toggle",e),i=n;break;case"input":J(e,n),i=X(e,n),Fn("invalid",e);break;case"option":default:i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=O({},n,{value:void 0}),Fn("invalid",e);break;case"textarea":ie(e,n),i=ne(e,n),Fn("invalid",e)}for(s in ye(r,i),c=i)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?ge(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&de(e,u):"children"===s?"string"===typeof u?("textarea"!==r||""!==u)&&he(e,u):"number"===typeof u&&he(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(o.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Fn("scroll",e):null!=u&&v(e,s,u,l))}switch(r){case"input":Z(e),Q(e,n,!1);break;case"textarea":Z(e),se(e);break;case"option":null!=n.value&&e.setAttribute("value",""+H(n.value));break;case"select":e.multiple=!!n.multiple,null!=(s=n.value)?re(e,!!n.multiple,s,!1):null!=n.defaultValue&&re(e,!!n.multiple,n.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=Qn)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Go(t),null;case 6:if(e&&null!=t.stateNode)Do(e,t,e.memoizedProps,n);else{if("string"!==typeof n&&null===t.stateNode)throw Error(a(166));if(r=rs(ts.current),rs(Qa.current),da(t)){if(n=t.stateNode,r=t.memoizedProps,n[hi]=t,(s=n.nodeValue!==r)&&null!==(e=ra))switch(e.tag){case 3:Yn(n.nodeValue,r,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Yn(n.nodeValue,r,0!==(1&e.mode))}s&&(t.flags|=4)}else(n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[hi]=t,t.stateNode=n}return Go(t),null;case 13:if(ki(os),n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ia&&null!==na&&0!==(1&t.mode)&&0===(128&t.flags))ha(),pa(),t.flags|=98560,s=!1;else if(s=da(t),null!==n&&null!==n.dehydrated){if(null===e){if(!s)throw Error(a(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(a(317));s[hi]=t}else pa(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Go(t),s=!1}else null!==aa&&(oc(aa),aa=null),s=!0;if(!s)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=r,t):((n=null!==n)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&os.current)?0===Dl&&(Dl=3):gc())),null!==t.updateQueue&&(t.flags|=4),Go(t),null);case 4:return is(),Ao(e,t),null===e&&$n(t.stateNode.containerInfo),Go(t),null;case 10:return wa(t.type._context),Go(t),null;case 19:if(ki(os),null===(s=t.memoizedState))return Go(t),null;if(n=0!==(128&t.flags),null===(l=s.rendering))if(n)Zo(s,!1);else{if(0!==Dl||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ls(e))){for(t.flags|=128,Zo(s,!1),null!==(n=l.updateQueue)&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;null!==r;)e=n,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ji(os,1&os.current|2),t.child}e=e.sibling}null!==s.tail&&Ke()>Ul&&(t.flags|=128,n=!0,Zo(s,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=ls(l))){if(t.flags|=128,n=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Zo(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!ia)return Go(t),null}else 2*Ke()-s.renderingStartTime>Ul&&1073741824!==r&&(t.flags|=128,n=!0,Zo(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ke(),t.sibling=null,r=os.current,ji(os,n?1&r|2:1&r),t):(Go(t),null);case 22:case 23:return hc(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!==(1&t.mode)?0!==(1073741824&Al)&&(Go(t),6&t.subtreeFlags&&(t.flags|=8192)):Go(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function Xo(e,t){switch(ta(t),t.tag){case 1:return Ni(t.type)&&Ai(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return is(),ki(Pi),ki(Ti),us(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ss(t),null;case 13:if(ki(os),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));pa()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ki(os),null;case 4:return is(),null;case 10:return wa(t.type._context),null;case 22:case 23:return hc(),null;default:return null}}No=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Ao=function(){},Lo=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,rs(Qa.current);var a,s=null;switch(r){case"input":i=X(e,i),n=X(e,n),s=[];break;case"select":i=O({},i,{value:void 0}),n=O({},n,{value:void 0}),s=[];break;case"textarea":i=ne(e,i),n=ne(e,n),s=[];break;default:"function"!==typeof i.onClick&&"function"===typeof n.onClick&&(e.onclick=Qn)}for(u in ye(r,n),r=null,i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var l=i[u];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(o.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var c=n[u];if(l=null!=i?i[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(s||(s=[]),s.push(u,r)),r=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!==typeof c&&"number"!==typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(o.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Fn("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}r&&(s=s||[]).push("style",r);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},Do=function(e,t,r,n){r!==n&&(t.flags|=4)};var Jo=!1,Ko=!1,Yo="function"===typeof WeakSet?WeakSet:Set,Qo=null;function el(e,t){var r=e.ref;if(null!==r)if("function"===typeof r)try{r(null)}catch(n){kc(e,t,n)}else r.current=null}function tl(e,t,r){try{r()}catch(n){kc(e,t,n)}}var rl=!1;function nl(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&tl(t,r,a)}i=i.next}while(i!==n)}}function il(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function al(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"===typeof t?t(e):t.current=e}}function sl(e){var t=e.alternate;null!==t&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[hi],delete t[pi],delete t[fi],delete t[gi],delete t[_i])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ol(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function cl(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!==(r=r._reactRootContainer)&&void 0!==r||null!==t.onclick||(t.onclick=Qn));else if(4!==n&&null!==(e=e.child))for(cl(e,t,r),e=e.sibling;null!==e;)cl(e,t,r),e=e.sibling}function ul(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(ul(e,t,r),e=e.sibling;null!==e;)ul(e,t,r),e=e.sibling}var dl=null,hl=!1;function pl(e,t,r){for(r=r.child;null!==r;)ml(e,t,r),r=r.sibling}function ml(e,t,r){if(at&&"function"===typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(it,r)}catch(o){}switch(r.tag){case 5:Ko||el(r,t);case 6:var n=dl,i=hl;dl=null,pl(e,t,r),hl=i,null!==(dl=n)&&(hl?(e=dl,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):dl.removeChild(r.stateNode));break;case 18:null!==dl&&(hl?(e=dl,r=r.stateNode,8===e.nodeType?li(e.parentNode,r):1===e.nodeType&&li(e,r),$t(e)):li(dl,r.stateNode));break;case 4:n=dl,i=hl,dl=r.stateNode.containerInfo,hl=!0,pl(e,t,r),dl=n,hl=i;break;case 0:case 11:case 14:case 15:if(!Ko&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var a=i,s=a.destroy;a=a.tag,void 0!==s&&(0!==(2&a)||0!==(4&a))&&tl(r,t,s),i=i.next}while(i!==n)}pl(e,t,r);break;case 1:if(!Ko&&(el(r,t),"function"===typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){kc(r,t,o)}pl(e,t,r);break;case 21:pl(e,t,r);break;case 22:1&r.mode?(Ko=(n=Ko)||null!==r.memoizedState,pl(e,t,r),Ko=n):pl(e,t,r);break;default:pl(e,t,r)}}function fl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Yo),t.forEach((function(t){var n=Pc.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function gl(e,t){var r=t.deletions;if(null!==r)for(var n=0;n<r.length;n++){var i=r[n];try{var s=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 5:dl=l.stateNode,hl=!1;break e;case 3:case 4:dl=l.stateNode.containerInfo,hl=!0;break e}l=l.return}if(null===dl)throw Error(a(160));ml(s,o,i),dl=null,hl=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(u){kc(i,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)_l(t,e),t=t.sibling}function _l(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gl(t,e),yl(e),4&n){try{nl(3,e,e.return),il(3,e)}catch(g){kc(e,e.return,g)}try{nl(5,e,e.return)}catch(g){kc(e,e.return,g)}}break;case 1:gl(t,e),yl(e),512&n&&null!==r&&el(r,r.return);break;case 5:if(gl(t,e),yl(e),512&n&&null!==r&&el(r,r.return),32&e.flags){var i=e.stateNode;try{he(i,"")}catch(g){kc(e,e.return,g)}}if(4&n&&null!=(i=e.stateNode)){var s=e.memoizedProps,o=null!==r?r.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===s.type&&null!=s.name&&K(i,s),ve(l,o);var u=ve(l,s);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];"style"===d?ge(i,h):"dangerouslySetInnerHTML"===d?de(i,h):"children"===d?he(i,h):v(i,d,h,u)}switch(l){case"input":Y(i,s);break;case"textarea":ae(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;null!=m?re(i,!!s.multiple,m,!1):p!==!!s.multiple&&(null!=s.defaultValue?re(i,!!s.multiple,s.defaultValue,!0):re(i,!!s.multiple,s.multiple?[]:"",!1))}i[pi]=s}catch(g){kc(e,e.return,g)}}break;case 6:if(gl(t,e),yl(e),4&n){if(null===e.stateNode)throw Error(a(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(g){kc(e,e.return,g)}}break;case 3:if(gl(t,e),yl(e),4&n&&null!==r&&r.memoizedState.isDehydrated)try{$t(t.containerInfo)}catch(g){kc(e,e.return,g)}break;case 4:default:gl(t,e),yl(e);break;case 13:gl(t,e),yl(e),8192&(i=e.child).flags&&(s=null!==i.memoizedState,i.stateNode.isHidden=s,!s||null!==i.alternate&&null!==i.alternate.memoizedState||($l=Ke())),4&n&&fl(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(Ko=(u=Ko)||d,gl(t,e),Ko=u):gl(t,e),yl(e),8192&n){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!==(1&e.mode))for(Qo=e,d=e.child;null!==d;){for(h=Qo=d;null!==Qo;){switch(m=(p=Qo).child,p.tag){case 0:case 11:case 14:case 15:nl(4,p,p.return);break;case 1:el(p,p.return);var f=p.stateNode;if("function"===typeof f.componentWillUnmount){n=p,r=p.return;try{t=n,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(g){kc(n,r,g)}}break;case 5:el(p,p.return);break;case 22:if(null!==p.memoizedState){wl(h);continue}}null!==m?(m.return=p,Qo=m):wl(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{i=h.stateNode,u?"function"===typeof(s=i.style).setProperty?s.setProperty("display","none","important"):s.display="none":(l=h.stateNode,o=void 0!==(c=h.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=fe("display",o))}catch(g){kc(e,e.return,g)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(g){kc(e,e.return,g)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:gl(t,e),yl(e),4&n&&fl(e);case 21:}}function yl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(ol(r)){var n=r;break e}r=r.return}throw Error(a(160))}switch(n.tag){case 5:var i=n.stateNode;32&n.flags&&(he(i,""),n.flags&=-33),ul(e,ll(e),i);break;case 3:case 4:var s=n.stateNode.containerInfo;cl(e,ll(e),s);break;default:throw Error(a(161))}}catch(o){kc(e,e.return,o)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function vl(e,t,r){Qo=e,xl(e,t,r)}function xl(e,t,r){for(var n=0!==(1&e.mode);null!==Qo;){var i=Qo,a=i.child;if(22===i.tag&&n){var s=null!==i.memoizedState||Jo;if(!s){var o=i.alternate,l=null!==o&&null!==o.memoizedState||Ko;o=Jo;var c=Ko;if(Jo=s,(Ko=l)&&!c)for(Qo=i;null!==Qo;)l=(s=Qo).child,22===s.tag&&null!==s.memoizedState?Cl(i):null!==l?(l.return=s,Qo=l):Cl(i);for(;null!==a;)Qo=a,xl(a,t,r),a=a.sibling;Qo=i,Jo=o,Ko=c}bl(e)}else 0!==(8772&i.subtreeFlags)&&null!==a?(a.return=i,Qo=a):bl(e)}}function bl(e){for(;null!==Qo;){var t=Qo;if(0!==(8772&t.flags)){var r=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Ko||il(5,t);break;case 1:var n=t.stateNode;if(4&t.flags&&!Ko)if(null===r)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:ga(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Ra(t,s,n);break;case 3:var o=t.updateQueue;if(null!==o){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Ra(t,o,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&$t(h)}}}break;default:throw Error(a(163))}Ko||512&t.flags&&al(t)}catch(p){kc(t,t.return,p)}}if(t===e){Qo=null;break}if(null!==(r=t.sibling)){r.return=t.return,Qo=r;break}Qo=t.return}}function wl(e){for(;null!==Qo;){var t=Qo;if(t===e){Qo=null;break}var r=t.sibling;if(null!==r){r.return=t.return,Qo=r;break}Qo=t.return}}function Cl(e){for(;null!==Qo;){var t=Qo;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{il(4,t)}catch(l){kc(t,r,l)}break;case 1:var n=t.stateNode;if("function"===typeof n.componentDidMount){var i=t.return;try{n.componentDidMount()}catch(l){kc(t,i,l)}}var a=t.return;try{al(t)}catch(l){kc(t,a,l)}break;case 5:var s=t.return;try{al(t)}catch(l){kc(t,s,l)}}}catch(l){kc(t,t.return,l)}if(t===e){Qo=null;break}var o=t.sibling;if(null!==o){o.return=t.return,Qo=o;break}Qo=t.return}}var Sl,kl=Math.ceil,jl=x.ReactCurrentDispatcher,El=x.ReactCurrentOwner,Tl=x.ReactCurrentBatchConfig,Pl=0,Il=null,Ml=null,Nl=0,Al=0,Ll=Si(0),Dl=0,zl=null,Ol=0,Rl=0,Fl=0,Bl=null,Vl=null,$l=0,Ul=1/0,Hl=null,ql=!1,Zl=null,Gl=null,Wl=!1,Xl=null,Jl=0,Kl=0,Yl=null,Ql=-1,ec=0;function tc(){return 0!==(6&Pl)?Ke():-1!==Ql?Ql:Ql=Ke()}function rc(e){return 0===(1&e.mode)?1:0!==(2&Pl)&&0!==Nl?Nl&-Nl:null!==fa.transition?(0===ec&&(ec=ft()),ec):0!==(e=vt)?e:e=void 0===(e=window.event)?16:Jt(e.type)}function nc(e,t,r,n){if(50<Kl)throw Kl=0,Yl=null,Error(a(185));_t(e,r,n),0!==(2&Pl)&&e===Il||(e===Il&&(0===(2&Pl)&&(Rl|=r),4===Dl&&lc(e,Nl)),ic(e,n),1===r&&0===Pl&&0===(1&t.mode)&&(Ul=Ke()+500,Fi&&$i()))}function ic(e,t){var r=e.callbackNode;!function(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-st(a),o=1<<s,l=i[s];-1===l?0!==(o&r)&&0===(o&n)||(i[s]=pt(o,t)):l<=t&&(e.expiredLanes|=o),a&=~o}}(e,t);var n=ht(e,e===Il?Nl:0);if(0===n)null!==r&&We(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(null!=r&&We(r),1===t)0===e.tag?function(e){Fi=!0,Vi(e)}(cc.bind(null,e)):Vi(cc.bind(null,e)),si((function(){0===(6&Pl)&&$i()})),r=null;else{switch(xt(n)){case 1:r=Qe;break;case 4:r=et;break;case 16:default:r=tt;break;case 536870912:r=nt}r=Ic(r,ac.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function ac(e,t){if(Ql=-1,ec=0,0!==(6&Pl))throw Error(a(327));var r=e.callbackNode;if(Cc()&&e.callbackNode!==r)return null;var n=ht(e,e===Il?Nl:0);if(0===n)return null;if(0!==(30&n)||0!==(n&e.expiredLanes)||t)t=_c(e,n);else{t=n;var i=Pl;Pl|=2;var s=fc();for(Il===e&&Nl===t||(Hl=null,Ul=Ke()+500,pc(e,t));;)try{vc();break}catch(l){mc(e,l)}ba(),jl.current=s,Pl=i,null!==Ml?t=0:(Il=null,Nl=0,t=Dl)}if(0!==t){if(2===t&&(0!==(i=mt(e))&&(n=i,t=sc(e,i))),1===t)throw r=zl,pc(e,0),lc(e,n),ic(e,Ke()),r;if(6===t)lc(e,n);else{if(i=e.current.alternate,0===(30&n)&&!function(e){for(var t=e;;){if(16384&t.flags){var r=t.updateQueue;if(null!==r&&null!==(r=r.stores))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!on(a(),i))return!1}catch(o){return!1}}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=_c(e,n))&&(0!==(s=mt(e))&&(n=s,t=sc(e,s))),1===t))throw r=zl,pc(e,0),lc(e,n),ic(e,Ke()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(a(345));case 2:case 5:wc(e,Vl,Hl);break;case 3:if(lc(e,n),(130023424&n)===n&&10<(t=$l+500-Ke())){if(0!==ht(e,0))break;if(((i=e.suspendedLanes)&n)!==n){tc(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ni(wc.bind(null,e,Vl,Hl),t);break}wc(e,Vl,Hl);break;case 4:if(lc(e,n),(4194240&n)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-st(n);s=1<<o,(o=t[o])>i&&(i=o),n&=~s}if(n=i,10<(n=(120>(n=Ke()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*kl(n/1960))-n)){e.timeoutHandle=ni(wc.bind(null,e,Vl,Hl),n);break}wc(e,Vl,Hl);break;default:throw Error(a(329))}}}return ic(e,Ke()),e.callbackNode===r?ac.bind(null,e):null}function sc(e,t){var r=Bl;return e.current.memoizedState.isDehydrated&&(pc(e,t).flags|=256),2!==(e=_c(e,t))&&(t=Vl,Vl=r,null!==t&&oc(t)),e}function oc(e){null===Vl?Vl=e:Vl.push.apply(Vl,e)}function lc(e,t){for(t&=~Fl,t&=~Rl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-st(t),n=1<<r;e[r]=-1,t&=~n}}function cc(e){if(0!==(6&Pl))throw Error(a(327));Cc();var t=ht(e,0);if(0===(1&t))return ic(e,Ke()),null;var r=_c(e,t);if(0!==e.tag&&2===r){var n=mt(e);0!==n&&(t=n,r=sc(e,n))}if(1===r)throw r=zl,pc(e,0),lc(e,t),ic(e,Ke()),r;if(6===r)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wc(e,Vl,Hl),ic(e,Ke()),null}function uc(e,t){var r=Pl;Pl|=1;try{return e(t)}finally{0===(Pl=r)&&(Ul=Ke()+500,Fi&&$i())}}function dc(e){null!==Xl&&0===Xl.tag&&0===(6&Pl)&&Cc();var t=Pl;Pl|=1;var r=Tl.transition,n=vt;try{if(Tl.transition=null,vt=1,e)return e()}finally{vt=n,Tl.transition=r,0===(6&(Pl=t))&&$i()}}function hc(){Al=Ll.current,ki(Ll)}function pc(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,ii(r)),null!==Ml)for(r=Ml.return;null!==r;){var n=r;switch(ta(n),n.tag){case 1:null!==(n=n.type.childContextTypes)&&void 0!==n&&Ai();break;case 3:is(),ki(Pi),ki(Ti),us();break;case 5:ss(n);break;case 4:is();break;case 13:case 19:ki(os);break;case 10:wa(n.type._context);break;case 22:case 23:hc()}r=r.return}if(Il=e,Ml=e=Lc(e.current,null),Nl=Al=t,Dl=0,zl=null,Fl=Rl=Ol=0,Vl=Bl=null,null!==ja){for(t=0;t<ja.length;t++)if(null!==(n=(r=ja[t]).interleaved)){r.interleaved=null;var i=n.next,a=r.pending;if(null!==a){var s=a.next;a.next=i,n.next=s}r.pending=n}ja=null}return e}function mc(e,t){for(;;){var r=Ml;try{if(ba(),ds.current=ao,_s){for(var n=ms.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}_s=!1}if(ps=0,gs=fs=ms=null,ys=!1,vs=0,El.current=null,null===r||null===r.return){Dl=1,zl=t,Ml=null;break}e:{var s=e,o=r.return,l=r,c=t;if(t=Nl,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c,d=l,h=d.tag;if(0===(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=_o(o);if(null!==m){m.flags&=-257,yo(m,o,l,0,t),1&m.mode&&go(s,u,t),c=u;var f=(t=m).updateQueue;if(null===f){var g=new Set;g.add(c),t.updateQueue=g}else f.add(c);break e}if(0===(1&t)){go(s,u,t),gc();break e}c=Error(a(426))}else if(ia&&1&l.mode){var _=_o(o);if(null!==_){0===(65536&_.flags)&&(_.flags|=256),yo(_,o,l,0,t),ma(co(c,l));break e}}s=c=co(c,l),4!==Dl&&(Dl=2),null===Bl?Bl=[s]:Bl.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,za(s,mo(0,c,t));break e;case 1:l=c;var y=s.type,v=s.stateNode;if(0===(128&s.flags)&&("function"===typeof y.getDerivedStateFromError||null!==v&&"function"===typeof v.componentDidCatch&&(null===Gl||!Gl.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t,za(s,fo(s,l,t));break e}}s=s.return}while(null!==s)}bc(r)}catch(x){t=x,Ml===r&&null!==r&&(Ml=r=r.return);continue}break}}function fc(){var e=jl.current;return jl.current=ao,null===e?ao:e}function gc(){0!==Dl&&3!==Dl&&2!==Dl||(Dl=4),null===Il||0===(268435455&Ol)&&0===(268435455&Rl)||lc(Il,Nl)}function _c(e,t){var r=Pl;Pl|=2;var n=fc();for(Il===e&&Nl===t||(Hl=null,pc(e,t));;)try{yc();break}catch(i){mc(e,i)}if(ba(),Pl=r,jl.current=n,null!==Ml)throw Error(a(261));return Il=null,Nl=0,Dl}function yc(){for(;null!==Ml;)xc(Ml)}function vc(){for(;null!==Ml&&!Xe();)xc(Ml)}function xc(e){var t=Sl(e.alternate,e,Al);e.memoizedProps=e.pendingProps,null===t?bc(e):Ml=t,El.current=null}function bc(e){var t=e;do{var r=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(r=Wo(r,t,Al)))return void(Ml=r)}else{if(null!==(r=Xo(r,t)))return r.flags&=32767,void(Ml=r);if(null===e)return Dl=6,void(Ml=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Ml=t);Ml=t=e}while(null!==t);0===Dl&&(Dl=5)}function wc(e,t,r){var n=vt,i=Tl.transition;try{Tl.transition=null,vt=1,function(e,t,r,n){do{Cc()}while(null!==Xl);if(0!==(6&Pl))throw Error(a(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(function(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-st(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}(e,s),e===Il&&(Ml=Il=null,Nl=0),0===(2064&r.subtreeFlags)&&0===(2064&r.flags)||Wl||(Wl=!0,Ic(tt,(function(){return Cc(),null}))),s=0!==(15990&r.flags),0!==(15990&r.subtreeFlags)||s){s=Tl.transition,Tl.transition=null;var o=vt;vt=1;var l=Pl;Pl|=4,El.current=null,function(e,t){if(ei=Ht,pn(e=hn())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(n&&0!==n.rangeCount){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch(b){r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var m;h!==r||0!==i&&3!==h.nodeType||(l=o+i),h!==s||0!==n&&3!==h.nodeType||(c=o+n),3===h.nodeType&&(o+=h.nodeValue.length),null!==(m=h.firstChild);)p=h,h=m;for(;;){if(h===e)break t;if(p===r&&++u===i&&(l=o),p===s&&++d===n&&(c=o),null!==(m=h.nextSibling))break;p=(h=p).parentNode}h=m}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(ti={focusedElem:e,selectionRange:r},Ht=!1,Qo=t;null!==Qo;)if(e=(t=Qo).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Qo=e;else for(;null!==Qo;){t=Qo;try{var f=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==f){var g=f.memoizedProps,_=f.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:ga(t.type,g),_);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(a(163))}}catch(b){kc(t,t.return,b)}if(null!==(e=t.sibling)){e.return=t.return,Qo=e;break}Qo=t.return}f=rl,rl=!1}(e,r),_l(r,e),mn(ti),Ht=!!ei,ti=ei=null,e.current=r,vl(r,e,i),Je(),Pl=l,vt=o,Tl.transition=s}else e.current=r;if(Wl&&(Wl=!1,Xl=e,Jl=i),s=e.pendingLanes,0===s&&(Gl=null),function(e){if(at&&"function"===typeof at.onCommitFiberRoot)try{at.onCommitFiberRoot(it,e,void 0,128===(128&e.current.flags))}catch(t){}}(r.stateNode),ic(e,Ke()),null!==t)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(ql)throw ql=!1,e=Zl,Zl=null,e;0!==(1&Jl)&&0!==e.tag&&Cc(),s=e.pendingLanes,0!==(1&s)?e===Yl?Kl++:(Kl=0,Yl=e):Kl=0,$i()}(e,t,r,n)}finally{Tl.transition=i,vt=n}return null}function Cc(){if(null!==Xl){var e=xt(Jl),t=Tl.transition,r=vt;try{if(Tl.transition=null,vt=16>e?16:e,null===Xl)var n=!1;else{if(e=Xl,Xl=null,Jl=0,0!==(6&Pl))throw Error(a(331));var i=Pl;for(Pl|=4,Qo=e.current;null!==Qo;){var s=Qo,o=s.child;if(0!==(16&Qo.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(Qo=u;null!==Qo;){var d=Qo;switch(d.tag){case 0:case 11:case 15:nl(8,d,s)}var h=d.child;if(null!==h)h.return=d,Qo=h;else for(;null!==Qo;){var p=(d=Qo).sibling,m=d.return;if(sl(d),d===u){Qo=null;break}if(null!==p){p.return=m,Qo=p;break}Qo=m}}}var f=s.alternate;if(null!==f){var g=f.child;if(null!==g){f.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(null!==g)}}Qo=s}}if(0!==(2064&s.subtreeFlags)&&null!==o)o.return=s,Qo=o;else e:for(;null!==Qo;){if(0!==(2048&(s=Qo).flags))switch(s.tag){case 0:case 11:case 15:nl(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,Qo=y;break e}Qo=s.return}}var v=e.current;for(Qo=v;null!==Qo;){var x=(o=Qo).child;if(0!==(2064&o.subtreeFlags)&&null!==x)x.return=o,Qo=x;else e:for(o=v;null!==Qo;){if(0!==(2048&(l=Qo).flags))try{switch(l.tag){case 0:case 11:case 15:il(9,l)}}catch(w){kc(l,l.return,w)}if(l===o){Qo=null;break e}var b=l.sibling;if(null!==b){b.return=l.return,Qo=b;break e}Qo=l.return}}if(Pl=i,$i(),at&&"function"===typeof at.onPostCommitFiberRoot)try{at.onPostCommitFiberRoot(it,e)}catch(w){}n=!0}return n}finally{vt=r,Tl.transition=t}}return!1}function Sc(e,t,r){e=La(e,t=mo(0,t=co(r,t),1),1),t=tc(),null!==e&&(_t(e,1,t),ic(e,t))}function kc(e,t,r){if(3===e.tag)Sc(e,e,r);else for(;null!==t;){if(3===t.tag){Sc(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===Gl||!Gl.has(n))){t=La(t,e=fo(t,e=co(r,e),1),1),e=tc(),null!==t&&(_t(t,1,e),ic(t,e));break}}t=t.return}}function jc(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=tc(),e.pingedLanes|=e.suspendedLanes&r,Il===e&&(Nl&r)===r&&(4===Dl||3===Dl&&(130023424&Nl)===Nl&&500>Ke()-$l?pc(e,0):Fl|=r),ic(e,t)}function Ec(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ut,0===(130023424&(ut<<=1))&&(ut=4194304)));var r=tc();null!==(e=Pa(e,t))&&(_t(e,t,r),ic(e,r))}function Tc(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),Ec(e,r)}function Pc(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(a(314))}null!==n&&n.delete(t),Ec(e,r)}function Ic(e,t){return Ge(e,t)}function Mc(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nc(e,t,r,n){return new Mc(e,t,r,n)}function Ac(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Lc(e,t){var r=e.alternate;return null===r?((r=Nc(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Dc(e,t,r,n,i,s){var o=2;if(n=e,"function"===typeof e)Ac(e)&&(o=1);else if("string"===typeof e)o=5;else e:switch(e){case C:return zc(r.children,i,s,t);case S:o=8,i|=8;break;case k:return(e=Nc(12,r,t,2|i)).elementType=k,e.lanes=s,e;case P:return(e=Nc(13,r,t,i)).elementType=P,e.lanes=s,e;case I:return(e=Nc(19,r,t,i)).elementType=I,e.lanes=s,e;case A:return Oc(r,i,s,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case j:o=10;break e;case E:o=9;break e;case T:o=11;break e;case M:o=14;break e;case N:o=16,n=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Nc(o,r,t,i)).elementType=e,t.type=n,t.lanes=s,t}function zc(e,t,r,n){return(e=Nc(7,e,n,t)).lanes=r,e}function Oc(e,t,r,n){return(e=Nc(22,e,n,t)).elementType=A,e.lanes=r,e.stateNode={isHidden:!1},e}function Rc(e,t,r){return(e=Nc(6,e,null,t)).lanes=r,e}function Fc(e,t,r){return(t=Nc(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bc(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Vc(e,t,r,n,i,a,s,o,l){return e=new Bc(e,t,r,o,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Nc(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ma(a),e}function $c(e){if(!e)return Ei;e:{if($e(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ni(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var r=e.type;if(Ni(r))return Di(e,r,t)}return t}function Uc(e,t,r,n,i,a,s,o,l){return(e=Vc(r,n,!0,e,0,a,0,o,l)).context=$c(null),r=e.current,(a=Aa(n=tc(),i=rc(r))).callback=void 0!==t&&null!==t?t:null,La(r,a,i),e.current.lanes=i,_t(e,i,n),ic(e,n),e}function Hc(e,t,r,n){var i=t.current,a=tc(),s=rc(i);return r=$c(r),null===t.context?t.context=r:t.pendingContext=r,(t=Aa(a,s)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=La(i,t,s))&&(nc(e,i,s,a),Da(e,i,s)),s}function qc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Zc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function Gc(e,t){Zc(e,t),(e=e.alternate)&&Zc(e,t)}Sl=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||Pi.current)xo=!0;else{if(0===(e.lanes&r)&&0===(128&t.flags))return xo=!1,function(e,t,r){switch(t.tag){case 3:Io(t),pa();break;case 5:as(t);break;case 1:Ni(t.type)&&zi(t);break;case 4:ns(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;ji(_a,n._currentValue),n._currentValue=i;break;case 13:if(null!==(n=t.memoizedState))return null!==n.dehydrated?(ji(os,1&os.current),t.flags|=128,null):0!==(r&t.child.childLanes)?Ro(e,t,r):(ji(os,1&os.current),null!==(e=qo(e,t,r))?e.sibling:null);ji(os,1&os.current);break;case 19:if(n=0!==(r&t.childLanes),0!==(128&e.flags)){if(n)return Uo(e,t,r);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),ji(os,os.current),n)break;return null;case 22:case 23:return t.lanes=0,ko(e,t,r)}return qo(e,t,r)}(e,t,r);xo=0!==(131072&e.flags)}else xo=!1,ia&&0!==(1048576&t.flags)&&Qi(t,Zi,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ho(e,t),e=t.pendingProps;var i=Mi(t,Ti.current);Sa(t,r),i=Cs(null,t,n,e,i,r);var s=Ss();return t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ni(n)?(s=!0,zi(t)):s=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ma(t),i.updater=Va,t.stateNode=i,i._reactInternals=t,qa(t,n,e,r),t=Po(null,t,n,!0,s,r)):(t.tag=0,ia&&s&&ea(t),bo(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ho(e,t),e=t.pendingProps,n=(i=n._init)(n._payload),t.type=n,i=t.tag=function(e){if("function"===typeof e)return Ac(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===T)return 11;if(e===M)return 14}return 2}(n),e=ga(n,e),i){case 0:t=Eo(null,t,n,e,r);break e;case 1:t=To(null,t,n,e,r);break e;case 11:t=wo(null,t,n,e,r);break e;case 14:t=Co(null,t,n,ga(n.type,e),r);break e}throw Error(a(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,Eo(e,t,n,i=t.elementType===n?i:ga(n,i),r);case 1:return n=t.type,i=t.pendingProps,To(e,t,n,i=t.elementType===n?i:ga(n,i),r);case 3:e:{if(Io(t),null===e)throw Error(a(387));n=t.pendingProps,i=(s=t.memoizedState).element,Na(e,t),Oa(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated){if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Mo(e,t,n,r,i=co(Error(a(423)),t));break e}if(n!==i){t=Mo(e,t,n,r,i=co(Error(a(424)),t));break e}for(na=ci(t.stateNode.containerInfo.firstChild),ra=t,ia=!0,aa=null,r=Ka(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(pa(),n===i){t=qo(e,t,r);break e}bo(e,t,n,r)}t=t.child}return t;case 5:return as(t),null===e&&ca(t),n=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,o=i.children,ri(n,i)?o=null:null!==s&&ri(n,s)&&(t.flags|=32),jo(e,t),bo(e,t,o,r),t.child;case 6:return null===e&&ca(t),null;case 13:return Ro(e,t,r);case 4:return ns(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=Ja(t,null,n,r):bo(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,wo(e,t,n,i=t.elementType===n?i:ga(n,i),r);case 7:return bo(e,t,t.pendingProps,r),t.child;case 8:case 12:return bo(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,ji(_a,n._currentValue),n._currentValue=o,null!==s)if(on(s.value,o)){if(s.children===i.children&&!Pi.current){t=qo(e,t,r);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){o=s.child;for(var c=l.firstContext;null!==c;){if(c.context===n){if(1===s.tag){(c=Aa(-1,r&-r)).tag=2;var u=s.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=r,null!==(c=s.alternate)&&(c.lanes|=r),Ca(s.return,r,t),l.lanes|=r;break}c=c.next}}else if(10===s.tag)o=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(o=s.return))throw Error(a(341));o.lanes|=r,null!==(l=o.alternate)&&(l.lanes|=r),Ca(o,r,t),o=s.sibling}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===t){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}bo(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Sa(t,r),n=n(i=ka(i)),t.flags|=1,bo(e,t,n,r),t.child;case 14:return i=ga(n=t.type,t.pendingProps),Co(e,t,n,i=ga(n.type,i),r);case 15:return So(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ga(n,i),Ho(e,t),t.tag=1,Ni(n)?(e=!0,zi(t)):e=!1,Sa(t,r),Ua(t,n,i),qa(t,n,i,r),Po(null,t,n,!0,e,r);case 19:return Uo(e,t,r);case 22:return ko(e,t,r)}throw Error(a(156,t.tag))};var Wc="function"===typeof reportError?reportError:function(e){console.error(e)};function Xc(e){this._internalRoot=e}function Jc(e){this._internalRoot=e}function Kc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Qc(){}function eu(e,t,r,n,i){var a=r._reactRootContainer;if(a){var s=a;if("function"===typeof i){var o=i;i=function(){var e=qc(s);o.call(e)}}Hc(t,s,e,i)}else s=function(e,t,r,n,i){if(i){if("function"===typeof n){var a=n;n=function(){var e=qc(s);a.call(e)}}var s=Uc(t,n,e,0,null,!1,0,"",Qc);return e._reactRootContainer=s,e[mi]=s.current,$n(8===e.nodeType?e.parentNode:e),dc(),s}for(;i=e.lastChild;)e.removeChild(i);if("function"===typeof n){var o=n;n=function(){var e=qc(l);o.call(e)}}var l=Vc(e,0,!1,null,0,!1,0,"",Qc);return e._reactRootContainer=l,e[mi]=l.current,$n(8===e.nodeType?e.parentNode:e),dc((function(){Hc(t,l,r,n)})),l}(r,t,e,i,n);return qc(s)}Jc.prototype.render=Xc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));Hc(e,t,null,null)},Jc.prototype.unmount=Xc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;dc((function(){Hc(null,e,null,null)})),t[mi]=null}},Jc.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var r=0;r<At.length&&0!==t&&t<At[r].priority;r++);At.splice(r,0,e),0===r&&Ot(e)}},bt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=dt(t.pendingLanes);0!==r&&(yt(t,1|r),ic(t,Ke()),0===(6&Pl)&&(Ul=Ke()+500,$i()))}break;case 13:dc((function(){var t=Pa(e,1);if(null!==t){var r=tc();nc(t,e,1,r)}})),Gc(e,1)}},wt=function(e){if(13===e.tag){var t=Pa(e,134217728);if(null!==t)nc(t,e,134217728,tc());Gc(e,134217728)}},Ct=function(e){if(13===e.tag){var t=rc(e),r=Pa(e,t);if(null!==r)nc(r,e,t,tc());Gc(e,t)}},St=function(){return vt},kt=function(e,t){var r=vt;try{return vt=e,t()}finally{vt=r}},we=function(e,t,r){switch(t){case"input":if(Y(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=bi(n);if(!i)throw Error(a(90));G(n),Y(n,i)}}}break;case"textarea":ae(e,r);break;case"select":null!=(t=r.value)&&re(e,!!r.multiple,t,!1)}},Te=uc,Pe=dc;var tu={usingClientEntryPoint:!1,Events:[vi,xi,bi,je,Ee,uc]},ru={findFiberByHostInstance:yi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},nu={bundleType:ru.bundleType,version:ru.version,rendererPackageName:ru.rendererPackageName,rendererConfig:ru.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=qe(e))?null:e.stateNode},findFiberByHostInstance:ru.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{it=iu.inject(nu),at=iu}catch(ue){}}
2t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tu,t.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Kc(t))throw Error(a(200));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:w,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,r)},t.createRoot=function(e,t){if(!Kc(e))throw Error(a(299));var r=!1,n="",i=Wc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(n=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Vc(e,1,!1,null,0,r,0,n,i),e[mi]=t.current,$n(8===e.nodeType?e.parentNode:e),new Xc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=null===(e=qe(t))?null:e.stateNode},t.flushSync=function(e){return dc(e)},t.hydrate=function(e,t,r){if(!Yc(t))throw Error(a(200));return eu(null,e,t,!0,r)},t.hydrateRoot=function(e,t,r){if(!Kc(e))throw Error(a(405));var n=null!=r&&r.hydratedSources||null,i=!1,s="",o=Wc;if(null!==r&&void 0!==r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(s=r.identifierPrefix),void 0!==r.onRecoverableError&&(o=r.onRecoverableError)),t=Uc(t,null,e,1,null!=r?r:null,i,0,s,o),e[mi]=t.current,$n(e),n)for(e=0;e<n.length;e++)i=(i=(r=n[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Jc(t)},t.render=function(e,t,r){if(!Yc(t))throw Error(a(200));return eu(null,e,t,!1,r)},t.unmountComponentAtNode=function(e){if(!Yc(e))throw Error(a(40));return!!e._reactRootContainer&&(dc((function(){eu(null,null,e,!1,(function(){e._reactRootContainer=null,e[mi]=null}))})),!0)},t.unstable_batchedUpdates=uc,t.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Yc(r))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return eu(e,t,r,!1,n)},t.version="18.2.0-next-9e3b772b8-20220608"},4391:function(e,t,r){"use strict";var n=r(7950);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},7950:function(e,t,r){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(2730)},6366:function(e){var t="undefined"!==typeof Element,r="function"===typeof Map,n="function"===typeof Set,i="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,s){if(e===s)return!0;if(e&&s&&"object"==typeof e&&"object"==typeof s){if(e.constructor!==s.constructor)return!1;var o,l,c,u;if(Array.isArray(e)){if((o=e.length)!=s.length)return!1;for(l=o;0!==l--;)if(!a(e[l],s[l]))return!1;return!0}if(r&&e instanceof Map&&s instanceof Map){if(e.size!==s.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!s.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!a(l.value[1],s.get(l.value[0])))return!1;return!0}if(n&&e instanceof Set&&s instanceof Set){if(e.size!==s.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!s.has(l.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(s)){if((o=e.length)!=s.length)return!1;for(l=o;0!==l--;)if(e[l]!==s[l])return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"===typeof e.valueOf&&"function"===typeof s.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString&&"function"===typeof e.toString&&"function"===typeof s.toString)return e.toString()===s.toString();if((o=(c=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(l=o;0!==l--;)if(!Object.prototype.hasOwnProperty.call(s,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!==l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!a(e[c[l]],s[c[l]]))return!1;return!0}return e!==e&&s!==s}e.exports=function(e,t){try{return a(e,t)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}}},5520:function(e,t,r){"use strict";var n,i=r(8804),a=(n=i)&&n.__esModule?n:{default:n};var s={tags:function(e){var t=e.id,r=e.events,n=e.dataLayer,i=e.dataLayerName,s=e.preview,o=">m_auth="+e.auth,l=">m_preview="+s;return t||(0,a.default)("GTM Id is required"),{iframe:'\n <iframe src="https://www.googletagmanager.com/ns.html?id='+t+o+l+'>m_cookies_win=x"\n height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>',script:"\n (function(w,d,s,l,i){w[l]=w[l]||[];\n w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', "+JSON.stringify(r).slice(1,-1)+"});\n var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';\n j.async=true;
2j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'"+o+l+">m_cookies_win=x';\n f.parentNode.insertBefore(j,f);\n })(window,document,'script','"+i+"','"+t+"');",dataLayerVar:this.dataLayer(n,i)}},dataLayer:function(e,t){return"\n window."+t+" = window."+t+" || [];\n window."+t+".push("+JSON.stringify(e)+")"}};e.exports=s},7425:function(e,t,r){"use strict";var n,i=r(5520),a=(n=i)&&n.__esModule?n:{default:n};var s={dataScript:function(e){var t=document.createElement("script");return t.innerHTML=e,t},gtm:function(e){var t=a.default.tags(e);return{noScript:function(){var e=document.createElement("noscript");return e.innerHTML=t.iframe,e},script:function(){var e=document.createElement("script");return e.innerHTML=t.script,e},dataScript:this.dataScript(t.dataLayerVar)}},initialize:function(e){var t=e.gtmId,r=e.events,n=void 0===r?{}:r,i=e.dataLayer,a=e.dataLayerName,s=void 0===a?"dataLayer":a,o=e.auth,l=void 0===o?"":o,c=e.preview,u=void 0===c?"":c,d=this.gtm({id:t,events:n,dataLayer:i||void 0,dataLayerName:s,auth:l,preview:u});i&&document.head.appendChild(d.dataScript),document.head.insertBefore(d.script(),document.head.childNodes[0]),document.body.insertBefore(d.noScript(),document.body.childNodes[0])},dataLayer:function(e){var t=e.dataLayer,r=e.dataLayerName,n=void 0===r?"dataLayer":r;if(window[n])return window[n].push(t);var i=a.default.dataLayer(t,n),s=this.dataScript(i);document.head.insertBefore(s,document.head.childNodes[0])}};e.exports=s},540:function(e,t,r){"use strict";var n,i=r(7425),a=(n=i)&&n.__esModule?n:{default:n};e.exports=a.default},8804:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){console.warn("[react-gtm]",e)}},4457:function(e,t,r){e.exports=r(4085)},4085:function(e,t,r){"use strict";var n,i=(n=r(5043))&&"object"==typeof n&&"default"in n?n.default:n,a=r(7950);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}}(e.prototype.constructor=e,t)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var c=function(e,t,r,n,i,a,s,o){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,s,o],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}};function u(e,t,r){if("selectionStart"in e&&"selectionEnd"in e)e.selectionStart=t,e.selectionEnd=r;else{var n=e.createTextRange();n.collapse(!0),n.moveStart("character",t),n.moveEnd("character",r-t),n.select()}}var d={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};function h(e,t,r){var n="",i="",a=null,s=[];if(void 0===t&&(t="_"),null==r&&(r=d),!e||"string"!=typeof e)return{maskChar:t,formatChars:r,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var o=!1;return e.split("").forEach((function(e){o=!o&&"\\"===e||(o||!r[e]?(s.push(n.length),n.length===s.length-1&&(i+=e)):a=n.length+1,n+=e,!1)})),{maskChar:t,formatChars:r,prefix:i,mask:n,lastEditablePosition:a,permanents:s}}function p(e,t){return-1!==e.permanents.indexOf(t)}function m(e,t,r){var n=e.mask,i=e.formatChars;if(!r)return!1;if(p(e,t))return n[t]===r;var a=i[n[t]];return new RegExp(a).test(r)}function f(e,t){return t.split("").every((function(t,r){return p(e,r)||!m(e,r,t)}))}function g(e,t){var r=e.maskChar,n=e.prefix;if(!r){for(;t.length>n.length&&p(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var i=n.length,a=t.length;a>=n.length;a--){var s=t[a];if(!p(e,a)&&m(e,a,s)){i=a+1;break}}return i}function _(e,t){return g(e,t)===e.mask.length}function y(e,t){var r=e.maskChar,n=e.mask,i=e.prefix;if(!r){for((t=v(e,"",t,0)).length<i.length&&(t=i);t.length<n.length&&p(e,t.length);)t+=n[t.length];return t}if(t)return v(e,y(e,""),t,0);for(var a=0;a<n.length;a++)p(e,a)?t+=n[a]:t+=r;return t}function v(e,t,r,n){var i=e.mask,a=e.maskChar,s=e.prefix,o=r.split(""),l=_(e,t);return!a&&n>t.length&&(t+=i.slice(t.length,n)),o.every((function(r){for(;u=r,p(e,c=n)&&u!==i[c];){if(n>=t.length&&(t+=i[n]),o=r,a&&p(e,n)&&o===a)return!0;
vendor: 9,104 bytes, line 2
2if(++n>=i.length)return!1}var o,c,u;return!m(e,n,r)&&r!==a||(n<t.length?t=a||l||n<s.length?t.slice(0,n)+r+t.slice(n+1):(t=t.slice(0,n)+r+t.slice(n),y(e,t)):a||(t+=r),++n<i.length)})),t}function x(e,t){for(var r=e.mask,n=t;n<r.length;++n)if(!p(e,n))return n;return null}function b(e){return e||0===e?e+"":""}function w(e,t,r,n,i){var a=e.mask,s=e.prefix,o=e.lastEditablePosition,l=t,c="",u=0,d=0,h=Math.min(i.start,r.start);return r.end>i.start?d=(u=function(e,t,r,n){var i=e.mask,a=e.maskChar,s=r.split(""),o=n;return s.every((function(t){for(;s=t,p(e,r=n)&&s!==i[r];)if(++n>=i.length)return!1;var r,s;return(m(e,n,t)||t===a)&&n++,n<i.length})),n-o}(e,0,c=l.slice(i.start,r.end),h))?i.length:0:l.length<n.length&&(d=n.length-l.length),l=n,d&&(1!==d||i.length||(h=i.start===r.start?x(e,r.start):function(e,t){for(var r=t;0<=r;--r)if(!p(e,r))return r;return null}(e,r.start)),l=function(e,t,r,n){var i=r+n,a=e.maskChar,s=e.mask,o=e.prefix,l=t.split("");if(a)return l.map((function(t,n){return n<r||i<=n?t:p(e,n)?s[n]:a})).join("");for(var c=i;c<l.length;c++)p(e,c)&&(l[c]="");return r=Math.max(o.length,r),l.splice(r,i-r),t=l.join(""),y(e,t)}(e,l,h,d)),l=v(e,l,c,h),(h+=u)>=a.length?h=a.length:h<s.length&&!u?h=s.length:h>=s.length&&h<o&&u&&(h=x(e,h)),c||(c=null),{value:l=y(e,l),enteredString:c,selection:{start:h,end:h}}}function C(e){return"function"==typeof e}function S(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function k(e){return(S()?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame:function(){return setTimeout(e,1e3/60)})(e)}function j(e){(S()||clearTimeout)(e)}var E=function(e){function t(t){var r=e.call(this,t)||this;r.focused=!1,r.mounted=!1,r.previousSelection=null,r.selectionDeferId=null,r.saveSelectionLoopDeferId=null,r.saveSelectionLoop=function(){r.previousSelection=r.getSelection(),r.saveSelectionLoopDeferId=k(r.saveSelectionLoop)},r.runSaveSelectionLoop=function(){null===r.saveSelectionLoopDeferId&&r.saveSelectionLoop()},r.stopSaveSelectionLoop=function(){null!==r.saveSelectionLoopDeferId&&(j(r.saveSelectionLoopDeferId),r.saveSelectionLoopDeferId=null,r.previousSelection=null)},r.getInputDOMNode=function(){if(!r.mounted)return null;var e=a.findDOMNode(l(l(r))),t="undefined"!=typeof window&&e instanceof window.Element;if(e&&!t)return null;if("INPUT"!==e.nodeName&&(e=e.querySelector("input")),!e)throw new Error("react-input-mask: inputComponent doesn't contain input node");return e},r.getInputValue=function(){var e=r.getInputDOMNode();return e?e.value:null},r.setInputValue=function(e){var t=r.getInputDOMNode();t&&(r.value=e,t.value=e)},r.setCursorToEnd=function(){var e=g(r.maskOptions,r.value),t=x(r.maskOptions,e);null!==t&&r.setCursorPosition(t)},r.setSelection=function(e,t,n){void 0===n&&(n={});var i=r.getInputDOMNode(),a=r.isFocused();i&&a&&(n.deferred||u(i,e,t),null!==r.selectionDeferId&&j(r.selectionDeferId),r.selectionDeferId=k((function(){r.selectionDeferId=null,u(i,e,t)})),r.previousSelection={start:e,end:t,length:Math.abs(t-e)})},r.getSelection=function(){return function(e){var t=0,r=0;if("selectionStart"in e&&"selectionEnd"in e)t=e.selectionStart,r=e.selectionEnd;else{var n=document.selection.createRange();n.parentElement()===e&&(t=-n.moveStart("character",-e.value.length),r=-n.moveEnd("character",-e.value.length))}return{start:t,end:r,length:r-t}}(r.getInputDOMNode())},r.getCursorPosition=function(){return r.getSelection().start},r.setCursorPosition=function(e){r.setSelection(e,e)},r.isFocused=function(){return r.focused},r.getBeforeMaskedValueChangeConfig=function(){var e=r.maskOptions,t=e.mask,n=e.maskChar,i=e.permanents,a=e.formatChars;return{mask:t,maskChar:n,permanents:i,alwaysShowMask:!!r.props.alwaysShowMask,formatChars:a}},r.isInputAutofilled=function(e,t,n,i){var a=r.getInputDOMNode();try{if(a.matches(":-webkit-autofill"))return!0}catch(c){}return!r.focused||i.end<n.length&&t.end===e.length},r.onChange=function(e){var t=l(l(r)).beforePasteState,n=l(l(r)).previousSelection,i=r.props.beforeMaskedValueChange,a=r.getInputValue(),s=r.value,o=r.getSelection();r.isInputAutofilled(a,o,s,n)&&(s=y(r.maskOptions,""),n={start:0,end:0,length:0}),t&&(n=t.selection,s=t.value,o={start:n.start+a.length,end:n.start+a.length,length:0},a=s.slice(0,n.start)+a+s.slice(n.end),r.beforePasteState=null);var c=w(r.maskOptions,a,o,s,n),u=c.enteredString,d=c.selection,h=c.value;if(C(i)){var p=i({value:h,selection:d},{value:s,selection:n},u,r.getBeforeMaskedValueChangeConfig());h=p.value,d=p.selection}r.setInputValue(h),C(r.props.onChange)&&r.props.onChange(e),r.isWindowsPhoneBrowser?r.setSelection(d.start,d.end,{deferred:!0}):r.setSelection(d.start,d.end)},r.onFocus=function(e){var t=r.props.beforeMaskedValueChange,n=r.maskOptions,i=n.mask,a=n.prefix;if(r.focused=!0,r.mounted=!0,i){if(r.value)g(r.maskOptions,r.value)<r.maskOptions.mask.length&&r.setCursorToEnd();else{var s=y(r.maskOptions,a),o=y(r.maskOptions,s),l=g(r.maskOptions,o),c=x(r.maskOptions,l),u={start:c,end:c};if(C(t)){var d=t({value:o,selection:u},{value:r.value,selection:null},null,r.getBeforeMaskedValueChangeConfig());o=d.value,u=d.selection}var h=o!==r.getInputValue();h&&r.setInputValue(o),h&&C(r.props.onChange)&&r.props.onChange(e),r.setSelection(u.start,u.end)}r.runSaveSelectionLoop()}C(r.props.onFocus)&&r.props.onFocus(e)},r.onBlur=function(e){var t=r.props.beforeMaskedValueChange,n=r.maskOptions.mask;if(r.stopSaveSelectionLoop(),r.focused=!1,n&&!r.props.alwaysShowMask&&f(r.maskOptions,r.value)){var i="";C(t)&&(i=t({value:i,selection:null},{value:r.value,selection:r.previousSelection},null,r.getBeforeMaskedValueChangeConfig()).value);var a=i!==r.getInputValue();a&&r.setInputValue(i),a&&C(r.props.onChange)&&r.props.onChange(e)}C(r.props.onBlur)&&r.props.onBlur(e)},r.onMouseDown=function(e){if(!r.focused&&document.addEventListener){r.mouseDownX=e.clientX,r.mouseDownY=e.clientY,r.mouseDownTime=(new Date).getTime();document.addEventListener("mouseup",(function e(t){if(document.removeEventListener("mouseup",e),r.focused){var n=Math.abs(t.clientX-r.mouseDownX),i=Math.abs(t.clientY-r.mouseDownY),a=Math.max(n,i),s=(new Date).getTime()-r.mouseDownTime;(a<=10&&s<=200||a<=5&&s<=300)&&r.setCursorToEnd()}}))}C(r.props.onMouseDown)&&r.props.onMouseDown(e)},r.onPaste=function(e){C(r.props.onPaste)&&r.props.onPaste(e),e.defaultPrevented||(r.beforePasteState={value:r.getInputValue(),selection:r.getSelection()},r.setInputValue(""))},r.handleRef=function(e){null==r.props.children&&C(r.props.inputRef)&&r.props.inputRef(e)};var n=t.mask,i=t.maskChar,s=t.formatChars,o=t.alwaysShowMask,c=t.beforeMaskedValueChange,d=t.defaultValue,p=t.value;r.maskOptions=h(n,i,s),null==d&&(d=""),null==p&&(p=d);var m=b(p);if(r.maskOptions.mask&&(o||m)&&(m=y(r.maskOptions,m),C(c))){var _=t.value;null==t.value&&(_=d),m=c({value:m,selection:null},{value:_=b(_),selection:null},null,r.getBeforeMaskedValueChangeConfig()).value}return r.value=m,r}o(t,e);var r=t.prototype;return r.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=function(){var e=new RegExp("windows","i"),t=new RegExp("phone","i"),r=navigator.userAgent;return e.test(r)&&t.test(r)}(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},r.componentDidUpdate=function(){var e=this.previousSelection,t=this.props,r=t.beforeMaskedValueChange,n=t.alwaysShowMask,i=t.mask,a=t.maskChar,s=t.formatChars,o=this.maskOptions,l=n||this.isFocused(),c=null!=this.props.value,u=c?b(this.props.value):this.value,d=e?e.start:null;if(this.maskOptions=h(i,a,s),this.maskOptions.mask){!o.mask&&this.isFocused()&&this.runSaveSelectionLoop();var p=this.maskOptions.mask&&this.maskOptions.mask!==o.mask;if(o.mask||c||(u=this.getInputValue()),(p||this.maskOptions.mask&&(u||l))&&(u=y(this.maskOptions,u)),p){var m=g(this.maskOptions,u);(null===d||m<d)&&(d=_(this.maskOptions,u)?m:x(this.maskOptions,m))}!this.maskOptions.mask||!f(this.maskOptions,u)||l||c&&this.props.value||(u="");var v={start:d,end:d};if(C(r)){var w=r({value:u,selection:v},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());u=w.value,v=w.selection}this.value=u;var S=this.getInputValue()!==this.value;S?(this.setInputValue(this.value),this.forceUpdate()):p&&this.forceUpdate();var k=!1;null!=v.start&&null!=v.end&&(k=!e||e.start!==v.start||e.end!==v.end),(k||S)&&this.setSelection(v.start,v.end)}else o.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},r.componentWillUnmount=function(){this.mounted=!1,null!==this.selectionDeferId&&j(this.selectionDeferId),this.stopSaveSelectionLoop()},r.render=function(){var e,t=this.props,r=(t.mask,t.alwaysShowMask,t.maskChar,t.formatChars,t.inputRef,t.beforeMaskedValueChange,t.children),n=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||(i[r]=e[r]);return i}(t,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);
2if(r){C(r)||c(!1);var a=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],o=s({},n);a.forEach((function(e){return delete o[e]})),e=r(o),a.filter((function(t){return null!=e.props[t]&&e.props[t]!==n[t]})).length&&c(!1)}else e=i.createElement("input",s({ref:this.handleRef},n));var l={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(n.disabled||n.readOnly||(l.onChange=this.onChange,l.onPaste=this.onPaste,l.onMouseDown=this.onMouseDown),null!=n.value&&(l.value=this.value)),e=i.cloneElement(e,l)},t}(i.Component);e.exports=E},5082:function(e,t){"use strict";var r,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function _(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case o:case s:case h:case p:return e;default:switch(e=e&&e.$$typeof){case u:case c:case d:case f:case m:case l:return e;default:return t}}case i:return t}}}r=Symbol.for("react.module.reference")},2086:function(e,t,r){"use strict";r(5082)},1153:function(e,t,r){"use strict";var n=r(5043),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,a={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:i,type:e,key:c,ref:u,props:a,_owner:o.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},4202:function(e,t){"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function _(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||m}function y(){}function v(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=_.prototype;var x=v.prototype=new y;x.constructor=v,f(x,_.prototype),x.isPureReactComponent=!0;var b=Array.isArray,w=Object.prototype.hasOwnProperty,C={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,n){var i,a={},s=null,o=null;if(null!=t)for(i in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(s=""+t.key),t)w.call(t,i)&&!S.hasOwnProperty(i)&&(a[i]=t[i]);var l=arguments.length-2;if(1===l)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===a[i]&&(a[i]=l[i]);return{$$typeof:r,type:e,key:s,ref:o,props:a,_owner:C.current}}function j(e){return"object"===typeof e&&null!==e&&e.$$typeof===r}var E=/\/+/g;function T(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function P(e,t,i,a,s){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case r:case n:l=!0}}if(l)return s=s(l=e),e=""===a?"."+T(l,0):a,b(s)?(i="",null!=e&&(i=e.replace(E,"$&/")+"/"),P(s,t,i,"",(function(e){return e}))):null!=s&&(j(s)&&(s=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,i+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(E,"$&/")+"/")+e)),t.push(s)),1;if(l=0,a=""===a?".":a+":",b(e))for(var c=0;c<e.length;c++){var u=a+T(o=e[c],c);l+=P(o,t,i,u,s)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),c=0;!(o=e.next()).done;)l+=P(o=o.value,t,i,u=a+T(o,c++),s);else if("object"===o)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function I(e,t,r){if(null==e)return e;var n=[],i=0;return P(e,n,"","",(function(e){return t.call(r,e,i++)})),n}function M(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var N={current:null},A={transition:null},L={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:A,ReactCurrentOwner:C};
vendor: 4,872 bytes, line 2
2t.Children={map:I,forEach:function(e,t,r){I(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return I(e,(function(){t++})),t},toArray:function(e){return I(e,(function(e){return e}))||[]},only:function(e){if(!j(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=_,t.Fragment=i,t.Profiler=s,t.PureComponent=v,t.StrictMode=a,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=f({},e.props),a=e.key,s=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,o=C.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)w.call(t,c)&&!S.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:r,type:e.type,key:a,ref:s,props:i,_owner:o}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=j,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=A.transition;A.transition={};try{e()}finally{A.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return N.current.useCallback(e,t)},t.useContext=function(e){return N.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return N.current.useDeferredValue(e)},t.useEffect=function(e,t){return N.current.useEffect(e,t)},t.useId=function(){return N.current.useId()},t.useImperativeHandle=function(e,t,r){return N.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return N.current.useMemo(e,t)},t.useReducer=function(e,t,r){return N.current.useReducer(e,t,r)},t.useRef=function(e){return N.current.useRef(e)},t.useState=function(e){return N.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return N.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return N.current.useTransition()},t.version="18.2.0"},5043:function(e,t,r){"use strict";e.exports=r(4202)},579:function(e,t,r){"use strict";e.exports=r(1153)},7234:function(e,t){"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,i=e[n];if(!(0<a(i,t)))break e;e[n]=t,e[r]=i,r=n}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length,s=i>>>1;n<s;){var o=2*(n+1)-1,l=e[o],c=o+1,u=e[c];if(0>a(l,r))c<i&&0>a(u,l)?(e[n]=u,e[c]=r,n=c):(e[n]=l,e[o]=r,n=o);else{if(!(c<i&&0>a(u,r)))break e;e[n]=u,e[c]=r,n=c}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,p=3,m=!1,f=!1,g=!1,_="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,v="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=n(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,r(c,t)}t=n(u)}}function b(e){if(g=!1,x(e),!f)if(null!==n(c))f=!0,A(w);else{var t=n(u);null!==t&&L(b,t.startTime-e)}}function w(e,r){f=!1,g&&(g=!1,y(j),j=-1),m=!0;var a=p;try{for(x(r),h=n(c);null!==h&&(!(h.expirationTime>r)||e&&!P());){var s=h.callback;if("function"===typeof s){h.callback=null,p=h.priorityLevel;var o=s(h.expirationTime<=r);r=t.unstable_now(),"function"===typeof o?h.callback=o:h===n(c)&&i(c),x(r)}else i(c);h=n(c)}if(null!==h)var l=!0;else{var d=n(u);null!==d&&L(b,d.startTime-r),l=!1}return l}finally{h=null,p=a,m=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,S=!1,k=null,j=-1,E=5,T=-1;function P(){return!(t.unstable_now()-T<E)}function I(){if(null!==k){var e=t.unstable_now();T=e;var r=!0;try{r=k(!0,e)}finally{r?C():(S=!1,k=null)}}else S=!1}
2if("function"===typeof v)C=function(){v(I)};else if("undefined"!==typeof MessageChannel){var M=new MessageChannel,N=M.port2;M.port1.onmessage=I,C=function(){N.postMessage(null)}}else C=function(){_(I,0)};function A(e){k=e,S||(S=!0,C())}function L(e,r){j=_((function(){e(t.unstable_now())}),r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){f||m||(f=!0,A(w))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var r=p;p=t;try{return e()}finally{p=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=p;p=e;try{return t()}finally{p=r}},t.unstable_scheduleCallback=function(e,i,a){var s=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:a,expirationTime:o=a+o,sortIndex:-1},a>s?(e.sortIndex=a,r(u,e),null===n(c)&&e===n(u)&&(g?(y(j),j=-1):g=!0,L(b,a-s))):(e.sortIndex=o,r(c,e),f||m||(f=!0,A(w))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=p;return function(){var r=p;p=t;try{return e.apply(this,arguments)}finally{p=r}}}},8853:function(e,t,r){"use strict";e.exports=r(7234)},7324:function(e){e.exports=function(e,t,r,n){var i=r?r.call(n,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var c=a[l];if(!o(c))return!1;var u=e[c],d=t[c];if(!1===(i=r?r.call(n,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},5956:function(e,t,r){"use strict";var n=r(5043);var i="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},a=n.useState,s=n.useEffect,o=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(n){return!0}}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=a({inst:{value:r,getSnapshot:t}}),i=n[0].inst,u=n[1];return o((function(){i.value=r,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,r,t]),s((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},5039:function(e,t,r){"use strict";var n=r(5043),i=r(9461);var a="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},s=i.useSyncExternalStore,o=n.useRef,l=n.useEffect,c=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var d=o(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function e(e){if(!l){if(l=!0,s=e,e=n(e),void 0!==i&&h.hasValue){var t=h.value;if(i(t,e))return o=t}return o=e}if(t=o,a(s,e))return t;var r=n(e);return void 0!==i&&i(t,r)?t:(s=e,o=r)}var s,o,l=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,r,n,i]);var p=s(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),u(p),p}},9461:function(e,t,r){"use strict";e.exports=r(5956)},8443:function(e,t,r){"use strict";e.exports=r(5039)},2695:function(e,t,r){var n={"./Birthday-Cake.jpg":8375,"./Chocolate-Fully-Iced.jpg":7258,"./Cookie-Cake-Base.jpg":3244,"./Double-Fudge.jpg":4354,"./Icing-Cake.jpg":4602,"./MM copy.jpg":6806,"./MM.jpg":8829,"./Oatmeal-Walnut-Raisin.jpg":8725,"./Original-Chocolate-Chip.jpg":7232,"./Sugar-Cake.jpg":9660,"./Vanilla-Fully-Iced.jpg":1387,"./m-birthday-cake-mm.jpg":7422,"./m-double-fudge-mm.jpg":9873,"./m-oatmeal-walnut-raisin-mm.jpg":3160,"./m-original-chocolate-chip-mm.jpg":9587,"./m-sugar-cake-mm.jpg":1579};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=2695},6803:function(e,t,r){var n={"./Birthday-Cake.jpg":6491,"./Chocolate-Fully-Iced.jpg":2782,"./Double-Fudge.jpg":4486,"./Icing.jpg":7803,"./M&M.jpg":1629,"./Oatmeal-Walnut-Raisin copy.jpg":9882,"./Oatmeal-Walnut-Raisin.jpg":9185,"./Original-Chocolate-Chip.jpg":4076,"./Sugar-Cake.jpg":6680,"./Vanilla-Fully-Iced.jpg":7655,"./m-birthday-cake-mm.jpg":9010,"./m-double-fudge-mm.jpg":4853,"./m-oatmeal-walnut-raisin-mm.jpg":4180,"./m-original-chocolate-chip-mm.jpg":4479,"./m-sugar-cake-mm.jpg":919};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=6803},68:function(e,t,r){var n={"./Birthday-Cake.jpg":9712,"./Chocolate-Fully-Iced.jpg":8911,"./Cookie-Cake-Base.jpg":6005,"./Double-Fudge.jpg":2243,"./Icing.jpg":64,"./M&M copy.jpg":3119,"./M&M.jpg":2514,"./Oatmeal-Walnut-Raisin.jpg":7842,"./Original-Chocolate-Chip.jpg":563,"./Sugar.jpg":2882,"./Vanilla-Fully-Iced.jpg":2690,"./m-birthday-cake-mm.jpg":1003,"./m-double-fudge-mm.jpg":7362,"./m-oatmeal-walnut-raisin-mm.jpg":7129,"./m-original-chocolate-chip-mm.jpg":3738,"./m-sugar-mm.jpg":1733};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=68},7535:function(e,t,r){var n={"./rect-red-2nd-simple.png":5345,"./rect-red-double-2.png":8008,"./rect-red-double-3.png":9137,"./rect_dollop_red_full.png":7846};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=7535},4257:function(e,t,r){var n={"./rect-white-2nd-simple.png":293,"./rect-white-double-2.png":7084,"./rect-white-double-3.png":149,"./rect_dollop_white_full.png":7306};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=4257},8339:function(e,t,r){var n={"./round-red-2nd-simple.png":2787,"./round-red-double-2.png":7778,"./round-red-double-3.png":9323,"./round_red_dollops_full.png":5179};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=8339},6669:function(e,t,r){var n={"./round-white-2nd-simple.png":5295,"./round-white-double-2.png":9902,"./round-white-double-3.png":2391,"./round-white-full.png":6703};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=6669},1856:function(e,t,r){var n={"./square-red-2nd-simple.png":6551,"./square-red-double-2.png":5590,"./square-red-double-3.png":3679,"./square_red_dollop_full.png":9112};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=1856},8182:function(e,t,r){var n={"./square-white-2nd-simple.png":159,"./square-white-double-2.png":3486,"./square-white-double-3.png":5975,"./square_white_dollop_full.png":3844};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=8182},9181:function(e,t,r){var n={"./212GAC_BlueberryCookie_Webslider-Artboard-1.webp":2818,"./212GAC_DoubleDoozie_Webslider-reflection.webp":3609,"./212GAC_Easter_Webslider-Easter.webp":7025,"./212GAC_MDG_Webslider-DAD.webp":1440,"./212GAC_MDG_Webslider-GRAD.webp":4775,"./212GAC_MDG_Webslider-GRAD_high-res.webp":4139,"./212GAC_MDG_Webslider-MOM _high-res.webp":2140,"./212GAC_MDG_Webslider-MOM.webp":7970,"./HBD_Evergreen_Transparent.webp":1242};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=9181},2818:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_BlueberryCookie_Webslider-Artboard-1.f24016f522e40bec28b3.webp"},3609:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_DoubleDoozie_Webslider-reflection.3aaecdf7db84895c50d8.webp"},7025:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_Easter_Webslider-Easter.bfab053144c3bb1f6e75.webp"},1440:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_MDG_Webslider-DAD.4b26edc0216e89319dd4.webp"},4775:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_MDG_Webslider-GRAD.5faa27e83b73d3f6f50e.webp"},4139:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_MDG_Webslider-GRAD_high-res.197272884f99f77dc95f.webp"},2140:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_MDG_Webslider-MOM _high-res.59417e54172f3795eaa4.webp"},7970:function(e,t,r){"use strict";e.exports=r.p+"static/media/212GAC_MDG_Webslider-MOM.fa18931fc1a89001681e.webp"},1242:function(e,t,r){"use strict";e.exports=r.p+"static/media/HBD_Evergreen_Transparent.df9e8caaf753da575f86.webp"},8375:function(e,t,r){"use strict";e.exports=r.p+"static/media/Birthday-Cake.bc082c5bc565f7b0f6de.jpg"},7258:function(e,t,r){"use strict";e.exports=r.p+"static/media/Chocolate-Fully-Iced.fb0ab31b41d4b5def38e.jpg"},3244:function(e,t,r){"use strict";e.exports=r.p+"static/media/Cookie-Cake-Base.2b584f4720323346496a.jpg"},4354:function(e,t,r){"use strict";e.exports=r.p+"static/media/Double-Fudge.a9bc532260a8b9fc9768.jpg"},4602:function(e,t,r){"use strict";e.exports=r.p+"static/media/Icing-Cake.4e0149718c56c9b05f32.jpg"},6806:function(e,t,r){"use strict";e.exports=r.p+"static/media/MM copy.99f2e576278b2c03c62f.jpg"},8829:function(e,t,r){"use strict";e.exports=r.p+"static/media/MM.99f2e576278b2c03c62f.jpg"},8725:function(e,t,r){"use strict";e.exports=r.p+"static/media/Oatmeal-Walnut-Raisin.1eaa44f4961e0ba5404d.jpg"},7232:function(e,t,r){"use strict";e.exports=r.p+"static/media/Original-Chocolate-Chip.2b584f4720323346496a.jpg"},9660:function(e,t,r){"use strict";e.exports=r.p+"static/media/Sugar-Cake.4492604217095e34947f.jpg"},1387:function(e,t,r){"use strict";e.exports=r.p+"static/media/Vanilla-Fully-Iced.4e0149718c56c9b05f32.jpg"},7422:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-birthday-cake-mm.55deb91ef418749509ba.jpg"}
2,9873:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-double-fudge-mm.0d6a16b0c32b8999bbe5.jpg"},3160:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-oatmeal-walnut-raisin-mm.1d3fab26952496fcf825.jpg"},9587:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-original-chocolate-chip-mm.99f2e576278b2c03c62f.jpg"},1579:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-sugar-cake-mm.607cc1dcd5c9330b2ada.jpg"},6491:function(e,t,r){"use strict";e.exports=r.p+"static/media/Birthday-Cake.4ce670396e2cbbf92d72.jpg"},2782:function(e,t,r){"use strict";e.exports=r.p+"static/media/Chocolate-Fully-Iced.dd45c3839be143f3d938.jpg"},4486:function(e,t,r){"use strict";e.exports=r.p+"static/media/Double-Fudge.2dff79b8ce7daf3254b6.jpg"},7803:function(e,t,r){"use strict";e.exports=r.p+"static/media/Icing.7091c9b4f80e979325f8.jpg"},1629:function(e,t,r){"use strict";e.exports=r.p+"static/media/M&M.f2697c7691deb94eb589.jpg"},9882:function(e,t,r){"use strict";e.exports=r.p+"static/media/Oatmeal-Walnut-Raisin copy.d0a47c6221c0306457ea.jpg"},9185:function(e,t,r){"use strict";e.exports=r.p+"static/media/Oatmeal-Walnut-Raisin.d0a47c6221c0306457ea.jpg"},4076:function(e,t,r){"use strict";e.exports=r.p+"static/media/Original-Chocolate-Chip.53d55f3745e07088ae81.jpg"},6680:function(e,t,r){"use strict";e.exports=r.p+"static/media/Sugar-Cake.50622268cf6c71daaf46.jpg"},7655:function(e,t,r){"use strict";e.exports=r.p+"static/media/Vanilla-Fully-Iced.7091c9b4f80e979325f8.jpg"},9010:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-birthday-cake-mm.2e4c204439f78068c46b.jpg"},4853:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-double-fudge-mm.467f1389f2ee2cea381f.jpg"},4180:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-oatmeal-walnut-raisin-mm.bcbe9eac90f7db0a82e7.jpg"},4479:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-original-chocolate-chip-mm.f2697c7691deb94eb589.jpg"},919:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-sugar-cake-mm.240afffd0f6980c628ea.jpg"},9712:function(e,t,r){"use strict";e.exports=r.p+"static/media/Birthday-Cake.1885d1d5576679d53d4a.jpg"},8911:function(e,t,r){"use strict";e.exports=r.p+"static/media/Chocolate-Fully-Iced.4aad9572041436c81288.jpg"},6005:function(e,t,r){"use strict";e.exports=r.p+"static/media/Cookie-Cake-Base.163f515c81ba5627a2fa.jpg"},2243:function(e,t,r){"use strict";e.exports=r.p+"static/media/Double-Fudge.ba6c74d0eae37d1a8283.jpg"},64:function(e,t,r){"use strict";e.exports=r.p+"static/media/Icing.f3394db0cc1ad5df3799.jpg"},3119:function(e,t,r){"use strict";e.exports=r.p+"static/media/M&M copy.e475a8af61b01f821a4e.jpg"},2514:function(e,t,r){"use strict";e.exports=r.p+"static/media/M&M.e475a8af61b01f821a4e.jpg"},7842:function(e,t,r){"use strict";e.exports=r.p+"static/media/Oatmeal-Walnut-Raisin.ba442fb0dde2751c96d5.jpg"},563:function(e,t,r){"use strict";e.exports=r.p+"static/media/Original-Chocolate-Chip.163f515c81ba5627a2fa.jpg"},2882:function(e,t,r){"use strict";e.exports=r.p+"static/media/Sugar.29514328dbb56d81f68b.jpg"},2690:function(e,t,r){"use strict";e.exports=r.p+"static/media/Vanilla-Fully-Iced.f3394db0cc1ad5df3799.jpg"},1003:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-birthday-cake-mm.7f6eeceb02ee2dd51e78.jpg"},7362:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-double-fudge-mm.422ee0365520c493a076.jpg"},7129:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-oatmeal-walnut-raisin-mm.1aeaeb7a9890ece758b2.jpg"},3738:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-original-chocolate-chip-mm.e475a8af61b01f821a4e.jpg"},1733:function(e,t,r){"use strict";e.exports=r.p+"static/media/m-sugar-mm.45475b316e4f349fbce4.jpg"},5345:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect-red-2nd-simple.3585db1cea188a792644.png"},8008:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect-red-double-2.679985403aa1ee11f4de.png"},9137:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect-red-double-3.80b955d2f857b8c9a15a.png"},7846:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect_dollop_red_full.fde15e1089f5be2faeb3.png"},293:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect-white-2nd-simple.b992cefbee9adac2a8f9.png"},7084:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect-white-double-2.859d929d74c7ecebbbdb.png"},149:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect-white-double-3.eaa1ab6d33a00ea23318.png"},7306:function(e,t,r){"use strict";e.exports=r.p+"static/media/rect_dollop_white_full.6a83338f51cbf0f2caee.png"},2787:function(e,t,r){"use strict";e.exports=r.p+"static/media/round-red-2nd-simple.0d267cdabf8ab1a1d126.png"},7778:function(e,t,r){"use strict";e.exports=r.p+"static/media/round-red-double-2.801142a75a96dc04ee22.png"},9323:function(e,t,r){"use strict";e.exports=r.p+"static/media/round-red-double-3.17576cc995becd6b74bb.png"},5179:function(e,t,r){"use strict";e.exports=r.p+"static/media/round_red_dollops_full.c7e55ade4eac0da08e08.png"},5295:function(e,t,r){"use strict";e.exports=r.p+"static/media/round-white-2nd-simple.a93029cc19a14454ca97.png"},9902:function(e,t,r){"use strict";e.exports=r.p+"static/media/round-white-double-2.c651695e45c5afd76d46.png"},2391:function(e,t,r){"use strict";e.exports=r.p+"static/media/round-white-double-3.a606d21d46fd1e517776.png"},6703:function(e,t,r){"use strict";e.exports=r.p+"static/media/round-white-full.fa55d4924d9dbf6a2985.png"},6551:function(e,t,r){"use strict";e.exports=r.p+"static/media/square-red-2nd-simple.d47a350adab8a1851cfb.png"},5590:function(e,t,r){"use strict";e.exports=r.p+"static/media/square-red-double-2.2d6023ab6a6b302cc2ab.png"},3679:function(e,t,r){"use strict";e.exports=r.p+"static/media/square-red-double-3.f44daab179e80c6ec328.png"},9112:function(e,t,r){"use strict";e.exports=r.p+"static/media/square_red_dollop_full.9c961bce91ffc4c1c1fd.png"},159:function(e,t,r){"use strict";e.exports=r.p+"static/media/square-white-2nd-simple.113ec08940381fc2e2a6.png"},3486:function(e,t,r){"use strict";e.exports=r.p+"static/media/square-white-double-2.415b9446bf6bf356bb88.png"},5975:function(e,t,r){"use strict";e.exports=r.p+"static/media/square-white-double-3.d37a235cee782df8941b.png"},3844:function(e,t,r){"use strict";e.exports=r.p+"static/media/square_white_dollop_full.0d04ffbd0cf7c16be18d.png"},4066:function(e){e.exports=function(){"use strict";var e={},t={};function r(r,n,i){if(t[r]=i,"index"===r){var a="var sharedModule = {}; ("+t.shared+")(sharedModule); ("+t.worker+")(sharedModule);",s={};return t.shared(s),t.index(e,s),"undefined"!==typeof window&&e.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),e}}return r("shared",["exports"],(function(e){function t(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}
vendor: 10,113 bytes, line 2
2function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var n=i;function i(e,t){this.x=e,this.y=t}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var 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:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var 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:function(e,t){var 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:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(e){return e instanceof i?e:Array.isArray(e)?new i(e[0],e[1]):e};var a=r(n),s=o;function o(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}o.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 a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var s=0,o=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?s=r:o=r,r=.5*(o-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var l=r(s);let c,u;function d(){return null==c&&(c="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),c}function h(){if(null==u&&(u=!1,d())){const e=5,t=new OffscreenCanvas(e,e).getContext("2d",{willReadFrequently:!0});if(t){for(let n=0;n<e*e;n++){const r=4*n;t.fillStyle=`rgb(${r},${r+1},${r+2})`,t.fillRect(n%e,Math.floor(n/e),1,1)}const r=t.getImageData(0,0,e,e).data;for(let t=0;t<e*e*4;t++)if(t%4!=3&&r[t]!==t){u=!0;break}}}return u||!1}function p(e,t,r,n){const i=new l(e,t,r,n);return e=>i.solve(e)}const m=p(.25,.1,.25,1);function f(e,t,r){return Math.min(r,Math.max(t,e))}function g(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function _(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(const i of r)for(const t in i)e[t]=i[t];return e}let y=1;function v(e,t,r){const n={};for(const i in e)n[i]=t.call(this,e[i],i,e);return n}function x(e,t,r){const n={};for(const i in e)t.call(this,e[i],i,e)&&(n[i]=e[i]);return n}function b(e){return Array.isArray(e)?e.map(b):"object"==typeof e&&e?v(e,b):e}const w={};function C(e){w[e]||("undefined"!=typeof console&&console.warn(e),w[e]=!0)}function S(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function k(e){return"undefined"!=typeof WorkerGlobalScope&&void 0!==e&&e instanceof WorkerGlobalScope}let j=null;function E(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}const T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function P(e,r,n,i,a){return t(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const t=new VideoFrame(e,{timestamp:0});try{const s=null==t?void 0:t.format;if(!s||!s.startsWith("BGR")&&!s.startsWith("RGB"))throw new Error(`Unrecognized format ${s}`);const o=s.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield t.copyTo(l,function(e,t,r,n,i){const a=4*Math.max(-t,0),s=(Math.max(0,r)-r)*n*4+a,o=4*n,l=Math.max(0,t),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(e.width,t+n)-l,height:Math.min(e.height,r+i)-c},layout:[{offset:s,stride:o}]}}(e,r,n,i,a)),o)for(let e=0;e<l.length;e+=4){const t=l[e];l[e]=l[e+2],l[e+2]=t}return l}finally{t.close()}}))}let I,M;const N="AbortError";function A(){return new Error(N)}const L={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function D(e){return L.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}const z="global-dispatcher";class O extends Error{constructor(e,t,r,n){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=n}}const R=()=>k(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,F=function(e,r){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){const t=D(e.url);if(t)return t(e,r);if(k(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:z},r)}if(!(/^file:/.test(n=e.url)||/^file:/.test(R())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(e,r){return t(this,void 0,void 0,(function*(){const t=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:R(),signal:r.signal});"json"!==e.type||t.headers.has("Accept")||t.headers.set("Accept","application/json");const n=yield fetch(t);if(!n.ok){const t=yield n.blob();throw new O(n.status,n.statusText,e.url,t)}let i;i="arrayBuffer"===e.type||"image"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text();const a=yield i;if(r.signal.aborted)throw A();return{data:a,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}))}(e,r);if(k(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:z},r)}var n;return function(e,t){return new Promise(((r,n)=>{var i;const a=new XMLHttpRequest;a.open(e.method||"GET",e.url,!0),"arrayBuffer"!==e.type&&"image"!==e.type||(a.responseType="arraybuffer");for(const t in e.headers)a.setRequestHeader(t,e.headers[t]);"json"===e.type&&(a.responseType="text",(null===(i=e.headers)||void 0===i?void 0:i.Accept)||a.setRequestHeader("Accept","application/json")),a.withCredentials="include"===e.credentials,a.onerror=()=>{n(new Error(a.statusText))},a.onload=()=>{if(!t.signal.aborted)if((a.status>=200&&a.status<300||0===a.status)&&null!==a.response){let t=a.response;if("json"===e.type)try{t=JSON.parse(a.response)}catch(e){return void n(e)}r({data:t,cacheControl:a.getResponseHeader("Cache-Control"),expires:a.getResponseHeader("Expires")})}else{const t=new Blob([a.response],{type:a.getResponseHeader("Content-Type")});n(new O(a.status,a.statusText,e.url,t))}},t.signal.addEventListener("abort",(()=>{a.abort(),n(A())})),a.send(e.body)}))}(e,r)};function B(e){if(!e||e.indexOf("://")<=0||0===e.indexOf("data:image/")||0===e.indexOf("blob:"))return!0;const t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function V(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function $(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class U{constructor(e){_(this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.type=e}}class H extends U{constructor(e){super("error",_({error:e},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}}class q{on(e,t){return this._listeners=this._listeners||{},V(e,t,this._listeners),this}off(e,t){return $(e,t,this._listeners),$(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},V(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new U(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const a of n)$(r,a,this._oneTimeListeners),a.call(this,e);const i=this._eventedParent;i&&(_(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof H&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var Z={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"}
vendor: 3,574 bytes, line 2
2,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade
vendor: 8,509 bytes, line 2
2","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}
vendor: 8,873 bytes, line 2
2,"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}
vendor: 9,830 bytes, line 2
2,"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const
vendor: 60,221 bytes, line 2
2G=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function W(e,t){const r={};for(const n in e)"ref"!==n&&(r[n]=e[n]);return G.forEach((e=>{e in t&&(r[e]=t[e])})),r}function X(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(!X(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(!X(e[r],t[r]))return!1;return!0}return e===t}function J(e,t){e.push(t)}function K(e,t,r){J(r,{command:"addSource",args:[e,t[e]]})}function Y(e,t,r){J(t,{command:"removeSource",args:[e]}),r[e]=!0}function Q(e,t,r,n){Y(e,r,n),K(e,t,r)}function ee(e,t,r){let n;for(n in e[r])if(Object.prototype.hasOwnProperty.call(e[r],n)&&"data"!==n&&!X(e[r][n],t[r][n]))return!1;for(n in t[r])if(Object.prototype.hasOwnProperty.call(t[r],n)&&"data"!==n&&!X(e[r][n],t[r][n]))return!1;return!0}function te(e,t,r,n,i,a){e=e||{},t=t||{};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(X(e[s],t[s])||r.push({command:a,args:[n,s,t[s],i]}));for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&!Object.prototype.hasOwnProperty.call(e,s)&&(X(e[s],t[s])||r.push({command:a,args:[n,s,t[s],i]}))}function re(e){return e.id}function ne(e,t){return e[t.id]=t,e}class ie{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function ae(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(const i of r)for(const t in i)e[t]=i[t];return e}class se extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class oe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.parent=e,this.bindings={};for(const[r,n]of t)this.bindings[r]=n}concat(e){return new oe(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 le={kind:"null"},ce={kind:"number"},ue={kind:"string"},de={kind:"boolean"},he={kind:"color"},pe={kind:"object"},me={kind:"value"},fe={kind:"collator"},ge={kind:"formatted"},_e={kind:"padding"},ye={kind:"resolvedImage"},ve={kind:"variableAnchorOffsetCollection"};function xe(e,t){return{kind:"array",itemType:e,N:t}}function be(e){if("array"===e.kind){const t=be(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const we=[le,ce,ue,de,he,ge,pe,xe(me),_e,ye,ve];function Ce(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ce(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 we)if(!Ce(e,t))return null}return`Expected ${be(e)} but found ${be(t)} instead.`}function Se(e,t){return t.some((t=>t.kind===e.kind))}function ke(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 je(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const Ee=.96422,Te=.82521,Pe=4/29,Ie=6/29,Me=3*Ie*Ie,Ne=Ie*Ie*Ie,Ae=Math.PI/180,Le=180/Math.PI;function De(e){return(e%=360)<0&&(e+=360),e}function ze(e){let t,r,[n,i,a,s]=e;const o=Re((.2225045*(n=Oe(n))+.7168786*(i=Oe(i))+.0606169*(a=Oe(a)))/1);n===i&&i===a?t=r=o:(t=Re((.4360747*n+.3850649*i+.1430804*a)/Ee),r=Re((.0139322*n+.0971045*i+.7141733*a)/Te));const l=116*o-16;return[l<0?0:l,500*(t-o),200*(o-r),s]}function Oe(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Re(e){return e>Ne?Math.pow(e,1/3):e/Me+Pe}function Fe(e){let[t,r,n,i]=e,a=(t+16)/116,s=isNaN(r)?a:a+r/500,o=isNaN(n)?a:a-n/200;return a=1*Ve(a),s=Ee*Ve(s),o=Te*Ve(o),[Be(3.1338561*s-1.6168667*a-.4906146*o),Be(-.9787684*s+1.9161415*a+.033454*o),Be(.0719453*s-.2289914*a+1.4052427*o),i]}function Be(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Ve(e){return e>Ie?e*e*e:Me*(e-Pe)}function $e(e){return parseInt(e.padEnd(2,e),16)/255}function Ue(e,t){return He(t?e/100:e,0,1)}function He(e,t,r){return Math.min(Math.max(t,e),r)}function qe(e){return!e.some(Number.isNaN)}const Ze={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Ge{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.r=e,this.g=t,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Ge)return e;if("string"!=typeof e)return;const t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=Ze[e];if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[$e(e.slice(r,r+=t)),$e(e.slice(r,r+=t)),$e(e.slice(r,r+=t)),$e(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){const t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){const[e,r,n,i,a,s,o,l,c,u,d,h]=t,p=[i||" ",o||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[n,s,c].join(""),t="%%%"===e?100:""===e?255:0;if(t){const e=[He(+r/t,0,1),He(+a/t,0,1),He(+l/t,0,1),d?Ue(+d,h):1];if(qe(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,i,a,s,o,l,c]=r,u=[n||" ",a||" ",o].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const e=[+t,He(+i,0,100),He(+s,0,100),l?Ue(+l,c):1];if(qe(e))return function(e){let[t,r,n,i]=e;function a(e){const i=(e+t/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return t=De(t),r/=100,n/=100,[a(0),a(8),a(4),i]}(e)}}}(e);return t?new Ge(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,i]=ze(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?De(Math.atan2(n,r)*Le):NaN,a,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ze(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map((e=>Math.round(255*e))).join(",")},${n})`}}Ge.black=new Ge(0,0,0,1),Ge.white=new Ge(1,1,1,1),Ge.transparent=new Ge(0,0,0,0),Ge.red=new Ge(1,0,0,1);class We{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 Xe{constructor(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class Je{constructor(e){this.sections=e}static fromString(e){return new Je([new Xe(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Je?e:Je.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class Ke{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ke)return e;if("number"==typeof e)return new Ke([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Ke(e)}}toString(){return JSON.stringify(this.values)}}const Ye=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qe)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!Ye.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new Qe(e)}}toString(){return JSON.stringify(this.values)}}class et{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new et({name:e,available:!1}):null}}function tt(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 rt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Ge||e instanceof We||e instanceof Je||e instanceof Ke||e instanceof Qe||e instanceof et)return!0;if(Array.isArray(e)){for(const t of e)if(!rt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!rt(e[t]))return!1;return!0}return!1}function nt(e){if(null===e)return le;if("string"==typeof e)return ue;if("boolean"==typeof e)return de;if("number"==typeof e)return ce;if(e instanceof Ge)return he;if(e instanceof We)return fe;if(e instanceof Je)return ge;if(e instanceof Ke)return _e;if(e instanceof Qe)return ve;if(e instanceof et)return ye;if(Array.isArray(e)){const t=e.length;let r;for(const n of e){const e=nt(n);if(r){if(r===e)continue;r=me;break}r=e}return xe(r||me,t)}return pe}function it(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ge||e instanceof Je||e instanceof Ke||e instanceof Qe||e instanceof et?e.toString():JSON.stringify(e)}class at{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(!rt(e[1]))return t.error("invalid value");const r=e[1];let n=nt(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 at(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class st{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const ot={string:ue,number:ce,boolean:de,object:pe};class lt{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,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in ot)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=ot[r],n++}else i=me;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);a=e[2],n++}r=xe(i,a)}else{if(!ot[i])throw new Error(`Types doesn't contain name = ${i}`);r=ot[i]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,me);if(!r)return null;a.push(r)}return new lt(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!Ce(this.type,nt(r)))return r;if(t===this.args.length-1)throw new st(`Expected value to be of type ${be(this.type)}, but found ${be(nt(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const ct={"to-boolean":de,"to-color":he,"to-number":ce,"to-string":ue};class ut{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];if(!ct[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=ct[r],i=[];for(let a=1;a<e.length;a++){const r=t.parse(e[a],a,me);if(!r)return null;i.push(r)}return new ut(n,i)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Ge)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.`:tt(t[0],t[1],t[2],t[3]),!r))return new Ge(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new st(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=Ke.parse(t);if(n)return n}throw new st(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=Qe.parse(t);if(n)return n}throw new st(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{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 st(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Je.fromString(it(this.args[0].evaluate(e)));case"resolvedImage":return et.fromString(it(this.args[0].evaluate(e)));default:return it(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const dt=["Unknown","Point","LineString","Polygon"];class ht{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?dt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Ge.parse(e)),t}}class pt{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new oe,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];this.registry=e,this.path=r,this.key=r.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new lt(t,[e]):"coerce"===r?new ut(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=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[n];if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==e.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(e,i))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof at)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const t=new ht;try{n=new at(n.type,n.evaluate(t))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}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){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new pt(this.registry,this._isConstant,n,t||null,i,this.errors)}error(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const i=`${this.key}${r.map((e=>`[${e}]`)).join("")}`;this.errors.push(new se(i,e))}checkSubtype(e,t){const r=Ce(e,t);return r&&this.error(r),r}}class mt{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 i=1;i<e.length-1;i+=2){const n=e[i];if("string"!=typeof n)return t.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);const a=t.parse(e[i+1],i+1);if(!a)return null;r.push([n,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new mt(r,n):null}outputDefined(){return this.result.outputDefined()}}class ft{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 ft(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}}class gt{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,ce),n=t.parse(e[2],2,xe(t.expectedType||me));return r&&n?new gt(n.type.itemType,r,n):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new st(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new st(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new st(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class _t{constructor(e,t){this.type=de,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,me),n=t.parse(e[2],2,me);return r&&n?Se(r.type,[de,ue,ce,le,me])?new _t(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${be(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!ke(t,["boolean","string","number","null"]))throw new st(`Expected first argument to be of type boolean, string, number or null, but found ${be(nt(t))} instead.`);if(!ke(r,["string","array"]))throw new st(`Expected second argument to be of type array or string, but found ${be(nt(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class yt{constructor(e,t,r){this.type=ce,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,me),n=t.parse(e[2],2,me);if(!r||!n)return null;if(!Se(r.type,[de,ue,ce,le,me]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${be(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,ce);return i?new yt(r,n,i):null}return new yt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ke(t,["boolean","string","number","null"]))throw new st(`Expected first argument to be of type boolean, string, number or null, but found ${be(nt(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),ke(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(ke(r,["array"]))return r.indexOf(t,n);throw new st(`Expected second argument to be of type array or string, but found ${be(nt(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class vt{constructor(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}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={},a=[];for(let l=2;l<e.length-1;l+=2){let s=e[l];const o=e[l+1];Array.isArray(s)||(s=[s]);const c=t.concat(l);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,nt(e)))return null}else r=nt(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=a.length}const u=t.parse(o,l,n);if(!u)return null;n=n||u.type,a.push(u)}const s=t.parse(e[1],1,me);if(!s)return null;const o=t.parse(e[e.length-1],e.length-1,n);return o?"value"!==s.type.kind&&t.concat(1).checkSubtype(r,s.type)?null:new vt(r,n,s,i,a,o):null}evaluate(e){const t=this.input.evaluate(e);return(nt(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()}}class xt{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 a=1;a<e.length-1;a+=2){const i=t.parse(e[a],a,de);if(!i)return null;const s=t.parse(e[a+1],a+1,r);if(!s)return null;n.push([i,s]),r=r||s.type}const i=t.parse(e[e.length-1],e.length-1,r);if(!i)return null;if(!r)throw new Error("Can't infer output type");return new xt(r,n,i)}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=>{let[t,r]=e;return r.outputDefined()}))&&this.otherwise.outputDefined()}}class bt{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,me),n=t.parse(e[2],2,ce);if(!r||!n)return null;if(!Se(r.type,[xe(me),ue,me]))return t.error(`Expected first argument to be of type array or string, but found ${be(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,ce);return i?new bt(r.type,r,n,i):null}return new bt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),ke(t,["string"]))return[...t].slice(r,n).join("");if(ke(t,["array"]))return t.slice(r,n);throw new st(`Expected first argument to be of type array or string, but found ${be(nt(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function wt(e,t){const r=e.length-1;let n,i,a=0,s=r,o=0;for(;a<=s;)if(o=Math.floor((a+s)/2),n=e[o],i=e[o+1],n<=t){if(o===r||t<i)return o;a=o+1}else{if(!(n>t))throw new st("Input is not a number.");s=o-1}return 0}class Ct{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[n,i]of r)this.labels.push(n),this.outputs.push(i)}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,ce);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let a=1;a<e.length;a+=2){const r=1===a?-1/0:e[a],s=e[a+1],o=a,l=a+1;if("number"!=typeof r)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(n.length&&n[n.length-1][0]>=r)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);const c=t.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([r,c])}return new Ct(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[wt(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()))}}function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kt=jt;function jt(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}jt.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 a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var s=0,o=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?s=r:o=r,r=.5*(o-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Et=St(kt);function Tt(e,t,r){return e+r*(t-e)}function Pt(e,t,r){return e.map(((e,n)=>Tt(e,t[n],r)))}const It={number:Tt,color:function(e,t,r){switch(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb"){case"rgb":{const[n,i,a,s]=Pt(e.rgb,t.rgb,r);return new Ge(n,i,a,s,!1)}case"hcl":{const[n,i,a,s]=e.hcl,[o,l,c,u]=t.hcl;let d,h;if(isNaN(n)||isNaN(o))isNaN(n)?isNaN(o)?d=NaN:(d=o,1!==a&&0!==a||(h=l)):(d=n,1!==c&&0!==c||(h=i));else{let e=o-n;o>n&&e>180?e-=360:o<n&&n-o>180&&(e+=360),d=n+r*e}const[p,m,f,g]=function(e){let[t,r,n,i]=e;return t=isNaN(t)?0:t*Ae,Fe([n,Math.cos(t)*r,Math.sin(t)*r,i])}([d,null!=h?h:Tt(i,l,r),Tt(a,c,r),Tt(s,u,r)]);return new Ge(p,m,f,g,!1)}case"lab":{const[n,i,a,s]=Fe(Pt(e.lab,t.lab,r));return new Ge(n,i,a,s,!1)}}},array:Pt,padding:function(e,t,r){return new Ke(Pt(e.values,t.values,r))},variableAnchorOffsetCollection:function(e,t,r){const n=e.values,i=t.values;if(n.length!==i.length)throw new st(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let s=0;s<n.length;s+=2){if(n[s]!==i[s])throw new st(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${n[s]}, to[${s}]: ${i[s]}`);a.push(n[s]);const[e,t]=n[s+1],[o,l]=i[s+1];a.push([Tt(e,o,r),Tt(t,l,r)])}return new Qe(a)}};class Mt{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[a,s]of i)this.labels.push(a),this.outputs.push(s)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=Nt(t,e.base,r,n);else if("linear"===e.name)i=Nt(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;i=new Et(a[0],a[1],a[2],a[3]).solve(Nt(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...a]=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)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,ce),!i)return null;const s=[];let o=null;"interpolate-hcl"===r||"interpolate-lab"===r?o=he:t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let l=0;l<a.length;l+=2){const e=a[l],r=a[l+1],n=l+3,i=l+4;if("number"!=typeof e)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=e)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(r,i,o);if(!c)return null;o=o||c.type,s.push([e,c])}return je(o,ce)||je(o,he)||je(o,_e)||je(o,ve)||je(o,xe(ce))?new Mt(o,r,n,i,s):t.error(`Type ${be(o)} 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 a=wt(t,n),s=Mt.interpolationFactor(this.interpolation,n,t[a],t[a+1]),o=r[a].evaluate(e),l=r[a+1].evaluate(e);switch(this.operator){case"interpolate":return It[this.type.kind](o,l,s);case"interpolate-hcl":return It.color(o,l,s,"hcl");case"interpolate-lab":return It.color(o,l,s,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Nt(e,t,r,n){const i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}class At{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 s of e.slice(1)){const e=t.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}if(!r)throw new Error("No output type");const a=n&&i.some((e=>Ce(n,e.type)));return new At(a?me: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 et&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function Lt(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 Dt(e,t,r,n){return 0===n.compare(t,r)}function zt(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=de,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 a=t.parse(e[1],1,me);if(!a)return null;if(!Lt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${be(a.type)}'.`);let s=t.parse(e[2],2,me);if(!s)return null;if(!Lt(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${be(s.type)}'.`);if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${be(a.type)}' and '${be(s.type)}'.`);n&&("value"===a.type.kind&&"value"!==s.type.kind?a=new lt(s.type,[a]):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new lt(a.type,[s])));let o=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(o=t.parse(e[3],3,fe),!o)return null}return new i(a,s,o)}evaluate(i){const a=this.lhs.evaluate(i),s=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=nt(a),r=nt(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new st(`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=nt(a),r=nt(s);if("string"!==e.kind||"string"!==r.kind)return t(i,a,s)}return this.collator?r(i,a,s,this.collator.evaluate(i)):t(i,a,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Ot=zt("==",(function(e,t,r){return t===r}),Dt),Rt=zt("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Dt(0,t,r,n)})),Ft=zt("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),Bt=zt(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),Vt=zt("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),$t=zt(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Ut{constructor(e,t,r){this.type=fe,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=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,de);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,de);if(!i)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,ue),!a)?null:new Ut(n,i,a)}evaluate(e){return new We(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}}class Ht{constructor(e,t,r,n,i){this.type=ue,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ce);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.parse(n.locale,1,ue),!i))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,ue),!a))return null;let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,ce),!s))return null;let o=null;return n["max-fraction-digits"]&&(o=t.parse(n["max-fraction-digits"],1,ce),!o)?null:new Ht(r,i,a,s,o)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class qt{constructor(e){this.type=ge,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 a=1;a<=e.length-1;++a){const r=e[a];if(i&&"object"==typeof r&&!Array.isArray(r)){i=!1;let e=null;if(r["font-scale"]&&(e=t.parse(r["font-scale"],1,ce),!e))return null;let a=null;if(r["text-font"]&&(a=t.parse(r["text-font"],1,xe(ue)),!a))return null;let s=null;if(r["text-color"]&&(s=t.parse(r["text-color"],1,he),!s))return null;const o=n[n.length-1];o.scale=e,o.font=a,o.textColor=s}else{const r=t.parse(e[a],1,me);if(!r)return null;const s=r.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:r,scale:null,font:null,textColor:null})}}return new qt(n)}evaluate(e){return new Je(this.sections.map((t=>{const r=t.content.evaluate(e);return nt(r)===ye?new Xe("",r,null,null,null):new Xe(it(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}}class Zt{constructor(e){this.type=ye,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ue);return r?new Zt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=et.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Gt{constructor(e){this.type=ce,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 ${be(r.type)} instead.`):new Gt(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 st(`Expected value to be of type string or array, but found ${be(nt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Wt=8192;function Xt(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*Wt),Math.round(n*i*Wt)]}function Jt(e,t){const r=Math.pow(2,t.z);return[(i=(e[0]/Wt+t.x)/r,360*i-180),(n=(e[1]/Wt+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function Kt(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 Yt(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Qt(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],s=e[1]-r[1];return n*s-a*i==0&&n*a<=0&&i*s<=0}function er(e,t,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*a[0]&&!(!sr(e,t,r,n)||!sr(r,n,e,t));var i,a}function tr(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(er(e,t,n[r],n[r+1]))return!0;return!1}function rr(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(Qt(e,o[t],o[t+1]))return r;(a=o[t])[1]>(i=e)[1]!=(s=o[t+1])[1]>i[1]&&i[0]<(s[0]-a[0])*(i[1]-a[1])/(s[1]-a[1])+a[0]&&(n=!n)}var i,a,s;return n}function nr(e,t){for(const r of t)if(rr(e,r))return!0;return!1}function ir(e,t){for(const r of e)if(!rr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(tr(e[r],e[r+1],t))return!1;return!0}function ar(e,t){for(const r of t)if(ir(e,r))return!0;return!1}function sr(e,t,r,n){const i=n[0]-r[0],a=n[1]-r[1],s=(e[0]-r[0])*a-i*(e[1]-r[1]),o=(t[0]-r[0])*a-i*(t[1]-r[1]);return s>0&&o<0||s<0&&o>0}function or(e,t,r){const n=[];for(let i=0;i<e.length;i++){const a=[];for(let n=0;n<e[i].length;n++){const s=Xt(e[i][n],r);Kt(t,s),a.push(s)}n.push(a)}return n}function lr(e,t,r){const n=[];for(let i=0;i<e.length;i++){const a=or(e[i],t,r);n.push(a)}return n}function cr(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}Kt(t,e)}function ur(e,t,r,n){const i=Math.pow(2,n.z)*Wt,a=[n.x*Wt,n.y*Wt],s=[];for(const o of e)for(const e of o){const n=[e.x+a[0],e.y+a[1]];cr(n,t,r,i),s.push(n)}return s}function dr(e,t,r,n){const i=Math.pow(2,n.z)*Wt,a=[n.x*Wt,n.y*Wt],s=[];for(const l of e){const e=[];for(const r of l){const n=[r.x+a[0],r.y+a[1]];Kt(t,n),e.push(n)}s.push(e)}if(t[2]-t[0]<=i/2){(o=t)[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(const e of s)for(const n of e)cr(n,t,r,i)}var o;return s}class hr{constructor(e,t){this.type=de,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(rt(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length)return new hr(t,{type:"MultiPolygon",coordinates:e})}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new hr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new hr(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("Polygon"===t.type){const a=or(t.coordinates,n,i),s=ur(e.geometry(),r,n,i);if(!Yt(r,n))return!1;for(const e of s)if(!rr(e,a))return!1}if("MultiPolygon"===t.type){const a=lr(t.coordinates,n,i),s=ur(e.geometry(),r,n,i);if(!Yt(r,n))return!1;for(const e of s)if(!nr(e,a))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("Polygon"===t.type){const a=or(t.coordinates,n,i),s=dr(e.geometry(),r,n,i);if(!Yt(r,n))return!1;for(const e of s)if(!ir(e,a))return!1}if("MultiPolygon"===t.type){const a=lr(t.coordinates,n,i),s=dr(e.geometry(),r,n,i);if(!Yt(r,n))return!1;for(const e of s)if(!ar(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let pr=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(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 r=(this.length>>1)-1;r>=0;r--)this._down(r)}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,a=t[i];if(r(n,a)>=0)break;t[e]=a,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 a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}};function mr(e,t,r,n,i){fr(e,t,r,n||e.length-1,i||_r)}function fr(e,t,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,s=t-r+1,o=Math.log(a),l=.5*Math.exp(2*o/3),c=.5*Math.sqrt(o*l*(a-l)/a)*(s-a/2<0?-1:1);fr(e,t,Math.max(r,Math.floor(t-s*l/a+c)),Math.min(n,Math.floor(t+(a-s)*l/a+c)),i)}var u=e[t],d=r,h=n;for(gr(e,r,t),i(e[n],u)>0&&gr(e,r,n);d<h;){for(gr(e,d,h),d++,h--;i(e[d],u)<0;)d++;for(;i(e[h],u)>0;)h--}0===i(e[r],u)?gr(e,r,h):gr(e,++h,n),h<=t&&(r=h+1),t<=h&&(n=h-1)}}function gr(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function _r(e,t){return e<t?-1:e>t?1:0}function yr(e,t){if(e.length<=1)return[e];const r=[];let n,i;for(const a of e){const e=xr(a);0!==e&&(a.area=Math.abs(e),void 0===i&&(i=e<0),i===e<0?(n&&r.push(n),n=[a]):n.push(a))}if(n&&r.push(n),t>1)for(let a=0;a<r.length;a++)r[a].length<=t||(mr(r[a],t,1,r[a].length-1,vr),r[a]=r[a].slice(0,t));return r}function vr(e,t){return t.area-e.area}function xr(e){let t=0;for(let r,n,i=0,a=e.length,s=a-1;i<a;s=i++)r=e[i],n=e[s],t+=(n.x-r.x)*(r.y+n.y);return t}const br=1/298.257223563,wr=br*(2-br),Cr=Math.PI/180;class Sr{constructor(e){const t=6378.137*Cr*1e3,r=Math.cos(e*Cr),n=1/(1-wr*(1-r*r)),i=Math.sqrt(n);this.kx=t*i*r,this.ky=t*i*n*(1-wr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,i,a,s=1/0;for(let o=0;o<e.length-1;o++){let l=e[o][0],c=e[o][1],u=this.wrap(e[o+1][0]-l)*this.kx,d=(e[o+1][1]-c)*this.ky,h=0;0===u&&0===d||(h=(this.wrap(t[0]-l)*this.kx*u+(t[1]-c)*this.ky*d)/(u*u+d*d),h>1?(l=e[o+1][0],c=e[o+1][1]):h>0&&(l+=u/this.kx*h,c+=d/this.ky*h)),u=this.wrap(t[0]-l)*this.kx,d=(t[1]-c)*this.ky;const p=u*u+d*d;p<s&&(s=p,r=l,n=c,i=o,a=h)}return{point:[r,n],index:i,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function kr(e,t){return t[0]-e[0]}function jr(e){return e[1]-e[0]+1}function Er(e,t){return e[1]>=e[0]&&e[1]<t}function Tr(e,t){if(e[0]>e[1])return[null,null];const r=jr(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 n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Pr(e,t){if(!Er(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Kt(r,e[n]);return r}function Ir(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)Kt(t,e);return t}function Mr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Nr(e,t,r){if(!Mr(e)||!Mr(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 Ar(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Lr(e,t,r,n,i){const a=Math.min(Ar(e,[r,n],i),Ar(t,[r,n],i)),s=Math.min(Ar(r,[e,t],i),Ar(n,[e,t],i));return Math.min(a,s)}function Dr(e,t,r,n,i){if(!Er(t,e.length)||!Er(n,r.length))return 1/0;let a=1/0;for(let s=t[0];s<t[1];++s){const t=e[s],o=e[s+1];for(let e=n[0];e<n[1];++e){const n=r[e],s=r[e+1];if(er(t,o,n,s))return 0;a=Math.min(a,Lr(t,o,n,s,i))}}return a}function zr(e,t,r,n,i){if(!Er(t,e.length)||!Er(n,r.length))return NaN;let a=1/0;for(let s=t[0];s<=t[1];++s)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,i.distance(e[s],r[t])),0===a)return a;return a}function Or(e,t,r){if(rr(e,t,!0))return 0;let n=1/0;for(const i of t){const t=i[0],a=i[i.length-1];if(t!==a&&(n=Math.min(n,Ar(e,[a,t],r)),0===n))return n;const s=r.pointOnLine(i,e);if(n=Math.min(n,r.distance(e,s.point)),0===n)return n}return n}function Rr(e,t,r,n){if(!Er(t,e.length))return NaN;for(let a=t[0];a<=t[1];++a)if(rr(e[a],r,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],s=e[a+1];for(const e of r)for(let r=0,a=e.length,o=a-1;r<a;o=r++){const a=e[o],l=e[r];if(er(t,s,a,l))return 0;i=Math.min(i,Lr(t,s,a,l,n))}}return i}function Fr(e,t){for(const r of e)for(const e of r)if(rr(e,t,!0))return!0;return!1}function Br(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;const i=Ir(e),a=Ir(t);if(n!==1/0&&Nr(i,a,r)>=n)return n;if(Yt(i,a)){if(Fr(e,t))return 0}else if(Fr(t,e))return 0;let s=1/0;for(const o of e)for(let e=0,n=o.length,i=n-1;e<n;i=e++){const n=o[i],a=o[e];for(const e of t)for(let t=0,i=e.length,o=i-1;t<i;o=t++){const i=e[o],l=e[t];if(er(n,a,i,l))return 0;s=Math.min(s,Lr(n,a,i,l,r))}}return s}function Vr(e,t,r,n,i,a){if(!a)return;const s=Nr(Pr(n,a),i,r);s<t&&e.push([s,a,[0,0]])}function $r(e,t,r,n,i,a,s){if(!a||!s)return;const o=Nr(Pr(n,a),Pr(i,s),r);o<t&&e.push([o,a,s])}function Ur(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=Math.min(n.distance(e[0],r[0][0]),i);if(0===a)return a;const s=new pr([[0,[0,e.length-1],[0,0]]],kr),o=Ir(r);for(;s.length>0;){const i=s.pop();if(i[0]>=a)continue;const l=i[1],c=t?50:100;if(jr(l)<=c){if(!Er(l,e.length))return NaN;if(t){const t=Rr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const i=Or(e[t],r,n);if(a=Math.min(a,i),0===a)return 0}}else{const r=Tr(l,t);Vr(s,a,n,e,o,r[0]),Vr(s,a,n,e,o,r[1])}}return a}function Hr(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,s=Math.min(a,i.distance(e[0],r[0]));if(0===s)return s;const o=new pr([[0,[0,e.length-1],[0,r.length-1]]],kr);for(;o.length>0;){const a=o.pop();if(a[0]>=s)continue;const l=a[1],c=a[2],u=t?50:100,d=n?50:100;if(jr(l)<=u&&jr(c)<=d){if(!Er(l,e.length)&&Er(c,r.length))return NaN;let a;if(t&&n)a=Dr(e,l,r,c,i),s=Math.min(s,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=c[0];e<=c[1];++e)if(a=Ar(r[e],t,i),s=Math.min(s,a),0===s)return s}else if(!t&&n){const t=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Ar(e[r],t,i),s=Math.min(s,a),0===s)return s}else a=zr(e,l,r,c,i),s=Math.min(s,a)}else{const a=Tr(l,t),u=Tr(c,n);$r(o,s,i,e,r,a[0],u[0]),$r(o,s,i,e,r,a[0],u[1]),$r(o,s,i,e,r,a[1],u[0]),$r(o,s,i,e,r,a[1],u[1])}}return s}function qr(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}class Zr{constructor(e,t){this.type=ce,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(rt(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Zr(t,t.features.map((e=>qr(e.geometry))).flat());if("Feature"===t.type)return new Zr(t,qr(t.geometry));if("type"in t&&"coordinates"in t)return new Zr(t,qr(t))}return t.error("'distance' 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=e.geometry(),n=r.flat().map((t=>Jt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new Sr(n[0][1]);let a=1/0;for(const s of t){switch(s.type){case"Point":a=Math.min(a,Hr(n,!1,[s.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Hr(n,!1,s.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Ur(n,!1,s.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>Jt([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new Sr(n[0][1]);let a=1/0;for(const s of t){switch(s.type){case"Point":a=Math.min(a,Hr(n,!0,[s.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Hr(n,!0,s.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Ur(n,!0,s.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=yr(r,0).map((t=>t.map((t=>t.map((t=>Jt([t.x,t.y],e.canonical))))))),i=new Sr(n[0][0][0][1]);let a=1/0;for(const s of t)for(const e of n){switch(s.type){case"Point":a=Math.min(a,Ur([s.coordinates],!1,e,i,a));break;case"LineString":a=Math.min(a,Ur(s.coordinates,!0,e,i,a));break;case"Polygon":a=Math.min(a,Br(e,s.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Gr={"==":Ot,"!=":Rt,">":Bt,"<":Ft,">=":$t,"<=":Vt,array:lt,at:gt,boolean:lt,case:xt,coalesce:At,collator:Ut,format:qt,image:Zt,in:_t,"index-of":yt,interpolate:Mt,"interpolate-hcl":Mt,"interpolate-lab":Mt,length:Gt,let:mt,literal:at,match:vt,number:lt,"number-format":Ht,object:lt,slice:bt,step:Ct,string:lt,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,var:ft,within:hr,distance:Zr};class Wr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=Wr.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,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((t=>{let[r]=t;return!Array.isArray(r)||r.length===e.length-1}));let o=null;for(const[l,c]of s){o=new pt(t.registry,Qr,t.path,null,t.scope);const n=[];let a=!1;for(let t=1;t<e.length;t++){const r=e[t],i=Array.isArray(l)?l[t-1]:l.type,s=o.parse(r,1+n.length,i);if(!s){a=!0;break}n.push(s)}if(!a)if(Array.isArray(l)&&l.length!==n.length)o.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let e=0;e<n.length;e++){const t=Array.isArray(l)?l[e]:l.type,r=n[e];o.concat(e+1).checkSubtype(t,r.type)}if(0===o.errors.length)return new Wr(r,i,c,n)}}if(1===s.length)t.errors.push(...o.errors);else{const r=(s.length?s:a).map((e=>{let[t]=e;return r=t,Array.isArray(r)?`(${r.map(be).join(", ")})`:`(${be(r.type)}...)`;var r})).join(" | "),n=[];for(let i=1;i<e.length;i++){const r=t.parse(e[i],1+n.length);if(!r)return null;n.push(be(r.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Wr.definitions=t;for(const r in t)e[r]=Wr}}function Xr(e,t){let[r,n,i,a]=t;r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);const s=a?a.evaluate(e):1,o=tt(r,n,i,s);if(o)throw new st(o);return new Ge(r/255,n/255,i/255,s,!1)}function Jr(e,t){return e in t}function Kr(e,t){const r=t[e];return void 0===r?null:r}function Yr(e){return{type:e}}function Qr(e){if(e instanceof ft)return Qr(e.boundExpression);if(e instanceof Wr&&"error"===e.name)return!1;if(e instanceof Ut)return!1;if(e instanceof hr)return!1;if(e instanceof Zr)return!1;const t=e instanceof ut||e instanceof lt;let r=!0;return e.eachChild((e=>{r=t?r&&Qr(e):r&&e instanceof at})),!!r&&en(e)&&rn(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function en(e){if(e instanceof Wr){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 hr)return!1;if(e instanceof Zr)return!1;let t=!0;return e.eachChild((e=>{t&&!en(e)&&(t=!1)})),t}function tn(e){if(e instanceof Wr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!tn(e)&&(t=!1)})),t}function rn(e,t){if(e instanceof Wr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!rn(e,t)&&(r=!1)})),r}function nn(e){return{result:"success",value:e}}function an(e){return{result:"error",value:e}}function sn(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function on(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ln(e){return!!e.expression&&e.expression.interpolated}function cn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function un(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function dn(e){return e}function hn(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),a=e.type||(ln(t)?"exponential":"interval");if(r||"padding"===t.type){const n=r?Ge.parse:Ke.parse;(e=ae({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],n(e[1])]))),e.default=n(e.default?e.default:t.default)}if(e.colorSpace&&"rgb"!==(s=e.colorSpace)&&"hcl"!==s&&"lab"!==s)throw new Error(`Unknown color space: "${e.colorSpace}"`);var s;let o,l,c;if("exponential"===a)o=gn;else if("interval"===a)o=fn;else if("categorical"===a){o=mn,l=Object.create(null);for(const t of e.stops)l[t[0]]=t[1];c=typeof e.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);o=_n}if(n){const r={},n=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],a=i[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},n.push(a)),r[a].stops.push([i[0].value,i[1]])}const i=[];for(const e of n)i.push([r[e].zoom,hn(r[e],t)]);const a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:Mt.interpolationFactor.bind(void 0,a),zoomStops:i.map((e=>e[0])),evaluate:(r,n)=>
2{let{zoom:a}=r;return gn({stops:i,base:e.base},t,a).evaluate(a,n)}}}if(i){const r="exponential"===a?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Mt.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:r=>{let{zoom:n}=r;return o(e,t,n,l,c)}}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?pn(e.default,t.default):o(e,t,i,l,c)}}}function pn(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function mn(e,t,r,n,i){return pn(typeof r===i?n[r]:void 0,e.default,t.default)}function fn(e,t,r){if("number"!==cn(r))return pn(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=wt(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function gn(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==cn(r))return pn(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 a=wt(e.stops.map((e=>e[0])),r),s=function(e,t,r,n){const i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[a][0],e.stops[a+1][0]),o=e.stops[a][1],l=e.stops[a+1][1],c=It[t.type]||dn;return"function"==typeof o.evaluate?{evaluate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const i=o.evaluate.apply(void 0,r),a=l.evaluate.apply(void 0,r);if(void 0!==i&&void 0!==a)return c(i,a,s,e.colorSpace)}}:c(o,l,s,e.colorSpace)}function _n(e,t,r){switch(t.type){case"color":r=Ge.parse(r);break;case"formatted":r=Je.fromString(r.toString());break;case"resolvedImage":r=et.fromString(r.toString());break;case"padding":r=Ke.parse(r);break;default:cn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return pn(r,e.default,t.default)}Wr.register(Gr,{error:[{kind:"error"},[ue],(e,t)=>{let[r]=t;throw new st(r.evaluate(e))}],typeof:[ue,[me],(e,t)=>{let[r]=t;return be(nt(r.evaluate(e)))}],"to-rgba":[xe(ce,4),[he],(e,t)=>{let[r]=t;const[n,i,a,s]=r.evaluate(e).rgb;return[255*n,255*i,255*a,s]}],rgb:[he,[ce,ce,ce],Xr],rgba:[he,[ce,ce,ce,ce],Xr],has:{type:de,overloads:[[[ue],(e,t)=>{let[r]=t;return Jr(r.evaluate(e),e.properties())}],[[ue,pe],(e,t)=>{let[r,n]=t;return Jr(r.evaluate(e),n.evaluate(e))}]]},get:{type:me,overloads:[[[ue],(e,t)=>{let[r]=t;return Kr(r.evaluate(e),e.properties())}],[[ue,pe],(e,t)=>{let[r,n]=t;return Kr(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[me,[ue],(e,t)=>{let[r]=t;return Kr(r.evaluate(e),e.featureState||{})}],properties:[pe,[],e=>e.properties()],"geometry-type":[ue,[],e=>e.geometryType()],id:[me,[],e=>e.id()],zoom:[ce,[],e=>e.globals.zoom],"heatmap-density":[ce,[],e=>e.globals.heatmapDensity||0],"line-progress":[ce,[],e=>e.globals.lineProgress||0],accumulated:[me,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[ce,Yr(ce),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[ce,Yr(ce),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:ce,overloads:[[[ce,ce],(e,t)=>{let[r,n]=t;return r.evaluate(e)-n.evaluate(e)}],[[ce],(e,t)=>{let[r]=t;return-r.evaluate(e)}]]},"/":[ce,[ce,ce],(e,t)=>{let[r,n]=t;return r.evaluate(e)/n.evaluate(e)}],"%":[ce,[ce,ce],(e,t)=>{let[r,n]=t;return r.evaluate(e)%n.evaluate(e)}],ln2:[ce,[],()=>Math.LN2],pi:[ce,[],()=>Math.PI],e:[ce,[],()=>Math.E],"^":[ce,[ce,ce],(e,t)=>{let[r,n]=t;return Math.pow(r.evaluate(e),n.evaluate(e))}],sqrt:[ce,[ce],(e,t)=>{let[r]=t;return Math.sqrt(r.evaluate(e))}],log10:[ce,[ce],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))/Math.LN10}],ln:[ce,[ce],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))}],log2:[ce,[ce],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))/Math.LN2}],sin:[ce,[ce],(e,t)=>{let[r]=t;return Math.sin(r.evaluate(e))}],cos:[ce,[ce],(e,t)=>{let[r]=t;return Math.cos(r.evaluate(e))}],tan:[ce,[ce],(e,t)=>{let[r]=t;return Math.tan(r.evaluate(e))}],asin:[ce,[ce],(e,t)=>{let[r]=t;return Math.asin(r.evaluate(e))}],acos:[ce,[ce],(e,t)=>{let[r]=t;return Math.acos(r.evaluate(e))}],atan:[ce,[ce],(e,t)=>{let[r]=t;return Math.atan(r.evaluate(e))}],min:[ce,Yr(ce),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[ce,Yr(ce),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[ce,[ce],(e,t)=>{let[r]=t;return Math.abs(r.evaluate(e))}],round:[ce,[ce],(e,t)=>{let[r]=t;const n=r.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[ce,[ce],(e,t)=>{let[r]=t;return Math.floor(r.evaluate(e))}],ceil:[ce,[ce],(e,t)=>{let[r]=t;return Math.ceil(r.evaluate(e))}],"filter-==":[de,[ue,me],(e,t)=>{let[r,n]=t;return e.properties()[r.value]===n.value}],"filter-id-==":[de,[me],(e,t)=>{let[r]=t;return e.id()===r.value}],"filter-type-==":[de,[ue],(e,t)=>{let[r]=t;return e.geometryType()===r.value}],"filter-<":[de,[ue,me],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[de,[me],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[de,[ue,me],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[de,[me],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[de,[ue,me],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[de,[me],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[de,[ue,me],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[de,[me],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[de,[me],(e,t)=>{let[r]=t;return r.value in e.properties()}],"filter-has-id":[de,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[de,[xe(ue)],(e,t)=>{let[r]=t;return r.value.indexOf(e.geometryType())>=0}],"filter-id-in":[de,[xe(me)],(e,t)=>{let[r]=t;return r.value.indexOf(e.id())>=0}],"filter-in-small":[de,[ue,xe(me)],(e,t)=>{let[r,n]=t;return n.value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[de,[ue,xe(me)],(e,t)=>{let[r,n]=t;return 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()[r.value],n.value,0,n.value.length-1)}],all:{type:de,overloads:[[[de,de],(e,t)=>{let[r,n]=t;return r.evaluate(e)&&n.evaluate(e)}],[Yr(de),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:de,overloads:[[[de,de],(e,t)=>{let[r,n]=t;return r.evaluate(e)||n.evaluate(e)}],[Yr(de),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[de,[de],(e,t)=>{let[r]=t;return!r.evaluate(e)}],"is-supported-script":[de,[ue],(e,t)=>{let[r]=t;const n=e.globals&&e.globals.isSupportedScript;return!n||n(r.evaluate(e))}],upcase:[ue,[ue],(e,t)=>{let[r]=t;return r.evaluate(e).toUpperCase()}],downcase:[ue,[ue],(e,t)=>{let[r]=t;return r.evaluate(e).toLowerCase()}],concat:[ue,Yr(me),(e,t)=>t.map((t=>it(t.evaluate(e)))).join("")],"resolved-locale":[ue,[fe],(e,t)=>{let[r]=t;return r.evaluate(e).resolvedLocale()}]});class yn{constructor(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new ht,this._defaultValue=t?"color"===(r=t).type&&un(r.default)?new Ge(0,0,0,0):"color"===r.type?Ge.parse(r.default)||null:"padding"===r.type?Ke.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?Qe.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||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 st(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function vn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Gr}function xn(e,t){const r=new pt(Gr,Qr,[],t?function(e){const t={color:he,string:ue,number:ce,enum:ue,boolean:de,formatted:ge,padding:_e,resolvedImage:ye,variableAnchorOffsetCollection:ve};return"array"===e.type?xe(t[e.value]||me,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?nn(new yn(n,t)):an(r.errors)}class bn{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!tn(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}}class wn{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!tn(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}interpolationFactor(e,t,r){return this.interpolationType?Mt.interpolationFactor(this.interpolationType,e,t,r):0}}function Cn(e,t){const r=xn(e,t);if("error"===r.result)return r;const n=r.value.expression,i=en(n);if(!i&&!sn(t))return an([new se("","data expressions not supported")]);const a=rn(n,["zoom"]);if(!a&&!on(t))return an([new se("","zoom expressions not supported")]);const s=kn(n);return s||a?s instanceof se?an([s]):s instanceof Mt&&!ln(t)?an([new se("",'"interpolate" expressions cannot be used with this property')]):nn(s?new wn(i?"camera":"composite",r.value,s.labels,s instanceof Mt?s.interpolation:void 0):new bn(i?"constant":"source",r.value)):an([new se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Sn{constructor(e,t){this._parameters=e,this._specification=t,ae(this,hn(this._parameters,this._specification))}static deserialize(e){return new Sn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function kn(e){let t=null;if(e instanceof mt)t=kn(e.result);else if(e instanceof At){for(const r of e.args)if(t=kn(r),t)break}else(e instanceof Ct||e instanceof Mt)&&e.input instanceof Wr&&"zoom"===e.input.name&&(t=e);return t instanceof se||e.eachChild((e=>{const r=kn(e);r instanceof se?t=r:!t&&r?t=new se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new se("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function jn(e){if(!0===e||!1===e)return!0;
vendor: 16,811 bytes, line 2
2if(!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(!jn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const En={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Tn(e){if(null==e)return{filter:()=>!0,needGeometry:!1};jn(e)||(e=Mn(e));const t=xn(e,En);if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,r,n)=>t.value.evaluate(e,r,{},n),needGeometry:In(e)}}function Pn(e,t){return e<t?-1:e>t?1:0}function In(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(In(e[t]))return!0;return!1}function Mn(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?Nn(e[1],e[2],"=="):"!="===t?Dn(Nn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Nn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(Mn))):"all"===t?["all"].concat(e.slice(1).map(Mn)):"none"===t?["all"].concat(e.slice(1).map(Mn).map(Dn)):"in"===t?An(e[1],e.slice(2)):"!in"===t?Dn(An(e[1],e.slice(2))):"has"===t?Ln(e[1]):"!has"!==t||Dn(Ln(e[1]));var r}function Nn(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 An(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(Pn)]]:["filter-in-small",e,["literal",t]]}}function Ln(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Dn(e){return["!",e]}function zn(e){const t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const r of e)t+=`${zn(r)},`;return`${t}]`}const r=Object.keys(e).sort();let n="{";for(let i=0;i<r.length;i++)n+=`${JSON.stringify(r[i])}:${zn(e[r[i]])},`;return`${n}}`}function On(e){let t="";for(const r of G)t+=`/${zn(e[r])}`;return t}function Rn(e){const t=e.value;return t?[new ie(e.key,t,"constants have been deprecated as of v8")]:[]}function Fn(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Bn(e){if(Array.isArray(e))return e.map(Bn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=Bn(e[r]);return t}return Fn(e)}function Vn(e){const t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,s=e.styleSpec,o=e.validateSpec;let l=[];const c=cn(r);if("object"!==c)return[new ie(t,r,`object expected, ${c} found`)];for(const u in r){const e=u.split(".")[0],c=n[e]||n["*"];let d;if(i[e])d=i[e];else if(n[e])d=o;else if(i["*"])d=i["*"];else{if(!n["*"]){l.push(new ie(t,r[u],`unknown property "${u}"`));continue}d=o}l=l.concat(d({key:(t?`${t}.`:t)+u,value:r[u],valueSpec:c,style:a,styleSpec:s,object:r,objectKey:u,validateSpec:o},r))}for(const u in n)i[u]||n[u].required&&void 0===n[u].default&&void 0===r[u]&&l.push(new ie(t,r,`missing required property "${u}"`));return l}function $n(e){const t=e.value,r=e.valueSpec,n=e.style,i=e.styleSpec,a=e.key,s=e.arrayElementValidator||e.validateSpec;if("array"!==cn(t))return[new ie(a,t,`array expected, ${cn(t)} found`)];if(r.length&&t.length!==r.length)return[new ie(a,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new ie(a,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let o={type:r.value,values:r.values};i.$version<7&&(o.function=r.function),"object"===cn(r.value)&&(o=r.value);let l=[];for(let c=0;c<t.length;c++)l=l.concat(s({array:t,arrayIndex:c,value:t[c],valueSpec:o,validateSpec:e.validateSpec,style:n,styleSpec:i,key:`${a}[${c}]`}));return l}function Un(e){const t=e.key,r=e.value,n=e.valueSpec;let i=cn(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new ie(t,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new ie(t,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new ie(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Hn(e){const t=e.valueSpec,r=Fn(e.value.type);let n,i,a,s={};const o="categorical"!==r&&void 0===e.value.property,l=!o,c="array"===cn(e.value.stops)&&"array"===cn(e.value.stops[0])&&"object"===cn(e.value.stops[0][0]),u=Vn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new ie(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const n=e.value;return t=t.concat($n({key:e.key,value:n,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),"array"===cn(n)&&0===n.length&&t.push(new ie(e.key,n,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&o&&u.push(new ie(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new ie(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!ln(e.valueSpec)&&u.push(new ie(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!sn(e.valueSpec)?u.push(new ie(e.key,e.value,"property functions not supported")):o&&!on(e.valueSpec)&&u.push(new ie(e.key,e.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==e.value.property||u.push(new ie(e.key,e.value,'"property" property is required')),u;function d(e){let r=[];const n=e.value,o=e.key;if("array"!==cn(n))return[new ie(o,n,`array expected, ${cn(n)} found`)];if(2!==n.length)return[new ie(o,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==cn(n[0]))return[new ie(o,n,`object expected, ${cn(n[0])} found`)];if(void 0===n[0].zoom)return[new ie(o,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ie(o,n,"object stop key must have value")];if(a&&a>Fn(n[0].zoom))return[new ie(o,n[0].zoom,"stop zoom values must appear in ascending order")];Fn(n[0].zoom)!==a&&(a=Fn(n[0].zoom),i=void 0,s={}),r=r.concat(Vn({key:`${o}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Un,value:h}}))}else r=r.concat(h({key:`${o}[0]`,value:n[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},n));return vn(Bn(n[1]))?r.concat([new ie(`${o}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${o}[1]`,value:n[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function h(e,a){const o=cn(e.value),l=Fn(e.value),c=null!==e.value?e.value:a;if(n){if(o!==n)return[new ie(e.key,c,`${o} stop domain type must match previous stop domain type ${n}`)]}else n=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return[new ie(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==r){let n=`number expected, ${o} found`;return sn(t)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ie(e.key,c,n)]}return"categorical"!==r||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===o&&void 0!==i&&l<i?[new ie(e.key,c,"stop domain values must appear in ascending order")]:(i=l,"categorical"===r&&l in s?[new ie(e.key,c,"stop domain values must be unique")]:(s[l]=!0,[])):[new ie(e.key,c,`integer expected, found ${l}`)]}}function qn(e){const t=("property"===e.expressionContext?Cn:xn)(Bn(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new ie(`${e.key}${t.key}`,e.value,t.message)));const r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new ie(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!tn(r))return[new ie(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!tn(r))return[new ie(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!rn(r,["zoom","feature-state"]))return[new ie(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!en(r))return[new ie(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Zn(e){const t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Fn(r))&&i.push(new ie(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Fn(r))&&i.push(new ie(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Gn(e){return jn(Bn(e.value))?qn(ae({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wn(e)}function Wn(e){const t=e.value,r=e.key;if("array"!==cn(t))return[new ie(r,t,`array expected, ${cn(t)} found`)];const n=e.styleSpec;let i,a=[];if(t.length<1)return[new ie(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Zn({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Fn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Fn(t[1])&&a.push(new ie(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&a.push(new ie(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(i=cn(t[1]),"string"!==i&&a.push(new ie(`${r}[1]`,t[1],`string expected, ${i} found`)));for(let s=2;s<t.length;s++)i=cn(t[s]),"$type"===Fn(t[1])?a=a.concat(Zn({key:`${r}[${s}]`,value:t[s],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new ie(`${r}[${s}]`,t[s],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let n=1;n<t.length;n++)a=a.concat(Wn({key:`${r}[${n}]`,value:t[n],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=cn(t[1]),2!==t.length?a.push(new ie(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==i&&a.push(new ie(`${r}[1]`,t[1],`string expected, ${i} found`))}return a}function Xn(e,t){const r=e.key,n=e.validateSpec,i=e.style,a=e.styleSpec,s=e.value,o=e.objectKey,l=a[`${t}_${e.layerType}`];if(!l)return[];const c=o.match(/^(.*)-transition$/);if("paint"===t&&c&&l[c[1]]&&l[c[1]].transition)return n({key:r,value:s,valueSpec:a.transition,style:i,styleSpec:a});const u=e.valueSpec||l[o];if(!u)return[new ie(r,s,`unknown property "${o}"`)];let d;if("string"===cn(s)&&sn(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(s)))return[new ie(r,s,`"${o}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];const h=[];return"symbol"===e.layerType&&("text-field"===o&&i&&!i.glyphs&&h.push(new ie(r,s,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&un(Bn(s))&&"identity"===Fn(s.type)&&h.push(new ie(r,s,'"text-font" does not support identity functions'))),h.concat(n({key:e.key,value:s,valueSpec:u,style:i,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:o}))}function Jn(e){return Xn(e,"paint")}function Kn(e){return Xn(e,"layout")}function Yn(e){let t=[];const r=e.value,n=e.key,i=e.style,a=e.styleSpec;r.type||r.ref||t.push(new ie(n,r,'either "type" or "ref" is required'));let s=Fn(r.type);const o=Fn(r.ref);if(r.id){const a=Fn(r.id);for(let s=0;s<e.arrayIndex;s++){const e=i.layers[s];Fn(e.id)===a&&t.push(new ie(n,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new ie(n,r[e],`"${e}" is prohibited for ref layers`))})),i.layers.forEach((t=>{Fn(t.id)===o&&(e=t)})),e?e.ref?t.push(new ie(n,r.ref,"ref cannot reference another ref layer")):s=Fn(e.type):t.push(new ie(n,r.ref,`ref layer "${o}" not found`))}else if("background"!==s)if(r.source){const e=i.sources&&i.sources[r.source],a=e&&Fn(e.type);e?"vector"===a&&"raster"===s?t.push(new ie(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===s?t.push(new ie(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==s?t.push(new ie(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==s?t.push(new ie(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&e.lineMetrics||t.push(new ie(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ie(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ie(n,r.source,`source "${r.source}" not found`))}else t.push(new ie(n,r,'missing required property "source"'));return t=t.concat(Vn({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:Gn,layout:e=>Vn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Kn(ae({layerType:s},e))}}),paint:e=>Vn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Jn(ae({layerType:s},e))}})}})),t}function Qn(e){const t=e.value,r=e.key,n=cn(t);return"string"!==n?[new ie(r,t,`string expected, ${n} found`)]:[]}const ei={promoteId:function(e){let{key:t,value:r}=e;if("string"===cn(r))return Qn({key:t,value:r});{const e=[];for(const n in r)e.push(...Qn({key:`${t}.${n}`,value:r[n]}));return e}}};function ti(e){const t=e.value,r=e.key,n=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new ie(r,t,'"type" is required')];const s=Fn(t.type);let o;switch(s){case"vector":case"raster":return o=Vn({key:r,value:t,valueSpec:n[`source_${s.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:ei,validateSpec:a}),o;case"raster-dem":return o=function(e){var t;const r=null!==(t=e.sourceName)&&void 0!==t?t:"",n=e.value,i=e.styleSpec,a=i.source_raster_dem,s=e.style;let o=[];const l=cn(n);if(void 0===n)return o;if("object"!==l)return o.push(new ie("source_raster_dem",n,`object expected, ${l} found`)),o;const c="custom"===Fn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],d=e.value.encoding?`"${e.value.encoding}"`:"Default";for(const h in n)!c&&u.includes(h)?o.push(new ie(h,n[h],`In "${r}": "${h}" is only valid when "encoding" is set to "custom". ${d} encoding found`)):a[h]?o=o.concat(e.validateSpec({key:h,value:n[h],valueSpec:a[h],validateSpec:e.validateSpec,style:s,styleSpec:i})):o.push(new ie(h,n[h],`unknown property "${h}"`));return o}({sourceName:r,value:t,style:e.style,styleSpec:n,validateSpec:a}),o;case"geojson":if(o=Vn({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:ei}),t.cluster)for(const e in t.clusterProperties){const[n,i]=t.clusterProperties[e],s="string"==typeof n?[n,["accumulated"],["get",e]]:n;o.push(...qn({key:`${r}.${e}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),o.push(...qn({key:`${r}.${e}.reduce`,value:s,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return Vn({key:r,value:t,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return Vn({key:r,value:t,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ie(r,null,"Please use runtime APIs to add canvas sources, rather than
2including them in stylesheets.","source.canvas")];default:return Zn({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function ri(e){const t=e.value,r=e.styleSpec,n=r.light,i=e.style;let a=[];const s=cn(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new ie("light",t,`object expected, ${s} found`)]),a;for(const o in t){const s=o.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?e.validateSpec({key:o,value:t[o],valueSpec:r.transition,validateSpec:e.validateSpec,style:i,styleSpec:r}):n[o]?e.validateSpec({key:o,value:t[o],valueSpec:n[o],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new ie(o,t[o],`unknown property "${o}"`)])}return a}function ni(e){const t=e.value,r=e.styleSpec,n=r.sky,i=e.style,a=cn(t);if(void 0===t)return[];if("object"!==a)return[new ie("sky",t,`object expected, ${a} found`)];let s=[];for(const o in t)s=s.concat(n[o]?e.validateSpec({key:o,value:t[o],valueSpec:n[o],style:i,styleSpec:r}):[new ie(o,t[o],`unknown property "${o}"`)]);return s}function ii(e){const t=e.value,r=e.styleSpec,n=r.terrain,i=e.style;let a=[];const s=cn(t);if(void 0===t)return a;
vendor: 74,665 bytes, line 2
2if("object"!==s)return a=a.concat([new ie("terrain",t,`object expected, ${s} found`)]),a;for(const o in t)a=a.concat(n[o]?e.validateSpec({key:o,value:t[o],valueSpec:n[o],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new ie(o,t[o],`unknown property "${o}"`)]);return a}function ai(e){let t=[];const r=e.value,n=e.key;if(Array.isArray(r)){const i=[],a=[];for(const s in r)r[s].id&&i.includes(r[s].id)&&t.push(new ie(n,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),i.push(r[s].id),r[s].url&&a.includes(r[s].url)&&t.push(new ie(n,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),t=t.concat(Vn({key:`${n}[${s}]`,value:r[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return Qn({key:n,value:r})}const si={"*":()=>[],array:$n,boolean:function(e){const t=e.value,r=e.key,n=cn(t);return"boolean"!==n?[new ie(r,t,`boolean expected, ${n} found`)]:[]},number:Un,color:function(e){const t=e.key,r=e.value,n=cn(r);return"string"!==n?[new ie(t,r,`color expected, ${n} found`)]:Ge.parse(String(r))?[]:[new ie(t,r,`color expected, "${r}" found`)]},constants:Rn,enum:Zn,filter:Gn,function:Hn,layer:Yn,object:Vn,source:ti,light:ri,sky:ni,terrain:ii,projection:function(e){const t=e.value,r=e.styleSpec,n=r.projection,i=e.style,a=cn(t);if(void 0===t)return[];if("object"!==a)return[new ie("projection",t,`object expected, ${a} found`)];let s=[];for(const o in t)s=s.concat(n[o]?e.validateSpec({key:o,value:t[o],valueSpec:n[o],style:i,styleSpec:r}):[new ie(o,t[o],`unknown property "${o}"`)]);return s},string:Qn,formatted:function(e){return 0===Qn(e).length?[]:qn(e)},resolvedImage:function(e){return 0===Qn(e).length?[]:qn(e)},padding:function(e){const t=e.key,r=e.value;if("array"===cn(r)){if(r.length<1||r.length>4)return[new ie(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let i=[];for(let a=0;a<r.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:n}));return i}return Un({key:t,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(e){const t=e.key,r=e.value,n=cn(r),i=e.styleSpec;if("array"!==n||r.length<1||r.length%2!=0)return[new ie(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let s=0;s<r.length;s+=2)a=a.concat(Zn({key:`${t}[${s}]`,value:r[s],valueSpec:i.layout_symbol["text-anchor"]})),a=a.concat($n({key:`${t}[${s+1}]`,value:r[s+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a},sprite:ai};function oi(e){const t=e.value,r=e.valueSpec,n=e.styleSpec;return e.validateSpec=oi,r.expression&&un(Fn(t))?Hn(e):r.expression&&vn(Bn(t))?qn(e):r.type&&si[r.type]?si[r.type](e):Vn(ae({},e,{valueSpec:r.type?n[r.type]:r}))}function li(e){const t=e.value,r=e.key,n=Qn(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new ie(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new ie(r,t,'"glyphs" url must include a "{range}" token'))),n}function ci(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z,r=[];return r=r.concat(oi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:oi,objectElementValidators:{glyphs:li,"*":()=>[]}})),e.constants&&(r=r.concat(Rn({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:oi}))),di(r)}function ui(e){return function(t){return e({...t,validateSpec:oi})}}function di(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function hi(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return di(e.apply(this,r))}}ci.source=hi(ui(ti)),ci.sprite=hi(ui(ai)),ci.glyphs=hi(ui(li)),ci.light=hi(ui(ri)),ci.sky=hi(ui(ni)),ci.terrain=hi(ui(ii)),ci.layer=hi(ui(Yn)),ci.filter=hi(ui(Gn)),ci.paintProperty=hi(ui(Jn)),ci.layoutProperty=hi(ui(Kn));const pi=ci,mi=pi.light,fi=pi.sky,gi=pi.paintProperty,_i=pi.layoutProperty;function yi(e,t){let r=!1;if(t&&t.length)for(const n of t)e.fire(new H(new Error(n.message))),r=!0;return r}class vi{constructor(e,t,r){const n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(r=i[2]);for(let e=0;e<this.d*this.d;e++){const t=i[3+e],r=i[3+e+1];n.push(t===r?null:i.subarray(t,r))}const a=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;const i=r/t*e;this.min=-i,this.max=e+i}insert(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,n,i,a){this.cells[i].push(a)}query(e,t,r,n,i){const a=this.min,s=this.max;if(e<=a&&t<=a&&s<=r&&s<=n&&!i)return Array.prototype.slice.call(this.keys);{const a=[];return this._forEachCell(e,t,r,n,this._queryCell,a,{},i),a}}_queryCell(e,t,r,n,i,a,s,o){const l=this.cells[i];if(null!==l){const i=this.keys,c=this.bboxes;for(let u=0;u<l.length;u++){const d=l[u];if(void 0===s[d]){const l=4*d;(o?o(c[l+0],c[l+1],c[l+2],c[l+3]):e<=c[l+2]&&t<=c[l+3]&&r>=c[l+0]&&n>=c[l+1])?(s[d]=!0,a.push(i[d])):s[d]=!1}}}}_forEachCell(e,t,r,n,i,a,s,o){const l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),d=this._convertToCellCoord(n);for(let h=l;h<=u;h++)for(let l=c;l<=d;l++){const c=this.d*l+h;if((!o||o(this._convertFromCellCoord(h),this._convertFromCellCoord(l),this._convertFromCellCoord(h+1),this._convertFromCellCoord(l+1)))&&i.call(this,e,t,r,n,c,a,s,o))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,t=3+this.cells.length+1+1;let r=0;for(let a=0;a<this.cells.length;a++)r+=this.cells[a].length;const n=new Int32Array(t+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let i=t;for(let a=0;a<e.length;a++){const t=e[a];n[3+a]=i,n.set(t,i),i+=t.length}return n[3+e.length]=i,n.set(this.keys,i),i+=this.keys.length,n[3+e.length+1]=i,n.set(this.bboxes,i),i+=this.bboxes.length,n.buffer}static serialize(e,t){const r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(e){return new vi(e.buffer)}}const xi={};function bi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(xi[e])throw new Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),xi[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}bi("Object",Object),bi("TransferableGridIndex",vi),bi("Color",Ge),bi("Error",Error),bi("AJAXError",O),bi("ResolvedImage",et),bi("StylePropertyFunction",Sn),bi("StyleExpression",yn,{omit:["_evaluator"]}),bi("ZoomDependentExpression",wn),bi("ZoomConstantExpression",bn),bi("CompoundExpression",Wr,{omit:["_evaluate"]});for(const Fd in Gr)Gr[Fd]._classRegistryKey||bi(`Expression_${Fd}`,Gr[Fd]);function wi(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Ci(e){return e.$name||e.constructor._classRegistryKey}function Si(e){return!function(e){if(null===e||"object"!=typeof e)return!1;const t=Ci(e);return!(!t||"Object"===t)}(e)&&(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||e instanceof Blob||e instanceof Error||wi(e)||E(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function ki(e,t){if(Si(e))return(wi(e)||E(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const n of e)r.push(ki(n,t));return r}if("object"!=typeof e)throw new Error("can't serialize object of type "+typeof e);const r=Ci(e);if(!r)throw new Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!xi[r])throw new Error(`${r} is not registered.`);const{klass:n}=xi[r],i=n.serialize?n.serialize(e,t):{};if(n.serialize){if(t&&i===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const n in e){if(!e.hasOwnProperty(n))continue;if(xi[r].omit.indexOf(n)>=0)continue;const a=e[n];i[n]=xi[r].shallow.indexOf(n)>=0?a:ki(a,t)}e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function ji(e){if(Si(e))return e;if(Array.isArray(e))return e.map(ji);if("object"!=typeof e)throw new Error("can't deserialize object of type "+typeof e);const t=Ci(e)||"Object";if(!xi[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=xi[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 i of Object.keys(e)){if("$name"===i)continue;const r=e[i];n[i]=xi[t].shallow.indexOf(i)>=0?r:ji(r)}return n}class Ei{constructor(){this.first=!0}update(e,t){const r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}}const Ti={"Latin-1 Supplement":e=>e>=128&&e<=255,"Hangul Jamo":e=>e>=4352&&e<=4607,Khmer:e=>e>=6016&&e<=6143,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Katakana:e=>e>=12448&&e<=12543,Kanbun:e=>e>=12688&&e<=12703,"CJK Strokes":e=>e>=12736&&e<=12783,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"Private Use Area":e=>e>=57344&&e<=63743,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519};function Pi(e){for(const t of e)if(Di(t.charCodeAt(0)))return!0;return!1}function Ii(e){for(const t of e)if(!Ai(t.charCodeAt(0)))return!1;return!0}function Mi(e){const t=e.map((e=>{try{return new RegExp(`\\p{sc=${e}}`,"u").source}catch(e){return null}})).filter((e=>e));return new RegExp(t.join("|"),"u")}const Ni=Mi(["Arab","Dupl","Mong","Ougr","Syrc"]);function Ai(e){return!Ni.test(String.fromCodePoint(e))}const Li=Mi(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Di(e){return!(746!==e&&747!==e&&(e<4352||!(Ti["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Ti["CJK Compatibility"](e)||Ti["CJK Strokes"](e)||!(!Ti["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Ti["Enclosed CJK Letters and Months"](e)||Ti["Ideographic Description Characters"](e)||Ti.Kanbun(e)||Ti.Katakana(e)&&12540!==e||!(!Ti["Halfwidth and Fullwidth Forms"](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)||!(!Ti["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Ti["Vertical Forms"](e)||Ti["Yijing Hexagram Symbols"](e)||/\p{sc=Cans}/u.test(String.fromCodePoint(e))||/\p{sc=Hang}/u.test(String.fromCodePoint(e))||Li.test(String.fromCodePoint(e)))))}function zi(e){return!(Di(e)||function(e){return!!(Ti["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Ti["General Punctuation"](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)||Ti["Letterlike Symbols"](e)||Ti["Number Forms"](e)||Ti["Miscellaneous Technical"](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)||Ti["Control Pictures"](e)&&9251!==e||Ti["Optical Character Recognition"](e)||Ti["Enclosed Alphanumerics"](e)||Ti["Geometric Shapes"](e)||Ti["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Ti["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ti["CJK Symbols and Punctuation"](e)||Ti.Katakana(e)||Ti["Private Use Area"](e)||Ti["CJK Compatibility Forms"](e)||Ti["Small Form Variants"](e)||Ti["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}const Oi=Mi(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ri(e){return Oi.test(String.fromCodePoint(e))}function Fi(e,t){return!(!t&&Ri(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Ti.Khmer(e))}function Bi(e){for(const t of e)if(Ri(t.charCodeAt(0)))return!0;return!1}const Vi=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class $i{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ei,this.transition={})}isSupportedScript(e){return function(e,t){for(const r of e)if(!Fi(r.charCodeAt(0),t))return!1;return!0}(e,"loaded"===Vi.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}}class Ui{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(un(e))return new Sn(e,t);if(vn(e)){const r=Cn(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=Ge.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)&&(r=Qe.parse(e)):r=Ke.parse(e),{kind:"constant",evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class Hi{constructor(e){this.property=e,this.value=new Ui(e,void 0)}transitioned(e,t){return new Zi(this.property,this.value,t,_({},e.transition,this.transition),e.now)}untransitioned(){return new Zi(this.property,this.value,null,{},0)}}class qi{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return b(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Hi(this._values[e].property)),this._values[e].value=new Ui(this._values[e].property,null===t?void 0:b(t))}getTransition(e){return b(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Hi(this._values[e].property)),this._values[e].transition=b(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 Gi(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 Gi(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Zi{constructor(e,t,r,n,i){this.property=e,this.value=t,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,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),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(e,t,r);{const s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),i,function(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)}(s))}}return i}}class Gi{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const n=new Ji(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 Wi{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return void 0!==this._values[e].value}getValue(e){return b(this._values[e].value)}setValue(e,t){this._values[e]=new Ui(this._values[e].property,null===t?void 0:b(t))}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){const n=new Ji(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}}class Xi{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}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)}}class Ji{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ki{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){const n=It[this.specification.type];return n?n(e,t,r):e}}class Yi{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n){return new Xi(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)}:e.expression,t)}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 Xi(this,{kind:"constant",value:void 0},e.parameters);const n=It[this.specification.type];if(n){const i=n(e.value.value,t.value.value,r);return new Xi(this,{kind:"constant",value:i},e.parameters)}return e}evaluate(e,t,r,n,i,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,a)}}class Qi extends Yi{possiblyEvaluate(e,t,r,n){if(void 0===e.value)return new Xi(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){const i=e.expression.evaluate(t,null,{},r,n),a="resolvedImage"===e.property.specification.type&&"string"!=typeof i?i.name:i,s=this._calculate(a,a,a,t);return new Xi(this,{kind:"constant",value:s},t)}if("camera"===e.expression.kind){const r=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Xi(this,{kind:"constant",value:r},t)}return new Xi(this,e.expression,t)}evaluate(e,t,r,n,i,a){if("source"===e.kind){const s=e.evaluate(t,r,n,i,a);return this._calculate(s,s,s,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class ea{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){const i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new $i(Math.floor(t.zoom-1),t)),e.expression.evaluate(new $i(Math.floor(t.zoom),t)),e.expression.evaluate(new $i(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class ta{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class ra{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const t in e){const r=e[t];r.specification.overridable&&this.overridableProperties.push(t);const n=this.defaultPropertyValues[t]=new Ui(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new Hi(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}}}bi("DataDrivenProperty",Yi),bi("DataConstantProperty",Ki),bi("CrossFadedDataDrivenProperty",Qi),bi("CrossFadedProperty",ea),bi("ColorRampProperty",ta);const na="-transition";class ia extends q{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Wi(t.layout)),t.paint)){this._transitionablePaint=new qi(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ji(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!=t&&this._validate(_i,`layers.${this.id}.layout.${e}`,e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return e.endsWith(na)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=t&&this._validate(gi,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith(na))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{const r=this._transitionablePaint._values[e],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const s=this._transitionablePaint._values[e].value;return s.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(e,a,s)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(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){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),x(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!i||!1!==i.validate)&&yi(this,e.call(pi,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:Z,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Xi&&sn(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}}const aa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class sa{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}}class oa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(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,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,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.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)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function la(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0,n=0;return{members:e.map((e=>{const i=aa[e.type].BYTES_PER_ELEMENT,a=r=ca(r,Math.max(t,i)),s=e.components||1;return n=Math.max(n,i),r+=i*s,{name:e.name,type:e.type,components:s,offset:a}})),size:ca(r,Math.max(n,t)),alignment:t}}function ca(e,t){return Math.ceil(e/t)*t}class ua extends oa{_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}}ua.prototype.bytesPerElement=4,bi("StructArrayLayout2i4",ua);class da extends oa{_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}}da.prototype.bytesPerElement=6,bi("StructArrayLayout3i6",da);class ha extends oa{_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 a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e}}ha.prototype.bytesPerElement=8,bi("StructArrayLayout4i8",ha);class pa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){const o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,this.int16[o+4]=a,this.int16[o+5]=s,e}}pa.prototype.bytesPerElement=12,bi("StructArrayLayout2i4i12",pa);class ma extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){const o=4*e,l=8*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=s,e}}ma.prototype.bytesPerElement=8,bi("StructArrayLayout2i4ub8",ma);class fa extends oa{_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}}fa.prototype.bytesPerElement=8,bi("StructArrayLayout2f8",fa);class ga extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,s,o,l,c)}emplace(e,t,r,n,i,a,s,o,l,c,u){const d=10*e;return this.uint16[d+0]=t,this.uint16[d+1]=r,this.uint16[d+2]=n,this.uint16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.uint16[d+8]=c,this.uint16[d+9]=u,e}}ga.prototype.bytesPerElement=20,bi("StructArrayLayout10ui20",ga);class _a extends oa{_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,a,s,o,l,c,u,d){const h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,n,i,a,s,o,l,c,u,d)}emplace(e,t,r,n,i,a,s,o,l,c,u,d,h){const p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=s,this.uint16[p+6]=o,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=d,this.int16[p+11]=h,e}}_a.prototype.bytesPerElement=24,bi("StructArrayLayout4i4ui4i24",_a);class ya extends oa{_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}}ya.prototype.bytesPerElement=12,bi("StructArrayLayout3f12",ya);class va extends oa{_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}}va.prototype.bytesPerElement=4,bi("StructArrayLayout1ul4",va);class xa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,s,o,l)}emplace(e,t,r,n,i,a,s,o,l,c){const u=10*e,d=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=s,this.uint32[d+3]=o,this.uint16[u+8]=l,this.uint16[u+9]=c,e}}xa.prototype.bytesPerElement=20,bi("StructArrayLayout6i1ul2ui20",xa);class ba extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){const o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,this.int16[o+4]=a,this.int16[o+5]=s,e}}ba.prototype.bytesPerElement=12,bi("StructArrayLayout2i2i2i12",ba);class wa extends oa{_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 a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)}emplace(e,t,r,n,i,a){const s=4*e,o=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=n,this.int16[o+6]=i,this.int16[o+7]=a,e}}wa.prototype.bytesPerElement=16,bi("StructArrayLayout2f1f2i16",wa);class Ca extends oa{_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,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){const o=16*e,l=4*e,c=8*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=s,e}}Ca.prototype.bytesPerElement=16,bi("StructArrayLayout2ub2f2i16",Ca);class Sa extends oa{_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}}Sa.prototype.bytesPerElement=6,bi("StructArrayLayout3ui6",Sa);class ka extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g){const _=this.length;return this.resize(_+1),this.emplace(_,e,t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g)}emplace(e,t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g,_){const y=24*e,v=12*e,x=48*e;return this.int16[y+0]=t,this.int16[y+1]=r,this.uint16[y+2]=n,this.uint16[y+3]=i,this.uint32[v+2]=a,this.uint32[v+3]=s,this.uint32[v+4]=o,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=u,this.float32[v+7]=d,this.float32[v+8]=h,this.uint8[x+36]=p,this.uint8[x+37]=m,this.uint8[x+38]=f,this.uint32[v+10]=g,this.int16[y+22]=_,e}}ka.prototype.bytesPerElement=48,bi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ka);class ja extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g,_,y,v,x,b,w,C,S,k,j,E){const T=this.length;return this.resize(T+1),this.emplace(T,e,t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g,_,y,v,x,b,w,C,S,k,j,E)}emplace(e,t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g,_,y,v,x,b,w,C,S,k,j,E,T){const P=32*e,I=16*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]=a,this.int16[P+5]=s,this.int16[P+6]=o,this.int16[P+7]=l,this.uint16[P+8]=c,this.uint16[P+9]=u,this.uint16[P+10]=d,this.uint16[P+11]=h,this.uint16[P+12]=p,this.uint16[P+13]=m,this.uint16[P+14]=f,this.uint16[P+15]=g,this.uint16[P+16]=_,this.uint16[P+17]=y,this.uint16[P+18]=v,this.uint16[P+19]=x,this.uint16[P+20]=b,this.uint16[P+21]=w,this.uint16[P+22]=C,this.uint32[I+12]=S,this.float32[I+13]=k,this.float32[I+14]=j,this.uint16[P+30]=E,this.uint16[P+31]=T,e}}ja.prototype.bytesPerElement=64,bi("StructArrayLayout8i15ui1ul2f2ui64",ja);class Ea extends oa{_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}}Ea.prototype.bytesPerElement=4,bi("StructArrayLayout1f4",Ea);class Ta extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(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.uint16[6*e+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}Ta.prototype.bytesPerElement=12,bi("StructArrayLayout1ui2f12",Ta);class Pa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(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=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=r,this.uint16[i+3]=n,e}}Pa.prototype.bytesPerElement=8,bi("StructArrayLayout1ul2ui8",Pa);class Ia extends oa{_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}}Ia.prototype.bytesPerElement=4,bi("StructArrayLayout2ui4",Ia);class Ma extends oa{_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}}Ma.prototype.bytesPerElement=2,bi("StructArrayLayout1ui2",Ma);class Na extends oa{_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 a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e}}Na.prototype.bytesPerElement=16,bi("StructArrayLayout4f16",Na);class Aa extends sa{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}}Aa.prototype.size=20;class La extends xa{get(e){return new Aa(this,e)}}bi("CollisionBoxArray",La);class Da extends sa{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Da.prototype.size=48;class za extends ka{get(e){return new Da(this,e)}}bi("PlacedSymbolArray",za);class Oa extends sa{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Oa.prototype.size=64;class Ra extends ja{get(e){return new Oa(this,e)}}bi("SymbolInstanceArray",Ra);class Fa extends Ea{getoffsetX(e){return this.float32[1*e+0]}}bi("GlyphOffsetArray",Fa);class Ba extends da{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}bi("SymbolLineVertexArray",Ba);class Va extends sa{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Va.prototype.size=12;class $a extends Ta{get(e){return new Va(this,e)}}bi("TextAnchorOffsetArray",$a);class Ua extends sa{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]}}Ua.prototype.size=8;class Ha extends Pa{get(e){return new Ua(this,e)}}bi("FeatureIndexArray",Ha);class qa extends ua{}class Za extends ua{}class Ga extends ua{}class Wa extends pa{}class Xa extends ma{}class Ja extends fa{}class Ka extends ga{}class Ya extends _a{}class Qa extends ya{}class es extends va{}class ts extends ba{}class rs extends Ca{}class ns extends Sa{}class is extends Ia{}const as=la([{name:"a_pos",components:2,type:"Int16"}],4),{members:ss}=as;class os{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=e}prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>os.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${os.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>os.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}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 os([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function ls(e,t){return 256*(e=f(Math.floor(e),0,255))+f(Math.floor(t),0,255)}os.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,bi("SegmentVector",os);const cs=la([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var us={exports:{}},ds={exports:{}};ds.exports=function(e,t){var r,n,i,a,s,o,l,c;for(n=e.length-(r=3&e.length),i=t,s=3432918353,o=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&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>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)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&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};var hs=ds.exports,ps={exports:{}};ps.exports=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<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,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var ms=hs,fs=ps.exports;us.exports=ms,us.exports.murmur3=ms,us.exports.murmur2=fs;var gs=r(us.exports);class _s{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(ys(e)),this.positions.push(t,r,n)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const t=ys(e);let r=0,n=this.ids.length-1;for(;r<n;){const e=r+n>>1;this.ids[e]>=t?n=e:r=e+1}const i=[];for(;this.ids[r]===t;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(e,t){const r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return vs(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(e){const t=new _s;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function ys(e){const t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:gs(String(e))}function vs(e,t,r,n){for(;r<n;){const i=e[r+n>>1];let a=r-1,s=n+1;for(;;){do{a++}while(e[a]<i);do{s--}while(e[s]>i);if(a>=s)break;xs(e,a,s),xs(t,3*a,3*s),xs(t,3*a+1,3*s+1),xs(t,3*a+2,3*s+2)}s-r<n-s?(vs(e,t,r,s),r=s+1):(vs(e,t,s+1,n),n=s)}}function xs(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}bi("FeaturePositionMap",_s);class bs{constructor(e,t){this.gl=e.gl,this.location=t}}class ws extends bs{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Cs extends bs{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class Ss extends bs{constructor(e,t){super(e,t),this.current=Ge.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const ks=new Float32Array(16);function js(e){return[ls(255*e.r,255*e.g),ls(255*e.b,255*e.a)]}class Es{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new Ss(e,t):new ws(e,t)}}class Ts{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,r,n){const i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&e.set(i)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)?new Cs(e,t):new ws(e,t)}}class Ps{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){const a=this.paintVertexArray.length,s=this.expression.evaluate(new $i(0),t,{},n,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,t,r,n){const i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(e,t,i)}_setPaintValue(e,t,r){if("color"===this.type){const n=js(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[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.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Is{constructor(e,t,r,n,i,a){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,r,n,i){const a=this.expression.evaluate(new $i(this.zoom),t,{},n,[],i),s=this.expression.evaluate(new $i(this.zoom+1),t,{},n,[],i),o=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(o,e,a,s)}updatePaintArray(e,t,r,n){const i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(e,t,i,a)}_setPaintValue(e,t,r,n){if("color"===this.type){const i=js(r),a=js(n);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[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))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){const r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=f(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(n)}getBinding(e,t,r){return new ws(e,t)}}class Ms{constructor(e,t,r,n,i,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(e,t,r){const n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,n,i){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],i)}_setPaintValues(e,t,r,n){if(!n||!r)return;const{min:i,mid:a,max:s}=r,o=n[i],l=n[a],c=n[s];if(o&&l&&c)for(let u=e;u<t;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],l.pixelRatio,o.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,cs.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,cs.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ns{constructor(e,t,r){this.binders={},this._buffers=[];const n=[];for(const i in e.paint._values){if(!r(i))continue;const a=e.paint.get(i);if(!(a instanceof Xi&&sn(a.property.specification)))continue;const s=Ls(i,e.type),o=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],d="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===o.kind)this.binders[i]=d?new Ts(o.value,s):new Es(o.value,s,l),n.push(`/u_${i}`);else if("source"===o.kind||d){const r=Ds(i,l,"source");this.binders[i]=d?new Ms(o,l,c,t,r,e.id):new Ps(o,s,l,r),n.push(`/a_${i}`)}else{const e=Ds(i,l,"composite");this.binders[i]=new Is(o,s,l,c,t,e),n.push(`/z_${i}`)}}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Ps||t instanceof Is?t.maxValue:0}populatePaintArrays(e,t,r,n,i){for(const a in this.binders){const s=this.binders[a];(s instanceof Ps||s instanceof Is||s instanceof Ms)&&s.populatePaintArray(e,t,r,n,i)}}setConstantPatternPositions(e,t){for(const r in this.binders){const n=this.binders[r];n instanceof Ts&&n.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,r,n,i){let a=!1;for(const s in e){const o=t.getPositions(s);for(const t of o){const o=r.feature(t.index);for(const r in this.binders){const l=this.binders[r];if((l instanceof Ps||l instanceof Is||l instanceof Ms)&&!0===l.expression.isStateDependent){const c=n.paint.get(r);l.expression=c.value,l.updatePaintArray(t.start,t.end,o,e[s],i),a=!0}}}}return a}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof Es||r instanceof Ts)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Ps||r instanceof Is)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name);else if(r instanceof Ms)for(let t=0;t<cs.members.length;t++)e.push(cs.members[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Es||r instanceof Ts||r instanceof Is)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){const r=[];for(const n in this.binders){const i=this.binders[n];if(i instanceof Es||i instanceof Ts||i instanceof Is)for(const a of i.uniformNames)if(t[a]){const s=i.getBinding(e,t[a],a);r.push({name:a,property:n,binding:s})}}return r}setUniforms(e,t,r,n){for(const{name:i,property:a,binding:s}of t)this.binders[a].setUniform(s,n,r.get(a),i)}updatePaintBuffers(e){this._buffers=[];for(const t in this.binders){const r=this.binders[t];if(e&&r instanceof Ms){const t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof Ps||r instanceof Is)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof Ps||r instanceof Is||r instanceof Ms)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Ps||t instanceof Is||t instanceof Ms)&&t.destroy()}}}class As{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new Ns(n,t,r);this.needsUpload=!1,this._featureMap=new _s,this._bufferOffset=0}populatePaintArrays(e,t,r,n,i,a){for(const s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,t,n,i,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n){for(const i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,n)||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()}}function Ls(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function Ds(e,t,r){const n={color:{source:fa,composite:Na},number:{source:Ea,composite:fa}},i=function(e){return{"line-pattern":{source:Ka,composite:Ka},"fill-pattern":{source:Ka,composite:Ka},"fill-extrusion-pattern":{source:Ka,composite:Ka}}[e]}(e);return i&&i[r]||n[t][r]}bi("ConstantBinder",Es),bi("CrossFadedConstantBinder",Ts),bi("SourceExpressionBinder",Ps),bi("CrossFadedCompositeBinder",Ms),bi("CompositeExpressionBinder",Is),bi("ProgramConfiguration",Ns,{omit:["_buffers"]}),bi("ProgramConfigurationSet",As);const zs=8192,Os=Math.pow(2,14)-1,Rs=-Os-1;function Fs(e){const t=zs/e.extent,r=e.loadGeometry();for(let n=0;n<r.length;n++){const e=r[n];for(let r=0;r<e.length;r++){const n=e[r],i=Math.round(n.x*t),a=Math.round(n.y*t);n.x=f(i,Rs,Os),n.y=f(a,Rs,Os),(i<n.x||i>n.x+1||a<n.y||a>n.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Bs(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Fs(e):[]}}function Vs(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}class $s{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Za,this.indexArray=new ns,this.segments=new os,this.programConfigurations=new As(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){const n=this.layers[0],i=[];let a=null,s=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),s=!a.isConstant());for(const{feature:o,id:l,index:c,sourceLayerIndex:u}of e){const e=this.layers[0]._featureFilter.needGeometry,t=Bs(o,e);if(!this.layers[0]._featureFilter.filter(new $i(this.zoom),t,r))continue;const n=s?a.evaluate(t,{},r):void 0,d={id:l,properties:o.properties,type:o.type,sourceLayerIndex:u,index:c,geometry:e?t.geometry:Fs(o),patterns:{},sortKey:n};i.push(d)}s&&i.sort(((e,t)=>e.sortKey-t.sortKey));for(const o of i){const{geometry:n,index:i,sourceLayerIndex:a}=o,s=e[i].feature;this.addFeature(o,n,i,r),t.featureIndex.insert(s,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ss),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n){for(const i of t)for(const t of i){const r=t.x,n=t.y;if(r<0||r>=zs||n<0||n>=zs)continue;const i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=i.vertexLength;Vs(this.layoutVertexArray,r,n,-1,-1),Vs(this.layoutVertexArray,r,n,1,-1),Vs(this.layoutVertexArray,r,n,1,1),Vs(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)}}function Us(e,t){for(let r=0;r<e.length;r++)if(Ys(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Ys(e,t[r]))return!0;return!!Gs(e,t)}function Hs(e,t,r){return!!Ys(e,t)||!!Xs(t,e,r)}function qs(e,t){if(1===e.length)return Ks(t,e[0]);for(let r=0;r<t.length;r++){const n=t[r];for(let t=0;t<n.length;t++)if(Ys(e,n[t]))return!0}for(let r=0;r<e.length;r++)if(Ks(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Gs(e,t[r]))return!0;return!1}function Zs(e,t,r){if(e.length>1){if(Gs(e,t))return!0;for(let n=0;n<t.length;n++)if(Xs(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(Xs(e[n],t,r))return!0;return!1}function Gs(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(Ws(n,i,t[e],t[e+1]))return!0}return!1}function Ws(e,t,r,n){return S(e,r,n)!==S(t,r,n)&&S(e,t,r)!==S(e,t,n)}function Xs(e,t,r){const n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let i=1;i<t.length;i++)if(Js(e,t[i-1],t[i])<n)return!0;return!1}function Js(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 Ks(e,t){let r,n,i,a=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)n=r[e],i=r[s],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function Ys(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){const a=e[n],s=e[i];a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function Qs(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 a=S(e,t,r[0]);return a!==S(e,t,r[1])||a!==S(e,t,r[2])||a!==S(e,t,r[3])}function eo(e,t,r){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function to(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ro(e,t,r,n,i){if(!t[0]&&!t[1])return e;const s=a.convert(t)._mult(i);"viewport"===r&&s._rotate(-n);const o=[];for(let a=0;a<e.length;a++)o.push(e[a].sub(s));return o}let no,io;bi("CircleBucket",$s,{omit:["layers"]});var ao={get paint(){return io=io||new ra({"circle-radius":new Yi(Z.paint_circle["circle-radius"]),"circle-color":new Yi(Z.paint_circle["circle-color"]),"circle-blur":new Yi(Z.paint_circle["circle-blur"]),"circle-opacity":new Yi(Z.paint_circle["circle-opacity"]),"circle-translate":new Ki(Z.paint_circle["circle-translate"]),"circle-translate-anchor":new Ki(Z.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ki(Z.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ki(Z.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Yi(Z.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Yi(Z.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Yi(Z.paint_circle["circle-stroke-opacity"])})},get layout(){return no=no||new ra({"circle-sort-key":new Yi(Z.layout_circle["circle-sort-key"])})}},so=1e-6,oo="undefined"!=typeof Float32Array?Float32Array:Array;function lo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function co(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],m=t[11],f=t[12],g=t[13],_=t[14],y=t[15],v=r[0],x=r[1],b=r[2],w=r[3];return e[0]=v*n+x*o+b*d+w*f,e[1]=v*i+x*l+b*h+w*g,e[2]=v*a+x*c+b*p+w*_,e[3]=v*s+x*u+b*m+w*y,e[4]=(v=r[4])*n+(x=r[5])*o+(b=r[6])*d+(w=r[7])*f,e[5]=v*i+x*l+b*h+w*g,e[6]=v*a+x*c+b*p+w*_,e[7]=v*s+x*u+b*m+w*y,e[8]=(v=r[8])*n+(x=r[9])*o+(b=r[10])*d+(w=r[11])*f,e[9]=v*i+x*l+b*h+w*g,e[10]=v*a+x*c+b*p+w*_,e[11]=v*s+x*u+b*m+w*y,e[12]=(v=r[12])*n+(x=r[13])*o+(b=r[14])*d+(w=r[15])*f,e[13]=v*i+x*l+b*h+w*g,e[14]=v*a+x*c+b*p+w*_,e[15]=v*s+x*u+b*m+w*y,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var uo,ho=co;function po(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*s,e}uo=new oo(4),oo!=Float32Array&&(uo[0]=0,uo[1]=0,uo[2]=0,uo[3]=0);class mo extends ia{constructor(e){super(e,ao)}createBucket(e){return new $s(e)}queryRadius(e){const t=e;return eo("circle-radius",this,t)+eo("circle-stroke-width",this,t)+to(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,n,i,a,s,o){const l=ro(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,s),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),d=u?l:function(e,t){return e.map((e=>fo(e,t)))}(l,o),h=u?c*s:c;for(const p of n)for(const e of p){const t=u?e:fo(e,o);let r=h;const n=po([],[e.x,e.y,0,1],o);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),Hs(d,t,r))return!0}return!1}}function fo(e,t){const r=po([],[e.x,e.y,0,1],t);return new a(r[0]/r[3],r[1]/r[3])}class go extends $s{}let _o;bi("HeatmapBucket",go,{omit:["layers"]});var yo={get paint(){return _o=_o||new ra({"heatmap-radius":new Yi(Z.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Yi(Z.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ki(Z.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ta(Z.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ki(Z.paint_heatmap["heatmap-opacity"])})}};function vo(e,t,r,n){let{width:i,height:a}=t;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${i*a*r}`)}else n=new Uint8Array(i*a*r);return e.width=i,e.height=a,e.data=n,e}function xo(e,t,r){let{width:n,height:i}=t;if(n===e.width&&i===e.height)return;const a=vo({},{width:n,height:i},r);bo(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=a.data}function bo(e,t,r,n,i,a){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 s=e.data,o=t.data;if(s===o)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){const c=((r.y+l)*e.width+r.x)*a,u=((n.y+l)*t.width+n.x)*a;for(let e=0;e<i.width*a;e++)o[u+e]=s[c+e]}return t}class wo{constructor(e,t){vo(this,e,1,t)}resize(e){xo(this,e,1)}clone(){return new wo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){bo(e,t,r,n,i,1)}}class Co{constructor(e,t){vo(this,e,4,t)}resize(e){xo(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Co({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){bo(e,t,r,n,i,4)}}function So(e){const t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new Co({width:r,height:n});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const a=(r,n,a)=>{t[e.evaluationKey]=a;const s=e.expression.evaluate(t);i.data[r+n+0]=Math.floor(255*s.r/s.a),i.data[r+n+1]=Math.floor(255*s.g/s.a),i.data[r+n+2]=Math.floor(255*s.b/s.a),i.data[r+n+3]=Math.floor(255*s.a)};if(e.clips)for(let s=0,o=0;s<n;++s,o+=4*r)for(let t=0,n=0;t<r;t++,n+=4){const i=t/(r-1),{start:l,end:c}=e.clips[s];a(o,n,l*(1-i)+c*i)}else for(let s=0,o=0;s<r;s++,o+=4)a(0,o,s/(r-1));return i}bi("AlphaImage",wo),bi("RGBAImage",Co);const ko="big-fb";class jo extends ia{createBucket(e){return new go(e)}constructor(e){super(e,yo),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=So({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(ko)&&this.heatmapFbos.delete(ko)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let Eo;var To={get paint(){return Eo=Eo||new ra({"hillshade-illumination-direction":new Ki(Z.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ki(Z.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ki(Z.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ki(Z.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ki(Z.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ki(Z.paint_hillshade["hillshade-accent-color"])})}};class Po extends ia{constructor(e){super(e,To)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}const Io=la([{name:"a_pos",components:2,type:"Int16"}],4),{members:Mo}=Io;function No(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const n=t&&t.length,i=n?t[0]*r:e.length;let a=Ao(e,0,i,r,!0);const s=[];if(!a||a.next===a.prev)return s;let o,l,c;if(n&&(a=function(e,t,r,n){const i=[];for(let a=0,s=t.length;a<s;a++){const r=Ao(e,t[a]*n,a<s-1?t[a+1]*n:e.length,n,!1);r===r.next&&(r.steiner=!0),i.push(Ho(r))}i.sort(Bo);for(let a=0;a<i.length;a++)r=Vo(i[a],r);return r}(e,t,a,r)),e.length>80*r){o=1/0,l=1/0;let t=-1/0,n=-1/0;for(let a=r;a<i;a+=r){const r=e[a],i=e[a+1];r<o&&(o=r),i<l&&(l=i),r>t&&(t=r),i>n&&(n=i)}c=Math.max(t-o,n-l),c=0!==c?32767/c:0}return Do(a,s,r,o,l,c,0),s}function Ao(e,t,r,n,i){let a;if(i===function(e,t,r,n){let i=0;for(let a=t,s=r-n;a<r;a+=n)i+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return i}(e,t,r,n)>0)for(let s=t;s<r;s+=n)a=el(s/n|0,e[s],e[s+1],a);else for(let s=r-n;s>=t;s-=n)a=el(s/n|0,e[s],e[s+1],a);return a&&Wo(a,a.next)&&(tl(a),a=a.next),a}function Lo(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Wo(n,n.next)&&0!==Go(n.prev,n,n.next))n=n.next;else{if(tl(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function Do(e,t,r,n,i,a,s){if(!e)return;!s&&a&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=Uo(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 a=null;for(t=0;i;){t++;let s=i,o=0;for(let e=0;e<r&&(o++,s=s.nextZ,s);e++);let l=r;for(;o>0||l>0&&s;)0!==o&&(0===l||!s||i.z<=s.z)?(n=i,i=i.nextZ,o--):(n=s,s=s.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=s}a.nextZ=null,r*=2}while(t>1)}(i)}(e,n,i,a);let o=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(a?Oo(e,n,i,a):zo(e))t.push(l.i,e.i,c.i),tl(e),e=c.next,o=c.next;else if((e=c)===o){s?1===s?Do(e=Ro(Lo(e),t),t,r,n,i,a,2):2===s&&Fo(e,t,r,n,i,a):Do(Lo(e),t,r,n,i,a,1);break}}}function zo(e){const t=e.prev,r=e,n=e.next;if(Go(t,r,n)>=0)return!1;const i=t.x,a=r.x,s=n.x,o=t.y,l=r.y,c=n.y,u=i<a?i<s?i:s:a<s?a:s,d=o<l?o<c?o:c:l<c?l:c,h=i>a?i>s?i:s:a>s?a:s,p=o>l?o>c?o:c:l>c?l:c;let m=n.next;for(;m!==t;){if(m.x>=u&&m.x<=h&&m.y>=d&&m.y<=p&&qo(i,o,a,l,s,c,m.x,m.y)&&Go(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Oo(e,t,r,n){const i=e.prev,a=e,s=e.next;if(Go(i,a,s)>=0)return!1;const o=i.x,l=a.x,c=s.x,u=i.y,d=a.y,h=s.y,p=o<l?o<c?o:c:l<c?l:c,m=u<d?u<h?u:h:d<h?d:h,f=o>l?o>c?o:c:l>c?l:c,g=u>d?u>h?u:h:d>h?d:h,_=Uo(p,m,t,r,n),y=Uo(f,g,t,r,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=_&&x&&x.z<=y;){if(v.x>=p&&v.x<=f&&v.y>=m&&v.y<=g&&v!==i&&v!==s&&qo(o,u,l,d,c,h,v.x,v.y)&&Go(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==i&&x!==s&&qo(o,u,l,d,c,h,x.x,x.y)&&Go(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=_;){if(v.x>=p&&v.x<=f&&v.y>=m&&v.y<=g&&v!==i&&v!==s&&qo(o,u,l,d,c,h,v.x,v.y)&&Go(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==i&&x!==s&&qo(o,u,l,d,c,h,x.x,x.y)&&Go(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Ro(e,t){let r=e;do{const n=r.prev,i=r.next.next;!Wo(n,i)&&Xo(n,r,r.next,i)&&Yo(n,i)&&Yo(i,n)&&(t.push(n.i,r.i,i.i),tl(r),tl(r.next),r=e=i),r=r.next}while(r!==e);return Lo(r)}function Fo(e,t,r,n,i,a){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Zo(s,e)){let o=Qo(s,e);return s=Lo(s,s.next),o=Lo(o,o.next),Do(s,t,r,n,i,a,0),void Do(o,t,r,n,i,a,0)}e=e.next}s=s.next}while(s!==e)}function Bo(e,t){return e.x-t.x}function Vo(e,t){const r=function(e,t){let r=t;const n=e.x,i=e.y;let a,s=-1/0;do{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,211 bytes, line 2
2);if(e<=n&&e>s&&(s=e,a=r.x<r.next.x?r:r.next,e===n))return a}r=r.next}while(r!==t);if(!a)return null;const o=a,l=a.x,c=a.y;let u=1/0;r=a;do{if(n>=r.x&&r.x>=l&&n!==r.x&&qo(i<c?n:s,i,l,c,i<c?s:n,i,r.x,r.y)){const t=Math.abs(i-r.y)/(n-r.x);Yo(r,e)&&(t<u||t===u&&(r.x>a.x||r.x===a.x&&$o(a,r)))&&(a=r,u=t)}r=r.next}while(r!==o);return a}(e,t);if(!r)return t;const n=Qo(r,e);return Lo(n,n.next),Lo(r,r.next)}function $o(e,t){return Go(e.prev,e,t.prev)<0&&Go(t.next,e,e.next)<0}function Uo(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 Ho(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 qo(e,t,r,n,i,a,s,o){return(i-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(n-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(i-s)*(n-o)}function Zo(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&&Xo(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Yo(e,t)&&Yo(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>
vendor: 32,354 bytes, line 2
2a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(Go(e.prev,e,t.prev)||Go(e,t.prev,t))||Wo(e,t)&&Go(e.prev,e,e.next)>0&&Go(t.prev,t,t.next)>0)}function Go(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Wo(e,t){return e.x===t.x&&e.y===t.y}function Xo(e,t,r,n){const i=Ko(Go(e,t,r)),a=Ko(Go(e,t,n)),s=Ko(Go(r,n,e)),o=Ko(Go(r,n,t));return i!==a&&s!==o||!(0!==i||!Jo(e,r,t))||!(0!==a||!Jo(e,n,t))||!(0!==s||!Jo(r,e,n))||!(0!==o||!Jo(r,t,n))}function Jo(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 Ko(e){return e>0?1:e<0?-1:0}function Yo(e,t){return Go(e.prev,e,e.next)<0?Go(e,t,e.next)>=0&&Go(e,e.prev,t)>=0:Go(e,t,e.prev)<0||Go(e,e.next,t)<0}function Qo(e,t){const r=rl(e.i,e.x,e.y),n=rl(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function el(e,t,r,n){const i=rl(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 tl(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 rl(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function nl(e,t,r){const n=r.patternDependencies;let i=!1;for(const a of t){const t=a.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);const r=t.constantOr(null);r&&(i=!0,n[r.to]=!0,n[r.from]=!0)}return i}function il(e,t,r,n,i){const a=i.patternDependencies;for(const s of t){const t=s.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n-1},r,{},i.availableImages),o=t.evaluate({zoom:n},r,{},i.availableImages),l=t.evaluate({zoom:n+1},r,{},i.availableImages);e=e&&e.name?e.name:e,o=o&&o.name?o.name:o,l=l&&l.name?l.name:l,a[e]=!0,a[o]=!0,a[l]=!0,r.patterns[s.id]={min:e,mid:o,max:l}}}return r}class al{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ga,this.indexArray=new ns,this.indexArray2=new is,this.programConfigurations=new As(e.layers,e.zoom),this.segments=new os,this.segments2=new os,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=nl("fill",this.layers,t);const n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(const{feature:s,id:o,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Bs(s,e);if(!this.layers[0]._featureFilter.filter(new $i(this.zoom),u,r))continue;const d=i?n.evaluate(u,{},r,t.availableImages):void 0,h={id:o,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Fs(s),patterns:{},sortKey:d};a.push(h)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(const s of a){const{geometry:n,index:i,sourceLayerIndex:a}=s;if(this.hasPattern){const e=il("fill",this.layers,s,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(s,n,i,r,{});t.featureIndex.insert(e[i].feature,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Mo),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,n,i){for(const a of yr(t,500)){let e=0;for(const o of a)e+=o.length;const t=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),r=t.vertexLength,n=[],i=[];for(const o of a){if(0===o.length)continue;o!==a[0]&&i.push(n.length/2);const e=this.segments2.prepareSegment(o.length,this.layoutVertexArray,this.indexArray2),t=e.vertexLength;this.layoutVertexArray.emplaceBack(o[0].x,o[0].y),this.indexArray2.emplaceBack(t+o.length-1,t),n.push(o[0].x),n.push(o[0].y);for(let r=1;r<o.length;r++)this.layoutVertexArray.emplaceBack(o[r].x,o[r].y),this.indexArray2.emplaceBack(t+r-1,t+r),n.push(o[r].x),n.push(o[r].y);e.vertexLength+=o.length,e.primitiveLength+=o.length}const s=No(n,i);for(let a=0;a<s.length;a+=3)this.indexArray.emplaceBack(r+s[a],r+s[a+1],r+s[a+2]);t.vertexLength+=e,t.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}}let sl,ol;bi("FillBucket",al,{omit:["layers","patternFeatures"]});var ll={get paint(){return ol=ol||new ra({"fill-antialias":new Ki(Z.paint_fill["fill-antialias"]),"fill-opacity":new Yi(Z.paint_fill["fill-opacity"]),"fill-color":new Yi(Z.paint_fill["fill-color"]),"fill-outline-color":new Yi(Z.paint_fill["fill-outline-color"]),"fill-translate":new Ki(Z.paint_fill["fill-translate"]),"fill-translate-anchor":new Ki(Z.paint_fill["fill-translate-anchor"]),"fill-pattern":new Qi(Z.paint_fill["fill-pattern"])})},get layout(){return sl=sl||new ra({"fill-sort-key":new Yi(Z.layout_fill["fill-sort-key"])})}};class cl extends ia{constructor(e){super(e,ll)}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 al(e)}queryRadius(){return to(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,n,i,a,s){return qs(ro(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,s),n)}isTileClipped(){return!0}}const ul=la([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),dl=la([{name:"a_centroid",components:2,type:"Int16"}],4),{members:hl}=ul;var pl={},ml=n,fl=gl;function gl(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(_l,this,t)}function _l(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function yl(e){for(var t,r,n=0,i=0,a=e.length,s=a-1;i<a;s=i++)n+=((r=e[s]).x-(t=e[i]).x)*(t.y+r.y);return n}gl.types=["Unknown","Point","LineString","Polygon"],gl.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,s=0,o=[];e.pos<r;){if(i<=0){var l=e.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)a+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&o.push(t),t=[]),t.push(new ml(a,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&o.push(t),o},gl.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,s=1/0,o=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<s&&(s=i),i>o&&(o=i),(a+=e.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,o,c]},gl.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),s=this.extent*e,o=this.extent*t,l=this.loadGeometry(),c=gl.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+s)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+o)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var d=[];for(n=0;n<l.length;n++)d[n]=l[n][0];u(l=d);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var s=yl(e[a]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(r&&i.push(r),r=[e[a]]):r.push(e[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var h={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(h.id=this.id),h};var vl=fl,xl=bl;function bl(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(wl,this,t),this.length=this._features.length}function wl(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){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}bl.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new vl(this._pbf,t,this.extent,this._keys,this._values)};var Cl=xl;function Sl(e,t,r){if(3===e){var n=new Cl(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}pl.VectorTile=function(e,t){this.layers=e.readFields(Sl,{},t)},pl.VectorTileFeature=fl,pl.VectorTileLayer=xl;const kl=pl.VectorTileFeature.types,jl=Math.pow(2,13);function El(e,t,r,n,i,a,s,o){e.emplaceBack(t,r,2*Math.floor(n*jl)+s,i*jl*2,a*jl*2,Math.round(o))}class Tl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Wa,this.centroidVertexArray=new qa,this.indexArray=new ns,this.programConfigurations=new As(e.layers,e.zoom),this.segments=new os,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasPattern=nl("fill-extrusion",this.layers,t);for(const{feature:n,id:i,index:a,sourceLayerIndex:s}of e){const e=this.layers[0]._featureFilter.needGeometry,o=Bs(n,e);if(!this.layers[0]._featureFilter.filter(new $i(this.zoom),o,r))continue;const l={id:i,sourceLayerIndex:s,index:a,geometry:e?o.geometry:Fs(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(il("fill-extrusion",this.layers,l,this.zoom,t)):this.addFeature(l,l.geometry,a,r,{}),t.featureIndex.insert(n,l.geometry,a,s,this.index,!0)}}addFeatures(e,t,r){for(const n of this.features){const{geometry:e}=n;this.addFeature(n,e,n.index,t,r)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hl),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,dl.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,n,i){for(const a of yr(t,500)){const t={x:0,y:0,vertexCount:0};let r=0;for(const e of a)r+=e.length;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const e of a){if(0===e.length)continue;if(Il(e))continue;let r=0;for(let i=0;i<e.length;i++){const a=e[i];if(i>=1){const s=e[i-1];if(!Pl(a,s)){n.vertexLength+4>os.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const e=a.sub(s)._perp()._unit(),i=s.dist(a);r+i>32768&&(r=0),El(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,0,r),El(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,1,r),t.x+=2*a.x,t.y+=2*a.y,t.vertexCount+=2,r+=i,El(this.layoutVertexArray,s.x,s.y,e.x,e.y,0,0,r),El(this.layoutVertexArray,s.x,s.y,e.x,e.y,0,1,r),t.x+=2*s.x,t.y+=2*s.y,t.vertexCount+=2;const o=n.vertexLength;this.indexArray.emplaceBack(o,o+2,o+1),this.indexArray.emplaceBack(o+1,o+2,o+3),n.vertexLength+=4,n.primitiveLength+=2}}}}if(n.vertexLength+r>os.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(r,this.layoutVertexArray,this.indexArray)),"Polygon"!==kl[e.type])continue;const i=[],s=[],o=n.vertexLength;for(const e of a)if(0!==e.length){e!==a[0]&&s.push(i.length/2);for(let r=0;r<e.length;r++){const n=e[r];El(this.layoutVertexArray,n.x,n.y,0,0,1,1,0),t.x+=n.x,t.y+=n.y,t.vertexCount+=1,i.push(n.x),i.push(n.y)}}const l=No(i,s);for(let e=0;e<l.length;e+=3)this.indexArray.emplaceBack(o+l[e],o+l[e+2],o+l[e+1]);n.primitiveLength+=l.length/3,n.vertexLength+=r;for(let e=0;e<t.vertexCount;e++){const e=Math.floor(t.x/t.vertexCount),r=Math.floor(t.y/t.vertexCount);this.centroidVertexArray.emplaceBack(e,r)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}}function Pl(e,t){return e.x===t.x&&(e.x<0||e.x>zs)||e.y===t.y&&(e.y<0||e.y>zs)}function Il(e){return e.every((e=>e.x<0))||e.every((e=>e.x>zs))||e.every((e=>e.y<0))||e.every((e=>e.y>zs))}let Ml;bi("FillExtrusionBucket",Tl,{omit:["layers","features"]});var Nl={get paint(){return Ml=Ml||new ra({"fill-extrusion-opacity":new Ki(Z["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Yi(Z["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ki(Z["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ki(Z["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qi(Z["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Yi(Z["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Yi(Z["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ki(Z["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Al extends ia{constructor(e){super(e,Nl)}createBucket(e){return new Tl(e)}queryRadius(){return to(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,r,n,i,s,o,l){const c=ro(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,o),u=this.paint.get("fill-extrusion-height").evaluate(t,r),d=this.paint.get("fill-extrusion-base").evaluate(t,r),h=function(e,t){const r=[];for(const n of e){const e=[n.x,n.y,0,1];po(e,e,t),r.push(new a(e[0]/e[3],e[1]/e[3]))}return r}(c,l),p=function(e,t,r,n){const i=[],s=[],o=n[8]*t,l=n[9]*t,c=n[10]*t,u=n[11]*t,d=n[8]*r,h=n[9]*r,p=n[10]*r,m=n[11]*r;for(const f of e){const e=[],t=[];for(const r of f){const i=r.x,s=r.y,f=n[0]*i+n[4]*s+n[12],g=n[1]*i+n[5]*s+n[13],_=n[2]*i+n[6]*s+n[14],y=n[3]*i+n[7]*s+n[15],v=_+c,x=y+u,b=f+d,w=g+h,C=_+p,S=y+m,k=new a((f+o)/x,(g+l)/x);k.z=v/x,e.push(k);const j=new a(b/S,w/S);j.z=C/S,t.push(j)}i.push(e),s.push(t)}return[i,s]}(n,d,u,l);return function(e,t,r){let n=1/0;qs(r,t)&&(n=Dl(r,t[0]));for(let i=0;i<t.length;i++){const a=t[i],s=e[i];for(let e=0;e<a.length-1;e++){const t=a[e],i=[t,a[e+1],s[e+1],s[e],t];Us(r,i)&&(n=Math.min(n,Dl(r,i)))}}return n!==1/0&&n}(p[0],p[1],h)}}function Ll(e,t){return e.x*t.x+e.y*t.y}function Dl(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 a=t[r],s=e[0],o=i.sub(n),l=a.sub(n),c=s.sub(n),u=Ll(o,o),d=Ll(o,l),h=Ll(l,l),p=Ll(c,o),m=Ll(c,l),f=u*h-d*d,g=(h*p-d*m)/f,_=(u*m-d*p)/f,y=n.z*(1-g-_)+i.z*g+a.z*_;if(isFinite(y))return y}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}const zl=la([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Ol}=zl,Rl=la([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Fl}=Rl,Bl=pl.VectorTileFeature.types,Vl=Math.cos(Math.PI/180*37.5),$l=Math.pow(2,14)/.5;class Ul{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Xa,this.layoutVertexArray2=new Ja,this.indexArray=new ns,this.programConfigurations=new As(e.layers,e.zoom),this.segments=new os,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=nl("line",this.layers,t);const n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(const{feature:s,id:o,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,t=Bs(s,e);if(!this.layers[0]._featureFilter.filter(new $i(this.zoom),t,r))continue;const u=i?n.evaluate(t,{},r):void 0,d={id:o,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?t.geometry:Fs(s),patterns:{},sortKey:u};a.push(d)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(const s of a){const{geometry:n,index:i,sourceLayerIndex:a}=s;if(this.hasPattern){const e=il("line",this.layers,s,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(s,n,i,r,{});t.featureIndex.insert(e[i].feature,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r)}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,Fl)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ol),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,n,i){const a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),o=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const u of t)this.addLine(u,e,s,o,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}addLine(e,t,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const s="Polygon"===Bl[t.type];let o=e.length;for(;o>=2&&e[o-1].equals(e[o-2]);)o--;let l=0;for(;l<o-1&&e[l].equals(e[l+1]);)l++;if(o<(s?3:2))return;"bevel"===r&&(i=1.05);const c=this.overscaling<=16?15*zs/(512*this.overscaling):0,u=this.segments.prepareSegment(10*o,this.layoutVertexArray,this.indexArray);let d,h,p,m,f;this.e1=this.e2=-1,s&&(d=e[o-2],f=e[l].sub(d)._unit()._perp());for(let g=l;g<o;g++){if(p=g===o-1?s?e[l+1]:void 0:e[g+1],p&&e[g].equals(p))continue;f&&(m=f),d&&(h=d),d=e[g],f=p?p.sub(d)._unit()._perp():m,m=m||f;let t=m.add(f);0===t.x&&0===t.y||t._unit();const _=m.x*f.x+m.y*f.y,y=t.x*f.x+t.y*f.y,v=0!==y?1/y:1/0,x=2*Math.sqrt(2-2*y),b=y<Vl&&h&&p,w=m.x*f.y-m.y*f.x>0;if(b&&g>l){const e=d.dist(h);if(e>2*c){const t=d.sub(d.sub(h)._mult(c/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,m,0,0,u),h=t}}const C=h&&p;let S=C?r:s?"butt":n;if(C&&"round"===S&&(v<a?S="miter":v<=2&&(S="fakeround")),"miter"===S&&v>i&&(S="bevel"),"bevel"===S&&(v>2&&(S="flipbevel"),v<i&&(S="miter")),h&&this.updateDistance(h,d),"miter"===S)t._mult(v),this.addCurrentVertex(d,t,0,0,u);else if("flipbevel"===S){if(v>100)t=f.mult(-1);else{const e=v*m.add(f).mag()/m.sub(f).mag();t._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(d,t,0,0,u),this.addCurrentVertex(d,t.mult(-1),0,0,u)}else if("bevel"===S||"fakeround"===S){const e=-Math.sqrt(v*v-1),t=w?e:0,r=w?0:e;if(h&&this.addCurrentVertex(d,m,t,r,u),"fakeround"===S){const e=Math.round(180*x/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*e*e+(.848013+_*(.215638*_-1.06021)))}const n=f.sub(m)._mult(r)._add(m)._unit()._mult(w?-1:1);this.addHalfVertex(d,n.x,n.y,!1,w,0,u)}}p&&this.addCurrentVertex(d,f,-t,-r,u)}else if("butt"===S)this.addCurrentVertex(d,t,0,0,u);else if("square"===S){const e=h?1:-1;this.addCurrentVertex(d,t,e,e,u)}else"round"===S&&(h&&(this.addCurrentVertex(d,m,0,0,u),this.addCurrentVertex(d,m,1,1,u,!0)),p&&(this.addCurrentVertex(d,f,-1,-1,u,!0),this.addCurrentVertex(d,f,0,0,u)));if(b&&g<o-1){const e=d.dist(p);if(e>2*c){const t=d.add(p.sub(d)._mult(c/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,f,0,0,u),d=t}}}}addCurrentVertex(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const s=t.y*n-t.x,o=-t.y-t.x*n;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,a,!1,r,i),this.addHalfVertex(e,s,o,a,!0,-n,i),this.distance>$l/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,n,i,a))}addHalfVertex(e,t,r,n,i,a,s){let{x:o,y:l}=e;const c=.5*(this.lineClips?this.scaledDistance*($l-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((o<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const u=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),s.primitiveLength++),i?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}let Hl,ql;bi("LineBucket",Ul,{omit:["layers","patternFeatures"]});var Zl={get paint(){return ql=ql||new ra({"line-opacity":new Yi(Z.paint_line["line-opacity"]),"line-color":new Yi(Z.paint_line["line-color"]),"line-translate":new Ki(Z.paint_line["line-translate"]),"line-translate-anchor":new Ki(Z.paint_line["line-translate-anchor"]),"line-width":new Yi(Z.paint_line["line-width"]),"line-gap-width":new Yi(Z.paint_line["line-gap-width"]),"line-offset":new Yi(Z.paint_line["line-offset"]),"line-blur":new Yi(Z.paint_line["line-blur"]),"line-dasharray":new ea(Z.paint_line["line-dasharray"]),"line-pattern":new Qi(Z.paint_line["line-pattern"]),"line-gradient":new ta(Z.paint_line["line-gradient"])})},get layout(){return Hl=Hl||new ra({"line-cap":new Ki(Z.layout_line["line-cap"]),"line-join":new Yi(Z.layout_line["line-join"]),"line-miter-limit":new Ki(Z.layout_line["line-miter-limit"]),"line-round-limit":new Ki(Z.layout_line["line-round-limit"]),"line-sort-key":new Yi(Z.layout_line["line-sort-key"])})}};class Gl extends Yi{possiblyEvaluate(e,t){return t=new $i(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=_({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}let Wl;class Xl extends ia{constructor(e){super(e,Zl),this.gradientVersion=0,Wl||(Wl=new Gl(Zl.paint.properties["line-width"].specification),Wl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this.gradientExpression();this.stepInterpolant=!!function(e){return void 0!==e._styleExpression}(e)&&e._styleExpression.expression instanceof Ct,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Wl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Ul(e)}queryRadius(e){const t=e,r=Jl(eo("line-width",this,t),eo("line-gap-width",this,t)),n=eo("line-offset",this,t);return r/2+Math.abs(n)+to(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,n,i,s,o){const l=ro(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,o),c=o/2*Jl(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=function(e,t){const r=[];for(let n=0;n<e.length;n++){const i=e[n],s=[];for(let e=0;e<i.length;e++){const r=i[e-1],n=i[e],o=i[e+1],l=0===e?new a(0,0):n.sub(r)._unit()._perp(),c=e===i.length-1?new a(0,0):o.sub(n)._unit()._perp(),u=l._add(c)._unit(),d=u.x*c.x+u.y*c.y;0!==d&&u._mult(1/d),s.push(u._mult(t)._add(n))}r.push(s)}return r}(n,u*o)),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(Ys(e,i[t]))return!0;if(Zs(e,i,r))return!0}return!1}(l,n,c)}isTileClipped(){return!0}}function Jl(e,t){return t>0?t+2*e:e}const Kl=la([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Yl=la([{name:"a_projected_pos",components:3,type:"Float32"}],4);la([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ql=la([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);la([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const ec=la([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),tc=la([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function rc(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()),Vi.applyArabicShaping&&(e=Vi.applyArabicShaping(e)),e}(e.text,t,r)})),e}la([{name:"triangle",components:3,type:"Uint16"}]),la([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),la([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),la([{type:"Float32",name:"offsetX"}]),la([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),la([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const nc={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var ic=24,ac=lc,sc=function(e,t,r,n,i){var a,s,o=8*i-n-1,l=(1<<o)-1,c=l>>1,u=-7,d=r?i-1:0,h=r?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-u)-1,p>>=-u,u+=o;u>0;a=256*a+e[t+d],d+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=c}return(p?-1:1)*s*Math.pow(2,a-n)},oc=function(e,t,r,n,i,a){var s,o,l,c=8*a-i-1,u=(1<<c)-1,d=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,m=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=u?(o=0,s=u):s+d>=1?(o=(t*l-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&o,p+=m,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;e[r+p]=255&s,p+=m,s/=256,c-=8);e[r+p-m]|=128*f};function lc(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}lc.Varint=0,lc.Fixed64=1,lc.Bytes=2,lc.Fixed32=5;var cc=4294967296,uc=1/cc,dc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function hc(e){return e.type===lc.Bytes?e.readVarint()+e.pos:e.pos+1}function pc(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function mc(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function fc(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function gc(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function _c(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function yc(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function vc(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function xc(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function bc(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function wc(e,t){for(var r=0;r<e.length;
vendor: 4,117 bytes, line 2
2r++)t.writeFixed64(e[r])}function Cc(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Sc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function kc(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function jc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}lc.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Sc(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=jc(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Sc(this.buf,this.pos)+Sc(this.buf,this.pos+4)*cc;return this.pos+=8,e},readSFixed64:function(){var e=Sc(this.buf,this.pos)+jc(this.buf,this.pos+4)*cc;return this.pos+=8,e},readFloat:function(){var e=sc(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=sc(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return pc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return pc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return pc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return pc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return pc(e,n,t);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return pc(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&dc?function(e,t,r){return dc.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var n="",i=t;i<r;){var a,s,o,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(s=e[i+2],128==(192&(a=e[i+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&a)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=e[i+2],o=e[i+3],128==(192&(a=e[i+1]))&&128==(192&s)&&128==(192&o)&&((c=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==lc.Bytes)return e.push(this.readVarint(t));var r=hc(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==lc.Bytes)return e.push(this.readSVarint());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==lc.Bytes)return e.push(this.readBoolean());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==lc.Bytes)return e.push(this.readFloat());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==lc.Bytes)return e.push(this.readDouble());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==lc.Bytes)return e.push(this.readFixed32());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==lc.Bytes)return e.push(this.readSFixed32());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==lc.Bytes)return e.push(this.readFixed64());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e}
vendor: 4,327 bytes, line 2
2,readPackedSFixed64:function(e){if(this.type!==lc.Bytes)return e.push(this.readSFixed64());var t=hc(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===lc.Varint)for(;this.buf[this.pos++]>127;);else if(t===lc.Bytes)this.pos=this.readVarint()+this.pos;else if(t===lc.Fixed32)this.pos+=4;else{if(t!==lc.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),kc(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),kc(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),kc(this.buf,-1&e,this.pos),kc(this.buf,Math.floor(e*uc),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),kc(this.buf,-1&e,this.pos),kc(this.buf,Math.floor(e*uc),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?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){var 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:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+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);var r=this.pos-t;r>=128&&mc(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),oc(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),oc(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&mc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,lc.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,fc,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,gc,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,vc,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,_c,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,yc,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,xc,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,bc,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,wc,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Cc,t)},writeBytesField:function(e,t){this.writeTag(e,lc.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,lc.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,lc.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,lc.Fixed64),this.writeFixed64
vendor: 175,130 bytes, line 2
2(t)},writeSFixed64Field:function(e,t){this.writeTag(e,lc.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,lc.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,lc.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,lc.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,lc.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,lc.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Ec=r(ac);const Tc=3;function Pc(e,t,r){1===e&&r.readMessage(Ic,t)}function Ic(e,t,r){if(3===e){const{id:e,bitmap:n,width:i,height:a,left:s,top:o,advance:l}=r.readMessage(Mc,{});t.push({id:e,bitmap:new wo({width:i+2*Tc,height:a+2*Tc},n),metrics:{width:i,height:a,left:s,top:o,advance:l}})}}function Mc(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 Nc=Tc;function Ac(e){let t=0,r=0;for(const s of e)t+=s.w*s.h,r=Math.max(r,s.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,a=0;for(const s of e)for(let e=n.length-1;e>=0;e--){const t=n[e];if(!(s.w>t.w||s.h>t.h)){if(s.x=t.x,s.y=t.y,a=Math.max(a,s.y+s.h),i=Math.max(i,s.x+s.w),s.w===t.w&&s.h===t.h){const t=n.pop();e<n.length&&(n[e]=t)}else s.h===t.h?(t.x+=s.w,t.w-=s.w):s.w===t.w?(t.y+=s.h,t.h-=s.h):(n.push({x:t.x+s.w,y:t.y,w:t.w-s.w,h:s.h}),t.y+=s.h,t.h-=s.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}const Lc=1;class Dc{constructor(e,t){let{pixelRatio:r,version:n,stretchX:i,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}=t;this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=s,this.version=n,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+Lc,this.paddedRect.y+Lc]}get br(){return[this.paddedRect.x+this.paddedRect.w-Lc,this.paddedRect.y+this.paddedRect.h-Lc]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Lc)/this.pixelRatio,(this.paddedRect.h-2*Lc)/this.pixelRatio]}}class zc{constructor(e,t){const r={},n={};this.haveRenderCallbacks=[];const i=[];this.addImages(e,r,i),this.addImages(t,n,i);const{w:a,h:s}=Ac(i),o=new Co({width:a||1,height:s||1});for(const l in e){const t=e[l],n=r[l].paddedRect;Co.copy(t.data,o,{x:0,y:0},{x:n.x+Lc,y:n.y+Lc},t.data)}for(const l in t){const e=t[l],r=n[l].paddedRect,i=r.x+Lc,a=r.y+Lc,s=e.data.width,c=e.data.height;Co.copy(e.data,o,{x:0,y:0},{x:i,y:a},e.data),Co.copy(e.data,o,{x:0,y:c-1},{x:i,y:a-1},{width:s,height:1}),Co.copy(e.data,o,{x:0,y:0},{x:i,y:a+c},{width:s,height:1}),Co.copy(e.data,o,{x:s-1,y:0},{x:i-1,y:a},{width:1,height:c}),Co.copy(e.data,o,{x:0,y:0},{x:i+s,y:a},{width:1,height:c})}this.image=o,this.iconPositions=r,this.patternPositions=n}addImages(e,t,r){for(const n in e){const i=e[n],a={x:0,y:0,w:i.data.width+2*Lc,h:i.data.height+2*Lc};r.push(a),t[n]=new Dc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[n,i]=e.tl;r.update(t.data,void 0,{x:n,y:i})}}var Oc;bi("ImagePosition",Dc),bi("ImageAtlas",zc),e.ah=void 0,(Oc=e.ah||(e.ah={}))[Oc.none=0]="none",Oc[Oc.horizontal=1]="horizontal",Oc[Oc.vertical=2]="vertical",Oc[Oc.horizontalOnly=3]="horizontalOnly";const Rc=-17;class Fc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const r=new Fc;return r.scale=e||1,r.fontStack=t,r}static forImage(e){const t=new Fc;return t.imageName=e,t}}class Bc{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const r=new Bc;for(let n=0;n<e.sections.length;n++){const i=e.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r+1)||null,i=e.charCodeAt(r-1)||null;t+=n&&zi(n)&&!nc[e[r+1]]||i&&zi(i)&&!nc[e[r-1]]||!nc[e[r]]?e[r]:nc[e[r]]}return t}(this.text)}trim(){let e=0;for(let r=0;r<this.text.length&&$c[this.text.charCodeAt(r)];r++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&$c[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 Bc;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(Fc.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let n=0;n<e.text.length;++n)this.sectionIndex.push(r)}addImageSection(e){const t=e.image?e.image.name:"";if(0===t.length)return void C("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Fc.forImage(t)),this.sectionIndex.push(this.sections.length-1)):C("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Vc(t,r,n,i,a,s,o,l,c,u,d,h,p,m,f){const g=Bc.fromFeature(t,a);let _;h===e.ah.vertical&&g.verticalizePunctuation();const{processBidirectionalText:y,processStyledBidirectionalText:v}=Vi;if(y&&1===g.sections.length){_=[];const e=y(g.toString(),Jc(g,u,s,r,i,m));for(const t of e){const e=new Bc;e.text=t,e.sections=g.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);_.push(e)}}else if(v){_=[];const e=v(g.text,g.sectionIndex,Jc(g,u,s,r,i,m));for(const t of e){const e=new Bc;e.text=t[0],e.sectionIndex=t[1],e.sections=g.sections,_.push(e)}}else _=function(e,t){const r=[],n=e.text;let i=0;for(const a of t)r.push(e.substring(i,a)),i=a;return i<n.length&&r.push(e.substring(i,n.length)),r}(g,Jc(g,u,s,r,i,m));const x=[],b={positionedLines:x,text:g.toString(),top:d[1],bottom:d[1],left:d[0],right:d[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,r,n,i,a,s,o,l,c,u,d,h){let p=0,m=Rc,f=0,g=0;const _="right"===l?1:"left"===l?0:.5;let y=0;for(const C of a){C.trim();const a=C.getMaxScale(),o=(a-1)*ic,l={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=l;const x=l.positionedGlyphs;let b=0;if(!C.length()){m+=s,++y;continue}for(let s=0;s<C.length();s++){const l=C.getSection(s),f=C.getSectionIndex(s),g=C.getCharCode(s);let _=0,y=null,w=null,S=null,k=ic;const j=!(c===e.ah.horizontal||!d&&!Di(g)||d&&($c[g]||(v=g,/\p{sc=Arab}/u.test(String.fromCodePoint(v)))));if(l.imageName){const e=i[l.imageName];if(!e)continue;S=l.imageName,t.iconsInText=t.iconsInText||!0,w=e.paddedRect;const r=e.displaySize;l.scale=l.scale*ic/h,y={width:r[0],height:r[1],left:Lc,top:-Nc,advance:j?r[1]:r[0]},_=o+(ic-r[1]*l.scale),k=y.advance;const n=j?r[0]*l.scale-ic*a:r[1]*l.scale-ic*a;n>0&&n>b&&(b=n)}else{const e=n[l.fontStack],t=e&&e[g];if(t&&t.rect)w=t.rect,y=t.metrics;else{const e=r[l.fontStack],t=e&&e[g];if(!t)continue;y=t.metrics}_=(a-l.scale)*ic}j?(t.verticalizable=!0,x.push({glyph:g,imageName:S,x:p,y:m+_,vertical:j,scale:l.scale,fontStack:l.fontStack,sectionIndex:f,metrics:y,rect:w}),p+=k*l.scale+u):(x.push({glyph:g,imageName:S,x:p,y:m+_,vertical:j,scale:l.scale,fontStack:l.fontStack,sectionIndex:f,metrics:y,rect:w}),p+=y.advance*l.scale+u)}0!==x.length&&(f=Math.max(p-u,f),Yc(x,0,x.length-1,_,b)),p=0;const w=s*a+b;l.lineOffset=Math.max(b,o),m+=w,g=Math.max(w,g),++y}var v;const x=m-Rc,{horizontalAlign:b,verticalAlign:w}=Kc(o);(function(e,t,r,n,i,a,s,o,l){const c=(t-r)*i;let u=0;u=a!==s?-o*n-Rc:(-n*l+.5)*s;for(const d of e)for(const e of d.positionedGlyphs)e.x+=c,e.y+=u})(t.positionedLines,_,b,w,f,g,s,x,a.length),t.top+=-w*x,t.bottom=t.top+x,t.left+=-b*f,t.right=t.left+f}(b,r,n,i,_,o,l,c,h,u,p,f),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(x)&&b}const $c={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Uc={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Hc={40:!0};function qc(e,t,r,n,i,a){if(t.imageName){const e=n[t.imageName];return e?e.displaySize[0]*t.scale*ic/a+i:0}{const n=r[t.fontStack],a=n&&n[e];return a?a.metrics.advance*t.scale+i:0}}function Zc(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 Gc(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 Wc(e,t,r,n,i,a){let s=null,o=Zc(t,r,i,a);for(const l of n){const e=Zc(t-l.x,r,i,a)+l.badness;e<=o&&(s=l,o=e)}return{index:e,x:t,priorBreak:s,badness:o}}function Xc(e){return e?Xc(e.priorBreak).concat(e.index):[]}function Jc(e,t,r,n,i,a){if(!e)return[];const s=[],o=function(e,t,r,n,i,a){let s=0;for(let o=0;o<e.length();o++){const r=e.getSection(o);s+=qc(e.getCharCode(o),r,n,i,t,a)}return s/Math.max(1,Math.ceil(s/r))}(e,t,r,n,i,a),l=e.text.indexOf("\u200b")>=0;let c=0;for(let d=0;d<e.length();d++){const r=e.getSection(d),h=e.getCharCode(d);if($c[h]||(c+=qc(h,r,n,i,t,a)),d<e.length()-1){const t=!((u=h)<11904)&&(!!Ti["CJK Compatibility Forms"](u)||!!Ti["CJK Compatibility"](u)||!!Ti["CJK Strokes"](u)||!!Ti["CJK Symbols and Punctuation"](u)||!!Ti["Enclosed CJK Letters and Months"](u)||!!Ti["Halfwidth and Fullwidth Forms"](u)||!!Ti["Ideographic Description Characters"](u)||!!Ti["Vertical Forms"](u)||Li.test(String.fromCodePoint(u)));(Uc[h]||t||r.imageName||d!==e.length()-2&&Hc[e.getCharCode(d+1)])&&s.push(Wc(d+1,c,o,s,Gc(h,e.getCharCode(d+1),t&&l),!1))}}var u;return Xc(Wc(e.length(),c,o,s,0,!0))}function Kc(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 Yc(e,t,r,n,i){if(!n&&!i)return;const a=e[r],s=(e[r].x+a.metrics.advance*a.scale)*n;for(let o=t;o<=r;o++)e[o].x-=s,e[o].y+=i}function Qc(e,t,r){const{horizontalAlign:n,verticalAlign:i}=Kc(r),a=t[0]-e.displaySize[0]*n,s=t[1]-e.displaySize[1]*i;return{image:e,top:s,bottom:s+e.displaySize[1],left:a,right:a+e.displaySize[0]}}function eu(e){var t,r;let n=e.left,i=e.top,a=e.right-n,s=e.bottom-i;const o=null!==(t=e.image.textFitWidth)&&void 0!==t?t:"stretchOrShrink",l=null!==(r=e.image.textFitHeight)&&void 0!==r?r:"stretchOrShrink",c=(e.image.content[2]-e.image.content[0])/(e.image.content[3]-e.image.content[1]);if("proportional"===l){if("stretchOnly"===o&&a/s<c||"proportional"===o){const e=Math.ceil(s*c);n*=e/a,a=e}}else if("proportional"===o&&"stretchOnly"===l&&0!==c&&a/s>c){const e=Math.ceil(a/c);i*=e/s,s=e}return{x1:n,y1:i,x2:n+a,y2:i+s}}function tu(e,t,r,n,i,a){const s=e.image;let o;if(s.content){const e=s.content,t=s.pixelRatio||1;o=[e[0]/t,e[1]/t,s.displaySize[0]-e[2]/t,s.displaySize[1]-e[3]/t]}const l=t.left*a,c=t.right*a;let u,d,h,p;"width"===r||"both"===r?(p=i[0]+l-n[3],d=i[0]+c+n[1]):(p=i[0]+(l+c-s.displaySize[0])/2,d=p+s.displaySize[0]);const m=t.top*a,f=t.bottom*a;return"height"===r||"both"===r?(u=i[1]+m-n[0],h=i[1]+f+n[2]):(u=i[1]+(m+f-s.displaySize[1])/2,h=u+s.displaySize[1]),{image:s,top:u,right:d,bottom:h,left:p,collisionPadding:o}}const ru=255,nu=128,iu=ru*nu;function au(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new $i(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:n}=r;let i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let a=i;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);const s=t[i],o=t[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:o,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:o,minSize:r.evaluate(new $i(s)),maxSize:r.evaluate(new $i(o)),interpolationType:n}}}function su(e,t,r){let n="never";const i=e.get(t);return i?n=i:e.get(r)&&(n="always"),n}const ou=pl.VectorTileFeature.types,lu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function cu(e,t,r,n,i,a,s,o,l,c,u,d,h){const p=o?Math.min(iu,Math.round(o[0])):0,m=o?Math.min(iu,Math.round(o[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),a,s,(p<<1)+(l?1:0),m,16*c,16*u,256*d,256*h)}function uu(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function du(e){for(const t of e.sections)if(Bi(t.text))return!0;return!1}class hu{constructor(e){this.layoutVertexArray=new Ya,this.indexArray=new ns,this.programConfigurations=e,this.segments=new os,this.dynamicLayoutVertexArray=new Qa,this.opacityVertexArray=new es,this.hasVisibleVertices=!1,this.placedSymbolArray=new za}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Kl.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Yl.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,lu,!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())}}bi("SymbolBuffers",hu);class pu{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new os,this.collisionVertexArray=new rs}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Ql.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}bi("CollisionBuffers",pu);class mu{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=lo([]),this.placementViewportMatrix=lo([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=au(this.zoom,r["text-size"]),this.iconSizeData=au(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==su(n,"text-overlap","text-allow-overlap")||"never"!==su(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((t=>e.ah[t]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID}createArrays(){this.text=new hu(new As(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new hu(new As(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new Fa,this.lineVertexArray=new Ba,this.symbolInstances=new Ra,this.textAnchorOffsets=new $a}calculateGlyphDependencies(e,t,r,n,i){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||n)&&i){const r=nc[e.charAt(a)];r&&(t[r.charCodeAt(0)]=!0)}}populate(t,r,n){const i=this.layers[0],a=i.layout,s=a.get("text-font"),o=a.get("text-field"),l=a.get("icon-image"),c=("constant"!==o.value.kind||o.value.value instanceof Je&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==s.value.kind||s.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,d=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const h=r.iconDependencies,p=r.glyphDependencies,m=r.availableImages,f=new $i(this.zoom);for(const{feature:g,id:_,index:y,sourceLayerIndex:v}of t){const t=i._featureFilter.needGeometry,r=Bs(g,t);if(!i._featureFilter.filter(f,r,n))continue;let o,l;if(t||(r.geometry=Fs(g)),c){const e=i.getValueAndResolveTokens("text-field",r,n,m),t=Je.factory(e),a=this.hasRTLText=this.hasRTLText||du(t);(!a||"unavailable"===Vi.getRTLTextPluginStatus()||a&&Vi.isParsed())&&(o=rc(t,i,r))}if(u){const e=i.getValueAndResolveTokens("icon-image",r,n,m);l=e instanceof et?e:et.fromString(e)}if(!o&&!l)continue;const x=this.sortFeaturesByKey?d.evaluate(r,{},n):void 0;if(this.features.push({id:_,text:o,icon:l,index:y,sourceLayerIndex:v,geometry:r.geometry,properties:g.properties,type:ou[g.type],sortKey:x}),l&&(h[l.name]=!0),o){const t=s.evaluate(r,{},n).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const e of o.sections)if(e.image)h[e.image.name]=!0;else{const r=Pi(o.toString()),n=e.fontStack||t,a=p[n]=p[n]||{};this.calculateGlyphDependencies(e.text,a,i,this.allowVerticalPlacement,r)}}}"line"===a.get("symbol-placement")&&(this.features=function(e){const t={},r={},n=[];let i=0;function a(t){n.push(e[t]),i++}function s(e,t,i){const a=r[e];return delete r[e],r[t]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function o(e,r,i){const a=t[r];return delete t[r],t[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}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){a(c);continue}const p=l(h,d),m=l(h,d,!0);if(p in r&&m in t&&r[p]!==t[m]){const e=o(p,m,d),i=s(p,m,n[e].geometry);delete t[p],delete r[m],r[l(h,n[i].geometry,!0)]=i,n[e].geometry=null}else p in r?s(p,m,d):m in t?o(p,m,d):(a(c),t[p]=i-1,r[m]=i-1)}return n.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]);const i={};for(let a=e.segment+1;a<t.length;a++)i[a]={x:t[a].x,y:t[a].y,tileUnitDistanceFromAnchor:r},a<t.length-1&&(r+=t[a+1].dist(t[a]));for(let a=e.segment||0;a>=0;a--)i[a]={x:t[a].x,y:t[a].y,tileUnitDistanceFromAnchor:n},a>0&&(n+=t[a-1].dist(t[a]));for(let e=0;e<t.length;e++){const t=i[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,r,n,i,a,s,o,l,c,u,d,h){const p=t.indexArray,m=t.layoutVertexArray,f=t.segments.prepareSegment(4*r.length,m,p,this.canOverlap?s.sortKey:void 0),g=this.glyphOffsetArray.length,_=f.vertexLength,y=this.allowVerticalPlacement&&o===e.ah.vertical?Math.PI/2:0,v=s.text&&s.text.sections;for(let e=0;e<r.length;e++){const{tl:i,tr:a,bl:o,br:c,tex:u,pixelOffsetTL:d,pixelOffsetBR:g,minFontScaleX:_,minFontScaleY:x,glyphOffset:b,isSDF:w,sectionIndex:C}=r[e],S=f.vertexLength,k=b[1];cu(m,l.x,l.y,i.x,k+i.y,u.x,u.y,n,w,d.x,d.y,_,x),cu(m,l.x,l.y,a.x,k+a.y,u.x+u.w,u.y,n,w,g.x,d.y,_,x),cu(m,l.x,l.y,o.x,k+o.y,u.x,u.y+u.h,n,w,d.x,g.y,_,x),cu(m,l.x,l.y,c.x,k+c.y,u.x+u.w,u.y+u.h,n,w,g.x,g.y,_,x),uu(t.dynamicLayoutVertexArray,l,y),p.emplaceBack(S,S+1,S+2),p.emplaceBack(S+1,S+2,S+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),e!==r.length-1&&C===r[e+1].sectionIndex||t.programConfigurations.populatePaintArrays(m.length,s,s.index,{},h,v&&v[C])}t.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,_,c,u,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],o,0,!1,0,d)}_addCollisionDebugVertex(e,t,r,n,i,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,n,i,s,o){const l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,u=i.layoutVertexArray,d=i.collisionVertexArray,h=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(u,d,s,h,p,new a(e,t)),this._addCollisionDebugVertex(u,d,s,h,p,new a(r,t)),this._addCollisionDebugVertex(u,d,s,h,p,new a(r,n)),this._addCollisionDebugVertex(u,d,s,h,p,new a(e,n)),l.vertexLength+=4;const m=i.indexArray;m.emplaceBack(c,c+1),m.emplaceBack(c+1,c+2),m.emplaceBack(c+2,c+3),m.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,n){for(let i=e;i<t;i++){const e=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(e.x1,e.y1,e.x2,e.y2,n?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new pu(ts,ec.members,is),this.iconCollisionBox=new pu(ts,ec.members,is);for(let e=0;e<this.symbolInstances.length;e++){const t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,n,i,a,s,o,l){const c={};for(let u=t;u<r;u++){const t=e.get(u);c.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.textFeatureIndex=t.featureIndex;break}for(let u=n;u<i;u++){const t=e.get(u);c.verticalTextBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.verticalTextFeatureIndex=t.featureIndex;break}for(let u=a;u<s;u++){const t=e.get(u);c.iconBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.iconFeatureIndex=t.featureIndex;break}for(let u=o;u<l;u++){const t=e.get(u);c.verticalIconBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.verticalIconFeatureIndex=t.featureIndex;break}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}addIndicesForPlacedSymbol(e,t){const r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let i=r.vertexStartIndex;i<n;i+=4)e.indexArray.emplaceBack(i,i+1,i+2),e.indexArray.emplaceBack(i+1,i+2,i+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),r=Math.cos(e),n=[],i=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);const e=this.symbolInstances.get(s);n.push(0|Math.round(t*e.anchorX+r*e.anchorY)),i.push(e.featureIndex)}return a.sort(((e,t)=>n[e]-n[t]||i[t]-i[e])),a}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),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach(((e,t,r)=>{e>=0&&r.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let fu,gu;bi("SymbolBucket",mu,{omit:["layers","collisionBoxArray","features","compareText"]}),mu.MAX_GLYPHS=65535,mu.addDynamicAttributes=uu;var _u={get paint(){return gu=gu||new ra({"icon-opacity":new Yi(Z.paint_symbol["icon-opacity"]),"icon-color":new Yi(Z.paint_symbol["icon-color"]),"icon-halo-color":new Yi(Z.paint_symbol["icon-halo-color"]),"icon-halo-width":new Yi(Z.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Yi(Z.paint_symbol["icon-halo-blur"]),"icon-translate":new Ki(Z.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ki(Z.paint_symbol["icon-translate-anchor"]),"text-opacity":new Yi(Z.paint_symbol["text-opacity"]),"text-color":new Yi(Z.paint_symbol["text-color"],{runtimeType:he,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Yi(Z.paint_symbol["text-halo-color"]),"text-halo-width":new Yi(Z.paint_symbol["text-halo-width"]),"text-halo-blur":new Yi(Z.paint_symbol["text-halo-blur"]),"text-translate":new Ki(Z.paint_symbol["text-translate"]),"text-translate-anchor":new Ki(Z.paint_symbol["text-translate-anchor"])})},get layout(){return fu=fu||new ra({"symbol-placement":new Ki(Z.layout_symbol["symbol-placement"]),"symbol-spacing":new Ki(Z.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ki(Z.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Yi(Z.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ki(Z.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ki(Z.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ki(Z.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ki(Z.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ki(Z.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ki(Z.layout_symbol["icon-rotation-alignment"]),"icon-size":new Yi(Z.layout_symbol["icon-size"]),"icon-text-fit":new Ki(Z.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ki(Z.layout_symbol["icon-text-fit-padding"]),"icon-image":new Yi(Z.layout_symbol["icon-image"]),"icon-rotate":new Yi(Z.layout_symbol["icon-rotate"]),"icon-padding":new Yi(Z.layout_symbol["icon-padding"]),"icon-keep-upright":new Ki(Z.layout_symbol["icon-keep-upright"]),"icon-offset":new Yi(Z.layout_symbol["icon-offset"]),"icon-anchor":new Yi(Z.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ki(Z.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ki(Z.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ki(Z.layout_symbol["text-rotation-alignment"]),"text-field":new Yi(Z.layout_symbol["text-field"]),"text-font":new Yi(Z.layout_symbol["text-font"]),"text-size":new Yi(Z.layout_symbol["text-size"]),"text-max-width":new Yi(Z.layout_symbol["text-max-width"]),"text-line-height":new Ki(Z.layout_symbol["text-line-height"]),"text-letter-spacing":new Yi(Z.layout_symbol["text-letter-spacing"]),"text-justify":new Yi(Z.layout_symbol["text-justify"]),"text-radial-offset":new Yi(Z.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ki(Z.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Yi(Z.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Yi(Z.layout_symbol["text-anchor"]),"text-max-angle":new Ki(Z.layout_symbol["text-max-angle"]),"text-writing-mode":new Ki(Z.layout_symbol["text-writing-mode"]),"text-rotate":new Yi(Z.layout_symbol["text-rotate"]),"text-padding":new Ki(Z.layout_symbol["text-padding"]),"text-keep-upright":new Ki(Z.layout_symbol["text-keep-upright"]),"text-transform":new Yi(Z.layout_symbol["text-transform"]),"text-offset":new Yi(Z.layout_symbol["text-offset"]),"text-allow-overlap":new Ki(Z.layout_symbol["text-allow-overlap"]),"text-overlap":new Ki(Z.layout_symbol["text-overlap"]),"text-ignore-placement":new Ki(Z.layout_symbol["text-ignore-placement"]),"text-optional":new Ki(Z.layout_symbol["text-optional"])})}};class yu{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:le,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}}bi("FormatSectionOverride",yu,{omit:["defaultValue"]});class vu extends ia{constructor(e){super(e,_u)}recalculate(e,t){if(super.recalculate(e,t),"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"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const e=this.layout.get("text-writing-mode");if(e){const t=[];for(const r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,n){const i=this.layout.get(e).evaluate(t,{},r,n),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||vn(a.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>e&&r in e?String(e[r]):""))}(t.properties,i)}createBucket(e){return new mu(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of _u.paint.overridableProperties){if(!vu.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new yu(t),n=new yn(r,t.property.specification);let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new bn("source",n):new wn("composite",n,t.value.zoomStops),this.paint._values[e]=new Xi(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&vu.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),n=_u.paint.properties[t];let i=!1;const a=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 Je)a(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{i||(t instanceof at&&nt(t.value)===ge?a(t.value.sections):t instanceof qt?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}}let xu;var bu={get paint(){return xu=xu||new ra({"background-color":new Ki(Z.paint_background["background-color"]),"background-pattern":new ea(Z.paint_background["background-pattern"]),"background-opacity":new Ki(Z.paint_background["background-opacity"])})}};class wu extends ia{constructor(e){super(e,bu)}}let Cu;var Su={get paint(){return Cu=Cu||new ra({"raster-opacity":new Ki(Z.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ki(Z.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ki(Z.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ki(Z.paint_raster["raster-brightness-max"]),"raster-saturation":new Ki(Z.paint_raster["raster-saturation"]),"raster-contrast":new Ki(Z.paint_raster["raster-contrast"]),"raster-resampling":new Ki(Z.paint_raster["raster-resampling"]),"raster-fade-duration":new Ki(Z.paint_raster["raster-fade-duration"])})}};class ku extends ia{constructor(e){super(e,Su)}}class ju extends ia{constructor(e){super(e,{}),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Eu{constructor(e){this._methodToThrottle=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Tu=6371008.8;class Pu{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 Pu(g(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 Tu*Math.acos(Math.min(i,1))}static convert(e){if(e instanceof Pu)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Pu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Pu(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>]")}}const Iu=2*Math.PI*Tu;function Mu(e){return Iu*Math.cos(e*Math.PI/180)}function Nu(e){return(180+e)/360}function Au(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Lu(e,t){return e/Mu(t)}function Du(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}class zu{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=Pu.convert(e);return new zu(Nu(r.lng),Au(r.lat),Lu(t,r.lat))}toLngLat(){return new Pu(360*this.x-180,Du(this.y))}toAltitude(){return this.z*Mu(Du(this.y))}meterInMercatorCoordinateUnits(){return 1/Iu*(e=Du(this.y),1/Math.cos(e*Math.PI/180));var e}}function Ou(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]}class Ru{constructor(e,t,r){if(!function(e,t,r){return!(e<0||e>25||r<0||r>=Math.pow(2,e)||t<0||t>=Math.pow(2,e))}(e,t,r))throw new Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=t,this.y=r,this.key=Vu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){const n=(a=this.y,s=this.z,o=Ou(256*(i=this.x),256*(a=Math.pow(2,s)-a-1),s),l=Ou(256*(i+1),256*(a+1),s),o[0]+","+o[1]+","+l[0]+","+l[1]);var i,a,s,o,l;const c=function(e,t,r){let n,i="";for(let a=e;a>0;a--)n=1<<a-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}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}isChildOf(e){const t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){const t=Math.pow(2,this.z);return new a((e.x*t-this.x)*zs,(e.y*t-this.y)*zs)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Fu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Vu(e,t.z,t.z,t.x,t.y)}}class Bu{constructor(e,t,r,n,i){if(e<r)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Ru(r,+n,+i),this.key=Vu(t,e,r,n,i)}clone(){return new Bu(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const t=this.canonical.z-e;return e>this.canonical.z?new Bu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Bu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?Vu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Vu(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.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new Bu(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 Bu(t,this.wrap,t,r,n),new Bu(t,this.wrap,t,r+1,n),new Bu(t,this.wrap,t,r,n+1),new Bu(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 Bu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Bu(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 Fu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new zu(e.x-this.wrap,e.y))}}function Vu(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);const a=1<<r;return(a*a*e+a*i+n).toString(36)+r.toString(36)+t.toString(36)}bi("CanonicalTileID",Ru),bi("OverscaledTileID",Bu,{omit:["posMatrix"]});class $u{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void C(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=t.height;const o=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=i,this.blueFactor=a,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let l=0;l<o;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(o,l)]=this.data[this._idx(o-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,o)]=this.data[this._idx(l,o-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(o,-1)]=this.data[this._idx(o-1,0)],this.data[this._idx(-1,o)]=this.data[this._idx(0,o-1)],this.data[this._idx(o,o)]=this.data[this._idx(o-1,o-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let l=0;l<o;l++)for(let e=0;e<o;e++){const t=this.get(l,e);t>this.max&&(this.max=t),t<this.min&&(this.min=t)}}get(e,t){const r=new Uint8Array(this.data.buffer),n=4*this._idx(e,t);return this.unpack(r[n],r[n+1],r[n+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_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)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Co({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}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,a=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=s-1;break;case 1:s=a+1}const o=-t*this.dim,l=-r*this.dim;for(let c=a;c<s;c++)for(let t=n;t<i;t++)this.data[this._idx(t,c)]=e.data[this._idx(t+o,c+l)]}}bi("DEMData",$u);class Uu{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){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Hu{constructor(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=n,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}class qu{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new vi(zs,16,0),this.grid3D=new vi(zs,16,0),this.featureIndexArray=new Ha,this.promoteId=t}insert(e,t,r,n,i,a){const s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);const o=a?this.grid3D:this.grid;for(let l=0;l<t.length;l++){const e=t[l],r=[1/0,1/0,-1/0,-1/0];for(let t=0;t<e.length;t++){const n=e[t];r[0]=Math.min(r[0],n.x),r[1]=Math.min(r[1],n.y),r[2]=Math.max(r[2],n.x),r[3]=Math.max(r[3],n.y)}r[0]<zs&&r[1]<zs&&r[2]>=0&&r[3]>=0&&o.insert(s,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new pl.VectorTile(new Ec(this.rawTileData)).layers,this.sourceLayerCoder=new Uu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,r,n){this.loadVTLayers();const i=e.params||{},s=zs/e.tileSize/e.scale,o=Tn(i.filter),l=e.queryGeometry,c=e.queryPadding*s,u=Gu(l),d=this.grid.query(u.minX-c,u.minY-c,u.maxX+c,u.maxY+c),h=Gu(e.cameraQueryGeometry),p=this.grid3D.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c,((t,r,n,i)=>function(e,t,r,n,i){for(const a of e)if(t<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;const s=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(const a of s)if(Ys(e,a))return!0;for(let a=0;a<e.length-1;a++)if(Qs(e[a],e[a+1],s))return!0;return!1}(e.cameraQueryGeometry,t-c,r-c,n+c,i+c)));for(const a of p)d.push(a);d.sort(Wu);const m={};let f;for(let a=0;a<d.length;a++){const c=d[a];if(c===f)continue;f=c;const u=this.featureIndexArray.get(c);let h=null;this.loadMatchingFeature(m,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,o,i.layers,i.availableImages,t,r,n,((t,r,n)=>(h||(h=Fs(t)),r.queryIntersectsFeature(l,t,n,h,this.z,e.transform,s,e.pixelPosMatrix))))}return m}loadMatchingFeature(e,t,r,n,i,a,s,o,l,c,u){const d=this.bucketLayerIDs[t];if(a&&!function(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(a,d))return;const h=this.sourceLayerCoder.decode(r),p=this.vtLayers[h].feature(n);if(i.needGeometry){const e=Bs(p,!0);if(!i.filter(new $i(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new $i(this.tileID.overscaledZ),p))return;const m=this.getId(p,h);for(let f=0;f<d.length;f++){const t=d[f];if(a&&a.indexOf(t)<0)continue;const r=o[t];if(!r)continue;let i={};m&&c&&(i=c.getState(r.sourceLayer||"_geojsonTileLayer",m));const h=_({},l[t]);h.paint=Zu(h.paint,r.paint,p,i,s),h.layout=Zu(h.layout,r.layout,p,i,s);const g=!u||u(p,r,i);if(!g)continue;const y=new Hu(p,this.z,this.x,this.y,m);y.layer=h;let v=e[t];void 0===v&&(v=e[t]=[]),v.push({featureIndex:n,feature:y,intersectionZ:g})}}lookupSymbolFeatures(e,t,r,n,i,a,s,o){const l={};this.loadVTLayers();const c=Tn(i);for(const u of e)this.loadMatchingFeature(l,r,n,u,c,a,s,o,t);return l}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;return this.promoteId&&(r=e.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[t]],"boolean"==typeof r&&(r=Number(r))),r}}function Zu(e,t,r,n,i){return v(e,((e,a)=>{const s=t instanceof Ji?t.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s}))}function Gu(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:t,minY:r,maxX:n,maxY:i}}function Wu(e,t){return t-e}function Xu(e,t,r,n,i){const s=[];for(let o=0;o<e.length;o++){const l=e[o];let c;for(let e=0;e<l.length-1;e++){let o=l[e],u=l[e+1];o.x<t&&u.x<t||(o.x<t?o=new a(t,o.y+(t-o.x)/(u.x-o.x)*(u.y-o.y))._round():u.x<t&&(u=new a(t,o.y+(t-o.x)/(u.x-o.x)*(u.y-o.y))._round()),o.y<r&&u.y<r||(o.y<r?o=new a(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r)._round():u.y<r&&(u=new a(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r)._round()),o.x>=n&&u.x>=n||(o.x>=n?o=new a(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y))._round():u.x>=n&&(u=new a(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y))._round()),o.y>=i&&u.y>=i||(o.y>=i?o=new a(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i)._round():u.y>=i&&(u=new a(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i)._round()),c&&o.equals(c[c.length-1])||(c=[o],s.push(c)),c.push(u)))))}}return s}bi("FeatureIndex",qu,{omit:["rawTileData","sourceLayerCoder"]});class Ju extends a{constructor(e,t,r,n){super(e,t),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new Ju(this.x,this.y,this.angle,this.segment)}}function Ku(e,t,r,n,i){if(void 0===t.segment||0===r)return!0;let a=t,s=t.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=e[s].dist(a),a=e[s]}o+=e[s].dist(e[s+1]),s++;const l=[];let c=0;for(;o<r/2;){const t=e[s],r=e[s+1];if(!r)return!1;let a=e[s-1].angleTo(t)-t.angleTo(r);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:a}),c+=a;o-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;s++,o+=t.dist(r)}return!0}function Yu(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Qu(e,t,r){return e?.6*t*r:0}function ed(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function td(e,t,r,n,i,a){const s=Qu(r,i,a),o=ed(r,n)*a;let l=0;const c=Yu(e)/2;for(let u=0;u<e.length-1;u++){const r=e[u],n=e[u+1],i=r.dist(n);if(l+i>c){const a=(c-l)/i,d=It.number(r.x,n.x,a),h=It.number(r.y,n.y,a),p=new Ju(d,h,n.angleTo(r),u);return p._round(),!s||Ku(e,p,o,s,t)?p:void 0}l+=i}}function rd(e,t,r,n,i,a,s,o,l){const c=Qu(n,a,s),u=ed(n,i),d=u*s,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),nd(e,h?t/2*o%t:(u/2+2*a)*s*o%t,t,c,r,d,h,!1,l)}function nd(e,t,r,n,i,a,s,o,l){const c=a/2,u=Yu(e);let d=0,h=t-r,p=[];for(let m=0;m<e.length-1;m++){const t=e[m],s=e[m+1],o=t.dist(s),f=s.angleTo(t);for(;h+r<d+o;){h+=r;const g=(h-d)/o,_=It.number(t.x,s.x,g),y=It.number(t.y,s.y,g);if(_>=0&&_<l&&y>=0&&y<l&&h-c>=0&&h+c<=u){const t=new Ju(_,y,f,m);t._round(),n&&!Ku(e,t,a,n,i)||p.push(t)}}d+=o}return o||p.length||s||(p=nd(e,d/2,r,n,i,a,s,!0,l)),p}bi("Anchor",Ju);const id=Lc;function ad(e,t,r,n){const i=[],s=e.image,o=s.pixelRatio,l=s.paddedRect.w-2*id,c=s.paddedRect.h-2*id;let u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom};const d=s.stretchX||[[0,l]],h=s.stretchY||[[0,c]],p=(e,t)=>e+t[1]-t[0],m=d.reduce(p,0),f=h.reduce(p,0),g=l-m,_=c-f;let y=0,v=m,x=0,b=f,w=0,C=g,S=0,k=_;if(s.content&&n){const t=s.content,r=t[2]-t[0],n=t[3]-t[1];(s.textFitWidth||s.textFitHeight)&&(u=eu(e)),y=sd(d,0,t[0]),x=sd(h,0,t[1]),v=sd(d,t[0],t[2]),b=sd(h,t[1],t[3]),w=t[0]-y,S=t[1]-x,C=r-v,k=n-b}const j=u.x1,E=u.y1,T=u.x2-j,P=u.y2-E,I=(e,n,i,l)=>{const c=ld(e.stretch-y,v,T,j),u=cd(e.fixed-w,C,e.stretch,m),d=ld(n.stretch-x,b,P,E),h=cd(n.fixed-S,k,n.stretch,f),p=ld(i.stretch-y,v,T,j),g=cd(i.fixed-w,C,i.stretch,m),_=ld(l.stretch-x,b,P,E),I=cd(l.fixed-S,k,l.stretch,f),M=new a(c,d),N=new a(p,d),A=new a(p,_),L=new a(c,_),D=new a(u/o,h/o),z=new a(g/o,I/o),O=t*Math.PI/180;if(O){const e=Math.sin(O),t=Math.cos(O),r=[t,-e,e,t];M._matMult(r),N._matMult(r),L._matMult(r),A._matMult(r)}const R=e.stretch+e.fixed,F=n.stretch+n.fixed;return{tl:M,tr:N,bl:L,br:A,tex:{x:s.paddedRect.x+id+R,y:s.paddedRect.y+id+F,w:i.stretch+i.fixed-R,h:l.stretch+l.fixed-F},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:z,minFontScaleX:C/o/T,minFontScaleY:k/o/P,isSDF:r}};if(n&&(s.stretchX||s.stretchY)){const e=od(d,g,m),t=od(h,_,f);for(let r=0;r<e.length-1;r++){const n=e[r],a=e[r+1];for(let e=0;e<t.length-1;e++)i.push(I(n,t[e],a,t[e+1]))}}else i.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return i}function sd(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 od(e,t,r){const n=[{fixed:-id,stretch:0}];for(const[i,a]of e){const e=n[n.length-1];n.push({fixed:i-e.stretch,stretch:e.stretch}),n.push({fixed:i-e.stretch,stretch:e.stretch+(a-i)})}return n.push({fixed:t+id,stretch:r}),n}function ld(e,t,r,n){return e/t*r+n}function cd(e,t,r,n){return e-t*r/n}class ud{constructor(e,t,r,n,i,s,o,l,c,u){var d;if(this.boxStartIndex=e.length,c){let e=s.top,t=s.bottom;const r=s.collisionPadding;r&&(e-=r[1],t+=r[3]);let n=t-e;n>0&&(n=Math.max(10,n),this.circleDiameter=n)}else{const c=(null===(d=s.image)||void 0===d?void 0:d.content)&&(s.image.textFitWidth||s.image.textFitHeight)?eu(s):{x1:s.left,y1:s.top,x2:s.right,y2:s.bottom};c.y1=c.y1*o-l[0],c.y2=c.y2*o+l[2],c.x1=c.x1*o-l[3],c.x2=c.x2*o+l[1];const h=s.collisionPadding;if(h&&(c.x1-=h[0]*o,c.y1-=h[1]*o,c.x2+=h[2]*o,c.y2+=h[3]*o),u){const e=new a(c.x1,c.y1),t=new a(c.x2,c.y1),r=new a(c.x1,c.y2),n=new a(c.x2,c.y2),i=u*Math.PI/180;e._rotate(i),t._rotate(i),r._rotate(i),n._rotate(i),c.x1=Math.min(e.x,t.x,r.x,n.x),c.x2=Math.max(e.x,t.x,r.x,n.x),c.y1=Math.min(e.y,t.y,r.y,n.y),c.y2=Math.max(e.y,t.y,r.y,n.y)}e.emplaceBack(t.x,t.y,c.x1,c.y1,c.x2,c.y2,r,n,i)}this.boxEndIndex=e.length}}class dd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(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 r=(this.length>>1)-1;r>=0;r--)this._down(r)}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,a=t[i];if(r(n,a)>=0)break;t[e]=a,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 a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}}function hd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=1/0,i=1/0,s=-1/0,o=-1/0;const l=e[0];for(let a=0;a<l.length;a++){const e=l[a];(!a||e.x<n)&&(n=e.x),(!a||e.y<i)&&(i=e.y),(!a||e.x>s)&&(s=e.x),(!a||e.y>o)&&(o=e.y)}const c=Math.min(s-n,o-i);let u=c/2;const d=new dd([],pd);if(0===c)return new a(n,i);for(let a=n;a<s;a+=c)for(let t=i;t<o;t+=c)d.push(new md(a+u,t+u,u,e));let h=function(e){let t=0,r=0,n=0;const i=e[0];for(let a=0,s=i.length,o=s-1;a<s;o=a++){const e=i[a],s=i[o],l=e.x*s.y-s.x*e.y;r+=(e.x+s.x)*l,n+=(e.y+s.y)*l,t+=3*l}return new md(r/t,n/t,0,e)}(e),p=d.length;for(;d.length;){const n=d.pop();(n.d>h.d||!h.d)&&(h=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-h.d<=t||(u=n.h/2,d.push(new md(n.p.x-u,n.p.y-u,u,e)),d.push(new md(n.p.x+u,n.p.y-u,u,e)),d.push(new md(n.p.x-u,n.p.y+u,u,e)),d.push(new md(n.p.x+u,n.p.y+u,u,e)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${h.d}`)),h.p}function pd(e,t){return t.max-e.max}function md(e,t,r,n){this.p=new a(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 a=t[i];for(let t=0,i=a.length,s=i-1;t<i;s=t++){const i=a[t],o=a[s];i.y>e.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r),n=Math.min(n,Js(e,i,o))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var fd;e.aq=void 0,(fd=e.aq||(e.aq={}))[fd.center=1]="center",fd[fd.left=2]="left",fd[fd.right=3]="right",fd[fd.top=4]="top",fd[fd.bottom=5]="bottom",fd[fd["top-left"]=6]="top-left",fd[fd["top-right"]=7]="top-right",fd[fd["bottom-left"]=8]="bottom-left",fd[fd["bottom-right"]=9]="bottom-right";const gd=7,_d=Number.POSITIVE_INFINITY;function yd(e,t){return t[1]!==_d?function(e,t,r){let n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-gd;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+gd}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]}(e,t[0],t[1]):function(e,t){let r=0,n=0;t<0&&(t=0);const i=t/Math.SQRT2;switch(e){case"top-right":case"top-left":n=i-gd;break;case"bottom-right":case"bottom-left":n=-i+gd;break;case"bottom":n=-t+gd;break;case"top":n=t-gd}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function vd(e,t,r){var n;const i=e.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(t,{},r);if(a){const e=a.values,t=[];for(let r=0;r<e.length;r+=2){const n=t[r]=e[r],i=e[r+1].map((e=>e*ic));n.startsWith("top")?i[1]-=gd:n.startsWith("bottom")&&(i[1]+=gd),t[r+1]=i}return new Qe(t)}const s=i.get("text-variable-anchor");if(s){let n;n=void 0!==e._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(t,{},r)*ic,_d]:i.get("text-offset").evaluate(t,{},r).map((e=>e*ic));const a=[];for(const e of s)a.push(e,yd(e,n));return new Qe(a)}return null}function xd(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 bd(t,r,n,i,a,s,o,l,c,u,d){let h=s.textMaxSize.evaluate(r,{});void 0===h&&(h=o);const p=t.layers[0].layout,m=p.get("icon-offset").evaluate(r,{},d),f=Cd(n.horizontal),g=o/24,_=t.tilePixelRatio*g,y=t.tilePixelRatio*h/24,v=t.tilePixelRatio*l,x=t.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*t.tilePixelRatio,w=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=e.get("icon-padding").evaluate(t,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(p,r,d,t.tilePixelRatio),S=p.get("text-max-angle")/180*Math.PI,k="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),j="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),E=p.get("symbol-placement"),T=x/2,P=p.get("icon-text-fit");let I;i&&"none"!==P&&(t.allowVerticalPlacement&&n.vertical&&(I=tu(i,n.vertical,P,p.get("icon-text-fit-padding"),m,g)),f&&(i=tu(i,f,P,p.get("icon-text-fit-padding"),m,g)));const M=(l,h)=>{h.x<0||h.x>=zs||h.y<0||h.y>=zs||function(t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g,_,y,v,x,b,w,S,k,j){const E=t.addToLineVertexArray(r,n);let T,P,I,M,N=0,A=0,L=0,D=0,z=-1,O=-1;const R={};let F=gs("");if(t.allowVerticalPlacement&&i.vertical){const e=l.layout.get("text-rotate").evaluate(b,{},k)+90;I=new ud(c,r,u,d,h,i.vertical,p,m,f,e),o&&(M=new ud(c,r,u,d,h,o,_,y,f,e))}if(a){const n=l.layout.get("icon-rotate").evaluate(b,{}),i="none"!==l.layout.get("icon-text-fit"),s=ad(a,n,S,i),p=o?ad(o,n,S,i):void 0;P=new ud(c,r,u,d,h,a,_,y,!1,n),N=4*s.length;const m=t.iconSizeData;let f=null;"source"===m.kind?(f=[nu*l.layout.get("icon-size").evaluate(b,{})],f[0]>iu&&C(`${t.layerIds[0]}: Value for "icon-size" is >= ${ru}. Reduce your "icon-size".`)):"composite"===m.kind&&(f=[nu*w.compositeIconSizes[0].evaluate(b,{},k),nu*w.compositeIconSizes[1].evaluate(b,{},k)],(f[0]>iu||f[1]>iu)&&C(`${t.layerIds[0]}: Value for "icon-size" is >= ${ru}. Reduce your "icon-size".`)),t.addSymbols(t.icon,s,f,x,v,b,e.ah.none,r,E.lineStartIndex,E.lineLength,-1,k),z=t.icon.placedSymbolArray.length-1,p&&(A=4*p.length,t.addSymbols(t.icon,p,f,x,v,b,e.ah.vertical,r,E.lineStartIndex,E.lineLength,-1,k),O=t.icon.placedSymbolArray.length-1)}const B=Object.keys(i.horizontal);for(const C of B){const n=i.horizontal[C];if(!T){F=gs(n.text);const e=l.layout.get("text-rotate").evaluate(b,{},k);T=new ud(c,r,u,d,h,n,p,m,f,e)}const a=1===n.positionedLines.length;if(L+=wd(t,r,n,s,l,f,b,g,E,i.vertical?e.ah.horizontal:e.ah.horizontalOnly,a?B:[C],R,z,w,k),a)break}i.vertical&&(D+=wd(t,r,i.vertical,s,l,f,b,g,E,e.ah.vertical,["vertical"],R,O,w,k));const V=T?T.boxStartIndex:t.collisionBoxArray.length,$=T?T.boxEndIndex:t.collisionBoxArray.length,U=I?I.boxStartIndex:t.collisionBoxArray.length,H=I?I.boxEndIndex:t.collisionBoxArray.length,q=P?P.boxStartIndex:t.collisionBoxArray.length,Z=P?P.boxEndIndex:t.collisionBoxArray.length,G=M?M.boxStartIndex:t.collisionBoxArray.length,W=M?M.boxEndIndex:t.collisionBoxArray.length;let X=-1;const J=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t;X=J(T,X),X=J(I,X),X=J(P,X),X=J(M,X);const K=X>-1?1:0;K&&(X*=j/ic),t.glyphOffsetArray.length>=mu.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);const Y=vd(l,b,k),[Q,ee]=function(t,r){const n=t.length,i=null==r?void 0:r.values;if((null==i?void 0:i.length)>0)for(let a=0;a<i.length;a+=2){const r=i[a+1];t.emplaceBack(e.aq[i[a]],r[0],r[1])}return[n,t.length]}(t.textAnchorOffsets,Y);t.symbolInstances.emplaceBack(r.x,r.y,R.right>=0?R.right:-1,R.center>=0?R.center:-1,R.left>=0?R.left:-1,R.vertical||-1,z,O,F,V,$,U,H,q,Z,G,W,u,L,D,N,A,K,0,p,X,Q,ee)}(t,h,l,n,i,a,I,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,_,[b,b,b,b],k,c,v,w,j,m,r,s,u,d,o)};if("line"===E)for(const e of Xu(r.geometry,0,0,zs,zs)){const r=rd(e,x,S,n.vertical||f,i,24,y,t.overscaling,zs);for(const n of r)f&&Sd(t,f.text,T,n)||M(e,n)}else if("line-center"===E){for(const e of r.geometry)if(e.length>1){const t=td(e,S,n.vertical||f,i,24,y);t&&M(e,t)}}else if("Polygon"===r.type)for(const e of yr(r.geometry,0)){const t=hd(e,16);M(e[0],new Ju(t.x,t.y,0))}else if("LineString"===r.type)for(const e of r.geometry)M(e,new Ju(e[0].x,e[0].y,0));else if("Point"===r.type)for(const e of r.geometry)for(const t of e)M([t],new Ju(t.x,t.y,0))}function wd(e,t,r,n,i,s,o,l,c,u,d,h,p,m,f){const g=function(e,t,r,n,i,s,o,l){const c=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,u=[];for(const d of t.positionedLines)for(const e of d.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let s=Nc+1,h=!0,p=1,m=0;const f=(i||l)&&e.vertical,g=e.metrics.advance*e.scale/2;if(l&&t.verticalizable&&(m=d.lineOffset/2-(e.imageName?-(ic-e.metrics.width*e.scale)/2:(e.scale-1)*ic)),e.imageName){const t=o[e.imageName];h=t.sdf,p=t.pixelRatio,s=Lc/p}const _=i?[e.x+g,e.y]:[0,0];let y=i?[0,0]:[e.x+g+r[0],e.y+r[1]-m],v=[0,0];f&&(v=y,y=[0,0]);const x=e.metrics.isDoubleResolution?2:1,b=(e.metrics.left-s)*e.scale-g+y[0],w=(-e.metrics.top-s)*e.scale+y[1],C=b+n.w/x*e.scale/p,S=w+n.h/x*e.scale/p,k=new a(b,w),j=new a(C,w),E=new a(b,S),T=new a(C,S);if(f){const t=new a(-g,g-Rc),r=-Math.PI/2,n=ic/2-g,i=new a(5-Rc-n,-(e.imageName?n:0)),s=new a(...v);k._rotateAround(r,t)._add(i)._add(s),j._rotateAround(r,t)._add(i)._add(s),E._rotateAround(r,t)._add(i)._add(s),T._rotateAround(r,t)._add(i)._add(s)}if(c){const e=Math.sin(c),t=Math.cos(c),r=[t,-e,e,t];k._matMult(r),j._matMult(r),E._matMult(r),T._matMult(r)}const P=new a(0,0),I=new a(0,0);u.push({tl:k,tr:j,bl:E,br:T,tex:n,writingMode:t.writingMode,glyphOffset:_,sectionIndex:e.sectionIndex,isSDF:h,pixelOffsetTL:P,pixelOffsetBR:I,minFontScaleX:0,minFontScaleY:0})}return u}(0,r,l,i,s,o,n,e.allowVerticalPlacement),_=e.textSizeData;let y=null;"source"===_.kind?(y=[nu*i.layout.get("text-size").evaluate(o,{})],y[0]>iu&&C(`${e.layerIds[0]}: Value for "text-size" is >= ${ru}. Reduce your "text-size".`)):"composite"===_.kind&&(y=[nu*m.compositeTextSizes[0].evaluate(o,{},f),nu*m.compositeTextSizes[1].evaluate(o,{},f)],(y[0]>iu||y[1]>iu)&&C(`${e.layerIds[0]}: Value for "text-size" is >= ${ru}. Reduce your "text-size".`)),e.addSymbols(e.text,g,y,l,s,o,u,t,c.lineStartIndex,c.lineLength,p,f);for(const a of d)h[a]=e.text.placedSymbolArray.length-1;return 4*g.length}function Cd(e){for(const t in e)return e[t];return null}function Sd(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}const kd=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class jd{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=kd[15&r];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new jd(s,a,i,e)}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,n=arguments.length>3?arguments[3]:void 0;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=kd.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-s%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+s+o,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+s+o),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+o,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 Ed(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:a,nodeSize:s}=this,o=[0,i.length-1,0],l=[];for(;o.length;){const c=o.pop()||0,u=o.pop()||0,d=o.pop()||0;if(u-d<=s){for(let s=d;s<=u;s++){const o=a[2*s],c=a[2*s+1];o>=e&&o<=r&&c>=t&&c<=n&&l.push(i[s])}continue}const h=d+u>>1,p=a[2*h],m=a[2*h+1];p>=e&&p<=r&&m>=t&&m<=n&&l.push(i[h]),(0===c?e<=p:t<=m)&&(o.push(d),o.push(h-1),o.push(1-c)),(0===c?r>=p:n>=m)&&(o.push(h+1),o.push(u),o.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:a}=this,s=[0,n.length-1,0],o=[],l=r*r;for(;s.length;){const c=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=a){for(let r=d;r<=u;r++)Md(i[2*r],i[2*r+1],e,t)<=l&&o.push(n[r]);continue}const h=d+u>>1,p=i[2*h],m=i[2*h+1];Md(p,m,e,t)<=l&&o.push(n[h]),(0===c?e-r<=p:t-r<=m)&&(s.push(d),s.push(h-1),s.push(1-c)),(0===c?e+r>=p:t+r>=m)&&(s.push(h+1),s.push(u),s.push(1-c))}return o}}function Ed(e,t,r,n,i,a){if(i-n<=r)return;const s=n+i>>1;Td(e,t,s,n,i,a),Ed(e,t,r,n,s-1,1-a),Ed(e,t,r,s+1,i,1-a)}function Td(e,t,r,n,i,a){for(;i>n;){if(i-n>600){const s=i-n+1,o=r-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(o-s/2<0?-1:1);Td(e,t,r,Math.max(n,Math.floor(r-o*c/s+u)),Math.min(i,Math.floor(r+(s-o)*c/s+u)),a)}const s=t[2*r+a];let o=n,l=i;for(Pd(e,t,n,r),t[2*i+a]>s&&Pd(e,t,n,i);o<l;){for(Pd(e,t,o,l),o++,l--;t[2*o+a]<s;)o++;for(;t[2*l+a]>s;)l--}t[2*n+a]===s?Pd(e,t,n,l):(l++,Pd(e,t,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Pd(e,t,r,n){Id(e,r,n),Id(t,2*r,2*n),Id(t,2*r+1,2*n+1)}function Id(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Md(e,t,r,n){const i=e-r,a=t-n;return i*i+a*a}var Nd;e.bg=void 0,(Nd=e.bg||(e.bg={})).create="create",Nd.load="load",Nd.fullLoad="fullLoad";let Ad=null,Ld=[];const Dd=1e3/60,zd="loadTime",Od="fullLoadTime",Rd={mark(e){performance.mark(e)},frame(e){const t=e;null!=Ad&&Ld.push(t-Ad),Ad=t},clearMetrics(){Ad=null,Ld=[],performance.clearMeasures(zd),performance.clearMeasures(Od);for(const t in e.bg)performance.clearMarks(e.bg[t])},getPerformanceMetrics(){performance.measure(zd,e.bg.create,e.bg.load),performance.measure(Od,e.bg.create,e.bg.fullLoad);const t=performance.getEntriesByName(zd)[0].duration,r=performance.getEntriesByName(Od)[0].duration,n=Ld.length,i=1/(Ld.reduce(((e,t)=>e+t),0)/n/1e3),a=Ld.filter((e=>e>Dd)).reduce(((e,t)=>e+(t-Dd)/Dd),0);return{loadTime:t,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};e.$=class extends ha{},e.A=oo,e.B=fi,e.C=function(e){if(null==j){const t=e.navigator?e.navigator.userAgent:null;j=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return j},e.D=Ki,e.E=q,e.F=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Eu((()=>this.process())),this.subscription=function(e,t,r){return e.addEventListener(t,r,!1),{unsubscribe:()=>{e.removeEventListener(t,r,!1)}}}(this.target,"message",(e=>this.receive(e))),this.globalScope=k(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}sendAsync(e,t){return new Promise(((r,n)=>{const i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},t&&t.signal.addEventListener("abort",(()=>{delete this.resolveRejects[i];const t={id:i,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(t)}),{once:!0});const a=[],s=Object.assign(Object.assign({},e),{id:i,sourceMapId:this.mapId,origin:location.origin,data:ki(e.data,a)});this.target.postMessage(s,{transfer:a})}))}receive(e){const t=e.data,r=t.id;if(!("file://"!==t.origin&&"file://"!==location.origin&&"resource://android"!==t.origin&&"resource://android"!==location.origin&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[r];const e=this.abortControllers[r];return delete this.abortControllers[r],void(e&&e.abort())}if(k(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;const e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,r){return t(this,void 0,void 0,(function*(){if("<response>"===r.type){const t=this.resolveRejects[e];if(delete this.resolveRejects[e],!t)return;return void(r.error?t.reject(ji(r.error)):t.resolve(ji(r.data)))}if(!this.messageHandlers[r.type])return void this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const t=ji(r.data),n=new AbortController;this.abortControllers[e]=n;try{const i=yield this.messageHandlers[r.type](r.sourceMapId,t,n);this.completeTask(e,null,i)}catch(t){this.completeTask(e,t)}}))}completeTask(e,t,r){const n=[];delete this.abortControllers[e];const i={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?ki(t):null,data:ki(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=z,e.H=function(){var e=new oo(16);return oo!=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},e.I=Dc,e.J=function(e,t,r){var n,i,a,s,o,l,c,u,d,h,p,m,f=r[0],g=r[1],_=r[2];return t===e?(e[12]=t[0]*f+t[4]*g+t[8]*_+t[12],e[13]=t[1]*f+t[5]*g+t[9]*_+t[13],e[14]=t[2]*f+t[6]*g+t[10]*_+t[14],e[15]=t[3]*f+t[7]*g+t[11]*_+t[15]):(i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],m=t[11],e[0]=n=t[0],e[1]=i,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=h,e[10]=p,e[11]=m,e[12]=n*f+o*g+d*_+t[12],e[13]=i*f+l*g+h*_+t[13],e[14]=a*f+c*g+p*_+t[14],e[15]=s*f+u*g+m*_+t[15]),e},e.K=function(e,t,r){var n=r[0],i=r[1],a=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]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.L=co,e.M=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.N=Pu,e.O=Nu,e.P=a,e.Q=Au,e.R=Co,e.S=Bu,e.T=qi,e.U=d,e.V=h,e.W=P,e.X=zs,e.Y=la,e.Z=zu,e._=t,e.a=L,e.a$=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8],d=e[9],h=e[10],p=e[11],m=e[12],f=e[13],g=e[14],_=e[15],y=t[0],v=t[1],x=t[2],b=t[3],w=t[4],C=t[5],S=t[6],k=t[7],j=t[8],E=t[9],T=t[10],P=t[11],I=t[12],M=t[13],N=t[14],A=t[15];return Math.abs(r-y)<=so*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-v)<=so*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-x)<=so*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-b)<=so*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(s-w)<=so*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(o-C)<=so*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(l-S)<=so*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-k)<=so*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-j)<=so*Math.max(1,Math.abs(u),Math.abs(j))&&Math.abs(d-E)<=so*Math.max(1,Math.abs(d),Math.abs(E))&&Math.abs(h-T)<=so*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(p-P)<=so*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(m-I)<=so*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(f-M)<=so*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(g-N)<=so*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(_-A)<=so*Math.max(1,Math.abs(_),Math.abs(A))},e.a0=os,e.a1=Ru,e.a2=ie,e.a3=e=>{const t=window.document.createElement("video");return t.muted=!0,new Promise((r=>{t.onloadstart=()=>{r(t)};for(const n of e){const e=window.document.createElement("source");B(n)||(t.crossOrigin="Anonymous"),e.src=n,t.appendChild(e)}}))},e.a4=function(){return y++},e.a5=La,e.a6=mu,e.a7=Tn,e.a8=Bs,e.a9=Hu,e.aA=function(e){if("custom"===e.type)return new ju(e);switch(e.type){case"background":return new wu(e);case"circle":return new mo(e);case"fill":return new cl(e);case"fill-extrusion":return new Al(e);case"heatmap":return new jo(e);case"hillshade":return new Po(e);case"line":return new Xl(e);case"raster":return new ku(e);case"symbol":return new vu(e)}},e.aB=b,e.aC=function(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!X(e.version,t.version))return[{command:"setStyle",args:[t]}];X(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),X(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),X(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),X(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),X(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),X(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),X(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),X(e.light,t.light)||r.push({command:"setLight",args:[t.light]}),X(e.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),X(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),X(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const n={},i=[];!function(e,t,r,n){let i;for(i in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)||Y(i,r,n));for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?X(e[i],t[i])||("geojson"===e[i].type&&"geojson"===t[i].type&&ee(e,t,i)?J(r,{command:"setGeoJSONSourceData",args:[i,t[i].data]}):Q(i,t,r,n)):K(i,t,r))}(e.sources,t.sources,i,n);const a=[];e.layers&&e.layers.forEach((e=>{"source"in e&&n[e.source]?r.push({command:"removeLayer",args:[e.id]}):a.push(e)})),r=r.concat(i),function(e,t,r){t=t||[];const n=(e=e||[]).map(re),i=t.map(re),a=e.reduce(ne,{}),s=t.reduce(ne,{}),o=n.slice(),l=Object.create(null);let c,u,d,h,p;for(let m=0,f=0;m<n.length;m++)c=n[m],Object.prototype.hasOwnProperty.call(s,c)?f++:(J(r,{command:"removeLayer",args:[c]}),o.splice(o.indexOf(c,f),1));for(let m=0,f=0;m<i.length;m++)c=i[i.length-1-m],o[o.length-1-m]!==c&&(Object.prototype.hasOwnProperty.call(a,c)?(J(r,{command:"removeLayer",args:[c]}),o.splice(o.lastIndexOf(c,o.length-f),1)):f++,h=o[o.length-m],J(r,{command:"addLayer",args:[s[c],h]}),o.splice(o.length-m,0,c),l[c]=!0);for(let m=0;m<i.length;m++)if(c=i[m],u=a[c],d=s[c],!l[c]&&!X(u,d))if(X(u.source,d.source)&&X(u["source-layer"],d["source-layer"])&&X(u.type,d.type)){for(p in te(u.layout,d.layout,r,c,null,"setLayoutProperty"),te(u.paint,d.paint,r,c,null,"setPaintProperty"),X(u.filter,d.filter)||J(r,{command:"setFilter",args:[c,d.filter]}),X(u.minzoom,d.minzoom)&&X(u.maxzoom,d.maxzoom)||J(r,{command:"setLayerZoomRange",args:[c,d.minzoom,d.maxzoom]}),u)Object.prototype.hasOwnProperty.call(u,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?te(u[p],d[p],r,c,p.slice(6),"setPaintProperty"):X(u[p],d[p])||J(r,{command:"setLayerProperty",args:[c,p,d[p]]}));for(p in d)Object.prototype.hasOwnProperty.call(d,p)&&!Object.prototype.hasOwnProperty.call(u,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?te(u[p],d[p],r,c,p.slice(6),"setPaintProperty"):X(u[p],d[p])||J(r,{command:"setLayerProperty",args:[c,p,d[p]]}))}else J(r,{command:"removeLayer",args:[c]}),h=o[o.lastIndexOf(c)+1],J(r,{command:"addLayer",args:[d,h]})}(a,t.layers,r)}catch(e){console.warn("Unable to compute style diff:",e),r=[{command:"setStyle",args:[t]}]}return r},e.aD=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.aE=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(!e(t[n],r[n]))return!1;return!0}return t===r},e.aF=v,e.aG=x,e.aH=class extends bs{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},e.aI=ws,e.aJ=class extends bs{constructor(e,t){super(e,t),this.current=ks}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}},e.aK=Cs,e.aL=Ss,e.aM=Ge,e.aN=class extends bs{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},e.aO=class extends bs{constructor(e,t){super(e,t),this.current=[0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},e.aP=function(e,t,r,n,i,a,s){var o=1/(t-r),l=1/(n-i),c=1/(a-s);return e[0]=-2*o,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)*o,e[13]=(i+n)*l,e[14]=(s+a)*c,e[15]=1,e},e.aQ=ho,e.aR=class extends wa{},e.aS=tc,e.aT=class extends Sa{},e.aU=ko,e.aV=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.aW=So,e.aX=qa,e.aY=ns,e.aZ=class extends Ma{},e.a_=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&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.aa=function(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,n,i)=>{const a=n||i;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t},e.ab=function(e,t){const r=[];for(const n in e)n in t||r.push(n);return r},e.ac=f,e.ad=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],s=t[1],o=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]=a*i+c*n,e[1]=s*i+u*n,e[2]=o*i+d*n,e[3]=l*i+h*n,e[4]=c*i-a*n,e[5]=u*i-s*n,e[6]=d*i-o*n,e[7]=h*i-l*n,e},e.ae=function(e){var t=new oo(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},e.af=po,e.ag=function(e,t){let r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){const{interpolationType:i,minZoom:a,maxZoom:s}=e,o=i?f(Mt.interpolationFactor(i,t,a,s),0,1):0;"camera"===e.kind?n=It.number(e.minSize,e.maxSize,o):r=o}return{uSizeT:r,uSize:n}},e.ai=function(e,t,r){let{uSize:n,uSizeT:i}=t,{lowerSize:a,upperSize:s}=r;return"source"===e.kind?a/nu:"composite"===e.kind?It.number(a/nu,s/nu,i):n},e.aj=uu,e.ak=function(e,t,r,n){const i=t.y-e.y,s=t.x-e.x,o=n.y-r.y,l=n.x-r.x,c=o*s-l*i;if(0===c)return null;const u=(l*(e.y-r.y)-o*(e.x-r.x))/c;return new a(e.x+u*s,e.y+u*i)},e.al=Xu,e.am=Us,e.an=lo,e.ao=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[t,r,n,i]},e.ap=ic,e.ar=su,e.as=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],p=t[11],m=t[12],f=t[13],g=t[14],_=t[15],y=r*o-n*s,v=r*l-i*s,x=r*c-a*s,b=n*l-i*o,w=n*c-a*o,C=i*c-a*l,S=u*f-d*m,k=u*g-h*m,j=u*_-p*m,E=d*g-h*f,T=d*_-p*f,P=h*_-p*g,I=y*P-v*T+x*E+b*j-w*k+C*S;return I?(e[0]=(o*P-l*T+c*E)*(I=1/I),e[1]=(i*T-n*P-a*E)*I,e[2]=(f*C-g*w+_*b)*I,e[3]=(h*w-d*C-p*b)*I,e[4]=(l*j-s*P-c*k)*I,e[5]=(r*P-i*j+a*k)*I,e[6]=(g*x-m*C-_*v)*I,e[7]=(u*C-h*x+p*v)*I,e[8]=(s*T-o*j+c*S)*I,e[9]=(n*j-r*T-a*S)*I,e[10]=(m*w-f*x+_*y)*I,e[11]=(d*x-u*w-p*y)*I,e[12]=(o*k-s*E-l*S)*I,e[13]=(r*E-n*k+i*S)*I,e[14]=(f*v-m*b-g*y)*I,e[15]=(u*b-d*v+h*y)*I,e):null},e.at=xd,e.au=Kc,e.av=jd,e.aw=function(){const e={},t=Z.$version;for(const r in Z.$root){const n=Z.$root[r];if(n.required){let i=null;i="version"===r?t:"array"===n.type?[]:{},null!=i&&(e[r]=i)}}return e},e.ax=Ei,e.ay=R,e.az=function(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]=W(e[r],t[e[r].ref]));return e},e.b=E,e.b0=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],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},e.b1=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},e.b2=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.b3=g,e.b4=Fu,e.b5=Lu,e.b6=function(e,t,r,n,i){var a,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+n)*(a=1/(n-i)),e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e},e.b7=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],s=t[5],o=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]=a*i+c*n,e[5]=s*i+u*n,e[6]=o*i+d*n,e[7]=l*i+h*n,e[8]=c*i-a*n,e[9]=u*i-s*n,e[10]=d*i-o*n,e[11]=h*i-l*n,e},e.b8=p,e.b9=m,e.bA=ac,e.bB=function(e){return e.message===N},e.bC=xn,e.bD=Vi,e.ba=function(e){return e*Math.PI/180},e.bb=function(e,t){const{x:r,y:n}=zu.fromLngLat(t);return!(e<0||e>25||n<0||n>=1||r<0||r>=1)},e.bc=function(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},e.bd=class extends da{},e.be=Tu,e.bf=Rd,e.bh=O,e.bi=function(e,t){L.REGISTERED_PROTOCOLS[e]=t},e.bj=function(e){delete L.REGISTERED_PROTOCOLS[e]},e.bk=function(e,t){const r={};for(let i=0;i<e.length;i++){const n=t&&t[e[i].id]||On(e[i]);t&&(t[e[i].id]=n);let a=r[n];a||(a=r[n]=[]),a.push(e[i])}const n=[];for(const i in r)n.push(r[i]);return n},e.bl=bi,e.bm=Uu,e.bn=qu,e.bo=zc,e.bp=function(t){t.bucket.createArrays(),t.bucket.tilePixelRatio=zs/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;const r=t.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,a={layoutIconSize:i["icon-size"].possiblyEvaluate(new $i(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new $i(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new $i(18))};if("composite"===t.bucket.textSizeData.kind){const{minZoom:e,maxZoom:r}=t.bucket.textSizeData;a.compositeTextSizes=[i["text-size"].possiblyEvaluate(new $i(e),t.canonical),i["text-size"].possiblyEvaluate(new $i(r),t.canonical)]}if("composite"===t.bucket.iconSizeData.kind){const{minZoom:e,maxZoom:r}=t.bucket.iconSizeData;a.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new $i(e),t.canonical),i["icon-size"].possiblyEvaluate(new $i(r),t.canonical)]}const s=n.get("text-line-height")*ic,o="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),l=n.get("text-keep-upright"),c=n.get("text-size");for(const u of t.bucket.features){const i=n.get("text-font").evaluate(u,{},t.canonical).join(","),d=c.evaluate(u,{},t.canonical),h=a.layoutTextSize.evaluate(u,{},t.canonical),p=a.layoutIconSize.evaluate(u,{},t.canonical),m={horizontal:{},vertical:void 0},f=u.text;let g,_=[0,0];if(f){const a=f.toString(),c=n.get("text-letter-spacing").evaluate(u,{},t.canonical)*ic,p=Ii(a)?c:0,g=n.get("text-anchor").evaluate(u,{},t.canonical),y=vd(r,u,t.canonical);if(!y){const e=n.get("text-radial-offset").evaluate(u,{},t.canonical);_=e?yd(g,[e*ic,_d]):n.get("text-offset").evaluate(u,{},t.canonical).map((e=>e*ic))}let v=o?"center":n.get("text-justify").evaluate(u,{},t.canonical);const x="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(u,{},t.canonical)*ic:1/0,b=()=>{t.bucket.allowVerticalPlacement&&Pi(a)&&(m.vertical=Vc(f,t.glyphMap,t.glyphPositions,t.imagePositions,i,x,s,g,"left",p,_,e.ah.vertical,!0,h,d))};if(!o&&y){const r=new Set;if("auto"===v)for(let e=0;e<y.values.length;e+=2)r.add(xd(y.values[e]));else r.add(v);let n=!1;for(const a of r)if(!m.horizontal[a])if(n)m.horizontal[a]=m.horizontal[0];else{const r=Vc(f,t.glyphMap,t.glyphPositions,t.imagePositions,i,x,s,"center",a,p,_,e.ah.horizontal,!1,h,d);r&&(m.horizontal[a]=r,n=1===r.positionedLines.length)}b()}else{"auto"===v&&(v=xd(g));const r=Vc(f,t.glyphMap,t.glyphPositions,t.imagePositions,i,x,s,g,v,p,_,e.ah.horizontal,!1,h,d);r&&(m.horizontal[v]=r),b(),Pi(a)&&o&&l&&(m.vertical=Vc(f,t.glyphMap,t.glyphPositions,t.imagePositions,i,x,s,g,v,p,_,e.ah.vertical,!1,h,d))}}let y=!1;if(u.icon&&u.icon.name){const e=t.imageMap[u.icon.name];e&&(g=Qc(t.imagePositions[u.icon.name],n.get("icon-offset").evaluate(u,{},t.canonical),n.get("icon-anchor").evaluate(u,{},t.canonical)),y=!!e.sdf,void 0===t.bucket.sdfIcons?t.bucket.sdfIcons=y:t.bucket.sdfIcons!==y&&C("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.bucket.pixelRatio||0!==n.get("icon-rotate").constantOr(1))&&(t.bucket.iconsNeedLinear=!0))}const v=Cd(m.horizontal)||m.vertical;t.bucket.iconsInText=!!v&&v.iconsInText,(v||g)&&bd(t.bucket,u,m,g,t.imageMap,a,h,p,_,y,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.bq=Ul,e.br=al,e.bs=Tl,e.bt=pl,e.bu=Ec,e.bv=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}},e.bw=function(e,r,n,i,a){return t(this,void 0,void 0,(function*(){if(h())try{return yield P(e,r,n,i,a)}catch(e){}return function(e,t,r,n,i){const a=e.width,s=e.height;I&&M||(I=new OffscreenCanvas(a,s),M=I.getContext("2d",{willReadFrequently:!0})),I.width=a,I.height=s,M.drawImage(e,0,0,a,s);const o=M.getImageData(t,r,n,i);return M.clearRect(0,0,a,s),o.data}(e,r,n,i,a)}))},e.bx=$u,e.by=r,e.bz=n,e.c=A,e.d=e=>t(void 0,void 0,void 0,(function*(){if(0===e.byteLength)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(t)}catch(e){throw 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.`)}})),e.e=_,e.f=e=>new Promise(((t,r)=>{const n=new Image;n.onload=()=>{t(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=T}))},n.onerror=()=>r(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 i=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?URL.createObjectURL(i):T})),e.g=D,e.h=(e,t)=>F(_(e,{type:"json"}),t),e.i=k,e.j=H,e.k=U,e.l=(e,t)=>F(_(e,{type:"arrayBuffer"}),t),e.m=F,e.n=function(e){return new Ec(e).readFields(Pc,[])},e.o=wo,e.p=Ac,e.q=ra,e.r=mi,e.s=B,e.t=yi,e.u=pi,e.v=Z,e.w=C,e.x=function(e){let[t,r,n]=e;return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(n),y:t*Math.sin(r)*Math.sin(n),z:t*Math.cos(n)}},e.y=It,e.z=$i})),r("worker",["./shared"],(function(e){class t{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,r){for(const i of t){this._layerConfigs[i.id]=i;const t=this._layers[i.id]=e.aA(i);t._featureFilter=e.a7(t.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const n=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const e of n){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 a=r.sourceLayer||"_geojsonTileLayer";let s=i[a];s||(s=i[a]=[]),s.push(t)}}}class r{constructor(t){const r={},n=[];for(const e in t){const i=t[e],a=r[e]={};for(const e in i){const t=i[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}const{w:i,h:a}=e.p(n),s=new e.o({width:i||1,height:a||1});for(const o in t){const n=t[o];for(const t in n){const i=n[+t];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=r[o][t].rect;e.o.copy(i.bitmap,s,{x:0,y:0},{x:a.x+1,y:a.y+1},i.bitmap)}}this.image=s,this.positions=r}}e.bl("GlyphAtlas",r);class n{constructor(t){this.tileID=new e.S(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,n,a,s){return e._(this,void 0,void 0,(function*(){this.status="parsing",this.data=t,this.collisionBoxArray=new e.a5;const o=new e.bm(Object.keys(t.layers).sort()),l=new e.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},d=n.familiesBySource[this.source];for(const r in d){const n=t.layers[r];if(!n)continue;1===n.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 s=o.encode(r),h=[];for(let e=0;e<n.length;e++){const t=n.feature(e),i=l.getId(t,r);h.push({feature:t,id:i,index:e,sourceLayerIndex:s})}for(const t of d[r]){const r=t[0];r.source!==this.source&&e.w(`layer.source = ${r.source} does not equal this.source = ${this.source}`),r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(i(t,this.zoom,a),(c[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:s,sourceID:this.source})).populate(h,u,this.tileID.canonical),l.bucketLayerIDs.push(t.map((e=>e.id))))}}const h=e.aF(u.glyphDependencies,(e=>Object.keys(e).map(Number)));this.inFlightDependencies.forEach((e=>null==e?void 0:e.abort())),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(h).length){const e=new AbortController;this.inFlightDependencies.push(e),p=s.sendAsync({type:"GG",data:{stacks:h,source:this.source,tileID:this.tileID,type:"glyphs"}},e)}const m=Object.keys(u.iconDependencies);let f=Promise.resolve({});if(m.length){const e=new AbortController;this.inFlightDependencies.push(e),f=s.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"icons"}},e)}const g=Object.keys(u.patternDependencies);let _=Promise.resolve({});if(g.length){const e=new AbortController;this.inFlightDependencies.push(e),_=s.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},e)}const[y,v,x]=yield Promise.all([p,f,_]),b=new r(y),w=new e.bo(v,x);for(const t in c){const r=c[t];r instanceof e.a6?(i(r.layers,this.zoom,a),e.bp({bucket:r,glyphMap:y,glyphPositions:b.positions,imageMap:v,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof e.bq||r instanceof e.br||r instanceof e.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((e=>!e.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:b.image,imageAtlas:w,glyphMap:this.returnDependencies?y:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?b.positions:null}}))}}function i(t,r,n){const i=new e.z(r);for(const e of t)e.recalculate(i,n)}class a{constructor(e,t,r){this.actor=e,this.layerIndex=t,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){const n=yield e.l(t.request,r);try{return{vectorTile:new e.bt.VectorTile(new e.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(e){const i=new Uint8Array(n.data);let a=`Unable to parse the tile at ${t.request.url}, `;throw a+=31===i[0]&&139===i[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${e.message}`,new Error(a)}}))}loadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.uid,i=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request),a=new n(t);this.loading[r]=a;const s=new AbortController;a.abort=s;try{const n=yield this.loadVectorTile(t,s);if(delete this.loading[r],!n)return null;const o=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);const c={};if(i){const e=i.finish();e&&(c.resourceTiming=JSON.parse(JSON.stringify(e)))}a.vectorTile=n.vectorTile;const u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:o,cacheControl:l,resourceTiming:c};try{const t=yield u;return e.e({rawTileData:o.slice(0)},t,l,c)}finally{delete this.fetching[r]}}catch(e){throw delete this.loading[r],a.status="done",this.loaded[r]=a,e}}))}reloadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const n=this.loaded[r];if(n.showCollisionBoxes=t.showCollisionBoxes,"parsing"===n.status){const t=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);let i;if(this.fetching[r]){const{rawTileData:n,cacheControl:a,resourceTiming:s}=this.fetching[r];delete this.fetching[r],i=e.e({rawTileData:n.slice(0)},t,a,s)}else i=t;return i}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){const e=this.loading,r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort.abort(),delete e[r])}))}removeTile(t){return e._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[t.uid]&&delete this.loaded[t.uid]}))}}class s{constructor(){this.loaded={}}loadTile(t){return e._(this,void 0,void 0,(function*(){const{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:s,blueFactor:o,baseShift:l}=t,c=i.width+2,u=i.height+2,d=e.b(i)?new e.R({width:c,height:u},yield e.bw(i,-1,-1,c,u)):i,h=new e.bx(r,d,n,a,s,o,l);return this.loaded=this.loaded||{},this.loaded[r]=h,h}))}removeTile(e){const t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}}function o(e,t){if(0!==e.length){l(e[0],t);for(var r=1;r<e.length;r++)l(e[r],!t)}}function l(e,t){for(var r=0,n=0,i=0,a=e.length,s=a-1;i<a;s=i++){var o=(e[i][0]-e[s][0])*(e[s][1]+e[i][1]),l=r+o;n+=Math.abs(r)>=Math.abs(o)?r-l+o:o-l+r,r=l}r+n>=0!=!!t&&e.reverse()}var c=e.by((function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===i)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===i)e(t.geometry,r);else if("Polygon"===i)o(t.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<t.coordinates.length;n++)o(t.coordinates[n],r);return t}));const u=e.bt.VectorTileFeature.prototype.toGeoJSON;var d={exports:{}},h=e.bz,p=e.bt.VectorTileFeature,m=f;function f(e,t){this.options=t||{},this.features=e,this.length=e.length}function g(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}f.prototype.feature=function(e){return new g(this.features[e],this.options.extent)},g.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],n=[],i=0;i<r.length;i++)n.push(new h(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<e.length;a++)for(var s=e[a],o=0;o<s.length;o++){var l=s[o];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[t,n,r,i]},g.prototype.toGeoJSON=p.prototype.toGeoJSON;var _=e.bA,y=m;function v(e){var t=new _;return function(e,t){for(var r in e.layers)t.writeMessage(3,x,e.layers[r])}(e,t),t.finish()}function x(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,b,n);var i=n.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)t.writeMessage(4,j,a[r])}function b(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,w,e),t.writeVarintField(3,r.type),t.writeMessage(4,k,r)}function w(e,t){var r=e.feature,n=e.keys,i=e.values,a=e.keycache,s=e.valuecache;for(var o in r.properties){var l=r.properties[o],c=a[o];if(null!==l){void 0===c&&(n.push(o),a[o]=c=n.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var d=u+":"+l,h=s[d];void 0===h&&(i.push(l),s[d]=h=i.length-1),t.writeVarint(h)}}}function C(e,t){return(t<<3)+(7&e)}function S(e){return e<<1^e>>31}function k(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,s=r.length,o=0;o<s;o++){var l=r[o],c=1;1===n&&(c=l.length),t.writeVarint(C(1,c));for(var u=3===n?l.length-1:l.length,d=0;d<u;d++){1===d&&1!==n&&t.writeVarint(C(2,u-1));var h=l[d].x-i,p=l[d].y-a;t.writeVarint(S(h)),t.writeVarint(S(p)),i+=h,a+=p}3===n&&t.writeVarint(C(7,1))}}function j(e,t){var 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))}d.exports=v,d.exports.fromVectorTileJs=v,d.exports.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new y(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return v({layers:r})},d.exports.GeoJSONWrapper=y;var E=e.by(d.exports);const T={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},P=Math.fround||(I=new Float32Array(1),e=>(I[0]=+e,I[0]));var I;const M=3,N=5,A=6;class L{constructor(e){this.options=Object.assign(Object.create(T),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 a=[];for(let o=0;o<e.length;o++){const t=e[o];if(!t.geometry)continue;const[r,n]=t.geometry.coordinates,i=P(O(r)),s=P(R(n));a.push(i,s,1/0,o,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[n+1]=this._createTree(a);t&&console.timeEnd(i);for(let o=n;o>=r;o--){const e=+Date.now();s=this.trees[o]=this._createTree(this._cluster(s,o)),t&&console.log("z%d: %d clusters in %dms",o,s.numItems,+Date.now()-e)}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 a=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,a],t),s=this.getClusters([-180,n,i,a],t);return e.concat(s)}const s=this.trees[this._limitZoom(t)],o=s.range(O(r),R(a),O(i),R(n)),l=s.data,c=[];for(const u of o){const e=this.stride*u;c.push(l[e+N]>1?D(l,e,this.clusterProps):this.points[l[e+M]])}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 a=i.data;if(t*this.stride>=a.length)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),o=i.within(a[t*this.stride],a[t*this.stride+1],s),l=[];for(const c of o){const t=c*this.stride;a[t+4]===e&&l.push(a[t+N]>1?D(a,t,this.clusterProps):this.points[a[t+M]])}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:a,radius:s}=this.options,o=s/a,l=(r-o)/i,c=(r+1+o)/i,u={features:[]};return this._addTileFeatures(n.range((t-o)/i,l,(t+1+o)/i,c),n.data,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-o/i,l,1,c),n.data,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,o/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 a=this.getChildren(t);for(const s of a){const t=s.properties;if(t&&t.cluster?i+t.point_count<=n?i+=t.point_count:i=this._appendLeaves(e,t.cluster_id,r,n,i):i<n?i++:e.push(s),e.length===r)break}return i}_createTree(t){const r=new e.av(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,a){for(const s of e){const e=s*this.stride,o=t[e+N]>1;let l,c,u;if(o)l=z(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const r=this.points[t[e+M]];l=r.properties;const[n,i]=r.geometry.coordinates;c=O(n),u=R(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=o||this.options.generateId?t[e+M]:this.points[t[e+M]].id,void 0!==h&&(d.id=h),a.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:a}=this.options,s=r/(n*Math.pow(2,t)),o=e.data,l=[],c=this.stride;for(let u=0;u<o.length;u+=c){if(o[u+2]<=t)continue;o[u+2]=t;const r=o[u],n=o[u+1],d=e.within(o[u],o[u+1],s),h=o[u+N];let p=h;for(const e of d){const r=e*c;o[r+2]>t&&(p+=o[r+N])}if(p>h&&p>=a){let e,a=r*h,s=n*h,m=-1;const f=(u/c<<5)+(t+1)+this.points.length;for(const r of d){const n=r*c;if(o[n+2]<=t)continue;o[n+2]=t;const l=o[n+N];a+=o[n]*l,s+=o[n+1]*l,o[n+4]=f,i&&(e||(e=this._map(o,u,!0),m=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(o,n)))}o[u+4]=f,l.push(a/p,s/p,1/0,f,-1,p),i&&l.push(m)}else{for(let e=0;e<c;e++)l.push(o[u+e]);if(p>1)for(const e of d){const r=e*c;if(!(o[r+2]<=t)){o[r+2]=t;for(let e=0;e<c;e++)l.push(o[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+N]>1){const n=this.clusterProps[e[t+A]];return r?Object.assign({},n):n}const n=this.points[e[t+M]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function D(e,t,r){return{type:"Feature",id:e[t+M],properties:z(e,t,r),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),F(e[t+1])]}};var n}function z(e,t,r){const n=e[t+N],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=e[t+A],s=-1===a?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:e[t+M],point_count:n,point_count_abbreviated:i})}function O(e){return e/360+.5}function R(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 F(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function B(e,t,r,n){let i=n;const a=t+(r-t>>1);let s,o=r-t;const l=e[t],c=e[t+1],u=e[r],d=e[r+1];for(let h=t+3;h<r;h+=3){const t=V(e[h],e[h+1],l,c,u,d);if(t>i)s=h,i=t;else if(t===i){const e=Math.abs(h-a);e<o&&(s=h,o=e)}}i>n&&(s-t>3&&B(e,t,s,n),e[s+2]=i,r-s>3&&B(e,s,r,n))}function V(e,t,r,n,i,a){let s=i-r,o=a-n;if(0!==s||0!==o){const l=((e-r)*s+(t-n)*o)/(s*s+o*o);l>1?(r=i,n=a):l>0&&(r+=s*l,n+=o*l)}return s=e-r,o=t-n,s*s+o*o}function $(e,t,r,n){const i={id:null==e?null:e,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)U(i,r);else if("Polygon"===t)U(i,r[0]);else if("MultiLineString"===t)for(const a of r)U(i,a);else if("MultiPolygon"===t)for(const a of r)U(i,a[0]);return i}function U(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 H(e,t,r,n){if(!t.geometry)return;const i=t.geometry.coordinates;if(i&&0===i.length)return;const a=t.geometry.type,s=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2);let o=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)q(i,o);else if("MultiPoint"===a)for(const c of i)q(c,o);else if("LineString"===a)Z(i,o,s,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(const r of i)o=[],Z(r,o,s,!1),e.push($(l,"LineString",o,t.properties));return}G(i,o,s,!1)}else if("Polygon"===a)G(i,o,s,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(const i of t.geometry.geometries)H(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=[];G(e,t,s,!0),o.push(t)}}e.push($(l,a,o,t.properties))}function q(e,t){t.push(W(e[0]),X(e[1]),0)}function Z(e,t,r,n){let i,a,s=0;for(let l=0;l<e.length;l++){const r=W(e[l][0]),o=X(e[l][1]);t.push(r,o,0),l>0&&(s+=n?(i*o-r*a)/2:Math.sqrt(Math.pow(r-i,2)+Math.pow(o-a,2))),i=r,a=o}const o=t.length-3;t[2]=1,B(t,0,o,r),t[o+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size}function G(e,t,r,n){for(let i=0;i<e.length;i++){const a=[];Z(e[i],a,r,n),t.push(a)}}function W(e){return e/360+.5}function X(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 J(e,t,r,n,i,a,s,o){if(n/=t,a>=(r/=t)&&s<n)return e;if(s<r||a>=n)return null;const l=[];for(const c of e){const e=c.geometry;let t=c.type;const a=0===i?c.minX:c.minY,s=0===i?c.maxX:c.maxY;if(a>=r&&s<n){l.push(c);continue}if(s<r||a>=n)continue;let u=[];if("Point"===t||"MultiPoint"===t)K(e,u,r,n,i);else if("LineString"===t)Y(e,u,r,n,i,!1,o.lineMetrics);else if("MultiLineString"===t)ee(e,u,r,n,i,!1);else if("Polygon"===t)ee(e,u,r,n,i,!0);else if("MultiPolygon"===t)for(const o of e){const e=[];ee(o,e,r,n,i,!0),e.length&&u.push(e)}if(u.length){if(o.lineMetrics&&"LineString"===t){for(const e of u)l.push($(c.id,t,e,c.tags));continue}"LineString"!==t&&"MultiLineString"!==t||(1===u.length?(t="LineString",u=u[0]):t="MultiLineString"),"Point"!==t&&"MultiPoint"!==t||(t=3===u.length?"Point":"MultiPoint"),l.push($(c.id,t,u,c.tags))}}return l.length?l:null}function K(e,t,r,n,i){for(let a=0;a<e.length;a+=3){const s=e[a+i];s>=r&&s<=n&&te(t,e[a],e[a+1],e[a+2])}}function Y(e,t,r,n,i,a,s){let o=Q(e);const l=0===i?re:ne;let c,u,d=e.start;for(let g=0;g<e.length-3;g+=3){const h=e[g],p=e[g+1],m=e[g+2],f=e[g+3],_=e[g+4],y=0===i?h:p,v=0===i?f:_;let x=!1;s&&(c=Math.sqrt(Math.pow(h-f,2)+Math.pow(p-_,2))),y<r?v>r&&(u=l(o,h,p,f,_,r),s&&(o.start=d+c*u)):y>n?v<n&&(u=l(o,h,p,f,_,n),s&&(o.start=d+c*u)):te(o,h,p,m),v<r&&y>=r&&(u=l(o,h,p,f,_,r),x=!0),v>n&&y<=n&&(u=l(o,h,p,f,_,n),x=!0),!a&&x&&(s&&(o.end=d+c*u),t.push(o),o=Q(e)),s&&(d+=c)}let h=e.length-3;const p=e[h],m=e[h+1],f=0===i?p:m;f>=r&&f<=n&&te(o,p,m,e[h+2]),h=o.length-3,a&&h>=3&&(o[h]!==o[0]||o[h+1]!==o[1])&&te(o,o[0],o[1],o[2]),o.length&&t.push(o)}function Q(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ee(e,t,r,n,i,a){for(const s of e)Y(s,t,r,n,i,a,!1)}function te(e,t,r,n){e.push(t,r,n)}function re(e,t,r,n,i,a){const s=(a-t)/(n-t);return te(e,a,r+(i-r)*s,1),s}function ne(e,t,r,n,i,a){const s=(a-r)/(i-r);return te(e,t+(n-t)*s,a,1),s}function ie(e,t){const r=[];for(let n=0;n<e.length;n++){const i=e[n],a=i.type;let s;if("Point"===a||"MultiPoint"===a||"LineString"===a)s=ae(i.geometry,t);else if("MultiLineString"===a||"Polygon"===a){s=[];for(const e of i.geometry)s.push(ae(e,t))}else if("MultiPolygon"===a){s=[];for(const e of i.geometry){const r=[];for(const n of e)r.push(ae(n,t));s.push(r)}}r.push($(i.id,a,s,i.tags))}return r}function ae(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 se(e,t){if(e.transformed)return e;const r=1<<e.z,n=e.x,i=e.y;for(const a of e.features){const e=a.geometry,s=a.type;if(a.geometry=[],1===s)for(let o=0;o<e.length;o+=2)a.geometry.push(oe(e[o],e[o+1],t,r,n,i));else for(let o=0;o<e.length;o++){const s=[];for(let a=0;a<e[o].length;a+=2)s.push(oe(e[o][a],e[o][a+1],t,r,n,i));a.geometry.push(s)}}return e.transformed=!0,e}function oe(e,t,r,n,i,a){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-a))]}function le(e,t,r,n,i){const a=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),s={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 o of e)ce(s,o,a,i);return s}function ce(e,t,r,n){const i=t.geometry,a=t.type,s=[];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"===a||"MultiPoint"===a)for(let o=0;o<i.length;o+=3)s.push(i[o],i[o+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)ue(s,i,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(let o=0;o<i.length;o++)ue(s,i[o],e,r,"Polygon"===a,0===o);else if("MultiPolygon"===a)for(let o=0;o<i.length;o++){const t=i[o];for(let n=0;n<t.length;n++)ue(s,t[n],e,r,!0,0===n)}if(s.length){let r=t.tags||null;if("LineString"===a&&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 o={geometry:s,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:r};null!==t.id&&(o.id=t.id),e.features.push(o)}}function ue(e,t,r,n,i,a){const s=n*n;if(n>0&&t.size<(i?s:n))return void(r.numPoints+=t.length/3);const o=[];for(let l=0;l<t.length;l+=3)(0===n||t[l+2]>s)&&(r.numSimplified++,o.push(t[l],t[l+1])),r.numPoints++;i&&function(e,t){let r=0;for(let n=0,i=e.length,a=i-2;n<i;a=n,n+=2)r+=(e[n]-e[a])*(e[n+1]+e[a+1]);if(r>0===t)for(let n=0,i=e.length;n<i/2;n+=2){const t=e[n],r=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=t,e[i-1-n]=r}}(o,a),e.push(o)}const de={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class he{constructor(e,t){const r=(t=this.options=function(e,t){for(const r in t)e[r]=t[r];return e}(Object.create(de),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++)H(r,e.features[n],t,n);else H(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=J(e,1,-1-r,r,0,-1,2,t),a=J(e,1,1-r,2+r,0,-1,2,t);return(i||a)&&(n=J(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=ie(i,1).concat(n)),a&&(n=n.concat(ie(a,-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,a,s){const o=[e,t,r,n],l=this.options,c=l.debug;for(;o.length;){n=o.pop(),r=o.pop(),t=o.pop(),e=o.pop();const u=1<<t,d=pe(t,r,n);let h=this.tiles[d];if(!h&&(c>1&&console.time("creation"),h=this.tiles[d]=le(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!==a>>e||n!==s>>e)continue}}if(h.source=null,0===e.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,m=.5-p,f=.5+p,g=1+p;let _=null,y=null,v=null,x=null,b=J(e,u,r-p,r+f,0,h.minX,h.maxX,l),w=J(e,u,r+m,r+g,0,h.minX,h.maxX,l);e=null,b&&(_=J(b,u,n-p,n+f,1,h.minY,h.maxY,l),y=J(b,u,n+m,n+g,1,h.minY,h.maxY,l),b=null),w&&(v=J(w,u,n-p,n+f,1,h.minY,h.maxY,l),x=J(w,u,n+m,n+g,1,h.minY,h.maxY,l),w=null),c>1&&console.timeEnd("clipping"),o.push(_||[],t+1,2*r,2*n),o.push(y||[],t+1,2*r,2*n+1),o.push(v||[],t+1,2*r+1,2*n),o.push(x||[],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:a}=n;if(e<0||e>24)return null;const s=1<<e,o=pe(e,t=t+s&s-1,r);if(this.tiles[o])return se(this.tiles[o],i);a>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[pe(c,u,d)];return l&&l.source?(a>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),a>1&&console.timeEnd("drilling down"),this.tiles[o]?se(this.tiles[o],i):null):null}}function pe(e,t,r){return 32*((1<<e)*r+t)+e}function me(e,t){return t?e.properties[t]:e.id}function fe(e,t){if(null==e)return!0;if("Feature"===e.type)return null!=me(e,t);if("FeatureCollection"===e.type){const r=new Set;for(const n of e.features){const e=me(n,t);if(null==e)return!1;if(r.has(e))return!1;r.add(e)}return!0}return!1}function ge(e,t){const r=new Map;if(null==e);else if("Feature"===e.type)r.set(me(e,t),e);else for(const n of e.features)r.set(me(n,t),n);return r}class _e extends a{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){const r=t.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return null;const i=new class{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.X,this.length=t.length,this._features=t}feature(t){return new class{constructor(t){this._feature=t,this.extent=e.X,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 u.call(this,e,t,r)}}(this._features[t])}}(n.features);let a=E(i);return 0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),{vectorTile:i,rawData:a.buffer}}))}loadData(t){return e._(this,void 0,void 0,(function*(){var r;null===(r=this._pendingRequest)||void 0===r||r.abort();const n=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(t,this._pendingRequest),this._geoJSONIndex=t.cluster?new L(function(t){let{superclusterOptions:r,clusterProperties:n}=t;if(!n||!r)return r;const i={},a={},s={accumulated:null,zoom:0},o={properties:null},l=Object.keys(n);for(const c of l){const[t,r]=n[c],s=e.bC(r),o=e.bC("string"==typeof t?[t,["accumulated"],["get",c]]:t);i[c]=s.value,a[c]=o.value}return r.map=e=>{o.properties=e;const t={};for(const r of l)t[r]=i[r].evaluate(s,o);return t},r.reduce=(e,t)=>{o.properties=t;for(const r of l)s.accumulated=e[r],e[r]=a[r].evaluate(s,o)},r}(t)).load((yield this._pendingData).features):(i=yield this._pendingData,new he(i,t.geojsonVtOptions)),this.loaded={};const r={};if(n){const e=n.finish();e&&(r.resourceTiming={},r.resourceTiming[t.source]=JSON.parse(JSON.stringify(e)))}return r}catch(t){if(delete this._pendingRequest,e.bB(t))return{abandoned:!0};throw t}var i}))}getData(){return e._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(e){const t=this.loaded;return t&&t[e.uid]?super.reloadTile(e):this.loadTile(e)}loadAndProcessGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(t,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(c(n,!0),t.filter){const r=e.bC(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const i=n.features.filter((e=>r.value.evaluate({zoom:0},e)));n={type:"FeatureCollection",features:i}}return n}))}loadGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){const{promoteId:n}=t;if(t.request){const i=yield e.h(t.request,r);return this._dataUpdateable=fe(i.data,n)?ge(i.data,n):void 0,i.data}if("string"==typeof t.data)try{const e=JSON.parse(t.data);return this._dataUpdateable=fe(e,n)?ge(e,n):void 0,e}catch(e){throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}if(!t.dataDiff)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${t.source}`);return function(e,t,r){var n,i,a,s;if(t.removeAll&&e.clear(),t.remove)for(const o of t.remove)e.delete(o);if(t.add)for(const o of t.add){const t=me(o,r);null!=t&&e.set(t,o)}if(t.update)for(const o of t.update){let t=e.get(o.id);if(null==t)continue;const r=!o.removeAllProperties&&((null===(n=o.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=o.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((o.newGeometry||o.removeAllProperties||r)&&(t=Object.assign({},t),e.set(o.id,t),r&&(t.properties=Object.assign({},t.properties))),o.newGeometry&&(t.geometry=o.newGeometry),o.removeAllProperties)t.properties={};else if((null===(a=o.removeProperties)||void 0===a?void 0:a.length)>0)for(const e of o.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if((null===(s=o.addOrUpdateProperties)||void 0===s?void 0:s.length)>0)for(const{key:e,value:n}of o.addOrUpdateProperties)t.properties[e]=n}}(this._dataUpdateable,t.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(t){return e._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset)}}class ye{constructor(t){this.self=t,this.actor=new e.F(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=t=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(t)},this.actor.registerMessageHandler("LDT",((e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t))),this.actor.registerMessageHandler("RDT",((t,r)=>e._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(t,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t))),this.actor.registerMessageHandler("GD",((e,t)=>this._getWorkerSource(e,t.type,t.source).getData())),this.actor.registerMessageHandler("LT",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t))),this.actor.registerMessageHandler("RT",((e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t))),this.actor.registerMessageHandler("AT",((e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t))),this.actor.registerMessageHandler("RMT",((e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t))),this.actor.registerMessageHandler("RS",((t,r)=>e._(this,void 0,void 0,(function*(){if(!this.workerSources[t]||!this.workerSources[t][r.type]||!this.workerSources[t][r.type][r.source])return;const e=this.workerSources[t][r.type][r.source];delete this.workerSources[t][r.type][r.source],void 0!==e.removeSource&&e.removeSource(r)})))),this.actor.registerMessageHandler("RM",(t=>e._(this,void 0,void 0,(function*(){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t]})))),this.actor.registerMessageHandler("SR",((t,r)=>e._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((e,t)=>this._syncRTLPluginState(e,t))),this.actor.registerMessageHandler("IS",((t,r)=>e._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((e,t)=>this._setImages(e,t))),this.actor.registerMessageHandler("UL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).replace(r)}))))}_setImages(t,r){return e._(this,void 0,void 0,(function*(){this.availableImages[t]=r;for(const e in this.workerSources[t]){const n=this.workerSources[t][e];for(const e in n)n[e].availableImages=r}}))}_syncRTLPluginState(t,r){return e._(this,void 0,void 0,(function*(){if(e.bD.isParsed())return e.bD.getState();if("loading"!==r.pluginStatus)return e.bD.setState(r),r;const t=r.pluginURL;if(this.self.importScripts(t),e.bD.isParsed()){const r={pluginStatus:"loaded",pluginURL:t};return e.bD.setState(r),r}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${t}`)}))}_getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new t),r}_getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){const n={sendAsync:(t,r)=>(t.targetMapId=e,this.actor.sendAsync(t,r))};switch(t){case"vector":this.workerSources[e][t][r]=new a(n,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][r]=new _e(n,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][r]=new this.externalWorkerSourceTypes[t](n,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][r]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new s),this.demWorkerSources[e][t]}}return e.i(self)&&(self.worker=new ye(self)),ye})),r("index",["exports","./shared"],(function(e,t){var r="4.7.0";let n,i;const a={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:e=>new Promise(((r,n)=>{const i=requestAnimationFrame(r);e.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(t.c())}))})),getImageData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){const t=window.document.createElement("canvas"),r=t.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height),r},resolveURL:e=>(n||(n=document.createElement("a")),n.href=e,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class s{static testProp(e){if(!s.docStyle)return e[0];for(let t=0;t<e.length;t++)if(e[t]in s.docStyle)return e[t];return e[0]}static create(e,t,r){const n=window.document.createElement(e);return void 0!==t&&(n.className=t),r&&r.appendChild(n),n}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){s.docStyle&&s.selectProp&&(s.userSelect=s.docStyle[s.selectProp],s.docStyle[s.selectProp]="none")}static enableDrag(){s.docStyle&&s.selectProp&&(s.docStyle[s.selectProp]=s.userSelect)}static setTransform(e,t){e.style[s.transformProp]=t}static addEventListener(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.addEventListener(t,r,"passive"in n?n:n.capture)}static removeEventListener(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.removeEventListener(t,r,"passive"in n?n:n.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",s.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",s.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",s.suppressClickInternal,!0)}),0)}static getScale(e){const t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,r,n){const i=r.boundingClientRect;return new t.P((n.clientX-i.left)/r.x-e.clientLeft,(n.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,t){const r=s.getScale(e);return s.getPoint(e,r,t)}static touchPos(e,t){const r=[],n=s.getScale(e);for(let i=0;i<t.length;i++)r.push(s.getPoint(e,n,t[i]));return r}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}s.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,s.selectProp=s.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),s.transformProp=s.testProp(["transform","WebkitTransform"]);const o={supported:!1,testSupport:function(e){!u&&c&&(d?h(e):l=e)}};let l,c,u=!1,d=!1;function h(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,c),e.isContextLost())return;o.supported=!0}catch(e){}e.deleteTexture(t),u=!0}var p;"undefined"!=typeof document&&(c=document.createElement("img"),c.onload=()=>{l&&h(l),l=null,d=!0},c.onerror=()=>{u=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(e){let r,n,i,a;e.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},e.addThrottleControl=e=>{const t=i++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],l()},e.getImage=function(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise(((a,s)=>{o.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),t.e(e,{type:"image"}),r.push({abortController:n,requestParameters:e,supportImageRefresh:i,state:"queued",onError:e=>{s(e)},onSuccess:e=>{a(e)}}),l()}))};const s=e=>t._(this,void 0,void 0,(function*(){e.state="running";const{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:s,abortController:o}=e,u=!1===i&&!t.i(self)&&!t.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((e,t)=>e&&"accept"===t),!0));n++;const d=u?c(r,o):t.m(r,o);try{const r=yield d;delete e.abortController,e.state="completed",r.data instanceof HTMLImageElement||t.b(r.data)?s(r):r.data&&s({data:yield(h=r.data,"function"==typeof createImageBitmap?t.d(h):t.f(h)),cacheControl:r.cacheControl,expires:r.expires})}catch(t){delete e.abortController,a(t)}finally{n--,l()}var h})),l=()=>{const e=(()=>{for(const e of Object.keys(a))if(a[e]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let t=n;t<e&&r.length>0;t++){const e=r.shift();e.abortController.signal.aborted?t--:s(e)}},c=(e,r)=>new Promise(((n,i)=>{const a=new Image,s=e.url,o=e.credentials;o&&"include"===o?a.crossOrigin="use-credentials":(o&&"same-origin"===o||!t.s(s))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(t.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(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."))},a.src=s}))}(p||(p={})),p.resetRequestQueue();class m{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function f(e){var r=new t.A(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}var g,_=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e};g=new t.A(3),t.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var y=function(e){var t=e[0],r=e[1];return t*t+r*r};function v(e){const t=[];if("string"==typeof e)t.push({id:"default",url:e});else if(e&&e.length>0){const r=[];for(const{id:n,url:i}of e){const e=`${n}${i}`;-1===r.indexOf(e)&&(r.push(e),t.push({id:n,url:i}))}}return t}function x(e,t,r){const n=e.split("?");return n[0]+=`${t}${r}`,n.join("?")}!function(){var e=new t.A(2);t.A!=Float32Array&&(e[0]=0,e[1]=0)}();class b{constructor(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)}update(e,r,n){const{width:i,height:a}=e,s=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:o}=this,{gl:l}=o;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),s)this.size=[i,a],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,e.data);else{const{x:r,y:s}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texSubImage2D(l.TEXTURE_2D,0,r,s,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,r,s,i,a,l.RGBA,l.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(e,t,r){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function w(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class C extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){const r=this.images[e];if(r&&!r.data&&r.spriteData){const e=r.spriteData;r.data=new t.R({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),r.spriteData=null}return r}addImage(e,t){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(e,r){let n=!0;const i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.j(new Error(`Image "${e}" 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;const r=t.spriteData,n=r&&r.width||t.data.width,i=r&&r.height||t.data.height;return!(e[0]<0||n<e[0]||e[1]<0||i<e[1]||e[2]<0||n<e[2]||e[3]<0||i<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=this.getImage(e);if(r&&(n.data.width!==t.data.width||n.data.height!==t.data.height))throw new Error(`size mismatch between old image (${n.data.width}x${n.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=n.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){const t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((t,r)=>{let n=!0;if(!this.isLoaded())for(const i of e)this.images[i]||(n=!1);this.isLoaded()||n?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})}))}_getImagesForIds(e){const r={};for(const n of e){let e=this.getImage(n);e||(this.fire(new t.k("styleimagemissing",{id:n})),e=this.getImage(n)),e?r[n]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:Boolean(e.userImage&&e.userImage.render)}:t.w(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return r}getPixelSize(){const{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){const r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{const r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new t.I(r,n);this.patterns[e]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new b(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const t in this.patterns)e.push(this.patterns[t].bin);const{w:r,h:n}=t.p(e),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(const a in this.patterns){const{bin:e}=this.patterns[a],r=e.x+1,n=e.y+1,s=this.getImage(a).data,o=s.width,l=s.height;t.R.copy(s,i,{x:0,y:0},{x:r,y:n},{width:o,height:l}),t.R.copy(s,i,{x:0,y:l-1},{x:r,y:n-1},{width:o,height:1}),t.R.copy(s,i,{x:0,y:0},{x:r,y:n+l},{width:o,height:1}),t.R.copy(s,i,{x:o-1,y:0},{x:r-1,y:n},{width:1,height:l}),t.R.copy(s,i,{x:0,y:0},{x:r+o,y:n},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const r of e){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const e=this.getImage(r);e||t.w(`Image with ID: "${r}" was not found`),w(e)&&this.updateImage(r,e)}}}const S=1e20;function k(e,t,r,n,i,a,s,o,l){for(let c=t;c<t+n;c++)j(e,r*a+c,a,i,s,o,l);for(let c=r;c<r+i;c++)j(e,c*a+t,1,n,s,o,l)}function j(e,t,r,n,i,a,s){a[0]=0,s[0]=-S,s[1]=S,i[0]=e[t];for(let o=1,l=0,c=0;o<n;o++){i[o]=e[t+o*r];const n=o*o;do{const e=a[l];c=(i[o]-i[e]+n-e*e)/(o-e)/2}while(c<=s[l]&&--l>-1);l++,a[l]=o,s[l]=c,s[l+1]=S}for(let o=0,l=0;o<n;o++){for(;s[l+1]<o;)l++;const n=a[l],c=o-n;e[t+o*r]=i[n]+c*c}}class E{constructor(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}}setURL(e){this.url=e}getGlyphs(e){return t._(this,void 0,void 0,(function*(){const t=[];for(const i in e)for(const r of e[i])t.push(this._getAndCacheGlyphsPromise(i,r));const r=yield Promise.all(t),n={};for(const{stack:e,id:i,glyph:a}of r)n[e]||(n[e]={}),n[e][i]=a&&{id:a.id,bitmap:a.bitmap.clone(),metrics:a.metrics};return n}))}_getAndCacheGlyphsPromise(e,r){return t._(this,void 0,void 0,(function*(){let t=this.entries[e];t||(t=this.entries[e]={glyphs:{},requests:{},ranges:{}});let n=t.glyphs[r];if(void 0!==n)return{stack:e,id:r,glyph:n};if(n=this._tinySDF(t,e,r),n)return t.glyphs[r]=n,{stack:e,id:r,glyph:n};const i=Math.floor(r/256);if(256*i>65535)throw new Error("glyphs > 65535 not supported");if(t.ranges[i])return{stack:e,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!t.requests[i]){const r=E.loadGlyphRange(e,i,this.url,this.requestManager);t.requests[i]=r}const a=yield t.requests[i];for(const e in a)this._doesCharSupportLocalGlyph(+e)||(t.glyphs[+e]=a[+e]);return t.ranges[i]=!0,{stack:e,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&/\p{Ideo}|\p{sc=Hang}|\p{sc=Hira}|\p{sc=Kana}/u.test(String.fromCodePoint(e))}_tinySDF(e,r,n){const i=this.localIdeographFontFamily;if(!i)return;if(!this._doesCharSupportLocalGlyph(n))return;let a=e.tinySDF;if(!a){let t="400";/bold/i.test(r)?t="900":/medium/i.test(r)?t="500":/light/i.test(r)&&(t="200"),a=e.tinySDF=new E.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:t})}const s=a.draw(String.fromCharCode(n));return{id:n,bitmap:new t.o({width:s.width||60,height:s.height||60},s.data),metrics:{width:s.glyphWidth/2||24,height:s.glyphHeight/2||24,left:s.glyphLeft/2+.5||0,top:s.glyphTop/2-27.5||-8,advance:s.glyphAdvance/2||24,isDoubleResolution:!0}}}}E.loadGlyphRange=function(e,r,n,i){return t._(this,void 0,void 0,(function*(){const a=256*r,s=a+255,o=i.transformRequest(n.replace("{fontstack}",e).replace("{range}",`${a}-${s}`),"Glyphs"),l=yield t.l(o,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${s}`);const c={};for(const e of t.n(l.data))c[e.id]=e;return c}))},E.TinySDF=class{constructor(){let{fontSize:e=24,buffer:t=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:s="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=t,this.cutoff=n,this.radius=r;const o=this.size=e+4*t,l=this._createCanvas(o),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${a} ${e}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Uint16Array(o)}_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:a}=this.ctx.measureText(e),s=Math.ceil(r),o=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,s+Math.ceil(n)),c=o+2*this.buffer,u=l+2*this.buffer,d=Math.max(c*u,0),h=new Uint8ClampedArray(d),p={data:h,width:c,height:u,glyphWidth:o,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:t};if(0===o||0===l)return p;const{ctx:m,buffer:f,gridInner:g,gridOuter:_}=this;m.clearRect(f,f,o,l),m.fillText(e,f,f+s);const y=m.getImageData(f,f,o,l);_.fill(S,0,d),g.fill(0,0,d);for(let v=0;v<l;v++)for(let e=0;e<o;e++){const t=y.data[4*(v*o+e)+3]/255;if(0===t)continue;const r=(v+f)*c+e+f;if(1===t)_[r]=0,g[r]=S;else{const e=.5-t;_[r]=e>0?e*e:0,g[r]=e<0?e*e:0}}k(_,0,0,c,u,c,this.f,this.v,this.z),k(g,f,f,o,l,c,this.f,this.v,this.z);for(let v=0;v<d;v++){const e=Math.sqrt(_[v])-Math.sqrt(g[v]);h[v]=Math.round(255-255*(e/this.radius+this.cutoff))}return p}};class T{constructor(){this.specification=t.v.light.position}possiblyEvaluate(e,r){return t.x(e.expression.evaluate(r))}interpolate(e,r,n){return{x:t.y.number(e.x,r.x,n),y:t.y.number(e.y,r.y,n),z:t.y.number(e.z,r.z,n)}}}let P;class I extends t.E{constructor(e){super(),P=P||new t.q({anchor:new t.D(t.v.light.anchor),position:new T,color:new t.D(t.v.light.color),intensity:new t.D(t.v.light.intensity)}),this._transitionable=new t.T(P),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(t.r,e,r))for(const t in e){const r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,n){return(!n||!1!==n.validate)&&t.t(this,e.call(t.u,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}const M=new t.q({"sky-color":new t.D(t.v.sky["sky-color"]),"horizon-color":new t.D(t.v.sky["horizon-color"]),"fog-color":new t.D(t.v.sky["fog-color"]),"fog-ground-blend":new t.D(t.v.sky["fog-ground-blend"]),"horizon-fog-blend":new t.D(t.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new t.D(t.v.sky["sky-horizon-blend"]),"atmosphere-blend":new t.D(t.v.sky["atmosphere-blend"])});class N extends t.E{constructor(e){super(),this._transitionable=new t.T(M),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.z(0))}setSky(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(t.B,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const t in e){const r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!1!==(null==n?void 0:n.validate)&&t.t(this,e.call(t.u,t.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class A{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){const r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]}getDashRanges(e,t,r){const n=[];let i=e.length%2==1?-e[e.length-1]*r:0,a=e[0]*r,s=!0;n.push({left:i,right:a,isDash:s,zeroLength:0===e[0]});let o=e[0];for(let l=1;l<e.length;l++){s=!s;const t=e[l];i=o*r,o+=t,a=o*r,n.push({left:i,right:a,isDash:s,zeroLength:0===t})}return n}addRoundDash(e,t,r){const n=t/2;for(let i=-r;i<=r;i++){const t=this.width*(this.nextRow+r+i);let a=0,s=e[a];for(let o=0;o<this.width;o++){o/s.right>1&&(s=e[++a]);const l=Math.abs(o-s.left),c=Math.abs(o-s.right),u=Math.min(l,c);let d;const h=i/r*(n+1);if(s.isDash){const e=n-Math.abs(h);d=Math.sqrt(u*u+e*e)}else d=n-Math.sqrt(u*u+h*h);this.data[t+o]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let s=e.length-1;s>=0;--s){const t=e[s],r=e[s+1];t.zeroLength?e.splice(s,1):r&&r.isDash===t.isDash&&(r.left=t.left,e.splice(s,1))}const t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);const n=this.width*this.nextRow;let i=0,a=e[i];for(let s=0;s<this.width;s++){s/a.right>1&&(a=e[++i]);const t=Math.abs(s-a.left),r=Math.abs(s-a.right),o=Math.min(t,r);this.data[n+s]=Math.max(0,Math.min(255,(a.isDash?o:-o)+128))}}addDash(e,r){const n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.w("LineAtlas out of space"),null;let a=0;for(let t=0;t<e.length;t++)a+=e[t];if(0!==a){const t=this.width/a,i=this.getDashRanges(e,this.width,t);r?this.addRoundDash(i,t,n):this.addRegularDash(i)}const s={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,s}bind(e){const t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}}const L="maplibre_preloaded_worker_pool";class D{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<D.workerCount;)this.workers.push(new Worker(t.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[L]}numActive(){return Object.keys(this.active).length}}const z=Math.floor(a.hardwareConcurrency/2);let O,R;function F(){return O||(O=new D),O}D.workerCount=t.C(globalThis)?Math.max(Math.min(z,3),1):1;class B{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;const n=this.workerPool.acquire(r);for(let i=0;i<n.length;i++){const e=new t.F(n[i],r);e.name=`Worker ${i}`,this.actors.push(e)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,t){const r=[];for(const n of this.actors)r.push(n.sendAsync({type:e,data:t}));return Promise.all(r)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.actors.forEach((e=>{e.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,t){for(const r of this.actors)r.registerMessageHandler(e,t)}}function V(){return R||(R=new B(F(),t.G),R.registerMessageHandler("GR",((e,r,n)=>t.m(r,n)))),R}function $(e,r){const n=t.H();return t.J(n,n,[1,1,0]),t.K(n,n,[.5*e.width,.5*e.height,1]),t.L(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function U(e,t,r,n,i,a){const s=function(e,t,r){if(e)for(const n of e){const e=t[n];if(e&&e.source===r&&"fill-extrusion"===e.type)return!0}else for(const n in t){const e=t[n];if(e.source===r&&"fill-extrusion"===e.type)return!0}return!1}(i&&i.layers,t,e.id),o=a.maxPitchScaleFactor(),l=e.tilesIn(n,o,s);l.sort(H);const c=[];for(const d of l)c.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(t,r,e._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,i,a,o,$(e.transform,d.tileID))});const u=function(e){const t={},r={};for(const n of e){const e=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(const r in e){const n=e[r],i=a[r]=a[r]||{},s=t[r]=t[r]||[];for(const e of n)i[e.featureIndex]||(i[e.featureIndex]=!0,s.push(e))}}return t}(c);for(const d in u)u[d].forEach((t=>{const r=t.feature,n=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function H(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 q(e,r,n){return t._(this,void 0,void 0,(function*(){let i=e;if(e.url?i=(yield t.h(r.transformRequest(e.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;const s=t.M(t.e(i,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(s.vectorLayerIds=i.vector_layers.map((e=>e.id))),s}))}class Z{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 t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}extend(e){const r=this._sw,n=this._ne;let i,a;if(e instanceof t.N)i=e,a=e;else{if(!(e instanceof Z))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Z.convert(e)):this.extend(t.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(t.N.convert(e)):this;if(i=e._sw,a=e._ne,!i||!a)return this}return r||n?(r.lng=Math.min(i.lng,r.lng),r.lat=Math.min(i.lat,r.lat),n.lng=Math.max(a.lng,n.lng),n.lat=Math.max(a.lat,n.lat)):(this._sw=new t.N(i.lng,i.lat),this._ne=new t.N(a.lng,a.lat)),this}getCenter(){return new t.N((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 t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(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:r,lat:n}=t.N.convert(e);let i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(e){return e instanceof Z?e:e?new Z(e):e}static fromLngLat(e){const r=360*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)/40075017,n=r/Math.cos(Math.PI/180*e.lat);return new Z(new t.N(e.lng-n,e.lat-r),new t.N(e.lng+n,e.lat+r))}adjustAntiMeridian(){const e=new t.N(this._sw.lng,this._sw.lat),r=new t.N(this._ne.lng,this._ne.lat);return new Z(e,e.lng>r.lng?new t.N(r.lng+360,r.lat):r)}}class G{constructor(e,t,r){this.bounds=Z.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const r=Math.pow(2,e.z),n=Math.floor(t.O(this.bounds.getWest())*r),i=Math.floor(t.Q(this.bounds.getNorth())*r),a=Math.ceil(t.O(this.bounds.getEast())*r),s=Math.ceil(t.Q(this.bounds.getSouth())*r);return e.x>=n&&e.x<a&&e.y>=i&&e.y<s}}class W extends t.E{constructor(e,r,n,i){if(super(),this.id=e,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,t.e(this,t.M(r,["url","scheme","tileSize","promoteId"])),this._options=t.e({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)}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield q(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(t.e(this,e),e.bounds&&(this.tileBounds=new G(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new t.j(e))}}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(t,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(e.actor&&"expired"!==e.state){if("loading"===e.state)return new Promise(((t,r)=>{e.reloadPromise={resolve:t,reject:r}}))}else e.actor=this.dispatcher.getActor(),n="LT";e.abortController=new AbortController;try{const t=yield e.actor.sendAsync({type:n,data:r},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t)}catch(t){if(delete e.abortController,e.aborted)return;if(t&&404!==t.status)throw t;this._afterTileLoadWorkerResponse(e,null)}}))}_afterTileLoadWorkerResponse(e,t){if(t&&t.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.loadVectorData(t,this.map.painter),e.reloadPromise){const t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class X extends t.E{constructor(e,r,n,i){super(),this.id=e,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=t.e({type:"raster"},r),t.e(this,t.M(r,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield q(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(t.e(this,e),e.bounds&&(this.tileBounds=new G(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new t.j(e))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return t.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const r=yield p.getImage(this.map._requestManager.transformRequest(t,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const t=this.map.painter.context,n=t.gl,i=r.data;e.texture=this.map.painter.getTileTexture(i.width),e.texture?e.texture.update(i,{useMipmap:!0}):(e.texture=new b(t,i,n.RGBA,{useMipmap:!0}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class J extends X{constructor(e,r,n,i){super(e,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const r=yield p.getImage(n,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){const n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=t.b(n)&&t.U()?n:yield this.readImageNow(n),a={type:this.type,uid:e.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||"expired"===e.state){e.actor=this.dispatcher.getActor();const t=yield e.actor.sendAsync({type:"LDT",data:a});e.dem=t,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}}))}readImageNow(e){return t._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&t.V()){const r=e.width+2,n=e.height+2;try{return new t.R({width:r,height:n},yield t.W(e,-1,-1,r,n))}catch(e){}}return a.getImageData(e,1)}))}_getNeighboringTiles(e){const r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,s=(r.x+1+n)%n,o=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.S(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.S(e.overscaledZ,o,r.z,s,r.y).key]={backfilled:!1},r.y>0&&(l[new t.S(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,o,r.z,s,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.S(e.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new t.S(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.S(e.overscaledZ,o,r.z,s,r.y+1).key]={backfilled:!1}),l}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))}))}}class K extends t.E{constructor(e,r,n,i){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=t.e({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;const a=t.X/this.tileSize;void 0!==r.clusterMaxZoom&&this.maxzoom<=r.clusterMaxZoom&&t.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=t.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.X,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:t.X,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return t._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}getData(){return t._(this,void 0,void 0,(function*(){const e=t.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})}))}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(void 0!==e.clusterRadius&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),void 0!==e.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,t,r){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:r}})}_updateWorkerData(e){return t._(this,void 0,void 0,(function*(){const r=t.e({type:this.type},this.workerOptions);e?r.dataDiff=e:"string"==typeof this._data?(r.request=this.map._requestManager.transformRequest(a.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new t.k("dataloading",{dataType:"source"}));try{const e=yield this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||e.abandoned)return void this.fire(new t.k("dataabort",{dataType:"source"}));let n=null;e.resourceTiming&&e.resourceTiming[this.id]&&(n=e.resourceTiming[this.id].slice(0));const i={dataType:"source"};this._collectResourceTiming&&n&&n.length>0&&t.e(i,{resourceTiming:n}),this.fire(new t.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(e){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(e))}}))}loaded(){return 0===this._pendingLoads}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.actor?"RT":"LT";e.actor=this.actor;const r={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const n=yield this.actor.sendAsync({type:t,data:r},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(n,this.map.painter,"RT"===t)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Y=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Q extends t.E{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.setEventedParent(n),this.options=t}load(e){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const t=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,t&&t.data&&(this.image=t.data,e&&(this.coordinates=e),this._finishLoading())}catch(e){this._request=null,this._loaded=!0,this.fire(new t.j(e))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const r=e.map(t.Z.fromLngLat);this.tileID=function(e){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(const t of e)r=Math.min(r,t.x),n=Math.min(n,t.y),i=Math.max(i,t.x),a=Math.max(a,t.y);const s=Math.max(i-r,a-n),o=Math.max(0,Math.floor(-Math.log(s)/Math.LN2)),l=Math.pow(2,o);return new t.a1(o,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;const n=r.map((e=>this.tileID.getTilePoint(e)._round()));return this._boundsArray=new t.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new b(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return t._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ee extends Q{constructor(e,t,r,n){super(e,t,r,n),this.roundZoom=!0,this.type="video",this.options=t}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const t of e.urls)this.urls.push(this.map._requestManager.transformRequest(t,"Source").url);try{const e=yield t.a3(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new t.j(e))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.j(new t.a2(`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=e}}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 e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),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 b(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class te extends Q{constructor(e,r,n,i){super(e,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 t.j(new t.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.j(new t.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${e}`,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 t.j(new t.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return t._(this,void 0,void 0,(function*(){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 t.j(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(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new b(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,i=!0)}i&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}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}}const re={},ne=e=>{switch(e){case"geojson":return K;case"image":return Q;case"raster":return X;case"raster-dem":return J;case"vector":return W;case"video":return ee;case"canvas":return te}return re[e]},ie="RTLPluginLoaded";class ae extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=V()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((e=>{throw this.status="error",e}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return t._(this,arguments,void 0,(function(e){var t=this;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){if(t.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(t.url=a.resolveURL(e),!t.url)throw new Error(`requested url ${e}
2 is invalid`);if("unavailable"===t.status){if(!r)return t._requestImport();t.status="deferred",t._syncState(t.status)}else if("requested"===t.status)return t._requestImport()}()}))}_requestImport(){return t._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(ie))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let se=null;function oe(){return se||(se=new ae),se}class le{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=t.a4(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const t=e+this.timeAdded;t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(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.id]=n}}return r}(e.buckets,r.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const r=this.buckets[e];if(r instanceof t.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const r=this.buckets[e];if(r instanceof t.a6&&r.hasRTLText){this.hasRTLText=!0,oe().lazyLoad();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(e).queryRadius(t))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const r in this.buckets){const t=this.buckets[r];t.uploadPending()&&t.upload(e)}const t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new b(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new b(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,n,i,a,s,o,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:o,params:s,queryPadding:this.queryPadding*l},e,t,r):{}}querySourceFeatures(e,r){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",s=i._geojsonTileLayer||i[a];if(!s)return;
vendor: 71,896 bytes, line 2
2const o=t.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,d={z:l,x:c,y:u};for(let h=0;h<s.length;h++){const r=s.feature(h);if(o.needGeometry){const e=t.a8(r,!0);if(!o.filter(new t.z(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!o.filter(new t.z(this.tileID.overscaledZ),r))continue;const i=n.getId(r,a),p=new t.a9(r,l,c,u,i);p.tile=d,e.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const r=this.expirationTime;if(e.cacheControl){const r=t.aa(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.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)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length)return;const r=this.latestFeatureIndex.loadVTLayers();for(const n in this.buckets){if(!t.style.hasLayer(n))continue;const i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",s=r[a],o=e[a];if(!s||!o||0===Object.keys(o).length)continue;i.update(o,s,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=t&&t.style&&t.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=a.now()+e}setDependencies(e,t){const r={};for(const n of t)r[n]=!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}}class ce{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}get(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 r of t)this.remove(r.value.tileID,r)}}class ue{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,n){const i=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},t.e(this.stateChanges[e][i],n),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==i&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][i]){this.deletedStates[e][i]={};for(const t in this.state[e][i])n[t]||(this.deletedStates[e][i][t]=null)}else for(const t in n)this.deletedStates[e]&&this.deletedStates[e][i]&&null===this.deletedStates[e][i][t]&&delete this.deletedStates[e][i][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,r){const n=String(r),i=t.e({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const t=this.deletedStates[e][r];if(null===t)return{};for(const e in t)delete i[e]}return i}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,r){const n={};for(const i in this.stateChanges){this.state[i]=this.state[i]||{};const e={};for(const r in this.stateChanges[i])this.state[i][r]||(this.state[i][r]={}),t.e(this.state[i][r],this.stateChanges[i][r]),e[r]=this.state[i][r];n[i]=e}for(const i in this.deletedStates){this.state[i]=this.state[i]||{};const e={};if(null===this.deletedStates[i])for(const t in this.state[i])e[t]={},this.state[i][t]={};else for(const t in this.deletedStates[i]){if(null===this.deletedStates[i][t])this.state[i][t]={};else for(const e of Object.keys(this.deletedStates[i][t]))delete this.state[i][t][e];e[t]=this.state[i][t]}n[i]=n[i]||{},t.e(n[i],e)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const t in e)e[t].setFeatureState(n,r)}}class de extends t.E{constructor(e,t,r){super(),this.id=e,this.dispatcher=r,this.on("data",(e=>this._dataHandler(e))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((e,t,r,n)=>{const i=new(ne(t.type))(e,t,r,n);if(i.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${i.id}`);return i})(e,t,r,this),this._tiles={},this._cache=new ce(0,(e=>this._unloadTile(e))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ue,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)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,this.terrain)}_loadTile(e,r,n){return t._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,r,n)}catch(r){e.state="errored",404!==r.status?this._source.fire(new t.j(r,{tile:e})):this.update(this.transform,this.terrain)}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new t.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}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),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(he).map((e=>e.key))}getRenderableIds(e){const r=[];for(const t in this._tiles)this._isIdRenderable(t,e)&&r.push(this._tiles[t]);return e?r.sort(((e,r)=>{const n=e.tileID,i=r.tileID,a=new t.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),s=new t.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||s.y-a.y||s.x-a.x})).map((e=>e.tileID.key)):r.map((e=>e.tileID)).sort(he).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}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,r){return t._(this,void 0,void 0,(function*(){const t=this._tiles[e];t&&("loading"!==t.state&&(t.state=r),yield this._loadTile(t,e,r))}))}_tileLoaded(e,r,n){e.timeAdded=a.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_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){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!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),a=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[a]&&(e.neighboringTiles[a].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 a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)continue;let s=a.tileID;for(;a&&a.tileID.overscaledZ>t+1;){const e=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[e.key],a&&a.hasData()&&(s=e)}let o=s;for(;o.overscaledZ>t;)if(o=o.scaledTo(o.overscaledZ-1),e[o.key]){n[s.key]=s;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}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const r=Math.ceil(e.width/this._source.tileSize)+1,n=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;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 t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(e,t,r,n,i,s){const o={},l={},c=Object.keys(e),u=a.now();for(const a of c){const r=e[a],n=this._tiles[a];if(!n||0!==n.fadeEndTime&&n.fadeEndTime<=u)continue;const i=this.findLoadedParent(r,t),s=this.findLoadedSibling(r),c=i||s||null;c&&(this._addTile(c.tileID),o[c.tileID.key]=c.tileID),l[a]=r}this._retainLoadedChildren(l,n,r,e);for(const a in o)e[a]||(this._coveredTiles[a]=!0,e[a]=o[a]);if(s){const t={},r={};for(const e of i)this._tiles[e.key].hasData()?t[e.key]=e:r[e.key]=e;for(const n in r){const i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(t[i[0].key]=e[i[0].key]=i[0],t[i[1].key]=e[i[1].key]=i[1],t[i[2].key]=e[i[2].key]=i[2],t[i[3].key]=e[i[3].key]=i[3],delete r[n])}for(const n in r){const i=r[n],a=this.findLoadedParent(i,this._source.minzoom),s=this.findLoadedSibling(i),o=a||s||null;if(o){t[o.tileID.key]=e[o.tileID.key]=o.tileID;for(const e in t)t[e].isChildOf(o.tileID)&&delete t[e]}}for(const e in this._tiles)t[e]||(this._coveredTiles[e]=!0)}}update(e,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new t.S(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(n=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(n=n.filter((e=>this._source.hasTile(e))))):n=[];const i=e.coveringZoomLevel(this._source),a=Math.max(i-de.maxOverzooming,this._source.minzoom),s=Math.max(i+de.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const e={};for(const t of n)if(t.canonical.z>this._source.minzoom){const r=t.scaledTo(t.canonical.z-1);e[r.key]=r;const n=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));e[n.key]=n}n=n.concat(Object.values(e))}const o=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,o&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(n,i);pe(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,s,i,n,r);for(const t in l)this._tiles[t].clearFadeHold();const c=t.ab(this._tiles,l);for(const t of c){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){var r;const n={},i={},a=Math.max(t-de.maxOverzooming,this._source.minzoom),s=Math.max(t+de.maxUnderzooming,this._source.minzoom),o={};for(const l of e){const e=this._addTile(l);n[l.key]=l,e.hasData()||t<this._source.maxzoom&&(o[l.key]=l)}this._retainLoadedChildren(o,t,s,n);for(const l of e){let e=this._tiles[l.key];if(e.hasData())continue;if(t+1>this._source.maxzoom){const e=l.children(this._source.maxzoom)[0],t=this.getTile(e);if(t&&t.hasData()){n[e.key]=e;continue}}else{const e=l.children(this._source.maxzoom);if(n[e[0].key]&&n[e[1].key]&&n[e[2].key]&&n[e[3].key])continue}let s=e.wasRequested();for(let t=l.overscaledZ-1;t>=a;--t){const a=l.scaledTo(t);if(i[a.key])break;if(i[a.key]=!0,e=this.getTile(a),!e&&s&&(e=this._addTile(a)),e){const t=e.hasData();if((t||!(null===(r=this.map)||void 0===r?void 0:r.cancelPendingTileRequestsWhileZooming)||s)&&(n[a.key]=a),s=e.wasRequested(),t)break}}}return n}_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}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const t=this._tiles[e].tileID,r=this._getLoadedTile(t);this._loadedSiblingTiles[t.key]=r}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));const n=r;return r||(r=new le(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.k("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?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){const t=e.sourceDataType;"source"===e.dataType&&"metadata"===t&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===t&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,n){const i=[],a=this.transform;if(!a)return i;const s=n?a.getCameraQueryGeometry(e):e,o=e.map((e=>a.pointCoordinate(e,this.terrain))),l=s.map((e=>a.pointCoordinate(e,this.terrain))),c=this.getIds();let u=1/0,d=1/0,h=-1/0,p=-1/0;for(const t of l)u=Math.min(u,t.x),d=Math.min(d,t.y),h=Math.max(h,t.x),p=Math.max(p,t.y);for(let m=0;m<c.length;m++){const e=this._tiles[c[m]];if(e.holdingForFade())continue;const n=e.tileID,s=Math.pow(2,a.zoom-e.tileID.overscaledZ),f=r*e.queryPadding*t.X/e.tileSize/s,g=[n.getTilePoint(new t.Z(u,d)),n.getTilePoint(new t.Z(h,p))];if(g[0].x-f<t.X&&g[0].y-f<t.X&&g[1].x+f>=0&&g[1].y+f>=0){const t=o.map((e=>n.getTilePoint(e))),r=l.map((e=>n.getTilePoint(e)));i.push({tile:e,tileID:n,queryGeometry:t,cameraQueryGeometry:r,scale:s})}}return i}getVisibleCoordinates(e){const t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const r of t)r.posMatrix=this.transform.calculatePosMatrix(r.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(pe(this._source.type)){const e=a.now();for(const t in this._tiles)if(this._tiles[t].fadeEndTime>=e)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)}setDependencies(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)))}}function he(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 pe(e){return"raster"===e||"image"===e||"video"===e}de.maxOverzooming=10,de.maxUnderzooming=3;class me{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-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(e){if(1===this.points.length)return this.points[0];e=t.ac(e,0,1);let r=1,n=this._distances[r];const i=e*this.paddedLength+this.padding;for(;n<i&&r<this._distances.length;)n=this._distances[++r];const a=r-1,s=this._distances[a],o=n-s,l=o>0?(i-s)/o:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function fe(e,t){let r=!0;return"always"===e||"never"!==e&&"never"!==t||(r=!1),r}class ge{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 a=0;a<this.xCellCount*this.yCellCount;a++)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,a){this.boxCells[i].push(a)}_insertCircleCell(e,t,r,n,i,a){this.circleCells[i].push(a)}_query(e,t,r,n,i,a,s){if(r<0||e>this.width||n<0||t>this.height)return[];const o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:e,y1:t,x2:r,y2:n}];for(let e=0;e<this.boxKeys.length;e++)o.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];o.push({key:this.circleKeys[e],x1:t-n,y1:r-n,x2:t+n,y2:r+n})}}else this._forEachCell(e,t,r,n,this._queryCell,o,{hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}},s);return o}query(e,t,r,n){return this._query(e,t,r,n,!1,null)}hitTest(e,t,r,n,i,a){return this._query(e,t,r,n,!0,i,a).length>0}hitTestCircle(e,t,r,n,i){const a=e-r,s=e+r,o=t-r,l=t+r;if(s<0||a>this.width||l<0||o>this.height)return!1;const c=[];return this._forEachCell(a,o,s,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(e,t,r,n,i,a,s,o){const{seenUids:l,hitTest:c,overlapMode:u}=s,d=this.boxCells[i];if(null!==d){const i=this.bboxes;for(const s of d)if(!l.box[s]){l.box[s]=!0;const d=4*s,h=this.boxKeys[s];if(e<=i[d+2]&&t<=i[d+3]&&r>=i[d+0]&&n>=i[d+1]&&(!o||o(h))&&(!c||!fe(u,h.overlapMode))&&(a.push({key:h,x1:i[d],y1:i[d+1],x2:i[d+2],y2:i[d+3]}),c))return!0}}const h=this.circleCells[i];if(null!==h){const i=this.circles;for(const s of h)if(!l.circle[s]){l.circle[s]=!0;const d=3*s,h=this.circleKeys[s];if(this._circleAndRectCollide(i[d],i[d+1],i[d+2],e,t,r,n)&&(!o||o(h))&&(!c||!fe(u,h.overlapMode))){const e=i[d],t=i[d+1],r=i[d+2];if(a.push({key:h,x1:e-r,y1:t-r,x2:e+r,y2:t+r}),c)return!0}}}return!1}_queryCellCircle(e,t,r,n,i,a,s,o){const{circle:l,seenUids:c,overlapMode:u}=s,d=this.boxCells[i];if(null!==d){const e=this.bboxes;for(const t of d)if(!c.box[t]){c.box[t]=!0;const r=4*t,n=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!o||o(n))&&!fe(u,n.overlapMode))return a.push(!0),!0}}const h=this.circleCells[i];if(null!==h){const e=this.circles;for(const t of h)if(!c.circle[t]){c.circle[t]=!0;const r=3*t,n=this.circleKeys[t];if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!o||o(n))&&!fe(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,r,n,i,a,s,o){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,a,s,o))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,a){const s=n-e,o=i-t,l=r+a;return l*l>s*s+o*o}_circleAndRectCollide(e,t,r,n,i,a,s){const o=(a-n)/2,l=Math.abs(e-(n+o));if(l>o+r)return!1;const c=(s-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=o||u<=c)return!0;const d=l-o,h=u-c;return d*d+h*h<=r*r}}function _e(e,r,n,i,a){const s=t.H();return r?(t.K(s,s,[1/a,1/a,1]),n||t.ad(s,s,i.angle)):t.L(s,i.labelPlaneMatrix,e),s}function ye(e,r,n,i,a){if(r){const r=t.ae(e);return t.K(r,r,[a,a,1]),n||t.ad(r,r,-i.angle),r}return i.glCoordMatrix}function ve(e,r,n,i){let a;i?(a=[e,r,i(e,r),1],t.af(a,a,n)):(a=[e,r,0,1],Le(a,a,n));const s=a[3];return{point:new t.P(a[0]/s,a[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}function xe(e,t){return.5+e/t*.5}function be(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function we(e,r,n,i,a,s,o,l,c,u,d,h,p,m,f){const g=i?e.textSizeData:e.iconSizeData,_=t.ag(g,n.transform.zoom),y=[256/n.width*2+1,256/n.height*2+1],v=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;v.clear();const x=e.lineVertexArray,b=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,w=n.transform.width/n.transform.height;let C=!1;for(let S=0;S<b.length;S++){const i=b.get(S);if(i.hidden||i.writingMode===t.ah.vertical&&!C){Ae(i.numGlyphs,v);continue}C=!1;const k=ve(i.anchorX,i.anchorY,r,f);if(!be(k.point,y)){Ae(i.numGlyphs,v);continue}const j=xe(n.transform.cameraToCenterDistance,k.signedDistanceFromCamera),E=t.ai(g,_,i),T=o?E/j:E*j,P={getElevation:f,labelPlaneMatrix:a,lineVertexArray:x,pitchWithMap:o,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new t.P(i.anchorX,i.anchorY),unwrappedTileID:d,width:h,height:p,translation:m},I=ke(P,i,T,!1,l,r,s,e.glyphOffsetArray,v,w,c);C=I.useVertical,(I.notEnoughRoom||C||I.needsFlipping&&ke(P,i,T,!0,l,r,s,e.glyphOffsetArray,v,w,c).notEnoughRoom)&&Ae(i.numGlyphs,v)}i?e.text.dynamicLayoutVertexBuffer.updateData(v):e.icon.dynamicLayoutVertexBuffer.updateData(v)}function Ce(e,t,r,n,i,a,s,o){const l=a.glyphStartIndex+a.numGlyphs,c=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,d=t.getoffsetX(a.glyphStartIndex),h=t.getoffsetX(l-1),p=Me(e*d,r,n,i,a.segment,c,u,o,s);if(!p)return null;const m=Me(e*h,r,n,i,a.segment,c,u,o,s);return m?o.projectionCache.anyProjectionOccluded?null:{first:p,last:m}:null}function Se(e,r,n,i){return e===t.ah.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.ah.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function ke(e,r,n,i,a,s,o,l,c,u,d){const h=n/24,p=r.lineOffsetX*h,m=r.lineOffsetY*h;let f;if(r.numGlyphs>1){const t=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,s=r.lineStartIndex+r.lineLength,c=Ce(h,l,p,m,i,r,d,e);if(!c)return{notEnoughRoom:!0};const g=ve(c.first.point.x,c.first.point.y,o,e.getElevation).point,_=ve(c.last.point.x,c.last.point.y,o,e.getElevation).point;if(a&&!i){const e=Se(r.writingMode,g,_,u);if(e)return e}f=[c.first];for(let a=r.glyphStartIndex+1;a<t-1;a++)f.push(Me(h*l.getoffsetX(a),p,m,i,r.segment,n,s,e,d));f.push(c.last)}else{if(a&&!i){const n=ve(e.tileAnchorPoint.x,e.tileAnchorPoint.y,s,e.getElevation).point,i=r.lineStartIndex+r.segment+1,a=new t.P(e.lineVertexArray.getx(i),e.lineVertexArray.gety(i)),o=ve(a.x,a.y,s,e.getElevation),l=o.signedDistanceFromCamera>0?o.point:function(e,t,r,n,i,a){return je(e,t,r,1,i,a)}(e.tileAnchorPoint,a,n,0,s,e),c=Se(r.writingMode,n,l,u);if(c)return c}const n=Me(h*l.getoffsetX(r.glyphStartIndex),p,m,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,e,d);if(!n||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};f=[n]}for(const g of f)t.aj(c,g.point,g.angle);return{}}function je(e,t,r,n,i,a){const s=e.add(e.sub(t)._unit()),o=void 0!==i?ve(s.x,s.y,i,a.getElevation).point:Te(s.x,s.y,a).point,l=r.sub(o);return r.add(l._mult(n/l.mag()))}function Ee(e,r,n){const i=r.projectionCache;if(i.projections[e])return i.projections[e];const a=new t.P(r.lineVertexArray.getx(e),r.lineVertexArray.gety(e)),s=Te(a.x,a.y,r);if(s.signedDistanceFromCamera>0)return i.projections[e]=s.point,i.anyProjectionOccluded=i.anyProjectionOccluded||s.isOccluded,s.point;const o=e-n.direction;return function(e,t,r,n,i){return je(e,t,r,n,void 0,i)}(0===n.distanceFromAnchor?r.tileAnchorPoint:new t.P(r.lineVertexArray.getx(o),r.lineVertexArray.gety(o)),a,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,r)}function Te(e,t,r){const n=e+r.translation[0],i=t+r.translation[1];let a;return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(a=r.projection.projectTileCoordinates(n,i,r.unwrappedTileID,r.getElevation),a.point.x=(.5*a.point.x+.5)*r.width,a.point.y=(.5*-a.point.y+.5)*r.height):(a=ve(n,i,r.labelPlaneMatrix,r.getElevation),a.isOccluded=!1),a}function Pe(e,t,r){return e._unit()._perp()._mult(t*r)}function Ie(e,r,n,i,a,s,o,l,c){if(l.projectionCache.offsets[e])return l.projectionCache.offsets[e];const u=n.add(r);if(e+c.direction<i||e+c.direction>=a)return l.projectionCache.offsets[e]=u,u;const d=Ee(e+c.direction,l,c),h=Pe(d.sub(n),o,c.direction),p=n.add(h),m=d.add(h);return l.projectionCache.offsets[e]=t.ak(s,u,p,m)||u,l.projectionCache.offsets[e]}function Me(e,t,r,n,i,a,s,o,l){const c=n?e-t:e+t;let u=c>0?1:-1,d=0;n&&(u*=-1,d=Math.PI),u<0&&(d+=Math.PI);let h,p=u>0?a+i:a+i+1;o.projectionCache.cachedAnchorPoint?h=o.projectionCache.cachedAnchorPoint:(h=Te(o.tileAnchorPoint.x,o.tileAnchorPoint.y,o).point,o.projectionCache.cachedAnchorPoint=h);let m,f,g=h,_=h,y=0,v=0;const x=Math.abs(c),b=[];let w;for(;y+v<=x;){if(p+=u,p<a||p>=s)return null;y+=v,_=g,f=m;const e={absOffsetX:x,direction:u,distanceFromAnchor:y,previousVertex:_};if(g=Ee(p,o,e),0===r)b.push(_),w=g.sub(_);else{let t;const n=g.sub(_);t=0===n.mag()?Pe(Ee(p+u,o,e).sub(g),r,u):Pe(n,r,u),f||(f=_.add(t)),m=Ie(p,t,g,a,s,f,r,o,e),b.push(f),w=m.sub(f)}v=w.mag()}const C=w._mult((x-y)/v)._add(f||_),S=d+Math.atan2(g.y-_.y,g.x-_.x);return b.push(C),{point:C,angle:l?S:0,path:b}}const Ne=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ae(e,t){for(let r=0;r<e;r++){const e=t.length;t.resize(e+4),t.float32.set(Ne,3*e)}}function Le(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 De=100;class ze{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ge(e.width+200,e.height+200,25),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ge(e.width+200,e.height+200,25);this.transform=e,this.mapProjection=t,this.grid=r,this.ignoredGrid=n,this.pitchFactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+De,this.screenBottomBoundary=e.height+De,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,n,i,a,s,o,l,c,u){const d=e.anchorPointX+o[0],h=e.anchorPointY+o[1],p=this.projectAndGetPerspectiveRatio(n,d,h,i,c),m=r*p.perspectiveRatio;let f;if(a||s)f=this._projectCollisionBox(e,m,n,i,a,s,o,p,c,u);else{const t=p.point.x+(u?u.x*m:0),r=p.point.y+(u?u.y*m:0);f={allPointsOccluded:!1,box:[t+e.x1*m,r+e.y1*m,t+e.x2*m,r+e.y2*m]}}const[g,_,y,v]=f.box;return this.mapProjection.useSpecialProjectionForSymbols&&(a?f.allPointsOccluded:this.mapProjection.isOccluded(d,h,i))||p.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(g,_,y,v)||"always"!==t&&this.grid.hitTest(g,_,y,v,t,l)?{box:[g,_,y,v],placeable:!1,offscreen:!1}:{box:[g,_,y,v],placeable:!0,offscreen:this.isOffscreen(g,_,y,v)}}placeCollisionCircles(e,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g){const _=[],y=new t.P(r.anchorX,r.anchorY),v=this.getPerspectiveRatio(s,y.x,y.y,o,g),x=(d?a/v:a*v)/t.ap,b={getElevation:g,labelPlaneMatrix:l,lineVertexArray:n,pitchWithMap:d,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:y,unwrappedTileID:o,width:this.transform.width,height:this.transform.height,translation:f},w=Ce(x,i,r.lineOffsetX*x,r.lineOffsetY*x,!1,r,!1,b);let C=!1,S=!1,k=!0;if(w){const r=.5*p*v+m,n=new t.P(-100,-100),i=new t.P(this.screenRightBoundary,this.screenBottomBoundary),a=new me,s=w.first,o=w.last;let l=[];for(let e=s.path.length-1;e>=1;e--)l.push(s.path[e]);for(let e=1;e<o.path.length;e++)l.push(o.path[e]);const d=2.5*r;if(c){const e=this.projectPathToScreenSpace(l,b,c);l=e.some((e=>e.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let f=[];if(l.length>0){const e=l[0].clone(),r=l[0].clone();for(let t=1;t<l.length;t++)e.x=Math.min(e.x,l[t].x),e.y=Math.min(e.y,l[t].y),r.x=Math.max(r.x,l[t].x),r.y=Math.max(r.y,l[t].y);f=e.x>=n.x&&r.x<=i.x&&e.y>=n.y&&r.y<=i.y?[l]:r.x<n.x||e.x>i.x||r.y<n.y||e.y>i.y?[]:t.al([l],n.x,n.y,i.x,i.y)}for(const t of f){a.reset(t,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/d)+1;for(let t=0;t<n;t++){const i=t/Math.max(n-1,1),s=a.lerp(i),o=s.x+De,l=s.y+De;_.push(o,l,r,0);const c=o-r,d=l-r,p=o+r,m=l+r;if(k=k&&this.isOffscreen(c,d,p,m),S=S||this.isInsideGrid(c,d,p,m),"always"!==e&&this.grid.hitTestCircle(o,l,r,e,h)&&(C=!0,!u))return{circles:[],offscreen:!1,collisionDetected:C}}}}return{circles:!u&&C||!S||v<this.perspectiveRatioCutoff?[]:_,offscreen:k,collisionDetected:C}}projectPathToScreenSpace(e,t,r){return e.map((e=>ve(e.x,e.y,r,t.getElevation)))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,a=-1/0,s=-1/0;for(const u of e){const e=new t.P(u.x+De,u.y+De);n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),s=Math.max(s,e.y),r.push(e)}const o=this.grid.query(n,i,a,s).concat(this.ignoredGrid.query(n,i,a,s)),l={},c={};for(const u of o){const e=u.key;if(void 0===l[e.bucketInstanceId]&&(l[e.bucketInstanceId]={}),l[e.bucketInstanceId][e.featureIndex])continue;const n=[new t.P(u.x1,u.y1),new t.P(u.x2,u.y1),new t.P(u.x2,u.y2),new t.P(u.x1,u.y2)];t.am(r,n)&&(l[e.bucketInstanceId][e.featureIndex]=!0,void 0===c[e.bucketInstanceId]&&(c[e.bucketInstanceId]=[]),c[e.bucketInstanceId].push(e.featureIndex))}return c}insertCollisionBox(e,t,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,n,i,a){const s=r?this.ignoredGrid:this.grid,o={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:t};for(let l=0;l<e.length;l+=4)s.insertCircle(o,e[l],e[l+1],e[l+2])}projectAndGetPerspectiveRatio(e,r,n,i,a){let s;a?(s=[r,n,a(r,n),1],t.af(s,s,e)):(s=[r,n,0,1],Le(s,s,e));const o=s[3];return{point:new t.P((s[0]/o+1)/2*this.transform.width+De,(-s[1]/o+1)/2*this.transform.height+De),perspectiveRatio:.5+this.transform.cameraToCenterDistance/o*.5,isOccluded:!1,signedDistanceFromCamera:o}}getPerspectiveRatio(e,t,r,n,i){const a=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(t,r,n,i):ve(t,r,e,i);return.5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5}isOffscreen(e,t,r,n){return r<De||e>=this.screenRightBoundary||n<De||t>this.screenBottomBoundary}isInsideGrid(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const e=t.an([]);return t.J(e,e,[-100,-100,0]),e}_projectCollisionBox(e,r,n,i,a,s,o,l,c,u){let d=new t.P(1,0),h=new t.P(0,1);const p=new t.P(e.anchorPointX+o[0],e.anchorPointY+o[1]);if(s&&!a){const e=this.projectAndGetPerspectiveRatio(n,p.x+1,p.y,i,c).point.sub(l.point).unit(),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0),a=Math.sin(r),s=Math.cos(r);d=new t.P(s,a),h=new t.P(-a,s)}else if(!s&&a){const e=-this.transform.angle,r=Math.sin(e),n=Math.cos(e);d=new t.P(n,r),h=new t.P(-r,n)}let m=l.point,f=r;if(a){m=p;const e=this.transform.zoom-Math.floor(this.transform.zoom);f=Math.pow(2,-e),f*=this.mapProjection.getPitchedTextCorrection(this.transform,p,i),u||(f*=t.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}u&&(m=m.add(d.mult(u.x*f)).add(h.mult(u.y*f)));const g=e.x1*f,_=e.x2*f,y=(g+_)/2,v=e.y1*f,x=e.y2*f,b=(v+x)/2,w=[{offsetX:g,offsetY:v},{offsetX:y,offsetY:v},{offsetX:_,offsetY:v},{offsetX:_,offsetY:b},{offsetX:_,offsetY:x},{offsetX:y,offsetY:x},{offsetX:g,offsetY:x},{offsetX:g,offsetY:b}];let C=[];for(const{offsetX:k,offsetY:j}of w)C.push(new t.P(m.x+d.x*k+h.x*j,m.y+d.y*k+h.y*j));let S=!1;if(a){const e=C.map((e=>this.projectAndGetPerspectiveRatio(n,e.x,e.y,i,c)));S=e.some((e=>!e.isOccluded)),C=e.map((e=>e.point))}else S=!0;return{box:t.ao(C),allPointsOccluded:!S}}}function Oe(e,r,n){return r*(t.X/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}class Re{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 Fe{constructor(e,t,r,n,i){this.text=new Re(e?e.text:null,t,r,i),this.icon=new Re(e?e.icon:null,t,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Be{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}}class Ve{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class $e{constructor(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class Ue{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 He(e,r,n,i,a){const{horizontalAlign:s,verticalAlign:o}=t.au(e);return new t.P(-(s-.5)*r+i[0]*a,-(o-.5)*n+i[1]*a)}class qe{constructor(e,t,r,n,i,a){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new ze(this.transform,t),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Ue(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const t=this.terrain;return t?(r,n)=>t.getElevation(e,r,n):null}getBucketParts(e,r,n,i){const a=n.getBucket(r),s=n.latestFeatureIndex;if(!a||!s||r.id!==a.layerIds[0])return;const o=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),d=n.tileSize/t.X,h=n.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(h),m="map"===l.get("text-pitch-alignment"),f="map"===l.get("text-rotation-alignment"),g=Oe(n,1,this.transform.zoom),_=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),v=_e(p,m,f,this.transform,g);let x=null;if(m){const e=ye(p,m,f,this.transform,g);x=t.L([],this.transform.labelPlaneMatrix,e)}this.retainedQueryData[a.bucketInstanceId]=new $e(a.bucketInstanceId,s,a.sourceLayerIndex,a.index,n.tileID);const b={bucket:a,layout:l,translationText:_,translationIcon:y,posMatrix:p,unwrappedTileID:h,textLabelPlaneMatrix:v,labelToScreenMatrix:x,scale:u,textPixelRatio:d,holdingForFade:n.holdingForFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:t.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(const t of a.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=t;e.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:b})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:b})}attemptAnchorPlacement(e,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g,_,y,v){const x=t.aq[e.textAnchor],b=[e.textOffset0,e.textOffset1],w=He(x,n,i,b,a),C=this.collisionIndex.placeCollisionBox(r,h,l,c,u,o,s,g,d.predicate,v,w);if((!y||this.collisionIndex.placeCollisionBox(y,h,l,c,u,o,s,_,d.predicate,v,w).placeable)&&C.placeable){let e;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(e=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:b,width:n,height:i,anchor:x,textBoxScale:a,prevAnchor:e},this.markUsedJustification(m,x,p,f),m.allowVerticalPlacement&&(this.markUsedOrientation(m,f,p),this.placedOrientations[p.crossTileID]=f),{shift:w,placedGlyphBoxes:C}}}placeLayerBucketPart(e,r,n){const{bucket:i,layout:a,translationText:s,translationIcon:o,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:d,textPixelRatio:h,holdingForFade:p,collisionBoxArray:m,partiallyEvaluatedTextSize:f,collisionGroup:g}=e.parameters,_=a.get("text-optional"),y=a.get("icon-optional"),v=t.ar(a,"text-overlap","text-allow-overlap"),x="always"===v,b=t.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===b,C="map"===a.get("text-rotation-alignment"),S="map"===a.get("text-pitch-alignment"),k="none"!==a.get("icon-text-fit"),j="viewport-y"===a.get("symbol-z-order"),E=x&&(w||!i.hasIconData()||y),T=w&&(x||!i.hasTextData()||_);!i.collisionArrays&&m&&i.deserializeCollisionBoxes(m);const P=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),I=(e,m,w)=>{var j,I;if(r[e.crossTileID])return;if(p)return void(this.placements[e.crossTileID]=new Be(!1,!1,!1));let M=!1,N=!1,A=!0,L=null,D={box:null,placeable:!1,offscreen:null},z={box:null,placeable:!1,offscreen:null},O=null,R=null,F=null,B=0,V=0,$=0;m.textFeatureIndex?B=m.textFeatureIndex:e.useRuntimeCollisionCircles&&(B=e.featureIndex),m.verticalTextFeatureIndex&&(V=m.verticalTextFeatureIndex);const U=m.textBox;if(U){const r=r=>{let n=t.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){const t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,n=t,this.markUsedOrientation(i,n,e))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&m.verticalTextBox){for(const e of i.writingModes)if(e===t.ah.vertical?(D=n(),z=D):D=r(),D&&D.placeable)break}else D=r()},u=e.textAnchorOffsetStartIndex,d=e.textAnchorOffsetEndIndex;if(d===u){const n=(t,r)=>{const n=this.collisionIndex.placeCollisionBox(t,v,h,l,c,S,C,s,g.predicate,P);return n&&n.placeable&&(this.markUsedOrientation(i,r,e),this.placedOrientations[e.crossTileID]=r),n};a((()=>n(U,t.ah.horizontal)),(()=>{const r=m.verticalTextBox;return i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?n(r,t.ah.vertical):{box:null,offscreen:null}})),r(D&&D.placeable)}else{let p=t.aq[null===(I=null===(j=this.prevPlacement)||void 0===j?void 0:j.variableOffsets[e.crossTileID])||void 0===I?void 0:I.anchor];const f=(r,a,m)=>{const f=r.x2-r.x1,_=r.y2-r.y1,y=e.textBoxScale,x=k&&"never"===b?a:null;let w=null,j="never"===v?1:2,E="never";p&&j++;for(let t=0;t<j;t++){for(let t=u;t<d;t++){const n=i.textAnchorOffsets.get(t);if(p&&n.textAnchor!==p)continue;const a=this.attemptAnchorPlacement(n,r,f,_,y,C,S,h,l,c,g,E,e,i,m,s,o,x,P);if(a&&(w=a.placedGlyphBoxes,w&&w.placeable))return M=!0,L=a.shift,w}p?p=null:E=v}return n&&!w&&(w={box:this.collisionIndex.placeCollisionBox(U,"always",h,l,c,S,C,s,g.predicate,P,new t.P(0,0)).box,offscreen:!1,placeable:!1}),w};a((()=>f(U,m.iconBox,t.ah.horizontal)),(()=>{const r=m.verticalTextBox;return i.allowVerticalPlacement&&(!D||!D.placeable)&&e.numVerticalGlyphVertices>0&&r?f(r,m.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}})),D&&(M=D.placeable,A=D.offscreen);const _=r(D&&D.placeable);if(!M&&this.prevPlacement){const t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(i,t.anchor,e,_))}}}if(O=D,M=O&&O.placeable,A=O&&O.offscreen,e.useRuntimeCollisionCircles){const r=i.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),o=t.ai(i.textSizeData,f,r),h=a.get("text-padding");R=this.collisionIndex.placeCollisionCircles(v,r,i.lineVertexArray,i.glyphOffsetArray,o,l,c,u,d,n,S,g.predicate,e.collisionCircleDiameter,h,s,P),R.circles.length&&R.collisionDetected&&!n&&t.w("Collisions detected, but collision boxes are not shown"),M=x||R.circles.length>0&&!R.collisionDetected,A=A&&R.offscreen}if(m.iconFeatureIndex&&($=m.iconFeatureIndex),m.iconBox){const e=e=>this.collisionIndex.placeCollisionBox(e,b,h,l,c,S,C,o,g.predicate,P,k&&L?L:void 0);z&&z.placeable&&m.verticalIconBox?(F=e(m.verticalIconBox),N=F.placeable):(F=e(m.iconBox),N=F.placeable),A=A&&F.offscreen}const H=_||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,q=y||0===e.numIconVertices;H||q?q?H||(N=N&&M):M=N&&M:N=M=N&&M;const Z=N&&F.placeable;if(M&&O.placeable&&this.collisionIndex.insertCollisionBox(O.box,v,a.get("text-ignore-placement"),i.bucketInstanceId,z&&z.placeable&&V?V:B,g.ID),Z&&this.collisionIndex.insertCollisionBox(F.box,b,a.get("icon-ignore-placement"),i.bucketInstanceId,$,g.ID),R&&M&&this.collisionIndex.insertCollisionCircles(R.circles,v,a.get("text-ignore-placement"),i.bucketInstanceId,B,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,m,O,F,R),0===e.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[e.crossTileID]=new Be(M||E,N||T,A||i.justReloaded),r[e.crossTileID]=!0};if(j){if(0!==e.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const t=i.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const r=t[e];I(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)I(i.symbolInstances.get(t),i.collisionArrays[t],t);if(n&&i.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[i.bucketInstanceId];t.as(e.invProjMatrix,l),e.viewportMatrix=this.collisionIndex.getViewportMatrix()}i.justReloaded=!1}storeCollisionData(e,t,r,n,i,a){if(r.textBox||r.iconBox){let a,s;this.collisionBoxArrays.has(e)?a=this.collisionBoxArrays.get(e):(a=new Map,this.collisionBoxArrays.set(e,a)),a.has(t)?s=a.get(t):(s={text:null,icon:null},a.set(t,s)),r.textBox&&(s.text=n.box),r.iconBox&&(s.icon=i.box)}if(a){let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Ve);for(let e=0;e<a.circles.length;e+=4)t.circles.push(a.circles[e+0]),t.circles.push(a.circles[e+1]),t.circles.push(a.circles[e+2]),t.circles.push(a.collisionDetected?1:0)}}markUsedJustification(e,r,n,i){let a;a=i===t.ah.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[t.at(r)];const s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(const t of s)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:n.crossTileID)}markUsedOrientation(e,r,n){const i=r===t.ah.horizontal||r===t.ah.horizontalOnly?r:0,a=r===t.ah.vertical?r:0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const t of s)e.text.placedSymbolArray.get(t).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}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:{},a=t?t.variableOffsets:{},s=t?t.placedOrientations:{};for(const o in this.placements){const e=this.placements[o],t=i[o];t?(this.opacities[o]=new Fe(t,n,e.text,e.icon),r=r||e.text!==t.text.placed||e.icon!==t.icon.placed):(this.opacities[o]=new Fe(null,n,e.text,e.icon,e.skipFade),r=r||e.text||e.icon)}for(const o in i){const e=i[o];if(!this.opacities[o]){const t=new Fe(e,n,!1,!1);t.isHidden()||(this.opacities[o]=t,r=r||e.text.placed||e.icon.placed)}}for(const o in a)this.variableOffsets[o]||!this.opacities[o]||this.opacities[o].isHidden()||(this.variableOffsets[o]=a[o]);for(const o in s)this.placedOrientations[o]||!this.opacities[o]||this.opacities[o].isHidden()||(this.placedOrientations[o]=s[o]);if(t&&void 0===t.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const r={};for(const n of t){const t=n.getBucket(e);t&&n.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(e,r,n,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const a=e.layers[0],s=a.layout,o=new Fe(null,0,!1,!1,!0),l=s.get("text-allow-overlap"),c=s.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),d="map"===s.get("text-rotation-alignment"),h="map"===s.get("text-pitch-alignment"),p="none"!==s.get("icon-text-fit"),m=new Fe(null,0,l&&(c||!e.hasIconData()||s.get("icon-optional")),c&&(l||!e.hasTextData()||s.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);const f=(e,t,r)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r);e.hasVisibleVertices=e.hasVisibleVertices||r!==tt},g=this.collisionBoxArrays.get(e.bucketInstanceId);for(let _=0;_<e.symbolInstances.length;_++){const r=e.symbolInstances.get(_),{numHorizontalGlyphVertices:i,numVerticalGlyphVertices:a,crossTileID:s}=r;let l=this.opacities[s];n[s]?l=o:l||(l=m,this.opacities[s]=l),n[s]=!0;const c=r.numIconVertices>0,y=this.placedOrientations[r.crossTileID],v=y===t.ah.vertical,x=y===t.ah.horizontal||y===t.ah.horizontalOnly;if(i>0||a>0){const t=et(l.text);f(e.text,i,v?tt:t),f(e.text,a,x?tt:t);const n=l.text.isHidden();[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=n||v?1:0)})),r.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=n||x?1:0);const s=this.variableOffsets[r.crossTileID];s&&this.markUsedJustification(e,s.anchor,r,y);const o=this.placedOrientations[r.crossTileID];o&&(this.markUsedJustification(e,"left",r,o),this.markUsedOrientation(e,o,r))}if(c){const t=et(l.icon),n=!(p&&r.verticalPlacedIconSymbolIndex&&v);r.placedIconSymbolIndex>=0&&(f(e.icon,r.numIconVertices,n?t:tt),e.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=l.icon.isHidden()),r.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,r.numVerticalIconVertices,n?tt:t),e.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}const b=g&&g.has(_)?g.get(_):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const r=e.collisionArrays[_];if(r){let n=new t.P(0,0);if(r.textBox||r.verticalTextBox){let t=!0;if(u){const e=this.variableOffsets[s];e?(n=He(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),d&&n._rotate(h?this.transform.angle:-this.transform.angle)):t=!1}if(r.textBox||r.verticalTextBox){let i;r.textBox&&(i=v),r.verticalTextBox&&(i=x),Ze(e.textCollisionBox.collisionVertexArray,l.text.placed,!t||i,b.text,n.x,n.y)}}if(r.iconBox||r.verticalIconBox){const t=Boolean(!x&&r.verticalIconBox);let i;r.iconBox&&(i=t),r.verticalIconBox&&(i=!t),Ze(e.iconCollisionBox.collisionVertexArray,l.icon.placed,i,b.icon,p?n.x:0,p?n.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}setStale(){this.stale=!0}}function Ze(e,t,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);const s=n[0]-De,o=n[1]-De,l=n[2]-De,c=n[3]-De;e.emplaceBack(t?1:0,r?1:0,i||0,a||0,s,o),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,o),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,c),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,s,c)}const Ge=Math.pow(2,25),We=Math.pow(2,24),Xe=Math.pow(2,17),Je=Math.pow(2,16),Ke=Math.pow(2,9),Ye=Math.pow(2,8),Qe=Math.pow(2,1);function et(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*Ge+t*We+r*Xe+t*Je+r*Ke+t*Ye+r*Qe+t}const tt=0;function rt(){return{isOccluded:(e,t,r)=>!1,getPitchedTextCorrection:(e,t,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(e,t,r,n){throw new Error("Not implemented.")},translatePosition:(e,t,r,n)=>function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!r[0]&&!r[1])return[0,0];const a=i?"map"===n?e.angle:0:"viewport"===n?-e.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}return[i?r[0]:Oe(t,r[0],e.zoom),i?r[1]:Oe(t,r[1],e.zoom)]}(e,t,r,n),getCircleRadiusCorrection:e=>1}}class nt{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,n,i){const a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(a,n,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<a.length;)if(t.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0;return!1}}class it{constructor(e,t,r,n,i,a,s,o){this.placement=new qe(e,rt(),t,a,s,o),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(e,t,r){const n=a.now(),i=()=>!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){const n=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new nt(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const at=512/t.X/2;class st{constructor(e,r,n){this.tileID=e,this.bucketInstanceId=n,this._symbolsByKey={};const i=new Map;for(let t=0;t<r.length;t++){const e=r.get(t),n=e.key,a=i.get(n);a?a.push(e):i.set(n,[e])}for(const[a,s]of i){const e={positions:s.map((e=>({x:Math.floor(e.anchorX*at),y:Math.floor(e.anchorY*at)}))),crossTileIDs:s.map((e=>e.crossTileID))};if(e.positions.length>128){const r=new t.av(e.positions.length,16,Uint16Array);for(const{x:t,y:n}of e.positions)r.add(t,n);r.finish(),delete e.positions,e.index=r}this._symbolsByKey[a]=e}}getScaledCoordinates(e,r){const{x:n,y:i,z:a}=this.tileID.canonical,{x:s,y:o,z:l}=r.canonical,c=at/Math.pow(2,l-a),u=(o*t.X+e.anchorY)*c,d=i*t.X*at;return{x:Math.floor((s*t.X+e.anchorX)*c-n*t.X*at),y:Math.floor(u-d)}}findMatches(e,t,r){const n=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z);for(let i=0;i<e.length;i++){const a=e.get(i);if(a.crossTileID)continue;const s=this._symbolsByKey[a.key];if(!s)continue;const o=this.getScaledCoordinates(a,t);if(s.index){const e=s.index.range(o.x-n,o.y-n,o.x+n,o.y+n).sort();for(const t of e){const e=s.crossTileIDs[t];if(!r[e]){r[e]=!0,a.crossTileID=e;break}}}else if(s.positions)for(let e=0;e<s.positions.length;e++){const t=s.positions[e],i=s.crossTileIDs[e];if(Math.abs(t.x-o.x)<=n&&Math.abs(t.y-o.y)<=n&&!r[i]){r[i]=!0,a.crossTileID=i;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((e=>{let{crossTileIDs:t}=e;return t}))}}class ot{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class lt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const r in this.indexes){const e=this.indexes[r],n={};for(const r in e){const i=e[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}this.indexes[r]=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 i=0;i<t.symbolInstances.length;i++)t.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const n=this.usedCrossTileIDs[e.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>e.overscaledZ)for(const i in r){const a=r[i];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,n)}else{const a=r[e.scaledTo(Number(i)).key];a&&a.findMatches(t.symbolInstances,e,n)}}for(let i=0;i<t.symbolInstances.length;i++){const e=t.symbolInstances.get(i);e.crossTileID||(e.crossTileID=r.generate(),n[e.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new st(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const r of t.getCrossTileIDsLists())for(const t of r)delete this.usedCrossTileIDs[e][t]}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 ct{constructor(){this.layerIndexes={},this.crossTileIDs=new ot,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r){let n=this.layerIndexes[e.id];void 0===n&&(n=this.layerIndexes[e.id]=new lt);let i=!1;const a={};n.handleWrapJump(r);for(const s of t){const t=s.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(s.tileID,t,this.crossTileIDs)&&(i=!0),a[t.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0}));for(const r in this.layerIndexes)t[r]||delete this.layerIndexes[r]}}const ut=(e,r)=>t.t(e,r&&r.filter((e=>"source.canvas"!==e.identifier))),dt=t.aw();class ht extends t.E{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this._rtlPluginLoaded=()=>{for(const e in this.sourceCaches){const t=this.sourceCaches[e].getSource().type;"vector"!==t&&"geojson"!==t||this.sourceCaches[e].reload()}},this.map=e,this.dispatcher=new B(F(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",((e,t)=>this.getGlyphs(e,t))),this.dispatcher.registerMessageHandler("GI",((e,t)=>this.getImages(e,t))),this.imageManager=new C,this.imageManager.setEventedParent(this),this.glyphManager=new E(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new A(256,512),this.crossTileSymbolIndex=new ct,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),oe().on(ie,this._rtlPluginLoaded),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.sourceCaches[e.sourceId];if(!t)return;const r=t.getSource();if(r&&r.vectorLayerIds)for(const n in this._layers){const e=this._layers[n];e.source===r.id&&this._validateLayer(e)}}))}loadURL(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new t.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;const i=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const a=this._loadStyleRequest;t.h(i,this._loadStyleRequest).then((e=>{this._loadStyleRequest=null,this._load(e.data,r,n)})).catch((e=>{this._loadStyleRequest=null,e&&!a.signal.aborted&&this.fire(new t.j(e))}))}loadJSON(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(e,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(dt,{validate:!1})}_load(e,r,n){var i;const a=r.transformStyle?r.transformStyle(n,e):e;if(!r.validate||!ut(this,t.u(a))){this._loaded=!0,this.stylesheet=a;for(const e in a.sources)this.addSource(e,a.sources[e],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new I(this.stylesheet.light),this.sky=new N(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const e=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map((e=>e.id)),this._layers={},this._serializedLayers=null;for(const r of e){const e=t.aA(r);e.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=e}}_loadSprite(e){let r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(e,r,n,i){return t._(this,void 0,void 0,(function*(){const s=v(e),o=n>1?"@2x":"",l={},c={};for(const{id:e,url:n}of s){const a=r.transformRequest(x(n,o,".json"),"SpriteJSON");l[e]=t.h(a,i);const s=r.transformRequest(x(n,o,".png"),"SpriteImage");c[e]=p.getImage(s,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(e,r){return t._(this,void 0,void 0,(function*(){const t={};for(const n in e){t[n]={};const i=a.getImageCanvasContext((yield r[n]).data),s=(yield e[n]).data;for(const e in s){const{width:r,height:a,x:o,y:l,sdf:c,pixelRatio:u,stretchX:d,stretchY:h,content:p,textFitWidth:m,textFitHeight:f}=s[e];t[n][e]={data:null,pixelRatio:u,sdf:c,stretchX:d,stretchY:h,content:p,textFitWidth:m,textFitHeight:f,spriteData:{width:r,height:a,x:o,y:l,context:i}}}}return t}))}(l,c)}))}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((e=>{if(this._spriteRequest=null,e)for(const t in e){this._spritesImagesIds[t]=[];const r=this._spritesImagesIds[t]?this._spritesImagesIds[t].filter((t=>!(t in e))):[];for(const e of r)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(const i in e[t]){const r="default"===t?i:`${t}:${i}`;this._spritesImagesIds[t].push(r),r in this.imageManager.images?this.imageManager.updateImage(r,e[t][i],!1):this.imageManager.addImage(r,e[t][i]),n&&(this._changedImages[r]=!0)}}})).catch((e=>{this._spriteRequest=null,r=e,this.fire(new t.j(r))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),i&&i(r)}))}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(e){const r=this.sourceCaches[e.source];if(!r)return;const n=e.sourceLayer;if(!n)return;const i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._serializedAllLayers();if(!e||0===e.length)return Object.values(r?t.aB(n):n);const i=[];for(const a of e)if(n[a]){const e=r?t.aB(n[a]):n[a];i.push(e)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const t=Object.keys(this._layers);for(const r of t){const t=this._layers[r];"custom"!==t.type&&(e[r]=t.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())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}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const r=this._changed;if(r){const t=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(t.length||r.length)&&this._updateWorkerLayers(t,r);for(const e in this._updatedSources){const t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else{if("clear"!==t)throw new Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const n in this._updatedPaintProps)this._layers[n].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const n={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];n[t]=e.used,e.used=!1}for(const t of this._order){const r=this._layers[t];r.recalculate(e,this._availableImages),!r.isHidden(e.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(const i in n){const e=this.sourceCaches[i];!!n[i]!=!!e.used&&e.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:i}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,r&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;this._checkLoaded();const i=this.serialize();if(e=r.transformStyle?r.transformStyle(i,e):e,(null===(n=r.validate)||void 0===n||n)&&ut(this,t.u(e)))return!1;(e=t.aB(e)).layers=t.az(e.layers);const a=t.aC(i,e),s=this._getOperationsToPerform(a);if(s.unimplemented.length>0)throw new Error(`Unimplemented: ${s.unimplemented.join(", ")}.`);if(0===s.operations.length)return!1;for(const t of s.operations)t();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const t=[],r=[];for(const n of e)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":t.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":t.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":t.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":t.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":t.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":t.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":t.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":t.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":t.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":t.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":t.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":t.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":t.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":t.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":t.push((()=>{}));break;default:r.push(n.command)}return{operations:t,unimplemented:r}}addImage(e,r){if(this.getImage(e))return this.fire(new t.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new t.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error(`Source "${e}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Ob
2ject.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.u.source,`sources.${e}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=this.sourceCaches[e]=new de(e,r,this.dispatcher);i.style=this,i.setEventedParent(this,(()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:e}))),i.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===e)return this.fire(new t.j(new Error(`Source "${e}" cannot be removed while layer "${n}" is using it.`)));const r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error(`There is no source with this ID=${e}`);const r=this.sourceCaches[e].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=e.id;if(this.getLayer(i))return void this.fire(new t.j(new Error(`Layer "${i}" already exists on this map.`)));let a;if("custom"===e.type){if(ut(this,t.aD(e)))return;a=t.aA(e)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(i,e.source),e=t.aB(e),e=t.e(e,{source:i})),this._validate(t.u.layer,`layers.${i}`,e,{arrayIndex:-1},n))return;a=t.aA(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}const s=r?this._order.indexOf(r):this._order.length;if(r&&-1===s)this.fire(new t.j(new Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));else{if(this._order.splice(s,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){const e=this._removedLayers[i];delete this._removedLayers[i],e.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===r)return;const n=this._order.indexOf(e);this._order.splice(n,1);const i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.j(new Error(`Cannot move layer "${e}" before non-existing layer "${r}".`))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const r=this._layers[e];if(!r)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);const n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,n){this._checkLoaded();const i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=this.getLayer(e);if(i){if(!t.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=t.aB(r),this._updateLayer(i)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return t.aB(this.getLayer(e).filter)}setLayoutProperty(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(e);
vendor: 9,554 bytes, line 2
2a?t.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,r){const n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(e);a?t.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,r){this._checkLoaded();const n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));const s=a.getSource().type;"geojson"===s&&i?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||i?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,r){this._checkLoaded();const n=e.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));const a=i.getSource().type,s="vector"===a?e.sourceLayer:void 0;"vector"!==a||s?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(s,e.id,r):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=t.aF(this.sourceCaches,(e=>e.serialize())),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return t.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:e,layers:r,terrain:n},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._layers[e].type,r={},n=[];for(let a=this._order.length-1;a>=0;a--){const i=this._order[a];if(t(i)){r[i]=a;for(const t of e){const e=t[i];if(e)for(const t of e)n.push(t)}}}n.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const i=[];for(let a=this._order.length-1;a>=0;a--){const s=this._order[a];if(t(s))for(let e=n.length-1;e>=0;e--){const t=n[e].feature;if(r[t.layer.id]<a)break;i.push(t),n.pop()}else for(const t of e){const e=t[s];if(e)for(const t of e)i.push(t.feature)}}return i}queryRenderedFeatures(e,r,n){r&&r.filter&&this._validate(t.u.filter,"queryRenderedFeatures.filter",r.filter,null,r);const i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.j(new Error("parameters.layers must be an Array."))),[];for(const e of r.layers){const r=this._layers[e];if(!r)return this.fire(new t.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];i[r.source]=!0}}const a=[];r.availableImages=this._availableImages;const s=this._serializedAllLayers();for(const t in this.sourceCaches)r.layers&&!i[t]||a.push(U(this.sourceCaches[t],this._layers,s,e,r,n));return this.placement&&a.push(function(e,t,r,n,i,a,s){const o={},l=a.queryRenderedSymbols(n),c=[];for(const u of Object.keys(l).map(Number))c.push(s[u]);c.sort(H);for(const u of c){const r=u.featureIndex.lookupSymbolFeatures(l[u.bucketInstanceId],t,u.bucketIndex,u.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(const e in r){const t=o[e]=o[e]||[],n=r[e];n.sort(((e,t)=>{const r=u.featureSortOrder;if(r){const n=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex}));for(const e of n)t.push(e)}}for(const u in o)o[u].forEach((t=>{const n=t.feature,i=r[e[u].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=i}));return o}(this._layers,s,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r&&r.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",r.filter,null,r);const n=this.sourceCaches[e];return n?function(e,t){const r=e.getRenderableIds().map((t=>e.getTileByID(t))),n=[],i={};for(let a=0;a<r.length;a++){const e=r[a],s=e.tileID.canonical.key;i[s]||(i[s]=!0,e.querySourceFeatures(n,t))}return n}(n,r):[]}getLight(){return this.light.getLight()}setLight(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();const n=this.light.getLight();let i=!1;for(const a in e)if(!t.aE(e[a],n[a])){i=!0;break}if(!i)return;const s={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(s)}getSky(){var e;return null===(e=this.stylesheet)||void 0===e?void 0:e.sky}setSky(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getSky();let i=!1;if(!e&&!n)return;if(e&&!n)i=!0;else if(!e&&n)i=!0;else for(const a in e)if(!t.aE(e[a],n[a])){i=!0;break}if(!i)return;const s={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(s)}_validate(e,r,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!a||!1!==a.validate)&&ut(this,e.call(t.u,t.e({key:r,style:this.serialize(),value:n,styleSpec:t.v},i)))}_remove(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),oe().off(ie,this._rtlPluginLoaded);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.sourceCaches){const e=this.sourceCaches[t];e.setEventedParent(null),e.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const t in this.sourceCaches)this.sourceCaches[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=!1,o=!1;const l={};for(const a of this._order){const t=this._layers[a];if("symbol"!==t.type)continue;if(!l[t.source]){const e=this.sourceCaches[t.source];l[t.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const r=this.crossTileSymbolIndex.addLayer(t,l[t.source],e.center.lng);s=s||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),e.zoom))&&(this.pauseablePlacement=new it(e,this.map.terrain,this._order,i,t,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),o=!0),s&&this.pauseablePlacement.placement.setStale()),o||s)for(const a of this._order){const e=this._layers[a];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,r){return t._(this,void 0,void 0,(function*(){const e=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,r.icons),e}))}getGlyphs(e,r){return t._(this,void 0,void 0,(function*(){const e=yield this.glyphManager.getGlyphs(r.stacks),t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,[""]),e}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
2this._checkLoaded(),e&&this._validate(t.u.glyphs,"glyphs",e,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;this._checkLoaded();const a=[{id:e,url:r}],s=[...v(this.stylesheet.sprite),...a];this._validate(t.u.sprite,"sprite",s,null,n)||(this.stylesheet.sprite=s,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();const r=v(this.stylesheet.sprite);if(r.find((t=>t.id===e))){if(this._spritesImagesIds[e])for(const t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;r.splice(r.findIndex((t=>t.id===e)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return v(this.stylesheet.sprite)}setSprite(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this._checkLoaded(),e&&this._validate(t.u.sprite,"sprite",e,null,r)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,n):(this._unloadSprite(),n&&n(null)))}}var pt=t.Y([{name:"a_pos",type:"Int16",components:2}]);const mt={prelude:ft("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\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(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:ft("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ft("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
2uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:ft("varying vec3 v_data;varying 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\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying 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\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:ft("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ft("uniform highp float u_intensity;varying 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);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:ft("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:ft("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ft("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:ft("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:ft("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:ft("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:ft("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:ft("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:ft("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0
2? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:ft("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:ft("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:ft("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
2\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:ft("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\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\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\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\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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:ft("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\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\nvoid main() {\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\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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:ft("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:ft("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
2uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:ft("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:ft("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.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(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:ft("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\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\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\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\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\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\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.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(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:ft("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\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\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\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
2gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\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\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\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.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(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:ft("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
2float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:ft("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:ft("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:ft("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function ft(e,t){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=a?a.concat(i):i,o={};return{fragmentSource:e=e.replace(r,((e,t,r,n,i)=>(o[i]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:t=t.replace(r,((e,t,r,n,i)=>{const a="float"===n?"vec2":"vec4",s=i.match(/color/)?"color":a;return o[i]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${s}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${s}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:s}}class gt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,r,n,i,a,s,o,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==n.length;for(let u=0;!c&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(c=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||c||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==s||this.boundDynamicVertexBuffer2!==o||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,r,n,i,a,s,o,l):(e.bindVertexArray.set(this.vao),s&&s.bind(),i&&i.dynamicDraw&&i.bind(),o&&o.bind(),l&&l.bind())}freshBind(e,t,r,n,i,a,s,o){const l=e.numAttributes,c=this.context,u=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=s,this.boundDynamicVertexBuffer3=o,t.enableAttributes(u,e);for(const d of r)d.enableAttributes(u,e);a&&a.enableAttributes(u,e),s&&s.enableAttributes(u,e),o&&o.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,i);for(const d of r)d.bind(),d.setVertexAttribPointers(u,e,i);a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),n&&n.bind(),s&&(s.bind(),s.setVertexAttribPointers(u,e,i)),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const _t=(e,r,n,i,a)=>({u_matrix:e,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function yt(e){const t=[];for(let r=0;r<e.length;r++){if(null===e[r])continue;const n=e[r].split(" ");t.push(n.pop())}return t}class vt{constructor(e,r,n,i,a,s){const o=e.gl;this.program=o.createProgram();const l=yt(r.staticAttributes),c=n?n.getBinderAttributes():[],u=l.concat(c),d=mt.prelude.staticUniforms?yt(mt.prelude.staticUniforms):[],h=r.staticUniforms?yt(r.staticUniforms):[],p=n?n.getBinderUniforms():[],m=d.concat(h).concat(p),f=[];for(const t of m)f.indexOf(t)<0&&f.push(t);const g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),s&&g.push("#define TERRAIN3D;");const _=g.concat(mt.prelude.fragmentSource,r.fragmentSource).join("\n"),y=g.concat(mt.prelude.vertexSource,r.vertexSource).join("\n"),v=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())return void(this.failedToCreate=!0);if(o.shaderSource(v,_),o.compileShader(v),!o.getShaderParameter(v,o.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${o.getShaderInfoLog(v)}`);o.attachShader(this.program,v);const x=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())return void(this.failedToCreate=!0);if(o.shaderSource(x,y),o.compileShader(x),!o.getShaderParameter(x,o.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${o.getShaderInfoLog(x)}`);o.attachShader(this.program,x),this.attributes={};const b={};this.numAttributes=u.length;for(let t=0;t<this.numAttributes;t++)u[t]&&(o.bindAttribLocation(this.program,t,u[t]),this.attributes[u[t]]=t);if(o.linkProgram(this.program),!o.getProgramParameter(this.program,o.LINK_STATUS))throw new Error(`Program failed to link: ${o.getProgramInfoLog(this.program)}`);o.deleteShader(x),o.deleteShader(v);for(let t=0;t<f.length;t++){const e=f[t];if(e&&!b[e]){const t=o.getUniformLocation(this.program,e);t&&(b[e]=t)}}this.fixedUniforms=i(e,b),this.terrainUniforms=((e,r)=>({u_depth:new t.aH(e,r.u_depth),u_terrain:new t.aH(e,r.u_terrain),u_terrain_dim:new t.aI(e,r.u_terrain_dim),u_terrain_matrix:new t.aJ(e,r.u_terrain_matrix),u_terrain_unpack:new t.aK(e,r.u_terrain_unpack),u_terrain_exaggeration:new t.aI(e,r.u_terrain_exaggeration)}))(e,b),this.binderUniforms=n?n.getUniforms(e,b):[]}draw(e,t,r,n,i,a,s,o,l,c,u,d,h,p,m,f,g,_){const y=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a
vendor: 6,089 bytes, line 2
2),o){e.activeTexture.set(y.TEXTURE2),y.bindTexture(y.TEXTURE_2D,o.depthTexture),e.activeTexture.set(y.TEXTURE3),y.bindTexture(y.TEXTURE_2D,o.texture);for(const e in this.terrainUniforms)this.terrainUniforms[e].set(o[e])}for(const x in this.fixedUniforms)this.fixedUniforms[x].set(s[x]);m&&m.setUniforms(e,this.binderUniforms,h,{zoom:p});let v=0;switch(t){case y.LINES:v=2;break;case y.TRIANGLES:v=3;break;case y.LINE_STRIP:v=1}for(const x of d.get()){const r=x.vaos||(x.vaos={});(r[l]||(r[l]=new gt)).bind(e,this,c,m?m.getPaintVertexBuffers():[],u,x.vertexOffset,f,g,_),y.drawElements(t,x.primitiveLength*v,y.UNSIGNED_SHORT,x.primitiveOffset*v*2)}}}function xt(e,t,r){const n=1/Oe(r,1,t.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,t.transform.tileZoom)/i,s=a*(r.tileID.canonical.x+r.tileID.wrap*i),o=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,o>>16],u_pixel_coord_lower:[65535&s,65535&o]}}const bt=(e,r,n,i)=>{const a=r.style.light,s=a.properties.get("position"),o=[s.x,s.y,s.z],l=function(){var e=new t.A(9);return t.A!=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}();"viewport"===a.properties.get("anchor")&&function(e,t){var r=Math.sin(t),n=Math.cos(t);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}(l,-r.transform.angle),function(e,t,r){var n=t[0],i=t[1],a=t[2];e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8]}(o,o,l);const c=a.properties.get("color");return{u_matrix:e,u_lightpos:o,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},wt=(e,r,n,i,a,s,o)=>t.e(bt(e,r,n,i),xt(s,r,o),{u_height_factor:-Math.pow(2,a.overscaledZ)/o.tileSize/8}),Ct=e=>({u_matrix:e}),St=(e,r,n,i)=>t.e(Ct(e),xt(n,r,i)),kt=(e,t)=>({u_matrix:e,u_world:t}),jt=(e,r,n,i,a)=>t.e(St(e,r,n,i),{u_world:a}),Et=(e,t,r,n)=>{const i=e.transform;let a,s;if("map"===n.paint.get("circle-pitch-alignment")){const e=Oe(r,1,i.zoom);a=!0,s=[e,e]}else a=!1,s=i.pixelsToGLUnits;return{u_camera_to_center_distance:i.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:s}},Tt=(e,t,r)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Pt=function(e,t){return{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1}},It=e=>({u_matrix:e}),Mt=(e,t,r,n)=>({u_matrix:e,u_extrude_scale:Oe(t,1,r),u_intensity:n}),Nt=(e,r,n,i)=>{const a=t.H();t.aP(a,0,e.width,e.height,0,0,1);const s=e.context.gl;return{u_matrix:a,u_world:[s.drawingBufferWidth,s.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function At(e,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.Z(0,i/n).toLngLat().lat,new t.Z(0,(i+1)/n).toLngLat().lat]}const Lt=(e,t,r,n)=>{const i=e.transform;return{u_matrix:Ft(e,t,r,n),u_ratio:1/Oe(t,1,i.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Dt=(e,r,n,i,a)=>t.e(Lt(e,r,n,a),{u_image:0,u_image_height:i}),zt=(e,t,r,n,i)=>{const a=e.transform,s=Rt(t,a);return{u_matrix:Ft(e,t,r,i),u_texsize:t.imageAtlasTexture.size,u_ratio:1/Oe(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[s,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Ot=(e,r,n,i,a,s)=>{const o=e.lineAtlas,l=Rt(r,e.transform),c="round"===n.layout.get("line-cap"),u=o.getDash(i.from,c),d=o.getDash(i.to,c),h=u.width*a.fromScale,p=d.width*a.toScale;return t.e(Lt(e,r,n,s),{u_patternscale_a:[l/h,-u.height/2],u_patternscale_b:[l/p,-d.height/2],u_sdfgamma:o.width/(256*Math.min(h,p)*e.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:d.y,u_mix:a.t})};function Rt(e,t){return 1/Oe(e,1,t.tileZoom)}function Ft(e,t,r,n){return e.translatePosMatrix(n?n.posMatrix:t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Bt=(e,t,r,n,i)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(s=i.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Vt(i.paint.get("raster-hue-rotate"))};var a,s};function Vt(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 $t=(e,t,r,n,i,a,s,o,l,c,u,d,h,p)=>{const m=s.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:m.cameraToCenterDistance,u_pitch:m.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:m.width/m.height,u_fade_change:s.options.fadeDuration?s.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+d,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:h,u_texture:0,u_translation:u,u_pitched_scale:p}},Ut=(e,r,n,i,a,s,o,l,c,u,d,h,p,m,f)=>{const g=o.transform;return t.e($t(e,r,n,i,a,s,o,l,c,u,d,h,p,f),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+m})},Ht=(e,r,n,i,a,s,o,l,c,u,d,h,p,m)=>t.e(Ut(e,r,n,i,a,s,o,l,c,u,d,!0,h,!0,m),{u_texsize_icon:p,u_texture_icon:1}),qt=(e,t,r)=>({u_matrix:e,u_opacity:t,u_color:r}),Zt=(e,r,n,i,a,s)=>t.e(function(e,t,r,n){const i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),{width:s,height:o}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ
vendor: 5,987 bytes, line 2
2),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),d=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,o],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/Oe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[65535&u,65535&d]}}(i,s,n,a),{u_matrix:e,u_opacity:r}),Gt={fillExtrusion:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_opacity:new t.aI(e,r.u_opacity)}),fillExtrusionPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_height_factor:new t.aI(e,r.u_height_factor),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade),u_opacity:new t.aI(e,r.u_opacity)}),fill:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),fillPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),fillOutline:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world)}),fillOutlinePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),circle:(e,r)=>({u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_scale_with_map:new t.aH(e,r.u_scale_with_map),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_extrude_scale:new t.aO(e,r.u_extrude_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_matrix:new t.aJ(e,r.u_matrix)}),collisionBox:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_pixel_extrude_scale:new t.aO(e,r.u_pixel_extrude_scale)}),collisionCircle:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_inv_matrix:new t.aJ(e,r.u_inv_matrix),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_viewport_size:new t.aO(e,r.u_viewport_size)}),debug:(e,r)=>({u_color:new t.aL(e,r.u_color),u_matrix:new t.aJ(e,r.u_matrix),u_overlay:new t.aH(e,r.u_overlay),u_overlay_scale:new t.aI(e,r.u_overlay_scale)}),clippingMask:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),heatmap:(e,r)=>({u_extrude_scale:new t.aI(e,r.u_extrude_scale),u_intensity:new t.aI(e,r.u_intensity),u_matrix:new t.aJ(e,r.u_matrix)}),heatmapTexture:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_color_ramp:new t.aH(e,r.u_color_ramp),u_opacity:new t.aI(e,r.u_opacity)}),hillshade:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_latrange:new t.aO(e,r.u_latrange),u_light:new t.aO(e,r.u_light),u_shadow:new t.aL(e,r.u_shadow),u_highlight:new t.aL(e,r.u_highlight),u_accent:new t.aL(e,r.u_accent)}),hillshadePrepare:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_dimension:new t.aO(e,r.u_dimension),u_zoom:new t.aI(e,r.u_zoom),u_unpack:new t.aK(e,r.u_unpack)}),line:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels)}),lineGradient:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_image:new t.aH(e,r.u_image),u_image_height:new t.aI(e,r.u_image_height)}),linePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texsize:new t.aO(e,r.u_texsize),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_image:new t.aH(e,r.u_image),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),lineSDF:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_patternscale_a:new t.aO(e,r.u_patternscale_a),u_patternscale_b:new t.aO(e,r.u_patternscale_b),u_sdfgamma:new t.aI(e,r.u_sdfgamma),u_image:new t.aH(e,r.u_image),u_tex_y_a:new t.aI(e,r.u_tex_y_a),u_tex_y_b:new t.aI(e,r.u_tex_y_b),u_mix:new t.aI(e,r.u_mix)}),raster:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_tl_parent:new t.aO(e,r.u_tl_parent),u_scale_parent:new t.aI(e,r.u_scale_parent),u_buffer_scale:new t.aI(e,r.u_buffer_scale),u_fade_t:new t.aI(e,r.u_fade_t),u_opacity:new t.aI(e,r.u_opacity),u_image0:new t.aH(e,r.u_image0),u_image1:new t.aH(e,r.u_image1),u_brightness_low:new t.aI(e,r.u_brightness_low),u_brightness_high:new t.aI(e,r.u_brightness_high),u_saturation_factor:new t.aI(e,r.u_saturation_factor),u_contrast_factor:new t.aI(e,r.u_contrast_factor),u_spin_weights:new t.aN(e,r.u_spin_weights)}),symbolIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix
vendor: 79,307 bytes, line 2
2),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolSDF:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolTextAndIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texsize_icon:new t.aO(e,r.u_texsize_icon),u_texture:new t.aH(e,r.u_texture),u_texture_icon:new t.aH(e,r.u_texture_icon),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),background:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_color:new t.aL(e,r.u_color)}),backgroundPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_image:new t.aH(e,r.u_image),u_pattern_tl_a:new t.aO(e,r.u_pattern_tl_a),u_pattern_br_a:new t.aO(e,r.u_pattern_br_a),u_pattern_tl_b:new t.aO(e,r.u_pattern_tl_b),u_pattern_br_b:new t.aO(e,r.u_pattern_br_b),u_texsize:new t.aO(e,r.u_texsize),u_mix:new t.aI(e,r.u_mix),u_pattern_size_a:new t.aO(e,r.u_pattern_size_a),u_pattern_size_b:new t.aO(e,r.u_pattern_size_b),u_scale_a:new t.aI(e,r.u_scale_a),u_scale_b:new t.aI(e,r.u_scale_b),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(e,r.u_tile_units_to_pixels)}),terrain:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_ele_delta:new t.aI(e,r.u_ele_delta),u_fog_matrix:new t.aJ(e,r.u_fog_matrix),u_fog_color:new t.aL(e,r.u_fog_color),u_fog_ground_blend:new t.aI(e,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(e,r.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon_fog_blend:new t.aI(e,r.u_horizon_fog_blend)}),terrainDepth:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ele_delta:new t.aI(e,r.u_ele_delta)}),terrainCoords:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_terrain_coords_id:new t.aI(e,r.u_terrain_coords_id),u_ele_delta:new t.aI(e,r.u_ele_delta)}),sky:(e,r)=>({u_sky_color:new t.aL(e,r.u_sky_color),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon:new t.aI(e,r.u_horizon),u_sky_horizon_blend:new t.aI(e,r.u_sky_horizon_blend)})};class Wt{constructor(e,t,r){this.context=e;const n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");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)}}const Xt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Jt{constructor(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.context=e;const i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r=0;r<this.attributes.length;r++){const n=t.attributes[this.attributes[r].name];void 0!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,r){for(let n=0;n<this.attributes.length;n++){const i=this.attributes[n],a=t.attributes[i.name];void 0!==a&&e.vertexAttribPointer(a,i.components,e[Xt[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Kt=new WeakMap;function Yt(e){var t;if(Kt.has(e))return Kt.get(e);{const r=null===(t=e.getParameter(e.VERSION))||void 0===t?void 0:t.startsWith("WebGL 2.0");return Kt.set(e,r),r}}class Qt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class er extends Qt{getDefault(){return t.aM.transparent}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 tr extends Qt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class rr extends Qt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class nr extends Qt{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 ir extends Qt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class ar extends Qt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class sr extends Qt{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 or extends Qt{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 lr extends Qt{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 cr extends Qt{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 ur extends Qt{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 dr extends Qt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class hr extends Qt{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 pr extends Qt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class mr extends Qt{getDefault(){return t.aM.transparent}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(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class fr extends Qt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class gr extends Qt{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 _r extends Qt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class yr extends Qt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class vr extends Qt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class xr extends Qt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class br extends Qt{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 wr extends Qt{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 Cr extends Qt{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 Sr extends Qt{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 kr extends Qt{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 jr extends Qt{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Er extends Qt{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;const r=this.gl;Yt(r)?r.bindVertexArray(e):null===(t=r.getExtension("OES_vertex_array_object"))||void 0===t||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Tr extends Qt{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 Pr extends Qt{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 Ir extends Qt{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 Mr extends Qt{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class Nr extends Mr{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,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Ar extends Mr{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Lr extends Mr{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Dr{constructor(e,t,r,n,i){this.context=e,this.width=t,this.height=r;const a=e.gl,s=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new Nr(e,s),n)this.depthAttachment=i?new Lr(e,s):new Ar(e,s);else if(i)throw new Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class zr{constructor(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r}}zr.Replace=[1,0],zr.disabled=new zr(zr.Replace,t.aM.transparent,[!1,!1,!1,!1]),zr.unblended=new zr(zr.Replace,t.aM.transparent,[!0,!0,!0,!0]),zr.alphaBlended=new zr([1,771],t.aM.transparent,[!0,!0,!0,!0]);class Or{constructor(e){var t,r;if(this.gl=e,this.clearColor=new er(this),this.clearDepth=new tr(this),this.clearStencil=new rr(this),this.colorMask=new nr(this),this.depthMask=new ir(this),this.stencilMask=new ar(this),this.stencilFunc=new sr(this),this.stencilOp=new or(this),this.stencilTest=new lr(this),this.depthRange=new cr(this),this.depthTest=new ur(this),this.depthFunc=new dr(this),this.blend=new hr(this),this.blendFunc=new pr(this),this.blendColor=new mr(this),this.blendEquation=new fr(this),this.cullFace=new gr(this),this.cullFaceSide=new _r(this),this.frontFace=new yr(this),this.program=new vr(this),this.activeTexture=new xr(this),this.viewport=new br(this),this.bindFramebuffer=new wr(this),this.bindRenderbuffer=new Cr(this),this.bindTexture=new Sr(this),this.bindVertexBuffer=new kr(this),this.bindElementBuffer=new jr(this),this.bindVertexArray=new Er(this),this.pixelStoreUnpack=new Tr(this),this.pixelStoreUnpackPremultiplyAlpha=new Pr(this),this.pixelStoreUnpackFlipY=new Ir(this),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.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),Yt(e)){this.HALF_FLOAT=e.HALF_FLOAT;const n=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(t=e.RGBA16F)&&void 0!==t?t:null==n?void 0:n.RGBA16F_EXT,this.RGB16F=null!==(r=e.RGB16F)&&void 0!==r?r:null==n?void 0:n.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const t=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==t?void 0:t.HALF_FLOAT_OES}}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.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new Wt(this,e,t)}createVertexBuffer(e,t,r){return new Jt(this,e,t,r)}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 Dr(this,e,t,r,n)}clear(e){let{color:t,depth:r,stencil:n}=e;const i=this.gl;let a=0;t&&(a|=i.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(a|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),void 0!==n&&(a|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),i.clear(a)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){t.aE(e.blendFunction,zr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return Yt(this.gl)?this.gl.createVertexArray():null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var t;return Yt(this.gl)?this.gl.deleteVertexArray(e):null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class Rr{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}Rr.ReadOnly=!1,Rr.ReadWrite=!0,Rr.disabled=new Rr(519,Rr.ReadOnly,[0,1]);const Fr=7680;class Br{constructor(e,t,r,n,i,a){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a}}Br.disabled=new Br({func:519,mask:0},0,0,Fr,Fr,Fr);class Vr{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}let $r;function Ur(e,r,n,i,a){const s=e.context,o=s.gl,l=e.useProgram("collisionBox"),c=[];let u=0,d=0;for(let y=0;y<i.length;y++){const p=i[y],m=r.getTile(p).getBucket(n);if(!m)continue;const f=a?m.textCollisionBox:m.iconCollisionBox,g=m.collisionCircleArray;if(g.length>0){const r=t.H();t.aQ(r,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.aQ(r,r,m.placementViewportMatrix),c.push({circleArray:g,circleOffset:d,transform:p.posMatrix,invTransform:r,coord:p}),u+=g.length/4,d=u}f&&l.draw(s,o.LINES,Rr.disabled,Br.disabled,e.colorModeForRenderPass(),Vr.disabled,{u_matrix:p.posMatrix,u_pixel_extrude_scale:[1/(h=e.transform).width,1/h.height]},e.style.map.terrain&&e.style.map.terrain.getTerrainData(p),n.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,null,e.transform.zoom,null,null,f.collisionVertexBuffer)}var h;if(!a||!c.length)return;const p=e.useProgram("collisionCircle"),m=new t.aR;m.resize(4*u),m._trim();let f=0;for(const t of c)for(let e=0;e<t.circleArray.length/4;e++){const r=4*e,n=t.circleArray[r+0],i=t.circleArray[r+1],a=t.circleArray[r+2],s=t.circleArray[r+3];m.emplace(f++,n,i,a,s,0),m.emplace(f++,n,i,a,s,1),m.emplace(f++,n,i,a,s,2),m.emplace(f++,n,i,a,s,3)}(!$r||$r.length<2*u)&&($r=function(e){const r=2*e,n=new t.aT;n.resize(r),n._trim();for(let t=0;t<r;t++){const e=6*t;n.uint16[e+0]=4*t+0,n.uint16[e+1]=4*t+1,n.uint16[e+2]=4*t+2,n.uint16[e+3]=4*t+2,n.uint16[e+4]=4*t+3,n.uint16[e+5]=4*t+0}return n}(u));const g=s.createIndexBuffer($r,!0),_=s.createVertexBuffer(m,t.aS.members,!0);for(const y of c){const r=Tt(y.transform,y.invTransform,e.transform);p.draw(s,o.TRIANGLES,Rr.disabled,Br.disabled,e.colorModeForRenderPass(),Vr.disabled,r,e.style.map.terrain&&e.style.map.terrain.getTerrainData(y.coord),n.id,_,g,t.a0.simpleSegment(0,2*y.circleOffset,y.circleArray.length,y.circleArray.length/2),null,e.transform.zoom,null,null,null)}_.destroy(),g.destroy()}Vr.disabled=new Vr(!1,1029,2305),Vr.backCCW=new Vr(!0,1029,2305);const Hr=t.an(new Float32Array(16));function qr(e,r,n,i,a,s){const{horizontalAlign:o,verticalAlign:l}=t.au(e);return new t.P((-(o-.5)*r/a+i[0])*s,(-(l-.5)*n/a+i[1])*s)}function Zr(e,r,n,i,a,s){const o=r.tileAnchorPoint.add(new t.P(r.translation[0],r.translation[1]));if(r.pitchWithMap){let e=i.mult(s);n||(e=e.rotate(-a));const t=o.add(e);return ve(t.x,t.y,r.labelPlaneMatrix,r.getElevation).point}if(n){const t=Te(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(e),n=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0);return e.add(i.rotate(n))}return e.add(i)}function Gr(e,r,n,i,a,s,o,l,c,u,d,h,p,m){const f=e.text.placedSymbolArray,g=e.text.dynamicLayoutVertexArray,_=e.icon.dynamicLayoutVertexArray,y={};g.clear();for(let v=0;v<f.length;v++){const _=f.get(v),x=_.hidden||!_.crossTileID||e.allowVerticalPlacement&&!_.placedOrientation?null:i[_.crossTileID];if(x){const i=new t.P(_.anchorX,_.anchorY),f={getElevation:m,width:a.width,height:a.height,labelPlaneMatrix:s,lineVertexArray:null,pitchWithMap:n,projection:d,projectionCache:null,tileAnchorPoint:i,translation:h,unwrappedTileID:p},v=n?ve(i.x,i.y,o,m):Te(i.x,i.y,f),b=xe(a.cameraToCenterDistance,v.signedDistanceFromCamera);let w=t.ai(e.textSizeData,c,_)*b/t.ap;n&&(w*=e.tilePixelRatio/l);const{width:C,height:S,anchor:k,textOffset:j,textBoxScale:E}=x,T=qr(k,C,S,j,E,w),P=d.getPitchedTextCorrection(a,i.add(new t.P(h[0],h[1])),p),I=Zr(v.point,f,r,T,a.angle,P),M=e.allowVerticalPlacement&&_.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let e=0;e<_.numGlyphs;e++)t.aj(g,I,M);u&&_.associatedIconIndex>=0&&(y[_.associatedIconIndex]={shiftedAnchor:I,angle:M})}else Ae(_.numGlyphs,g)}if(u){_.clear();const r=e.icon.placedSymbolArray;for(let e=0;e<r.length;e++){const n=r.get(e);if(n.hidden)Ae(n.numGlyphs,_);else{const r=y[e];if(r)for(let e=0;e<n.numGlyphs;e++)t.aj(_,r.shiftedAnchor,r.angle);else Ae(n.numGlyphs,_)}}e.icon.dynamicLayoutVertexBuffer.updateData(_)}e.text.dynamicLayoutVertexBuffer.updateData(g)}function Wr(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function Xr(e,r,n,i,a,s,o,l,c,u,d,h){const p=e.context,m=p.gl,f=e.transform,g=rt(),_="map"===l,y="map"===c,v="viewport"!==l&&"point"!==n.layout.get("symbol-placement"),x=_&&!y&&!v,b=!y&&v,w=!n.layout.get("symbol-sort-key").isConstant();let C=!1;const S=e.depthModeForSublayer(0,Rr.ReadOnly),k=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),j=[],E=g.getCircleRadiusCorrection(f);for(const T of i){const i=r.getTile(T),l=i.getBucket(n);if(!l)continue;const c=a?l.text:l.icon;if(!c||!c.segments.get().length||!c.hasVisibleVertices)continue;const d=c.programConfigurations.get(n.id),h=a||l.sdfIcons,p=a?l.textSizeData:l.iconSizeData,S=y||0!==f.pitch,P=e.useProgram(Wr(h,a,l),d),I=t.ag(p,f.zoom),M=e.style.map.terrain&&e.style.map.terrain.getTerrainData(T);let N,A,L,D,z=[0,0],O=null;if(a)A=i.glyphAtlasTexture,L=m.LINEAR,N=i.glyphAtlasTexture.size,l.iconsInText&&(z=i.imageAtlasTexture.size,O=i.imageAtlasTexture,D=S||e.options.rotating||e.options.zooming||"composite"===p.kind||"camera"===p.kind?m.LINEAR:m.NEAREST);else{const t=1!==n.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear;A=i.imageAtlasTexture,L=h||e.options.rotating||e.options.zooming||t||S?m.LINEAR:m.NEAREST,N=i.imageAtlasTexture.size}const R=Oe(i,1,e.transform.zoom),F=b?T.posMatrix:Hr,B=_e(F,y,_,e.transform,R),V=ye(F,y,_,e.transform,R),$=ye(T.posMatrix,y,_,e.transform,R),U=g.translatePosition(e.transform,i,s,o),H=k&&l.hasTextData(),q="none"!==n.layout.get("icon-text-fit")&&H&&l.hasIconData();if(v){const t=e.style.map.terrain?(t,r)=>e.style.map.terrain.getElevation(T,t,r):null,r="map"===n.layout.get("text-rotation-alignment");we(l,T.posMatrix,e,a,B,$,y,u,r,g,T.toUnwrapped(),f.width,f.height,U,t)}const Z=T.posMatrix,G=a&&k||q,W=v||G?Hr:B,X=V,J=h&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);let K;K=h?l.iconsInText?Ht(p.kind,I,x,y,v,G,e,Z,W,X,U,N,z,E):Ut(p.kind,I,x,y,v,G,e,Z,W,X,U,a,N,!0,E):$t(p.kind,I,x,y,v,G,e,Z,W,X,U,a,N,E);const Y={program:P,buffers:c,uniformValues:K,atlasTexture:A,atlasTextureIcon:O,atlasInterpolation:L,atlasInterpolationIcon:D,isSDF:h,hasHalo:J};if(w&&l.canOverlap){C=!0;const e=c.segments.get();for(const r of e)j.push({segments:new t.a0([r]),sortKey:r.sortKey,state:Y,terrainData:M})}else j.push({segments:c.segments,sortKey:0,state:Y,terrainData:M})}C&&j.sort(((e,t)=>e.sortKey-t.sortKey));for(const t of j){const r=t.state;if(p.activeTexture.set(m.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,m.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(m.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Jr(r.buffers,t.segments,n,e,r.program,S,d,h,i,t.terrainData)),i.u_is_halo=0}Jr(r.buffers,t.segments,n,e,r.program,S,d,h,r.uniformValues,t.terrainData)}}function Jr(e,t,r,n,i,a,s,o,l,c){const u=n.context;i.draw(u,u.gl.TRIANGLES,a,s,o,Vr.disabled,l,c,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Kr(e,r,n,i){const a=e.context,s=a.gl,o=Br.disabled,l=new zr([s.ONE,s.ONE],t.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;const u=i.key;let d=n.heatmapFbos.get(u);d||(d=Qr(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,d)),a.bindFramebuffer.set(d.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:t.aM.transparent});const h=c.programConfigurations.get(n.id),p=e.useProgram("heatmap",h),m=e.style.map.terrain.getTerrainData(i);p.draw(a,s.TRIANGLES,Rr.disabled,o,l,Vr.disabled,Mt(i.posMatrix,r,e.transform.zoom,n.paint.get("heatmap-intensity")),m,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,e.transform.zoom,h)}function Yr(e,t,r){const n=e.context,i=n.gl;n.setColorMode(e.colorModeForRenderPass());const a=en(n,t),s=r.key,o=t.heatmapFbos.get(s);o&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Rr.disabled,Br.disabled,e.colorModeForRenderPass(),Vr.disabled,Nt(e,t,0,1),null,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,e.transform.zoom),o.destroy(),t.heatmapFbos.delete(s))}function Qr(e,t,r){var n,i;const a=e.gl,s=a.createTexture();a.bindTexture(a.TEXTURE_2D,s),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);const o=null!==(n=e.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=e.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,t,r,0,a.RGBA,o,null);const c=e.createFramebuffer(t,r,!1,!1);return c.colorAttachment.set(s),c}function en(e,t){return t.colorRampTexture||(t.colorRampTexture=new b(e,t.colorRamp,e.gl.RGBA)),t.colorRampTexture}function tn(e,t,r,n,i){if(!r||!n||!n.imageAtlas)return;const a=n.imageAtlas.patternPositions;let s=a[r.to.toString()],o=a[r.from.toString()];if(!s&&o&&(s=o),!o&&s&&(o=s),!s||!o){const e=i.getPaintProperty(t);s=a[e],o=a[e]}s&&o&&e.setConstantPatternPositions(s,o)}function rn(e,t,r,n,i,a,s){const o=e.context.gl,l="fill-pattern",c=r.paint.get(l),u=c&&c.constantOr(1),d=r.getCrossfadeParameters();let h,p,m,f,g;s?(p=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=o.LINES):(p=u?"fillPattern":"fill",h=o.TRIANGLES);const _=c.constantOr(null);for(const y of n){const n=t.getTile(y);if(u&&!n.patternsLoaded())continue;const c=n.getBucket(r);if(!c)continue;const v=c.programConfigurations.get(r.id),x=e.useProgram(p,v),b=e.style.map.terrain&&e.style.map.terrain.getTerrainData(y);u&&(e.context.activeTexture.set(o.TEXTURE0),n.imageAtlasTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),v.updatePaintBuffers(d)),tn(v,l,_,n,r);const w=b?y:null,C=e.translatePosMatrix(w?w.posMatrix:y.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(s){f=c.indexBuffer2,g=c.segments2;const t=[o.drawingBufferWidth,o.drawingBufferHeight];m="fillOutlinePattern"===p&&u?jt(C,e,d,n,t):kt(C,t)}else f=c.indexBuffer,g=c.segments,m=u?St(C,e,d,n):Ct(C);x.draw(e.context,h,i,e.stencilModeForClipping(y),a,Vr.disabled,m,b,r.id,c.layoutVertexBuffer,f,g,r.paint,e.transform.zoom,v)}}function nn(e,t,r,n,i,a,s){const o=e.context,l=o.gl,c="fill-extrusion-pattern",u=r.paint.get(c),d=u.constantOr(1),h=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),m=u.constantOr(null);for(const f of n){const n=t.getTile(f),u=n.getBucket(r);if(!u)continue;const g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(f),_=u.programConfigurations.get(r.id),y=e.useProgram(d?"fillExtrusionPattern":"fillExtrusion",_);d&&(e.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers(h)),tn(_,c,m,n,r);const v=e.translatePosMatrix(f.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),x=r.paint.get("fill-extrusion-vertical-gradient"),b=d?wt(v,e,x,p,f,h,n):bt(v,e,x,p);y.draw(o,o.gl.TRIANGLES,i,a,s,Vr.backCCW,b,g,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,e.transform.zoom,_,e.style.map.terrain&&u.centroidVertexBuffer)}}function an(e,t,r,n,i,a,s){const o=e.context,l=o.gl,c=r.fbo;if(!c)return;const u=e.useProgram("hillshade"),d=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);o.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(o,l.TRIANGLES,i,a,s,Vr.disabled,((e,t,r,n)=>{const i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),s=r.paint.get("hillshade-accent-color");let o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=e.transform.angle);const l=!e.options.moving;return{u_matrix:n?n.posMatrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:At(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:i,u_highlight:a,u_accent:s}})(e,r,n,d?t:null),d,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}function sn(e,r,n,i,a,s){const o=e.context,l=o.gl,c=r.dem;if(c&&c.data){const u=c.dim,d=c.stride,h=c.getPixels();if(o.activeTexture.set(l.TEXTURE1),o.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(d),r.demTexture){const e=r.demTexture;e.update(h,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new b(o,h,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);o.activeTexture.set(l.TEXTURE0);let p=r.fbo;if(!p){const e=new b(o,{width:u,height:u,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.fbo=o.createFramebuffer(u,u,!0,!1),p.colorAttachment.set(e.texture)}o.bindFramebuffer.set(p.framebuffer),o.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(o,l.TRIANGLES,i,a,s,Vr.disabled,((e,r)=>{const n=r.stride,i=t.H();return t.aP(i,0,t.X,-t.X,0,0,1),t.J(i,i,[0,-t.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function on(e,r,n,i,s,o){const l=i.paint.get("raster-fade-duration");if(!o&&l>0){const i=a.now(),o=(i-e.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),d=s.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-d)>Math.abs(e.tileID.overscaledZ-d),p=h&&e.refreshedUponExpiration?1:t.ac(h?o:1-c,0,1);return e.refreshedUponExpiration&&o>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}const ln=new t.aM(1,0,0,1),cn=new t.aM(0,1,0,1),un=new t.aM(0,0,1,1),dn=new t.aM(1,0,1,1),hn=new t.aM(0,1,1,1);function pn(e,t,r,n){fn(e,0,t+r/2,e.transform.width,r,n)}function mn(e,t,r,n){fn(e,t-r/2,0,r,e.transform.height,n)}function fn(e,t,r,n,i,a){const s=e.context,o=s.gl;o.enable(o.SCISSOR_TEST),o.scissor(t*e.pixelRatio,r*e.pixelRatio,n*e.pixelRatio,i*e.pixelRatio),s.clear({color:a}),o.disable(o.SCISSOR_TEST)}function gn(e,r,n){const i=e.context,a=i.gl,s=n.posMatrix,o=e.useProgram("debug"),l=Rr.disabled,c=Br.disabled,u=e.colorModeForRenderPass(),d="$debug",h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);const p=r.getTileByID(n.key).latestRawTileData,m=Math.floor((p&&p.byteLength||0)/1024),f=r.getTile(n).tileSize,g=512/Math.min(f,512)*(n.overscaledZ/e.transform.zoom)*.5;let _=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(_+=` => ${n.overscaledZ}`),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)}(e,`${_} ${m}kB`),o.draw(i,a.TRIANGLES,l,c,zr.alphaBlended,Vr.disabled,Pt(s,t.aM.transparent,g),null,d,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),o.draw(i,a.LINE_STRIP,l,c,u,Vr.disabled,Pt(s,t.aM.red),h,d,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function _n(e,t,r){const n=e.context,i=n.gl,a=e.colorModeForRenderPass(),s=new Rr(i.LEQUAL,Rr.ReadWrite,e.depthRangeFor3D),o=e.useProgram("terrain"),l=t.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height]);for(const c of r){const r=e.renderToTexture.getTexture(c),u=t.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);const d=e.transform.calculatePosMatrix(c.tileID.toUnwrapped()),h=t.getMeshFrameDelta(e.transform.zoom),p=e.transform.calculateFogMatrix(c.tileID.toUnwrapped()),m=_t(d,h,p,e.style.sky,e.transform.pitch);o.draw(n,i.TRIANGLES,s,Br.disabled,a,Vr.backCCW,m,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class yn{constructor(e,t,r){this.vertexBuffer=e,this.indexBuffer=t,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class vn{constructor(e,r){this.context=new Or(e),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=de.maxUnderzooming+de.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ct}resize(e,t,r){if(this.width=Math.floor(e*r),this.height=Math.floor(t*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const n of this.style._order)this.style._layers[n].resize()}setup(){const e=this.context,r=new t.aX;r.emplaceBack(0,0),r.emplaceBack(t.X,0),r.emplaceBack(0,t.X),r.emplaceBack(t.X,t.X),this.tileExtentBuffer=e.createVertexBuffer(r,pt.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const n=new t.aX;n.emplaceBack(0,0),n.emplaceBack(t.X,0),n.emplaceBack(0,t.X),n.emplaceBack(t.X,t.X),this.debugBuffer=e.createVertexBuffer(n,pt.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const i=new t.$;i.emplaceBack(0,0,0,0),i.emplaceBack(t.X,0,t.X,0),i.emplaceBack(0,t.X,0,t.X),i.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=e.createVertexBuffer(i,Y.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const a=new t.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,pt.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const s=new t.aZ;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);const o=new t.aY;o.emplaceBack(0,1,2),o.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(o);const l=this.context.gl;this.stencilClearMode=new Br({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=t.H();t.aP(n,0,this.width,this.height,0,0,1),t.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Rr.disabled,this.stencilClearMode,zr.disabled,Vr.disabled,It(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;const r=this.context,n=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(zr.disabled),r.setDepthMode(Rr.disabled);const i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const a of t){const e=this._tileClippingMaskIDs[a.key]=this.nextStencilID++,t=this.style.map.terrain&&this.style.map.terrain.getTerrainData(a);i.draw(r,n.TRIANGLES,Rr.disabled,new Br({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),zr.disabled,Vr.disabled,It(a.posMatrix),t,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Br({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){const t=this.context.gl;return new Br({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)=>t.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 Br({func:t.GEQUAL,mask:255},r+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=i,[e,r]}return[{[n]:Br.disabled},r]}colorModeForRenderPass(){const e=this.context.gl;if(this._showOverdrawInspector){const r=1/8;return new zr([e.CONSTANT_COLOR,e.ONE],new t.aM(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?zr.unblended:zr.alphaBlended}depthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return Rr.disabled;const n=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Rr(r||this.context.gl.LEQUAL,t,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,r){this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(a.now()),this.imageManager.beginFrame();const n=this.style._order,i=this.style.sourceCaches,s={},o={},l={};for(const t in i){const e=i[t];e.used&&e.prepare(this.context),s[t]=e.getVisibleCoordinates(),o[t]=s[t].slice().reverse(),l[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<n.length;t++)if(this.style._layers[n[t]].is3D()){this.opaquePassCutoff=t;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const t of n){const e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const r=o[e.source];("custom"===e.type||r.length)&&this.renderLayer(this,i[e.source],e,r)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.aM.black:t.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(e,r){const n=e.context,i=n.gl,a=((e,t,r)=>({u_sky_color:e.properties.get("sky-color"),u_horizon_color:e.properties.get("horizon-color"),u_horizon:(t.height/2+t.getHorizon())*r,u_sky_horizon_blend:e.properties.get("sky-horizon-blend")*t.height/2*r}))(r,e.style.map.transform,e.pixelRatio),s=new Rr(i.LEQUAL,Rr.ReadWrite,[0,1]),o=Br.disabled,l=e.colorModeForRenderPass(),c=e.useProgram("sky");if(!r.mesh){const e=new t.aX;e.emplaceBack(-1,-1),e.emplaceBack(1,-1),e.emplaceBack(1,1),e.emplaceBack(-1,1);const i=new t.aY;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),r.mesh=new yn(n.createVertexBuffer(e,pt.members),n.createIndexBuffer(i),t.a0.simpleSegment(0,0,e.length,i.length))}c.draw(n,i.TRIANGLES,s,o,l,Vr.disabled,a,void 0,"sky",r.mesh.vertexBuffer,r.mesh.indexBuffer,r.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const e=this.style._layers[n[this.currentLayer]],t=i[e.source],r=s[e.source];this._renderTileClippingMasks(e,r),this.renderLayer(this,t,e,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const e=this.style._layers[n[this.currentLayer]],t=i[e.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(e))continue;const r=("symbol"===e.type?l:o)[e.source];this._renderTileClippingMasks(e,s[e.source]),this.renderLayer(this,t,e,r)}if(this.options.showTileBoundaries){const e=function(e,t){let r=null;const n=Object.values(e._layers).flatMap((r=>r.source&&!r.isHidden(t)?[e.sourceCaches[r.source]]:[])),i=n.filter((e=>"vector"===e.getSource().type)),a=n.filter((e=>"vector"!==e.getSource().type)),s=e=>{(!r||r.getSource().maxzoom<e.getSource().maxzoom)&&(r=e)};return i.forEach((e=>s(e))),r||a.forEach((e=>s(e))),r}(this.style,this.transform.zoom);e&&function(e,t,r){for(let n=0;n<r.length;n++)gn(e,t,r[n])}(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){const t=e.transform.padding;pn(e,e.transform.height-(t.top||0),3,ln),pn(e,t.bottom||0,3,cn),mn(e,t.left||0,3,un),mn(e,e.transform.width-(t.right||0),3,dn);const r=e.transform.centerPoint;!function(e,t,r,n){fn(e,t-1,r-10,2,20,n),fn(e,t-10,r-1,20,2,n)}(e,r.x,e.transform.height-r.y,hn)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const r=this.terrainFacilitator.matrix,n=this.transform.modelViewProjectionMatrix;let i=this.terrainFacilitator.dirty;i||(i=e?!t.a_(r,n):!t.a$(r,n)),i||(i=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),i&&(t.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,r){const n=e.context,i=n.gl,a=zr.unblended,s=new Rr(i.LEQUAL,Rr.ReadWrite,[0,1]),o=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=e.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1});for(const t of l){const l=r.getTerrainData(t.tileID),u={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};c.draw(n,i.TRIANGLES,s,Br.disabled,a,Vr.backCCW,u,l,"terrain",o.vertexBuffer,o.indexBuffer,o.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,r){const n=e.context,i=n.gl,a=zr.unblended,s=new Rr(i.LEQUAL,Rr.ReadWrite,[0,1]),o=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=e.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1}),r.coordsIndex=[];for(const t of c){const c=r.getTerrainData(t.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);const d={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};u.draw(n,i.TRIANGLES,s,Br.disabled,a,Vr.backCCW,d,c,"terrain",o.vertexBuffer,o.indexBuffer,o.segments),r.coordsIndex.push(t.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(e,r,n,i,a){if("translucent"!==e.renderPass)return;const s=Br.disabled,o=e.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,r,n,i,a,s,o,l,c){const u=r.transform,d=rt(),h="map"===a,p="map"===s;for(const m of e){const e=i.getTile(m),a=e.getBucket(n);if(!a||!a.text||!a.text.segments.get().length)continue;const s=t.ag(a.textSizeData,u.zoom),f=Oe(e,1,r.transform.zoom),g=_e(m.posMatrix,p,h,r.transform,f),_="none"!==n.layout.get("icon-text-fit")&&a.hasIconData();if(s){const t=Math.pow(2,u.zoom-e.tileID.overscaledZ),n=r.style.map.terrain?(e,t)=>r.style.map.terrain.getElevation(m,e,t):null,i=d.translatePosition(u,e,o,l);Gr(a,h,p,c,u,g,m.posMatrix,t,s,_,d,i,m.toUnwrapped(),n)}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&Xr(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),s,o),0!==n.paint.get("text-opacity").constantOr(1)&&Xr(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),s,o),r.map.showCollisionBoxes&&(Ur(e,r,n,i,!0),Ur(e,r,n,i,!1))}(e,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(e,r,n,i){if("translucent"!==e.renderPass)return;const a=n.paint.get("circle-opacity"),s=n.paint.get("circle-stroke-width"),o=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===s.constantOr(1)||0===o.constantOr(1)))return;const c=e.context,u=c.gl,d=e.depthModeForSublayer(0,Rr.ReadOnly),h=Br.disabled,p=e.colorModeForRenderPass(),m=[];for(let f=0;f<i.length;f++){const a=i[f],s=r.getTile(a),o=s.getBucket(n);if(!o)continue;const c=o.programConfigurations.get(n.id),u=e.useProgram("circle",c),d=o.layoutVertexBuffer,h=o.indexBuffer,p=e.style.map.terrain&&e.style.map.terrain.getTerrainData(a),g={programConfiguration:c,program:u,layoutVertexBuffer:d,indexBuffer:h,uniformValues:Et(e,a,s,n),terrainData:p};if(l){const e=o.segments.get();for(const r of e)m.push({segments:new t.a0([r]),sortKey:r.sortKey,state:g})}else m.push({segments:o.segments,sortKey:0,state:g})}l&&m.sort(((e,t)=>e.sortKey-t.sortKey));for(const t of m){const{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:s,uniformValues:o,terrainData:l}=t.state;i.draw(c,u.TRIANGLES,d,h,p,Vr.disabled,o,l,n.id,a,s,t.segments,n.paint,e.transform.zoom,r)}}(e,r,n,i);break;case"heatmap":!function(e,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;const a=e.context;if(e.style.map.terrain){for(const t of i){const i=r.getTile(t);r.hasRenderableParent(t)||("offscreen"===e.renderPass?Kr(e,i,n,t):"translucent"===e.renderPass&&Yr(e,n,t))}a.viewport.set([0,0,e.width,e.height])}else"offscreen"===e.renderPass?function(e,r,n,i){const a=e.context,s=a.gl,o=Br.disabled,l=new zr([s.ONE,s.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(e,r,n){const i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(t.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=Qr(e,r.width/4,r.height/4),n.heatmapFbos.set(t.aU,a))})(a,e,n),a.clear({color:t.aM.transparent});for(let t=0;t<i.length;t++){const c=i[t];if(r.hasRenderableParent(c))continue;const u=r.getTile(c),d=u.getBucket(n);if(!d)continue;const h=d.programConfigurations.get(n.id),p=e.useProgram("heatmap",h),{zoom:m}=e.transform;p.draw(a,s.TRIANGLES,Rr.disabled,o,l,Vr.disabled,Mt(c.posMatrix,u,m,n.paint.get("heatmap-intensity")),null,n.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,n.paint,e.transform.zoom,h)}a.viewport.set([0,0,e.width,e.height])}(e,r,n,i):"translucent"===e.renderPass&&function(e,r){const n=e.context,i=n.gl;n.setColorMode(e.colorModeForRenderPass());const a=r.heatmapFbos.get(t.aU);a&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),en(n,r).bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Rr.disabled,Br.disabled,e.colorModeForRenderPass(),Vr.disabled,Nt(e,r,0,1),null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom))}(e,n)}(e,r,n,i);break;case"line":!function(e,r,n,i){if("translucent"!==e.renderPass)return;const a=n.paint.get("line-opacity"),s=n.paint.get("line-width");if(0===a.constantOr(1)||0===s.constantOr(1))return;const o=e.depthModeForSublayer(0,Rr.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),d=u.constantOr(1),h=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),m=d?"linePattern":c?"lineSDF":h?"lineGradient":"line",f=e.context,g=f.gl;let _=!0;for(const y of i){const i=r.getTile(y);if(d&&!i.patternsLoaded())continue;const a=i.getBucket(n);if(!a)continue;const s=a.programConfigurations.get(n.id),v=e.context.program.get(),x=e.useProgram(m,s),w=_||x.program!==v,C=e.style.map.terrain&&e.style.map.terrain.getTerrainData(y),S=u.constantOr(null);if(S&&i.imageAtlas){const e=i.imageAtlas,t=e.patternPositions[S.to.toString()],r=e.patternPositions[S.from.toString()];t&&r&&s.setConstantPatternPositions(t,r)}const k=C?y:null,j=d?zt(e,i,n,p,k):c?Ot(e,i,n,c,p,k):h?Dt(e,i,n,a.lineClipsArray.length,k):Lt(e,i,n,k);if(d)f.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),s.updatePaintBuffers(p);else if(c&&(w||e.lineAtlas.dirty))f.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(f);else if(h){const i=a.gradients[n.id];let s=i.texture;if(n.gradientVersion!==i.version){let o=256;if(n.stepInterpolant){const n=r.getSource().maxzoom,i=y.canonical.z===n?Math.ceil(1<<e.transform.maxZoom-y.canonical.z):1;o=t.ac(t.aV(a.maxLineLength/t.X*1024*i),256,f.maxTextureSize)}i.gradient=t.aW({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:o,image:i.gradient||void 0,clips:a.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new b(f,i.gradient,g.RGBA),i.version=n.gradientVersion,s=i.texture}f.activeTexture.set(g.TEXTURE0),s.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}x.draw(f,g.TRIANGLES,o,e.stencilModeForClipping(y),l,Vr.disabled,j,C,n.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,n.paint,e.transform.zoom,s,a.layoutVertexBuffer2),_=!1}}(e,r,n,i);break;case"fill":!function(e,r,n,i){const a=n.paint.get("fill-color"),s=n.paint.get("fill-opacity");if(0===s.constantOr(1))return;const o=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.aM.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){const t=e.depthModeForSublayer(1,"opaque"===e.renderPass?Rr.ReadWrite:Rr.ReadOnly);rn(e,r,n,i,t,o,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){const t=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Rr.ReadOnly);rn(e,r,n,i,t,o,!0)}}(e,r,n,i);break;case"fill-extrusion":!function(e,t,r,n){const i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===e.renderPass){const a=new Rr(e.context.gl.LEQUAL,Rr.ReadWrite,e.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))nn(e,t,r,n,a,Br.disabled,zr.disabled),nn(e,t,r,n,a,e.stencilModeFor3D(),e.colorModeForRenderPass());else{const i=e.colorModeForRenderPass();nn(e,t,r,n,a,Br.disabled,i)}}}(e,r,n,i);break;case"hillshade":!function(e,t,r,n){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;const i=e.context,a=e.depthModeForSublayer(0,Rr.ReadOnly),s=e.colorModeForRenderPass(),[o,l]="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n];for(const c of l){const n=t.getTile(c);void 0!==n.needsHillshadePrepare&&n.needsHillshadePrepare&&"offscreen"===e.renderPass?sn(e,n,r,a,Br.disabled,s):"translucent"===e.renderPass&&an(e,c,n,r,a,o[c.overscaledZ],s)}i.viewport.set([0,0,e.width,e.height])}(e,r,n,i);break;case"raster":!function(e,t,r,n){if("translucent"!==e.renderPass)return;if(0===r.paint.get("raster-opacity"))return;if(!n.length)return;const i=e.context,a=i.gl,s=t.getSource(),o=e.useProgram("raster"),l=e.colorModeForRenderPass(),[c,u]=s instanceof Q?[{},n]:e.stencilConfigForOverlap(n),d=u[u.length-1].overscaledZ,h=!e.options.moving;for(const p of u){const n=e.depthModeForSublayer(p.overscaledZ-d,1===r.paint.get("raster-opacity")?Rr.ReadWrite:Rr.ReadOnly,a.LESS),u=t.getTile(p);u.registerFadeDuration(r.paint.get("raster-fade-duration"));const m=t.findLoadedParent(p,0),f=t.findLoadedSibling(p),g=on(u,m||f||null,t,r,e.transform,e.style.map.terrain);let _,y;const v="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),u.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),m?(m.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),_=Math.pow(2,m.tileID.overscaledZ-u.tileID.overscaledZ),y=[u.tileID.canonical.x*_%1,u.tileID.canonical.y*_%1]):u.texture.bind(v,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),u.texture.useMipmap&&i.extTextureFilterAnisotropic&&e.transform.pitch>20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);const x=e.style.map.terrain&&e.style.map.terrain.getTerrainData(p),b=x?p:null,w=b?b.posMatrix:e.transform.calculatePosMatrix(p.toUnwrapped(),h),C=Bt(w,y||[0,0],_||1,g,r);s instanceof Q?o.draw(i,a.TRIANGLES,n,Br.disabled,l,Vr.disabled,C,x,r.id,s.boundsBuffer,e.quadTriangleIndexBuffer,s.boundsSegments):o.draw(i,a.TRIANGLES,n,c[p.overscaledZ],l,Vr.disabled,C,x,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}(e,r,n,i);break;case"background":!function(e,t,r,n){const i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;const s=e.context,o=s.gl,l=e.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(e.isPatternMissing(u))return;const d=!u&&1===i.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==d)return;const h=Br.disabled,p=e.depthModeForSublayer(0,"opaque"===d?Rr.ReadWrite:Rr.ReadOnly),m=e.colorModeForRenderPass(),f=e.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:e.style.map.terrain});u&&(s.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));const _=r.getCrossfadeParameters();for(const y of g){const t=n?y.posMatrix:e.transform.calculatePosMatrix(y.toUnwrapped()),l=u?Zt(t,a,e,u,{tileID:y,tileSize:c},_):qt(t,a,i),d=e.style.map.terrain&&e.style.map.terrain.getTerrainData(y);f.draw(s,o.TRIANGLES,p,h,m,Vr.disabled,l,d,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}(e,0,n,i);break;case"custom":!function(e,t,r){const n=e.context,i=r.implementation;if("offscreen"===e.renderPass){const t=i.prerender;t&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),t.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Br.disabled);const t="3d"===i.renderingMode?new Rr(e.context.gl.LEQUAL,Rr.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Rr.ReadOnly);n.setDepthMode(t),i.render(n.gl,e.transform.customLayerMatrix(),{farZ:e.transform.farZ,nearZ:e.transform.nearZ,fov:e.transform._fov,modelViewProjectionMatrix:e.transform.modelViewProjectionMatrix,projectionMatrix:e.transform.projectionMatrix}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}(e,0,n)}}translatePosMatrix(e,r,n,i,a){if(!n[0]&&!n[1])return e;const s=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(s){const e=Math.sin(s),t=Math.cos(s);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const o=[a?n[0]:Oe(r,n[0],this.transform.zoom),a?n[1]:Oe(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return t.J(l,e,o),l}saveTileTexture(e){const t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r}useProgram(e,t){this.cache=this.cache||{};const r=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new vt(this.context,mt[e],t,Gt[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){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 b(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}class xn{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,r,n){const i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((n=>{const a=1/(n=t.af([],n,e))[3]/r*i;return t.b1(n,n,[a,a,1/n[3],a])})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}([],function(e,t,r){var n=t[0],i=t[1],a=t[2],s=r[0],o=r[1],l=r[2];return e[0]=i*l-a*o,e[1]=a*s-n*l,e[2]=n*o-i*s,e}([],_([],a[e[0]],a[e[1]]),_([],a[e[2]],a[e[1]]))),r=-((n=t)[0]*(i=a[e[1]])[0]+n[1]*i[1]+n[2]*i[2]);var n,i;return t.concat(r)}));return new xn(a,s)}}class bn{constructor(e,t){this.min=e,this.max=t,this.center=function(e,t){return e[0]=.5*t[0],e[1]=.5*t[1],e[2]=.5*t[2],e}([],function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}([],this.min,this.max))}quadrant(e){const t=[e%2==0,e<2],r=f(this.min),n=f(this.max);for(let i=0;i<t.length;i++)r[i]=t[i]?this.min[i]:this.center[i],n[i]=t[i]?this.center[i]:this.max[i];return n[2]=this.max[2],new bn(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]}intersects(e){const r=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let n=!0;for(let i=0;i<e.planes.length;i++){const a=e.planes[i];let s=0;for(let e=0;e<r.length;e++)t.b2(a,r[e])>=0&&s++;if(0===s)return 0;s!==r.length&&(n=!1)}if(n)return 2;for(let t=0;t<3;t++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;i<e.points.length;i++){const a=e.points[i][t]-this.min[t];r=Math.min(r,a),n=Math.max(n,a)}if(n<0||r>this.max[t]-this.min[t])return 0}return 1}}class wn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]: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(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.y.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.y.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.y.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.y.number(e.right,r.right,n)),this}getCenter(e,r){const n=t.ac((this.left+e-this.right)/2,0,e),i=t.ac((this.top+r-this.bottom)/2,0,r);return new t.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 wn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Cn=85.051129;class Sn{constructor(e,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new Sn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}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}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const r=-t.b3(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=function(){var e=new t.A(4);return t.A!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}(),function(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);e[0]=n*l+a*o,e[1]=i*l+s*o,e[2]=n*-o+a*l,e[3]=i*-o+s*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const r=t.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}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._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}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._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}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())}get centerPoint(){return this._edgeInsets.getCenter(this.width,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(e){const r=[new t.b4(0,e)];if(this._renderWorldCopies){const n=this.pointCoordinate(new t.P(0,0)),i=this.pointCoordinate(new t.P(this.width,0)),a=this.pointCoordinate(new t.P(this.width,this.height)),s=this.pointCoordinate(new t.P(0,this.height)),o=Math.floor(Math.min(n.x,i.x,a.x,s.x)),l=Math.floor(Math.max(n.x,i.x,a.x,s.x)),c=1;for(let u=o-c;u<=l+c;u++)0!==u&&r.push(new t.b4(u,e))}return r}coveringTiles(e){var r,n;let i=this.coveringZoomLevel(e);const a=i;if(void 0!==e.minzoom&&i<e.minzoom)return[];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);const s=this.pointCoordinate(this.getCameraPoint()),o=t.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*s.x,l*s.y,0],u=[l*o.x,l*o.y,0],d=xn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i);let h=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(h=i);const p=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,m=e=>({aabb:new bn([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),f=[],g=[],_=i,v=e.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let t=1;t<=3;t++)f.push(m(-t)),f.push(m(t));for(f.push(m(0));f.length>0;){const i=f.pop(),a=i.x,s=i.y;let o=i.fullyVisible;if(!o){const e=i.aabb.intersects(d);if(0===e)continue;o=2===e}const l=e.terrain?c:u,m=i.aabb.distanceX(l),x=i.aabb.distanceY(l),b=Math.max(Math.abs(m),Math.abs(x));if(i.zoom===_||b>p+(1<<_-i.zoom)-2&&i.zoom>=h){const e=_-i.zoom,r=c[0]-.5-(a<<e),n=c[1]-.5-(s<<e);g.push({tileID:new t.S(i.zoom===_?v:i.zoom,i.wrap,i.zoom,a,s),distanceSq:y([u[0]-.5-a,u[1]-.5-s]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let c=0;c<4;c++){const l=(a<<1)+c%2,u=(s<<1)+(c>>1),d=i.zoom+1;let h=i.aabb.quadrant(c);if(e.terrain){const a=new t.S(d,i.wrap,d,l,u),s=e.terrain.getMinMaxElevation(a),o=null!==(r=s.minElevation)&&void 0!==r?r:this.elevation,c=null!==(n=s.maxElevation)&&void 0!==n?n:this.elevation;h=new bn([h.min[0],h.min[1],o],[h.max[0],h.max[1],c])}f.push({aabb:h,zoom:d,x:l,y:u,wrap:i.wrap,fullyVisible:o})}}return g.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.log(e)/Math.LN2}project(e){const r=t.ac(e.lat,-85.051129,Cn);return new t.P(t.O(e.lng)*this.worldSize,t.Q(r)*this.worldSize)}unproject(e){return new t.Z(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){const r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,e),a=e.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;const s=n+r-a,o=Math.cos(this._pitch)*this.cameraToCenterDistance/s/t.b5(1,i.lat),l=this.scaleZoom(o/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(e,r){const n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),s=new t.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(s),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),t.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(e){return t.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,r){if(r){const t=r.pointCoordinate(e);if(null!=t)return t}const n=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.af(n,n,this.pixelMatrixInverse),t.af(i,i,this.pixelMatrixInverse);const a=n[3],s=i[3],o=n[1]/a,l=i[1]/s,c=n[2]/a,u=i[2]/s,d=c===u?0:(0-c)/(u-c);return new t.Z(t.y.number(n[0]/a,i[0]/s,d)/this.worldSize,t.y.number(o,l,d)/this.worldSize)}coordinatePoint(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.pixelMatrix;const i=[e.x*this.worldSize,e.y*this.worldSize,r,1];return t.af(i,i,n),new t.P(i[0]/i[3],i[1]/i[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return(new Z).extend(this.pointLocation(new t.P(0,e))).extend(this.pointLocation(new t.P(this.width,e))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Z([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Cn])}calculateTileMatrix(e){const r=e.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*e.wrap,a=t.an(new Float64Array(16));return t.J(a,a,[i*n,r.y*n,0]),t.K(a,a,[n/t.X,n/t.X,1]),a}calculatePosMatrix(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];const a=this.calculateTileMatrix(e);return t.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(e){const r=e.key,n=this._fogMatrixCache;if(n[r])return n[r];const i=this.calculateTileMatrix(e);return t.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,r){r=t.ac(+r,this.minZoom,this.maxZoom);const n={center:new t.N(e.lng,e.lat),zoom:r};let i=this.lngRange;if(!this._renderWorldCopies&&null===i){const e=180-1e-10;i=[-e,e]}const a=this.tileSize*this.zoomScale(n.zoom);let s=0,o=a,l=0,c=a,u=0,d=0;const{x:h,y:p}=this.size;if(this.latRange){const e=this.latRange;s=t.Q(e[1])*a,o=t.Q(e[0])*a,o-s<p&&(u=p/(o-s))}i&&(l=t.b3(t.O(i[0])*a,0,a),c=t.b3(t.O(i[1])*a,0,a),c<l&&(c+=a),c-l<h&&(d=h/(c-l)));const{x:m,y:f}=this.project.call({worldSize:a},e);let g,_;const y=Math.max(d||0,u||0);if(y){const e=new t.P(d?(c+l)/2:m,u?(o+s)/2:f);return n.center=this.unproject.call({worldSize:a},e).wrap(),n.zoom+=this.scaleZoom(y),n}if(this.latRange){const e=p/2;f-e<s&&(_=s+e),f+e>o&&(_=o-e)}if(i){const e=(l+c)/2;let r=m;this._renderWorldCopies&&(r=t.b3(m,e-a/2,e+a/2));const n=h/2;r-n<l&&(g=l+n),r+n>c&&(g=c-n)}if(void 0!==g||void 0!==_){const e=new t.P(null!=g?g:m,null!=_?_:f);n.center=this.unproject.call({worldSize:a},e).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:t,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=r,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let i=t.an(new Float64Array(16));t.K(i,i,[this.width/2,-this.height/2,1]),t.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=t.an(new Float64Array(16)),t.K(i,i,[1,-1,1]),t.J(i,i,[-1,-1,0]),t.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;const a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),s=Math.min(this.elevation,this.minElevationForCurrentTile),o=a-s*this._pixelPerMeter/Math.cos(this._pitch),l=s<0?o:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+e.y/this.height),d=Math.sin(u)*l/Math.sin(t.ac(Math.PI-c-u,.01,Math.PI-.01)),h=this.getHorizon(),p=2*Math.atan(h/this.cameraToCenterDistance)*(.5+e.y/(2*h)),m=Math.sin(p)*l/Math.sin(t.ac(Math.PI-c-p,.01,Math.PI-.01)),f=Math.min(d,m);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*f+l),this.nearZ=this.height/50,i=new Float64Array(16),t.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-e.x/this.width,i[9]=2*e.y/this.height,this.projectionMatrix=t.ae(i),t.K(i,i,[1,-1,1]),t.J(i,i,[0,0,-this.cameraToCenterDistance]),t.b7(i,i,this._pitch),t.ad(i,i,this.angle),t.J(i,i,[-r,-n,0]),this.mercatorMatrix=t.K([],i,[this.worldSize,this.worldSize,this.worldSize]),t.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,i),t.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=t.as([],i),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,i);const g=this.width%2/2,_=this.height%2/2,y=Math.cos(this.angle),v=Math.sin(this.angle),x=r-Math.round(r)+y*g+v*_,b=n-Math.round(n)+y*_+v*g,w=new Float64Array(i);if(t.J(w,w,[x>.5?x-1:x,b>.5?b-1:b,0]),this.alignedModelViewProjectionMatrix=w,i=t.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new t.P(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,e))}getCameraQueryGeometry(e){const r=this.getCameraPoint();if(1===e.length)return[e[0],r];{let n=r.x,i=r.y,a=r.x,s=r.y;for(const t of e)n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),s=Math.max(s,t.y);return[new t.P(n,i),new t.P(a,i),new t.P(a,s),new t.P(n,s),new t.P(n,i)]}}lngLatToCameraDepth(e,r){const n=this.locationCoordinate(e),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return t.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function kn(e,t){var r=this;let n,i=!1,a=null,s=null;const o=()=>{a=null,i&&(e.apply(s,n),a=setTimeout(o,t),i=!1)};return function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return i=!0,s=r,n=t,a||o(),a}}class jn{constructor(e){this._getCurrentHash=()=>{const e=window.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("/")},this._onHashChange=()=>{const e=this._getCurrentHash();if(e.length>=3&&!e.some((e=>isNaN(e)))){const t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const e=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{const e=this._getCurrentHash();if(0===e.length)return;const t=e.join("/");let r=t;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${t}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=kn(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const t=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(t.lng*i)/i,s=Math.round(t.lat*i)/i,o=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=e?`/${a}/${s}/${r}`:`${r}/${s}/${a}
2`,(o||l)&&(c+="/"+Math.round(10*o)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const e=this._hashName;let t=!1;const r=window.location.hash.slice(1).split("&").map((r=>{const n=r.split("=")[0];return n===e?(t=!0,`${n}=${c}`):r})).filter((e=>e));return t||r.push(`${e}=${c}`),`#${r.join("&")}`}return`#${c}`}}const En={linearity:.3,easing:t.b8(0,0,.3,1)},Tn=t.e({deceleration:2500,maxSpeed:1400},En),Pn=t.e({deceleration:20,maxSpeed:1400},En),In=t.e({deceleration:1e3,maxSpeed:360},En),Mn=t.e({deceleration:1e3,maxSpeed:90},En);class Nn{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,t=a.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,t.panDelta&&r.pan._add(t.panDelta),t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const a=Ln(r.pan.mag(),n,t.e({},Tn,e||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,An(i,a)}if(r.zoom){const e=Ln(r.zoom,n,Pn);i.zoom=this._map.transform.zoom+e.amount,An(i,e)}if(r.bearing){const e=Ln(r.bearing,n,In);i.bearing=this._map.transform.bearing+t.ac(e.amount,-179,179),An(i,e)}if(r.pitch){const e=Ln(r.pitch,n,Mn);i.pitch=this._map.transform.pitch+e.amount,An(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(),t.e(i,{noMoveStart:!0})}}function An(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Ln(e,r,n){const{maxSpeed:i,linearity:a,deceleration:s}=n,o=t.ac(e*a/(r/1e3),-i,i),l=Math.abs(o)/(s*a);return{easing:n.easing,duration:1e3*l,amount:o*(l/2)}}class Dn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=s.mousePos(r.getCanvas(),n),o=r.unproject(a);super(e,t.e({point:a,lngLat:o,originalEvent:n},i)),this._defaultPrevented=!1,this.target=r}}class zn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,n){const i="touchend"===e?n.changedTouches:n.touches,a=s.touchPos(r.getCanvasContainer(),i),o=a.map((e=>r.unproject(e))),l=a.reduce(((e,t,r,n)=>e.add(t.div(n.length))),new t.P(0,0));super(e,{points:a,point:l,lngLats:o,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class On extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){super(e,{originalEvent:r}),this._defaultPrevented=!1}}class Rn{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new On(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Dn(e.type,this._map,e))}mouseup(e){this._map.fire(new Dn(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Dn(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Dn(e.type,this._map,e))}mouseover(e){this._map.fire(new Dn(e.type,this._map,e))}mouseout(e){this._map.fire(new Dn(e.type,this._map,e))}touchstart(e){return this._firePreventable(new zn(e.type,this._map,e))}touchmove(e){this._map.fire(new zn(e.type,this._map,e))}touchend(e){this._map.fire(new zn(e.type,this._map,e))}touchcancel(e){this._map.fire(new zn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Fn{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Dn(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Dn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Bn{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(t.P.convert(e),this._map.terrain)}}class Vn{constructor(e,t){this._map=e,this._tr=new Bn(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&&(s.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;const n=this._startPos;this._lastPos=r,this._box||(this._box=s.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const i=Math.min(n.x,r.x),a=Math.max(n.x,r.x),o=Math.min(n.y,r.y),l=Math.max(n.y,r.y);s.setTransform(this._box,`translate(${i}px,${o}px)`),this._box.style.width=a-i+"px",this._box.style.height=l-o+"px"}mouseupWindow(e,r){if(!this._active)return;if(0!==e.button)return;const n=this._startPos,i=r;if(this.reset(),s.suppressClick(),n.x!==i.x||n.y!==i.y)return this._map.fire(new t.k("boxzoomend",{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}
vendor: 26,407 bytes, line 2
2keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new t.k(e,{originalEvent:r}))}}function $n(e,t){if(e.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);const r={};for(let n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}class Un{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){const r=new t.P(0,0);for(const t of e)r._add(t);return r.div(e.length)}(r),this.touches=$n(n,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;const n=$n(r,t);for(const i in this.touches){const e=n[i];(!e||e.dist(this.touches[i])>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 Hn{constructor(e){this.singleTap=new Un(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,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 qn{constructor(e){this._tr=new Bn(e),this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({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),a=this._tr;return n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom-1,around:a.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}}class Zn{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(){const e=this._moveFunction(...arguments);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;const r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const n=t.length?t[0]:t;return!this._moved&&n.dist(r)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=n,this._move(r,n))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&s.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Gn={0:1,2:2};class Wn{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const t=s.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){const r=Gn[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton)}isValidEndEvent(e){return s.mouseButton(e)===this._eventButton}}class Xn{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}const Jn=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}},Kn=e=>{let{enable:t,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=e;const i=new Wn({checkCorrectEvent:e=>0===s.mouseButton(e)&&e.ctrlKey||2===s.mouseButton(e)});return new Zn({clickTolerance:r,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:i,enable:t,assignEvents:Jn})},Yn=e=>{let{enable:t,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=e;const i=new Wn({checkCorrectEvent:e=>0===s.mouseButton(e)&&e.ctrlKey||2===s.mouseButton(e)});return new Zn({clickTolerance:r,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:i,enable:t,assignEvents:Jn})};class Qn{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active){if(!this._shouldBePrevented(r.length))return e.preventDefault(),this._calculateTransform(e,t,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,n){n.length>0&&(this._active=!0);const i=$n(n,r),a=new t.P(0,0),s=new t.P(0,0);let o=0;for(const t in i){const e=i[t],r=this._touches[t];r&&(a._add(e),s._add(e.sub(r)),o++,i[t]=e)}if(this._touches=i,this._shouldBePrevented(o)||!s.mag())return;const l=s.div(o);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(o),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ei{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}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){if(!this._firstTwoTouches)return;e.preventDefault();const[n,i]=this._firstTwoTouches,a=ti(r,t,n),s=ti(r,t,i);if(!a||!s)return;const o=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],o,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;const[n,i]=this._firstTwoTouches,a=ti(r,t,n),o=ti(r,t,i);a&&o||(this._active&&s.suppressClick(),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 ti(e,t,r){for(let n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function ri(e,t){return Math.log(e/t)/Math.LN2}class ni extends ei{reset(){super.reset(),delete this._distance,delete this._startDistance}_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(ri(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ri(this._distance,r),pinchAround:t}}}function ii(e,t){return 180*e.angleWith(t)/Math.PI}class ai extends ei{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,r){const n=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ii(this._vector,n),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,r=ii(e,this._startVector);return Math.abs(r)<t}}function si(e){return Math.abs(e.y)>Math.abs(e.x)}class oi extends ei{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,si(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}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 void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const a=e.y>0==t.y>0;return si(e)&&si(t)&&a}}const li={panStep:100,bearingStep:15,pitchStep:10};class ci{constructor(e){this._tr=new Bn(e);const t=li;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,n=0,i=0,a=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(),a=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:s=>{const o=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:ui,zoom:t?Math.round(o.zoom)+t*(e.shiftKey?2:1):o.zoom,bearing:o.bearing+r*this._bearingStep,pitch:o.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:o.center},{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 ui(e){return e*(2-e)}const di=4.000244140625;class hi{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new Bn(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}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)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==t&&t%di==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_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 r=s.mousePos(this._map.getCanvas(),e),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?t.N.convert(this._aroundCenter?n.center:n.unproject(r)):t.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const e=this._tr.transform;if(0!==this._delta){const t="wheel"===this._type&&Math.abs(this._delta)>di?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==r&&(r=1/r);const n="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:e.zoom,n=this._startZoom,i=this._easing;let s,o=!1;const l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&n&&i&&l){const e=Math.min(l/200,1),a=i(e);s=t.y.number(n,r,a),e<1?this._frameId||(this._frameId=!0):o=!0}else s=r,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!o,zoomDelta:s-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=t.b9;if(this._prevEase){const e=this._prevEase,n=(a.now()-e.start)/e.duration,i=e.easing(n+.01)-e.easing(n),s=.27/Math.sqrt(i*i+1e-4)*.01,o=Math.sqrt(.0729-s*s);r=t.b8(s,o,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class pi{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 mi{constructor(e){this._tr=new Bn(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fi{constructor(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(this._tapTime){const n=t[0],i=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else 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){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{const n=this._tap.touchend(e,t,r);n&&(this._tapTime=e.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{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("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class _i{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 yi{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("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-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()}}class vi{constructor(e,t){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=s.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=t,this._container.appendChild(n);const i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(s.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const xi=e=>e.zoom||e.drag||e.pitch||e.rotate;class bi extends t.k{}function wi(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Ci{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===e.type?void 0:e,n={needsRenderFrame:!1},i={},a={},o=e.touches,l=o?this._getMapTouches(o):void 0,c=l?s.touchPos(this._map.getCanvas(),l):s.mousePos(this._map.getCanvas(),e);for(const{handlerName:s,handler:h,allowed:p}of this._handlers){if(!h.isEnabled())continue;let o;this._blockedByActive(a,p,s)?h.reset():h[t||e.type]&&(o=h[t||e.type](e,c,l),this.mergeHandlerResult(n,i,o,s,r),o&&o.needsRenderFrame&&this._triggerRenderFrame()),(o||h.isActive())&&(a[s]=h)}const u={};for(const s in this._previousActiveHandlers)a[s]||(u[s]=r);this._previousActiveHandlers=a,(Object.keys(u).length||wi(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||wi(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:d}=n;d&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],d(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Nn(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[n,i,a]of this._listeners)s.addEventListener(n,i,n===document?this.handleWindowEvent:this.handleEvent,a)}destroy(){for(const[e,t,r]of this._listeners)s.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){const t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new Rn(t,e));const n=t.boxZoom=new Vn(t,e);this._add("boxZoom",n),e.interactive&&e.boxZoom&&n.enable();const i=t.cooperativeGestures=new vi(t,e.cooperativeGestures);this._add("cooperativeGestures",i),e.cooperativeGestures&&i.enable();const a=new qn(t),o=new mi(t);t.doubleClickZoom=new pi(o,a),this._add("tapZoom",a),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();const l=new fi;this._add("tapDragZoom",l);const c=t.touchPitch=new oi(t);this._add("touchPitch",c),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);const u=Kn(e),d=Yn(e);t.dragRotate=new _i(e,u,d),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",d,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();const h=(e=>{let{enable:t,clickTolerance:r}=e;const n=new Wn({checkCorrectEvent:e=>0===s.mouseButton(e)&&!e.ctrlKey});return new Zn({clickTolerance:r,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:n,enable:t,assignEvents:Jn})})(e),p=new Qn(e,t);t.dragPan=new gi(r,h,p),this._add("mousePan",h),this._add("touchPan",p,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);const m=new ai,f=new ni;t.touchZoomRotate=new yi(r,f,m,l),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);const g=t.scrollZoom=new hi(t,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);const _=t.keyboard=new ci(t);this._add("keyboard",_),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new Fn(t))}_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=[]}}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 Boolean(xi(this._eventsInProgress))||this.isZooming()}_blockedByActive(e,t,r){for(const n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1}_getMapTouches(e){const t=[];for(const r of e)this._el.contains(r.target)&&t.push(r);return t}mergeHandlerResult(e,r,n,i,a){if(!n)return;t.e(e,n);const s={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=s),void 0!==n.panDelta&&(r.drag=s),void 0!==n.pitchDelta&&(r.pitch=s),void 0!==n.bearingDelta&&(r.rotate=s)}_applyChanges(){const e={},r={},n={};for(const[i,a,s]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(e.around=i.around),void 0!==i.pinchAround&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),t.e(r,a),t.e(n,s);this._updateMapTransform(e,r,n),this._changes=[]}_updateMapTransform(e,t,r){const n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(wi(e)||a&&this._terrainMovement))return this._fireEvents(t,r,!0);let{panDelta:s,zoomDelta:o,bearingDelta:l,pitchDelta:c,around:u,pinchAround:d}=e;void 0!==d&&(u=d),n._stop(!0),u=u||n.transform.centerPoint;const h=i.pointLocation(s?u.sub(s):u);l&&(i.bearing+=l),c&&(i.pitch+=c),o&&(i.zoom+=o),a?this._terrainMovement||!t.drag&&!t.zoom?t.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(s)):i.setLocationAtPoint(h,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(h,u)):i.setLocationAtPoint(h,u),n._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)}_fireEvents(e,r,n){const i=xi(this._eventsInProgress),s=xi(e),o={};for(const t in e){const{originalEvent:r}=e[t];this._eventsInProgress[t]||(o[`${t}start`]=r),this._eventsInProgress[t]=e[t]}!i&&s&&this._fireEvent("movestart",s.originalEvent);for(const t in o)this._fireEvent(t,o[t]);s&&this._fireEvent("move",s.originalEvent);for(const t in e){const{originalEvent:r}=e[t];this._fireEvent(t,r)}const l={};let c;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],c=r[e]||n,l[`${t}
2end`]=c)}for(const t in l)this._fireEvent(t,l[t]);const u=xi(this._eventsInProgress),d=(i||s)&&!u;if(d&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const e=this._map._getTransformForUpdate();e.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(e)}if(n&&d){this._updatingCamera=!0;const e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&a.prefersReducedMotion?(this._map.fire(new t.k("moveend",{originalEvent:c})),r(this._map.getBearing())&&this._map.resetNorth()):(r(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:c})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new t.k(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new bi("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Si extends t.E{constructor(e,t){super(),this._renderFrameCallback=()=>{const e=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=t.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(e,r,n){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},r),n)}panTo(e,r,n){return this.easeTo(t.e({center:e},r),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,r,n){return this.easeTo(t.e({zoom:e},r),n)}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,r,n){return this.easeTo(t.e({bearing:e},r),n)}resetNorth(e,r){return this.rotateTo(0,t.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},e),r),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(e,t){e=Z.convert(e).adjustAntiMeridian();const r=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,r,n,i){const a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){const e=i.padding;i.padding={top:e,bottom:e,right:e,left:e}}i.padding=t.e(a,i.padding);const s=this.transform,o=s.padding,l=new Z(e,r),c=s.project(l.getNorthWest()),u=s.project(l.getNorthEast()),d=s.project(l.getSouthEast()),h=s.project(l.getSouthWest
vendor: 53,086 bytes, line 2
2()),p=t.ba(-n),m=c.rotate(p),f=u.rotate(p),g=d.rotate(p),_=h.rotate(p),y=new t.P(Math.max(m.x,f.x,_.x,g.x),Math.max(m.y,f.y,_.y,g.y)),v=new t.P(Math.min(m.x,f.x,_.x,g.x),Math.min(m.y,f.y,_.y,g.y)),x=y.sub(v),b=(s.width-(o.left+o.right+i.padding.left+i.padding.right))/x.x,w=(s.height-(o.top+o.bottom+i.padding.top+i.padding.bottom))/x.y;if(w<0||b<0)return void t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const C=Math.min(s.scaleZoom(s.scale*Math.min(b,w)),i.maxZoom),S=t.P.convert(i.offset),k=new t.P((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(t.ba(n)),j=S.add(k).mult(s.scale/s.zoomScale(C));return{center:s.unproject(c.add(d).div(2).sub(j)),zoom:C,bearing:n}}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(e)),this.transform.pointLocation(t.P.convert(r)),n,i),i,a)}_fitInternal(e,r,n){return e?(delete(r=t.e(e,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}jumpTo(e,r){this.stop();const n=this._getTransformForUpdate();let i=!1,a=!1,s=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.N.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(s=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this._applyUpdatedTransform(n),this.fire(new t.k("movestart",r)).fire(new t.k("move",r)),i&&this.fire(new t.k("zoomstart",r)).fire(new t.k("zoom",r)).fire(new t.k("zoomend",r)),a&&this.fire(new t.k("rotatestart",r)).fire(new t.k("rotate",r)).fire(new t.k("rotateend",r)),s&&this.fire(new t.k("pitchstart",r)).fire(new t.k("pitch",r)).fire(new t.k("pitchend",r)),this.fire(new t.k("moveend",r))}calculateCameraOptionsFromTo(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const a=t.Z.fromLngLat(e,r),s=t.Z.fromLngLat(n,i),o=s.x-a.x,l=s.y-a.y,c=s.z-a.z,u=Math.hypot(o,l,c);if(0===u)throw new Error("Can't calculate camera options with same From and To");const d=Math.hypot(o,l),h=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(o,-l)/Math.PI;let m=180*Math.acos(d/u)/Math.PI;return m=c<0?90-m:90+m,{center:s.toLngLat(),zoom:h,pitch:m,bearing:p}}easeTo(e,r){var n;this._stop(!1,e.easeId),(!1===(e=t.e({offset:[0,0],duration:500,easing:t.b9},e)).animate||!e.essential&&a.prefersReducedMotion)&&(e.duration=0);const i=this._getTransformForUpdate(),s=i.zoom,o=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,d="pitch"in e?+e.pitch:l,h="padding"in e?e.padding:i.padding,p=t.P.convert(e.offset);let m=i.centerPoint.add(p);const f=i.pointLocation(m),{center:g,zoom:_}=i.getConstrained(t.N.convert(e.center||f),null!==(n=e.zoom)&&void 0!==n?n:s);this._normalizeCenter(g,i);const y=i.project(f),v=i.project(g).sub(y),x=i.zoomScale(_-s);let b,w;e.around&&(b=t.N.convert(e.around),w=i.locationPoint(b));const C={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||_!==s,this._rotating=this._rotating||o!==u,this._pitching=this._pitching||d!==l,this._padding=!i.isPaddingEqual(h),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,C),this.terrain&&this._prepareElevation(g),this._ease((n=>{if(this._zooming&&(i.zoom=t.y.number(s,_,n)),this._rotating&&(i.bearing=t.y.number(o,u,n)),this._pitching&&(i.pitch=t.y.number(l,d,n)),this._padding&&(i.interpolatePadding(c,h,n),m=i.centerPoint.add(p)),this.terrain&&!e.freezeElevation&&this._updateElevation(n),b)i.setLocationAtPoint(b,w);else{const e=i.zoomScale(i.zoom-s),t=_>s?Math.min(2,x):Math.max(.5,x),r=Math.pow(t,1-n),a=i.unproject(y.add(v.mult(n*r)).mult(e));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,m)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(t=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,t)}),e),this}_prepareEase(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,r||n.moving||this.fire(new t.k("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.k("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.k("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){const t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(r-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){const t=e.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(t.lngLat,e.zoom);if(t.altitude<r){const n=this.calculateCameraOptionsFromTo(t.lngLat,r,e.center,e.elevation);return{pitch:n.pitch,zoom:n.zoom}}return{}}_applyUpdatedTransform(e){const t=[];if(this.terrain&&t.push((e=>this._elevateCameraIfInsideTerrain(e))),this.transformCameraUpdate&&t.push((e=>this.transformCameraUpdate(e))),!t.length)return;const r=e.clone();for(const n of t){const e=r.clone(),{center:t,zoom:i,pitch:a,bearing:s,elevation:o}=n(e);t&&(e.center=t),void 0!==i&&(e.zoom=i),void 0!==a&&(e.pitch=a),void 0!==s&&(e.bearing=s),void 0!==o&&(e.elevation=o),r.apply(e)}this.transform.apply(r)}_fireMoveEvents(e){this.fire(new t.k("move",e)),this._zooming&&this.fire(new t.k("zoom",e)),this._rotating&&this.fire(new t.k("rotate",e)),this._pitching&&this.fire(new t.k("pitch",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.k("zoomend",e)),i&&this.fire(new t.k("rotateend",e)),a&&this.fire(new t.k("pitchend",e)),this.fire(new t.k("moveend",e))}flyTo(e,r){var n;if(!e.essential&&a.prefersReducedMotion){const n=t.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},e);const i=this._getTransformForUpdate(),s=i.zoom,o=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,d="pitch"in e?+e.pitch:l,h="padding"in e?e.padding:i.padding,p=t.P.convert(e.offset);let m=i.centerPoint.add(p);const f=i.pointLocation(m),{center:g,zoom:_}=i.getConstrained(t.N.convert(e.center||f),null!==(n=e.zoom)&&void 0!==n?n:s);this._normalizeCenter(g,i);const y=i.zoomScale(_-s),v=i.project(f),x=i.project(g).sub(v);let b=e.curve;const w=Math.max(i.width,i.height),C=w/y,S=x.mag();if("minZoom"in e){const r=t.ac(Math.min(e.minZoom,s,_),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-s);b=Math.sqrt(n/S*2)}const k=b*b;function j(e){const t=(C*C-w*w+(e?-1:1)*k*k*S*S)/(2*(e?C:w)*k*S);return Math.log(Math.sqrt(t*t+1)-t)}function E(e){return(Math.exp(e)-Math.exp(-e))/2}function T(e){return(Math.exp(e)+Math.exp(-e))/2}const P=j(!1);let I=function(e){return T(P)/T(P+b*e)},M=function(e){return w*((T(P)*(E(t=P+b*e)/T(t))-E(P))/k)/S;var t},N=(j(!0)-P)/b;if(Math.abs(S)<1e-6||!isFinite(N)){if(Math.abs(w-C)<1e-6)return this.easeTo(e,r);const t=C<w?-1:1;N=Math.abs(Math.log(C/w))/b,M=()=>0,I=e=>Math.exp(t*b*e)}return e.duration="duration"in e?+e.duration:1e3*N/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==u,this._pitching=d!==l,this._padding=!i.isPaddingEqual(h),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{const a=n*N,f=1/I(a);i.zoom=1===n?_:s+i.scaleZoom(f),this._rotating&&(i.bearing=t.y.number(o,u,n)),this._pitching&&(i.pitch=t.y.number(l,d,n)),this._padding&&(i.interpolatePadding(c,h,n),m=i.centerPoint.add(p)),this.terrain&&!e.freezeElevation&&this._updateElevation(n);const y=1===n?g:i.unproject(v.add(x.mult(M(a))).mult(f));i.setLocationAtPoint(i.renderWorldCopies?y.wrap():y,m),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(e,t,r){!1===r.animate||0===r.duration?(e(1),t()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=t.b3(e,-180,180);const n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e}_normalizeCenter(e,t){if(!t.renderWorldCopies||t.lngRange)return;const r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const ki={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ji{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ki;this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=e=>{!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=s.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=s.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=s.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){s.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){const r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((e=>"string"!=typeof e?"":e))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style.sourceCaches;for(const n in t){const r=t[n];if(r.used||r.usedForTerrain){const t=r.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e=e.filter((e=>String(e).trim())),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}));const r=e.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ei{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._updateCompact=()=>{const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=s.create("div","maplibregl-ctrl");const t=s.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){s.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ti{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 n of r)if(n.id===e)return void(n.cancelled=!0)}run(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");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=[]}}var Pi=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Ii extends t.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];const n={};for(const i of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),this._tiles[i.key]=new le(i,this.tileSize));for(const t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(e){for(const t in this._tiles){const r=this._tiles[t];(!e||r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const r={};for(const n of this._renderableTilesKeys){const i=this._tiles[n].tileID;if(i.canonical.equals(e.canonical)){const i=e.clone();i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),r[n]=i}else if(i.canonical.isChildOf(e.canonical)){const a=e.clone();a.posMatrix=new Float64Array(16);const s=i.canonical.z-e.canonical.z,o=i.canonical.x-(i.canonical.x>>s<<s),l=i.canonical.y-(i.canonical.y>>s<<s),c=t.X>>s;t.aP(a.posMatrix,0,c,0,c,0,1),t.J(a.posMatrix,a.posMatrix,[-o*c,-l*c,0]),r[n]=a}else if(e.canonical.isChildOf(i.canonical)){const a=e.clone();a.posMatrix=new Float64Array(16);const s=e.canonical.z-i.canonical.z,o=e.canonical.x-(e.canonical.x>>s<<s),l=e.canonical.y-(e.canonical.y>>s<<s),c=t.X>>s;t.aP(a.posMatrix,0,t.X,0,t.X,0,1),t.J(a.posMatrix,a.posMatrix,[o*c,l*c,0]),t.K(a.posMatrix,a.posMatrix,[1/2**s,1/2**s,0]),r[n]=a}}return r}getSourceTile(e,t){const r=this.sourceCache._source;let n=e.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n<r.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(n).key);let i=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!i||!i.dem)&&t)for(;n>=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(e.scaledTo(n--).key);return i}tilesAfterTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return Object.values(this._tiles).filter((t=>t.timeAdded>=e))}}class Mi{constructor(e,t,r){this.painter=e,this.sourceCache=new Ii(t),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.X;var a;if(!(r>=0&&r<i&&n>=0&&n<i))return 0;const s=this.getTerrainData(e),o=null===(a=s.tile)||void 0===a?void 0:a.dem;if(!o)return 0;const l=function(e,t,r){var 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}([],[r/i*t.X,n/i*t.X],s.u_terrain_matrix),c=[l[0]*o.dim,l[1]*o.dim],u=Math.floor(c[0]),d=Math.floor(c[1]),h=c[0]-u,p=c[1]-d;return o.get(u,d)*(1-h)*(1-p)+o.get(u+1,d)*h*(1-p)+o.get(u,d+1)*(1-h)*p+o.get(u+1,d+1)*h*p}getElevationForLngLatZoom(e,r){if(!t.bb(r,e.wrap()))return 0;const{tileID:n,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(n,i%t.X,a%t.X,t.X)}getElevation(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.X;return this.getDEMElevation(e,r,n,i)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const e=this.painter.context,r=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new b(e,r,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new b(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}const r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const e=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new b(e,r.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),r.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const n=r&&r+r.tileID.key+e.key;if(n&&!this._demMatrixCache[n]){const n=this.sourceCache.sourceCache._source.maxzoom;let i=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=n?i=e.canonical.z-n:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const a=e.canonical.x-(e.canonical.x>>i<<i),s=e.canonical.y-(e.canonical.y>>i<<i),o=t.bc(new Float64Array(16),[1/(t.X<<i),1/(t.X<<i),0]);t.J(o,o,[a*t.X,s*t.X,0]),this._demMatrixCache[e.key]={matrix:o,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){const t=this.painter,r=t.width/devicePixelRatio,n=t.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new b(t.context,{width:r,height:n,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new b(t.context,{width:r,height:n,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(r,n,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,r,n))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,a=0;t<this._coordsTextureSize;t++)for(let e=0;e<this._coordsTextureSize;e++,a+=4)r[a+0]=255&e,r[a+1]=255&t,r[a+2]=e>>8<<4|t>>8,r[a+3]=0;const n=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new b(e,n,e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),s=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),o=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,o-s-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);const l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],d=u&&this.sourceCache.getTileByID(u);if(!d)return null;const h=this._coordsTextureSize,p=(1<<d.tileID.canonical.z)*h;return new t.Z((d.tileID.canonical.x*h+l)/p+d.tileID.wrap,(d.tileID.canonical.y*h+c)/p,this.getElevation(d.tileID,l,c,h))}depthAtPoint(e){const t=new Uint8Array(4),r=this.painter.context,n=r.gl;return r.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),n.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,t),r.bindFramebuffer.set(null),(t[0]/16777216+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const e=this.painter.context,r=new t.bd,n=new t.aY,i=this.meshSize,a=t.X/i,s=i*i;for(let t=0;t<=i;t++)for(let e=0;e<=i;e++)r.emplaceBack(e*a,t*a,0);for(let t=0;t<s;t+=i+1)for(let e=0;e<i;e++)n.emplaceBack(e+t,i+e+t+1,i+e+t+2),n.emplaceBack(e+t,i+e+t+2,e+t+1);const o=r.length,l=o+2*(i+1);for(const d of[0,1])for(let e=0;e<=i;e++)for(const n of[0,1])r.emplaceBack(e*a,d*t.X,n);for(let t=0;t<2*i;t+=2)n.emplaceBack(l+t,l+t+1,l+t+3),n.emplaceBack(l+t,l+t+3,l+t+2),n.emplaceBack(o+t,o+t+3,o+t+1),n.emplaceBack(o+t,o+t+2,o+t+3);const c=r.length,u=c+2*(i+1);for(const d of[0,1])for(let e=0;e<=i;e++)for(const n of[0,1])r.emplaceBack(d*t.X,e*a,n);for(let t=0;t<2*i;t+=2)n.emplaceBack(c+t,c+t+1,c+t+3),n.emplaceBack(c+t,c+t+3,c+t+2),n.emplaceBack(u+t,u+t+3,u+t+1),n.emplaceBack(u+t,u+t+2,u+t+3);return this._mesh=new yn(e.createVertexBuffer(r,Pi.members),e.createIndexBuffer(n),t.a0.simpleSegment(0,0,r.length,n.length)),this._mesh}getMeshFrameDelta(e){return 2*Math.PI*t.be/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,t){var r;const{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(e,t);return null!==(r=this.getMinMaxElevation(n).minElevation)&&void 0!==r?r:0}getMinMaxElevation(e){const t=this.getTerrainData(e).tile,r={minElevation:null,maxElevation:null};return t&&t.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}_getOverscaledTileIDFromLngLatZoom(e,r){const n=t.Z.fromLngLat(e.wrap()),i=(1<<r)*t.X,a=n.x*i,s=n.y*i,o=Math.floor(a/t.X),l=Math.floor(s/t.X);return{tileID:new t.S(r,0,r,o,l),mercatorX:a,mercatorY:s}}}class Ni{constructor(e,t,r){this._context=e,this._size=t,this._tileSize=r,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const t=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new b(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),t.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),t.colorAttachment.set(r.texture),{id:e,fbo:t,texture:r,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((t=>e.id!==t)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some((e=>!e.inUse))}}const Ai={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Li{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Ni(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter((r=>!e._layers[r].isHidden(t))),this._coordsDescendingInv={};for(const r in e.sourceCaches){this._coordsDescendingInv[r]={};const t=e.sourceCaches[r].getVisibleCoordinates();for(const e of t){const t=this.terrain.sourceCache.getTerrainCoords(e);for(const e in t)this._coordsDescendingInv[r][e]||(this._coordsDescendingInv[r][e]=[]),this._coordsDescendingInv[r][e].push(t[e])}}this._coordsDescendingInvStr={};for(const r of e._order){const t=e._layers[r],n=t.source;if(Ai[t.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(const e in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][e]=this._coordsDescendingInv[n][e].map((e=>e.key)).sort().join()}}for(const r of this._renderableTiles)for(const e in this._coordsDescendingInvStr){const t=this._coordsDescendingInvStr[e][r.tileID.key];t&&t!==r.rttCoords[e]&&(r.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const r=e.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Ai[r]&&(this._prevType&&Ai[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(e.id),!i))return!0;if(Ai[this._prevType]||Ai[r]&&i){this._prevType=r;const e=this._stacks.length-1,i=this._stacks[e]||[];for(const r of this._renderableTiles){if(this.pool.isFull()&&(_n(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[e]){const t=this.pool.getObjectForId(r.rtt[e].id);if(t.stamp===r.rtt[e].stamp){this.pool.useObject(t);continue}}const a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[e]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:t.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let e=0;e<i.length;e++){const t=n.style._layers[i[e]],s=t.source?this._coordsDescendingInv[t.source][r.tileID.key]:[r.tileID];n.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),n._renderTileClippingMasks(t,s),n.renderLayer(n,n.style.sourceCaches[t.source],t,s),t.source&&(r.rttCoords[t.source]=this._coordsDescendingInvStr[t.source][r.tileID.key])}}return _n(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Ai[r]}return!1}}const Di={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},zi=r,Oi={hash:!1,interactive:!0,bearingSnap:7,attributionControl:ki,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:t.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Ri=e=>{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},Fi={showCompass:!0,showZoom:!0,visualizePitch:!1};class Bi{constructor(e,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.mousedown=e=>{this.startMouse(t.e({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),s.mousePos(this.element,e)),s.addEventListener(window,"mousemove",this.mousemove),s.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=e=>{this.moveMouse(e,s.mousePos(this.element,e))},this.mouseup=e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},this.touchstart=e=>{1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=s.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),s.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.addEventListener(window,"touchend",this.touchend))},this.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=s.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},this.touchend=e=>{0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const i=e.dragRotate._mouseRotate.getClickTolerance(),a=e.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Kn({clickTolerance:i,enable:!0}),this.touchRotate=(e=>{let{enable:t,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=e;const i=new Xn;return new Zn({clickTolerance:r,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:i,enable:t,assignEvents:Ri})})({clickTolerance:i,enable:!0}),this.map=e,n&&(this.mousePitch=Yn({clickTolerance:a,enable:!0}),this.touchPitch=(e=>{let{enable:t,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=e;const i=new Xn;return new Zn({clickTolerance:r,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:i,enable:t,assignEvents:Ri})})({clickTolerance:a,enable:!0})),s.addEventListener(r,"mousedown",this.mousedown),s.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),s.addEventListener(r,"touchcancel",this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),s.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),s.disableDrag()}moveMouse(e,t){const r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){const{pitchDelta:n}=this.mousePitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(e,t){const r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){const{pitchDelta:n}=this.touchPitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}off(){const e=this.element;s.removeEventListener(e,"mousedown",this.mousedown),s.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend),s.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){s.enableDrag(),s.removeEventListener(window,"mousemove",this.mousemove),s.removeEventListener(window,"mouseup",this.mouseup),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend)}}let Vi;function $i(e,r,n){const i=new t.N(e.lng,e.lat);if(e=new t.N(e.lng,e.lat),r){const i=new t.N(e.lng-360,e.lat),a=new t.N(e.lng+360,e.lat),s=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<s?e=i:n.locationPoint(a).distSqr(r)<s&&(e=a)}for(;Math.abs(e.lng-n.center.lng)>180;){const t=n.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e.lng!==i.lng&&n.locationPoint(e).y>n.height/2-n.getHorizon()?e:i}const Ui={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Hi(e,t,r){const n=e.classList;for(const i in Ui)n.remove(`maplibregl-${r}-anchor-${i}`);n.add(`maplibregl-${r}-anchor-${t}`)}class qi extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{const t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=e=>{const t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},this._update=e=>{var t;if(!this._map)return;const r=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==e?void 0:e.type)||"render"===(null==e?void 0:e.type)&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?$i(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&"moveend"!==e.type||(this._pos=this._pos.round()),s.setTransform(this._element,`${Ui[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(e&&"moveend"===e.type)})).catch((()=>{}))},this._onMove=e=>{if(!this._isDragging){const t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==e?void 0:e.opacity,null==e?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=t.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");const r=s.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);const a=s.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const o=s.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");const l=s.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const e of c){const t=s.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),l.appendChild(t)}const u=s.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const d=s.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),u.appendChild(d);const h=s.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"opacity","0.25"),h.setAttributeNS(null,"fill","#000000");const p=s.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),h.appendChild(p);const m=s.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(6.0, 7.0)"),m.setAttributeNS(null,"fill","#FFFFFF");const f=s.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=s.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const _=s.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),f.appendChild(g),f.appendChild(_),o.appendChild(l),o.appendChild(u),o.appendChild(h),o.appendChild(m),o.appendChild(f),r.appendChild(o),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=t.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()})),Hi(this._element,this._anchor,"marker"),e&&e.className)for(const t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),s.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,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.abs(r)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-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,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var r,n;if(!(null===(r=this._map)||void 0===r?void 0:r.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const i=this._map,a=i.terrain.depthAtPoint(this._pos),s=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,s)-a<.006)return void(this._element.style.opacity=this._opacity);const o=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*o,c=i.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,s+l)-c>.006;(null===(n=this._popup)||void 0===n?void 0:n.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return void 0===e&&void 0===t&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==t&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}const Zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Gi=0,Wi=!1;const Xi={maxWidth:100,unit:"metric"};function Ji(e,t,r){const n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),s=e.unproject([n,i]),o=a.distanceTo(s);if(r&&"imperial"===r.unit){const r=3.2808*o;r>5280?Ki(t,n,r/5280,e._getUIString("ScaleControl.Miles")):Ki(t,n,r,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(t,n,o/1852,e._getUIString("ScaleControl.NauticalMiles")):o>=1e3?Ki(t,n,o/1e3,e._getUIString("ScaleControl.Kilometers")):Ki(t,n,o,e._getUIString("ScaleControl.Meters"))}function Ki(e,t,r,n){const i=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}(r);e.style.width=t*(i/r)+"px",e.innerHTML=`${i} ${n}`}const Yi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Qi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ea(e){if(e){if("number"==typeof e){const r=Math.round(Math.abs(e)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,e),"top-left":new t.P(r,r),"top-right":new t.P(-r,r),bottom:new t.P(0,-e),"bottom-left":new t.P(r,-r),"bottom-right":new t.P(-r,-r),left:new t.P(e,0),right:new t.P(-e,0)}}if(e instanceof t.P||Array.isArray(e)){const r=t.P.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:t.P.convert(e.center||[0,0]),top:t.P.convert(e.top||[0,0]),"top-left":t.P.convert(e["top-left"]||[0,0]),"top-right":t.P.convert(e["top-right"]||[0,0]),bottom:t.P.convert(e.bottom||[0,0]),"bottom-left":t.P.convert(e["bottom-left"]||[0,0]),"bottom-right":t.P.convert(e["bottom-right"]||[0,0]),left:t.P.convert(e.left||[0,0]),right:t.P.convert(e.right||[0,0])}}return ea(new t.P(0,0))}const ta=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=ji,e.BoxZoomHandler=Vn,e.CanvasSource=te,e.CooperativeGesturesHandler=vi,e.DoubleClickZoomHandler=pi,e.DragPanHandler=gi,e.DragRotateHandler=_i,e.EdgeInsets=wn,e.FullscreenControl=class extends t.E{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(e=null==t?void 0:t.shadowRoot)||void 0===e?void 0:e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,e&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){s.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const e=this._fullscreenButton=s.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);s.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=K,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
2RROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const r=new t.N(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.e({bearing:i},this.options.fitBoundsOptions),s=Z.fromLngLat(r,n);this._map.fitBounds(s,a,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const r=new t.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Wi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=s.create("button","maplibregl-ctrl-geolocate",this._container),s.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(!1===e){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=s.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new qi({element:this._dotElement}),this._circleElement=s.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new qi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))}))}},this.options=t.e({},Zi,e)}onAdd(e){return this._map=e,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function*(){if(void 0!==Vi&&!e)return Vi;if(void 0===window.navigator.permissions)return Vi=!!window.navigator.geolocation,Vi;try{const e=yield window.navigator.permissions.query({name:"geolocation"});Vi="denied"!==e.state}catch(e){Vi=!!window.navigator.geolocation}return Vi}()}))}().then((e=>this._finishSetupUI(e))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),s.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gi=0,Wi=!1}_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_E
2RROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const e=this._map.getBounds(),t=e.getSouthEast(),r=e.getNorthEast(),n=t.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return t.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 t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gi--,Wi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Gi++,Gi>1?(e={maximumAge:6e5,timeout:0},Wi=!0):(e=this.options.positionOptions,Wi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=jn,e.ImageSource=Q,e.KeyboardHandler=ci,e.LngLatBounds=Z,e.LogoControl=Ei,e.Map=class extends Si{constructor(e){t.bf.mark(t.bg.create);const r=Object.assign(Object.assign({},Oi),e);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Sn(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ti,this._controls=[],this._mapId=t.a4(),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()}
vendor: 18,705 bytes, line 2
2,this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Di),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl((()=>this.isMoving())),this._requestManager=new m(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))).on("moveend",(()=>this._update(!1))).on("zoom",(()=>this._update(!0))).on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})).once("idle",(()=>{this._idleTriggered=!0})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let e=!1;const t=kn((e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{e?t(r):e=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Ci(this,r),this._hash=r.hash&&new jn("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,t.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new ji("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Ei,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire(new t.k(`${e.dataType}data`,e))})),this.on("dataloading",(e=>{this.fire(new t.k(`${e.dataType}dataloading`,e))})),this.on("dataabort",(e=>{this.fire(new t.k("sourcedataabort",e))}))}_getMapId(){return this._mapId}addControl(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=e.onAdd(this);this._controls.push(e);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,r,n)}resize(e){var r;const n=this._containerDimensions(),i=n[0],a=n[1],s=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,s),this.painter.resize(i,a,s),this.painter.overLimit()){const e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];const t=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,t),this.painter.resize(i,a,t)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);const o=!this._moving;return o&&(this.stop(),this.fire(new t.k("movestart",e)).fire(new t.k("move",e))),this.fire(new t.k("resize",e)),o&&this.fire(new t.k("moveend",e)),this}_getClampedPixelRatio(e,t){const{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=e*i,s=t*i;return Math.min(a>r?r/a:1,s>n?n/s:1)*i}getPixelRatio(){var e;return null!==(e=this._overridePixelRatio)&&void 0!==e?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(Z.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=null==e?60:e)>85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}project(e){return this.transform.locationPoint(t.N.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.pointLocation(t.P.convert(e),this.terrain)}isMoving(){var e;return this._moving||(null===(e=this.handlers)||void 0===e?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null===(e=this.handlers)||void 0===e?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null===(e=this.handlers)||void 0===e?void 0:e.isRotating())}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let n=!1;const i=i=>{const a=t.filter((e=>this.getLayer(e))),s=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];s.length?n||(n=!0,r.call(this,new Dn(e,this,i.originalEvent,{features:s}))):n=!1};return{layers:t,listener:r,delegates:{mousemove:i,mouseout:()=>{n=!1}}}}if("mouseleave"===e||"mouseout"===e){let n=!1;const i=i=>{const a=t.filter((e=>this.getLayer(e)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Dn(e,this,i.originalEvent)))},a=t=>{n&&(n=!1,r.call(this,new Dn(e,this,t.originalEvent)))};return{layers:t,listener:r,delegates:{mousemove:i,mouseout:a}}}{const n=e=>{const n=t.filter((e=>this.getLayer(e))),i=0!==n.length?this.queryRenderedFeatures(e.point,{layers:n}):[];i.length&&(e.features=i,r.call(this,e),delete e.features)};return{layers:t,listener:r,delegates:{[e]:n}}}}_saveDelegatedListener(e,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners||!this._delegatedListeners[e])return;const n=this._delegatedListeners[e];for(let i=0;i<n.length;i++){const e=n[i];if(e.listener===r&&e.layers.length===t.length&&e.layers.every((e=>t.includes(e)))){for(const t in e.delegates)this.off(t,e.delegates[t]);return void n.splice(i,1)}}}on(e,t,r){if(void 0===r)return super.on(e,t);const n=this._createDelegatedListener(e,"string"==typeof t?[t]:t,r);this._saveDelegatedListener(e,n);for(const i in n.delegates)this.on(i,n.delegates[i]);return this}once(e,t,r){var n=this;if(void 0===r)return super.once(e,t);const i="string"==typeof t?[t]:t,a=this._createDelegatedListener(e,i,r);for(const s in a.delegates){const t=a.delegates[s];a.delegates[s]=function(){n._removeDelegatedListener(e,i,r),t(...arguments)}}this._saveDelegatedListener(e,a);for(const s in a.delegates)this.once(s,a.delegates[s]);return this}off(e,t,r){return void 0===r?super.off(e,t):(this._removeDelegatedListener(e,"string"==typeof t?[t]:t,r),this)}queryRenderedFeatures(e,r){if(!this.style)return[];let n;const i=e instanceof t.P||Array.isArray(e),a=i?e:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:e)||{},a instanceof t.P||"number"==typeof a[0])n=[t.P.convert(a)];else{const e=t.P.convert(a[0]),r=t.P.convert(a[1]);n=[e,new t.P(r.x,e.y),r,new t.P(e.x,r.y),e]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,r){return!1!==(r=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(e,t)));const r=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new ht(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ht(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,r){if("string"==typeof e){const n=this._requestManager.transformRequest(e,"Style");t.h(n,new AbortController).then((e=>{this._updateDiff(e.data,r)})).catch((e=>{e&&this.fire(new t.j(e))}))}else"object"==typeof e&&this._updateDiff(e,r)}_updateDiff(e,r){try{this.style.setState(e,r)&&this._update(!0)}catch(n){t.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(e,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){const r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.j(new Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){const r=this.style.sourceCaches[e.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);null===this.terrain&&r.reload();for(const n in this.style._layers){const r=this.style._layers[n];"hillshade"===r.type&&r.source===e.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Mi(this.painter,r,e),this.painter.renderToTexture=new Li(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=t=>{"style"===t.dataType?this.terrain.sourceCache.freeRtt():"source"===t.dataType&&t.tile&&(t.sourceId!==e.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(t.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:e})),this}getTerrain(){var e,t;return null!==(t=null===(e=this.terrain)||void 0===e?void 0:e.options)&&void 0!==t?t:null}areTilesLoaded(){const e=this.style&&this.style.sourceCaches;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}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{pixelRatio:i=1,sdf:s=!1,stretchX:o,stretchY:l,content:c,textFitWidth:u,textFitHeight:d}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||t.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new t.j(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`")));{const{width:n,height:a,data:h}=r,p=r;return this.style.addImage(e,{data:new t.R({width:n,height:a},new Uint8Array(h)),pixelRatio:i,stretchX:o,stretchY:l,content:c,textFitWidth:u,textFitHeight:d,sdf:s,version:0,userImage:p}),p.onAdd&&p.onAdd(this,e),this}}{const{width:n,height:h,data:p}=a.getImageData(r);this.style.addImage(e,{data:new t.R({width:n,height:h},p),pixelRatio:i,stretchX:o,stretchY:l,content:c,textFitWidth:u,textFitHeight:d,sdf:s,version:0})}}updateImage(e,r){const n=this.style.getImage(e);if(!n)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=r instanceof HTMLImageElement||t.b(r)?a.getImageData(r):r,{width:s,height:o,data:l}=i;if(void 0===s||void 0===o)return this.fire(new t.j(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(s!==n.data.width||o!==n.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(r instanceof HTMLImageElement||t.b(r));return n.data.replace(l,c),this.style.updateImage(e,n),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return p.getImage(this._requestManager.transformRequest(e,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(e,t,r,n),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(e,t,r,n),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,(e=>{e||this._update(!0)})),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,(e=>{e||this._update(!0)})),this}setLight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e){return this._lazyInitEmptyStyle(),this.style.setSky(e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){const e=this._container;e.classList.add("maplibregl-map");const t=this._canvasContainer=s.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=s.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","regi
2on");const r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);const i=this._controlContainer=s.create("div","maplibregl-control-container",e),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{a[e]=s.create("div",`maplibregl-ctrl-${e} `,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,t,r){this._canvas.width=Math.floor(r*e),this._canvas.height=Math.floor(r*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const e={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{t={requestedAttributes:e},r&&(t.statusMessage=r.statusMessage,t.type=r.type)}),{once:!0});const r=this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e);if(!r){const e="Failed to initialize WebGL";throw t?(t.message=e,new Error(JSON.stringify(t))):new Error(e)}this.painter=new vn(r,this.transform),o.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded?(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)}_render(e){const r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const e=this.transform.zoom,i=a.now();this.style.zoomHistory.update(e,i);const s=new t.z(e,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=s.crossFadingFactor();1===o&&o===this._crossFadingFactor||(n=!0,this._crossFadingFactor=o),this.style.update(s)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var e;this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(e=this._resizeObserver)||void 0===e||e.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==r?void 0:r.loseContext)&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),s.remove(this._canvasContainer),s.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((e=>{t.bf.frame(e),this._frameRequest=null,this._render(e)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=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,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 version(){return zi}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Dn,e.MapTouchEvent=zn,e.MapWheelEvent=On,e.Marker=qi,e.NavigationControl
vendor: 9,591 bytes, line 2
2=class{constructor(e){this._updateZoomButtons=()=>{const e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,t)=>{const r=this._map._getUIString(`NavigationControl.${t}`);e.title=r,e.setAttribute("aria-label",r)},this.options=t.e({},Fi,e),this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),s.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),s.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=s.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Bi(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){s.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){const r=s.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}},e.Popup=class extends t.E{constructor(e){super(),this.remove=()=>(this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var t;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=s.create("div","maplibregl-popup",this._map.getContainer()),this._tip=s.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const e of this.options.className.split(" "))this._container.classList.add(e);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?$i(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.wrap(),this._trackPointer&&!e)return;const r=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor;const i=ea(this.options.offset);if(!n){const e=this._container.offsetWidth,t=this._container.offsetHeight;let a;a=r.y+i.bottom.y<t?["top"]:r.y>this._map.transform.height-t?["bottom"]:[],r.x<e/2?a.push("left"):r.x>this._map.transform.width-e/2&&a.push("right"),n=0===a.length?"bottom":a.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),s.setTransform(this._container,`${Ui[n]} translate(${a.x}px,${a.y}px)`),Hi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(Yi),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.N.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-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(){var e;return null===(e=this._container)||void 0===e?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=s.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}_createCloseButton(){this.options.closeButton&&(this._closeButton=s.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(Qi);e&&e.focus()}},e.RasterDEMTileSource=J,e.RasterTileSource=X,e.ScaleControl=class{constructor(e){this._onMove=()=>{Ji(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,Ji(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Xi),e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=hi,e.Style=ht,e.TerrainControl=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=e}onAdd(e){return this._map=e,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=s.create("button","maplibregl-ctrl-terrain",this._container),s.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
2ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){s.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=oi,e.TwoFingersTouchRotateHandler=ai,e.TwoFingersTouchZoomHandler=ni,e.TwoFingersTouchZoomRotateHandler=yi,e.VectorTileSource=W,e.VideoSource=ee,e.addSourceType=(e,r)=>t._(void 0,void 0,void 0,(function*(){if(ne(e))throw new Error(`A source type called "${e}" already exists.`);((e,t)=>{re[e]=t})(e,r)})),e.clearPrewarmedResources=function(){const e=O;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(L),O=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.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return oe().getRTLTextPluginStatus()},e.getVersion=function(){return ta},e.getWorkerCount=function(){return D.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return V().broadcast("IS",e)},e.prewarm=function(){F().acquire(L)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return oe().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){D.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}})),e}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"===typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var s={};e=e||[null,t({}),t([]),t(t)];for(var o=2&i&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((function(e){s[e]=function(){return n[e]}}));return s.default=function(){return n},r.d(a,s),a}}(),r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",function(){"use strict";var e=r(5043),t=r.t(e,2),n=r(4391),i=r(9461),a=r(8443),s=r(7950);let o=function(e){e()};const l=()=>o,c=Symbol.for("react-redux-context"),u="undefined"!==typeof globalThis?globalThis:{};function d(){var t;if(!e.createContext)return{};const r=null!=(t=u[c])?t:u[c]=new Map;let n=r.get(e.createContext);return n||(n=e.createContext(null),r.set(e.createContext,n)),n}const h=d();function p(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return function(){return(0,e.useContext)(t)}}const m=p();let f=()=>{throw new Error("uSES not initialized!")};const g=(e,t)=>e===t;function _(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;const r=t===h?m:p(t);return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{equalityFn:i=g,stabilityCheck:a,noopCheck:s}="function"===typeof n?{equalityFn:n}:n;const{store:o,subscription:l,getServerState:c,stabilityCheck:u,noopCheck:d}=r(),h=((0,e.useRef)(!0),(0,e.useCallback)({[t.name](e){return t(e)}}[t.name],[t,u,a])),p=f(l.addNestedSub,o.getState,c||o.getState,h,i);return(0,e.useDebugValue)(p),p}}const y=_();r(219),r(2086);const v={notify(){},get:()=>[]};function x(e,t){let r,n=v;function i(){s.onStateChange&&s.onStateChange()}function a(){r||(r=t?t.addNestedSub(i):e.subscribe(i),n=function(){const e=l();let t=null,r=null;return{clear(){t=null,r=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let n=!0,i=r={callback:e,next:null,prev:r};return i.prev?i.prev.next=i:t=i,function(){n&&null!==t&&(n=!1,i.next?i.next.prev=i.prev:r=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}())}const s={addNestedSub:function(e){return a(),n.subscribe(e)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:i,isSubscribed:function(){return Boolean(r)},trySubscribe:a,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=v)},getListeners:()=>n};return s}const b=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement)?e.useLayoutEffect:e.useEffect;let w=null;var C=function(t){let{store:r,context:n,children:i,serverState:a,stabilityCheck:s="once",noopCheck:o="once"}=t;const l=e.useMemo((()=>{const e=x(r);return{store:r,subscription:e,getServerState:a?()=>a:void 0,stabilityCheck:s,noopCheck:o}}),[r,a,s,o]),c=e.useMemo((()=>r.getState()),[r]);b((()=>{const{subscription:e}=l;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),c!==r.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}}),[l,c]);const u=n||h;return e.createElement(u.Provider,{value:l},i)};function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;const t=e===h?m:p(e);return function(){const{store:e}=t();return e}}const k=S();function j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;const t=e===h?k:S(e);return function(){return t().dispatch}}const E=j();var T,P;function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
2for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},I.apply(this,arguments)}(e=>{f=e})(a.useSyncExternalStoreWithSelector),(e=>{w=e})(i.useSyncExternalStore),T=s.unstable_batchedUpdates,o=T,function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(P||(P={}));const M="popstate";function N(e){return void 0===e&&(e={}),F((function(e,t){let{pathname:r,search:n,hash:i}=e.location;return z("",{pathname:r,search:n,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:O(t)}),null,e)}function A(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function L(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}function D(e,t){return{usr:e.state,key:e.key,idx:t}}function z(e,t,r,n){return void 0===r&&(r=null),I({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?R(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function O(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function R(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function F(e,t,r,n){void 0===n&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,o=P.Pop,l=null,c=u();function u(){return(s.state||{idx:null}).idx}function d(){o=P.Pop;let e=u(),t=null==e?null:e-c;c=e,l&&l({action:o,location:p.location,delta:t})}function h(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,r="string"===typeof e?e:O(e);return A(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==c&&(c=0,s.replaceState(I({},s.state,{idx:c}),""));let p={get action(){return o},get location(){return e(i,s)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(M,d),l=e,()=>{i.removeEventListener(M,d),l=null}},createHref(e){return t(i,e)},createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){o=P.Push;let n=z(p.location,e,t);r&&r(n,e),c=u()+1;let d=D(n,c),h=p.createHref(n);try{s.pushState(d,"",h)}catch(m){if(m instanceof DOMException&&"DataCloneError"===m.name)throw m;i.location.assign(h)}a&&l&&l({action:o,location:p.location,delta:1})},replace:function(e,t){o=P.Replace;let n=z(p.location,e,t);r&&r(n,e),c=u();let i=D(n,c),d=p.createHref(n);s.replaceState(i,"",d),a&&l&&l({action:o,location:p.location,delta:0})},go(e){return s.go(e)}};return p}var B;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(B||(B={}));const V=new Set(["lazy","caseSensitive","path","id","index","children"]);function $(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,i)=>{let a=[...r,i],s="string"===typeof e.id?e.id:a.join("-");if(A(!0!==e.index||!e.children,"Cannot specify children on an index route"),A(!n[s],'Found a route id collision on i
2d "'+s+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=I({},e,t(e),{id:s});return n[s]=r,r}{let r=I({},e,t(e),{id:s,children:void 0});return n[s]=r,e.children&&(r.children=$(e.children,t,a,n)),r}}))}function U(e,t,r){void 0===r&&(r="/");let n=ne(("string"===typeof t?R(t):t).pathname||"/",r);if(null==n)return null;let i=H(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let a=null;for(let s=0;null==a&&s<i.length;++s)a=ee(i[s],re(n));return a}function H(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let i=(e,i,a)=>{let s={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};s.relativePath.startsWith("/")&&(A(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(n.length));let o=oe([n,s.relativePath]),l=r.concat(s);e.children&&e.children.length>0&&(A(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),H(e.children,t,l,o)),(null!=e.path||e.index)&&t.push({path:o,score:Q(o,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let n of q(e.path))i(e,t,n);else i(e,t)})),t}function q(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return i?[a,""]:[a];let s=q(n.join("/")),o=[];return o.push(...s.map((e=>""===e?a:[a,e].join("/")))),i&&o.push(...s),o.map((t=>e.startsWith("/")&&""===t?"/":t))}const Z=/^:\w+$/,G=3,W=2,X=1,J=10,K=-2,Y=e=>"*"===e;function Q(e,t){let r=e.split("/"),n=r.length;return r.some(Y)&&(n+=K),t&&(n+=W),r.filter((e=>!Y(e))).reduce(((e,t)=>e+(Z.test(t)?G:""===t?X:J)),n)}function ee(e,t){let{routesMeta:r}=e,n={},i="/",a=[];for(let s=0;s<r.length;++s){let e=r[s],o=s===r.length-1,l="/"===i?t:t.slice(i.length)||"/",c=te({path:e.relativePath,caseSensitive:e.caseSensitive,end:o},l);if(!c)return null;
2Object.assign(n,c.params);let u=e.route;a.push({params:n,pathname:oe([i,c.pathname]),pathnameBase:le(oe([i,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(i=oe([i,c.pathnameBase]))}return a}function te(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!0);L("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,((e,t)=>(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");let a=new RegExp(i,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),o=i.slice(1),l=n.reduce(((e,t,r)=>{if("*"===t){let e=o[r]||"";s=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return L(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(o[r]||"",t),e}),{});return{params:l,pathname:a,pathnameBase:s,pattern:e}}function re(e){try{return decodeURI(e)}catch(t){return L(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function ne(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function ie(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function ae(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function se(e,t,r,n){let i;void 0===n&&(n=!1),"string"===typeof e?i=R(e):(i=I({},e),A(!i.pathname||!i.pathname.includes("?"),ie("?","pathname","search",i)),A(!i.pathname||!i.pathname.includes("#"),ie("#","pathname","hash",i)),A(!i.search||!i.search.includes("#"),ie("#","search","hash",i)));let a,s=""===e||""===i.pathname,o=s?"/":i.pathname;if(n||null==o)a=r;else{let e=t.length-1;if(o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:i=""}="string"===typeof e?R(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:ce(n),hash:ue(i)}}(i,a),c=o&&"/"!==o&&o.endsWith("/"),u=(s||"."===o)&&r.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}const oe=e=>e.join("/").replace(/\/\/+/g,"/"),le=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ce=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ue=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class de extends Error{}class he{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],A(e&&"object"===typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new de("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof de)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}
2),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return A(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:pe(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function pe(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const me=function(e,t){return void 0===t&&(t={}),new he(e,"number"===typeof t?{status:t}:t)},fe=function(e,t){void 0===t&&(t=302);let r=t;"number"===typeof r?r={status:r}:"undefined"===typeof r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,I({},r,{headers:n}))};class ge{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function _e(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const ye=["post","put","patch","delete"],ve=new Set(ye),xe=["get",...ye],be=new Set(xe),we=new Set([301,302,303,307,308]),Ce=new Set([307,308]),Se={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ke={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},je={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ee=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Te=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function Pe(e){const t=e.window?e.window:"undefined"!==typeof window?window:void 0,r="undefined"!==typeof t&&"undefined"!==typeof t.document&&"undefined"!==typeof t.document.createElement,n=!r;let i;if(A(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=Te;let a,s={},o=$(e.routes,i,void 0,s),l=e.basename||"/",c=I({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),u=null,d=new Set,h=null,p=null,m=null,f=null!=e.hydrationData,g=U(o,e.history.location,l),_=null;if(null==g){let t=Ze(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=qe(o);g=r,_={[n.id]:t}}let y,v,x=!g.some((e=>e.route.lazy))&&(!g.some((e=>e.route.loader))||null!=e.hydrationData),b={historyAction:e.history.action,location:e.history.location,matches:g,initialized:x,navigation:Se,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||_,fetchers:new Map,blockers:new Map},w=P.Pop,C=!1,S=!1,k=!1,j=[],E=[],T=new Map,M=0,N=-1,D=new Map,O=new Set,R=new Map,F=new Map,V=new Map,H=!1;function q(e){b=I({},b,e),d.forEach((e=>e(b)))}function Z(t,r){var n,i;let s,l=null!=b.actionData&&null!=b.navigation.formMethod&&et(b.navigation.formMethod)&&"loading"===b.navigation.state&&!0!==(null==(n=t.state)?void 0:n._isRedirect);s=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:l?b.actionData:null;let c=r.loaderData?Ue(b.loaderData,r.loaderData,r.matches||[],r.errors):b.loaderData,u=b.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,je))));let d=!0===C||null!=b.navigation.formMethod&&et(b.navigation.formMethod)&&!0!==(null==(i=t.state)?void 0:i._isRedirect);a&&(o=a,a=void 0),S||w===P.Pop||(w===P.Push?e.history.push(t,t.state):w===P.Replace&&e.history.replace(t,t.state)),q(I({},r,{actionData:s,loaderData:c,historyAction:w,location:t,initialized:!0,navigation:Se,revalidation:"idle",restoreScrollPosition:ue(t,r.matches||b.matches),preventScrollReset:d,blockers:u})),w=P.Pop,C=!1,S=!1,k=!1,j=[],E=[]}async function G(t,r,n){v&&v.abort(),v=null,w=t,S=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(h&&m){let r=ce(e,t);h[r]=m()}}(b.location,b.matches),C=!0===(n&&n.preventScrollReset);let c=a||o,u=n&&n.overrideNavigation,d=U(c,r,l);if(!d){let e=Ze(404,{pathname:r.pathname}),{matches:t,route:n}=qe(c);return le(),void Z(r,{matches:t,loaderData:{},errors:{[n.id]:e}})}if(b.initialized&&!k&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;
2if(""!==t.hash)return!0;return!1}(b.location,r)&&!(n&&n.submission&&et(n.submission.formMethod)))return void Z(r,{matches:d});v=new AbortController;let p,f,g=Re(e.history,r,v.signal,n&&n.submission);if(n&&n.pendingError)f={[He(d).route.id]:n.pendingError};else if(n&&n.submission&&et(n.submission.formMethod)){let e=await async function(e,t,r,n,a){void 0===a&&(a={});K();let o,c=function(e,t){let r={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return r}(t,r);q({navigation:c});let u=it(n,t);if(u.route.action||u.route.lazy){if(o=await Oe("action",e,u,n,s,i,l),e.signal.aborted)return{shortCircuited:!0}}else o={type:B.error,error:Ze(405,{method:e.method,pathname:t.pathname,routeId:u.route.id})};if(Ke(o)){let e;return e=a&&null!=a.replace?a.replace:o.location===b.location.pathname+b.location.search,await X(b,o,{submission:r,replace:e}),{shortCircuited:!0}}if(Je(o)){let e=He(n,u.route.id);return!0!==(a&&a.replace)&&(w=P.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:o.error}}}if(Xe(o))throw Ze(400,{type:"defer-action"});return{pendingActionData:{[u.route.id]:o.data}}}(g,r,n.submission,d,{replace:n.replace});if(e.shortCircuited)return;p=e.pendingActionData,f=e.pendingActionError,u=st(r,n.submission),g=new Request(g.url,{signal:g.signal})}let{shortCircuited:_,loaderData:y,errors:x}=await async function(t,r,n,i,s,c,u,d,h){let p=i||st(r,s),m=s||c||at(p),f=a||o,[g,_]=Ae(e.history,b,n,m,r,k,j,E,R,O,f,l,d,h);if(le((e=>!(n&&n.some((t=>t.route.id===e)))||g&&g.some((t=>t.route.id===e)))),N=++M,0===g.length&&0===_.length){let e=re();return Z(r,I({matches:n,loaderData:{},errors:h||null},d?{actionData:d}:{},e?{fetchers:new Map(b.fetchers)}:{})),{shortCircuited:!0}}if(!S){_.forEach((e=>{let t=b.fetchers.get(e.key),r=ot(void 0,t?t.data:void 0);b.fetchers.set(e.key,r)}));let e=d||b.actionData;q(I({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},_.length>0?{fetchers:new Map(b.fetchers)}:{}))}_.forEach((e=>{T.has(e.key)&&ee(e.key),e.controller&&T.set(e.key,e.controller)}));let y=()=>_.forEach((e=>ee(e.key)));v&&v.signal.addEventListener("abort",y);let{results:x,loaderResults:w,fetcherResults:C}=await J(b.matches,n,g,_,t);if(t.signal.aborted)return{shortCircuited:!0};v&&v.signal.removeEventListener("abort",y);_.forEach((e=>T.delete(e.key)));let P=Ge(x);if(P){if(P.idx>=g.length){let e=_[P.idx-g.length].key;O.add(e)}return await X(b,P.result,{replace:u}),{shortCircuited:!0}}let{loaderData:A,errors:L}=$e(b,n,g,w,h,_,C,F);F.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&F.delete(t)}))}));let D=re(),z=ie(N),B=D||z||_.length>0;return I({loaderData:A,errors:L},B?{fetchers:new Map(b.fetchers)}:{})}(g,r,d,u,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,p,f);_||(v=null,Z(r,I({matches:d},p?{actionData:p}:{},{loaderData:y,errors:x})))}function W(e){return b.fetchers.get(e)||ke}async function X(n,i,a){let{submission:s,replace:o,isFetchActionRedirect:c}=void 0===a?{}:a;i.revalidate&&(k=!0);let u=z(n.location,i.location,I({_isRedirect:!0},c?{_isFetchActionRedirect:!0}:{}));if(A(u,"Expected a location on the redirect navigation"),r){let r=!1;if(i.reloadDocument)r=!0;else if(Ee.test(i.location)){const n=e.history.createURL(i.location);r=n.origin!==t.location.origin||null==ne(n.pathname,l)}if(r)return void(o?t.location.replace(i.location):t.location.assign(i.location))}v=null;let d=!0===o?P.Replace:P.Push,h=s||at(n.navigation);if(Ce.has(i.status)&&h&&et(h.formMethod))await G(d,u,{submission:I({},h,{formAction:i.location}),preventScrollReset:C});else if(c)await G(d,u,{overrideNavigation:st(u),fetcherSubmission:h,preventScrollReset:C});else{let e=st(u,h);await G(d,u,{overrideNavigation:e,preventScrollReset:C})}}async function J(t,r,n,a,o){let c=await Promise.all([...n.map((e=>Oe("loader",o,e,r,s,i,l))),...a.map((t=>{if(t.matches&&t.match&&t.controller)return Oe("loader",Re(e.history,t.path,t.controller.signal),t.match,t.matches,s,i,l);return{type:B.error,error:Ze(404,{pathname:t.path})}}))]),u=c.slice(0,n.length),d=c.slice(n.length);return await Promise.all([tt(t,n,u,u.map((()=>o.signal)),!1,b.loaderData),tt(t,a.map((e=>e.match)),d,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:c,loaderResults:u,fetcherResults:d}}
2function K(){k=!0,j.push(...le()),R.forEach(((e,t)=>{T.has(t)&&(E.push(t),ee(t))}))}function Y(e,t,r){let n=He(b.matches,t);Q(e),q({errors:{[n.route.id]:r},fetchers:new Map(b.fetchers)})}function Q(e){let t=b.fetchers.get(e);!T.has(e)||t&&"loading"===t.state&&D.has(e)||ee(e),R.delete(e),D.delete(e),O.delete(e),b.fetchers.delete(e)}function ee(e){let t=T.get(e);A(t,"Expected fetch controller: "+e),t.abort(),T.delete(e)}function te(e){for(let t of e){let e=lt(W(t).data);b.fetchers.set(t,e)}}function re(){let e=[],t=!1;for(let r of O){let n=b.fetchers.get(r);A(n,"Expected fetcher: "+r),"loading"===n.state&&(O.delete(r),e.push(r),t=!0)}return te(e),t}function ie(e){let t=[];for(let[r,n]of D)if(n<e){let e=b.fetchers.get(r);A(e,"Expected fetcher: "+r),"loading"===e.state&&(ee(r),D.delete(r),t.push(r))}return te(t),t.length>0}function ae(e){b.blockers.delete(e),V.delete(e)}function se(e,t){let r=b.blockers.get(e)||je;A("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(b.blockers);n.set(e,t),q({blockers:n})}function oe(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===V.size)return;V.size>1&&L(!1,"A router only supports one blocker at a time");let i=Array.from(V.entries()),[a,s]=i[i.length-1],o=b.blockers.get(a);return o&&"proceeding"===o.state?void 0:s({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function le(e){let t=[];return F.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),F.delete(n))})),t}function ce(e,t){if(p){let r=p(e,t.map((e=>function(e,t){let{route:r,pathname:n,params:i}=e;return{id:r.id,pathname:n,params:i,data:t[r.id],handle:r.handle}}(e,b.loaderData))));return r||e.key}return e.key}function ue(e,t){if(h){let r=ce(e,t),n=h[r];if("number"===typeof n)return n}return null}return y={get basename(){return l},get state(){return b},get routes(){return o},initialize:function(){return u=e.history.listen((t=>{let{action:r,location:n,delta:i}=t;if(H)return void(H=!1);L(0===V.size||null!=i,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=oe({currentLocation:b.location,nextLocation:n,historyAction:r});return a&&null!=i?(H=!0,e.history.go(-1*i),void se(a,{state:"blocked",location:n,proceed(){se(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(i)},reset(){let e=new Map(b.blockers);e.set(a,je),q({blockers:e})}})):G(r,n)})),b.initialized||G(P.Pop,b.location),y},subscribe:function(e){return d.add(e),()=>d.delete(e)},enableScrollRestoration:function(e,t,r){if(h=e,m=t,p=r||null,!f&&b.navigation===Se){f=!0;let e=ue(b.location,b.matches);null!=e&&q({restoreScrollPosition:e})}return()=>{h=null,m=null,p=null}},navigate:async function t(r,n){if("number"===typeof r)return void e.history.go(r);let i=Ie(b.location,b.matches,l,c.v7_prependBasename,r,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),{path:a,submission:s,error:o}=Me(c.v7_normalizeFormMethod,!1,i,n),u=b.location,d=z(b.location,a,n&&n.state);d=I({},d,e.history.encodeLocation(d));let h=n&&null!=n.replace?n.replace:void 0,p=P.Push;!0===h?p=P.Replace:!1===h||null!=s&&et(s.formMethod)&&s.formAction===b.location.pathname+b.location.search&&(p=P.Replace);let m=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,f=oe({currentLocation:u,nextLocation:d,historyAction:p});if(!f)return await G(p,d,{submission:s,pendingError:o,preventScrollReset:m,replace:n&&n.replace});se(f,{state:"blocked",location:d,proceed(){se(f,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,n)},reset(){let e=new Map(b.blockers);e.set(f,je),q({blockers:e})}})},fetch:function(t,r,u,d){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");T.has(t)&&ee(t);
2let h=a||o,p=Ie(b.location,b.matches,l,c.v7_prependBasename,u,r,null==d?void 0:d.relative),m=U(h,p,l);if(!m)return void Y(t,r,Ze(404,{pathname:p}));let{path:f,submission:g,error:_}=Me(c.v7_normalizeFormMethod,!0,p,d);if(_)return void Y(t,r,_);let y=it(m,f);C=!0===(d&&d.preventScrollReset),g&&et(g.formMethod)?async function(t,r,n,c,u,d){if(K(),R.delete(t),!c.route.action&&!c.route.lazy){let e=Ze(405,{method:d.formMethod,pathname:n,routeId:r});return void Y(t,r,e)}let h=b.fetchers.get(t),p=function(e,t){let r={state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0};return r}(d,h);b.fetchers.set(t,p),q({fetchers:new Map(b.fetchers)});let m=new AbortController,f=Re(e.history,n,m.signal,d);T.set(t,m);let g=M,_=await Oe("action",f,c,u,s,i,l);if(f.signal.aborted)return void(T.get(t)===m&&T.delete(t));if(Ke(_)){if(T.delete(t),N>g){let e=lt(void 0);return b.fetchers.set(t,e),void q({fetchers:new Map(b.fetchers)})}{O.add(t);let e=ot(d);return b.fetchers.set(t,e),q({fetchers:new Map(b.fetchers)}),X(b,_,{submission:d,isFetchActionRedirect:!0})}}if(Je(_))return void Y(t,r,_.error);if(Xe(_))throw Ze(400,{type:"defer-action"});let y=b.navigation.location||b.location,x=Re(e.history,y,m.signal),C=a||o,S="idle"!==b.navigation.state?U(C,b.navigation.location,l):b.matches;A(S,"Didn't find any matches after fetcher action");let P=++M;D.set(t,P);let L=ot(d,_.data);b.fetchers.set(t,L);let[z,B]=Ae(e.history,b,S,d,y,k,j,E,R,O,C,l,{[c.route.id]:_.data},void 0);B.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=b.fetchers.get(t),n=ot(void 0,r?r.data:void 0);b.fetchers.set(t,n),T.has(t)&&ee(t),e.controller&&T.set(t,e.controller)})),q({fetchers:new Map(b.fetchers)});let V=()=>B.forEach((e=>ee(e.key)));m.signal.addEventListener("abort",V);let{results:$,loaderResults:H,fetcherResults:G}=await J(b.matches,S,z,B,x);if(m.signal.aborted)return;m.signal.removeEventListener("abort",V),D.delete(t),T.delete(t),B.forEach((e=>T.delete(e.key)));let W=Ge($);if(W){if(W.idx>=z.length){let e=B[W.idx-z.length].key;O.add(e)}return X(b,W.result)}let{loaderData:Q,errors:te}=$e(b,b.matches,z,H,void 0,B,G,F);if(b.fetchers.has(t)){let e=lt(_.data);b.fetchers.set(t,e)}let re=ie(P);"loading"===b.navigation.state&&P>N?(A(w,"Expected pending action"),v&&v.abort(),Z(b.navigation.location,{matches:S,loaderData:Q,errors:te,fetchers:new Map(b.fetchers)})):(q(I({errors:te,loaderData:Ue(b.loaderData,Q,S,te)},re||B.length>0?{fetchers:new Map(b.fetchers)}:{})),k=!1)}(t,r,f,y,m,g):(R.set(t,{routeId:r,path:f}),async function(t,r,n,a,o,c){let u=b.fetchers.get(t),d=ot(c,u?u.data:void 0);b.fetchers.set(t,d),q({fetchers:new Map(b.fetchers)});let h=new AbortController,p=Re(e.history,n,h.signal);T.set(t,h);let m=M,f=await Oe("loader",p,a,o,s,i,l);Xe(f)&&(f=await rt(f,p.signal,!0)||f);T.get(t)===h&&T.delete(t);if(p.signal.aborted)return;if(Ke(f)){if(N>m){let e=lt(void 0);return b.fetchers.set(t,e),void q({fetchers:new Map(b.fetchers)})}return O.add(t),void await X(b,f)}if(Je(f)){let e=He(b.matches,r);return b.fetchers.delete(t),void q({fetchers:new Map(b.fetchers),errors:{[e.route.id]:f.error}})}A(!Xe(f),"Unhandled fetcher deferred data");let g=lt(f.data);b.fetchers.set(t,g),q({fetchers:new Map(b.fetchers)})}(t,r,f,y,m,g))},revalidate:function(){K(),q({revalidation:"loading"}),"submitting"!==b.navigation.state&&("idle"!==b.navigation.state?G(w||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation}):G(b.historyAction,b.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:W,deleteFetcher:Q,dispose:function(){u&&u(),d.clear(),v&&v.abort(),b.fetchers.forEach(((e,t)=>Q(t))),b.blockers.forEach(((e,t)=>ae(t)))},getBlocker:function(e,t){let r=b.blockers.get(e)||je;return V.get(e)!==t&&V.set(e,t),r},deleteBlocker:ae,_internalFetchControllers:T,_internalActiveDeferreds:F,_internalSetRoutes:function(e){s={},a=$(e,i,void 0,s)}},y}Symbol("deferred");function Ie(e,t,r,n,i,a,s){let o,l;if(null!=a&&"path"!==s){o=[];
2for(let e of t)if(o.push(e),e.route.id===a){l=e;break}}else o=t,l=t[t.length-1];let c=se(i||".",ae(o).map((e=>e.pathnameBase)),ne(e.pathname,r)||e.pathname,"path"===s);return null==i&&(c.search=e.search,c.hash=e.hash),null!=i&&""!==i&&"."!==i||!l||!l.route.index||nt(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:oe([r,c.pathname])),O(c)}function Me(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&!Qe(n.formMethod))return{path:r,error:Ze(405,{method:n.formMethod})};let i,a,s=()=>({path:r,error:Ze(400,{type:"invalid-body"})}),o=n.formMethod||"get",l=e?o.toUpperCase():o.toLowerCase(),c=We(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!et(l))return s();let e="string"===typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!et(l))return s();try{let e="string"===typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(h){return s()}}}if(A("function"===typeof FormData,"FormData is not available in this environment"),n.formData)i=Fe(n.formData),a=n.formData;else if(n.body instanceof FormData)i=Fe(n.body),a=n.body;else if(n.body instanceof URLSearchParams)i=n.body,a=Be(i);else if(null==n.body)i=new URLSearchParams,a=new FormData;else try{i=new URLSearchParams(n.body),a=Be(i)}catch(h){return s()}let u={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:a,json:void 0,text:void 0};if(et(u.formMethod))return{path:r,submission:u};let d=R(r);return t&&d.search&&nt(d.search)&&i.append("index",""),d.search="?"+i,{path:O(d),submission:u}}function Ne(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}function Ae(e,t,r,n,i,a,s,o,l,c,u,d,h,p){let m=p?Object.values(p)[0]:h?Object.values(h)[0]:void 0,f=e.createURL(t.location),g=e.createURL(i),_=p?Object.keys(p)[0]:void 0,y=Ne(r,_).filter(((e,r)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,i=void 0===e[r.route.id];return n||i}(t.loaderData,t.matches[r],e)||s.some((t=>t===e.route.id)))return!0;let i=t.matches[r],o=e;return De(e,I({currentUrl:f,currentParams:i.params,nextUrl:g,nextParams:o.params},n,{actionResult:m,defaultShouldRevalidate:a||f.pathname+f.search===g.pathname+g.search||f.search!==g.search||Le(i,o)}))})),v=[];return l.forEach(((e,i)=>{if(!r.some((t=>t.route.id===e.routeId)))return;let s=U(u,e.path,d);if(!s)return void v.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=t.fetchers.get(i),h=it(s,e.path),p=!1;p=!c.has(i)&&(!!o.includes(i)||(l&&"idle"!==l.state&&void 0===l.data?a:De(h,I({currentUrl:f,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:m,defaultShouldRevalidate:a})))),p&&v.push({key:i,routeId:e.routeId,path:e.path,matches:s,match:h,controller:new AbortController})})),[y,v]}function Le(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function De(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"===typeof r)return r}return t.defaultShouldRevalidate}async function ze(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let i=r[e.id];A(i,"No route found in manifest");let a={};for(let s in n){let e=void 0!==i[s]&&"hasErrorBoundary"!==s;L(!e,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+s+'" will be ignored.'),e||V.has(s)||(a[s]=n[s])}Object.assign(i,a),Object.assign(i,I({},t(i),{lazy:void 0}))}async function Oe(e,t,r,n,i,a,s,o){let l,c,u;void 0===o&&(o={});let d=e=>{let n,i=new Promise(((e,t)=>n=t));return u=()=>n(),t.signal.addEventListener("abort",u),Promise.race([e({request:t,params:r.params,context:o.requestContext}),i])};try{let n=r.route[e];if(r.route.lazy)if(n){c=(await Promise.all([d(n),ze(r.route,a,i)]))[0]}else{if(await ze(r.route,a,i),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Ze(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:B.data,data:void 0}}c=await d(n)}else{if(!n){let e=new URL(t.url);throw Ze(404,{pathname:e.pathname+e.search})}c=await d(n)}A(void 0!==c,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(m){l=B.error,c=m}finally{u&&t.signal.removeEventListener("abort",u)}if(Ye(c)){let e,i=c.status;if(we.has(i)){let e=c.headers.get("Location");if(A(e,"Redirects returned/thrown from loaders/actions must have a Location header"),Ee.test(e)){if(!o.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),i=null!=ne(n.pathname,s);n.origin===r.origin&&i&&(e=n.pathname+n.search+n.hash)}}else e=Ie(new URL(t.url),n.slice(0,n.indexOf(r)+1),s,!0,e);if(o.isStaticRequest)throw c.headers.set("Location",e),c;return{type:B.redirect,status:i,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate"),reloadDocument:null!==c.headers.get("X-Remix-Reload-Document")}}if(o.isRouteRequest){throw{type:l===B.error?B.error:B.data,response:c}}let a=c.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await c.json():await c.text(),l===B.error?{type:l,error:new ge(i,c.statusText,e),headers:c.headers}:{type:B.data,data:e,statusCode:c.status,headers:c.headers}}return l===B.error?{type:l,error:c}:function(e){let t=e;return t&&"object"===typeof t&&"object"===typeof t.data&&"function"===typeof t.subscribe&&"function"===typeof t.cancel&&"function"===typeof t.resolveData}(c)?{type:B.deferred,deferredData:c,statusCode:null==(h=c.init)?void 0:h.status,headers:(null==(p=c.init)?void 0:p.headers)&&new Headers(c.init.headers)}:{type:B.data,data:c};var h,p}function Re(e,t,r,n){let i=e.createURL(We(t)).toString(),a={signal:r};if(n&&et(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=Fe(n.formData):a.body=n.formData}
2return new Request(i,a)}function Fe(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"===typeof n?n:n.name);return t}function Be(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ve(e,t,r,n,i){let a,s={},o=null,l=!1,c={};return r.forEach(((r,u)=>{let d=t[u].route.id;if(A(!Ke(r),"Cannot handle redirect results in processLoaderData"),Je(r)){let t=He(e,d),i=r.error;n&&(i=Object.values(n)[0],n=void 0),o=o||{},null==o[t.route.id]&&(o[t.route.id]=i),s[d]=void 0,l||(l=!0,a=_e(r.error)?r.error.status:500),r.headers&&(c[d]=r.headers)}else Xe(r)?(i.set(d,r.deferredData),s[d]=r.deferredData.data):s[d]=r.data,null==r.statusCode||200===r.statusCode||l||(a=r.statusCode),r.headers&&(c[d]=r.headers)})),n&&(o=n,s[Object.keys(n)[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:c}}function $e(e,t,r,n,i,a,s,o){let{loaderData:l,errors:c}=Ve(t,r,n,i,o);for(let u=0;u<a.length;u++){let{key:t,match:r,controller:n}=a[u];A(void 0!==s&&void 0!==s[u],"Did not find corresponding fetcher result");let i=s[u];if(!n||!n.signal.aborted)if(Je(i)){let n=He(e.matches,null==r?void 0:r.route.id);c&&c[n.route.id]||(c=I({},c,{[n.route.id]:i.error})),e.fetchers.delete(t)}else if(Ke(i))A(!1,"Unhandled fetcher revalidation redirect");else if(Xe(i))A(!1,"Unhandled fetcher deferred data");else{let r=lt(i.data);e.fetchers.set(t,r)}}return{loaderData:l,errors:c}}function Ue(e,t,r,n){let i=I({},t);for(let a of r){let r=a.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(i[r]=t[r]):void 0!==e[r]&&a.route.loader&&(i[r]=e[r]),n&&n.hasOwnProperty(r))break}return i}function He(e,t){let r=t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e];return r.reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function qe(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ze(e,t){let{pathname:r,routeId:n,method:i,type:a}=void 0===t?{}:t,s="Unknown Server Error",o="Unknown @remix-run/router error";return 400===e?(s="Bad Request",i&&r&&n?o="You made a "+i+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?o="defer() is not supported in actions":"invalid-body"===a&&(o="Unable to encode submission body")):403===e?(s="Forbidden",o='Route "'+n+'" does not match URL "'+r+'"'):404===e?(s="Not Found",o='No route matches URL "'+r+'"'):405===e&&(s="Method Not Allowed",i&&r&&n?o="You made a "+i.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':i&&(o='Invalid request method "'+i.toUpperCase()+'"')),new ge(e||500,s,new Error(o),!0)}function Ge(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ke(r))return{result:r,idx:t}}}function We(e){return O(I({},"string"===typeof e?R(e):e,{hash:""}))}function Xe(e){return e.type===B.deferred}function Je(e){return e.type===B.error}function Ke(e){return(e&&e.type)===B.redirect}function Ye(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function Qe(e){return be.has(e.toLowerCase())}function et(e){return ve.has(e.toLowerCase())}async function tt(e,t,r,n,i,a){for(let s=0;s<r.length;s++){let o=r[s],l=t[s];if(!l)continue;let c=e.find((e=>e.route.id===l.route.id)),u=null!=c&&!Le(c,l)&&void 0!==(a&&a[l.route.id]);if(Xe(o)&&(i||u)){let e=n[s];A(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await rt(o,e,i).then((e=>{e&&(r[s]=e||r[s])}))}}}async function rt(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:B.data,data:e.deferredData.unwrappedData}}catch(n){return{type:B.error,error:n}}return{type:B.data,data:e.deferredData.data}}}function nt(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function it(e,t){let r="string"===typeof t?R(t).search:t.search;if(e[e.length-1].route.index&&nt(r||""))return e[e.length-1];let n=ae(e);return n[n.length-1]}function at(e){let{formMethod:t,formAction:r,formEncType:n,text:i,formData:a,json:s}=e;if(t&&r&&n)return null!=i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0}:void 0!==s?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:s,text:void 0}:void 0}function st(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ot(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function lt(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
2for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ct.apply(this,arguments)}const ut=e.createContext(null);const dt=e.createContext(null);const ht=e.createContext(null);const pt=e.createContext(null);const mt=e.createContext(null);const ft=e.createContext({outlet:null,matches:[],isDataRoute:!1});const gt=e.createContext(null);function _t(){return null!=e.useContext(mt)}function yt(){return _t()||A(!1),e.useContext(mt).location}function vt(t){e.useContext(pt).static||e.useLayoutEffect(t)}function xt(){let{isDataRoute:t}=e.useContext(ft);return t?function(){let{router:t}=Nt(It.UseNavigateStable),r=Lt(Mt.UseNavigateStable),n=e.useRef(!1);vt((()=>{n.current=!0}));let i=e.useCallback((function(e,i){void 0===i&&(i={}),n.current&&("number"===typeof e?t.navigate(e):t.navigate(e,ct({fromRouteId:r},i)))}),[t,r]);return i}():function(){_t()||A(!1);let t=e.useContext(ut),{basename:r,navigator:n}=e.useContext(pt),{matches:i}=e.useContext(ft),{pathname:a}=yt(),s=JSON.stringify(ae(i).map((e=>e.pathnameBase))),o=e.useRef(!1);vt((()=>{o.current=!0}));let l=e.useCallback((function(e,i){if(void 0===i&&(i={}),!o.current)return;if("number"===typeof e)return void n.go(e);let l=se(e,JSON.parse(s),a,"path"===i.relative);null==t&&"/"!==r&&(l.pathname="/"===l.pathname?r:oe([r,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[r,n,s,a,t]);return l}()}const bt=e.createContext(null);function wt(){let{matches:t}=e.useContext(ft),r=t[t.length-1];return r?r.params:{}}function Ct(t,r){let{relative:n}=void 0===r?{}:r,{matches:i}=e.useContext(ft),{pathname:a}=yt(),s=JSON.stringify(ae(i).map((e=>e.pathnameBase)));return e.useMemo((()=>se(t,JSON.parse(s),a,"path"===n)),[t,s,a,n])}function St(t,r,n){_t()||A(!1);let{navigator:i}=e.useContext(pt),{matches:a}=e.useContext(ft),s=a[a.length-1],o=s?s.params:{},l=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let c,u=yt();if(r){var d;let e="string"===typeof r?R(r):r;"/"===l||(null==(d=e.pathname)?void 0:d.startsWith(l))||A(!1),c=e}else c=u;let h=c.pathname||"/",p=U(t,{pathname:"/"===l?h:h.slice(l.length)||"/"});let m=Pt(p&&p.map((e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:oe([l,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?l:oe([l,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n);return r&&m?e.createElement(mt.Provider,{value:{location:ct({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:P.Pop}},m):m}function kt(){let t=function(){var t;let r=e.useContext(gt),n=At(Mt.UseRouteError),i=Lt(Mt.UseRouteError);if(r)return r;return null==(t=n.errors)?void 0:t[i]}(),r=_e(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const jt=e.createElement(kt,null);class Et extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?e.createElement(ft.Provider,{value:this.props.routeContext},e.createElement(gt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Tt(t){let{routeContext:r,match:n,children:i}=t,a=e.useContext(ut);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(ft.Provider,{value:r},i)}function Pt(t,r,n){var i;if(void 0===r&&(r=[]),void 0===n&&(n=null),null==t){var a;
2if(null==(a=n)||!a.errors)return null;t=n.matches}let s=t,o=null==(i=n)?void 0:i.errors;if(null!=o){let e=s.findIndex((e=>e.route.id&&(null==o?void 0:o[e.route.id])));e>=0||A(!1),s=s.slice(0,Math.min(s.length,e+1))}return s.reduceRight(((t,i,a)=>{let l=i.route.id?null==o?void 0:o[i.route.id]:null,c=null;n&&(c=i.route.errorElement||jt);let u=r.concat(s.slice(0,a+1)),d=()=>{let r;return r=l?c:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(Tt,{match:i,routeContext:{outlet:t,matches:u,isDataRoute:null!=n},children:r})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===a)?e.createElement(Et,{location:n.location,revalidation:n.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var It=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(It||{}),Mt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Mt||{});function Nt(t){let r=e.useContext(ut);return r||A(!1),r}function At(t){let r=e.useContext(dt);return r||A(!1),r}function Lt(t){let r=function(){let t=e.useContext(ft);return t||A(!1),t}(),n=r.matches[r.matches.length-1];return n.route.id||A(!1),n.route.id}function Dt(){let e=At(Mt.UseLoaderData),t=Lt(Mt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}const zt=t.startTransition;function Ot(t){let{fallbackElement:r,router:n,future:i}=t,[a,s]=e.useState(n.state),{v7_startTransition:o}=i||{},l=e.useCallback((e=>{o&&zt?zt((()=>s(e))):s(e)}),[s,o]);e.useLayoutEffect((()=>n.subscribe(l)),[n,l]);let c=e.useMemo((()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),u=n.basename||"/",d=e.useMemo((()=>({router:n,navigator:c,static:!1,basename:u})),[n,c,u]);return e.createElement(e.Fragment,null,e.createElement(ut.Provider,{value:d},e.createElement(dt.Provider,{value:a},e.createElement(Bt,{basename:u,location:a.location,navigationType:a.historyAction,navigator:c},a.initialized?e.createElement(Rt,{routes:n.routes,state:a}):r))),null)}function Rt(e){let{routes:t,state:r}=e;return St(t,void 0,r)}function Ft(t){return function(t){let r=e.useContext(ft).outlet;return r?e.createElement(bt.Provider,{value:t},r):r}(t.context)}function Bt(t){let{basename:r="/",children:n=null,location:i,navigationType:a=P.Pop,navigator:s,static:o=!1}=t;_t()&&A(!1);let l=r.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:l,navigator:s,static:o})),[l,s,o]);"string"===typeof i&&(i=R(i));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:m="default"}=i,f=e.useMemo((()=>{let e=ne(u,l);return null==e?null:{location:{pathname:e,search:d,hash:h,state:p,key:m},navigationType:a}}),[l,u,d,h,p,m,a]);return null==f?null:e.createElement(pt.Provider,{value:c},e.createElement(mt.Provider,{children:n,value:f}))}function Vt(t){let{children:r,errorElement:n,resolve:i}=t;return e.createElement(Ht,{resolve:i,errorElement:n},e.createElement(qt,null,r))}var $t=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}($t||{});const Ut=new Promise((()=>{}));class Ht extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,i=null,a=$t.pending;if(n instanceof Promise)if(this.state.error){a=$t.error;let e=this.state.error;i=Promise.reject().catch((()=>{})),Object.defineProperty(i,"_tracked",{get:()=>!0}),Object.defineProperty(i,"_error",{get:()=>e})}else n._tracked?(i=n,a=void 0!==i._error?$t.error:void 0!==i._data?$t.success:$t.pending):(a=$t.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),i=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else a=$t.success,i=Promise.resolve(),Object.defineProperty(i,"_tracked",{get:()=>!0}),Object.defineProperty(i,"_data",{get:()=>n});if(a===$t.error&&i._error instanceof de)throw Ut;if(a===$t.error&&!r)throw i._error;if(a===$t.error)return e.createElement(ht.Provider,{value:i,children:r});if(a===$t.success)return e.createElement(ht.Provider,{value:i,children:t});throw i}}function qt(t){let{children:r}=t,n=function(){let t=e.useContext(ht);return null==t?void 0:t._data}(),i="function"===typeof r?r(n):r;return e.createElement(e.Fragment,null,i)}function Zt(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
2for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gt.apply(this,arguments)}function Wt(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Xt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function Jt(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Gt({},t,{errors:Kt(t.errors)})),t}function Kt(e){if(!e)return null;let t=Object.entries(e),r={};for(let[i,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[i]=new ge(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"===typeof e)try{let t=new e(a.message);t.stack="",r[i]=t}catch(n){}}if(null==r[i]){let e=new Error(a.message);e.stack="",r[i]=e}}else r[i]=a;return r}t.startTransition;const Yt="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Qt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,er=e.forwardRef((function(t,r){let n,{onClick:i,relative:a,reloadDocument:s,replace:o,state:l,target:c,to:u,preventScrollReset:d}=t,h=Wt(t,Xt),{basename:p}=e.useContext(pt),m=!1;if("string"===typeof u&&Qt.test(u)&&(n=u,Yt))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=ne(t.pathname,p);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:m=!0}catch(_){}let f=function(t,r){let{relative:n}=void 0===r?{}:r;_t()||A(!1);let{basename:i,navigator:a}=e.useContext(pt),{hash:s,pathname:o,search:l}=Ct(t,{relative:n}),c=o;return"/"!==i&&(c="/"===o?i:oe([i,o])),a.createHref({pathname:c,search:l,hash:s})}(u,{relative:a}),g=function(t,r){let{target:n,replace:i,state:a,preventScrollReset:s,relative:o}=void 0===r?{}:r,l=xt(),c=yt(),u=Ct(t,{relative:o});return e.useCallback((e=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(e,n)){e.preventDefault();let r=void 0!==i?i:O(c)===O(u);l(t,{replace:r,state:a,preventScrollReset:s,relative:o})}}),[c,l,u,i,a,n,t,s,o])}(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a});return e.createElement("a",Gt({},h,{href:n||f,onClick:m||s?i:function(e){i&&i(e),e.defaultPrevented||g(e)},ref:r,target:c}))}));var tr,rr;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(tr||(tr={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(rr||(rr={}));const nr=async(e,t,r)=>{const n={method:t||"GET",headers:{"Content-Type":"application/json",Authorization:`Basic ${btoa("3owl:access")}`,ProjectID:"1",ProjectName:"GAC"}};r&&(n.body=JSON.stringify(r));
2const i=await fetch(e,n);if(i.ok){return await i.json()}return{message:await i.json(),success:!1}},ir=async()=>await nr("https://ordernew-admin.greatamericancookies.com/api/v1/get-restaurants?no_cache=1",null,null),ar=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/restaurants/nearby?delivery=${t}&lat=${e.lat}&lng=${e.lng}`,null,null),sr=async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/restaurants/${e}`,null,null),or=async e=>{const t=await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/restaurants/${e}?with_menu=1`,null,null);if((null===t||void 0===t||!t.id)&&null!=e&&!/^\d+$/.test(String(e))){const t=await ir();if(Array.isArray(t)){const r=String(e),n=t.find((e=>(null===e||void 0===e?void 0:e.location_slug)===r||(null===e||void 0===e?void 0:e.slug)===r));if(null!==n&&void 0!==n&&n.id)return nr(`https://ordernew-admin.greatamericancookies.com/api/v1/restaurants/${n.id}?with_menu=1`,null,null)}}return t},lr=async e=>await nr("https://ordernew-admin.greatamericancookies.com/api/v1/restaurants/menu",null,null),cr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/restaurants/${e}/product/${t}`,null,null),ur=async e=>await nr("https://ordernew-admin.greatamericancookies.com/api/v1/cart","POST",e),dr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}?authtoken=${t}`,null,null),hr=async e=>await nr("https://ordernew-admin.greatamericancookies.com/api/v1/cart/item","POST",e),pr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/item`,"POST",t),mr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/item`,"PUT",t),fr=async(e,t,r)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/item/${t}`,"PUT",r),gr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/item/${t}`,"DELETE",null),_r=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/set-delivery-method`,"PUT",t),yr=async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/validate`,null,null),vr=async(e,t,r)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/get-time-slots/${e}/${t}/${r}`,null,null),xr=async(e,t,r)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/set-vehicle/${t}`,"POST",r),br=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/set-tip-amount`,"POST",t),wr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/checkout`,"POST",t),Cr=async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/orders/${e}`,null,null),Sr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/ccsftoken`,"POST",t),kr=async e=>await nr("https://ordernew-admin.greatamericancookies.com/api/v1/register","POST",e),jr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}${t?"?auth_provider="+t:""}`,null,null),Er=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/migrate-account`,"POST",t),Tr=async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/migrate-user`,"POST",t),Pr=(e,t,r)=>{const n=new Date;let i={};i=null!==r?{value:t,expiry:n.getTime()+1e3*r}:{value:t},localStorage.setItem(e,JSON.stringify(i))},Ir=e=>{const t=localStorage.getItem(e);if(null===t||void 0===t)return null;const r=JSON.parse(t),n=new Date;return r.expiry&&n.getTime()>r.expiry?(localStorage.removeItem(e),null):r.value},Mr=(e,t,r)=>{const n=new Date;let i={};i=null!==r?{value:t,expiry:n.getTime()+1e3*r}:{value:t},sessionStorage.setItem(e,JSON.stringify(i))},Nr=e=>{const t=sessionStorage.getItem(e);if(null===t||void 0===t)return null;const r=JSON.parse(t),n=new Date;return r.expiry&&n.getTime()>r.expiry?(sessionStorage.removeItem(e),null):r.value},Ar=e=>{sessionStorage.removeItem(e)};var Lr={item:"Card_item__ykNCY",item_no_padding:"Card_item_no_padding__Xr2h5",column:"Card_column__Ouj0H",column_perma:"Card_column_perma__oVOlM"},Dr=r(579);var zr=e=>{let{direction:t,children:r,extraClass:n}=e;return(0,Dr.jsx)("div",{className:`${Lr.item} ${Lr[t]} ${Lr[n]}`,children:r})},Or="SuperCategories_supercategories__JnDjM",Rr="SuperCategories_text_content__Lu1Vw",Fr="SuperCategories_title__u1LJh",Br="SuperCategories_title_icon__S6Rp3",Vr="SuperCategories_image_container__psk+h",$r="SuperCategories_button_link__8RYEd",Ur="SuperCategories_set_fav_loc_container__TbpsV";function Hr(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function qr(e){return!!e&&!!e[Dn]}function Zr(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===zn}(e)||Array.isArray(e)||!!e[Ln]||!!(null===(t=e.constructor)||void 0===t?void 0:t[Ln])||Qr(e)||en(e))}function Gr(e,t,r){void 0===r&&(r=!1),0===Wr(e)?(r?Object.keys:On)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function Wr(e){var t=e[Dn];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Qr(e)?2:en(e)?3:0}function Xr(e,t){return 2===Wr(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Jr(e,t){return 2===Wr(e)?e.get(t):e[t]}function Kr(e,t,r){var n=Wr(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function Yr(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Qr(e){return In&&e instanceof Map}function en(e){return Mn&&e instanceof Set}function tn(e){return e.o||e.t}function rn(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Rn(e);delete t[Dn];for(var r=On(t),n=0;n<r.length;n++){var i=r[n],a=t[i];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function nn(e,t){return void 0===t&&(t=!1),sn(e)||qr(e)||!Zr(e)||(Wr(e)>1&&(e.set=e.add=e.clear=e.delete=an),Object.freeze(e),t&&Gr(e,(function(e,t){return nn(t,!0)}),!0)),e}function an(){Hr(2)}function sn(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function on(e){var t=Fn[e];return t||Hr(18,e),t}function ln(e,t){Fn[e]||(Fn[e]=t)}function cn(){return Tn}function un(e,t){t&&(on("Patches"),e.u=[],e.s=[],e.v=t)}function dn(e){hn(e),e.p.forEach(mn),e.p=null}function hn(e){e===Tn&&(Tn=e.l)}function pn(e){return Tn={p:[],l:Tn,h:e,m:!0,_:0}}function mn(e){var t=e[Dn];0===t.i||1===t.i?t.j():t.g=!0}function fn(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;
vendor: 6,368 bytes, line 2
2return t.h.O||on("ES5").S(t,e,n),n?(r[Dn].P&&(dn(t),Hr(4)),Zr(e)&&(e=gn(t,e),t.l||yn(t,e)),t.u&&on("Patches").M(r[Dn].t,e,t.u,t.s)):e=gn(t,r,[]),dn(t),t.u&&t.v(t.u,t.s),e!==An?e:void 0}function gn(e,t,r){if(sn(t))return t;var n=t[Dn];if(!n)return Gr(t,(function(i,a){return _n(e,n,t,i,a,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return yn(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=4===n.i||5===n.i?n.o=rn(n.k):n.o,a=i,s=!1;3===n.i&&(a=new Set(i),i.clear(),s=!0),Gr(a,(function(t,a){return _n(e,n,i,t,a,r,s)})),yn(e,i,!1),r&&e.u&&on("Patches").N(n,r,e.u,e.s)}return n.o}function _n(e,t,r,n,i,a,s){if(qr(i)){var o=gn(e,i,a&&t&&3!==t.i&&!Xr(t.R,n)?a.concat(n):void 0);if(Kr(r,n,o),!qr(o))return;e.m=!1}else s&&r.add(i);if(Zr(i)&&!sn(i)){if(!e.h.D&&e._<1)return;gn(e,i),t&&t.A.l||yn(e,i)}}function yn(e,t,r){void 0===r&&(r=!1),!e.l&&e.h.D&&e.m&&nn(t,r)}function vn(e,t){var r=e[Dn];return(r?tn(r):e)[t]}function xn(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function bn(e){e.P||(e.P=!0,e.l&&bn(e.l))}function wn(e){e.o||(e.o=rn(e.t))}function Cn(e,t,r){var n=Qr(t)?on("MapSet").F(t,r):en(t)?on("MapSet").T(t,r):e.O?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:cn(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=n,a=Bn;r&&(i=[n],a=Vn);var s=Proxy.revocable(i,a),o=s.revoke,l=s.proxy;return n.k=l,n.j=o,l}(t,r):on("ES5").J(t,r);return(r?r.A:cn()).p.push(n),n}function Sn(e){return qr(e)||Hr(22,e),function e(t){if(!Zr(t))return t;var r,n=t[Dn],i=Wr(t);if(n){if(!n.P&&(n.i<4||!on("ES5").K(n)))return n.t;n.I=!0,r=kn(t,i),n.I=!1}else r=kn(t,i);return Gr(r,(function(t,i){n&&Jr(n.t,t)===i||Kr(r,t,e(i))})),3===i?new Set(r):r}(e)}function kn(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return rn(e)}function jn(){function e(e,t){var r=i[e];return r?r.enumerable=t:i[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[Dn];return Bn.get(t,e)},set:function(t){var r=this[Dn];Bn.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][Dn];if(!i.P)switch(i.i){case 5:n(i)&&bn(i);break;case 4:r(i)&&bn(i)}}}function r(e){for(var t=e.t,r=e.k,n=On(r),i=n.length-1;i>=0;i--){var a=n[i];if(a!==Dn){var s=t[a];if(void 0===s&&!Xr(t,a))return!0;var o=r[a],l=o&&o[Dn];if(l?l.t!==s:!Yr(o,s))return!0}}var c=!!t[Dn];return n.length!==On(t).length+(c?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);if(r&&!r.get)return!0;for(var n=0;n<t.length;n++)if(!t.hasOwnProperty(n))return!0;return!1}var i={};ln("ES5",{J:function(t,r){var n=Array.isArray(t),i=function(t,r){if(t){for(var n=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(n,""+i,e(i,!0));return n}var a=Rn(r);delete a[Dn];for(var s=On(a),o=0;o<s.length;o++){var l=s[o];a[l]=e(l,t||!!a[l].enumerable)}return Object.create(Object.getPrototypeOf(r),a)}(n,t),a={i:n?5:4,A:r?r.A:cn(),P:!1,I:!1,R:{},l:r,t:t,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Dn,{value:a,writable:!0}),i},S:function(e,r,i){i?qr(r)&&r[Dn].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[Dn];if(r){var i=r.t,a=r.k,s=r.R,o=r.i;if(4===o)Gr(a,(function(t){t!==Dn&&(void 0!==i[t]||Xr(i,t)?s[t]||e(a[t]):(s[t]=!0,bn(r)))})),Gr(i,(function(e){void 0!==a[e]||Xr(a,e)||(s[e]=!1,bn(r))}));else if(5===o){if(n(r)&&(bn(r),s.length=!0),a.length<i.length)for(var l=a.length;l<i.length;l++)s[l]=!1;else for(var c=i.length;c<a.length;c++)s[c]=!0;for(var u=Math.min(a.length,i.length),d=0;d<u;d++)a.hasOwnProperty(d)||(s[d]=!0),void 0===s[d]&&e(a[d])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}var En,Tn,Pn="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),In="undefined"!=typeof Map,Mn="undefined"!=typeof Set,Nn="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,An=Pn?Symbol.for("immer-nothing"):((En={})["immer-nothing"]=!0,En),Ln=Pn?Symbol.for("immer-draftable"):"__$immer_draftable",Dn=Pn?Symbol.for("immer-state"):"__$immer_state",zn=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),On="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Rn=Object.getOwnPropertyDescriptors||function(e){var t={};return On(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},Fn={},Bn={get:function(e,t){if(t===Dn)return e;var r=tn(e);if(!Xr(r,t))return function(e,t,r){var n,i=xn(t,r);return i?"value"in i?i.value:null===(n=i.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!Zr(n)?n:n===vn(e.t,t)?(wn(e),e.o[t]=Cn(e.A.h,n,e)):n},has:function(e,t){return t in tn(e)},ownKeys:function(e){return Reflect.ownKeys(tn(e))},set:function(e,t,r){var n=xn(tn(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=vn(tn(e),t),a=null==i?void 0:i[Dn];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Yr(r,i)&&(void 0!==r||Xr(e.t,t)))return!0;wn(e),bn(e)}return e.o[t]===r&&(void 0!==r||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==vn(e.t,t)||t in e.t?(e.R[t]=!1,wn(e),bn(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=tn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){Hr(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Hr(12)}},Vn={};Gr(Bn,(function(e,t){Vn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Vn.deleteProperty=function(e,t){return Vn.set.call(this,e,t,void 0)},Vn.set=function(e,t,r){return Bn.set.call(this,e[0],t,r,e[0])};var $n=function(){function e(e){var t=this;this.O=Nn,this.D=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var i=r;r=e;var a=t;return function(e){var t=this;void 0===e&&(e=i);for(var n=arguments.length,s=Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return a.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(s))}))}}var s;if("function"!=typeof r&&Hr(6),void 0!==n&&"function"!=typeof n&&Hr(7),Zr(e)){var o=pn(t),l=Cn(t,e,void 0),c=!0;
2try{s=r(l),c=!1}finally{c?dn(o):hn(o)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(e){return un(o,n),fn(e,o)}),(function(e){throw dn(o),e})):(un(o,n),fn(s,o))}if(!e||"object"!=typeof e){if(void 0===(s=r(e))&&(s=e),s===An&&(s=void 0),t.D&&nn(s,!0),n){var u=[],d=[];on("Patches").M(e,s,u,d),n(u,d)}return s}Hr(21,e)},this.produceWithPatches=function(e,r){if("function"==typeof e)return function(r){for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(i))}))};var n,i,a=t.produce(e,r,(function(e,t){n=e,i=t}));return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return[e,n,i]})):[a,n,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Zr(e)||Hr(8),qr(e)&&(e=Sn(e));var t=pn(this),r=Cn(this,e,void 0);return r[Dn].C=!0,hn(t),r},t.finishDraft=function(e,t){var r=(e&&e[Dn]).A;return un(r,t),fn(void 0,r)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Nn&&Hr(20),this.O=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var i=on("Patches").$;return qr(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),Un=new $n,Hn=Un.produce,qn=(Un.produceWithPatches.bind(Un),Un.setAutoFreeze.bind(Un),Un.setUseProxies.bind(Un),Un.applyPatches.bind(Un),Un.createDraft.bind(Un),Un.finishDraft.bind(Un),Hn);function Zn(e){return Zn="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},Zn(e)}function Gn(e){var t=function(e,t){if("object"!=Zn(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zn(t)?t:t+""}function Wn(e,t,r){return(t=Gn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xn(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 Jn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xn(Object(r),!0).forEach((function(t){Wn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Kn(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Yn="function"===typeof Symbol&&Symbol.observable||"@@observable",Qn=function(){return Math.random().toString(36).substring(7).split("").join(".")},ei={INIT:"@@redux/INIT"+Qn(),REPLACE:"@@redux/REPLACE"+Qn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Qn()}};function ti(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ri(e,t,r){var n;if("function"===typeof t&&"function"===typeof r||"function"===typeof r&&"function"===typeof arguments[3])throw new Error(Kn(0));if("function"===typeof t&&"undefined"===typeof r&&(r=t,t=void 0),"undefined"!==typeof r){if("function"!==typeof r)throw new Error(Kn(1));return r(ri)(e,t)}if("function"!==typeof e)throw new Error(Kn(2));var i=e,a=t,s=[],o=s,l=!1;function c(){o===s&&(o=s.slice())}function u(){if(l)throw new Error(Kn(3));return a}function d(e){if("function"!==typeof e)throw new Error(Kn(4));if(l)throw new Error(Kn(5));var t=!0;return c(),o.push(e),function(){if(t){if(l)throw new Error(Kn(6));t=!1,c();var r=o.indexOf(e);o.splice(r,1),s=null}}}function h(e){if(!ti(e))throw new Error(Kn(7));if("undefined"===typeof e.type)throw new Error(Kn(8));if(l)throw new Error(Kn(9));try{l=!0,a=i(a,e)}finally{l=!1}for(var t=s=o,r=0;r<t.length;r++){(0,t[r])()}return e}return h({type:ei.INIT}),(n={dispatch:h,subscribe:d,getState:u,replaceReducer:function(e){if("function"!==typeof e)throw new Error(Kn(10));i=e,h({type:ei.REPLACE})}})[Yn]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!==typeof e||null===e)throw new Error(Kn(11));function r(){e.next&&e.next(u())}return r(),{unsubscribe:t(r)}}})[Yn]=function(){return this},e},n}function ni(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n];0,"function"===typeof e[i]&&(r[i]=e[i])}var a,s=Object.keys(r);try{!function(e){Object.keys(e).forEach((function(t){var r=e[t];if("undefined"===typeof r(void 0,{type:ei.INIT}))throw new Error(Kn(12));if("undefined"===typeof r(void 0,{type:ei.PROBE_UNKNOWN_ACTION()}))throw new Error(Kn(13))}))}(r)}catch(o){a=o}return function(e,t){if(void 0===e&&(e={}),a)throw a;for(var n=!1,i={},o=0;o<s.length;o++){var l=s[o],c=r[l],u=e[l],d=c(u,t);if("undefined"===typeof d){t&&t.type;throw new Error(Kn(14))}i[l]=d,n=n||d!==u}return(n=n||s.length!==Object.keys(e).length)?i:e}}function ii(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function ai(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error(Kn(15))},i={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},a=t.map((function(e){return e(i)}));return n=ii.apply(void 0,a)(r.dispatch),Jn(Jn({},r),{},{dispatch:n})}}}function si(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(i){return"function"===typeof i?i(r,n,e):t(i)}}}}var oi=si();oi.withExtraArgument=si;var li=oi,ci=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ui=function(e,t){var r,n,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;
2function o(a){return function(o){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(o){a=[6,o],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},di=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},hi=Object.defineProperty,pi=Object.defineProperties,mi=Object.getOwnPropertyDescriptors,fi=Object.getOwnPropertySymbols,gi=Object.prototype.hasOwnProperty,_i=Object.prototype.propertyIsEnumerable,yi=function(e,t,r){return t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},vi=function(e,t){for(var r in t||(t={}))gi.call(t,r)&&yi(e,r,t[r]);if(fi)for(var n=0,i=fi(t);n<i.length;n++){r=i[n];_i.call(t,r)&&yi(e,r,t[r])}return e},xi=function(e,t){return pi(e,mi(t))},bi=function(e,t,r){return new Promise((function(n,i){var a=function(e){try{o(r.next(e))}catch(t){i(t)}},s=function(e){try{o(r.throw(e))}catch(t){i(t)}},o=function(e){return e.done?n(e.value):Promise.resolve(e.value).then(a,s)};o((r=r.apply(e,t)).next())}))},wi="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"===typeof arguments[0]?ii:ii.apply(null,arguments)};"undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Ci(e){if("object"!==typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return t===r}var Si=function(e){function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return ci(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,di([void 0],e[0].concat(this)))):new(t.bind.apply(t,di([void 0],e.concat(this))))},t}(Array),ki=function(e){function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return ci(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,di([void 0],e[0].concat(this)))):new(t.bind.apply(t,di([void 0],e.concat(this))))},t}(Array);function ji(e){return Zr(e)?qn(e,(function(){})):e}function Ei(){return function(e){return function(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t,n=(e.immutableCheck,e.serializableCheck,new Si);r&&(!function(e){return"boolean"===typeof e}(r)?n.push(li.withExtraArgument(r.extraArgument)):n.push(li));0;return n}(e)}}function Ti(e,t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t){var i=t.apply(void 0,r);if(!i)throw new Error("prepareAction did not return an object");return vi(vi({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:r[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(t){return t.type===e},r}function Pi(e){var t,r={},n=[],i={addCase:function(e,t){var n="string"===typeof e?e:e.type;if(n in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[n]=t,i},addMatcher:function(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[r,n,t]}function Ii(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var r,n="function"==typeof e.initialState?e.initialState:ji(e.initialState),i=e.reducers||{},a=Object.keys(i),s={},o={},l={};function c(){var t="function"===typeof e.extraReducers?Pi(e.extraReducers):[e.extraReducers],r=t[0],i=void 0===r?{}:r,a=t[1],s=void 0===a?[]:a,l=t[2],c=void 0===l?void 0:l,u=vi(vi({},i),o);return function(e,t,r,n){void 0===r&&(r=[]);var i,a="function"===typeof t?Pi(t):[t,r,n],s=a[0],o=a[1],l=a[2];if(function(e){return"function"===typeof e}(e))i=function(){return ji(e())};else{var c=ji(e);i=function(){return c}}function u(e,t){void 0===e&&(e=i());var r=di([s[t.type]],o.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===r.filter((function(e){return!!e})).length&&(r=[l]),r.reduce((function(e,r){if(r){var n;if(qr(e))return void 0===(n=r(e,t))?e:n;if(Zr(e))return qn(e,(function(e){return r(e,t)}));if(void 0===(n=r(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return e}),e)}return u.getInitialState=i,u}(n,(function(e){for(var t in u)e.addCase(t,u[t]);for(var r=0,n=s;r<n.length;r++){var i=n[r];e.addMatcher(i.matcher,i.reducer)}c&&e.addDefaultCase(c)}))}return a.forEach((function(e){var r,n,a=i[e],c=function(e,t){return e+"/"+t}(t,e);"reducer"in a?(r=a.reducer,n=a.prepare):r=a,s[e]=r,o[c]=r,l[e]=n?Ti(c,n):Ti(c)})),{name:t,reducer:function(e,t){return r||(r=c()),r(e,t)},actions:l,caseReducers:s,getInitialState:function(){return r||(r=c()),r.getInitialState()}}}var Mi=function(e){void 0===e&&(e=21);for(var t="",r=e;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},Ni=["name","message","stack","code"],Ai=function(e,t){this.payload=e,this.meta=t},Li=function(e,t){this.payload=e,this.meta=t},Di=function(e){if("object"===typeof e&&null!==e){for(var t={},r=0,n=Ni;r<n.length;r++){var i=n[r];"string"===typeof e[i]&&(t[i]=e[i])}return t}return{message:String(e)}};!function(){function e(e,t,r){var n=Ti(e+"/fulfilled",(function(e,t,r,n){return{payload:e,meta:xi(vi({},n||{}),{arg:r,requestId:t,requestStatus:"fulfilled"})}})),i=Ti(e+"/pending",(function(e,t,r){return{payload:void 0,meta:xi(vi({},r||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),a=Ti(e+"/rejected",(function(e,t,n,i,a){return{payload:i,error:(r&&r.serializeError||Di)(e||"Rejected"),meta:xi(vi({},a||{}),{arg:n,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),s="undefined"!==typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){0},e}();return Object.assign((function(e){return function(o,l,c){var u,d=(null==r?void 0:r.idGenerator)?r.idGenerator(e):Mi(),h=new s;function p(e){u=e,h.abort()}var m=function(){return bi(this,null,(function(){var s,m,f,g,_,y;return ui(this,(function(v){switch(v.label){case 0:return v.trys.push([0,4,,5]),g=null==(s=null==r?void 0:r.condition)?void 0:s.call(r,e,{getState:l,extra:c}),null===(x=g)||"object"!==typeof x||"function"!==typeof x.then?[3,2]:[4,g];case 1:g=v.sent(),v.label=2;case 2:if(!1===g||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return _=new Promise((function(e,t){return h.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))}
2)),o(i(d,e,null==(m=null==r?void 0:r.getPendingMeta)?void 0:m.call(r,{requestId:d,arg:e},{getState:l,extra:c}))),[4,Promise.race([_,Promise.resolve(t(e,{dispatch:o,getState:l,extra:c,requestId:d,signal:h.signal,abort:p,rejectWithValue:function(e,t){return new Ai(e,t)},fulfillWithValue:function(e,t){return new Li(e,t)}})).then((function(t){if(t instanceof Ai)throw t;return t instanceof Li?n(t.payload,d,e,t.meta):n(t,d,e)}))])];case 3:return f=v.sent(),[3,5];case 4:return y=v.sent(),f=y instanceof Ai?a(null,d,e,y.payload,y.meta):a(y,d,e),[3,5];case 5:return r&&!r.dispatchConditionRejection&&a.match(f)&&f.meta.condition||o(f),[2,f]}var x}))}))}();return Object.assign(m,{abort:p,requestId:d,arg:e,unwrap:function(){return m.then(zi)}})}}),{pending:i,rejected:a,fulfilled:n,typePrefix:e})}e.withTypes=function(){return e}}();function zi(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}Object.assign;var Oi="listenerMiddleware";Ti(Oi+"/add"),Ti(Oi+"/removeAll"),Ti(Oi+"/remove");"function"===typeof queueMicrotask&&queueMicrotask.bind("undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:globalThis);var Ri,Fi=function(e){return function(t){setTimeout(t,e)}};"undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Fi(10);jn();const Bi=Ii({name:"location",initialState:{islocationSidebarOpened:!1,virtualDeliveryType:"pickup",location:null,menu:null,order:{type:"asap",date:null,time:null},changeDeliveryModal:!1,closedStoreWarning:!1,foundLocations:null,mapSelectedLocation:{id:null,scroll:!1}},reducers:{setLocationsSideBarState(e){e.islocationSidebarOpened=!e.islocationSidebarOpened},forceLocationsSideBarStateOpen(e){e.islocationSidebarOpened=!0},forceLocationsSideBarStateClosed(e){e.islocationSidebarOpened=!1},setLocationItem(e,t){e.location=t.payload},setMenuItem(e,t){e.menu=t.payload},setVirtualDeliveryType(e,t){e.virtualDeliveryType=t.payload},setOrderType(e,t){e.order.type=t.payload},setOrderDate(e,t){e.order.date=t.payload},setOrderTime(e,t){e.order.time=t.payload},setChangeDelivery(e,t){t.payload.close?e.changeDeliveryModal=t.payload.value:e.changeDeliveryModal=!e.changeDeliveryModal},setClosedStoreWarning(e,t){e.closedStoreWarning=t.payload},setFoundLocations(e,t){e.foundLocations=t.payload},setMapSelectedLocation(e,t){e.mapSelectedLocation.id=t.payload.id,e.mapSelectedLocation.scroll=t.payload.scroll}}}),Vi=Bi.actions;var $i=Bi.reducer,Ui=r.p+"static/media/combined-logos-placeholder.4fd42f5a2d23be794b6a.png";const Hi=Ii({name:"various",initialState:{isInfoContainerOpen:!1,infoContainer:null,errors:[]},reducers:{setIsInfoContainerOpened(e){e.isInfoContainerOpen=!e.isInfoContainerOpen},setIsInfoContainer(e,t){e.infoContainer=t.payload},setError(e,t){t.payload.id=parseInt(1e7*Math.random()),e.errors.push(t.payload)},removeError(e,t){const r=e.errors.findIndex((e=>e.id==t.payload.id));e.errors.splice(r,1)}}}),qi=Hi.actions;var Zi=Hi.reducer;const Gi=()=>(new Date).toLocaleDateString("en-US",{weekday:"short"});function Wi(e){var t=new Date(e),r=""+(t.getMonth()+1),n=""+t.getDate(),i=t.getFullYear();return r.length<2&&(r="0"+r),n.length<2&&(n="0"+n),[i,r,n].join("-")}const Xi=(e,t)=>{let r="",n="";e.split(" ").forEach(((e,t)=>{if(0===t){const t=e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6);r=t}1===t&&(n=e)}));let i=t||{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",hour12:!0,minute:"2-digit"};return new Date(r+"T"+n).toLocaleString("en-US",i)},Ji=e=>{let t="",r="";return e.split(" ").forEach(((e,n)=>{if(0===n){const r=e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6);t=r}1===n&&(r=e)})),t+"T"+r},Ki=e=>{let t="",r="";return e&&(r=e.split(" "),r.forEach(((e,r)=>{if(0===r){const r=e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6);t=r}}))),t},Yi=e=>{let t="",r="";return e&&(r=e.split(" "),r.forEach(((e,r)=>{1===r&&(t=e)}))),t},Qi=(e,t)=>{let r="",n="",i="";e&&(i=e.split(" "),i.forEach(((e,t)=>{if(0===t){const t=e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6);n=t}1===t&&(r=e)})));const a=new Date(n+"T"+r),s=new Date(a.getTime()+60*t*1e3);return s.toLocaleDateString("en-US",{year:"numeric"})+s.toLocaleDateString("en-US",{month:"2-digit"})+s.toLocaleDateString("en-US",{day:"2-digit"})+" "+s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1})},ea=e=>e.replace(/[^\d]/g,"").replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3").slice(0,14),ta=e=>""===e.trim(),ra=e=>/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,20}$/i.test(e),na=(e,t)=>e===t,ia=e=>e.toFixed(2),aa=function(){return/\p{Extended_Pictographic}/u.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")},sa=e=>{if(e){return e.split(" ")[0]}return null},oa=e=>{if(e){let t=e.split(" ")[1].split(":");return t.pop(),t.join(":")}return null},la=e=>{if(e){return e.split(" ")[1]}return null},ca=()=>{const e=sessionStorage.getItem("token");if(e)return e;const t=sessionStorage.getItem("olotoken");return t||null};const ua=(e,t)=>{let r=[];
2e.products.forEach((e=>{r.push({item_id:e.id,item_name:e.name,price:e.totalcost,quantity:e.quantity})})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:e.oloid,tax:e.salestax,currency:"USD",value:e.total,coupon:e.coupon,payment_type:"credit card",store_name:t.name,items:r}})},da=(e,t)=>{e.attributes&&e.attributes.includes("GAC Treatware")&&(window.location=`https://order.greatamericancookies.com/menu/${t}`)},ha=["cookie-cake-by-the-slice"];function pa(e){return!!e&&(!!ha.includes(String(e.slug))||!(!Array.isArray(e.metadata)||!e.metadata.some((e=>e&&"HIDE_ORDER_CUSTOMIZATION"===e.key&&"1"===e.value))))}function ma(e,t,r){document.cookie=`${e}=${t}; path=/; max-age=${86400*r};`}function fa(e){let t=e+"=",r=decodeURIComponent(document.cookie).split(";");for(let n=0;n<r.length;n++){let e=r[n];for(;" "==e.charAt(0);)e=e.substring(1);if(0==e.indexOf(t))return e.substring(t.length,e.length)}return""}function ga(e){document.cookie=`${e}=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT; max-age=0`}function _a(e,t){var r,n=new Date,i=n.getTime()+6e4*n.getTimezoneOffset(),a=new Date(i+36e5*t);return e&&e.hours&&e.hours.business&&e.hours.business[Gi()]?new Date(null===(r=e.hours.business[Gi()])||void 0===r?void 0:r.start)<a:null}function ya(e){return"object"===typeof e&&!Array.isArray(e)&&null!==e}function va(e){e&&e.data&&e.data.attributes&&e.data.attributes.includes("MSC")?document.documentElement.style.cssText="\n --color-cocoa: #584646;\n --color-raspberry: #08616a;\n --color-mint: #5bc6cc; \n --color-text-blue: #242c37;\n\n /* colors secondary */\n /* --color-dark-raspberry: #0b818e; */\n --color-dark-raspberry: #0b818e;\n /* --color-dark-raspberry-secondary: #8d1e59; */\n --color-dark-raspberry-secondary: #0b818e;\n --color-red: #AA0061;\n --color-dark-mint: #0B818E;\n --color-lemon: #f8de8d;\n --color-cream: #FFEAD4;\n --color-light-mint: #9bd7d7;\n --color-strawberry: #ebc6de;\n --color-sugar: #dcc5b7;\n --color-pink: #ECC5DE;\n\n /* colors aditional */\n --color-grey-bg: #f9f9f9;\n --color-grey-stroke: #d6d8d9;\n --color-grey-stroke-dark: #B2B5B9;\n --color-light-bg: #f8e0be;\n --color-light-bg-v2: #FBFAF8;\n --color-border: #E3E5E7;\n ":document.documentElement.style.cssText="\n --color-cocoa: #584646;\n --color-raspberry: #b7006a;\n --color-mint: #5bc6cc; \n --color-text-blue: #242c37;\n\n /* colors secondary */\n --color-dark-raspberry: #8d0e57;\n --color-dark-raspberry-secondary: #8d1e59;\n --color-red: #AA0061;\n --color-dark-mint: #0B818E;\n --color-lemon: #f8de8d;\n --color-cream: #FFEAD4;\n --color-light-mint: #9bd7d7;\n --color-strawberry: #ebc6de;\n --color-sugar: #dcc5b7;\n --color-pink: #ECC5DE;\n\n /* colors aditional */\n --color-grey-bg: #f9f9f9;\n --color-grey-stroke: #d6d8d9;\n --color-grey-stroke-dark: #B2B5B9;\n --color-light-bg: #f8e0be;\n --color-light-bg-v2: #FBFAF8;\n --color-border: #E3E5E7;\n "}function xa(e){if(e)return e.data&&e.data.attributes&&e.data.attributes.includes("MSC")?`/marble-slab-creamery/${e.location_slug}`:e.data&&e.data.attributes&&e.data.attributes.findIndex((e=>e.includes("CNC")))>=0?`/co-marble-slab-creamery/${e.location_slug}`:`/gac/${e.location_slug}`}const ba=[{label:"Alabama",value:"AL"},{label:"Alaska",value:"AK"},{label:"American Samoa",value:"AS"},{label:"Arizona",value:"AZ"},{label:"Arkansas",value:"AR"},{label:"California",value:"CA"},{label:"Colorado",value:"CO"},{label:"Connecticut",value:"CT"},{label:"Delaware",value:"DE"},{label:"District of Columbia",value:"DC"},{label:"States of Micronesia",value:"FM"},{label:"Florida",value:"FL"},{label:"Georgia",value:"GA"},{label:"Guam",value:"GU"},{label:"Hawaii",value:"HI"},{label:"Idaho",value:"ID"},{label:"Illinois",value:"IL"},{label:"Indiana",value:"IN"},{label:"Iowa",value:"IA"},{label:"Kansas",value:"KS"},{label:"Kentucky",value:"KY"},{label:"Louisiana",value:"LA"},{label:"Maine",value:"ME"},{label:"Marshall Islands",value:"MH"},{label:"Maryland",value:"MD"},{label:"Massachusetts",value:"MA"},{label:"Michigan",value:"MI"},{label:"Minnesota",value:"MN"},{label:"Mississippi",value:"MS"},{label:"Missouri",value:"MO"},{label:"Montana",value:"MT"},{label:"Nebraska",value:"NE"},{label:"Nevada",value:"NV"},{label:"New Hampshire",value:"NH"},{label:"New Jersey",value:"NJ"},{label:"New Mexico",value:"NM"},{label:"New York",value:"NY"},{label:"North Carolina",value:"NC"},{label:"North Dakota",value:"ND"},{label:"Northern Mariana Islands",value:"MP"},{label:"Ohio",value:"OH"},{label:"Oklahoma",value:"OK"},{label:"Oregon",value:"OR"},{label:"Palau",value:"PW"},{label:"Pennsylvania",value:"PA"},{label:"Puerto Rico",value:"PR"},{label:"Rhode Island",value:"RI"},{label:"South Carolina",value:"SC"},{label:"South Dakota",value:"SD"},{label:"Tennessee",value:"TN"},{label:"Texas",value:"TX"},{label:"Utah",value:"UT"},{label:"Vermont",value:"VT"},{label:"Virgin Islands",value:"VI"},{label:"Virginia",value:"VA"},{label:"Washington",value:"WA"},{label:"West Virginia",value:"WV"},{label:"Wisconsin",value:"WI"},{label:"Wyoming",value:"WY"}];function wa(e,t,r){if(e&&t&&r){const n=new Date(Ji(e));let i=[];return t.forEach((e=>{const t=new Date(`${r}T${e.value}`);n>t&&i.push(e)})),i.length}return 0}function Ca(e){if(e){var t,r,n;let a;var i;if(null!==e&&void 0!==e&&null!==(t=e.address)&&void 0!==t&&t.utcoffset)a=function(e){const t=new Date,r=t.getTime()+6e4*t.getTimezoneOffset();return new Date(r+36e5*e)}(null===e||void 0===e||null===(i=e.address)||void 0===i?void 0:i.utcoffset);else a=new Date;
2let s=new Date(a.toLocaleString("en-US")).getTime(),o=new Date(null===(r=e.hours.business[Gi()])||void 0===r?void 0:r.start).getTime(),l=new Date(null===(n=e.hours.business[Gi()])||void 0===n?void 0:n.end).getTime();if(s<o||s>l)return!0}return!1}var Sa=t=>{let{data:r}=t;const n=E(),[i,a]=(0,e.useState)(!1);return(0,Dr.jsxs)(Dr.Fragment,{children:[i&&(0,Dr.jsx)("span",{className:"btn-icon",children:(0,Dr.jsx)("span",{className:"loader dark-raspberry"})}),!i&&(0,Dr.jsxs)("button",{className:"btn-icon",title:"set favorite location",onClick:async()=>{a(!0);let e=ca();const t=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/favorite-locations/${t}`,"POST",null))(e,r.id);t.message?n(qi.setError(t)):n(qi.setError({message:"Location set as favorite!",type:"success"})),a(!1)},children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"set as favorite"})]})]})};var ka=()=>(0,Dr.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsx)("ellipse",{cx:"19.7726",cy:"20.0393",rx:"17.7954",ry:"17.8042",fill:"white"}),(0,Dr.jsx)("path",{d:"M17.6569 28.625C17.2812 28.625 16.9056 28.4866 16.609 28.1898C16.0356 27.6161 16.0356 26.6666 16.609 26.0929L22.3826 20.3164L16.3717 14.3026C15.7983 13.7289 15.7983 12.7793 16.3717 12.2057C16.9451 11.632 17.8942 11.632 18.4676 12.2057L25.5264 19.268C26.0998 19.8417 26.0998 20.7912 25.5264 21.3649L18.7049 28.1898C18.4083 28.4866 18.0326 28.625 17.6569 28.625Z",fill:"var(--color-cocoa)"}),(0,Dr.jsx)("path",{d:"M19.9901 40C18.1315 40 16.3915 39.1494 15.2645 37.725C13.564 38.3976 11.6263 38.2789 10.0049 37.3294C8.38359 36.3798 7.31587 34.7775 7.03905 32.9773C5.21997 32.7003 3.61839 31.6123 2.68908 29.9901C1.75976 28.368 1.62135 26.4491 2.29362 24.7478C0.869995 23.6202 0 21.8793 0 20C0 18.1207 0.869995 16.3798 2.29362 15.2522C1.62135 13.5509 1.75976 11.6321 2.68908 9.99012C3.61839 8.36796 5.21997 7.27993 7.03905 7.02276C7.29609 5.22256 8.38359 3.6004 10.0049 2.67063C11.6461 1.74086 13.564 1.62216 15.2645 2.27498C16.4113 0.85065 18.1315 -0.0197754 20.0099 -0.0197754C21.8883 -0.0197754 23.6283 0.85065 24.7751 2.27498C26.4755 1.62216 28.3935 1.74086 30.0148 2.65085C31.6362 3.6004 32.7039 5.20278 32.9807 7.02276C34.78 7.27993 36.3816 8.34818 37.3307 9.99012C38.2798 11.6123 38.3984 13.5509 37.7261 15.2522C39.1498 16.3798 40.0198 18.1207 40.0198 20C40.0198 21.8793 39.1498 23.6202 37.7261 24.7478C38.3984 26.4491 38.26 28.368 37.3307 30.0099C36.3816 31.6321 34.78 32.7003 32.9807 32.9773C32.7039 34.7775 31.6362 36.3996 30.0148 37.3294C28.3935 38.2789 26.4755 38.3976 24.7751 37.725C23.6283 39.1494 21.8883 40 20.0297 40H19.9901ZM15.7785 34.2631C15.8972 34.2631 16.0356 34.2631 16.1542 34.3027C16.5892 34.4214 16.9451 34.7181 17.1429 35.1335C17.6372 36.2809 18.7642 37.0129 19.9901 37.0129C21.216 37.0129 22.3628 36.2809 22.8571 35.1335C23.0351 34.7181 23.4108 34.4016 23.8458 34.3027C24.2808 34.184 24.7553 34.2829 25.1112 34.5598C26.0998 35.3116 27.4246 35.3907 28.4923 34.7577C29.5798 34.1246 30.173 32.9377 30.0346 31.6914C29.9753 31.2364 30.1335 30.8012 30.4498 30.4847C30.7662 30.1682 31.221 30.0099 31.656 30.0692C32.9016 30.2077 34.088 29.5945 34.7207 28.5262C35.3534 27.458 35.2743 26.1128 34.523 25.1236C34.2462 24.7676 34.1671 24.2928 34.2857 23.8378C34.4044 23.4026 34.7207 23.0267 35.1359 22.8487C36.2827 22.3541 37.0143 21.2463 37.0143 20C37.0143 18.7537 36.2827 17.6261 35.1359 17.1513C34.7207 16.9733 34.4044 16.6172 34.2857 16.1622C34.1671 15.7072 34.2659 15.2522 34.523 14.8764C35.2743 13.8872 35.3534 12.542 34.7207 11.4738C34.088 10.3858 32.9016 9.79229 31.6757 9.95055C31.221 10.0099 30.7662 9.85164 30.4498 9.53512C30.1335 9.2186 29.9753 8.76361 30.0148 8.30861C30.1532 7.06232 29.5403 5.8556 28.4726 5.22256C27.4048 4.6093 26.0801 4.68843 25.0717 5.42038C24.7158 5.69734 24.2412 5.77647 23.8062 5.65777C23.3712 5.53908 23.0153 5.24234 22.8374 4.82691C22.3431 3.67953 21.1962 2.94758 19.9703 2.94758C18.7444 2.94758 17.6174 3.67953 17.1231 4.82691C16.9451 5.24234 16.5892 5.53908 16.1542 5.65777C15.7192 5.77647 15.2447 5.67755 14.8888 5.42038C13.9001 4.68843 12.5358 4.6093 11.4483 5.22256C10.3806 5.83581 9.78744 7.04254 9.94563 8.28883C10.0049 8.74383 9.84676 9.19882 9.5304 9.51534C9.21404 9.83186 8.7395 9.99012 8.3045 9.93077C7.0786 9.77251 5.87247 10.366 5.25952 11.4342C4.62679 12.5223 4.70588 13.8675 5.45724 14.8566C
25.73406 15.2325 5.81315 15.6874 5.69451 16.1424C5.57588 16.5974 5.25952 16.9535 4.84429 17.1316C3.69748 17.6063 2.96589 18.7339 2.96589 19.9802C2.96589 21.2265 3.69748 22.3343 4.84429 22.8289C5.25952 23.0069 5.57588 23.363 5.69451 23.818C5.81315 24.2532 5.71429 24.728 5.45724 25.1039C4.70588 26.093 4.62679 27.4382 5.25952 28.5064C5.87247 29.5945 7.0786 30.1879 8.32427 30.0495C8.77904 29.9901 9.23381 30.1484 9.55017 30.4847C9.86653 30.8012 10.0247 31.2562 9.9654 31.7112C9.80722 32.9377 10.4202 34.1246 11.4879 34.7577C12.5754 35.3907 13.9001 35.3116 14.8888 34.5598C15.1458 34.362 15.4622 34.2631 15.7785 34.2631Z",fill:"var(--color-cocoa)"})]});var ja=()=>{const t=E(),r=Ir("currentLocation"),n=xt(),i=y((e=>e.location.location));(0,e.useEffect)((()=>{i&&i.pathname&&i.pathname.includes("/menu")&&n(`/gac/${i.location_slug}/`)}),[i]);const a=ca();(0,e.useEffect)((()=>{var e;r&&t(Vi.setLocationItem(r.currentLocation));const n=null===(e=Ir("currentMenu"))||void 0===e?void 0:e.menu;n&&t(Vi.setMenuItem(n))}),[t]);const s=y((e=>e.location.menu)),o=()=>{t(Vi.setLocationsSideBarState())};return(0,Dr.jsxs)("section",{children:[a&&i&&i.id&&(0,Dr.jsx)("div",{className:Ur,children:(0,Dr.jsx)(Sa,{data:i})}),(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:`grid-3 ${Or}`,children:[!i&&!r&&(0,Dr.jsx)(Dr.Fragment,{children:s&&s.map((e=>(0,Dr.jsx)(zr,{direction:"column",extraClass:"item_no_padding",children:(0,Dr.jsxs)("button",{onClick:o,className:$r,children:[(0,Dr.jsxs)("div",{className:Vr,children:[e.image&&(0,Dr.jsx)("img",{src:e.image,className:"image-cover",alt:"",loading:"lazy",width:524,height:300}),!e.image&&(0,Dr.jsx)("img",{src:Ui,className:"image-contain",alt:"",loading:"lazy",width:524,height:300})]}),(0,Dr.jsx)("div",{className:Rr,children:(0,Dr.jsxs)("div",{className:Fr,children:[e.name,(0,Dr.jsx)("span",{className:Br,children:(0,Dr.jsx)(ka,{})})]})})]})},e.id+Math.random(10))))}),i&&(0,Dr.jsx)(Dr.Fragment,{children:s&&s.categories&&s.categories.filter((e=>e.products&&e.products.length>0||e.sub_categories&&e.sub_categories.length>0)).map((e=>(0,Dr.jsx)(zr,{direction:"column",extraClass:"item_no_padding",children:(0,Dr.jsxs)(er,{to:`${e.slug}`,className:$r,children:[(0,Dr.jsxs)("div",{className:Vr,children:[e.image&&(0,Dr.jsx)("img",{src:e.image,className:"image-cover",alt:"",loading:"lazy",width:524,height:300}),!e.image&&(0,Dr.jsx)("img",{src:Ui,className:"image-contain",alt:"",loading:"lazy",width:524,height:300})]}),(0,Dr.jsx)("div",{className:Rr,children:(0,Dr.jsxs)("div",{className:Fr,children:[e.name,(0,Dr.jsx)("span",{className:Br,children:(0,Dr.jsx)(ka,{})})]})})]})},e.id+Math.random(10))))})]})})]})},Ea={banner:"BannerSimple_banner__YJvk-",banner_inner_wrapper:"BannerSimple_banner_inner_wrapper__ZPQGh",graphic_container:"BannerSimple_graphic_container__BKFsw",graphic_container_left:"BannerSimple_graphic_container_left__SFZ1L",banner_inner_wrapper_cobrand:"BannerSimple_banner_inner_wrapper_cobrand__qUwLl",graphic_container_right:"BannerSimple_graphic_container_right__Rb-lC",graphic_container_msc:"BannerSimple_graphic_container_msc__FsFGa",banner_inner:"BannerSimple_banner_inner__xRc93",title:"BannerSimple_title__PScB9",directory:"BannerSimple_directory__IV18X",banner_bottom_line:"BannerSimple_banner_bottom_line__nQ51u",banner_msc:"BannerSimple_banner_msc__WytEb",title_set:"BannerSimple_title_set__aLBLn",banner_set:"BannerSimple_banner_set__7kTaI",banner_inner_wrapper_set:"BannerSimple_banner_inner_wrapper_set__KON5b",banner_inner_set:"BannerSimple_banner_inner_set__IZp8h",supTitle:"BannerSimple_supTitle__3BRGZ",subtitle:"BannerSimple_subtitle__JuTda"},Ta=r.p+"static/media/MSC_Ice_Cream.814947bcf45482b60624.webp",Pa=r.p+"static/media/GAC_Cake.a303251f5610d39d9796.webp",Ia=r.p+"static/media/GAC_Cookies.8c0fafb069e48a77d76c.webp",Ma=r.p+"static/media/MSC_Cake.4f2eda19d87e598d4648.webp";var Na=()=>{let t=y((e=>e.location.location));const[r,n]=(0,e.useState)(!1);y((e=>e.location.location));const i=Ir("currentLocation");return(0,e.useEffect)((()=>{i&&i.currentLocation&&i.currentLocation.data&&i.currentLocation.data.attributes&&i.currentLocation.data.attributes.includes("MSC")?n(!0):n(!1)}),[i]),(0,Dr.jsxs)("div",{className:`${Ea.banner} ${r?Ea.banner_msc:""}`,children:[(0,Dr.jsxs)("div",{className:`${Ea.banner_inner_wrapper} ${t&&t.cobranded?Ea.banner_inner_wrapper_cobrand:""}`,children:[(0,Dr.jsxs)("div",{className:`${Ea.graphic_container} ${Ea.graphic_container_left} ${t&&t.data.attributes.includes("MSC")?Ea.graphic_container_msc:null}`,children:[t&&(0,Dr.jsxs)(Dr.Fragment,{children:[t.cobranded&&(0,Dr.jsx)("img",{src:Ta,alt:"banner",className:`${Ea.side_image} image-contain`}),!t.cobranded&&t.data.attributes&&t.data.attributes.includes("MSC")&&(0,Dr.jsx)("img",{src:Ta,alt:"banner",className:`${Ea.side_image} ${Ea.side_image_msc} image-contain`})]}),(!t||t&&!t.cobranded&&!t.data.attributes.includes("MSC"))&&(0,Dr.jsx)("img",{src:Ia,alt:"banner",className:`${Ea.side_image} image-contain`,width:578,height:583})]}),(0,Dr.jsx)("div",{className:Ea.banner_inner,children:(0,Dr.jsx)("h1",{className:Ea.title,children:"Menu"})}),(0,Dr.jsxs)("div",{className:`${Ea.graphic_container} ${Ea.graphic_container_right} ${t&&t.data.attributes.includes("MSC")?Ea.graphic_container_msc:null}`,children:[t&&(0,Dr.jsxs)(Dr.Fragment,{children:[t.cobranded&&(0,Dr.jsx)("img",{src:Pa,alt:"banner",className:`${Ea.side_image} image-contain`}),!t.cobranded&&t.data.attributes&&t.data.attributes.includes("MSC")&&(0,Dr.jsx)("img",{src:Ma,alt:"banner",className:`${Ea.side_image} ${Ea.side_image_msc} image-contain`})]}),(!t||t&&!t.cobranded&&!t.data.attributes.includes("MSC"))&&(0,Dr.jsx)("img",{src:Pa,alt:"banner",className:`${Ea.side_image} image-contain`,width:709,height:712})]})]}),(0,Dr.jsx)("div",{className:Ea.banner_bottom_line})]})},Aa={product_details_container:"MockProductPage_product_details_container__lq6pf",background:"MockProductPage_background__dSrv9",error:"MockProductPage_error__WrD9a",presentation_box:"MockProductPage_presentation_box__Ip1D0",page_title:"MockProductPage_page_title__etqAn",gradient:"MockProductPage_gradient__O1Up3",description:"MockProductPage_description__1Gfl3",composite_image:"MockProductPage_composite_image__yBlh7",composite_image_inner:"MockProductPage_composite_image_inner__JR11R",product_container:"MockProductPage_product_container__9+YVQ",options_container:"MockProductPage_options_container__Edk5i",main_mod:"MockProductPage_main_mod__hxG+X",main_mod_options:"MockProductPage_main_mod_options__RG1bu",main_mod_option:"MockProductPage_main_mod_option__hSEcP",modifiers_container:"MockProductPage_modifiers_container__kBity",options_item_header:"MockProductPage_options_item_header__wAECw",options_item_header_arrow:"MockProductPage_options_item_header_arrow__7yxli",trigger_open:"MockProductPage_trigger_open__c5X6q",options_item_header_sub:"MockProductPage_options_item_header_sub__rKsA6",options_item_header_text:"MockProductPage_options_item_header_text__DPMC1",item_number:"MockProductPage_item_number__BUWfr",options_item_header_helper:"MockProductPage_options_item_header_helper__2IJTs",form_controller:"MockProductPage_form_controller__tAzu7",option_container:"MockProductPage_option_container__H1XiJ",option:"MockProductPage_option__HYGfZ",active:"MockProductPage_active__7T5oI",image_container:"MockProductPage_image_container__mHl1k",image_container_inner:"MockProductPage_image_container_inner__WQ7ot",name:"MockProductPage_name__Mg5WL",option_description:"MockProductPage_option_description__KoOVm",option_title_text:"MockProductPage_option_title_text__RAN6S",option_price:"MockProductPage_option_price__KbiP3",increment_decrement_c
2ontainer:"MockProductPage_increment_decrement_container__XKwln",item_count:"MockProductPage_item_count__DC4Vt",check_mark:"MockProductPage_check_mark__G3F+x",option_title:"MockProductPage_option_title__IxdMp",option_simple:"MockProductPage_option_simple__8VIVR",option_aggregate:"MockProductPage_option_aggregate__5Kn6u",option_title_controller:"MockProductPage_option_title_controller__BicUt",tooltip_container:"MockProductPage_tooltip_container__JhTja",tooltip_button:"MockProductPage_tooltip_button__64v4C",tooltip_modal:"MockProductPage_tooltip_modal__+c1ob",tooltip_modal_inner:"MockProductPage_tooltip_modal_inner__LxJBX",tail_icon:"MockProductPage_tail_icon__eJQX0"},La=r.p+"static/media/bg-details.160a33d4842a38febb79.png";var Da=()=>{const e=[{id:1},{id:2},{id:3},{id:4},{id:5}];return(0,Dr.jsxs)("div",{className:"relative",children:[(0,Dr.jsx)("div",{className:Aa.background,children:(0,Dr.jsx)("img",{src:La,role:"presentation",alt:"",className:"image-cover"})}),(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:Aa.product_details_container,children:[(0,Dr.jsxs)("div",{className:Aa.presentation_box,children:[(0,Dr.jsx)("div",{className:Aa.page_title}),(0,Dr.jsx)("div",{className:Aa.description}),(0,Dr.jsx)("div",{className:Aa.composite_image,children:(0,Dr.jsx)("div",{className:Aa.composite_image_inner})})]}),(0,Dr.jsx)("div",{className:Aa.product_container,children:(0,Dr.jsx)("div",{children:e.map((t=>(0,Dr.jsxs)("div",{className:Aa.modifier_item,children:[(0,Dr.jsx)("div",{className:`${Aa.options_item_header}`,children:(0,Dr.jsx)("div",{className:Aa.options_item_header_text,children:(0,Dr.jsx)("h3",{children:" "})})}),(0,Dr.jsx)("div",{children:(0,Dr.jsx)("div",{className:`${Aa.options_container} grid-4`,children:e.map((e=>(0,Dr.jsxs)("div",{className:Aa.option,children:[(0,Dr.jsx)("div",{className:Aa.image_container,children:(0,Dr.jsx)("div",{className:Aa.image_container_inner})}),(0,Dr.jsxs)("div",{className:Aa.option_title,children:[(0,Dr.jsx)("div",{className:Aa.option_title_text}),(0,Dr.jsx)("div",{className:Aa.option_price})]})]},e.id)))})})]},t.id)))})})]})})]})},za="MockSuperCategories_supercategories__KfLGY",Oa="MockSuperCategories_text_content__GaBY7",Ra="MockSuperCategories_title__6pD7J",Fa="MockSuperCategories_image_container__kChqx",Ba="MockSuperCategories_button_link__TUloo";var Va=()=>(0,Dr.jsx)("section",{children:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsx)("div",{className:`grid-3 ${za}`,children:[{id:1},{id:2},{id:3},{id:4},{id:5},{id:6},{id:7},{id:8}].map((e=>(0,Dr.jsx)(zr,{direction:"column",children:(0,Dr.jsxs)("div",{className:Ba,children:[(0,Dr.jsx)("div",{className:Fa}),(0,Dr.jsx)("div",{className:Oa,children:(0,Dr.jsx)("div",{className:Ra})})]})},e.id+Math.random(10))))})})});var $a=e=>{let{text:t,productPage:r}=e;return(0,Dr.jsxs)(Dr.Fragment,{children:[!r&&(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(Na,{}),(0,Dr.jsx)(Va,{})]})}),r&&(0,Dr.jsx)(Da,{}),s.createPortal((0,Dr.jsx)("div",{className:"preparing_restaurant",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_backdrop",children:(0,Dr.jsxs)("div",{className:"preparing_restaurant_container",children:[(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"}),(0,Dr.jsx)("div",{className:"preparing_restaurant_message",children:t})]})})}),document.getElementById("overlay-root"))]})};r.p;const Ua=Ii({name:"authentication",initialState:{authToken:null,user:null,isUserSidebarOpened:!1,oloToken:null,termsAndConditionsPop:!1},reducers:{login(e,t){e.authToken=t.payload.authtoken,Pr("tokens",t.payload),sessionStorage.removeItem("olotoken"),sessionStorage.setItem("token",t.payload.authtoken),Pr("tokens",t.payload)},logout(e){e.user=null,e.authToken=null,e.oloToken=null,sessionStorage.removeItem("token"),sessionStorage.removeItem("olotoken"),localStorage.removeItem("tokens")},setUser(e,t){e.user=t.payload},setUserSideBarState(e){e.isUserSidebarOpened=!e.isUserSidebarOpened},oloLogin(e,t){e.oloToken=t.payload.authtoken,sessionStorage.removeItem("token"),sessionStorage.setItem("olotoken",t.payload.authtoken)},openTermsAndConditions(e,t){e.termsAndConditionsPop=!e.termsAndConditionsPop}}}),Ha=Ua.actions;var qa=Ua.reducer;var Za=t=>{let{locationPage:r}=t;const n=E();return(0,e.useEffect)((()=>{r&&n(Vi.forceLocationsSideBarStateOpen())}),[]),null};var Ga=t=>{let{locationPage:r}=t;const n=Dt();
2return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:n.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("div",{className:"overflow_container",children:[r&&(0,Dr.jsx)(Za,{locationPage:r}),(0,Dr.jsx)(Na,{}),(0,Dr.jsx)(ja,{})]})})})})};async function Wa(e){const t=Ir("currentLocation"),r=Ir("currentLocationId");if(null===t&&!r){console.log("no storage");const e=async()=>{const e=await lr();return Pr("currentMenu",{menu:e},3600),e},t=e();return me({data:t})}return r?r.currentLocationSlug?fe(`/gac/${r.currentLocationSlug}/`):void 0:fe(xa(t.currentLocation))}var Xa="Footer_footer__AcWGP",Ja="Footer_msc_footer__yk1be",Ka="Footer_directory_pages__sm0AL",Ya="Footer_footer_top__CPPJo",Qa="Footer_footer_main_menu__VEizb",es="Footer_copyright__lghYs",ts="Footer_footer_legal_menu__+wYg5",rs="Footer_socials_menu__LIq80",ns="Footer_social_icon__5YpQF",is="Footer_footer_bottom__8mN62",as="Footer_footer_bottom_inner__uDHhC";var ss=()=>{const[t,r]=(0,e.useState)(!1),[n,i]=(0,e.useState)(!1);let a=y((e=>e.location.location));return(0,e.useEffect)((()=>{a&&a.data&&a.data.attributes&&a.data.attributes.includes("MSC")?r(!0):r(!1),va(a),window.location.pathname.includes("directory")?(console.log("is directory page::::: ",window.location.pathname),i(!0)):i(!1)}),[a]),(0,Dr.jsxs)("footer",{className:`${Xa} ${t?Ja:""} ${n?Ka:""}`,children:[(0,Dr.jsx)("div",{className:Ya,children:(0,Dr.jsxs)("div",{className:"container-full",children:[(0,Dr.jsxs)("nav",{className:Qa,children:[!t&&(0,Dr.jsxs)("ul",{children:[(0,Dr.jsx)("li",{children:(0,Dr.jsx)(er,{to:"/directory",children:"All Locations"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/our-story/",target:"_blank",rel:"noreferrer",children:"Our Story"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/gift-cards/",target:"_blank",rel:"noreferrer",children:"Gift Cards"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/wp-content/uploads/sites/2/2024/01/GAC-Nutrition-FINAL-6.23.21.pdf",target:"_blank",rel:"noreferrer",children:"Nutritionals"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/wp-content/uploads/sites/2/2023/01/GAC-Allergen-_-ingredients-FINAL-6.23.21.pdf",target:"_blank",rel:"noreferrer",children:"Allergens"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://greatamericancookiesfranchise.com/",target:"_blank",rel:"noreferrer",children:"Franchising"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://portal.gfgmanagement.com/",target:"_blank",rel:"noreferrer",children:"Franchise Login"})})]}),t&&(0,Dr.jsxs)("ul",{children:[(0,Dr.jsx)("li",{children:(0,Dr.jsx)(er,{to:"/directory",children:"All Locations"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/our-story/",target:"_blank",rel:"noreferrer",children:"Our Story"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/gift-cards/",target:"_blank",rel:"noreferrer",children:"Gift Cards"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/wp-content/uploads/2023/02/ICE-CREAM-Nutrition-Allergens-2-8-23.pdf",target:"_blank",rel:"noreferrer",children:"Nutritionals"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.fatbrands.com/brand/marble-slab-creamery/",target:"_blank",rel:"noreferrer",children:"Franchising"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://portal.gfgmanagement.com/_layouts/GFG.SharePoint.AuthForm/login.aspx?ReturnUrl=%2f_layouts%2...",target:"_blank",rel:"noreferrer",children:"Franchise Login"})})]})]}),(0,Dr.jsxs)("div",{className:es,children:["\xa9 ",(new Date).getFullYear()," Great American Cookies & Marble Slab Creamery. We\u2019re part of the FAT Brands Family."]}),(0,Dr.jsxs)("nav",{className:ts,children:[!t&&(0,Dr.jsxs)("ul",{children:[(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/contact-us/",target:"_blank",rel:"noreferrer",children:"Contact Us"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/privacy-policy/",target:"_blank",rel:"noreferrer",children:"Privacy Policy"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/terms-of-use/",target:"_blank",rel:"noreferrer",children:"Terms of Use"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/accessibility-statement/",target:"_blank",rel:"noreferrer",children:"Accessibility Statement"})})]}),t&&(0,Dr.jsxs)("ul",{children:[(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/contact/",target:"_blank",rel:"noreferrer",children:"Contact Us"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/privacy-policy/",target:"_blank",rel:"noreferrer",children:"Privacy Policy"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/accessibility-statement/",target:"_blank",rel:"noreferrer",children:"Accessibility Statement"})})]})]}),(0,Dr.jsx)("nav",{className:rs,children:(0,Dr.jsxs)("ul",{children:[(0,Dr.jsx)("li",{children:(0,Dr.jsxs)("a",{href:t?"https://www.facebook.com/marbleslabcreameryofficial/":"https://www.facebook.com/greatamericancookiesv",target:"_blank",rel:"noreferrer",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62",height:"60",viewBox:"0 0 62 60",fill:"none",children:(0,Dr.jsx)("path",{d:"M16.135 57.2219C6.28204 53.0389 0.567018 46.2597 1.02402 36.7697C1.42358 29.5679 2.95154 22.4736 5.55203 15.7458C10.794 2.11078 18.317 -1.30056 36.052 0.405444C55.644 2.28344 62.4241 9.26683 60.7621 25.8058C60.2371 37.9708 56.072 48.3869 43.903 55.5739C39.346 58.4023 34.1031 59.9324 28.74 59.9997C24.3933 59.939 20.1045 58.994 16.135 57.2219Z",fill:"white"})}),(0,Dr.jsx)("svg",{className:ns,xmlns:"http://www.w3.org/2000/svg",width:"15",height:"26",viewBox:"0 0 15 26",fill:"none",children:(0,Dr.jsx)("path",{d:"M15.001 4.31598H12.28C10.148 4.31598 9.73602 5.228 9.73602 6.565V9.51599H14.82L14.159 14.139H9.73702V26H4.43702V14.141H-0.000976562V9.51801H4.43502V6.10999C4.43502 2.15299 7.11803 0 11.035 0C12.912 0 14.526 0.125007 14.998 0.182007L15.001 4.31598Z",fill:"var(--color-dark-raspberry)"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"facebook"})]})}),(0,Dr.jsx)("li",{children:(0,Dr.jsxs)("a",{href:t?"https://twitter.com/marbleslab":"https://twitter.com/gr8amcookies",target:"_blank",rel:"noreferrer",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62",height:"60",viewBox:"0 0 62 60",fill:"none",children:(0,Dr.jsx)("path",{d:"M16.135 57.2219C6.28204 53.0389 0.567018 46.2597 1.02402 36.7697C1.42358 29.5679 2.95154 22.4736 5.55203 15.7458C10.794 2.11078 18.317 -1.30056 36.052 0.405444C55.644 2.28344 62.4241 9.26683 60.7621 25.8058C60.2371 37.9708 56.072 48.3869 43.903 55.5739C39.346 58.4023 34.1031 59.9324 28.74 59.9997C24.3933 59.939 20.1045 58.994 16.135 57.2219Z",fill:"white"})}),(0,Dr.jsx)("svg",{className:ns,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z",fill:"var(--color-dark-raspberry)"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"twitter"})]})}),(0,Dr.jsx)("li",{children:(0,Dr.jsxs)("a",{href:t?"https://instagram.com/marbleslabcreamery":"https://www.instagram.com/greatamericancookies/",target:"_blank",rel:"noreferrer",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62",height:"60",viewBox:"0 0 62 60",fill:"none",children:(0,Dr.jsx)("path",{d:"M16.135 57.2219C6.28204 53.0389 0.567018 46.2597 1.02402 36.7697C1.42358 29.5679 2.95154 22.4736 5.55203 15.7458C10.794 2.11078 18.317 -1.30056 36.052 0.405444C55.644 2.28344 62.4241 9.26683 60.7621 25.8058C60.2371 37.9708 56.072 48.3869 43.903 55.5739C39.346 58.4023 34.1031 59.9324 28.74 59.9997C24.3933 59.939 20.1045 58.994 16.135 57.2219Z",fill:"white"})}),(0,Dr.jsx)("svg",{className:ns,xmlns:"http://www.w3.org/2000/svg",width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",children:(0,Dr.jsx)("path",{d:"M7.5 0C3.4 0 0 3.4 0 7.5V18.4C0 22.6 3.4 26 7.5 26H18.4C22.6 26 25.9 22.6 25.9 18.5V7.5C26 3.4 22.6 0 18.5 0H7.5ZM7.5 2H18.4C21.5 2 24 4.5 24 7.5V18.4C24 21.5 21.5 23.9 18.5 23.9H7.5C4.5 24 2 21.5 2 18.5V7.5C2 4.5 4.5 2 7.5 2ZM20.5 4C19.7 4 19 4.7 19 5.5C19 6.3 19.7 7 20.5 7C21.3 7 22 6.3 22 5.5C22 4.7 21.3 4 20.5 4ZM13 6C9.1 6 6 9.1 6 13C6 16.9 9.1 20 13 20C16.9 20 20 16.9 20 13C20 9.1 16.9 6 13 6ZM13 8C15.8 8 18 10.2 18 13C18 15.8 15.8 18 13 18C10.2 18 8 15.8 8 13C8 10.2 10.2 8 13 8Z",fill:"var(--color-dark-raspberry)"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"instagram"})]})}),(0,Dr.jsx)("li",{children:(0,Dr.jsxs)("a",{href:t?"https://www.tiktok.com/@marbleslabcreamery?_t=8fRIWwUac0I&_r=1":"https://www.tiktok.com/@greatamericancookies",target:"_blank",rel:"noreferrer",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62",height:"60",viewBox:"0 0 62 60",fill:"none",children:(0,Dr.jsx)("path",{d:"M16.135 57.2219C6.28204 53.0389 0.567018 46.2597 1.02402 36.7697C1.42358 29.5679 2.95154 22.4736 5.55203 15.7458C10.794 2.11078 18.317 -1.30056 36.052 0.405444C55.644 2.28344 62.4241 9.26683 60.7621 25.8058C60.2371 37.9708 56.072 48.3869 43.903 55.5739C39.346 58.4023 34.1031 59.9324 28.74 59.9997C24.3933 59.939 20.1045 58.994 16.135 57.2219Z",fill:"white"})}),(0,Dr.jsx)("svg",{className:ns,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M448 209.9a210.1 210.1 0 0 1 -122.8-39.3V349.4A162.6 162.6 0 1 1 185 188.3V278.2a74.6 74.6 0 1 0 52.2 71.2V0l88 0a121.2
2121.2 0 0 0 1.9 22.2h0A122.2 122.2 0 0 0 381 102.4a121.4 121.4 0 0 0 67 20.1z",fill:"var(--color-dark-raspberry)"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"tiktok"})]})})]})})]})}),(0,Dr.jsx)("div",{className:is,children:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:as,children:["Mars, Incorporated has no affiliation and has no participation in the production or distribution of this product. M&M'S\xae is a registered trademark of Mars, Incorporated ",(new Date).getFullYear(),"."]})})})]})},os={header:"Header_header__OPGSD",header_hide:"Header_header_hide__qaBCo",header_sticky:"Header_header_sticky__awEa4",header_inner:"Header_header_inner__hwGJW",logo:"Header_logo__04L6z",logo_cobranded:"Header_logo_cobranded__RyKpw",logo_gac:"Header_logo_gac__gmXlT",logo_msc:"Header_logo_msc__l1mkv",header_controls:"Header_header_controls__Tlb47",header_controls_item:"Header_header_controls_item__Hf7kS",btn_location:"Header_btn_location__PsICM",control_box:"Header_control_box__zISdA",control_box_location_container:"Header_control_box_location_container__c8vWO",control_box_icon:"Header_control_box_icon__BCgk3",text_block:"Header_text_block__iOjiQ",btn_subtitute:"Header_btn_subtitute__I3u-T",btn_subtitute_span:"Header_btn_subtitute_span__yAMPi",btn_underline:"Header_btn_underline__Ruynq",mobile_location_header:"Header_mobile_location_header__HtBQ6",mobile_location_header_address:"Header_mobile_location_header_address__b3J6m",mobile_location_header_delivery_type:"Header_mobile_location_header_delivery_type__Mqjnv",control_box_mobile:"Header_control_box_mobile__jzUi+",mobile_location_header_no_loc:"Header_mobile_location_header_no_loc__hlY7t",control_box_location:"Header_control_box_location__ONkJa",control_box_location_text:"Header_control_box_location_text__uvvzx",white:"Header_white__swj12",user_logged_in:"Header_user_logged_in__8tjQT",text_block_sign_in:"Header_text_block_sign_in__4-H35",text_block_address:"Header_text_block_address__6jRB2",loader_container:"Header_loader_container__Gvkzc",change_selections_container_outer:"Header_change_selections_container_outer__pxzsZ",change_selections_container:"Header_change_selections_container__o+VGP",change_selections_header:"Header_change_selections_header__KWtVa",change_selections_title:"Header_change_selections_title__j-aD-",highlight:"Header_highlight__2ZFtl",change_selections_footer:"Header_change_selections_footer__qMGF+",change_selections_button_container:"Header_change_selections_button_container__ClAff",btn_svg_18:"Header_btn_svg_18__VYTaN",switch_button:"Header_switch_button__66X3a",change_selections_body:"Header_change_selections_body__BGr+v",change_selections_main_controls:"Header_change_selections_main_controls__tRmy9",change_selections_date_controls:"Header_change_selections_date_controls__NK8vB",change_selections_date_confirm:"Header_change_selections_date_confirm__9Yy8m",account_helper_text:"Header_account_helper_text__bciau",terms_container:"Header_terms_container__m3KZM",terms_container_footer:"Header_terms_container_footer__tDQ3d"};var ls=r.p+"static/media/FATB_GACMSC_Logo_D.60fd8b67c3b9437d49bf7b6c5c4ac11b.svg";var cs=r.p+"static/media/FATB_GACMSC_Logo_M-v2.8de821314bf567118d072ff6f39740a9.svg";var us=r.p+"static/media/logo-gac.39493050c9e49dc6822a1c88f13a2ddd.svg";var ds=r.p+"static/media/logo-marble.01a8e3f5f47511df525615d0541e9127.svg";const hs={xsm:"480px",sm:"640px",md:"768px",md800:"800px",md841:"841px",md900:"900px",md1023:"1023px",lg:"1024px",xl:"1280px","2xl":"1536px"},ps=t=>{const[r,n]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{const e=`(min-width: ${hs[t]})`,i=window.matchMedia(e);i.matches!==r&&n(i.matches);const a=()=>n(i.matches);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)}),[r,t]),r};var ms={enableHighAccuracy:!0,timeout:5e3,maximumAge:1/0};function fs(e){console.warn(`ERROR(${e.code}): ${e.message}`)}function gs(e){return e*(Math.PI/180)}const _s=()=>{const e=E(),t=Ir("currentMenu"),r=y((e=>e.location.menu));return r||(t&&t.menu?(e(Vi.setMenuItem(t.menu)),t.menu):null)},ys=Ii({name:"cart",initialState:{cart:null,numberOfProducts:0,totalPrice:0,cartSidebarOpen:!1,items:[],vehicleInfo:{vehicleMake:null,vehicleModel:null,vehicleColor:null},billing:null,digitalWallet:null,cartSidebarStep:"order",tipSelection:null,hasUserOptedIn:!0},reducers:{addCart(e,t){e.cart=t.payload},updateVehicleinfo(e,t){e.vehicleInfo[t.payload.handle]=t.payload.value},setVehicleInfo(e,t){e.vehicleInfo=t.payload},incrementProducts(e){e.numberOfProducts++},decrementProducts(e){e.numberOfProducts--},setCartSidebarState(e){e.cartSidebarOpen=!e.cartSidebarOpen},addItem(e,t){const r=e.items.findIndex((e=>e.id==t.payload.id));r<0?e.items.push(t.payload):e.items[r].amount=e.items[r].amount+1},removeItem(e,t){const r=e.items.findIndex((e=>e.id==t.payload));e.items.splice(r,1)},addOneItem(e,t){const r=e.items.findIndex((e=>e.id==t.payload));e.items[r].amount=e.items[r].amount+1},removeOneItem(e,t){const r=e.items.findIndex((e=>e.id==t.payload));e.items[r].amount>1?e.items[r].amount=e.items[r].amount-1:e.items.splice(r,1)},setBilling(e,t){e.billing=t.payload},removeBillingMethod(e,t){e.billing=null},setDigitalWallet(e,t){e.digitalWallet=t.payload},setCartSidebarStep(e,t){e.cartSidebarStep=t.payload},setTipSelection(e,t){e.tipSelection=t.payload},setHasUserOptedIn(e,t){e.hasUserOptedIn=t.payload}}}),vs=ys.actions;var xs=ys.reducer,bs="HeaderCartButton_control_box__pEmKH",ws="HeaderCartButton_cart_items_number__XeZl+",Cs="HeaderCartButton_cart_total__9q4KH";var Ss=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsx)("svg",{width:r&&r.width?r.width:"16",height:r&&r.height?r.height:"22",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M8.09996 13.3199C5.96996 13.3199 4.23996 11.5899 4.23996 9.45988C4.23996 9.04988 4.57996 8.70988 4.98996 8.70988C5.39996 8.70988 5.73996 9.04988 5.73996 9.45988C5.73996 10.7599 6.79996 11.8199 8.09996 11.8199C9.39996 11.8199 10.46 10.7599 10.46 9.45988C10.46 9.04988 10.8 8.70988 11.21 8.70988C11.62 8.70988 11.96 9.04988 11.96 9.45988C11.96 11.5899 10.23 13.3
2199 8.09996 13.3199ZM16 8.80988V15.6199C16 18.7899 13.42 21.3699 10.25 21.3699H5.95996C2.78996 21.3699 0.209961 18.7899 0.209961 15.6199V8.80988C0.209961 6.73988 1.88996 5.05988 3.95996 5.05988H4.24996V4.48988C4.24996 2.35988 5.97996 0.629883 8.09996 0.629883C10.22 0.629883 11.96 2.35988 11.96 4.48988V5.05988H12.25C14.32 5.05988 16 6.73988 16 8.80988ZM5.74996 5.05988H10.46V4.48988C10.46 3.18988 9.39996 2.12988 8.09996 2.12988C6.79996 2.12988 5.74996 3.18988 5.74996 4.48988V5.05988ZM14.5 8.80988C14.5 7.56988 13.49 6.55988 12.25 6.55988H3.95996C2.71996 6.55988 1.70996 7.56988 1.70996 8.80988V15.6199C1.70996 17.9599 3.60996 19.8699 5.95996 19.8699H10.25C12.59 19.8699 14.5 17.9599 14.5 15.6199V8.80988Z",fill:t||"#242C37"})})};var ks=()=>{const e=E(),t=y((e=>e.cart.cart));let r=0;t&&(r=t.products?t.products.length:0);let n=0;t&&(n=t.subtotal?t.subtotal:0);return(0,Dr.jsx)("button",{className:"btn-clear",onClick:()=>{if(e(vs.setCartSidebarState()),t&&t.products.length>0){let e=[];t.products.forEach((t=>{e.push({item_id:t.productId,item_name:t.name,price:t.totalcost,quantity:t.quantity})})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"view_cart",ecommerce:{currency:"USD",value:t.total,items:e}})}},children:(0,Dr.jsxs)("div",{className:bs,children:[(0,Dr.jsxs)("div",{className:"relative",children:[(0,Dr.jsx)(Ss,{}),(0,Dr.jsx)("span",{className:ws,children:r})]}),(0,Dr.jsxs)("div",{className:Cs,children:["$",ia(n)]})]})})};var js=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsx)("svg",{width:r&&r.width?r.width:"24",height:r&&r.height?r.height:"21",viewBox:"0 0 24 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M21.3088 13.8365C21.2178 13.8365 21.1398 13.8365 21.0488 13.8236C21.2568 13.9656 21.3998 14.2108 21.3998 14.4819V20.1868C21.3998 20.6386 21.0358 21 20.5937 21H16.6414C16.1994 21 15.8353 20.6386 15.8353 20.1868V16.2502H13.2091V20.1868C13.2091 20.6386 12.8451 21 12.403 21H3.39328C2.95125 21 2.58722 20.6386 2.58722 20.1868V14.4819C2.58722 14.2108 2.73023 13.9656 2.93825 13.8236C2.86024 13.8365 2.76923 13.8365 2.69122 13.8365C1.2221 13.8365 0.0520043 12.7007 0.0130011 11.2422C0 10.8033 0.36403 10.429 0.806067 10.4161C1.30011 10.429 1.62514 10.7646 1.63814 11.2034C1.65114 11.7843 2.11918 12.2231 2.69122 12.2231C3.26327 12.2231 3.69231 11.8101 3.73131 11.2422V11.1905C3.73131 11.1905 3.74431 11.0873 3.75731 11.0486C3.77031 10.9969 3.78332 10.9453 3.80932 10.8937C3.84832 10.7904 3.91333 10.713 3.99133 10.6484C4.03034 10.6097 4.06934 10.571 4.12134 10.5581C4.16035 10.5323 4.21235 10.5065 4.26436 10.4806C4.30336 10.4548 4.34236 10.4548 4.39437 10.4419C4.43337 10.4161 4.47237 10.4161 4.52438 10.4161H4.57638C4.57638 10.4161 4.68039 10.429 4.71939 10.4419C4.7454 10.4419 4.7714 10.4548 4.7974 10.4548C4.8234 10.4677 4.8364 10.4677 4.8494 10.4806C4.87541 10.4935 4.88841 10.4935 4.90141 10.5065C4.92741 10.5065 4.94041 10.5194 4.95341 10.5323C4.96641 10.5452 4.97942 10.5452 4.99242 10.5581C5.03142 10.5839 5.07042 10.6097 5.09643 10.6355C5.13543 10.6613 5.16143 10.7001 5.18743 10.7388C5.21343 10.7646 5.22644 10.7904 5.23944 10.8162C5.26544 10.842 5.27844 10.8808 5.29144 10.9195C5.31744 10.9582 5.33044 10.9969 5.33044 11.0486C5.34345 11.0744 5.35645 11.126 5.35645 11.1647V11.2422C5.39545 11.8101 5.85049 12.2231 6.40953 12.2231C6.96858 12.2231 7.42362 11.7972 7.46262 11.2422V11.1905C7.46262 11.1905 7.47562 11.0873 7.48863 11.0486C7.50163 10.984 7.51463 10.9324 7.54063 10.8808C7.55363 10.8549 7.57963 10.8162 7.60563 10.7904C7.60563 10.7904 7.60563 10.7775 7.61864 10.7775C7.61864 10.7775 7.70964 10.6742 7.76165 10.6226C7.76165 10.6097 7.80065 10.5968 7.82665 10.571C7.90466 10.5194 7.98267 10.4806 8.06067 10.4548H8.07367C8.07367 10.4548 8.11268 10.4419 8.12568 10.4419C8.16468 10.4161 8.21669 10.4161 8.25569 10.4161H8.28169C8.28169 10.4161 8.3467 10.4161 8.3727 10.429C8.3987 10.429 8.4247 10.429 8.4507 10.4419C8.47671 10.4419 8.50271 10.4548 8.52871 10.4548C8.55471 10.4677 8.56771 10.4677 8.58072 10.4806C8.61972 10.4935 8.65872 10.5065 8.68472 10.5323C8.78873 10.5839 8.86674 10.6613 8.94475 10.7646H8.95775C8.95775 10.7646 8.97075 10.8033 8.97075 10.8162C8.99675 10.842 9.00975 10.8808 9.02275 10.9195C9.04875 10.9582 9.06176 10.9969 9.06176 11.0486C9.06176 11.0873 9.08776 11.1389 9.08776 11.1905V11.2422C9.12676 11.8101 9.5818 12.2231 10.1408 12.2231C10.6999 12.2231 11.1419 11.8101 11.1809 11.2422C11.1809 11.2034 11.1809 11.1647 11.1939 11.126C11.1939 11.1002 11.1939 11.0744 11.2069 11.0486C11.2069 10.9969 11.2199 10.9582 11.2459 10.9195C11.2589 10.8679 11.2849 10.8162 11.3239 10.7775C11.428 10.6097 11.61 10.4806 11.818 10.4419C11.844 10.429 11.87 10.429 11.896 10.429C11.922 10.4161 11.948 10.4161 11.974 10.4161C12.039 10.4161 12.104 10.429 12.169 10.4419C12.221 10.4548 12.26 10.4677 12.299 10.4806C12.351 10.5065 12.39 10.5323 12.442 10.5581C12.546 10.6226 12.6371 10.713 12.6891 10.8162C12.7151 10.842 12.7281 10.8808 12.7411 10.9195C12.7671 10.9582 12.7801 10.9969 12.7801 11.0486C12.7931 11.0615 12.7931 11.0744 12.7931 11.0873V11.1389C12.7931 11.1389 12.7931 11.1776 12.7931 11.1905V11.2422C12.8321 11.8101 13.2871 12.2231 13.8462 12.2231C14.4052 12.2231 14.8472 11.8101 14.8862 11.2422V11.1905C14.8862 11.1905 14.8992 11.0873 14.9122 11.0486C14.9122 10.9969 14.9382 10.9453 14.9642 10.8937C15.0033 10.8033 15.0683 10.7259
215.1463 10.6484C15.1853 10.6097 15.2373 10.571 15.3023 10.5323C15.3023 10.5323 15.3023 10.5323 15.3023 10.5194C15.3283 10.5065 15.3673 10.4935 15.4063 10.4806C15.4453 10.4806 15.4843 10.4548 15.5363 10.4419C15.5753 10.4161 15.6143 10.4161 15.6663 10.4161H15.7183C15.7183 10.4161 15.8223 10.429 15.8613 10.4419C15.8873 10.4419 15.9133 10.4548 15.9393 10.4548C15.9653 10.4677 15.9783 10.4677 15.9913 10.4806C16.0303 10.4935 16.0693 10.5065 16.0953 10.5323C16.2124 10.5968 16.3164 10.7001 16.3814 10.8162C16.4074 10.842 16.4204 10.8808 16.4334 10.9195C16.4594 10.9582 16.4724 10.9969 16.4724 11.0486C16.4854 11.0873 16.4984 11.1389 16.4984 11.1905V11.2422C16.5374 11.8101 16.9924 12.2231 17.5645 12.2231C18.1365 12.2231 18.5655 11.8101 18.6046 11.2422V11.1905C18.6046 11.1905 18.6176 11.0873 18.6306 11.0486C18.6306 10.9969 18.6566 10.9453 18.6826 10.8937C18.7216 10.8033 18.7866 10.7259 18.8646 10.6484C18.9166 10.5968 18.9816 10.5581 19.0336 10.5194C19.0726 10.5065 19.0986 10.4935 19.1376 10.4806C19.1766 10.4806 19.2156 10.4548 19.2676 10.4419C19.3066 10.4161 19.3456 10.4161 19.3976 10.4161C19.6446 10.4161 19.8397 10.5065 19.9827 10.6484C19.9957 10.6484 19.9957 10.6613 19.9957 10.6613C20.0347 10.7001 20.0607 10.7259 20.0997 10.7646C20.0997 10.7646 20.1517 10.8679 20.1647 10.9195C20.2037 11.0098 20.2297 11.1002 20.2297 11.2034V11.2422C20.2687 11.8101 20.7237 12.2231 21.2828 12.2231C21.8418 12.2231 22.3099 11.7843 22.3229 11.2034C22.3359 10.7646 22.6609 10.429 23.1549 10.4161C23.61 10.429 23.961 10.8033 23.948 11.2422C23.909 12.7007 22.7389 13.8365 21.2828 13.8365H21.3088ZM20.4247 13.6945C20.0477 13.5655 19.7226 13.3589 19.4496 13.0879H19.4366C18.9686 13.5526 18.3185 13.8365 17.5905 13.8365C16.8624 13.8365 16.1994 13.5526 15.7183 13.0879H15.7053C15.2373 13.5526 14.5742 13.8365 13.8592 13.8365C13.1441 13.8365 12.481 13.5526 12 13.0879C11.532 13.5526 10.8689 13.8365 10.1538 13.8365C9.43879 13.8365 8.77573 13.5526 8.29469 13.0879H8.28169C7.80065 13.5526 7.1506 13.8365 6.42254 13.8365C5.69448 13.8365 5.04442 13.5526 4.56338 13.0879H4.55038C4.27736 13.3589 3.95233 13.5655 3.5753 13.6945C3.95233 13.772 4.22535 14.0947 4.22535 14.4819V19.3866H11.597V15.4499C11.597 14.9982 11.961 14.6368 12.416 14.6368H16.6544C17.1094 14.6368 17.4735 14.9982 17.4735 15.4499V19.3866H19.7877V14.4819C19.7877 14.1076 20.0737 13.7849 20.4377 13.6945H20.4247ZM23.844 9.78365C23.688 9.99016 23.441 10.1192 23.1809 10.1192H0.806067C0.36403 10.1192 0 9.75784 0 9.30608C0 9.21573 0.0130011 9.12538 0.0390033 9.03503L0.429036 7.88629C0.429036 7.88629 0.468039 7.78304 0.507042 7.73141L3.36728 3.08482C3.51029 2.83958 3.77031 2.6976 4.05634 2.6976H5.31744V0.800246C5.31744 0.361401 5.68147 0 6.12351 0H17.9155C18.3575 0 18.7216 0.361401 18.7216 0.800246V2.6976H19.9307C20.2167 2.6976 20.4767 2.83958 20.6197 3.08482L23.519 7.80885C23.519 7.80885 23.571 7.91211 23.584 7.97664L23.948 9.06085C24.039 9.30608 24 9.56423 23.844 9.78365ZM6.94258 4.93055H17.0964V1.6134H6.94258V4.93055ZM22.0368 8.50584L19.4756 4.311H18.7216V5.73079C18.7216 6.18254 18.3575 6.54395 17.9155 6.54395H6.12351C5.68147 6.54395 5.31744 6.18254 5.31744 5.73079V4.311H4.51138L1.93716 8.50584H22.0368Z",fill:t||"#584646"})})};var Es=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsx)("svg",{width:r&&r.width?r.width:"22",height:r&&r.height?r.height:"14",viewBox:"0 0 22 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M14.29 11.4899C14.21 11.5199 14.13 11.5399 14.04 11.5399H14.3C14.3 11.5399 14.3 11.5099 14.3 11.4899H14.29ZM6.7 5.33992C6.7 4.99992 6.42 4.71992 6.08 4.71992H1.38C1.04 4.71992 0.76 4.99992 0.76 5.33992C0.76 5.67992 1.04 5.95992 1.38 5.95992H6.08C6.42 5.95992 6.7 5.67992 6.7 5.33992ZM21.28 10.9099C21.28 11.2599 21 11.5399 20.66 11.5399H19.5C19.21 12.7099 18.15 13.5799 16.9 13.5799C15.65 13.5799 14.59 12.7099 14.3 11.5399C14.3 11.5199 14.3 11.5099 14.3 11.4899C14.22 11.5199 14.14 11.5399 14.05 11.5399H10.6C10.31 12.7099 9.26 13.5799 8 13.5799C6.74 13.5799 5.7 12.7099 5.41 11.5399H4.18C3.84 11.5399 3.56 11.2599 3.56 10.9099V8.06992H0.62C0.28 8.06992 0 7.78992 0 7.44992C0 7.10992 0.28 6.81992 0.62 6.81992H6.08C6.42 6.81992 6.7 7.09992 6.7 7.44992C6.7 7.79992 6.42 8.06992 6.08 8.06992H4.8V10.2899H5.4C5.68 9.11992 6.73 8.24992 7.99 8.24992C9.25 8.24992 10.31 9.11992 10.59 10.2899H13.42V1.66992H4.8V2.59992H6.08C6.42 2.59992 6.7 2.87992 6.7 3.22992C6.7 3.57992 6.42 3.84992 6.08 3.84992H2.11C1.76 3.84992 1.48 3.56992 1.48 3.22992C1.48 2.88992 1.76 2.59992 2.11 2.59992H3.55V1.03992C3.55 0.699922 3.83 0.419922 4.17 0.419922H14.04C14.39 0.419922 14.67 0.699922 14.67 1.03992V2.07992H17.51C19.09 2.07992 20.38 3.36992 20.38 4.95992V10.2899H20.66C21 10.2899 21.28 10.5699 21.28 10.9099ZM9.41 10.9099C9.41 10.1299 8.78 9.49992 7.99 9.49992C7.2 9.49992 6.58 10.1299 6.58 10.9099C6.58 11.6899 7.21 12.3299 7.99 12.3299C8.77 12.3299 9.41 11.6999 9.41 10.9099ZM18.32 10.9099C18.32 10.1299 17.68 9.49992 16.9 9.49992C16.12 9.49992 15.48 10.1299 15.48 10.9099C15.48 11.6899 16.12 12.3299 16.9 12.3299C17.68 12.3299 18.32 11.6999 18.32 10.9099ZM19.13 7.58992H16.43C16.1 7.58992 15.83 7.33992 15.81 7.00992L15.64 4.68992C15.64 4.50992 15.69 4.33992 15.8 4.21992C15.92 4.08992 16.09 4.01992 16.26 4.01992H18.83C18.54 3.59992 18.05 3.32992 17.51 3.32992H14.67V9.44992C15.15 8.72992 15.97 8.24992 16.9 8.24992C17.83 8.24992 18.65 8.72992 19.13 9.44992V7.58992ZM19.13 5.26992H16.93L17.01 6.33992H19.13V5.26992Z",fill:t||"#242C37"})})};var Ts=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsx)("svg",{width:r&&r.width?r.width:"16",height:r&&r.height?r.height:"24",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M12.8224 9.35996L12.6929 8.79007C12.6325 8.49649 12.3475 8.31516 12.054 8.38424C11.7604 8.44468 11.5791 8.73826 11.6395 9.02321L11.6913 9.23044H3.36751L3.69563 7.74528C3.86832 6.97679 4.71452 6.42418 5.71614 6.42418H7.52941C7.82299 6.42418 8.06476 6.18241 8.06476 5.88883C8.06476 5.59525 7.82299 5.34485 7.52941 5.34485H5.71614C4.21371 5.34485 2.91851 6.26012 2.6422 7.51214L2.23637 9.35996H2.22774C0.941176 9.74852 0 10.9401 0 12.3562V14.6185C0 14.9207 0.24177 15.1624 0.543983 15.1624H1.39018V17.1139C1.39018 17.4074 1.63195 17.6492 1.92553 17.6492H3.84242C4.13599 17.6492 4.3864 17.4074 4.3864 17.1139V15.1624H10.6724V17.1139C10.6724 17.4074 10.9142 17.6492 11.2164 17.6492H13.1247C13.4269 17.6492 13.6686 17.4074 13.6686 17.1139V15.1624H14.5148C14.8084 15.1624 15.0502 14.9207 15.0502 14.6185V12.3562C15.0502 10.9401 14.109 9.74852 12.8224 9.35996ZM3.30707 16.5699H2.46951V15.1624H3.30707V16.5699ZM12.5893 16.5699H11.7518V15.1624H12.5893V16.5699ZM13.9709 14.0831H1.07933V12.3562C1.07933 11.225 2.00324 10.3098 3.13438 10.3098H11.9244C13.0556 10.3098 13.9709 11.225 13.9709 12.3562V14.0831ZM3.88559 12.2785C3.88559 12.7534 3.50567 13.1333 3.03076 13.1333C2.55586 13.1333 2.17593 12.7534 2.17593 12.2785C2.17593 11.8036 2.55586 11.4236 3.03076 11.4236C3.5056
27 11.4236 3.88559 11.8036 3.88559 12.2785ZM12.8829 12.2785C12.8829 12.7534 12.503 13.1333 12.0281 13.1333C11.5532 13.1333 11.1732 12.7534 11.1732 12.2785C11.1732 11.8036 11.5532 11.4236 12.0281 11.4236C12.503 11.4236 12.8829 11.8036 12.8829 12.2785ZM9.30815 12.7361H5.75067C5.4571 12.7361 5.21533 12.4943 5.21533 12.2008C5.21533 11.9072 5.4571 11.6654 5.75067 11.6654H9.30815C9.60173 11.6654 9.8435 11.9072 9.8435 12.2008C9.8435 12.4943 9.60173 12.7361 9.30815 12.7361ZM15.9482 2.85807C15.81 2.43497 15.4474 2.13276 15.0156 2.07232L13.6427 1.83918L13.0556 0.647599C12.857 0.250405 12.4598 0 12.0194 0C11.5791 0 11.1819 0.250405 10.9833 0.647599L10.3357 1.88235L9.0232 2.07232C8.58284 2.13276 8.22882 2.43497 8.09066 2.85807C7.95251 3.27253 8.06476 3.73017 8.38424 4.03238L9.35132 5.034L9.12682 6.34647C9.05774 6.7782 9.23044 7.20993 9.58446 7.46897C9.94711 7.73664 10.4134 7.76255 10.8019 7.55532L11.9849 6.94226L11.7345 6.45872L12.054 6.94226L13.2283 7.56395C13.401 7.6503 13.5823 7.69347 13.7636 7.69347C14.0054 7.69347 14.2472 7.61576 14.4458 7.46897C14.7998 7.20993 14.9811 6.7782 14.9034 6.34647L14.6962 4.96492L15.6546 4.03238C15.9655 3.73017 16.0777 3.27253 15.9482 2.85807ZM14.8948 3.2639L13.945 4.19644C13.6773 4.45548 13.5478 4.84404 13.6168 5.21533L13.8413 6.52779L13.7291 6.6055L12.5548 5.98381C12.3907 5.89746 12.2008 5.85429 12.0194 5.85429C11.8381 5.85429 11.6481 5.89746 11.4841 5.98381L10.3011 6.6055L10.5515 7.08041L10.1975 6.52779L10.422 5.21533C10.4825 4.84404 10.3616 4.46411 10.0853 4.19644L9.13546 3.2639L8.75553 3.65246L9.17863 3.13438L10.4911 2.94441C10.871 2.89261 11.1905 2.65947 11.3632 2.31409L11.9503 1.1225H12.0799L12.6757 2.31409C12.8397 2.65947 13.1678 2.89261 13.5391 2.94441L14.8602 3.13438L14.9379 2.60766L14.8948 3.2639Z",fill:t||"var(--color-dark-raspberry)"})})};var Ps=()=>(0,Dr.jsx)("svg",{width:"13",height:"18",viewBox:"0 0 13 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M13 7.08534C13 3.45613 10.0802 0.5 6.49551 0.5C2.91085 0.5 0 3.45613 0 7.08534C0 10.4872 2.56945 13.2978 5.83967 13.6252C5.83068 13.6525 5.83068 13.6798 5.83068 13.7071V16.8178C5.83068 17.1998 6.12716 17.5 6.49551 17.5C6.86386 17.5 7.1783 17.1998 7.1783 16.8178V13.7071C7.1783 13.7071 7.1783 13.6525 7.16932 13.6252C10.4395 13.2887 13 10.4872 13 7.08534ZM6.49551 12.2972C3.65653 12.2972 1.34762 9.9687 1.34762 7.08534C1.34762 4.20198 3.65653 1.86437 6.49551 1.86437C9.33449 1.86437 11.6524 4.20198 11.6524 7.08534C11.6524 9.9687 9.34347 12.2972 6.49551 12.2972ZM9.85556 6.21215C9.71182 5.78464 9.35245 5.47539 8.91223 5.41172L7.9689 5.26618L7.53766 4.40209C7.34001 3.99278 6.94471 3.74719 6.49551 3.74719C6.0463 3.74719 5.651 3.99278 5.45335 4.40209L5.0311 5.26618L4.08777 5.41172C3.64755 5.47539 3.28818 5.78464 3.14444 6.21215C3.00968 6.63965 3.12647 7.10353 3.44091 7.41279L4.1237 8.09497L3.96199 9.05003C3.89012 9.49572 4.0698 9.93232 4.42916 10.2052C4.62681 10.3507 4.86938 10.4235 5.11196 10.4235C5.29164 10.4235 5.4803 10.378 5.651 10.2871L6.49551 9.84136L7.349 10.2871C7.7443 10.5054 8.21147 10.469 8.57084 10.2052C8.9302 9.93232 9.10988 9.49572 9.03801 9.05003L8.86731 8.09497L9.55909 7.41279C9.87353 7.10353 9.99032 6.63965 9.85556 6.21215ZM7.86109 7.18539C7.59157 7.44917 7.46579 7.84029 7.52868 8.22231L7.64547 8.90449L7.04354 8.58614C6.87284 8.49518 6.68417 8.44971 6.49551 8.44971C6.30684 8.44971 6.12716 8.49518 5.95646 8.58614L5.35453 8.90449L5.47132 8.22231C5.53421 7.84029 5.40843 7.45827 5.13891 7.18539L4.65377 6.70332L5.32757 6.60326C5.70491 6.54869 6.02833 6.3122 6.19903 5.96656L6.49551 5.34805L6.80097 5.96656C6.97167 6.3122 7.29509 6.54869 7.67243 6.60326L8.34623 6.70332L7.86109 7.18539Z",fill:"var(--color-dark-raspberry)"})});var Is=()=>(0,Dr.jsx)("svg",{width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M16.39 11.0852C16.32 11.0852 16.26 11.0852 16.19 11.0752C16.35 11.1852 16.46 11.3752 16.46 11.5852V16.0052C16.46 16.3552 16.18 16.6352 15.84 16.6352H12.8C12.46 16.6352 12.18 16.3552 12.18 16.0052V12.9552H10.16V16.0052C10.16 16.3552 9.88 16.6352 9.54 16.6352H2.61C2.27 16.6352 1.99 16.3552 1.99 16.0052V11.5852C1.99 11.3752 2.1 11.1852 2.26 11.0752C2.2 11.0852 2.13 11.0852 2.07 11.0852C0.94 11.0852 0.04 10.2052 0.01 9.07523C0 8.73523 0.28 8.44523 0.62 8.43523C1 8.44523 1.25 8.70523 1.26 9.04523C1.27 9.49523 1.63 9.83523 2.07 9.83523C2.51 9.83523 2.84 9.51523 2.87 9.07523V9.03523C2.87 9.03523 2.88 8.95523 2.89 8.92523C2.9 8.88523 2.91 8.84523 2.93 8.80523C2.96 8.72523 3.01 8.66523 3.07 8.61523C3.1 8.58523 3.13 8.5
25523 3.17 8.54523C3.2 8.52523 3.24 8.50523 3.28 8.48523C3.31 8.46523 3.34 8.46523 3.38 8.45523C3.41 8.43523 3.44 8.43523 3.48 8.43523H3.52C3.52 8.43523 3.6 8.44523 3.63 8.45523C3.65 8.45523 3.67 8.46523 3.69 8.46523C3.71 8.47523 3.72 8.47523 3.73 8.48523C3.75 8.49523 3.76 8.49523 3.77 8.50523C3.79 8.50523 3.8 8.51523 3.81 8.52523C3.82 8.53523 3.83 8.53523 3.84 8.54523C3.87 8.56524 3.9 8.58523 3.92 8.60523C3.95 8.62523 3.97 8.65523 3.99 8.68523C4.01 8.70523 4.02 8.72523 4.03 8.74523C4.05 8.76523 4.06 8.79523 4.07 8.82523C4.09 8.85523 4.1 8.88523 4.1 8.92523C4.11 8.94524 4.12 8.98523 4.12 9.01523V9.07523C4.15 9.51523 4.5 9.83523 4.93 9.83523C5.36 9.83523 5.71 9.50523 5.74 9.07523V9.03523C5.74 9.03523 5.75 8.95523 5.76 8.92523C5.77 8.87523 5.78 8.83523 5.8 8.79523C5.81 8.77523 5.83 8.74523 5.85 8.72523C5.85 8.72523 5.85 8.71523 5.86 8.71523C5.86 8.71523 5.93 8.63523 5.97 8.59523C5.97 8.58523 6 8.57523 6.02 8.55523C6.08 8.51523 6.14 8.48524 6.2 8.46523H6.21C6.21 8.46523 6.24 8.45523 6.25 8.45523C6.28 8.43523 6.32 8.43523 6.35 8.43523H6.37C6.37 8.43523 6.42 8.43523 6.44 8.44523C6.46 8.44523 6.48 8.44523 6.5 8.45523C6.52 8.45523 6.54 8.46523 6.56 8.46523C6.58 8.47523 6.59 8.47523 6.6 8.48523C6.63 8.49523 6.66 8.50523 6.68 8.52523C6.76 8.56523 6.82 8.62523 6.88 8.70523H6.89C6.89 8.70523 6.9 8.73523 6.9 8.74523C6.92 8.76523 6.93 8.79523 6.94 8.82523C6.96 8.85523 6.97 8.88523 6.97 8.92523C6.97 8.95523 6.99 8.99523 6.99 9.03523V9.07523C7.02 9.51523 7.37 9.83523 7.8 9.83523C8.23 9.83523 8.57 9.51523 8.6 9.07523C8.6 9.04523 8.6 9.01523 8.61 8.98523C8.61 8.96523 8.61 8.94524 8.62 8.92523C8.62 8.88523 8.63 8.85523 8.65 8.82523C8.66 8.78523 8.68 8.74523 8.71 8.71523C8.79 8.58523 8.93 8.48523 9.09 8.45523C9.11 8.44523 9.13 8.44523 9.15 8.44523C9.17 8.43523 9.19 8.43523 9.21 8.43523C9.26 8.43523 9.31 8.44523 9.36 8.45523C9.4 8.46523 9.43 8.47523 9.46 8.48523C9.5 8.50523 9.53 8.52523 9.57 8.54523C9.65 8.59523 9.72 8.66523 9.76 8.74523C9.78 8.76523 9.79 8.79523 9.8 8.82523C9.82 8.85523 9.83 8.88523 9.83 8.92523C9.84 8.93524 9.84 8.94523 9.84 8.95523V8.99523C9.84 8.99523 9.84 9.02523 9.84 9.03523V9.07523C9.87 9.51523 10.22 9.83523 10.65 9.83523C11.08 9.83523 11.42 9.51523 11.45 9.07523V9.03523C11.45 9.03523 11.46 8.95523 11.47 8.92523C11.47 8.88523 11.49 8.84523 11.51 8.80523C11.54 8.73523 11.59 8.67523 11.65 8.61523C11.68 8.58523 11.72 8.55523 11.77 8.52523C11.77 8.52523 11.77 8.52523 11.77 8.51523C11.79 8.50523 11.82 8.49523 11.85 8.48523C11.88 8.48523 11.91 8.46523 11.95 8.45523C11.98 8.43523 12.01 8.43523 12.05 8.43523H12.09C12.09 8.43523 12.17 8.44523 12.2 8.45523C12.22 8.45523 12.24 8.46523 12.26 8.46523C12.28 8.47523 12.29 8.47523 12.3 8.48523C12.33 8.49523 12.36 8.50523 12.38 8.52523C12.47 8.57523 12.55 8.65523 12.6 8.74523C12.62 8.76523 12.63 8.79523 12.64 8.82523C12.66 8.85523 12.67 8.88523 12.67 8.92523C12.68 8.95523 12.69 8.99523 12.69 9.03523V9.07523C12.72 9.51523 13.07 9.83523 13.51 9.83523C13.95 9.83523 14.28 9.51523 14.31 9.07523V9.03523C14.31 9.03523 14.32 8.95523 14.33 8.92523C14.33 8.88523 14.35 8.84523 14.37 8.80523C14.4 8.73523 14.45 8.67523 14.51 8.61523C14.55 8.57523 14.6 8.54523 14.64 8.51523C14.67 8.50523 14.69 8.49523 14.72 8.48523C14.75 8.48523 14.78 8.46523 14.82 8.45523C14.85 8.43523 14.88 8.43523 14.92 8.43523C15.11 8.43523 15.26 8.50523 15.37 8.61523C15.38 8.61523 15.38 8.62523 15.38 8.62523C15.41 8.65523 15.43 8.67523 15.46 8.70523C15.46 8.70523 15.5 8.78523 15.51 8.82523C15.54 8.89523 15.56 8.96523 15.56 9.04523V9.07523C15.59 9.51523 15.94 9.83523 16.37 9.83523C16.8 9.83523 17.16 9.49523 17.17 9.04523C17.18 8.70523 17.43 8.44523 17.81 8.43523C18.16 8.44523 18.43 8.73523 18.42 9.07523C18.39 10.2052 17.49 11.0852 16.37 11.0852H16.39ZM15.71 10.9752C15.42 10.8752 15.17 10.7152 14.96 10.5052H14.95C14.59 10.8652 14.09 11.0852 13.53 11.0852C12.97 11.0852 12.46 10.8652 12.09 10.5052H12.08C11.72 10.8652 11.21 11.0852 10.66 11.0852C10.11 11.0852 9.6 10.8652 9.23 10.5052C8.87 10.8652 8.36 11.0852 7.81 11.0852C7.26 11.0852 6.75 10.8652 6.38 10.5052H6.37C6 10.8652 5.5 11.0852 4.94 11.0852C4.38 11.0852 3.88 10.8652 3.51 10.5052H3.5C3.29 10.7152 3.04 10.8752 2.75 10.9752C3.04 11.0352 3.25 11.2852 3.25 11.5852V15.3852H8.92V12.3352C8.92 11.9852 9.2 11.7052 9.55 11.7052H12.81C13.16 11.70
252 13.44 11.9852 13.44 12.3352V15.3852H15.22V11.5852C15.22 11.2952 15.44 11.0452 15.72 10.9752H15.71ZM18.34 7.94523C18.22 8.10523 18.03 8.20523 17.83 8.20523H0.62C0.28 8.20523 0 7.92523 0 7.57523C0 7.50523 0.01 7.43523 0.03 7.36523L0.33 6.47523C0.33 6.47523 0.36 6.39523 0.39 6.35523L2.59 2.75523C2.7 2.56523 2.9 2.45523 3.12 2.45523H4.09V0.985234C4.09 0.645234 4.37 0.365234 4.71 0.365234H13.78C14.12 0.365234 14.4 0.645234 14.4 0.985234V2.45523H15.33C15.55 2.45523 15.75 2.56523 15.86 2.75523L18.09 6.41523C18.09 6.41523 18.13 6.49523 18.14 6.54523L18.42 7.38523C18.49 7.57523 18.46 7.77523 18.34 7.94523ZM5.34 4.18523H13.15V1.61523H5.34V4.18523ZM16.95 6.95523L14.98 3.70523H14.4V4.80523C14.4 5.15523 14.12 5.43523 13.78 5.43523H4.71C4.37 5.43523 4.09 5.15523 4.09 4.80523V3.70523H3.47L1.49 6.95523H16.95Z",fill:"#242C37"})}),Ms="DateTimeAdvanced_change_selections_date_confirm__LGH8u",Ns="DateTimeAdvanced_date_time_container__MP-D9",As="DateTimeAdvanced_select__60p05",Ls="DateTimeAdvanced_selects_container__iKtwj",Ds="DateTimeAdvanced_time_slots_container__JQjab",zs="DateTimeAdvanced_loading_overlay__pc1ZM",Os="DateTimeAdvanced_open_drawer__NM7NQ",Rs="DateTimeAdvanced_disabled__DXi4Q",Fs="DateTimeAdvanced_radio_input_container__pXGUi",Bs="DateTimeAdvanced_radio_input_item__0nSrU";var Vs=e=>{let{stroke:t,dimensions:r}=e;return(0,Dr.jsxs)("svg",{width:r&&r.width?r.width:"24",height:r&&r.height?r.height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsxs)("g",{clipPath:"url(#clip0_4414_1316)",children:[(0,Dr.jsx)("path",{d:"M4.93443 16.6475L7.41943 19.1122L22.2076 4.20213L19.7226 1.73743L4.93443 16.6475Z",stroke:t||"var(--color-dark-raspberry)",strokeWidth:"2",strokeLinejoin:"round"}),(0,Dr.jsx)("path",{d:"M2.47991 21.6073L7.41946 19.1122L4.93446 16.6475L2.47991 21.6073Z",stroke:t||"var(--color-dark-raspberry)",strokeWidth:"2",strokeLinejoin:"round"}),(0,Dr.jsx)("path",{d:"M19.7429 6.68713L17.2579 4.22243",stroke:t||"var(--color-dark-raspberry)",strokeWidth:"2",strokeLinejoin:"round"})]}),(0,Dr.jsx)("defs",{children:(0,Dr.jsx)("clipPath",{id:"clip0_4414_1316",children:(0,Dr.jsx)("rect",{width:"5.25",height:"28",fill:"white",transform:"translate(3.72754 24.0771) rotate(-135.235)"})})})]})};var $s=t=>{let{timemode:r,date:n,time:i,isCurbside:a}=t;const s=E(),[o,l]=(0,e.useState)(!1),c=y((e=>e.cart.cart)),u=y((e=>e.location.location));let d=y((e=>e.cart.vehicleInfo)),h=null===d||void 0===d?void 0:d.vehicleMake,p=null===d||void 0===d?void 0:d.vehicleModel,m=null===d||void 0===d?void 0:d.vehicleColor;var f,g,_;c&&"curbside"===c.deliverymode&&c.customfields&&(h=null===(f=c.customfields.find((e=>"Make"===e.label)))||void 0===f?void 0:f.value,p=null===(g=c.customfields.find((e=>"Model"===e.label)))||void 0===g?void 0:g.value,m=null===(_=c.customfields.find((e=>"Color"===e.label)))||void 0===_?void 0:_.value);return(0,Dr.jsxs)("div",{className:Ms,children:[!o&&(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)("button",{className:"btn btn-transparent",onClick:async e=>{e.preventDefault(),l(!0);const t={delivery_mode:a?"curbside":"pickup",time:"asap"===r?"asap":"schedule",schedule_date:n||null,schedule_time:i||null};if(c){const e=await _r(c.id,t);if(e.id){if(a&&h&&p&&m&&u){const t={vehicle_make:h,vehicle_model:p,vehicle_color:m},r=await xr(e.id,u.id,t);r.id?(Mr("currentCart",r),s(vs.addCart(r)),l(!1)):s(qi.setError(r))}else Mr("currentCart",e),s(vs.addCart(e)),l(!1);s(Vi.setChangeDelivery({close:!1,value:!0}))}else s(qi.setError(e)),l(!1)}else{const e=await ur({restaurant_id:u.id});if(e.id){const r=await _r(e.id,t);if(a&&h&&p&&m&&u){const e={vehicle_make:h,vehicle_model:p,vehicle_color:m},t=await xr(r.id,u.id,e);t.id?(Mr("currentCart",t),s(vs.addCart(t)),l(!1)):s(qi.setError(t))}else Mr("currentCart",r),s(vs.addCart(r)),l(!1);s(Vi.setChangeDelivery({close:!1,value:!0}))}else s(qi.setError(e))}},disabled:!!a&&!(h&&p&&m),children:"Confirm"})}),o&&(0,Dr.jsx)("div",{className:"btn btn-transparent",children:(0,Dr.jsx)("span",{className:"loader dark"})})]})};var Us=t=>{let{isCurbside:r,isDelivery:n,setDate:i,setTime:a}=t;const s=E(),[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(null),[d,h]=(0,e.useState)(null),[p,m]=(0,e.useState)(null),[f,g]=(0,e.useState)(null),[_,v]=(0,e.useState)(!0),x=y((e=>e.cart.cart)),b=y((e=>e.location.location)),[w,C]=(0,e.useState)(!1),S=(0,e.useRef)(),k=(0,e.useRef)();(0,e.useEffect)((()=>{const e=[];let t=null;if(x&&x.earliestreadytime){const e=new Date;t=new Date(x.earliestreadytime)>e?Ki(x.earliestreadytime):e}for(let r=0;r<b.services.advance_days;r++){const n=new Date(t),i=n.setDate(n.getDate()+r);e.push({weekDay:new Date(i).toLocaleDateString("en-US",{weekday:"long"}),day:new Date(i).toLocaleDateString("en-US",{day:"numeric"}),date:Wi(i),dateUS:new Date(i).toLocaleDateString("en-US"),fancyFormat:new Date(i).toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"})})}u(e),x&&x.timewanted&&(v(!1),j(x.timewanted),l(!0))}),[b]);const j=async e=>{C(!0),h(null),m(Ki(e)),n&&(i(Ki(e)),a(Yi(x.timewanted)));const t=await vr(x.id,b.id,e);let r=0;if(x&&x.leadtimeestimateminutes&&(r=Math.ceil(x.leadtimeestimateminutes/15),r>16&&(r=0)),200===t.status){let e=[];for(const[r,n]of Object.entries(t.data))e.push({label:r,value:n});h(e),g(Yi(x.timewanted)),l(!0)}else s(qi.setError(t));C(!1)},T=async e=>{C(!0),h(null),m(e.target.value);const t=new Date,r=new Date(e.target.value),o=t.toDateString()===r.toDateString();n&&i(e.target.value);const c=await vr(x.id,b.id,e.target.value);let u=0;if(x&&x.leadtimeestimateminutes&&(u=Math.ceil(x.leadtimeestimateminutes/15),u>16&&(u=0)),200===c.status){let t=[];for(const[e,n]of Object.entries(c.data))t.push({label:e,value:n});let r=t;if(o){console.log("today!");let n=wa(x.earliestreadytime,t,e.target.value);r.splice(0,n)}h(r),g(null),l(!1),n&&a(null)}else s(qi.setError(c));C(!1)},P=e=>{l(!0),g(e.target.value),n&&a(e.target.value)};return(0,Dr.jsxs)("div",{className:Ns,children:[(0,Dr.jsxs)("div",{className:"label-appearance",children:[_&&(0,Dr.jsx)(Dr.Fragment,{children:"Select date and time"}),!_&&(0,Dr.jsx)(Dr.Fragment,{children:"Edit date and time"})]}),(0,Dr.jsxs)("div",{className:Ls,children:[!x.timewanted&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:Ds,children:[c&&(0,Dr.jsxs)("select",{ref:S,onChange:T,className:`select ${As}`,defaultValue:"Date",children:[(0,Dr.jsx)("option",{disabled:!0,value:"Date",hidden:!0,children:"Date"}),c.map((e=>(0,Dr.jsx)("option",{value:e.date,children:e.fancyFormat},e.date)))]}),(0,Dr.jsx)("span",{className:Os,children:(0,Dr.jsx)(Vs,{})})]}),(0,Dr.jsxs)("div",{className:`${Ds} ${d?"":Rs}`,children:[(0,Dr.jsxs)("select",{ref:k,className:`select ${As}
2`,onChange:P,disabled:!d,defaultValue:"Time",children:[(0,Dr.jsx)("option",{disabled:!0,value:"Time",hidden:!0,children:"Time"}),d&&!w&&(0,Dr.jsx)(Dr.Fragment,{children:d.map((e=>(0,Dr.jsx)("option",{value:e.value,children:e.label},e.value)))})]}),(0,Dr.jsx)("span",{className:Os,children:(0,Dr.jsx)(Vs,{fill:"#fff"})}),!d&&w&&(0,Dr.jsx)("div",{className:zs,children:(0,Dr.jsx)("span",{className:"loader dark"})})]})]}),x.timewanted&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:Ds,children:[c&&(0,Dr.jsxs)("select",{ref:S,onChange:T,className:`select ${As}`,defaultValue:Ki(x.timewanted),children:[(0,Dr.jsx)("option",{disabled:!0,value:"Date",hidden:!0,children:"Date"}),c.map((e=>(0,Dr.jsx)("option",{value:e.date,children:e.fancyFormat},e.date)))]}),(0,Dr.jsx)("span",{className:Os,children:(0,Dr.jsx)(Vs,{})})]}),(0,Dr.jsxs)("div",{className:`${Ds} ${d?"":Rs}`,children:[(0,Dr.jsxs)("select",{ref:k,className:`select ${As}`,onChange:P,disabled:!d,value:f||"Time",children:[(0,Dr.jsx)("option",{disabled:!0,value:"Time",hidden:!0,children:"Time"}),d&&!w&&(0,Dr.jsx)(Dr.Fragment,{children:d.map((e=>(0,Dr.jsx)("option",{value:e.value,children:e.label},e.value)))})]}),(0,Dr.jsx)("span",{className:Os,children:(0,Dr.jsx)(Vs,{fill:"#fff"})}),!d&&w&&(0,Dr.jsx)("div",{className:zs,children:(0,Dr.jsx)("span",{className:"loader dark"})})]})]})]}),o&&!n&&(0,Dr.jsx)($s,{timemode:"schedule",date:p,time:f,isCurbside:r})]})};var Hs=t=>{let{isCurbside:r}=t;const[n,i]=(0,e.useState)(!1),a=y((e=>e.cart.cart));(0,e.useEffect)((()=>{a&&"advance"===a.timemode&&i(!0)}),[]);const s=e=>{"schedule"===e.target.value?i(!0):i(!1)};return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsxs)("fieldset",{children:[(0,Dr.jsx)("legend",{className:"label sr-only",children:"Order Time"}),(0,Dr.jsxs)("div",{className:Fs,children:[(0,Dr.jsxs)("div",{className:`${Bs}`,children:[(0,Dr.jsx)("input",{type:"radio",id:"orderTime_asap",name:"orderTime",value:"asap",checked:!n,onChange:s}),(0,Dr.jsx)("label",{htmlFor:"orderTime_asap",children:"Asap"})]}),(0,Dr.jsxs)("div",{className:`${Bs}`,children:[(0,Dr.jsx)("input",{type:"radio",id:"orderTime_scheduled",name:"orderTime",value:"schedule",checked:n,onChange:s}),(0,Dr.jsx)("label",{htmlFor:"orderTime_scheduled",children:"Scheduled"})]})]})]})}),!n&&(0,Dr.jsx)($s,{timemode:"asap",isCurbside:r}),n&&(0,Dr.jsx)(Us,{isCurbside:r})]})},qs="DeliverySelection_form__O8MDY",Zs="DeliverySelection_form_input_container__A-r-D",Gs="DeliverySelection_text_info__VBk+h",Ws="DeliverySelection_form_cart_is_delivery__N8M+K";var Xs=t=>{let{setTimeMode:r,setDateHandler:n,setTimeHandler:i}=t;const a=E(),s=y((e=>e.cart.cart)),[o,l]=(0,e.useState)(!1);(0,e.useEffect)((()=>{s&&"advance"===s.timemode&&(l(!0),r(!0))}),[]);const c=e=>{"schedule"===e.target.value?(l(!0),r(!0)):(l(!1),r(!1)),a(Vi.setOrderType(e.target.value))};return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsxs)("fieldset",{children:[(0,Dr.jsx)("legend",{className:"label sr-only",children:"Order Time"}),(0,Dr.jsxs)("div",{className:Fs,children:[(0,Dr.jsxs)("div",{className:`${Bs}`,children:[(0,Dr.jsx)("input",{type:"radio",id:"orderTime_asap",name:"orderTime",value:"asap",checked:!o,onChange:c}),(0,Dr.jsx)("label",{htmlFor:"orderTime_asap",children:"Asap"})]}),(0,Dr.jsxs)("div",{className:`${Bs}`,children:[(0,Dr.jsx)("input",{type:"radio",id:"orderTime_scheduled",name:"orderTime",value:"schedule",checked:o,onChange:c}),(0,Dr.jsx)("label",{htmlFor:"orderTime_scheduled",children:"Scheduled"})]})]})]})}),o&&(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsx)(Us,{isCurbside:!1,isDelivery:!0,setDate:n,setTime:i})})]})},Js={text_info:"DeliverySelectionDetails_text_info__k7KkI",text_info_header:"DeliverySelectionDetails_text_info_header__hfhA0",cta_container:"DeliverySelectionDetails_cta_container__joHLT",text_info_item:"DeliverySelectionDetails_text_info_item__LogmX",text_info_item_header:"DeliverySelectionDetails_text_info_item_header__kg1ba",form_fields_container:"DeliverySelectionDetail
2s_form_fields_container__f2N1L"};var Ks=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsx)("svg",{width:r&&r.width?r.width:"24",height:r&&r.height?r.height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M12 0C5.38714 0 0 5.38714 0 12C0 18.6129 5.38714 24 12 24C18.6129 24 24 18.628 24 12C24 5.372 18.628 0 12 0ZM12 21.7301C6.64313 21.7301 2.26986 17.372 2.26986 12C2.26986 6.628 6.64313 2.26986 12 2.26986C17.3569 2.26986 21.7301 6.64313 21.7301 12C21.7301 17.3569 17.372 21.7301 12 21.7301ZM19.9596 12C19.9596 12.6356 19.4603 13.1349 18.8247 13.1349H12C11.3796 13.1349 10.8651 12.6356 10.8651 12V6.68853C10.8651 6.0681 11.3796 5.55359 12 5.55359C12.6204 5.55359 13.1349 6.0681 13.1349 6.68853V10.8651H18.8247C19.4603 10.8651 19.9596 11.3796 19.9596 12Z",fill:t||"var(--color-dark-raspberry)"})})};var Ys=t=>{let{scheduled:r,selectedDate:n,selectedTime:i,searchedLocations:a}=t;const s=E(),[o,l]=(0,e.useState)(!1),c=(0,e.useRef)(null),u=(0,e.useRef)(null),d=y((e=>e.cart.cart));return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),l(!0);const t={delivery_mode:"delivery",time:r?"schedule":"asap",schedule_date:r?n:null,schedule_time:r?i:null,street_address:a.street_number+" "+a.street,city:a.city,zip_code:a.postal_code};if(c.current.value&&(t.building=c.current.value),u.current.value){if(aa(u.current.value))return window.alert("Please remove emojis from special instructions. Use letters and numbers only."),void l(!1);t.special_instructions=u.current.value}const o=await _r(d.id,t);o.id?(Mr("currentCart",o),s(vs.addCart(o)),l(!1),s(Vi.setChangeDelivery({close:!1,value:!0}))):(s(qi.setError(o)),l(!1)),l(!1)},children:[(0,Dr.jsxs)("div",{className:`${Js.text_info} ${Js.text_info_header}`,children:[r&&(0,Dr.jsxs)("div",{className:Js.text_info_item,children:[(0,Dr.jsx)(Ks,{}),(0,Dr.jsxs)("div",{className:Js.text_info_item_text,children:[(0,Dr.jsx)("div",{className:Js.text_info_item_header,children:"Delivery Time"}),(0,Dr.jsx)("span",{children:new Date(n+"T"+i).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]})]}),!r&&(0,Dr.jsxs)("div",{className:Js.text_info_item,children:[(0,Dr.jsx)(Ks,{}),(0,Dr.jsxs)("div",{className:Js.text_info_item_text,children:[(0,Dr.jsx)("div",{className:Js.text_info_item_header,children:"Delivery Time"}),(0,Dr.jsx)("span",{children:"ASAP"})]})]}),(0,Dr.jsxs)("div",{className:Js.text_info_item,children:[(0,Dr.jsx)(Ps,{}),(0,Dr.jsxs)("div",{className:Js.text_info_item_text,children:[(0,Dr.jsx)("div",{className:Js.text_info_item_header,children:"Delivery Address"}),(0,Dr.jsx)("span",{children:a.full_address})]})]}),(0,Dr.jsxs)("div",{className:`form-fields-container ${Js.form_fields_container}`,children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{htmlFor:"locationDetails",className:"label",children:"Apt/Suite/Flr (Optional)"}),(0,Dr.jsx)("input",{ref:c,type:"text",id:"locationDetails",name:"locationDetails",placeholder:"Apt/Suite/Flr (Optional)"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"locationInstructions",children:"Special Instructions (Optional)"}),(0,Dr.jsx)("textarea",{ref:u,type:"text",id:"locationInstructions",name:"locationInstructions",placeholder:"Special Instructions (Optional)"})]})]}),(0,Dr.jsx)("br",{}),(0,Dr.jsx)(Es,{}),(0,Dr.jsx)("h4",{children:"Sweeeeet!"}),(0,Dr.jsx)("p",{children:"We deliver treats straight to your door!"})]}),(0,Dr.jsxs)("div",{className:Js.cta_container,children:[!o&&(0,Dr.jsx)("button",{className:"btn btn-100",type:"submit",children:"Start Delivery Order"}),o&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})})},Qs=r(4066);class eo{static setup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eo.options=e}static get(){return eo.options||{}}static clear(){eo.options={}}}eo.defaultOptions={live:!1,logLevel:"error",host:"https://api.radar.io",version:"v1",debug:!1};const to={none:0,error:1,warn:2,info:3,debug:4},ro=()=>
2{if(window&&window.RADAR_TEST_ENV)return to.none;const{logLevel:e,debug:t}=eo.get();return t?to.debug:e?to[e]:to.error};class no{static debug(e){ro()===to.debug&&console.log(`Radar SDK (debug): ${e.trim()}`)}static info(e){ro()>=to.info&&console.log(`Radar SDK: ${e.trim()}`)}static warn(e){ro()>=to.warn&&console.warn(`Radar SDK: ${e.trim()}`)}static error(e){ro()>=to.error&&console.error(`Radar SDK: ${e.trim()}`)}}class io{static get USER_ID(){return"radar-userId"}static get DEVICE_ID(){return"radar-deviceId"}static get INSTALL_ID(){return"radar-installId"}static get SESSION_ID(){return"radar-sessionId"}static get DESCRIPTION(){return"radar-description"}static get METADATA(){return"radar-metadata"}static get CACHED_LOCATION(){return"radar-cached-location"}static get TRIP_OPTIONS(){return"radar-trip-options"}static getStorage(){const e=null===window||void 0===window?void 0:window.localStorage;return e||no.warn("localStorage not available."),e}static setItem(e,t){const r=this.getStorage();r&&void 0!==t&&null!==t&&r.setItem(e,t)}static getItem(e){const t=this.getStorage();if(!t)return null;const r=t.getItem(e);return void 0!==r&&null!==r?r:null}static getJSON(e){const t=this.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(r){return no.warn(`could not getJSON from storage for key: ${e}`),null}}static removeItem(e){const t=this.getStorage();if(!t)return null;t.removeItem(e)}static clear(){const e=this.getStorage();if(!e)return null;e.clear()}}function ao(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(t){a(t)}}function o(e){try{l(n.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}class so extends Error{constructor(e){super(e),this.status=""}}class oo extends so{constructor(e){super(e),this.name="RadarPublishableKeyError",this.status="ERROR_PUBLISHABLE_KEY"}}class lo extends so{constructor(e){super(e),this.name="RadarLocationError",this.status="ERROR_LOCATION"}}class co extends so{constructor(e){super(e),this.name="RadarPermissionsError",this.status="ERROR_PERMISSIONS"}}class uo extends so{constructor(){super("Radar Verify app not running."),this.name="RadarVerifyAppError",this.status="ERROR_VERIFY_APP"}}class ho extends so{constructor(e){var t;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Bad request."),this.name="RadarBadRequestError",this.code=400,this.response=e,this.status="ERROR_BAD_REQUEST"}}class po extends so{constructor(e){var t;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Unauthorized."),this.name="RadarUnauthorizedError",this.code=401,this.response=e,this.status="ERROR_UNAUTHORIZED"}}class mo extends so{constructor(e){var t;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Payment required."),this.name="RadarPaymentRequiredError",this.code=402,this.response=e,this.status="ERROR_PAYMENT_REQUIRED"}}class fo extends so{constructor(e){var t;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Forbidden."),this.name="RadarForbiddenError",this.code=403,this.response=e,this.status="ERROR_FORBIDDEN"}}class go extends so{constructor(e){var t;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Not found."),this.name="RadarNotFoundError",this.code=404,this.response=e,this.status="ERROR_NOT_FOUND"}}class _o extends so{constructor(e){var t,r;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Rate limit exceeded."),this.name="RadarRateLimitError",this.code=429,this.response=e,this.type=null===(r=null===e||void 0===e?void 0:e.meta)||void 0===r?void 0:r.type,this.status="ERROR_RATE_LIMIT"}}class yo extends so{constructor(e){var t;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Internal server error."),this.name="RadarServerError",this.response=e,this.status="ERROR_SERVER"}}class vo extends so{constructor(){super("Request timed out."),this.name="RadarNetworkError",this.status="ERROR_NETWORK"}}class xo extends so{constructor(e){var t;super((null===(t=null===e||void 0===e?void 0:e.meta)||void 0===t?void 0:t.message)||"Something went wrong."),this.name="RadarUnknownError",this.response=e,this.status="ERROR_UNKNOWN"}}class bo extends so{constructor(e){super(e),this.name="RadarAutocompleteContainerNotFound",this.status="CONTAINER_NOT_FOUND"}}const wo={maximumAge:0,timeout:3e4,enableHighAccuracy:!0},Co=e=>Boolean("high"===e);class So{static getCurrentPosition(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ao(this,void 0,void 0,(function*(){return new Promise(((t,r)=>{const n=eo.get();if(!navigator||!navigator.geolocation)return r(new lo("navigator.geolocation is not available."));if(n.cacheLocationMinutes)try{const e=io.getItem(io.CACHED_LOCATION);if(e){const r=JSON.parse(e),{latitude:n,longitude:i,accuracy:a,expiresAt:s}=r||{};if(Date.now()<parseInt(s)&&n&&i&&a)return t({latitude:n,longitude:i,accuracy:a})}}catch(a){no.warn("could not load cached location.")}const i=Object.assign({},wo);void 0!==n.locationMaximumAge&&(i.maximumAge=n.locationMaximumAge),void 0!==n.locationTimeout&&(i.timeout=n.locationTimeout),void 0!==n.desiredAccuracy&&(i.enableHighAccuracy=Co(n.desiredAccuracy)),void 0!==e.desiredAccuracy&&(i.enableHighAccuracy=Co(e.desiredAccuracy)),no.info(`Using geolocation options: ${JSON.stringify(i)}`),navigator.geolocation.getCurrentPosition((e=>{if(!e||!e.coords)return r(new lo("device location return empty coordinates."));const{latitude:i,longitude:a,accuracy:s}=e.coords;if(n.cacheLocationMinutes){const e=Number.parseFloat(n.cacheLocationMinutes),t=Date.now(),r={latitude:i,longitude:a,accuracy:s,updatedAt:t,expiresAt:t+60*e*1e3};io.setItem(io.CACHED_LOCATION,JSON.stringify(r))}return t({latitude:i,longitude:a,accuracy:s})}),(e=>e&&1===e.code?r(new co("Location permissions denied.")):r(new lo("Could not determine location."))),i)}))}))}static getPermissionStatus(){return ao(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{if(!navigator||!navigator.permissions)return t(new lo("navigator.permissions is not available."));navigator.permissions.query({name:"geolocation"}).then((t=>{let r="NOT_DETERMINED";switch(t.state){case"granted":r="GRANTED_FOREGROUND";break;case"denied":r="DENIED";break;case"prompt":r="NOT_DETERMINED"}return e(r)}))}))}))}}var ko="4.4.3";const jo=new Map;class Eo{static request(e){let{method:t,path:r,data:n,host:i,version:a,headers:s={},responseType:o,requestId:l}=e;return ao(this,void 0,void 0,(function*(){return new Promise(((e,c)=>{const u=eo.get(),d=u.publishableKey;if(!d)return void c(new oo("publishableKey not set."));let h=`${i||u.host}
2/${a||u.version}/${r}`,p={};if(Object.keys(n||{}).forEach((e=>{const t=n[e];void 0!==t&&(p[e]=t)})),"GET"===t){const e=Object.keys(p).map((e=>`${e}=${encodeURIComponent(p[e])}`));if(e.length>0){const t=e.join("&");h=`${h}?${t}`}p=void 0}if(l){const e=jo.get(l);e&&e.abort()}const m=new XMLHttpRequest;m.open(t,h,!0),l&&jo.set(l,m);const f={Authorization:d,"Content-Type":"application/json","X-Radar-Device-Type":"Web","X-Radar-SDK-Version":ko};let g={};"function"===typeof u.getRequestHeaders&&(g=u.getRequestHeaders());const _=Object.assign(f,g,s);Object.keys(_).forEach((e=>{m.setRequestHeader(e,_[e])})),o&&(m.responseType=o),m.onload=()=>{var t;let r;l&&jo.delete(l);try{r="blob"===m.responseType?{code:m.status,data:m.response}:JSON.parse(m.response)}catch(i){return c(new yo(r))}const n=null===(t=null===r||void 0===r?void 0:r.meta)||void 0===t?void 0:t.error;return"ERROR_PERMISSIONS"===n?c(new co("Location permissions not granted.")):"ERROR_LOCATION"===n?c(new lo("Could not determine location.")):"ERROR_NETWORK"===n?c(new vo):200==m.status?e(r):(u.debug&&(no.debug(`API call failed: ${h}`),no.debug(JSON.stringify(r))),void(400===m.status?c(new ho(r)):401===m.status?c(new po(r)):402===m.status?c(new mo(r)):403===m.status?c(new fo(r)):404===m.status?c(new go(r)):429===m.status?c(new _o(r)):500<=m.status&&m.status<600?c(new yo(r)):c(new xo(r))))},m.onerror=function(){c(!i||"http://localhost:52516"!==i&&"https://radar-verify.com:52516"!==i?new yo:new uo)},m.ontimeout=function(){c(new uo)},m.send(JSON.stringify(p))}))}))}}class To{static validateAddress(e){return ao(this,void 0,void 0,(function*(){const t=eo.get(),r=yield Eo.request({method:"GET",path:"addresses/validate",data:e}),{address:n,result:i}=r,a={address:n,result:i};return t.debug&&(a.response=r),a}))}}const Po=()=>{const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}));return e};class Io{static getDeviceId(){const e=io.getItem(io.DEVICE_ID);if(e)return e;const t=Po();return io.setItem(io.DEVICE_ID,t),t}static getInstallId(){const e=io.getItem(io.INSTALL_ID);if(e)return e;const t=Po();return io.setItem(io.INSTALL_ID,t),t}}class Mo{static getSessionId(){const e=io.getItem(io.SESSION_ID);if(e&&(e=>{const t=Math.trunc(Date.now()/1e3),r=Number.parseInt(e);return Math.abs(t-r)<300})(e))return e;const t=Math.trunc(Date.now()/1e3).toString();return io.setItem(io.SESSION_ID,t),t}}class No{static getConfig(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ao(this,void 0,void 0,(function*(){if("v1"!=eo.get().version)return void no.info("Skipping /config call.");const t={deviceId:e.deviceId||Io.getDeviceId(),installId:e.installId||Io.getInstallId(),sessionId:Mo.getSessionId(),locationAuthorization:yield So.getPermissionStatus()};try{yield Eo.request({method:"GET",path:"config",data:t})}catch(r){no.warn(`Error calling /config: ${r.message}`)}}))}}class Ao{static getContext(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();e.latitude&&e.longitude||(e=yield So.getCurrentPosition());const{latitude:r,longitude:n,accuracy:i}=e,a=yield Eo.request({method:"GET",path:"context",data:{coordinates:`${r},${n}`,accuracy:i}}),{geofences:s,place:o,country:l,state:c,dma:u,postalCode:d}=a,h={location:e,geofences:s,place:o,country:l,state:c,dma:u,postalCode:d};return t.debug&&(h.response=a),h}))}}class Lo{static logConversion(e){return ao(this,void 0,void 0,(function*(){const t=eo.get(),r=e.name,n=e.userId||io.getItem(io.USER_ID),i=e.deviceId||Io.getDeviceId(),a=e.installId||Io.getInstallId(),s=e.metadata||{},o=e.createdAt;e.revenue&&(s.revenue=e.revenue);const l={name:r,userId:n,deviceId:i,installId:a,metadata:s};"string"===typeof o?l.createdAt=o:o instanceof Date?l.createdAt=o.toISOString():l.createdAt=(new Date).toISOString();const c=yield Eo.request({method:"POST",path:"events",data:l}),u={event:c.event};return t.debug&&(u.response=c),u}))}}class Do{static forwardGeocode(e){return ao(this,void 0,void 0,(function*(){const t=eo.get(),{query:r,layers:n,country:i}=e,a=yield Eo.request({method:"GET",path:"geocode/forward",data:{query:r,layers:n,country:i}}),s={addresses:a.addresses};return t.debug&&(s.response=a),s}))}static reverseGeocode(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();let{latitude:r,longitude:n,layers:i}=e;if(!r||!n){const e=yield So.getCurrentPosition();r=e.latitude,n=e.longitude}const a=yield Eo.request({method:"GET",path:"geocode/reverse",data:{coordinates:`${r},${n}`,layers:i}}),s={addresses:a.addresses};return t.debug&&(s.response=a),s}))}static ipGeocode(){return ao(this,void 0,void 0,(function*(){const e=eo.get(),t=yield Eo.request({method:"GET",path:"geocode/ip"}),r={ip:t.ip,address:t.address,proxy:t.proxy}
2;return e.debug&&(r.response=t),r}))}}class zo{static distance(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();let{origin:r,destination:n,modes:i,units:a,geometry:s,geometryPoints:o,avoid:l}=e;if(r){if("string"!==typeof r){const{latitude:e,longitude:t}=r;r=`${e},${t}`}}else{const{latitude:e,longitude:t}=yield So.getCurrentPosition();r=`${e},${t}`}if("string"!==typeof n){const{latitude:e,longitude:t}=n;n=`${e},${t}`}Array.isArray(i)&&(i=i.join(",")),Array.isArray(l)&&(l=l.join(","));const c=yield Eo.request({method:"GET",path:"route/distance",data:{origin:r,destination:n,modes:i,units:a,geometry:s,geometryPoints:o,avoid:l}}),u={routes:c.routes};return t.debug&&(u.response=c),u}))}static matrix(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();let{origins:r,destinations:n,mode:i,units:a,avoid:s}=e;if(r)Array.isArray(r)&&(r=r.map((e=>`${e.latitude},${e.longitude}`)).join("|"));else{const{latitude:e,longitude:t}=yield So.getCurrentPosition();let i=[];for(let r=0;r<n.length;r++)i.push(`${e},${t}`);r=i.join("|")}Array.isArray(n)&&(n=n.map((e=>`${e.latitude},${e.longitude}`)).join("|")),Array.isArray(s)&&(s=s.join(","));const o=yield Eo.request({method:"GET",path:"route/matrix",data:{origins:r,destinations:n,mode:i,units:a,avoid:s}}),l={origins:o.origins,destinations:o.destinations,matrix:o.matrix};return t.debug&&(l.response=o),l}))}}class Oo{static autocomplete(e,t){return ao(this,void 0,void 0,(function*(){const r=eo.get();let{query:n,near:i,limit:a,layers:s,countryCode:o,expandUnits:l,mailable:c}=e;i&&"string"!==typeof i&&i.latitude&&i.longitude&&(i=`${i.latitude},${i.longitude}`);const u=yield Eo.request({method:"GET",path:"search/autocomplete",data:{query:n,near:i,limit:a,layers:s,countryCode:o,expandUnits:l,mailable:c},requestId:t}),d={addresses:u.addresses};return r.debug&&(d.response=u),d}))}static searchGeofences(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();let{near:r,radius:n,tags:i,metadata:a,limit:s,includeGeometry:o}=e;if(r){if("string"!==typeof r){const{latitude:e,longitude:t}=r;r=`${e},${t}`}}else{const{latitude:e,longitude:t}=yield So.getCurrentPosition();r=`${e},${t}`}Array.isArray(i)&&(i=i.join(","));const l=yield Eo.request({method:"GET",path:"search/geofences",data:{near:r,radius:n,tags:i,metadata:a,limit:s,includeGeometry:o}}),c={geofences:l.geofences};return t.debug&&(c.response=l),c}))}static searchPlaces(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();let{near:r,radius:n,chains:i,categories:a,groups:s,limit:o}=e;if(r){if("string"!==typeof r){const{latitude:e,longitude:t}=r;r=`${e},${t}`}}else{const{latitude:e,longitude:t}=yield So.getCurrentPosition();r=`${e},${t}`}Array.isArray(i)&&(i=i.join(",")),Array.isArray(a)&&(a=a.join(",")),Array.isArray(s)&&(s=s.join(","));const l=yield Eo.request({method:"GET",path:"search/places",data:{near:r,radius:n,chains:i,categories:a,groups:s,limit:o}}),c={places:l.places};return t.debug&&(c.response=l),c}))}}const Ro=e=>e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e);class Fo{static setTripOptions(e){if(!e)return void Fo.clearTripOptions();const t=JSON.stringify(e);no.debug(`Saving trip options: ${t}`),io.setItem(io.TRIP_OPTIONS,t)}static getTripOptions(){let e=io.getItem(io.TRIP_OPTIONS);return e&&(e=JSON.parse(e)),e}static clearTripOptions(){io.removeItem(io.TRIP_OPTIONS)}static startTrip(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();(e=e||Fo.getTripOptions())||no.warn('tripOptions not set when calling "startTrip"');const r=e.userId||io.getItem(io.USER_ID);r&&r!==io.getItem(io.USER_ID)&&io.setItem(io.USER_ID,r);const{externalId:n,destinationGeofenceTag:i,destinationGeofenceExternalId:a,mode:s,metadata:o,approachingThreshold:l,scheduledArrivalAt:c}=e,u={userId:r,externalId:n,destinationGeofenceTag:i,destinationGeofenceExternalId:a,mode:s,metadata:o,approachingThreshold:l};Ro(c)?u.scheduledArrivalAt=null===c||void 0===c?void 0:c.toJSON():(c&&no.warn("Invalid date format for scheduledArrivalAt"),u.scheduledArrivalAt=void 0);const d=yield Eo.request({method:"POST",path:"trips",data:u});Fo.setTripOptions(e);const h={trip:d.trip,events:d.events};return t.debug&&(h.response=d),h}))}static updateTrip(e,t){return ao(this,void 0,void 0,(function*(){const r=eo.get();(e=e||Fo.getTripOptions())||no.warn('tripOptions not set when calling "startTrip"');const{externalId:n,destinationGeofenceTag:i,destinationGeofenceExternalId:a,mode:s,metadata:o,approachingThreshold:l,scheduledArrivalAt:c}=e,u={status:t,externalId:n,destinationGeofenceTag:i,destinationGeofenceExternalId:a,mode:s,metadata:o,approachingThreshold:l};Ro(c)?u.scheduledArrivalAt=null===c||void 0===c?void 0:c.toJSON():(c&&no.warn("Invalid date format for scheduledArrivalAt"),u.scheduledArrivalAt=void 0);const d=yield Eo.request({method:"PATCH",path:`trips/${n}/update`,data:u}),h={trip:d.trip,events:d.events};return r.debug&&(h.response=d),h}))}static completeTrip(){return ao(this,void 0,void 0,(function*(){const e=Fo.getTripOptions(),t=yield Fo.updateTrip(e,"completed");return Fo.clearTripOptions(),t}))}static cancelTrip(){return ao(this,void 0,void 0,(function*(){const e=Fo.getTripOptions(),t=yield Fo.updateTrip(e,"canceled");return Fo.clearTripOptions(),t}))}}const Bo=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),Vo=e=>
2new Promise((t=>{const r=new WebSocket(e);let n=0;const i=[];let a,s;const o=()=>{n++;const e=Date.now();r.send("ping"),r.onmessage=o=>{if("pong"===o.data){const o=Date.now()-e;if(i.push(o),n>=3){clearInterval(a),clearInterval(s);const e=i.sort(((e,t)=>e-t))[1];r.close(),t(e)}}}},l=()=>{no.warn("Socket timeout"),clearInterval(a),clearInterval(s),r.close(),t(-1)};r.onerror=e=>{no.warn("Error opening socket"),r.close(),t(-1)},r.onopen=()=>{o(),a=setInterval(o,1e3),s=setInterval(l,1e4)}}));class $o{static trackOnce(e){return ao(this,void 0,void 0,(function*(){const t=eo.get();let r,{latitude:n,longitude:i,accuracy:a,desiredAccuracy:s,fraud:o}=e;if(!n||!i){const e=yield So.getCurrentPosition({desiredAccuracy:s});n=e.latitude,i=e.longitude,a=e.accuracy}try{r=yield So.getPermissionStatus()}catch(w){no.warn(`Location authorization error: ${w.message}`)}const l=e.userId||io.getItem(io.USER_ID),c=e.deviceId||Io.getDeviceId(),u=e.installId||Io.getInstallId(),d=Mo.getSessionId(),h=e.deviceType||"Web",p=e.description||io.getItem(io.DESCRIPTION);let m;try{m=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(w){no.warn(`Error getting time zone: ${w.message}`)}l?io.setItem(io.USER_ID,l):no.warn("userId not provided for trackOnce.");const f=e.metadata||io.getJSON(io.METADATA),g=e.tripOptions||Fo.getTripOptions();g&&(g.version="2");const _=Object.assign(Object.assign({},e),{locationAuthorization:r,accuracy:a,description:p,deviceId:c,deviceType:h,foreground:!0,installId:u,sessionId:d,latitude:n,longitude:i,metadata:f,sdkVersion:ko,stopped:!0,userId:l,tripOptions:g,timeZone:m});let y;if(o){const e="https://api-verified.radar.io",s="ping.radar-verify.com",o=navigator.language,l=navigator.languages,{dk:h}=yield Eo.request({host:e,method:"GET",path:"config",data:{deviceId:c,installId:u,sessionId:d,locationAuthorization:r},headers:{"X-Radar-Desktop-Device-Type":"Web"}});let p=-1,m=-1;try{const[e,t]=yield Promise.all([Eo.request({host:`https://${s}`,method:"GET",path:"ping"}),Vo(`wss://${s}`)]),{scl:r}=e;p=r,m=t}catch(w){}const f={payload:JSON.stringify(Object.assign(Object.assign({},_),{scl:p,csl:m,lang:o,langs:l}))},g=yield((e,t)=>ao(void 0,void 0,void 0,(function*(){const r=new TextEncoder,n=Bo(JSON.stringify({alg:"HS256",typ:"JWT"})),i=Bo(JSON.stringify(e)),a=r.encode(t),s=r.encode(`${n}.${i}`),o=yield crypto.subtle.importKey("raw",a,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),l=yield crypto.subtle.sign("HMAC",o,s);return`${n}.${i}.${Bo(String.fromCharCode(...Array.from(new Uint8Array(l))))}`})))(f,h);y=yield Eo.request({host:e,method:"POST",path:"track",data:{token:g},headers:{"X-Radar-Body-Is-Token":"true"}}),t.debug&&y&&y.user&&(y.user.metadata||(y.user.metadata={}),y.user.metadata["radar:debug"]={sclVal:p,cslVal:m});let{user:v,events:x,token:b,expiresAt:C,expiresIn:S,passed:k,failureReasons:j,_id:E}=y;const T={latitude:n,longitude:i,accuracy:a};C&&(C=new Date(C));const P={user:v,events:x,location:T,token:b,expiresAt:C,expiresIn:S,passed:k,failureReasons:j,_id:E};return t.debug&&(P.response=y),P}y=yield Eo.request({method:"POST",path:"track",data:_});const{user:v,events:x}=y,b={user:v,events:x,location:{latitude:n,longitude:i,accuracy:a}};return t.debug&&(b.response=y),b}))}}let Uo=null,Ho=null,qo=null,Zo=0,Go=null,Wo=null;class Xo{static trackVerified(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ao(this,void 0,void 0,(function*(){const r=eo.get(),n=e.userId||io.getItem(io.USER_ID),i=e.deviceId||Io.getDeviceId(),a=e.installId||Io.getInstallId(),s=Mo.getSessionId(),o=e.description||io.getItem(io.DESCRIPTION);n?io.setItem(io.USER_ID,n):no.warn("userId not provided for trackVerified.");const l=e.metadata||io.getJSON(io.METADATA),c=Object.assign(Object.assign({},e),{description:o,deviceId:i,foreground:!0,installId:a,sessionId:s,metadata:l,sdkVersion:ko,stopped:!0,userId:n,encrypted:t,expectedCountryCode:Go,expectedStateCode:Wo});let u=navigator.userAgent;const d=u&&(u.toLowerCase().includes("mac")||u.toLowerCase().includes("iphone")||u.toLowerCase().includes("ipod")||u.toLowerCase().includes("ipad")),h=yield Eo.request({method:"GET",path:"verify",data:c,host:d?"https://radar-verify.com:52516":"http://localhost:52516"});
2let p,{user:m,events:f,token:g,expiresAt:_,expiresIn:y,passed:v,failureReasons:x,_id:b}=h;m&&m.location&&m.location.coordinates&&m.locationAccuracy&&(p={latitude:m.location.coordinates[1],longitude:m.location.coordinates[0],accuracy:m.locationAccuracy}),_&&(_=new Date(_));const w={user:m,events:f,location:p,token:g,expiresAt:_,expiresIn:y,passed:v,failureReasons:x,_id:b};return r.debug&&(w.response=h),qo=w,Zo=performance.now(),Ho&&Ho(w),w}))}static startTrackingVerified(e){return ao(this,void 0,void 0,(function*(){const t=()=>ao(this,void 0,void 0,(function*(){const r=yield this.trackVerified({}),{interval:n}=e;let i=0,a=n;r&&(i=r.expiresIn||i,a=Math.min(i,n)),a>20&&(a-=10),a<10&&(a=10),Uo&&clearTimeout(Uo),Uo=setTimeout(t,1e3*a)}));t()}))}static stopTrackingVerified(){Uo&&clearTimeout(Uo)}static getVerifiedLocationToken(){return ao(this,void 0,void 0,(function*(){const e=(performance.now()-Zo)/1e3;return qo&&e<(qo.expiresIn||0)?qo:this.trackVerified({})}))}static setExpectedJurisdiction(e,t){Go=e||null,Wo=t||null}static onTokenUpdated(e){Ho=e}}let Jo=class{static get VERSION(){return ko}static initialize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)throw new oo("Publishable key required in initialization.");if(e.includes("_sk_"))throw new oo("Secret keys are not allowed. Please use your Radar publishable key.");const r=(e=>e.includes("_live_"))(e),n=r?"error":"info",i=!r,a=Object.assign(eo.defaultOptions,{publishableKey:e,live:r,logLevel:n,debug:i},t);eo.setup(a),no.info(`initialized with ${r?"live":"test"} publishableKey.`),t.debug&&no.info(`using options: ${JSON.stringify(t)}`),(null===window||void 0===window?void 0:window.RADAR_TEST_ENV)||No.getConfig()}static clear(){eo.clear()}static setUserId(e){e?io.setItem(io.USER_ID,String(e).trim()):io.removeItem(io.USER_ID)}static setDescription(e){e?io.setItem(io.DESCRIPTION,String(e).trim()):io.removeItem(io.DESCRIPTION)}static setMetadata(e){e?io.setItem(io.METADATA,JSON.stringify(e)):io.removeItem(io.METADATA)}static getLocation(){return So.getCurrentPosition()}static trackOnce(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return $o.trackOnce(e)}finally{No.getConfig(e)}}static trackVerified(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xo.trackVerified(e)}static startTrackingVerified(e){return Xo.startTrackingVerified(e)}static stopTrackingVerified(){return Xo.stopTrackingVerified()}static getVerifiedLocationToken(){return Xo.getVerifiedLocationToken()}static setExpectedJurisdiction(e,t){Xo.setExpectedJurisdiction(e,t)}static getContext(e){return Ao.getContext(e)}static setTripOptions(e){Fo.setTripOptions(e)}static clearTripOptions(){Fo.clearTripOptions()}static getTripOptions(){return Fo.getTripOptions()}static startTrip(e){return Fo.startTrip(e)}static updateTrip(e){return Fo.updateTrip(e)}static completeTrip(){return Fo.completeTrip()}static cancelTrip(){return Fo.cancelTrip()}static logConversion(e){return Lo.logConversion(e)}static onTokenUpdated(e){Xo.onTokenUpdated(e)}static forwardGeocode(e){return Do.forwardGeocode(e)}static reverseGeocode(e){return Do.reverseGeocode(e)}static ipGeocode(){return Do.ipGeocode()}static autocomplete(e){return Oo.autocomplete(e)}static searchGeofences(e){return Oo.searchGeofences(e)}static searchPlaces(e){return Oo.searchPlaces(e)}static validateAddress(e){return To.validateAddress(e)}static distance(e){return zo.distance(e)}static matrix(e){return zo.matrix(e)}};class Ko{constructor(e,t,r){this.type=e,this.feature=t,this.originalEvent=r}}class Yo{constructor(e,t){var r;this._sourceIds=[],this._layerIds=[],this.id=(null!==(r=t.id)&&void 0!==r?r:`feature-${Date.now()}`).toString(),(e.getFeatures()||[]).forEach((e=>{if(e.id===this.id)throw new Error(`RadarMapFeature: feature with id ${this.id} already exists.`)})),this.geometry=t.geometry,this.properties=t.properties||{},this._feature=t,this._map=e}remove(){this._layerIds.forEach((e=>{this._map.getLayer(e)&&this._map.removeLayer(e)})),this._sourceIds.forEach((e=>{this._map.getSource(e)&&this._map.removeSource(e)})),this._map._features=this._map._features.filter((e=>e.id!==this.id))}on(e,t){this._map.on(e,this.id,(r=>{t(new Ko(e,this,r))})),"click"===e&&(this._map.on("mouseenter",this.id,(()=>{this._map.getCanvas().style.cursor="pointer"})),this._map.on("mouseleave",this.id,(()=>{this._map.getCanvas().style.cursor=""})))}}const Qo=e=>{const t={};return Object.entries(e).forEach((e=>{let[r,n]=e;void 0!==n&&(t[r]=n)})),t},el=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.assign({},e);for(const n in t)t[n]instanceof Object&&!Array.isArray(t[n])&&n in e?r[n]=el(e[n],t[n]):Array.isArray(t[n])&&Array.isArray(e[n])?r[n]=e[n].concat(t[n]):r[n]=t[n];return r},tl={paint:{"line-cap":"round","line-color":"#000257","line-width":4,"border-color":"#FFFFFF","border-width":2}};class rl extends Yo{constructor(e,t,r){super(e,t);const n=this.id,i=el(tl,r),a=()=>
2{if(i.paint=i.paint||{},e.addSource(n,{type:"geojson",data:t}),this._sourceIds.push(n),i.paint["line-width"]&&i.paint["border-width"]){const t=`${n}-border`,r=i.paint["line-width"]+i.paint["border-width"];e.addLayer({id:t,source:n,type:"line",layout:{"line-cap":i.paint["line-cap"]},paint:Qo({"line-color":i.paint["border-color"],"line-opacity":i.paint["border-opacity"],"line-width":r})}),this._layerIds.push(t)}e.addLayer({id:n,source:n,type:"line",layout:{"line-cap":i.paint["line-cap"]},paint:Qo({"line-color":i.paint["line-color"],"line-width":i.paint["line-width"],"line-opacity":i.paint["line-opacity"],"line-offset":i.paint["line-offset"],"line-blur":i.paint["line-blur"],"line-dasharray":i.paint["line-dasharray"],"line-gap-width":i.paint["line-gap-width"],"line-gradient":i.paint["line-gradient"]})}),this._layerIds.push(n)};return e.loaded()?a():e.once("data",(()=>{a()})),this}static fromPolyline(e,t,r){const n=(null===r||void 0===r?void 0:r.id)||`polyline-feature-${Date.now()}`,i=function(e){let t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=0,a=0,s=0,o=[],l=0,c=0,u=null,d=Math.pow(10,n||6);for(;i<e.length;){u=null,l=0,c=0;do{u=e.charCodeAt(i++)-63,c|=(31&u)<<l,l+=5}while(u>=32);t=1&c?~(c>>1):c>>1,l=c=0;do{u=e.charCodeAt(i++)-63,c|=(31&u)<<l,l+=5}while(u>=32);r=1&c?~(c>>1):c>>1,a+=t,s+=r,o.push([s/d,a/d])}return o}(t,null===r||void 0===r?void 0:r.precision),a={id:n,type:"Feature",geometry:{type:"LineString",coordinates:i},properties:(null===r||void 0===r?void 0:r.properties)||{}};return new rl(e,a,r)}}const nl={paint:{"fill-color":"#FF6F00","fill-opacity":.3,"border-color":"#FF6F00","border-opacity":1,"border-width":2}};class il extends Yo{constructor(e,t,r){super(e,t);const n=this.id,i=el(nl,r),a=()=>{if(i.paint=i.paint||{},e.addSource(n,{type:"geojson",data:t}),this._sourceIds.push(n),e.addLayer({id:n,source:n,type:"fill",layout:{},paint:Qo({"fill-color":i.paint["fill-color"],"fill-opacity":i.paint["fill-opacity"]})}),this._layerIds.push(n),i.paint["border-color"]&&i.paint["border-width"]&&i.paint["border-opacity"]){let t=`${n}-border`;e.addLayer({id:t,source:n,type:"line",layout:{},paint:Qo({"line-color":i.paint["border-color"],"line-opacity":i.paint["border-opacity"],"line-width":i.paint["border-width"]})}),this._layerIds.push(t)}};return e.loaded()?a():e.once("data",(()=>{a()})),this}}class al{onAdd(){const e=document.createElement("img");return e.src="https://api.radar.io/maps/static/images/logo.svg",e.alt="Radar Maps Platform",this.link=document.createElement("a"),this.link.id="radar-map-logo",this.link.href="https://radar.com?ref=powered_by_radar",this.link.target="_blank",this.link.appendChild(e),this.link}onRemove(){var e;null===(e=this.link)||void 0===e||e.remove()}}const sl=(e,t)=>{t.forEach((t=>{e.push(t)}))},ol=e=>{const t=[];return(e||[]).forEach((e=>{const r=(e=>{const t=[],r=e.geometry;switch(r.type){case"Point":t.push(r.coordinates);break;case"MultiPoint":case"LineString":sl(t,r.coordinates);break;case"MultiLineString":case"Polygon":r.coordinates.forEach((e=>sl(t,e)));break;case"MultiPolygon":r.coordinates.forEach((e=>{e.forEach((e=>sl(t,e)))}));break;default:return t}return t})(e);r.forEach((e=>{t.push(e)}))})),t},ll=["radar-default-v1","radar-light-v1","radar-dark-v1"],cl={showZoomControls:!0},ul={minZoom:1,maxZoom:20,attributionControl:!1,dragRotate:!1,touchPitch:!1,maplibreLogo:!1},dl={padding:50},hl=(e,t)=>{const r=t.style||"radar-default-v1";let n=`${e.host}/maps/styles/${r}`;return t.language&&(n+=`?language=${t.language}`),n},pl=e=>!!ll.includes(e)||!/^(http:|https:)/.test(e);class ml extends Qs.Map{constructor(e){const t=eo.get();t.publishableKey||no.warn("publishableKey not set. Call Radar.initialize() with key before creating a new map.");const r=((e,t)=>{const r=t.style;return!r||"string"===typeof r&&pl(r)?hl(e,t):t.style})(t,e),n=Object.assign({},cl,ul,e,{style:r});no.debug(`initialize map with options: ${JSON.stringify(n)}`),n.transformRequest=(e,r)=>{"Style"===r&&pl(e)&&(e=hl(t,Object.assign(Object.assign({},n),{style:e})));let i={Authorization:t.publishableKey,"X-Radar-Device-Type":"Web","X-Radar-SDK-Version":ko};return"function"===typeof t.getRequestHeaders&&(i=Object.assign(i,t.getRequestHeaders())),{url:e,headers:i}},super(n),this._markers=[],this._features=[];const i=this.getContainer();i.style.width||i.style.height||no.warn('map container does not have a set "width" or "height"');const a=new al;this.addControl(a,"bottom-left");const s=new Qs.AttributionControl({compact:!1});this.addControl(s,"bottom-right");const o=new Qs.NavigationControl({showCompass:!1,showZoom:n.showZoomControls});this.addControl(o,"bottom-right");const l=()=>{const e=document.querySelector(".maplibregl-ctrl-attrib");
2if(e){this.getContainer().clientWidth<380?e.classList.add("hidden"):e.classList.remove("hidden")}};this.on("resize",l),this.on("load",l)}addMarker(e){this._markers.push(e)}removeMarker(e){this._markers=this._markers.filter((t=>t!==e))}getMarkers(){return this._markers}fitToMarkers(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(arguments.length>1?arguments[1]:void 0)||this.getMarkers();if(0===t.length)return;const r=new Qs.LngLatBounds;t.forEach((e=>{r.extend(e.getLngLat())}));const n=Object.assign(dl,e);this.fitBounds(r,n)}clearMarkers(){this._markers.forEach((e=>{e.remove()}))}getFeatures(){return this._features}fitToFeatures(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=((arguments.length>1?arguments[1]:void 0)||this._features).map((e=>e._feature)),r=ol(t);if(r.length>0){const t=new Qs.LngLatBounds;r.forEach((e=>{t.extend(e)})),this.fitBounds(t,e)}}clearFeatures(){this._features.forEach((e=>{e.remove()}))}addPolygon(e,t){const r=new il(this,e,t);return this._features.push(r),r}addLine(e,t){const r=new rl(this,e,t);return this._features.push(r),r}addPolyline(e,t){const r=rl.fromPolyline(this,e,t);return this._features.push(r),r}}class fl{constructor(e,t,r){this.target=t,this.originalEvent=r,this.point=t._pos,this.lngLat=t.getLngLat(),this.type=e}}const gl=new Map,_l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;return new Promise(((r,n)=>{if(!gl.has(e))return gl.set(e,"pending"),n("miss");const i=Date.now(),a=setInterval((()=>{const s=gl.get(e);"pending"===s?Date.now()-i>t&&(clearInterval(a),n("timed out")):"failed"===s?(clearInterval(a),n("failed")):void 0!==s&&(clearInterval(a),r(s))}),100)}))},yl={color:"#000257"};class vl extends Qs.Marker{constructor(e){const t=Object.assign({},yl);if(e.color&&(t.color=e.color),e.element&&(t.element=e.element),e.scale&&(t.scale=e.scale),super(t),e.marker||e.url){const t=this._element.cloneNode(!0);this._element.childNodes.forEach((e=>{e.remove()}));const r=t=>{this._element.replaceChildren((e=>{const t=document.createElement("img");return t.src=e.url,e.width&&("number"===typeof e.width?t.width=e.width:t.style.width=e.width),e.height&&("number"===typeof e.height?t.height=e.height:t.style.height=e.height),e.width||e.height||(t.style.maxWidth="64px",t.style.maxHeight="64px",t.style.width="100%",t.style.height="100%"),t})({width:e.width,height:e.height,url:t}))},n=r=>{no.error(`Could not load marker: ${r.message} - falling back to default marker`),gl.set(e.url,"failed"),this._element.replaceChildren(...Array.from(t.childNodes))};if(e.url){const t=()=>{fetch(e.url).then((t=>{200===t.status?t.blob().then((t=>{const n=URL.createObjectURL(t);gl.set(e.url,n),r(n)})).catch(n):n(new Error(t.statusText))})).catch(n)};_l(e.url).then(r).catch((r=>{"miss"!==r&&no.debug(`RadarMarker: cache lookup for ${e.url}: ${r}`),t()}))}if(e.marker){const t=()=>{Eo.request({method:"GET",version:"maps",path:`markers/${e.marker}`,responseType:"blob"}).then((t=>{let{data:n}=t;const i=URL.createObjectURL(n);gl.set(e.marker,i),r(i)})).catch(n)};_l(e.marker).then(r).catch((r=>{"miss"!==r&&no.debug(`RadarMarker: cache lookup for ${e.marker} ${r}`),t()}))}}if(e.text&&(no.warn('marker option "text" is deprecated, and will be removed in a future version. Use "popup.text".'),e.popup=e.popup||{},e.popup.text=e.text),e.html&&(no.warn('marker option "html" is deprecated, and will be removed in a future version. Use "popup.html".'),e.popup=e.popup||{},e.popup.html=e.html),e.popup){const t=new Qs.Popup(e.popup);e.popup.text&&t.setText(e.popup.text),e.popup.html&&t.setHTML(e.popup.html),e.popup.element&&t.setDOMContent(e.popup.element),this.setPopup(t)}const r=this.getElement();r&&r.addEventListener("click",(e=>{e.stopPropagation(),this.getPopup()&&((this._map.getMarkers()||[]).forEach((e=>{var t;(null===(t=e.getPopup())||void 0===t?void 0:t.isOpen())&&e.togglePopup()})),this.togglePopup()),this.fire("click",new fl("click",this,e))}))}addTo(e){return e.addMarker(this),super.addTo(e)}remove(){return this._map&&this._map.removeMarker(this),super.remove()}}class xl extends Qs.Popup{constructor(e){super(e),e.text&&this.setText(e.text),e.html&&this.setHTML(e.html),e.element&&this.setDOMContent(e.element)}}class bl{static getMapLibre(){return Qs}static createMap(e){return new ml(e)}static createMarker(){return new vl(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}static createPopup(e){return new xl(e)}}const wl="radar-autocomplete-wrapper",Cl="radar-autocomplete-input",Sl="radar-autocomplete-search-icon",kl="radar-autocomplete-results-list",jl="radar-autocomplete-results-item",El="radar-autocomplete-results-marker",Tl="radar-autocomplete-results-item-selected",Pl="radar-powered",Il="radar-no-results",Ml={container:"autocomplete",debounceMS:200,minCharacters:3,limit:8,placeholder:"Search address",responsive:!0,disabled:!1,showMarkers:!0,hideResultsOnBlur:!0},Nl=e=>"number"===typeof e?`${e}px`:e,Al=(e,t)=>
2{if(t.responsive)return e.style.width="100%",void(t.width&&(e.style.maxWidth=Nl(t.width)));e.style.width=Nl(t.width||400),e.style.removeProperty("max-width")},Ll=(e,t)=>{t.maxHeight&&(e.style.maxHeight=Nl(t.maxHeight),e.style.overflowY="auto")},Dl=function(){return`data:image/svg+xml;charset=utf-8,${`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.5704 6.57036C12.5704 4.11632 10.6342 2.11257 8.21016 2C8.14262 2 8.06757 2 8.00003 2C7.93249 2 7.85744 2 7.7899 2C5.35838 2.11257 3.42967 4.11632 3.42967 6.57036C3.42967 6.60037 3.42967 6.6379 3.42967 6.66792C3.42967 6.69794 3.42967 6.73546 3.42967 6.76548C3.42967 9.46717 7.09196 13.3621 7.4672 13.7598C7.61729 13.9174 7.84994 14 8.00003 14C8.15012 14 8.38277 13.9174 8.53286 13.7598C8.9156 13.3621 12.5704 9.46717 12.5704 6.76548C12.5704 6.72795 12.5704 6.69794 12.5704 6.66792C12.5704 6.6379 12.5704 6.60037 12.5704 6.57036ZM7.99252 8.28893C7.04693 8.28893 6.27395 7.52345 6.27395 6.57036C6.27395 5.61726 7.03943 4.85178 7.99252 4.85178C8.94562 4.85178 9.7111 5.61726 9.7111 6.57036C9.7111 7.52345 8.94562 8.28893 7.99252 8.28893Z" fill="${(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#ACBDC8").replace("#","%23")}"/>\n </svg>`.trim()}`};class zl{static createAutocomplete(e){return new zl(e)}constructor(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.config=Object.assign({},Ml,t),this.isOpen=!1,this.debouncedFetchResults=this.debounce(this.fetchResults,this.config.debounceMS),this.results=[],this.highlightedIndex=-1,void 0!==this.config.threshold&&(this.config.minCharacters=this.config.threshold,no.warn('AutocompleteUI option "threshold" is deprecated, use "minCharacters" instead.')),t.near&&("string"===typeof t.near?this.near=t.near:this.near=`${t.near.latitude},${t.near.longitude}`),e="string"===typeof this.config.container?document.getElementById(this.config.container):this.config.container,!e)throw new bo(`Could not find container element: ${this.config.container}`);if(this.container=e,this.wrapper=document.createElement("div"),this.wrapper.classList.add(wl),this.wrapper.style.display=this.config.responsive?"block":"inline-block",Al(this.wrapper,this.config),this.resultsList=document.createElement("ul"),this.resultsList.classList.add(kl),this.resultsList.setAttribute("id",kl),this.resultsList.setAttribute("role","listbox"),this.resultsList.setAttribute("aria-live","polite"),this.resultsList.setAttribute("aria-label","Search results"),Ll(this.resultsList,this.config),"INPUT"===e.nodeName)this.inputField=e,this.wrapper.appendChild(this.resultsList),e.parentNode.appendChild(this.wrapper);else{this.inputField=document.createElement("input"),this.inputField.classList.add(Cl),this.inputField.placeholder=this.config.placeholder,this.inputField.type="text",this.inputField.disabled=this.config.disabled;const e=document.createElement("div");e.classList.add(Sl),this.wrapper.appendChild(this.inputField),this.wrapper.appendChild(this.resultsList),this.wrapper.appendChild(e),this.container.appendChild(this.wrapper)}this.inputField.setAttribute("autocomplete","off"),this.inputField.setAttribute("role","combobox"),this.inputField.setAttribute("aria-controls",kl),this.inputField.setAttribute("aria-expanded","false"),this.inputField.setAttribute("aria-haspopup","listbox"),this.inputField.setAttribute("aria-autocomplete","list"),this.inputField.setAttribute("aria-activedescendant",""),this.inputField.addEventListener("input",this.handleInput.bind(this)),this.inputField.addEventListener("keydown",this.handleKeyboardNavigation.bind(this)),this.config.hideResultsOnBlur&&this.inputField.addEventListener("blur",this.close.bind(this),!0),no.debug(`AutocompleteUI iniailized with options: ${JSON.stringify(this.config)}`)}handleInput(){const e=this.inputField.value;e.length<this.config.minCharacters||this.debouncedFetchResults(e).then((e=>{const t=this.config.onResults;t&&t(e),this.displayResults(e)})).catch((e=>{no.warn(`Autocomplete ui error: ${e.message}`);const t=this.config.onError;t&&t(e)}))}debounce(e,t){var r=this;let n,i,a;return function(){for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];return clearTimeout(n),n=setTimeout((()=>{const t=e.apply(r,o);t instanceof Promise&&t.then((e=>{i&&i(e)})).catch((e=>{a&&a(e)}))}),t),new Promise(((e,t)=>{i=e,a=t}))}}fetchResults(e){return ao(this,void 0,void 0,(function*(){const{limit:t,layers:r,countryCode:n,expandUnits:i,mailable:a,onRequest:s}=this.config,o={query:e,limit:t,layers:r,countryCode:n,expandUnits:i,mailable:a};this.near&&(o.near=this.near),s&&s(o);const{addresses:l}=yield Oo.autocomplete(o,"autocomplete-ui");return l}))}displayResults(e){let t;if(this.clearResultsList(),this.results=e,this.config.showMarkers&&(t=document.createElement("img"),t.classList.add(El),t.setAttribute("src",Dl(this.config.markerColor))),e.forEach(((e,r)=>{const n=document.createElement("li");let i;if(n.classList.add(jl),n.setAttribute("role","option"),n.setAttribute("id",`${jl}}-${r}`),e.formattedAddress.includes(e.addressLabel)&&"postalCode"!==e.layer){const t=new RegExp(`(${e.addressLabel}),?`);i=e.formattedAddress.replace(t,"<b>$1</b>")}else{i=`<b>${e.placeLabel||e.addressLabel}</b> ${e.formattedAddress}`}n.innerHTML=i,t&&n.prepend(t.cloneNode()),n.addEventListener("mousedown",(()=>{this.select(r)})),this.resultsList.appendChild(n)})),this.open(),e.length>0){const e=document.createElement("a");e.href="https://radar.com?ref=powered_by_radar",e.target="_blank",this.poweredByLink=e;const t=document.createElement("span");t.textContent="Powered by",e.appendChild(t);const r=document.createElement("span");r.id="radar-powered-logo",r.textContent="Radar",e.appendChild(r);const n=document.createElement("div");n.classList.add(Pl),n.appendChild(e),this.resultsList.appendChild(n)}else{const e=document.createElement("div");e.classList.add(Il),e.textContent="No results",this.resultsList.appendChild(e)}}open(){this.isOpen||(this.inputField.setAttribute("aria-expanded","true"),this.resultsList.removeAttribute("hidden"),this.isOpen=!0)}close(e){if(!this.isOpen)return;const t=e&&e.relatedTarget===this.poweredByLink;setTimeout((()=>
2{this.inputField.setAttribute("aria-expanded","false"),this.inputField.setAttribute("aria-activedescendant",""),this.resultsList.setAttribute("hidden",""),this.highlightedIndex=-1,this.isOpen=!1,this.clearResultsList()}),t?100:0)}goTo(e){if(!this.isOpen||!this.results.length)return;e<0?e=this.results.length-1:e>=this.results.length&&(e=0);const t=this.resultsList.getElementsByTagName("li");this.highlightedIndex>-1&&t[this.highlightedIndex].classList.remove(Tl),t[e].classList.add(Tl),this.inputField.setAttribute("aria-activedescendant",`${jl}-${e}`),this.highlightedIndex=e}handleKeyboardNavigation(e){let t=e.key;if(this.isOpen)switch("Tab"===t&&e.shiftKey&&(t="ArrowUp"),t){case"Tab":case"ArrowDown":e.preventDefault(),this.goTo(this.highlightedIndex+1);break;case"ArrowUp":e.preventDefault(),this.goTo(this.highlightedIndex-1);break;case"Enter":this.select(this.highlightedIndex);break;case"Esc":this.close()}}select(e){const t=this.results[e];if(!t)return void no.warn(`No autocomplete result found at index: ${e}`);let r;if(t.formattedAddress.includes(t.addressLabel))r=t.formattedAddress;else{r=`${t.placeLabel||t.addressLabel}, ${t.formattedAddress}`}this.inputField.value=r;const n=this.config.onSelection;n&&n(t),this.close()}clearResultsList(){this.resultsList.innerHTML="",this.results=[]}remove(){no.debug("AutocompleteUI removed."),this.inputField.remove(),this.resultsList.remove(),this.wrapper.remove()}setNear(e){return this.near=void 0===e||null===e?void 0:"string"===typeof e?e:`${e.latitude},${e.longitude}`,this}setPlaceholder(e){return this.config.placeholder=e,this.inputField.placeholder=e,this}setDisabled(e){return this.config.disabled=e,this.inputField.disabled=e,this}setResponsive(e){return this.config.responsive=e,Al(this.wrapper,this.config),this}setWidth(e){return this.config.width=e,Al(this.wrapper,this.config),this}setMaxHeight(e){return this.config.maxHeight=e,Ll(this.resultsList,this.config),this}setMinCharacters(e){return this.config.minCharacters=e,this.config.threshold=e,this}setLimit(e){return this.config.limit=e,this}setShowMarkers(e){if(this.config.showMarkers=e,e){const e=document.createElement("img");e.classList.add(El),e.setAttribute("src",Dl(this.config.markerColor));const t=this.resultsList.getElementsByTagName("li");for(let r=0;r<t.length;r++){t[r].getElementsByClassName(El)[0]||t[r].prepend(e.cloneNode())}}else{const e=this.resultsList.getElementsByTagName("li");for(let t=0;t<e.length;t++){const r=e[t].getElementsByClassName(El)[0];r&&r.remove()}}return this}setMarkerColor(e){this.config.markerColor=e;const t=this.resultsList.getElementsByClassName(El);for(let r=0;r<t.length;r++)t[r].setAttribute("src",Dl(e));return this}setHideResultsOnBlur(e){return this.config.hideResultsOnBlur=e,e?this.inputField.addEventListener("blur",this.close.bind(this),!0):this.inputField.removeEventListener("blur",this.close.bind(this),!0),this}}class Ol extends Jo{static get ui(){return{maplibregl:bl.getMapLibre(),map:bl.createMap,marker:bl.createMarker,popup:bl.createPopup,autocomplete:zl.createAutocomplete}}}var Rl={form_input_container:"PickupPannel_form_input_container__P5nPp",no_location_found:"PickupPannel_no_location_found__SQNJF",no_location_found_text:"PickupPannel_no_location_found_text__gzMSk",location_container:"PickupPannel_location_container__AdFRr",location_container_counter:"PickupPannel_location_container_counter__SaiFE",current_location:"PickupPannel_current_location__hHUUO",info:"PickupPannel_info__+qgXT",curbisde_pannel:"PickupPannel_curbisde_pannel__3ndSL",curbside:"PickupPannel_curbside__EaURi",current_location_address:"PickupPannel_current_location_address__-TWrs",results:"PickupPannel_results__TC-3q",result_item:"PickupPannel_result_item__AQ2+b",helper:"PickupPannel_helper__GVEIa",link_container:"PickupPannel_link_container__+mZCQ",helper_footer:"PickupPannel_helper_footer__zWH1b",loader_container:"PickupPannel_loader_container__pdHi4",btn_clear:"PickupPannel_btn_clear__XwIAf"};var Fl=()=>(0,Dr.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M27.9184 4.09862C22.4554 -1.361 13.5709 -1.361 8.10793 4.09862C3.01437 9.20852 2.68387 17.3105 7.13587 22.7896L0.428703 29.5121C-0.135088 30.0756 -0.135088 30.9887 0.428703 31.5716C0.720319 31.8436 1.0897 31.999 1.45908 31.999C1.82846 31.999 2.21728 31.8436 2.48946 31.5716L9.19663 24.8491C11.7628 26.9474 14.8929 27.9772 18.0229 27.9772C21.6 27.9772 25.1772 26.6171 27.9184 23.8776C33.3813 18.4374 33.3813 9.55825 27.9184 4.09862ZM25.8576 21.8181C23.758 23.9165 20.9779 25.0628 18.0229 25.0628C15.0678 25.0628 12.2683 23.9165 10.1687 21.8181C8.08848 19.7392 6.92202 16.9608 6.92202 13.9881C6.92202 11.0154 8.08848 8.25649 10.1687 6.15813C12.2683 4.05977 15.0484 2.91344 18.0229 2.91344C20.9974 2.91344 23.758 4.05977 25.8576 6.15813C27.9378 8.25649 29.1043 11.0349 29.1043 13.9881C29.1043 16.9414 27.9378 19.7392 25.8576 21.8181Z",fill:"white"})});var Bl=t=>{let{selectedResult:r,loading:n,setError:i,setValue:a,setAddressDetail
2s:s,inputError:o,label:l}=t;const c=(0,e.useRef)(null),[u,d]=(0,e.useState)(null);return(0,e.useEffect)((()=>{Ol.initialize("prj_live_pk_0db2330639bf866045f9e6d6752f1481ccf14f10",{}),c&&Ol.ui.autocomplete({container:"radar_autocomplete",countryCode:"US",style:{position:"absolute",backgroundColor:"red"},onSelection:e=>{d(e);let t=!1,n=!1,o=!1,l=!1,c={postal_code:"",city:"",street_number:"",street:"",full_address:""};e.city&&(n=!0,c.city=e.city),e.postalCode&&(t=!0,c.postal_code=e.postalCode),e.number&&(o=!0,c.street_number=e.number),e.street&&(l=!0,c.street=e.street),t&&n&&o&&l?(i(null),a(e.formattedAddress),c.full_address=e.formattedAddress,s(c),r(e)):i("The address provided seems incomplete. Please ensure you enter your full address.")}})}),[]),(0,Dr.jsxs)("div",{className:"form-fields-container",children:[(0,Dr.jsx)("label",{className:"label label-caps",htmlFor:"searchAddress",children:l||"Enter an address"}),(0,Dr.jsxs)("div",{className:Rl.form_input_container,children:[(0,Dr.jsx)("input",{type:"text",id:"radar_autocomplete",ref:c,className:""+(o?"error":""),required:!0}),(0,Dr.jsxs)("button",{className:Rl.btn_simple,type:"button",onClick:()=>{r(u)},children:[n&&(0,Dr.jsx)("span",{className:"loader"}),!n&&(0,Dr.jsx)(Fl,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"Search location"})]})]})]})};var Vl=t=>{let{selectedDate:r,selectedTime:n,setShowDetails:i,setSearchedLoc:a}=t;const s=E(),o=y((e=>e.location.location)),[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)(""),[h,p]=(0,e.useState)(""),[m,f]=(0,e.useState)(!1),[g,_]=(0,e.useState)(!1),[v,x]=(0,e.useState)(null),[b,w]=(0,e.useState)(!1);let C=y((e=>e.location.order));const[S,k]=(0,e.useState)({hasErrors:!1,errorMessage:null}),[j,T]=(0,e.useState)(!0);(0,e.useEffect)((()=>{r&&n&&!S.disableButton?T(!1):T(!0)}),[r,n,S.disableButton]);return(0,e.useEffect)((()=>{"schedule"===C.type?null!==C.date&&null!==C.time?w(!1):w(!0):w(!1)}),[C]),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:`form-controller ${b&&"invalid"}`,children:(0,Dr.jsx)("div",{className:Zs,children:(0,Dr.jsx)(Bl,{selectedResult:async e=>{f(!0);const t=await ar({lat:e.latitude,lng:e.longitude},"pickup");if(t.message)s(qi.setError({message:"Delivery is not available. This address is outside the delivery area."})),i(!1),c(!0),x(null);else{t.find((e=>e.id===o.id))?i(!0):(i(!1),s(qi.setError({message:"Delivery is not available. This address is outside the delivery area."})),f(!1)),x(t),c(!1)}f(!1)},loading:m,foundLocations:e=>{x(e)},inputError:S.hasErrors,setError:e=>{k(e?{hasErrors:!0,errorMessage:e,disableButton:!0}:{hasErrors:!1,errorMessage:null,disableButton:!1})},setValue:e=>{d(e)},setAddressDetails:e=>{a(e)}})})}),S.hasErrors&&(0,Dr.jsx)("div",{className:"error-message",children:S.errorMessage})]})};var $l=t=>{let{showAddress:r}=t;const n=E(),i=y((e=>e.cart.cart)),[a,s]=(0,e.useState)(""),[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(!1),[d,h]=(0,e.useState)(null),[p,m]=(0,e.useState)(null),[f,g]=(0,e.useState)(!1),[_,v]=(0,e.useState)(!1);(0,e.useEffect)((()=>{i&&"dispatch"===i.deliverymode&&(v(!0),s(i.deliveryaddress)),r&&(v(!1),l(!1))}),[r]);const x=async()=>{l(!0);const e={delivery_mode:"delivery",time:c?"schedule":"asap",schedule_date:c?d:null,schedule_time:c?p:null};e.zip_code=i.deliveryaddress.zipcode,e.street_address=i.deliveryaddress.streetaddress,e.city=i.deliveryaddress.city,e.phone_number=i.deliveryaddress.phonenumber,e.special_instructions=i.deliveryaddress.specialinstructions,e.building=i.deliveryaddress.building;const t=await _r(i.id,e);t.id?(Mr("currentCart",t),n(vs.addCart(t)),l(!1),n(Vi.setChangeDelivery({close:!1,value:!0}))):n(qi.setError(t)),l(!1)};return(0,Dr.jsxs)(Dr.Fragment,{children:[!f&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("form",{className:`form-fields-container ${qs}`,children:[(0,Dr.jsx)(Xs,{setTimeMode:e=>{u(e)},setDateHandler:e=>{h(e)},setTimeHandler:e=>{m(e)}}),!_&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(Vl,{selectedDate:d,selectedTime:p,setShowDetails:e=>{g(e)},setSearchedLoc:e=>{s(e)}}),(0,Dr.jsxs)("div",{className:Gs,children:[(0,Dr.jsx)("svg",{width:"56",height:"70",viewBox:"0 0 56 70",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.7318 66.6626C-37.4594 14.3665 35 -22.4885 53.5914 15.8259C58.7506 29.3444 52.5063 43.6053 43.2411 53.6283C42.0958 55.0151 40.9265 56.3766 39.7599 57.7348C36.8405 61.134 33.9387 64.5127 31.4747 68.2157C30.5545 69.7334 28.6648 69.339 27.1765 69.0284C27.0296 68.9977 26.8866 68.9679 26.7488 68.9408C26.0301 68.2624 25.3506 67.4494 24.7318 66.6626ZM39.6164 27.5192L35.7429 26.7409L36.9215 30.347L39.6164 27.5192ZM30.8511 35.6135L33.6179 36.7862L34.8685 34.1918L32.1017 33.0192L30.8511 35.6135ZM25.3175 25.6253L26.4242 28.8682L29.8827 27.8305L28.776 24.5875L25.3175 25.6253ZM22.9546 31.4263L22.4012 35.1206L26.1198 33.7767L22.9546 31.4263ZM23.1704 21.1682L25.5001 17.4479L21.0676 17.5361L23.1704 21.1682ZM14.8755 28.4064L15.9822 31.6494L19.4407 30.6064L18.334 27.3687L14.8755 28.4064ZM44.3001 28.1396C44.4067 28.8054 44.4435 29.0354 43.8497 30.8659V30.9489C43.709 31.3808 43.769 31.8386 43.829 32.2957C43.8894 32.7557 43.9497 33.215 43.8054 33.647C43.6993 33.9587 43.526 34.2466 43.2963 34.4928H43.3682C41.7189 37.4523 39.1165 39.849 35.931 41.3419C35.1466 41.4487 34.3577 41.4947 33.5705 41.5405C32.4084 41.6082 31.25 41.6756 30.1151 41.9386C29.5885 42.0615 29.0577 42.2296 28.5229 42.399C27.8157 42.623 27.1014 42.8493 26.3799 42.9763C23.4715 42.6898 20.69 41.709 18.3008 40.1277C18.0864 39.4229 17.9
2638 38.6964 17.9356 37.964C17.9246 37.759 17.8457 37.5623 17.7098 37.4014C17.5739 37.2405 17.3878 37.1234 17.1775 37.0664C16.152 36.8318 15.16 36.4834 14.2225 36.0286C14.1335 35.9886 14.0382 35.9623 13.9403 35.9508C12.2883 33.6313 11.3064 30.9496 11.0905 28.1677C11.36 28.1681 11.6194 28.0714 11.815 27.8976C12.0107 27.7238 12.1277 27.4861 12.1419 27.2338C12.2748 24.5326 12.6094 21.8434 13.1434 19.1861C13.8938 17.9121 14.8245 16.7392 15.9103 15.6993C18.6328 13.0842 22.6669 10.8945 26.6732 11.2578C27.0955 11.2958 27.5383 11.3569 27.9916 11.4194C28.7143 11.5192 29.4636 11.6226 30.1981 11.6417C30.3977 11.6448 30.5179 11.5101 30.632 11.3823C30.711 11.2938 30.787 11.2087 30.8843 11.1747C31.2832 11.0624 31.7084 11.0624 32.1073 11.1747C33.1642 11.403 34.7136 11.7455 34.7579 12.5861C34.6712 12.7477 34.5531 12.932 34.4207 13.1387C33.826 14.0672 32.9415 15.4481 33.3081 17.2559C33.5681 18.5375 34.0994 19.9021 35.4551 20.1771C35.6875 20.2238 36.8275 21.0385 36.8994 21.7078C36.9324 22.0355 37.15 22.214 37.3837 22.4057C37.5423 22.5358 37.7083 22.6719 37.829 22.8649C38.2726 23.5204 38.9396 24.016 39.7216 24.271C40.4997 24.5189 41.3128 24.657 42.1342 24.6809C43.0694 24.738 43.6947 24.9663 44.0433 25.7187C44.1281 25.8925 44.1661 26.0831 44.154 26.2739C44.1599 27.2642 44.2408 27.7693 44.3001 28.1396Z",fill:"#8D0E57"})}),(0,Dr.jsx)("h4",{children:"Just Need Your Address"}),(0,Dr.jsx)("p",{children:"Let\u2019s see if you can get all your favorite sweet treats delivered straight to your door."})]})]})]}),_&&(0,Dr.jsx)("div",{className:Ws,children:p&&(0,Dr.jsxs)(Dr.Fragment,{children:[!o&&(0,Dr.jsx)("button",{className:"btn btn-transparent",onClick:x,children:"Confirm"}),o&&(0,Dr.jsx)("span",{className:"btn btn-transparent",onClick:x,children:(0,Dr.jsx)("span",{className:"loader dark"})})]})})]}),f&&(0,Dr.jsx)(Ys,{scheduled:c,selectedDate:d,selectedTime:p,searchedLocations:a})]})};var Ul=t=>{let{curbside:r}=t;const n=E();let i=y((e=>e.cart.vehicleInfo)),a=null===i||void 0===i?void 0:i.vehicleMake,s=null===i||void 0===i?void 0:i.vehicleModel,o=null===i||void 0===i?void 0:i.vehicleColor;const l=y((e=>e.cart.cart));var c,u,d;l&&"curbside"===l.deliverymode&&l.customfields&&(a=null===(c=l.customfields.find((e=>"Make"===e.label)))||void 0===c?void 0:c.value,s=null===(u=l.customfields.find((e=>"Model"===e.label)))||void 0===u?void 0:u.value,o=null===(d=l.customfields.find((e=>"Color"===e.label)))||void 0===d?void 0:d.value);const[h,p]=(0,e.useState)(!1),m=e=>{p(e.target.checked),r(e.target.checked)};(0,e.useEffect)((()=>{l&&"curbside"===l.deliverymode&&p(!0)}),[]);const f=e=>{n(vs.updateVehicleinfo({handle:e.target.name,value:e.target.value}))};return(0,Dr.jsxs)("div",{className:Rl.curbisde_pannel,children:[(0,Dr.jsxs)("div",{className:"form-container form-group-checkbox",children:[h&&(0,Dr.jsx)("input",{type:"checkbox",id:"changeToPickup",name:"changeToPickup",onChange:m,defaultChecked:!0}),!h&&(0,Dr.jsx)("input",{type:"checkbox",id:"changeToPickup",name:"changeToPickup",onChange:m,defaultChecked:!1}),(0,Dr.jsx)("label",{htmlFor:"changeToPickup",className:"label-regular-font",children:"Curbside Pickup"})]}),h&&(0,Dr.jsxs)("div",{className:`form-fields-container ${Rl.curbside}`,children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"vehicleMake",children:"Vehicle make"}),(0,Dr.jsx)("input",{id:"vehicleMake",defaultValue:a,name:"vehicleMake",type:"text",placeholder:"e.g. Chevrolet, Toyota",onChange:f})]}),(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller form-controller-1",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"vehicleModel",children:"Vehicle model"}),(0,Dr.jsx)("input",{id:"vehicleModel",defaultValue:s,name:"vehicleModel",type:"text",placeholder:"e.g. Silverado",onChange:f})]}),(0,Dr.jsxs)("div",{className:"form-controller form-controller-1",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"vehicleColor",children:"Vehicle color"}),(0,Dr.jsx)("input",{id:"vehicleColor",defaultValue:o,name:"vehicleColor",type:"text",placeholder:"e.g. Red, Blue",onCh
2ange:f})]})]})]})]})};var Hl=t=>{let{closeChangeSelector:r}=t;const n=E(),i=y((e=>e.location.location)),a=y((e=>e.cart.cart)),[s,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)({pickup:!0,delivery:!1}),h=()=>{n(Vi.setLocationsSideBarState()),r()},[p,m]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{a||(async()=>{o(!0);const e=await ur({restaurant_id:i.id});e.id?(Mr("currentCart",e),n(vs.addCart(e))):n(qi.setError(e)),o(!1)})(),a&&"curbside"===a.deliverymode&&c(!0),a&&"dispatch"===a.deliverymode&&d({pickup:!1,delivery:!0})}),[]),(0,Dr.jsxs)(Dr.Fragment,{children:[!s&&(0,Dr.jsx)("div",{className:os.change_selections_container,children:a&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:os.change_selections_header,children:[(0,Dr.jsx)(Ps,{}),!a&&(0,Dr.jsxs)("span",{children:[(0,Dr.jsxs)("div",{className:os.change_selections_title,children:[(0,Dr.jsx)("span",{className:os.highlight,children:"Pickup from:"})," ",i.name.replace("Great American Cookies ","")]}),(0,Dr.jsxs)("div",{children:[i.address.street,", ",i.address.city,", ",i.address.state," ",i.address.zip," "]})]}),a&&(0,Dr.jsxs)(Dr.Fragment,{children:["pickup"===a.deliverymode&&(0,Dr.jsxs)("span",{children:[(0,Dr.jsxs)("div",{className:os.change_selections_title,children:[(0,Dr.jsx)("span",{className:os.highlight,children:"Pickup from:"})," ",i.name.replace("Great American Cookies ","")]}),(0,Dr.jsxs)("div",{children:[i.address.street,", ",i.address.city,", ",i.address.state," ",i.address.zip," "]}),(0,Dr.jsx)("div",{className:os.change_selections_button_container,children:(0,Dr.jsxs)("button",{className:`btn-underline btn-flex-5 ${os.btn_svg_18} ${os.switch_button}`,onClick:h,children:["Switch Pickup Location ",(0,Dr.jsx)(Vs,{})]})})]}),"curbside"===a.deliverymode&&(0,Dr.jsxs)("span",{children:[(0,Dr.jsxs)("div",{className:os.change_selections_title,children:[(0,Dr.jsx)("span",{className:os.highlight,children:"Curbside Pickup from:"})," ",i.name.replace("Great American Cookies ","")]}),(0,Dr.jsxs)("div",{children:[i.address.street,", ",i.address.city,", ",i.address.state," ",i.address.zip," "]}),(0,Dr.jsx)("div",{className:os.change_selections_button_container,children:(0,Dr.jsxs)("button",{className:`btn-underline btn-flex-5 ${os.btn_svg_18} ${os.switch_button}`,onClick:h,children:["Switch Curbside Location ",(0,Dr.jsx)(Vs,{})]})})]}),"dispatch"===a.deliverymode&&(0,Dr.jsxs)("span",{children:[(0,Dr.jsxs)("div",{className:os.change_selections_title,children:[(0,Dr.jsx)("span",{className:os.highlight,children:"Delivery to:"})," "]}),(0,Dr.jsxs)("div",{children:[a.deliveryaddress.streetaddress,", ",a.deliveryaddress.city,", ",a.deliveryaddress.zipcode," "]}),(0,Dr.jsx)("div",{className:os.change_selections_button_container,children:(0,Dr.jsxs)("button",{className:`btn-underline btn-flex-5 ${os.btn_svg_18} ${os.switch_button}`,onClick:()=>{m((e=>!e))},children:["Change Delivery Address ",(0,Dr.jsx)(Vs,{})]})})]})]})]}),i&&(0,Dr.jsxs)("div",{className:os.change_selections_body,children:[(0,Dr.jsxs)("div",{className:os.change_selections_main_controls,children:[i.services.pickup&&(0,Dr.jsxs)("button",{className:"btn "+(u.pickup?"":"btn-border"),onClick:()=>{d({pickup:!0,delivery:!1})},children:[(0,Dr.jsx)(Is,{}),(0,Dr.jsx)("span",{children:"Pickup"})]}),i.services.dispatch&&(0,Dr.jsxs)("button",{className:"btn "+(u.delivery?"":"btn-border"),onClick:()=>{d({pickup:!1,delivery:!0})},children:[(0,Dr.jsx)(Es,{}),(0,Dr.jsx)("span",{children:"Delivery"})]})]}),u.pickup&&(0,Dr.jsxs)("form",{children:[i.services.curbside&&(0,Dr.jsx)(Ul,{curbside:e=>{c(e)}}),(0,Dr.jsx)("div",{className:` ${os.change_selections_date_controls}`,children:(0,Dr.jsx)(Hs,{isCurbside:l})})]}),u.delivery&&(0,Dr.jsx)($l,{showAddress:p})]})]})}),s&&(0,Dr.jsx)("div",{className:os.change_selections_container,children:(0,Dr.jsx)("div",{className:os.loader_container,children:(0,Dr.jsx)("span",{className:"loader dark"})})})]})};function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}
vendor: 4,227 bytes, line 2
2).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ql.apply(null,arguments)}function Zl(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}function Gl(e,t){return Gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gl(e,t)}function Wl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Gl(e,t)}function Xl(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Jl=!1,Kl=e.createContext(null),Yl=function(e){return e.scrollTop},Ql="unmounted",ec="exited",tc="entering",rc="entered",nc="exiting",ic=function(t){function r(e,r){var n;n=t.call(this,e,r)||this;var i,a=r&&!r.isMounting?e.enter:e.appear;return n.appearStatus=null,e.in?a?(i=ec,n.appearStatus=tc):i=rc:i=e.unmountOnExit||e.mountOnEnter?Ql:ec,n.state={status:i},n.nextCallback=null,n}Wl(r,t),r.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Ql?{status:ec}:null};var n=r.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==tc&&r!==rc&&(t=tc):r!==tc&&r!==rc||(t=nc)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!==typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===tc){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:s.findDOMNode(this);r&&Yl(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ec&&this.setState({status:Ql})},n.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,i=this.props.nodeRef?[n]:[s.findDOMNode(this),n],a=i[0],o=i[1],l=this.getTimeouts(),c=n?l.appear:l.enter;!e&&!r||Jl?this.safeSetState({status:rc},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:tc},(function(){t.props.onEntering(a,o),t.onTransitionEnd(c,(function(){t.safeSetState({status:rc},(function(){t.props.onEntered(a,o)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:s.findDOMNode(this);t&&!Jl?(this.props.onExit(n),this.safeSetState({status:nc},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:ec},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:ec},(function(){e.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:s.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if(t===Ql)return null;var r=this.props,n=r.children,i=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,Zl(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return e.createElement(Kl.Provider,{value:null},"function"===typeof n?n(t,i):e.cloneElement(e.Children.only(n),i))},r}(e.Component);function ac(){}ic.contextType=Kl,ic.propTypes={},ic.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter
2:!0,exit:!0,onEnter:ac,onEntering:ac,onEntered:ac,onExit:ac,onExiting:ac,onExited:ac},ic.UNMOUNTED=Ql,ic.EXITED=ec,ic.ENTERING=tc,ic.ENTERED=rc,ic.EXITING=nc;var sc=ic,oc=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"===typeof r.className?r.className=Xl(r.className,n):r.setAttribute("class",Xl(r.className&&r.className.baseVal||"",n)));var r,n}))},lc=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(t,r){var n=e.resolveArguments(t,r),i=n[0],a=n[1];e.removeClasses(i,"exit"),e.addClass(i,a?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(t,r)},e.onEntering=function(t,r){var n=e.resolveArguments(t,r),i=n[0],a=n[1]?"appear":"enter";e.addClass(i,a,"active"),e.props.onEntering&&e.props.onEntering(t,r)},e.onEntered=function(t,r){var n=e.resolveArguments(t,r),i=n[0],a=n[1]?"appear":"enter";e.removeClasses(i,a),e.addClass(i,a,"done"),e.props.onEntered&&e.props.onEntered(t,r)},e.onExit=function(t){var r=e.resolveArguments(t)[0];e.removeClasses(r,"appear"),e.removeClasses(r,"enter"),e.addClass(r,"exit","base"),e.props.onExit&&e.props.onExit(t)},e.onExiting=function(t){var r=e.resolveArguments(t)[0];e.addClass(r,"exit","active"),e.props.onExiting&&e.props.onExiting(t)},e.onExited=function(t){var r=e.resolveArguments(t)[0];e.removeClasses(r,"exit"),e.addClass(r,"exit","done"),e.props.onExited&&e.props.onExited(t)},e.resolveArguments=function(t,r){return e.props.nodeRef?[e.props.nodeRef.current,t]:[t,r]},e.getClassNames=function(t){var r=e.props.classNames,n="string"===typeof r,i=n?""+(n&&r?r+"-":"")+t:r[t];return{baseClassName:i,activeClassName:n?i+"-active":r[t+"Active"],doneClassName:n?i+"-done":r[t+"Done"]}},e}Wl(r,t);var n=r.prototype;return n.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&i&&(n+=" "+i),"active"===r&&e&&Yl(e),n&&(this.appliedClasses[t][r]=n,function(e,t){e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"===typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))}(e,n))},n.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,i=r.active,a=r.done;this.appliedClasses[t]={},n&&oc(e,n),i&&oc(e,i),a&&oc(e,a)},n.render=function(){var t=this.props,r=(t.classNames,Zl(t,["classNames"]));return e.createElement(sc,ql({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},r}(e.Component);lc.defaultProps={classNames:""},lc.propTypes={};var cc=lc;var uc=()=>{const t=y((e=>e.location.changeDeliveryModal)),r=(0,e.useRef)(null),n=E(),i=y((e=>e.location.location)),a=y((e=>e.cart.cart)),o=()=>{n(Vi.setChangeDelivery({close:!0,value:!1}))};return(0,Dr.jsxs)("div",{className:`${os.control_box} ${os.control_box_location_container}`,children:[(0,Dr.jsxs)("div",{className:os.control_box_icon,children:[a&&(0,Dr.jsxs)(Dr.Fragment,{children:["pickup"===a.deliverymode&&(0,Dr.jsx)(js,{}),"curbside"===a.deliverymode&&(0,Dr.jsx)(Ts,{}),"dispatch"===a.deliverymode&&(0,Dr.jsx)(Es,{})]}),!a&&(0,Dr.jsx)(js,{})]}),(0,Dr.jsx)("div",{className:os.text_block,children:(0,Dr.jsxs)("button",{onClick:()=>{n(Vi.setChangeDelivery({close:!1,value:!0}))},title:"Change Selection",children:[a&&(0,Dr.jsxs)(Dr.Fragment,{children:["pickup"===a.deliverymode&&"advance"!==a.timemode&&(0,Dr.jsx)("span",{children:i&&(0,Dr.jsxs)(Dr.Fragment,{children:[i.status.open&&(0,Dr.jsx)(Dr.Fragment,{children:a.deliverymode+" asap from"}),!i.status.open&&i.hours&&i.hours.business&&i.hours.business[Gi()]&&(0,Dr.jsxs)(Dr.Fragment,{children:[a.deliverymode+" open at ",new Date(i.hours.business[Gi()].start).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})]})]})}),"pickup"===a.deliverymode&&"advance"===a.timemode&&(0,Dr.jsx)("span",{children:i&&(0,Dr.jsxs)(Dr.Fragment,{children:[a.deliverymode+" on ",a.timewanted&&(0,Dr.jsx)(Dr.Fragment,{children:Xi(a.timewanted,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",hour12:!0,minute:"2-digit"})}
2),!a.timewanted&&(0,Dr.jsx)(Dr.Fragment,{children:Xi(a.earliestreadytime,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",hour12:!0,minute:"2-digit"})})]})}),"curbside"===a.deliverymode&&"advance"!==a.timemode&&(0,Dr.jsx)("span",{children:i&&(0,Dr.jsxs)(Dr.Fragment,{children:[i.status.open&&(0,Dr.jsx)(Dr.Fragment,{children:"Curbside asap from"}),!i.status.open&&i.hours&&i.hours.business&&i.hours.business[Gi()]&&(0,Dr.jsxs)(Dr.Fragment,{children:[a.deliverymode+" open at ",new Date(i.hours.business[Gi()].start).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})]})]})}),"curbside"===a.deliverymode&&"advance"===a.timemode&&(0,Dr.jsx)("span",{children:i&&(0,Dr.jsxs)(Dr.Fragment,{children:[a.deliverymode+" on ",a.timewanted&&(0,Dr.jsx)(Dr.Fragment,{children:Xi(a.timewanted,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",hour12:!0,minute:"2-digit"})}),!a.timewanted&&(0,Dr.jsx)(Dr.Fragment,{children:Xi(a.earliestreadytime,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",hour12:!0,minute:"2-digit"})})]})}),"dispatch"===a.deliverymode&&"advance"!==a.timemode&&(0,Dr.jsx)("span",{children:"Delivery asap to"}),"dispatch"===a.deliverymode&&"advance"===a.timemode&&(0,Dr.jsx)("span",{children:i&&(0,Dr.jsxs)(Dr.Fragment,{children:["Delivery on ",a.timewanted&&(0,Dr.jsx)(Dr.Fragment,{children:Xi(a.timewanted,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",hour12:!0,minute:"2-digit"})}),!a.timewanted&&(0,Dr.jsx)(Dr.Fragment,{children:Xi(a.earliestreadytime,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",hour12:!0,minute:"2-digit"})})]})})]}),!a&&(0,Dr.jsx)("span",{children:i&&ya(i.hours)&&i.hours&&i.hours.business&&i.hours.business[Gi()]&&(0,Dr.jsxs)(Dr.Fragment,{children:[_a(i,"-5")&&(0,Dr.jsx)(Dr.Fragment,{children:"Pickup from"}),!_a(i,"-5")&&(0,Dr.jsxs)(Dr.Fragment,{children:["Pickup open at ",new Date(i.hours.business[Gi()].start).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})]})]})}),a&&"dispatch"!==a.deliverymode&&(0,Dr.jsx)("div",{className:os.text_block_address,children:i.address&&i.address.street}),a&&"dispatch"===a.deliverymode&&(0,Dr.jsxs)("div",{className:os.text_block_address,children:[a.deliveryaddress.streetaddress,", ",a.deliveryaddress.city,", ",a.deliveryaddress.zipcode]}),!a&&(0,Dr.jsx)("div",{className:os.text_block_address,children:i.address&&i.address.street}),(0,Dr.jsxs)("span",{className:`btn-underline ${os.btn_underline}`,children:["Change ",(0,Dr.jsx)(Vs,{dimensions:{width:16,height:20}})]})]})}),(0,Dr.jsx)(cc,{in:t,nodeRef:r,timeout:400,classNames:"top-drop",unmountOnExit:!0,children:(0,Dr.jsxs)("div",{ref:r,className:os.change_selections_container_outer,children:[(0,Dr.jsx)(Hl,{closeChangeSelector:o}),s.createPortal((0,Dr.jsx)("div",{className:"background-invisible",onClick:o}),document.getElementById("backdrop-root"))]})})]})};var dc=()=>(0,Dr.jsx)("svg",{width:"18",height:"20",viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M8.71513 -0.000488281C6.03528 -0.000488281 3.86243 2.17237 3.86243 4.85222C3.86243 7.53207 6.03528 9.70493 8.71513 9.70493C11.395 9.70493 13.5678 7.53207 13.5678 4.85222C13.5678 2.17237 11.395 -0.000488281 8.71513 -0.000488281ZM8.71513 8.15289C6.89407 8.15289 5.41446 6.67328 5.41446 4.85222C5.41446 3.03116 6.89407 1.55155 8.71513 1.55155C10.5362 1.55155 12.0158 3.03116 12.0158 4.85222C12.0158 6.67328 10.5362 8.15289 8.71513 8.15289ZM16.4339 20.0001C16.0097 20.0001 15.6579 19.6483 15.6579 19.2241V16.8857C15.6579 14.361 13.5989 12.302 11.0742 12.302H6.34569C3.82104 12.302 1.762 14.361 1.762 16.8857V19.2241C1.762 19.6483 1.4102 20.0001 0.98598 20.0001C0.561756 20.0001 0.209961 19.6483 0.209961 19.2241V16.8857C0.209961 13.5022 2.96224 10.75 6.34569 10.75H11.0742C14.4577 10.75 17.21 13.5022 17.21 16.8857V19.2241C17.21 19.6483 16.8582 20.0001 16.4339 20.0001Z",fill:"#242C37"})});var hc=()=>{const e=E(),t=y((e=>e.auth.user)),r=y((e=>e.auth.user));return(0,Dr.jsxs)(Dr.Fragment,{children:[!t&&(0,Dr.jsx)("button",{className:"btn-clear",onClick:()=>{e(Ha.setUserSideBarState())},title:"Sign In/Join",children:(0,Dr.jsxs)("div",{className:os.control_box,children:[(0,Dr.jsx)(dc,{}),(0,Dr.jsxs)("div",{className:os.text_block,children:[(0,Dr.jsx)("span",{children:"Sweet rewards"}),"Sign In/Join"]})]})}),t&&(0,Dr.jsx)("div",{className:os.control_box,children:(0,Dr.jsx)("div",{className:`${os.text_block} ${os.text_block_sign_in}`,children:(0,Dr.jsxs)(er,{to:"/account",children:[(0,Dr.jsxs)("div",{className:os.user_logged_in,children:[(0,Dr.jsx)(dc,{}),(0,Dr.jsx)("div",{children:(0,Dr.jsx)("span",{children:r.first_name})})]}),(0,Dr.jsx)("div",{className:os.account_helper_text,children:"My A
2ccount"})]})})})]})};var pc=()=>{const t=E(),r=(0,e.useRef)(null),n=y((e=>e.location.changeDeliveryModal)),i=y((e=>e.location.location)),a=y((e=>e.cart.cart)),o=()=>{t(Vi.setChangeDelivery({close:!0,value:!1}))};return(0,Dr.jsxs)("div",{className:`${os.mobile_location_header} `,children:[!i&&(0,Dr.jsx)("div",{className:`${os.control_box_mobile} ${i?"":os.mobile_location_header_no_loc}`,children:(0,Dr.jsx)("button",{className:`btn-underline ${os.white}`,onClick:()=>{t(Vi.setLocationsSideBarState()),a?("pickup"!==a.deliverymode&&"curbside"!==a.deliverymode||t(Vi.setVirtualDeliveryType("pickup")),"dispatch"===a.deliverymode&&t(Vi.setVirtualDeliveryType("delivery"))):t(Vi.setVirtualDeliveryType("pickup"))},children:"Start Your Order"})}),i&&i.id&&(0,Dr.jsxs)("div",{className:os.control_box_location,children:[(0,Dr.jsxs)("div",{className:os.mobile_location_header_address,children:[(0,Dr.jsxs)("div",{className:os.control_box_icon_mobile,children:[a&&(0,Dr.jsxs)(Dr.Fragment,{children:["pickup"===a.deliverymode&&(0,Dr.jsx)(js,{fill:"#fff",dimensions:{width:"16px",height:"16px"}}),"curbside"===a.deliverymode&&(0,Dr.jsx)(Ts,{fill:"#fff"}),"dispatch"===a.deliverymode&&(0,Dr.jsx)(Es,{fill:"#fff"})]}),!a&&(0,Dr.jsx)(js,{fill:"#fff",dimensions:{width:"16px",height:"16px"}})]}),a&&(0,Dr.jsxs)(Dr.Fragment,{children:["pickup"===a.deliverymode&&(0,Dr.jsx)("span",{className:os.mobile_location_header_delivery_type,children:a.deliverymode}),"curbside"===a.deliverymode&&(0,Dr.jsx)("span",{className:os.mobile_location_header_delivery_type,children:a.deliverymode}),"dispatch"===a.deliverymode&&(0,Dr.jsx)("span",{className:os.mobile_location_header_delivery_type,children:"Delivery to"})]}),!a&&(0,Dr.jsx)("span",{className:os.mobile_location_header_delivery_type,children:"Pickup"}),a&&"dispatch"!==a.deliverymode&&(0,Dr.jsx)("div",{className:os.control_box_location_text,children:i.address&&i.address.street}),a&&"dispatch"===a.deliverymode&&(0,Dr.jsxs)("div",{className:os.control_box_location_text,children:[a.deliveryaddress.streetaddress,", ",a.deliveryaddress.city,", ",a.deliveryaddress.zipcode]}),!a&&(0,Dr.jsx)("div",{className:os.control_box_location_text,children:i.address&&i.address.street})]}),(0,Dr.jsxs)("button",{className:`btn-underline ${os.white} btn-flex-5 ${os.btn_svg_18}`,onClick:()=>{t(Vi.setChangeDelivery({close:!1,value:!0}))},children:["Change ",(0,Dr.jsx)(Vs,{stroke:"#fff"})]})]}),(0,Dr.jsx)(cc,{in:n,nodeRef:r,timeout:400,classNames:"top-drop",unmountOnExit:!0,children:(0,Dr.jsxs)("div",{ref:r,className:os.change_selections_container_outer,children:[(0,Dr.jsx)(Hl,{closeChangeSelector:o}),s.createPortal((0,Dr.jsx)("div",{className:"background-invisible",onClick:o}),document.getElementById("backdrop-root"))]})})]})},mc="Backdrop_backdrop__VoPVa",fc="Backdrop_backdrop_over__2RzdT";var gc=e=>(0,Dr.jsx)("div",{className:`${mc} ${e.over?fc:""}`,onClick:e.hide}),_c={sidebar:"Sidebar_sidebar__5xATo",active:"Sidebar_active__H+1LP",close_button:"Sidebar_close_button__byAmw",location:"Sidebar_location__p-1tK",sidebar_header:"Sidebar_sidebar_header__4FF3S",sidebar_content:"Sidebar_sidebar_content__zfuzX",sidebar_content_inner:"Sidebar_sidebar_content_inner__KXLSG",form_input_container:"Sidebar_form_input_container__s1Wlr"};var yc=()=>(0,Dr.jsx)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M18.7095 17.3058C19.1064 17.7027 19.1064 18.3246 18.7095 18.7083C18.5243 18.9068 18.2729 18.9994 18.0083 18.9994C17.7436 18.9994 17.5055 18.9068 17.307 18.7083L9.51383 10.9151L1.70742 18.7083C1.50895 18.9068 1.25756 18.9994 1.00617 18.9994C0.754777 18.9994 0.490153 18.9068 0.304916 18.7083C-0.09202 18.3246 -0.09202 17.7027 0.304916 17.3058L8.11132 9.51263L0.291685 1.70623C-0.0920199 1.29606 -0.0920199 0.687424 0.291685 0.303719C0.688621 -0.106448 1.32372 -0.106448 1.70742 0.303719L9.51383 8.11013L17.307 0.303719C17.7039 -0.0932168 18.3258 -0.0932168 18.7095 0.303719C19.1064 0.687424 19.1064 1.30929 18.7095 1.70623L10.9163 9.51263L18.7095 17.3058Z",fill:"var(--color-dark-raspberry)"})});var vc=t=>{let{click:r,children:n,activeState:i,design:a}=t;const[s,o]=(0,e.useState)(!1),l=(0,e.useRef)(null);return(0,e.useEffect)((()=>{setTimeout((()=>{o("active")}),100)})),(0,Dr.jsx)(cc,{in:i,nodeRef:l,timeout:400,classNames:"sidebar-group",unmountOnExit:!0,children:(0,Dr.jsxs)("div",{className:`${_c.sidebar}`,ref:l,children:[(0,Dr.jsxs)("button",{onClick:r,className:`btn-clear ${_c.close_button} ${a?_c[a]:""}`,children:[(0,Dr.jsx)(yc,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"close sidebar"})]}),n]})})},xc={sidebar_header:"Cart_sidebar_header__Mn22r",sidebar_header_message_type:"Cart_sidebar_header_message_type__t+0oA",sidebar_header_message_store_name:"Cart_sidebar_header_message_store_name__gm7-s",sidebar_header_message:"Cart_sidebar_header_message__Ek5p2",sidebar_content:"Cart_sidebar_content__X6FYu",sidebar_content_inner:"Cart_sidebar_content_inner__CXa9a",sidebar_content_inner_empty:"Cart_sidebar_content_inner_empty__5sUf-",cart_timeline:"Cart_
2cart_timeline__mfB7K",cart_timeline_item:"Cart_cart_timeline_item__5NNZY",active:"Cart_active__6XUOb",number:"Cart_number__7RhhG",svg_loader:"Cart_svg_loader__p1uAg",complete:"Cart_complete__U9sIU",cart_items:"Cart_cart_items__ESvjU",no_items:"Cart_no_items__yQ55N",info_pannel_header:"Cart_info_pannel_header__mlrdf",btn_active:"Cart_btn_active__VwUHb",cart_footer:"Cart_cart_footer__g0NoI",cart_footer_loader:"Cart_cart_footer_loader__kEVWt",checkout_location_date_info:"Cart_checkout_location_date_info__3ryQO",checkout_location_date_info_title:"Cart_checkout_location_date_info_title__-dxLh",checkout_location_date_info_more:"Cart_checkout_location_date_info_more__3SrNS",checkout_location_date_info_cta:"Cart_checkout_location_date_info_cta__2ngQh",billing_loader:"Cart_billing_loader__zIn6r",order_total_container:"Cart_order_total_container__iSVhc",order_total_header:"Cart_order_total_header__h70u5",order_total_item:"Cart_order_total_item__Nxq1Q",user_info:"Cart_user_info__P4Odr",order_complete:"Cart_order_complete__mT1+k",disclaimer:"Cart_disclaimer__Z8Lx0",modal_controls:"Cart_modal_controls__BO7vN",btn:"Cart_btn__881ir",modal_footer:"Cart_modal_footer__4yAJS",mobile_flex_wrap:"Cart_mobile_flex_wrap__ZAWmU",max_width_container:"Cart_max_width_container__U1Gl8",migrate_disclaimer:"Cart_migrate_disclaimer__XqfOs"},bc="CartItem_item__QlZ5B",wc="CartItem_remove_item__90jQ3",Cc="CartItem_title__SBwia",Sc="CartItem_description__v9SJZ",kc="CartItem_item_footer__c3P2-",jc="CartItem_cart_item_operation__b04jo",Ec="CartItem_item_count__cD2am",Tc="CartItem_increment_decrement__9ibgX",Pc="CartItem_price__2pbn9",Ic="CartItem_text__+rrwd",Mc="CartItem_image_container__ymM-0",Nc="CartItem_special_instructions__AYl1X",Ac="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEcAAAA0CAYAAADYBiVwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAABTuSURBVGhD1VsHfFRV9j7pvZFAQkgIAZLQQjVIVZAq0hRBWZooLG2xrIhIERFBFGWVXUURsC7NAiKr0pSuIEUIkFAS0ggJIWUySSY9//Od997Mm8kE4v5/6vLBMO/e9+a9d8895zvn3HtwqGHQHQy8/s2cHEpPTqbS0lJqGBxM/gEBdOr4cWoRE0ORLVuSk5OTevVvwx0tnMT4eNr04YeUfOkSVZSXq708KAcHERof0MLXXqN2HTuqZ34bHNXvOwpVVVW0feNGWrFwIV08d85KMIA238EhIaI5/y3uOOFUV1fTZ2vX0paPP6ZSk0nttY/YTp3Iy9tbbf123HHC2fPNN7R7xw6zdvj5+9PgESPovvvvF3PSo7SsTD3673BHCaekuJg2M8fArDRAe0aNH09ubm5mgWk4c+IE5WRnq63fDmtC5sO845ep+FImi82BAuKiyCuqscyIMTGDygtL+Bf818mRPEODyD3EX/0hUXmekYxJ19WWBZ5hDcmjcYAcVxaVUmFCOtXwHwdHR/Jt25Sc3V3JEJ9ClaXWvAG4+nqRd0t+Pj8PuHLxIi2cPVuO9ejSrRvFnzpF5TbcAwQEBtLkWbOoa69eak/9YRZOaVY+nXn8HTKeT5MTAF4qdt1MCuzeig51f54q84vVMwp8OzSjjh/NJtcGPpS4aCNlfLJfPWNBoxFx1H71VDm+tOwLSlu7W46BsMf6UtSiMXQg+m9UrdMGDY78/Lt/WEJezYKlvX/XLnrvzTfl+LcA7v2lVasosGFDtad+kCmBfBLnfWolGKCmqpoqCoqpptpaXTUUnkmhc0+vl+MaJkq70P20MD5VPVJgPJfGQqkEy6o91pDn6hQ7JytLPaob9mIamNbq5cvpzMmTZDQaa5lfXRDh5B1JpJs/npMOJy93av7MMOrAGhG9aDR5tQiRF3SAPTFc/Dwp8tnh5OTtLu28AxfIlJFrJYTQ8fewRjwsnyaPKOpcXV5JpmRr+y+6kEEuLq4UvXQsRc0fRY4eLsoJFydpxywZS+6NLKabl5enHtnHxOnTac3mzRQaHq72WHDx/Hl69YUXaOqoUfTG4sX1EpAIx3DiijSA4OFxFPnUUGrYN5aaThlA/h0ihSO0mzn7snBm3U9BfdtJGyhOyrLSrpChcRQxZaB8Anu1lr5Ko0m0EHBmAQNVJWVUml1AYRP6UMS0QURuinAcnBykHTapj0yWhoJcngSGI/NVS45+nZ2dpa0B/OLr50ed7r5b7eF7MV/+ZcoU6svezMNTee7VK1dqxUb2IMIpuaY8FGg0pDOVXc8nY0KGfEpSbqhnbKBzmw5M3nqUpOWQ4VwqGdhMIRQAAqwuq5Bj/7uj5BsovlKbxO0hLSWFfv3lFxngijVr6EXmnhbR0epZBf/58ktawIT9LX9rwKTiExoWRiY1LqqoqKDSEnYut4EIp6rQEky5BPnSyUfepGODX5bP6bGreNpZK3S8kLPvLBUcu6w0WC4+bazVOHHuJ/TLA8volyGvUPa3J6XPyMICQPIBPVrJMWA4m6Ie3Rp+rBFu7u5k4kGl8MwXM3c0sCHYK4mJlMQezdZkvt6yhTZv2GDmr5DQUPLh+Oh2EOHo4aS6TQ2a5DWY0m9S/F/fozI2B6DxQ93JpUHdUaimU8bzGfLt5OnGwgwjJ5VfjPHWTqAu+LBwMPvAZx98QPNmzKCfDhyQdvd776Wo1or52kNJUZFVbOTLgrENGO1BJOHk6SoNAC61KbtYX+YaDcp9dDdThQVzavncSHmQXoBw3xF/u5+azX6A/DlWAjRPWGUqp6TXt7MiKtcXXUiX79sBPDNw2DB5VmFBARn4o6F1+/b02MyZIkAN6Bs/bRo14vzKFuCl+kCE48qmpKE8y0DhT/SngK4WXhA3rQ4eWhI0uJMcg4RLWJOUY4vZhY1lb/Xcg9RyzgjybB5MVcVlZFJ5raayih1AEtWUsQtnlPLvNV5yqCNk0NCjb19ZhrCd9b07d9Irzz9PRoNB7SEh5UHDh5O3r2VsgCtH0iMeeURt3RoiHC+OQjVk7ThOFRwJVyEatgNn9h7hrFkaMrccUY8sqMwvIlNmrnyqWVPKcgupukjJc2BW7mGB5OiumBUELKGANJSvuoCBzV+xgmbOnWtlRmlXrwoX6bFp3Tp6ec4c4Sc9Rk2YQCFNmqitW0OEE9SvPTn7KC4za9sxOnrvQsrYeljaAJSmWmc2PjFNyLWRopo5u06ZZ15D/Ky1dLTnAvkkv/MtFV28ZtYsRMU9Dy+nSDY5DbbBoWrHduHJ3qp3v340dPRotcc+YOaXExIkiwdcXV1pGP9mxJgx0q4PRDhubFYxL41lT6JElxV5RTKL4BQvFgTU2Py6fIw4pZFqWpXGUrqx51c51gBtgDDwqeKcSU+6ECru5x4eqPaAlFVPpj4E/HI7IM6JbttWbd0afgEB9MSTT9K4qUo
2aU19YEk/+ytl7lrJ3nxbecWVuCegeQyEjuoqQrrEmVbDL9wwPouBhcVTCcUv2bhYK/y6odxvRHsPpqzJjGjBWf3AXCyv/VJL0NRrUSZJJU8ZNus4mjEnwa9+MAvkemVuPSFDowoFm+CSL6dYFEPNZTgkO7tlDl9mNI7ADx8R27kzNozhp9vEhDw8PataiBTW0Q8y3wx2/hgxgCMifCvPzKbRpU/L08lLP/P9wxwlHXpfNVaOA3xNWwrm25TDHI0rcgQQzYuoAyaWAjH/vZ2K9To3ZzPy6tJA+DbmHLtBNNkm/Ls0pZHhXSlm7i0ozaieJ4ZPvE75JW7+PTVUskpzZe/l2iqSg/h1kiQIJatLqnRK1+7QLp9CHeyrpCV+M5Dhj4wGqyC0i99AGFPHXgbJsAmR+8RMVqtG2IyeuLeeM5ERWid9u7DpN+Ucvkk+HCArloBXI/PyoOAL3xgHUbPpghQNsYBZONccf+9s8ac5/gC5b5lBAt2hZujjSaz6VZuaRd9tw6vrNfB6IMnP43VGc43zMt3NzuuvLubQf6zMVShyjR/s106k010CXFm5SeyxAvtX506cljDh013PSh0g6bvt8cnBxpMtLt1Lahh+kX0Ngv1jqtEFZ/DrSZyGZrlrywNg10yh4SBc5PjFuFRUcTpQktvu+JeQW4k+nx/1DViPgILrtfYlc/WqbotktYHB6wQCGs1fVIwuKL2ZyvnRKbSkzgN/WC86O5GiJFa2AXC2VNcoe8g4lWAkGYYcDa4em9DUVVRxMWmtq4bnaaUlVcSld335Mbd0eZuGYUmtn36arOeqRBYhwr7P5abi28ZB6ZIH20i5BPtR15wLqeWAZ9Ty4jBreFyv9GsKn9KPWr01UW4h37Ceh2TtPqEdETcb1pt7HV9I9J96gls8Mlz7jJY6jKq01FQtp9nDt0/1UXWqtBHXBLBzjBSUxROTqGqKs+RYlXTcHb3oYTibz9emUf/wyGW2yahGM+htk4B5hQeTRrCF5RDQkB2eebd39XFiVg0fGCQ8B5Woyq0dlWTnlH7skx46uzhw8DpUo28Xfi3w5BAAMp5PlG/BspUS/xRx42kNZZj7lHk5QW7eGWTiGM4oJIc/yjlJiAlNqDlXqljM0YJEKpJr63i61xz6qOEBMfX8Xpby9k1LX7uGAsKLWWjGCSE3THL3c5FuPyoJi8ztg9RFCsUWR6kTAgw2YI4HyGwZ5T1vgWanvf888qjzzVrBozhklSnVjgvKKDpXj8mwDld2oPZtA1rafKffAebVlH3i5lDXf05VVOyj5rR21XhZLrOdmvK+2OBhsF6EeWQAerFEF6uTmytpT24UbExUtcQ0L4CBVWeNBlF5osyauAWPVn7NNZDWIcMoNJVSmJn/OAV6WLJ2lXHjWJu9hOMI82IOBf24XbyDxkD/8AvhddaXFrApOXKGCX5TEEKEDXL0tYJrmOeb3waBtofGle5NAqmHPpkELS6zATgHhQpW2EsBhgrb1YwvpNZ5PNat23o/nKeXd7+QYMPxqzSluwf7k392yPNnwIU4v6pA83GTnz+dQtz2LKY7dv7Ovh3pGBeIXFY0e6MJaW3t1ztnHg5zVteUq5p+qEuu13/L8IvOWUeGJJEp61bJEaruQ5sRm22hg/YsKRDhwzxokWWQe0FDE6qcJDoCkwyZy3gOB8N+wx/qoZ1TgWu1yPu8dFSpm6tVc4TE9IUdM7U8ePNtAzr54uxzh7OMpS7dAJWu4Kd3agxYlZJi1CRpRbbJ4ImNCuiyZ6BH6aC/zcsntoAhHFzw1HtOTmk4fJMkfgGVRrN7pgQjZH1HtgA7kGVl3QldVXE7pHynEnbZ+LxNriZijBidvDwoc2IGqHGoowXSN9mzZJmvDekArG3BSCkAIFxdtouvbjlEGu+SUD3ZTwUkloQUCOVSImHU/uQQqy7YICqFZevgyr/nE1uY2exDhlKjbuFDyyKceoOgXRpF70yDpq2CV1bZUNCAI68jRbLt/PCEKVBeqikxMxDvpMqv6pZe3UnF27WAxYGAsfRueRfsb59BHmzbQ7h3fqGcsCBnahZzUVMBwKpnOP72eEhdupLyjiaLZGpqM7U1Rcx8kT9WhQBPL2GtZgV8YaVF9oGgO9sZ5kMhFtP1vLG+iD54CaYMTVBHX8Ddm05ndKj5wn46u6jkmXOyBO7k5yzW1Pnxf7I3LAX8w4C+PfEs5HhXUKc+fwks8KSMzneMhZzmPuAg2ivXs1svHm/e7ANzPhU3OlMaOBNcipmqqeCrPiEbSh08Ze1wRLNrqOlFQ31jy41QHfY4ueBZO1obkVqbreRKC42LNFVYUQmNQOODAvNCAym8aZeHKkcnRnUlZD1NWPtWwvTvxwBEKlLKGVDJxWnEV38c7Mph5oYJKs5TwIDMvmxbPn0sPjxtPA3r1o8UL5lG3gX1pWP+hkrMhgXRv3ECuBcpzjRJFl+cVy+T5sIYgdqpkDQW5e4QGCieCuCEUjMctyI/bfA2bNDYLPZqoFqGOD8JB8mkXEM6fgerq6prVy5fXzJk6taa8rKzmwtmzNZNHjqy5eeOGeoV9lPG1fxQUPfsTkJuTQ6d+/plGT5gg2om9qAHDhtVZCZGZnk4b/vlPWvzMM3Ti6FG1t35ADY9+38oeeFKIJ0ltKbArHBYa/lFbvw+0nckOcXGyjYuNt1HjxqlnrZFw9qzsJBzYvVuWPbHzWR9AID/u2kUvskC3b6q9TKLhWloa/XvdOvri00+thGglnCrObFFWhmqE5fPnSzHi7wWUg0S1aUP5ubm08/PP6akFC2TrxR52ff01VfC7zVu2jF584w1ZI9aQd/MmHTt0SO5ji8sXLtDaVatkopvdonDyEl+HiULJbnGxxTObF7sq+eGrliyhU8eOUXCTJlReqiSEr777LgU0sJAigN1G1OVhYx/n5vDv9DAWFtLR/fupV9++sshtCyyEL3rqKep53330w3ffkYlfyIUFE9ezJ02cNk29yoIi1iq8n79ufxvFABvXr6c9/B44h7K3F159lVq1s1R/fMzvvpsne9Hrr1OrWOvlEg3QlKxr1+Q9cI/RkyaJ8wDMmrNj61YRzN333ENvsv3PZu3Bqr2HjQqjvGzOlCn05WefiWmcPn6cMlktNaAm+EUe+EfvvEPnfv2V/vPVV1RkE9gV5OdTZkaGaMx1/g4ODaXwiAipjkAdjS1O/vQTvcaaVcxC0gBT/H7bNopp21bqjJmoZZAaILyDe/dKmQq2ZuoCroE5TeBJGfPYY2bBACIckB0GG81qPnvePLlhm/btRY3d1ZoWACr8wdtvy4MhYexHQ/Kfsb2i9HXlSy9JCch1fsnO3bpJldVGFvTKxYspT6f22E4B+UEDh4waRYtWrqSJM2bIOf0euAYIMCM1VZ6rATwEoQ5/9FE53zgsTDRPA4olIUwI7Qsemy3Z4l4QMATTZ9AgtdcaYlZbPvyQtjFhLV29mqJaWcpD9IDq/ovV9me270cnT6aRY8cKw89mbwMhoHAohlUaBUbnz5wRbsCsLn3uOUqIjyd3JtIYFj5M5Orly+adSBdXVwpjrYFAm/L3AjYBqLcGmPbLfA/sUa1gM8H1wArWJDwH84zt3b/zBKC0BMC7vjBrlmwOooYHtYRtWbumPv20PPfEkSN0cN8+2VufMH069bj3XvmdLaQ0KpEJqUFQUJ2CAaABxw4fJmcXF+rYtav0wVzw8n+ZOpWGPPig9HHcQmHNmslL4eXadepECUzsTSMjyYk1sifzEPpRSwOh9hk4kNxYcKig6NWvH7nw/fVAHWBaUhINGD7cLBh4lxyeGHAXNHQGezIfXcEANvnSr14Vku/GNAENQ33O3x9/XDQdpnNP//6i/bcqohSzMuTlWd1cD6jmawsX0nfbt8vg4FG08rEvPvlEvjt2UVb5EU/gxaNiYsyex8D84u3tTfNZ6+YuXSqxDFQd3AYzzsrMpPEoSxs8uJZgytgpbOJBwYNERilVH/vZnS9hYeDF/dkZQGD6TbwDLJgP3npLqjFQt4NJ+I65CQJBauPB165iIp/O97hddakIJ5C1BgQJMwGgehk8SJTRw2wusPo+/8orEpPAs4CU4alA4INGjJBdRgB2DU0qKSmhSrZp2aplw
2oMWabEJ4pnc7GzxZMPGjKFzp09L5ZXt8ilc8zLmv58PHpR2WnIyzZs5k95jc+3FXm4Jcx/eCcUCz7Jw1zElIEBcw/yFOp1nmf8AFHVjUmHmQx56SMrd4BnrA+GcbZs30xaeIVQ8oRIT9o0IFgNsf9ddNHriRNl7xmDf4IfCLDATqIGZrCsagmBAyPBYMCNs0YLQ5/EgIppzoseAh1s6dy4t52i3MT8Lgz38ww9ifr1Z1b3Z9Z9nL3eEQwF4MLhmOAvwSHTr1vToE0+I+Wsmls9av5WdASawHO/L94HQw9QJw38eSeBzmEBodUv+LRwNqi5uBxEOzOGrjRvlpaDK2IyHG7+rRw9qzfGBvrYXgWEKc0A48woqHVxtXH0ua98OdtHQQmgkBqyvpTnOvLWeBbOStRIVVtA2eBNoEAYKMkZ5W48+feT50Lh4Pod3wH3sDQqTgv9rBe2DiendMbhnJ3slkC9MEwVNUIJ6AcLRwLNTw2onSeHvBY5Zap6cNAkTovYoQEJZVFhYU1JcjKxU7f1zYY6Q/yjgceATuH79DP8v4g8Xzp0Dov8DBpKW2MyHSm0AAAAASUVORK5CYII=";var Lc=t=>{let{data:r}=t;const n=Ir("currentMenu"),i=Ir("cartUpsells"),[a,s]=(0,e.useState)(Ac),[o,l]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{n&&n.menu.categories.forEach((e=>{if(e.products&&e.products.length>0){let t=e.products.find((e=>e.id==r.productId));if(t)return s(t.image_small_url),void l(!0)}e.sub_categories&&e.sub_categories.length>0&&e.sub_categories.forEach((e=>{if(e.products&&e.products.length>0){let t=e.products.find((e=>e.id==r.productId));if(t)return s(t.image_small_url),void l(!0)}e.sub_categories&&e.sub_categories.length>0&&e.sub_categories.forEach((e=>{if(e.products&&e.products.length>0){let t=e.products.find((e=>e.id==r.productId));if(t)return s(t.image_small_url),void l(!0)}}))}))})),i&&i.forEach((e=>{if(e.items){let t=e.items.find((e=>e.id==r.productId));if(t)return s(`${e.imagepath}${t.images[0].filename}`),void l(!0)}}))}),[]),(0,Dr.jsx)("div",{className:Mc,children:(0,Dr.jsx)("img",{src:a,alt:r.title,className:o?"image-cover":"image-contain"})})};const Dc=Ii({name:"productDetails",initialState:{data:null,edit:null,editCreate:null,pageReload:!1,accordionTrigger:null},reducers:{createProduct(e,t){e.data=t.payload},selectOption(e,t){if(console.log("data.payload:::: ",t.payload),console.log("state.data:::: ",e.data),t.payload){let r=e.data.findIndex((e=>e.id==t.payload.id));r&&(console.log("found"),e.data[r]=t.payload)}},setEditOptions(e,t){e.edit=t.payload},setEditOptionsCreate(e,t){e.editCreate=t.payload},setpageReload(e,t){e.pageReload=t.payload},builderAccordionTriggerMark(e){e.accordionTrigger=Math.random()}}}),zc=Dc.actions;var Oc=Dc.reducer;var Rc=t=>{var r;let{data:n}=t;const i=E(),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(!1),d=()=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"remove_from_cart",ecommerce:{currency:"USD",value:n.totalcost,items:[{item_id:n.productId,item_name:n.name,price:n.totalcost,quantity:n.quantity}]}})};let h=y((e=>e.cart.cart));const p=n.choices.map((e=>e.name));return(0,Dr.jsxs)("div",{className:bc,children:[(0,Dr.jsx)(Lc,{data:n}),(0,Dr.jsxs)("div",{className:Ic,children:[!a&&(0,Dr.jsxs)("button",{className:wc,onClick:(async e=>{s(!0);const t=await gr(h.id,e);t.id?(Mr("currentCart",t),i(vs.addCart(t)),d()):i(qi.setError(t)),s(!1)}).bind(void 0,n.id),children:[(0,Dr.jsx)("svg",{width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M6.32812 6.61328C6.53906 6.40234 6.92578 6.40234 7.13672 6.61328L9 8.47656L10.8281 6.61328C11.0391 6.40234 11.4258 6.40234 11.6367 6.61328C11.8477 6.82422 11.8477 7.21094 11.6367 7.42188L9.77344 9.25L11.6367 11.1133C11.8477 11.3242 11.8477 11.7109 11.6367 11.9219C11.4258 12.1328 11.0391 12.1328 10.8281 11.9219L9 10.0586L7.13672 11.9219C6.92578 12.1328 6.53906 12.1328 6.32812 11.9219C6.11719 11.7109 6.11719 11.3242 6.32812 11.1133L8.19141 9.25L6.32812 7.42188C6.11719 7.21094 6.11719 6.82422 6.32812 6.61328ZM18 9.25C18 14.2422 13.957 18.25 9 18.25C4.00781 18.25 0 14.2422 0 9.25C0 4.29297 4.00781 0.25 9 0.25C13.957 0.25 18 4.29297 18 9.25ZM9 1.375C4.64062 1.375 1.125 4.92578 1.125 9.25C1.125 13.6094 4.64062 17.125 9 17.125C13.3242 17.125 16.875 13.6094 16.875 9.25C16.875 4.92578 13.3242 1.375 9 1.375Z",fill:"var(--color-dark-raspberry)"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"remove item from cart"})]}),a&&(0,Dr.jsx)("div",{className:wc,children:(0,Dr.jsx)("span",{className:"loader dark-raspberry"})}),(0,Dr.jsx)("div",{className:Cc,children:null===(r=n.name)||void 0===r?void 0:r.toLowerCase()}),(0,Dr.jsx)("div",{className:Sc,children:p.join(", ")}),""!==n.specialinstructions&&(0,Dr.jsxs)("div",{className:Nc,children:[(0,Dr.jsx)("span",{children:"Special Instructions:"})," ",n.specialinstructions]}),(0,Dr.jsxs)("div",{className:kc,children:[(0,Dr.jsxs)("div",{className:jc,children:[!c&&(0,Dr.jsxs)("button",{onClick:(async e=>{if(u(!0),n.quantity>1){const t=h.products.find((t=>t.id==e));let r=[];
2t.choices.forEach((e=>{r.push(e.optionid)}));const n={quantity:t.quantity-1,product_id:t.id,special_instructions:t.specialinstructions,options:r.join(",")},a=await fr(h.id,e,n);a.id?(Mr("currentCart",a),i(vs.addCart(a))):i(qi.setError(a))}else{const t=await gr(h.id,e);t.id?(Mr("currentCart",t),i(vs.addCart(t))):i(qi.setError(t))}d(),u(!1)}).bind(void 0,n.id),className:Tc,children:[(0,Dr.jsx)("svg",{width:"12",height:"2",viewBox:"0 0 12 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M11.8125 0.75C11.8125 0.996094 11.5938 1.1875 11.375 1.1875H0.875C0.628906 1.1875 0.4375 0.996094 0.4375 0.777344C0.4375 0.53125 0.628906 0.3125 0.875 0.3125H11.375C11.5938 0.3125 11.8125 0.53125 11.8125 0.75Z",fill:"#242C37"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"remove one item"})]}),c&&(0,Dr.jsx)("span",{className:Tc,children:(0,Dr.jsx)("span",{className:"loader dark-raspberry"})}),(0,Dr.jsx)("div",{className:Ec,children:n.quantity}),!o&&(0,Dr.jsxs)("button",{onClick:(async e=>{l(!0);const t=h.products.find((t=>t.id==e));let r=[];t.choices.forEach((e=>{r.push(e.optionid)}));const n={quantity:t.quantity+1,product_id:t.id,special_instructions:t.specialinstructions,options:r.join(",")},a=await fr(h.id,e,n);a.id?(Mr("currentCart",a),i(vs.addCart(a))):i(qi.setError(a)),l(!1)}).bind(void 0,n.id),className:Tc,children:[(0,Dr.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M11.8125 5.75C11.8125 5.99609 11.5938 6.1875 11.375 6.1875H6.5625V11C6.5625 11.2461 6.34375 11.4648 6.125 11.4648C5.87891 11.4648 5.6875 11.2461 5.6875 11V6.1875H0.875C0.628906 6.1875 0.4375 5.99609 0.4375 5.77734C0.4375 5.53125 0.628906 5.3125 0.875 5.3125H5.6875V0.5C5.6875 0.28125 5.87891 0.0898438 6.125 0.0898438C6.34375 0.0898438 6.5625 0.28125 6.5625 0.5V5.3125H11.375C11.5938 5.3125 11.8125 5.53125 11.8125 5.75Z",fill:"#242C37"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"add one item"})]}),o&&(0,Dr.jsx)("span",{className:Tc,children:(0,Dr.jsx)("span",{className:"loader dark-raspberry"})})]}),(0,Dr.jsxs)("div",{className:Pc,children:["$",ia(n.totalcost)]})]})]})]})},Fc="CartUpsells_upsells_container__0DhWw",Bc="CartUpsells_upsells_category_item__o1j+Y",Vc="CartUpsells_upsells_title__+ymC2",$c="CartUpsells_upsells_category_title__g9+b7",Uc="CartUpsells_card_alt_item_inner_no_image__Z6FJe",Hc="CartUpsells_card_alt_item_inner__09SVR";var qc=t=>{let{item:r,imgPath:n}=t;const i=E(),[a,s]=(0,e.useState)(!1),o=y((e=>e.cart.cart));return(0,Dr.jsx)("div",{className:"card_alt_item",children:(0,Dr.jsxs)("div",{className:`card_alt_item_inner ${Hc} ${r.image_url?"":Uc}`,children:[(0,Dr.jsxs)("div",{children:[r.images&&r.images.length>0&&(0,Dr.jsx)("div",{className:"card_alt_item_image",children:(0,Dr.jsx)("img",{src:`${n}${r.images[0].filename}`,alt:r.name,className:"image-contain"})}),(0,Dr.jsx)("div",{className:"card_alt_title",children:r.name}),(0,Dr.jsx)("div",{className:"card_alt_price",children:r.cost})]}),(0,Dr.jsxs)("div",{className:"card_alt_btn-container",children:[a&&(0,Dr.jsx)("div",{className:"btn-loader card_button",children:(0,Dr.jsx)("span",{className:"loader dark-raspberry"})}),!a&&(0,Dr.jsx)("button",{className:"btn card_button",onClick:async()=>{s(!0);const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/eligible-upsell-items`,"POST",t))(o.id,{items:[{id:r.id,quantity:1}]});e.id?(Mr("currentCart",e),i(vs.addCart(e))):i(qi.setError(e)),s(!1)},children:"Add to cart"})]})]})})};function Zc(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,n.key,n)}}var Gc="(prefers-reduced-motion: reduce)",Wc=4,Xc=5,Jc={CREATED:1,MOUNTED:2,IDLE:3,MOVING:Wc,SCROLLING:Xc,DRAGGING:6,DESTROYED:7};function Kc(e){e.length=0}function Yc(e,t,r){return Array.prototype.slice.call(e,t,r)}function Qc(e){return e.bind.apply(e,[null].concat(Yc(arguments,1)))}var eu=setTimeout,tu=function(){};function ru(e){return requestAnimationFrame(e)}function nu(e,t){return typeof t===e}function iu(e){return!cu(e)&&nu("object",e)}var au=Array.isArray,su=Qc(nu,"function"),ou=Qc(nu,"string"),lu=Qc(nu,"undefined");function cu(e){return null===e}function uu(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch(t){return!1}}function du(e){return au(e)?e:[e]}function hu(e,t){du(e).forEach(t)}function pu(e,t){return e.indexOf(t)>-1}function mu(e,t){return e.push.apply(e,du(t)),e}function fu(e,t,r){e&&hu(t,(function(t){t&&e.classList[r?"add":"remove"](t)}))}function gu(e,t){fu(e,ou(t)?t.split(" "):t,!0)}function _u(e,t){hu(t,e.appendChild.bind(e))}function yu(e,t){hu(e,(function(e){var r=(t||e).parentNode;r&&r.insertBefore(e,t)}))}function vu(e,t){return uu(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function xu(e,t){var r=e?Yc(e.children):[];return t?r.filter((function(e){return vu(e,t)})):r}function bu(e,t){return t?xu(e,t)[0]:e.firstElementChild}var wu=Object.keys;
2function Cu(e,t,r){return e&&(r?wu(e).reverse():wu(e)).forEach((function(r){"__proto__"!==r&&t(e[r],r)})),e}function Su(e){return Yc(arguments,1).forEach((function(t){Cu(t,(function(r,n){e[n]=t[n]}))})),e}function ku(e){return Yc(arguments,1).forEach((function(t){Cu(t,(function(t,r){au(t)?e[r]=t.slice():iu(t)?e[r]=ku({},iu(e[r])?e[r]:{},t):e[r]=t}))})),e}function ju(e,t){hu(t||wu(e),(function(t){delete e[t]}))}function Eu(e,t){hu(e,(function(e){hu(t,(function(t){e&&e.removeAttribute(t)}))}))}function Tu(e,t,r){iu(t)?Cu(t,(function(t,r){Tu(e,r,t)})):hu(e,(function(e){cu(r)||""===r?Eu(e,t):e.setAttribute(t,String(r))}))}function Pu(e,t,r){var n=document.createElement(e);return t&&(ou(t)?gu(n,t):Tu(n,t)),r&&_u(r,n),n}function Iu(e,t,r){if(lu(r))return getComputedStyle(e)[t];cu(r)||(e.style[t]=""+r)}function Mu(e,t){Iu(e,"display",t)}function Nu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Au(e,t){return e.getAttribute(t)}function Lu(e,t){return e&&e.classList.contains(t)}function Du(e){return e.getBoundingClientRect()}function zu(e){hu(e,(function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}))}function Ou(e){return bu((new DOMParser).parseFromString(e,"text/html").body)}function Ru(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Fu(e,t){return e&&e.querySelector(t)}function Bu(e,t){return t?Yc(e.querySelectorAll(t)):[]}function Vu(e,t){fu(e,t,!1)}function $u(e){return e.timeStamp}function Uu(e){return ou(e)?e:e?e+"px":""}var Hu="splide",qu="data-"+Hu;function Zu(e,t){if(!e)throw new Error("["+Hu+"] "+(t||""))}var Gu=Math.min,Wu=Math.max,Xu=Math.floor,Ju=Math.ceil,Ku=Math.abs;function Yu(e,t,r){return Ku(e-t)<r}function Qu(e,t,r,n){var i=Gu(t,r),a=Wu(t,r);return n?i<e&&e<a:i<=e&&e<=a}function ed(e,t,r){var n=Gu(t,r),i=Wu(t,r);return Gu(Wu(n,e),i)}function td(e){return+(e>0)-+(e<0)}function rd(e,t){return hu(t,(function(t){e=e.replace("%s",""+t)})),e}function nd(e){return e<10?"0"+e:""+e}var id={};function ad(){var e=[];function t(e,t,r){hu(e,(function(e){e&&hu(t,(function(t){t.split(" ").forEach((function(t){var n=t.split(".");r(e,n[0],n[1])}))}))}))}return{bind:function(r,n,i,a){t(r,n,(function(t,r,n){var s="addEventListener"in t,o=s?t.removeEventListener.bind(t,r,i,a):t.removeListener.bind(t,i);s?t.addEventListener(r,i,a):t.addListener(i),e.push([t,r,n,i,o])}))},unbind:function(r,n,i){t(r,n,(function(t,r,n){e=e.filter((function(e){return!!(e[0]!==t||e[1]!==r||e[2]!==n||i&&e[3]!==i)||(e[4](),!1)}))}))},dispatch:function(e,t,r){var n,i=!0;return"function"===typeof CustomEvent?n=new CustomEvent(t,{bubbles:i,detail:r}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,i,!1,r),e.dispatchEvent(n),n},destroy:function(){e.forEach((function(e){e[4]()})),Kc(e)}}}var sd="mounted",od="ready",ld="move",cd="moved",ud="click",dd="active",hd="inactive",pd="visible",md="hidden",fd="refresh",gd="updated",_d="resize",yd="resized",vd="drag",xd="dragging",bd="dragged",wd="scroll",Cd="scrolled",Sd="destroy",kd="arrows:mounted",jd="arrows:updated",Ed="pagination:mounted",Td="pagination:updated",Pd="navigation:mounted",Id="autoplay:play",Md="autoplay:playing",Nd="autoplay:pause",Ad="lazyload:loaded",Ld="sk",Dd="sh",zd="ei";function Od(e){var t=e?e.event.bus:document.createDocumentFragment(),r=ad();return e&&e.event.on(Sd,r.destroy),Su(r,{bus:t,on:function(e,n){r.bind(t,du(e).join(" "),(function(e){n.apply(n,au(e.detail)?e.detail:[])}))},off:Qc(r.unbind,t),emit:function(e){r.dispatch(t,e,Yc(arguments,1))}})}function Rd(e,t,r,n){var i,a,s=Date.now,o=0,l=!0,c=0;function u(){if(!l){if(o=e?Gu((s()-i)/e,1):1,r&&r(o),o>=1&&(t(),i=s(),n&&++c>=n))return d();a=ru(u)}}function d(){l=!0}function h(){a&&cancelAnimationFrame(a),o=0,a=0,l=!0}return{start:function(t){t||h(),i=s()-(t?o*e:0),l=!1,a=ru(u)},rewind:function(){i=s(),o=0,r&&r(o)},pause:d,cancel:h,set:function(t){e=t},isPaused:function(){return l}}}var Fd="Arrow",Bd=Fd+"Left",Vd=Fd+"Right",$d=Fd+"Up",Ud=Fd+"Down",Hd="ttb",qd={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[$d,Vd],ArrowRight:[Ud,Bd]};var Zd="role",Gd="tabindex",Wd="aria-",Xd=Wd+"controls",Jd=Wd+"current",Kd=Wd+"selected",Yd=Wd+"label",Qd=Wd+"labelledby",eh=Wd+"hidden",th=Wd+"orientation",rh=Wd+"roledescription",nh=Wd+"live",ih=Wd+"busy",ah=Wd+"atomic",sh=[Zd,Gd,"disabled",Xd,Jd,Yd,Qd,eh,th,rh],oh=Hu+"__",lh="is-",ch=Hu,uh=oh+"track",dh=oh+"list",hh=oh+"slide",ph=hh+"--clone",mh=hh+"__container",fh=oh+"arrows",gh=oh+"arrow",_h=gh+"--prev",yh=gh+"--next",vh=oh+"pagination",xh=vh+"__page",bh=oh+"progress"+"__bar",wh=oh+"toggle",Ch=oh+"sr",Sh=lh+"initialized",kh=lh+"active",jh=lh+"prev",Eh=lh+"next",Th=lh+"visible",Ph=lh+"loading",Ih=lh+"focus-in",Mh=lh+"overflow",Nh=[kh,Th,jh,Eh,Ph,Ih,Mh],Ah={slide:hh,clone:ph,arrows:fh,arrow:gh,prev:_h,next:yh,pagination:vh,page:xh,spinner:oh+"spinner"};var Lh="touchstart mousedown",Dh="touchmove mousemove",zh="touchend touchcancel mouseup click";var Oh="slide",Rh="loop",Fh="fade";function Bh(e,t,r,n){var i,a=Od(e),s=a.on,o=a.emit,l=a.bind,c=e.Components,u=e.root,d=e.options,h=d.isNavigation,p=d.updateOnMove,m=d.i18n,f=d.pagination,g=d.slideFocus,_=c.Direction.resolve,y=Au(n,"style"),v=Au(n,Yd),x=r>-1,b=bu(n,"."+mh);function w(){var i=e.splides.map((function(e){var r=e.splide.Components.Slides.getAt(t);return r?r.slide.id:""})).join(" ");Tu(n,Yd,rd(m.slideX,(x?r:t)+1)),Tu(n,Xd,i),Tu(n,Zd,g?"button":""),g&&Eu(n,rh)}function C(){i||S()}function S(){if(!i){var r=e.index;!function(){var e=k();e!==Lu(n,kh)&&(fu(n,kh,e),Tu(n,Jd,h&&e||""),o(e?dd:hd,j))}(),function(){var t=function(){if(e.is(Fh))return k();var t=Du(c.Elements.track),r=Du(n),i=_("left",!0),a=_("right",!0);return Xu(t[i])<=Ju(r[i])&&Xu(r[a])<=Ju(t[a])}(),r=!t&&(!k()||x);e.state.is([Wc,Xc])||Tu(n,eh,r||"");Tu(Bu(n,d.focusableNodes||""),Gd,r?-1:""),g&&Tu(n,Gd,r?-1:0);t!==Lu(n,Th)&&(fu(n,Th,t),o(t?pd:md,j));if(!t&&document.activeElement===n){var i=c.Slides.getAt(e.index);i&&Nu(i.slide)}}(),fu(n,jh,t===r-1),fu(n,Eh,t===r+1)}}function k(){var n=e.index;return n===t||d.cloneStatus&&n===r}var j={index:t,slideIndex:r,slide:n,container:b,isClone:x,mount:function(){x||(n.id=u.id+"-slide"+nd(t+1),Tu(n,Zd,f?"tabpanel":"group"),Tu(n,rh,m.slide),Tu(n,Yd,v||rd(m.slideLabel,[t+1,e.length]))),l(n,"click",Qc(o,ud,j)),l(n,"keydown",Qc(o,Ld,j)),s([cd,Dd,Cd],S),s(Pd,w),p&&s(ld,C)},destroy:function(){i=!0,a.destroy(),Vu(n,Nh),Eu(n,sh),Tu(n,"style",y),Tu(n,Yd,v||"")},update:S,style:function(e,t,r){Iu(r&&b||n,e,t)},isWithin:function(r,n){var i=Ku(r-t);return x||!d.rewind&&!e.is(Rh)||(i=Gu(i,e.length-i)),i<=n}};return j}var Vh=qu+"-interval";var $h={passive:!1,capture:!0};var Uh={Spacebar:" ",Right:Vd,Left:Bd,Up:$d,Down:Ud};function Hh(e){return e=ou(e)?e:e.key,Uh[e]||e}var qh="keydown";var Zh=qu+"-lazy",Gh=Zh+"-srcset",Wh="["+Zh+"], ["+Gh+"]";var Xh=[" ","Enter"];var Jh=Object.freeze({__proto__:null,Media:function(e,t,r){var n=e.state,i=r.breakpoints||{},a=r.reducedMotion||{},s=ad(),o=[];function l(e){e&&s.destroy()}function c(e,t){var r=matchMedia(t);s.bind(r,"change",u),o.push([e,r])}function u(){var t=n.is(7),i=r.direction,a=o.reduce((function(e,t){return ku(e,t[1].matches?t[0]:{})}),{});ju(r),d(a),r.destroy?e.destroy("completely"===r.destroy):t?(l(!0),e.mount()):i!==r.direction&&e.refresh()}function d(t,i,a){ku(r,t),i&&ku(Object.getPrototypeOf(r),t),!a&&n.is(1)||e.emit(gd,r)}return{setup:function(){var e="min"===r.mediaQuery;wu(i).sort((function(t,r){return e?+t-+r:+r-+t}
2)).forEach((function(t){c(i[t],"("+(e?"min":"max")+"-width:"+t+"px)")})),c(a,Gc),u()},destroy:l,reduce:function(e){matchMedia(Gc).matches&&(e?ku(r,a):ju(r,wu(a)))},set:d}},Direction:function(e,t,r){return{resolve:function(e,t,n){var i="rtl"!==(n=n||r.direction)||t?n===Hd?0:-1:1;return qd[e]&&qd[e][i]||e.replace(/width|left|right/i,(function(e,t){var r=qd[e.toLowerCase()][i]||e;return t>0?r.charAt(0).toUpperCase()+r.slice(1):r}))},orient:function(e){return e*("rtl"===r.direction?1:-1)}}},Elements:function(e,t,r){var n,i,a,s=Od(e),o=s.on,l=s.bind,c=e.root,u=r.i18n,d={},h=[],p=[],m=[];function f(){n=y("."+uh),i=bu(n,"."+dh),Zu(n&&i,"A track/list element is missing."),mu(h,xu(i,"."+hh+":not(."+ph+")")),Cu({arrows:fh,pagination:vh,prev:_h,next:yh,bar:bh,toggle:wh},(function(e,t){d[t]=y("."+e)})),Su(d,{root:c,track:n,list:i,slides:h}),function(){var e=c.id||function(e){return""+e+nd(id[e]=(id[e]||0)+1)}(Hu),t=r.role;c.id=e,n.id=n.id||e+"-track",i.id=i.id||e+"-list",!Au(c,Zd)&&"SECTION"!==c.tagName&&t&&Tu(c,Zd,t);Tu(c,rh,u.carousel),Tu(i,Zd,"presentation")}(),_()}function g(e){var t=sh.concat("style");Kc(h),Vu(c,p),Vu(n,m),Eu([n,i],t),Eu(c,e?t:["style",rh])}function _(){Vu(c,p),Vu(n,m),p=v(ch),m=v(uh),gu(c,p),gu(n,m),Tu(c,Yd,r.label),Tu(c,Qd,r.labelledby)}function y(e){var t=Fu(c,e);return t&&function(e,t){if(su(e.closest))return e.closest(t);for(var r=e;r&&1===r.nodeType&&!vu(r,t);)r=r.parentElement;return r}(t,"."+ch)===c?t:void 0}function v(e){return[e+"--"+r.type,e+"--"+r.direction,r.drag&&e+"--draggable",r.isNavigation&&e+"--nav",e===ch&&kh]}return Su(d,{setup:f,mount:function(){o(fd,g),o(fd,f),o(gd,_),l(document,Lh+" keydown",(function(e){a="keydown"===e.type}),{capture:!0}),l(c,"focusin",(function(){fu(c,Ih,!!a)}))},destroy:g})},Slides:function(e,t,r){var n=Od(e),i=n.on,a=n.emit,s=n.bind,o=t.Elements,l=o.slides,c=o.list,u=[];function d(){l.forEach((function(e,t){p(e,t,-1)}))}function h(){f((function(e){e.destroy()})),Kc(u)}function p(t,r,n){var i=Bh(e,r,n,t);i.mount(),u.push(i),u.sort((function(e,t){return e.index-t.index}))}function m(e){return e?g((function(e){return!e.isClone})):u}function f(e,t){m(t).forEach(e)}function g(e){return u.filter(su(e)?e:function(t){return ou(e)?vu(t.slide,e):pu(du(e),t.index)})}return{mount:function(){d(),i(fd,h),i(fd,d)},destroy:h,update:function(){f((function(e){e.update()}))},register:p,get:m,getIn:function(e){var n=t.Controller,i=n.toIndex(e),a=n.hasFocus()?1:r.perPage;return g((function(e){return Qu(e.index,i,i+a-1)}))},getAt:function(e){return g(e)[0]},add:function(e,t){hu(e,(function(e){if(ou(e)&&(e=Ou(e)),uu(e)){var n=l[t];n?yu(e,n):_u(c,e),gu(e,r.classes.slide),function(e,t){var r=Bu(e,"img"),n=r.length;n?r.forEach((function(e){s(e,"load error",(function(){--n||t()}))})):t()}(e,Qc(a,_d))}})),a(fd)},remove:function(e){zu(g(e).map((function(e){return e.slide}))),a(fd)},forEach:f,filter:g,style:function(e,t,r){f((function(n){n.style(e,t,r)}))},getLength:function(e){return e?l.length:u.length},isEnough:function(){return u.length>r.perPage}}},Layout:function(e,t,r){var n,i,a,s=Od(e),o=s.on,l=s.bind,c=s.emit,u=t.Slides,d=t.Direction.resolve,h=t.Elements,p=h.root,m=h.track,f=h.list,g=u.getAt,_=u.style;function y(){n=r.direction===Hd,Iu(p,"maxWidth",Uu(r.width)),Iu(m,d("paddingLeft"),x(!1)),Iu(m,d("paddingRight"),x(!0)),v(!0)}function v(e){var t=Du(p);(e||i.width!==t.width||i.height!==t.height)&&(Iu(m,"height",function(){var e="";n&&(Zu(e=b(),"height or heightRatio is missing."),e="calc("+e+" - "+x(!1)+" - "+x(!0)+")");return e}()),_(d("marginRight"),Uu(r.gap)),_("width",r.autoWidth?null:Uu(r.fixedWidth)||(n?"":w())),_("height",Uu(r.fixedHeight)||(n?r.autoHeight?null:w():b()),!0),i=t,c(yd),a!==(a=T())&&(fu(p,Mh,a),c("overflow",a)))}function x(e){var t=r.padding,n=d(e?"right":"left");return t&&Uu(t[n]||(iu(t)?0:t))||"0px"}function b(){return Uu(r.height||Du(f).width*r.heightRatio)}function w(){var e=Uu(r.gap);return"calc((100%"+(e&&" + "+e)+")/"+(r.perPage||1)+(e&&" - "+e)+")"}function C(){return Du(f)[d("width")]}function S(e,t){var r=g(e||0);return r?Du(r.slide)[d("width")]+(t?0:E()):0}function k(e,t){var r=g(e);
vendor: 5,185 bytes, line 2
2if(r){var n=Du(r.slide)[d("right")],i=Du(f)[d("left")];return Ku(n-i)+(t?0:E())}return 0}function j(t){return k(e.length-1)-k(0)+S(0,t)}function E(){var e=g(0);return e&&parseFloat(Iu(e.slide,d("marginRight")))||0}function T(){return e.is(Fh)||j(!0)>C()}return{mount:function(){y(),l(window,"resize load",function(e,t){var r=Rd(t||0,e,null,1);return function(){r.isPaused()&&r.start()}}(Qc(c,_d))),o([gd,fd],y),o(_d,v)},resize:v,listSize:C,slideSize:S,sliderSize:j,totalSize:k,getPadding:function(e){return parseFloat(Iu(m,d("padding"+(e?"Right":"Left"))))||0},isOverflow:T}},Clones:function(e,t,r){var n,i=Od(e),a=i.on,s=t.Elements,o=t.Slides,l=t.Direction.resolve,c=[];function u(){a(fd,d),a([gd,_d],p),(n=m())&&(!function(t){var n=o.get().slice(),i=n.length;if(i){for(;n.length<t;)mu(n,n);mu(n.slice(-t),n.slice(0,t)).forEach((function(a,l){var u=l<t,d=function(t,n){var i=t.cloneNode(!0);return gu(i,r.classes.clone),i.id=e.root.id+"-clone"+nd(n+1),i}(a.slide,l);u?yu(d,n[0].slide):_u(s.list,d),mu(c,d),o.register(d,l-t+(u?0:i),a.index)}))}}(n),t.Layout.resize(!0))}function d(){h(),u()}function h(){zu(c),Kc(c),i.destroy()}function p(){var e=m();n!==e&&(n<e||!e)&&i.emit(fd)}function m(){var n=r.clones;if(e.is(Rh)){if(lu(n)){var i=r[l("fixedWidth")]&&t.Layout.slideSize(0);n=i&&Ju(Du(s.track)[l("width")]/i)||r[l("autoWidth")]&&e.length||2*r.perPage}}else n=0;return n}return{mount:u,destroy:h}},Move:function(e,t,r){var n,i=Od(e),a=i.on,s=i.emit,o=e.state.set,l=t.Layout,c=l.slideSize,u=l.getPadding,d=l.totalSize,h=l.listSize,p=l.sliderSize,m=t.Direction,f=m.resolve,g=m.orient,_=t.Elements,y=_.list,v=_.track;function x(){t.Controller.isBusy()||(t.Scroll.cancel(),b(e.index),t.Slides.update())}function b(e){w(j(e,!0))}function w(r,n){if(!e.is(Fh)){var i=n?r:function(r){if(e.is(Rh)){var n=k(r),i=n>t.Controller.getEnd();(n<0||i)&&(r=C(r,i))}return r}(r);Iu(y,"transform","translate"+f("X")+"("+i+"px)"),r!==i&&s(Dd)}}function C(e,t){var r=e-T(t),n=p();return e-=g(n*(Ju(Ku(r)/n)||1))*(t?1:-1)}function S(){w(E(),!0),n.cancel()}function k(e){for(var r=t.Slides.get(),n=0,i=1/0,a=0;a<r.length;a++){var s=r[a].index,o=Ku(j(s,!0)-e);if(!(o<=i))break;i=o,n=s}return n}function j(t,n){var i=g(d(t-1)-function(e){var t=r.focus;return"center"===t?(h()-c(e,!0))/2:+t*c(e)||0}(t));return n?function(t){r.trimSpace&&e.is(Oh)&&(t=ed(t,0,g(p(!0)-h())));return t}(i):i}function E(){var e=f("left");return Du(y)[e]-Du(v)[e]+g(u(!1))}function T(e){return j(e?t.Controller.getEnd():0,!!r.trimSpace)}return{mount:function(){n=t.Transition,a([sd,yd,gd,fd],x)},move:function(e,t,r,i){e!==t&&function(e){var t=g(C(E(),e));return e?t>=0:t<=y[f("scrollWidth")]-Du(v)[f("width")]}(e>r)&&(S(),w(C(E(),e>r),!0)),o(Wc),s(ld,t,r,e),n.start(t,(function(){o(3),s(cd,t,r,e),i&&i()}))},jump:b,translate:w,shift:C,cancel:S,toIndex:k,toPosition:j,getPosition:E,getLimit:T,exceededLimit:function(e,t){t=lu(t)?E():t;var r=!0!==e&&g(t)<g(T(!1)),n=!1!==e&&g(t)>g(T(!0));return r||n},reposition:x}},Controller:function(e,t,r){var n,i,a,s,o=Od(e),l=o.on,c=o.emit,u=t.Move,d=u.getPosition,h=u.getLimit,p=u.toPosition,m=t.Slides,f=m.isEnough,g=m.getLength,_=r.omitEnd,y=e.is(Rh),v=e.is(Oh),x=Qc(j,!1),b=Qc(j,!0),w=r.start||0,C=w;function S(){i=g(!0),a=r.perMove,s=r.perPage,n=P();var e=ed(w,0,_?n:i-1);e!==w&&(w=e,u.reposition())}function k(){n!==P()&&c(zd)}function j(e,t){var r=a||(A()?1:s),i=E(w+r*(e?-1:1),w,!(a||A()));return-1===i&&v&&!Yu(d(),h(!e),1)?e?0:n:t?i:T(i)}function E(t,o,l){if(f()||A()){var c=function(t){if(v&&"move"===r.trimSpace&&t!==w)for(var n=d();n===p(t,!0)&&Qu(t,0,e.length-1,!r.rewind);)t<w?--t:++t;return t}(t);c!==t&&(o=t,t=c,l=!1),t<0||t>n?t=a||!Qu(0,t,o,!0)&&!Qu(n,o,t,!0)?y?l?t<0?-(i%s||s):i:t:r.rewind?t<0?n:0:-1:I(M(t)):l&&t!==o&&(t=I(M(o)+(t<o?-1:1)))}else t=-1;return t}function T(e){return y?(e+i)%i||0:e}function P(){for(var e=i-(A()||y&&a?1:s);_&&e-- >0;)if(p(i-1,!0)!==p(e,!0)){e++;break}return ed(e,0,i-1)}function I(e){return ed(A()?e:s*e,0,n)}function M(e){return A()?Gu(e,n):Xu((e>=n?i-1:e)/s)}function N(e){e!==w&&(C=w,w=e)}function A(){return!lu(r.focus)||r.isNavigation}function L(){return e.state.is([Wc,Xc])&&!!r.waitForTransition}return{mount:function(){S(),l([gd,fd,zd],S),l(yd,k)},go:function(e,t,r){if(!L()){var i=function(e){var t=w;if(ou(e)){var r=e.match(/([+\-<>])(\d+)?/)||[],i=r[1],a=r[2];"+"===i||"-"===i?t=E(w+ +(""+i+(+a||1)),w):">"===i?t=a?I(+a):x(!0):"<"===i&&(t=b(!0))}else t=y?e:ed(e,0,n);return t}(e),a=T(i);a>-1&&(t||a!==w)&&(N(a),u.move(i,a,C,r))}},scroll:function(e,r,i,a){t.Scroll.scroll(e,r,i,(function(){var e=T(u.toIndex(d()));N(_?Gu(e,n):e),a&&a()}))},getNext:x,getPrev:b,getAdjacent:j,getEnd:P,setIndex:N,getIndex:function(e){return e?C:w},toIndex:I,toPage:M,toDest:function(e){var t=u.toIndex(e);return v?ed(t,0,n):t},hasFocus:A,isBusy:L}},Arrows:function(e,t,r){var n,i,a=Od(e),s=a.on,o=a.bind,l=a.emit,c=r.classes,u=r.i18n,d=t.Elements,h=t.Controller,p=d.arrows,m=d.track,f=p,g=d.prev,_=d.next,y={};function v(){!function(){var e=r.arrows;!e||g&&_||(f=p||Pu("div",c.arrows),g=C(!0),_=C(!1),n=!0,_u(f,[g,_]),!p&&yu(f,m));g&&_&&(Su(y,{prev:g,next:_}),Mu(f,e?"":"none"),gu(f,i=fh+"--"+r.direction),e&&(s([sd,cd,fd,Cd,zd],S),o(_,"click",Qc(w,">
2")),o(g,"click",Qc(w,"<")),S(),Tu([g,_],Xd,m.id),l(kd,g,_)))}(),s(gd,x)}function x(){b(),v()}function b(){a.destroy(),Vu(f,i),n?(zu(p?[g,_]:f),g=_=null):Eu([g,_],sh)}function w(e){h.go(e,!0)}function C(e){return Ou('<button class="'+c.arrow+" "+(e?c.prev:c.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(r.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function S(){if(g&&_){var t=e.index,r=h.getPrev(),n=h.getNext(),i=r>-1&&t<r?u.last:u.prev,a=n>-1&&t>n?u.first:u.next;g.disabled=r<0,_.disabled=n<0,Tu(g,Yd,i),Tu(_,Yd,a),l(jd,g,_,r,n)}}return{arrows:y,mount:v,destroy:b,update:S}},Autoplay:function(e,t,r){var n,i,a=Od(e),s=a.on,o=a.bind,l=a.emit,c=Rd(r.interval,e.go.bind(e,">"),(function(e){var t=d.bar;t&&Iu(t,"width",100*e+"%"),l(Md,e)})),u=c.isPaused,d=t.Elements,h=t.Elements,p=h.root,m=h.toggle,f=r.autoplay,g="pause"===f;function _(){u()&&t.Slides.isEnough()&&(c.start(!r.resetProgress),i=n=g=!1,x(),l(Id))}function y(e){void 0===e&&(e=!0),g=!!e,x(),u()||(c.pause(),l(Nd))}function v(){g||(n||i?y(!1):_())}function x(){m&&(fu(m,kh,!g),Tu(m,Yd,r.i18n[g?"play":"pause"]))}function b(e){var n=t.Slides.getAt(e);c.set(n&&+Au(n.slide,Vh)||r.interval)}return{mount:function(){f&&(!function(){r.pauseOnHover&&o(p,"mouseenter mouseleave",(function(e){n="mouseenter"===e.type,v()}));r.pauseOnFocus&&o(p,"focusin focusout",(function(e){i="focusin"===e.type,v()}));m&&o(m,"click",(function(){g?_():y(!0)}));s([ld,wd,fd],c.rewind),s(ld,b)}(),m&&Tu(m,Xd,d.track.id),g||_(),x())},destroy:c.cancel,play:_,pause:y,isPaused:u}},Cover:function(e,t,r){var n=Od(e).on;function i(e){t.Slides.forEach((function(t){var r=bu(t.container||t.slide,"img");r&&r.src&&a(e,r,t)}))}function a(e,t,r){r.style("background",e?'center/cover no-repeat url("'+t.src+'")':"",!0),Mu(t,e?"none":"")}return{mount:function(){r.cover&&(n(Ad,Qc(a,!0)),n([sd,gd,fd],Qc(i,!0)))},destroy:Qc(i,!1)}},Scroll:function(e,t,r){var n,i,a=Od(e),s=a.on,o=a.emit,l=e.state.set,c=t.Move,u=c.getPosition,d=c.getLimit,h=c.exceededLimit,p=c.translate,m=e.is(Oh),f=1;function g(e,r,a,s,d){var p=u();if(v(),a&&(!m||!h())){var g=t.Layout.sliderSize(),x=td(e)*g*Xu(Ku(e)/g)||0;e=c.toPosition(t.Controller.toDest(e%g))+x}var b=Yu(p,e,1);f=1,r=b?0:r||Wu(Ku(e-p)/1.5,800),i=s,n=Rd(r,_,Qc(y,p,e,d),1),l(Xc),o(wd),n.start()}function _(){l(3),i&&i(),o(Cd)}function y(e,t,n,a){var s=u(),o=e+(t-e)*function(e){var t=r.easingFunc;return t?t(e):1-Math.pow(1-e,4)}(a),l=(o-s)*f;p(s+l),m&&!n&&h()&&(f*=.6,Ku(l)<10&&g(d(h(!0)),600,!1,i,!0))}function v(){n&&n.cancel()}function x(){n&&!n.isPaused()&&(v(),_())}return{mount:function(){s(ld,v),s([gd,fd],x)},destroy:v,scroll:g,cancel:x}},Drag:function(e,t,r){var n,i,a,s,o,l,c,u,d=Od(e),h=d.on,p=d.emit,m=d.bind,f=d.unbind,g=e.state,_=t.Move,y=t.Scroll,v=t.Controller,x=t.Elements.track,b=t.Media.reduce,w=t.Direction,C=w.resolve,S=w.orient,k=_.getPosition,j=_.exceededLimit,E=!1;function T(){var e=r.drag;F(!e),s="free"===e}function P(e){if(l=!1,!c){var t=R(e);!function(e){var t=r.noDrag;return!vu(e,"."+xh+", ."+gh)&&(!t||!vu(e,t))}(e.target)||!t&&e.button||(v.isBusy()?Ru(e,!0):(u=t?x:window,o=g.is([Wc,Xc]),a=null,m(u,Dh,I,$h),m(u,zh,M,$h),_.cancel(),y.cancel(),A(e)))}}function I(t){if(g.is(6)||(g.set(6),p(vd)),t.cancelable)if(o){_.translate(n+L(t)/(E&&e.is(Oh)?5:1));var i=D(t)>200,a=E!==(E=j());(i||a)&&A(t),l=!0,p(xd),Ru(t)}else(function(e){return Ku(L(e))>Ku(L(e,!0))})(t)&&(o=function(e){var t=r.dragMinThreshold,n=iu(t),i=n&&t.mouse||0,a=(n?t.touch:+t)||10;return Ku(L(e))>(R(e)?a:i)}(t),Ru(t))}function M(n){g.is(6)&&(g.set(3),p(bd)),o&&(!function(n){var i=function(t){if(e.is(Rh)||!E){var r=D(t);if(r&&r<200)return L(t)/r}return 0}(n),a=function(e){return k()+td(e)*Gu(Ku(e)*(r.flickPower||600),s?1/0:t.Layout.listSize()*(r.flickMaxPages||1))}(i),o=r.rewind&&r.rewindByDrag;b(!1),s?v.scroll(a,0,r.snap):e.is(Fh)?v.go(S(td(i))<0?o?"<":"-":o?">":"+"):e.is(Oh)&&E&&o?v.go(j(!0)?">":"<"):v.go(v.toDest(a),!0);b(!0)}(n),Ru(n)),f(u,Dh,I),f(u,zh,M),o=!1}function N(e){!c&&l&&Ru(e,!0)}function A(e){a=i,i=e,n=k()}function L(e,t){return O(e,t)-O(z(e),t)}function D(e){return $u(e)-$u(z(e))}function z(e){return i===e&&a||i}function O(e,t){return(R(e)?e.changedTouches[0]:e)["page"+C(t?"Y":"X")]}function R(e){return"undefined"!==typeof TouchEvent&&e instanceof TouchEvent}function F(e){c=e}return{mount:function(){m(x,Dh,tu,$h),m(x,zh,tu,$h),m(x,Lh,P,$h),m(x,"click",N,{capture:!0}),m(x,"dragstart",Ru),h([sd,gd],T)},disable:F,isDragging:function(){return o}}},Keyboard:function(e,t,r){var n,i,a=Od(e),s=a.on,o=a.bind,l=a.unbind,c=e.root,u=t.Direction.resolve;function d(){var e=r.keyboard;e&&(n="global"===e?window:c,o(n,qh,m))}function h(){l(n,qh)}function p(){var e=i;i=!0,eu((function(){i=e}))}function m(t){if(!i){var r=Hh(t);
2r===u(Bd)?e.go("<"):r===u(Vd)&&e.go(">")}}return{mount:function(){d(),s(gd,h),s(gd,d),s(ld,p)},destroy:h,disable:function(e){i=e}}},LazyLoad:function(e,t,r){var n=Od(e),i=n.on,a=n.off,s=n.bind,o=n.emit,l="sequential"===r.lazyLoad,c=[cd,Cd],u=[];function d(){Kc(u),t.Slides.forEach((function(e){Bu(e.slide,Wh).forEach((function(t){var n=Au(t,Zh),i=Au(t,Gh);if(n!==t.src||i!==t.srcset){var a=r.classes.spinner,s=t.parentElement,o=bu(s,"."+a)||Pu("span",a,s);u.push([t,e,o]),t.src||Mu(t,"none")}}))})),l?f():(a(c),i(c,h),h())}function h(){(u=u.filter((function(t){var n=r.perPage*((r.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,n)||p(t)}))).length||a(c)}function p(e){var t=e[0];gu(e[1].slide,Ph),s(t,"load error",Qc(m,e)),Tu(t,"src",Au(t,Zh)),Tu(t,"srcset",Au(t,Gh)),Eu(t,Zh),Eu(t,Gh)}function m(e,t){var r=e[0],n=e[1];Vu(n.slide,Ph),"error"!==t.type&&(zu(e[2]),Mu(r,""),o(Ad,r,n),o(_d)),l&&f()}function f(){u.length&&p(u.shift())}return{mount:function(){r.lazyLoad&&(d(),i(fd,d))},destroy:Qc(Kc,u),check:h}},Pagination:function(e,t,r){var n,i,a=Od(e),s=a.on,o=a.emit,l=a.bind,c=t.Slides,u=t.Elements,d=t.Controller,h=d.hasFocus,p=d.getIndex,m=d.go,f=t.Direction.resolve,g=u.pagination,_=[];function y(){n&&(zu(g?Yc(n.children):n),Vu(n,i),Kc(_),n=null),a.destroy()}function v(e){m(">"+e,!0)}function x(e,t){var r=_.length,n=Hh(t),i=b(),a=-1;n===f(Vd,!1,i)?a=++e%r:n===f(Bd,!1,i)?a=(--e+r)%r:"Home"===n?a=0:"End"===n&&(a=r-1);var s=_[a];s&&(Nu(s.button),m(">"+a),Ru(t,!0))}function b(){return r.paginationDirection||r.direction}function w(e){return _[d.toPage(e)]}function C(){var e=w(p(!0)),t=w(p());if(e){var r=e.button;Vu(r,kh),Eu(r,Kd),Tu(r,Gd,-1)}if(t){var i=t.button;gu(i,kh),Tu(i,Kd,!0),Tu(i,Gd,"")}o(Td,{list:n,items:_},e,t)}return{items:_,mount:function t(){y(),s([gd,fd,zd],t);var a=r.pagination;g&&Mu(g,a?"":"none"),a&&(s([ld,wd,Cd],C),function(){var t=e.length,a=r.classes,s=r.i18n,o=r.perPage,p=h()?d.getEnd()+1:Ju(t/o);gu(n=g||Pu("ul",a.pagination,u.track.parentElement),i=vh+"--"+b()),Tu(n,Zd,"tablist"),Tu(n,Yd,s.select),Tu(n,th,b()===Hd?"vertical":"");for(var m=0;m<p;m++){var f=Pu("li",null,n),y=Pu("button",{class:a.page,type:"button"},f),w=c.getIn(m).map((function(e){return e.slide.id})),C=!h()&&o>1?s.pageX:s.slideX;l(y,"click",Qc(v,m)),r.paginationKeyboard&&l(y,"keydown",Qc(x,m)),Tu(f,Zd,"presentation"),Tu(y,Zd,"tab"),Tu(y,Xd,w.join(" ")),Tu(y,Yd,rd(C,m+1)),Tu(y,Gd,-1),_.push({li:f,button:y,page:m})}}(),C(),o(Ed,{list:n,items:_},w(e.index)))},destroy:y,getAt:w,update:C}},Sync:function(e,t,r){var n=r.isNavigation,i=r.slideFocus,a=[];function s(){e.splides.forEach((function(t){t.isParent||(l(e,t.splide),l(t.splide,e))})),n&&function(){var t=Od(e),r=t.on;r(ud,u),r(Ld,d),r([sd,gd],c),a.push(t),t.emit(Pd,e.splides)}()}function o(){a.forEach((function(e){e.destroy()})),Kc(a)}function l(e,t){var r=Od(e);r.on(ld,(function(e,r,n){t.go(t.is(Rh)?n:e)})),a.push(r)}function c(){Tu(t.Elements.list,th,r.direction===Hd?"vertical":"")}function u(t){e.go(t.index)}function d(e,t){pu(Xh,Hh(t))&&(u(e),Ru(t))}return{setup:Qc(t.Media.set,{slideFocus:lu(i)?n:i},!0),mount:s,destroy:o,remount:function(){o(),s()}}},Wheel:function(e,t,r){var n=Od(e).bind,i=0;function a(n){if(n.cancelable){var a=n.deltaY,s=a<0,o=$u(n),l=r.wheelMinThreshold||0,c=r.wheelSleep||0;Ku(a)>l&&o-i>c&&(e.go(s?"<":">"),i=o),function(n){return!r.releaseWheel||e.state.is(Wc)||-1!==t.Controller.getAdjacent(n)}(s)&&Ru(n)}}return{mount:function(){r.wheel&&n(t.Elements.track,"wheel",a,$h)}}},Live:function(e,t,r){var n=Od(e).on,i=t.Elements.track,a=r.live&&!r.isNavigation,s=Pu("span",Ch),o=Rd(90,Qc(l,!1));function l(e){Tu(i,ih,e),e?(_u(i,s),o.start()):(zu(s),o.cancel())}function c(e){a&&Tu(i,nh,e?"off":"polite")}return{mount:function(){a&&(c(!t.Autoplay.isPaused()),Tu(i,ah,!0),s.textContent="\u2026",n(Id,Qc(c,!0)),n(Nd,Qc(c,!1)),n([cd,Cd],Qc(l,!0)))},disable:c,destroy:function(){Eu(i,[nh,ah,ih]),zu(s)}}}}),Kh={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace
2:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Ah,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Yh(e,t,r){var n=t.Slides;function i(){n.forEach((function(e){e.style("transform","translateX(-"+100*e.index+"%)")}))}return{mount:function(){Od(e).on([sd,fd],i)},start:function(e,t){n.style("transition","opacity "+r.speed+"ms "+r.easing),eu(t)},cancel:tu}}function Qh(e,t,r){var n,i=t.Move,a=t.Controller,s=t.Scroll,o=t.Elements.list,l=Qc(Iu,o,"transition");function c(){l(""),s.cancel()}return{mount:function(){Od(e).bind(o,"transitionend",(function(e){e.target===o&&n&&(c(),n())}))},start:function(t,o){var c=i.toPosition(t,!0),u=i.getPosition(),d=function(t){var n=r.rewindSpeed;if(e.is(Oh)&&n){var i=a.getIndex(!0),s=a.getEnd();if(0===i&&t>=s||i>=s&&0===t)return n}return r.speed}(t);Ku(c-u)>=1&&d>=1?r.useScroll?s.scroll(c,d,!1,o):(l("transform "+d+"ms "+r.easing),i.translate(c,!0),n=o):(i.jump(t),o())},cancel:c}}var ep=function(){function e(t,r){this.event=Od(),this.Components={},this.state=function(e){var t=e;return{set:function(e){t=e},is:function(e){return pu(du(e),t)}}}(1),this.splides=[],this._o={},this._E={};var n=ou(t)?Fu(document,t):t;Zu(n,n+" is invalid."),this.root=n,r=ku({label:Au(n,Yd)||"",labelledby:Au(n,Qd)||""},Kh,e.defaults,r||{});try{ku(r,JSON.parse(Au(n,qu)))}catch(i){Zu(!1,"Invalid JSON")}this._o=Object.create(ku({},r))}var t,r,n,i=e.prototype;return i.mount=function(e,t){var r=this,n=this.state,i=this.Components;return Zu(n.is([1,7]),"Already mounted!"),n.set(1),this._C=i,this._T=t||this._T||(this.is(Fh)?Yh:Qh),this._E=e||this._E,Cu(Su({},Jh,this._E,{Transition:this._T}),(function(e,t){var n=e(r,i,r._o);i[t]=n,n.setup&&n.setup()})),Cu(i,(function(e){e.mount&&e.mount()})),this.emit(sd),gu(this.root,Sh),n.set(3),this.emit(od),this},i.sync=function(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),e.Components.Sync.remount()),this},i.go=function(e){return this._C.Controller.go(e),this},i.on=function(e,t){return this.event.on(e,t),this},i.off=function(e){return this.event.off(e),this},i.emit=function(e){var t;return(t=this.event).emit.apply(t,[e].concat(Yc(arguments,1))),this},i.add=function(e,t){return this._C.Slides.add(e,t),this},i.remove=function(e){return this._C.Slides.remove(e),this},i.is=function(e){return this._o.type===e},i.refresh=function(){return this.emit(fd),this},i.destroy=function(e){void 0===e&&(e=!0);var t=this.event,r=this.state;return r.is(1)?Od(this).on(od,this.destroy.bind(this,e)):(Cu(this._C,(function(t){t.destroy&&t.destroy(e)}),!0),t.emit(Sd),t.destroy(),e&&Kc(this.splides),r.set(7)),this},t=e,r=[{key:"options",get:function(){return this._o},set:function(e){this._C.Media.set(e,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}],r&&Zc(t.prototype,r),n&&Zc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),tp=ep;tp.defaults={},tp.STATES=Jc;var rp=[[sd,"onMounted"],[od,"onReady"],[ld,"onMove"],[cd,"onMoved"],[ud,"onClick"],[dd,"onActive"],[hd,"onInactive"],[pd,"onVisible"],[md,"onHidden"],[fd,"onRefresh"],[gd,"onUpdated"],[_d,"onResize"],[yd,"onResized"],[vd,"onDrag"],[xd,"onDragging"],[bd,"onDragged"],[wd,"onScroll"],[Cd,"onScrolled"],[Sd,"onDestroy"],[kd,"onArrowsMounted"],[jd,"onArrowsUpdated"],[Ed,"onPaginationMounted"],[Td,"onPaginationUpdated"],[Pd,"onNavigationMounted"],[Id,"onAutoplayPlay"],[Md,"onAutoplayPlaying"],[Nd,"onAutoplayPause"],[Ad,"onLazyLoadLoaded"]];function np(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}function ip(e){return null!==e&&"object"===typeof e}function ap(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some(((e,r)=>!ap(e,t[r])));if(ip(e)&&ip(t)){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&!r.some((r=>!Object.prototype.hasOwnProperty.call(t,r)||!ap(e[r],t[r])))}return e===t}function sp(e,t){const r=e;return function(e,t){if(e){const r=Object.keys(e);for(let n=0;n<r.length;n++){const i=r[n];if("__proto__"!==i&&!1===t(e[i],i))break}}}(t,((e,t)=>
2{Array.isArray(e)?r[t]=e.slice():ip(e)?r[t]=sp(ip(r[t])?r[t]:{},e):r[t]=e})),r}var op=t=>{let{children:r,className:n,...i}=t;return e.createElement("div",{className:np("splide__track",n),...i},e.createElement("ul",{className:"splide__list"},r))},lp=class extends e.Component{constructor(){super(...arguments),this.splideRef=e.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:r}=this.props,{current:n}=this.splideRef;n&&(this.splide=new tp(n,e),this.bind(this.splide),this.splide.mount(t,r),this.options=sp({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!ap(this.options,e)&&(this.splide.options=e,this.options=sp({},e));const t=this.getSlides();var r,n;r=this.slides,n=t,(r.length!==n.length||r.some(((e,t)=>e!==n[t])))&&(this.splide.refresh(),this.slides=t)}sync(e){var t;null==(t=this.splide)||t.sync(e)}go(e){var t;null==(t=this.splide)||t.go(e)}getSlides(){var e;if(this.splide){const t=null==(e=this.splide.Components.Elements)?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){rp.forEach((t=>{let[r,n]=t;const i=this.props[n];"function"===typeof i&&e.on(r,(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];i(e,...r)}))}))}omit(e,t){return t.forEach((t=>{Object.prototype.hasOwnProperty.call(e,t)&&delete e[t]})),e}render(){const{className:t,tag:r="div",hasTrack:n=!0,children:i,...a}=this.props;return e.createElement(r,{className:np("splide",t),ref:this.splideRef,...this.omit(a,["options",...rp.map((e=>e[1]))])},n?e.createElement(op,null,i):i)}},cp=t=>{let{children:r,className:n,...i}=t;return e.createElement("li",{className:np("splide__slide",n),...i},r)};var up=()=>(0,Dr.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsx)("ellipse",{cx:"20.2273",cy:"19.9607",rx:"17.7954",ry:"17.8042",transform:"rotate(180 20.2273 19.9607)",fill:"white"}),(0,Dr.jsx)("path",{d:"M22.3431 11.375C22.7188 11.375 23.0944 11.5134 23.391 11.8102C23.9644 12.3839 23.9644 13.3334 23.391 13.9071L17.6174 19.6836L23.6283 25.6974C24.2017 26.2711 24.2017 27.2207 23.6283 27.7943C23.0549 28.368 22.1058 28.368 21.5324 27.7943L14.4736 20.732C13.9002 20.1583 13.9002 19.2088 14.4736 18.6351L21.2951 11.8102C21.5917 11.5134 21.9674 11.375 22.3431 11.375Z",fill:"#584646"}),(0,Dr.jsx)("path",{d:"M20.0099 -5.8818e-06C21.8685 -6.04429e-06 23.6085 0.850637 24.7355 2.27497C26.436 1.60237 28.3737 1.72106 29.9951 2.67061C31.6164 3.62017 32.6841 5.22254 32.9609 7.02274C34.78 7.29969 36.3816 8.38773 37.3109 10.0099C38.2402 11.632 38.3786 13.5509 37.7064 15.2522C39.13 16.3798 40 18.1207 40 20C40 21.8793 39.13 23.6202 37.7064 24.7478C38.3786 26.4491 38.2402 28.3679 37.3109 30.0099C36.3816 31.632 34.78 32.7201 32.9609 32.9772C32.7039 34.7774 31.6164 36.3996 29.9951 37.3294C28.3539 38.2591 26.436 38.3778 24.7355 37.725C23.5887 39.1494 21.8685 40.0198 19.9901 40.0198C18.1117 40.0198 16.3717 39.1494 15.2249 37.725C13.5245 38.3778 11.6065 38.2591 9.98517 37.3492C8.36382 36.3996 7.2961 34.7972 7.01928 32.9772C5.21997 32.7201 3.61839 31.6518 2.66931 30.0099C1.72022 28.3877 1.60158 26.4491 2.27385 24.7478C0.850222 23.6202 -0.0197732 21.8793 -0.0197733 20C-0.0197735 18.1207 0.850221 16.3798 2.27385 15.2522C1.60158 13.5509 1.73999 11.632 2.66931 9.9901C3.61839 8.36795 5.21997 7.2997 7.01928 7.02274C7.29609 5.22254 8.36381 3.60039 9.98517 2.67061C11.6065 1.72106 13.5245 1.60237 15.2249 2.27497C16.3717 0.850638 18.1117 -5.71586e-06 19.9703 -5.87835e-06L20.0099 -5.8818e-06ZM24.2215 5.73689C24.1028 5.73689 23.9644 5.73689 23.8458 5.69732C23.4108 5.57863 23.0549 5.28189 22.8571 4.86646C22.3628 3.71908 21.2358 2.98713 20.0099 2.98713C18.784 2.98713 17.6372 3.71908 17.1429 4.86646C16.9649 5.28189 16.5892 5.59841 16.1542 5.69732C15.7192 5.81602 15.2447 5.71711 14.8888 5.44015C13.9001 4.68842 12.5754 4.60929 11.5077 5.24233C10.4202 5.87536 9.82699 7.06231 9.9654 8.3086C10.0247 8.76359 9.86653 9.19881 9.5
25017 9.51533C9.23381 9.83185 8.77904 9.9901 8.34404 9.93076C7.09837 9.79228 5.91201 10.4055 5.27929 11.4738C4.64657 12.542 4.72566 13.8872 5.47701 14.8764C5.75383 15.2324 5.83292 15.7072 5.71428 16.1622C5.59565 16.5974 5.27929 16.9733 4.86406 17.1513C3.71725 17.6459 2.98567 18.7537 2.98567 20C2.98567 21.2463 3.71725 22.3739 4.86406 22.8487C5.27929 23.0267 5.59565 23.3828 5.71429 23.8378C5.83292 24.2928 5.73406 24.7478 5.47702 25.1236C4.72566 26.1128 4.64657 27.458 5.27929 28.5262C5.91201 29.6142 7.09837 30.2077 8.32427 30.0495C8.77904 29.9901 9.23381 30.1484 9.55017 30.4649C9.86654 30.7814 10.0247 31.2364 9.98517 31.6914C9.84676 32.9377 10.4597 34.1444 11.5274 34.7774C12.5952 35.3907 13.9199 35.3116 14.9283 34.5796C15.2842 34.3027 15.7588 34.2235 16.1938 34.3422C16.6288 34.4609 16.9847 34.7577 17.1626 35.1731C17.6569 36.3205 18.8038 37.0524 20.0297 37.0524C21.2556 37.0524 22.3826 36.3205 22.8769 35.1731C23.0549 34.7577 23.4108 34.4609 23.8458 34.3422C24.2808 34.2235 24.7553 34.3224 25.1112 34.5796C26.0999 35.3116 27.4642 35.3907 28.5517 34.7774C29.6194 34.1642 30.2126 32.9575 30.0544 31.7112C29.9951 31.2562 30.1532 30.8012 30.4696 30.4847C30.786 30.1681 31.2605 30.0099 31.6955 30.0692C32.9214 30.2275 34.1275 29.634 34.7405 28.5658C35.3732 27.4777 35.2941 26.1325 34.5428 25.1434C34.2659 24.7675 34.1868 24.3126 34.3055 23.8576C34.4241 23.4026 34.7405 23.0465 35.1557 22.8684C36.3025 22.3937 37.0341 21.2661 37.0341 20.0198C37.0341 18.7735 36.3025 17.6657 35.1557 17.1711C34.7405 16.9931 34.4241 16.637 34.3055 16.182C34.1868 15.7468 34.2857 15.272 34.5428 14.8961C35.2941 13.907 35.3732 12.5618 34.7405 11.4936C34.1275 10.4055 32.9214 9.81206 31.6757 9.95054C31.221 10.0099 30.7662 9.85162 30.4498 9.51532C30.1335 9.19881 29.9753 8.74381 30.0346 8.28881C30.1928 7.06231 29.5798 5.87536 28.5121 5.24233C27.4246 4.60929 26.0998 4.68842 25.1112 5.44015C24.8542 5.63798 24.5378 5.73689 24.2215 5.73689Z",fill:"#584646"})]});var dp=t=>{let{cartId:r}=t;const[n,i]=(0,e.useState)(null),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(!1);let c=y((e=>e.location.location));return(0,e.useEffect)((()=>{(async()=>{if(s(!0),c.id){const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/eligible-upsell-items/${t}`,null,null))(r,c.id);e&&e.length>0&&Pr("cartUpsells",e);let t=e.find((e=>e.imagepath));t&&l(t.imagepath),i(e)}s(!1)})()}),[r,c]),(0,Dr.jsxs)("div",{className:Fc,children:[a&&(0,Dr.jsx)("div",{className:"text-center",children:(0,Dr.jsx)("span",{className:"loader dark"})}),!a&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h5",{className:Vc,children:"Don't Forget!"}),n&&n.length>0&&(0,Dr.jsx)(Dr.Fragment,{children:n.map((e=>(0,Dr.jsxs)("div",{className:Bc,children:[(0,Dr.jsx)("div",{className:$c,children:e.title}),e.items&&e.items.length>0&&(0,Dr.jsx)("div",{className:"card_alt_items",children:(0,Dr.jsxs)(lp,{className:"splide-custom-arrows","aria-label":"Rewards",hasTrack:!1,options:{rewind:!1,perPage:2,pagination:!1,gap:"1rem",arrows:!0},children:[(0,Dr.jsx)(op,{children:e.items.map((t=>(0,Dr.jsx)(cp,{children:(0,Dr.jsx)(qc,{item:t,imgPath:e.imagepath?e.imagepath:o})},t.id)))}),(0,Dr.jsxs)("div",{className:"splide__arrows",children:[(0,Dr.jsxs)("button",{className:"splide__arrow splide__arrow--prev",children:[(0,Dr.jsx)(up,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"Prev"})]}),(0,Dr.jsxs)("button",{className:"splide__arrow splide__arrow--next",children:[(0,Dr.jsx)(ka,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"Next"})]})]})]})})]},e.title)))})]})]})};var hp=t=>{let{items:r,cartId:n,totalPrice:i}=t;const a=E(),[s,o]=(0,e.useState)(!1);let l=y((e=>e.cart.cart)),c=y((e=>e.location.location));(0,e.useEffect)((()=>{(async e=>{const t=await yr(e.id);t.id?a(vs.addCart(t)):console.log("error::::: ",t)})(l)}),[]);return(0,Dr.jsxs)(Dr.Fragment,{children:[r.map((e=>(0,Dr.jsx)(Rc,{data:e},e.id))),(0,Dr.jsx)(dp,{cartId:n}),(0,Dr.jsxs)("div",{className:xc.order_total_container,children:[(0,Dr.jsxs)("div",{className:xc.order_total_header,children:[(0,Dr.jsx)("h3",{children:"Order total"}),(0,Dr.jsxs)("span",{children:["$",ia(l.total)]})]}),(0,Dr.jsxs)("div",{className:xc.order_total_body,children:[(0,Dr.jsxs)("div",{className:xc.order_total_item,children:[(0,Dr.jsx)("span",{children:"Subtotal"}),(0,Dr.jsxs)("span",{children:["$",ia(l.subtotal)]})]}),(0,Dr.jsxs)("div",{className:xc.order_total_item,children:[(0,Dr.jsx)("span",{children:"Taxes"}),(0,Dr.jsxs)("span",{children:["$",ia(l.taxes[0].tax)]})]}),0!==l.customerhandoffcharge&&(0,Dr.jsxs)("div",{className:xc.order_total_item,children:[(0,Dr.jsx)("span",{children:"Customer Handoff Charge"}),(0,Dr.jsxs)("span",{children:["$",ia(l.customerhandoffcharge)]})]}),0!==l.tip&&(0,Dr.jsxs)("div",{className:xc.order_total_item,children:[(0,Dr.jsx)("span",{children:"Tip"}),(0,Dr.jsxs)("span",{children:["$",ia(l.tip)]})]}),0!==l.discount&&(0,Dr.jsxs)("div",{className:xc.order_total_item,children:[(0,Dr.jsx)("span",{children:"Discount"}),(0,Dr.jsxs)("span",{children:["-$",ia(l.discount)]})]})]})]}),(0,Dr.jsxs)("div",{className:xc.cart_footer,children:[!s&&(0,Dr.jsxs)("button",{className:"btn",onClick:async()=>
2{if(c){if(o(!0),"advance"!==l.timemode||l.timewanted)if("asap"!==l.timemode||c.status.open){const e=await yr(n);e.id?(a(vs.addCart(e)),a(vs.setCartSidebarStep("info"))):a(qi.setError(e)),o(!1)}else{var e;const t={delivery_mode:l.deliverymode,time:"asap",schedule_date:null,schedule_time:null};null!==l&&void 0!==l&&null!==(e=l.status)&&void 0!==e&&e.open||(t.time="schedule",t.schedule_date=Ki(l.earliestreadytime),t.schedule_time=Yi(l.earliestreadytime));const r=await _r(l.id,t);if(r.id){Mr("currentCart",r),a(vs.addCart(r));const e=await yr(r.id);e.id?(a(vs.addCart(e)),a(vs.setCartSidebarStep("info"))):a(qi.setError(e)),o(!1)}else a(qi.setError(r)),o(!1)}else{var t;const e={delivery_mode:l.deliverymode,time:"asap",schedule_date:null,schedule_time:null};if(null!==c&&void 0!==c&&null!==(t=c.status)&&void 0!==t&&t.open){const t=new Date;new Date(Ki(l.earliestreadytime)+"T"+Yi(l.earliestreadytime)).setHours(0,0,0,0)==t.setHours(0,0,0,0)||(e.time="schedule",e.schedule_date=Ki(Qi(l.earliestreadytime,60)),e.schedule_time=Yi(Qi(l.earliestreadytime,60)))}else e.time="schedule",e.schedule_date=Ki(l.earliestreadytime),e.schedule_time=Yi(l.earliestreadytime);const r=await _r(l.id,e);if(r.id){Mr("currentCart",r),a(vs.addCart(r));const e=await yr(r.id);e.id?(a(vs.addCart(e)),a(vs.setCartSidebarStep("info"))):a(qi.setError(e)),o(!1)}else a(qi.setError(r)),o(!1)}let r=[];l.products.forEach((e=>{r.push({item_id:e.productId,item_name:e.name,price:e.totalcost,quantity:e.quantity})})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"begin_checkout",ecommerce:{currency:"USD",value:l.total,items:r}})}else a(qi.setError({message:"Please set a location in order to continue"}))},children:["Checkout | $",ia(i)]}),s&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})};var pp=t=>{let{edit:r}=t;const n=E(),[i,a]=(0,e.useState)(!1),s=(0,e.useRef)(null),[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)({email:!0});return(0,Dr.jsxs)(Dr.Fragment,{children:[!o&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:"margin-bottom-20",children:[!r&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h3",{children:"Forgot Password"}),(0,Dr.jsx)("p",{children:"If you've forgotten your password, don't worry! Simply enter your email address in the field below, and we'll send you a link to reset your password."})]}),r&&(0,Dr.jsx)("p",{children:"Enter your email address in the field below, and we'll send you a link to reset your password."})]}),(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),a(!0);const t=s.current.value,r=!ta(t)&&ra(t);u({email:r});if(r){const e=await(async e=>await nr("https://ordernew-admin.greatamericancookies.com/api/v1/reset-password","POST",e))({email:t});e&&e.message?n(qi.setError(e)):l(!0)}a(!1)},className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"password_input",children:"Request New Password"}),(0,Dr.jsx)("input",{type:"email",id:"email_input",placeholder:"Email",ref:s,className:`${c.email?null:"error"}`,required:!0}),!c.email&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter an email!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[!i&&(0,Dr.jsx)("button",{className:"btn",children:"Send Instructions"}),i&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})]}),o&&(0,Dr.jsx)("div",{children:"Instructions sent to the email you provided"})]})},mp="Authentication_sidebar_header__6bw+6",fp="Authentication_sidebar_content__ommXz",gp="Authentication_sidebar_content_inner__BccEB",_p="Authentication_form_title__sXQRI",yp="Authentication_intro__pWOMh",vp="Authentication_fine_print__RhaKU",xp="Authentication_terms_link__Z3t9C",bp="Authentication_migrate_disclaimer__bwXW2",wp="InfoComponent_info_module__kocf-",Cp="InfoComponent_info_module_inner__z8aDl",Sp="InfoComponent_modal_module_inner__wU5iT",kp="InfoComponent_modal_in_view__yvFNX",jp="InfoComponent_close__Zk1hk",Ep="InfoComponent_controls__jf+5E";var Tp=t=>{let{children:r,closeInfoHandler:n,transition:i}=t;const[a,o]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{o(!!i)}),[i]),(0,Dr.jsxs)(Dr.Fragment,{children:[s.createPortal((0,Dr.jsx)(gc,{hide:n,over:!0}),document.getElementById("backdrop-root")),s.createPortal((0,Dr.jsx)("div",{className:wp,children:(0,Dr.jsxs)("div",{className:`${Cp} ${Sp} ${a&&kp}`,children:[n&&(0,Dr.jsxs)("button",{onClick:n,className:jp,children:[(0,Dr.jsx)(yc,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"close window"})]}),r]})}),document.getElementById("overlay-root"))]})};const Pp=e=>""===e.trim();var Ip=t=>{let{closeSidebar:r,position:n,noTitle:i}=t;const[a,s]=(0,e.useState)(!1),o=(0,e.useRef)(null),l=(0,e.useRef)(null),[c,u]=(0,e.useState)({email:!0,password:!0}),[d,h]=(0,e.useState)(!1),[p,m]=(0,e.useState)(!1),f=E(),g=()=>{s((e=>!e))};let _="";return n&&"cart"===n&&(_="cart_footer_button"),(0,Dr.jsxs)(Dr.Fragment,{children:[!a&&(0,Dr.jsxs)(Dr.Fragment,{children:[!i&&(0,Dr.jsx)("div",{className:"margin-bottom-30",children:(0,Dr.jsxs)("h3",{className:_p,children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M224 256A128 128 0 1 0 224
20a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z"})}),"Sign In"]})}),(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault();const t=o.current.value,i=l.current.value,a=!Pp(t)&&/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z0-9]/i.test(t);const s=!Pp(i);u({email:a,password:s});if(a&&s){m(!0);const e={email:t,password:i},a=Nr("currentCart"),s=await(async e=>await nr("https://ordernew-admin.greatamericancookies.com/api/v1/login","POST",e))(e);if(s.message)f(qi.setError(s));else{f(Ha.login(s));const e=await jr(s.authtoken);if(f(Ha.setUser(e)),a){const e=await dr(a.id,s.authtoken);e.id&&Mr("currentCart",e)}n||r(!1),fa("terms_agreed")||f(Ha.openTermsAndConditions())}m(!1)}},className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"email_input",children:"Email"}),(0,Dr.jsx)("input",{type:"email",id:"email_input",placeholder:"Email",ref:o,className:`${c.email?null:"error"}`,required:!0}),!c.email&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a valid email!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"password_input",children:"Password"}),(0,Dr.jsx)("input",{id:"password_input",type:"password",ref:l,placeholder:"******",className:`${c.password?null:"error"}`,required:!0}),!c.password&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a password!"})]}),(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsx)("div",{className:"margin-bottom-20",children:(0,Dr.jsx)("button",{type:"button",className:"btn-underline",onClick:g,children:"Forgot password?"})})}),(0,Dr.jsxs)("div",{className:_,children:[!p&&(0,Dr.jsx)("button",{className:"btn",children:"Login"}),p&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})]}),a&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:"margin-bottom-20",children:(0,Dr.jsx)("button",{className:"btn-underline",onClick:g,children:"Back"})}),(0,Dr.jsx)("div",{className:"margin-bottom-20"}),(0,Dr.jsx)(pp,{})]})]})};var Mp=t=>{let{position:r,noTitle:n}=t;const i=E(),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(!1),c=(0,e.useRef)(null),u=(0,e.useRef)(null),d=(0,e.useRef)(null),h=(0,e.useRef)(null),p=(0,e.useRef)(null),m=(0,e.useRef)(null),[f,g]=(0,e.useState)({email:!0,phone:!0,firstName:!0,lastName:!0,password:!0,matchPassword:!0}),[_,y]=(0,e.useState)("");let v="";return r&&"cart"===r&&(v="cart_footer_button"),(0,Dr.jsxs)(Dr.Fragment,{children:[!n&&(0,Dr.jsx)("div",{className:"margin-bottom-30",children:(0,Dr.jsxs)("h3",{className:_p,children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:(0,Dr.jsx)("path",{d:"M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3zM504 312V248H440c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V136c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H552v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"})}),"Join Rewards"]})}),!a&&(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault();const t=c.current.value,r=u.current.value,n=d.current.value,a=h.current.value,o=p.current.value,f=m.current.value,_=!ta(t)&&ra(t),y=!ta(r),v=!ta(n),x=!ta(a),b=!ta(o)&&!ta(f),w=na(o,f);g({email:_,phone:y,firstName:v,lastName:x,password:b,matchPassword:w});if(_&&y&&v&&x&&b&&w){l(!0);const e={email:t,phone:r,first_name:n,last_name:a,password:o},c=Nr("currentCart"),u=await kr(e);if(u.message)i(qi.setError(u));else{i(Ha.login(u));const e=await jr(u.authtoken);if(i(Ha.setUser(e)),c){const t=await dr(c.id,e.authtoken);t.id&&Mr("currentCart",t)}s(!0)}l(!1)}},className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"email_input",children:"Email"}),(0,Dr.jsx)("input",{type:"email",id:"email_input",placeholder:"Email",required:!0,ref:c,className:`${f.email?null:"error"}`}),!f.email&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a valid email!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"phone_input",children:"Phone"}),(0,Dr.jsx)("input",{type:"text",id:"phone_input",value:_,placeholder:"Phone",required:!0,ref:u,className:`${f.phone?null:"error"}`,onChange:e=>{y(ea(e.target.value))}}),!f.phone&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a phone number!"})]}),(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"first_name_input",children:"First Name"}),(0,Dr.jsx)("input",{type:"text",id:"first_name_input",placeholder:"First Name",required:!0,ref:d,className:`${f.firstName?null:"error"}`}),!f.firstName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"last_name_input",children:"Last Name"}),(0,Dr.jsx)("input",{type:"text",id:"last_name_input",placeholder:"Last Name",required:!0,ref:h,className:`${f.lastName?null:"error"}`}),!f.lastName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]})]}),(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"password_input",children:"Password"}),(0,Dr.jsx)("input",{id:"password_input",type:"password",required:!0,minLength:8,ref:p,className:`${f.password?null:"error"}`}),!f.password&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a password!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"confirm_password_input",children:"Confirm Password"}),(0,Dr.jsx)("input",{id:"confirm_password_input",type:"password",minLength:8,required:!0,ref:m,className:`${f.matchPassword?null:"error"}`}),!f.matchPassword&&(0,Dr.jsx)("div",{className:"error-message",children:"Passwords don not match!"})]})]}),(0,Dr.jsxs)("div",{className:`form-controller ${v}
2`,children:[!o&&(0,Dr.jsx)("button",{className:"btn",type:"submit",children:"Sign up"}),o&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]}),a&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h3",{children:"Welcome!"}),(0,Dr.jsx)("p",{children:"Account created successfully!"})]})]})};var Np,Ap,Lp=()=>{const t=xt(),r=E(),n=y((e=>e.auth.user)),[i,a]=(0,e.useState)(!1),s=Ir("guestUser");let o=y((e=>e.location.location));const[l,c]=(0,e.useState)("guest"),[u,d]=(0,e.useState)({email:!0,firstName:!0,lastName:!0,phone:!0}),h=(0,e.useRef)(null),p=(0,e.useRef)(null),m=(0,e.useRef)(null),f=(0,e.useRef)(null),g=y((e=>e.auth.user)),_=e=>{c(e)},[v,x]=(0,e.useState)(s?s.phone:null),b=()=>{r(vs.setCartSidebarState()),t("/rewards-migration")};return(0,e.useEffect)((()=>{!function(e){return!!(e&&e.data&&e.data.attributes&&e.data.attributes.includes("Rewards Non-Participating"))}(o)?a(!1):a(!0)}),[o]),(0,Dr.jsxs)(Dr.Fragment,{children:[g&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h3",{children:"Account Details"}),(0,Dr.jsxs)("div",{className:xc.user_info,children:[(0,Dr.jsx)("span",{children:"Name:"}),n.name]}),(0,Dr.jsxs)("div",{className:xc.user_info,children:[(0,Dr.jsx)("span",{children:"Email:"}),n.email]}),(0,Dr.jsxs)("div",{className:xc.user_info,children:[(0,Dr.jsx)("span",{children:"Phone:"}),ea(n.phone)]}),(0,Dr.jsx)("div",{className:xc.user_info,children:(0,Dr.jsx)("button",{onClick:()=>{r(vs.setCartSidebarState()),t("/account/edit")},className:"btn",children:"Change Info"})}),(0,Dr.jsx)("div",{className:xc.cart_footer,children:(0,Dr.jsx)("button",{type:"submit",className:"btn",onClick:()=>{r(vs.setCartSidebarStep("checkout"))},children:"Continue to Payment"})})]}),!g&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:xc.info_pannel_header,children:[(0,Dr.jsx)("button",{className:`btn ${"guest"===l&&xc.btn_active}`,onClick:_.bind(void 0,"guest"),children:"Guest Checkout"}),!i&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("button",{className:`btn ${"sign"===l&&xc.btn_active}`,onClick:_.bind(void 0,"sign"),children:"Sign In"}),(0,Dr.jsx)("button",{className:`btn ${"signup"===l&&xc.btn_active}`,onClick:_.bind(void 0,"signup"),children:"Join Rewards"})]})]}),"guest"===l&&(0,Dr.jsxs)("form",{onSubmit:e=>{e.preventDefault();const t=h.current.value,n=p.current.value,i=m.current.value,a=f.current.value,s=!ta(i)&&ra(i),o=!ta(t),l=!ta(n),c=!ta(a);d({email:s,firstName:o,lastName:l,phone:c});s&&o&&l&&c&&(Pr("guestUser",{firstName:t,lastName:n,email:i,phone:a}),r(vs.setCartSidebarStep("checkout")))},children:[(0,Dr.jsxs)("div",{className:`form-fields-container ${xc.guest_form}`,children:[(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"guest_first_name",children:"First Name"}),(0,Dr.jsx)("input",{ref:h,type:"text",id:"guest_first_name",placeholder:"Johnathan",required:!0,className:`${u.firstName?null:"error"}`,defaultValue:s?s.firstName:null}),!u.firstName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"guest_last_name",children:"Last Name"}),(0,Dr.jsx)("input",{ref:p,type:"text",id:"guest_last_name",placeholder:"Hale",required:!0,className:`${u.lastName?null:"error"}`,defaultValue:s?s.lastName:null}),!u.lastName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"guest_email",children:"Email Address"}),(0,Dr.jsx)("input",{ref:m,type:"text",id:"guest_email",placeholder:"[email protected]",required:!0,className:`${u.email?null:"error"}`,defaultValue:s?s.email:null}),!u.email&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a valid email!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"guest_phone",children:"Phone Number"}),(0,Dr.jsx)("input",{ref:f,type:"text",id:"guest_phone",placeholder:"123-456-7890",required:!0,className:`${u.phone?null:"error"}`,onChange:e=>{x(ea(e.target.value))},defaultValue:v}),!u.phone&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a phone number"})]})]}),(0,Dr.jsx)("div",{className:xc.cart_footer,children:(0,Dr.jsx)("button",{type:"submit",className:"btn",children:"Continue to Payment"})})]}),"sign"===l&&(0,Dr.jsxs)("div",{children:[(0,Dr.jsxs)("div",{className:xc.migrate_disclaimer,children:[(0,Dr.jsx)("p",{children:"We've combined Great American Cookies and Marble Slab Creamery Rewards! If you have an existing Great American Cookies Rewards account, please log in below."}),(0,Dr.jsxs)("p",{children:["If you have an existing Marble Slab Creamery Rewards account, ",(0,Dr.jsx)("button",{onClick:b,children:"please visit the migration page"})," to complete the account migration process."]})]}),(0,Dr.jsx)(Ip,{position:"cart",noTitle:!0})]}),"signup"===l&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:xc.migrate_disclaimer,children:[(0,Dr.jsx)("p",{children:"We've combined Great American Cookies and Marble Slab Creamery Rewards! If you have an existing Great American Cookies Rewards account, please log in below."}),(0,Dr.jsxs)("p",{children:["If you have an existing Marble Slab Creamery Rewards account, ",(0,Dr.jsx)("button",{onClick:b,children:"please visit the migration page"})," to complete the account migration process."]})]}),(0,Dr.jsx)(Mp,{position:"cart",noTitle:!0})]})]})]})},Dp={billing_header:"Billing_billing_header__pLwSm",btn_hand:"Billing_btn_hand__cHd8m",active:"Billing_active__YMexX",absolute_loader:"Billing_absolute_loader__Ynlgv"},zp="CreditCardForm_olo_card_form__KVqQU",Op="CreditCardForm_set_credit_card__-X560",Rp="CreditCardForm_selected_payment_container__SawN
2h",Fp="CreditCardForm_selected_payment_item__NhREV";(Ap=Np||(Np={})).CreditCardElements="CreditCardElements",Ap.CvvCardElement="CvvCardElement",Ap.DigitalWallets="DigitalWallets",Ap.SingleLineCardElement="SingleLineCardElement";const Bp={log:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return console.log("%c Olo Pay ","background: #25B3E2; color: #ffffff",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return console.warn("%c Olo Pay ","background: #F3A966; color: #ffffff",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.error("%c Olo Pay Error ","background: #FF2A53; color: #ffffff",...t)},throw:e=>{if(e)throw new Error(`Olo Pay Error: ${e}`)}};var Vp={};function $p(e){return($p="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(Vp,"__esModule",{value:!0});var Up,Hp="https://js.stripe.com/v3",qp=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Zp="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Gp=null,Wp=function(e){return null!==Gp||(Gp=new Promise((function(t,r){if("undefined"!==typeof window&&"undefined"!==typeof document)if(window.Stripe&&e&&console.warn(Zp),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Hp,'"]')),t=0;t<e.length;t++){var r=e[t];if(qp.test(r.src))return r}return null}();n&&e?console.warn(Zp):n||(n=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(Hp).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r}(e)),n.addEventListener("load",(function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))})),n.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(i){return void r(i)}else t(null)}))),Gp},Xp=function(e){var t="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==$p(e))throw new Error(t);if(1===Object.keys(e).length&&"boolean"===typeof e.advancedFraudSignals)return e;throw new Error(t)},Jp=!1,Kp=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Jp=!0;var n=Date.now();return Wp(Up).then((function(e){return function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.54.0",startTime:t})}(n,r),n}(e,t,n)}))};Kp.setLoadParameters=function(e){if(Jp&&Up){var t=Xp(e);if(Object.keys(t).reduce((function(t,r){var n;return t&&e[r]===(null===(n=Up)||void 0===n?void 0:n[r])}),!0))return}if(Jp)throw new Error("You cannot change load parameters after calling loadStripe");Up=Xp(e)},Vp.loadStripe=Kp;const Yp=Vp.loadStripe;var Qp,em;async function tm(e,t){Bp.log(`Setting up Stripe for ${t}`);const r=/\bproduction\b/i.test(t)?Qp.production:Qp.development,n=await async function(e,t){Bp.log(`Fetching key for ${t}`);try{const t=await fetch(e);return(await t.json()).key.trim()||""}catch(r){return r instanceof Error&&Bp.error(`Failed to fetch key ${JSON.stringify(r)}`),""}}(r,t),i=await async function(e,t){let r=null,n=!1;try{if(null===r&&(n=!0,r=await Yp(t)),null===r)throw Bp.error(`Failed to load Stripe. Tried import = ${n}`),new Error;return r}catch(i){i instanceof Error&&(Bp.error(`${e}: ${i.message}`),Bp.error(`${e}: ${i.stack}`),console.error("%c Olo Pay Error ","background: #FF2A53; color: #ffffff",`${e}: ${i.message}`),console.error("%c Olo Pay Error Stack Trace ","background: #FFA500; color: #ffffff",`${e}: ${i.stack}`))}}(e,n).catch((e=>Bp.error(e)));if(i)return i;Bp.error(`${e}: Failed to access Olo Pay`)}(em=Qp||(Qp={})).development="https://static.olocdn.net/web-client/olo-pay/keys/dev.json",em.production="https://static.olocdn.net/web-client/olo-pay/keys/prod.json";const rm={color:"inherit",backgroundColor:"inherit",fontFamily:"inherit",fontSize:"1.8rem",fontSmoothing:"inherit",fontStyle:"inherit",fontVariant:"inherit",fontWeight:"inherit",iconColor:"#25B3E2",lineHeight:"inherit",letterSpacing:"inherit",textAlign:"inherit",textDecoration:"inherit",textShadow:"inherit",textTransform:"inherit"},nm={":hover":rm,":focus":rm,"::placeholder":rm,"::selection":rm,":-webkit-autofill":rm,":disabled":rm,"::-ms-clear":{...rm,display:"str
2ing"}},im={...rm,...nm},am={base:{...im},complete:{...im},empty:{...im},invalid:{...im}};const sm={paymentMethod:{id:"pm_visa",object:"payment_method",billing_details:{address:{city:"New York",country:"US",line1:"One World Trade Center",line2:null,postal_code:"10006",state:"NY"},email:"[email protected]",name:"Test Mode",phone:"4444444444"},card:{brand:"visa",checks:{address_line1_check:null,address_postal_code_check:null,cvc_check:null},country:"US",exp_month:12,exp_year:2031,funding:"credit",generated_from:null,last4:"1234",networks:{available:["visa"],preferred:null},three_d_secure_usage:{supported:!0},wallet:{dynamic_last4:"1234",google_pay:{},type:"google_pay"}},created:1628283848,customer:null,livemode:!1,type:"card"}};class om{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"development";Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"stripe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"digitalWalletsOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"paymentEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"paymentRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultPaymentRequestOptions",{enumerable:!0,configurable:!0,writable:!0,value:{currency:"usd",total:{label:"test",amount:0},requestPayerName:!0}}),Object.defineProperty(this,"canMakePayment",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"paymentButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async initialize(e){if(this.stripe||(this.stripe=await tm(Np.DigitalWallets,this.environment)),!this.stripe)return;if(!e)return void Bp.error("No digital wallets options provided");if(this.digitalWalletsOptions=e,this.paymentRequest&&!this.paymentRequest.isShowing()){const{currency:e,total:t,displayItems:r,shippingOptions:n}=this.digitalWalletsOptions.options;return this.updatePaymentDetails({currency:e,total:t,displayItems:r,shippingOptions:n}),void(this.canMakePayment=await this.paymentRequest.canMakePayment())}const t=this.stripe.paymentRequest(this.digitalWalletsOptions.options);this.canMakePayment=await t.canMakePayment(),this.paymentRequest=t}mountButton(e,t){if(!this.digitalWalletsOptions||!this.paymentRequest||!this.stripe)return void Bp.error("Digital Wallets not initialized properly.");const r=this.paymentRequest;r.on("paymentmethod",(t=>{this.paymentEvent=t,e(t.paymentMethod)}));const n=function(e){if(1===(t=e).nodeType&&t.matches("*")){const t=e;return t.isConnected?t:null}var t;try{return document.querySelector(e)}catch(r){return Bp.error(`No element marked with ${e} found`),null}}(t||"[data-olo-pay-payment-button]");if(!n)return;const{classes:i,style:a}=this.digitalWalletsOptions,s=this.stripe.elements().create("paymentRequestButton",{paymentRequest:r,...i||{},...a?{style:{paymentRequestButton:{...a}}}:{}});n&&this.canMakePayment?s.mount("[data-olo-pay-payment-button]"):n.style.display="none","test"===this.environment&&(Bp.log("Digital Wallets is running in test mode."),s.on("click",(e=>{e.preventDefault(),window.PaymentRequest=r,window.PaymentRequest.emit("paymentmethod",sm)}))),this.paymentButton=s}initiatePayment(){var e;this.canMakePayment&&(null==(e=this.paymentRequest)||e.show())}async canRenderButton(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"US";var t;return this.stripe=await tm(Np.DigitalWallets,this.environment),this.stripe?(this.paymentRequest=null==(t=this.stripe)?void 0:t.paymentRequest({...this.defaultPaymentRequestOptions,country:e}),this.canMakePayment=await this.paymentRequest.canMakePayment(),this.canMakePayment):null}updatePaymentDetails(e){this.paymentRequest&&this.paymentRequest.update(e)}completePaymentEvent(){var e;null==(e=this.paymentEvent)||e.complete("success")}failPaymentEvent(){var e;null==(e=this.paymentEvent)||e.complete("fail")}destroy(){var e;null==(e=this.paymentButton)||e.destroy()}unmount(){var e;null==(e=this.paymentButton)||e.unmount()}}var lm="https://js.stripe.com/v3",cm=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,um="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",dm=null,hm=function(e){return null!==dm||(dm=new Promise((function(t,r){if("undefined"!==typeof window&&"undefined"!==typeof document)if(window.Stripe&&e&&console.warn(um),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(lm,'"]')),t=0;t<e.length;t++){var r=e[t];if(cm.test(r.src))return r}return null}();n&&e?console.warn(um):n||(n=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(lm).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r}(e)),n.addEventListener("load",(function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))})),n.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(i){return void r(i)}else t(null)}))),dm};Promise.resolve().then((function(){return hm(null)})).catch((function(e){console.warn(e)}));Symbol.toStringTag;
2const pm={cardElementOptions:{style:{base:{fontSize:"16px",fontFamily:"inherit",color:"#584446","::placeholder":{color:"#8a8a8a"}},complete:{color:"#242c37"},invalid:{color:"red",":hover":{color:"orangered"}}}},mountTargets:{number:"#custom-card-number-selector",expiry:"#custom-card-expiry",cvv:"#custom-card-cvv"}},mm=new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"development";Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"stripe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultMountTargets",{enumerable:!0,configurable:!0,writable:!0,value:{number:"[data-olo-pay-card-number]",expiry:"[data-olo-pay-card-expiry]",cvc:"[data-olo-pay-card-cvc]",cvv:"[data-olo-pay-card-cvv]"}}),Object.defineProperty(this,"defaultOptions",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{base:"olo-pay",complete:"olo-pay--complete",empty:"olo-pay--empty",focus:"olo-pay--focus",invalid:"olo-pay--invalid",webkitAutofill:"olo-pay--webkit-autofill"}}}),Object.defineProperty(this,"defaultPlaceholders",{enumerable:!0,configurable:!0,writable:!0,value:{number:"Card number",expiry:"Card expiry",cvc:"Card cvv",cvv:"Card cvv"}}),Object.defineProperty(this,"cardNumber",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cardExpiry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cardCvc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cardCvv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"elements",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async create(e){var t,r;if(this.stripe=await tm(Np.CreditCardElements,this.environment),!this.stripe)return;const n=this.stripe.elements((null==e?void 0:e.elementsOptions)||{}),i={...this.defaultOptions,...null==e?void 0:e.cardElementOptions},a=(null==e?void 0:e.placeholders)||this.defaultPlaceholders,s=(null==e?void 0:e.mountTargets)||this.defaultMountTargets;e&&(null==(t=null==e?void 0:e.mountTargets)?void 0:t.cvv)?delete s.cvc:(e&&(null==(r=null==e?void 0:e.mountTargets)?void 0:r.cvc)||!(null==e?void 0:e.mountTargets))&&delete s.cvv;const o=n.create("cardNumber",{...i,placeholder:a.number}),l=n.create("cardExpiry",{...i,placeholder:a.expiry});let c,u;s.cvc&&(Bp.warn('Deprecation: Use the "cvv" key for mountTargets and placeholder objects. CVC will be deprecated
2in the next major version'),c=n.create("cardCvc",{...i,placeholder:a.cvc})),s.cvv&&(u=n.create("cardCvc",{...i,placeholder:a.cvv}));try{o.mount(s.number),l.mount(s.expiry),void 0!==c&&s.cvc&&c.mount(s.cvc),void 0!==u&&s.cvv&&u.mount(s.cvv)}catch(d){return void Bp.error(`${Np.CreditCardElements}:\n Unable to mount Olo Pay elements to their DOM targets\n Please ensure valid selectors or elements are passed to \`create\``)}return this.cardNumber=n.getElement("cardNumber")||void 0,this.cardExpiry=n.getElement("cardExpiry")||void 0,void 0!==c&&s.cvc&&(this.cardCvc=n.getElement("cardCvc")||void 0),void 0!==u&&s.cvv&&(this.cardCvv=n.getElement("cardCvc")||void 0),this.cardNumber?this.cardExpiry?this.cardCvc||this.cardCvv?void(this.elements=[this.cardNumber,this.cardExpiry,this.cardCvv||this.cardCvc]):Bp.error("cvv input not mounted properly"):Bp.error("Expiry input not mounted properly"):Bp.error("Number input not mounted properly")}async createPaymentMethod(e){if(!this.stripe||!this.cardNumber)return void Bp.error("Failed to create a payment method due to missing: "+(this.stripe?"cardNumber element":"Olo Pay connection. Call `create` first"));return await this.stripe.createPaymentMethod({type:"card",card:this.cardNumber,billing_details:e})}applyStyles(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:am;var t,r,n,i;null==(t=this.cardNumber)||t.update({style:e}),null==(r=this.cardExpiry)||r.update({style:e}),void 0!==this.cardCvc&&(null==(n=this.cardCvc)||n.update({style:e})),void 0!==this.cardCvv&&(null==(i=this.cardCvv)||i.update({style:e}))}clear(){var e,t,r,n;null==(e=this.cardNumber)||e.clear(),null==(t=this.cardExpiry)||t.clear(),void 0!==this.cardCvc&&(null==(r=this.cardCvc)||r.clear()),void 0!==this.cardCvv&&(null==(n=this.cardCvv)||n.clear())}destroy(){var e,t,r,n;null==(e=this.cardNumber)||e.destroy(),null==(t=this.cardExpiry)||t.destroy(),void 0!==this.cardCvc&&(null==(r=this.cardCvc)||r.destroy()),void 0!==this.cardCvv&&(null==(n=this.cardCvv)||n.destroy()),this.elements=void 0}mount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultMountTargets;var t,r,n,i;null==(t=this.cardNumber)||t.mount(e.number),null==(r=this.cardExpiry)||r.mount(e.expiry),void 0!==this.cardCvc&&(null==(n=this.cardCvc)||n.mount(e.cvc)),void 0!==this.cardCvv&&(null==(i=this.cardCvv)||i.mou
2nt(e.cvv))}unmount(){var e,t,r,n;null==(e=this.cardNumber)||e.unmount(),null==(t=this.cardExpiry)||t.unmount(),void 0!==this.cardCvc&&(null==(r=this.cardCvc)||r.unmount()),void 0!==this.cardCvv&&(null==(n=this.cardCvv)||n.unmount())}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultOptions;var t,r,n,i;null==(t=this.cardNumber)||t.update(e),null==(r=this.cardExpiry)||r.update(e),void 0!==this.cardCvc&&(null==(n=this.cardCvc)||n.update(e)),void 0!==this.cardCvv&&(null==(i=this.cardCvv)||i.update(e))}}("production");var fm=()=>{const t=(0,e.useRef)(),r=E(),[n,i]=(0,e.useState)(!1),[a,s]=(0,e.useState)({number:!1,cvv:!1,date:!1});let o=y((e=>e.cart.cart));const[l,c]=(0,e.useState)([]);(0,e.useEffect)((()=>{if(async function(){await mm.create(pm),mm.cardNumber.on("change",(e=>{if(e.complete)s((e=>({...e,number:!0})));else if(e.error){e.error.message;s((e=>({...e,number:!1})))}})),mm.cardExpiry.on("change",(e=>{if(e.complete)s((e=>({...e,expiry:!0})));else if(e.error){e.error.message;s((e=>({...e,expiry:!1})))}}))}(),a.number&&a.cvv&&a.date){mm.createPaymentMethod()}return()=>{mm.clear()}}),[]);return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("div",{className:`form-fields-container ${zp}`,children:[(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller form-controller-3",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"card_number",children:"Card Number"}),(0,Dr.jsx)("div",{id:"custom-card-number-selector"})]}),(0,Dr.jsxs)("div",{className:"form-controller form-controller-1",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"cvv_input",children:"CVV"}),(0,Dr.jsx)("div",{id:"custom-card-cvv"})]})]}),(0,Dr.jsxs)("div",{className:"form-controller-group align-bottom",children:[(0,Dr.jsxs)("div",{className:"form-controller form-controller-1",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"expiry_date",children:"Expiry Date"}),(0,Dr.jsx)("div",{id:"custom-card-expiry"})]}),(0,Dr.jsxs)("div",{className:"form-controller form-controller-1",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"locationZip",children:"Zip Code*"}),(0,Dr.jsx)("input",{ref:t,type:"text",id:"locationZip",name:"locationZip",placeholder:"12345",required:!0})]}),(0,Dr.jsxs)("div",{className:"form-controller-1",children:[!n&&(0,Dr.jsx)("button",{onClick:async()=>{i(!0);const e=t.current.value;if(""!==e.trim()&&(e=>e.length>=5)(e)){const t=await mm.createPaymentMethod();if(t.error)r(qi.setError({message:t.error.message}));else{t.zipCode=e,c([t]),r(vs.setBilling(t));let n=[];o.products.forEach((e=>{n.push({item_id:e.productId,item_name:e.name,price:e.totalcost,quantity:e.quantity})})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"add_payment_info",ecommerce:{currency:"USD",value:o.total,coupon:o.coupon,payment_type:"credit card",items:n}})}}else r(qi.setError({message:"Please provide a valid zip code"}));i(!1)},className:`btn ${Op}`,children:"Add Card"}),n&&(0,Dr.jsx)("div",{className:`btn ${Op}`,children:(0,Dr.jsx)("span",{className:"loader"})})]})]})]})})};const gm=Ii({name:"virtualCart",initialState:{items:[],newItems:[],multipleChoices:[]},reducers:{addnewItem(e,t){e.newItems=t.payload},addMultipleChoice(e,t){e.multipleChoices=t.payload},addItem(e,t){const r=e.items.findIndex((e=>e.id==t.payload.id));if(r<0)e.items.push(t.payload);else{const n=e.items[r].options.findIndex((e=>e.id==t.payload.options[0].id));n<0?e.items[r].options=[...e.items[r].options,...t.payload.options]:(e.items[r].options[n].price=t.payload.options[0].price,e.items[r].options[n].optionID=t.payload.options[0].optionID,e.items[r].options[n].subOptions=[])}},addSubOption(e,t){const r=e.items.findIndex((e=>e.id==t.payload.id)),n=e.items[r].options.findIndex((e=>e.optionID==t.payload.options[0].id));"checkbox"===t.payload.options[0].type||(e.items[r].options[n].subOptions=[]),e.items[r].options[n].subOptions.push({id:t.payload.options[0].sub[0].id,price:t.payload.options[0].sub[0].price,name:t.payload.options[0].sub[0].name})},removeSubOption(e,t){const r=e.items.findIndex((e=>e.id==t.payload.id)),n=e.items[r].options.findIndex((e=>e.optionID==t.payload.options[0].id)),i=e.items[r].options[n].subOptions.findIndex((e=>e.id==t.payload.options[0].sub[0].id));e.items[r].options[n].subOptions.splice(i,1)},clearVirtualCart(e){e.items=[]}}}),_m=gm.actions;var ym=gm.reducer;function vm(t){let{billingscheme:r}=t;const n=E(),i=xt(),a=Ir("guestUser"),s=y((e=>e.auth.user));let o=ca(),l=y((e=>e.location.location));y((e=>e.cart.hasUserOptedIn));let c=y((e=>e.cart.cart));const u={options:{country:"US",currency:"usd",total:{label:"Pay Great American Cookies",amount:100*c.total.toFixed(2)}
2,requestPayerName:!0},style:{type:"default",theme:"dark",height:"40px"}},[d,h]=(0,e.useState)(!1),[p,m]=(0,e.useState)(null),[f,g]=(0,e.useState)(null),_=(0,e.useCallback)((async(e,t)=>{if(e){g(e),n(vs.setDigitalWallet(e));let u={},d="",h="";t.canMakePayment.googlePay?(d=r.find((e=>"Google Pay"===e.name)).id,h="Google Pay"):t.canMakePayment.applePay&&(d=r.find((e=>"Apple Pay"===e.name)).id,h="Apple Pay");let p=[];c.products.forEach((e=>{p.push({item_id:e.productId,item_name:e.name,price:e.totalcost,quantity:e.quantity})})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"add_payment_info",ecommerce:{currency:"USD",value:c.total,coupon:c.coupon,payment_type:h,items:p}});const m=fa("rwg_token");o?u={billing_method:"digitalwallet",billingschemeid:d,card_token:e.id,user_type:"user",authtoken:o,first_name:s.first_name,last_name:s.last_name,email_address:s.email,contact_number:s.phone,card_type:e.card.brand,card_number:e.card.last4,expiry_year:e.card.exp_year,expiry_month:e.exp_month,zip:e.billing_details.address.postal_code}:a&&""!==a.firstName&&(u={billing_method:"digitalwallet",billingschemeid:d,card_token:e.id,user_type:"guest",first_name:a.firstName,last_name:a.lastName,email_address:a.email,contact_number:a.phone,card_type:e.card.brand,card_number:e.card.last4,expiry_year:e.card.exp_year,expiry_month:e.exp_month,zip:e.billing_details.address.postal_code});const f=await wr(c.id,u);f.id?(m&&ga("rwg_token"),Ar("currentCart"),n(vs.addCart(null)),n(vs.setCartSidebarState()),n(_m.clearVirtualCart()),null===t||void 0===t||t.completePaymentEvent(),n(vs.setBilling(null)),ua(f,l),i(`/order/${f.id}`)):(n(qi.setError(f)),null===t||void 0===t||t.failPaymentEvent())}}),[p]),[v,x]=(0,e.useState)();return(0,e.useEffect)((()=>(p||(async()=>{h(!0);const e=new om("production"),t=await(null===e||void 0===e?void 0:e.canRenderButton());x(t),t&&(await e.initialize(u),e.mountButton((t=>{_(t,e)})),m(e)),h(!1)})(),()=>{p&&(null===p||void 0===p||p.unmount())})),[p,_]),(0,Dr.jsxs)(Dr.Fragment,{children:[d&&(0,Dr.jsx)("div",{className:`loader-box ${Dp.absolute_loader}`,children:(0,Dr.jsx)("span",{className:"loader dark-raspberry medium"})}),(0,Dr.jsx)("div",{"data-olo-pay-payment-button":!0,className:"digital-wallet-button"})]})}var xm=e=>{let{item:t,removeCard:r}=e;const n=E();return(0,Dr.jsxs)("div",{className:Fp,children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 576 512",children:(0,Dr.jsx)("path",{d:"M512 80c8.8 0 16 7.2 16 16v32H48V96c0-8.8 7.2-16 16-16H512zm16 144V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V224H528zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm56 304c-13.3 0-24 10.7-24 24s10.7 24 24 24h48c13.3 0 24-10.7 24-24s-10.7-24-24-24H120zm128 0c-13.3 0-24 10.7-24 24s10.7 24 24 24H360c13.3 0 24-10.7 24-24s-10.7-24-24-24H248z"})}),(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("span",{children:t.paymentMethod.card.brand})," x-",t.paymentMethod.card.last4]}),(0,Dr.jsxs)("button",{onClick:()=>{n(vs.removeBillingMethod(t))},children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:(0,Dr.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"remove payment method"})]})]})};var bm=()=>{const e=y((e=>e.cart.billing));return(0,Dr.jsxs)("div",{className:Rp,children:[(0,Dr.jsx)("h4",{children:"Selected Payment Method"}),e&&(0,Dr.jsx)(xm,{item:e},e.paymentMethod.id)]})};var wm=t=>{let{billingMethod:r}=t;const[n,i]=(0,e.useState)(!1),a=y((e=>e.cart.billing));return(0,e.useEffect)((()=>{r.forEach((e=>{"Credit Card"===e.name&&i(!0)}))}),[r]),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:Dp.billing_header,children:[n&&(0,Dr.jsx)("div",{children:(0,Dr.jsx)("button",{className:`btn btn-border ${Dp.btn_hand} ${Dp.active}`,children:"Credit Card"})}),(0,Dr.jsx)(vm,{billingscheme:r})]}),!a&&(0,Dr.jsx)("div",{className:Dp.billing_body,children:n&&(0,Dr.jsx)(fm,{})}),a&&(0,Dr.jsx)(bm,{})]})},Cm={alternative_container:"AlternativePayment_alternative_container__CGxar",alternative_container_inner_wrapper:"AlternativePayment_alternative_container_inner_wrapper__9I8ck",alternative_container_header:"AlternativePayment_alternative_container_header__50K5W",drawer:"AlternativePayment_drawer__Q38eP",reward_item:"AlternativePayment_reward_item__AAB+1",rewar_item_applied:"AlternativePayment_rewar_item_applied__Vnydu",reward_item_inner:"AlternativePayment_reward_item_inner__vLmKf",reward_item_head:"AlternativePayment_reward_item_head__19Ozf",reward_item_image:"AlternativePayment_reward_item_image__xKPvN",reward_item_label:"AlternativePayment_reward_item_label__yvH2b",applied_coupons:"AlternativePayment_applied_coupons__-KTJP",btn_placeholder:"AlternativePayment_btn_placeholder__v8o+t",apply_promo_container:"AlternativePayment_apply_promo_container__5oDAz",apply_promo_button:"AlternativePayment_apply_promo_button__-JgLw",rewards_container:"AlternativePayment_rewards_container__ZDMlh",rewards_header:"AlternativePayment_rewards_header__eCOLj",rewards_header_title:"AlternativePayment_rewards_header_title__BcP-e"};var Sm=()=>{const t=E(),r=(0,e.useRef)(null),[n,i]=(0,e.useState)(!1),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(!1),c=y((e=>e.cart.cart));return(0,Dr.jsxs)("div",{className:Cm.drawer,children:[c.coupon&&c.coupon.couponcode&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h4",{className:Cm.rewards_header_title,children:"Applied Promo Code"}),(0,Dr.jsxs)("div",{className:Cm.applied_coupons,children:[(0,Dr.jsx)("p",{children:c.coupon.couponcode}),!o&&(0,Dr.jsxs)("button",{onClick:async()=>
2{l(!0);const e=await(async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/coupon`,"DELETE",null))(c.id);e.id?(Mr("currentCart",e),t(vs.addCart(e)),t(qi.setError({message:"Coupon successfully removed from the cart!",type:"success"})),s(!1)):t(qi.setError(e)),l(!1)},title:"remove coupon",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:(0,Dr.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"Remove coupon"})]}),o&&(0,Dr.jsx)("div",{className:Cm.btn_placeholder,children:(0,Dr.jsx)("span",{className:"loader dark-raspberry"})})]})]}),!c.coupon&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h4",{className:Cm.rewards_header_title,children:"Add Promo Code"}),(0,Dr.jsxs)("div",{className:`form-fields-container ${Cm.apply_promo_container}`,children:[(0,Dr.jsxs)("div",{className:"form-controller-3",children:[(0,Dr.jsx)("label",{className:"sr-only",htmlFor:"promo_code",children:"Input promo code"}),(0,Dr.jsx)("input",{id:"promo_code",ref:r,type:"text",placeholder:"Enter Code",onChange:e=>{ta(e.target.value)?s(!1):s(!0)}})]}),!n&&(0,Dr.jsx)("button",{className:`btn ${Cm.apply_promo_button}`,onClick:async()=>{i(!0);const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/coupon`,"POST",t))(c.id,{coupon_code:r.current.value});e.id?(Mr("currentCart",e),t(vs.addCart(e)),t(qi.setError({message:"Coupon successfully added to cart!",type:"success"}))):t(qi.setError(e)),i(!1)},disabled:!a,children:"Apply Code"}),n&&(0,Dr.jsx)("div",{className:`btn ${Cm.apply_promo_button}`,children:(0,Dr.jsx)("span",{className:"loader dark"})})]})]})]})};var km=t=>{let{reward:r}=t;const n=E(),[i,a]=(0,e.useState)(!1);let s=y((e=>e.cart.cart));return(0,Dr.jsx)("div",{className:`${Cm.reward_item} ${r.applied&&Cm.rewar_item_applied}`,children:(0,Dr.jsxs)("div",{className:Cm.reward_item_inner,children:[(0,Dr.jsxs)("div",{className:Cm.reward_item_head,children:[(0,Dr.jsxs)("div",{className:Cm.reward_item_image,children:[r.imageurl&&(0,Dr.jsx)("img",{src:r.imageurl,alt:r.label,className:"image-cover"}),r.image_url&&(0,Dr.jsx)("img",{src:r.image_url,alt:r.label,className:"image-cover"})]}),(0,Dr.jsx)("div",{className:Cm.reward_item_label,children:r.label})]}),(0,Dr.jsxs)("div",{children:[!r.applied&&(0,Dr.jsxs)("div",{className:Cm.reward_item_button,children:[!i&&(0,Dr.jsx)("button",{title:"Redeem reward",onClick:(async(e,t)=>{a(!0);const r=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/rewards`,"POST",t))(s.id,{membership_id:e,references:t});if(r.id){const e=await yr(r.id);e.id?(Mr("currentCart",e),n(vs.addCart(e))):n(qi.setError(e))}else n(qi.setError(r));a(!1)}).bind(void 0,r.membership_id,r.reference),className:"btn btn-transparent",children:"Redeem"}),i&&(0,Dr.jsx)("div",{className:`${Cm.loader_container} btn btn-transparent`,children:(0,Dr.jsx)("span",{className:"loader dark"})})]}),r.applied&&(0,Dr.jsxs)("div",{className:Cm.reward_item_button,children:[!i&&(0,Dr.jsx)("button",{title:"remove reward",onClick:async()=>{a(!0);const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/rewards/${t}`,"DELETE",null))(s.id,s.appliedrewards[0].rewardid);e.id?(Mr("currentCart",e),n(vs.addCart(e))):n(qi.setError(e)),a(!1)},className:"btn btn-transparent",children:"Remove"}),i&&(0,Dr.jsx)("div",{className:`${Cm.loader_container} btn btn-transparent`,children:(0,Dr.jsx)("span",{className:"loader dark"})})]})]})]})})};var jm=()=>{const[t,r]=(0,e.useState)(!1),[n,i]=(0,e.useState)(null);let a=y((e=>e.cart.cart)),s=ca();return(0,e.useEffect)((()=>{r(!1);(async()=>{const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/cart/${t}/rewards`,null,null))(s,a.id);i(e),r(!0)})()}),[s,a]),(0,Dr.jsxs)("div",{className:Cm.drawer,children:[!t&&(0,Dr.jsx)("span",{className:"loader dark-raspberry medium"}),t&&(0,Dr.jsxs)("div",{className:Cm.rewards_container,children:[(0,Dr.jsxs)("div",{className:Cm.rewards_header,children:[n&&n.length>0&&(0,Dr.jsx)("h4",{className:Cm.rewards_header_title,children:"Rewards Wallet"}),n&&0===n.length&&(0,Dr.jsx)("h4",{className:Cm.rewards_header_title,children:"No Rewards Available"})]}),a.appliedrewards&&a.appliedrewards.length>0&&(0,Dr.jsxs)("div",{className:Cm.applied_rewards,children:[(0,Dr.jsx)("p",{className:"text-center",children:"Applied rewards: "}),(0,Dr.jsx)(km,{reward:a.appliedrewards[0]},a.appliedrewards[0].rewardid)]}),a.appliedrewards&&0===a.appliedrewards.length&&(0,Dr.jsxs)(Dr.Fragment,{children:[n&&n.length>0&&(0,Dr.jsx)("p",{className:"text-center",children:"Choose one to apply to your order."}),n&&n.length>0&&(0,Dr.jsx)("div",{className:Cm.rewards_items,children:(0,Dr.jsxs)(lp,{className:"splide-custom-arrows","aria-label":"Rewards",hasTrack:!1,options:{rewind:!1,perPage:2,pagination:!1,gap:"1rem",arrows:!0},children:[(0,Dr.jsx)(op,{children:n.map((e=>
2(0,Dr.jsx)(cp,{children:(0,Dr.jsx)(km,{reward:e})},e.reference)))}),(0,Dr.jsxs)("div",{className:"splide__arrows",children:[(0,Dr.jsxs)("button",{className:"splide__arrow splide__arrow--prev",children:[(0,Dr.jsx)(up,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"Prev"})]}),(0,Dr.jsxs)("button",{className:"splide__arrow splide__arrow--next",children:[(0,Dr.jsx)(ka,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"Next"})]})]})]})})]})]})]})};var Em=()=>(0,Dr.jsx)("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M10.14 0.85498C4.55 0.85498 0 5.40498 0 10.995C0 16.585 4.55 21.145 10.14 21.145C15.73 21.145 20.29 16.595 20.29 10.995C20.29 5.39498 15.74 0.85498 10.14 0.85498ZM10.14 19.645C5.38 19.645 1.5 15.765 1.5 10.995C1.5 6.22498 5.38 2.35498 10.14 2.35498C14.9 2.35498 18.79 6.23498 18.79 10.995C18.79 15.755 14.91 19.645 10.14 19.645ZM15.62 10.995C15.62 11.415 15.29 11.745 14.87 11.745H10.9V15.725C10.9 16.145 10.56 16.475 10.14 16.475C9.72 16.475 9.4 16.145 9.4 15.725V11.745H5.42C5 11.745 4.67 11.415 4.67 10.995C4.67 10.575 5 10.245 5.42 10.245H9.4V6.27498C9.4 5.85498 9.73 5.52498 10.14 5.52498C10.55 5.52498 10.9 5.85498 10.9 6.27498V10.245H14.87C15.29 10.245 15.62 10.585 15.62 10.995Z",fill:"var(--color-dark-raspberry-secondary)"})});var Tm=()=>(0,Dr.jsx)("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M14.87 11.745H5.42C5.01 11.745 4.67 11.405 4.67 10.995C4.67 10.585 5.01 10.245 5.42 10.245H14.88C15.29 10.245 15.63 10.585 15.63 10.995C15.63 11.405 15.29 11.745 14.88 11.745H14.87ZM20.29 10.995C20.29 16.595 15.74 21.145 10.14 21.145C4.54 21.145 0 16.595 0 10.995C0 5.39498 4.55 0.85498 10.14 0.85498C15.73 0.85498 20.29 5.40498 20.29 10.995ZM18.79 10.995C18.79 6.23498 14.91 2.35498 10.14 2.35498C5.37 2.35498 1.5 6.23498 1.5 10.995C1.5 15.755 5.38 19.645 10.14 19.645C14.9 19.645 18.79 15.765 18.79 10.995Z",fill:"var(--color-dark-raspberry-secondary)"})});var Pm=()=>{const[t,r]=(0,e.useState)(!1),n=(0,e.useRef)(null),i=y((e=>e.auth.user));return(0,Dr.jsxs)("div",{className:Cm.alternative_container,children:[(0,Dr.jsxs)("button",{onClick:()=>{r((e=>!e))},className:"btn-underline btn-underline-red btn-underline-static",children:[!t&&(0,Dr.jsx)(Em,{}),t&&(0,Dr.jsx)(Tm,{}),"Use Promo/Rewards"]}),(0,Dr.jsx)(cc,{in:t,nodeRef:n,timeout:300,classNames:"rewards",unmountOnExit:!0,children:(0,Dr.jsx)("div",{className:Cm.alternative_container_inner,ref:n,children:(0,Dr.jsxs)("div",{className:Cm.alternative_container_inner_wrapper,children:[i&&(0,Dr.jsx)(jm,{}),(0,Dr.jsx)(Sm,{})]})})})]})},Im="Tip_checkout_tip__vK-qp",Mm="Tip_checkout_tip_header__W46jq",Nm="Tip_checkout_tip_header_title__15sHd",Am="Tip_checkout_tip_percent__cALGO",Lm="Tip_checkout_tip_item__4EaU5",Dm="Tip_active__xwjb7",zm="Tip_selection_active__bWdDp",Om="Tip_checkout_tip_amount__19pVo",Rm="Tip_other_tip__Mlyj0",Fm="Tip_loader__G9dNm",Bm="Tip_btn_placeholder__YIO+a";var Vm=()=>(0,Dr.jsx)("svg",{width:"14",height:"18",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M13.3412 10.0995C13.219 8.95113 11.3213 8.42172 9.61086 8.18552C9.62715 8.11222 9.62715 8.03891 9.62715 7.96561C9.62715 6.33665 8.30769 5.01719 6.67873 5.01719C5.04977 5.01719 3.73032 6.33665 3.73032 7.96561C3.73032 8.03891 3.73032 8.11222 3.74661 8.18552C2.05249 8.42172 0.154751 8.94299 0.0162896 10.0833C0 10.1321 0 10.1729 0 10.2217V15.7683C0 15.7683 0 15.8498 0 15.8905C0.18733 17.552 4.24344 18 6.67059 18C9.09774 18 13.3493 17.5276 13.3493 15.7683V10.2217C13.3493 10.2217 13.3412 10.1403 13.333 10.0995H13.3412ZM6.67873 6.03529C7.7457 6.03529 8.60905 6.89864 8.60905 7.96561C8.60905 8.68235 8.2181 9.33394 7.59095 9.66787C7.56651 9.68416 7.54208 9.70045 7.52579 9.71674H5.84796C5.18009 9.3991 4.74842 8.70679 4.74842 7.96561C4.74842 6.89864 5.61176 6.03529 6.67873 6.03529ZM4.09683 9.37466C4.15385 9.49683 4.22715 9.61086 4.3086 9.71674H3.65701C3.37195 9.71674 3.14389 9.9448 3.14389 10.2217C3.14389 10.4986 3.37195 10.7348 3.65701 10.7348H9.70045C9.98552 10.7348 10.2136 10.4986 10.2136 10.2217C10.2136 9.9448 9.98552 9.71674 9.70045 9.71674H9.04887C9.13032 9.61086 9.20362 9.49683 9.26878 9.37466C11.0362 9.60272 11.8914 10.
20181 12.1032 10.2217C11.7367 10.6127 9.77376 11.2317 6.67873 11.2317C3.58371 11.2317 1.61267 10.6127 1.2543 10.2217C1.46606 10.01 2.31312 9.60272 4.09683 9.37466ZM12.1357 15.7195C11.9158 16.1023 9.91222 16.7783 6.67873 16.7783C3.44525 16.7783 1.41719 16.0941 1.22172 15.7683V11.6063C2.6552 12.2498 5.04163 12.4534 6.67873 12.4534C8.31584 12.4534 10.7023 12.2498 12.1357 11.6063V15.7195ZM6.67873 3.8362C6.3448 3.8362 6.06787 3.55928 6.06787 3.22534V0.61086C6.06787 0.276923 6.3448 0 6.67873 0C7.01267 0 7.28959 0.276923 7.28959 0.61086V3.23348C7.28959 3.56742 7.01267 3.84434 6.67873 3.84434V3.8362ZM3.41267 5.18824C3.25792 5.18824 3.10317 5.13122 2.981 5.00905L1.12398 3.16018C0.887783 2.92398 0.887783 2.53303 1.12398 2.29683C1.36018 2.06063 1.75113 2.06063 1.98733 2.29683L3.8362 4.1457C4.0724 4.3819 4.0724 4.77285 3.8362 5.00905C3.71403 5.13122 3.55928 5.18824 3.40452 5.18824H3.41267ZM9.95294 5.18824C9.79819 5.18824 9.64344 5.13122 9.52127 5.00905C9.28507 4.77285 9.28507 4.3819 9.52127 4.1457L11.3701 2.29683C11.6063 2.06063 11.9973 2.06063 12.2335 2.29683C12.4697 2.53303 12.4697 2.92398 12.2335 3.16018L10.3846 5.00905C10.2624 5.13122 10.1077 5.18824 9.95294 5.18824Z",fill:"var(--color-dark-raspberry)"})});var $m=t=>{let{cart:r}=t;const n=(0,e.useRef)(null),i=E(),a=y((e=>e.cart.tipSelection)),[s,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)(!1),[h,p]=(0,e.useState)(null),m=async e=>{o(!0),d(!1);const t=(r.subtotal+r.salestax)*e/100;p(e);const n=await br(r.id,{amount:t.toFixed(2)});n.id?(Mr("currentCart",n),i(vs.setTipSelection(e)),i(vs.addCart(n))):i(qi.setError(n)),o(!1)};return(0,Dr.jsxs)("div",{className:Im,children:[(0,Dr.jsx)("div",{className:Mm,children:(0,Dr.jsxs)("div",{className:Nm,children:[(0,Dr.jsx)(Vm,{}),(0,Dr.jsx)("span",{children:"Tip"})]})}),(0,Dr.jsxs)("div",{className:Am,children:[(0,Dr.jsx)("div",{className:Lm,children:(0,Dr.jsx)("button",{onClick:m.bind(void 0,15),disabled:s&&!0,className:15===a?zm:"",children:"15%"})}),(0,Dr.jsx)("div",{className:Lm,children:(0,Dr.jsx)("button",{onClick:m.bind(void 0,20),disabled:s&&!0,className:20===a?zm:"",children:"20%"})}),(0,Dr.jsx)("div",{className:Lm,children:(0,Dr.jsx)("button",{onClick:m.bind(void 0,25),disabled:s&&!0,className:25===a?zm:"",children:"25%"})}),(0,Dr.jsx)("div",{className:Lm,children:(0,Dr.jsx)("button",{onClick:()=>{d((e=>!e))},className:`${u&&Dm} ${"custom"===a?zm:""}`,disabled:s&&!0,children:"Custom"})})]}),u&&(0,Dr.jsxs)("div",{className:"form-fields-container",children:[(0,Dr.jsx)("label",{htmlFor:"tipInput",className:"label",children:"Tip in $:"}),(0,Dr.jsxs)("div",{className:Rm,children:[(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsx)("input",{id:"tipInput",name:"tipInput",type:"number",placeholder:"0",ref:n})}),(0,Dr.jsxs)("div",{className:"form-controller",children:[!s&&(0,Dr.jsx)("button",{className:"btn",onClick:async()=>{o(!0);const e=Number(n.current.value);if(p("custom"),i(vs.setTipSelection("custom")),e&&e>=0&&"number"===typeof e){const t=await br(r.id,{amount:e.toFixed(2)});t.id?(Mr("currentCart",t),i(vs.addCart(t))):i(qi.setError(t))}else i(qi.setError({message:"Please set a valid tip amount"}));o(!1)},children:"Set Tip"}),s&&(0,Dr.jsx)("div",{className:`btn-loader ${Fm}`,children:(0,Dr.jsx)("span",{className:"loader"})})]})]})]}),s&&(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("span",{className:"loader dark-raspberry"})," Setting tip!"]}),0!==r.tip&&(0,Dr.jsxs)("div",{className:Om,children:[(0,Dr.jsxs)("span",{children:["tip amount: $",ia(r.tip)]}),!l&&(0,Dr.jsxs)("button",{onClick:async()=>{c(!0);const e=await br(r.id,{amount:0});e.id?(Mr("currentCart",e),i(vs.setTipSelection(null)),i(vs.addCart(e))):i(qi.setError(e)),c(!1)},title:"remove tip",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:(0,Dr.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"Remove tip"})]}),l&&(0,Dr.jsx)("div",{className:Bm,children:(0,Dr.jsx)("span",{className:"loader dark-raspberry"})})]})]})},Um="AdvanceDays_select__lt8tR",Hm="AdvanceDays_selects_container__-PWfK",qm="AdvanceDays_time_slots_container__yQiHV",Zm="AdvanceDays_loading_overlay__kWfAE",Gm="AdvanceDays_controls__R3fzD",Wm="AdvanceDays_open_drawer__IzNIc",Xm="AdvanceDays_disabled__IvQmB";var Jm=t=>{let{closeModal:r}=t;const n=E(),[i,a]=(0,e.useState)(!1),[s,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(null),[u,d]=(0,e.useState)(null),h=y((e=>e.cart.cart)),p=y((e=>e.location.location)),[m,f]=(0,e.useState)(!1),g=(0,e.useRef)(),_=(0,e.useRef)();(0,e.useEffect)((()=>{const e=[];let t=null;if(h&&h.earliestreadytime){const e=new Date;t=new Date(h.earliestreadytime)>e?Ki(h.earliestreadytime):e}for(let r=0;r<p.services.advance_days;r++){const n=new Date(t),i=n.setDate(n.getDate()+r);e.push({weekDay:new Date(i).toLocaleDateString("en-US",{weekday:"long"}),day:new Date(i).toLocaleDateString("en-US",{day:"numeric"}),date:Wi(i),dateUS:new Date(i).toLocaleDateString("en-US"),fancyFormat:new Date(i).toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"})})}c(e)}),[p]);return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:Hm,children:[(0,Dr.jsxs)("div",{className:qm,children:[l&&(0,Dr.jsxs)("select",{ref:g,onChange:async e=>{f(!0),d(null);const t=new Date,r=new Date(e.target.value),i=t.toDateString()===r.toDateString(),a=await vr(h.id,p.id,e.target.value);let s=0;if(h&&h.leadtimeestimateminutes&&(s=Math.ceil(h.leadtimeestimateminutes/15),s>16&&(s=0)),200===a.status){let t=[];for(const[e,n]of Object.entries(a.data))t.push({label:e,value:n});let r=t;if(i){console.log("today!");let n=wa(h.earliestreadytime,t,e.target.value);console.log("newSlotsToRemove:::: ",n),r.splice(0,n)}d(r)}else n(qi.setError(a));f(!1)},className:`select ${Um}`,defaultValue:"Date",children:[(0,Dr.jsx)("option",{disabled:!0,value:"Date",hidden:!0,children:"Date"}),l.map((e=>(0,Dr.jsx)("option",{value:e.date,children:e.fancyFormat},e.day+e.date)))]}),(0,Dr.jsx)("span",{className:Wm,children:(0,Dr.jsx)(Vs,{})})]}),(0,Dr.jsxs)("div",{className:`${qm} ${u?"":Xm}`,children:[(0,Dr.jsxs)("select",{ref:_,className:`select ${Um}`,onChange:()=>{o(!0)},disabled:!u,defaultValue:"Time",children:[(0,Dr.jsx)("option",{disabled:!0,value:"Time",hidden:!0,children:"Time"}),u&&!m&&(0,Dr.jsx)(Dr.Fragment,{children:u.map((e=>(0,Dr.jsx)("option",{value:e.value,children:e.label},e.value)))})]}),(0,Dr.jsx)("span",{className:Wm,children:(0,Dr.jsx)(Vs,{fill:"#fff"})}),!u&&m&&(0,Dr.jsx)("div",{className:Zm,children:(0,Dr.jsx)("span",{className:"loader dark"})})]})]}),s&&(0,Dr.jsxs)("div",{className:Gm,children:[!i&&(0,Dr.jsx)("button",{onClick:async()=>{a(!0);const e={delivery_mode:"dispatch"===h.deliverymode?"delivery":h.deliverymode,time:"schedule",schedule_date:g.current.value,schedule_time:_.current.value};"dispatch"===h.deliverymode&&(e.zip_code=h.deliveryaddress.zipcode,e.street_address=h.deliveryaddress.streetaddress,e.city=h.deliveryaddress.city,e.phone_number=h.deliveryaddress.phonenumber,e.special_instructions=h.deliveryaddress.specialinstructions,e.building=h.deliveryaddress.building);const t=await _r(h.id,e);t.id?(async(e,t)=>{const i=await yr(e);i.id?(Mr("currentCart",i),n(vs.addCart(i)),n(Vi.setOrderType(t.time)),n(Vi.setOrderDate(t.schedule_date)),n(Vi.setOrderTime(t.schedule_time)),r()):n(qi.setError(i)),a(!1)})(t.id,e):(n(qi.setError(t)),a(!1))},className:"btn",children:"Confirm"}),i&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})};var Km=t=>{const r=E(),[n,i]=(0,e.useState)(),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(),c=y((e=>e.cart.cart)),u=y((e=>e.location.location));(0,e.useEffect)((()=>{let e="",t="",r="";r="advance"===c.timemode?c.timewanted.split(" "):c.earliestreadytime.split(" "),r.forEach(((r,n)=>{if(0===n){const t=r.slice(0,4)+"-"+r.slice(4,6)+"-"+r.slice(6);e=t}1===n&&(t=r)})),l(e+"T"+t)}),[c]);const d=()=>{i((e=>!e))},h=async(e,t)=>{const n=await yr(e);n.id?(Mr("currentCart",n),r(vs.addCart(n)),r(Vi.setOrderType(t.time)),r(Vi.setOrderDate(t.schedule_date)),r(Vi.setOrderTime(t.schedule_time)),i(!1)):r(qi.setError(n)),s(!1)},[p,m]=(0,e.useState)(!1);(0,e.useRef)(null);return(0,Dr.jsx)(Dr.Fragment,{children:u&&u.services.advance&&(0,Dr.jsxs)("div",{className:xc.checkout_date_info,children:[(0,Dr.jsxs)("div",{className:xc.checkout_location_date_info_title,children:[(0,Dr.jsx)(Ks,{dimensions:{width:16,height:16}}),"dispatch"===c.deliverymode?"Delivery time":"Pickup time"]}),(0,Dr.jsx)("div",{className:`${xc.checkout_location_date_info_more} ${xc.max_width_container}
2`,children:new Date(o).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,Dr.jsx)("div",{className:xc.checkout_location_date_info_cta,children:(0,Dr.jsx)("button",{onClick:d,children:"Change Time"})}),n&&(0,Dr.jsxs)(Tp,{closeInfoHandler:d,transition:n,children:[(0,Dr.jsx)("h3",{children:"Select Date and Time"}),(0,Dr.jsxs)("div",{className:xc.modal_controls,children:[!a&&(0,Dr.jsx)("button",{className:"btn btn-border-input",onClick:async()=>{s(!0);const e={delivery_mode:"dispatch"===c.deliverymode?"delivery":c.deliverymode,time:"asap",schedule_date:null,schedule_time:null};"dispatch"===c.deliverymode&&(e.zip_code=c.deliveryaddress.zipcode,e.street_address=c.deliveryaddress.streetaddress,e.city=c.deliveryaddress.city,e.phone_number=c.deliveryaddress.phonenumber,e.special_instructions=c.deliveryaddress.specialinstructions,e.building=c.deliveryaddress.building);const t=await _r(c.id,e);if(t.id)if("curbisde"===c.deliverymode){const n={vehicle_make:c.customfields[0].value,vehicle_model:c.customfields[1].value,vehicle_color:c.customfields[2].value},i=await xr(t.id,u.id,n);i.id?h(i.id,e):(r(qi.setError(i)),s(!1))}else h(t.id,e);else r(qi.setError(t)),s(!1)},children:"Asap"}),a&&(0,Dr.jsx)("div",{className:"btn btn-border-input",children:(0,Dr.jsx)("span",{className:"loader dark"})}),(0,Dr.jsx)("button",{className:`btn btn-border-input ${p&&"btn-active"}`,onClick:()=>{m(!0)},children:"Schedule"})]}),p&&(0,Dr.jsx)(Jm,{closeModal:d})]})]})})},Ym="CartInfo_card__dP4dm",Qm="CartInfo_card_header__SY8BI",ef="CartInfo_card_row__+wOwz";var tf=()=>{const e=xt(),t=E(),r=y((e=>e.auth.user)),n=Ir("guestUser"),i={name:null===r||void 0===r?void 0:r.name,email:null===r||void 0===r?void 0:r.email,phone:null===r||void 0===r?void 0:r.phone},a={name:(null===n||void 0===n?void 0:n.firstName)+" "+(null===n||void 0===n?void 0:n.lastName),email:null===n||void 0===n?void 0:n.email,phone:null===n||void 0===n?void 0:n.phone};return(0,Dr.jsxs)("div",{className:Ym,children:[r&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("h4",{className:Qm,children:["Contact Information",(0,Dr.jsx)("button",{onClick:()=>{t(vs.setCartSidebarState()),e("/account/edit")},className:"btn-simple",children:"Edit account"})]}),(0,Dr.jsx)("div",{className:ef,children:i.name}),(0,Dr.jsx)("div",{className:ef,children:i.email}),(0,Dr.jsx)("div",{className:ef,children:ea(i.phone)})]}),!r&&n&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("h4",{className:Qm,children:["Guest Information",(0,Dr.jsx)("button",{onClick:()=>{t(vs.setCartSidebarStep("info"))},className:"btn-simple",children:"Edit Info"})]}),(0,Dr.jsx)("div",{className:ef,children:a.name}),(0,Dr.jsx)("div",{className:ef,children:a.email}),(0,Dr.jsx)("div",{className:ef,children:ea(a.phone)})]})]})};var rf=t=>{let{closeModal:r}=t;const n=E(),[i,a]=(0,e.useState)(!1),s=y((e=>e.cart.cart)),o=y((e=>e.location.location)),l=(0,e.useRef)(),c=(0,e.useRef)(),u=(0,e.useRef)(),[d,h]=(0,e.useState)({make:!0,model:!0,color:!0});return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h3",{children:"Vehicle details"}),(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),a(!0);const t=l.current.value,i=c.current.value,d=u.current.value,p=!ta(t),m=!ta(i),f=!ta(d);h({make:p,model:m,color:f});if(p&&m&&f){const e={vehicle_make:t,vehicle_model:i,vehicle_color:d};localStorage.setItem("carInfo",JSON.stringify(e));const a=await xr(s.id,o.id,e);if(a.id){const e={delivery_mode:"curbside",time:"advance"===a.timemode?"schedule":a.timemode,schedule_date:null===a.timewanted?null:Ki(a.timewanted),schedule_time:null===a.timewanted?null:a.timewanted.split(" ")[1]},o=await _r(s.id,e);o.id?(async(e,t)=>{const i=await yr(e);i.id?(Mr("currentCart",i),n(vs.addCart(i)),n(vs.setVehicleInfo(t)),r()):n(qi.setError(i))})(a.id,{vehicleMake:t,vehicleModel:i,vehicleColor:d}):n(qi.setError(o))}else n(qi.setError(a))}a(!1)},className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:`form-controller-group ${xc.mobile_flex_wrap}`,children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"car_make",children:"Vehicle Make"}),(0,Dr.jsx)("input",{ref:l,type:"text",id:"car_make",name:"car_make",placeholder:"e.g. Chevrolet, Toyota",className:`${d.make?null:"error"}`,required:!0}),!d.make&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter car make"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"car_model",children:"Vehicle Model"}),(0,Dr.jsx)("input",{ref:c,type:"text",id:"car_model",name:"car_model",placeholder:"e.g. Silverado",className:`${d.model?null:"error"}`,required:!0}),!d.model&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter car model"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"car_color",children:"Vehicle Color"}),(0,Dr.jsx)("input",{ref:u,type:"text",id:"car_color",name:"car_color",placeholder:"e.g. Red, Blue",className:`${d.color?null:"error"}`,required:!0}),!d.color&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter car color"})]})]}),(0,Dr.jsxs)("div",{className:`form-controller ${xc.modal_footer}`,children:[!i&&(0,Dr.jsx)("button",{type:"submit",className:"btn",children:"Set Vehicle Info"}),i&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})]})};var nf=t=>{let{closeModal:r}=t;const n=E(),i=y((e=>e.location.location)),a=y((e=>e.cart.cart)),[s,o]=(0,e.useState)({hasErrors:!1,errorMessage:null}),[l,c]=(0,e.useState)(""),[u,d]=(0,e.useState)(""),[h,p]=(0,e.useState)(!1),[m,f]=(0,e.useState)(null);return(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("h3",{children:"Delivery Details"}),(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsx)(Bl,{selectedResult:async e=>{p(!0),d(e);const t=await ar({lat:e.latitude,lng:e.longitude},"pickup");if(t.message)n(qi.setError({message:"Delivery is not available. This address is outside the delivery area."})),f(null);else{if(t.find((e=>
2e.id===i.id))){const t={delivery_mode:"delivery",time:"advance"===a.timemode?"schedule":a.timemode,schedule_date:null===a.timewanted?null:Ki(a.timewanted),schedule_time:null===a.timewanted?null:a.timewanted.split(" ")[1],street_address:e.number+" "+e.street,city:e.city,zip_code:e.postalCode},i=await _r(a.id,t);i.id?(async e=>{const t=await yr(e);t.id?(Mr("currentCart",t),n(vs.addCart(t)),r(),p(!1)):(n(qi.setError(t)),p(!1))})(i.id):(n(qi.setError(i)),p(!1))}else n(qi.setError({message:"Delivery is not available. This address is outside the delivery area."})),p(!1);f(t)}p(!1)},loading:h,foundLocations:e=>{f(e)},inputError:s.hasErrors,setError:e=>{o(e?{hasErrors:!0,errorMessage:e}:{hasErrors:!1,errorMessage:null})},setValue:e=>{c(e)},setAddressDetails:e=>{d(e)}})}),s.hasErrors&&(0,Dr.jsx)("div",{className:"error-message",children:s.errorMessage})]})};var af=()=>{const t=E(),[r,n]=(0,e.useState)(),[i,a]=(0,e.useState)(!1),s=y((e=>e.cart.cart)),o=y((e=>e.location.location)),l=(0,e.useRef)(),c=(0,e.useRef)(),u=(0,e.useRef)(),[d,h]=(0,e.useState)({make:!0,model:!0,color:!0}),p=()=>{n((e=>!e))};return(0,Dr.jsx)(Dr.Fragment,{children:"curbside"===s.deliverymode&&(0,Dr.jsxs)("div",{className:xc.checkout_location_info,children:[(0,Dr.jsxs)("div",{className:xc.checkout_location_date_info_title,children:[(0,Dr.jsx)(Ts,{}),"Vehicle"]}),(0,Dr.jsxs)("div",{className:xc.checkout_location_date_info_more,children:[s.customfields&&s.customfields.map((e=>{if("Make"===e.label)return e.value})),s.customfields&&s.customfields.map((e=>{if("Model"===e.label)return" "+e.value+", "})),s.customfields&&s.customfields.map((e=>{if("Color"===e.label)return e.value}))]}),(0,Dr.jsx)("div",{className:xc.checkout_location_date_info_cta,children:(0,Dr.jsx)("button",{onClick:p,children:"Change Vehicle"})}),r&&(0,Dr.jsxs)(Tp,{closeInfoHandler:p,transition:r,children:[(0,Dr.jsx)("h3",{children:"Change vehicle informations"}),(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),a(!0);const r=l.current.value,i=c.current.value,d=u.current.value,p=!ta(r),m=!ta(i),f=!ta(d);h({make:p,model:m,color:f});if(p&&m&&f){const e={vehicle_make:r,vehicle_model:i,vehicle_color:d};localStorage.setItem("carInfo",JSON.stringify(e));const a=await xr(s.id,o.id,e);a.id?(async(e,r)=>{const i=await yr(e);i.id?(Mr("currentCart",i),t(vs.addCart(i)),t(vs.setVehicleInfo(r)),n(!1)):t(qi.setError(i))})(a.id,{vehicleMake:r,vehicleModel:i,vehicleColor:d}):t(qi.setError(a))}a(!1)},className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:`form-controller-group ${xc.mobile_flex_wrap}`,children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"car_make",children:"Vehicle Make"}),(0,Dr.jsx)("input",{ref:l,type:"text",id:"car_make",name:"car_make",placeholder:"e.g. Chevrolet, Toyota",className:`${d.make?null:"error"}`,required:!0}),!d.make&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter car make"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"car_model",children:"Vehicle Model"}),(0,Dr.jsx)("input",{ref:c,type:"text",id:"car_model",name:"car_model",placeholder:"e.g. Silverado",className:`${d.model?null:"error"}`,required:!0}),!d.model&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter car model"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"car_color",children:"Vehicle Color"}),(0,Dr.jsx)("input",{ref:u,type:"text",id:"car_color",name:"car_color",placeholder:"e.g. Red, Blue",className:`${d.color?null:"error"}`,required:!0}),!d.model&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter car model"})]})]}),(0,Dr.jsxs)("div",{className:`form-controller ${xc.modal_footer}`,children:[!i&&(0,Dr.jsx)("button",{className:"btn",type:"submit",children:"Set Vehicle Info"}),i&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})]})]})})};var sf=t=>{let{children:r}=t;const n=E(),[i,a]=(0,e.useState)(!1),s=y((e=>e.location.location)),o=y((e=>e.cart.cart)),[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)(!1),[h,p]=(0,e.useState)(!1),m=()=>{a(!1),d(!1),p(!1)};return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("button",{onClick:()=>{a((e=>!e)),d(!1),p(!1)},children:r}),i&&(0,Dr.jsxs)(Tp,{closeInfoHandler:m,transition:i,children:[!u&&!h&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("h3",{children:"Change Order Type"}),(0,Dr.jsxs)("div",{className:xc.modal_controls,children:[s.services.dispatch&&"dispatch"!==o.deliverymode&&(0,Dr.jsxs)("button",{className:"btn btn-border",onClick:()=>{d(!0)},children:[(0,Dr.jsx)(Es,{}),"Delivery"]}),s.services.pickup&&"pickup"!==o.deliverymode&&(0,Dr.jsxs)(Dr.Fragment,{children:[!l&&(0,Dr.jsx)("button",{className:"btn btn-border",onClick:async()=>{c(!0);const e={delivery_mode:"pickup",time:"asap"===o.timemode?"asap":"schedule",schedule_date:null===o.timewanted?null:Ki(o.timewanted),schedule_time:null===o.timewanted?null:o.timewanted.split(" ")[1]},t=await _r(o.id,e);t.id?(async e=>{const t=await yr(e);t.id?(Mr("currentCart",t),n(vs.addCart(t)),a(!1)):n(qi.setError(t)),c(!1)})(t.id):(n(qi.setError(t)),c(!1))},children:"Pickup"}),l&&(0,Dr.jsx)("div",{className:"btn btn-border",children:(0,Dr.jsx)("span",{className:"loader dark"})})]}),s.services.curbside&&"curbside"!==o.deliverymode&&(0,Dr.jsxs)("button",{className:"btn btn-border",onClick:()=>{p(!0)},children:[(0,Dr.jsx)(Ts,{}),"Curbside"]})]})]}),u&&(0,Dr.jsx)("div",{children:(0,Dr.jsx)(nf,{closeModal:m})}),h&&(0,Dr.jsx)("div",{children:(0,Dr.jsx)(rf,{closeModal:m})})]})]})};var of=()=>{const e=y((e=>e.cart.cart)),t=y((e=>e.location.location));return(0,Dr.jsxs)("div",{className:xc.checkout_location_info,children:[(0,Dr.jsxs)("div",{className:xc.checkout_location_date_info_title,children:[(0,Dr.jsx)(Ps,{}),"pickup"===e.deliverymode&&(0,Dr.jsx)("span",{children:e.deliverymode+" from"}),"curbside"===e.deliverymode&&(0,Dr.jsx)("span",{children:e.deliverymode+" from"}),"dispatch"===e.deliverymode&&(0,Dr.jsx)("span",{children:"Delivery to"})]}),(0,Dr.jsxs)("div",{className:xc.checkout_location_date_info_more,children:["dispatch"!==e.deliverymode&&(0,Dr.jsxs)(Dr.Fragment,{children:[t.address.street," ",(0,Dr.jsx)("br",{}),t.address.city,", ",t.address.state," ",t.address.zip]}),"dispatch"===e.deliverymode&&(0,Dr.jsxs)(Dr.Fragment,{children:[e.deliveryaddress.streetaddress," ",e.deliveryaddress.zipcode," ",e.deliveryaddress.city]})]}),(0,Dr.jsx)("div",{className:xc.checkout_location_date_info_cta,children:(0,Dr.jsx)(sf,{children:"Change Order Type"})})]})},lf="NonOloPay_olo_card_form__dcpAS",cf="NonOloPay_set_credit_card__sWpFx",uf="NonOloPay_submit_container__7V4v6",df="NonOloPay_input__KcZaD",hf="NonOloPay_form_controller_credit_card__FjpGn",pf="NonOloPay_form_controller_cvv__MZF3y",mf=r(4457),ff=r.n(mf);var gf=e=>{let{value:t,onChange:r,refVar:n}=e;return(0,Dr.jsx)(ff(),{ref:n,className:df,mask:"99/9999",placeholder:"MM/YYYY"})};var _f=t=>{let{checkoutFrame:r}=t;const n=E(),i=xt(),a=(0,e.useRef)(),s=(0,e.useRef)(),[o,l]=(0,e.useState)(!1);let c=y((e=>e.cart.cart));const u=Ir("guestUser"),d=y((e=>e.auth.user));y((e=>e.cart.hasUserOptedIn));let h=y((e=>e.location.location));const[p,m]=(0,e.useState)("");return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"dateInput",children:"Expiry Date"}),(0,Dr.jsx)(gf,{refVar:a})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"locationZip",children:"Zip Code"}),(0,Dr.jsx)("input",{ref:s,value:p,type:"text",id:"locationZip",name:"locationZip",placeholder:"12345",required:!0,onChange:e=>{(""===e.target.value||/^[0-9\b]+$/.test(e.target.value))&&e.target.value.length<6&&m(e.target.value)}})]})]}
2),(0,Dr.jsxs)("div",{className:uf,children:[!o&&(0,Dr.jsxs)("button",{onClick:async()=>{l(!0);const e={phone:!0,zip:!0};let t=null,o=null;const p=fa("rwg_token"),m=a.current.value;if(ta(m))e.zip=!0,n(qi.setError({message:"Please provide a valid date"}));else{let r=m.split("/")[0],i=m.split("/")[1];if(/^\d+$/.test(r)&&/^\d+$/.test(i)){var f=new Date;new Date(`${i}-${r}-01`)>f?(o=i,t=r,e.phone=!1):(e.phone=!0,n(qi.setError({message:"Please check date format"})))}else e.phone=!0,n(qi.setError({message:"Please provide a valid date"}))}const g=s.current.value;if(!ta(g)&&g.length>=5?e.zip=!1:(e.zip=!0,n(qi.setError({message:"Please provide a valid zip code"}))),!e.phone&&!e.zip){const e=ca(),a=async()=>{if(d){return await Sr(c.id,{authtoken:e})}return await Sr(c.id,null)},s=await a();if(s&&s.accesstoken){const i=await yr(c.id);i.id?d?r.submit({id:i.id,accessToken:s.accesstoken,userType:"user",authtoken:e,firstName:d.first_name,lastName:d.last_name,emailAddress:d.email,contactNumber:d.phone.replace(/\D/g,""),billingAccounts:[{amount:i.total,billingMethod:"creditcard",city:"",expiryMonth:t,expiryYear:o,state:"",streetAddress:"",streetAddress2:"",zip:g,tipPortion:i.tip}]}):u&&r.submit({id:i.id,accessToken:s.accesstoken,firstName:u.firstName,lastName:u.lastName,emailAddress:u.email,contactNumber:u.phone.replace(/\D/g,""),userType:"guest",billingAccounts:[{amount:i.total,billingMethod:"creditcard",city:"",expiryMonth:t,expiryYear:o,state:"",streetAddress:"",streetAddress2:"",zip:g,tipPortion:i.tip}]}):n(qi.setError(i))}r.on("success",(function(e){p&&ga("rwg_token"),Ar("currentCart"),n(vs.addCart(null)),n(vs.setCartSidebarState()),n(vs.setBilling(null)),n(_m.clearVirtualCart()),ua(e,h),i(`/order/${e.id}`)})),r.on("error",(function(e){e.forEach((e=>{n(qi.setError({message:e.description}))}))}))}l(!1)},className:`btn ${cf}`,children:["Place order | ",c.total.toFixed(2)]}),o&&(0,Dr.jsx)("div",{className:`btn ${cf}`,children:(0,Dr.jsx)("span",{className:"loader"})})]})]})};let yf=new window.Olo.CheckoutFrame({cardElement:"credit-card-info-div",cvvElement:"cvv-info-div"});var vf=()=>{let t=y((e=>e.cart.cart));const[r,n]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{let e=[];t.products.forEach((t=>{e.push({item_id:t.productId,item_name:t.name,price:t.totalcost,quantity:t.quantity})})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"add_payment_info",ecommerce:{currency:"USD",value:t.total,coupon:t.coupon,payment_type:"credit card",items:e}}),r||(n(!0),yf.initialize({brandAccessId:"_Y58Czo-dvg2BWdAf6mvniv8KqSZ_mDN",basketGuid:t.id,styles:{cardNumber:'background-color: transparent;\n border: 0;\n border-left-width: 0;\n border-right-width: 0;\n border-bottom: 0;\n border-top-width: 0;\n display: block;\n font-family: "Brandon Text";\n font-size: 18px;\n height: 1.2em;\n line-height: 1.2em;\n margin: 0;\n padding: 0;\n width: 100%;\n color: #242c37;\n ',cvv:'background-color: transparent;\n border: 0;\n border-left-width: 0;\n border-right-width: 0;\n border-bottom: 0;\n border-top-width: 0;\n display: block;\n font-family: "Brandon Text";\n height: 1.2em;\n line-height: 1.2em;\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: 18px;\n color: #242c37;\n '},cardNumber:{placeholder:"Credit Card"},cvv:{placeholder:"Cvv"}}))}),[]),(0,Dr.jsx)("div",{children:(0,Dr.jsxs)("div",{className:`form-fields-container ${lf}`,children:[(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:`form-controller ${hf}`,children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"card_number",children:"Card Number"}),(0,Dr.jsx)("div",{className:"credit-card-info-div olo-pay"})]}),(0,Dr.jsxs)("div",{className:`form-controller ${pf}`,children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"cvv_input",children:"CVV"}),(0,Dr.jsx)("div",{className:"cvv-info-div olo-pay"})]})]}),(0,Dr.jsx)(_f,{checkoutFrame:yf})]})})};var xf=t=>{let{cartId:r,totalPrice:n}=t;const i=xt(),a=E(),[s,o]=(0,e.useState)([]),[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)(!1),h=Ir("guestUser");let p=y((e=>e.cart.cart)),m=ca();const f=y((e=>e.auth.user));let g=y((e=>e.location.location));y((e=>e.cart.hasUserOptedIn));const _=fa("rwg_token");(0,e.useEffect)((()=>
2{if(_){const e={rwg_token:_};(async()=>{await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/referrals`,"POST",t))(p.id,e)})()}(async()=>{c(!0);const e=await(async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/billing-schemes`,null,null))(r);o(e),c(!1)})()}),[r]);const v=y((e=>e.cart.billing));return(0,Dr.jsxs)("div",{className:xc.cart_items,children:[(0,Dr.jsxs)("div",{className:xc.checkout_location_date_info,children:[(0,Dr.jsx)(of,{}),(0,Dr.jsx)(Km,{})]}),p&&"curbside"===p.deliverymode&&(0,Dr.jsx)("div",{className:xc.checkout_location_date_info,children:(0,Dr.jsx)(af,{})}),(0,Dr.jsx)(tf,{}),g.payment.tip&&(0,Dr.jsx)($m,{cart:p}),(0,Dr.jsx)(Pm,{}),!l&&17199!==g.id&&(0,Dr.jsxs)("div",{className:xc.billing_container,children:[s&&s.length>0&&s.filter((e=>e.supportsolopay)).length>0&&(0,Dr.jsx)(wm,{billingMethod:s}),s&&s.length<=0&&(0,Dr.jsx)("div",{children:"No Billing Method"})]}),s&&s.length>0&&s.filter((e=>!e.supportsolopay&&"creditcard"===e.type)).map((e=>(0,Dr.jsx)(vf,{},e.type))),l&&(0,Dr.jsx)("div",{className:xc.billing_loader,children:(0,Dr.jsx)("span",{className:"preparing_restaurant_loader"})}),(0,Dr.jsx)("div",{className:xc.disclaimer,children:(0,Dr.jsxs)("p",{children:["* Submitting this order confirms that you accept all associated terms and conditions. Please be advised Delivery orders are fulfilled via third party. Review address & order details for accuracy. Your order will be sent to ",g.name,"."]})}),s&&0===s.length&&(0,Dr.jsx)("div",{className:xc.cart_footer,children:(0,Dr.jsx)("div",{className:xc.cart_footer_loader,children:(0,Dr.jsx)("span",{className:"loader dark"})})}),s&&s.length>0&&s.filter((e=>e.supportsolopay)).length>0&&(0,Dr.jsxs)("div",{className:xc.cart_footer,children:[!u&&(0,Dr.jsxs)("button",{className:"btn",onClick:async()=>{d(!0);let e={};if(f?e={billing_method:"creditcardtoken",user_type:"user",authtoken:m,first_name:f.first_name,last_name:f.last_name,email_address:f.email,contact_number:f.phone.replace(/\D/g,""),card_token:v.paymentMethod.id,card_type:v.paymentMethod.card.brand,card_number:v.paymentMethod.card.last4,expiry_year:v.paymentMethod.card.exp_year,expiry_month:v.paymentMethod.card.exp_month,zip:v.zipCode}:h?e={billing_method:"creditcardtoken",user_type:"guest",first_name:h.firstName,last_name:h.lastName,email_address:h.email,contact_number:h.phone.replace(/\D/g,""),card_token:v.paymentMethod.id,card_type:v.paymentMethod.card.brand,card_number:v.paymentMethod.card.last4,expiry_year:v.paymentMethod.card.exp_year,expiry_month:v.paymentMethod.card.exp_month,zip:v.zipCode}:a(qi.setError({message:"Please check contact information"})),"dispatch"===p.deliverymode){const t={phone_number:f?f.phone.replace(/\D/g,""):h.phone.replace(/\D/g,""),delivery_mode:"delivery",time:p.timemode,street_address:p.deliveryaddress.streetaddress,zip_code:p.deliveryaddress.zipcode,special_instructions:p.deliveryaddress.specialinstructions,city:p.deliveryaddress.city,building:p.deliveryaddress.building},r=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/cart/${e}/set-delivery-address`,"PUT",t))(p.id,t);if(r.id){const t=await wr(r.id,e);!1===t.success?(a(vs.setBilling(null)),a(qi.setError(t))):(_&&ga("rwg_token"),Ar("currentCart"),a(vs.addCart(null)),a(vs.setCartSidebarState()),a(vs.setBilling(null)),a(_m.clearVirtualCart()),ua(t,g),i(`/order/${t.id}`))}else a(qi.setError(r))}else{const t=await wr(p.id,e);!1===t.success?(a(vs.setBilling(null)),a(qi.setError(t))):(_&&ga("rwg_token"),Ar("currentCart"),a(vs.addCart(null)),a(vs.setCartSidebarState()),a(_m.clearVirtualCart()),a(vs.setBilling(null)),ua(t,g),i(`/order/${t.id}`))}d(!1)},disabled:!v,children:["Place order | $",n.toFixed(2)]}),u&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})};var bf=()=>{const[t,r]=(0,e.useState)(!1),n=E(),i=y((e=>e.cart.cartSidebarStep));return(0,Dr.jsx)("div",{className:`${xc.cart_timeline_item} ${"order"===i&&xc.active} ${("info"===i||"checkout"===i)&&xc.complete}`,children:(0,Dr.jsxs)("button",{onClick:(async e=>{r(!0),n(vs.setCartSidebarStep(e)),r(!1)}).bind(void 0,"order"),disabled:"order"===i,children:[(0,Dr.jsxs)("span",{className:xc.number,children:[(0,Dr.jsxs)("span",{children:[!t&&1,t&&(0,Dr.jsx)("div",{className:"loader dark-raspberry"})]}),(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z",fill:"#fff"})})]}),"Your Order"]})})};var wf=()=>{const[t,r]=(0,e.useState)(!1),n=E(),i=y((e=>e.cart.cart)),a=y((e=>e.cart.cartSidebarStep));let s=y((e=>e.location.location));return(0,Dr.jsx)("div",{className:`${xc.cart_timeline_item} ${"info"===a&&xc.active} ${"checkout"===a&&xc.complete}`,children:(0,Dr.jsxs)("button",{onClick:(async e=>{if(s){if(r(!0),"advance"!==i.timemode||i.timewanted)if("asap"!==i.timemode||s.status.open){const e=await yr(i.id);e.id?n(vs.setCartSidebarStep("info")):n(qi.setError(e)),r(!1)}else{var t;const e={delivery_mode:i.deliverymode,time:"asap",schedule_date:null,schedule_time:null};null!==i&&void 0!==i&&null!==(t=i.status)&&void 0!==t&&t.open||(e.time="schedule",e.schedule_date=Ki(i.earliestreadytime),e.schedule_time=Yi(i.earliestreadytime));const a=await _r(i.id,e);if(a.id){Mr("currentCart",a),n(vs.addCart(a));const e=await yr(a.id);e.id?n(vs.setCartSidebarStep("info")):n(qi.setError(e)),r(!1)}else n(qi.setError(a))}else{var a;const e={delivery_mode:i.deliverymode,time:"asap",schedule_date:null,schedule_time:null};null!==s&&void 0!==s&&null!==(a=s.status)&&void 0!==a&&a.open||(e.time="schedule",e.schedule_date=Ki(i.earliestreadytime),e.schedule_time=Yi(i.earliestreadytime));const t=await _r(i.id,e);if(t.id){Mr("currentCart",t),n(vs.addCart(t));const e=await yr(t.id);e.id?n(vs.setCartSidebarStep("info")):n(qi.setError(e)),r(!1)}else n(qi.setError(t))}let e=[];
2i.products.forEach((t=>{e.push({item_id:t.productId,item_name:t.name,price:t.totalcost,quantity:t.quantity})})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"begin_checkout",ecommerce:{currency:"USD",value:i.total,items:e}})}else n(qi.setError({message:"Please set a location in order to continue"}))}).bind(void 0,"info"),disabled:"info"===a,children:[(0,Dr.jsxs)("span",{className:xc.number,children:[(0,Dr.jsxs)("span",{children:[!t&&2,t&&(0,Dr.jsx)("div",{className:"loader dark-raspberry"})]}),!t&&(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z",fill:"#fff"})}),t&&(0,Dr.jsx)("div",{className:xc.svg_loader,children:(0,Dr.jsx)("div",{className:"loader small"})})]}),"Your Info"]})})};var Cf=()=>{const[t,r]=(0,e.useState)(!1),n=E(),i=y((e=>e.cart.cartSidebarStep)),a=y((e=>e.auth.user)),s=Ir("guestUser");return(0,Dr.jsx)("div",{className:`${xc.cart_timeline_item} ${"checkout"===i&&xc.active}`,children:(0,Dr.jsxs)("button",{onClick:(async e=>{r(!0),(a||s)&&n(vs.setCartSidebarStep(e)),r(!1)}).bind(void 0,"checkout"),children:[(0,Dr.jsxs)("span",{className:xc.number,children:[(0,Dr.jsxs)("span",{children:[!t&&3,t&&(0,Dr.jsx)("div",{className:"loader dark-raspberry"})]}),(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z",fill:"#fff"})})]}),"Checkout"]})})},Sf="EmptyCart_no_items_container__oZec5",kf="EmptyCart_no_items_container_inner__c0UKt",jf="EmptyCart_title__fy2Sb",Ef="EmptyCart_description__I3T1X",Tf="EmptyCart_no_items_container_footer__nzbmu";var Pf=r.p+"static/media/bird.572bc46f58743b9e13d36350f8a024e6.svg";var If=r.p+"static/media/meltedicecream.86f2a9114f419d2539d22c41663ac873.svg";var Mf=()=>{const t=E(),r=xt(),[n,i]=(0,e.useState)(!1);let a=y((e=>e.location.location));const s=Ir("currentLocation");return(0,e.useEffect)((()=>{s&&s.currentLocation&&s.currentLocation.data&&s.currentLocation.data.attributes&&s.currentLocation.data.attributes.includes("MSC")?i(!0):i(!1)}),[s]),(0,Dr.jsx)("div",{className:Sf,children:(0,Dr.jsxs)("div",{className:kf,children:[!n&&(0,Dr.jsx)("img",{src:Pf,alt:"bird eating crumbs"}),n&&(0,Dr.jsx)("img",{src:If,alt:"melted icecream"}),(0,Dr.jsx)("h3",{className:jf,children:"Your bag is empty!"}),(0,Dr.jsx)("p",{className:Ef,children:"It\u2019s lonely in here."}),(0,Dr.jsxs)("div",{className:Tf,children:[a&&(0,Dr.jsx)("button",{to:"cookie-cakes",className:"btn-fancy",onClick:()=>{t(vs.setCartSidebarState()),r(`${a.slug}/menu/cookie-cakes`,{state:{toHolidays:"Holidays"}})},children:"Order Now"}),!a&&(0,Dr.jsx)("button",{to:"cookie-cakes",className:"btn-fancy",onClick:()=>{t(vs.setCartSidebarStep("order")),t(vs.setCartSidebarState()),t(Vi.setLocationsSideBarState())},children:"Order Now"})]})]})})};var Nf=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M6 0C2.69357 0 0 2.69357 0 6C0 9.30643 2.69357 12 6 12C9.30643 12 12 9.314 12 6C12 2.686 9.314 0 6 0ZM6 10.8651C3.32156 10.8651 1.13493 8.686 1.13493 6C1.13493 3.314 3.32156 1.13493 6 1.13493C8.67844 1.13493 10.8651 3.32156 10.8651 6C10.8651 8.67844 8.686 10.8651 6 10.8651ZM9.97982 6C9.97982 6.31778 9.73014 6.56747 9.41236 6.56747H6C5.68979 6.56747 5.43253 6.31778 5.43253 6V3.34426C5.43253 3.03405 5.68979 2.7768 6 2.7768C6.31021 2.7768 6.56747 3.03405 6.56747 3.34426V5.43253H9.41236C9.73014 5.43253 9.97982 5.68979 9.97982 6Z",fill:"var(--color-dark-raspberry)"})})};var Af=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsxs)("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsxs)("g",{clipPath:"url(#clip0_4988_9951)",children:[(0,Dr.jsx)("path",{d:"M3.52456 12.1135L5.29956 13.874L15.8626 3.22401L14.0876 1.4635L3.52456 12.1135Z",stroke:"var(--color-dark-raspberry-secondary)",strokeWidth:"2",strokeLinejoin:"round"}),(0,Dr.jsx)("path",{d:"M1.77131 15.6564L5.29957 13.8741L3.52456 12.1136L1.77131 15.6564Z",stroke:"var(--color-dark-raspberry-secondary)",strokeWidth:"2",strokeLinejoin:"round"}),(0,Dr.jsx)("path",{d:"M14.1021 4.99902L12.327 3.23852",stroke:"var(--color-dark-raspberry-secondary)",strokeWidth:"2",strokeLinejoin:"round"})]}),(0,Dr.jsx)("defs",{children:(0,Dr.jsx)("clipPath",{id:"clip0_4988_9951",children:(0,Dr.jsx)("rect",{width:"3.75",height:"20",fill:"white",transform:"translate(2.66248 17.4204) rotate(-135.235)"})})})]})};var Lf=()=>(0,Dr.jsx)("svg",{width:"13",height:"16",viewBox:"0 0 13 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M12.3874 6.19797C12.3874 2.78224 9.60514 0 6.18941 0C2.77368 0 0 2.78224 0 6.19797C0 9.39968 2.44837 12.0449 5.56447 12.3531C5.55591 12.3788 5.55591 12.4045 5.55591 12.4302V15.3579C5.55591 15.7175 5.83842 16 6.18941 16C6.5404 16 6.84002 15.7175 6.84002 15.3579V12.4302C6.84002 12.4302 6.84002 12.3788 6.83146 12.3531C9.94757 12.0364 12.3874 9.39968 12.3874 6.19797ZM6.18941 11.1033C3.48422 11.1033 1.28411 8.91172 1.28411 6.19797C1.28411 3.48422 3.48422 1.28411 6.18941 1.28411C8.8946 1.28411 11.1033 3.48422 11.1033 6.19797C11.1033 8.91172 8.90316 11.1033 6.18941 11.1033ZM9.39112 5.37614C9.25415 4.97378 8.91172 4.68272 8.49224 4.62279L7.59337 4.48582L7.18245 3.67255C6.99411 3.28732 6.61744 3.05618 6.18941 3.05618C5.76137 3.05618 5.3847 3.28732 5.19636 3.67255L4.79401 4.48582L3.89513 4.62279C3.47566 4.68272 3.13323 4.97378 2.99625 5.37614C2.86784 5.77849 2.97913 6.21509 3.27876 6.50615L3.92937 7.14821L3.77528 8.04708C3.70679 8.46656 3.87801 8.87747 4.22044 9.1343C4.40877 9.27127 4.63991 9.33975 4.87105 9.33975C5.04227 9.33975 5.22204 9.29695 5.3847 9.21134L6.18941 8.79187L7.00268 9.21134C7.37935 9.4168 7.8245 9.38256 8.16693 9.1343C8.50936 8.87747 8.68058 8.46656 8.61209 8.04708L8.44944 7.14821L9.10861 6.50615C9.40824 6.21509 9.51953 5.77849 9.39112 5.37614ZM7.49064 6.29213C7.23381 6.5404 7.11396 6.90851 7.17389 7.26806L7.28518 7.91011L6.71161 7.61049C6.54896 7.52488 6.36918 7.48208 6.18941 7.48208C6.00963 7.48208 5.83842 7.52488 5.67576 7.61049L5.10219 7.91011L5.21348 7.26806C5.27341 6.90851 5.15356 6.54896 4.89674 6.29213L4.43446 5.83842L5.07651 5.74425C5.43606 5.69288 5.74425 5.4703 5.9069 5.145L6.18941 4.56287L6.48047 5.145C6.64312 5.4703 6.95131 5.69288 7.31086 5.74425L7.95292 5.83842L7.49064 6.29213Z",fill:"var(--color-dark-raspberry)"})}),Df={cart_header_item:"CartHeader_cart_header_item__fb0wx",label:"CartHeader_label__+3Ni9",value:"CartHeader_value__S+Mmz",modal_controls:"CartHeader_modal_controls__L8gE3",btn:"CartHeader_btn__jx6Ax",modal_footer:"CartHeader_modal_footer__lL8Hn",mobile_flex_wrap:"CartHeader_mobile_flex_wrap__KHuSy",sidebar_header_message:"CartHeader_sidebar_header_message__sdp+w",sidebar_header_message_type:"CartHeader_sidebar_header_message_type__4Vzyy",sidebar_header_message_store_name:"CartHeader_sidebar_header_message_store_name__zVvHS"};var zf=t=>{let{cart:r,location:n}=t;const i=E(),[a,s]=(0,e.useState)(),[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(!1),[d,h]=(0,e.useState)();(0,e.useEffect)((()=>
2{if(r){let e="",t="",n="";n="advance"===r.timemode&&r.timewanted?r.timewanted.split(" "):r.earliestreadytime.split(" "),n.forEach(((r,n)=>{if(0===n){const t=r.slice(0,4)+"-"+r.slice(4,6)+"-"+r.slice(6);e=t}1===n&&(t=r)})),h(e+"T"+t)}}),[r]);const p=()=>{s((e=>!e))},m=async(e,t)=>{const r=await yr(e);r.id?(Mr("currentCart",r),i(vs.addCart(r)),i(Vi.setOrderType(t.time)),i(Vi.setOrderDate(t.schedule_date)),i(Vi.setOrderTime(t.schedule_time)),s(!1)):i(qi.setError(r)),l(!1)};return(0,Dr.jsxs)("div",{className:Df.cart_header,children:[r&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:Df.cart_header_item,children:[(0,Dr.jsxs)("div",{className:Df.label,children:[(0,Dr.jsx)(Lf,{}),"pickup"===r.deliverymode&&(0,Dr.jsx)(Dr.Fragment,{children:"Pickup From"}),"curbside"===r.deliverymode&&(0,Dr.jsx)(Dr.Fragment,{children:"Curbside From"}),"dispatch"===r.deliverymode&&(0,Dr.jsx)(Dr.Fragment,{children:"Delivery To"})]}),(0,Dr.jsxs)("div",{className:Df.value,children:[r&&"dispatch"!==r.deliverymode&&(0,Dr.jsx)(Dr.Fragment,{children:n.address&&n.address.street}),r&&"dispatch"===r.deliverymode&&(0,Dr.jsxs)(Dr.Fragment,{children:[r.deliveryaddress.streetaddress,", ",r.deliveryaddress.city,", ",r.deliveryaddress.zipcode]}),!r&&(0,Dr.jsx)(Dr.Fragment,{children:n.address&&n.address.street}),(0,Dr.jsxs)("button",{onClick:()=>{i(vs.setCartSidebarState()),i(Vi.setLocationsSideBarState())},children:[(0,Dr.jsx)(Af,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"edit location"})]})]})]}),(0,Dr.jsxs)("div",{className:Df.cart_header_item,children:[(0,Dr.jsxs)("div",{className:Df.label,children:[(0,Dr.jsx)(Nf,{}),"dispatch"===r.deliverymode?"Delivery time":"Pickup time"]}),(0,Dr.jsxs)("div",{className:Df.value,children:[new Date(d).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),(0,Dr.jsxs)("button",{onClick:p,children:[(0,Dr.jsx)(Af,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"edit time"})]})]})]})]}),!r&&(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("div",{className:Df.sidebar_header_message,children:[n&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(js,{}),(0,Dr.jsx)("span",{className:Df.sidebar_header_message_type,children:"Pickup"}),(0,Dr.jsxs)("span",{className:Df.sidebar_header_message_store_name,children:[n.address.street,", ",n.address.zip,", ",n.address.city]})]}),!n&&(0,Dr.jsx)(Dr.Fragment,{children:"Pick a location to start your order!"})]})}),a&&(0,Dr.jsxs)(Tp,{closeInfoHandler:p,transition:a,children:[(0,Dr.jsx)("h3",{children:"Select Date and Time"}),(0,Dr.jsxs)("div",{className:Df.modal_controls,children:[!o&&(0,Dr.jsx)("button",{className:"btn btn-border-input",onClick:async()=>{l(!0);const e={delivery_mode:"dispatch"===r.deliverymode?"delivery":r.deliverymode,time:"asap",schedule_date:null,schedule_time:null};"dispatch"===r.deliverymode&&(e.zip_code=r.deliveryaddress.zipcode,e.street_address=r.deliveryaddress.streetaddress,e.city=r.deliveryaddress.city,e.phone_number=r.deliveryaddress.phonenumber,e.special_instructions=r.deliveryaddress.specialinstructions,e.building=r.deliveryaddress.building);const t=await _r(r.id,e);if(t.id)if("curbisde"===r.deliverymode){const a={vehicle_make:r.customfields[0].value,vehicle_model:r.customfields[1].value,vehicle_color:r.customfields[2].value},s=await xr(t.id,n.id,a);s.id?m(s.id,e):(i(qi.setError(s)),l(!1))}else m(t.id,e);else i(qi.setError(t)),l(!1)},children:"Asap"}),o&&(0,Dr.jsx)("div",{className:"btn btn-border-input",children:(0,Dr.jsx)("span",{className:"loader dark"})}),(0,Dr.jsx)("button",{className:`btn btn-border-input ${c&&"btn-active"}`,onClick:()=>{u(!0)},children:"Schedule"})]}),c&&(0,Dr.jsx)(Jm,{closeModal:p})]})]})};var Of=()=>{const e=y((e=>e.cart.cart)),t=null!==e?e.products:null,r=null!==e?null===t||void 0===t?void 0:t.length:0,n=null!==e?null===e||void 0===e?void 0:e.total:0,i=y((e=>e.cart.cartSidebarStep)),a=y((e=>e.location.location));return e&&console.log("CART::::: ",e),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:xc.sidebar_header,children:(0,Dr.jsx)(zf,{cart:e,location:a})}),(0,Dr.jsx)("div",{className:xc.sidebar_content,children:(0,Dr.jsxs)("div",{className:`${xc.sidebar_content_inner} ${null===e||0===e.products.length?xc.sidebar_content_inner_empty:""}`,children:[r>0&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:xc.cart_timeline,children:[(0,Dr.jsx)(bf,{}),(0,Dr.jsx)(wf,{}),(0,Dr.jsx)(Cf,{})]}),"order"===i&&(0,Dr.jsx)("div",{className:xc.cart_items,children:(0,Dr.jsx)(hp,{items:t,cartId:e.id,totalPrice:n})}),"info"===i&&(0,Dr.jsx)("div",{className:xc.cart_items,children:(0,Dr.jsx)(Lp,{})}),"checkout"===i&&(0,Dr.jsx)(xf,{cartId:e.id,totalPrice:n})]}),(null===e||0===e.products.length)&&(0,Dr.jsx)(Mf,{})]})})]})};var Rf=()=>{const e=E(),t=y((e=>e.cart.cartSidebarOpen)),r=y((e=>e.cart.cart)),n=()=>{r&&e(vs.setCartSidebarStep("order")),e(vs.setCartSidebarState())};return(0,Dr.jsxs)(Dr.Fragment,{children:[t&&(0,Dr.jsx)(Dr.Fragment,{children:s.createPortal((0,Dr.jsx)(gc,{hide:n}),document.getElementById("backdrop-root"))}),s.createPortal((0,Dr.jsx)(vc,{click:n,activeState:t,children:(0,Dr.jsx)(Of,{})}),document.getElementById("overlay-root"))]})};var Ff=t=>{let{closeSidebar:r}=t;const n=E(),i=xt(),[a,s]=(0,e.useState)(!0),[o,l]=(0,e.useState)(!1);return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:mp,children:[(0,Dr.jsx)("button",{className:"btn "+(a?"":"btn-border"),onClick:()=>{s(!0),l(!1)},children:"Sign In"}),(0,Dr.jsx)("button",{className:"btn "+(o?"":"btn-border"),onClick:()=>{s(!1),l(!0)},children:"Join Rewards"})]}),(0,Dr.jsx)("div",{className:fp,children:(0,Dr.jsxs)("div",{className:gp,children:[(0,Dr.jsxs)("div",{className:bp,children:[(0,Dr.jsx)("p",{children:"We've combined Great American Cookies and Marble Slab Creamery Rewards! If you have an existing Great American Cookies Rewards account, please log in below."}),(0,Dr.jsxs)("p",{children:["If you have an existing Marble Slab Creamery Rewards account, ",(0,Dr.jsx)("button",{onClick:()=>{n(Ha.setUserSideBarState()),i("/rewards-migration")},children:"please visit the migration page"})," to complete the account migration process."]})]}),a&&(0,Dr.jsx)(Ip,{closeSidebar:r,noTitle:!0}),o&&(0,Dr.jsx)(Mp,{noTitle:!0})]})})]})};var Bf=()=>{const e=E(),t=y((e=>e.auth.isUserSidebarOpened)),r=()=>{e(Ha.setUserSideBarState())};return(0,Dr.jsxs)(Dr.Fragment,{children:[t&&(0,Dr.jsx)(Dr.Fragment,{children:s.createPortal((0,Dr.jsx)(gc,{hide:r}),document.getElementById("backdrop-root"))}),s.createPortal((0,Dr.jsx)(vc,{click:r,activeState:t,children:(0,Dr.jsx)(Ff,{closeSidebar:r})}),document.getElementById("overlay-root"))]})},Vf="DateTime_scheduled_inputs__MzVxj",$f="DateTime_radio_input_container__oBn3O",Uf="DateTime_radio_input_item__xZOHv",Hf="DateTime_radio_input_item_small__+UFIE",qf="DateTime_relative__c8EOm",Zf="DateTime_open_drawer__RdRMF";var Gf=e=>{let{handleDateChange:t}=e,r=[];for(let n=0;n<7;n++){let e=new Date;e.setDate(e.getDate()+n),r.push({value:Wi(e),label:new Date(e).toLocaleStr
2ing("en-US",{month:"short",day:"2-digit",year:"numeric"})})}return(0,Dr.jsxs)("select",{className:"select",onChange:t,defaultValue:"Date",children:[(0,Dr.jsx)("option",{disabled:!0,value:"Date",hidden:!0,children:"Date"}),r.map((e=>(0,Dr.jsx)("option",{value:e.value,children:e.label},e.value)))]})};var Wf=t=>{let{handleTimeChange:r}=t;const[n,i]=(0,e.useState)(null);return(0,e.useEffect)((()=>{i(((e,t,r)=>{const n=[],i=new Date,a=new Date(i);a.setHours(e.split(":")[0],e.split(":")[1],0,0);const s=new Date(i);s.setHours(t.split(":")[0],t.split(":")[1],0,0);const o=i.getHours(),l=i.getMinutes();if(l<45?l<30?l<15?a.setMinutes(15):a.setMinutes(30):a.setMinutes(45):(a.setMinutes(0),a.setHours(o+1)),r){const e=i.getHours(),t=i.getMinutes();a.setMinutes(t<45?t+15:0),a.setHours(e+1)}for(;a<=s;){const e=a.toLocaleTimeString("en-US",{hour12:!0,minute:"2-digit",hour:"2-digit"}),t=a.toLocaleTimeString("en-US",{hour12:!1,minute:"2-digit",hour:"2-digit"});n.push({value:t,label:e}),a.setMinutes(a.getMinutes()+15)}return n})("06:00","23:59",!1))}),[]),(0,Dr.jsxs)("select",{className:"select",onChange:r,defaultValue:"Time",children:[(0,Dr.jsx)("option",{disabled:!0,value:"Time",hidden:!0,children:"Time"}),n&&n.map((e=>(0,Dr.jsx)("option",{value:e.value,children:e.label},e.label)))]})};var Xf=t=>{let{hidelabel:r,smallButtons:n}=t;const[i,a]=(0,e.useState)(!1),s=E(),o=e=>{"schedule"===e.target.value?a(!0):a(!1),s(Vi.setOrderType(e.target.value))};let l=y((e=>e.location.order));let c=new Date;return c.setDate(c.getDate()+7),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsxs)("fieldset",{children:[(0,Dr.jsx)("legend",{className:"label",children:"Order Time"}),(0,Dr.jsxs)("div",{className:$f,children:[(0,Dr.jsxs)("div",{className:`${Uf} ${n?Hf:""}`,children:[(0,Dr.jsx)("input",{type:"radio",id:"orderTime_asap",name:"orderTime",value:"asap",defaultChecked:!0,onChange:o}),(0,Dr.jsx)("label",{htmlFor:"orderTime_asap",children:"Asap"})]}),(0,Dr.jsxs)("div",{className:`${Uf} ${n?Hf:""}`,children:[(0,Dr.jsx)("input",{type:"radio",id:"orderTime_scheduled",name:"orderTime",value:"schedule",onChange:o}),(0,Dr.jsx)("label",{htmlFor:"orderTime_scheduled",children:"Scheduled"})]})]})]})}),i&&(0,Dr.jsx)("div",{className:Vf,children:(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{htmlFor:"dateSchedule",className:"label",children:"Select a date"}),(0,Dr.jsxs)("div",{className:qf,children:[(0,Dr.jsx)(Gf,{handleDateChange:e=>{e.target.setAttribute("data-date",new Date(e.target.value).toLocaleString("en-US",{day:"2-digit",month:"2-digit"})),s(Vi.setOrderDate(e.target.value))}}),(0,Dr.jsx)("span",{className:Zf,children:(0,Dr.jsx)(Vs,{})})]})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{htmlFor:"timeSchedule",className:"label",children:"Select a time"}),(0,Dr.jsxs)("div",{className:qf,children:[(0,Dr.jsx)(Wf,{handleTimeChange:e=>{s(Vi.setOrderTime(e.target.value)),e.target.setAttribute("data-time",new Date(l.date+"T"+e.target.value).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}))}}),(0,Dr.jsx)("span",{className:Zf,children:(0,Dr.jsx)(Vs,{})})]})]})]})})]})};var Jf=()=>(0,Dr.jsx)("svg",{width:"98",height:"60",viewBox:"0 0 98 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M97.979 48.0454C97.979 49.5735 96.7206 50.8319 95.1925 50.8319H89.979C88.7206 56.0904 83.9565 60.0005 78.2936 60.0005C72.6307 60.0005 67.8666 56.0904 66.6082 50.8319C66.6082 50.7421 66.5633 50.6971 66.5633 50.6072C66.2037 50.7421 65.8442 50.8319 65.4397 50.8319H49.934C48.6756 56.0904 43.9565 60.0005 38.2487 60.0005C32.5408 60.0005 27.8666 56.0904 26.6082 50.8319H21.0801C19.552 50.8319 18.2936 49.5735 18.2936 48.0454V34.4274C18.2936 32.8544 19.552 31.596 21.0801 31.596C22.6082 31.596 23.9116 32.8544 23.9116 34.4274V45.214H26.6082C27.9116 39.9555 32.6307 36.0454 38.2487 36.0454C43.8666 36.0454 48.6307 39.9555 49.934 45.214H62.6531V6.47239H36.0015C34.4284 6.47239 33.17 5.21397 33.17 3.64093C33.17 2.0679 34.4284 0.854415 36.0015 0.854415H65.4397C67.0127 0.854415 68.2711 2.11284 68.2711 3.64093V8.31509H81.0352C88.1363 8.31509 93.934 14.1128 93.934 21.2589V45.214H95.1925C96.7206 45.214 97.979 46.4724 97.979 48.0454ZM44.6307 48.0454C44.6307 44.4949 41.7992 41.6634 38.2487 41.6634C34.6981 41.6634 31.9116 44.4949 31.9116 48.0454C31.9116 51.596 34.743 54.3825 38.2487 54.3825C41.7543 54.3825 44.6307 51.551 44.6307 48.0454ZM84.6756 48.0454C84.6756 44.4949 81.7992 41.6634 78.2936 41.6634C74.788 41.6634 71.9116 44.4949 71.9116 48.0454C71.9116 51.596 74.788 54.3825 78.2936 54.3825C81.7992 54.3825 84.6756 51.551 84.6756 48.0454ZM88.3161 33.1241H76.1812C74.6981 33.1241 73.4846 31.9555 73.3947 30.5173L72.6307 20.0454C72.5857 19.2364 72.8554 18.4724 73.3498 17.9331C73.8891 17.3488 74.6531 17.0342 75.4172 17.0342H86.9678C85.6644 15.1465 83.4621 13.9331 81.0352 13.9331H68.2711V41.4387C70.4284 38.2027 74.1138 36.0454 78.2936 36.0454C82.4734 36.0454 86.1588 38.2027 88.3161 41.4387V33.1241ZM88.3161 22.6522H78.4284L78.788 27.5061H88.3161V22.6522ZM66.5633 50.6072C66.2037 50.7421 65.8442 50.8319
265.4397 50.8319H66.6082C66.6082 50.8319 66.5633 50.6971 66.5633 50.6072ZM19.0127 14.2926L27.4621 5.79823C28.1363 5.12408 28.4509 4.27015 28.4509 3.41621C28.4509 2.56228 28.1363 1.70835 27.4621 1.03419C26.1588 -0.314124 24.0015 -0.314124 22.6981 1.03419L14.2487 9.52857L5.75427 0.989247C4.4509 -0.314124 2.29359 -0.314124 0.990223 0.989247C-0.313147 2.29262 -0.313147 4.49486 0.990223 5.75329L9.4846 14.2477L0.990223 22.7421C-0.313147 24.0454 -0.313147 26.1578 0.990223 27.5061C1.66438 28.1353 2.51831 28.4949 3.37225 28.4949C4.22618 28.4949 5.12505 28.1353 5.75427 27.5061L14.2487 19.0567L22.6981 27.5061C22.6981 27.5061 23.0576 27.8207 23.2374 27.9106C23.8217 28.3151 24.4509 28.4949 25.0801 28.4949C25.934 28.4949 26.788 28.1353 27.4621 27.5061C28.7655 26.1578 28.7655 24.0454 27.4621 22.7421L19.0127 14.2926Z",fill:"#584646"})}),Kf={form_input_container:"DeliveryPannel_form_input_container__RTVSu",delivery_description_text:"DeliveryPannel_delivery_description_text__88jv7",no_delivery_text:"DeliveryPannel_no_delivery_text__mQ8bV",text_info:"DeliveryPannel_text_info__a5P34",text_info_header:"DeliveryPannel_text_info_header__R2twG",cta_container:"DeliveryPannel_cta_container__pw-Zk",text_info_item:"DeliveryPannel_text_info_item__LfBoe",text_info_item_header:"DeliveryPannel_text_info_item_header__NmvOJ",form_fields_container:"DeliveryPannel_form_fields_container__VCs6K",delivery_success_confirmation:"DeliveryPannel_delivery_success_confirmation__qCMiQ"};var Yf=t=>{let{orderType:r,searchedLocations:n,foundLocation:i,deliveryType:a,time:s}=t;const o=xt(),l=E(),[c,u]=(0,e.useState)(!1),d=(0,e.useRef)(null),h=(0,e.useRef)(null);return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)("form",{onSubmit:async e=>{e.preventDefault(),u(!0);const t=i,r=await ur({restaurant_id:t.id});if(r.id){const e={delivery_mode:"delivery",time:s.type,schedule_date:s.date,schedule_time:s.time,street_address:n.street_number+" "+n.street,city:n.city,zip_code:n.postal_code};if(d.current.value&&(e.building=d.current.value),h.current.value){if(aa(h.current.value))return window.alert("Please remove emojis from special instructions. Use letters and numbers only."),void u(!1);e.special_instructions=h.current.value}const t=await _r(r.id,e);t.message?l(qi.setError(t)):(async e=>{const t=await or(i.id);Ar("currentCart"),l(vs.addCart(null)),l(_m.clearVirtualCart()),l(Vi.setLocationItem(i)),l(Vi.setMenuItem(t)),l(Vi.setLocationsSideBarState()),l(Vi.setVirtualDeliveryType(a)),Pr("currentLocationId",{currentLocationId:i.id,currentLocationSlug:i.location_slug},null),Pr("currentLocation",{currentLocation:i,deliveryType:a,time:s},3600),Pr("currentMenu",{menu:t},3600),l(vs.addCart(e)),Mr("currentCart",e),o(`/${t.slug}/menu`)})(t)}else l(qi.setError(r));u(!1)},children:(0,Dr.jsxs)("div",{className:`${Kf.text_info} ${Kf.text_info_header} ${Kf.delivery_success_confirmation}`,children:[(0,Dr.jsx)(Es,{}),"scheduled"===r.type&&(0,Dr.jsxs)("div",{className:Kf.text_info_item,children:[(0,Dr.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsx)("path",{d:"M24.9471 11.088C24.0219 1.83751 13.1071 -3.09563 5.56278 2.12578C5.33076 2.0268 5.05494 2.04356 4.81153 2.26571C3.63339 3.30483 2.57296 4.49441 1.76384 5.84888C-3.2418 13.5575 3.08976 24.6648 12.181 24.6343C13.4098 24.7639 19.5978 23.8625 19.1649 22.2934C19.0147 22.0261 18.675 21.9323 18.4088 22.0844C15.9049 23.5159 12.8949 24.1143 10.0669 23.4502C2.85627 21.9487 -1.32957 12.7785 2.93038 6.57077C3.69895 5.36732 4.69787 4.31504 5.81389 3.40725C6.01189 3.24063 6.08576 3.03635 6.07508 2.83795C6.45837 2.588 6.85665 2.35324 7.25899 2.1562C8.82402 1.35432 10.5837 0.927033 12.3424 0.92597C17.7622 0.895138 22.3505 5.02989 23.2996 10.295C23.8786 13.2221 23.1958 16.1786 21.8584 18.8286C21.5908 19.2736 22.2862 19.7295 22.5826 19.2862C24.3174 16.9542 25.2374 13.9991 24.9471 11.088Z",fill:"#8D0E57"}),(0,Dr.jsx)("path",{d:"M17.899 11.8316C17.2874 11.8511 16.674 11.8611 16.0588 11.8741C15.7192 11.9337 14.3679 11.8945 13.0456 11.9055C13.1086 11.0714 13.195 10.2421 13.2455 9.5511C13.3769 7.88066 13.4707 6.19048 13.421 4.50946C13.4028 3.44913 11.7294 3.61236 11.9
2089 4.65178C12.0735 5.63019 12.1479 6.66207 12.1796 7.66332C12.2079 9.07814 12.1825 10.5049 12.1119 11.9243C10.9953 11.9635 10.1021 12.0715 10.1777 12.355C10.078 12.8707 11.4374 12.8028 12.0598 12.8361C12.0519 12.9599 12.0446 13.0838 12.036 13.2074C12.0102 13.6713 11.9248 14.1297 11.8911 14.592C11.9455 15.3152 13.0771 15.2083 13.0013 14.4917C12.9602 14.0229 12.9609 13.4875 12.984 12.9288C14.5835 13.0664 16.3055 13.2432 17.8684 13.3501C18.9045 13.4338 18.9344 11.7898 17.899 11.8316Z",fill:"#8D0E57"})]}),(0,Dr.jsxs)("div",{className:Kf.text_info_item_text,children:[(0,Dr.jsx)("div",{className:Kf.text_info_item_header,children:"Delivery Time"}),(0,Dr.jsx)("span",{children:new Date(r.date+"T"+r.time).toLocaleString("en-US")})]})]}),"asap"===r.type&&(0,Dr.jsxs)("div",{className:Kf.text_info_item,children:[(0,Dr.jsx)(Ks,{}),(0,Dr.jsxs)("div",{className:Kf.text_info_item_text,children:[(0,Dr.jsx)("div",{className:Kf.text_info_item_header,children:"Delivery Time"}),(0,Dr.jsx)("span",{children:"ASAP"})]})]}),(0,Dr.jsxs)("div",{className:Kf.text_info_item,children:[(0,Dr.jsx)(Ps,{}),(0,Dr.jsxs)("div",{className:Kf.text_info_item_text,children:[(0,Dr.jsx)("div",{className:Kf.text_info_item_header,children:"Delivery Address"}),(0,Dr.jsx)("span",{children:n.full_address})]})]}),(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("h4",{children:"Sweeeeet!"}),(0,Dr.jsx)("p",{children:"We deliver treats straight to your door!"})]}),(0,Dr.jsxs)("div",{className:`form-fields-container ${Kf.form_fields_container}`,children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{htmlFor:"locationDetails",className:"label",children:"Apt/Suite/Flr (Optional)"}),(0,Dr.jsx)("input",{ref:d,type:"text",id:"locationDetails",name:"locationDetails",placeholder:"Apt/Suite/Flr (Optional)"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"locationInstructions",children:"Special Instructions (Optional)"}),(0,Dr.jsx)("textarea",{ref:h,type:"text",id:"locationInstructions",name:"locationInstructions",placeholder:"Special Instructions (Optional)"})]})]}),(0,Dr.jsxs)("div",{className:Kf.cta_container,children:[!c&&(0,Dr.jsx)("button",{className:"btn btn-100",type:"submit",children:"Start Delivery Order"}),c&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})})})};var Qf=t=>{let{switchToPickup:r}=t;const n=E(),[i,a]=(0,e.useState)(!1),[s,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)(null),[h,p]=(0,e.useState)(null),[m,f]=(0,e.useState)(""),[g,_]=(0,e.useState)({hasErrors:!1,errorMessage:null});let v=y((e=>e.location.order)),x=y((e=>e.location.order));(0,e.useEffect)((()=>{"schedule"===v.type?null!==v.date&&null!==v.time?a(!1):a(!0):a(!1)}),[v]);return(0,Dr.jsxs)(Dr.Fragment,{children:[!u&&(0,Dr.jsxs)("div",{className:"form-fields-container",children:[(0,Dr.jsx)(Xf,{}),(0,Dr.jsxs)("div",{className:`form-controller ${i&&"invalid"}`,children:[(0,Dr.jsx)(Bl,{label:"Enter your address",selectedResult:async e=>{if(e){c(!0);const t=await ar({lat:e.latitude,lng:e.longitude},"pickup");t.message?(o(!0),d(null)):(d(t),o(!1)),c(!1)}else n(qi.setError({message:"Please select an address"}))},loading:l,foundLocations:e=>{d(e)},setError:e=>{_(e?{hasErrors:!0,errorMessage:e}:{hasErrors:!1,errorMessage:null})},setValue:e=>{f(e)},setAddressDetails:e=>{p(e)},inputError:g.hasErrors}),g.hasErrors&&(0,Dr.jsx)("div",{className:"error-message",children:g.errorMessage})]})]}),s&&(0,Dr.jsxs)("div",{className:`${Kf.text_info} ${Kf.no_delivery_text}`,children:[(0,Dr.jsx)(Jf,{}),(0,Dr.jsx)("h4",{children:"Delivery isn\u2019t available in your area."}),(0,Dr.jsx)("p",{children:"We're sorry, no locations currently deliver to this address."}),(0,Dr.jsx)("div",{className:Kf.cta_container,children:(0,Dr.jsx)("button",{className:"btn-underline",onClick:()=>{r()},children:"Search Pickup Options"})})]}),!s&&!u&&(0,Dr.jsx)("div",{className:Kf.delivery_description_text,children:(0,Dr.jsxs)("div",{className:Kf.text_info,children:[(0,Dr.jsx)("svg",{width:"56",height:"70",viewBox:"0 0 56 70",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.7318 66.6626C-37.4594 14.3665 35 -22.4885 53.5914 15.8259C58.7506 29.3444 52.5063 43.6053 43.2411 53.6283C42.0958 55.0151 40.9265 56.3766 39.7599 57.7348C36.8405 61.134 33.9387 64.5127 31.4747 68.2157C30.5545 69.7334 28.6648 69.339 27.1765 69.0284C27.0296 68.9977 26.8866 68.9679 26.7488 68.9408C26.0301 68.2624 25.3506 67.4494 24.7318 66.6626ZM39.6164 27.5192L35.7429 26.7409L36.9215 30.347L39.6164 27.5192ZM30.8511 35.6135L33.6179 36.7862L34.8685 34.1918L32.1017 33.0192L30.8511 35.6135ZM25.3175 25.6253L26.4242 28.8682L29.8827 27.8305L28.776 24.5875L25.3175 25.6253ZM22.9546 31.4263L22.4012 35.1206L26.1198 33.7767L22.9546 31.4263ZM23.1704 21.1682L25.5001 17.4479L21.0676 17.5361L23.1704 21.1682ZM14.8755 28.4064L15.9822 31.6494L19.4407 30.6064L18.334 27.3687L14.8755 28.4064ZM44.3001 28.1396C44.4067 28.8054 44.4435 29.0354 43.8497 30.8659V30.9489C43.709 31.3808 43.769 31.8386 43.829 32.2957C43.8894 32.7557 43.9497 33.215 43.8054 33.647C43.6993 33.9587 43.526 34.2466 43.2963 34.4928H43.3682C41.7189 37.4523 39.1165 39.849 35.931 41.3419C35.1466 41.4487 34.3577 41.4947 33.5705 41.5405C32.4084 41.6082 31.25 41.6756 30.1151 41.9386C29.5885 42.0615 29.0577 42.2296 28.5229 42.399C27.8157 42.623 27.1014 42.8493 26.3799 42.9763C23.4715 42.6898 20.69 41.709 18.3008 40.1277C18.0864 39.4229 17.9
2638 38.6964 17.9356 37.964C17.9246 37.759 17.8457 37.5623 17.7098 37.4014C17.5739 37.2405 17.3878 37.1234 17.1775 37.0664C16.152 36.8318 15.16 36.4834 14.2225 36.0286C14.1335 35.9886 14.0382 35.9623 13.9403 35.9508C12.2883 33.6313 11.3064 30.9496 11.0905 28.1677C11.36 28.1681 11.6194 28.0714 11.815 27.8976C12.0107 27.7238 12.1277 27.4861 12.1419 27.2338C12.2748 24.5326 12.6094 21.8434 13.1434 19.1861C13.8938 17.9121 14.8245 16.7392 15.9103 15.6993C18.6328 13.0842 22.6669 10.8945 26.6732 11.2578C27.0955 11.2958 27.5383 11.3569 27.9916 11.4194C28.7143 11.5192 29.4636 11.6226 30.1981 11.6417C30.3977 11.6448 30.5179 11.5101 30.632 11.3823C30.711 11.2938 30.787 11.2087 30.8843 11.1747C31.2832 11.0624 31.7084 11.0624 32.1073 11.1747C33.1642 11.403 34.7136 11.7455 34.7579 12.5861C34.6712 12.7477 34.5531 12.932 34.4207 13.1387C33.826 14.0672 32.9415 15.4481 33.3081 17.2559C33.5681 18.5375 34.0994 19.9021 35.4551 20.1771C35.6875 20.2238 36.8275 21.0385 36.8994 21.7078C36.9324 22.0355 37.15 22.214 37.3837 22.4057C37.5423 22.5358 37.7083 22.6719 37.829 22.8649C38.2726 23.5204 38.9396 24.016 39.7216 24.271C40.4997 24.5189 41.3128 24.657 42.1342 24.6809C43.0694 24.738 43.6947 24.9663 44.0433 25.7187C44.1281 25.8925 44.1661 26.0831 44.154 26.2739C44.1599 27.2642 44.2408 27.7693 44.3001 28.1396Z",fill:"var(--color-dark-raspberry)"})}),(0,Dr.jsx)("h4",{children:"Just Need Your Address"}),(0,Dr.jsx)("p",{children:"Let\u2019s see if you can get all your favorite sweet treats delivered straight to your door."})]})}),!s&&u&&u.length>0&&(0,Dr.jsx)(Yf,{orderType:v,searchedLocations:h,foundLocation:u[0],deliveryType:"dispatch",time:x})]})};var eg=()=>(0,Dr.jsx)("svg",{width:"43",height:"60",viewBox:"0 0 43 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M21.4821 0C9.65087 0 0 9.76492 0 21.7722C0 32.8391 8.25686 42.0253 18.8371 43.3273V57.2875C18.8371 58.8065 20.0166 60 21.4821 60C22.9476 60 24.1987 58.8065 24.1987 57.2875V43.3273C34.7789 41.9891 43 32.8029 43 21.7722C43 9.76492 33.3491 0 21.4821 0ZM21.4821 38.0832C12.6176 38.0832 5.3616 30.7776 5.3616 21.7722C5.3616 12.7667 12.6176 5.42495 21.4821 5.42495C30.3466 5.42495 37.6384 12.7667 37.6384 21.7722C37.6384 30.7776 30.3824 38.0832 21.4821 38.0832ZM29.1313 25.208C30.1679 26.2568 30.1679 27.9928 29.1313 29.0416C28.6309 29.5841 27.916 29.8373 27.2369 29.8373C26.5578 29.8373 25.8786 29.5841 25.3425 29.0416L21.5179 25.1718L17.6575 29.0416C17.1214 29.5841 16.4422 29.8373 15.7631 29.8373C15.084 29.8373 14.3691 29.5841 13.8687 29.0416C12.7963 27.9928 12.7963 26.2568 13.8687 25.208L17.729 21.3382L13.8687 17.4322C12.7963 16.3472 12.7963 14.6474 13.8687 13.5986C14.9052 12.5136 16.5852 12.5136 17.6575 13.5986L21.5179 17.5045L25.3425 13.5986C26.3791 12.5136 28.0948 12.5136 29.1313 13.5986C30.1679 14.6474 30.1679 16.3472 29.1313 17.4322L25.3067 21.3382L29.1313 25.208Z",fill:"#584646"})}),tg={location:"Location_location__vUkDS",location_inner:"Location_location_inner__qLxul",location_active:"Location_location_active__JH-Mg",location_header:"Location_location_header__ErYHi",location_header_controls:"Location_location_header_controls__n7mvb",status:"Location_status__mhZ+8",status_text:"Location_status_text__NxmeG",title:"Location_title__PHY30",distance:"Location_distance__eh0+I",program:"Location_program__ihxl8",program_header:"Location_program_header__J91G3",program_header_inner:"Location_program_header_inner__yn7hO",phone:"Location_phone__7G86K",program_text:"Location_program_text__JNUb1",location_footer:"Location_location_footer__6IHsH",cobranded_container:"Location_cobranded_container__3G57Y",cobranded_image:"Location_cobranded_image__V8dK+",cobranded_text:"Location_cobranded_text__zQeol",loc_details_trigger:"Location_loc_details_trigger__StwZh",modal_controller:"Location_modal_controller__Aj9Xh",warning_header:"Location_warning_header__3Fz-1",loc_hours_trigger:"Location_loc_hours_trigger__K9DfQ",opened:"Location_opened__0hRoI",logo:"Location_logo__Wl-OI"};var rg=r.p+"static/media/GAC_MSC_logo.ca1942a57e75e6f55791b4df2f043042.svg";var ng=()=>(0,Dr.jsx)("svg",{width:"19",height:"9",viewBox:"0 0 19 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M18.2751 8.98868C18.1301 8.98868 17.985 8.94288 17.8593 8.82838L9.49546 1.91235L1.14126 8.83983C0.812504 9.11464 0.358051 9.02304 0.13566 8.63372C-0.0964015 8.24441 -0.0190478 7.70624 0.309705 7.44288L9.07968 0.16044C9.33108 -0.0456673 9.65983 -0.0456673 9.91123 0.16044L18.6812 7.43143C19.01 7.70624 19.0873 8.24441 18.8553 8.62227C18.7102 8.86273 18.4878 8.98868 18.2558 8.98868H18.2751Z",fill:"var(--color-text-blue)"})});var ig=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsx)("svg",{width:r&&r.width?r.width:"24",height:r&&r.height?r.height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M16.9388 17.1257C15.4572 15.0034 13.8687 14.2292 12.7075 15.0434C12.2403 15.3638 11.7864 15.5106 11.386 15.4439C11.1057 15.3905 10.8521 15.2303 10.6785 14.99C10.0912 14.1491 9.29032 12.9611 9.29032 12.9611L8.3693 13.5885L9.26363 12.9344C9.26363 12.9344 8.42269 11.7865 7.83537 10.9322C7.67519 10.6919 7.60845 10.3982 7.66185 10.1179C7.72859 9.73084 8.02225 9.34374 8.48943 9.02339C8.80979 8.79647 9.33037 8.26254 9.23693 7.22139C9.07675 5.3126 6.79421 2.45609 5.21913 1.72194C4.31146 1.2948 3.69744 1.56176 3.40378 1.76199C2.17575 2.62962 0.480533 4.03117 0.06674 6.12684C-0.320357 8.08902 1.14794 11.4127 4.53838 16.2714C7.94216 21.1302 10.5584 23.6396 12.5473 23.9466C12.8009 23.9867 13.0412 24 13.2948 24C15.3504 24 17.1524 22.7453 17.7798 22.2915C19.1546 21.3304 18.1802 18.9144 16.9388 17.1257ZM12.8543 21.9711C12.2136 21.8643 10.3048 20.9967 6.1802 15.1235C6.1802 15.1235 6.1535 15.0835 6.14015 15.0701C2.06896 9.22361 1.90879 7.1413 2.02892 6.50058C2.28254 5.20581 3.44383 4.2047 4.3782 3.52394C4.77864 3.71082 5.67297 4.47166 6.47386 5.673C7.07453 6.58067 7.24805 7.20804 7.24805 7.4483C6.16685 8.23585 5.80645 9.13017 5.68632 9.74419C5.53949 10.5584 5.72636 11.4127 6.19355 12.0801C6.74082 12.881 7.50167 13.9222 7.63515 14.0823C7.63515 14.0823 7.63515 14.0957 7.6485 14.109C7.76863 14.2826 8.48943 15.3504 9.03671 16.138C9.51724 16.8187 10.2514 17.2859 11.0656 17.4194C11.6796 17.5262 12.6541 17.4861 13.762 16.7386C13.9755 16.8187 14.5095 17.2058 15.1502 18.0734C16.0178 19.2347 16.4182 20.3426 16.4583 20.7831C15.5106 21.4238 14.1624 22.1713 12.8543 21.9711ZM15.6307 9.31705C15.3103 9.31705 15.0033 9.17022 14.8031 8.8899
21C14.4828 8.43607 14.5895 7.8087 15.0434 7.5017L19.5017 4.37823C19.9555 4.05787 20.5829 4.16466 20.8899 4.61849C21.2102 5.07233 21.1034 5.6997 20.6496 6.0067L16.1913 9.13017C16.0178 9.25031 15.8176 9.31705 15.6174 9.31705H15.6307ZM16.8721 12.841C16.3648 12.841 15.9244 12.4539 15.871 11.9333C15.8176 11.386 16.2314 10.8921 16.7786 10.8521L22.2113 10.3716C22.7453 10.3315 23.2525 10.732 23.2925 11.2792C23.3459 11.8265 22.9321 12.3204 22.3849 12.3604L16.9522 12.841C16.9522 12.841 16.8988 12.841 16.8587 12.841H16.8721ZM12.7475 6.94107C12.6007 6.94107 12.4672 6.91438 12.3204 6.84764C11.8131 6.62072 11.5996 6.02005 11.8398 5.51282L14.1491 0.574C14.376 0.0801179 14.9766 -0.146801 15.4839 0.0934661C15.9911 0.320385 16.2047 0.921052 15.9644 1.42828L13.6552 6.3671C13.4816 6.7275 13.1212 6.94107 12.7475 6.94107Z",fill:t||"#8D0E57"})})},ag=r.p+"static/media/MSC_Logo_F_1line-spot-clr.d570091d926938b78736.png",sg=r.p+"static/media/GAC_Logo_F_1line-spot-clr.2188606c827197417ea5.png",og=r.p+"static/media/GAC_MSC_CoBrand.f396ba9b100d5a6e4b8b.png",lg="LocationsHours_container__i2xlf",cg="LocationsHours_row__lrZxt",ug="LocationsHours_today__XpzOx";const dg={monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6,sunday:7};function hg(e){const t=new Date(e);return new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(t)}var pg=t=>{let{hours:r}=t;const[n,i]=(0,e.useState)(null);return(0,e.useEffect)((()=>{let e=[];
2if(r){for(const[t,n]of Object.entries(r))e.push({day:t,dayLong:hg(n.start),open:new Date(n.start).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),close:new Date(n.end).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})});e.sort((function(e,t){let r=e.dayLong.toLowerCase(),n=t.dayLong.toLowerCase();return dg[r]-dg[n]})),i(e)}}),[r]),(0,Dr.jsx)("div",{className:lg,children:n&&n.map((e=>(0,Dr.jsxs)("div",{className:`${cg} ${Gi()===e.day?ug:""}`,children:[(0,Dr.jsx)("div",{children:e.dayLong}),(0,Dr.jsxs)("div",{children:[e.open," - ",e.close]})]},e.day)))})};var mg=e=>{let{children:t,data:r}=e;const n=E();return(0,Dr.jsx)("div",{onMouseEnter:()=>{n(Vi.setMapSelectedLocation({id:r.id,scroll:!1}))},children:t})};var fg=t=>{let{children:r,data:n}=t;const i=(0,e.useRef)(null),[a,s]=(0,e.useState)(!1),o=y((e=>e.location.mapSelectedLocation));return(0,e.useEffect)((()=>{o&&i&&(o.id===n.id?(s(!0),o.scroll&&i.current.scrollIntoView({behavior:"smooth",block:"center"})):s(!1))}),[o,n.id,a]),(0,Dr.jsx)("div",{ref:i,className:`${tg.location} ${a?tg.location_active:tg.location_inactive}`,children:r})};function gg(e){if(e)return e.data&&e.data.attributes&&e.data.attributes.includes("MSC")?ag:e.data&&e.data.attributes&&e.data.attributes.findIndex((e=>e.includes("CNC")))>=0?og:sg}var _g=t=>{var r,n,i,a,o;let{data:l,deliveryType:c,itemIndex:u}=t;const d=xt(),[h,p]=(0,e.useState)(!1),[m,f]=(0,e.useState)(!1),g=E();let _=y((e=>e.cart.vehicleInfo)),v=y((e=>e.cart.cart)),x=y((e=>e.location.order));const b=null===l||void 0===l||null===(r=l.data)||void 0===r||null===(n=r.attributes)||void 0===n?void 0:n.some((e=>"GAC Treatware"===e));null!==v&&void 0===v.id&&g(vs.addCart(Nr("currentCart")));const w=async()=>{p(!0),"curbside"===c&&localStorage.setItem("carInfo",JSON.stringify(_));const e=await ur({restaurant_id:l.id});if(e.id){const t={delivery_mode:"pickup",time:"asap",schedule_date:null,schedule_time:null};l.status.open||(t.time="schedule",t.schedule_date=sa(e.earliestreadytime),t.schedule_time=la(e.earliestreadytime)),l.status.open&&!l.services.asap&&(t.time="schedule",t.schedule_date=Ki(Qi(e.earliestreadytime,30)),t.schedule_time=Yi(Qi(e.earliestreadytime,30)));const r=await _r(e.id,t);r.id?(async e=>{const t=await or(l.id);Ar("currentCart"),g(vs.addCart(null)),g(_m.clearVirtualCart()),g(Vi.setLocationItem(l)),g(Vi.setMenuItem(t)),g(Vi.forceLocationsSideBarStateClosed()),g(Vi.setVirtualDeliveryType(c)),Pr("currentLocationId",{currentLocationId:l.id,currentLocationSlug:l.location_slug},null),Pr("currentLocation",{currentLocation:l,deliveryType:c,time:x},3600),Pr("currentMenu",{menu:t},3600),g(vs.addCart(e)),Mr("currentCart",e),g(Vi.setOrderDate(null)),g(Vi.setOrderTime(null)),t.data&&t.data.attributes&&t.data.attributes.includes("MSC")?d(`/marble-slab-creamery/${t.location_slug}`):t.data&&t.data.attributes&&t.data.attributes.findIndex((e=>e.includes("CNC")))>=0?d(`/co-marble-slab-creamery/${t.location_slug}`):d(`/gac/${t.location_slug}`),p(!1)})(r):(g(qi.setError(r)),p(!1))}else g(qi.setError(e)),p(!1)},[C,S]=(0,e.useState)(!1);return(0,Dr.jsxs)(Dr.Fragment,{children:[!l.exempt_store&&(0,Dr.jsx)(mg,{data:l,children:(0,Dr.jsxs)(fg,{data:l,children:[(0,Dr.jsxs)("div",{className:tg.location_inner,children:[(0,Dr.jsx)("img",{src:gg(l),alt:l.name,className:tg.logo}),l.name&&(0,Dr.jsxs)("div",{className:tg.title,children:[l.address.street,(0,Dr.jsx)("br",{}),l.address.city,", ",l.address.state,", ",l.address.zip]}),(0,Dr.jsxs)("div",{className:"distance_directions",children:[l.distanceFromSearch&&(0,Dr.jsxs)("div",{className:tg.distance,children:["(",l.distanceFromSearch," miles away)"]}),(0,Dr.jsx)("button",{className:"btn get-directions-btn",children:"Get directions"})]}),l.telephone&&(0,Dr.jsxs)("div",{className:tg.phone,children:[(0,Dr.jsx)(ig,{}),(0,Dr.jsx)("div",{className:tg.program_text,children:l.telephone})]}),(0,Dr.jsxs)("div",{className:tg.program,children:[(0,Dr.jsxs)("div",{className:tg.program_header,children:[(0,Dr.jsxs)("div",{className:tg.program_header_inner,children:[(0,Dr.jsx)(Ks,{}),(0,Dr.jsxs)("div",{className:tg.program_text,children:["Open until ",l&&l.hours&&l.hours.business&&l.hours.business[Gi()]&&new Date(null===(i=l.hours.business[Gi()])||void 0===i?void 0:i.end).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})]})]}),(0,Dr.jsxs)("button",{onClick:()=>{S((e=>!e))},className:`${tg.loc_hours_trigger} ${C?tg.opened:""}`,children:[(0,Dr.jsx)(ng,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"open location"})]})]}),C&&(0,Dr.jsx)("div",{children:l.hours&&l.hours.business&&(0,Dr.jsx)(pg,{hours:l.hours.business})})]}),b&&(0,Dr.jsx)("p",{className:"online_ordering",children:"This location is not currently accepting online orders"}),!b&&(0,Dr.jsx)("div",{className:tg.location_footer,children:(0,Dr.jsx)("button",{className:"btn btn-fit",onClick:async()=>{l.status.open?w():f(!0)},title:"select this location",children:"Order Now"})})]}),h&&(0,Dr.jsx)(Dr.Fragment,{children:s.createPortal((0,Dr.jsx)("div",{className:"preparing_restaurant",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_backdrop",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_container",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"})})})}),document.getElementById("overlay-root"))})]})}),l.exempt_store&&(0,Dr.jsx)(mg,{data:l,children:(0,Dr.jsxs)(fg,{data:l,children:[(0,Dr.jsxs)("div",{className:tg.location_inner,children:[(0,Dr.jsx)("img",{src:gg(l),alt:l.name,className:tg.logo}),(0,Dr.jsx)("div",{className:tg.title,children:l.address.full_address}),(0,Dr.jsxs)("div",{className:"distance_directions",children:[(l.address.distance||0==l.address.distance)&&(0,Dr.jsxs)("div",{className:tg.distance,children:["(",ia(l.address.distance)," miles away)"]}),(0,Dr.jsx)("button",{className:"btn get-directions-btn",children:"Get directions"})]}),l.telephone&&(0,Dr.jsxs)("div",{className:tg.phone,children:[(0,Dr.jsx)(ig,{}),(0,Dr.jsx)("div",{className:tg.program_text,children:l.telephone})]}),(0,Dr.jsx)("div",{className:tg.program,children:(0,Dr.jsx)("div",{className:tg.program_header,children:(0,Dr.jsxs)("div",{className:tg.program_header_inner,children:[(0,Dr.jsx)(Ks,{}),(0,Dr.jsxs)("div",{className:tg.program_text,children:["Open until ",null===(a=l.hours.business[Gi()])||void 0===a?void 0:a.end]})]})})})]}),l.cobranded&&(0,Dr.jsxs)("div",{className:tg.cobranded_container,children:[(0,Dr.jsx)("div",{className:tg.cobranded_image,children:rg&&(0,Dr.jsx)("img",{src:rg,alt:"cobranded"})}),(0,Dr.jsxs)("div",{className:tg.cobranded_text,children:[(0,Dr.jsx)("span",{children:"Co-Branded Store"}),"This store also sells products from ",(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/",rel:"noreferrer",target:"_blank",children:"Marble Slab Creamery"}),"."]})]})]})}),m&&(0,Dr.jsxs)(Tp,{transition:m,children:[(0,Dr.jsxs)("p",{className:tg.warning_header,children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),(0,Dr.jsx)("strong",{children:"Warning:"})," ",l.name," is not opened yet!"]}),(0,Dr.jsxs)("p",{children:["The store will open today at ",new Date(null===(o=l.hours.business[Gi()])||void 0===o?void 0:o.start).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})]}),(0,Dr.jsxs)("div",{className:tg.modal_controller,children:[(0,Dr.jsx)("button",{className:"btn btn-border",onClick:()=>{f(!1)},children:"Change Location"}),(0,Dr.jsx)("button",{className:"btn",onClick:async()=>{f(!1),sessionStorage.setItem("wasWarningShown",!0),w()},children:"Proceed Anyway"})]})]})]})};var yg=()=>(0,Dr.jsx)("svg",{width:"15",height:"16",viewBox:"0 0 15 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M7.49181 0.527409C7.35054 0.529617 7.21592 0.587782 7.11749 0.689139C7.01907 0.790496 6.96487 0.926763 6.96681 1.06803V1.62845C3.86371 1.88649 1.38395 4.3653 1.12618 7.46803H0.566808C0.496135 7.46703 0.425968 7.48009 0.360385 7.50644C0.294802 7.5328 0.235111 7.57193 0.18478 7.62155C0.13445 7.67117 0.094484 7.7303 0.0672053 7.79551C0.0399265 7.86071 0.0258789 7.93069 0.0258789 8.00137C0.0258789 8.07205 0.0399265 8.14202 0.0672053 8.20723C0.094484 8.27243 0.13445 8.33156 0.18478 8.38119C0.235111 8.43081 0.294802 8.46994 0.360385 8.49629C0.425968 8.52264 0.496135 8.5357 0.566808 8.5347H1.12722C1.38524 11.6375 3.86401 14.1163 6.96681 14.3743V14.9347C6.96581 15.0054 6.97886 15.0755 7.00522 15.1411C7.03157 15.2067 7.0707 15.2664 7.12032 15.3167C7.16995 15.3671 7.22908 15.407 7.29428 15.4343C7.35949 15.4616 7.42946 15.4756 7.50014 15.4756C7.57082 15.4756 7.6408 15.4616 7.706 15.4343C7.7712 15.407 7.83034 15.3671 7.87996 15.3167C7.92958 15.2664 7.96871 15.2067 7.99506 15.1411C8.02142 15.0755 8.03447 15.0054 8.03347 14.9347V14.3743C11.1363 14.1163 13.615 11.6375 13.8731 8.5347H14.4335C14.5041 8.5357 14.5743 8.52264 14.6399 8.49629C14.7055 8.46994 14.7652 8.43081 14.8155 8.38119C14.8658 8.33156 14.9058 8.27243 14.9331 8.20723C14.9604 8.14202 14.9744 8.07205 14.9744 8.00137C14.9744 7.93069 14.9604 7.86071 14.9331 7.79551C14.9058 7.7303 14.8658 7.67117 14.8
2155 7.62155C14.7652 7.57193 14.7055 7.5328 14.6399 7.50644C14.5743 7.48009 14.5041 7.46703 14.4335 7.46803H13.8741C13.6163 4.3653 11.1366 1.88649 8.03347 1.62845V1.06803C8.03445 0.996679 8.0211 0.925854 7.99421 0.859753C7.96732 0.793651 7.92744 0.733618 7.87694 0.683206C7.82643 0.632795 7.76632 0.593031 7.70016 0.56627C7.63401 0.539509 7.56316 0.526294 7.49181 0.527409ZM6.96681 2.69408V3.20137C6.96581 3.27204 6.97886 3.34221 7.00522 3.40779C7.03157 3.47337 7.0707 3.53306 7.12032 3.5834C7.16995 3.63373 7.22908 3.67369 7.29428 3.70097C7.35949 3.72825 7.42946 3.7423 7.50014 3.7423C7.57082 3.7423 7.6408 3.72825 7.706 3.70097C7.7712 3.67369 7.83034 3.63373 7.87996 3.5834C7.92958 3.53306 7.96871 3.47337 7.99506 3.40779C8.02142 3.34221 8.03447 3.27204 8.03347 3.20137V2.69408C10.5579 2.9435 12.5571 4.94356 12.8064 7.46803H12.3001C12.2295 7.46703 12.1593 7.48009 12.0937 7.50644C12.0281 7.5328 11.9684 7.57193 11.9181 7.62155C11.8678 7.67117 11.8278 7.7303 11.8005 7.79551C11.7733 7.86071 11.7592 7.93069 11.7592 8.00137C11.7592 8.07205 11.7733 8.14202 11.8005 8.20723C11.8278 8.27243 11.8678 8.33156 11.9181 8.38119C11.9684 8.43081 12.0281 8.46994 12.0937 8.49629C12.1593 8.52264 12.2295 8.5357 12.3001 8.5347H12.8074C12.558 11.0589 10.5577 13.0593 8.03347 13.3087V12.8014C8.03445 12.73 8.0211 12.6592 7.99421 12.5931C7.96732 12.527 7.92744 12.467 7.87694 12.4165C7.82643 12.3661 7.76632 12.3264 7.70016 12.2996C7.63401 12.2728 7.56316 12.2596 7.49181 12.2607C7.35054 12.263 7.21592 12.3211 7.11749 12.4225C7.01907 12.5238 6.96487 12.6601 6.96681 12.8014V13.3087C4.44257 13.0593 2.44226 11.0589 2.19285 8.5347H2.70014C2.77081 8.5357 2.84098 8.52264 2.90656 8.49629C2.97215 8.46994 3.03184 8.43081 3.08217 8.38119C3.1325 8.33156 3.17247 8.27243 3.19974 8.20723C3.22702 8.14202 3.24107 8.07205 3.24107 8.00137C3.24107 7.93069 3.22702 7.86071 3.19974 7.79551C3.17247 7.7303 3.1325 7.67117 3.08217 7.62155C3.03184 7.57193 2.97215 7.5328 2.90656 7.50644C2.84098 7.48009 2.77081 7.46703 2.70014 7.46803H2.19389C2.44318 4.94356 4.44242 2.9435 6.96681 2.69408ZM7.50014 5.86803C6.93435 5.86803 6.39172 6.0928 5.99165 6.49287C5.59157 6.89295 5.36681 7.43557 5.36681 8.00137C5.36681 8.56716 5.59157 9.10978 5.99165 9.50986C6.39172 9.90994 6.93435 10.1347 7.50014 10.1347C8.06594 10.1347 8.60856 9.90994 9.00863 9.50986C9.40871 9.10978 9.63347 8.56716 9.63347 8.00137C9.63347 7.43557 9.40871 6.89295 9.00863 6.49287C8.60856 6.0928 8.06594 5.86803 7.50014 5.86803Z",fill:"white"})}),vg="GetCurrentLocationButton_container__6r6YD";var xg=t=>{let{deliveryType:r,foundLocations:n,noLocation:i}=t;const a=E(),[s,o]=(0,e.useState)(!1);(()=>{const[t,r]=(0,e.useState)(!1);function n(e){var t=e.coords;r({lat:t.latitude,lng:t.longitude})}(0,e.useEffect)((()=>{navigator.geolocation?navigator.permissions.query({name:"geolocation"}).then((function(e){"granted"===e.state||"prompt"===e.state?r(navigator.geolocation.getCurrentPosition(n,fs,ms)):"denied"===e.state&&r({message:"denied"})})):r({message:"Geolocation is not supported by this browser."})}),[])})();let l=y((e=>e.location.order));return(0,Dr.jsx)("div",{className:vg,children:(0,Dr.jsxs)("button",{className:"btn btn-large",onClick:async()=>{o(!0),Ol.initialize("prj_live_pk_0db2330639bf866045f9e6d6752f1481ccf14f10",{}),Ol.ipGeocode().then((e=>{const{ip:t,address:a,proxy:s}=e;if(e&&e.address&&e.address.latitude){let c={lat:e.address.latitude,lng:e.address.longitude};async function u(){let e;e="asap"===l.type?await ar(c,r):await(async(e,t,r,n)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/restaurants/nearby?advance=${r} ${n}&delivery=${t}&lat=${e.lat}&lng=${e.lng}`,null,null))(c,r,l.date,l.time),e.length>0?(e.forEach((e=>{e.distanceFromSearch=(.621371*((e,t,r,n)=>{var i=gs(r-e),a=gs(n-t),s=Math.sin(i/2)*Math.sin(i/2)+Math.cos(gs(e))*Math.cos(gs(r))*Math.sin(a/2)*Math.sin(a/2);return 2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))*6371})(e.address.latitude,e.address.longitude,c.lat,c.lng)).toFixed(2)})),n(e),i(!0),o(!1)):(i(!0),n(null),o(!1)),o(!1)}u()}})).catch((e=>{a(qi.setError({message:"Something went wrong, please try again"})),o(!1)}))},children:[s&&(0,Dr.jsx)("span",{className:"loader small"}),!s&&(0,Dr.jsx)(yg,{}),(0,Dr.jsx)("span",{children:"Use my location"})]})})};var bg=()=>(0,Dr.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M10 0C4.48241 0 0 4.48241 0 10C0 15.5176 4.48241 20 10 20C15.5176 20 20 15.5176 20 10C20 4.48241 15.5176 0 10 0ZM10 0.869565C15.0476 0.869565 19.1304 4.95238 19.1304 10C19.1304 15.0476 15.0476 19.1304 10 19.1304C4.95238 19.1304 0.869565 15.0476 0.869565 10C0.869565 4.95238 4.95238 0.869565 10 0.869565ZM13.474 6.08101C13.3593 6.08372 13.2504 6.13164 13.1709 6.21433L10 9.38519L6.82914 6.21433C6.78863 6.17268 6.74017 6.13958 6.68664 6.11697C6.63312 6.09436 6.5756 6.08271 6.51749 6.08271C6.431 6.08273 6.34648 6.10855 6.27474 6.15686C6.20299 6.20517 6.14729 6.27378 6.11474 6.35391C6.08219 6.43405 6.07429 6.52207 6.09203 6.60673C6.10977 6.69138 6.15235 6.76882 6.21433 6.82914L9.38519 10L6.21433 13.1709C6.17261 13.2109 6.13929 13.2589 6.11634 13.312C6.09339 13.3651 6.08127 13.4222 6.08068 13.4801C6.08009 13.5379 6.09105 13.5953 6.11291 13.6489C6.13478 13.7024 6.16711 13.7511 6.20801 13.792C6.24892 13.8329 6.29757 13.8652 6.35113 13.8871C6.40468 13.909
26.46206 13.9199 6.51991 13.9193C6.57775 13.9187 6.6349 13.9066 6.68799 13.8837C6.74109 13.8607 6.78908 13.8274 6.82914 13.7857L10 10.6148L13.1709 13.7857C13.2109 13.8274 13.2589 13.8607 13.312 13.8837C13.3651 13.9066 13.4222 13.9187 13.4801 13.9193C13.5379 13.9199 13.5953 13.909 13.6489 13.8871C13.7024 13.8652 13.7511 13.8329 13.792 13.792C13.8329 13.7511 13.8652 13.7024 13.8871 13.6489C13.909 13.5953 13.9199 13.5379 13.9193 13.4801C13.9187 13.4222 13.9066 13.3651 13.8837 13.312C13.8607 13.2589 13.8274 13.2109 13.7857 13.1709L10.6148 10L13.7857 6.82914C13.8488 6.76843 13.8921 6.69005 13.91 6.60429C13.9278 6.51853 13.9193 6.42937 13.8857 6.34851C13.852 6.26764 13.7947 6.19884 13.7212 6.15111C13.6477 6.10338 13.5616 6.07895 13.474 6.08101Z",fill:"#242C37"})});var wg=t=>{let{selectedResult:r,loading:n,label:i,hasLocations:a}=t;const s=(0,e.useRef)(null),[o,l]=(0,e.useState)(null),[c,u]=(0,e.useState)(!0);(0,e.useEffect)((()=>{Ol.initialize("prj_live_pk_0db2330639bf866045f9e6d6752f1481ccf14f10",{}),s&&Ol.ui.autocomplete({container:"radar_autocomplete",countryCode:"US",onSelection:e=>{l(e),r(e)},style:{pinIcon:{display:"none"},addressText:{fontSize:100,lineHeight:24,color:"#000",fontWeight:"600"}}})}),[]),(0,e.useEffect)((()=>{a&&u(!1)}),[a]);return(0,Dr.jsxs)("div",{className:"form-fields-container",children:[(0,Dr.jsx)("label",{className:"label label-caps",htmlFor:"searchAddress",children:i||"Enter an address"}),(0,Dr.jsxs)("div",{className:Rl.form_input_container,children:[(0,Dr.jsx)("input",{type:"text",id:"radar_autocomplete",ref:s}),n&&(0,Dr.jsx)("div",{className:Rl.loader_container,children:(0,Dr.jsx)("span",{className:"loader locations"})}),!n&&c&&(0,Dr.jsxs)("button",{className:Rl.btn_simple,type:"button",onClick:()=>{Ol.forwardGeocode({query:s.current.value}).then((e=>{const{addresses:t}=e;t&&t.length>0?r(t[0]):r(void 0)})).catch((e=>{}))},children:[" ",(0,Dr.jsx)(Fl,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"Search location"})]}),!n&&!c&&(0,Dr.jsxs)("button",{className:Rl.btn_clear,type:"button",onClick:()=>{s.current.value="",u(!0)},children:[(0,Dr.jsx)(bg,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"Clear search"})]})]})]})};var Cg=()=>{const e=xt(),t=E();return(0,Dr.jsx)("button",{onClick:()=>{t(Vi.forceLocationsSideBarStateClosed()),e("/directory")},className:"btn-underline",children:"View all locations"})};var Sg=()=>{const t=E(),[r,n]=(0,e.useState)(!1),[i,a]=(0,e.useState)(null),[s,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!1);return(0,e.useEffect)((()=>()=>{t(Vi.setFoundLocations(null)),t(Vi.setMapSelectedLocation({id:0,scroll:!1}))}),[]),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(wg,{selectedResult:async e=>{if(e){c(!0),o(e.formattedAddress);const r=await ar({lat:e.latitude,lng:e.longitude},"pickup");r.message?(n(!0),a(null),t(Vi.setFoundLocations(null))):(a(r),n(!1),t(Vi.setFoundLocations(r))),c(!1)}else t(qi.setError({message:"Please select an address"}))},loading:l,hasLocations:i,label:"Search by City, Zip or Address"}),!i&&(0,Dr.jsx)("div",{className:"form-controller",children:(0,Dr.jsxs)("div",{className:Rl.helper,children:[r&&(0,Dr.jsxs)("div",{className:Rl.no_location_found,children:[(0,Dr.jsx)(eg,{}),(0,Dr.jsx)("div",{className:Rl.no_location_found_text,children:"There are no stores in your area yet!"}),(0,Dr.jsx)("div",{className:Rl.link_container,children:(0,Dr.jsx)(Cg,{})})]}),!r&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("p",{children:"To find the closest store to your location, enter city or zip code in the field above."}),(0,Dr.jsx)("div",{className:Rl.link_container,children:(0,Dr.jsx)(Cg,{})})]}),(0,Dr.jsxs)("div",{className:Rl.helper_footer,children:[(0,Dr.jsx)("p",{children:"Tap the locator button below to find the closest store to you."}),(0,Dr.jsx)(xg,{deliveryType:"pickup",foundLocations:e=>{a(e),t(Vi.setFoundLocations(e))},noLocation:()=>{n(!0)}})]})]})}),i&&(0,Dr.jsxs)("div",{className:Rl.location_container,children:[(0,Dr.jsxs)("div",{className:Rl.location_container_counter,children:[i.length," Location",i.length>1?"s":""," Nearby"]}),i.map(((e,t)=>(0,Dr.jsx)(_g,{itemIndex:t,data:e,deliveryType:"pickup"},e.id)))]})]})},kg="SearchLocation_sidebar_content__v4cDN",jg="SearchLocation_sidebar_content_wrapper__U9DmM",Eg="SearchLocation_controls__XfQH1",Tg="SearchLocation_btn_round_left__-Iv8+",Pg="SearchLocation_btn_round_right__RolkX",Ig="SearchLocation_sidebar_content_inner__u2GFR";var Mg=t=>{let{closeSidebar:r}=t;const n=E(),[i,a]=(0,e.useState)({pickup:!0,curbside:!1,delivery:!1}),s=()=>{a({pickup:!0,curbside:!1,delivery:!1}),n(Vi.setVirtualDeliveryType("pickup")),n(Vi.setOrderDate(null)),n(Vi.setOrderTime(null)),n(Vi.setOrderType("asap"))};return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)("div",{className:kg,children:(0,Dr.jsxs)("div",{className:jg,children:[(0,Dr.jsxs)("div",{className:Eg,children:[(0,Dr.jsxs)("button",{className:`btn ${i.pickup?"":"btn-border"} ${Tg}`,onClick:s,children:[(0,Dr.jsx)(Is,{}),(0,Dr.jsx)("span",{children:"Pickup"})]}),(0,Dr.jsxs)("button",{className:`btn ${i.delivery?"":"btn-border"} ${Pg}`,onClick:()=>{a({pickup:!1,curbside:!1,delivery:!0}),n(Vi.setVirtualDeliveryType("delivery")),n(Vi.setOrderDate(null)),n(Vi.setOrderTime(null)),n(Vi.setOrderType("asap"))},children:[(0,Dr.jsx)(Es,{}),(0,Dr.jsx)("span",{children:"Delivery"})]})]}),i.pickup&&(0,Dr.jsx)("div",{className:Ig,children:(0,Dr.jsx)(Sg,{})}),i.delivery&&(0,Dr.jsx)("div",{className:Ig,children:(0,Dr.jsx)(Qf,{switchToPickup:s})})]})})})},Ng="MapRadar_map__cO-w8";r.p;var Ag="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAASCAYAAAC5DOVpAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJhSURBVHgBlVNBctpA
2EJwd4YSqVFTkB+IH8ILAD8zFULmYvCAITKpyMjrl4ATIC8CXFHCx8gKSF0B+wBMEXIDy7mRmhTBQ4CRTBSutZnume3oV/Ed03KtbA6qKuM77URgdf1fJQ9stf+ClRgAhJwfHyZ1MxTOGxnKgvhhmTxXDuGK5xyBdIphbQPNi3MlcZg4yjbnmfw+IWnAmMG4dqtx+0FgOc7znE6ic0S97B10xPe5qVl+O7vfZtN2rSVIYJQlI/WouBrZiYzHscpffWIDLu0ylIHtaGyniaVTvLfird7n26/I4ZoPzRBKhmQFFB/o42vRjamDBbpajUKOTb0aDn9KNcfSEi+WYkd9YDgo7mopgyuvbpFVLycEHphSlNtBPEj9G36fbnBoDhQrX2Saz2G8ipR0VIE/p0aRr/N4SSkopoVRsrgaz/eQtnYNJfubisqZXW2tY/tw2blT+MQ2egPN2l/Xz4USI6Dwkz0r0FJG1hnQnH+iCeqKLHQDT+eqWa6fANOAPzrkXB4AMhX+saXFn2i9uucsvYlyfTdsXr0l16dY/onsudmAibgKg0RQvwInY8RNpnysHStM1S+EhUN9fjIJTYJg8iLgKsSTPjsEHgFVkUJVsNUM9sQJPfsbUWmL0Z8FiwMGMkMSYnnSZgtVU7uEGVZbXN/XlsAgEoQAmhj4LJnETjSQ52F6pjux9ip40Q2ctxSJH0+1fwSTkatlJKaiKbTrp2EtJiNFZv8LxOQXPxJ1babHg0sEMgMLtkSrYKwhhYz4s/TOYhFwv0tAjRQW5YkTqt3GgJX48zv0DQG8mkWMxYiUAAAAASUVORK5CYII=",Lg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAASCAYAAAC5DOVpAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHSSURBVHgBnZRRTgJBDEDbrsY/MjeQI+wR1hPoj8of4QYQg7/ArySsnAD8MfiHJxBOIN5gPYErX4rZqe3AxpEsgjTZ7EynfdNpp4NQIF1TicjaUwSIGLAsKiNfisAJA0xoQf3GxyhZ90N/EpszY7OjgWjPVospM7wi4NvSmkNeggEYhvSFHR+KP6BK2Vp+kmEZGKc2gHYzHU2Kog6sjSXiUKYJLfAkB+I6yAJ2mvNRG7ZIt1RpE3DLB5Iu2IzjTSDdqFe6eL4x56GvVzu1Vz8+5IHqSMN2OWJ4KYrILosQBlkQrq+pPTJMGCFyRSPLVecUYB32kCxw0QFlXCUpt+6YFiV7F1n5pXK66CCvylYv5LhXumz5Krkm/av5wy2iu0Jl2sbIgGaaTxm+syK9TwpgfNsDoSZCNZtg1+n9TH7hXxuqv3Bmkn+cyty4qu4hKz8jwBkxwVCVQcYt2EO0G/RvCe9Iq5Hflbh08S+g2rsCMjwqxxUAA6xJXyWS0PauQLVTe/WThnd39Fejs/Qna3tIMhmxsbHRJSV6EgXheqP7wMyC7LbsCtA3TBLrRsjGe9vUc0z4WWuk4zT3x8IjOCjXBRRJyY/1DcvfNolowoTjoqi/ASOu9YRZp16uAAAAAElFTkSuQmCC";function Dg(e){const t=document.createElement("div");return t.className="marker",e&&(e.data&&e.data.attributes&&e.data.attributes.includes("MSC")?t.innerHTML='<svg width="48" height="65" viewBox="0 0 48 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect width="48" height="48" rx="24" fill="#584646"/>\n <path d="M24 64.5L19.6699 28.875L28.3301 28.875L24 64.5Z" fill="#584646"/>\n <path d="M23.7819 21.1766C25.8175 21.1766 27.8531 21.1815 29.8938 21.1766C30.6326 21.1766 31.2408 20.7369 31.4871 20.0774C31.7233 19.4374 31.6027 18.5776 30.9945 18.3089C30.13 17.9229 30.2506 17.3416 30.3511 16.6869C30.3511 16.6723 30.3511 16.6576 30.3511 16.6381C30.5421 11.7869 25.3249 8.51367 20.8616 10.6828C18.2731 11.9383 16.8658 14.6155 17.3131 17.41C17.3483 17.6347 17.4136 17.835 17.0869 17.9767C16.2224 18.3577 15.8555 19.071 16.0515 19.8771C16.2526 20.7125 16.8959 21.1766 17.871 21.1766C19.8363 21.1766 21.8066 21.1766 23.7819 21.1766Z" fill="white"/>\n <path d="M23.8271 25.5099C22.7414 25.5099 21.6608 25.5099 20.5751 25.5099C19.2181 25.5099 18.7255 26.1743 19.1527 27.425C20.4847 31.3431 21.8166 35.2612 23.1737 39.1695C23.2792 39.4773 23.5808 39.7264 23.7869 40C23.993 39.7215 24.2895 39.4724 24.3951 39.1646C25.7622 35.2221 27.1092 31.2747 28.4512 27.3273C28.8282 26.2281 28.3055 25.5197 27.1193 25.5099C26.0286 25.5002 24.9278 25.5099 23.8271 25.5099Z" fill="white"/>\n </svg>':e.data&&e.data.attributes&&e.data.attributes.findIndex((e=>e.includes("CNC")))>=0?t.innerHTML='<svg width="48" height="65" viewBox="0 0 48 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="Location Pin / Cobrand">\n <rect width="48" height="48" rx="24" fill="#584646"/>\n <path id="Polygon 1" d="M24 64.5L19.6699 28.875L28.3301 28.875L24 64.5Z" fill="#584646"/>\n <g id="Vector">\n <path d="M19.825 15.0788C20.1047 15.1549 20.3911 15.2144 20.6641 15.307C20.8798 15.3798 21.0954 15.4725 21.2841 15.5982C21.5436 15.7702 21.547 15.9224 21.4088 16.1903C21.1763 16.6469 20.9067 17.0968 20.7551 17.5798C20.4956 18.3936 20.6944 19.1809 21.1022 19.912C21.2606 20.1998 21.5167 20.3818 21.8334 20.5009C22.2917 20.6729 22.6254 20.9773 22.75 21.4702C22.7703 21.5496 22.8073 21.629 22.8579 21.6918C23.0702 21.9399 23.2825 22.188 23.5083 22.4229C23.9464 22.8795 24.5192 23.0647 25.1326 23.1507C25.4055 23.1871 25.6852 23.2037 25.9582 23.2367C26.5715 23.3128 26.8815 23.6701 26.895 24.2689C26.9051 24.6229 26.9355 24.9768 26.9826 25.3275C27.0332 25.7212 26.9692 26.1016 26.8445 26.4655C26.6895 26.9121 26.6288 27.3554 26.7131 27.8219C26.7872 28.2288 26.6726 28.5894 26.4704 28.9665C26.0862 29.6877 25.6279 30.3526 25.082 30.9613C24.3002 31.8347 23.3836 32.5426 22.3221 33.0554C22.039 33.191 21.6818 33.1943 21.3549 33.2208C20.4046 33.2969 19.4442 33.3035 18.5242 33.588C18.2007 33.6873 17.8772 33.7832 17.5604 33.9023C17.0246 34.1041 16.4921 34.1173 15.9327 34.0048C14.605 33.7369 13.3682 33.2605 12.2562 32.4996C12.1652 32.4368 12.0809 32.321 12.0607 32.2184C11.9967 31.8975 11.9495 31.5667 11.9192 31.2359C11.8788 30.8257 11.744 30.6801 11.3463 30.5445C10.7802 30.3559 10.2241 3
20.1343 9.6681 29.9159C9.6007 29.8895 9.55015 29.8035 9.50634 29.7373C8.6268 28.3776 8.16176 27.0047 8 25.301C8.08762 25.2713 8.18197 25.2448 8.26959 25.2018C8.47179 25.1025 8.57288 24.9338 8.5931 24.7155C8.71105 23.5444 8.829 22.37 8.96042 21.1989C9.00423 20.8085 9.08511 20.4248 9.15588 20.0377C9.16936 19.965 9.19631 19.8922 9.23338 19.826C10.4533 17.7617 12.1719 16.2763 14.4769 15.4724C15.5182 15.1086 16.5831 15.0854 17.6649 15.274C18.0187 15.3368 18.3827 15.3567 18.7432 15.3997C18.9252 15.4195 19.0701 15.3765 19.1881 15.2243C19.2386 15.1582 19.333 15.1218 19.4071 15.0755C19.5453 15.0788 19.6834 15.0788 19.825 15.0788ZM18.0895 23.1573C17.4323 23.3658 16.7921 23.5709 16.1316 23.7826C16.3472 24.4343 16.5562 25.0662 16.7685 25.7046C17.4357 25.4896 18.076 25.2878 18.7264 25.0794C18.5107 24.4244 18.3018 23.7958 18.0895 23.1573ZM10.8004 27.3653C11.4676 27.1536 12.1113 26.9485 12.7583 26.7401C12.5393 26.0851 12.3303 25.4598 12.118 24.818C11.4541 25.0298 10.8139 25.2349 10.1601 25.4433C10.3791 26.0884 10.5847 26.7169 10.8004 27.3653ZM20.007 28.2089C19.7643 28.7349 19.5352 29.2345 19.3026 29.7406C19.8351 29.9788 20.3439 30.2038 20.8595 30.432C21.1022 29.9093 21.3313 29.4131 21.5638 28.9036C21.0348 28.6654 20.5327 28.4438 20.007 28.2089ZM14.9083 21.0963C15.3565 20.3454 15.7845 19.6275 16.2091 18.9196C15.3767 18.9196 14.5679 18.9196 13.712 18.9196C14.1197 19.6606 14.5039 20.3586 14.9083 21.0963ZM22.0862 24.4508C22.3153 25.172 22.531 25.8535 22.7568 26.5681C23.2825 25.9958 23.7711 25.4631 24.28 24.9107C23.5251 24.7519 22.8242 24.603 22.0862 24.4508ZM14.8005 27.2562C14.6893 28.0005 14.5882 28.7018 14.4803 29.4363C15.2048 29.165 15.8788 28.9103 16.5865 28.6423C15.9799 28.1725 15.4104 27.7292 14.8005 27.2562Z" fill="white"/>\n <path d="M33.7888 21.6646C35.1456 21.6646 36.5025 21.668 37.8627 21.6646C38.3552 21.6646 38.7606 21.3631 38.9247 20.9108C39.0822 20.4719 39.0018 19.8823 38.5964 19.698C38.0202 19.4333 38.1006 19.0347 38.1676 18.5857C38.1676 18.5757 38.1676 18.5656 38.1676 18.5522C38.2949 15.2254 34.8173 12.9807 31.8423 14.4682C30.1169 15.3293 29.1788 17.1652 29.477 19.0816C29.5004 19.2357 29.544 19.373 29.3262 19.4702C28.75 19.7315 28.5054 20.2206 28.636 20.7734C28.7701 21.3463 29.1989 21.6646 29.8488 21.6646C31.1588 21.6646 32.4721 21.6646 33.7888 21.6646Z" fill="white"/>\n <path d="M33.8189 24.6363C33.0953 24.6363 32.375 24.6363 31.6513 24.6363C30.7467 24.6363 30.4184 25.0919 30.7032 25.9496C31.591 28.6365 32.4788 31.3234 33.3834 34.0037C33.4538 34.2147 33.6548 34.3856 33.7921 34.5732C33.9295 34.3822 34.1272 34.2114 34.1975 34.0003C35.1088 31.2966 36.0067 28.5896 36.9012 25.8826C37.1525 25.1288 36.804 24.643 36.0134 24.6363C35.2864 24.6296 34.5526 24.6363 33.8189 24.6363Z" fill="white"/>\n </g>\n </g>\n </svg>':t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="65" viewBox="0 0 48 65" fill="none">\n <rect width="48" height="48" rx="24" fill="#584646"/>\n <path d="M24 64.5L19.6699 28.875L28.3301 28.875L24 64.5Z" fill="#584646"/>\n <path d="M26.4473 14.0035C26.7418 14.0836 27.0433 14.1463 27.3306 14.2438C27.5576 14.3204 27.7847 14.4179 27.9833 14.5502C28.2564 14.7313 28.26 14.8915 28.1146 15.1735C27.8698 15.6541 27.586 16.1277 27.4264 16.6361C27.1532 17.4927 27.3625 18.3215 27.7918 19.0911C27.9585 19.3941 28.2281 19.5856 28.5615 19.711C29.0439 19.892 29.3951 20.2124 29.5264 20.7313C29.5477 20.8148 29.5867 20.8984 29.6399 20.9646C29.8634 21.2257 30.0868 21.4869 30.3245 21.7342C30.7856 22.2147 31.3887 22.4097 32.0343 22.5003C32.3216 22.5386 32.616 22.556 32.9034 22.5908C33.549 22.6709 33.8753 23.047 33.8895 23.6773C33.9001 24.0499 33.9321 24.4225 33.9817 24.7916C34.0349 25.206 33.9675 25.6065 33.8363 25.9895C33.6731 26.4596 33.6093 26.9263 33.6979 27.4173C33.776 27.8456 33.6554 28.2251 33.4425 28.6221C33.0382 29.3813 32.5557 30.0812 31.9811 30.7219C31.1581 31.6413 30.1933 32.3865 29.0759 32.9262C28.7779 33.069 28.4019 33.0725 28.0578 33.1004C27.0575 33.1804 26.0465 33.1874 25.0781 33.4869C24.7376 33.5914 24.397 33.6923 24.0636 33.8177C23.4996 34.0301 22.9391 34.0441 22.3503 33.9257C20.9526 33.6436 19.6508 33.1421 18.4802 32.3412C18.3844 32.2751 18.2957 32.1532 18.2745 32.0452C18.2071 31.7074 18.1574 31.3592 18.1255 31.011C18.0829 30.5792 17.941 30.426 17.5224 30.2832C16.9265 30.0847 16.3412 29.8514 15.7559 29.6215C15.6849 29.5937 15.6317 29.5031 15.5856 29.4335C14.6598 28.0023 14.1703 26.5571 14 24.7638C14.0922 24.7324 14.1916 24.7046 14.2838 24.6593C14.4966 24.5548 14.603 24.3772 14.6243 24.1474C14.7485 22.9147 14.8726 21.6784 15.011 20.4457C15.0571 20.0348 15.1422 19.6309 15.2167 19.2234C15.2309 19.1468 15.2593 19.0702 15.2983 19.0006C16.5824 16.8276 18.3915 15.2641 20.8178 14.4179C21.9139 14.0348 23.0349 14.0104 24.1735 14.2089C24.546 14.2751 24.9291 14.296 25.3087 14.3413C25.5002 14.3622 25.6528 14.3169 25.7769 14.1567C25.8301 14.0871 25.9294 14.0488 26.0075 14C26.1529 14.0035 26.2984 14.0035 26.4473 14.0035ZM24.6205 22.5072C23.9288 22.7266 23.2548 22.9425 22.5595 23.1654C22.7866 23.8514 23.0065 24.5165 23.23 25.1886C23.9323 24.9622 24.6063 24.7498 25.2909 24.5304C25.0639 23.8409 24.844 23.1793 24.6205 22.5072ZM16.9478 26.9367C17.6501 26.7138 18.3277 26.4979 19.0087 26.2786C18.7782 25.5891 18.5582 24.9309 18.3348 24.2553C17.6359 24.4782 16.962 24.6941 16.2738 24.9135C16.5044 25.5925 16.7208 26.2542 16.9478 26.9367ZM26.6389 27.8247C26.3835 28.3784 26.1423 28.9042 25.8975 29.437C26.458 29.6877 26.9936 29.9245 27.5364 30.1648C27.7918 29.6146 28.033 29.0922 28.2777 28.556C27.7208 28.3052 27.1923 28.0719 26.6389 27.8247ZM21.2719 20.3378C21.7437 19.5473 22.1942 18.7916 22.6411 18.0464C21.765 18.0464 20.9136 18.0464 20.0126 18.0464C20.4418 18.8265 20.8462 19.5612 21.2719 20.3378ZM28.8276 23.8688C29.0688 24.6279 29.2958 25.3453 29.5335 26.0975C30.0868 25.495 30.6012 24.9344 31.1368 24.3528C30.3422 24.1857 29.6044 24.029 28.8276 23.8688ZM21.1584 26.8218C21.0413 27.6053 20.9349 28.3435 20.8214 29.1166C21.584 28.8311 22.2935 28.5629 23.0384 28.2809C22.3999 27.7864 21.8004 27.3198 21.1584 26.8218Z" fill="white"/>\n </svg>'),t}var zg=t=>{let{locations:r,zoom:n,center:i}=t;const a=E(),s=(0,e.useRef)(null),o=(0,e.useRef)(null),l=y((e=>e.location.foundLocations)),c=y((e=>e.location.mapSelectedLocation));return(0,e.useEffect)((()=>{Ol.initialize("prj_live_pk_0db2330639bf866045f9e6d6752f1481ccf14f10",{});const e=Ol.ui.map({container:"map",style:"radar-default-v1",center:i||[-73.9911,40.7342],zoom:n||14});function t(e){var t,r;const n=null===e||void 0===e||null===(t=e.data)||void 0===t||null===(r=t.attributes)||void 0===r?void 0:r.some((e=>"GAC Treatware"===e));var i,a;return e.exempt_store?`\n <div class="map-popup-container">\n <div class="map-popup-header"> \n ${e.address.full_address}\n </div>\n \n <div class="distance_directions">\n <div class="map-popup-distance">(${e.address.distance.toFixed(2)} mile${1===e.address.distance?"":"s"} away)</div>\n <button class="btn get-directions-btn" onclick="window.open('${e.address.directions}', '_blank')">Get directions</button>\n </div>\n\n <div class="map-popup-row"><img src="${Ag}" alt="phone"/> ${e.telephone}</div>\n <div class="map-popup-row"><img src="${Lg}" alt="clock"/> Open until ${e.hours&&e.hours.business&&e.hours.business[Gi()]&&(null===(i=e.hours.business[Gi()])||void 0===i?void 0:i.end)}</div>\n \n ${n?"<p class='online_ordering'>This location is not currently accepting online orders</p>":""}\n </div>\n `:`\n <div class="map-popup-container">\n <div class="map-popup-header"> \n ${e.address.street}<br />\n ${e.address.city}, ${e.address.state}, ${e.address.zip}\n </div>\n \n <div class="distance_directions">\n <div class="map-popup-distance">(${e.address.distance} mile${1===e.address.distance?"":"s"} away)</div>\n <button class="btn get-directions-btn" onclick="window.open('${e.address.directions}', '_blank')">Get directions</button>\n </div>\n\n <div class="map-popup-row"><img src="${Ag}" alt="phone"/> ${e.telephone}</div>\n <div class="map-popup-row"><img src="${Lg}" alt="clock"/> Open until ${e.hours&&e.hours.business&&e.hours.business[Gi()]&&new Date(null===(a=e.hours.business[Gi()])||void 0===a?void 0:a.end).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}</div>\n\n ${n?"<p class='online_ordering'>This location is not currently accepting online orders</p>":""}\n\n ${n?"":`<div class="map-popup-footer">\n <a href="${"/"+e.slug+"/menu"}" class="btn btn-fit">Order Now</a>\n </div>`}\n </div>\n `}s.current=e,l&&(l.forEach((r=>{const n=Ol.ui.marker({element:Dg(r),marker_id:r.id,popup:{maxWidth:"325px",anchor:"bottom",offset:50,html:t(r)}}).setLngLat([r.address.longitude,r.address.latitude]).addTo(e);
2n.marker_id=r.id,n.on("click",(t=>{t.target.addClassName("marker-active"),e.fitToMarkers({center:[r.address.longitude,r.address.latitude],zoom:16,speed:2,curve:1}),a(Vi.setMapSelectedLocation({id:r.id,scroll:!0}))})),n._popup.on("close",(()=>{n.removeClassName("marker-active"),e.fitToMarkers({center:[r.address.longitude,r.address.latitude],zoom:7.85,speed:2,curve:1}),c.id===r.id&&a(Vi.setMapSelectedLocation({id:0,scroll:!1}))})),o.current=n})),s.current.flyTo({center:[l[0].address.longitude,l[0].address.latitude],zoom:8}))}),[l]),(0,e.useEffect)((()=>{s.current.getMarkers().forEach((e=>{e.removeClassName("marker-active"),e.marker_id===c.id&&e.addClassName("marker-active")}))}),[c]),(0,Dr.jsx)("div",{id:"map",className:Ng})},Og="MapContainer_container__mRVHp";var Rg=t=>{let{children:r,activeState:n}=t;const i=(0,e.useRef)(null);return(0,Dr.jsx)(cc,{in:n,nodeRef:i,timeout:400,classNames:"sidebar-group",unmountOnExit:!0,children:(0,Dr.jsx)("div",{ref:i,className:Og,children:r})})};var Fg=()=>{const e=E(),t=y((e=>e.location.islocationSidebarOpened)),r=y((e=>e.cart.cart)),n=ps("md900"),i=()=>{e(Vi.setLocationsSideBarState()),r?("pickup"!==r.deliverymode&&"curbside"!==r.deliverymode||e(Vi.setVirtualDeliveryType("pickup")),"dispatch"===r.deliverymode&&e(Vi.setVirtualDeliveryType("delivery"))):e(Vi.setVirtualDeliveryType("pickup"))};return(0,Dr.jsxs)(Dr.Fragment,{children:[t&&(0,Dr.jsx)(Dr.Fragment,{children:s.createPortal((0,Dr.jsx)(gc,{hide:i}),document.getElementById("backdrop-root"))}),s.createPortal((0,Dr.jsxs)("div",{children:[n&&(0,Dr.jsx)(Rg,{activeState:t,children:(0,Dr.jsx)(zg,{zoom:4,center:[-87.6298,41.8781]})}),(0,Dr.jsx)(vc,{click:i,activeState:t,design:"location",children:(0,Dr.jsx)(Mg,{closeSidebar:i})})]}),document.getElementById("overlay-root"))]})};var Bg=t=>{let{children:r}=t;const n=(0,e.useRef)(null),[i,a]=(0,e.useState)(!1),[s,o]=(0,e.useState)(!1);ps("lg");return(0,e.useEffect)((()=>{let e=200;const t=()=>{const t=n.current;if(a(!0),void 0!=t&&null!=t){var r=window.scrollY||document.documentElement.scrollTop;r>e?o(!1):r<e&&o(!0),e=r<=200?200:r}};return window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}}),[]),(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)("header",{className:`${os.header} ${i?s?`${os.header_sticky} header-sticky`:`${os.header_hide} header-hide`:""}`,ref:n,children:r})})};var Vg=()=>{const t=E(),r=ps("md"),n=y((e=>e.cart.cart)),[i,a]=(0,e.useState)(!1);let s=y((e=>e.auth.termsAndConditionsPop)),o=y((e=>e.location.location));return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)(Bg,{children:[(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:os.header_inner,children:[(0,Dr.jsxs)("div",{className:os.logo,children:[!o&&(0,Dr.jsxs)(er,{to:"/",children:[r&&(0,Dr.jsx)("img",{src:ls,alt:"logo",className:os.logo_cobranded,width:154,height:66}),!r&&(0,Dr.jsx)("img",{src:cs,alt:"logo",className:os.logo_cobranded,width:45,height:45})]}),o&&o.id&&(0,Dr.jsxs)(er,{to:xa(o),children:[o.cobranded&&(0,Dr.jsxs)(Dr.Fragment,{children:[r&&(0,Dr.jsx)("img",{src:ls,alt:"logo",className:os.logo_cobranded,width:154,height:66}),!r&&(0,Dr.jsx)("img",{src:cs,alt:"logo",className:os.logo_cobranded})]}),!o.cobranded&&o.data.attributes.includes("MSC")&&(0,Dr.jsx)("img",{src:ds,alt:"logo",className:os.logo_msc}),!o.cobranded&&!o.data.attributes.includes("MSC")&&(0,Dr.jsx)("img",{src:us,alt:"logo",className:os.logo_gac,width:300,height:26})]})]}),(0,Dr.jsxs)("div",{className:os.header_controls,children:[r&&(0,Dr.jsxs)("div",{className:os.header_controls_item,children:[!o&&(0,Dr.jsx)("button",{className:`btn ${os.btn_location}`,onClick:()=>{t(Vi.setLocationsSideBarState()),n?("pickup"!==n.deliverymode&&"curbside"!==n.deliverymode||t(Vi.setVirtualDeliveryType("pickup")),"dispatch"===n.deliverymode&&t(Vi.setVirtualDeliveryType("delivery"))):t(Vi.setVirtualDeliveryType("pickup"))},title:"Find you store",children:"Start Your Order"}),o&&o.id&&(0,Dr.jsx)(uc,{})]}),(0,Dr.jsx)("div",{className:`${os.header_controls_item} ${os.header_controls_item_sign_in}`,children:(0,Dr.jsx)(hc,{})}),(0,Dr.jsx)("div",{className:os.header_controls_item,children:(0,Dr.jsx)(ks,{})})]})]})}),!r&&(0,Dr.jsx)(pc,{}),(0,Dr.jsx)(Fg,{}),(0,Dr.jsx)(Bf,{}),(0,Dr.jsx)(Rf,{}),s&&(0,Dr.jsx)(Tp,{closeInfoHandler:()=>{t(Ha.openTermsAndConditions())},transition:s,children:(0,Dr.jsxs)("div",{className:os.terms_container,children:[(0,Dr.jsx)("h3",{children:"Updated Terms and Conditions"}),(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("p",{children:"Great American Cookies & Marble Slab Creamery Rewards program terms and conditions have changed."}),(0,Dr.jsxs)("p",{children:["By continuing, you agree to the ",(0,Dr.jsx)("a",{href:"https://www.greatamericancookies.com/rewards-terms/",target:"_blank",rel:"noreferrer",children:"Terms & Conditions"}),"."]})]}),(0,Dr.jsx)("div",{className:os.terms_container_footer,children:(0,Dr.jsx)("button",{className:"btn",onClick:()=>{t(Ha.openTermsAndConditions()),ma("terms_agreed",!0,3e3)},children:"Accept"})})]})})]})})};function $g(){const{pathname:t}=yt();return(0,e.useEffect)((()=>{window.scrollTo(0,0)}),[t]),null}var Ug={warning_container:"WarningComponent_warning_container__mwher",warning_inner:"WarningComponent_warning_inner__EtoCN",warning:"WarningComponent_warning__OBSTQ",success:"WarningComponent_success__G82RQ",warning_icon:"WarningComponent_warning_icon__0DLai",close_button:"WarningComponent_close_button__GaIq3"};var Hg=e=>{let{children:t,id:r,type:n}=e;const i=E();return setTimeout((()=>{i(qi.removeError(r))}),3e3),(0,Dr.jsx)("div",{className:`${Ug.warning} ${n&&"success"===n&&Ug.success}`,children:(0,Dr.jsxs)("div",{className:Ug.warning_inner,children:[(0,Dr.jsxs)("button",{onClick:()=>{i(qi.removeError(r))},className:Ug.close_button,children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:(0,Dr.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"close warning"})]}),!n&&(0,Dr.jsx)("div",{className:Ug.warning_icon,children:(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})})}),n&&"success"===n&&(0,Dr.jsx)("div",{className:Ug.warning_icon,children:(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"})})}),(0,Dr.jsx)("div",{className:Ug.warning_text,children:t})]})})};var qg=e=>{let{data:t}=e;return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)("div",{className:Ug.warning_container,children:t&&t.length>0&&t.map((e=>(0,Dr.jsxs)(Hg,{id:e.id,type:e.type,children:["string"===typeof e.message&&e.message,"string"!==typeof e.message&&e.message.errors&&"string"!==typeof e.message.errors&&(0,Dr.jsx)("ul",{children:Object.entries(e.message.errors).map((e=>(0,Dr.jsxs)("li",{children:[e[0]," ",e[1]]},e[0])))}),"string"!==typeof e.message&&e.message.errors&&"string"===typeof e.message.errors&&e.message.errors]},e.id)))})})};var Zg=()=>{const e=y((e=>e.various.errors));return(0,Dr.jsx)(Dr.Fragment,{children:e&&e.length>0&&(0,Dr.jsx)(qg,{data:e})})}
2,Gg=r(6366),Wg=r.n(Gg),Xg=r(2740),Jg=r.n(Xg),Kg=r(7324),Yg=r.n(Kg),Qg=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Qg||{}),e_={rel:["amphtml","canonical","alternate"]},t_={type:["application/ld+json"]},r_={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},n_=Object.values(Qg),i_={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},a_=Object.entries(i_).reduce(((e,t)=>{let[r,n]=t;return e[n]=r,e}),{}),s_="data-rh",o_="defaultTitle",l_="defer",c_="encodeSpecialCharacters",u_="onChangeClientState",d_="titleTemplate",h_="prioritizeSeoTags",p_=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},m_=e=>{let t=p_(e,"title");const r=p_(e,d_);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,(()=>t));const n=p_(e,o_);return t||n||void 0},f_=e=>p_(e,u_)||(()=>{}),g_=(e,t)=>t.filter((t=>"undefined"!==typeof t[e])).map((t=>t[e])).reduce(((e,t)=>({...e,...t})),{}),__=(e,t)=>t.filter((e=>"undefined"!==typeof e.base)).map((e=>e.base)).reverse().reduce(((t,r)=>{if(!t.length){const n=Object.keys(r);for(let i=0;i<n.length;i+=1){const a=n[i].toLowerCase();if(-1!==e.indexOf(a)&&r[a])return t.concat(r)}}return t}),[]),y_=(e,t,r)=>{const n={};return r.filter((t=>{return!!Array.isArray(t[e])||("undefined"!==typeof t[e]&&(r=`Helmet: ${e} should be of type "Array". Instead found type "${typeof t[e]}"`,console&&"function"===typeof console.warn&&console.warn(r)),!1);var r})).map((t=>t[e])).reverse().reduce(((e,r)=>{const i={};r.filter((e=>{let r;const a=Object.keys(e);for(let n=0;n<a.length;n+=1){const i=a[n],s=i.toLowerCase();-1===t.indexOf(s)||"rel"===r&&"canonical"===e[r].toLowerCase()||"rel"===s&&"stylesheet"===e[s].toLowerCase()||(r=s),-1===t.indexOf(i)||"innerHTML"!==i&&"cssText"!==i&&"itemprop"!==i||(r=i)}if(!r||!e[r])return!1;const s=e[r].toLowerCase();return n[r]||(n[r]={}),i[r]||(i[r]={}),!n[r][s]&&(i[r][s]=!0,!0)})).reverse().forEach((t=>e.push(t)));const a=Object.keys(i);for(let t=0;t<a.length;t+=1){const e=a[t],r={...n[e],...i[e]};n[e]=r}return e}),[]).reverse()},v_=(e,t)=>{if(Array.isArray(e)&&e.length)for(let r=0;r<e.length;r+=1){if(e[r][t])return!0}return!1},x_=e=>Array.isArray(e)?e.join(""):e,b_=(e,t)=>Array.isArray(e)?e.reduce(((e,r)=>(((e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1})(r,t)?e.priority.push(r):e.default.push(r),e)),{priority:[],default:[]}):{default:e,priority:[]},w_=(e,t)=>({...e,[t]:void 0}),C_=["noscript","script","style"],S_=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},k_=e=>Object.keys(e).reduce(((t,r)=>{const n="undefined"!==typeof e[r]?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n}),""),j_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce(((t,r)=>(t[i_[r]||r]=e[r],t)),t)},E_=(t,r)=>r.map(((r,n)=>{const i={key:n,[s_]:!0};return Object.keys(r).forEach((e=>{const t=i_[e]||e;if("innerHTML"===t||"cssText"===t){const e=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:e}}else i[t]=r[e]})),e.createElement(t,i)})),T_=function(t,r){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(t){case"title":return{toComponent:()=>((t,r,n)=>{const i=j_(n,{key:r,[s_]:!0});return[e.createElement("title",i,r)]})(0,r.title,r.titleAttributes),toString:()=>((e,t,r,n)=>{const i=k_(r),a=x_(t);return i?`<${e} ${s_}="true" ${i}>${S_(a,n)}</${e}>`:`<${e} ${s_}="true">${S_(a,n)}</${e}>`})(t,r.title,r.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>j_(r),toString:()=>k_(r)};default:return{toComponent:()=>E_(t,r),toString:()=>function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.reduce(((t,n)=>{const i=n,a=Object.keys(i).filter((e=>!("innerHTML"===e||"cssText"===e))).reduce(((e,t)=>{const n="undefined"===typeof i[t]?t:`${t}="${S_(i[t],r)}"`;return e?`${e} ${n}`:n}),""),s=i.innerHTML||i.cssText||"",o=-1===C_.indexOf(e);return`${t}<${e} ${s_}="true" ${a}${o?"/>
2":`>${s}</${e}>`}`}),"")}(t,r,n)}}},P_=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:a,styleTags:s,title:o="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:u,metaTags:d,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:u,metaTags:d,scriptTags:h}=(e=>{let{metaTags:t,linkTags:r,scriptTags:n,encode:i}=e;const a=b_(t,r_),s=b_(r,e_),o=b_(n,t_);return{priorityMethods:{toComponent:()=>[...E_("meta",a.priority),...E_("link",s.priority),...E_("script",o.priority)],toString:()=>`${T_("meta",a.priority,i)} ${T_("link",s.priority,i)} ${T_("script",o.priority,i)}`},metaTags:a.default,linkTags:s.default,scriptTags:o.default}})(e)),{priority:p,base:T_("base",t,n),bodyAttributes:T_("bodyAttributes",r,n),htmlAttributes:T_("htmlAttributes",i,n),link:T_("link",u,n),meta:T_("meta",d,n),noscript:T_("noscript",a,n),script:T_("script",h,n),style:T_("style",s,n),title:T_("title",{title:o,titleAttributes:l},n)}},I_=[],M_=!("undefined"===typeof window||!window.document||!window.document.createElement),N_=class{instances=[];canUseDOM=(()=>M_)();context;value={setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?I_:this.instances,add:e=>{(this.canUseDOM?I_:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?I_:this.instances).indexOf(e);(this.canUseDOM?I_:this.instances).splice(t,1)}}};constructor(e,t){this.context=e,this.canUseDOM=t||!1,t||(e.helmet=P_({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},A_=e.createContext({}),L_=class t extends e.Component{static canUseDOM=(()=>M_)();helmetData;constructor(e){super(e),this.helmetData=new N_(this.props.context||{},t.canUseDOM)}render(){return e.createElement(A_.Provider,{value:this.helmetData.value},this.props.children)}},D_=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${s_}]`),i=[].slice.call(n),a=[];let s;return t&&t.length&&t.forEach((t=>{const r=document.createElement(e);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)r.innerHTML=t.innerHTML;else if("cssText"===e)r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText));else{const n=e,i="undefined"===typeof t[n]?"":t[n];r.setAttribute(e,i)}r.setAttribute(s_,"true"),i.some(((e,t)=>(s=t,r.isEqualNode(e))))?i.splice(s,1):a.push(r)})),i.forEach((e=>e.parentNode?.removeChild(e))),a.forEach((e=>r.appendChild(e))),{oldTags:i,newTags:a}},z_=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(s_),i=n?n.split(","):[],a=[...i],s=Object.keys(t);for(const o of s){const e=t[o]||"";r.getAttribute(o)!==e&&r.setAttribute(o,e),-1===i.indexOf(o)&&i.push(o);const n=a.indexOf(o);-1!==n&&a.splice(n,1)}for(let o=a.length-1;o>=0;o-=1)r.removeAttribute(a[o]);i.length===a.length?r.removeAttribute(s_):r.getAttribute(s_)!==s.join(",")&&r.setAttribute(s_,s.join(","))},O_=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:a,metaTags:s,noscriptTags:o,onChangeClientState:l,scriptTags:c,styleTags:u,title:d,titleAttributes:h}=e;z_("body",n),z_("html",i),((e,t)=>{"undefined"!==typeof e&&document.title!==e&&(document.title=x_(e)),z_("title",t)})(d,h);const p={baseTag:D_("base",r),linkTags:D_("link",a),metaTags:D_("meta",s),noscriptTags:D_("noscript",o),scriptTags:D_("script",c),styleTags:D_("style",u)},m={},f={};Object.keys(p).forEach((e=>{const{newTags:t,oldTags:r}=p[e];t.length&&(m[e]=t),r.length&&(f[e]=p[e].oldTags)})),t&&t(),l(e,m,f)},R_=null,F_=e=>{R_&&cancelAnimationFrame(R_),e.defer?R_=requestAnimationFrame((()=>{O_(e,(()=>{R_=null}))})):(O_(e),R_=null)},B_=class extends e.Component{rendered=!1;shouldComponentUpdate(e){return!Yg()(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:t}=this.props.context;let r=null;const n=(i=e.get().map((e=>{const t={...e.props};return delete t.context,t})),{baseTag:__(["href"],i),bodyAttributes:g_("bodyAttributes",i),defer:p_(i,l_),encode:p_(i,c_),htmlAttributes:g_("htmlAttributes",i),linkTags:y_("link",["rel","href"],i),metaTags:y_("meta",["name","charset","http-equiv","property","itemprop"],i),noscriptTags:y_("noscript",["innerHTML"],i),onChangeClientState:f_(i),scriptTags:y_("script",["src","innerHTML"],i),styleTags:y_("style",["cssText"],i),title:m_(i),titleAttributes:g_("titleAttributes",i),prioritizeSeoTags:v_(i,h_)});var i;L_.canUseDOM?F_(n):P_&&(r=P_(n)),t(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},V_=class extends e.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(e){return!Wg()(w_(this.props,"helmetData"),w_(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach((t=>{r={...r,[t]:e[t]}})),r}
2warnOnInvalidChildren(e,t){return Jg()(n_.some((t=>e.type===t)),"function"===typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${n_.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),Jg()(!t||"string"===typeof t||Array.isArray(t)&&!t.some((e=>"string"!==typeof e)),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,r){let n={};return e.Children.forEach(t,(e=>{if(!e||!e.props)return;const{children:t,...i}=e.props,a=Object.keys(i).reduce(((e,t)=>(e[a_[t]||t]=i[t],e)),{});let{type:s}=e;switch("symbol"===typeof s?s=s.toString():this.warnOnInvalidChildren(e,t),s){case"Symbol(react.fragment)":r=this.mapChildrenToProps(t,r);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(e,n,a,t);break;default:r=this.mapObjectTypeChildren(e,r,a,t)}})),this.mapArrayTypeChildrenToProps(n,r)}render(){const{children:t,...r}=this.props;let n={...r},{helmetData:i}=r;if(t&&(n=this.mapChildrenToProps(t,n)),i&&!(i instanceof N_)){i=new N_(i.context,!0),delete n.helmetData}return i?e.createElement(B_,{...n,context:i.value}):e.createElement(A_.Consumer,null,(t=>e.createElement(B_,{...n,context:t})))}};var $_=()=>{let t=window.location;const r=y((e=>e.location.location)),[n,i]=(0,e.useState)("Great American Cookies - Cookie Cake Delivery"),[a,s]=(0,e.useState)("Make it the sweetest Birthday with a fresh-baked Cookie Cake! Order today. Customize your celebration! Order a Create Your Own Cookie Cake today.");return(0,e.useEffect)((()=>{r&&(r.data&&r.data.attributes&&r.data.attributes.includes("MSC")?(i(`Ice Cream, Cakes & Desserts Near Me in ${r.address.city}, ${r.address.state} - Marble Slab Creamery | Pickup & Delivery`),s(`Looking for Ice Cream Scoops, Shakes, and Cakes? Browse all Marble Slab Creamery locations in ${r.address.city}, ${r.address.state}, to see all of our desserts!`)):r.data&&r.data.attributes&&r.data.attributes.findIndex((e=>e.includes("CNC")))>=0?(i(`Cookie Cakes, Ice Cream, and Cookies Near Me in ${r.address.city}, ${r.address.state} - Great American Cookies and Marble Slab Creamery | Pickup & Delivery`),s(`Looking for Cookie Cakes, Ice Cream, and Cookies? Browse all Great American Cookies and Marble Slab Creamery locations in ${r.address.city}, ${r.address.state}, to see all of our desserts!`)):(i(`Cookie Cakes, Cookies & Desserts Near Me in ${r.address.city}, ${r.address.state} - Great American Cookies | Pickup & Delivery`),s(`Looking for Cookie Cakes, Cookies and Double Doozies? Browse all Great American Cookies locations in ${r.address.city}, ${r.address.state}, to see all of our desserts!`)))}),[r]),(0,Dr.jsx)(L_,{children:(0,Dr.jsxs)(V_,{children:[(0,Dr.jsx)("title",{children:n}),(0,Dr.jsx)("meta",{name:"description",content:a}),(0,Dr.jsx)("link",{rel:"canonical",href:t})]})})};var U_=()=>{xt();const t=E(),r=Ir("currentLocation");return(0,e.useEffect)((()=>{const e=Ir("currentMenu");e&&t(Vi.setMenuItem(e.menu));const r=Nr("currentCart");r&&t(vs.addCart(r));const n=sessionStorage.getItem("token");n&&(async()=>{const e=await jr(n);e.message?t(Ha.logout()):t(Ha.setUser(e))})();const i=sessionStorage.getItem("olotoken");i&&(async()=>{const e=await jr(i,"oloauth");if(e.message)t(Ha.logout());else{const r={first_name:e.firstname?e.firstname:"",last_name:e.lastname?e.lastname:"",name:(e.firstname?e.firstname:"")+" "+(e.lastname?e.lastname:""),email:e.emailaddress,phone:e.phone?e.phone:""};t(Ha.setUser(r))}})();const a=JSON.parse(localStorage.getItem("carInfo"));a&&t(vs.setVehicleInfo({vehicleMake:a.vehicle_make,vehicleModel:a.vehicle_model,vehicleColor:a.vehicle_color}))}),[r]),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)($_,{}),(0,Dr.jsx)(Vg,{}),(0,Dr.jsx)($g,{}),(0,Dr.jsx)("main",{children:(0,Dr.jsx)(Ft,{})})]}),(0,Dr.jsx)(Zg,{}),(0,Dr.jsx)(ss,{})]})},H_="Error_error__eeh21";var q_=()=>(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(Vg,{}),(0,Dr.jsx)("main",{children:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("section",{className:H_,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Page Not Found"}),(0,Dr.jsx)("h3",{className:"text-center",children:"No cookies for you here :( !"})]})})}),(0,Dr.jsx)(ss,{})]}),Z_="ProductCard_title__fz8g5",G_="ProductCard_text_content__h56g7",W_="ProductCard_image_container__udjM7",X_="ProductCard_btn__0ofYQ",J_="ProductCard_cta_container__fS0D9";var K_=e=>{let{data:t}=e;return(0,Dr.jsxs)(er,{to:`../${t.name.toLowerCase().includes("create")?"create":"product"}/${t.id}`,children:[" ",(0,Dr.jsxs)(zr,{children:[(0,Dr.jsx)("div",{className:W_,children:t.image_small_url&&(0,Dr.jsx)("img",{src:t.image_small_url,className:"image-cover",alt:t.title})}),(0,Dr.jsxs)("div",{className:G_,children:[(0,Dr.jsx)("div",{className:Z_,children:t.name}),(0,Dr.jsx)("div",{className:J_,children:(0,Dr.jsx)("span",{className:`btn ${X_}`,children:"Order Now"})})]})]},t.id)]})},Y_={sub_cat_sub_cat:"SubCategories_sub_cat_sub_cat__5SHdh",sub_cat_sub_cat_item:"SubCategories_sub_cat_sub_cat_item__-cvfG",cat_active:"SubCategories_cat_active__pZV9Z",pagination:"SubCategories_pagination__tQVd0",pagination_view:"SubCategories_pagination_view__PTslk",pagination_controls:"SubCategories_pagination_controls__lU8Ks",control_next:"SubCategories_control_next__XqTvm",control_prev:"SubCategories_control_prev__E-bno",pagination_pages:"SubCategories_pagination_pages__toJ5T",page_active:"SubCategories_page_active__VFqiA",navigation_container:"SubCategories_navigation_container__USSBF",controls:"SubCategories_controls__dQDi4",button_left:"SubCategories_button_left__OeaEk",button_right:"SubCategories_button_right__DZMND"};var Q_=()=>(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"10",viewBox:"0 0 320 512",children:(0,Dr.jsx)("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})});var ey=()=>(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"10",viewBox:"0 0 320 512",children:(0,Dr.jsx)("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})});var ty=t=>{let{data:r,changeSubSubCategoryHandler:n,catIndex:i}=t;const a=(0,e.useRef)(null),s=(0,e.useRef)(null),[o,l]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{const e=a.current.offsetWidth,t=()=>{e>s.current.offsetWidth?l(!0):l(!1)};return window.addEventListener("resize",t,!0),window.addEventListener("load",t,!0),function(){window.removeEventListener("resize",t,!0),window.removeEventListener("load",t,!0)}}),[]),(0,Dr.jsxs)("div",{className:Y_.navigation_container,ref:s,children:[(0,Dr.jsx)("div",{className:Y_.sub_cat_sub_cat,ref:a,children:r.map(((e,t)=>(0,Dr.jsx)("button",{className:`${Y_.sub_cat_sub_cat_item} ${t===i?Y_.cat_active:null}`,onClick:e=>{((e,t)=>
2{a.current.scrollLeft+=e.target.getBoundingClientRect().left-60,n(t)})(e,t)},children:e.name},e.name+Math.random(10))))}),o&&(0,Dr.jsxs)("div",{className:Y_.controls,children:[(0,Dr.jsxs)("button",{onClick:()=>{a.current.scrollLeft-=300},className:Y_.button_left,children:[(0,Dr.jsx)(Q_,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"scroll left"})]}),(0,Dr.jsxs)("button",{onClick:()=>{a.current.scrollLeft+=300},className:Y_.button_right,children:[(0,Dr.jsx)(ey,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"scroll rightt"})]})]})]})};var ry=t=>{let{data:r}=t;const[n,i]=(0,e.useState)(0);let a=r[n].products.map((e=>(0,Dr.jsx)(K_,{data:e},e.id)));return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(ty,{data:r,changeSubSubCategoryHandler:e=>{i(e)},catIndex:n}),(0,Dr.jsx)("div",{className:Y_.sub_cat_sub_cat_items,children:(0,Dr.jsx)("div",{className:"grid-3",children:a})})]})},ny={section:"Category_section__PytV7",description:"Category_description__4Ivrq",products_container:"Category_products_container__kXBFl",categories_controller_container:"Category_categories_controller_container__yL5Ta",categories_controller_container_fixed:"Category_categories_controller_container_fixed__rAPxY",sticky_menu:"Category_sticky_menu__lZhvf",categories_controller:"Category_categories_controller__sGVvx",items_container:"Category_items_container__+mvgC",sub_categories_item:"Category_sub_categories_item__w3Hst",icon:"Category_icon__BFfgd",sub_title:"Category_sub_title__Mqk7X",sub_description:"Category_sub_description__LsVo+",navigation_container:"Category_navigation_container__gJ9sM",controls:"Category_controls__Swxjc",button_left:"Category_button_left__Ho0mI",button_right:"Category_button_right__W7WPd"},iy={categories_controller_item:"SubCategoriesController_categories_controller_item__dP-zd",icon:"SubCategoriesController_icon__ootOq",active:"SubCategoriesController_active__5Yci8",name:"SubCategoriesController_name__eRFkU"};var ay=t=>{let{data:r,scrollTo:n,activeId:i}=t,a=yt();return(0,e.useEffect)((()=>{a.state&&a.state.toHolidays&&a.state.toHolidays===r.name&&n(`item-${r.id}`)}),[a]),(0,Dr.jsxs)("button",{className:[iy.categories_controller_item,`item-${r.id}`===i?iy.active:""].join(" "),onClick:(e=>{n(e)}).bind(null,`item-${r.id}`),children:[r.image&&(0,Dr.jsx)("div",{className:iy.icon,children:(0,Dr.jsx)("img",{src:r.image,alt:"icon"})}),(0,Dr.jsx)("div",{className:iy.name,children:"Create Your Own Cookie Cake"===r.name?"Create Your Own":r.name})]},r.id)};var sy=t=>{let{item:r,handleClickScroll:n,activeID:i,flag:a}=t;wt();const s=(0,e.useRef)(null),o=(0,e.useRef)(null),[l,c]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{const e=s.current.getElementsByTagName("button");let t=-20;Array.from(e).forEach((e=>{t+=e.offsetWidth+20}));const r=()=>{t>o.current.offsetWidth?c(!0):c(!1)};return r(),window.addEventListener("resize",r,!0),function(){window.removeEventListener("resize",r,!0)}}),[a]),(0,Dr.jsxs)("div",{ref:o,className:ny.navigation_container,children:[(0,Dr.jsx)("div",{className:`${ny.categories_controller} categories_controller`,ref:s,children:r.sub_categories.filter((e=>e.products&&e.products.length>0||e.sub_categories&&e.sub_categories.length>0)).map((e=>(0,Dr.jsx)(ay,{data:e,scrollTo:n,activeId:i},e.id)))}),l&&(0,Dr.jsxs)("div",{className:ny.controls,children:[(0,Dr.jsxs)("button",{onClick:()=>{s.current.scrollLeft-=300},className:ny.button_left,children:[(0,Dr.jsx)(Q_,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"scroll left"})]}),(0,Dr.jsxs)("button",{onClick:()=>{s.current.scrollLeft+=300},className:ny.button_right,children:[(0,Dr.jsx)(ey,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"scroll rightt"})]})]})]})};var oy=t=>{let{item:r}=t;const n=(0,e.useRef)(null),i=(0,e.useRef)(null),[a,s]=(0,e.useState)(""),[o,l]=(0,e.useState)(!1),c=e=>{const t=n.current;void 0!=t&&null!=t&&(t.getBoundingClientRect().bottom<180?l(!0):l(!1))},u=()=>{document.querySelectorAll(".sub_categories_item").forEach((e=>{e.classList.remove("active"),e.getBoundingClientRect().top<351&&(e.classList.add("active"),s(e.id))}))},d=e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};return(0,e.useEffect)((()=>(window.addEventListener("scroll",c),window.addEventListener("scroll",u),()=>{window.removeEventListener("scroll",c),window.removeEventListener("scroll",u)})),[]),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:`${ny.categories_controller_container} categories_controller_container`,ref:n,children:(0,Dr.jsx)(sy,{item:r,handleClickScroll:d,activeID:a,flag:o})}
2),(0,Dr.jsx)(cc,{in:o,nodeRef:i,timeout:500,classNames:"fixed-bar",unmountOnExit:!0,children:(0,Dr.jsx)("div",{className:`${ny.categories_controller_container} ${ny.categories_controller_container_fixed} categories_controller_container_fixed`,ref:i,children:(0,Dr.jsx)(sy,{item:r,handleClickScroll:d,activeID:a,flag:o})})})]})},ly="CategoriesHeader_categories_header_container__45hNq",cy="CategoriesHeader_categories_header_inner__HRm5P",uy="CategoriesHeader_categories_header_inner_left__y7dmQ",dy="CategoriesHeader_categories_header_fixed__uvUpU",hy="CategoriesHeader_item__joEuA",py="CategoriesHeader_image_container__bnU5R",my="CategoriesHeader_title__Vzqrw",fy="CategoriesHeader_active__6rC2g",gy="CategoriesHeader_categories_header__xtWRq",_y="CategoriesHeader_navigation_container__Ft+i9",yy="CategoriesHeader_controls__qEKNj",vy="CategoriesHeader_button_left__Mok4R",xy="CategoriesHeader_button_right__1nmUr";var by=t=>{let{menu:r,flag:n}=t;const i=wt(),a=(0,e.useRef)(null),s=(0,e.useRef)(null),[o,l]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{const e=a.current.getElementsByTagName("a");let t=-20;Array.from(e).forEach((e=>{t+=e.offsetWidth+20}));const r=()=>{t>s.current.offsetWidth?l(!0):l(!1)};return r(),window.addEventListener("resize",r,!0),function(){window.removeEventListener("resize",r,!0)}}),[n]),(0,Dr.jsxs)("div",{ref:s,className:_y,children:[(0,Dr.jsx)("div",{className:`${cy} ${o?uy:""}`,ref:a,children:r&&r.categories.filter((e=>e.products&&e.products.length>0||e.sub_categories&&e.sub_categories.length>0)).map((e=>(0,Dr.jsxs)(er,{to:`../${e.slug}`,className:`${hy} ${e.slug===i.categoryId?fy:""} categories_header_item`,children:[(0,Dr.jsxs)("div",{className:`sticky-image ${py}`,children:[e.image_secondary&&(0,Dr.jsx)("img",{src:e.image_secondary,alt:e.title}),!e.image_secondary&&(0,Dr.jsx)("img",{src:e.image,alt:e.title})]}),(0,Dr.jsx)("div",{className:my,children:e.name})]},e.id)))}),o&&(0,Dr.jsxs)("div",{className:yy,children:[(0,Dr.jsxs)("button",{onClick:()=>{a.current.scrollLeft-=300},className:vy,children:[(0,Dr.jsx)(Q_,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"scroll left"})]}),(0,Dr.jsxs)("button",{onClick:()=>{a.current.scrollLeft+=300},className:xy,children:[(0,Dr.jsx)(ey,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"scroll rightt"})]})]})]})};var wy=()=>{const t=_s(),r=(wt(),(0,e.useRef)(null)),n=(0,e.useRef)(null),[i,a]=(0,e.useState)(!1),s=e=>{const t=n.current;window.scrollY>t.getBoundingClientRect().bottom?a(!0):a(!1)};return(0,e.useEffect)((()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)})),[]),(0,Dr.jsx)(Dr.Fragment,{children:t&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:gy,ref:n,children:(0,Dr.jsx)("div",{className:`${ly} categories-header-container`,children:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsx)(by,{menu:t,flag:i})})})}),(0,Dr.jsx)(cc,{in:i,nodeRef:r,timeout:500,classNames:"fixed-bar",unmountOnExit:!0,children:(0,Dr.jsx)("div",{className:`categories_header_fixed ${dy}`,ref:r,children:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsx)(by,{menu:t,flag:i})})})})]})})};var Cy=()=>{var t;const r=wt(),n=null===(t=_s().categories)||void 0===t?void 0:t.find((e=>e.slug==r.categoryId));return(0,e.useEffect)((()=>{if(n){let e=[];n.products&&n.products.forEach((t=>{e.push({item_id:t.id,item_name:t.name,price:t.cost,quantity:1,item_list_id:n.id,item_list_name:n.name})})),n.sub_categories&&n.sub_categories.forEach((t=>{t.products&&t.products.forEach((r=>{e.push({item_id:r.id,item_name:r.name,price:r.cost,quantity:1,item_category:t.name,item_list_id:n.id,item_list_name:n.name})}))})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"view_item_list",ecommerce:{item_list_id:n.id,item_list_name:n.name,items:e}})}}),[]),(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(wy,{}),n&&(0,Dr.jsx)("div",{className:ny.section,children:(0,Dr.jsxs)("div",{className:"container-full",children:[(0,Dr.jsx)("h1",{children:n.name}),n.products&&(0,Dr.jsx)("div",{className:"grid-3",children:n.products.map((e=>(0,Dr.jsx)(K_,{data:e},e.id)))}),n.sub_categories&&n.sub_categories.length>0&&(0,Dr.jsxs)("div",{children:[n.sub_categories.length>3&&(0,Dr.jsx)(oy,{item:n}),n.sub_categories.filter((e=>e.products&&e.products.length>0||e.sub_categories&&e.sub_categories.length>0)).map(((e,t)=>(0,Dr.jsxs)("div",{className:`${ny.sub_categories_item} sub_categories_item`,id:`item-${e.id}`,children:[(0,Dr.jsxs)("h3",{className:ny.sub_title,children:[e.image&&(0,Dr.jsx)("span",{className:ny.icon,children:(0,Dr.jsx)("img",{src:e.image,alt:"icon"})}),e.name]}),(0,Dr.jsx)("div",{className:ny.sub_description,children:e.description}),e.sub_categories&&e.sub_categories.length>0&&(0,Dr.jsx)("div",{className:ny.sub_cat_sub_cat,children:(0,Dr.jsx)(ry,{data:e.sub_categories})}),e.products&&e.products.length>0&&(0,Dr.jsx)("div",{className:ny.sub_cat_sub_cat,children:(0,Dr.jsx)("div",{className:[ny.items_container,"grid-3"].join(" "),children:e.products.map((e=>(0,Dr.jsx)(K_,{data:e},e.id)))})})]},e.id)))]})]})})]})};var Sy=()=>{const t=Dt(),r=wt(),n=xt(),i=yt();let a=y((e=>e.location.location));return(0,e.useEffect)((()=>{i&&i.pathname&&i.pathname.includes("/menu")&&n(`/gac/${a.location_slug}/${r.categoryId}`)}
2),[i]),(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(Cy,{})})})})},ky="ProductDetails_product_details_container__u9uR4",jy="ProductDetails_back_to_menu_container__J94ud",Ey="ProductDetails_background__WLuYp",Ty="ProductDetails_error__c7Vkw",Py="PresentationBox_presentation_box__qM9uB",Iy="PresentationBox_page_title__qqD-a",My="PresentationBox_description__0-+tS",Ny="PresentationBox_composite_image__R9027",Ay="PresentationBox_composite_image_inner__hxmh4";var Ly=()=>{var e;const t=null===(e=Ir("foundProduct"))||void 0===e?void 0:e.product;return(0,Dr.jsx)("div",{className:Py,children:t&&(0,Dr.jsxs)(Dr.Fragment,{children:[t.name&&""!==t.name&&(0,Dr.jsx)("h1",{className:Iy,children:t.name}),t.description&&""!==t.description&&(0,Dr.jsx)("div",{className:My,children:t.description}),t.image_large_url&&(0,Dr.jsx)("div",{className:Ny,children:(0,Dr.jsx)("div",{className:Ay,children:(0,Dr.jsx)("img",{src:t.image_large_url,alt:t.name})})})]})})},Dy="ProductOptions_product_container__+d-n0",zy="ModifierTitle_options_item_header__whM2L",Oy="ModifierTitle_options_item_header_text__5CFQP",Ry="ModifierTitle_options_item_header_helper__Yr3MO";var Fy=[{title:"Choose Cookie Cake Border Color:",mobile:"Border Color:"},{title:"Choose Message Base Color:",mobile:"Message Base Color:"},{title:"Choose Message Top Color:",mobile:"Message Top Color:"},{title:"Choose Cookie Cake Batter:",mobile:"Cookie Cake Batter:"},{title:"Choose Cookie Cake Flavor:",mobile:"Cookie Cake Flavor:"}];var By=t=>{let{text:r}=t;const[n,i]=(0,e.useState)(!1),[a,s]=(0,e.useState)(""),o=ps("md");return(0,e.useEffect)((()=>{Fy.forEach((e=>{e.title===r&&(i(!0),s(e.mobile))}))})),(0,Dr.jsxs)(Dr.Fragment,{children:[o&&r,!o&&(0,Dr.jsxs)(Dr.Fragment,{children:[n&&a,!n&&r]})]})};var Vy=e=>{let{modifier:t,changeTitle:r}=e;return(0,Dr.jsx)("div",{className:`${zy}`,children:(0,Dr.jsx)("div",{className:Oy,children:(0,Dr.jsxs)("h3",{children:[(0,Dr.jsx)(By,{text:r?"What name do you want on your cookie cake?":t.description}),t.maxselects&&!t.maxaggregatequantity&&(0,Dr.jsxs)("span",{className:Ry,children:[" Select up to ",t.maxselects]}),t.maxselects&&t.maxaggregatequantity&&(0,Dr.jsxs)("span",{className:Ry,children:[" Select a total of ",t.maxselects]})]})})})},$y="Option_option_container__7MgOi",Uy="Option_option__T6-Pg",Hy="Option_active__5PxiR",qy="Option_image_container__Uq8O+",Zy="Option_image_container_inner__5bsKr",Gy="Option_option_price__rOOwn",Wy="Option_increment_decrement_container__LX-9a",Xy="Option_item_count__wqb1z",Jy="Option_check_mark__tLN1r",Ky="Option_option_title__PRaqu",Yy="Option_option_simple__T4-hc",Qy="Option_option_aggregate__7PukW",ev="Option_tooltip_container__iGGoO",tv="Option_tooltip_button__9nvPW",rv="Option_tooltip_modal__48LbU",nv="Option_tooltip_modal_inner__yeN+z",iv="Option_tail_icon__YSqU7";var av=()=>(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})});var sv=()=>(0,Dr.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsx)("path",{d:"M8.99555 18C8.15917 18 7.37617 17.6172 6.86901 16.9763C6.10381 17.2789 5.23183 17.2255 4.50222 16.7982C3.77261 16.3709 3.29214 15.6499 3.16757 14.8398C2.35788 14.7151 1.62827 14.2255 1.21008 13.4955C0.791893 12.7656 0.738507 11.9021 1.03213 11.1365C0.391498 10.6291 0 9.8457 0 9C0 8.1543 0.391498 7.37092 1.03213 6.8635C0.738507 6.10683 0.791893 5.23442 1.21008 4.50445C1.62827 3.77448 2.34899 3.28487 3.16757 3.16914C3.28324 2.35905 3.77261 1.62908 4.50222 1.21068C5.24073 0.792285 6.10381 0.738872 6.86901 1.03264C7.38507 0.391691 8.15917 0 9.00445 0C9.84973 0 10.6327 0.391691 11.1488 1.03264C11.914 0.738872 12.7771 0.792285 13.5067 1.20178C14.2363 1.62908 14.7168 2.35015 14.8502 3.16914C15.6599 3.28487 16.3806 3.76558 16.8077 4.50445C17.2348 5.23442 17.2882 6.10683 16.9857 6.8635C17.6263 7.37092 18.0178 8.1543 18.0178 9C18.0178 9.8457 17.6263 10.6291 16.9857 11.1365C17.2793 11.9021 17.2259 12.7656 16.8077 13.5045C16.3895 14.2344 15.6599 14.7151 14.8502 14.8398C14.7257 15.6499 14.2452 16.3798 13.5156 16.7982C12.786 17.2255 11.9229 17.2789 11.1577 16.9763C10.6416 17.6172 9.85863 18 9.02224 18H8.99555ZM7.10035 15.4184C7.15373 15.4184 7.21602 15.4184 7.2694 15.4362C7.46515 15.4896 7.62531 15.6231 7.71429 15.8101C7.93673 16.3264 8.4439 16.6558 8.99555 16.6558C9.54721 16.6558 10.0633 16.3264 10.2857 15.8101C10.3658 15.6231 10.5349 15.4807 10.7306 15.4362C10.9263 15.3828 11.1399 15.4273 11.3 15.5519C11.7449 15.8902 12.3411 15.9258 12.8216 15.641C13.3109 15.3561 13.5779 14.822 13.5156 14.2611C13.4889 14.0564 13.5601 13.8605 13.7024 13.7181C13.8448 13.5757 14.0494 13.5045 14.2452 13.5312C14.8057 13.5935 15.3396 13.3175 15.6243 12.8368C15.909 12.3472 15.8735 11.750
27 15.5353 11.3056C15.4108 11.1454 15.3752 10.9318 15.4286 10.727C15.482 10.5312 15.6243 10.362 15.8112 10.2819C16.3272 10.0593 16.6565 9.56083 16.6565 9C16.6565 8.43917 16.3272 7.93175 15.8112 7.7181C15.6243 7.63798 15.482 7.47775 15.4286 7.273C15.3752 7.06825 15.4197 6.8635 15.5353 6.69436C15.8735 6.24926 15.909 5.64392 15.6243 5.16321C15.3485 4.67359 14.7968 4.40653 14.2541 4.47775C14.0494 4.50445 13.8448 4.43323 13.7024 4.2908C13.5601 4.14837 13.4889 3.94362 13.5067 3.73887C13.569 3.17804 13.2931 2.63502 12.8127 2.35015C12.3322 2.07418 11.736 2.10979 11.2823 2.43917C11.1221 2.5638 10.9086 2.59941 10.7128 2.54599C10.5171 2.49258 10.3569 2.35905 10.2768 2.17211C10.0544 1.65579 9.54721 1.32641 8.98665 1.32641C8.4261 1.32641 7.92783 1.65579 7.70539 2.17211C7.62531 2.35905 7.46515 2.49258 7.2694 2.54599C7.07365 2.59941 6.86011 2.5549 6.69995 2.43917C6.24617 2.10979 5.64113 2.07418 5.15175 2.35015C4.67128 2.62611 4.40435 3.16914 4.47553 3.72997C4.50222 3.93472 4.43104 4.13947 4.28868 4.2819C4.14632 4.42433 3.94167 4.49555 3.73702 4.46884C3.18537 4.39763 2.64261 4.66469 2.36678 5.1543C2.08206 5.64392 2.11765 6.24926 2.45576 6.69436C2.58033 6.8635 2.61592 7.06825 2.56253 7.273C2.50915 7.47775 2.36678 7.63798 2.17993 7.7181C1.66387 7.93175 1.33465 8.43917 1.33465 9C1.33465 9.56083 1.66387 10.0593 2.17993 10.2819C2.36678 10.362 2.50915 10.5223 2.56253 10.727C2.61592 10.9228 2.57143 11.1365 2.45576 11.3056C2.11765 11.7507 2.08206 12.3561 2.36678 12.8368C2.64261 13.3264 3.18537 13.5935 3.74592 13.5312C3.94167 13.5045 4.15522 13.5757 4.29758 13.727C4.43994 13.8694 4.51112 14.0742 4.48443 14.2789C4.41325 14.8309 4.68908 15.365 5.16955 15.6499C5.65892 15.9347 6.25507 15.8991 6.70885 15.5608C6.82452 15.4718 6.96688 15.4273 7.10924 15.4273L7.10035 15.4184Z",fill:"#8D0E57"}),(0,Dr.jsx)("path",{d:"M9.12011 13.7093C8.75531 13.7093 8.45279 13.4066 8.45279 13.0416V9.46299L8.16806 9.67664C7.87444 9.89919 7.45625 9.83687 7.23381 9.54311C7.01136 9.24934 7.07365 8.83094 7.36727 8.60839L8.71972 7.59355C8.92436 7.44221 9.19129 7.41551 9.42263 7.53124C9.64508 7.64696 9.79634 7.87842 9.79634 8.12767V13.0416C9.79634 13.4066 9.49382 13.7093 9.12901 13.7093H9.12011Z",fill:"#8D0E57"}),(0,Dr.jsx)("path",{d:"M8.94207 6.4898C9.59073 6.4898 10.1166 5.9637 10.1166 5.31472C10.1166 4.66575 9.59073 4.13965 8.94207 4.13965C8.29342 4.13965 7.76758 4.66575 7.76758 5.31472C7.76758 5.9637 8.29342 6.4898 8.94207 6.4898Z",fill:"#8D0E57"})]});var ov=()=>(0,Dr.jsxs)("svg",{width:"29",height:"9",viewBox:"0 0 29 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsx)("path",{d:"M13.0858 7.08579L10.249 4.24903C8.86542 2.86542 8.17361 2.17361 7.36628 1.67888C6.6505 1.24025 5.87015 0.917015 5.05386 0.721041C4.13316 0.5 3.15479 0.5 1.19807 0.5H27.8019C25.8452 0.5 24.8668 0.5 23.9461 0.721041C23.1299 0.917015 22.3495 1.24025 21.6337 1.67888C20.8264 2.17361 20.1346 2.86542 18.751 4.24903L15.9142 7.08579C15.1332 7.86684 13.8668 7.86683 13.0858 7.08579Z",fill:"white"}),(0,Dr.jsx)("path",{d:"M27.8019 1.5C25.7976 1.5 24.9584 1.50643 24.1796 1.69341C23.4653 1.86489 22.7825 2.14772 22.1562 2.53152C21.4733 2.95003 20.8753 3.53887 19.4581 4.95614L16.6213 7.7929C15.4497 8.96447 13.5503 8.96446 12.3787 7.79289L9.54193 4.95614C8.12466 3.53887 7.52672 2.95003 6.84378 2.53152C6.21748 2.14772 5.53466 1.86489 4.82041 1.69341C4.04157 1.50643 3.20239 1.5 1.19807 1.5H0.5V0.5H1.19807C3.15479 0.5 4.13315 0.5 5.05386 0.721041C5.87015 0.917014 6.6505 1.24025 7.36628 1.67888C8.17361 2.17361 8.86542 2.86542 10.249 4.24903L13.0858 7.08579C13.8668 7.86683 15.1332 7.86684 15.9142 7.08579L18.751 4.24903C20.1346 2.86542 20.8264 2.17361 21.6337 1.67888C22.3495 1.24025 23.1299 0.917014 23.9461 0.721041C24.8668 0.5 25.8452 0.5 27.8019 0.5H28.5V1.5H27.8019Z",fill:"#8D0E57"})]});var lv=t=>{let{data:r}=t;const[n,i]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{n&&setTimeout((()=>{i(!1)}),4e3)}),[n]),(0,Dr.jsxs)("div",{className:ev,children:[n&&(0,Dr.jsxs)("div",{className:rv,children:[(0,Dr.jsx)("div",{className:nv,children:(0,Dr.jsx)("p",{children:r.value})}),(0,Dr.jsx)("div",{className:iv,children:(0,Dr.jsx)(ov,{})})]}),(0,Dr.jsxs)("button",{className:tv,onClick:()=>{i((e=>!e))},children:[(0,Dr.jsx)(sv,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"open tooltip"})]})]})};var cv=e=>{let{option:t,setOption:r,limitReached:n,choiceStyle:i}=e,a=null;return t.cost>0&&(a=t.cost),(0,Dr.jsxs)("div",{className:$y,children:[(0,Dr.jsxs)("button",{onClick:r.bind(void 0,t.id),className:`${Uy} ${t.itemSelected?Hy:""} ${i?"":Yy}`,disabled:!(!n||t.itemSelected),children:[(0,Dr.jsxs)("div",{className:qy,children:[(0,Dr.jsxs)("div",{className:Zy,children:[t.image&&(0,Dr.jsx)("img",{src:t.image,alt:t.name}),!t.image&&(0,Dr.jsx)("img",{src:Ac,alt:t.name})]}),(0,Dr.jsx)("div",{className:Jy,children:(0,Dr.jsx)(av,{})})]}),!i&&(0,Dr.jsx)("div",{className:Jy,children:(0,Dr.jsx)(av,{})}),(0,Dr.jsxs)("div",{className:Ky,children:[t.name,a&&(0,Dr.jsxs)("div",{className:Gy,children:["$",ia(t.cost)]})]})]}),t.metadata&&t.metadata.filter((e=>"Tooltip"===e.key)).map((e=>(0,Dr.jsx)(lv,{data:e},e.key)))]})},uv="Options_options_container__lwsms";const dv=(e,t)=>{t||(e[0]={...e[0],itemSelected:!0}
2),e[0].modifiers&&e[0].modifiers.forEach((e=>{e.mandatory?dv(e.options):dv(e.options,!0)}))},hv=e=>{e.forEach((e=>{e.options&&e.options.forEach((e=>{e.itemSelected||e.modifiers&&(e.modifiers.forEach((e=>{e.options.forEach((e=>{e.itemSelected=!1}))})),hv(e.modifiers))}))}))};function pv(e,t,r){let n=e.findIndex((e=>e.id===t));return hv(e),e.forEach((e=>e.itemSelected=!1)),n>=0?e[n].options.forEach((e=>{e.id===r?(e.itemSelected=!0,e.modifiers&&e.modifiers.forEach((e=>{e.mandatory?dv(e.options):dv(e.options,!0)}))):e.itemSelected=!1})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&pv(e.modifiers,t,r)}))})),e}function mv(e,t,r){let n=e.findIndex((e=>e.id===t));return hv(e),e.forEach((e=>e.itemSelected=!1)),n>=0?e[n].options.forEach((e=>{e.id===r&&(!1===e.itemSelected?(e.itemSelected=!0,e.modifiers&&e.modifiers.forEach((e=>{dv(e.options)}))):(e.itemSelected=!1,e.modifiers&&e.modifiers.forEach((e=>{var t;(t=e.options)[0]={...t[0],itemSelected:!1},t[0].modifiers&&t[0].modifiers.forEach((e=>{e.mandatory&&dv(e.options)}))}))))})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&mv(e.modifiers,t,r)}))})),e}var fv=t=>{let{options:r,parentModifier:n}=t;const i=E(),a=y((e=>e.productDetails.data)),[s,o]=(0,e.useState)(!1),l=e=>{let t=JSON.parse(JSON.stringify(a));if(n.mandatory||"Add a soda?"===n.description||"Add a beverage?"===n.description){const r=pv(t,n.id,e);i(zc.createProduct(r))}else{console.log("id:::: ",e);const r=mv(t,n.id,e);i(zc.createProduct(r))}};return(0,e.useEffect)((()=>{if(n.maxselects){r.filter((e=>e.itemSelected)).length>=n.maxselects?o(!0):o(!1)}}),[r]),(0,Dr.jsxs)(Dr.Fragment,{children:[r&&(0,Dr.jsx)("div",{className:`${uv} ${n.use_images?"grid-5":"grid-4"}`,children:r.map((e=>(0,Dr.jsx)(cv,{option:e,setOption:l,limitReached:s,choiceStyle:n.use_images},e.id)))}),r.filter((e=>e.itemSelected)).map((e=>(0,Dr.jsx)("div",{children:e.modifiers&&e.modifiers.length>0&&(0,Dr.jsx)(Ev,{modifiers:e.modifiers})},e.id)))]})};var gv=t=>{let{option:r,setOption:n,selecteditemsIncrement:i,selectedNumbersDecrement:a,totalSectable:s,limitReached:o}=t;const[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)(0),h=y((e=>e.productDetails.edit)),p=y((e=>e.productDetails.pageReload));return(0,e.useEffect)((()=>{if(h){const e=h.choices.filter((e=>e.optionid===r.id));e.length>0&&(c(!0),d(e[0].quantity))}}),[p]),(0,Dr.jsxs)("div",{className:Qy,children:[(0,Dr.jsxs)("button",{onClick:e=>{n(r.id,"increment"),c(!0),d((e=>e+1))},className:`${Uy} ${r.itemSelected?Hy:""}`,disabled:!(!o&&!l),children:[(0,Dr.jsxs)("div",{className:qy,children:[(0,Dr.jsxs)("div",{className:Zy,children:[r.image&&(0,Dr.jsx)("img",{src:r.image,alt:r.name}),!r.image&&(0,Dr.jsx)("img",{src:Ac,alt:r.name})]}),(0,Dr.jsx)("div",{className:Jy,children:(0,Dr.jsx)(av,{})})]}),(0,Dr.jsx)("div",{className:Ky,children:r.name})]}),r.metadata&&r.metadata.filter((e=>"Tooltip"===e.key)).map((e=>(0,Dr.jsx)(lv,{data:e},e.key))),l&&(0,Dr.jsxs)("div",{className:Wy,children:[(0,Dr.jsxs)("button",{onClick:e=>{u>0&&(d((e=>e-1)),a(r.id)),1===u&&(c(!1),n(r.id,"decrement"))},children:[(0,Dr.jsx)("svg",{viewBox:"0 0 12 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M11.8125 0.75C11.8125 0.996094 11.5938 1.1875 11.375 1.1875H0.875C0.628906 1.1875 0.4375 0.996094 0.4375 0.777344C0.4375 0.53125 0.628906 0.3125 0.875 0.3125H11.375C11.5938 0.3125 11.8125 0.53125 11.8125 0.75Z",fill:"#242C37"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"remove one item"})]}),(0,Dr.jsx)("div",{className:Xy,children:u}),(0,Dr.jsxs)("button",{onClick:e=>{s>0&&(d((e=>e+1)),i(r.id))},children:[(0,Dr.jsx)("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M11.8125 5.75C11.8125 5.99609 11.5938 6.1875 11.375 6.1875H6.5625V11C6.5625 11.2461 6.34375 11.4648 6.125 11.4648C5.87891 11.4648 5.6875 11.2461 5.6875 11V6.1875H0.875C0.628906 6.1875 0.4375 5.99609 0.4375 5.77734C0.4375 5.53125 0.628906 5.3125 0.875 5.3125H5.6875V0.5C5.6875 0.28125 5.87891 0.0898438 6.125 0.0898438C6.34375 0.0898438 6.5625 0.28125 6.5625 0.5V5.3125H11.375C11.5938 5.3125 11.8125 5.53125 11.8125 5.75Z",fill:"#242C37"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"add one item"})]})]})]})};const _v=(e,t)=>
2{t||(e[0]={...e[0],itemSelected:!0}),e[0].modifiers&&e[0].modifiers.forEach((e=>{e.mandatory?_v(e.options):_v(e.options,!0)}))},yv=e=>{e.forEach((e=>{e.options&&e.options.forEach((e=>{e.itemSelected||e.modifiers&&(e.modifiers.forEach((e=>{e.options.forEach((e=>{e.itemSelected=!1,e.selectedQuantity=0}))})),yv(e.modifiers))}))}))};function vv(e,t,r){let n=e.findIndex((e=>e.id===t));return yv(e),e.forEach((e=>e.itemSelected=!1)),n>=0?e[n].options.forEach((e=>{e.id===r?(e.itemSelected=!0,e.modifiers&&e.modifiers.forEach((e=>{e.mandatory?_v(e.options):_v(e.options,!0)}))):e.itemSelected=!1})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&vv(e.modifiers,t,r)}))})),e}function xv(e,t,r){let n=e.findIndex((e=>e.id===t));return yv(e),n>=0?e[n].options.forEach((t=>{t.id===r&&(t.itemSelected?(t.itemSelected=!1,t.selectedQuantity=0,t.modifiers&&t.modifiers.forEach((t=>{var r;(r=e)[0]={...r[0],itemSelected:!1},r[0].modifiers&&r[0].modifiers.forEach((e=>{e.mandatory&&_v(e.options)}))}))):(t.itemSelected=!0,t.modifiers&&t.modifiers.forEach((e=>{e.mandatory?_v(e.options):_v(e.options,!0)}))))}
2)):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&xv(e.modifiers,t,r)}))})),e}function bv(e,t,r){let n=e.findIndex((e=>e.id===t));return n>=0?e[n].options.forEach((e=>{e.id===r&&(e.selectedQuantity=(e.selectedQuantity?e.selectedQuantity:0)+1)})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&bv(e.modifiers,t,r)}))})),e}function wv(e,t,r){let n=e.findIndex((e=>e.id===t));return n>=0?e[n].options.forEach((e=>{e.id===r&&(e.selectedQuantity?e.selectedQuantity=e.selectedQuantity-1:e.selectedQuantity=0)})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&wv(e.modifiers,t,r)}))})),e}var Cv=t=>{let{options:r,parentModifier:n}=t;const i=E(),a=y((e=>e.productDetails.data)),[s,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(0),u=y((e=>e.productDetails.edit)),d=y((e=>e.productDetails.pageReload)),h=e=>{let t=JSON.parse(JSON.stringify(a));c((e=>e+1));const r=bv(t,n.id,e);i(zc.createProduct(r))},p=e=>{let t=JSON.parse(JSON.stringify(a));c((e=>e-1));const r=wv(t,n.id,e);i(zc.createProduct(r))},m=(e,t,r)=>{console.log("edit? ",e," ",r);let s=JSON.parse(JSON.stringify(a));if(n.mandatory){const a=vv(s,n.id,e);if("increment"===t){c(r?e=>e+r:e=>e+1);const t=bv(a,n.id,e);i(zc.createProduct(t))}else if("decrement"===t){c((e=>e-1));const t=wv(s,n.id,e);i(zc.createProduct(t))}}else{const a=xv(s,n.id,e);if("increment"===t){c(r?e=>e+r:e=>e+1);const t=bv(a,n.id,e);i(zc.createProduct(t))}else if("decrement"===t){const t=wv(s,n.id,e);i(zc.createProduct(t))}}};(0,e.useEffect)((()=>{if(n.maxselects){r.filter((e=>e.itemSelected)).length>=n.maxselects?o(!0):o(!1)}}),[r]),(0,e.useEffect)((()=>{n.maxaggregatequantity-l>0?o(!1):o(!0)}),[n.maxaggregatequantity,l]),(0,e.useEffect)((()=>{if(u){let e=[];
2if(r.forEach((t=>{u.choices.find((e=>e.optionid===t.id))&&e.push(u.choices.find((e=>e.optionid===t.id)))})),e.length>0){let t=0;e.forEach((e=>{t+=e.quantity})),c(t)}}}),[d]);const f=n.maxaggregatequantity-l>0?n.maxaggregatequantity-l:0;return(0,Dr.jsxs)(Dr.Fragment,{children:[r&&(0,Dr.jsx)("div",{className:`${uv} grid-5`,children:r.map((e=>(0,Dr.jsx)(gv,{option:e,setOption:m,selecteditemsIncrement:h,selectedNumbersDecrement:p,totalSectable:f,limitReached:s},e.id)))}),r.filter((e=>e.itemSelected)).map((e=>(0,Dr.jsx)("div",{children:e.modifiers&&e.modifiers.length>0&&(0,Dr.jsx)(Ev,{modifiers:e.modifiers})},e.id)))]})},Sv={modifiers_container:"ProductModifiers_modifiers_container__g59w2"};function kv(t){let{product:r,modifier:n,hideModifier:i}=t;return(0,e.useEffect)((()=>{r&&Array.isArray(r.metadata)&&r.metadata.some((e=>e&&"SWIFT"===e.key&&"1"===e.value))&&i&&i(!0)}),[r]),null}var jv=t=>{let{modifier:r,product:n}=t;const[i,a]=(0,e.useState)(!1);return(0,Dr.jsxs)("div",{className:Sv.modifier_item,children:[(0,Dr.jsx)(kv,{product:n,modifier:r,hideModifier:function(e){r&&"Name Customization"===r.description&&a(!0)}}),(0,Dr.jsx)(Vy,{modifier:r,changeTitle:i}),!i&&(0,Dr.jsxs)(Dr.Fragment,{children:[r.options&&!r.maxaggregatequantity&&(0,Dr.jsx)(fv,{options:r.options,parentModifier:r}),r.options&&r.maxaggregatequantity&&(0,Dr.jsx)(Cv,{options:r.options,parentModifier:r})]})]})};var Ev=e=>{let{modifiers:t,product:r}=e;return(0,Dr.jsx)("div",{children:t&&t.map((e=>(0,Dr.jsx)(jv,{modifier:e,product:r},e.id)))})};var Tv=t=>{let{productQuantity:r}=t;const[n,i]=(0,e.useState)(0),a=Ir("foundProduct").product,s=y((e=>e.productDetails.data));return(0,e.useEffect)((()=>{const e=function(e){const t=[];return function e(r,n){r.forEach((r=>{r.options.forEach((r=>{r.itemSelected&&t.push(r),r.modifiers&&e(r.modifiers)}))}))}(e),t}(s);let t=0;e.forEach((e=>{t+=e.cost})),i(t+a.cost)}),[s]),(0,Dr.jsxs)("div",{children:["$",ia(r*n)]})},Pv="AddToCart_product_options_footer__32pCo",Iv="AddToCart_product_options_footer_inner__XyE6+",Mv="AddToCart_product_options_footer_controls__KVlwU",Nv="AddToCart_control_button__gZtXZ",Av="AddToCart_control_button_decrement__6rcgb",Lv="AddToCart_control_button_increment__FLdOx",Dv="AddToCart_controls_display__Yx2Dc";var zv=()=>{var t;const r=E(),n=yt(),i=y((e=>e.location.location)),a=y((e=>e.productDetails.data)),s=y((e=>e.cart.cart)),o=null===(t=Ir("foundProduct"))||void 0===t?void 0:t.product;let l=o;const[c,u]=(0,e.useState)(1),[d,h]=(0,e.useState)(!1),[p,m]=(0,e.useState)(null);return(0,Dr.jsxs)(Dr.Fragment,{children:[i&&(0,Dr.jsx)("div",{className:Pv,children:(0,Dr.jsxs)("div",{className:Iv,children:[(0,Dr.jsxs)("div",{className:Mv,children:[(0,Dr.jsx)("button",{className:`${Nv} ${Av}`,onClick:()=>{c>1&&u((e=>e-1))},disabled:1===c,children:(0,Dr.jsx)("span",{children:(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"})})})}),(0,Dr.jsx)("span",{className:Dv,children:c}),(0,Dr.jsx)("button",{className:`${Nv} ${Lv}`,onClick:()=>{u((e=>e+1))},children:(0,Dr.jsx)("span",{children:(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"})})})})]}
2),!d&&(0,Dr.jsxs)("button",{onClick:async e=>{h(!0),m(e.target.getBoundingClientRect().width);const t=function(e){const t=[];return function e(r,n){r.forEach((r=>{r.options.forEach((r=>{r.itemSelected&&t.push(r),r.modifiers&&e(r.modifiers)}))}))}(e),t}(a);let u="";const d=document.getElementById("orderCustomizationTextarea");if(!pa(o)&&null!==d&&void 0!==d&&d.checked&&(u=document.getElementById("orderCustomizationTextareaInput").value),aa(u))return window.alert("Please remove emojis from special instructions. Use letters and numbers only."),void h(!1);let p=[],f=0;t.forEach((e=>{p.push({choiceid:e.id,quantity:e.selectedQuantity?e.selectedQuantity:1}),f+=e.cost}));const g={add_by:"batch",restaurant_id:i.id,quantity:c,product_id:l.id,special_instructions:u,choices:p},_={add_by:"batch",quantity:c,product_id:l.id,special_instructions:u,choices:p};let y=ca();if(y&&(g.authtoken=y,_.authtoken=y),s)if(n.state&&n.state.type){_.product_id=n.state.productInCart;const e=await mr(s.id,_);e.id?(Mr("currentCart",e),r(vs.addCart(e)),r(vs.setCartSidebarStep("order")),r(vs.setCartSidebarState())):r(qi.setError(e))}else{const e=await pr(s.id,g);e.id?(Mr("currentCart",e),r(vs.addCart(e)),r(vs.setCartSidebarStep("order")),r(vs.setCartSidebarState())):r(qi.setError(e))}else{const e=await hr(g);e.id?(Mr("currentCart",e),r(vs.addCart(e)),r(vs.setCartSidebarStep("order")),r(vs.setCartSidebarState())):r(qi.setError(e))}o&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"add_to_cart",ecommerce:{currency:"USD",value:f,items:[{item_id:o.id,item_name:o.name,price:f,quantity:c}]}})),h(!1)},className:"btn btn-large",children:[(0,Dr.jsx)("span",{children:"Add To Cart"}),(0,Dr.jsx)("span",{children:"|"}),(0,Dr.jsx)(Tv,{productQuantity:c})]}),d&&(0,Dr.jsx)("div",{className:"btn-loader",style:{width:p},children:(0,Dr.jsx)("span",{className:"loader"})})]})}),!i&&(0,Dr.jsx)("div",{className:Pv,children:(0,Dr.jsx)("div",{className:Iv,children:(0,Dr.jsxs)("button",{className:"btn btn-large",onClick:()=>{r(Vi.setLocationsSideBarState())},children:[(0,Dr.jsx)("span",{children:"Find your store"}),(0,Dr.jsx)("span",{children:"|"}),(0,Dr.jsx)(Tv,{productQuantity:c})]})})})]})},Ov="SpecialInstructions_options_item__lRVYZ",Rv="SpecialInstructions_options_item_customize__FoLq3",Fv="SpecialInstructions_options_item_header__RYGbq",Bv="SpecialInstructions_form_controller__U6uyG",Vv="SpecialInstructions_instructions__mourQ",$v="SpecialInstructions_form_group__Sm1mU",Uv="SpecialInstructions_isShiftProduct__VlvNc";var Hv=t=>{let{cakeBuilder:r,product:n}=t;const i=(0,e.useRef)(null),[a,s]=(0,e.useState)(!1),o=y((e=>e.productDetails.edit)),l=y((e=>e.productDetails.pageReload)),[c,u]=(0,e.useState)(""),[d,h]=(0,e.useState)(!1);(0,e.useEffect)((()=>{o&&""!==o.specialinstructions&&(u(o.specialinstructions),h(!0))}),[l]);let p="Write any special instructions here...";return a&&(p="Enter up to 10 characters..."),(0,Dr.jsxs)("div",{className:`${Ov} ${Rv}`,children:[(0,Dr.jsx)(kv,{product:n,hideModifier:function(){s(!0),h(!0)}}),!a&&(0,Dr.jsx)("div",{className:Fv,children:(0,Dr.jsx)("h3",{children:"Order Customization:"})}),(0,Dr.jsx)("div",{className:"form-fields-container",children:(0,Dr.jsx)("div",{className:`form-controller ${Bv}`,children:(0,Dr.jsxs)("fieldset",{children:[(0,Dr.jsx)("legend",{className:"sr-only",children:"Order Customization"}),!r&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:`form-group-checkbox ${$v} ${a?Uv:""}`,children:[(0,Dr.jsx)("input",{type:"checkbox",id:"orderCustomizationTextarea",name:"orderCustomizationTextarea",onChange:e=>{h(e.target.checked)},value:d,checked:d}),(0,Dr.jsxs)("label",{htmlFor:"orderCustomizationTextarea",children:["special instructions (",(0,Dr.jsx)("span",{children:"optional"}),")"]})]}),(0,Dr.jsxs)("div",{className:$v,children:[(0,Dr.jsx)("textarea",{ref:i,maxLength:a?10:200,id:"orderCustomizationTextareaInput",name:"orderCustomizationTextareaInput",placeholder:p,disabled:!d,defaultValue:c}),!a&&(0,Dr.jsx)("label",{htmlFor:"orderCustomizationTextareaInput",className:Vv,children:"Enter any special instructions here, such as a custom design description. No price altering substitutions/additions. "}),a&&(0,Dr.jsx)("label",{htmlFor:"orderCustomizationTextareaInput",className:Vv,children:"Leave name field blank if you do not want a name included. No other modifications can be made to this specific design, including changes to icing color."})]})]}),r&&(0,Dr.jsxs)("div",{className:$v,children:[(0,Dr.jsx)("textarea",{ref:i,maxLength:200,id:"orderCustomizationTextareaInput",name:"orderCustomizationTextareaInput",placeholder:"Write any special instructions here...",defaultValue:c}),(0,Dr.jsx)("label",{htmlFor:"orderCustomizationTextareaInput",className:Vv,children:"Enter any special instructions here, such as a custom design description. No price altering substitutions/additions. "})]})]})})})]})};var qv=e=>{let{product:t}=e;const r=y((e=>e.productDetails.data)),n=pa(t);return(0,Dr.jsx)(Dr.Fragment,{children:r&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(Ev,{modifiers:r,product:t}),!n&&(0,Dr.jsx)(Hv,{product:t}),(0,Dr.jsx)(zv,{})]})})};const Zv=(e,t,r)=>{e.forEach((e=>e.itemSelected=!1)),r||(e[0]={...e[0],itemSelected:t}
2),e[0].modifiers&&e[0].modifiers.forEach((e=>{e.mandatory?Zv(e.options,!0):Zv(e.options,!0,!0)})),e.slice(1).forEach((e=>{e.modifiers&&e.modifiers.forEach((e=>{e.mandatory?Zv(e.options,!1,!1):Zv(e.options,!1,!0)}))}))},Gv=(e,t)=>{e.forEach((e=>e.itemSelected=!1)),t.forEach((r=>{e.forEach((e=>{e.id===r.optionid&&(e.itemSelected=!0),e.modifiers&&e.modifiers.forEach((e=>{Gv(e.options,t)}))}))}))};var Wv=()=>{var t;const r=E(),n=null===(t=Ir("foundProduct"))||void 0===t?void 0:t.product,i=y((e=>e.productDetails.data)),a=y((e=>e.productDetails.edit)),s=y((e=>e.productDetails.pageReload));return(0,e.useEffect)((()=>{if(n&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"view_item",ecommerce:{currency:"USD",value:n.cost,test:`this is the view_item event - ${Math.random()}`,items:[{item_id:n.id,item_name:n.name,price:n.cost,quantity:1}]}})),n&&n.modifiers)if(a){let e=JSON.parse(JSON.stringify(n.modifiers));e.forEach((e=>{Gv(e.options,a.choices)})),r(zc.createProduct(e))}else{let e=JSON.parse(JSON.stringify(n.modifiers));e.forEach((e=>{var t;e.mandatory||"Add a soda?"===e.description?Zv(e.options,!0,!1):!e.mandatory&&e.maxselects?((t=e.options).forEach((e=>e.itemSelected=!1)),t.forEach((e=>{e.isdefault&&(e.itemSelected=!0)}))):Zv(e.options,!1,!0)})),r(zc.createProduct(e))}return()=>{r(zc.setEditOptions(null))}}),[s]),(0,Dr.jsx)("div",{className:Dy,children:n&&i&&(0,Dr.jsx)(qv,{product:n})})},Xv="PageWrapper_modal_controller__+YWLl",Jv="PageWrapper_warning_header__VvUko",Kv="PageWrapper_no_online_ordering_container__7Hd5K";var Yv=t=>{var r;let{children:n}=t;const i=E();let a=y((e=>e.location.location)),s=Ir("currentLocation");const o=y((e=>e.cart.cart)),l=sessionStorage.getItem("wasWarningShown"),[c,u]=(0,e.useState)(!1),[d,h]=(0,e.useState)(!1),[p,m]=(0,e.useState)(null),[f,g]=(0,e.useState)(!1),_=async()=>{var e,t;h(!0);const r={delivery_mode:"pickup",time:"schedule",schedule_date:ya(a.hours)?sa(null===(e=a.hours.business[Gi()])||void 0===e?void 0:e.start):null,schedule_time:ya(a.hours)?oa(null===(t=a.hours.business[Gi()])||void 0===t?void 0:t.start):null};if(o){var n;if(r.schedule_date=Ki(o.earliestreadytime),r.schedule_time=Yi(o.earliestreadytime),o.timewanted)if(new Date>new Date(Ji(o.timewanted)))null!==a&&void 0!==a&&null!==(n=a.status)&&void 0!==n&&n.open&&(r.time="asap",r.schedule_date=null,r.schedule_time=null);const e=await _r(o.id,r);e.id?(i(vs.addCart(e)),Mr("currentCart",e),u(!1)):(i(qi.setError(e)),h(!1))}else{const e=await ur({restaurant_id:a.id});if(e.id){r.schedule_date=Ki(e.earliestreadytime),r.schedule_time=Yi(e.earliestreadytime);const t=await _r(e.id,r);t.id?(i(vs.addCart(t)),Mr("currentCart",t),u(!1)):(i(qi.setError(t)),h(!1))}else i(qi.setError(e)),h(!1)}};(0,e.useEffect)((()=>{a&&a.status&&"Currently unavailable to accept online orders."===a.status.message||(!a&&s&&s.currentLocation&&i(i(Vi.setLocationItem(s.currentLocation))),Ca(a)&&!l?u(!0):u(!1),a&&o&&a.id!==o.vendorid&&i(vs.addCart(null)),va(a))}),[a,o,i,s,l]);return(0,e.useEffect)((()=>{a&&a.status&&"Currently unavailable to accept online orders."===a.status.message&&g(!0)}),[a]),(0,Dr.jsxs)(Dr.Fragment,{children:[n,c&&(0,Dr.jsxs)(Tp,{transition:c,children:[(0,Dr.jsxs)("p",{className:Jv,children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),(0,Dr.jsx)("strong",{children:"Warning:"})," ",a.name," is not opened yet!"]}),(0,Dr.jsxs)("p",{children:["The store will open today at ",ya(a.hours)?new Date(null===(r=a.hours.business[Gi()])||void 0===r?void 0:r.start).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):null]}),(0,Dr.jsxs)("div",{className:Xv,children:[(0,Dr.jsx)("button",{className:"btn btn-border",onClick:()=>{u(!1),i(Vi.setLocationsSideBarState()),sessionStorage.setItem("wasWarningShown",!0)},children:"Change Location"}),!d&&(0,Dr.jsx)("button",{className:"btn",onClick:e=>{m(e.target.getBoundingClientRect().width),_(),sessionStorage.setItem("wasWarningShown",!0)},children:"Proceed Anyway"}),d&&(0,Dr.jsx)("span",{className:"btn",style:{width:p},children:(0,Dr.jsx)("span",{className:"loader"})})]})]}),f&&(0,Dr.jsx)(Tp,{transition:f,children:(0,Dr.jsxs)("div",{className:Kv,children:[(0,Dr.jsxs)("p",{className:Jv,children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),(0,Dr.jsx)("strong",{children:"Warning:"})," ",a.name," is currently unavailable to accept online orders."]}),(0,Dr.jsx)("div",{className:Xv,children:(0,Dr.jsx)("button",{className:"btn",onClick:()=>{g(!1),i(Vi.setLocationsSideBarState())},children:"Change Location"})})]})})]})};var Qv=()=>(0,Dr.jsx)("svg",{width:"32",height:"33",viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M15.9921 0C7.17595 0 0 7.19172 0 16.0079C0 24.8241 7.17595 32.0158 15.9921 32.0158C24.8083 32.0158 32 24.8398 32 16.0079C32 7.17595 24.8241 0 15.9921 0ZM15.9921 29.6501C8.48497 29.6501 2.3657 23.5308 2.3657 16.0079C2.3657 8.48497 8.48497 2.3657 15.9921 2.3657C23.4993 2.3657 29.6343 8.48497 29.6343 16.0079C29.6343 23.5308 23.515 29.6501 15.9921 29.6501ZM18.0582 22.8211C17.7585 22.8211 17.4588 22.7107 17.2223 22.4741L11.5919 16.8438C11.3711 16.623 11.2449 16.3233 11.2449 16.0079C11.2449 15.6925 11.3711 15.3928 11.5919 15.172L17.033 9.7309C17.4904 9.27353 18.2474 9.27353 18.7048 9.7309C19.1621 10.
21883 19.1621 10.9453 18.7048 11.4027L14.0996 16.0079L18.894 20.8024C19.3514 21.2597 19.3514 22.0168 18.894 22.4741C18.6575 22.7107 18.3578 22.8211 18.0582 22.8211Z",fill:"var(--color-dark-raspberry-secondary)"})});var ex=()=>{const t=Dt();let r=y((e=>e.location.location));const n=wt(),i=xt(),a=yt();return(0,e.useEffect)((()=>{var e,t,r;const n=null===(e=window.google_tag_manager)||void 0===e||null===(t=e["GTM-TDTC8Z9"])||void 0===t||null===(r=t.dataLayer)||void 0===r?void 0:r.reset;"function"===typeof n&&n()}),[]),(0,e.useEffect)((()=>{a&&a.pathname&&a.pathname.includes("/menu")&&i(`/gac/${r.location_slug}/product/${n.productSlug}`)}),[a]),(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:"",productPage:!0}),children:(0,Dr.jsx)(Vt,{resolve:t.data,errorElement:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("section",{className:Ty,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Page Not Found"}),(0,Dr.jsx)("h3",{className:"text-center",children:"No cookies for you here :( !"})]})}),children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(Yv,{children:(0,Dr.jsxs)("div",{className:"relative",children:[(0,Dr.jsx)("div",{className:Ey,children:(0,Dr.jsx)("img",{src:La,role:"presentation",alt:"",className:"image-cover"})}),(0,Dr.jsxs)("div",{className:"container-full",children:[r&&(0,Dr.jsx)("div",{className:jy,children:(0,Dr.jsxs)(er,{to:xa(r),children:[(0,Dr.jsx)(Qv,{}),"Back To Menu"]})}),(0,Dr.jsxs)("div",{className:ky,children:[(0,Dr.jsx)(Ly,{}),(0,Dr.jsx)(Wv,{})]})]})]})})})})})})},tx="CreateCookie_product_details_container__tVe+G",rx="CreateCookie_background__ibEsn",nx="CreateCookie_container__YIloK",ix="CreateCookie_back_to_menu_container__nLnA1",ax="PresentationBoxCreate_presentation_box__rAq40",sx="PresentationBoxCreate_page_title__iQae3",ox="PresentationBoxCreate_description__5g2j4",lx="PresentationBoxCreate_composite_image__6WIbP",cx="PresentationBoxCreate_composite_image_inner__2Fh2-",ux="PresentationBoxCreate_presentation_box_container__hutRs",dx="PresentationBoxCreate_presentation_box_details__OHOaT",hx="PresentationBoxCreate_create_options__quP8v",px="PresentationBoxCreate_simple_choices__Il4er",mx="PresentationBoxCreate_page_title_button__N9f0n",fx="PresentationBoxCreate_page_title_icon__blA+H",gx="PresentationBoxCreate_drawer_button_opened__CGdGR",_x="PresentationBoxCreate_presentation_box_drawer__sgTnF",yx="PresentationBoxCreate_drawer_opened__71iLd",vx="PresentationBoxCreate_drawer_button_opened_text__eeZH8",xx="PresentationBoxCreate_disclaimer__Yr2Ko",bx="SelectedChoice_choice_basic__YnGic",wx="SelectedChoice_choice_basic_inner__2tjRF",Cx="SelectedChoice_choice_title__t+g73",Sx="SelectedChoice_choice_picked__20nRQ",kx="SelectedChoice_choice_picked_title__aZUXl",jx="SelectedChoice_picked_sub_options__5R4hC",Ex="SelectedChoice_choice_custom_fields__frQ3R",Tx="SelectedChoice_field_value__96fuS";const Px=Ii({name:"productChoices",initialState:{choices:[],product:null,openedOptions:0,mobileSelectedChoicesState:!1,optionsConfirmed:!1,customFields:null,customMessage:null},reducers:{createproduct(e,t){e.product=t.payload},addChoice(e,t){const r=e.product.findIndex((e=>e.choice_id==t.payload.id));-1!==r&&(e.product[r].choice_options=[t.payload.choice],e.product[r].selected=!0)},removeSubChoices(e,t){let r=e.product;for(let n=r.length-1;n>=0;n--)r[n].parent_id&&r[n].parent_id===t.payload.parent_id&&r.splice(n,1);e.product=r},removeSubChoicesCheckbox(e,t){const r=e.product.findIndex((e=>e.related_option==t.payload.option_id));r>=0&&e.product.splice(r,1)},addMultipleChoices(e,t){const r=e.product.findIndex((e=>e.choice_id==t.payload.id));-1!==r&&(e.product[r].choice_options.push(t.payload.choice),e.product[r].selected=!0)},removeFromMultipleChoices(e,t){const r=e.product.findIndex((e=>e.choice_id==t.payload.id));if(-1!==r){const n=e.product[r].choice_options.findIndex((e=>e.id==t.payload.optionId));if(-1!==n){e.product[r].choice_options.splice(n,1),0===e.product[r].choice_options.length&&(e.product[r].selected=!1);const i=e.product.findIndex((e=>e.related_option==t.payload.optionId));-1!==i&&e.product.splice(i,1)}}},appendSubChoice(e,t){const r=e.product.findIndex((e=>e.parent_id==t.payload.parent_id));-1!==r&&e.product.splice(r,1);const n=e.product.findIndex((e=>e.choice_id==t.payload.parent_id));e.product.findIndex((e=>e.choice_id==t.payload.choice_id))<0&&e.product.splice(n+1,0,t.payload)},appendBulkSubChoice(e,t){let r=e.product;
2t.payload.optionsToAdd.forEach((e=>{const n=r.findIndex((e=>e.parent_id==t.payload.parent_id));-1!==n&&r.splice(n,1)}));const n=r.findIndex((e=>e.choice_id==t.payload.parent_id));t.payload.optionsToAdd.forEach(((e,t)=>{r.findIndex((t=>t.choice_id==e.choice_id))<0&&r.splice(n+1+t,0,e)})),e.product=r},clearOptions(e){e.product=null},removeSelectedChoice(e,t){const r=e.product.findIndex((e=>e.choice_id==t.payload.parent_id));if(-1!==r){const n=e.product[r].choice_options.findIndex((e=>e.id==t.payload.id));-1!==n&&e.product[r].choice_options.splice(n,1),0===e.product[r].choice_options.length&&(e.product[r].selected=!1)}},setOpenedoption(e,t){e.openedOptions=t.payload},setMobileSelectedChoicesState(e){e.mobileSelectedChoicesState=!e.mobileSelectedChoicesState},closeMobileSelectedChoices(e){e.mobileSelectedChoicesState=!1},addAggregateChoices(e,t){const r=e.product.findIndex((e=>e.choice_id==t.payload.parent_id));if(r>=0){console.log("there is a parent");const n=e.product[r].choice_options.findIndex((e=>e.id==t.payload.options.id));n>=0?0===t.payload.options.quantity?e.product[r].choice_options.splice(n,1):e.product[r].choice_options[n]={...t.payload.options}:e.product[r].choice_options.push(t.payload.options)}},confirmOptions(e,t){e.optionsConfirmed=t.payload},addCustomFieldData(e,t){e.customFields=t.payload},customMessageText(e,t){e.customMessage=t.payload}}}),Ix=Px.actions;var Mx=Px.reducer;function Nx(e){e.forEach((e=>e.drawerOpened=!1)),e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&Nx(e.modifiers)}))}))}function Ax(e,t){let r=e.findIndex((e=>e.id===t));return Nx(e),r>=0?e[r].drawerOpened=!0:e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&Ax(e.modifiers,t)}))})),e}var Lx=e=>{let{option:t,parent:r}=e;const n=E(),i=y((e=>e.productDetails.data));let a=JSON.parse(JSON.stringify(i));return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)("button",{onClick:()=>{const e=Ax(a,r.id);n(zc.createProduct(e)),n(zc.builderAccordionTriggerMark())},className:Sx,children:(0,Dr.jsx)("span",{className:kx,children:t.name})})})};var Dx=e=>{let{data:t}=e;return(0,Dr.jsx)("div",{className:bx,children:(0,Dr.jsxs)("div",{className:wx,children:[(0,Dr.jsx)("div",{className:Cx,children:"Upgrade Your Cookie Cake"===t.modName?t.modName:t.modName.replace(/\b(?:Select|Choose|Cookie Cake)/g,"").replace(/[:?]/g,"")}),t.selectedoptions&&t.selectedoptions.length>0&&(0,Dr.jsx)("div",{className:jx,children:t.selectedoptions.map((e=>(0,Dr.jsx)(Lx,{option:e,parent:t},e.id)))})]})})};var zx=()=>(0,Dr.jsxs)("svg",{width:"16",height:"13",viewBox:"0 0 16 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsx)("path",{d:"M7.9999 10.378C5.7695 10.378 3.95731 8.56584 3.95731 6.33544C3.95731 4.10504 5.7695 2.29285 7.9999 2.29285C10.2303 2.29285 12.0348 4.10504 12.0348 6.33544C12.0348 8.56584 10.2226 10.378 7.9999 10.378ZM7.9999 3.46226C6.41229 3.46226 5.11897 4.75558 5.11897 6.34319C5.11897 7.93079 6.41229 9.22411 7.9999 9.22411C9.58751 9.22411 10.8731 7.93079 10.8731 6.34319C10.8731 4.75558 9.57976 3.46226 7.9999 3.46226Z",fill:"var(--color-dark-raspberry)"}),(0,Dr.jsx)("path",{d:"M8 12.5C4.37561 12.5 1.09197 10.076 0.0232333 6.61427C-0.00774443 6.50585 -0.00774443 6.38194 0.0232333 6.27352C1.10745 2.7498 4.31365 0.380005 8 0.380005C11.6864 0.380005 14.9003 2.7498 15.9768 6.27352C16.0077 6.38194 16.0077 6.50585 15.9768 6.61427C14.8925 10.1302 11.6864 12.5 8 12.5ZM1.19264 6.4439C2.1607 9.33257 4.94095 11.3384 8 11.3384C11.0591 11.3384 13.8238 9.37904 14.8074 6.4439C13.8316 3.50101 11.121 1.54167 8 1.54167C4.87899 1.54167 2.17619 3.50101 1.19264 6.4439Z",fill:"var(--color-dark-raspberry)"})]}),Ox=r(563),Rx=r(4076),Fx=r(7232);const Bx=r(68),Vx=(Bx.keys().map((e=>Bx(e))),r(2695)),$x=(Vx.keys().map((e=>Vx(e))),r(6803)),Ux=($x.keys().map((e=>$x(e))),r(8339)),Hx=(Ux.keys().map((e=>Ux(e))),r(6669)),qx=(Hx.keys().map((e=>
2Hx(e))),r(1856)),Zx=(qx.keys().map((e=>qx(e))),r(8182)),Gx=(Zx.keys().map((e=>Zx(e))),r(7535)),Wx=(Gx.keys().map((e=>Gx(e))),r(4257));Wx.keys().map((e=>Wx(e)));var Xx=()=>{const e=y((e=>e.product.customFields));return(0,Dr.jsx)(Dr.Fragment,{children:e&&(0,Dr.jsx)("div",{className:`${bx} ${Ex}`,children:(0,Dr.jsxs)("div",{className:wx,children:[(0,Dr.jsx)("div",{className:Cx,children:e.fieldName.split("_").join(" ")}),(0,Dr.jsx)("div",{className:Tx,children:e.fieldValue})]})})})},Jx="BuilderImage_container__IleWr",Kx="BuilderImage_loader_container__QPhho",Yx="BuilderImage_image_container_item__Dat-l",Qx="BuilderImage_text_container__dMm7F",eb="BuilderImage_container_static__yNeyl",tb="BuilderImage_container_loading__a4fGq",rb=r(3738),nb=r(4479),ib=r(9587);var ab=t=>{let{wholeImage:r}=t;const[n,i]=(0,e.useState)(!1);return(0,Dr.jsxs)(Dr.Fragment,{children:[n&&(0,Dr.jsx)("div",{className:Kx,children:(0,Dr.jsx)("span",{className:"loader dark"})}),(0,Dr.jsx)("div",{className:`${eb} ${n?tb:""}`,children:r&&r.length>0&&r.map(((e,t)=>(0,Dr.jsx)("div",{className:Yx,children:(0,Dr.jsx)("img",{src:e.uri,alt:"",style:{filter:e.filter?e.filter:""}})},e.uri+Math.random())))})]})};let sb="square";const ob=r(68),lb=ob.keys().map((e=>ob(e))),cb=r(2695),ub=cb.keys().map((e=>cb(e))),db=r(6803),hb=db.keys().map((e=>db(e))),pb=r(8339),mb=pb.keys().map((e=>pb(e))),fb=r(6669),gb=fb.keys().map((e=>fb(e))),_b=r(1856),yb=_b.keys().map((e=>_b(e))),vb=r(8182),xb=vb.keys().map((e=>vb(e))),bb=r(7535),wb=bb.keys().map((e=>bb(e))),Cb=r(4257),Sb=Cb.keys().map((e=>Cb(e))),kb=[{color:"Vanilla",noChange:!0,hue:null,base:"white",hsl:null},{color:"Chocolate",hue:"hue-rotate(10deg)",base:"red",hsl:"hsl(22, 20%, 50%)",filter:"hue-rotate(39deg) saturate(1) brightness(.6)"},{color:"Red",noChange:!0,hue:null,base:"red",hsl:null},{color:"Blue",hue:"hue-rotate(190deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"hue-rotate(207deg) saturate(1.2) brightness(2.2)"},{color:"Orange",hue:"hue-rotate(30deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"hue-rotate(28deg) saturate(1.8) brightness(2.8)"},{color:"Green",hue:"hue-rotate(90deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"hue-rotate(99deg) saturate(.6) brightness(2.5)"},{color:"Pink",hue:"hue-rotate(300deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"hue-rotate(353deg) saturate(1) brightness(2.3)"},{color:"Yellow",hue:"hue-rotate(60deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"hue-rotate(65deg) saturate(.7) brightness(3)"},{color:"Dark Purple",hue:"hue-rotate(270deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"hue-rotate(268deg) saturate(1.7) brightness(.8)"},{color:"Dark Green",hue:"hue-rotate(120deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"hue-rotate(123deg) saturate(.4) brightness(2)"},{colorName:"Dark Blue",hue:"hue-rotate(120deg)",base:"red",hsl:"hsl(0, 20%, 50%)",filter:"brightness(0) saturate(100%) invert(23%) sepia(28%) saturate(6293%) hue-rotate(193deg) brightness(97%) contrast(101%)"}],jb=[{colorName:"Vanilla",color:"hsl(49.3,87.5%,93.7%)",trueColor:"#fdf8e1"},{colorName:"Chocolate",color:"hsl(24.2,59.6%,20.4%)",trueColor:"#532e15"},{colorName:"Red",color:"hsl(358.9,68%,52.2%)",trueColor:"#d83235"},{colorName:"Blue",color:"hsl(201.7,64.4%,57.1%)",trueColor:"#4ba5d8"},{colorName:"Orange",color:"hsl(12.9,74.4%,51%)",trueColor:"#df4d25"},{colorName:"Green",color:"hsl(89.7,52.6%,42.2%)",trueColor:"#6ca433"},{colorName:"Pink",color:"hsl(349.7,73.1%,59.2%)",trueColor:"#e34b65"},{colorName:"Yellow",color:"hsl(57.7,79.9%,61%)",trueColor:"#ebe54c"},{colorName:"Dark Purple",color:"hsl(246.3,53.8%,31.4%)",trueColor:"#2e257b"},{colorName:"Dark Green",color:"hsl(110.5,28.9%,38.6%)",trueColor:"#4f7f46"},{colorName:"Dark Blue",color:"hsl(207.8,100%,34.7%)",trueColor:"#005fb1"}];var Eb=t=>{let{mobile:r,selectedOptions:n}=t;const i=yt(),[a,s]=(0,e.useState)(!0),[o,l]=(0,e.useState)(!1),c=(0,e.useRef)(null),u=y((e=>e.product.customMessage)),[d,h]=(0,e.useState)([{uri:Ox}]);let p=[];const[m,f]=(0,e.useState)({baseColor:"white",topColor:"black"});return(0,e.useEffect)((()=>{document.fonts.load("46px Intro Script Bold").then((()=>l(!0)));const e=()=>{if(s(!0),n){let e=[{uri:Ox}],t=[{uri:Ox}];
2n.forEach((r=>{r.modName.toLowerCase().includes("choose shape")&&r.selectedoptions.length>0&&(r.selectedoptions.forEach((e=>{e.name.toLowerCase().includes("round")&&(sb="round",t=[{uri:Rx}]),e.name.toLowerCase().includes("square")&&(sb="square",t=[{uri:Ox}]),e.name.toLowerCase().includes("rect")&&(sb="rect",t=[{uri:Fx}])})),e=t),(r.modName.toLowerCase().includes("choose cookie cake flavor")||r.modName.toLowerCase().includes("choose cookie cake batter"))&&(r.selectedoptions.length>0&&("square"===sb&&lb.forEach((e=>{var n;e.includes(null===(n=r.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-"))&&(t=[{uri:e}])})),"rect"===sb&&ub.forEach((e=>{var n;e.includes(null===(n=r.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-"))&&(t=[{uri:e}])})),"round"===sb&&hb.forEach((e=>{var n;e.includes(null===(n=r.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-"))&&(t=[{uri:e}])}))),e=t)})),n.forEach((r=>{(r.modName.toLowerCase().includes("upgrade your cookie")||r.modName.toLowerCase().includes("would you like to upgrade"))&&r.selectedoptions.length>0&&r.selectedoptions.forEach((r=>{"M&Ms Baked In"!==r.name&&"M&M'S\xae Baked In"!==r.name||("square"===sb&&(t=[{uri:rb}]),"rect"===sb&&(t=[{uri:ib}]),"round"===sb&&(t=[{uri:nb}]),n.forEach((e=>{(e.modName.toLowerCase().includes("choose cookie cake flavor")||e.modName.toLowerCase().includes("choose cookie cake batter"))&&("square"===sb&&lb.forEach((r=>{var n;r.includes(`m-${null===(n=e.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-").toLowerCase()}`)&&(t=[{uri:r}])}
2)),"rect"===sb&&ub.forEach((r=>{var n;r.includes(`m-${null===(n=e.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-").toLowerCase()}`)&&(t=[{uri:r}])})),"round"===sb&&hb.forEach((r=>{var n;r.includes(`m-${null===(n=e.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-").toLowerCase()}`)&&(t=[{uri:r}])})))})),e=t)}))})),n.forEach((r=>{if("choose flavor"===r.modName.toLowerCase()&&(r.selectedoptions.length>0&&("square"===sb&&lb.forEach((e=>{var n;e.includes(null===(n=r.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-"))&&(t=[{uri:e}])})),"rect"===sb&&ub.forEach((e=>{var n;e.includes(null===(n=r.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-"))&&(t=[{uri:e}])})),"round"===sb&&hb.forEach((e=>{var n;e.includes(null===(n=r.selectedoptions[0])||void 0===n?void 0:n.name.split(" ").join("-"))&&(t=[{uri:e}])}))),e=t),r.modName.toLowerCase().includes("border color")&&r.selectedoptions.length>0){p=[],r.selectedoptions.forEach((e=>{var t,r,n,i,a,s;p.push({hue:null===(t=kb.find((t=>t.color===e.name)))||void 0===t?void 0:t.hue,hsl:null===(r=kb.find((t=>t.color===e.name)))||void 0===r?void 0:r.hsl,filter:null===(n=kb.find((t=>t.color===e.name)))||void 0===n?void 0:n.filter,step:null===(i=kb.find((t=>t.color===e.name)))||void 0===i?void 0:i.base,nocolor:null===(a=kb.find((t=>t.color===e.name)))||void 0===a?void 0:a.base,name:null===(s=kb.find((t=>t.color===e.name)))||void 0===s?void 0:s.color})}));let n=mb,i=gb;"square"===sb&&(n=yb,i=xb),"rect"===sb&&(n=wb,i=Sb);let a=p.map(((e,t)=>{let r={};if("red"===e.nocolor)switch(t){case 0:default:r.uri=n.find((e=>e.includes("full")));break;case 1:r.uri=2===p.length?n.find((e=>e.includes("2nd-simple"))):n.find((e=>e.includes("double-2")));break;case 2:r.uri=n.find((e=>e.includes("double-3")))}if("white"===e.nocolor)switch(t){case 0:r.uri=i.find((e=>e.includes("full")));break;case 1:r.uri=2===p.length?i.find((e=>e.includes("2nd-simple"))):i.find((e=>e.includes("double-2")));break;case 2:r.uri=i.find((e=>e.includes("double-3")));break;default:r.uri=gb.find((e=>e.includes("full")))}return r.hsl=e.hsl,r.filter=e.filter,r}));t=[...e,...a]}r.modName.toLowerCase().includes("base")&&r.selectedoptions.length>0&&(m.baseColor=jb.find((e=>e.colorName===r.selectedoptions[0].name)).trueColor,f({baseColor:jb.find((e=>e.colorName===r.selectedoptions[0].name)).trueColor,topColor:"black"})),r.modName.toLowerCase().includes("top")&&r.selectedoptions.length>0&&f({baseColor:m.baseColor,topColor:jb.find((e=>e.colorName===r.selectedoptions[0].name)).trueColor})})),h(t)}s(!1)};e(),window.onresize=e}),[n,r,o,u,i]),(0,Dr.jsxs)("div",{className:Jx,ref:c,children:[(0,Dr.jsx)(ab,{wholeImage:d}),u&&(0,Dr.jsx)("div",{className:Qx,style:{color:m.topColor,textShadow:`${m.baseColor} 0px 0px 0px, ${m.baseColor} 1px 0px 0px,\n ${m.baseColor} 2px 0px 0px, ${m.baseColor} 3px 1px 0px,\n rgba(0, 0, 0, 0.13) 4px -4px 3px, rgba(0, 0, 0, 0.5) 3px -1px 5px,\n rgba(0, 0, 0, 0.2) 5px 3px 3px`},children:u}),!u&&(0,Dr.jsx)("div",{className:Qx,style:{color:m.topColor,textShadow:`${m.baseColor} 0px 0px 0px, ${m.baseColor} 1px 0px 0px,\n ${m.baseColor} 2px 0px 0px, ${m.baseColor} 3px 1px 0px,\n rgba(0, 0, 0, 0.13) 4px -4px 3px, rgba(0, 0, 0, 0.5) 3px -1px 5px,\n rgba(0, 0, 0, 0.2) 5px 3px 3px`},children:"Your Message Here"})]})};function Tb(e,t){e&&e.forEach((e=>{if(e.itemSelected){var r;if(-1===t.findIndex((t=>t.id==e.id)))t.push({modName:e.description,id:e.id,selectedoptions:null===(r=e.options)||void 0===r?void 0:r.filter((e=>e.itemSelected))});e.options&&e.options.forEach((e=>{e.modifiers&&Tb(e.modifiers,t)}))}else e.options&&e.options.forEach((r=>{if(r.itemSelected){var n;if(-1===t.findIndex((t=>t.id==e.id)))t.push({modName:e.description,id:e.id,selectedoptions:null===(n=e.options)||void 0===n?void 0:n.filter((e=>e.itemSelected))});r.modifiers&&Tb(r.modifiers,t)}}))}))}var Pb=()=>{var t;const r=E(),n=null===(t=Ir("foundProduct"))||void 0===t?void 0:t.product,[i,a]=(0,e.useState)(null),s=ps("lg"),o=y((e=>e.product.product)),l=y((e=>e.product.mobileSelectedChoicesState));(0,e.useEffect)((()=>{r(Ix.confirmOptions(!1))}));const c=y((e=>e.productDetails.data));return(0,e.useEffect)((()=>{let e=[];Tb(c,e),a(e)}),[c]),(0,Dr.jsx)("div",{className:`${ax} presentation-box-create`,children:n&&(0,Dr.jsxs)(Dr.Fragment,{children:[s&&(0,Dr.jsxs)(Dr.Fragment,{children:[n.name&&""!==n.name&&(0,Dr.jsx)("h1",{className:sx,children:n.name}),(0,Dr.jsxs)("div",{className:ux,children:[(0,Dr.jsx)("div",{className:dx,children:n.image_large_url&&(0,Dr.jsxs)("div",{className:lx,children:[!n.name.toLowerCase().includes("cookie")&&(0,Dr.jsx)("div",{className:cx,children:(0,Dr.jsx)("img",{src:n.image_large_url,alt:n.name})}),n.name.toLowerCase().includes("cookie")&&(0,Dr.jsx)(Eb,{options:o,selectedOptions:i})]})}),(0,Dr.jsxs)("div",{className:hx,children:[(0,Dr.jsxs)("h3",{children:[n.name.toLowerCase().includes("ice")&&(0,Dr.jsx)(Dr.Fragment,{children:"Your Ice Cream Cake Choices"}),!n.name.toLowerCase().includes("ice")&&(0,Dr.jsx)(Dr.Fragment,{children:"Your cookie cake choices:"})]}),(0,Dr.jsx)("div",{className:px,children:i&&i.length>0&&(0,Dr.jsx)(Dr.Fragment,{children:i.map((e=>(0,Dr.jsx)(Dx,{data:e},e.id)))})}),(0,Dr.jsx)(Xx,{})]})]}),!n.name.toLowerCase().includes("ice")&&(0,Dr.jsxs)("div",{className:xx,children:[(0,Dr.jsx)("p",{children:"We strive to provide our customers with the best possible experience when ordering our Cookie Cakes. While our custom Cookie Cake design tool offers a representation of the final product, actual designs may vary slightly depending on the specific store location and the individual decorator's artistic interpretation."}),(0,Dr.jsx)("p",{children:"Online Cookie Cake orders require a 2-hour minimum lead time. Please keep in mind that some custom designs may be restricted by copyright laws, and we do not produce any cakes that use profanity or vulgar messages. If you need your Cookie Cake earlier or don't see the design you want, please call the store directly. We are happy to help!"})]})]}),!s&&(0,Dr.jsxs)(Dr.Fragment,{children:[n.name&&""!==n.name&&(0,Dr.jsx)("h1",{className:`${mx} ${l?gx:""}`,children:(0,Dr.jsxs)("button",{onClick:()=>{r(Ix.setMobileSelectedChoicesState())},children:[!l&&(0,Dr.jsxs)("span",{className:vx,children:[(0,Dr.jsx)(zx,{})," Show Cookie Cake Design"]}),l&&(0,Dr.jsx)("span",{children:"Your Cookie Cake"}),(0,Dr.jsx)("span",{className:fx,children:(0,Dr.jsx)(ng,{})})]})}),(0,Dr.jsxs)("div",{className:`${_x} ${l?yx:""}`,children:[(0,Dr.jsxs)("div",{className:ux,children:[(0,Dr.jsxs)("div",{className:dx,children:[n.description&&""!==n.description&&(0,Dr.jsx)("div",{className:ox,children:n.description}),n.image_url&&(0,Dr.jsxs)("div",{className:lx,children:[!n.name.toLowerCase().includes("cookie")&&(0,Dr.jsx)("div",{className:cx,children:(0,Dr.jsx)("img",{src:n.image_large_url,alt:n.name})}),n.name.toLowerCase().includes("cookie")&&(0,Dr.jsx)(Eb,{options:o,mobile:l,selectedOptions:i})]})]}),(0,Dr.jsx)("div",{className:hx,children:(0,Dr.jsx)("div",{className:px,children:i&&i.length>0&&(0,Dr.jsx)(Dr.Fragment,{children:i.map((e=>(0,Dr.jsx)(Dx,{data:e},e.id)))})})})]}),!n.name.toLowerCase().includes("ice")&&(0,Dr.jsxs)("div",{className:xx,children:[(0,Dr.jsx)("p",{children:"We strive to provide our customers with the best possible experience when ordering our Cookie Cakes. While our custom Cookie Cake design tool offers a representation of the final product, actual designs may vary slightly depending on the specific store location and the individual decorator's artistic interpretation."}),(0,Dr.jsx)("p",{children:"Online Cookie Cake orders require a 2-hour minimum lead time. Please keep in mind that some custom designs may be restricted by copyright laws, and we do not produce any cakes that use profanity or vulgar messages. If you need your Cookie Cake earlier or don't see the design you want, please call the store directly. We are happy to help!"})]})]})]})]})})},Ib="ProductOptions_product_container__3Lxtj",Mb="ModifierTitle_options_item_header__Ivkig",Nb="ModifierTitle_options_item_header_arrow__3ZxYH",Ab="ModifierTitle_options_item_header_text__yNIX8",Lb="ModifierTitle_item_number__6ZOTj",Db="ModifierTitle_options_item_header_helper__7nNhK";var zb=()=>(0,Dr.jsx)("svg",{width:"30",height:"31",viewBox:"0 0 30 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M14.0625 20.4961C13.5352 21.082 12.6562 21.082 12.1289 20.4961L8.84766 17.2148C8.26172 16.6875 8.26172 15.8086 8.84766 15.2227C9.375 14.6953 10.2539 14.6953 10.7812 15.2227L13.125 17.5664L18.6914 11.9414C19.2188 11.4141 20.0977 11.4141 20.625 11.9414C21.2109 12.5273 21.2109 13.4062 20.625 13.9336L14.0625 20.4961ZM20.1562 3.32812C22.0898 3.09375 24.082 3.67969 25.6055 5.14453C27.0703 6.66797 27.6562 8.66016 27.4219 10.5938C28.9453 11.8242 30 13.6992 30 15.75C30 17.8594 28.9453 19.7344 27.4219 20.9648C27.6562 22.8398 27.0703 24.8906 25.6055 26.3555C24.082 27.8789 22.0898 28.4648 20.1562 28.2305C18.9258 29.7539 17.0508 30.75 15 30.75C12.8906 30.75 11.0156 29.7539 9.78516 28.2305C7.85156 28.4648 5.85938 27.8789 4.33594 26.3555C2.87109 24.8906 2.28516 22.8398 2.51953 20.9648C0.996094 19.7344 0 17.8594 0 15.75C0 13.6992 0.996094 11.8242 2.51953 10.5938C2.28516 8.66016 2.87109 6.66797 4.33594 5.14453C5.85938 3.67969 7.85156 3.09375 9.78516 3.32812C11.0156 1.80469 12.8906 0.75 15 0.75C17.0508 0.75 18.9258 1.80469 20.1562 3.32812ZM11.1328 6.60938L10.0781 6.25781C8.78906 5.84766 7.32422 6.14062 6.32812 7.13672C5.33203 8.13281 5.03906 9.59766 5.44922 10.8281L5.80078 11.9414L4.74609 12.5273C3.57422 13.1133 2.8125 14.3438 2.8125 15.75C2.8125 17.2148 3.57422 18.4453 4.74609 19.0312L5.80078 19.5586L5.44922 20.6719C5.03906 21.9609 5.33203 23.3672 6.32812 24.4219C7.32422 25.418 8.78906 25.7109 10.0781 25.3008L11.1328 24.9492L11.7188 26.0039C12.3047 27.1758 13.5352 27.9375 15 27.9375C16.4062 27.9375 17.6367 27.1758 18.2227 26.0039L18.8086 24.9492L19.8633 25.3008C21.1523 25.7109 22.6172 25.418 23.6133 24.4219C24.6094 23.3672 24.9023 21.9609 24.4922 20.6719L24.1406 19.5586L25.1953 19.0312C26.3672 18.4453 27.1875 17.2148 27.1875 15.75C27.187
25 14.3438 26.3672 13.1133 25.1953 12.5273L24.1406 11.9414L24.4922 10.8281C24.9023 9.59766 24.6094 8.13281 23.6133 7.13672C22.6172 6.14062 21.1523 5.84766 19.8633 6.25781L18.8086 6.60938L18.2227 5.55469C17.6367 4.38281 16.4062 3.5625 15 3.5625C13.5352 3.5625 12.3047 4.38281 11.7188 5.55469L11.1328 6.60938Z",fill:"#8D0E57"})});var Ob=e=>{let{id:t}=e;return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(zb,{})})};var Rb=t=>{let{modifier:r,setDrawer:n,setDrawerClosed:i}=t;const a=(0,e.useRef)(null),[s,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!0),u=y((e=>e.productDetails.accordionTrigger));return(0,e.useEffect)((()=>{r.drawerOpened&&a.current.scrollIntoView({behavior:"smooth",block:"start"})}),[s,u]),(0,Dr.jsxs)("button",{className:`option-header ${Mb}`,onClick:()=>{r.drawerOpened?i():(n(),o(Math.random()))},ref:a,children:[(0,Dr.jsxs)("div",{className:Ab,children:[r.itemSelected&&(0,Dr.jsx)(Ob,{}),(0,Dr.jsxs)("h3",{children:[(0,Dr.jsx)("span",{className:`header-index ${Lb}`,children:"1"}),(0,Dr.jsx)(By,{text:r.description}),r.maxselects&&!r.maxaggregatequantity&&(0,Dr.jsxs)("span",{className:Db,children:[" Select up to ",r.maxselects]}),r.maxselects&&r.maxaggregatequantity&&(0,Dr.jsxs)("span",{className:Db,children:[" Select a total of ",r.maxselects]})]})]}),(0,Dr.jsx)("span",{className:Nb,children:(0,Dr.jsx)(ng,{})})]})},Fb="Option_option_container__R8qMW",Bb="Option_option__jCT43",Vb="Option_active__l1Owo",$b="Option_image_container__mWB9z",Ub="Option_image_container_inner__hsZhE",Hb="Option_option_price__yYla7",qb="Option_increment_decrement_container__YtckD",Zb="Option_item_count__+swpt",Gb="Option_check_mark__KCnp6",Wb="Option_option_title__o7hdA",Xb="Option_option_simple__m8XGO",Jb="Option_option_aggregate__9NZFp",Kb="Option_tooltip_container__dS1jc",Yb="Option_tooltip_button__TXyav",Qb="Option_tooltip_modal__s3pZg",ew="Option_tooltip_modal_inner__E8irk",tw="Option_tail_icon__vA2gG";var rw=t=>{let{data:r}=t;const[n,i]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{n&&setTimeout((()=>{i(!1)}),4e3)}),[n]),(0,Dr.jsxs)("div",{className:Kb,children:[n&&(0,Dr.jsxs)("div",{className:Qb,children:[(0,Dr.jsx)("div",{className:ew,children:(0,Dr.jsx)("p",{children:r.value})}),(0,Dr.jsx)("div",{className:tw,children:(0,Dr.jsx)(ov,{})})]}),(0,Dr.jsxs)("button",{className:Yb,onClick:()=>{i((e=>!e))},children:[(0,Dr.jsx)(sv,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"open tooltip"})]})]})};var nw=e=>{let{option:t,setOption:r,limitReached:n,choiceStyle:i}=e,a=null;return t.cost>0&&(a=t.cost),(0,Dr.jsxs)("div",{className:Fb,children:[(0,Dr.jsxs)("button",{onClick:r.bind(void 0,t.id),className:`${Bb} ${t.itemSelected?Vb:""} ${i?"":Xb}`,disabled:!(!n||t.itemSelected),children:[(0,Dr.jsxs)("div",{className:$b,children:[(0,Dr.jsxs)("div",{className:Ub,children:[t.image&&(0,Dr.jsx)("img",{src:t.image,alt:t.name}),!t.image&&(0,Dr.jsx)("img",{src:Ac,alt:t.name})]}),(0,Dr.jsx)("div",{className:Gb,children:(0,Dr.jsx)(av,{})})]}),!i&&(0,Dr.jsx)("div",{className:Gb,children:(0,Dr.jsx)(av,{})}),(0,Dr.jsxs)("div",{className:Wb,children:[t.name,a&&(0,Dr.jsxs)("div",{className:Hb,children:["$",ia(t.cost)]})]})]}),t.metadata&&t.metadata.filter((e=>"Tooltip"===e.key)).map((e=>(0,Dr.jsx)(rw,{data:e},e.key)))]})},iw={options_container:"Options_options_container__0WRF1",options_containe_parent:"Options_options_containe_parent__aHrJf",drwer_open:"Options_drwer_open__C5Qf6"};const aw=(e,t)=>{t||(e[0]={...e[0],itemSelected:!0}),e[0].modifiers&&e[0].modifiers.forEach((e=>{e.mandatory?aw(e.options):aw(e.options,!0)}))},sw=e=>{e.forEach((e=>{e.itemSelected=!1,e.options&&e.options.forEach((e=>{e.itemSelected=!1,e.modifiers&&(e.modifiers.forEach((e=>{e.itemSelected=!1})),sw(e.modifiers))}))}))};function ow(e,t,r){let n=e.findIndex((e=>e.id===t));return n>=0?(e[n].mandatory&&(e[n].itemSelected=!0),e[n].options.forEach((e=>{e.modifiers&&sw(e.modifiers),e.id===r?e.itemSelected=!0:e.itemSelected=!1}))):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&ow(e.modifiers,t,r)}))})),e}function lw(e,t,r){let n=e.findIndex((e=>e.id===t));if(n>=0){(e[n].mandatory||e[n].minselects)&&(e[n].itemSelected=!0),e[n].options.forEach((e=>{e.id===r&&(!1===e.itemSelected?(e.itemSelected=!0,e.modifiers&&e.modifiers.forEac
2h((e=>{aw(e.options,!0)}))):(e.itemSelected=!1,e.modifiers&&e.modifiers.forEach((e=>{var t;(t=e.options)[0]={...t[0],itemSelected:!1},t[0].modifiers&&t[0].modifiers.forEach((e=>{e.mandatory&&aw(e.options)}))}))))}));0===e[n].options.filter((e=>e.itemSelected)).length&&(e[n].itemSelected=!1)}else e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&lw(e.modifiers,t,r)}))}));return e}var cw=t=>{let{options:r,parentModifier:n,drawer:i}=t;const a=E(),s=y((e=>e.productDetails.data)),[o,l]=(0,e.useState)(!1),c=e=>{let t=JSON.parse(JSON.stringify(s));if(n.mandatory||"Add a soda?"===n.description||"Add a beverage?"===n.description){const r=ow(t,n.id,e);a(zc.createProduct(r))}else{const r=lw(t,n.id,e);a(zc.createProduct(r))}};return(0,e.useEffect)((()=>{if(n.maxselects){r.filter((e=>e.itemSelected)).length>=n.maxselects?l(!0):l(!1)}}),[r]),(0,Dr.jsxs)(Dr.Fragment,{children:[r&&(0,Dr.jsx)("div",{className:`${iw.options_containe_parent} ${n.drawerOpened&&iw.drwer_open} ${!n.drawerOpened&&iw.drwer_closed}`,children:(0,Dr.jsx)("div",{className:`${iw.options_container} ${n.use_images?"grid-5":"grid-4"}`,children:r.map((e=>(0,Dr.jsx)(nw,{option:e,setOption:c,limitReached:o,choiceStyle:n.use_images},e.id)))})}),r.filter((e=>e.itemSelected)).map((e=>(0,Dr.jsx)("div",{children:e.modifiers&&e.modifiers.length>0&&(0,Dr.jsx)(ww,{modifiers:e.modifiers})},e.id)))]})};var uw=t=>{let{option:r,setOption:n,selecteditemsIncrement:i,selectedNumbersDecrement:a,totalSectable:s,limitReached:o}=t;const[l,c]=(0,e.useState)(!1),[u,d]=(0,e.useState)(0),h=y((e=>e.productDetails.edit)),p=y((e=>e.productDetails.pageReload));return(0,e.useEffect)((()=>{if(h){const e=h.choices.filter((e=>e.optionid===r.id));e.length>0&&(c(!0),d(e[0].quantity))}}),[p]),(0,Dr.jsxs)("div",{className:Jb,children:[(0,Dr.jsxs)("button",{onClick:e=>{n(r.id,"increment"),c(!0),d((e=>e+1))},className:`${Bb} ${r.itemSelected?Vb:""}`,disabled:!(!o&&!l),children:[(0,Dr.jsxs)("div",{className:$b,children:[(0,Dr.jsxs)("div",{className:Ub,children:[r.image&&(0,Dr.jsx)("img",{src:r.image,alt:r.name}),!r.image&&(0,Dr.jsx)("img",{src:Ac,alt:r.name})]}),(0,Dr.jsx)("div",{className:Gb,children:(0,Dr.jsx)(av,{})})]}),(0,Dr.jsx)("div",{className:Wb,children:r.name})]}),r.metadata&&r.metadata.filter((e=>"Tooltip"===e.key)).map((e=>(0,Dr.jsx)(rw,{data:e},e.key))),l&&(0,Dr.jsxs)("div",{className:qb,children:[(0,Dr.jsxs)("button",{onClick:e=>{u>0&&(d((e=>e-1)),a(r.id)),1===u&&(c(!1),n(r.id,"decrement"))},children:[(0,Dr.jsx)("svg",{viewBox:"0 0 12 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M11.8125 0.75C11.8125 0.996094 11.5938 1.1875 11.375 1.1875H0.875C0.628906 1.1875 0.4375 0.996094 0.4375 0.777344C0.4375 0.53125 0.628906 0.3125 0.875 0.3125H11.375C11.5938 0.3125 11.8125 0.53125 11.8125 0.75Z",fill:"#242C37"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"remove one item"})]}),(0,Dr.jsx)("div",{className:Zb,children:u}),(0,Dr.jsxs)("button",{onClick:e=>{s>0&&(d((e=>e+1)),i(r.id))},children:[(0,Dr.jsx)("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Dr.jsx)("path",{d:"M11.8125 5.75C11.8125 5.99609 11.5938 6.1875 11.375 6.1875H6.5625V11C6.5625 11.2461 6.34375 11.4648 6.125 11.4648C5.87891 11.4648 5.6875 11.2461 5.6875 11V6.1875H0.875C0.628906 6.1875 0.4375 5.99609 0.4375 5.77734C0.4375 5.53125 0.628906 5.3125 0.875 5.3125H5.6875V0.5C5.6875 0.28125 5.87891 0.0898438 6.125 0.0898438C6.34375 0.0898438 6.5625 0.28125 6.5625 0.5V5.3125H11.375C11.5938 5.3125 11.8125 5.53125 11.8125 5.75Z",fill:"#242C37"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"add one item"})]})]})]})};const dw=(e,t)=>{t||(e[0]={...e[0],itemSelected:!0}),e[0].modifiers&&e[0].modifiers.forEach((e=>{e.mandatory?dw(e.options):dw(e.options,!0)}))},hw=e=>{e.forEach((e=>{e.options&&e.options.forEach((e=>{e.itemSelected||e.modifiers&&(e.modifiers.forEach((e=>{e.options.forEach((e=>{e.itemSelected=!1,e.selectedQuantity=0}))})),hw(e.modifiers))}))}))};function pw(e,t,r){let n=e.findIndex((e=>e.id===t));return hw(e),e.forEach((e=>e.itemSelected=!1)),n>=0?e[n].options.forEach((e=>
2{e.id===r?(e.itemSelected=!0,e.modifiers&&e.modifiers.forEach((e=>{e.mandatory?dw(e.options):dw(e.options,!0)}))):e.itemSelected=!1})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&pw(e.modifiers,t,r)}))})),e}function mw(e,t,r){let n=e.findIndex((e=>e.id===t));return hw(e),n>=0?e[n].options.forEach((t=>{t.id===r&&(t.itemSelected?(t.itemSelected=!1,t.selectedQuantity=0,t.modifiers&&t.modifiers.forEach((t=>{var r;(r=e)[0]={...r[0],itemSelected:!1},r[0].modifiers&&r[0].modifiers.forEach((e=>{e.mandatory&&dw(e.options)}))}))):(t.itemSelected=!0,t.modifiers&&t.modifiers.forEach((e=>{e.mandatory?dw(e.options):dw(e.options,!0)}))))})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&mw(e.modifiers,t,r)}))})),e}function fw(e,t,r){let n=e.findIndex((e=>e.id===t));return n>=0?e[n].options.forEach((e=>{e.id===r&&(e.selectedQuantity=(e.selectedQuantity?e.selectedQuantity:0)+1)})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&fw(e.modifiers,t,r)}))})),e}function gw(e,t,r){let n=e.findIndex((e=>e.id===t));return n>=0?e[n].options.forEach((e=>{e.id===r&&(e.selectedQuantity?e.selectedQuantity=e.selectedQuantity-1:e.selectedQuantity=0)})):e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&gw(e.modifiers,t,r)}))})),e}var _w=t=>{let{options:r,parentModifier:n}=t;const i=E(),a=y((e=>e.productDetails.data)),[s,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(0),u=y((e=>e.productDetails.edit)),d=y((e=>e.productDetails.pageReload)),h=e=>{let t=JSON.parse(JSON.stringify(a));c((e=>e+1));const r=fw(t,n.id,e);i(zc.createProduct(r))},p=e=>{let t=JSON.parse(JSON.stringify(a));c((e=>e-1));const r=gw(t,n.id,e);i(zc.createProduct(r))},m=(e,t)=>{let r=JSON.parse(JSON.stringify(a));if(n.mandatory){const a=pw(r,n.id,e);if("increment"===t){c((e=>e+1));const t=fw(a,n.id,e);i(zc.createProduct(t))}else if("decrement"===t){c((e=>e-1));const t=gw(r,n.id,e);i(zc.createProduct(t))}}else{const a=mw(r,n.id,e);if("increment"===t){c((e=>e+1));const t=fw(a,n.id,e);i(zc.createProduct(t))}else if("decrement"===t){const t=gw(r,n.id,e);i(zc.createProduct(t))}}};(0,e.useEffect)((()=>{if(n.maxselects){r.filter((e=>e.itemSelected)).length>=n.maxselects?o(!0):o(!1)}}),[r]),(0,e.useEffect)((()=>{n.maxaggregatequantity-l>0?o(!1):o(!0)}),[n.maxaggregatequantity,l]),(0,e.useEffect)((()=>{if(u){let e=[];
2if(r.forEach((t=>{u.choices.find((e=>e.optionid===t.id))&&e.push(u.choices.find((e=>e.optionid===t.id)))})),e.length>0){let t=0;e.forEach((e=>{t+=e.quantity})),c(t)}}}),[d]);const f=n.maxaggregatequantity-l>0?n.maxaggregatequantity-l:0;return(0,Dr.jsxs)(Dr.Fragment,{children:[r&&(0,Dr.jsx)("div",{className:`${iw.options_container} grid-5`,children:r.map((e=>(0,Dr.jsx)(uw,{option:e,setOption:m,selecteditemsIncrement:h,selectedNumbersDecrement:p,totalSectable:f,limitReached:s},e.id)))}),r.filter((e=>e.itemSelected)).map((e=>(0,Dr.jsx)("div",{children:e.modifiers&&e.modifiers.length>0&&(0,Dr.jsx)(ww,{modifiers:e.modifiers})},e.id)))]})},yw={modifiers_container:"ProductModifiers_modifiers_container__6bYXt"};function vw(e){e.forEach((e=>e.drawerOpened=!1)),e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&vw(e.modifiers)}))}))}function xw(e,t){let r=e.findIndex((e=>e.id===t));return vw(e),r>=0?e[r].drawerOpened=!0:e.forEach((e=>{e.options.forEach((e=>{e.modifiers&&xw(e.modifiers,t)}))})),e}var bw=e=>{let{modifier:t}=e;const r=E(),n=y((e=>e.productDetails.data));let i=JSON.parse(JSON.stringify(n));return(0,Dr.jsxs)("div",{className:yw.modifier_item,children:[(0,Dr.jsx)(Rb,{modifier:t,setDrawer:()=>{const e=xw(i,t.id);r(zc.createProduct(e))},setDrawerClosed:()=>{const e=(vw(t=i),t);var t;r(zc.createProduct(e))}}),t.options&&!t.maxaggregatequantity&&(0,Dr.jsx)(cw,{options:t.options,parentModifier:t}),t.options&&t.maxaggregatequantity&&(0,Dr.jsx)(_w,{options:t.options,parentModifier:t})]})};var ww=e=>{let{modifiers:t}=e;return(0,Dr.jsx)("div",{children:t&&t.map((e=>(0,Dr.jsx)(bw,{modifier:e},e.id)))})};var Cw=t=>{let{productQuantity:r}=t;const[n,i]=(0,e.useState)(0),a=Ir("foundProduct").product,s=y((e=>e.productDetails.data));return(0,e.useEffect)((()=>{const e=function(e){const t=[];return function e(r,n){r.forEach((r=>{r.options.forEach((r=>{r.itemSelected&&t.push(r),r.modifiers&&e(r.modifiers)}))}))}(e),t}(s);let t=0;e.forEach((e=>{t+=e.cost})),i(t+a.cost)}),[s]),(0,Dr.jsxs)("div",{children:["$",ia(r*n)]})},Sw="AddToCart_product_options_footer__6nIYz",kw="AddToCart_product_options_footer_inner__yzzIx",jw="AddToCart_product_options_footer_controls__BZHK-",Ew="AddToCart_control_button__m2-XU",Tw="AddToCart_control_button_decrement__Kz1uJ",Pw="AddToCart_control_button_increment__KFwvd",Iw="AddToCart_controls_display__t9nwo";function Mw(e){let t=[];return e.forEach((e=>{e.mandatory&&!e.itemSelected&&t.push(e)})),t}var Nw=()=>{var t;const r=E(),n=yt(),i=y((e=>e.location.location)),a=y((e=>e.productDetails.data)),s=y((e=>e.cart.cart)),o=y((e=>e.product.optionsConfirmed)),l=null===(t=Ir("foundProduct"))||void 0===t?void 0:t.product;let c=l;const[u,d]=(0,e.useState)(1),[h,p]=(0,e.useState)(!1),[m,f]=(0,e.useState)(null);return(0,Dr.jsxs)(Dr.Fragment,{children:[i&&(0,Dr.jsx)("div",{className:Sw,children:(0,Dr.jsxs)("div",{className:kw,children:[(0,Dr.jsxs)("div",{className:jw,children:[(0,Dr.jsx)("button",{className:`${Ew} ${Tw}`,onClick:()=>{u>1&&d((e=>e-1))},disabled:1===u,children:(0,Dr.jsx)("span",{children:(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"})})})}),(0,Dr.jsx)("span",{className:Iw,children:u}),(0,Dr.jsx)("button",{className:`${Ew} ${Pw}`,onClick:()=>{d((e=>e+1))},children:(0,Dr.jsx)("span",{children:(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Dr.jsx)("path",{d:"M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"})})})})]}),!h&&(0,Dr.jsxs)("button",{onClick:async e=>{p(!0),f(e.target.getBoundingClientRect().width);const t=function(e){const t=[];return function e(r,n){r.forEach((r=>{r.options.forEach((r=>{r.itemSelected&&t.push(r),r.modifiers&&e(r.modifiers)}))}))}(e),t}(a);let d="";if(document.getElementById("orderCustomMessageTextareaInput")&&""!==document.getElementById("orderCustomMessageTextareaInput").value.trim()&&(d="Custom Message: "+document.getElementById("orderCustomMessageTextareaInput").value),document.getElementById("orderCustomDesignTextareaInput")&&""!==document.getElementById("orderCustomDesignTextareaInput").value.trim()&&(d=d+" | Custom Design: "+document.getElementById("orderCustomDesignTextareaInput").value),document.getElementById("orderCustomizationTextarea")&&document.getElementById("orderCustomizationTextarea").checked&&(d=document.getElementById("orderCustomizationTextareaInput").value),aa(d))return window.alert("Please remove emojis from special instructions. Use letters and numbers only."),void p(!1);if(Mw(a).length>
20)Mw(a).forEach((e=>{r(qi.setError({message:`You need to select an option for ${e.description.replace(/[^a-zA-Z /]+/g,"")}`}))}));else if(o){let e=[],a=0;t.forEach((t=>{e.push({choiceid:t.id,quantity:t.selectedQuantity?t.selectedQuantity:1}),a+=t.cost}));const o={add_by:"batch",restaurant_id:i.id,quantity:u,product_id:c.id,special_instructions:d,choices:e},h={add_by:"batch",quantity:u,product_id:c.id,special_instructions:d,choices:e};let p=ca();if(p&&(o.authtoken=p,h.authtoken=p),s)if(n.state&&n.state.type){h.product_id=n.state.productInCart;const e=await mr(s.id,h);e.id?(Mr("currentCart",e),r(vs.addCart(e)),r(vs.setCartSidebarStep("order")),r(vs.setCartSidebarState())):r(qi.setError(e))}else{const e=await pr(s.id,o);e.id?(Mr("currentCart",e),r(vs.addCart(e)),r(vs.setCartSidebarStep("order")),r(vs.setCartSidebarState())):r(qi.setError(e))}else{const e=await hr(o);e.id?(Mr("currentCart",e),r(vs.addCart(e)),r(vs.setCartSidebarStep("order")),r(vs.setCartSidebarState())):r(qi.setError(e))}l&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"add_to_cart",ecommerce:{currency:"USD",value:a,items:[{item_id:l.id,item_name:l.name,price:a,quantity:u}]}}))}else r(qi.setError({message:"Please confirm your selections!"}));p(!1)},className:"btn btn-large",children:[(0,Dr.jsx)("span",{children:"Add To Cart"}),(0,Dr.jsx)("span",{children:"|"}),(0,Dr.jsx)(Cw,{productQuantity:u})]}),h&&(0,Dr.jsx)("div",{className:"btn-loader",style:{width:m},children:(0,Dr.jsx)("span",{className:"loader"})})]})}),!i&&(0,Dr.jsx)("div",{className:Sw,children:(0,Dr.jsx)("div",{className:kw,children:(0,Dr.jsxs)("button",{className:"btn btn-large",onClick:()=>{r(Vi.setLocationsSideBarState())},children:[(0,Dr.jsx)("span",{children:"Find your store"}),(0,Dr.jsx)("span",{children:"|"}),(0,Dr.jsx)(Cw,{productQuantity:u})]})})})]})},Aw="ConfirmAllSelections_checkbox_container__akSg0",Lw="ConfirmAllSelections_label__U4WvZ";var Dw=()=>{const e=E(),t=y((e=>e.product.optionsConfirmed));return(0,Dr.jsx)("div",{className:Aw,children:(0,Dr.jsxs)("div",{className:"form-container form-group-checkbox",children:[(0,Dr.jsx)("input",{type:"checkbox",id:"confirmAllSelections",name:"confirmAllSelections",onChange:t=>{t.target.checked?e(Ix.confirmOptions(!0)):e(Ix.confirmOptions(!1))},value:t,checked:t}),(0,Dr.jsx)("label",{htmlFor:"confirmAllSelections",className:`label-regular-font ${Lw}`,children:"I confirm that I have reviewed my choices and approve these selections."})]})})},zw="SpecialInstructionsBuilder_options_item__fbwUz",Ow="SpecialInstructionsBuilder_options_item_customize__LQFQ3",Rw="SpecialInstructionsBuilder_options_item_header__1iFBo",Fw="SpecialInstructionsBuilder_form_controller__KBWMI",Bw="SpecialInstructionsBuilder_instructions__55skY",Vw="SpecialInstructionsBuilder_form_group__5hkCW",$w="SpecialInstructionsBuilder_label_title__BkTzS";var Uw=t=>{let{text:r}=t;const n=E(),i=(0,e.useRef)(null),[a,s]=(0,e.useState)("");let o;const l=()=>{console.log("done typing 2000"),n(Ix.customMessageText(i.current.value))};return(0,e.useEffect)((()=>{s(r),n(Ix.customMessageText(r))}),[r]),(0,Dr.jsx)("div",{className:"form-fields-container",children:(0,Dr.jsx)("div",{className:`form-controller ${Fw}`,children:(0,Dr.jsxs)("fieldset",{children:[(0,Dr.jsx)("legend",{className:"sr-only",children:"Order Customization"}),(0,Dr.jsxs)("div",{className:Vw,children:[(0,Dr.jsx)("label",{htmlFor:"orderCustomMessageTextareaInput",className:$w,children:"What do you want your Cookie Cake to say?"}),(0,Dr.jsx)("textarea",{ref:i,onKeyUp:()=>{clearTimeout(o),o=setTimeout(l,1e3)},onKeyDown:()=>{clearTimeout(o)},maxLength:30,id:"orderCustomMessageTextareaInput",name:"orderCustomMessageTextareaInput",placeholder:"Write your custom text here... up to 30 characters",defaultValue:a}),(0,Dr.jsx)("span",{className:Bw,children:"Please do not enter quotation marks for your cake writing."})]})]})})})};var Hw=t=>{let{text:r}=t;const n=(0,e.useRef)(null),[i,a]=(0,e.useState)(r);return(0,Dr.jsx)("div",{className:"form-fields-container",children:(0,Dr.jsx)("div",{className:`form-controller ${Fw}`,children:(0,Dr.jsxs)("fieldset",{children:[(0,Dr.jsx)("legend",{className:"sr-only",children:"Order Customization"}),(0,Dr.jsxs)("div",{className:Vw,children:[(0,Dr.jsx)("label",{htmlFor:"orderCustomDesignTextareaInput",className:$w,children:"What design or decoration do you want on your Cookie Cake?"}),(0,Dr.jsx)("textarea",{ref:n,id:"orderCustomDesignTextareaInput",name:"orderCustomDesignTextareaInput",placeholder:"Enter any special instructions here, such as, please add pink and purple flowers",defaultValue:i}),(0,Dr.jsx)("span",{className:Bw,children:"Enter any special instructions here, such as a custom design description. No price altering substitutions/additions. "})]})]})})})};var qw=t=>{let{specialinstructionsText:r}=t;const n=y((e=>e.productDetails.data)),[i,a]=(0,e.useState)({message:!1,design:!1}),[s,o]=(0,e.useState)(!1);return(0,e.useEffect)((()=>
2{n.forEach((e=>{e.description.toLowerCase().includes("custom")?(o(!1),e.itemSelected?e.options.length>0&&(e.options[0].itemSelected&&!0===e.options[0].itemSelected?a({message:!0,design:!1}):e.options[1].itemSelected&&!0===e.options[1].itemSelected?a({message:!0,design:!0}):a({message:!1,design:!1})):a({message:!1,design:!1})):o(!0)}))}),[n]),(0,Dr.jsxs)(Dr.Fragment,{children:[(i.message||i.design)&&(0,Dr.jsxs)("div",{className:`${zw} ${Ow}`,children:[(0,Dr.jsx)("div",{className:Rw,children:(0,Dr.jsx)("h3",{children:"Cake Customization:"})}),(i.message||i.design)&&(0,Dr.jsx)(Uw,{text:r.message}),i.design&&(0,Dr.jsx)(Hw,{text:r.design})]}),s&&(0,Dr.jsx)(Hv,{})]})},Zw="ProductContainer_mobile_footer_container__ZUm+n",Gw={create_options_container:"SelectedOptionsContainer_create_options_container__nFvHl",create_options:"SelectedOptionsContainer_create_options__v61e6",disclaimer:"SelectedOptionsContainer_disclaimer__pj-dW"};function Ww(e,t){e&&e.forEach((e=>{if(e.itemSelected){var r;if(-1===t.findIndex((t=>t.id==e.id)))t.push({modName:e.description,id:e.id,selectedoptions:null===(r=e.options)||void 0===r?void 0:r.filter((e=>e.itemSelected))});e.options&&e.options.forEach((e=>{e.modifiers&&Ww(e.modifiers,t)}))}else e.options&&e.options.forEach((r=>{if(r.itemSelected){var n;if(-1===t.findIndex((t=>t.id==e.id)))t.push({modName:e.description,id:e.id,selectedoptions:null===(n=e.options)||void 0===n?void 0:n.filter((e=>e.itemSelected))})}}))}))}var Xw=()=>{var t;const r=null===(t=Ir("foundProduct"))||void 0===t?void 0:t.product,[n,i]=(0,e.useState)(null),a=y((e=>e.productDetails.data));return(0,e.useEffect)((()=>{let e=[];Ww(a,e),i(e)}),[a]),(0,Dr.jsx)(Dr.Fragment,{children:r&&(0,Dr.jsxs)("div",{className:Gw.create_options_container,children:[(0,Dr.jsxs)("div",{className:Gw.create_options,children:[(0,Dr.jsxs)("h3",{children:[r.name.toLowerCase().includes("ice")&&(0,Dr.jsx)(Dr.Fragment,{children:"Your Ice Cream Cake Choices"}),!r.name.toLowerCase().includes("ice")&&(0,Dr.jsx)(Dr.Fragment,{children:"Your cookie cake choices:"})]}),(0,Dr.jsx)("div",{className:Gw.simple_choices,children:n&&n.length>0&&(0,Dr.jsx)(Dr.Fragment,{children:n.map((e=>(0,Dr.jsx)(Dx,{data:e},e.id)))})})]}),!r.name.toLowerCase().includes("ice")&&(0,Dr.jsxs)("div",{className:Gw.disclaimer,children:[(0,Dr.jsx)("p",{children:"We strive to provide our customers with the best possible experience when ordering our Cookie Cakes. While our custom Cookie Cake design tool offers a representation of the final product, actual designs may vary slightly depending on the specific store location and the individual decorator's artistic interpretation."}),(0,Dr.jsx)("p",{children:"Online Cookie Cake orders require a 2-hour minimum lead time. Please keep in mind that some custom designs may be restricted by copyright laws, and we do not produce any cakes that use profanity or vulgar messages. If you need your Cookie Cake earlier or don't see the design you want, please call the store directly. We are happy to help!"})]})]})})};var Jw=t=>{let{specialinstructionsText:r}=t;const n=y((e=>e.productDetails.data)),i=ps("sm");return(0,e.useEffect)((()=>{const e=document.querySelectorAll(".option-header");e.length&&e.forEach(((e,t)=>{e.querySelector(".header-index").innerHTML=t+1+". "}))}),[n]),(0,Dr.jsx)(Dr.Fragment,{children:n&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(ww,{modifiers:n}),(0,Dr.jsx)(qw,{specialinstructionsText:r}),i&&(0,Dr.jsx)(Dw,{}),!i&&(0,Dr.jsxs)("div",{className:Zw,children:[(0,Dr.jsx)(Xw,{}),(0,Dr.jsx)(Dw,{})]}),(0,Dr.jsx)(Nw,{})]})})};const Kw=(e,t,r)=>{e.forEach((e=>e.itemSelected=!1)),r||(e[0]={...e[0],itemSelected:t}),e[0].modifiers&&e[0].modifiers.forEach((e=>{e.mandatory?Kw(e.options,!0):Kw(e.options,!0,!0)})),e.slice(1).forEach((e=>{e.modifiers&&e.modifiers.forEach((e=>{e.mandatory?Kw(e.options,!1,!1):Kw(e.options,!1,!0)}))}))},Yw=(e,t)=>{t.forEach((r=>{e.options&&e.options.forEach((n=>{n.id===r.optionid&&(e.itemSelected=!0,n.itemSelected=!0),n.modifiers&&n.modifiers.forEach((e=>{Yw(e,t)}))}))}))};var Qw=()=>{var t;const r=E(),n=yt(),i=null===(t=Ir("foundProduct"))||void 0===t?void 0:t.product,a=y((e=>e.productDetails.data)),s=y((e=>e.productDetails.edit)),o=y((e=>e.productDetails.pageReload)),[l,c]=(0,e.useState)({message:null,design:null});return(0,e.useEffect)((()=>
2{if(i&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"view_item",ecommerce:{currency:"USD",value:i.cost,test:`this is the view_item event - ${Math.random()}`,items:[{item_id:i.id,item_name:i.name,price:i.cost,quantity:1}]}})),i&&i.modifiers)if(n.state&&n.state.type){let e=JSON.parse(JSON.stringify(i.modifiers));if(e.forEach((e=>{Yw(e,s.choices)})),s.specialinstructions){let e=s.specialinstructions.split(" | ")[0],t=s.specialinstructions.split(" | ")[1],r=null,n=null;if(e){let t=e.split("Custom Message: ")[1];r=t||null}if(t){let e=t.split("Custom Design: ")[1];n=e||null}c({message:r,design:n})}r(zc.createProduct(e))}else{r(zc.createProduct(null));let e=JSON.parse(JSON.stringify(i.modifiers));e.forEach((e=>{e.mandatory||"Add a soda?"===e.description?Kw(e.options,!0,!0):Kw(e.options,!1,!0)})),r(zc.createProduct(e))}}),[o,n]),(0,Dr.jsx)("div",{className:Ib,children:i&&a&&(0,Dr.jsx)(Jw,{specialinstructionsText:l})})},eC="PresentationBoxMobile_presentation_box__tPx5B",tC="PresentationBoxMobile_composite_image__cJNSn",rC="PresentationBoxMobile_composite_image_inner__U48mr";function nC(e,t){e&&e.forEach((e=>{if(e.itemSelected){var r;if(-1===t.findIndex((t=>t.id==e.id)))t.push({modName:e.description,id:e.id,selectedoptions:null===(r=e.options)||void 0===r?void 0:r.filter((e=>e.itemSelected))});e.options&&e.options.forEach((e=>{e.modifiers&&nC(e.modifiers,t)}))}else e.options&&e.options.forEach((r=>{if(r.itemSelected){var n;if(-1===t.findIndex((t=>t.id==e.id)))t.push({modName:e.description,id:e.id,selectedoptions:null===(n=e.options)||void 0===n?void 0:n.filter((e=>e.itemSelected))});r.modifiers&&nC(r.modifiers,t)}}))}))}var iC=()=>{var t;const r=null===(t=Ir("foundProduct"))||void 0===t?void 0:t.product,n=y((e=>e.product.product)),[i,a]=(0,e.useState)(null),s=y((e=>e.productDetails.data));return(0,e.useEffect)((()=>{let e=[];nC(s,e),a(e)}),[s]),(0,Dr.jsx)("div",{className:`${eC} presentation-box-create`,children:r&&(0,Dr.jsx)(Dr.Fragment,{children:r.image_large_url&&(0,Dr.jsxs)("div",{className:tC,children:[!r.name.toLowerCase().includes("cookie")&&(0,Dr.jsx)("div",{className:rC,children:(0,Dr.jsx)("img",{src:r.image_large_url,alt:r.name})}),r.name.toLowerCase().includes("cookie")&&(0,Dr.jsx)(Eb,{options:n,selectedOptions:i})]})})})};var aC=()=>{const t=E(),r=Dt(),n=ps("sm");t(Ix.setOpenedoption(0));let i=y((e=>e.location.location));const a=wt(),s=xt(),o=yt();return(0,e.useEffect)((()=>{var e,t,r;const n=null===(e=window.google_tag_manager)||void 0===e||null===(t=e["GTM-TDTC8Z9"])||void 0===t||null===(r=t.dataLayer)||void 0===r?void 0:r.reset;"function"===typeof n&&n()}),[]),(0,e.useEffect)((()=>{o&&o.pathname&&o.pathname.includes("/menu")&&s(`/gac/${i.location_slug}/product/${a.productSlug}`)}),[o]),(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:"",productPage:!0}),children:(0,Dr.jsx)(Vt,{resolve:r.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(Yv,{children:(0,Dr.jsxs)("div",{className:"relative",children:[(0,Dr.jsx)("div",{className:rx,children:(0,Dr.jsx)("img",{src:La,role:"presentation",alt:"",className:"image-cover"})}),(0,Dr.jsxs)("div",{className:`container-full ${nx}`,children:[i&&(0,Dr.jsx)("div",{className:ix,children:(0,Dr.jsxs)(er,{to:xa(i),children:[(0,Dr.jsx)(Qv,{}),"Back To Menu"]})}),(0,Dr.jsxs)("div",{className:tx,children:[n&&(0,Dr.jsx)(Pb,{}),!n&&(0,Dr.jsx)(iC,{}),(0,Dr.jsx)(Qw,{})]})]})]})})})})})})};var sC=()=>{const{data:t}=Dt();return console.log("data::::: ",t),(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t,errorElement:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("section",{className:H_,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Page Not Found"}),(0,Dr.jsx)("h3",{className:"text-center",children:"No cookies for you here :( !"})]})}),children:e=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(Yv,{children:(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(Na,{}),(0,Dr.jsx)(ja,{})]})})})})})};async function oC(e,t){const r=Ir("currentLocation");let n=new URL(document.location).searchParams.get("rwg_token");n&&ma("rwg_token",n,30);const i=async()=>{const r=await or(e);
2if(r.id){if(da(r.data,r.slug),Pr("currentLocationId",{currentLocationId:r.id,currentLocationSlug:r.location_slug},null),Pr("currentMenu",{menu:r},3600),Pr("currentLocation",{currentLocation:r,deliveryType:"pickup"},3600),null!==t){const e=await cr(r.id,t);if(e.id)return Pr("foundProduct",{product:e}),{menu:r,prodDetails:e};throw new Response("Not Found",{status:404})}return console.log("loc::::: ",r),r}throw new Response("Not Found",{status:404})};if(null===r){return i()}if(r.currentLocation.location_slug!==e){sessionStorage.removeItem("wasWarningShown");return await i()}if(da(r.currentLocation.data,r.currentLocation.slug),null!==t){const e=await cr(Ir("currentMenu").menu.id,t);if(e.id)return Pr("foundProduct",{product:e}),{menu:Ir("currentMenu").menu,prodDetails:e};throw new Response("Not Found",{status:404})}return function(e){e&&e.currentLocation&&e.currentLocation.data&&e.currentLocation.data.attributes&&e.currentLocation.data.attributes.includes("MSC")?document.documentElement.style.cssText="\n --color-cocoa: #584646;\n --color-raspberry: #08616a;\n --color-mint: #5bc6cc; \n --color-text-blue: #242c37;\n\n /* colors secondary */\n /* --color-dark-raspberry: #0b818e; */\n --color-dark-raspberry: #0b818e;\n /* --color-dark-raspberry-secondary: #8d1e59; */\n --color-dark-raspberry-secondary: #0b818e;\n --color-red: #AA0061;\n --color-dark-mint: #0B818E;\n --color-lemon: #f8de8d;\n --color-cream: #FFEAD4;\n --color-light-mint: #9bd7d7;\n --color-strawberry: #ebc6de;\n --color-sugar: #dcc5b7;\n --color-pink: #ECC5DE;\n\n /* colors aditional */\n --color-grey-bg: #f9f9f9;\n --color-grey-stroke: #d6d8d9;\n --color-grey-stroke-dark: #B2B5B9;\n --color-light-bg: #f8e0be;\n --color-light-bg-v2: #FBFAF8;\n --color-border: #E3E5E7;\n ":document.documentElement.style.cssText="\n --color-cocoa: #584646;\n --color-raspberry: #b7006a;\n --color-mint: #5bc6cc; \n --color-text-blue: #242c37;\n\n /* colors secondary */\n --color-dark-raspberry: #8d0e57;\n --color-dark-raspberry-secondary: #8d1e59;\n --color-red: #AA0061;\n --color-dark-mint: #0B818E;\n --color-lemon: #f8de8d;\n --color-cream: #FFEAD4;\n --color-light-mint: #9bd7d7;\n --color-strawberry: #ebc6de;\n --color-sugar: #dcc5b7;\n --color-pink: #ECC5DE;\n\n /* colors aditional */\n --color-grey-bg: #f9f9f9;\n --color-grey-stroke: #d6d8d9;\n --color-grey-stroke-dark: #B2B5B9;\n --color-light-bg: #f8e0be;\n --color-light-bg-v2: #FBFAF8;\n --color-border: #E3E5E7;\n "}(r),{menu:Ir("currentMenu").menu}}async function lC(e){let{request:t,params:r}=e;const n=r.locationSlug,i=r.productSlug||null;return me({data:oC(n,i)})}r(9181);var cC=()=>{const t=xt();let r=y((e=>e.location.location));return(0,e.useEffect)((()=>{r?r.data&&r.data.attributes&&r.data.attributes.includes("MSC")?t(`/marble-slab-creamery/${r.location_slug}`):r.data&&r.data.attributes&&r.data.attributes.findIndex((e=>e.includes("CNC")))>=0?t(`/co-marble-slab-creamery/${r.location_slug}`):t(`/gac/${r.location_slug}`):t("/")}),[r]),null};var uC=()=>{const t=Dt();return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,errorElement:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("section",{className:H_,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Page Not Found"}),(0,Dr.jsx)("h3",{className:"text-center",children:"No cookies for you here :( !"})]})}),children:()=>(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(cC,{}),(0,Dr.jsx)(Yv,{children:(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(Na,{}),(0,Dr.jsx)(ja,{})]})})]})})})};async function dC(e,t){const r=Ir("currentLocation");let n=new URL(document.location).searchParams.get("rwg_token");n&&ma("rwg_token",n,30);const i=async()=>{const r=await or(e);
2if(r.id){if(da(r.data,r.slug),Pr("currentLocationId",{currentLocationId:r.id,currentLocationSlug:r.slug},null),Pr("currentMenu",{menu:r},3600),Pr("currentLocation",{currentLocation:r,deliveryType:"pickup"},3600),null!==t){const e=await cr(r.id,t);if(e.id)return Pr("foundProduct",{product:e}),{menu:r,prodDetails:e};throw new Response("Not Found",{status:404})}return r}throw new Response("Not Found",{status:404})};if(null===r){return i()}if(r.currentLocation.slug!==e){sessionStorage.removeItem("wasWarningShown");return await i()}if(da(r.currentLocation.data,r.currentLocation.slug),null!==t){const e=await cr(Ir("currentMenu").menu.id,t);if(e.id)return Pr("foundProduct",{product:e}),{menu:Ir("currentMenu").menu,prodDetails:e};throw new Response("Not Found",{status:404})}return{menu:Ir("currentMenu").menu}}async function hC(e){let{request:t,params:r}=e;const n=r.locationSlug,i=r.productSlug||null;return me({data:dC(n,i)})}var pC={wrapper:"AccountLanding_wrapper__FyVu0",wrapper_inner:"AccountLanding_wrapper_inner__R8KRo",content:"AccountLanding_content__ygiNZ",sidebar:"AccountLanding_sidebar__OiVH9",btn_subtitute:"AccountLanding_btn_subtitute__CYP90",info_item:"AccountLanding_info_item__2NJcY",back_to_container:"AccountLanding_back_to_container__PVrff",form_wrapper:"AccountLanding_form_wrapper__BZtms",success_message:"AccountLanding_success_message__-VvZm",favorite_orders:"AccountLanding_favorite_orders__knZNd",favorites:"AccountLanding_favorites__xRoH6",controls:"AccountLanding_controls__QYlW0"};var mC=()=>{const t=xt(),r=E(),[n,i]=(0,e.useState)(!1),a=y((e=>e.auth.user));return(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsx)("div",{className:pC.wrapper,children:a&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("h1",{children:["Hello, ",a.first_name]}),(0,Dr.jsxs)("div",{className:pC.wrapper_inner,children:[(0,Dr.jsxs)("div",{className:pC.content,children:[(0,Dr.jsx)("h3",{children:"What would you like to do today?"}),(0,Dr.jsxs)("ul",{children:[(0,Dr.jsx)("li",{children:(0,Dr.jsx)(er,{to:"edit",children:"Edit Account Info"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)(er,{to:"favorites",children:"Go to Favorites"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)(er,{to:"recent",children:"Go to Recent Orders"})}),(0,Dr.jsx)("li",{children:(0,Dr.jsx)(er,{to:"rewards",children:"See my rewards"})}),(0,Dr.jsxs)("li",{children:[n&&(0,Dr.jsxs)("div",{className:pC.btn_subtitute,children:[(0,Dr.jsx)("span",{className:"loader dark-raspberry"})," ",(0,Dr.jsx)("span",{className:pC.btn_subtitute_span,children:"Sign Out"})]}),!n&&(0,Dr.jsx)("button",{onClick:async()=>{i(!0);const e=sessionStorage.getItem("token"),n=sessionStorage.getItem("olotoken"),a=await(async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/logout`,"POST",null))(e||n);a&&a.message?r(qi.setError({message:"Something went wrong"})):(sessionStorage.removeItem("currentCart"),r(vs.addCart(null)),r(Ha.logout()),t("/signin")),i(!1)},children:"Sign Out"})]})]})]}),(0,Dr.jsxs)("div",{className:pC.sidebar,children:[(0,Dr.jsx)("h4",{children:"Account Info"}),(0,Dr.jsxs)("div",{className:pC.info_item,children:[(0,Dr.jsx)("span",{children:"Name: "}),a.name]}),(0,Dr.jsxs)("div",{className:pC.info_item,children:[(0,Dr.jsx)("span",{children:"Email: "}),a.email]}),(0,Dr.jsxs)("div",{className:pC.info_item,children:[(0,Dr.jsx)("span",{children:"Phone: "}),a.phone]})]})]})]})})})},fC="MockAccount_container__85iRE",gC="MockAccount_mock_title__2sAkK",_C="MockAccount_mock_content__9OOHJ",yC="MockAccount_container_left__p52zf",vC="MockAccount_container_right__tyCmj";var xC=()=>(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:fC,children:[(0,Dr.jsx)("div",{className:gC}),(0,Dr.jsxs)("div",{className:_C,children:[(0,Dr.jsx)("div",{className:yC}),(0,Dr.jsx)("div",{className:vC})]})]})});var bC=e=>{let{text:t}=e;return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(xC,{}),s.createPortal((0,Dr.jsx)("div",{className:"preparing_restaurant",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_backdrop",children:(0,Dr.jsxs)("div",{className:"preparing_restaurant_container",children:[(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"}),(0,Dr.jsx)("div",{className:"preparing_restaurant_message",children:t})]})})}),document.getElementById("overlay-root"))]})};var wC=t=>{let{children:r}=t;const n=E(),i=xt();return(0,e.useEffect)((()=>{const e=sessionStorage.getItem("token"),t=sessionStorage.getItem("olotoken");e||t||(sessionStorage.removeItem("currentCart"),n(vs.addCart(null)),n(Ha.logout()),i("/signin"))}),[]),(0,Dr.jsx)(Dr.Fragment,{children:r})};var CC=()=>{const t=Dt();
2return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)(bC,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(wC,{children:(0,Dr.jsx)(mC,{})})})})})};async function SC(){const e=sessionStorage.getItem("token"),t=Ir("currentLocation");if(t){function n(e){return!!(e&&e.data&&e.data.attributes&&e.data.attributes.includes("Rewards Non-Participating"))}if(n(t.currentLocation))return fe("/")}if(e){const i=await jr(e);return i.message?(sessionStorage.removeItem("token"),fe("/signin")):i}const r=sessionStorage.getItem("olotoken");if(r){const a=await jr(r,"oloauth");if(a.message)return sessionStorage.removeItem("token"),fe("/signin");a.firstname&&a.firstname,a.lastname&&a.lastname,a.firstname&&a.firstname,a.lastname&&a.lastname,a.emailaddress,a.phone&&a.phone;return a}return fe("/signin")}async function kC(e){let{request:t,params:r}=e;return me({data:SC()})}var jC=()=>{const t=xt(),r=ca(),n=y((e=>e.auth.user));let i=y((e=>e.location.location));(0,e.useEffect)((()=>{(function(e){return!!(e&&e.data&&e.data.attributes&&e.data.attributes.includes("Rewards Non-Participating"))})(i)&&t("/"),r&&t("/account"),n&&t("/account")}),[r,t,n,i]);return(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:pC.wrapper,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Sign in to access your account page"}),(0,Dr.jsx)("div",{className:pC.form_wrapper,children:(0,Dr.jsx)(Ip,{closeSidebar:()=>{t("/account")}})})]})})};var EC=()=>{const t=E(),[r,n]=(0,e.useState)(!1),i=y((e=>e.auth.user)),a=ca(),s=(0,e.useRef)(null),o=(0,e.useRef)(null),l=(0,e.useRef)(null),c=(0,e.useRef)(null),[u,d]=(0,e.useState)({email:!0,phone:!0,firstName:!0,lastName:!0});return(0,Dr.jsx)("form",{onSubmit:async e=>{e.preventDefault();const r=s.current.value,i=o.current.value,u=l.current.value,h=c.current.value,p=!ta(r)&&ra(r),m=!ta(i),f=!ta(u),g=!ta(h);d({email:p,phone:m,firstName:f,lastName:g});if(p&&m&&f&&g){n(!0);const e={email:r,phone:i,first_name:u,last_name:h},s=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}`,"PUT",t))(a,e);s.message?t(qi.setError(s)):(t(qi.setError({message:"Account successfully updated!",type:"success"})),t(Ha.setUser(s))),n(!1)}},className:"form-fields-container",children:i&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"email_input",children:"Email"}),(0,Dr.jsx)("input",{type:"text",id:"email_input",placeholder:"Email",required:!0,ref:s,className:`${u.email?null:"error"}`,defaultValue:i.email}),!u.email&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a valid email!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"phone_input",children:"Phone"}),(0,Dr.jsx)("input",{type:"text",id:"phone_input",placeholder:"Phone",required:!0,ref:o,className:`${u.phone?null:"error"}`,defaultValue:i.phone}),!u.phone&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a phone number!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"first_name_input",children:"First Name"}),(0,Dr.jsx)("input",{type:"text",id:"first_name_input",placeholder:"First Name",required:!0,ref:l,className:`${u.firstName?null:"error"}`,defaultValue:i.first_name}),!u.firstName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"last_name_input",children:"Last Name"}),(0,Dr.jsx)("input",{type:"text",id:"last_name_input",placeholder:"Last Name",required:!0,ref:c,className:`${u.lastName?null:"error"}`,defaultValue:i.last_name}),!u.lastName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[!r&&(0,Dr.jsx)("button",{className:"btn",children:"Update account"}),r&&(0,Dr.jsx)("span",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})})};var TC=()=>{const[t,r]=(0,e.useState)(!0),n=()=>{r((e=>!e))};return(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:pC.wrapper,children:[(0,Dr.jsx)("div",{className:pC.back_to_container,children:(0,Dr.jsxs)(er,{to:"/account",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:(0,Dr.jsx)("path",{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"})}),"Back To Account"]})}),(0,Dr.jsx)("h1",{className:"text-center",children:"Edit Account Info"}),(0,Dr.jsx)("div",{className:pC.form_wrapper,children:(0,Dr.jsxs)("div",{className:pC.controls,children:[(0,Dr.jsx)("button",{onClick:n,className:`btn ${t?null:"btn-border"}`,children:"Edit basic information"}),(0,Dr.jsx)("button",{onClick:n,className:`btn ${t?"btn-border":null}`,children:"Change Password"})]})}),(0,Dr.jsxs)("div",{className:pC.form_wrapper,children:[t&&(0,Dr.jsx)(EC,{}),!t&&(0,Dr.jsx)(pp,{edit:!0})]})]})})};var PC=()=>{const t=Dt();
2return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)(bC,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(wC,{children:(0,Dr.jsx)(TC,{})})})})})},IC="FavoriteItem_item_title__LeMQN",MC="FavoriteItem_item_vendor__xzzL7",NC="FavoriteItem_item_products__ONovH",AC="FavoriteItem_controls__oFgu0",LC="FavoriteItem_product_item__4xHrD",DC="FavoriteItem_product_name__PqXH9",zC="FavoriteItem_choice__mo+qS";var OC=t=>{let{item:r}=t;const[n,i]=(0,e.useState)(),a=()=>{i((e=>!e))};return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("button",{className:"btn btn-small",onClick:a,children:"View Details"}),n&&(0,Dr.jsx)(Tp,{closeInfoHandler:a,transition:n,children:r.products&&r.products.length>0&&(0,Dr.jsx)("div",{className:NC,children:r.products.map((e=>(0,Dr.jsxs)("div",{className:LC,children:[(0,Dr.jsxs)("div",{className:DC,children:[e.quantity,"X",e.name]}),e.choices&&e.choices.length>0&&(0,Dr.jsx)("div",{className:"choices",children:e.choices.map((e=>(0,Dr.jsx)("div",{className:zC,children:(0,Dr.jsxs)("div",{className:"choice",children:[(0,Dr.jsx)("span",{children:e.name}),", quantity: ",e.quantity]})},e.id)))})]},e.productid)))})})]})};var RC=e=>{let{children:t,cancel:r,acceptText:n,accept:i}=e;return(0,Dr.jsxs)(Dr.Fragment,{children:[s.createPortal((0,Dr.jsx)(gc,{hide:r}),document.getElementById("backdrop-root")),s.createPortal((0,Dr.jsx)("div",{className:wp,children:(0,Dr.jsxs)("div",{className:Cp,children:[(0,Dr.jsxs)("button",{onClick:r,className:jp,children:[(0,Dr.jsx)(yc,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"close window"})]}),t,(0,Dr.jsxs)("div",{className:Ep,children:[i,r&&(0,Dr.jsx)("button",{className:"btn",onClick:r,children:"Cancel"})]})]})}),document.getElementById("overlay-root"))]})},FC="OrderAgain_info_container__Fv-Tb";var BC=t=>{let{item:r,tag:n}=t;const i=E(),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(!1),c=ca(),u=r;let d=y((e=>e.location.location));const h=async()=>{if(s(!0),sessionStorage.removeItem("currentCart"),i(vs.addCart(null)),n){const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/reorder`,"POST",t))(c,{order_id:u.id});e.id?(i(vs.addCart(e)),Mr("currentCart",e),i(vs.setCartSidebarStep("order")),i(vs.setCartSidebarState())):i(qi.setError(e))}else{const e={favorite_id:r.id,ignore_unavailable_products:1},t=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/create-favorite-order`,"POST",t))(c,e);t.id?(i(vs.addCart(t)),Mr("currentCart",t),i(vs.setCartSidebarStep("order")),i(vs.setCartSidebarState())):i(qi.setError(t))}s(!1)},p=(0,Dr.jsxs)(Dr.Fragment,{children:[a&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})}),!a&&(0,Dr.jsx)("button",{className:"btn",onClick:h,children:"Order again"})]});return(0,Dr.jsxs)(Dr.Fragment,{children:[!a&&(0,Dr.jsxs)("button",{className:"btn btn-small",onClick:async()=>{d.id===u.vendorid?h():l(!0)},children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M0 224c0 17.7 14.3 32 32 32s32-14.3 32-32c0-53 43-96 96-96H320v32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S320 19.1 320 32V64H160C71.6 64 0 135.6 0 224zm512 64c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 53-43 96-96 96H192V352c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V448H352c88.4 0 160-71.6 160-160z"})}),"Order again"]}),a&&(0,Dr.jsx)("div",{className:"btn btn-small",children:(0,Dr.jsx)("span",{className:"loader small"})}),o&&(0,Dr.jsx)(RC,{cancel:()=>{l(!1)},accept:p,children:(0,Dr.jsx)("div",{className:FC,children:(0,Dr.jsxs)("p",{children:["Do you want to clear your existing cart at ",(0,Dr.jsx)("span",{children:d.name})," and reorder your recent order from ",(0,Dr.jsx)("span",{children:u.vendorname}),"?"]})})})]})};var VC=t=>{let{item:r,removeitem:n}=t;const i=E(),[a,s]=(0,e.useState)(!1),o=ca();return(0,Dr.jsxs)(Dr.Fragment,{children:[!a&&(0,Dr.jsxs)("button",{className:"btn btn-small",onClick:async()=>{s(!0);const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/favorite-orders/${t}`,"DELETE",null))(o,r.id);e.message?i(qi.setError(e)):n(!0),s(!1)},children:[(0,Dr.jsx)("svg",{viewBox:"-2 0 18 18",xmlns:"http://www.w3.org/2000/svg","aria-label":"Delete",role:"img",children:(0,Dr.jsx)("path",{d:"M.996 15.504a1.5 1.5 0 001.501 1.501h9.006a1.5 1.5 0 001.5-1.5V4.996H.997v10.507zM9.502 7.5a.5.5 0 111 0v7.004a.5.5 0 11-1 0V7.5zM6.5 7.5a.5.5 0 011 0v7.004a.5.5 0 11-1 0V7.5zm-3.002 0a.5.5 0 011 0v7.004a.5.5 0 11-1 0V7.5zm10.006-5.503H9.752l-.294-.585a.75.75 0 00-.673-.416H5.211a.742.742 0 00-.669.416l-.294.585H.496a.5.5 0 00-.5.5v1a.5.5 0 00.5.5h13.008a.5.5 0 00.5-.5v-1a.5.5 0 00-.5-.5z"})}),(0,Dr.jsx)("span",{children:"Remove"})]}),a&&(0,Dr.jsx)("span",{className:"btn btn-small",children:(0,Dr.jsx)("span",{className:"loader small"})})]})};var $C=e=>{let{item:t,removeItemHandler:r}=e;return(0,Dr.jsxs)(zr,{direction:"column",children:[(0,Dr.jsx)("div",{className:IC,children:t.name}),(0,Dr.jsxs)("div",{className:MC,children:[(0,Dr.jsx)("span",{children:"Vendor: "}),t.vendorname]}),t.products&&t.products.length>0&&(0,Dr.jsx)("div",{className:NC,children:t.products.map((e=>(0,Dr.jsx)("div",{className:LC,children:(0,Dr.jsxs)("div",{className:DC,children:[e.quantity,"X",e.name]})},e.productid)))}),(0,Dr.jsxs)("div",{className:AC,children:[(0,Dr.jsx)(OC,{item:t}),(0,Dr.jsx)(BC,{item:t}),(0,Dr.jsx)(VC,{item:t,removeitem:r})]})]})};var UC=()=>{const t=E(),[r,n]=(0,e.useState)(),i=ca(),[a,s]=(0,e.useState)(!0),[o,l]=(0,e.useState)(!1);(0,e.useEffect)((()=>{(async()=>{const e=await(async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/favorite-orders`,null,null))(i);e.message?(t(qi.setError(e)),s(!1)):(s(!1),n(e))})()}),[t,i,o]);const c=()=>
2{l((e=>!e))};return(0,Dr.jsxs)("div",{className:pC.favorite_orders,children:[a&&(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"}),r&&!a&&r.length>0&&(0,Dr.jsx)("div",{className:"grid-3",children:r.map((e=>(0,Dr.jsx)($C,{item:e,removeItemHandler:c},e.id)))}),r&&!a&&0===r.length&&(0,Dr.jsx)("div",{children:(0,Dr.jsx)("p",{children:"There are no favorite orders"})})]})};var HC=t=>{let{item:r,removeLoc:n}=t;const i=E(),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(!1),c="pickup",u=ca();return(0,Dr.jsxs)(zr,{direction:"column",children:[(0,Dr.jsx)("div",{className:IC,children:r.vendorname}),(0,Dr.jsxs)("div",{className:AC,children:[!a&&(0,Dr.jsxs)("button",{className:"btn btn-small",onClick:async()=>{s(!0);const e=await sr(r.vendorid);if(e.id){const t=await ur({restaurant_id:r.vendorid});if(t.id){const n={delivery_mode:c,time:"asap",schedule_date:null,schedule_time:null};(async(e,t)=>{const n=await or(r.vendorid);Ar("currentCart"),i(vs.addCart(null)),i(_m.clearVirtualCart()),i(Vi.setLocationItem(t)),i(Vi.setMenuItem(n)),i(Vi.setVirtualDeliveryType(c)),Pr("currentLocationId",{currentLocationId:t.id,currentLocationSlug:t.location_slug},null),Pr("currentLocation",{currentLocation:t,deliveryType:c,time:"asap"},3600),Pr("currentMenu",{menu:n},3600),i(vs.addCart(e)),Mr("currentCart",e)})(await _r(t.id,n),e),i(qi.setError({message:`Location set as ${r.vendorname}`,type:"success"}))}else i(qi.setError(t))}else i(qi.setError(e));s(!1)},children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M256 0c17.7 0 32 14.3 32 32V66.7C368.4 80.1 431.9 143.6 445.3 224H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H445.3C431.9 368.4 368.4 431.9 288 445.3V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.3C143.6 431.9 80.1 368.4 66.7 288H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H66.7C80.1 143.6 143.6 80.1 224 66.7V32c0-17.7 14.3-32 32-32zM128 256a128 128 0 1 0 256 0 128 128 0 1 0 -256 0zm128-80a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"})}),"Set Location"]}),a&&(0,Dr.jsx)("span",{className:"btn btn-small",children:(0,Dr.jsx)("span",{className:"loader"})}),!o&&(0,Dr.jsxs)("button",{className:"btn btn-small",onClick:async e=>{l(!0);await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/favorite-locations/${t}
2`,"DELETE",null))(u,r.vendorid);n(!0),l(!1)},children:[(0,Dr.jsx)("svg",{viewBox:"-2 0 18 18",xmlns:"http://www.w3.org/2000/svg","aria-label":"Delete",role:"img",children:(0,Dr.jsx)("path",{d:"M.996 15.504a1.5 1.5 0 001.501 1.501h9.006a1.5 1.5 0 001.5-1.5V4.996H.997v10.507zM9.502 7.5a.5.5 0 111 0v7.004a.5.5 0 11-1 0V7.5zM6.5 7.5a.5.5 0 011 0v7.004a.5.5 0 11-1 0V7.5zm-3.002 0a.5.5 0 011 0v7.004a.5.5 0 11-1 0V7.5zm10.006-5.503H9.752l-.294-.585a.75.75 0 00-.673-.416H5.211a.742.742 0 00-.669.416l-.294.585H.496a.5.5 0 00-.5.5v1a.5.5 0 00.5.5h13.008a.5.5 0 00.5-.5v-1a.5.5 0 00-.5-.5z"})}),(0,Dr.jsx)("span",{children:"Remove"})]}),o&&(0,Dr.jsx)("span",{className:"btn btn-small",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})};var qC=()=>{const t=E(),[r,n]=(0,e.useState)(),i=ca(),[a,s]=(0,e.useState)(!0),[o,l]=(0,e.useState)(!1);(0,e.useEffect)((()=>{(async()=>{const e=await(async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/favorite-locations`,null,null))(i);e.message?(t(qi.setError(e)),s(!1)):(s(!1),n(e))})()}),[t,i,o]);const c=()=>{l((e=>!e))};return(0,Dr.jsxs)("div",{className:pC.favorite_orders,children:[a&&(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"}),r&&!a&&r.length>0&&(0,Dr.jsx)("div",{className:"grid-3",children:r.map((e=>(0,Dr.jsx)(HC,{item:e,removeLoc:c},e.id)))}),r&&!a&&0===r.length&&(0,Dr.jsx)("div",{children:"You haven't selected any favorite location"})]})};var ZC=()=>(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:pC.wrapper,children:[(0,Dr.jsx)("div",{className:pC.back_to_container,children:(0,Dr.jsxs)(er,{to:"/account",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:(0,Dr.jsx)("path",{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"})}),"Back To Account"]})}),(0,Dr.jsxs)("div",{className:pC.favorites,children:[(0,Dr.jsx)("h1",{className:"h2",children:"Favorite Orders"}),(0,Dr.jsx)(UC,{})]}),(0,Dr.jsxs)("div",{className:pC.favorites,children:[(0,Dr.jsx)("h2",{children:"Favorite Locations"}),(0,Dr.jsx)(qC,{})]})]})});var GC=()=>{const t=Dt();return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)(bC,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(wC,{children:(0,Dr.jsx)(ZC,{})})})})})};var WC=t=>{let{orderID:r}=t;const n=E(),i=(0,e.useRef)(null),[a,s]=(0,e.useState)(!1),[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(!1),d=ca(),h=()=>{s((e=>!e))};return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("button",{className:"btn btn-small",onClick:h,title:"add this order to favorites",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:(0,Dr.jsx)("path",{d:"M225.8 468.2l-2.5-2.3L48.1 303.2C17.4 274.7 0 234.7 0 192.8v-3.3c0-70.4 50-130.8 119.2-144C158.6 37.9 198.9 47 231 69.6c9 6.4 17.4 13.8 25 22.3c4.2-4.8 8.7-9.2 13.5-13.3c3.7-3.2 7.5-6.2 11.5-9c0 0 0 0 0 0C313.1 47 353.4 37.9 392.8 45.4C462 58.6 512 119.1 512 189.5v3.3c0 41.9-17.4 81.9-48.1 110.4L288.7 465.9l-2.5 2.3c-8.2 7.6-19 11.9-30.2 11.9s-22-4.2-30.2-11.9zM239.1 145c-.4-.3-.7-.7-1-1.1l-17.8-20c0 0-.1-.1-.1-.1c0 0 0 0 0 0c-23.1-25.9-58-37.7-92-31.2C81.6 101.5 48 142.1 48 189.5v3.3c0 28.5 11.9 55.8 32.8 75.2L256 430.7 431.2 268c20.9-19.4 32.8-46.7 32.8-75.2v-3.3c0-47.3-33.6-88-80.1-96.9c-34-6.5-69 5.4-92 31.2c0 0 0 0-.1 .1s0 0-.1 .1l-17.8 20c-.3 .4-.7 .7-1 1.1c-4.5 4.5-10.6 7-16.9 7s-12.4-2.5-16.9-7z"})}),(0,Dr.jsx)("span",{className:"sr-only",children:"add to favorites"})]}),a&&(0,Dr.jsxs)(Tp,{closeInfoHandler:h,transition:a,children:[(0,Dr.jsx)("h3",{children:"Just a step to better remember your order"}),(0,Dr.jsx)("form",{onSubmit:async e=>{u(!0),e.preventDefault();const t=i.current.value;if(ta(t))l(!0);else{l(!1);const e={order_id:r,name:t,default:0},i=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/favorite-orders`,"POST",t))(d,e);i.message?n(qi.setError(i)):(n(qi.setError({message:"Order successfully added to favorites!",type:"success"})),h())}u(!1)},children:(0,Dr.jsxs)("div",{className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",children:"Set a name for this order"}),(0,Dr.jsx)("input",{ref:i,type:"text",id:"favorite_order_name",name:"favorite_order_name",placeholder:"My favorite",required:!0,className:`${o?"error":null}`}),o&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name for your order"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[!c&&(0,Dr.jsx)("button",{className:"btn",children:"Add to favorites!"}),c&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})})]})]})};var XC=t=>{let{item:r}=t;const[n,i]=(0,e.useState)();return(0,e.useEffect)((()=>{let e="",t="";r.timeplaced.split(" ").forEach(((r,n)=>{if(0===n){const t=r.slice(0,4)+"-"+r.slice(4,6)+"-"+r.slice(6);e=t}1===n&&(t=r)})),i(e+"T"+t)}),[]),(0,Dr.jsxs)(zr,{direction:"column_perma",children:[(0,Dr.jsxs)("div",{className:IC,children:["Ordered at ",r.vend
2orname]}),(0,Dr.jsxs)("div",{className:MC,children:[(0,Dr.jsx)("span",{children:"Date: "}),new Date(n).toLocaleString("en-US")]}),(0,Dr.jsxs)("div",{className:MC,children:[(0,Dr.jsx)("span",{children:"Status: "}),r.status]}),(0,Dr.jsxs)("div",{className:MC,children:[(0,Dr.jsx)("span",{children:"Total: "}),"$",r.total]}),(0,Dr.jsxs)("div",{className:AC,children:[(0,Dr.jsx)(er,{to:`/order/${r.id}`,className:"btn btn-small",children:"View Details"}),(0,Dr.jsx)(BC,{item:r,tag:!0}),(0,Dr.jsx)(WC,{orderID:r.id})]})]})};var JC=()=>{const t=E(),[r,n]=(0,e.useState)(),i=ca(),[a,s]=(0,e.useState)(!0);return(0,e.useEffect)((()=>{(async()=>{const e=await(async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/recent-orders`,null,null))(i);e.message?(t(qi.setError(e)),s(!1)):(s(!1),n(e))})()}),[i]),(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:pC.wrapper,children:[(0,Dr.jsx)("div",{className:pC.back_to_container,children:(0,Dr.jsxs)(er,{to:"/account",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:(0,Dr.jsx)("path",{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"})}),"Back To Account"]})}),(0,Dr.jsx)("h1",{children:"Recent Orders"}),(0,Dr.jsxs)("div",{className:pC.favorite_orders,children:[a&&(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"}),r&&!a&&r.length>0&&(0,Dr.jsx)("div",{className:"grid-3",children:r.map((e=>(0,Dr.jsx)(XC,{item:e},e.id)))}),!r&&!a&&(0,Dr.jsx)("div",{children:(0,Dr.jsx)("p",{children:"There are no recent"})})]})]})})};var KC=()=>{const t=Dt();return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)(bC,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(wC,{children:(0,Dr.jsx)(JC,{})})})})})},YC={wrapper:"OrderStatusComponent_wrapper__Gxocy",page_header:"OrderStatusComponent_page_header__oP0dk",pickup_time:"OrderStatusComponent_pickup_time__DUaBW",pickup_time_label:"OrderStatusComponent_pickup_time_label__qu1+A",directions:"OrderStatusComponent_directions__xTKIt",thank_you:"OrderStatusComponent_thank_you__HVtcF",page_text:"OrderStatusComponent_page_text__4JVip",details:"OrderStatusComponent_details__tqNle",details_item:"OrderStatusComponent_details_item__4CApb",details_delivery:"OrderStatusComponent_details_delivery__jpDSQ",details_summary:"OrderStatusComponent_details_summary__+9SRD",details_header:"OrderStatusComponent_details_header__nY9iM",aditional_information:"OrderStatusComponent_aditional_information__YwhdY",card_container:"OrderStatusComponent_card_container__PPl0W",card:"OrderStatusComponent_card__d-GfR",card_item:"OrderStatusComponent_card_item__gu+9M",card_item_border:"OrderStatusComponent_card_item_border__4jl69",card_item_simple:"OrderStatusComponent_card_item_simple__eTKJ1",card_item_header:"OrderStatusComponent_card_item_header__SnpjX",location_address:"OrderStatusComponent_location_address__Pc10V",location_name:"OrderStatusComponent_location_name__oEsa+",location_distance:"OrderStatusComponent_location_distance__56T5n",location_phone:"OrderStatusComponent_location_phone__0txnL",store_info_header:"OrderStatusComponent_store_info_header__xF1qQ",item_header:"OrderStatusComponent_item_header__LyhJ+",item_price:"OrderStatusComponent_item_price__V+pRz",item_title:"OrderStatusComponent_item_title__bGee2",item_description:"OrderStatusComponent_item_description__TVIbK",order_page_footer:"OrderStatusComponent_order_page_footer__8CoBP",order_status:"OrderStatusComponent_order_status__0VFiJ"},QC="DispatchOrderTracker_order_delivery_stages__43NKl",eS="DispatchOrderTracker_order_delivery_stage__Ykd1T",tS="DispatchOrderTracker_stage_active__6gnWN";var rS=t=>{let{status:r}=t;const[n,i]=(0,e.useState)({received:!0,inProgress:!1,out:!1,delivered:!1});return(0,e.useEffect)((()=>{i({received:"Pending"===r||"PickupInProgress"===r||"DeliveryInProgress"===r||"Delivered"===r,inProgress:"PickupInProgress"===r||"DeliveryInProgress"===r||"Delivered"===r,out:"DeliveryInProgress"===r||"Delivered"===r,delivered:"Delivered"===r})}),[r]),(0,Dr.jsxs)("div",{className:QC,children:[(0,Dr.jsxs)("div",{className:`${eS} ${n.received&&tS}`,children:[(0,Dr.jsxs)("span",{children:[!n.received&&(0,Dr.jsx)(Dr.Fragment,{children:"1"}),n.received&&(0,Dr.jsx)(av,{})]}),"Order Received"]}),(0,Dr.jsxs)("div",{className:`${eS} ${n.inProgress&&tS}`,children:[(0,Dr.jsxs)("span",{children:[!n.inProgress&&(0,Dr.jsx)(Dr.Fragment,{children:"1"}),n.inProgress&&(0,Dr.jsx)(av,{})]}),"Pickup in Progress"]}),(0,Dr.jsxs)("div",{className:`${eS} ${n.out&&tS}`,children:[(0,Dr.jsxs)("span",{children:[!n.out&&(0,Dr.jsx)(Dr.Fragment,{children:"1"}),n.out&&(0,Dr.jsx)(av,{})]}),"Out for Delivery"]}),(0,Dr.jsxs)("div",{className:`${eS} ${n.delivered&&tS}`,children:[(0,Dr.jsxs)("span",{children:[!n.delivered&&(0,Dr.jsx)(Dr.Fragment,{children:"1"}),n.delivered&&(0,Dr.jsx)(av,{})]}),"Delivered"]})]})};var nS=()=>{const t=wt(),[r,n]=(0,e.useState)(!1),[i,a]=(0,e.useState)(null);return(0,e.useEffect)((()=>{(async()=>
2{if(n(!0),t&&t.orderId){const e=await(async e=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/orders/${e}/dispatch-status`,null,null))(t.orderId);a(e[0])}n(!1)})()}),[t]),(0,Dr.jsxs)(Dr.Fragment,{children:[r&&(0,Dr.jsx)("div",{className:"loader-box",children:(0,Dr.jsx)("span",{className:"loader dark"})}),!r&&(0,Dr.jsxs)(Dr.Fragment,{children:[i&&"Scheduled"!==i.status&&(0,Dr.jsx)(rS,{status:i.status}),i&&"Scheduled"===i.status&&(0,Dr.jsx)("div",{className:QC,children:"Your tracking informaiton will show up in here once the order is ready for processing"}),i&&"Canceled"===i.status&&(0,Dr.jsx)("div",{className:QC,children:"Your order has been canceled!"})]})]})};var iS=e=>{let{fill:t,dimensions:r}=e;return(0,Dr.jsxs)("svg",{width:r&&r.width?r.width:"17",height:r&&r.height?r.height:"19",viewBox:"0 0 17 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Dr.jsx)("path",{d:"M12.53 12.06H3.83C3.42 12.06 3.08 11.72 3.08 11.31C3.08 10.9 3.42 10.56 3.83 10.56H12.53C12.94 10.56 13.28 10.9 13.28 11.31C13.28 11.72 12.94 12.06 12.53 12.06Z",fill:t||"#584646"}),(0,Dr.jsx)("path",{d:"M12.53 14.97H3.83C3.42 14.97 3.08 14.63 3.08 14.22C3.08 13.81 3.42 13.47 3.83 13.47H12.53C12.94 13.47 13.28 13.81 13.28 14.22C13.28 14.63 12.94 14.97 12.53 14.97Z",fill:t||"#584646"}),(0,Dr.jsx)("path",{d:"M12.53 9.08H3.83C3.42 9.08 3.08 8.74 3.08 8.33C3.08 7.92 3.42 7.58 3.83 7.58H12.53C12.94 7.58 13.28 7.92 13.28 8.33C13.28 8.74 12.94 9.08 12.53 9.08Z",fill:t||"#584646"}),(0,Dr.jsx)("path",{d:"M15.61 2.59H13.28V0.75C13.28 0.33 12.94 0 12.53 0C12.12 0 11.78 0.33 11.78 0.75V2.59H10.38V0.75C10.38 0.33 10.04 0 9.63 0C9.22 0 8.88 0.33 8.88 0.75V2.59H7.48V0.75C7.48 0.33 7.14 0 6.73 0C6.32 0 5.98 0.33 5.98 0.75V2.59H4.58V0.75C4.58 0.33 4.24 0 3.83 0C3.42 0 3.08 0.33 3.08 0.75V2.59H0.75C0.34 2.59 0 2.93 0 3.34V18.19C0 18.61 0.34 18.94 0.75 18.94H15.61C16.02 18.94 16.36 18.61 16.36 18.19V3.34C16.36 2.93 16.02 2.59 15.61 2.59ZM14.86 17.44H1.5V4.09H3.08V4.93C3.08 5.35 3.42 5.68 3.83 5.68C4.24 5.68 4.58 5.35 4.58 4.93V4.09H5.98V4.93C5.98 5.35 6.32 5.68 6.73 5.68C7.14 5.68 7.48 5.35 7.48 4.93V4.09H8.88V4.93C8.88 5.35 9.22 5.68 9.63 5.68C10.04 5.68 10.38 5.35 10.38 4.93V4.09H11.78V4.93C11.78 5.35 12.12 5.68 12.53 5.68C12.94 5.68 13.28 5.35 13.28 4.93V4.09H14.86V17.44Z",fill:t||"#584646"})]})};var aS=()=>{const t=wt(),[r,n]=(0,e.useState)(null),i=ca(),a=JSON.parse(sessionStorage.getItem(t.orderId));return(0,e.useEffect)((()=>{!async function(){const e=await sr(a.vendorid);n(e)}()}),[a.vendorid]),(0,Dr.jsxs)("div",{className:"container-full",children:[a&&(0,Dr.jsxs)("div",{className:YC.wrapper,children:["Completed"!==a.status&&(0,Dr.jsxs)(Dr.Fragment,{children:["pickup"===a.deliverymode&&(0,Dr.jsxs)("div",{className:YC.intro,children:[(0,Dr.jsx)("h1",{className:YC.page_header,children:"Pickup instructions"}),(0,Dr.jsx)("div",{className:YC.page_text,children:(0,Dr.jsx)("p",{children:"Go Straight to Order Pickup At the Counter & Tell a Crew Member You Ordered Online."})}),(0,Dr.jsxs)("div",{className:YC.pickup_time,children:[(0,Dr.jsxs)("div",{className:YC.pickup_time_label,children:[(0,Dr.jsx)(Ks,{}),"Your order will be ready for pickup at:"]}),(0,Dr.jsx)("span",{children:Xi(a.readytime?a.readytime:a.earliestreadytime)})]}),(0,Dr.jsx)("div",{className:YC.directions})]}),"curbside"===a.deliverymode&&(0,Dr.jsxs)("div",{className:YC.intro,children:[(0,Dr.jsx)("h1",{className:YC.page_header,children:"Curbside Instructions"}),(0,Dr.jsx)("div",{className:YC.page_text,children:(0,Dr.jsx)("p",{children:"Your order has been confirmed. When you arrive, please let us know you're here so the store knows to bring your order."})})]}),"dispatch"===a.deliverymode&&(0,Dr.jsxs)("div",{className:YC.intro,children:[(0,Dr.jsx)("h1",{className:YC.page_header,children:"Order tracker"}),(0,Dr.jsx)(nS,{}),(0,Dr.jsx)("div",{className:YC.page_text,children:"We have your order in our system and it's getting prepared!"})]})]}),(0,Dr.jsxs)("div",{className:YC.thank_you,children:[(0,Dr.jsx)("h2",{className:YC.page_header,children:"Thank You"}),(0,Dr.jsx)("div",{className:YC.page_text,children:(0,Dr.jsx)("p",{children:"Thanks for your order! Visit our website to give us a shout and let us know what you think!"})})]}),(0,Dr.jsxs)("div",{className:YC.details,children:[(0,Dr.jsxs)("div",{className:`${YC.details_item} ${YC.details_delivery}`,children:[(0,Dr.jsxs)("div",{className:YC.details_header,children:[(0,Dr.jsx)(Es,{fill:"#8D0E57",dimensions:{width:37,height:23}}),"delivery details"]}
2),(0,Dr.jsxs)("div",{className:YC.card_container,children:["pickup"===a.deliverymode&&(0,Dr.jsxs)("div",{className:YC.store_info_header,children:[(0,Dr.jsx)(js,{}),"Pickup from"]}),"curbside"===a.deliverymode&&(0,Dr.jsxs)("div",{className:YC.store_info_header,children:[(0,Dr.jsx)(Ts,{}),"Order Location"]}),"dispatch"===a.deliverymode&&(0,Dr.jsxs)("div",{className:YC.store_info_header,children:[(0,Dr.jsx)(Es,{}),"delivering from"]}),r&&(0,Dr.jsxs)("div",{className:YC.card,children:[(0,Dr.jsxs)("div",{className:YC.card_item_simple,children:[(0,Dr.jsx)("div",{className:YC.location_name,children:a.vendorname}),(0,Dr.jsx)("div",{className:YC.location_address,children:r.address.street})]}),(0,Dr.jsx)("div",{className:`${YC.card_item} ${YC.card_item_border}`,children:(0,Dr.jsxs)("div",{className:YC.card_item,children:[(0,Dr.jsx)(ig,{dimensions:{width:18,height:18}})," ",r.telephone]})})]}),"dispatch"===a.deliverymode&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:YC.store_info_header,children:"Deliver To"}),(0,Dr.jsx)("div",{className:YC.card,children:(0,Dr.jsxs)("p",{children:[a.deliveryaddress.streetaddress,", ",a.deliveryaddress.zipcode,", ",a.deliveryaddress.city]})})]})]})]}),(0,Dr.jsxs)("div",{className:`${YC.details_item} ${YC.details_summary}`,children:[(0,Dr.jsxs)("div",{className:YC.details_header,children:[(0,Dr.jsx)(Ss,{fill:"#8D0E57",dimensions:{width:16,height:21}}),"order summary"]}),(0,Dr.jsxs)("div",{className:YC.card_container,children:[(0,Dr.jsxs)("div",{className:YC.order_contents,children:[(0,Dr.jsxs)("div",{className:YC.store_info_header,children:[(0,Dr.jsx)(Ss,{fill:"#584646"}),"Contents"]}),a.products.map((e=>(0,Dr.jsxs)("div",{className:YC.card,children:[e.image&&(0,Dr.jsx)("div",{className:YC.image_container,children:(0,Dr.jsx)("img",{src:e.image,alt:e.title})}),(0,Dr.jsxs)("div",{children:[(0,Dr.jsxs)("div",{className:YC.item_header,children:[(0,Dr.jsx)("div",{className:YC.item_title,children:e.name}),(0,Dr.jsxs)("div",{className:YC.item_price,children:["$",ia(e.totalcost)]})]}),(0,Dr.jsx)("div",{className:YC.item_description,children:e.choices.map((e=>e.name)).join(", ")})]})]},e.id)))]}),(0,Dr.jsxs)("div",{className:YC.aditional_information,children:[(0,Dr.jsxs)("div",{className:YC.store_info_header,children:[(0,Dr.jsx)(iS,{}),"Additional details"]}),(0,Dr.jsxs)("div",{className:YC.card,children:[(0,Dr.jsxs)("div",{className:YC.card_item,children:["Order Number",(0,Dr.jsx)("span",{children:a.oloid})]}),(0,Dr.jsxs)("div",{className:`${YC.card_item} ${YC.card_item_border}`,children:["Payment Method",(0,Dr.jsx)("span",{children:"Credit Card"})]}),"curbside"===a.deliverymode&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:`${YC.card_item} ${YC.card_item_border}`,children:["Make",(0,Dr.jsx)("span",{children:a.customfields[0].value})]}),(0,Dr.jsxs)("div",{className:`${YC.card_item} ${YC.card_item_border}`,children:["Model",(0,Dr.jsx)("span",{children:a.customfields[1].value})]}),(0,Dr.jsxs)("div",{className:`${YC.card_item} ${YC.card_item_border}`,children:["Color",(0,Dr.jsx)("span",{children:a.customfields[2].value})]})]})]}),(0,Dr.jsxs)("div",{className:YC.card,children:[(0,Dr.jsxs)("div",{className:`${YC.card_item} ${YC.card_item_header}`,children:["Order total",(0,Dr.jsxs)("span",{children:["$",ia(a.total)]})]}),(0,Dr.jsxs)("div",{className:`${YC.card_item} ${YC.card_item_border}`,children:["Subtotal",(0,Dr.jsxs)("span",{children:["$",ia(a.subtotal)]})]}),0!==a.customerhandoffcharge&&(0,Dr.jsxs)("div",{className:YC.card_item,children:["Delivery Charge",(0,Dr.jsxs)("span",{children:["$",ia(a.customerhandoffcharge)]})]}),0!==a.tip&&(0,Dr.jsxs)("div",{className:YC.card_item,children:["Tip",(0,Dr.jsxs)("span",{children:["$",ia(a.tip)]})]}),(0,Dr.jsxs)("div",{className:YC.card_item,children:["Tax",(0,Dr.jsxs)("span",{children:["$",ia(a.taxes[0].tax)]})]})]})]})]})]})]})]}),i&&(0,Dr.jsxs)("div",{className:YC.order_page_footer,children:[(0,Dr.jsx)(er,{to:"/account/recent",className:"btn",children:"See All Recent Orders"}),(0,Dr.jsx)(WC,{orderID:a.id})]})]})};var sS=()=>{const t=Dt();
2return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:"Tracking Order, please wait"}),children:(0,Dr.jsx)(Vt,{resolve:t.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(aS,{})})})})};async function oS(e){if(e){const t=JSON.parse(sessionStorage.getItem(e));if(t)return t;const r=await Cr(e);return sessionStorage.setItem(r.id,JSON.stringify(r)),r}return fe("/")}function lS(e){let{request:t,params:r}=e;const n=r.orderId;return me({data:oS(n)})}var cS="RewardsItem_item_title__+keq+",uS="RewardsItem_item_image__iZVR2";var dS=e=>{let{item:t}=e;return(0,Dr.jsxs)(zr,{direction:"column_perma",children:[(0,Dr.jsx)("div",{className:uS,children:(0,Dr.jsx)("img",{src:t.reward_image_url,alt:t.name,className:"image-contain"})}),(0,Dr.jsx)("div",{className:cS,children:t.name})]})};var hS=()=>{const t=E(),[r,n]=(0,e.useState)(null),[i,a]=(0,e.useState)(!0),s=sessionStorage.getItem("token"),o=sessionStorage.getItem("olotoken");return(0,e.useEffect)((()=>{(async()=>{const e=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/account-rewards-information${t?"?auth_provider="+t:""}`,null,null))(s||o,s?null:"oloauth");e.message?(t(qi.setError(e)),a(!1)):(a(!1),n(e))})()}),[s]),(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:pC.wrapper,children:[(0,Dr.jsx)("div",{className:pC.back_to_container,children:(0,Dr.jsxs)(er,{to:"/account",children:[(0,Dr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:(0,Dr.jsx)("path",{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"})}),"Back To Account"]})}),(0,Dr.jsx)("h1",{children:"Available Rewards"}),(0,Dr.jsxs)("div",{className:pC.favorite_orders,children:[i&&(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"}),r&&!i&&r.total_points&&(0,Dr.jsxs)(Dr.Fragment,{children:["You currently have ",r.point_balances," redeemable points (out of ",r.total_points," lifetime points)."]}),r&&!i&&r.reward_balances&&r.reward_balances.length>0&&(0,Dr.jsx)("div",{className:"grid-5",children:r.reward_balances.map((e=>(0,Dr.jsx)(dS,{item:e},e.reward_id)))}),!r&&!i&&(0,Dr.jsx)("div",{children:(0,Dr.jsx)("p",{children:"There are no rewards"})})]})]})})};var pS=()=>{const t=Dt();return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)(bC,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(wC,{children:(0,Dr.jsx)(hS,{})})})})})},mS=r(540);var fS=t=>{let{position:r,btnText:n,btnClass:i}=t;const a=E(),s=xt(),[o,l]=(0,e.useState)(!1),c=(0,e.useRef)(null),u=(0,e.useRef)(null),d=(0,e.useRef)(null),h=(0,e.useRef)(null),p=(0,e.useRef)(null),m=(0,e.useRef)(null),f=(0,e.useRef)(null),[g,_]=(0,e.useState)({email:!0,phone:!0,firstName:!0,lastName:!0,password:!0,matchPassword:!0,checkBoxRef:!0}),[y,v]=(0,e.useState)("");return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsxs)("div",{className:yp,children:[(0,Dr.jsx)("p",{children:"We've combined Great American Cookies & Marble Slab Creamery Rewards! You can now earn points and redeem rewards at your favorite Great American Cookies and Marble Slab Creamery locations."}),(0,Dr.jsx)("p",{children:"If you have an existing Great American Cookies Rewards account, please proceed to log in to the new app or at online checkout. If you have an existing Marble Slab Creamery Rewards account, please complete the migration form to migrate your existing points.*"})]}),(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault();const t=c.current.value,r=u.current.value,n=d.current.value,i=h.current.value,o=p.current.value,g=m.current.value,y=f.current.checked,v=!ta(t)&&ra(t),x=!ta(r),b=!ta(n),w=!ta(i),C=!ta(o)&&!ta(g),S=na(o,g);_({email:v,phone:x,firstName:b,lastName:w,password:C,matchPassword:S,checkBoxRef:y});if(v&&x&&b&&w&&C&&S&&y){l(!0);const e={email:t,phone:r,first_name:n,last_name:i,password:o},c=Nr("currentCart"),u=await kr(e);if(u.message)a(qi.setError(u));else{a(Ha.login(u)),console.log("login::::: ",u);const e=await Tr(u.authtoken,{access_token:u.access_token}),t=await jr(u.authtoken);if(a(Ha.setUser(t)),c){const e=await dr(c.id,u.authtoken);e.id&&Mr("currentCart",e)}if(e.message)console.log("there was an error::::: ",e);else if(e.user.migrate_status)s("/");else{let e=await Er(u.authtoken,{access_token:u.access_token});e.message?a(qi.setError(e)):s("token")}}l(!1)}},className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"email_input",children:"Email"}),(0,Dr.jsx)("input",{type:"email",id:"email_input",placeholder:"Email",required:!0,ref:c,className:`${g.email?null:"error"}`}),!g.email&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a valid email!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"phone_input",children:"Phone"}),(0,Dr.jsx)("input",{type:"text",id:"phone_input",value:y,placeholder:"Phone",required:!0,ref:u,className:`${g.phone?null:"error"}`,onChange:e=>{v(ea(e.target.value))}}),!g.phone&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a phone number!"})]}),(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"first_name_input",children:"First Name"}),(0,Dr.jsx)("input",{type:"text",id:"first_name_input",placeholder:"First Name",required:!0,ref:d,className:`${g.firstName?null:"error"}`}),!g.firstName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"last_name_input",children:"Last Name"}),(0,Dr.jsx)("input",{type:"text",id:"last_name_input",placeholder:"Last Name",required:!0,ref:h,className:`${g.lastName?null:"error"}`}),!g.lastName&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a name!"})]})]}),(0,Dr.jsxs)("div",{className:"form-controller-group",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"password_input",children:"Password"}),(0,Dr.jsx)("input",{id:"password_input",type:"password",required:!0,minLength:8,ref:p,className:`${g.password?null:"error"}`}),!g.password&&(0,Dr.jsx)("div",{className:"error-message",children:"Please enter a password!"})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"confirm_password_input",children:"Confirm Password"}),(0,Dr.jsx)("input",{id:"confirm_password_input",type:"password",minLength:8,required:!0,ref:m,className:`${g.matchPassword?null:"error"}`}),!g.matchPassword&&(0,Dr.jsx)("div",{className:"error-message",children:"Passwords don not match!"})]})]}),(0,Dr.jsxs)("div",{className:"form-controller form-group-checkbox",children:[(0,Dr.jsx)("input",{ref:f,type:"checkbox",id:"terms_and_conditions",name:"terms_and_conditions"}),(0,Dr.jsxs)("label",{htmlFor:"terms_and_conditions",children:["I agree to the Great American Cookies & Marble Slab Creamery Rewards ",(0,Dr.jsx)("a",{href:"https://greatamericancookies.com/rewards-terms/",target:"_blank",rel:"noreferrer",className:xp,children:"Terms and Conditions"})]}),!g.checkBoxRef&&(0,Dr.jsx)("div",{className:"error-message",children:"You need to agree to the terms and conditions!"})]}
2),(0,Dr.jsxs)("div",{className:"form-controller",children:[!o&&(0,Dr.jsx)("button",{className:`btn ${i||""}`,type:"submit",children:n||"Sign up"}),o&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]}),(0,Dr.jsx)("div",{className:vp,children:(0,Dr.jsx)("p",{children:"*Existing Marble Slab Creamery Rewards members are eligible to migrate their existing points earned through 9/3/24 11:59 pm EST to the combined Great American Cookies and Marble Slab Creamery Rewards program. Previously earned Marble Slab Creamery rewards (birthday, anniversary, etc.) are not eligible for migration. Earned $5 OFF rewards for reaching 50 points are eligible for migration."})})]})},gS="Migrate_container__b-UZH",_S="Migrate_min_container__c8J3C",yS="Migrate_min_container__9Cs1m",vS="Migrate_text_container__VXSqf",xS="Migrate_btn_container__mrMlF";var bS=()=>{const t=E(),[r,n]=(0,e.useState)(!1),[i,a]=(0,e.useState)(!1),s=(y((e=>e.auth.tokens)),y((e=>e.auth.user))),o=Ir("tokens");return(0,Dr.jsxs)("div",{className:yS,children:[!i&&(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("div",{className:vS,children:(0,Dr.jsx)("p",{children:"A migration verification code was sent to your email. Please check it and add it here to complete your migration."})}),(0,Dr.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),n(!0);const r=new FormData(e.target),i=Object.fromEntries(r.entries());if(i&&""!==i.token_input){const e={access_token:o.access_token,token:i.token_input,username:s.email},r=await(async(e,t)=>await nr(`https://ordernew-admin.greatamericancookies.com/api/v1/user/${e}/migrate-account`,"PUT",t))(o.authtoken,e);r.message?t(qi.setError(r)):a(!0)}n(!1)},className:"form-fields-container",children:[(0,Dr.jsxs)("div",{className:"form-controller",children:[(0,Dr.jsx)("label",{className:"label",htmlFor:"token_input",children:"Migration verification code"}),(0,Dr.jsx)("input",{type:"text",id:"token_input",name:"token_input",placeholder:"Enter your migration code",required:!0})]}),(0,Dr.jsxs)("div",{className:"form-controller",children:[!r&&(0,Dr.jsx)("button",{className:"btn btn-large",type:"submit",children:"Submit"}),r&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]})]}),i&&(0,Dr.jsx)("div",{children:"Migration Complete!"})]})};var wS=()=>{const t=E(),[r,n]=(0,e.useState)(!1),[i,a]=(0,e.useState)(!1),s=(y((e=>e.auth.tokens)),Ir("tokens"));return(0,Dr.jsx)("div",{className:yS,children:(0,Dr.jsxs)("div",{children:[!r&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)("div",{className:vS,children:(0,Dr.jsx)("p",{children:"To complete your migration proccess hit the button bellow. This will send a token to your email to be verified on the next step."})}),(0,Dr.jsxs)("div",{className:xS,children:[!i&&(0,Dr.jsx)("button",{className:"btn",onClick:async()=>{a(!0);let e=await Er(s.authtoken,{access_token:s.access_token});e.message?t(qi.setError(e)):n(!0),a(!1)},children:"Send Token"}),i&&(0,Dr.jsx)("div",{className:"btn",children:(0,Dr.jsx)("span",{className:"loader"})})]})]}),r&&(0,Dr.jsx)(bS,{})]})})};var CS=e=>{let{title:t,type:r,subtitle:n,supTitle:i,styleType:a}=e,s=y((e=>e.location.location));return(0,Dr.jsxs)("div",{className:`${Ea.banner} ${Ea.banner_set} ${a?Ea[a]:""}`,children:[(0,Dr.jsxs)("div",{className:`${Ea.banner_inner_wrapper} ${Ea.banner_inner_wrapper_set} ${s&&s.cobranded?Ea.banner_inner_wrapper_cobrand:""}`,children:[(0,Dr.jsxs)("div",{className:`${Ea.graphic_container} ${Ea.graphic_container_left} ${s&&s.data.attributes.includes("MSC")?Ea.graphic_container_msc:null}`,children:[r&&"CNC"===r&&(0,Dr.jsx)("img",{src:Ta,alt:"banner",className:`${Ea.side_image} ${Ea.side_image_msc} image-contain`}),!r&&(0,Dr.jsx)("img",{src:Ta,alt:"banner",className:`${Ea.side_image} image-contain`})]}),(0,Dr.jsxs)("div",{className:`${Ea.banner_inner} ${Ea.banner_inner_set}`,children:[i&&(0,Dr.jsx)("div",{className:Ea.supTitle,children:i}),(0,Dr.jsx)("h1",{className:`${Ea.title} ${Ea.title_set}`,dangerouslySetInnerHTML:{__html:t}}),n&&(0,Dr.jsx)("div",{className:Ea.subtitle,children:n})]}),(0,Dr.jsxs)("div",{className:`${Ea.graphic_container} ${Ea.graphic_container_right} ${s&&s.data.attributes.includes("MSC")?Ea.graphic_container_msc:null}`,children:[r&&"CNC"===r&&(0,Dr.jsx)("img",{src:Pa,alt:"banner",className:`${Ea.side_image} image-contain`}),!r&&(0,Dr.jsx)("img",{src:Pa,alt:"banner",className:`${Ea.side_image} image-contain`,width:709,height:712})]})]}),(0,Dr.jsx)("div",{className:Ea.banner_bottom_line})]})};var SS=()=>{const t=y((e=>e.auth.user)),r=Ir("tokens"),[n,i]=(0,e.useState)(null);return(0,e.useEffect)((()=>{!async function(){if(r){let e=await Tr(r.authtoken,{access_token:r.access_token});e.message?i(null):i(e)}else i(null)}()}),[]),(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(CS,{title:"Marble Slab Creamery Rewards/ Slab Happy Rewards Account Migration",type:"CNC"}),(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("div",{className:gS,children:[!t&&(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)(fS,{btnText:"Migrate My Account",btnClass:"btn-large"})}),n&&(0,Dr.jsxs)(Dr.Fragment,{children:[n.user&&!n.user.migrate_status&&"email"===n.user.verification_mode&&(0,Dr.jsx)(wS,{}),n.user&&n.user.migrate_status&&null===n.user.verification_mode&&(0,Dr.jsx)("div",{className:_S,children:(0,Dr.jsx)("h4",{children:"Account migration is already complete"})}),n.user&&!n.user.migrate_status&&null===n.user.verification_mode&&(0,Dr.jsx)("div",{className:_S,children:(0,Dr.jsx)("h4",{children:"Account migration is not posible"})})]})]})})]})};var kS=()=>(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(CS,{title:"Marble Slab Creamery Rewards/ Slab Happy Rewards Account Migration",type:"CNC"}),(0,Dr.jsx)(bS,{})]});var jS="LocationsPage_container__mIWl+",ES="LocationsPage_map_container__yojKJ",TS="LocationsPage_search_container__XaZ1k";var PS=()=>{const e=ps("md900");return(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("div",{className:jS,children:[(0,Dr.jsx)("div",{className:ES,children:e&&(0,Dr.jsx)(Rg,{activeState:!0,children:(0,Dr.jsx)(zg,{zoom:4,center:[-87.6298,41.8781]})})}),(0,Dr.jsx)("div",{className:TS,children:(0,Dr.jsx)(Mg,{closeSidebar:null})})]})})},IS="AllLocations_container_wrapper__V2dsW",MS="AllLocations_container__3Jn1H",NS="AllLocations_title__LACVi",AS="AllLocations_item__Gt9ed",LS="AllLocations_state__i2dZu",DS="AllLocations_store_number__wlaXL",zS="AllLocations_store_number_header__FJkI9",OS="AllLocations_locations_counter__dY8YE",RS="AllLocations_city_name__CoYh4",FS="AllLocations_breadcrumb__zkyWk",BS="AllLocations_separator__OOuoN",VS="AllLocations_breadcrumb_link__FYT-x",$S="AllLocations_breadcrumb_current__fVzWJ";var US=()=>{const[t,r]=(0,e.useState)(null),n=Ir("allLocations");return(0,e.useEffect)((()=>
2{if(n&&n.all){let e=[];n.all.forEach((t=>{if(t.address&&t.address.state){-1===e.findIndex((e=>e.state===t.address.state))&&e.push({state:t.address.state,stateFull:null,locations:[]})}})),n.all.forEach((t=>{e.forEach((e=>{e.state===t.address.state&&e.locations.push(t)}))})),e.forEach((e=>{null===ba||void 0===ba||ba.forEach((t=>{t.value===e.state&&(e.stateFull=t.label)}))})),e.sort((function(e,t){return e.stateFull.localeCompare(t.stateFull)})),r(e)}}),[]),(0,Dr.jsx)("div",{className:IS,children:(0,Dr.jsxs)("div",{className:MS,children:[(0,Dr.jsx)("h2",{className:NS,children:"All Locations"}),t&&(0,Dr.jsx)("div",{className:"grid-3 gap_24",children:t.map((e=>(0,Dr.jsxs)(er,{to:e.state.toLowerCase(),className:AS,children:[(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("span",{className:LS,children:e.stateFull})," ",(0,Dr.jsxs)("span",{className:DS,children:["(",e.locations.length,")"]})]}),(0,Dr.jsx)(ka,{})]},e.state)))})]})})};var HS=()=>{const[t,r]=(0,e.useState)(null),n=Ir("allLocations");return(0,e.useEffect)((()=>{n&&n.all&&r(n.all.length)}),[]),(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("span",{className:OS,children:[(0,Dr.jsx)("span",{className:`${DS} ${zS}`,children:t})," stores in United States."]})})};var qS=()=>{const t=Dt();return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,errorElement:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("section",{className:H_,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Page Not Found"}),(0,Dr.jsx)("h3",{className:"text-center",children:"No cookies for you here :( !"})]})}),children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsx)("div",{className:"overflow_container",children:(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(CS,{title:"Dessert Near Me",subtitle:(0,Dr.jsx)(HS,{}),supTitle:"our locations",type:"CNC",styleType:"directory"}),(0,Dr.jsx)(US,{})]})})})})})};async function ZS(e,t){if(null===Ir("allLocations")){return(async()=>{const e=await ir();if(!e&&e.loc)throw new Response("Not Found",{status:404});return Pr("allLocations",{all:e},3600),e})()}return{loc:Ir("allLocations").all}}async function GS(e){let{request:t,params:r}=e;return me({data:ZS()})}var WS=()=>{const[t,r]=(0,e.useState)(null),[n,i]=(0,e.useState)(null),a=wt(),s=Ir("allLocations");return(0,e.useEffect)((()=>{if(s&&s.all&&a&&a.stateName){null===ba||void 0===ba||ba.forEach((e=>{e.value.toLowerCase()===a.stateName&&i(e.label)}));let e=s.all.filter((e=>e.address.state.toLowerCase()===a.stateName));if(e){let t=[];e.forEach((e=>{if(e.address&&e.address.city){var r;if(-1===t.findIndex((t=>t.city===e.address.city)))t.push({city:e.address.city,slug:null===(r=e.address.city.split(" "))||void 0===r?void 0:r.join("_").toLowerCase(),locations:[]})}})),e.forEach((e=>{t.forEach((t=>{t.city===e.address.city&&t.locations.push(e)}))})),t.sort((function(e,t){return e.city.trim().localeCompare(t.city.trim())})),r(t)}}}),[]),(0,Dr.jsx)("div",{className:IS,children:(0,Dr.jsxs)("div",{className:MS,children:[(0,Dr.jsxs)("div",{className:FS,children:[(0,Dr.jsx)(er,{to:"/directory",className:VS,children:"All Stores"}),(0,Dr.jsx)("span",{className:BS,children:(0,Dr.jsx)(ka,{})}),(0,Dr.jsx)("div",{className:$S,children:n})]}),(0,Dr.jsxs)("h2",{className:NS,children:[n," Locations"]}),(0,Dr.jsxs)(Dr.Fragment,{children:[!t&&(0,Dr.jsx)(Dr.Fragment,{children:"No stores found"}),t&&(0,Dr.jsx)("div",{className:"grid-3 gap_24",children:t.map((e=>(0,Dr.jsxs)(er,{to:e.slug,className:AS,children:[(0,Dr.jsxs)("div",{children:[(0,Dr.jsx)("span",{className:LS,children:e.city})," ",(0,Dr.jsxs)("span",{className:DS,children:["(",e.locations.length,")"]})]}),(0,Dr.jsx)(ka,{})]},e.city)))})]})]})})};var XS=()=>{const[t,r]=(0,e.useState)(null),[n,i]=(0,e.useState)(null),a=Ir("allLocations"),s=wt();return(0,e.useEffect)((()=>{if(a&&a.all&&s&&s.stateName){null===ba||void 0===ba||ba.forEach((e=>{e.value.toLowerCase()===s.stateName&&i(e.label)}));let e=a.all.filter((e=>e.address.state.toLowerCase()===s.stateName));e&&r(e.length)}}),[s]),(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("span",{className:OS,children:[(0,Dr.jsx)("span",{className:`${DS} ${zS}`,children:t})," stores in ",n,"."]})})};var JS=()=>{const t=Dt();
2return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,errorElement:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("section",{className:H_,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Page Not Found"}),(0,Dr.jsx)("h3",{className:"text-center",children:"No cookies for you here :( !"})]})}),children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(CS,{title:"Dessert Near Me",subtitle:(0,Dr.jsx)(XS,{}),supTitle:"our locations",type:"CNC"}),(0,Dr.jsx)(WS,{})]})})})})},KS="CityLocation_location__TkjFp",YS="CityLocation_location_inner__O0N8P",QS="CityLocation_title__veoi9",ek="CityLocation_distance__S7uCz",tk="CityLocation_program__x-aE6",rk="CityLocation_program_header__C9QL1",nk="CityLocation_program_header_inner__1f5UI",ik="CityLocation_phone__D9A2k",ak="CityLocation_program_text__8n63S",sk="CityLocation_location_footer__Dk5qs",ok="CityLocation_cobranded_container__PtHPX",lk="CityLocation_cobranded_image__ConmP",ck="CityLocation_cobranded_text__b79jW",uk="CityLocation_loc_hours_trigger__1HP-b",dk="CityLocation_opened__AUOXt",hk="CityLocation_logo__HvLZN",pk="CityLocation_external_link__ki6ft";function mk(e){if(console.log("location:::: ",e),e)return e.attributes&&e.attributes.includes("MSC")?ag:e.attributes&&e.attributes.findIndex((e=>e.includes("CNC")))>=0?(console.log("is a cnc!!!!!!!!!!!!!"),og):sg}var fk=t=>{var r,n,i;let{data:a,deliveryType:o,itemIndex:l}=t;xt();const[c,u]=(0,e.useState)(!1),[d,h]=(0,e.useState)(!1),p=E();y((e=>e.cart.vehicleInfo));let m=y((e=>e.cart.cart));y((e=>e.location.order));const f=null===a||void 0===a||null===(r=a.attributes)||void 0===r?void 0:r.some((e=>"GAC Treatware"===e));null!==m&&void 0===m.id&&p(vs.addCart(Nr("currentCart")));const[g,_]=(0,e.useState)(!1);return(0,Dr.jsxs)(Dr.Fragment,{children:[!a.exempt_store&&(0,Dr.jsxs)("div",{className:`${KS}`,children:[(0,Dr.jsxs)("div",{className:YS,children:[(0,Dr.jsx)("img",{src:mk(a),alt:a.name,className:hk}),a.name&&(0,Dr.jsxs)("div",{className:QS,children:[a.address.street,(0,Dr.jsx)("br",{}),a.address.city,", ",a.address.state,", ",a.address.zip]}),(0,Dr.jsxs)("div",{className:"distance_directions",children:[(0,Dr.jsx)("a",{href:a.address.directions,className:pk,target:"_blank",rel:"noreferrer",children:"Get directions"}),a.distanceFromSearch&&(0,Dr.jsxs)("div",{className:ek,children:["(",a.distanceFromSearch," miles away)"]})]}
2),a.telephone&&(0,Dr.jsxs)("div",{className:ik,children:[(0,Dr.jsx)(ig,{}),(0,Dr.jsx)("div",{className:ak,children:a.telephone})]}),(0,Dr.jsxs)("div",{className:tk,children:[(0,Dr.jsxs)("div",{className:rk,children:[(0,Dr.jsxs)("div",{className:nk,children:[(0,Dr.jsx)(Ks,{}),(0,Dr.jsxs)("div",{className:ak,children:["Open until ",a&&a.hours&&a.hours.business&&a.hours.business[Gi()]&&new Date(null===(n=a.hours.business[Gi()])||void 0===n?void 0:n.end).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})]})]}),(0,Dr.jsxs)("button",{onClick:()=>{_((e=>!e))},className:`${uk} ${g?dk:""}`,children:[(0,Dr.jsx)(ng,{}),(0,Dr.jsx)("span",{className:"sr-only",children:"open location"})]})]}),g&&(0,Dr.jsx)("div",{children:a.hours&&a.hours.business&&(0,Dr.jsx)(pg,{hours:a.hours.business})})]}),f&&(0,Dr.jsx)("p",{className:"online_ordering",children:"This location is not currently accepting online orders"}),!f&&(0,Dr.jsx)("div",{className:sk,children:(0,Dr.jsx)(er,{to:""+("/"+a.slug+"/menu"),className:"btn btn-fit",title:"select this location",children:"Order Now"})})]}),c&&(0,Dr.jsx)(Dr.Fragment,{children:s.createPortal((0,Dr.jsx)("div",{className:"preparing_restaurant",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_backdrop",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_container",children:(0,Dr.jsx)("div",{className:"preparing_restaurant_loader"})})})}),document.getElementById("overlay-root"))})]}),a.exempt_store&&(0,Dr.jsx)(mg,{data:a,children:(0,Dr.jsxs)(fg,{data:a,children:[(0,Dr.jsxs)("div",{className:YS,children:[(0,Dr.jsx)("img",{src:mk(a),alt:a.name,className:hk}),(0,Dr.jsx)("div",{className:QS,children:a.address.full_address}),(a.address.distance||0==a.address.distance)&&(0,Dr.jsxs)("div",{className:ek,children:["(",ia(a.address.distance)," miles away)"]}),a.telephone&&(0,Dr.jsxs)("div",{className:ik,children:[(0,Dr.jsx)(ig,{}),(0,Dr.jsx)("div",{className:ak,children:a.telephone})]}),(0,Dr.jsx)("div",{className:tk,children:(0,Dr.jsx)("div",{className:rk,children:(0,Dr.jsxs)("div",{className:nk,children:[(0,Dr.jsx)(Ks,{}),(0,Dr.jsxs)("div",{className:ak,children:["Open until ",null===(i=a.hours.business[Gi()])||void 0===i?void 0:i.end]})]})})})]}),a.cobranded&&(0,Dr.jsxs)("div",{className:ok,children:[(0,Dr.jsx)("div",{className:lk,children:rg&&(0,Dr.jsx)("img",{src:rg,alt:"cobranded"})}),(0,Dr.jsxs)("div",{className:ck,children:[(0,Dr.jsx)("span",{children:"Co-Branded Store"}),"This store also sells products from ",(0,Dr.jsx)("a",{href:"https://www.marbleslab.com/",rel:"noreferrer",target:"_blank",children:"Marble Slab Creamery"}),"."]})]})]})})]})};var gk=()=>{const[t,r]=(0,e.useState)(null),[n,i]=(0,e.useState)(null),[a,s]=(0,e.useState)(null),o=wt(),l=Ir("allLocations");return(0,e.useEffect)((()=>{if(l&&l.all&&o&&o.stateName&&o.cityName){null===ba||void 0===ba||ba.forEach((e=>{e.value.toLowerCase()===o.stateName&&i(e.label)})),s(o.cityName.split("_").join(" "));let e=l.all.filter((e=>e.address.state.toLowerCase()===o.stateName));if(console.log("stateStore::: ",e),e){let t=e.filter((e=>e.address.city.toLowerCase()===o.cityName.split("_").join(" ")));console.log("cityStore::::: ",t),t&&r(t)}}}),[]),(0,Dr.jsx)("div",{className:IS,children:(0,Dr.jsxs)("div",{className:MS,children:[(0,Dr.jsxs)("div",{className:FS,children:[(0,Dr.jsx)(er,{to:"/directory",className:VS,children:"All Stores"}),(0,Dr.jsx)("span",{className:BS,children:(0,Dr.jsx)(ka,{})}),(0,Dr.jsx)(er,{to:`/directory/${o.stateName}`,className:VS,children:n}),(0,Dr.jsx)("span",{className:BS,children:(0,Dr.jsx)(ka,{})}),(0,Dr.jsx)("div",{className:$S,children:a})]}),(0,Dr.jsxs)("h2",{className:NS,children:[a," Locations"]}),(0,Dr.jsxs)(Dr.Fragment,{children:[!t&&(0,Dr.jsx)(Dr.Fragment,{children:"No stores found"}),t&&(0,Dr.jsx)("div",{className:"grid-3 gap_24",children:t.map((e=>(0,Dr.jsx)(fk,{data:e},e.id)))})]})]})})};var _k=()=>{const[t,r]=(0,e.useState)(null),[n,i]=(0,e.useState)(null),a=Ir("allLocations"),s=wt();return(0,e.useEffect)((()=>{if(a&&a.all&&s&&s.stateName&&s.cityName){i(s.cityName.split("_").join(" "));let e=a.all.filter((e=>e.address.city.toLowerCase()===s.cityName.split("_").join(" ")));e&&r(e.length)}}),[s]),(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("span",{className:OS,children:[(0,Dr.jsx)("span",{className:`${DS} ${zS}`,children:t})," stores in ",(0,Dr.jsx)("span",{className:RS,children:n}),"."]})})};var yk=()=>{const t=Dt();
2return(0,Dr.jsx)(e.Suspense,{fallback:(0,Dr.jsx)($a,{text:""}),children:(0,Dr.jsx)(Vt,{resolve:t.data,errorElement:(0,Dr.jsx)("div",{className:"container-full",children:(0,Dr.jsxs)("section",{className:H_,children:[(0,Dr.jsx)("h1",{className:"text-center",children:"Page Not Found"}),(0,Dr.jsx)("h3",{className:"text-center",children:"No cookies for you here :( !"})]})}),children:()=>(0,Dr.jsx)(Dr.Fragment,{children:(0,Dr.jsxs)("div",{className:"overflow_container",children:[(0,Dr.jsx)(CS,{title:"Dessert Near Me",subtitle:(0,Dr.jsx)(_k,{}),supTitle:"our locations",type:"CNC"}),(0,Dr.jsx)(gk,{})]})})})})};function vk(){const e=(t=[{path:"/",element:(0,Dr.jsx)(U_,{}),errorElement:(0,Dr.jsx)(q_,{}),children:[{index:!0,element:(0,Dr.jsx)(Ga,{}),loader:Wa},{path:"/cnc",element:(0,Dr.jsx)(cC,{})},{path:"/msc",element:(0,Dr.jsx)(cC,{})},{path:"/gac",element:(0,Dr.jsx)(cC,{})},{path:"locations",element:(0,Dr.jsx)(PS,{})},{path:"directory",children:[{index:!0,element:(0,Dr.jsx)(qS,{}),loader:GS},{path:":stateName",element:(0,Dr.jsx)(JS,{}),loader:GS},{path:":stateName/:cityName",element:(0,Dr.jsx)(yk,{}),loader:GS}]},{path:"rewards-migration",element:(0,Dr.jsx)(SS,{})},{path:"rewards-migration/token",element:(0,Dr.jsx)(kS,{})},{path:"/co-marble-slab-creamery/:locationSlug",children:[{index:!0,element:(0,Dr.jsx)(sC,{}),loader:lC},{path:":categoryId",element:(0,Dr.jsx)(Sy,{}),loader:lC},{path:"product/:productSlug",element:(0,Dr.jsx)(ex,{}),loader:lC},{path:"create/:productSlug",element:(0,Dr.jsx)(aC,{}),loader:lC}]},{path:"/marble-slab-creamery/:locationSlug",children:[{index:!0,element:(0,Dr.jsx)(sC,{}),loader:lC},{path:":categoryId",element:(0,Dr.jsx)(Sy,{}),loader:lC},{path:"product/:productSlug",element:(0,Dr.jsx)(ex,{}),loader:lC},{path:"create/:productSlug",element:(0,Dr.jsx)(aC,{}),loader:lC}]},{path:"/gac/:locationSlug",children:[{index:!0,element:(0,Dr.jsx)(sC,{}),loader:lC},{path:":categoryId",element:(0,Dr.jsx)(Sy,{}),loader:lC},{path:"product/:productSlug",element:(0,Dr.jsx)(ex,{}),loader:lC},{path:"create/:productSlug",element:(0,Dr.jsx)(aC,{}),loader:lC}]},{path:"/:locationSlug/menu",children:[{index:!0,element:(0,Dr.jsx)(uC,{}),loader:hC},{path:":categoryId",element:(0,Dr.jsx)(Sy,{}),loader:hC},{path:"product/:productSlug",element:(0,Dr.jsx)(ex,{}),loader:hC},{path:"create/:productSlug",element:(0,Dr.jsx)(aC,{}),loader:hC}]},{path:"signin",element:(0,Dr.jsx)(jC,{})},{path:"account",children:[{index:!0,element:(0,Dr.jsx)(CC,{}),loader:kC},{path:"edit",element:(0,Dr.jsx)(PC,{}),loader:kC},{path:"favorites",element:(0,Dr.jsx)(GC,{}),loader:kC},{path:"recent",element:(0,Dr.jsx)(KC,{}),loader:kC},{path:"rewards",element:(0,Dr.jsx)(pS,{}),loader:kC}]},{path:"order/:orderId",element:(0,Dr.jsx)(sS,{}),loader:lS}]}],Pe({basename:null==r?void 0:r.basename,future:Gt({},null==r?void 0:r.future,{v7_prependBasename:!0}),history:N({window:null==r?void 0:r.window}),hydrationData:(null==r?void 0:r.hydrationData)||Jt(),routes:t,mapRouteProperties:Zt}).initialize());var t,r;return(0,Dr.jsx)(Ot,{router:e})}r.n(mS)().initialize({gtmId:"GTM-TDTC8Z9"});var xk=function(){return(0,Dr.jsx)("div",{className:"App",children:(0,Dr.jsx)(vk,{})})};const bk=Ii({name:"counter",initialState:{counter:0,showCounter:!0},reducers:{increment(e){e.counter++},decrement(e){e.counter--},increase(e,t){e.counter=e.counter+t.payload}}});bk.actions;const wk=function(e){var t,r=Ei(),n=e||{},i=n.reducer,a=void 0===i?void 0:i,s=n.middleware,o=void 0===s?r():s,l=n.devTools,c=void 0===l||l,u=n.preloadedState,d=void 0===u?void 0:u,h=n.enhancers,p=void 0===h?void 0:h;if("function"===typeof a)t=a;else{if(!Ci(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=ni(a)}var m=o;"function"===typeof m&&(m=m(r));var f=ai.apply(void 0,m),g=ii;c&&(g=wi(vi({trace:!1},"object"===typeof c&&c)));var _=new ki(f),y=_;return Array.isArray(p)?y=di([f],p):"function"===typeof p&&(y=p(_)),ri(t,d,g.apply(void 0,y))}({reducer:{counter:bk.reducer,auth:qa,location:$i,cart:xs,virtualCart:ym,various:Zi,product:Mx,productDetails:Oc}});var Ck=wk;n.createRoot(document.getElementById("root")).render((0,Dr.jsx)(e.
2StrictMode,{children:(0,Dr.jsx)(C,{store:Ck,children:(0,Dr.jsx)(xk,{})})}))}()}(); 3//# sourceMappingURL=main.bdf7605c.js.map
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.